Skip to content

Instantly share code, notes, and snippets.

@mohsinbmwm3
Created January 18, 2021 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohsinbmwm3/b64073c174e5182e677b09e4e27b7b2f to your computer and use it in GitHub Desktop.
Save mohsinbmwm3/b64073c174e5182e677b09e4e27b7b2f to your computer and use it in GitHub Desktop.
UIApplication extensions
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