Archive for 'iPhone'

Swift Reactions

So yeah, that yesterday. That was a thing, wasn’t it? Most of the plethora of announcements we found more along the lines of good show and thank you yes that’ll certainly help shut up the fandroids, but kinda obvious that was a good idea and not any too soon either; but on the scale of 1 to Did Not See That Coming, at “Asteroid Impact” level with this one, pretty much:

Screen Shot 2014-06-03 at 5.14.19 AM.png

Swift is an innovative new programming language for Cocoa and Cocoa Touch. Writing code is interactive and fun, the syntax is concise yet expressive, and apps run lightning-fast. Swift is ready for your next iOS and OS X project — or for addition into your current app — because Swift code works side-by-side with Objective-C.

Woah. Right then, time to get started earning your Swift merit badge, folks.

We’ll be adding good links as we find them, but just to get you started:

Welcome to the brave new Swift world! Especially to those Kotlin fans in the audience, as apparently the Swift designers were [EDIT: Nope, just common inspirations, so it appears…]


10 Early Thoughts on the Swift Programming Language

Swift Language Highlights: An Objective-C Developer’s Perspective

Michael Tsai’s Swift Links

Learning Swift: Ordered Dictionaries

Say Hello to Cocos2D-Swift!

Swift Initializers

GoshDarnClosureSyntax and GoshDarnSwiftBlockSyntax and GoshDarnSwiftSyntax channel a popular Objective-C reference

Subclass UIApplication with Swift

Terrible Swift Ideas!

@mhm500’s Swift Cheat Sheet gitbook

Mike Ash’s Friday Q&A 2014-06-20: Interesting Swift Features and Friday Q&A 2014-07-18: Exploring Swift Memory Layout and Friday Q&A 2014-08-01: Exploring Swift Memory Layout, Part II

jas/swift-playground-builder: “Create your own interactive Swift playgrounds with embedded documentation compiled from Markdown.”; iOS 8: Interactive Playgrounds; iOS 8 Demo: Interactive Playgrounds and Functional Programming

Playground has never been so fun — bundle playground and library in workspace; XCode 6: How To Add Image Assets To Your Playground

We ❤ Swift on How to make awesome UI components in iOS 8 using Swift and XCode 6

Inside Swift

Advanced Swift – Part 1 and Part 2

Ray Wenderlich’s Swift Tutorial: A Quick Start and Part 2: A Simple iOS App and Part 3: Tuples, Protocols, Delegates, and Table Views

Understanding Optionals in Swift; A Beginner’s Guide to Optionals in Swift; A Morning with Swift Optionals; Swift Optionals; Unwrapping Multiple Optionals; Implicitly Unwrapped Optionals In Depth; Understanding Optional Chaining; Optionals Case Study: valuesForKeys; Swift Optionals: When to use if let, when ? and !, when as? and as; The Point Of Optionals?; Swift: Using Map to Deal with Optionals; Tearing Down Swift’s Optional Pyramids of Doom; The Complete Guide to Understanding Swift Optionals; How I Handle Optionals In Swift; Swift: The Unused Optional Value Problem

Swift Sequences and Lazy Evaluation; Lazy by name, lazy by nature; Randomly Lazy

Dollar and Cent: “Dollar is a functional tool-belt and Cent is an extension for missing methods in Swift.”

ExSwift: “A set of Swift extensions for standard types and classes.”

Making Multiplayer Games using AppWarp in Swift

Developing iOS8 Apps Using Swift – Create a To-Do Application, Connect to the iTunes Search API, Best Practices, Adding Interactions, Async image loading and caching, Interaction with multiple views, Animations, Audio, and Custom Table View Cells

Swift & Cocoapods: “How to integrate Cocoapods into a vanilla Swift project.”

Swift Standard Library: “Documented and undocumented built-in functions in the Swift standard library – the complete list with all 74 functions.”

We ❤ Swift: One month of Swift

Custom Threading Operator in Swift; Async: “Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch.”; Latency As Effect in Swift; FutureKit / FutureKit: “A Swift based Future/Promises Library for IOS and OS X”

Tutorial: Using Generics To Implement KVO In Swift

Programming Challenge: Are You a Swift Ninja? Part 1

Swiftris: Build Your First iOS Game with Swift

Swift: Use for-in loops with your own sequence types; Sequences and Generators

Wayne Bishop’s Algorithms & Data Structures with Swift

Getting started with UIKit Dynamics in Swift Part I and Part II

