Tag: ios9

在7.3 / 9/2 + Swift中如何禁用旋转animation,设备何时旋转?

这个问题严格的关于iOS9 + 假设你有一个普通的现代应用程序(自动布局,故事板,通用),它允许所有四个旋转位置 你希望它以正常的方式自动旋转,所以当用户从横向到纵向旋转设备时,它会改变为新的基于约束的布局 但是在用户旋转设备的时候,你只需要没有animation。 你想要它只是“点击”新的横向或直立的布局。 我能做到这一点的唯一方法是增加: override func viewWillTransitionToSize(size:CGSize, withTransitionCoordinator coordinator:UIViewControllerTransitionCoordinator) { coordinator.animateAlongsideTransition(nil, completion: {_ in UIView.setAnimationsEnabled(true) }) UIView.setAnimationsEnabled(false) super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator); } 到一个视图控制器,一个最高或接近最高的VC,用于保存容器视图的其余部分或场景中的任何内容。 这与使用willRotateToInterfaceOrientation / didRotateFromInterfaceOrientation(现在在现代iOS中不能使用)的古老想法基本相同,可以将animation开关。 但是有很多问题 这不适用于AppWide,它是一团糟,它是基于场景的 关掉所有的animation似乎很不好 你可以看到各种赛道 这个问题严格的关于iOS9 + 这些天,有没有更好的方法来closures支持风景/肖像的应用程序中的旋转animation? 这个问题严格的关于iOS9 +

自定义解除争议iOS 8和iOS 9

我的问题是,我如何获得以下自定义展开segue在iOS 9之前版本的设备以及运行iOS 9的设备上工作? 我有一个自定义Segue显示一个视图控制器,然后有一个相应的自定义解绕Segue。 此代码在iOS 8中运行良好,并通过创buildUIStoryboardSegue的子类和实现perform方法来实现。 然后我重写我的自定义导航控制器中的以下方法: – (UIStoryboardSegue *) segueForUnwindingToViewController: (UIViewController *)toViewController fromViewController:(UIViewController *)fromViewController identifier:(NSString *)identifier { UIStoryboardSegue *segue; if([fromViewController isKindOfClass:[MyViewController class]]){ segue = [[CustomSegue alloc] initWithIdentifier:identifier source:fromViewController destination:toViewController]; //Custom Unwind Segue } else{ UIStoryboardSegue *unwindSegue = [super segueForUnwindingToViewController:toViewController fromViewController:fromViewController identifier:identifier]; //Normal Unwind Segue segue = unwindSegue; } return segue; } 在iOS 9中,不推荐使用segueForUnwindingToViewController 。 […]

iOS 9企业应用validation失败

苹果改变了在iOS 9上validation企业应用程序的方式,但是当我在“设置 – 常规 – configuration文件”中validation我们的应用程序时,我得到了这个结果 我检查了日志: Oct 15 21:32:21 Nix-iPhone online-auth-agent[216] <Error>: Caller does not have required entitlement 'com.apple.private.mis.trust.set' Oct 15 21:32:21 Nix-iPhone online-auth-agent[216] <Error>: SecTrustEvaluate [leaf AnchorTrusted] Oct 15 21:32:31 Nix-iPhone online-auth-agent[216] <Notice>: Server returned no data Oct 15 21:32:31 Nix-iPhone online-auth-agent[216] <Notice>: Could not complete online authentication Oct 15 21:32:31 Nix-iPhone online-auth-agent[216] […]

iOS9 – 分享到Instagram(w / hooks)不起作用

我目前正在更新我的应用程序之一,以便与iOS9兼容,并且我在Instagramfunction上遇到了麻烦。 我正在使用他们的开发者网站上陈述的Instagram挂钩:( https://instagram.com/developer/mobile-sharing/iphone-hooks/ ) 我希望分享的图像正在成功生成,具有.igo后缀,并且function仍然按iOS8上的预期工作。 它似乎已经打破了新版本的iOS。 以下是使用UIDocumentInteractionController与Instagram分享的代码: NSURL *instagramURL = [NSURL URLWithString:@"instagram://app"]; if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) { //convert image into .png format. NSData *imageData = UIImagePNGRepresentation(image); //create instance of NSFileManager NSFileManager *fileManager = [NSFileManager defaultManager]; //create an array and store result of our search for the documents directory in it NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, […]

目标C中什么是非空的?

有人可以详细说明为什么在iOS 9中引入nonnull ? 例如, NSArray方法+ (instancetype)array; 现在是+ (instancetype nonnull)array; 参考: https : //developer.apple.com/library/prerelease/ios/releasenotes/General/iOS90APIDiffs/frameworks/Foundation.html 这是一个客观的C级function,这将如何影响现有的应用程序?

scrollToRowAtIndexPath:atScrollPosition导致表视图“跳转”

我的应用程序具有聊天function,我正在喂这样的新消息: [self.tableView beginUpdates]; [messages addObject:msg]; [self.tableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:messages.count – 1 inSection:1]] withRowAnimation:UITableViewRowAnimationBottom]; [self.tableView endUpdates]; [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:messages.count – 1 inSection:1] atScrollPosition:UITableViewScrollPositionBottom animated:YES]; 但是,当我添加一个新的消息(发送和接收,结果是相同的),我的表视图“跳”怪异: 为什么我会得到这个奇怪的“跳跃”?

