Easy Way Out

Jordan Morgan
May 8, 2015 · 8 min read

A quick note — all of my future posts will be published on my dedicated website and this publication is no longer being updated. Thanks for reading!


The UIKeyboard + Covering Views

World hunger. Distant space travel. Heck, time travel.

Managing Too Many Images

If image assets managed themselves as SQL behind the scenes (they are actually JSON), they would proudly proclaim their relationship status as one-to-way-too-freaking-many.

The scale factor option needs to be set for a vectorized PDF to be registered.
  • Too many images to manage — solvedish.

Async Design Patterns

I’ll keep this short since I recently spoke at length over the matter. It’s known among a multitude of developers that iOS just beckons for async programming. Making multiple trips to the server is just one common reason to do that dance, and it’s one dance of many that you’ll likely take in terms of async programming.

[self userSessionInitiated].then(^{ 
return [ServerSide profilePics];
}).then(^(NSArray *pics){
self.pics = pics
[self.collectionView reloadData];
}).catch(^(NSError *error){
//Failwhale
});
id firstName = [API getName:url] promise];
id userLocations = [API getLocations:url] promise];
[PMKPromise when:@[firstName, userLocations].then(^(NSArray *data){
//Handle data
}).catch(^
//Man down
});
  • Too many images to manage — solvedish.
  • Async Design Patterns — solved.

Launch Images

Moving on to the more obvious yet hardly utilized.

The launch .xib works much like any other .xib, save for a few caveats.
  • Too many images to manage — solvedish.
  • Async Design Patterns — solved.
  • Multiple Launch Images — solved.

The Art of the Universal App

This one is a passionate topic for me. I’ve written about it, leisurely talked about it, and am even doing a course at Pluralsight over it. But, much like the launchscreen.xib, it seems the community at large is either ill-versed on the matter or just aren’t fully aware of what adaptive design can do.

  • No reliance on device-specific logic
  • Shared components
  • Shared code
  • Flexible view controller presentation options
  • Appearance proxy support matching to size class
  • …ostensibly much more
  • Too many images to manage — solvedish.
  • Async Design Patterns — solved.
  • Multiple Launch Images — solved.
  • Universal Apps — solved.

Small Gains In Readability

Readable code is a no brainer. The more one’s codebase turns into an amorphous blob of unusable trash, the less the business is able to do with the project going forward.

aButton.setTitle(“Download The Halo Timer”, forState: .Normal)
aSubclassedView.itsButton.setTitle(“Still download The Halo Timer”, forState: .Normal)
var buttonText:String{
didSet(buttonText){
aButton.setTitle(buttonText, forState: .Normal)
}
}
aSubclassedView.buttonText = “Visit bit.ly/halotimerios”
var accounts:Array<Accounts>?{
didSet{
self.tableView.reloadData()
}
}
  • Too many images to manage — solvedish.
  • Async Design Patterns — solved.
  • Multiple Launch Images — solved.
  • Universal Apps — solved.
  • Some Gains In Readability — solved.

Final Thoughts

There are several other road blocks in iOS that are solved in very clever and unique ways. The mastery of the proposed technique shows itself when one knows which to employ for a given project — and even more importantly, when. Go forth and utilize these six methods as you see fit. Until next Saturday, friends.


If you learned something about iOS workflows, please NSRecommend this article below.

The Traveled iOS Developer’s Guide

Cocoa Touch, unwrapped and analyzed by @JordanMorgan10. Updated biweekly.

    Jordan Morgan

    Written by

    iOS @buffer. Author for Pluralsight, contributor to a few books, conference talks and some other stuff! Writing at swiftjectivec.com

    The Traveled iOS Developer’s Guide

    Cocoa Touch, unwrapped and analyzed by @JordanMorgan10. Updated biweekly.