Learn -> Swift: “A no-frills introduction to Swift for busy and/or curious people.”

Locking in Swift: Helping Protect Me from Myself

Swift Operators; Operator Overloading in Swift Tutorial; Facets of Swift, Part 5: Custom Operators; Operator Overloading — Tailor Swift To Your Needs; Custom Operators in Swift; Choosing the Best Expression

that thing in swift – “How do the Objective-C patterns we already know translate into Swift?”; Design-Patterns-In-Swift

Protocols in Swift: Blueprints for success; Swift Default Protocol Implementations; Swift Comparison Protocols; Swift’s Protocol Extension; Protocols and Swift; Swift and Protocols; Protocols and Generics; Generic Delegate Protocols

Apples to apples, Part II

Collection Data Structures In Swift; Swift Collection Protocols; Sorting Nibbles in Swift as a collection

Arrays and their Methods in Swift; Array extension to calculate summary statistics; Custom Subscripts in Swift

Swift Dictionary Quick Reference

Swift Set Type in Swift 1.2

Swift Literal Convertibles; Swift Literal Convertibles for Foundation; Literal Enumerations

Integers and Numeric Literals in Swift; Swift: Madness of Generic Integer; A Sanatorium for Swift Generics; Swift + Int: The little struct that could

Replace Magic Strings with Enumerations in Swift; Tuples, Structs and Enums; Raw​Option​Set​Type; Enums in Swift; Enums Instead of Booleans; Swift: Raw{Not}Representable enum; NS_OPTIONS Bitmask Generator for Swift; Loopy, Random Ideas for Extending “enum”; Swift: Enums, Pattern Matching & Generics; Swift Generics

NSNotifications with userInfo in Swift; Functional notifications

Tuples in Swift: Create, Read, and Return; On Typed Tuples in Swift; Tuples In Swift; Tuple as Function arguments

Prototyping Animated Transitions in Swift and Transitions in Swift (Part II) #16 Swift

Functional Swift and Memoization


Swift Extensions Part 1 — Computed Properties and Initializers; 3 Nuances of Swift Extensions + Clarifying Swift Access Control

How to Build a Trivia App Using Swift Programming Language

Swift + Objc = Magic

Facebook Tweaks with Swift Tutorial

10 Swift IOS open-source projects you cannot ignore

Structures in Swift

Design Teardown: Stretchy Headers

Developing a Bidding Kiosk for iOS in Swift

Swift Initialization and the Pain of Optionals; Swift: Strange tales of initialization; Swift: The quiet affair of the failable initializer and the nil coalescing operator; Failable initializers, revisited; Nil-coalescing Operator in Swift; Nil Coalescing Operator

A Swift Corner Case “…we suddenly were left with a closure that was automatically returning something of type Void?, which clashed with addOperationWithBlock()’s expectation of Void…”

Swiftly Typing on Error Handling; Error Handling in Swift: Might and Magic and Part II; antitypical / Result “Swift type modelling the success/failure of arbitrary operations”; Swift: Putting Your Generics in a Box; Clean Optional Parameters

The Design of Types

Running Totals and Force Unwraps

Using String Ranges The Functional Way

Why we’re rewriting our robotics software in Swift

Swift Method Dispatching

Bindings, Generics, Swift and MVVM; From MVC to MVVM in Swift; Solving the binding problem with Swift; MVVM, Swift and Reactive Cocoa — It’s All Good!; Reactive Swift; MVVM In Swift

UIKitSwagger: “Simpler UIKit development in Swift.”

Swift’s pattern-matching switch statement; Custom Switch Matchers; Switches and Optionals; Filling Table Views demonstrates using switch on tuples; Pattern Matching in Swift

The 12 Apps of Swiftmas

Favorite Swift Tips & Tricks of 2014

EasyCast: “Makes math operations in Swift easier by adding automatic casting between Int, Float, CGFloat, and Double.”

Avoid using var with this one weird trick

More fun with implicitly wrapped non-optionals

Friday Q&A 2015-01-23: Let’s Build Swift Notifications; Implementing Events in Swift; Exploring KVO Alternatives in Swift; Exception Handling in Swift

Friday Q&A 2015-02-06: Locks, Thread Safety, and Swift; Friday Q&A 2015-02-20: Let’s Build @synchronized

Real World Swift

Swifty APIs: NSUserDefaults; AppInfo — Swift Api for InfoDictionary

Swift State Machines, Part 1 and Part 2 and Part 3: Follow Up and Part 4: Redirect

Swift Resistance; Swift Resistance Explored; Writing our first Swift app

Swift & C: What I Learned Building Swift Bindings to libgit2; Extending C structures in Swift; Tutorial: A Quick Guide To Using C Libraries Within Swift Code; NSHipster’s Unmanaged; Swift: Working with Unmanaged Objects

Swift & the Objective-C Runtime; Objective-C Runtime with Swift

Swift: Associated Types

Swift Quickie: Capture Lists

The Importance of Being `final`; Increasing Performance by Reducing Dynamic Dispatch

Polymorphism with Return Types; Stupid Disambiguation Tricks; Type Safety in Swift: A Route Back

Dynamic Casting in Swift; Casting In Swift 1.2

Value Types Are More Valuey Than You Think

Swift asserts – the missing manual

Looping In Swift

Swift typealias to the rescue

SwiftScripting [via ScriptingBridge]: Swift Scripting Part 1 and Part 2; blakemerryman / Swift-Scripts

Swift: Occam’s Code Razor “I’m continually fascinated by how Swift compiler inferencing enables you to omit code details.”

Overriding and overloading

And note our various more focused followups for specific technologies like Core Data, SceneKit, etc.; and non-specific’s Functional Programming In Swift for discussions of functional programming concepts

Swiftly Improving for Swift 1.2 specific discussions

And these curators:

Awesome Swift at ZEEF

Wolg / awesome-swift: “A curated list of awesome Swift frameworks, libraries and software.”

matteocrippa / awesome-swift: “A collaborative list of awesome swift resources. Feel free to contribute!”

Swift Toolbox “is a community-supported catalog of iOS and OSX libraries written in the Swift Programming Language.” has tutorials, examples, etc…

Swift Tutorials has more neat links

Erica Sadun’s Swift postsplaygrounds, operator snippet, type conversions, …

Follow @SwiftStack_ for Swift StackOverflow questions. (And @ObjectiveCStack for Objective-C.)

Subscribe to Swift Coder Weekly for a weekly digest, archives here; also Swift Dev Weekly and This Week in Swift

Swift Programming at Medium

Sign up for video tutorials starting July 1 from @SwiftCastTV

Swift Language Google Group

vandadnp / swift-weekly: “Weekly Swift Language Gems, Tips and Tricks.” curates resources for forum discussions

Continue Reading →

WWDC Student Submissions

Here’s a little something to take a look at as a break from all the entail-reading, wishful thinking, and outright nuttery that’s going around while we all wait for this year’s shoes to drop next week: check out TosinAF/WWDC-2014-Submissions for a list of all the WWDC Student Scholarship submissions people felt like sharing — 63 so far! And browser demo people are powering a showcase of all the videos in one place. Here’s three we found particularly interesting at first glance:

Gold star for niftiness to neerajbaid/WWDC2014 who did his résumé map-based. That’s such a neat idea, think we’ll steal it.


And top “interesting idea…” marks to BalestraPatrick/WWDC-2014-Scholarship who made the background a blur of the front camera feed.

And some particularly cool node dynamics in conradev/WWDC2014.

Lots of nice work in the other five dozen too; check them all out and prepare to be impressed.

Now, back to applying ourselves even harder to our own proficiencies — clearly we’re going to have our work quite cut out for us in the coming years to keep ahead of these little whippersnappers. And we wouldn’t have it any other way!

Continue Reading →

HelpStack: In-App Support

We don’t seem to generally get around much to putting any more end user support in our apps than an email link, but next time somebody asks for more, this HelpStack thing sure looks like a front of the line choice:

Screen Shot 2014-05-15 at 8.08.32 AM.png

Source is on github, and out of the box it’s ready to hook up with an account on

Presumably if you were motivated you could check out those implementations and figure out how to adapt them to the various other support solutions we’ve mentioned a long time ago and before that a really seriously long time ago, or whatever other solution it might be that the cool kids use these days. Us, we tend to work more on the poor kids end of the spectrum, so even the cup of coffee a month price most of these services have a starter service for is pretty much right out. But look, HelpStack is even good for that too:

4. Email gear

If you do not use any of the help desk solutions, you can still use HelpStack to provide efficient customer support by configuring with just your email. You can configure email support in Helpstack by including the below lines of code in your App delegate…

