@@ -63,7 +63,6 @@ - (SFSafariViewController *)safariController:(NSString *)url withEntersReaderIfA
6363{
6464 if (_safariController == nil ) {
6565 NSURL *safariURL = [NSURL URLWithString: [url stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding]];
66- #if IS_IOS_11
6766 if (@available (iOS 11.0 , *)) {
6867 SFSafariViewControllerConfiguration *config = [[SFSafariViewControllerConfiguration alloc ] init ];
6968 config.entersReaderIfAvailable = entersReaderIfAvailable;
@@ -72,12 +71,9 @@ - (SFSafariViewController *)safariController:(NSString *)url withEntersReaderIfA
7271 _safariController = [[SFSafariViewController alloc ] initWithURL: safariURL
7372 configuration: config];
7473 } else {
75- #endif
7674 _safariController = [[SFSafariViewController alloc ] initWithURL: safariURL
7775 entersReaderIfAvailable: entersReaderIfAvailable];
78- #if IS_IOS_11
7976 }
80- #endif
8177
8278 [_safariController setDelegate: self ];
8379 }
@@ -115,7 +111,7 @@ - (NSNumber *)isOpen:(id)unused
115111
116112- (NSNumber *)isSupported : (id )unused
117113{
118- return NUMBOOL ([TiUtils isIOS9OrGreater ]);
114+ return NUMBOOL ([TiUtils isIOSVersionOrGreater: @" 9.0 " ]);
119115}
120116
121117- (void )close : (id )unused
@@ -144,9 +140,7 @@ - (void)open:(id)args
144140 BOOL entersReaderIfAvailable = [TiUtils boolValue: @" entersReaderIfAvailable" properties: args def: YES ];
145141 BOOL barCollapsingEnabled = NO ;
146142
147- #if IS_IOS_11
148143 barCollapsingEnabled = [TiUtils boolValue: @" barCollapsingEnabled" properties: args def: YES ];
149- #endif
150144
151145 SFSafariViewController *safari = [self safariController: _url withEntersReaderIfAvailable: entersReaderIfAvailable andBarCollapsingEnabled: barCollapsingEnabled];
152146
@@ -157,30 +151,28 @@ - (void)open:(id)args
157151 if ([args objectForKey: @" tintColor" ]) {
158152 TiColor *newColor = [TiUtils colorValue: @" tintColor" properties: args];
159153
160- if ([TiUtils isIOS10OrGreater ]) {
154+ if ([TiUtils isIOSVersionOrGreater: @" 10.0 " ]) {
161155 [safari setPreferredControlTintColor: [newColor _color ]];
162156 } else {
163157 [[safari view ] setTintColor: [newColor _color ]];
164158 }
165159 }
166160
167161 if ([args objectForKey: @" barColor" ]) {
168- if ([TiUtils isIOS10OrGreater ]) {
162+ if ([TiUtils isIOSVersionOrGreater: @" 10.0 " ]) {
169163 [safari setPreferredBarTintColor: [[TiUtils colorValue: @" barColor" properties: args] _color ]];
170164 } else {
171165 NSLog (@" [ERROR] Ti.WebDialog: The barColor property is only available in iOS 10 and later" );
172166 }
173167 }
174168
175- #if IS_IOS_11
176169 if ([args objectForKey: @" dismissButtonStyle" ]) {
177170 if (@available (iOS 11.0 , *)) {
178171 [safari setDismissButtonStyle: [TiUtils intValue: @" dismissButtonStyle" properties: args def: SFSafariViewControllerDismissButtonStyleDone]];
179172 } else {
180173 NSLog (@" [ERROR] Ti.WebDialog: The dismissButtonStyle property is only available in iOS 11 and later" );
181174 }
182175 }
183- #endif
184176
185177 [[TiApp app ] showModalController: safari
186178 animated: animated];
@@ -198,10 +190,8 @@ - (void)open:(id)args
198190
199191#pragma mark Constants
200192
201- #if IS_IOS_11
202193MAKE_SYSTEM_PROP (DISMISS_BUTTON_STYLE_DONE, SFSafariViewControllerDismissButtonStyleDone);
203194MAKE_SYSTEM_PROP (DISMISS_BUTTON_STYLE_CLOSE, SFSafariViewControllerDismissButtonStyleClose);
204195MAKE_SYSTEM_PROP (DISMISS_BUTTON_STYLE_CANCEL, SFSafariViewControllerDismissButtonStyleCancel);
205- #endif
206196
207197@end
0 commit comments