SlideShare uma empresa Scribd logo
1 de 29
Baixar para ler offline
1 
Popups, alerts 
and windows 
Kanstantsin Charnukha 
iOS developer
2 
Goal 
• Fullscreen popup 
• Overlaps status 
bar 
• Customizable 
button color 
• Customizable 
button title color
3 
Customizable transition animations
4 
Custom popup VS UIAlertView
5 
Customization items 
1. Corners 
2. Highlighted button color 
3. Cancel button title color 
4. Transition animations
6 
UIAlertView сustomization by using 
its properties 
1. Corners 
2. Highlighted button color 
3. Cancel button title color 
4. Transition animations
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 
UIAlertView сustomization by 
subclassing 
- (void)show 
- (void)drawRect:(CGRect)rect 
1. Corners 
2. Highlighted button color 
3. Cancel button title color 
4. Transition animations
9 
Subclassing sample 
• Simple 
• Keeps UIAlertView 
behavior 
• Fragile 
• Inflexible 
• Limited 
WCAlertView: https://github.com/m1entus/WCAlertView
10 
Custom UIView 
1. Corners 
2. Highlighted button color 
3. Cancel button title color 
4. Transition animations 
• Status bar 
• showInView:
11 
Custom UIView + keyWindow 
1. Corners 
2. Highlighted button color 
3. Cancel button title color 
4. Transition animations 
• Status bar 
• show 
• Device rotation
12 
Key Window Sample 
• Status bar 
• Custom transitions 
• Flexible 
• Rotation 
• Multiple views 
presentation 
JKProgressHUD: https://bitbucket.org/kluivers/jkprogresshud
UIView + UIWindow + UIViewController 
1. Corners 
2. Highlighted button color 
3. Cancel button title color 
4. Transition animations 
13 
• Status bar 
• show 
• Device rotation
14 
Requisites 
1. UIWindow + UIWindowLevelAlert 
2. Root UIViewController = custom 
container 
3. Alert UIViewController 
4. AlertView 
5. Singleton = window controller 
6. Duck typing
15 
1. UIWindow + UIWindowLevelAlert 
- (UIWindow *)window 
{ 
if (_window == nil) { 
_window = 
[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] 
bounds]]; 
_window.windowLevel = UIWindowLevelAlert; 
_window.opaque = NO; 
_window.autoresizingMask = UIViewAutoresizingFlexibleWidth | 
UIViewAutoresizingFlexibleHeight; 
[_window setRootViewController:[self rootViewController]]; 
} 
return _window; 
} 
Requisites
16 
2. Root UIViewController 
- (MyAlertRootViewController *)rootViewController 
{ 
if (_rootViewController == nil) { 
_rootViewController = [[MyAlertRootViewController alloc] init]; 
_rootViewController.delegate = self; 
} 
return _rootViewController; 
} 
Requisites
17 
3. Alert UIViewController 
4. AlertView 
// MyAlertView 
- (void)show 
{ 
[[MyAlertsController sharedInstance] showAlert:self animated:YES]; 
} 
- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex 
animated:(BOOL)animated 
{ 
[[MyAlertsController sharedInstance] dissmissAlert:self 
animated:animated]; 
} 
Requisites
18 
5. Singleton (window controller) 
- (void)showAlert:(UIView<MyTransitionDelegate> *)alertView 
animated:(BOOL)animated 
{ 
[self.window setHidden:NO]; 
MyAlertViewController *viewController = 
[[MyAlertViewController alloc] init]; 
viewController.alertView = alertView; 
[self.rootViewController displayViewController:viewController 
animated:animated]; 
} 
Requisites
19 
Requisites 
6. Duck typing 
- (id)initWithTitle:(NSString *)title 
message:(NSString *)message 
delegate:(id<MyAlertViewDelegate>)delegate 
cancelButtonTitle:(NSString *)cancelButtonTitle 
otherButtonTitles:(NSString *)otherButtonTitles, ... 
NS_REQUIRES_NIL_TERMINATION; 
- (void)show; 
- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated: 
(BOOL)animated; 
- (NSInteger)addButtonWithTitle:(NSString *)title; 
- (NSString *)buttonTitleAtIndex:(NSInteger)buttonIndex;
20 
Examples
21 
Examples
22 
Examples
23 
Problems solved 
• Corners 
MyAlertView.layer.cornerRadius 
• Highlighted button color 
[UIButton setImage:forState:] 
• Cancel button title color 
setCancelButtonTitleColor: 
• Transition animations 
[MyAlertViewController showAnimated:completion] 
• Rotation 
Automatically by UIViewControllers
24 
Advanced problems 
• Multiple alerts simultaneously 
• Transition events 
• Interaction with system UIAlertView
25 
Demo 
Multiple alerts
26 
Multiple alerts simultaneous 
display 
• Alert displayed + show = 
dismiss + display 
• Running transition + show/hide = 
add transition to wait queue
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 
Interaction with UIAlertView 
• UIWindowDidBecomeVisible 
• UIWindowDidBecomeHidden 
• UIWindowDidBecomeKey 
• UIWindowDidResignKey 
• What should be done on 
receiving notifications?
29 
Kanstantsin Charnukha 
iOS developer 
xardas@yandex-team.ru 
Thank you

Mais conteúdo relacionado

Mais procurados

Taming forms with React
Taming forms with ReactTaming forms with React
Taming forms with ReactGreeceJS
 
Modern Android Architecture
Modern Android ArchitectureModern Android Architecture
Modern Android ArchitectureEric Maxwell
 
FLTK Summer Course - Part VI - Sixth Impact - Exercises
FLTK Summer Course - Part VI - Sixth Impact - ExercisesFLTK Summer Course - Part VI - Sixth Impact - Exercises
FLTK Summer Course - Part VI - Sixth Impact - ExercisesMichel Alves
 
Effective Android Data Binding
Effective Android Data BindingEffective Android Data Binding
Effective Android Data BindingEric Maxwell
 
Keyboard Access APIs
Keyboard Access APIsKeyboard Access APIs
Keyboard Access APIstoddkloots
 
UITableView Pain Points
UITableView Pain PointsUITableView Pain Points
UITableView Pain PointsKen Auer
 

Mais procurados (9)

Taming forms with React
Taming forms with ReactTaming forms with React
Taming forms with React
 
I os 03
I os 03I os 03
I os 03
 
Modern Android Architecture
Modern Android ArchitectureModern Android Architecture
Modern Android Architecture
 
FLTK Summer Course - Part VI - Sixth Impact - Exercises
FLTK Summer Course - Part VI - Sixth Impact - ExercisesFLTK Summer Course - Part VI - Sixth Impact - Exercises
FLTK Summer Course - Part VI - Sixth Impact - Exercises
 
Bd venta.sql
Bd venta.sqlBd venta.sql
Bd venta.sql
 
Effective Android Data Binding
Effective Android Data BindingEffective Android Data Binding
Effective Android Data Binding
 
Keyboard Access APIs
Keyboard Access APIsKeyboard Access APIs
Keyboard Access APIs
 
Android
AndroidAndroid
Android
 
UITableView Pain Points
UITableView Pain PointsUITableView Pain Points
UITableView Pain Points
 

Semelhante a Константин Чернухо_Popups, alerts and windows

Leaving Interface Builder Behind
Leaving Interface Builder BehindLeaving Interface Builder Behind
Leaving Interface Builder BehindJohn Wilker
 
MOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentMOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentanistar sung
 
Heat on Wed.(ヒートオンウェンズディ)! Vol.1
Heat on Wed.(ヒートオンウェンズディ)! Vol.1Heat on Wed.(ヒートオンウェンズディ)! Vol.1
Heat on Wed.(ヒートオンウェンズディ)! Vol.1Noriyuki Nonomura
 
Migrating Objective-C to Swift
Migrating Objective-C to SwiftMigrating Objective-C to Swift
Migrating Objective-C to SwiftElmar Kretzer
 
iOS for C# Developers - DevConnections Talk
iOS for C# Developers - DevConnections TalkiOS for C# Developers - DevConnections Talk
iOS for C# Developers - DevConnections TalkMiguel de Icaza
 
iOS Development: What's New
iOS Development: What's NewiOS Development: What's New
iOS Development: What's NewNascentDigital
 
Intro to UIKit • Made by Many
Intro to UIKit • Made by ManyIntro to UIKit • Made by Many
Intro to UIKit • Made by Manykenatmxm
 
Building Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice NinjaBuilding Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice NinjaDroidConTLV
 
The Ring programming language version 1.7 book - Part 76 of 196
The Ring programming language version 1.7 book - Part 76 of 196The Ring programming language version 1.7 book - Part 76 of 196
The Ring programming language version 1.7 book - Part 76 of 196Mahmoud Samir Fayed
 
Everything You (N)ever Wanted to Know about Testing View Controllers
Everything You (N)ever Wanted to Know about Testing View ControllersEverything You (N)ever Wanted to Know about Testing View Controllers
Everything You (N)ever Wanted to Know about Testing View ControllersBrian Gesiak
 
Formacion en movilidad: Conceptos de desarrollo en iOS (II)
Formacion en movilidad: Conceptos de desarrollo en iOS (II) Formacion en movilidad: Conceptos de desarrollo en iOS (II)
Formacion en movilidad: Conceptos de desarrollo en iOS (II) Mobivery
 