HAGearEmail* emailGear = [[HAGearEmail alloc] initWithSupportEmailAddress : @"" articlePath : @"<pList file name>”];
HSHelpStack *helpStack = [HSHelpStack instance];
helpStack.gear = emailGear;

You can provide your FAQs as a local pList file and provide the pList file name in place of pList file name…

Well, that’s a pretty darn low barrier to entry for including at least a minimal FAQ in your app. We’ll definitely give that at least a rustle at the next opportunity!

Continue Reading →

All About Animation

Just on the off chance you haven’t subscribed to yet, issue #12 “Animations” is out with the accustomed assortment of must-reads:

Animations Explained goes over the basics of motion, paths, etc.

Animating Custom Layer Properties has particularly clever applications of interpolation functionality: “…by overriding the -display method, we can use those properties to control anything we like, even something like sound volume….”

Custom Container View Controller Transitions goes over how to reusably package up your cool transition code.

View-Layer Synergy gets right down into the guts of how the magic actually works.

Animating Collection Views is great for sussing out how to do layout transitions.

Interactive Animations goes over how to make your animations interactive (most importantly, interruptible) via UIKit Dynamics.

While we’re on the subject of animations, you checked out Facebook’s POP framework yet? Worth a look if you haven’t. Also don’t forget that Canvas library, and the little pieces from the last little while we collected here.


Adding Bounce to Your UIViews: The Joy of Damped Harmonics in iOS 7 Development

RBBAnimation: Extensive UIKit Animation Library Allowing Block Based Animations, Spring Animations And More

BCGenieEffect: Open Source iOS Library Allowing You To Easily Apply Animated Mesh Transforms To A View Hierarchy — check out math in Mesh Transforms!

DDHDynamicViewControllers: Open Source iOS Library Providing Some Nice UIDynamic Based View Controller Transitions

AGGeometryKit-POP: An Open Source Pop Add-On Library Adding A Quadrilateral Property For Amazing Effects bridging hfossli / AGGeometryKit: “Quadrilaterals on CALayer, CGGeometry-functions, UIView/CALayer properties and other invaluable tools.”

POP-MCAnimate: An Add-On Library For The Pop Animation Framework Making The Syntax Much More Concise

DynamicXray “is a UIKit Dynamics runtime visualisation and introspection library.”

Top 5 iOS 7 Animations as picked by

Popping: An Open Source Library Providing Many Pre-Built Animations For User Interfaces Built On Pop

FastAnimationWithPOP: Open Source Animation Library Based On Pop Featuring Animation Creation In Storyboards

Multiple Animations

ICGTransitionAnimation “is a library to customize transition animation in iOS 7.”

AHKBendableView: Open Source iOS Component Providing A UIView Subclass That Automatically Bends On Position Changes

VBFJellyView Tutorial

UIKit Dynamics Tutorial: Tossing Views

Add Implicit Animations to Your iOS Views, Part 1 and Part 2

JMAnimatedImageView: Open Source Animation Library For Interactive Animations, Carousels, Animated Gifs

Shapes: Open Source iOS Library Making It Easier To Create Custom Shaped And Animated Components

INTUAnimationEngine: Open Source iOS Animation Library For Creating Advanced Interactive Animations

RZTransitions: Library Providing A Nice Collection Of Custom Transitions And Interaction Controllers

Creating Animations and Interactions with Physical Models

Creating Simple Animations with Facebook’s Pop Framework

The Highlight 2014 — UI Animations

ShapeAnimation-Swift: “Vector animation framework in Swift for iOS.”

Pulsar : “A versatile solution for displaying pulse animations as known from Apple Maps.”

Spring: “A library to simplify iOS animations in Swift.”

CALayer in iOS with Swift: 10 Examples

CoreAnimator is a nifty looking design application with code export.

How To Implement A Circular Image Loader Animation with CAShapeLayer

Twinkle: Open Source Swift Component Allowing You To Add A Neat Twinkling Effect To A UIView

awesome-ios-ui: “A curated list of awesome iOS UI/UX libraries.”

Your Spring Animations Are Bad (And It’s Probably Apple’s Fault)

Creating a Dynamically Sized Progress Animation in Swift with Facebook Pop

Recreating Apple’s Rubber Band Effect in Swift

JHChainableAnimations: Open Source iOS Library For Creating UIView Animations With A Clean Chainable Syntax

EasyAnimation – an open source Swift animation library!

Playing With UIDynamics in iOS 9

Fun with Gradients and Masks

DKChainableAnimationKit: “Easy to read and write chainable animations in Swift.”

UIDynamics Tutorial in Swift 2.0

UIDynamics, UIKit or OpenGL? 3 Types of iOS Animations for the Star Wars

Continue Reading →

External Actions: Choosy

One of the mildly frustrating things about iOS programming is that none of the various URL scheme handling schemes have managed to get enough traction to be all that widely useful. But here’s a new one that’s certainly the best put together we’ve seen yet, and we’d strongly encourage everyone to get on board with:


People will love your app even more if it helps them use their other favorite apps. We’re essentially solving the iOS’ lack of default app selection mechanism.

Once Choosy is widely implemented, end users will be able to traverse the iOS ecosystem using just the apps they love, be they built-in ones or not…

Screen Shot 2014-05-04 at 7.01.55 AM.png

Thanks to UIApplication’s canOpenURL method and iOS forcing unique url schemes. Basically, we store a list of URL schemes for each app on the server, and categorize apps. Choosy downloads that info as needed.

Choosy caches network data, so the traffic footprint is small. It also instantly knows when a new app from same category is installed, or the default app is deleted, and lets user re-select the default app. Choosy is non-intrusive – if there’s no connection and the default app hasn’t been selected yet, it just opens the default iOS app…

Looks like a big whack of user-pleasing functionality for no particularly large effort. Check it out on github today!

Continue Reading →

Asking Pre-Permission

When you open up a new app and a barrage of permissions dialogs pop up at you, doesn’t that just annoy you?

And when a user gets all bent out of shape when something doesn’t work, and it’s because they said no to those permissions in your app, doesn’t that just annoy you?

So yeah, we should all be telling the user exactly why we want a permission, so they’re less likely to say no; and we should be doing it only when we need to, instead of tossing everything at them on first run just to make absolutely sure their first impression of the app is that it sucks. Maybe you’re conscientious enough to have bothered doing that already. For the rest of us, there’s a good article to be reading here:

The Right Way to Ask Users for iOS Permissions

Over time, we’ve learned to ask our users for permission when, and only when, we absolutely need it and we think the user can clearly relate how this access will benefit them.

We’ve re-engineered Cluster using two methods to only show the system permissions dialog once a user has told us that they intend to say “Allow”…

As stated above, the worst possible thing is for a user to deny permission at the system level, because reversing that decision in iOS is very complicated. But if we ask them before the system does and they say no, we still have the opportunity to ask them again in the future when they are more likely to say yes.

For photos alone, 46% of people who denied access in a pre-permissions dialog ended up granting access when asked at a better time later.

This is simpler than you think…

The code described there can be found at clusterinc/ClusterPrePermissions for contacts and access.

And if you want a complete set, check out jlaws/JLPermissions:

An iOS pre-permissions utility that lets developers ask users on their own dialog for calendar, contacts, location, photos, reminders, twitter, and push notification access, before making the system-based permission request.

That cover everything you need permissions for these days? Hmmm … think microphone needs permissions too, recently. Almost a complete set then. No doubt microphone can be left as an exercise for the reader.

h/t: ManiacDev!


An Open Source Pre-Permissions Framework With Support For iOS 8 Permission APIs

Why 60% of your users opt-out of push notifications, and what to do about it

PermissionScope: “A Periscope-inspired way to ask for iOS permissions.”

Continue Reading →

Barcodes for iOS 7

Here’s a book you might think about picking up, written by Oliver Drobnik:

Barcodes with iOS 7: Bringing together the digital and physical worlds

Barcodes are a universally-accepted way to track and share information about products, applications, and businesses. Until recently, however, it’s been difficult for iOS developers to take advantage of them without licensing complicated or expensive third-party libraries. With iOS7, Apple has added all the necessary components for you to make apps that scan, display, and print barcodes.

Barcodes with iOS 7 is the first and only book that comprehensively addresses barcode technology for the iOS developer. It offers a introduction to commonly used formats, such as ISBN and UPC codes and provides real world examples that teach you how to integrate code scanning and generation into your apps. This book consolidates information about applicable Apple frameworks in one place so you can quickly add native barcode support to your existing enterprise apps or start building new apps that help bring together the physical and digital worlds…

  1. Barcodes, iOS 7, and You – FREE
  2. Media Capture with AV Foundation – AVAILABLE
  3. Scanning Barcodes – AVAILABLE
  4. Passbook, Apple’s Digital Wallet
  5. Generating Barcodes
  6. Getting Metadata for Barcodes
  7. Putting Barcodes in Context

And you get a 1D support library for free, too:

iOS 7 does not support generation of 1D barcodes. Still I wanted to have a modern and powerful way to have this functionality present in this book which is all about all types barcodes. So you are getting the most current version of BarCodeKit completely for free. As long as you own a copy of the book in any form you can use BarCodeKit to create 1D barcodes in all your apps…

Still teetering? Buy right now for a half off deal:

Now through March 9th18th you even get 50% discount with promo code “mldrobnik”“bwiaunch50!”

So there you go, if you’ve got any interest in hooking up your apps with real world stuff, looks like a pretty darn solid investment there!

Continue Reading →

iOS Design Central

Here’s a new place to bookmark for your designer friends, or yourself should you fancy yourself a designer: Apple’s pulled together all their various design resources onto a new page

Desiging Great Apps

Exceptional user experience is a hallmark of Apple products, and a distinguishing feature of the most successful apps built for iOS and OS X. Use the resources below to learn how to build the polished, engaging, and intuitive apps that Apple customers expect…

Indeed. Don’t think there’s actually anything new there at the moment, seems to be WWDC videos and previously released documents pulled together in one place, but no doubt a good place to keep an eye on in future.

It’s also been quite a while since our last design roundup post back when iOS 7 was a polarizing novelty, so let’s see what else is new we haven’t tacked on to its updates since:

Pixel Perfect Precision Handbook 3 is out now (h/t iOS Dev Weekly), that should be on every designer’s must-read list.

This is a pretty nifty iOS 7 UI Kit Photoshop Action Set:

You’ve probably seen many iOS 7 UI Kits. But this one is slightly different, as there is no psd file involved. All you need (apart from love) is this little 1.4 MB .atn file that creates entire default look iPhone mockups for your wireframes, design mockups (use it with care) or just quick ideas…

iOS Dev Tools is an ever more comprehensively curated set of links in all categories of development interest we don’t think we’ve got around to linking to before, for design-related stuff check out these sections:

Check out all the non-design categories while you’re at it, and follow @iOSDevTools for updates!


30 Amazing iOS 7 UI Kits – Part

My app design workflow

Continue Reading →

Background Fetch Caveats

Couple interesting posts lately about background fetch resource usage. If you’re not familiar with background fetch, that’s an iOS 7 thing that’s explained quite nicely in’s Multitasking in iOS 7 article:

Background Fetch is a kind of smart polling mechanism which works best for apps that have frequent content updates, like social networking, news, or weather apps. The system wakes up the app based on a user’s behavior, and aims to trigger background fetches in advance of the user launching the app. For example, if the user always uses an app at 1 p.m., the system learns and adapts, performing fetches ahead of usage periods. Background fetches are coalesced across apps by the device’s radio in order to reduce battery usage, and if you report that new data was not available during a fetch, iOS can adapt, using this information to avoid fetches at quiet times…

But the naîve user may find a surprise in wait:

An Unexpected Botnet

… There is, however, an intrinsic danger in applying this ability without fully thinking through the implications. When enabled within your applications you are essentially building a massively distributed botnet. Each copy of your application will be periodically awoken and sent on a mission to seek and assimilate internet content with only the OS safeguards holding it back. As your app grows in popularity this can lead to some rather significant increases in activity…

Here are the feed request frequencies for various Background Fetch enabled podcast clients … For an RSS feed that changes only once per week just these apps produce 126k web requests each week (out of 160k across all aggregators ). The feed itself is 450KB (49KB gzipped). Where it not for HTTP caching/compression (discussed later) this would be generating 56GB of almost entirely unnecessary downloads each week…

That is, indeed, a lot of almost entirely unnecessary downloads. The developers of Castro chimed in here:

The Value of Background Fetch [Point]

… Our strategy with Castro has been to employ Background Fetch to help us avoid the ongoing cost of a server. Castro polls each subscribed feed from the app regularly and posts local notifications when new episodes are found. There are pros and cons to this approach.


  • We spend no time on web app development or money on server hosting. Xcode is always open.
  • We have no scaling concerns.
  • The continued functionality of the app is not dependent on future sales.
  • There are fewer points of failure.


  • Worse update performance since the app hits every individual feed, rather than one centralised server.
  • A central server gives developers flexibility to fix individual feed issues, like poorly formatted dates or duplicate episodes for example…

Well, being big believers ourselves in not doing work we don’t have to, that makes a pretty compelling argument, indeed. But hark! Here’s a counterpoint from coming soon Castro competitor Overcast author Marco Arment:

The Value of Background Fetch [Counterpoint]

… Service-backed apps still have a lot of advantages and exclusive capabilities over iOS 7’s Background Fetch. I think server-side crawling is still the best choice for podcast apps and feed readers, for which users want fast updates to collections of infrequently updated feeds.

Overcast has been crawling tens of thousands of podcast feeds every few minutes for the last 6 months using standard HTTP caching headers. In the last week, 62% of all requests have returned 304 (“Not Modified”). Many of the rest returned the entire “new” feed, but none of the episodes had actually changed, making the server download and process hundreds of kilobytes unnecessarily.

An app using Background Fetch needs to make all of those fruitless requests just to get the handful of occasional changes. All of those requests cost processor time, memory, battery power, and data transfer. And each copy of the app needs to download those hundreds of wasted kilobytes when a server erroneously reports an unchanged feed as new…

A server can simply send a silent push notification to all subscribed apps when there’s new data in a feed, and each app can download just the changes. With infrequently updated feeds, like podcasts, this leads to huge savings in battery life and transferred data over time…

Well, there’s that too. So yeah, if you can’t count on decent 304 support, background fetch is not your resource-optimal choice no.

Lots of good numbers to crunch through, so read the whole posts. Personally, if the choice for your particular application is less than immediately obvious, we’d recommend implementing both methods; that way, if your service goes down, or you stop paying for it, or whatever, the app can remain functional. Safety first and second, that’s us!


Apropos of things to do to avoid users calling out your app as battery-hogging, take a gander at The Ultimate Guide to Solving iOS Battery Drain

Continue Reading →

All About Strings

Are you reading If not, you should be. Check out issue #9 for more than you ever realized you didn’t know about strings. Yes, strings.

Quick now: How do you correctly find the length of a string containing odd characters like emoji? And how can you be certain you’re comparing strings with combining characters for visible equivalence correctly? If the answers don’t spring to mind, check out NSString and Unicode.

How do you correctly, i.e. locale-aware, join a list of items for text display? That’s one of the many tidbits in Working with Strings.

No doubt you know how to use localized .strings … but did you know in iOS 7+ you can do locale-aware plurals with .stringdict files? And do you know how to correctly display a localized file name? See String Localization.

Need to validate your input? Or have a full expression grammar? Check out String Parsing.

Finally, know how to calculate bounding rects for attributed strings in the new non-deprecated iOS 7 way? And how to lay out hanging indents for lists and decimal-aligned number tables with Text Kit? If not, here’s String Rendering to get you up to speed.

Haven’t seen a developer periodical this consistently high quality through issue #9 since … well, ever, actually … so we strongly encourage you all to subscribe with their app to keep the goodies coming!


Also check out our Bezier Pathological Strings

Extending “strings” to include “text” — Open Source Library And Editor Tool For Easily Formatting Text Within Your Apps

NSHipster’s NSScanner — “NSScanner can be the shiny tool to reach for when it’s time to parse a user’s input or a web service’s data.”

BBCyclingLabel: Open Source UI Control Allowing You To Easily Create Animated Text Labels

TOMSMorphingLabel: Open Source iOS Component Allowing You To Create Morphing Effects Between Text Label Values

LTMorphingLabel: Open Source iOS Component For Morphing UILabel Text Created In Swift

YetiCharacterLabelExample: Open Source iOS Component For Creating UILabels With Interesting Transition Effects

Ophiucus: Open Source Component For Creating Sophisticated Animated Text Labels; Text animations with Ophiuchus

Twinkle: Open Source Swift Component Allowing You To Add A Neat Twinkling Effect To A UIView

Attributed String for iOS in Swift

Swift-String-Tools: Open Source Library Extending Swift Strings With Linguistics And Social Features

Swift: Indices: “Don’t assume that the range from “My String” works with “Another String”. Even if strings are both ASCII, they may use different internal encodings.”

Swift: Creating styled and attributed text with NSAttributedString and NSParagraphStyle (updated); Functional Formatting in Swift: NSAttributedStrings and NSParagraphStyle

PimpMyString: “A strongly typed wrapper around NSAttributedString for iOS and OSX.”

Continue Reading →
Page 5 of 100 «...34567...»