Arthur’s Coding Tips

Articles on Swift, Objective-C, and iOS projects

Latest

A small bug on the URL property of the NSURLComponents class

Earlier today, I was writing a function that would throw an error if the URL property on an NSURLComponents object wasn’t properly set…. That function never threw, even when instantiating an empty NSURLComponents object. According to the docs on NSURLComponents, the URL property should be nil if nothing is set. Unfortunately, this isn’t true in practice. ¶ Snippet from the NSURLComponents docs: ¶ If the components object has an authority component (user, password, host, or port) and a path component, then the path must either begin with “/” or be an empty string.
Go to the profile of Arthur Ariel Sabintsev
Arthur Ariel SabintsevMar 27

A note about my OSS repositories

Over the weekend, I added Carthage support to my top 7 Objective-C and Swift OSS repositories. I also added Swift Package Manager support…for my Swift OSS repositories. These repos already supported CocoaPods. ¶ Harpy ¶ Siren ¶ FontBlaster ¶ Zephyr ¶ Magic ¶ UIFloatLabelTextField ¶ UIFloatLabelTextView ¶ All of my future repositories will be written in Swift and will support all three package managers, regardless of their popularity.
Go to the profile of Arthur Ariel Sabintsev
Arthur Ariel SabintsevFeb 8

1 Month of Floppy Candidate

A month ago, we at The Washington Post released Floppy Candidate, a free app for both iOS and Android. I led development on the iOS app and…I thought it would be fun to share some statistics (specific to the iOS app only) on how we’ve done. ¶ Since December 14, 2015, we’ve had: ¶ Over 15,000 downloads ¶ Approx. 2 million games played (~130 games played per user) ¶ Approx. 1.4 million quiz questions have been answered ¶ An average of 4.5 stars on the App Store for all versions ¶ Reached #30 in the U.S. App Store for Trivia games (in our launch week) ¶ Other fun stats: ¶ Most Played Republican: Donald Trump (~900,000 games) …
Go to the profile of Arthur Ariel Sabintsev
Arthur Ariel SabintsevJan 14

My First Swift-Evolution Proposal!

I just submitted a PR to the Swift-Evolution project. The proposal is about arrays and how their interpreted in variadic functions.Here’s the link to my proposal.
Go to the profile of Arthur Ariel Sabintsev
Arthur Ariel SabintsevDec 11, 2015

Zephyr: Effortlessly sync NSUserDefaults over iCloud

Zephyr is a Swift library that does two-way synchronization between NSUserDefaults and NSUbiquitousKeyValueStore. Zephyr allows you to…synchronize either specific keys or all of your NSUserDefaults with one line of code. ¶ Zephyr also has a built in a monitoring system that allows you to register certain keys to be synchronized immediatley when their value changes. ¶ For example, if you register one or more keys for monitoring, Zephyr will automatically synchronize those keys to/from iCloud the moment your app is notified of their change. ¶ More information can be found on the github page.
Go to the profile of Arthur Ariel Sabintsev
Arthur Ariel SabintsevNov 4, 2015

Two Awesome Commands for Cleaning Up Local Git branches

This first command prunes all local references to remote branches that no longer exists on the remote hostThis next command removes all local checked-out branches that have been merged into master (and the develop branch if you’re using git-flow): ¶ I’ve aliased gitpurge on my bash profile to simplify execution of this command. ¶ Enjoy!
Go to the profile of Arthur Ariel Sabintsev
Arthur Ariel SabintsevOct 25, 2015

Swift 2.0 updates to Siren, FontBlaster, and Magic

Xcode 7 GM is out, which means it’s time for Swift OSS developers to update their projects’ master branches to support Swift 2.0! As I…currently maintain three Swift OSS repos, I wanted to make sure they were ready to ship as soon as the GM build was live. ¶ As of a few minutes ago, they’re good to go! ¶ Here’s the low down: ¶ Siren (v0.5.0) ¶ Updated to use Swift 2.0 ¶ Updated for iOS 9 ¶ Multiple bug fixes to long-standing oversights ¶ Download link: https://github.com/ArtSabintsev/Siren ¶ FontBlaster (v2.0.0) ¶ Updated for Swift 2.0
Go to the profile of Arthur Ariel Sabintsev
Arthur Ariel SabintsevSep 9, 2015

Narwhal v1.5 Released to the App Store!

About a month ago, I joined the @GetNarwhal team. The iOS app we’re building is a client for Reddit. Today, we released v1.5.4, the first…version where my contributions are live. ¶ The entire list of features can be found in the release notes on the App Store, but here’s a quick highlight of some of the features I added: ¶ Tap the Narwhal icon for fast theme switching ¶ Regex parsing and hot-linking of subreddit (/r/) and user links (/u/) ¶ Improved sharing to multiple aspects of the app ¶ Improved private messaging UX ¶ Support for opening links in Google Chrome ¶ There’s a lot more in our pipeline.
Go to the profile of Arthur Ariel Sabintsev
Arthur Ariel SabintsevAug 7, 2015

Importing C Static Libraries into a Swift project using Cocoapods

I came across a situation over the last few days where I needed to import third-party C-Static libraries into a Swift project that also had…Swift dependencies (e.g., had the use_frameworks! flag in the Podfile) using Cocoapods 0.38+. Unfortunately, everytime I attempted to do it, I got the following error: ¶ The only way to get around it was to make a custom podspec for the static library you were trying to import, and point to that custom podspec in your Podfile. I’ve performed the method described below on multiple static libraries, some that had framework wrappers, and some that just contained the .a
Go to the profile of Arthur Ariel Sabintsev
Arthur Ariel SabintsevAug 4, 2015
More stories →About Arthur’s Coding Tips