This file contains hidden or 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
private var statusBarView: UIView? | |
if #available(iOS 13.0, *) { | |
let tag = 38482458385 | |
if let statusBar = UIApplication.shared.keyWindow?.viewWithTag(tag) { | |
statusBarView = statusBar | |
} else { | |
let statusBar = UIView(frame: UIApplication.shared.statusBarFrame) | |
statusBar.tag = tag | |
UIApplication.shared.keyWindow?.addSubview(statusBar) |
This file contains hidden or 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 showMessageResetApp(){ | |
let exitAppAlert = UIAlertController(title: "Restart is needed", | |
message: "We need to restart the app on your first login to the app.\n Please reopen the app after this.", | |
preferredStyle: .alert) | |
let resetApp = UIAlertAction(title: "Close Now", style: .destructive) { | |
(alert) -> Void in | |
// home button pressed programmatically - to thorw app to background | |
UIControl().sendAction(#selector(URLSessionTask.suspend), to: UIApplication.shared, for: nil) | |
// terminaing app in background |
This file contains hidden or 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
/* | |
* Copyright (c) 2017 Emil Davtyan | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining | |
* a copy of this software and associated documentation files (the | |
* "Software"), to deal in the Software without restriction, including | |
* without limitation the rights to use, copy, modify, merge, publish, | |
* distribute, sublicense, and/or sell copies of the Software, and to | |
* permit persons to whom the Software is furnished to do so, subject to | |
* the following conditions: |