Wednesday 6 March 2013

NSConference 5: Day Three

iOS Tools at Flipboard

Evan Doll, Flipboard @edog1203

avoiding crap work

  • use jenkins
    • run clang: +leakToEnsureClangDidRun
    • can also use to send out a beta using TestFlight/HockeyApp
    • jenkins build types:
      • beta
      • beta-external
      • ios-debug-device
      • ios-debug-simulator
      • ios-debug-unittests
    • takes some time to get things sorted with signing etc
  • app icon versioning
    • stamp app icon with the version
    • ImageMagick shell script build phase
  • use multiple bundle identifiers
    • allow app store, beta & debug builds to coexist on device
    • define a custom build setting called BUNDLE_SUFFIX
    • then reference the variable in the Info.plist
  • use JetBrains AppCode as an additional bug finding tool
    • unused code, mismatched types, etc
  • HockeyApp is great for beta handling & crash reporting

squashing bugs

  • useful to capture app state without plugging in to Xcode
    • CocoaLumberjack - high performance logging library
    • bring up a console log on the device
    • also added view hierarchy explorer & file explorer to debug builds
    • tweaker: in-app property inspector launched from pressing and holding on any view
    • see also DCIntrospect & CBIntrospector on github
  • bug reporting UI
    • launched by gesture from anywhere in the app: Flipboard use the volume buttons
      • do some basic checking in case there is actually audio playing…
      • useful to have a hardware gesture
    • attaches view hierarchy, file system, etc
    • can also take screenshot
    • Flipboard attach app feed state to each bug
      • then have in-app bug browser
      • can replicate feed state in app directly from bug

give yourself superpowers

  • testing gestures in the simulator is a pain
    • instead use keyboard shortcuts
    • override UIApplication to capture key events at a deep level
    • doesn’t mess with other text views
    • can use dlopen & dlsym to load private framework in debug code, without linking public app
    • some shortcut examples:
      • enter login info
      • block UI thread for 1 second
  • feature switches
    • exposed in the app
    • can force on/off first launch flow
    • e.g. early iPhone introducing app re-ordering jiggle
      • special shortcut to show an overlay to adjust rotation, shift & frequency
      • handed to Steve to adjust…
      • (see also the Calculator Construction Kit)
    • change the language without resetting the whole phone
      • need a wrapper round NSLocalizedString
    • if arguing about design options, try it both ways
    • freeze content in app for marketing
    • e.g. always show advert
    • make them dynamic at run-time
  • pseudolocalization
    • map all localisation keys to unicode accented characters with extra length
    • For more info on Pseudolocalization, watch the “Internationalization Tips & Tricks” video from WWDC 2012
  • WebTranslateIt
    • shared strings for iOS & Android
  • escape hatches: brains on the server
    • change your mind after the app has been released
    • JSON file for settings
    • sync NSUserDefaults
      • comment from the audience: GroundControl from Matt Thompson (@mattt) can provide remote settings
    • also replace Localized strings
    • in-app help
    • UI hints
    • even adding new social services…
  • chaos monkey
    • process in the app that randomly makes things fail
    • memory warnings, delete cached content, closing network connections
    • ensure there’s some obvious part of the UI that indicates when the monkey is running


  • use pivotal tracker: task management tool
    • testers report into Jira
    • then prioritise using pivotal
  • github pull requests to communicate about code
    • talking about code in progress
    • not just for reviewing
    • start earlier
    • get designers involved
  • GitX + email for lightweight code reviews

User Identity

Markos Charatzas @qnoid

  • stop using passwords!
  • the password policy is one of things wrong with passwords
    • each company has different rules
    • then just as you remember the password, you have to change it
  • security questions for when you forget…
  • need to innovate on user authentication
  • residence based authentication

Reverse Indie

