Monday, 4 March 2013

NSConference 5: Day One

This was my first NSConference and I was impressed. Three days of full-on sessions covering everything from deep technical gotchas, through brutally honest experience reports and even across to basic economics lessons. And the people… I’ve never met so many iOS and Mac developers in one room. Everywhere I turned, there was a developer of an app that I’ve used or know about and admire.

Thank you so much to Scotty and the team. Everything (apart from the wi-fi!) went swimmingly!

iOS performance testing

Bill Dudney @bdudney bdudney@me.com

  • Double check performance even when you think you’re doing it right
  • Watchdog gives you lots of time but user expectation is instantaneous
  • You can use more time on suspend… but don’t go outside watchdog times otherwise app will have to start from scratch
  • Use Time Profiler to check CPU usage on startup
  • VM tracker tells you how much memory is dirty - most crashes come from here
    • Allocations can be low but dirty memory still high
    • e.g. Image allocations
    • Memory gets dirty as soon as you write to it
  • ARC deals with most of issues for you but won’t deal with cycles
    • Can see in leaks
    • Deal with by using weak references
  • Graphics
    • Quartz all happens on CPU
    • OpenGL happens on GPU
    • Separate processor - more power
    • CoreAnimation gives you access without writing raw OpenGL
    • It’s a compositing engine
  • Offscreen rendering can take up lots of time
    • Check offscreen rendering highlight in instruments

searching for speedy searching

Simon Wolf @sgaw or @sw on ADN

  • WWDC 2010 mastering CoreData suggests title contains[dc] $content
  • Can use beginswith to improve speed
  • Even faster use >= 'frog' and < 'froh'
  • But doesn’t work for in-word searching
  • SQLite with full text search FTS (or FTS3, older)
  • Have to build own version of SQLite and include in your app
  • And then can’t use with CoreData
  • Use FMDatabase & FMDatabaseQueue to behave better with threads
  • Use SQLite with FTS to create an index that refers to the Managed Object ID
  • otsNormalizeString string category to remove diacritics (in blog post)
  • FTS search is word based, * is wildcard
  • Can also define “nearness” of terms
  • Need to keep index in sync with CoreData

The ultimate developer toolchain

Richard Morton @richardmorton

  • “if you have a machine and don’t buy it, you will ultimately find you have paid for a machine and don’t have it” — Henry Ford
    • buy a decent developer machine!
  • iOS Support Matrix gives you a good way to find which test devices you need
  • Injection for Xcode: restores “Fix & Continue”
    • uses bundles & method swizzling
  • Xcoverage
    • LLVM provides build coverage
    • instrument program flow & generate test coverage files
  • Mogenerator
  • AppCode by JetBrains
    • would still do bulk of dev in Xcode but boot up AppCode to use refactoring & other unique features
  • Jenkins
  • PaintCode
  • xScope
  • ResourceHelper
    • extra QA for assets

Why making 12 Games in 12 months is a good idea

Matthijs Hollemans @mhollemans

  • lots of game jams around
  • why?
  • experimentation & innovation
  • learning how to finish
    • often there’s a long hard grind to finish
  • learn to limit your scope
    • one single thing
    • take idea and strip it to the core
  • putting constraints on what you’re doing enhances your creativity
  • also get experience in failing to finish games
    • good to find a way to fail faster!

UISS - UIAppearance on Steroids

Robert Wijas @robertwijas

  • UISS available on github & CocoaPods
  • UIAppearance & UIAppearanceContainer lets you set appearance defaults application-wide
  • but need lots of code to do anything…
  • UISS uses JSON syntax, similar to CSS
  • lets you set styles for inner elements
  • and also styles per device type (iPhone/iPad)
  • lets you define variables
  • easily disable bits by prefixing selector with “-“
  • setup:
    • [UISSS configureWithDefaultJSONFile];
    • add uiss.json file
  • debug: UISS status bar
    • tapping status bar shows errors in uiss.json
  • works with live updates in uiss :-)
    • just make uiss.json available via HTTP
    • [UISS configureWithURL:url]
    • let’s you build the app and give it to your designer to adjust, even without Xcode
    • debug option lets you adjust URL
  • generates UIAppearance code for you
    • you’ll want to do that before you create production code
  • can use UIProxy to control your own custom views with UIAppearance
    • also allows you to adjust them with UISS
  • other systems doing same thing:
    • NUI
    • pixate
    • both use traditional CSS - so heavier dependencies

Becoming a product company

Daniel Pasco @dlpasco daniel@blackpixel.com

  • started in 2007 as contracting but aimed from the beginning to be a product company
  • 6 people for 3 years, then doubled in size for 3 years
  • operate as a remote company, HQ in Seattle, but spread over US, with a couple in France
  • have shipped hundreds of apps, but all for other people
    • have a reputation for confidentiality
    • so can’t tell anyone about them…
  • there’s an opportunity cost to do product development
    • in the presence of lucrative contracts, you take a risk and turn away money
  • however, you get stability
    • find that contract work is busy Feb to July
    • occasional spike in November preparing apps for Xmas
  • did client work until they had enough money
    • then did some product work until money ran out
    • then swapped back to contract
    • big gaps between product dev
    • when went back to code, there were lots of changes to make with all the new knowledge…
  • initial product was Bistromath
    • massively over-engineered…
    • developed in a vacuum
  • need to share app with people who know nothing about how the app works
    • tester should not share any of your assumptions
  • life after being featured…
    • intense — but treat it as a bonus
    • people need to be aware of the app outside of the app store
  • painful first product experience made them very gunshy
  • learnings:
    • vet your ideas early on
    • get feedback on betas
    • no excitement? that’s an issue
    • if someone wants to extrapolate — that’s great! but leave those additional features for later
    • have a sustainable dev plan — through to the product release
    • check out marketing
  • changed business model:
    • grew contracting team so could subsidise continuous product team
    • could keep momentum going
  • got the chance to acquire three products from other developers (NetNewsWire, Kaleidoscope, Versions)
    • existing userbase
    • well-known brands
  • products acquired through revenue-share
    • no money up front
    • revenue share decreases as time goes on
  • wanted to share info & blog monthly, but…
    • have competitors: don’t want to reveal feature roadmap
    • no one knows if you miss a deadline: would have announced and missed three times!
    • no one knows if you drop a feature you promised
  • Apple will not let you transfer an app between accounts
    • unless you get the keys to the old account, customers will have to buy the app over again…
    • trying out introductory pricing on upgrades to help people recover their losses
  • iCloud sync issues with NetNewsWire
    • iCloud/Core Data: still unusable…
      • opening the iCloud container can take up to 25 minutes
    • iCloud/Key Value Store: works fine
    • iCloud/Ubiquitous Documents: has issues
  • got creative tensions from people caring so much about their own products
  • changed aim to be frequent, shorter, release cycles
  • got lost with features — endless ticket list
    • @jury drew a line in the sand: ship by this date
    • focus accordingly
    • the plan:
      • 4 weeks for feature complete
      • then 4 weeks for no P3 bugs (fix or defer)
      • then 2 weeks for no P2s
      • then 1 week for no P1 bugs
    • there will always be another release
      • if that isn’t built into your plan — change your plan!
    • it’s ok to ship with bugs, as long as they’re not blockers

Software Architecture: what questions to ask?

Jacob Gorban @apparentsoft

A short list of questions to ask when adding a new feature to your project:

  • good ideas are insidious: they increase scope
    • must definitely be worth adding…
    • here are some questions to think about before adding a new one to your project
  • is it really a good idea?
    • is it good for your business?
    • it it good for your app in the long run
  • is it DRY?
  • is it orthogonal?
    • good to have smaller pieces joined than one big piece
  • is it testable?
  • is there another way?
    • when you see a good move, look for a better one — Emanuel Lasker
  • what is the cost of changing this later?
  • what would the architecture look like if I didn’t have this problem?
    • is this problem framed properly for my app?
    • perhaps we can change the problem…
  • document the rationale
    • not just for later — helps you understand the problem
    • could also discuss with others
  • what are the facts and assumptions?

Download from http://bit.ly/software_architecture_tips_pdf

WebKit UI Inspector Tips and Tricks

Daniel Jalkut, Red Sweater Software @danielpunkass

  • use webkit inspector to fix a page for printing
  • prototype app store previews
  • can set inspector on in your own (Mac) app:
    • just add -WebkitDeveloperExtras YES argument
    • can add same preference on other apps
    • defaults write <bundle-id> WebkitDeveloperExtras -bool YES
    • or globally: defaults write -g WebkitDeveloperExtras -bool YES
  • Dictionary app uses a WebView… so you can inspect it!
  • preference key doesn’t guarantee that the “Inspect Element” menu item will be available
  • Mail.app is a very good robust HTML editor using a WebView but it overrides the contextual menu
  • for any process (even one that has custom contextual menu):
    • attach to target
    • break on [NSView menuForEvent:]
      • lldb: break set -r menuForEvent
    • ctrl-click in the suspected WebView
    • run code: [[[$rdi _webView] inspector] show:0];
      • event target is in $rdi
  • iOS webkit inspector can inspect Safari or any UIWebView in an app that you own

The Invisible Interface — Adding offline speech UI to your app

Halle Winkler @politepix http://politepix.com

  • large vocabulary tasks
    • use server-based speech recognition
    • UITextView, Nuance, AT&T, iSpeech
  • command and control
    • can use offline speech recognition
    • e.g. OpenEars
  • speech API dimension is time
    • make time, rather than just take time
  • small steps through decision tree, means small steps backwards
    • trust & quickly verify
    • switch between small vocabularies
  • watch out for “out of vocabulary”
    • what happens when people walk past talking loudly…?
    • it’s a solved problem in speech recognition, but deciding what to do is a design issue

No comments: