MacOS and Swift 3.0

About a month ago, I started working on converting an iOS app to Swift 3.0. The iOS app was basically converted a few weeks ago, and additional functionality has been added. The macOS version didn’t exist, so I started from scratch. One of the most important reasons I’m doing this exercise, is to test the CloudKit synchronization over different device and platforms. Not just as a proof-of-concept, but as a completely functioning solution. I already got the synchronization working between my iPhone and iPad, but with the Mac it didn’t work.

Embarrassing!
Years and years of developer info on stackflow often helps, but for Swift, you better specify that you want swift 3 examples and even than you will mostly get iOS code. With Objective-C you mostly get iOS code as well, but in the case of Swift 3, this is double so.
So you download examples of Apple and others; you look at wwdc videos to see what you missed…. nothing. This should work!
So what I usually do, is continue with other stuff, and in most cases you find the solution sooner of later.
By chance, I was working on another iCloud issue, when I noticed I had switched iCloud accounts. Meaning, that when I’m developing in xCode, I connect with my developer account to iCloud (and CloudKit), and my iMac was using my personal iCloud account… of course this doesn’t work. Accounts are synchronized, not devices, so when you are not logged in to the correct account, you don’t get any updates. OMG, how stupid.

That being said, I do find Apple should allow me to have more than one iCloud account active. Maybe you have a personal and business iCloud account, and you want the corresponding apps to sync, or even get the info of the two account both displayed in the app.
You could share items with other accounts, but this doesn’t really cover it for me.

Anyway, I learned a lot, but basically lost a lot of time trying to solve a problem that didn’t exist.
Have a nice week…

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s