Do you often forget [weak self]? Here’s a solution
Mar 11, 2018, 9:55 AM
Let’s talk about closure-based delegation, retain cycles and genericsRead a 2020 follow-up to this story here: No more [weak self], or the weird new future of delegationOkay, so today’s post is about delegation and how we can make it...
Don’t underestimate how slow the disk really is
Feb 28, 2018, 3:09 PM
You should not treat every piece of data the same way. Here’s whyAlright, no additional introductions this time — I’ll just cut straight to the point:Only, only request a data in a synchronous manner if it’s coming directly...
Introducing AppFolder
Jan 23, 2018, 2:45 PM
Folder of your iOS app — friendly and strongly-typedEach one of your iOS apps has an associated container with it, where you, as a developer, can store basically anything you need. This is often referred to as a “sandbox”. Inside this...
Turning Swift compile-time safety into safety for your users
Jan 16, 2018, 4:27 PM
Sometimes good coding practices lead to good UXWhat happened?Technically, today nothing stops you as a developer from unintentionally or accidentally making irreversible changes (e.g. deleting user data) without confirmation from the user....
How to share layout code between UIView and UITableViewCell subclasses
Jan 15, 2018, 7:40 AM
Short story of “composition over inheritance” (including generics, yay!)Disclaimer: this technique is relevant only if you create your layouts programmatically (without Interface Builder and Storyboards). If you want to take a deep look at...
Introducing Time
Aug 21, 2017, 5:13 PM
Type safe time calculations for SwiftIn Cocoa, TimeInterval (ex NSTimeInterval) is the only thing that defines time. But, actually, it’s just a typealias for Double, and so it doesn’t have any descriptive meaning. Just a number. It’s not...
Lightweight persistence in iOS shouldn’t be this hard
Jun 6, 2017, 6:09 PM
Introducing Shallows — a reusable, easy-to-use caching libraryI think you would agree that sometimes in iOS things that should be easy are made hard. Okay, not hard, but cumbersome, unintuitive, and absolutely no fun.One of the good...
How to use custom type as a key for NSCache
Apr 18, 2017, 3:20 PM
NSCache is an amazing Cocoa API which is often overlooked by the developers. NSHipster has an amazing article on it, so I’ll go straight to business.In Swift 3, NSCache is a generic type. But it doesn’t work as a regular Dictionary. In...
Introducing Placeholders
Apr 17, 2017, 10:08 AM
Set and animate multiple placeholders on UITextFieldPlaceholder is a powerful concept with a long history — it’s easily recognizable by users, has a strict, reasonable meaning and gives the developer an easy way to hint...