Alexander Griekspoor, Papers

  • 100% Indie (until 31st Oct 2012…)
    • bought by Springer Science+Business Media
  • started making free apps just for the fun of it
  • won an Apple Design Award
  • then made Papers while waiting for postdoc to start
  • free apps drove adoption of paid apps
  • also gave 40% discount to students — fuelled word of mouth marketing
  • then had to figure out how to grow from one person to two?
    • how many more copies do I need to sell just to employ another person?
  • then iPhone & iPad got released…
    • suddenly could support an extra developer
  • iOS enabled growth
  • got handed a love letter to Papers at WWDC 2009 :-)
  • when app gets popular requirements start getting bigger
    • choose between lifestyle business or let the product fly
    • restrict the business to the size of you, or let the product free and take a step back
  • offer of being taken over by a big company
    • wanted to keep independent direction and not get eaten by the beast
      • take advantage of big marketing & sales + common HR & legal
    • need to be able to speak to the guys at the top
    • if the process gets difficult, need to go back to them and check if things are still on track
    • get the financial stuff sorted early
    • get professional help early
    • bring soft issues up immediately
      • they won’t go away

Rethinking Syncing

Charles Parnot @cparnot

  • syncing-friendly-driven development :-)
    • start with a sync-friendly foundation
    • use a syncing-friendly data model
    • make syncing-friendly decisions
    • keep things syncing-friendly
  • can just use dropbox
    • but two devices accessing same file can get corruption
    • can use a lock file
    • or File Coordination APIs (controls all access so single machine only)
  • have multiple databases, one read/write, others read only
    • log events rather than just storing data
    • then can get latest event
  • rather than having entire record as an event, can use a key/value store with timestamp
  • fetching data involves iterating through required keys
  • can open multiple databases in CoreData
    • one as R/W
    • others can be loaded as read only
    • CoreData will manage reading from combined data and writing to R/W db automatically
  • example: crash reports library
    • shared amongst multiple developers using dropbox
    • key/value database for adding/modifying crash report files
    • UI layer has an in-memory cache of latest data
  • inspirations

Independent, but Not Alone

Craig Hockenberry @chockenberry

Principal at the Iconfactory

  • Weightbot: crazy idea to add personality
    • but it makes the app fun & accessible
    • designer challenged developer to make the app work in a better way
  • “Design is not just what it looks like and feels like. Design is how it works” — Steve Jobs
    • “Developers don’t know how their product works” — @chockenberry
  • developers think of a product from the inside out
    • think about underlying stuff at the beginning
    • UIs reflect the underlying design
  • designers think of a product from the outside in
    • don’t even know what orthogonal means
    • not worried about how it works, or how hard it might be to implement
    • think about your app in the same way that a customer would
  • a designer is your first customer
    • they will give you feedback that may hurt your feelings
  • provide help with tough decisions
  • explaining problems to a non-technical person helps you think differently about the problem
  • how do you make the design - code - review process shorter and tighter?
    • for Twitterrific (iOS & Mac) had a couple of attempts…
    • first attempt: AppTheme
      • application-level settings
      • extract fonts, colours, etc into a file that the designer can edit
      • can still be objective-c
      • still need to train designer to build & install
    • improved attempt Theme: used UIAppearance
      • one Theme for every view class in the app
      • some view classes only exist to be customisable
      • used some macros to make images, insets, gradients etc
      • in Chameleon, when remove root view controller from window, can reset UIAppearance to a new theme (don’t forget to add it back afterwards…)
  • Interface Builder is the uncanny valley of UI design…
    • hard to visualise results
    • really easy to screw things up
  • most important tool to work with designers is version control

Copywriting is Design

