Created
January 18, 2021 15:03
-
-
Save mohsinbmwm3/b64073c174e5182e677b09e4e27b7b2f to your computer and use it in GitHub Desktop.
UIApplication extensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UIApplication { | |
func openSetting() { | |
if let _url = URL(string: UIApplication.openSettingsURLString), canOpenURL(_url) { | |
open(_url, options: [:], completionHandler: nil) | |
} | |
} | |
func clearNotificationBadge() { | |
applicationIconBadgeNumber = 0 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment