Popups, alerts and windows
Константин Чернухо
Яндекс Беларусь
Как красиво и безболезненно создать кастомный попап на iOS на основе UIWindow, и при этом не иметь проблем с вращением девайса. Особенности поведения UIAlertView. Как сделать поведение кастомного попапа идентичным системному. Все это рассматривается в контексте существующих готовых сторонних решений, их плюсов и минусов.
5. 5
Customization items
1. Corners
2. Highlighted button color
3. Cancel button title color
4. Transition animations
6. 6
UIAlertView сustomization by using
its properties
1. Corners
2. Highlighted button color
3. Cancel button title color
4. Transition animations
7. 7
UIAlertView сustomization by using
UIAppearance
UI_APPEARANCE_SELECTOR: NONE
1. Corners
2. Highlighted button color
3. Cancel button title color
4. Transition animations
8. 8
UIAlertView сustomization by
subclassing
- (void)show
- (void)drawRect:(CGRect)rect
1. Corners
2. Highlighted button color
3. Cancel button title color
4. Transition animations
10. 10
Custom UIView
1. Corners
2. Highlighted button color
3. Cancel button title color
4. Transition animations
• Status bar
• showInView:
11. 11
Custom UIView + keyWindow
1. Corners
2. Highlighted button color
3. Cancel button title color
4. Transition animations
• Status bar
• show
• Device rotation
13. UIView + UIWindow + UIViewController
1. Corners
2. Highlighted button color
3. Cancel button title color
4. Transition animations
13
• Status bar
• show
• Device rotation
27. 27
Transition events
1. Will Present
2. Did Present
3. Will Present
4. Did Present
5. Will Dismiss
6. Did Present
7. Did Dismiss
8. Will Dismiss
9. Did Dismiss
28. 28
Interaction with UIAlertView
• UIWindowDidBecomeVisible
• UIWindowDidBecomeHidden
• UIWindowDidBecomeKey
• UIWindowDidResignKey
• What should be done on
receiving notifications?