session-ios/Signal/src/UIApplication+OWS.swift

24 lines
567 B
Swift
Raw Normal View History

//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
import Foundation
extension UIApplication {
var frontmostViewController: UIViewController? {
let window = UIApplication.shared.keyWindow
var viewController = window!.rootViewController
while viewController?.presentedViewController != nil {
viewController = viewController?.presentedViewController
}
return viewController
}
2017-05-05 18:39:21 +02:00
func openSystemSettings() {
openURL(URL(string: UIApplicationOpenSettingsURLString)!)
}
}