ios11

iOS 11 NSPredicate search on Swift array crashing - NSUnknownKeyException

隐身守侯 提交于 2019-12-19 02:54:11
问题 I am using NSPredicate to filter an array in Swift. The problem is after updating to iOS 11 (Xcode 9 /w Swift 4), I keep getting a crash on the filter line. Here is the crash log: Terminating app due to uncaught exception 'NSUnknownKeyException', reason: >'[ valueForUndefinedKey:]: this class is not key >value coding-compliant for the key name.' Here is an example of the class that I have an array of: final class Model: NSObject { let name: String init(name: String) { self.name = name } }

iOS 11 Navigation TitleView misplaced

左心房为你撑大大i 提交于 2019-12-19 02:30:42
问题 I have an iOS app in which I am setting a custom navigation title view. It was working fine till iOS 10, but in iOS 11 the navigation title view is misplaced. Here is the screen shot for iOS 10 - Here is the screen shot for iOS 11 - As you can see in the screen shots that when I run the code on iOS 10 the title view appears to be fine. But the same code on iOS 11 shifts the title view down by some pixels and it gets cut. This is how I am setting the title view - navigationItem.titleView = MY

iOS 11 UISearchBar background color

混江龙づ霸主 提交于 2019-12-18 20:05:08
问题 I understand that this question has been asked many, many times on SO. However, as Apple does best, with the release of iOS 11 , they seem to have made a seemingly unnecessary change to the UISearchBar , specifically it's view hierarchy. In further, the "text field" of a search bar is no longer accessible in the search bar's subviews, causing all of the previous solutions to "access" and change the background color of the text field, or any property of the text field for that matter. Does

iPhone X full screen issue [duplicate]

本秂侑毒 提交于 2019-12-18 15:16:10
问题 This question already has answers here : Seeing black bars at the top and bottom of the iPhone X Simulator (9 answers) Closed 2 years ago . Today I've installed Xcode 9 and build my app for iPhone x . but the upper and bottom area showing black like the scenarios we met couple of years ago for iPhone 5 when screen switched to 3.5 to 4. How simply we can fix this problem? 回答1: You should use a safe area . For apps with custom layouts, supporting iPhone X should also be relatively easy,

How to line break long large title in iOS 11?

淺唱寂寞╮ 提交于 2019-12-18 13:31:15
问题 I am trying to use the new large title system in iOS 11 using Swift. When the title gets too long (see image example), it adds ... instead of line breaking or shrinking the text size. How can I add a line break? Here is some of the code I'm using to set up the title: self.navigationController?.navigationBar.prefersLargeTitles = true self.navigationController?.navigationBar.largeTitleTextAttributes = [NSForegroundColorAttributeName: MyGlobalVariable.themeMainColor] self.navigationController?

How to set unsafe area background color for ios 11

末鹿安然 提交于 2019-12-18 11:28:19
问题 Creating some new view controllers with xcode 9 so now I have a few safe areas to deal with. I am currently trying to do something fullproof, meaning keeping the unsafe area as it is (since I always display the status bar) and having the background color extending to the fullscreen (to keep a similar behaviour to what I used to have). On an additional note, this also affect page controls since when you have some the system will put them in the bottom unsafe area which will also be displayed

Continuously train CoreML model after shipping

那年仲夏 提交于 2019-12-18 11:26:55
问题 In looking over the new CoreML API, I don't see any way to continue training the model after generating the .mlmodel and bundling it in your app. This makes me think that I won't be able to perform machine learning on my user's content or actions because the model must be entirely trained beforehand. Is there any way to add training data to my trained model after shipping? EDIT: I just noticed you could initialize a generated model class from a URL, so perhaps I can post new training data to

dyld: dyld_sim not compatible mach-o

三世轮回 提交于 2019-12-18 11:01:20
问题 I installed Xcode 9 and trying to run my app on ios simulator 11.0. As soon as it launches the app its crashing giving this error. What does this error mean? If my app is not compatible with ios11.0, how can I check for the compatibily? EDIT - Uploaded my valid Architectures 回答1: You need to make these changes in build setting ... it works for me 回答2: I had the same problem and found out that the architectures and valid architectures settings for my targets (and pods) were set wrong. iOS 11

How to prevent app from overlapping status bar in ios-11, iPhone-X, Xcode-9

假装没事ソ 提交于 2019-12-18 09:01:11
问题 I want to stop overlapping of my View with statusbar 回答1: Use Auto Layout and pin your view to Top Layout Guide, or use the new Safe Area Layout Guides. To enable it, in your storyboard's File inspector tick the following option. As an example I have used gray image view: As you can see below, it does not overlap status bar: 来源: https://stackoverflow.com/questions/46275652/how-to-prevent-app-from-overlapping-status-bar-in-ios-11-iphone-x-xcode-9

WKWebView vs UIWebView

我们两清 提交于 2019-12-18 07:12:05
问题 I've an app/project with deployment target version - iOS 10. I had used UIWebView , which is deprecated now and replaced by WKWebView . So, I want to replace UIWebView with WKWebView in my project also. It force me to either use UIWebView (with iOS 10) or change deployment target to iOS 11. I cannot change deployment target but as a middleware solution, I added code (programatically) support for both. I mean, if user's device OS is iOS 11 (or above) then use WKWebView else use UIWebView (for