![]() After you are done and you want to save some energy - you end your activity by calling endActivity() method to notify the system. Then you call beginActivity(options:reason:) method to disable app nap. Prevent App Napįirst of all you have to make a property in your class that is going to hold an instance of NSObjectProtocol - an object token representing the activity. I strongly encourage you to go ahead and read the documentation on what this class can do for you as I am going to concentrate only on the problem you might encounter - "I called the proper methods, why does my app still goes into a nap mode?!". In order to prevent app nap you have to inform the system about you performing some work which should not be interrupted by the OS i.e. Here is how to turn it off as well as some hints. ![]() ![]() An urge to disable app nap was quite natural. I knew what might be the issue - App Nap feature of macOS. At one point I have noticed that the speed of the process my app does drops significantly after some period of time in case a window of the app in minimized or not visible on the screen. I am currently writing an app for OS X that is going to controlling my new Philips Hue lights.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |