ios9

UIStackView - Distribute views evenly from the centre

ぐ巨炮叔叔 提交于 2019-11-29 21:30:14
I have a UIStackView ,inside a UIScrollView to show dynamically added subviews horizontally arranged. Current solution will start displaying items from the left, I would like to start distributing items from the centre without changing the width and height of the subviews. How do I do that? Im also open to solutions which doesn't use UIStackView as well. That way I could support devices < iOS9. ( Current ) ( Expected ) Short answer : ScrollView constraints Leading >= 0, Trailing >= 0, Top >= 0, Bottom >= 0 Center X and Center Y StackView constraints Leading = 0, Trailing = 0, Top = 0, Bottom =

iOS 9 - NSUserActivity userinfo property showing null

梦想的初衷 提交于 2019-11-29 19:09:14
问题 I had a quick question about NSUserActivity's userInfo property. NSString *activity = @"com.test.activity"; NSUserActivity *userActivity = [[NSUserActivity alloc] initWithActivityType:activity]; userActivity.title = @"Test"; userActivity.keywords = [NSSet setWithArray:@[@"Test"]; userActivity.userInfo = @{@"location": location}; userActivity.eligibleForSearch = YES; self.userActivity = userActivity; [self.userActivity becomeCurrent]; I have the above snippet implemented in one of view

Submitting App from building in Xcode 6.4

£可爱£侵袭症+ 提交于 2019-11-29 18:49:44
I previously built my app in an Xcode 7 beta as my testing device is an iOS 9.0 device. I recently deleted Xcode 7 and began working on my app in Xcode 6.4 (not a beta). 6.4 does not support iOS 9 but my iPhone on an iOS 9 Beta is not uneligible (as it should because 6.4 doesn't support 9.0). Are there some files I can remove so that my device is ineligible? I believe once I fix this problem, I can finally submit a new build for review to iTunes Connect because I shouldn't get this error message when submitting my app: New apps and app updates submitted to the App Store must be built with

didReceiveRemoteNotification is not running when app is running (FOREGROUND)

让人想犯罪 __ 提交于 2019-11-29 17:55:24
I have a strange case. My swift ios app is connected to Cloudkit. If the app is NOT running (background state), I receive my notifications badge and alert just fine, every time! If the app is running, no notifications are received! I know it is not hitting the remote because I do this: 1. Adding a breakpoint to the didReceiveRemoteNotification event 2. Running xcode in a plugged iphone 3. NSLog("detected didReceiveRemoteNotification"), so final code look like this func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]){ NSLog("detected

iOS9: canOpenURL returning false for WhatApp's url scheme

南楼画角 提交于 2019-11-29 17:53:23
问题 In my current project I need to share text on whatsapp from iOS app. Here is my code to share text on whatsapp:- NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?text=Hello%2C%20World!"]; if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) { [[UIApplication sharedApplication] openURL: whatsappURL]; } but canOpenURL always returning false in iOS9. Is there any iOS9 privacy policy ? Can anyone help me out. Thanks in advance. 回答1: In iOS 9 you must whitelist any URL

Testing UIWebView with Xcode UI Testing

谁都会走 提交于 2019-11-29 17:51:58
问题 I'm using new Xcode UI Testing from XCTest Framework with the Xcode 7 GM . I've got an app with simple UIWebView (it's just a navigation controller + view controller with web view and button) and I want to check following scenario: Web View loads page www.example.com User taps on button Web View loads some page with URL: www.example2.com I want to check which page is loaded in UIWebView after pressing button. Is this possible with UI Testing right now? Actually I'm getting web view like this:

HTTP load failed (kCFStreamErrorDomainSSL, -9806 ( IOS9)

感情迁移 提交于 2019-11-29 17:10:52
I am getting the NSURLSession/NSURLConnection HTTP load failed on iOS 9 while running app on Simulator. Here is how my info.plist file looks like <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> <key>NSIncludesSubdomains</key> <true/> <!--Include to allow insecure HTTP requests--> <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key> <true/> <!--Include to specify minimum TLS version--> <key>NSTemporaryExceptionMinimumTLSVersion</key> <string>TLSv1.1</string> </dict> Even after entering these key values Same error is showing up on the Xcode Console. please

Set the application badge number in ios 9

隐身守侯 提交于 2019-11-29 17:08:03
问题 I'd used [UIApplication sharedApplication].applicationIconBadgeNumber = 5; for setting application badge number. It's not working in ios 9 alone. Can anyone suggest why? I tried, [[UIApplication sharedApplication] setApplicationIconBadgeNumber:5]; 回答1: Hi You need to register UIUserNotificationSettings like this UIUserNotificationSettings* notificationSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound

iOS 整理iOS9适配中出现的坑

我怕爱的太早我们不能终老 提交于 2019-11-29 16:50:48
一、NSAppTransportSecurity iOS9让所有的HTTP默认使用了HTTPS,原来的HTTP协议传输都改成TLS1.2协议进行传输。直接造成的情况就是App发请求的时候弹出网络无法连接。解决办法就是在项目的info.plist 文件里加上如下节点: NSAppTransportSecurity - NSAllowsArbitraryLoads 这个子节点的意思是:是否允许任性的加载?! 设为YES的话就将禁用了AppTransportSecurity转而使用用户自定义的设置,这个问题就解决了。 上面说是苹果限制了HTTP协议,但是也并不是说所有的HTTPS都能完美适配iOS9了。 举个栗子,从app内起webView加载https的网页。新建个项目写几行起网页的代码 - (void)loadView{ UIWebView *web = [[UIWebView alloc]initWithFrame:[UIScreen mainScreen].bounds]; self.view = web; } - (void)viewDidLoad { [super viewDidLoad]; UIWebView *web = (UIWebView *)self.view; //董铂然 NSURL *url = [NSURL URLWithString:@"https:/

整理iOS9适配中出现的坑(图文)

心不动则不痛 提交于 2019-11-29 16:50:36
本文主要是说一些iOS9适配中出现的坑,如果只是要单纯的了解iOS9新特性可以看瞄神的 开发者所需要知道的 iOS 9 SDK 新特性 。9月17日凌晨,苹果给用户推送了iOS9正式版,随着有用户陆续升级iOS9,也就逐渐的衍生出了一系列的问题,笔者也在赶忙为自己维护的App做适配,本文写的一些坑基本都是亲身体验了。 一、NSAppTransportSecurity iOS9让所有的HTTP默认使用了HTTPS,原来的HTTP协议传输都改成TLS1.2协议进行传输。直接造成的情况就是App发请求的时候弹出网络无法连接。解决办法就是在项目的info.plist 文件里加上如下节点: NSAppTransportSecurity - NSAllowsArbitraryLoads 这个子节点的意思是:是否允许任性的加载?! 设为YES的话就将禁用了AppTransportSecurity转而使用用户自定义的设置,这个问题就解决了。 如果你不是在董铂然博客园看到本文,请 点击查看原文 。 上面说是苹果限制了HTTP协议,但是也并不是说所有的HTTPS都能完美适配iOS9了。 举个栗子,从app内起webView加载https的网页。新建个项目写几行起网页的代码 1 2 3 4 5 6 7 8 9 10 11 12 - (void)loadView{ UIWebView *web = [