Play

Hosts: Darryl H. Thomas
Audio Engineer and Post-Producer: Darryl H. Thomas
Released Wednesday, May 20, 2015

The Discussion

Override of private methods:

Descendant methods with the same signature as an ancestor’s private method are not considered overrides:

  • Only methods that are visible to a given class can be overridden.
  • When the ancestor class makes a call to the private method, the ancestor’s method is indeed called, not the non-overridden method in the descendant class.
  • Descendants can override methods that are visible to them and promote their visibility (even implicitly: Make sure you explicitly specify private if you want to keep something private.)

Use of private methods in notification selectors:

  • Classes need to descend from NSObject (or at least implement all the expected methods used for invocation, etc)
  • Using private methods as notification handlers results in a crash: unrecognized selector
  • Because the methods used in notifications must be visible, the descendant’s implementation is what will be invoked, and it will clearly be an override. This does help the case we discussed in episode 68.

Argument order of member-wise struct initializers:

The order does appear to be the order in which the properties are declared.

Factory methods:

Convenience initializers really do replace the factory methods found in Objective-c classes. Take a look at the Swift bridge for NSString as an example. There are two designated initializers and a whole slew of convenience initializers, but no class methods bridging the ones found in Objective-c.

Failable initializers: init? vs init!

  • For value types, failable initializers can fail at any point during the initialization process, but class types can only fail once all properties have been initialized and initializer delegation has taken place. You can work around this using implicitly unwrapped optionals, but this seems strange to me.
  • I’m still confused by init!. I’ve tested this out, and I do get an implicitly unwrapped optional. If I assign this to a non-optional variable and initialization did fail, I get a “unexpectedly found nil while unwrapping an Optional value” exception, as I would expect. But what is the benefit of an implicitly unwrapped failable initializer? If you’re confident that it’s safe to implicitly unwrap the optional, why make it failable at all? Wouldn’t it always be safer to use a regular failable initializer and require consumers to perform checks?

Inout parameters during initialization:

This is indeed possible. When bridging with Objective-c, however, an NSErrorPointer is used, which is an AutoreleasingUnsafeMutablePointer of an NSError optional. I still think it would’ve been nice if Swift used tuples for failable initializers, but since we can’t do that, should we adopt the convention of using inouts?

Alternative Show Titles

  • Darryl Does His Homework
  • You Call That An Episode?!?!
  • var episode69 : Episode?
Play

Hosts: Darryl H. Thomas and Chad Etzel
Audio Engineer and Post-Producer: Darryl H. Thomas
Released Wednesday, May 13, 2015

Tweet Shoutouts

The Discussion

  • Swift
    • Inheritance
      • Base class
      • Subclass
        • Depth of inheritance hierarchy
      • Overriding
        • Accessing super
        • Methods
        • Properties
        • Getters and Setters
        • Prop Observers
        • Preventing with `Final`
    • Initialization
      • Initializing property values vs default values
      • Automatic external names for all parameters, including the first
      • Un-named parameters using the underscore (_) when intent is clear
      • Structures automatically receive a memberwise initializer if they do not define any of their own custom initializers, even if the stored properties do not have default values.
      • If you define a custom initializer for a value type, you will no longer have access to the default or memberwise initializer for that type. If you do want both the default and a custom initializer, define the custom initializer in an extension. #extensionsyes
      • Designated initializers
        • Primary initializers for a class
        • Fully initializes all properties introduced by the class
        • Calls an appropriate superclass initializer
        • Every class must have at least one designated initializer
        • Multiple designated initializers are allowed, but it is common to have only one and rare to have more than a few
      • Convenience initializers
        • Secondary, supporting initializers for a class
        • Defined using the ‘convenience’ modifier before the init keyword
        • Can call a designated initializer with some of the designated initializer’s parameters set to default values
        • Are not required
        • Used whenever a shortcut to a common init pattern will save time or make intent clearer
      • Initializer delegation rules
        • A designated initializer must call a designated initializer from its immediate superclass
        • A convenience initializer must call another initializer from the same class
        • A convenience initializer must ultimately call a designated initializer
        • Simplified:
          • Designated initializers must always delegate up
          • Convenience initializers must always delegate across
      • Class initialization is a two-phase process
        • Phases
          • Each stored property is assigned an initial value
          • Each class is given the opportunity to customize its stored properties
        • Provides safety while allowing customization by preventing values from being accessed before they are initialized or being set to a different value unexpectedly
      • Subclasses do not inherit their superclass initializers by default…except when they do:
        • If your subclass doesn’t define any designated initializers, it automatically inherits all of its superclass’ designated initializers
        • If your subclass provides an implementation of all of its superclass’ designated initializers either through inheritance or custom implementation, it automatically inherits all of the superclass’ convenience initializers.
      • Failable Initializers
        • Defined using init? instead of init
        • Creates an optional value of the type it initializes
        • Return nil to trigger a failure.
        • Useful for
          • Invalid initialization parameter values
          • Absence of a required resource
          • Anything that prevents initialization from succeeding
      • Required Initializers
      • Stored property initialization via closures
    • Deinitialization
      • Called immediately before deallocation of a class instance
      • Defined using the deinit keyword
      • Cannot be called explicitly
      • Superclass deinit is called immediately following subclass deinit
      • Allows you to free resources that would not be freed automatically through ARC

Picks

Darryl

  • The Ugly American Learns Swift – Daniel Steinberg at dotSwift 2015
    The sneaky bastard hooked me by appealing to my fondness of Objective-C and distaste for Rubyists before making me realize I was the Ugly American.

Chad

Alternative show title suggestions

  • Do you like cheese? (from SurveyQuestion code example)
  • Yes, I do like cheese.
  • Functional-like Functionality
  • Semi-constant
  • Right On
  • Out of words
  • me myself and you
  • overall, nice pick
Play

Hosts: John Sextro, Darryl H. Thomas and Chad Etzel
Audio Engineer and Post-Producer: Darryl H. Thomas
Special Guest: Kim Etzel
Released Wednesday, May 6, 2015

Tweet Shoutouts

 

The Discussion

  • ResearchKit
    • Build surveys for modal presentation on an iOS device.
    • Use customizable visual consent templates to explain the details of your study and obtain a signature from the participant. Be sure to get your visual consent flow approved by your institutional review board (IRB) or ethics committee.
    • Use active tasks to invite users to perform activities under semi-controlled conditions, using iPhone sensors to collect data.
  • Related Open Source
    • AppCore
      • Dashboard with progress graphs
      • Data storage back end
      • JSON serialization and deserialization
      • Integration with Sage Bionetworks’ Bridge service
    • GlucoSuccess
    • Asthma Health
    • mPower
    • Share the Journey

AthenaCareNetwork.org

Picks

Kim

Darryl

Chad

John

Alternative show title suggestions

  • Talk about the color for 10 minutes
  • Chunky block of computer
  • Just stand
  • Hey Oh!
  • Drift off into the abyss
  • No help for you
  • Universal sign for Mammogram
  • Do they all smoke up there?
  • Praise Jesus
  • This is radio
  • Gender wise
  • Any yahoo
  • Call your congressman
  • Definitely not Chad escape
Play

Hosts: John Sextro, Darryl H. Thomas and Chad Etzel
Audio Engineer and Post-Producer: Darryl H. Thomas
Released Wednesday, April 22, 2015

Tweet Shoutouts

 

The Discussion

  • Swift
    • Methods
      • Newly available to enums and structs via Swift
      • Instance methods
      • Type methods
        • class keyword in classes
        • static keyword in structs and enums
      • self
      • mutating for structs and enums
    • Subscript
      • Shortcuts for getting/setting member elements of collections.
    • Visibility

Picks

John

Darryl

  • Increasing Performance by Reducing Dynamic Dispatch – Apple Swift Blog Explains the performance impact of dynamic dispatch/indirect calls and describes three ways available in Swift to selectively eliminate dynamism: final, private and whole module optimization.

Chad

Alternative show title suggestions

  • Roommate
  • She’s my roommate
  • Same diff
  • Synthesize blah
  • What the func
  • I disagree ???
  • Question mark???
  • My brain turned off
  • Xcode yelled at me
  • Octothorpe
  • Pigeonholing
  • Kicked that horse to death
  • Let me get there
  • Foot gun
  • Goun-hilda
  • Its cool bro
  • I’m Down with PHP
  • False privacy
  • Embrace the swift
Play

Hosts: Darryl H. Thomas and Chad Etzel
Audio Engineer and Post-Producer: Darryl H. Thomas
Released Wednesday, April 15, 2015

Tweet Shoutouts

The Discussion

  • Swift
    • Follow-up/Corrections
      • https://gist.github.com/anonymous/b53e190efb6627e020bd Implements modifying the width of a frame in Swift and Objective-C. Disassembly shows that setFrame: is called and aside from memory management and memsetting, the code is very similar.
      • “view.frame.size.width = …” behavior
    • Properties
      • structs and classes can have them
      • stored properties
      • computed properties
        • must always be declared with var, even read-only properties
        • implemented using get/set keywords followed by closures (or at least closure-like code blocks)
        • Supports a shorthand setter declaration, in which an implied newValue value is used
      • “type-properties” like static vars
        • class type-properties are computed-only
      • property observers
        • called in response to changes in a property’s value
          • willSet (custom parameter name can provide the pending new value
          • didSet
        • called every time a property’s value is set, even if the new value is equal to the current value
    • Methods
      • Newly available to enums and structs via Swift
      • Instance methods
      • Type methods
        • class keyword in classes
        • static keyword in structs and enums
      • self
      • mutating for structs and enums
    • Visibility

Picks

Darryl

Chad

Alternative show title suggestions

  • We don’t even have any show titles yet.
  • A total shot in the dark.
  • Homework’s back on
Play

Hosts: John Sextro, Darryl H. Thomas and Chad Etzel
Audio Engineer and Post-Producer: Darryl H. Thomas
Released Wednesday, April 8, 2015

Tweet Shoutouts

The Discussion

Picks

Darryl

John

Chad

Alternative show title suggestions

  • Read along with iOhYes
  • Watch Kit Week
  • Deep Pockets
  • Do you even belong on this show
  • iPhone 6 minus
  • Keep waiting pal
  • Established my use cases
  • Betting on the “Come”
  • The Space Color
  • The Answer to that question is “Yes”
  • You wanted Mickey Mouse
  • The Art of the Thing
  • 8 Hours is Low-balling it
  • Velcro Watch Band
  • a highfalutin watch-wearing person
  • FlickrWatch
  • My answer is “Nooooo!”
  • Reconnect the outlets
  • Neuter the entire storyboard file
  • Follow-up
  • Homework
  • Storyboard Malarky
  • Complicated Codes
  • Et tu Brute?
  • Hungarian Notation
  • Imagine That
  • Terse Alphabet Soup
  • Hard Habit to Break
  • Save it for last week
  • 4 million and 23
  • That’s not Fair
  • Don’t step to me
Play

Hosts: John Sextro and Darryl H. Thomas
Audio Engineer and Post-Producer: Darryl H. Thomas
Released Friday, April 3, 2015

Tweet Shoutouts

The Discussion

Swift

  • Follow-up/Corrections
  • 2 episodes ago, Darryl mistakenly referred to Swift 1.3 beta. He meant to say 1.2 beta.
    • Tuples
      • Contents can be decomposed in a manner very similar to the decomposition of an enum value’s associated values
      • Elements can be accessed using dot notation with its zero-based index.
    • Particularly useful as the return value of functions
      • Group values into a single compound value.
      • Values need not be of the same type
      • Multiple ways of getting at the composed values
        • “_” can be used to ignore parts of a tuple.
      • Elements of a tuple can be named, and subsequently accessed by name using dot syntax.
      • If the data structure is likely to persist beyond a temporary scope, consider a class or structure instead.
  • Functions
    • syntax
    • parameters
      • local vs. external parameter names
      • variadic
      • in-out
      • default parameter values
    •  return
      • multiple return values
      • option tuple return types
      • void defined as empty tuple ()
    • function types
      • syntax
      • as parameters
      • as return types
  • Closures
    • terseness
    • Types
      • Global Functions
      • Nested Functions
      • Closure Expressions
    • Trailing Closures

Picks

Darryl

John

Alternative show title suggestions

  • Make it swift
  • Tuples
  • Changed the rules
  • Variadic
  • Surprise
  • Magical Functions
  • Closed the book on closure
  • Whoever decides they want to write a blog post
Play

Hosts: Chad Etzel, John Sextro and Darryl H. Thomas
Audio Engineer and Post-Producer: Darryl H. Thomas
Released Friday, March 27, 2015

Tweet Shoutouts

The Discussion

Swift

  • Data
    • value types
      • enums
        • can have initializers, can be extended and can conform to protocols
        • Swift enums do NOT get default integer values
      • structs
        • auto-gen’ed memberwise initializers (not so in classes)
        • No ref counting, since value type
    • reference types
      • classes
        • very similar to structs (but ref type)
        • inheritance
        • Ref count for memory management
    • Swift Diff: dot syntax allows us to directly set sub-properties without intermediate assignment (reduces instance creation and malloc)
    • Rookie Question: What is the key deciding factor between creating a struct vs. class or class vs. struc?

Open Source Project of the Week

FastttCamera from IFTTT
wrapper around AVFoundation that allows you to build your own powerful custom camera app without all the headaches of using AVFoundation directly. Used to build “Do Camera”.

  • trending on GitHub this month
  • 700 stars
  • 2 contributors

Picks

Darryl

John

Chad

Alternative show title suggestions

  • Value is the value it is
  • “Mmm”
  • Sort of
  • Ok then
  • Compass points
  • Confusing
  • Raw value
  • Out of words
  • Not enough words
  • One gripe
  • There’s so many
  • alt click
  • model layel
  • Dynamism
  • Dynomite
Play

Hosts: Chad Etzel, John Sextro and Darryl H. Thomas
Audio Engineer and Post-Producer: Darryl H. Thomas
Released Friday, March 20, 2015

Tweet Shoutouts

None :(

Send us your tweet shoutouts to @iohyespodcast

The Discussion

Swift

  • Syntax
    • variable / constant declaration / type inference
    • if/for loops
    • switch statements
    • optionals

Open Source Project of the Week

FXForms, from Nick Lockwood

Picks

John

Chad

Alternative show title suggestions

  • Convenience
  • Fun with words
  • Reading code
  • Raging at your stereos
  • Swift Switch Statements
  • Bear Claws
  • Polymorphism way of life
  • Super Xcode ninja warrior person
  • The Swiftisode
Play

Hosts: Darryl H. Thomas and John Sextro
Audio Engineer and Post-Producer: Darryl H. Thomas
Released Friday, March 13, 2015

Tweet Shoutouts

The Discussion

Apple Event Recap

  • Retail Update
    • New flagship store in West Lake, China
    • Apple is moving into China at a rapid pace
      • 6 new stores in as many weeks
      • 21 Greater China stores to date, 453 worldwide (16 countries)
      • Plans to have 40 Greater China stores by mid-2016
    • 120 million visitors last quarter
  • Apple TV
    • 25 million units sold to date
    • No apparent hardware refresh
    • Price drop from $99 to $69
    • HBO Now officially announced by HBO CEO and Ricardo Montalbon/John Boehner stunt-double Richard Plepler
      • Apple is an exclusive partner (no word on the agreement duration)
      • Available early April, timed with the 4/12 Game of Thrones season premiere
      • $14.99/month
  • iPhone
    • 700 million iPhones sold
    • 49% year-over-year sales growth, compared against 26% industry-wide
    • 99% customer sat score for iPhone 6 and 6 Plus
    • Apple Pay
      • 2500 card-issuing banks on board
      • Nearly 700k locations accepting Apple Pay across the U.S.
      • Expansion to vending machines (CocaCola Co.)
    • CarPlay
      • Every major auto manufacturer has committed to supporting CarPlay
      • >40 new models with support shipping this year
    • HomeKit
      • Lots of announcements at CES, nothing earth-shattering announced
    • Health
      • Over 900 apps for managing and tracking health/fitness
      • ResearchKit (introduced by Jeff Williams)
        • Seeks to solve several problems related to medical research
          • Small sample sizes
          • Subjective data
          • Infrequent data
          • One-way communication
        • 5 apps available currently, General availability release next month
        • Takes advantage of HealthKit info, 3rd-party bluetooth devices, GPS and direct user feedback
        • Privacy
          • Opt-in
          • User decides who to share data with
          • Apple does not see the data
        • Open source (unclear as to how they define that)
  • Mac
    • 10 years of outgrowing the industry
    • New MacBook (presented by Phil Schiller)
      • No huge surprises here. See recent ATP episodes for discussions about leaked details.
      • 12” Retina display, 2304×1440 pixels
      • Fanless design, Intel Core-M processor up to 1.3GHz
      • Terraced, contoured battery cells
      • Single USB-C port (and a headphone jack, but who’s counting?)
      • Weighs 2 lbs, 24% thinner than 11-inch MacBook Air (Does the Air brand make any sense now?)
      • Redesigned keyboard, Force Touch trackpad (with new Force Click gestures)
      • Available in Silver, Space Grey, Gold
    • MacBook Air gets faster processors, Thunderbolt 2, 2x faster flash on 13” model
    • 13” MBP gets Force Touch trackpad, faster processors, 2x faster flash and longer battery life
  • Apple Watch
    • Recap of what we learned in September
    • Kevin Lynch demos the watch in action
    • All-day battery life
      • Numbers based on 38MM model. 42MM model typically gets longer battery life
      • Up to 18 hours on a typical day
      • 3 hours talk time
      • 6.5 hours audio playback
      • 6.5 hours workout
      • 48 hours watch
      • 72 hours power reserve
      • Charges 80% in 1.5 hours, 100% in 2.5 hours
    • Pricing
      • Sport: 38MM $349, 42MM $399
      • Watch Collection: 38MM $549-$1049, 42MM $599-$1099
      • Watch Edition: Starts at $10,000, Limited availability
    • April 10 Pre-order and preview
    • Available April 24 in 9 countries

Are our development tools secure?

Picks

Darryl

John

Alternative show title suggestions

  • Spring Forward
  • 10k
  • Attack Vectors
  • Chills me to the bone
  • FUD Scenario
  • Stuxnet
  • Open Source
  • Game over
  • Not Sha1
  • Reasonably Secure