[swift] Swift Presentr의 사용자 인터페이스 디자인 가이드라인
소개
Swift Presentr은 iOS 앱에서 사용되는 사용자 인터페이스 라이브러리입니다. 이 라이브러리는 사용자에게 모달창을 제공하고, 동적으로 제어할 수 있는 기능을 제공합니다. 따라서 사용자 경험을 향상시키고 앱의 사용성을 개선할 수 있습니다.
디자인 가이드라인
Swift Presentr를 사용할 때 다음과 같은 디자인 가이드라인을 준수해야 합니다:
-
모달 창 디자인: 모달 창은 앱의 일관성을 유지해야 합니다. 따라서 앱의 전반적인 디자인 원칙과 일치하도록 모달 창의 배경색, 텍스트 스타일, 버튼 스타일 등을 설정해야 합니다.
-
애니메이션 효과: Swift Presentr는 모달 창을 보여주거나 감추는 시각적인 효과를 제공합니다. 애니메이션 효과를 사용할 때는 앱의 디자인 스타일과 일관성을 유지해야 합니다. 부드럽고 자연스러운 애니메이션 효과를 사용하여 사용자에게 편안한 경험을 제공해야 합니다.
-
버튼 배치: 모달 창에는 종종 버튼이 포함되어 있습니다. 이때 버튼의 배치와 디자인은 사용성을 고려해야 합니다. 버튼의 크기와 위치는 사용자가 쉽게 인식하고 터치할 수 있어야 합니다.
-
텍스트 및 라벨: 모달 창에는 사용자에게 정보나 메시지를 전달하는 텍스트와 라벨이 포함될 수 있습니다. 이때 텍스트와 라벨은 가독성이 좋아야 하며, 사용자가 쉽게 이해할 수 있도록 해야 합니다.
예제 코드
import Presentr
func showCustomModal() {
let customPresenter = Presentr(presentationType: .custom(width: .fluid(percentage: 0.8), height: .default))
let customVC = CustomViewController()
customPresenter.presentationController?.transitionType = .coverVertical
customPresenter.dismissOnSwipe = true
customPresenter.roundCorners = true
customPresenter.backgroundColor = .white
customPresenter.backgroundOpacity = 0.5
customVC.customPresenter = customPresenter
customVC.titleText = "Custom Modal"
customVC.messageText = "This is a custom modal view"
customVC.addAction(title: "OK", style: .default) {
// Handle OK button tap
}
customVC.addAction(title: "Cancel", style: .cancel) {
// Handle Cancel button tap
}
present(customVC, animated: true, completion: nil)
}
참고 자료
Swift Presentr를 사용하여 모달 창을 디자인할 때는 앱의 일관성을 유지하고 사용자 경험을 개선하기 위해 위의 가이드라인을 따라야 합니다.