uiapplication

Open Photos app programmatically

早过忘川 提交于 2019-12-19 06:55:37
问题 Is it possible to launch the "Photos" application from an iPhone app? Similar to launching mail? [[UIApplication sharedApplication] openURL:url]; 回答1: The Photos app doesn't appear to register any URL schemes that other apps can use. There's a pretty well-established pattern in other system apps (e.g. Safari) of “saving an image” resulting in that image being placed in the user's camera roll; I'd recommend just sticking with that expected behavior, and perhaps using an alert to direct the

Open Photos app programmatically

时间秒杀一切 提交于 2019-12-19 06:55:10
问题 Is it possible to launch the "Photos" application from an iPhone app? Similar to launching mail? [[UIApplication sharedApplication] openURL:url]; 回答1: The Photos app doesn't appear to register any URL schemes that other apps can use. There's a pretty well-established pattern in other system apps (e.g. Safari) of “saving an image” resulting in that image being placed in the user's camera roll; I'd recommend just sticking with that expected behavior, and perhaps using an alert to direct the

Open Photos app programmatically

雨燕双飞 提交于 2019-12-19 06:55:05
问题 Is it possible to launch the "Photos" application from an iPhone app? Similar to launching mail? [[UIApplication sharedApplication] openURL:url]; 回答1: The Photos app doesn't appear to register any URL schemes that other apps can use. There's a pretty well-established pattern in other system apps (e.g. Safari) of “saving an image” resulting in that image being placed in the user's camera roll; I'd recommend just sticking with that expected behavior, and perhaps using an alert to direct the

Dismiss an already delivered UILocalNotification?

霸气de小男生 提交于 2019-12-18 07:43:35
问题 Is it possible to do this? UIApplication's scheduledLocalNotifications doesn't seem to return notifications that have already been delivered to the user's notification center, so I think this may be by design, but I can't find any documented evidence of this. Anyone know? Thanks! EDIT: Found this: You can cancel a specific scheduled notification by calling cancelLocalNotification: on the application object, and you can cancel all scheduled notifications by calling cancelAllLocalNotifications.

[UIScreen mainScreen].bounds vs [UIApplcation sharedApplication].keyWindow.bounds?

余生长醉 提交于 2019-12-14 03:48:05
问题 I have view that i want to cover entire screen. And i want to set its frame to cover entire screen. Browsing the stack overflow i found these two different ways of setting view frame to cover the screen: [UIScreen mainScreen].bounds [UIApplcation sharedApplication].keyWindow.bounds It seems to me they are returning same values always, or at least in few test cases I have tried. Currently i am using UIScreen , but i curious to know difference between these calls? Will there be some cases where

ios call function in background mode

夙愿已清 提交于 2019-12-13 09:41:02
问题 my app running in the background and I want to take the html data from the web server every 60 second. (with alamofire or nsurlconnection etc..) but I could not find sample code associated with it. Is it possible to do something like this. updated every minute I want to do. applications running in the background mode, updateServer function I want to call every 60 second note: with background fetch methot not working every minute. func application(application: UIApplication,

Opening another (mine) application from my main application Swift

感情迁移 提交于 2019-12-13 07:20:02
问题 I have two applications and i want to open them from each other (like facebook opens messenger). After a little search i found that i have to know the url scheme of my app, but i don't know how can i declare it. In my urlSchemes are only facebook's schemes. var url = NSURL(string: "") UIApplication.sharedApplication().canOpenURL(url!) I found that code and as i understand i have to put in the url my urlScheme. Any help? 回答1: Here is a good tutorial on setting up URL Schemes within you app:

Understanding applicationSignificantTimeChange:

拜拜、爱过 提交于 2019-12-12 14:08:08
问题 I find that sometimes my application (Cocos2d game) beheaves in a "buggy" way after a significant time change. For example: case 1: when the application enters the background and, after several minutes, I restart it, I can see the loading image and then the application/game resumes. case 2: when the application enters the background and after a significant time change the application sometimes restarts, sometimes not. It is still unclear to me why. Looking at the AppDelegate methods I found:

Prevent iPhone to sleep

北慕城南 提交于 2019-12-12 10:10:46
问题 I using accelerometer in my app and i'm using [UIApplication sharedApplication].idleTimerDisabled = YES; to prevent the device to sleep. It works fine, but this way the screen is always on full bright, there is a way to prevent the device to sleep and keep the energy economy mode on? When idleTimerDisabled is stetted to NO the device enter in the energy economy mode before sleep, i just want to prevent the device to sleep and keep the energy economy. There is a way to do that? 回答1: There's a

ios app hits straight shouldstartloadwithrequest after coming from background instead

心已入冬 提交于 2019-12-12 01:32:38
问题 I have a webview in my mainviewcontroller and i am laoding a webpage in viewdidload method as below: - (void)viewDidLoad { [super viewDidLoad]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; [_loginWebView loadRequest:requestObj]; } and in the shouldstartloadwithrequest method, i check if the url contains "itunes" and i have the following code for it: - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType