-
Notifications
You must be signed in to change notification settings - Fork 1
[FEAT] 2.0 알럿 UI (#146) #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
yurim830
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다 :D
| // NOTE: - 알럿에 자주 사용되는 액션 클로저 | ||
|
|
||
| static let openSettings = { | ||
| guard let settingsURL = URL(string: UIApplication.openSettingsURLString), | ||
| UIApplication.shared.canOpenURL(settingsURL) else { return } | ||
| UIApplication.shared.open(settingsURL, options: [:], completionHandler: nil) | ||
| } | ||
|
|
||
| static let goToTabBar = { | ||
| if let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate { | ||
| sceneDelegate.window?.rootViewController = ACTabBarController() | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
센스짱!!
| case locationAccessDenied // 위치 권한 X | ||
| case locationAccessFail // 위치 인식 실패 - 외국, GPS 지원 공간 X | ||
|
|
||
| case reviewLocationFail // 리뷰 위치 인증 실패 | ||
|
|
||
| case libraryAccessDenied // 사진 권한 X | ||
| case changeNotSaved // 프로필 변경사항 저장 X | ||
|
|
||
| case changeVerifiedArea // 지역인증 변경 (지역 1개) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐿️ NOTE: 추가해주시면 좋을 것 같아요!
cirtuare
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yurim830
(5/20 14:38 변경사항) CustomAlert -> ACAlert으로 모두 네이밍 변경했습니다! presentACAlert으로 사용해주시면 됩니당 ~
🐿️ Pull Requests
🪵 작업 브랜치
🥔 작업 내용
2.0 알럿 UI를 작업했습니다.
🚨 참고 사항
구조를 대폭 개선하였습니다 ! 아래는 대략적인 설명이니 코드와 함께 읽어보시고 혹시라도 헷갈리는 부분이 있다면 리뷰 남겨주세요 ~
개요
기존의 AlertHandler을 삭제하고, 실제 알럿을 띄우는 메소드는 UIViewController+ 에
presentACAlert으로 정의해두었습니다.버튼 하나만 길게 있는 알럿 : longAction ( ACAlertView.longButton에 적용 )
왼쪽 버튼, 오른쪽 버튼이 있는 알럿: leftAction ( ACAlertView.leftButton에 적용) / rightAction ( ACAlertView.rightButton에 적용)
각 알럿 타입에 해당하는 액션 클로저만 적용해주시면 되며, 액션 클로저를 따로 넣지 않을 경우 단순 알럿 dismiss가 적용됩니다 !
사용방법
title을 제외한 모든 프로퍼티의 default 값은 nil이므로, 추가하는 case에 해당하는 프로퍼티만 정의해주세요 !
액션 클로저 객체를 먼저 정의한 후, presentACAlert 중 원하는 버튼 액션 프로퍼티 ( longAction / leftAction / rightAction) 프로퍼티에 정의한 객체를 할당
*자주 사용되는 액션 클로저 객체들은
ACAlertActionType에 정의해두었습니다!사용 :
self.presentACAlert(.changeVerifiedArea, rightAction: ACAlertActionType.openSettings)📸 스크린샷
💥 To be sure
🌰 Resolve issue