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
func downloadDetails(){ | |
let dispatchGroup = DispatchGroup() | |
dispatchGroup.enter() // <<--- | |
WebServiceManager.getAData(format:A, withCompletion: {(data: Any? , error: Error?) -> Void in | |
if let success = data { | |
DispatchQueue.main.async { | |
(success code) |
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
extension UIApplication { | |
var currentWindow: UIWindow? { | |
connectedScenes | |
.filter({$0.activationState == .foregroundActive}) | |
.map({$0 as? UIWindowScene}) | |
.compactMap({$0}) | |
.first?.windows | |
.filter({$0.isKeyWindow}).first | |
} | |
} |
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
extension UIViewController { | |
func statusBarColorChange() { | |
if #available(iOS 13.0, *) { | |
let app = UIApplication.shared | |
let statusBarHeight: CGFloat = app.statusBarFrame.size.height | |
let statusbarView = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: statusBarHeight)) | |
statusbarView.backgroundColor = UIColor.red | |
view.addSubview(statusbarView) | |
} else { |