Solar Powered Birdhouse
May 19, 2022
In my last couple of posts I’ve talked about the hardware and software behind my birdhouse camera project. I haven’t previously covered how I’m giving it all enough power to operate, and therein lies a tale.
No Power? No Problem If I had a power outlet located anywhere near the bird house, this would have been easy. Pretty much any micro-USB power adapter would plug into the Raspberry Pi, and I’d be set.
Raspberry Pi Birdhouse Software
May 9, 2022
In my last post I went over the components of the bird house camera I set up this year to get a better look at the local black-capped chickadees. Today I’ll talk about the software that makes it work.
Initial Setup Being relatively new to Raspberry Pi, I started off with a full install of Raspbian Deskop. It’s more than I need, since I won’t have anything like a desktop setup, but with a 64GB SD card I wasn’t concerned about the space.
Raspberry Pi Birdhouse Camera
May 7, 2022
My current non-app related project has taken me out into the back yard, but brought along my coding and technical experience. Given this site’s name, the project might be called the atomic birdhouse.
For the past couple of years I’ve had a bird house in my yard, in which black-capped chickadees have nested and raised chicks. I’d see them come and go, and sometimes hear sounds from inside the house.
Clash of the Optionals
Jan 21, 2022
…or, how to accidentally break Swift initialization rules.
Today I’m going to talk about optionals. Swift optionals. And also another kind of optional. And how you might break the ironclad rules of Swift without realizing it until it’s too late.
What is an “optional” anyway? It depends who you ask. Swift will give you one answer, but Core Data has other ideas. So what happens when you bring them together?
Core Data Using Only Code
Nov 8, 2021
If you know anything about Core Data, you’re probably aware of Xcode’s built-in model editor. If you’ve used Core Data, you’ve probably spent more time with it than you care to remember. It edits the data model, which then gets compiled to a binary form Core Data can use when your app runs. Conveniently it can also generate some code for you, subclasses of NSManagedObject for each entity in the model.
Stumping People for 1000* Years
Sep 2, 2021
* Base 2
Last week at 360iDev I hosted the 8th edition of Stump 360. Stump is an evening event that, to my surprise as much as anyone else’s, has become a tradition at 360iDev.
What is Stump 360? Stump started as an unofficial spin-off of “Stump the Experts” at Apple WWDC, which ran for many years. The two overlapped by a year or two, but WWDC Stump stopped several years ago.
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.