Core Data Backups, Redux
Mar 29, 2021
This is the second of two posts following up on my earlier post about backing up and restoring Core Data.
My past post covered the difficulty of learning how to use mostly-undocumented framework methods, specifically about a Core Data method called replacePersistentStore(...). Arnaud Joubay recently messaged me to ask why I used a different approach when backing up and restoring persistent stores. Now that I’ve had some time to look at that method and work out what I can about how to use it, let’s see how it works in practice.
Mar 25, 2021
Last year I wrote about backing up and restoring Core Data. Recently Arnaud Joubay messaged me to ask about it. I used a method called migratePersistentStore(...) to duplicate a persistent store. Arnaud asked why I had not used a similar method called replacePersistentStore(...) instead. He also sent me a link to a post on Apple’s dev forum site, attributed to an anonymous framework engineer, which had this to say on the topic:
Backing up Core Data Stores
May 26, 2020
Today we’re going to travel back in time a little with Core Data. Or at least find out how your app can do so. What if you want to make a backup copy of your app’s data? What if you want to restore from that backup later on? This won’t be mainly about data safety, because your app’s data will be getting backed up to the user’s iCloud account and, maybe, their Mac.
Adding thumbnails with PDFKit
Apr 15, 2020
Today I’m continuing with some ideas from my recent post about using PDFKit. In that post I was using a custom PDF view for an app that would work something like a basic slide presentation app.
Part of that was adding a thumbnail view with PDFThumbnailView, which ended up looking like this.
PDFThumbnailView works with a PDFView and generates thumbnails for pages in the current document. You can tell it how big the thumbnails should be and whether to arrange the thumbnails horiontally or vertically, but that’s about it as far as layout goes.
JSON vs Property Lists, Revisited
Mar 3, 2020
In a previous post I wrote about How JSON compares to Apple property lists and the obstacles to converting data between them. That was a while ago but the post is still accurate, as far as it goes. But Swift changes the situation in some ways, so an update is in order.
Recap: JSON vs. Property Lists The previous post was motivated by the problems some people encountered trying to download JSON from a server and then save it as a property list.
Getting started with PDFKit
Feb 26, 2020
In my post about my custom presentation slide app I mentioned that because of time constraints, I decided against doing my own slide layout. Instead I’d do that in DeckSet, export my slides to PDF, and show the PDFs in my app.
So, how do you do that then?
Getting a PDF on the screen The basics of PDFKit are actually pretty basic. If you have a PDF, you create a PDFDocument to hold it and a PDFView to display it.
Interactive Presentation Slides at 360iDev
Jan 28, 2020
This is a story of how a trip to a karaoke bar led to me writing my own app to display presentation slides. Of how a user interface that allows live smartass comments led to me being completely nerd sniped until I was able to do something I’ve never seen in a conference session– however silly the result was.
In the end audience members could send Emoji and other images directly to the slides during the session, which ended up looking like this.
Better logging with Emoji
Jan 17, 2020
Apple’s developer tools provide a rich variety of debugging aids. Sometimes though, it’s useful to do things the old fashioned way. With debugging, this often means just printing out data while your code runs, and then looking through the results to see what’s going on.
Some scenarios where printing debug data helps include:
When you need to check on something that happens a lot. When the mental context switching between using your app and using the debugger gets to be too much.
Return to Independence
Jan 14, 2020
Aaaaand, I’m back. It’s been a long time since I posted anything here.
Mainly this was because I worked full time for a while. I found it hard to work all day on someone else’s project, then come home and do even more blog-worthy code-related stuff. At the end of the work day I was done with code. So, this blog faded away. Back before that, in my glorious years of independence, I could find time to explore whatever technical areas caught my eye.
BombBomb in the Gazette
Nov 4, 2017
The Colorado Springs Gazette just did a nice feature article about BombBomb, the place where I write apps these days.