ios11

针对Xcode 9 + iOS11 的修改,及iPhone X的适配

不问归期 提交于 2020-02-03 02:40:48
1,UIScrollView的automaticallyAdjustsScrollViewInsets 失效了。 automaticallyAdjustsScrollViewInsets,当设置为YES时(默认YES),如果视图里面存在唯一一个UIScrollView或其子类View,那么它会自动设置相应的内边距,这样可以让scroll占据整个视图,又不会让导航栏遮盖。 iOS11这个属性失效了,表现在App的现象就是TableHeaderView的背景图原本覆盖导航栏的,现在在导航栏的下方。 这是因为iOS 11为UIScrollView 添加了新的属性contentInsetAdjustmentBehavior 这是一个枚举。 修改代码如下: if (@available(iOS 11.0, *)) { self.centerTable.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; } else { self.automaticallyAdjustsScrollViewInsets = NO; } 2, 相册读取权限 iOS11下,苹果对相册的权限key做了调整,原来的 NSPhotoLibraryUsageDescription ,在iOS11之后

iOS11 & iPhone X 适配指南

巧了我就是萌 提交于 2020-02-03 00:48:43
苹果WWDC开发者大会上,终于发布了大家期待已久的iOS 11,有些新特性功能确实出人意料。不过大的方面苹果貌似也就 AR 和 GM 机器学习了,9月13日凌晨1点,苹果开了新品发布会,相信大家都已经知道Phone X 的刘海了,看起来不是很雅观,对于iOS开发者来说,适配工作也带来了麻烦,iOS11在新旧API 方面做了新的改动,未来App Store就会出现很多大量的APP更新,针对iOS11和iPhone X的适配。 下面针对已经了解的出现的问题进行适配的说明。 屏幕未充满? 相信一部分开发者已经在着手适配iPhone X 和iOS11 了,xcode9测试版运行自己的项目会发现项目没有充满屏幕,上下会有黑色区域的情况,大家别慌,这是没有设置对应的启动图,iPhone X对应像素 1125 * 2436 大家可以自己添加图片或者准备一张尺寸:1125 * 2436的启动图片, 移动到LaunchImage的Finder目录中, 并在LaunchImage中的Contents.json文件中增加 (注意Json格式): { "extent" : "full-screen", "idiom" : "iphone", "subtype" : "2436h", "filename" : "图片名字.png", "minimum-system-version" : "11.0",

Change views using Segmented Control

為{幸葍}努か 提交于 2020-02-01 09:38:41
问题 I need to change views using a Segmented Control. In the following example I have put two view containers in the same location: The second container is hidden and I will show it through code every time I use the segmented control. (Although it does not show it either.) import UIKit class ViewController: UIViewController { @IBOutlet weak var container1: UIView! @IBOutlet weak var container2: UIView! override func viewDidLoad() { super.viewDidLoad() } override func didReceiveMemoryWarning() {

Change views using Segmented Control

时光总嘲笑我的痴心妄想 提交于 2020-02-01 09:38:24
问题 I need to change views using a Segmented Control. In the following example I have put two view containers in the same location: The second container is hidden and I will show it through code every time I use the segmented control. (Although it does not show it either.) import UIKit class ViewController: UIViewController { @IBOutlet weak var container1: UIView! @IBOutlet weak var container2: UIView! override func viewDidLoad() { super.viewDidLoad() } override func didReceiveMemoryWarning() {

How to programatically save arkit object in .dae format

邮差的信 提交于 2020-01-31 18:02:43
问题 I am working on an app the creates a 3d mesh of users face. I am successful in generating data of a users face. I want to programatically save this data in .dae format so that i could export my .dae file, edit that in 3d softwares like blender, and than further import it in my iphone and display that file in sceneview. Long story short i want programatically save the data in .dae format. I am not able to find anything on internet about this. If there could be another approach then please tell

How to programatically save arkit object in .dae format

余生长醉 提交于 2020-01-31 18:01:30
问题 I am working on an app the creates a 3d mesh of users face. I am successful in generating data of a users face. I want to programatically save this data in .dae format so that i could export my .dae file, edit that in 3d softwares like blender, and than further import it in my iphone and display that file in sceneview. Long story short i want programatically save the data in .dae format. I am not able to find anything on internet about this. If there could be another approach then please tell

NavigationBar without statusbar overlaps safearea in iOS11

倖福魔咒の 提交于 2020-01-24 22:06:08
问题 I have a problem in iOS11 with the iPhoneX simulator. I have a viewcontroller without the statusbar. To do this I add: - (BOOL)prefersStatusBarHidden { return YES; } It is good so far but the navigationbar overlaps the safearea in the iPhoneX. How can I fix this? 回答1: Finally the solution was using safeAreaInsets if (@available(iOS 11.0, *)) { UIEdgeInsets safeInsets = UIApplication.sharedApplication.delegate.window.safeAreaInsets; paddingTop = safeInsets.top; } You can do this

custom titleView of navigationItem is not getting tapped on iOS 11

隐身守侯 提交于 2020-01-24 13:02:31
问题 I am using a custom titleView and assigning it to navigationItem titleView. It had been working fine until iOS 11. Since the update it's position got misplaced to center as originally it was on more left. Beside that user interaction is not working. titleView = Bundle.main.loadNibNamed("SomeNib", owner: self, options: nil)?.first as? SomeNib navigationItem.titleView = titleView titleView is just a usual nib. then for enabling interaction: if let titleView = self.navigationItem.titleView { let

custom titleView of navigationItem is not getting tapped on iOS 11

亡梦爱人 提交于 2020-01-24 13:02:08
问题 I am using a custom titleView and assigning it to navigationItem titleView. It had been working fine until iOS 11. Since the update it's position got misplaced to center as originally it was on more left. Beside that user interaction is not working. titleView = Bundle.main.loadNibNamed("SomeNib", owner: self, options: nil)?.first as? SomeNib navigationItem.titleView = titleView titleView is just a usual nib. then for enabling interaction: if let titleView = self.navigationItem.titleView { let

custom titleView of navigationItem is not getting tapped on iOS 11

老子叫甜甜 提交于 2020-01-24 13:02:06
问题 I am using a custom titleView and assigning it to navigationItem titleView. It had been working fine until iOS 11. Since the update it's position got misplaced to center as originally it was on more left. Beside that user interaction is not working. titleView = Bundle.main.loadNibNamed("SomeNib", owner: self, options: nil)?.first as? SomeNib navigationItem.titleView = titleView titleView is just a usual nib. then for enabling interaction: if let titleView = self.navigationItem.titleView { let