IOS Notes

Posted on 17 Mayıs 2018 in Programlama by

To call a function when application becomes active

NotificationCenter.default.addObserver(self, selector: #selector(didBecomeActive), name: NSNotification.Name.UIApplicationDidBecomeActive, object: nil)

@objc func didBecomeActive() {
print(“did become active”)
//Do signaling offline works
}

—————

https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/StrategiesforHandlingAppStateTransitions/StrategiesforHandlingAppStateTransitions.html

 

Creation of temporary url path:

let destURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(“manifest.plist”)

Printing content of url

let contents = try String(contentsOf: destURL)

print(“!! contents:\(contents)”)

Please give us your valuable comment

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image

This site uses Akismet to reduce spam. Learn how your comment data is processed.