Core data, iCloud, and Cloudkit - ios

I am in the planning stage of a new project that will require to use Core Data. It has these requirements: 1. Be able to access same data across multiple devices. 2. Be able to access same data in offline or online 3. Guarantee data will not be lost.
Couple years ago, I embarked on similar project. But I had to abandon these features.
Does Core Data with iCloud syncing work well enough for current iOS 7 and 8 to warrant another attempt?
If not, I am thinking about using CloudKit and local Core Data storage. But then I will have to write extra code to update both.
Any suggestions?

You could use https://github.com/evermeer/EVCloudKitDao It's a CloudKit library with support for local caching (not Core Data, but files using NSCoding)

Related

Developing Quiz App - Data Storage iOS

I am planning to develop a quiz app in iOS and doing it offline. I need to store 100s of questions and options in that app. How to store? How does core data comes in handy here? Is there any other good methods for this problem?
The app is meant to be offline.
You can also use SQLite database for saving Questions and Answers offline for your Quiz app. You can create tables in SQLite and save and fetch data from that using SQLite queries.
I would recommend you to use realm.io. It measures better than core data, its fast and simple to use. On https://realm.io there is lots of documentation.
I find realm much easier to set up and in generally to comprehend. It works nicely with SwiftJSON and hence in my view much easier to connect to backend.
Preloading core data can be quite cumbersome and to me it seems that core data still relies heavily on objective c.
On the other Core Data is made by Apple so it could be more stable solution on longer run (parse.com)

Core Data iCloud sync or smth else?

I build an iOS app which works with base. User can work with it everywhere, that is cool. When application starts for the first time, obviously, base will be empty. For now, user's base stores data locally with Core Data. But there is a case, when user may have his own base with a lot of data and he do not want to start work from scratch. For this reason I want to create simple Cocoa App for macOS, which will allow user to import some data from, for example - CSV file.
Both Core Data models (iOS app and macOS app) will be the same. I just want to make sync between two platforms.
I think it's possible with cloudKit, but which way is the best? Core Data Sync or smth like supporting MySQL database on server, etc...
Thanks in advance!
Asking which method is "best" is a matter of opinion, but in mine, Apple has made working with iCloud fairly simple. If all you want to do is sync between platforms, I would use cloudKit. There seems to be no reason to spin up your own MYSQL database instance and introduce another level of complexity, when the functionality you're looking for is free and easily accessible.
See this WWDC16 video for some cloudKit tips: https://developer.apple.com/videos/play/wwdc2016/226/

Firebase's iOS Offline Capabilities vs Core Data

I am developing a small set of classes that will make it easy to keep your Core Data in sync with your Firebase. But, I recently came across Firebase's iOS Offline Capabilities and I noticed, regarding data persistence, it sounds to me like similar capabilities that Core Data would provide.
As I said, I am trying to make it easy for my Core Data to stay in sync with my Firebase. How do the two differ (if at all for my case)? More specifically, will Firebase offline provide similar effects? My intentions are for a single-user app, I do not need to support multiple users simultaneously on the same app. I need the data to persist so that users can access their data offline, and between app sessions/restarts.
I work at Firebase, and I once tried to do the same thing.
The Offline Capabilities of Firebase make using CoreData a bit superfluous. Firebase's offline handles a lot of the complexities like dealing with authentication offline and syncing after being offline for long period of time.
It might be useful to have a wrapper around CoreData if you really want to use the two together. However, I have found that it ends up being more complicated than it's really worth.
As an additional answer...Both Core Data and Firebase can both store data 'offline'. They have data persistence and will enable your code to run offline transparently to the user.
To dig a bit deeper, Core Data doesn't have an 'online mode'* (built in) whereas, as soon as Firebase has a connection - wham-o, all of your offline data is now online. (*CloudKit gives CoreData that online-ness)
Additionally, Firebase has real-time data updates, so if that's what you need Firebase is the way to go for that functionality.
So for your use case, as David mentions, you are duplicating off-line functionality in many ways - especially if this is a single user only use.
If you've already got CoreData & CloudKit working, it may not be worth the time to also loop Firebase into the project - it really depends on the scope of the classes you are building.
I have started with Firebase and stumbled upon these two issues that made me switch back to CoreData:
No offline search - Firebase (online or offline) search is very limited, and they recommends using a third party service like Aglolia, which needs another subscription, another offline mode, another authentication etc. CoreData just supports searching via SQL like language and it is easy.
No offline attachments - Firebase (real time database or cloudstore) doesn't have offline attachments feature, and Firebase Storage doesn't have an offline mode as well, so I will need to implement this on my own.

Alternatives to iCloud + Core Data to sync data between iOS and OS X

I'm developing an application for iOS/OS X and i want to sync data between them.
for now I use Core Data for persistent data.
I read that iCloud is not enough mature to use with core data.
Is that true ?
so i try to use the new DropBox sync API(to sync the SQLite file), but there's no support for OS X.
Is Parse SDK a good idea? (it will also allow me to add Android support)
If no, have you other solution?
Thank you.
i read that icloud is not enough mature to use with core data.
is that true ?
Yes, I've worked with it quite a bit but I cannot recommend it at present.
so i try to use the new dropBox sync API(to sync the sqlite file), but there's no support for mac.
is parse sdk a good idea (that will allow me to add android support)?
if no, have you other solution ?
Parse has a good reputation. There's an open source project called FTASync that integrates it with Core Data.
Some other options:
TICoreDataSync, which syncs via Dropbox but lets you use Core Data
WasabiSync, a third-party project that syncs Core Data via their own servers.
Simperium, another one like Wasabi, syncing Core Data via their own servers.
At present I don't have enough experience with any of these to endorse them. They're all designed to sync Core Data outside of iCloud but I can't say which works best.

Is it possible to migrate Data from iPhone to any Desktop SQL Data Base?

I'm developing an app that stores data in the iPhone, but I need to know if it's possible to export the data (as an entities, tables, .txt or xls) to a desktop because I need the data to be readable on my Computer OR do I need to create a web site to do it?
By the way.. I'm still not sure what method is more effective for this kind of app, Core Data or SQLite.
Core Data on the desktop and iOS are identical. You can stand up a SQLite file created on either on the other with no issues. In these situations it is highly recommended (I would say necessary) to use the same data model in both applications.

Resources