File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed
Example Apps/SparrowKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad
Sources/SparrowKit/UIKit/Extensions Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 2222#if canImport(UIKit) && (os(iOS) || os(tvOS))
2323import UIKit
2424
25- public extension UIApplication {
25+ extension UIApplication {
2626
2727 /**
2828 SparrowKit: Bundle display name from plist.
2929 */
30- var displayName : String ? {
30+ open var displayName : String ? {
3131 return Bundle . main. object ( forInfoDictionaryKey: " CFBundleDisplayName " ) as? String
3232 }
3333
3434 /**
3535 SparrowKit: Bundle identifier from plist.
3636 */
37- var bundleIdentifier : String ? {
37+ open var bundleIdentifier : String ? {
3838 return Bundle . main. bundleIdentifier
3939 }
4040
4141 /**
4242 SparrowKit: Bundle version from plist.
4343 */
44- var version : String ? {
44+ open var version : String ? {
4545 return Bundle . main. object ( forInfoDictionaryKey: " CFBundleShortVersionString " ) as? String
4646 }
4747
4848 /**
4949 SparrowKit: Bundle number from plist.
5050 */
51- var buildNumber : String ? {
51+ open var buildNumber : String ? {
5252 return Bundle . main. object ( forInfoDictionaryKey: kCFBundleVersionKey as String ) as? String
5353 }
54+
55+ /**
56+ SparrowKit: Open App Settings.
57+ */
58+ public func openSettings( ) {
59+ DispatchQueue . main. async {
60+ guard let settingsUrl = URL ( string: UIApplication . openSettingsURLString) else { return }
61+ if UIApplication . shared. canOpenURL ( settingsUrl) {
62+ UIApplication . shared. open ( settingsUrl, completionHandler: { _ in } )
63+ }
64+ }
65+ }
5466}
5567#endif
You can’t perform that action at this time.
0 commit comments