Question: Swift 2 iOS 9 and SqlLite

Question

Swift 2 iOS 9 and SqlLite

Answers 3
Added at 2017-04-18 14:04
Tags
Question

I'm a new iOS programmer. I'm building a simple app with Swift. Now I want to insert a database to storage information of my app.

I can't find any tutorial that Using Swift 2.2 and iOS 9 (iOS Target). Can anyone suggest a tutorial?

Answers to

Swift 2 iOS 9 and SqlLite

nr: #1 dodano: 2017-04-18 15:04

As others pointed, it's highly suggested that you upgrade to Swift 3. You can keep the target iOS to 9. As for the tutorial, I recommend Ray Wenderlich's "Getting Started with Core Data Tutorial".

https://www.raywenderlich.com/145809/getting-started-core-data-tutorial

Depending on your needs, you can also take a look at different data persistence methods (such as NSUserDefaults and realm). This post gives a good overview on persistence methods for iOS Apps:

http://www.thomashanning.com/data-persistence-ios/

nr: #2 dodano: 2017-04-18 15:04

This tutorial will help you get started with SQLite using Swift 2.2 and iOS 9 https://www.raywenderlich.com/123579/sqlite-tutorial-swift

However I highly suggest you look at Core Data unless you have some specific use case for SQLite. Core Data uses SQL under the hood but abstracts it away from you so you can use native APIs. And as others have pointed out, you definitely should use Swift 3+ as Swift 2 is already deprecated and unavailable in the latest version of Xcode. You don't need to worry about iOS 9 support, Swift 3 can support both iOS 9 and iOS 10. And you definitely want to focus on iOS 10 as its greater than 80% of the market at this point.

https://www.raywenderlich.com/145809/getting-started-core-data-tutorial

nr: #3 dodano: 2017-04-18 15:04

I think that if you want to use it only for user session maintenance in your app, then don't use core data unless you are thinking of complicating it further. If you still decide to use Core Data, here is a simple tutorial to do so Also the Ray Wenderlich tutorial is good, as suggested earlier.

I recommend you use this pod: https://github.com/stephencelis/SQLite.swift

It will give you an insight in using pods as well as the data persistence in swift.

The usage instructions are given in it's github page itself

Source Show
◀ Wstecz