UIAlertView for iOS 9的替代scheme?

UAlertView在iOS 9及更高版本中已弃用。 什么是替代? UIAlertView *new = [[UIAlertView alloc] initWithTitle:@"Success" message:@"Your InApp Purchases were successfully restored" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [new show];

iOS9:崩溃报告中的重复行导致symbolicacrash卡住

这不是一个问题,因为我已经find了解决方法。 我正在发布它,以便其他人可以利用我花费的时间,并使用我build议的解决方法。 我有一些奇怪的崩溃报告 – 单行重复多次: … 0x190e08000 – 0x190e49fff Notes arm64 <f45c09ce977b3282ab0e879252dfebee> /System/Library/PrivateFrameworks/Notes.framework/Notes 0x190f9c000 – 0x190fa6fff NotificationsUI arm64 <73dcb247ed183ce7bb330d7bb55f93bd> /System/Library/PrivateFrameworks/NotificationsUI.framework/NotificationsUI 0x190fa8000 – 0x190faafff OAuth arm64 <c2658cb3208b342dbe1e91cea30ebdd5> /System/Library/PrivateFrameworks/OAuth.framework/OAuth 0x191900000 – 0x191903fff ParsecSubscriptionServiceSupport arm64 <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport 0x191900000 – 0x191903fff ParsecSubscriptionServiceSupport arm64 <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport 0x191900000 – 0x191903fff ParsecSubscriptionServiceSupport arm64 <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport 0x191900000 – 0x191903fff ParsecSubscriptionServiceSupport arm64 <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport […]

UIApplication.sharedApplication()。setStatusBarStyle()在iOS 9中不推荐使用

我一直在使用 UIApplication.sharedApplication().setStatusBarStyle() 在我的appDelegate,它工作得很好,但自iOS 9以来,这种方法已被弃用,我找不到替代品。 我想为我的整个应用程序更改状态栏样式为.LightContent,但唯一的build议xCode给我的是在每个VC分别处理这个; override func preferredStatusBarStyle() -> UIStatusBarStyle { return .LightContent } 有没有人有一个想法如何做到这一点的整个应用程序? 提前致谢

自定义着色器SCNProgram iOS 9 Scenekit

我试图在SceneKit中SceneKit并教导自己。 基本上,我正在创build一个有3个矩形边和1个倾斜滑块的四边形。 我希望我的纹理能够在表面上伸展和变形/变形。 在线阅读一些东西,似乎我需要用自定义顶点和片段着色器来制作一个SCNProgram来获得效果。 但是,我似乎无法让纹理在表面上传播。 需要帮助,请。 (我是graphics编程新手,因此试图自己教)。 我的Swift代码创build的几何和纹理如下: func geometryCreate() -> SCNNode { let verticesPosition = [ SCNVector3Make(0.0, 0.0, 0.0), SCNVector3Make(5.0, 0.0, 0.0), SCNVector3Make(5.0, 5.0, 0.0), SCNVector3Make(0.0, 3.0, 0.0) ] let textureCord = [CGPoint (x: 0.0,y: 0.0), CGPoint(x: 1.0,y: 0.0), CGPoint(x: 1.0,y: 1.0), CGPoint(x: 0.0,y: 1.0)] let indices: [CInt] = [ 0, 2, 3, 0, […]