Apress Beginning iPhone Development with Swift, Exploring the iOS SDK (2014) by Kim Topley & Fredrik Olsson & Jeff LaMarche
Author:Kim Topley & Fredrik Olsson & Jeff LaMarche
Format: epub
let app = UIApplication.sharedApplication()
NSNotificationCenter.defaultCenter().addObserver(self,
selector: "applicationWillEnterForeground:",
name: UIApplicationWillEnterForegroundNotification,
object: app)
}
We start by getting a reference to our application instance, and then use that to subscribe to the UIApplicationWillEnterForegroundNotification, using the default NSNotificationCenter instance and a method called addObserver(_, selector:, name:, object:). We then pass the following to this method:
For the observer, we pass self, which means that our controller class (each of them individually, since this code is going into both of them) is the object that needs to be notified.
For selector, we pass a selector to the applicationWillEnterForeground() method we just wrote, telling the notification center to call that method when the notification is posted.
The third parameter, UIApplicationWillEnterForegroundNotification, is the name of the notification that we’re interested in receiving.
The final parameter, app, is the object from which we’re interested in getting the notification. We use a reference to our own application for this. If we passed nil for the final parameter instead, we would get notified any time any application posted the UIApplicationWillEnterForegroundNotification.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Linux Device Driver Development Cookbook by Rodolfo Giometti(3957)
Embedded Programming with Modern C++ Cookbook by Igor Viarheichyk(3783)
Implementing Cellular IoT Solutions for Digital Transformation by Dennis McCain(3703)
Embedded Linux Development Using Yocto Project - Third Edition by Otavio Salvador & Daiane Angolini(3551)
TinyML Cookbook by Gian Marco Iodice(3470)
Simplifying 3D Printing with OpenSCAD by Colin Dow(2861)
TinyML Cookbook by Gian Marco Iodice & Ronan Naughton(2623)
Fusion 360 for Makers by Lydia Sloan Cline(2231)
Networking A Beginner's Guide by Bruce Hallberg(2228)
Hands-On Linux for Architects by Denis Salamanca(2073)
But How Do It Know? by J. Clark Scott(2039)
Computers For Seniors For Dummies by Nancy C. Muir(2023)
Raspberry Pi and MQTT Essentials by Dhairya Parikh(1980)
Arduino Project Handbook, Volume 2: 25 Simple Electronics Projects for Beginners by Geddes Mark(1963)
9781803246888-ENHANCING DEEP LEARNING WITH BAYESIAN INFERENCE by Unknown(1918)
Hack and HHVM by Owen Yamauchi(1904)
31 Days Before Your CompTIA A+ Exams (Shanette Luellen's Library) by Benjamin Patrick Conry(1878)
MicroPython Projects by Jacob Beningo(1768)
Hands-On Internet of Things with MQTT by Tim Pulver(1728)
