I maintain a fairly popular open source project called Disk that helps iOS developers work with the iPhone’s filesystem. I had to learn the inner workings of obscure iOS frameworks and build Disk around Apple’s exhaustive storage guidelines involving user privacy and iCloud backup behavior — all appropriately handled behind Disk’s simple API, saving tons of iOS developers from having to understand it all themselves. Unfortunately after moving out to California and getting a full time job I found myself committing less time to open source and no one I trusted was willing to take over the project. …
I’ve been an open source developer since I was in high school. It’s part of who I am as a software engineer, and I’ve learned so much and met so many along the way. About 5 years later, it even helped me land my first job, which was the first time I got paid for programming in my life. All of a sudden my time had a real dollar value, and I started looking at programming from the lens of a responsible, bill-paying adult (in California). Needless to say, I found myself working on my open source projects less and…
During my transition from relying on Alamofire to working with the native
URLSession class myself, I’ve come across a fundamental issue with data tasks that Alamofire handles for the developer behind the scenes — creating multiple network requests to the same URL at once. This is actually a pretty common problem; think of a scenario where you’re loading images into table view cells, and the user is scrolling through the cells fast. In this scenario, images that aren’t cached are called to be downloaded in network requests, but what if while an image is being downloaded, it’s requested again and…
You’ve probably seen this tooltip control in some of Apple’s default apps or when editing text on iOS. This tooltip actually has a name,
UIMenuController, and can be customized and used in your own app, although the API can be kind of hard to grasp.
Similar to how an app has a
UIView hierarchy stemming from a
UIWindow, it also has a
UIResponder chain, since views are inherently responders.
Update: Checkout my open source framework, Piano. It makes using the Taptic Engine much easier, allowing you to create patterns of sound patterns and vibrations.
If you haven’t downloaded iTranslate’s Converse app, I suggest you do so now and play around with it — it’s a very well designed & polished app. What really stood out to me in Converse’s user interactions was the subtle vibrations that came with each swipe and transition between views in the app — something you’ll notice adds a spirited feeling to the user experience, yet doesn’t obstruct the seamlessness of the interface. …
Codable structs is an absolute delight, but it can get kind of tiresome having to instantiate
JSONDecoder whenever we want to retrieve or store model data. I threw together a little helper class called Storage this weekend that helps with this process tremendously.
Let’s say we have a model called Message…
… and we want to store an array of Messages to disk…
… and later we might even want…
The worst part about adding a
UITapGestureRecognizer or any sort of gesture recognizer/target action is implementing a new function solely for the selector parameter. Today I’d like to share a neat trick I threw together that let’s you add gesture recognizers without selectors.
Let’s say we have a
UIImageView in our View Controller and we want to add a
UITapGestureRecognizer to it that prints out a statement whenever it’s tapped.
Normally we would create an instance of a
UITapGestureRecognizer and set it’s target to the View Controller and its selector as some function we quickly threw together (
myImageViewTapped(sender: UITapGestureRecognizer)). …
Thank you all for the great feedback on the previous article! Some of you wanted to know more about different networking requests and alternative persistence methods, so hopefully I can shed some more light on the matter with this article. If you haven’t already, I recommend reading Part 1 to learn a bit about making a simple GET request to JSONPlaceholder, converting the response data to structs, and saving those structs to disk.
And let’s say…
With the release of Swift 4, Networking with
Foundation’s built-in classes has never been easier, and structs are even more robust with their ability to encode/decode to and from JSON using the new
Until now there have generally been only three ways to persist data on iOS:
UserDefaults — simple key-value storage, preferably to be used for any user settings or app states.
NSKeyedArchiver/NSKeyedUnarchiver — provides a way to encode objects into an architecture-independent…
There’s two kinds of iOS developers out there — those that use storyboards and those that create & layout their views programmatically using frames or constraints. The latter half know and understand the struggles of dealing with massive view controllers, where most lines are dedicated to initializing views, setting constraints/frames, and animation code. MVVM attempts to fix the struggles of massive view controllers, but it doesn’t cut the bill for apps with complex views, layouts, and animations. As someone that takes interface design and animation seriously, this was a problem.
I’ve open sourced several UI components and interactions, and a…