@@ -257,9 +257,8 @@ extension SiteDetailViewController {
257
257
258
258
@IBAction func gotoSiteSettings( sender: UIBarButtonItem) {
259
259
260
- let alertController = UIAlertController ( title: Constants . LocalizedString. uiAlertScreenOverrideTitle. localized, message: Constants . LocalizedString. uiAlertScreenOverrideMessage. localized, preferredStyle: UIAlertControllerStyle . ActionSheet)
260
+ let alertController = UIAlertController ( title: Constants . LocalizedString. uiAlertScreenOverrideTitle. localized, message: Constants . LocalizedString. uiAlertScreenOverrideMessage. localized, preferredStyle: . ActionSheet)
261
261
262
- alertController. view. tintColor = NSAssetKit . darkNavColor
263
262
264
263
let cancelAction = UIAlertAction ( title: Constants . LocalizedString. generalCancelLabel. localized, style: . Cancel) { ( action) in
265
264
#if DEBUG
@@ -273,26 +272,44 @@ extension SiteDetailViewController {
273
272
if site!. overrideScreenLock == true {
274
273
yesString = checkEmoji
275
274
}
276
- let yesAction = UIAlertAction ( title: " \( yesString) \( Constants . LocalizedString. generalYesLabel. localized) " , style: UIAlertActionStyle . Default) { ( action) -> Void in
275
+
276
+ let yesAction = UIAlertAction ( title: " \( yesString) \( Constants . LocalizedString. generalYesLabel. localized) " , style: . Default) { ( action) -> Void in
277
277
self . updateScreenOverride ( true )
278
278
#if DEBUG
279
279
print ( " Yes action: \( action) " )
280
280
#endif
281
281
}
282
+
282
283
alertController. addAction ( yesAction)
284
+
285
+ if #available( iOS 9 . 0 , * ) {
286
+ alertController. preferredAction = yesAction
287
+ }
288
+
283
289
284
290
var noString = " "
285
291
if ( site!. overrideScreenLock == false ) {
286
292
noString = checkEmoji
287
293
}
288
- let noAction = UIAlertAction ( title: " \( noString) \( Constants . LocalizedString. generalNoLabel. localized) " , style: UIAlertActionStyle . Default) { ( action) -> Void in
294
+
295
+ let noAction = UIAlertAction ( title: " \( noString) \( Constants . LocalizedString. generalNoLabel. localized) " , style: . Destructive) { ( action) -> Void in
289
296
self . updateScreenOverride ( false )
290
297
#if DEBUG
291
298
print ( " No action: \( action) " )
292
299
#endif
293
300
}
294
301
alertController. addAction ( noAction)
302
+
303
+ alertController. view. tintColor = NSAssetKit . darkNavColor
295
304
305
+ self . view. window? . tintColor = nil
306
+
307
+ // Resolving Incident with Identifier: 1169918A-77AC-4D15-8610-E62C1D74E386
308
+ // Crash in UIPopoverPresentationController
309
+ if let popoverController = alertController. popoverPresentationController {
310
+ popoverController. barButtonItem = sender
311
+ }
312
+
296
313
self . presentViewController ( alertController, animated: true ) {
297
314
#if DEBUG
298
315
print ( " presentViewController: \( alertController. debugDescription) " )
0 commit comments