Topic

Notification

A browsable archive of writing and notes across the site.

Post

UserDefaults and Keychain

Apple offers several persistence options, and UserDefaults and Keychain are the two you reach for most often in day-to-day app development. From past conversations with colleagues …

Post

In-app purchase

If your app ships on the App Store, in-app purchase (IAP) is something you can’t really avoid. Last year’s spat between WeChat tipping and Apple put IAP in the …

Post

Dependency injection using factories in Swift

Original: Dependency injection using factories in Swift Original author & copyright: @johnsundell Dependency injection is one of the key tools for making code more testable. …

Post

Handling non-optional optionals in Swift

Original: Handling non-optional optionals in Swift Original author & copyright @johnsundell Optionals are arguably one of the most important features of Swift, and one of the …

Post

Understanding responders and the responder chain

Apps receive and handle events through responder objects. A responder is an instance of the UIResponder class — and UIView, UIViewController, and UIApplication, all the usual …

Post

Capturing objects in Swift closures

Original: Capturing objects in Swift closures Original author @johnsundell Ever since blocks were introduced to Objective-C in iOS 4, they’ve been a core part of the most …

Post

@autoclosure && @escape

Closures are first-class citizens in Swift, which means you can pass them around as arguments. While learning Swift, you keep running into keywords that decorate these closure …

Post

Everything you need to know about iOS 10 notifications

Overview Push notifications are something we’re all familiar with — pretty much anyone with a smartphone gets interrupted by them every day. The right notification is a …

Post

Building an elastic view animation with UIBezierPath

Original: Elastic view animation, or how I built DGElasticPullToRefresh Author: @gontovnik DGElasticPullToRefresh demonstrates a springy elastic effect. Here’s what it looks …

Post

A bit about Category in Objective-C

A category in Objective-C is a compile-time mechanism that lets you tack extra methods onto an existing class. There’s one catch: you can’t add new instance variables …

Post

Understanding the Objective-C runtime

The Objective-C runtime is one of those language features that’s easy to overlook when you’re just stepping into Cocoa/Objective-C land. The reason is simple: …

Post

How we built the Guillotine menu animation for iOS

Original: How We Created Guillotine Menu Animation for iOS Author: @johnsundell Ever wondered why nearly every app’s menu is a sidebar? Why isn’t it a topBar, a …

Post

[257] Binary Tree Paths

Problem: 257. Binary Tree Paths Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 1 / 2 3 5 All root-to-leaf paths are: …

Post

[018] Length Of Last Word

Problem Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of last word in the string. If the last word does not …

Post

iOS remote push notifications: a deployment walkthrough

iOS push notification setup has been driving me crazy for the past few days, so I’m writing up everything I learned for anyone else who might run into the same wall. How iOS …