iPhoneOS3.1でのカメラAPIについて
iPhoneOS3.1でのカメラAPIについてiPhoneOS3.1でのカメラAPIについて
iPhoneOS3.1でのカメラAPIについてKyosuke Takayama
 
The Ring programming language version 1.8 book - Part 78 of 202
The Ring programming language version 1.8 book - Part 78 of 202The Ring programming language version 1.8 book - Part 78 of 202
The Ring programming language version 1.8 book - Part 78 of 202Mahmoud Samir Fayed
 
Window object methods (timer related)
Window object methods (timer related)Window object methods (timer related)
Window object methods (timer related)Shivani Thakur Daxini
 
The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180Mahmoud Samir Fayed
 

Semelhante a Константин Чернухо_Popups, alerts and windows (20)

I os 11
I os 11I os 11
I os 11
 
Leaving Interface Builder Behind
Leaving Interface Builder BehindLeaving Interface Builder Behind
Leaving Interface Builder Behind
 
MOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentMOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app development
 
IOS Storyboards
IOS StoryboardsIOS Storyboards
IOS Storyboards
 
Heat on Wed.(ヒートオンウェンズディ)! Vol.1
Heat on Wed.(ヒートオンウェンズディ)! Vol.1Heat on Wed.(ヒートオンウェンズディ)! Vol.1
Heat on Wed.(ヒートオンウェンズディ)! Vol.1
 
201104 iphone navigation-based apps
201104 iphone navigation-based apps201104 iphone navigation-based apps
201104 iphone navigation-based apps
 
Migrating Objective-C to Swift
Migrating Objective-C to SwiftMigrating Objective-C to Swift
Migrating Objective-C to Swift
 
iOS for C# Developers - DevConnections Talk
iOS for C# Developers - DevConnections TalkiOS for C# Developers - DevConnections Talk
iOS for C# Developers - DevConnections Talk
 
iOS Development: What's New
iOS Development: What's NewiOS Development: What's New
iOS Development: What's New
 
iOS
iOSiOS
iOS
 
Intro to UIKit • Made by Many
Intro to UIKit • Made by ManyIntro to UIKit • Made by Many
Intro to UIKit • Made by Many
 
Building Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice NinjaBuilding Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice Ninja
 
The Ring programming language version 1.7 book - Part 76 of 196
The Ring programming language version 1.7 book - Part 76 of 196The Ring programming language version 1.7 book - Part 76 of 196
The Ring programming language version 1.7 book - Part 76 of 196
 
занятие6
занятие6занятие6
занятие6
 
Everything You (N)ever Wanted to Know about Testing View Controllers
Everything You (N)ever Wanted to Know about Testing View ControllersEverything You (N)ever Wanted to Know about Testing View Controllers
Everything You (N)ever Wanted to Know about Testing View Controllers
 
Formacion en movilidad: Conceptos de desarrollo en iOS (II)
Formacion en movilidad: Conceptos de desarrollo en iOS (II) Formacion en movilidad: Conceptos de desarrollo en iOS (II)
Formacion en movilidad: Conceptos de desarrollo en iOS (II)
 
iPhoneOS3.1でのカメラAPIについて
iPhoneOS3.1でのカメラAPIについてiPhoneOS3.1でのカメラAPIについて
iPhoneOS3.1でのカメラAPIについて
 
The Ring programming language version 1.8 book - Part 78 of 202
The Ring programming language version 1.8 book - Part 78 of 202The Ring programming language version 1.8 book - Part 78 of 202
The Ring programming language version 1.8 book - Part 78 of 202
 
Window object methods (timer related)
Window object methods (timer related)Window object methods (timer related)
Window object methods (timer related)
 
The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180
 

Mais de GeeksLab Odessa

DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...
DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...
DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...GeeksLab Odessa
 
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...GeeksLab Odessa
 
DataScience Lab 2017_Блиц-доклад_Турский Виктор
DataScience Lab 2017_Блиц-доклад_Турский ВикторDataScience Lab 2017_Блиц-доклад_Турский Виктор
DataScience Lab 2017_Блиц-доклад_Турский ВикторGeeksLab Odessa
 
DataScience Lab 2017_Обзор методов детекции лиц на изображение
DataScience Lab 2017_Обзор методов детекции лиц на изображениеDataScience Lab 2017_Обзор методов детекции лиц на изображение
DataScience Lab 2017_Обзор методов детекции лиц на изображениеGeeksLab Odessa
 
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...GeeksLab Odessa
 
DataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладDataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладGeeksLab Odessa
 
DataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладDataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладGeeksLab Odessa
 
DataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладDataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладGeeksLab Odessa
 
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...GeeksLab Odessa
 
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...GeeksLab Odessa
 
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко GeeksLab Odessa
 
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...GeeksLab Odessa
 
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...GeeksLab Odessa
 
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...GeeksLab Odessa
 
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...GeeksLab Odessa
 
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...GeeksLab Odessa
 
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...GeeksLab Odessa
 
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот GeeksLab Odessa
 
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...GeeksLab Odessa
 
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js GeeksLab Odessa
 

Mais de GeeksLab Odessa (20)

DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...
DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...
DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...
 
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...
 
DataScience Lab 2017_Блиц-доклад_Турский Виктор
DataScience Lab 2017_Блиц-доклад_Турский ВикторDataScience Lab 2017_Блиц-доклад_Турский Виктор
DataScience Lab 2017_Блиц-доклад_Турский Виктор
 
DataScience Lab 2017_Обзор методов детекции лиц на изображение
DataScience Lab 2017_Обзор методов детекции лиц на изображениеDataScience Lab 2017_Обзор методов детекции лиц на изображение
DataScience Lab 2017_Обзор методов детекции лиц на изображение
 
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...
 
DataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладDataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-доклад
 
DataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладDataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-доклад
 
DataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладDataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-доклад
 
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...
 
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...
 
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко
 
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...
 
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...
 
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...
 
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...
 
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...
 
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...
 
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот
 
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...
 
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js
 

Último

Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Niamh verma
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Pooja Nehwal
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7Pooja Nehwal
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceanilsa9823
 
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRnishacall1
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceanilsa9823
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...wyqazy
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPsychicRuben LoveSpells
 

Último (9)

Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
 
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
 

Константин Чернухо_Popups, alerts and windows

  • 1. 1 Popups, alerts and windows Kanstantsin Charnukha iOS developer
  • 2. 2 Goal • Fullscreen popup • Overlaps status bar • Customizable button color • Customizable button title color
  • 4. 4 Custom popup VS 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
  • 9. 9 Subclassing sample • Simple • Keeps UIAlertView behavior • Fragile • Inflexible • Limited WCAlertView: https://github.com/m1entus/WCAlertView
  • 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
  • 12. 12 Key Window Sample • Status bar • Custom transitions • Flexible • Rotation • Multiple views presentation JKProgressHUD: https://bitbucket.org/kluivers/jkprogresshud
  • 13. UIView + UIWindow + UIViewController 1. Corners 2. Highlighted button color 3. Cancel button title color 4. Transition animations 13 • Status bar • show • Device rotation
  • 14. 14 Requisites 1. UIWindow + UIWindowLevelAlert 2. Root UIViewController = custom container 3. Alert UIViewController 4. AlertView 5. Singleton = window controller 6. Duck typing
  • 15. 15 1. UIWindow + UIWindowLevelAlert - (UIWindow *)window { if (_window == nil) { _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; _window.windowLevel = UIWindowLevelAlert; _window.opaque = NO; _window.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [_window setRootViewController:[self rootViewController]]; } return _window; } Requisites
  • 16. 16 2. Root UIViewController - (MyAlertRootViewController *)rootViewController { if (_rootViewController == nil) { _rootViewController = [[MyAlertRootViewController alloc] init]; _rootViewController.delegate = self; } return _rootViewController; } Requisites
  • 17. 17 3. Alert UIViewController 4. AlertView // MyAlertView - (void)show { [[MyAlertsController sharedInstance] showAlert:self animated:YES]; } - (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated { [[MyAlertsController sharedInstance] dissmissAlert:self animated:animated]; } Requisites
  • 18. 18 5. Singleton (window controller) - (void)showAlert:(UIView<MyTransitionDelegate> *)alertView animated:(BOOL)animated { [self.window setHidden:NO]; MyAlertViewController *viewController = [[MyAlertViewController alloc] init]; viewController.alertView = alertView; [self.rootViewController displayViewController:viewController animated:animated]; } Requisites
  • 19. 19 Requisites 6. Duck typing - (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id<MyAlertViewDelegate>)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION; - (void)show; - (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated: (BOOL)animated; - (NSInteger)addButtonWithTitle:(NSString *)title; - (NSString *)buttonTitleAtIndex:(NSInteger)buttonIndex;
  • 23. 23 Problems solved • Corners MyAlertView.layer.cornerRadius • Highlighted button color [UIButton setImage:forState:] • Cancel button title color setCancelButtonTitleColor: • Transition animations [MyAlertViewController showAnimated:completion] • Rotation Automatically by UIViewControllers
  • 24. 24 Advanced problems • Multiple alerts simultaneously • Transition events • Interaction with system UIAlertView
  • 26. 26 Multiple alerts simultaneous display • Alert displayed + show = dismiss + display • Running transition + show/hide = add transition to wait queue
  • 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?
  • 29. 29 Kanstantsin Charnukha iOS developer xardas@yandex-team.ru Thank you