问题
I want start new app in Swift 3 Xcode 8 and support iOS 8.4/9.x How to deal with Core Data ?
回答1:
Yes, it is easily possible. Swift 3 is targeted to run on iOS v8+. You will only be able to use the subset of APIs supported on iOS v8.4 though. The best way to find out the answer to your question though is to create a test project that uses Core Data. You'll find that NSPersistentContainer
creates an error. Why? It isn't available on the earlier OSes. Alternatively, create a test project with Xcode 7 and then migrate it to Swift 3, you'll see that it can easily work every where.
回答2:
For anyone looking for it, I added the core data template generated by xcode 7 (swift 2) and its swift 3 conversion in this answer: https://stackoverflow.com/a/39814217/3034715
来源:https://stackoverflow.com/questions/38140188/is-it-possible-to-use-core-data-xcode-8-and-swift-3-0-with-both-ios-9-and-10