Nik Fletcher @nikf

  • even “serious” products are known as Apps
  • Nik is trying to purge the word Cancel from our app vocabulary
    • negatives are hard to scan quickly: “Delete” “Don’t Delete”
    • go for opposites: “Keep”, “Never”, “Not Now”
  • try not to repeat words in sequential alerts
  • disclosure
    • iOS 6 introduces data isolation instead of CLLocationService.purpose
    • localised Info.plist strings instead (see this blog post)
    • can reset:
      • OS X: tccutil reset ..
      • iOS: Settings > Reset All
  • photo access has implicit access to past location history
    • either disclose usage or scrub it before you upload
  • don’t use checkboxes to turn stuff off!
    • tell QA when you find it
  • don’t talk about the “File System” or the “Keychain”
    • again — it’s implementation detail
  • app state: not running or stopped; instead open or closed
  • example: Realmac developer found an awkward bug in Quick Look
    • developer just added a “QuickLook sucks” alert
    • Nik got an email saying “what’s your problem with Quick Look?”
    • …from the engineer at Apple who worked on Quick Look
  • “personality” can be useful in copy
    • but don’t trivialise important things
  • nice trend of moving errors inline
    • avoiding unnecessary alerts
    • e.g. Mobile Safari has error pages rather than alerts
  • your copy (and maybe your company) needs a style guide
    • anyone in the company can use it
    • even developers…!
  • customer? user?
    • Apple uses “you”
  • use genstrings & ibtool to get all the strings into a file to check through
  • recipe for a great alert:
    • title: how did I get here?
    • title & copy: what am I doing here?
    • buttons: how do I do that?
    • buttons: where do I go from here?
  • see more on

Controlling an animation with a UIGestureRecognizer

Eelco Lempsink @eelco

  • want to use a gesture to scrub across an animation
    • e.g. Photos app on iPad lets you slowly pinch/zoom open each event/album
  • control animation: CA...Animation* animation ... animation.speed = 0; animation.duration = 1; animation.timeOffset = position; // 0 .. 1
  • use UIPinchGestureRecognizer
    • adjust scale to fit the UI element size and animation
    • objects should stay under your fingers as you move them
  • decide what to do when you release the gesture
    • end state, duration, animation curve
    • during gesture you probably want linear animation
    • but when you let go it should probably be something different
  • if you have a complicated animation you can add a property to control the offset
    • can then derive other properties from the value of this new property
    • simplifies code
    • but you have to do some interpolation maths yourself

The Art of Shipping

Alan Cannistraro @accannis

  • worked 12 years at Apple
  • started on iOS apps in 2006 before iPhone even announced
  • now working at Facebook London
  • 5 stages to shipping a product


  • Steve Jobs: “Creativity is just connecting things. When you ask creative people how they did something, they feel a little guilty because they didn’t really do it, they just saw something. It seemed obvious to them after a while.”
  • de Bono lateral/horizontal thinking exercises
  • e.g. “Random Entry”
    • define a focus
    • choose a word from a 2000 word table
    • spend 10-15 mins generating ideas
    • repeat
  • then distill ideas
    • filter for crap or technically impossible
    • gather into a cohesive story


  • Steve Jobs: “sweat all the details”
  • Alan uses wireframes to help to decide the design
  • then generate screenshots
  • does it flow? can you simplify it?
  • design up front is easier…
    • (but not always possible)


  • make a scaffold: has all the bits
  • Steve Jobs: “Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple.”
  • don’t mess with MVC
    • don’t have a UIView that references an NSManagedObject!
  • Cocoa SDK API has a team that scrutinises the code and strives to simplify it
    • use their API as your yardstick…
  • tried a project by designing it all in UML first
    • the developers stopped coming in…
  • start with simple bits
  • avoid shortcuts unless you’re 2-3 days away from release…


  • track everything
  • set a date
  • don’t be afraid to punt issues to the next release
  • prioritising bugs:
    1. data loss
    2. crashes
    3. visual polish (!)
    4. regressions
    5. bugs in new features
    6. everything else
  • why visual polish so high?
  • Donald Norman: Emotional Design
    • aesthetically pleasing objects appear more useful
    • cognitive bias: beauty bias
      • when something is beautiful, we believe its other properties have prowess
    • the halo effect
      • not about success in one area leading to another
      • instead our brains assume that beautiful apps are better, whether they are or not


  • Steve Jobs: “My job is not to be easy on people. My job is to take great people and push them.”
  • be honest about first impressions
    • but leave your ego at the door
  • if it feels wrong, don’t ship it

one more thing…

One thing that Steve said to Alan was “the most important thing you need to do surround yourself with people smarter than you.”

No comments: