100 Days of Code Day 1: Making the Photo Gallery, Abandoning it, Reading, and the SS Blog Processor Reborn.
Some of my friends (including my podcast co-host Tiffany White and friend-of-the-show Alex Gwartney) have been doing the 100 Days of Code challenge. This involves getting in some sort of programming in every day, which I pretty much always do. However, I want to log what I’m doing each day on here.
New iOS App… Not!
Today I worked on and explored an app that hides photos and videos from the camera roll. The native Photos app only allows for hiding from the regular photo in Moments, Collections and Views. The hidden images are easily viewable in a "Hidden" album. Let’s say you have a terrible rash, and took a picture to show your dermatologist. You don’t want the photo to sync to all of your devices, and you also don’t want your hidden image available in a "Hidden" images album. This idea tries to solve this problem. It’s a password an Touch ID protected image gallery. Simple, right? I thought it would be smooth sailing… but there are plenty of challenges.
The Image Gallery
I spent the last week or so digging into the ins and outs of implementing an image gallery. At first, I’d thought I’d be able to use a little image gallery library to get started. However, most of them haven’t been updated in a while and do not meet my needs. Also a lot of the libraries do not take advantage of UIKit’s UICollectionView
and UIPageView Controller
, preferring to reinvent the wheel. I found that after hours into trying to adopt a library, I was spending more times fighting it than getting what I wanted done.
I ended up with an image gallery that has much less code than the libraries I was looking at. A lot still needs to be ironed out. There are tricky parts when it comes to zooming and scrolling, bugs to squash, and other parts I’d like to refine, but it’s mostly all there!
However, I won’t developing this app, and I’m going to release what I do have on Github as soon as I can.
….But Why???
I’d hope that people who would shell out money for such an app care about photos, the meta data, and image quality. As it is, this is lost in the transfer of the image from the Photos app to this gallery. I can already see complaints pouring in of customers who’ve lost important parts of an image when they restore it to the camera roll. I wouldn’t let that happen!
I could remedy this with some hard work, but I’m not a photo guy. I’m not the type who is always taking advantage of the advances in smart phone photography. I have a bunch of photo editing and filtering apps but I’m never using them. I even forget to take pictures of special events and my friends are the ones picking up the slack. I do not know what makes a great photo app! Also, there are many photo hiding apps on the App Store. While I’m confident that I could make something that surpasses what’s out there, I am not excited about the prospects. I don’t see any real money in an photo hiding app. On top of that, with a single line of code in the stock Photos app, Apple could render this app obsolete.
Realm vs. Core Data
Moodsmitten uses Core Data and it works well. However, I’d like to learn about other databases.. Realm seems like a great place to start, especially because it is cross platform and open source I’m excited about Realm because I won’t have to use Core Data’s GUI tools and I don’t have to worry about thread safety. Today I fiddled with Realm in the photo hiding app. I got it working quickly. Ensembles/Core Data/CloudKit have been great to me, but Realm is so simple and powerful!
Reading of the Day.
objc.io just updated it’s Advanced Swift book for Swift 3. I’m determined to get through it as I follow along in an iPad Playground. I’m still in the second chapter on collections, but I went through my photo gallery code and swapping out many for…in loops for higher level functions.
The Soundsmitten Blog Processor 2.0: Now in Swift 3!
The blog processor scripts I’ve been using for Soundsmitten have been collecting dust for a while. A lot is broken and I don’t want to get into the quirks of JS and npm as much as possible. Also, I’ve wanted to be able to use Ulysses to blog and be able to post on iOS.
I’m experimenting with new scripts that use Swift that parse the TextBundle format. They will run on my Linux server, so I’ll I have to do is upload a zipped .textbundle file to a watched folder on the server.
That’s all for today. Stay tuned for day 2!
Did you like this post? Are you smitten for Soundsmitten? Click the "Tweet" link below to retweet my post. It keeps my livelihood afloat, brightens my day, and I'm always eternally grateful. Thanks for your help!