multitasking

Detect if app is running in Slide Over or Split View mode in iOS 9

寵の児 提交于 2019-11-27 17:50:34
In iOS 9, is it possible to detect when an app is running in iOS 9's Slide Over or Split View mode? I've tried reading through Apple's documentation on iOS 9 multitasking, but haven't had any luck with this… I ask because I might have a feature in my app that I'd like to disable when the app is opened in a Slide Over. Tamás Zahola Just check if your window occupies the whole screen: BOOL isRunningInFullScreen = CGRectEqualToRect([UIApplication sharedApplication].delegate.window.frame, [UIApplication sharedApplication].delegate.window.screen.bounds); If this is false, then you're running in a

How to respond to push notification view if app is already running in the background

天涯浪子 提交于 2019-11-27 16:59:54
I have something fairly simple I want to do. I attach a custom piece of data to some push notifications that I handle in -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions I look for the UIApplicationLaunchOptionsRemoteNotificationKey and hey presto there it is. That method only gets called if my app is being launched for the first time. How do I read that same key if my application is running in the background already when the notification comes in and the user pressed the 'View' button on the notification? I want to send them to a

How to refresh UITableView after app comes becomes active again?

柔情痞子 提交于 2019-11-27 16:54:43
问题 I would like my UITableView to reloadData once my app is active again, after a user exits the application. I know I need to implement (in my app delegate): - (void)applicationDidBecomeActive:(UIApplication *)application but im not sure how to reference the current UITableView? UPDATE: My UITableView is a separate controller. It is actually presented as follows AppDelegate > Root View Controller > Pushes UITabBarController modally which has a UITableViewController 回答1: following up on Ole's

Invalid Bundle Error - “requires launch storyboard”

China☆狼群 提交于 2019-11-27 16:46:44
I keep getting this error when I try to submit my app to the store using Xcode: ERROR ITMS-90475: "Invalid Bundle. iPad Multitasking support requires launch storyboard in bundle 'com.companyname.appname.'" Anyone know what this error really means? This is because you need to specify how your app is supposed to handle multitasking on iPad. If you don't want to handle multitasking right now, you can simply disable it by going to the "General" tab of your target: marji I solved the problem in this way, see here : If you must opt out of Slide Over and Split View, do so explicitly by adding the

Is it possible to test iOS4 multitasking/background music playing on the simulator?

大兔子大兔子 提交于 2019-11-27 14:09:00
I have added the UIBackgroundModes property in Info.plist to have an array entry of " audio " and have added the call to setup the audio session: [session setCategory: AVAudioSessionCategoryPlayback error: &error]; . However, the only test device I have is the iPod Touch 2G which doesn't support multitasking. I've tried the simulator but the music stops playing when I switch to Safari. But when I switch back to my app, the song continues playing to a farther location than when I left the app. It seems to have continued playing in the background but I didn't hear the audio of my app while using

Want app upgraded to 4.0 to exit completely when home button pressed

白昼怎懂夜的黑 提交于 2019-11-27 13:20:58
问题 I am working on an app for iOS 4.0. The app was originally on 2.2.1. I upgraded it to a universal app, but now it seems to be multitasking. When I press the menu button while running the app, instead of exiting it closes, but when I relaunch the app it resumes where I left off. I am assuming this is multitasking. I want it to exit, is there a way in the settings? My guess is that the iPad target upgrade changed the plist somehow? Any thoughts? 回答1: Open your info.plist file Add The Key

How can I run both of these methods 'at the same time' in .NET 4.5?

若如初见. 提交于 2019-11-27 11:19:57
I have a method which does 2 independent pieces of logic. I was hoping I can run them both at the same time .. and only continue afterwards when both those child methods have completed. I was trying to get my head around the async/await syntax but I just don't get it. Here's the code: public PewPew SomeMethod(Foo foo) { var cats = GetAllTheCats(foo); var food = GetAllTheFood(foo); return new PewPew { Cats = cats, Food = food }; } private IList<Cat> GetAllTheCats(Foo foo) { // Do stuff, like hit the Db, spin around, dance, jump, etc... // It all takes some time. return cats; } private IList

Prevent iOS from taking screen capture of app before going into background

霸气de小男生 提交于 2019-11-27 11:08:14
You all might know that iOS takes a screen shot of your application before throwing it into the background. This is usually for a better User experience like quick animation to bring the app back and so on. I don't want my app screen shot to be stored on the device, but I want the multitasking to still exist. I came out with a solution but I'm not sure if I'm heading in the right direction. So, when the applicationDidEnterBackground is called -- I put in an overlay image that will be captured by the OS, and once the app enters foreground, I will remove the overlay. I'm not sure if this is

iOS - Ensure execution on main thread [duplicate]

折月煮酒 提交于 2019-11-27 10:36:08
This question already has an answer here: Check whether or not the current thread is the main thread 11 answers I want to know how to call my function on the main thread . How do I make sure my function is called on the main thread ? (this follows a previous question of mine). there any rule I can follow to be sure that my app executes my own code just in the main thread? Typically you wouldn't need to do anything to ensure this — your list of things is usually enough. Unless you're interacting with some API that happens to spawn a thread and run your code in the background, you'll be running

multiple parallel async calls with await

和自甴很熟 提交于 2019-11-27 10:29:43
问题 As far as I know, when runtime comes across the statement below it wraps the rest of the function as a callback to the method which is invoked asynchronously ( someCall() in this example). In this case anotherCall() will be executed as a callback to someCall() : await someCall(); await anotherCall(); I wonder if it is possible to make runtime perform like this: call someCall() in async fashion and return immediately to the calling thread, then invoke anotherCall() similarly (without waiting