際際滷

際際滷Share a Scribd company logo
let swiftInitialzersTalk = Talk(for lang: )
FORWARD SWIFT 16 | BY @JORDANMORGAN10
WHO AM I?
IOS DEV @
 iOS dev since iOS 6
 Talks, blog, online courses, etc.
FORWARD SWIFT 16: SWIFT INITIALIZERS
WHY TALK ABOUT SWIFTS INITIALIZERS?
 A common point of friction
 there is no escaping them
let foo = Box()
FORWARD SWIFT 16: SWIFT INITIALIZERS
OBJECTIVE-C INIT
- (instancetype)init
{
self = [super init];
if (self)
{
//Setup code...
}
return self;
}
FORWARD SWIFT 16: SWIFT INITIALIZERS
TRYING THAT IN SWIFT
class Foo
{
init()
{
self = super.init()
if self
{
}
return self
}
}
FORWARD SWIFT 16: SWIFT INITIALIZERS
OBJECTIVE-C INITS != SWIFT INITS
Why?
FORWARD SWIFT 16: SWIFT INITIALIZERS
SWIFTS DESIGN GOALS
 SAFE
 FAST
 EXPRESSIVE
FORWARD SWIFT 16: SWIFT INITIALIZERS
SWIFTS DESIGN GOALS
 SAFE
 FAST
 EXPRESSIVE
SAFE
EXPRESSIVE
OPTING FOR SAFETY SOMETIMES MEANS SWIFT WILL FEEL
STRICT, BUT WE BELIEVE THAT CLARITY SAVES TIME IN THE
LONG RUN.
FORWARD SWIFT 16: SWIFT INITIALIZERS
SWIFTS DESIGN GOALS
SAFE
EXPRESSIVESWIFT BENEFITS FROM DECADES
OF ADVANCEMENT IN COMPUTER
SCIENCE TO OFFER SYNTAX THAT
IS A JOY TO USE, WITH MODERN
FEATURES DEVELOPERS EXPECT.
FORWARD SWIFT 16: SWIFT INITIALIZERS
THE MOST BASIC SWIFT INIT: TAKE TWO
class Foo
{
init()
{
self = super.init()
if self
{
}
return self
}
}
class Foo
{
init()
{
}
}
class Foo
{
}
let aFoo = Foo()
 Phase One
 Init() is called
 Memory allocated
 Each of the instance stored props gets a value
 Memory is fully initialized
 Init() delegation kicks in - does the same thing
 Instance methods or self are not allowed here
FORWARD SWIFT 16: SWIFT INITIALIZERS
TWO PHASE INITIALIZATION
class Foo { }
let aFoo = Foo()
Memory
 Phase Two
 Each Init() can customize the instance further
 Self is allowed, instance methods can be called
 but they de鍖nitely dont have to
FORWARD SWIFT 16: SWIFT INITIALIZERS
TWO PHASE INITIALIZATION
class Foo { }
let aFoo = Foo()
Memory
FORWARD SWIFT 16: SWIFT INITIALIZERS
BUT WAITTHERES MORE!
class Foo
{
init() {}
}
class Foo
{
required init() {}
}
class Foo
{
convenience init() {}
}
class Foo
{
init?()
}
struct Foo
{
init() {}
}
FORWARD SWIFT 16: SWIFT INITIALIZERS
KEY POINTS TO REMEMBER WITH SWIFT INITIALIZERS
 Swift inits vs Objective-C inits are very different
 More thought comes into play with inheritance
 Its largely driven by de鍖nitive initialization
 which means, all properties need a value!
Swift properties cannot be in an indeterminate
state before the instance is used
 This wont compile - why?
FORWARD SWIFT 16: SWIFT INITIALIZERS
WORKING WITH STRUCTS
struct ConferenceTalk
{
var talkName:String
init() { }
}
 This wont compile - why?
FORWARD SWIFT 16: SWIFT INITIALIZERS
WORKING WITH STRUCTS
struct ConferenceTalk
{
var talkName:String?
init() { }
}
struct ConferenceTalk
{
var talkName:String
init() { }
}
This becomes the designated initializer for ConferenceTalk
FORWARD SWIFT 16: SWIFT INITIALIZERS
WORKING WITH STRUCTS
struct ConferenceTalk
{
var talkName:String?
init() { }
}
struct ConferenceTalk
{
var talkName = ""
init() { }
}
struct ConferenceTalk
{
var talkName:String
init() { self.talkName = "" }
}
struct ConferenceTalk
{
var talkName = { /*...*/ return ""}()
init() { }
}
struct ConferenceTalk
{
var presenter:String?
var talkName = {
self.presenter = "Something"
return ""
}()
init() { }
}
FORWARD SWIFT 16: SWIFT INITIALIZERS
WORKING WITH STRUCTS
struct ConferenceTalk
{
var talkName = { /*...*/ return ""}()
init() { }
}
Compilation Error!
 Ties a propertys init closely to its declaration
 Intent is clear
 Initializers inheritance
 Type inference!
 default init() for free
//Use defaults 
struct ConferenceTalk
{
var talkDuration = 0.0
}
FORWARD SWIFT 16: SWIFT INITIALIZERS
WORKING WITH STRUCTS - USE DEFAULT VALUES
FORWARD SWIFT 16: SWIFT INITIALIZERS
WORKING WITH STRUCTS
 What about when defaults dont make sense?
struct ConferenceTalk
{
var talkDuration = 0.0
var speakerName:String
var topics:[String]
}
 Memberwise Initializers 
 No default values? No prob! *
 Custom inits() wipe this out
FORWARD SWIFT 16: SWIFT INITIALIZERS
WORKING WITH STRUCTS
struct ConferenceTalk
{
var talkDuration = 0.0
var speakerName:String
var topics:[String]
}
let fsTalk = ConferenceTalk(talkDuration: 45,
speakerName: "Jordan",
topics: ["Swift", "Inits"])
 but dont wanna lose my free one!
 Extensions allow this
 Only convenience inits() though
FORWARD SWIFT 16: SWIFT INITIALIZERS
WORKING WITH STRUCTS - WAIT, I WANT A CUSTOM INIT()
extension ConferenceTalk
{
//An init
}
FORWARD SWIFT 16: SWIFT INITIALIZERS
WORKING WITH STRUCTS - WAIT, I WANT A CUSTOM INIT()
extension ConferenceTalk
{
init(jordansTalk duration:Double)
{
self.init(talkDuration:duration,
speakerName:"Jordan",
topics:["Swift", "Inits"])
}
}
let myTalk = ConferenceTalk(jordansTalk: 45)
FORWARD SWIFT 16: SWIFT INITIALIZERS
WORKING WITH CLASSES A.K.A. HARD MODE
 not really, but there is more to think about 
Swift properties cannot be in an indeterminate
state before the instance is used
- and -
Any instance must have 鍖rst dibs on setting any
properties that it introduced
FORWARD SWIFT 16: SWIFT INITIALIZERS
DESIGNATED INITIALIZERS - EVERY CLASS NEEDS ONE
 Eventually, every instance gets initialized from a designated init()
 Enforces that each property introduced by that class has a value
 Then it calls an initializer from its superclass
class ConferenceTalk
{
var speakerName:String
init(speaker:String)
{
self.speakerName = speaker
}
}
let conTalk = ConferenceTalk(speaker: "Jordan")
FORWARD SWIFT 16: SWIFT INITIALIZERS
DESIGNATED INITIALIZERS CONT.
 Think of them as a funnel
 Typically, each class only has one of these
public init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?)
FORWARD SWIFT 16: SWIFT INITIALIZERS
CONVENIENCE INITIALIZERS - HELPFUL BUT NOT REQUIRED
 Supporting, helpful initializers
 Great for speci鍖c use cases
 Theyll eventually hit a designated initializer
FORWARD SWIFT 16: SWIFT INITIALIZERS
CONVENIENCE INITIALIZERS - EXAMPLE
class ConferenceTalk
{
var speakerName:String
init(speaker:String)
{
self.speakerName = speaker
}
convenience init()
{
self.init(speaker:"Unknown")
}
}
let unknownTalk = ConferenceTalk() //unknownTalk.speakerName == "Unknown"
FORWARD SWIFT 16: SWIFT INITIALIZERS
CONVENIENCE INITIALIZERS - HELPFUL/NOT REQUIRED
init(speaker:String)
{
self.speakerName = speaker
}
convenience init()
{
self.init(speaker:"Unknown")
}
let unknownTalk = ConferenceTalk()
FORWARD SWIFT 16: SWIFT INITIALIZERS
LAWS OF THE LAND
 Rule 1
 A designated initializer must call a designated initializer
from its immediate superclass.
class ForwardSwiftTalk : ConferenceTalk
{
let talkLocation:String
init(location:String)
{
self.talkLocation = location
super.init(speaker: "")
}
}
FORWARD SWIFT 16: SWIFT INITIALIZERS
LAWS OF THE LAND
 Rule 2
 A convenience initializer must call another initializer
from the same class.
class ForwardSwiftTalk : ConferenceTalk
{
let talkLocation:String
init(location:String)
{
self.talkLocation = location
super.init(speaker: "")
}
convenience init()
{
self.init(location: "Hall A")
}
}
FORWARD SWIFT 16: SWIFT INITIALIZERS
LAWS OF THE LAND
 Rule 3
 A convenience initializer must ultimately call a
designated initializer.
class ForwardSwiftTalk : ConferenceTalk
{
let talkLocation:String
init(location:String)
{
self.talkLocation = location
super.init(speaker: "")
}
convenience init()
{
self.init(location: "Hall A")
}
}
FORWARD SWIFT 16: SWIFT INITIALIZERS
THE EASY WAY TO REMEMBER THIS?
Designated Initializers delegate up
Convenience Initializers delegate across
FORWARD SWIFT 16: SWIFT INITIALIZERS
WHAT HAPPENS WHEN I SUBCLASS?
class ConferenceTalk
{
var speakerName:String
init(speaker:String)
{
self.speakerName = speaker
}
convenience init()
{
self.init(speaker:"Unknown")
}
}
class ForwardSwiftTalk : ConferenceTalk
{
//Now Wut ???
}
FORWARD SWIFT 16: SWIFT INITIALIZERS
INHERITANCE
 Unlike Objective-C - you dont always get supers inits()
 But if:
 The subclass doesnt have any custom inits() then 
 If you have an implementation of all of supers designated inits
either from rule 1 or by a custom implementation - then you get
convenience inits() too!
let fsTalk = ForwardSwiftTalk()
FORWARD SWIFT 16: SWIFT INITIALIZERS
INHERITANCE IN ACTION
class ConferenceTalk
{
var speakerName:String
init(speaker:String)
{
self.speakerName = speaker
}
convenience init()
{
self.init(speaker:"Unknown")
}
}
class ForwardSwiftTalk : ConferenceTalk
{
let talkLocation:String
init(location:String)
{
self.talkLocation = location
super.init(speaker: "")
}
}
let fsTalk = ForwardSwiftTalk(location: "Hall A")
FORWARD SWIFT 16: SWIFT INITIALIZERS
class ConferenceTalk
class ForwardSwiftTalk : ConferenceTalk
init(location:String)
{
self.talkLocation = location
super.init(speaker: "")
}
init(location:String)
{
self.talkLocation = location
super.init(speaker: "")
}
FORWARD SWIFT 16: SWIFT INITIALIZERS
SUBCLASS CONVENIENCE HAVE THE SAME RULES
class ForwardSwiftTalk : ConferenceTalk
{
let talkLocation:String
init(location:String)
{
self.talkLocation = location
super.init(speaker: "")
}
convenience init()
{
self.init(location: "Hall A")
}
}
let fsTalk = ForwardSwiftTalk()
 Each class is responsible for setting initial values for things
that it introduces!
FORWARD SWIFT 16: SWIFT INITIALIZERS
THE TRICK REALLY IS TO REMEMBER THAT
class ForwardSwiftTalk : ConferenceTalk
{
let talkLocation:String
init(location:String)
{
self.talkLocation = location
super.init(speaker: "")
}
}
class ForwardSwiftTalk : ConferenceTalk
{
let talkLocation:String
init(location:String)
{
super.init(speaker: "")
self.talkLocation = location
}
}
 Why? Because supers designated init() had the chance to
set them before anyone else did (i.e. FowardSwiftTalk)
FORWARD SWIFT 16: SWIFT INITIALIZERS
AFTER THAT POINT - YOU CAN CUSTOMIZE SUPERS PROPS
class ForwardSwiftTalk : ConferenceTalk
{
let talkLocation:String
init(location:String)
{
self.talkLocation = location
super.init(speaker: "")
self.speakerName = "俗_( )_/俗"
}
}
FYI: This is crazy town if youre still wearing Objective-C glasses
 Failable inits() allow for you to say This might not work
 Most famously
 Here, weve got an optional UIImage instance
FORWARD SWIFT 16: SWIFT INITIALIZERS
ENOUGH ABOUT INHERITANCE - LETS TALK FAILURE
let maybeAnImage = UIImage(named: "Jordan_Excercising")
FORWARD SWIFT 16: SWIFT INITIALIZERS
FAILABLE INITIALIZERS EXAMPLE
class ConferenceTalk
{
var speakerName:String
init?(speaker:String)
{
if speaker.isEmpty
{
return nil
}
self.speakerName = speaker
}
}
let emptyTalk = ConferenceTalk(speaker: "")
if let aTalk = emptyTalk
{
//We've got something
}
FORWARD SWIFT 16: SWIFT INITIALIZERS
FAILABLE INITIALIZERS ARE QUITE FANCY, BECAUSE
They can delegate up
and across
to one of supers failable initializers
to another failable initializer within the instance
FORWARD SWIFT 16: SWIFT INITIALIZERS
FLEXIBLE: OVERRIDE A FAILABLE WITH A NON-FAILABLE
class ConferenceTalk
{
var speakerName:String?
init(){}
init?(speaker:String)
{
if speaker.isEmpty
{
return nil
}
self.speakerName = speaker
}
}
class ForwardSwiftTalk : ConferenceTalk
{
let talkLocation:String
override init()
{
self.talkLocation = ""
super.init()
self.speakerName = "No Speaker Set"
}
override init(speaker:String)
{
self.talkLocation = ""
super.init()
self.speakerName = speaker.isEmpty ? "No
Speaker Set" : speaker
}
}
FORWARD SWIFT 16: SWIFT INITIALIZERS
YOU CAN TRIGGER A FAILURE ANYTIME
class ConferenceTalk
{
var speakerName:String
init?(speaker:String)
{
if speaker.isEmpty
{
return nil
}
self.speakerName = speaker
}
}
class ForwardSwiftTalk : ConferenceTalk
{
let talkLocation:String
init?(location:String, speaker:String)
{
if location.isEmpty
{
return nil
}
self.talkLocation = location
super.init(speaker: speaker)
}
}
FORWARD SWIFT 16: SWIFT INITIALIZERS
LASTLY, LETS TALK REQUIRED INITIALIZERS
 Use these to signify that subclasses must implement it
class ConferenceTalk
{
var speakerName:String
required init(speaker:String)
{
self.speakerName = speaker
}
}
class ForwardSwiftTalk : ConferenceTalk
{
let talkLocation:String
init(location:String)
{
self.talkLocation = location
super.init(speaker: "")
}
}
Compilation Error!
FORWARD SWIFT 16: SWIFT INITIALIZERS
ISSUES WITH SUBCLASSING UIVIEWCONTROLLER? THIS IS WHY.
class FooViewController:UIViewController
{
let aValue:String
init(someValue:String)
{
self.aValue = someValue
super.init(nibName: "", bundle: nil)
}
}
FORWARD SWIFT 16: SWIFT INITIALIZERS
ISSUES WITH SUBCLASSING UIVIEWCONTROLLER? THIS IS WHY.
class FooViewController:UIViewController
{
let aValue:String
init(someValue:String)
{
self.aValue = someValue
super.init(nibName: "", bundle: nil)
}
}
class FooViewController:UIViewController
{
let aValue:String
init(someValue:String)
{
self.aValue = someValue
super.init(nibName: "", bundle: nil)
}
required init?(coder aDecoder: NSCoder)
{
self.aValue = ""
super.init(coder: aDecoder)
}
}
FORWARD SWIFT 16: SWIFT INITIALIZERS
WRAP UP: TO MAKE THINGS EASY JUST REMEMBER THAT
 Always start with making sure your properties have a value
before anything else
 An instance always has 鍖rsties on setting its introduced
instances. So when inheriting, call supers init before you try and
set its properties
 Look out for required inits (i.e. UIViewController)
 Value types are easier (no inheritance to worry about)
 Dont think about Objective-C inits at all when writing Swift
ones
FORWARD SWIFT 16: SWIFT INITIALIZERS
THE PLUGS
 @jordanmorgan10 on the Twittersphere
 bit.ly/iosdevguide - Also pluralsight.com for iOS courses.
 @bufferdevs | over鍖ow.buffer.com | github for open source
bit.ly/bfrimgviewer bit.ly/bfrgifrefresh bit.ly/bfrswiftkit
let restOfFS16 = FSCon(be super:.Awesome)

More Related Content

Similar to Swift initcopy (20)

The Joy of Server Side Swift Development
The Joy  of Server Side Swift DevelopmentThe Joy  of Server Side Swift Development
The Joy of Server Side Swift Development
Giordano Scalzo
BUILDING APPS WITH ASYNCIO
BUILDING APPS WITH ASYNCIOBUILDING APPS WITH ASYNCIO
BUILDING APPS WITH ASYNCIO
Mykola Novik
Free FreeRTOS Course-Task Management
Free FreeRTOS Course-Task ManagementFree FreeRTOS Course-Task Management
Free FreeRTOS Course-Task Management
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
Async Frontiers
Async FrontiersAsync Frontiers
Async Frontiers
Domenic Denicola
Server Side Swift
Server Side SwiftServer Side Swift
Server Side Swift
Chad Moone
Why the Dark Side should use Swift and a SOLID Architecture
Why the Dark Side should use Swift and a SOLID ArchitectureWhy the Dark Side should use Swift and a SOLID Architecture
Why the Dark Side should use Swift and a SOLID Architecture
Jorge Ortiz
invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]
David Buck
LAU ACM - Introduction to Swift - Dani Arnaout
LAU ACM - Introduction to Swift - Dani ArnaoutLAU ACM - Introduction to Swift - Dani Arnaout
LAU ACM - Introduction to Swift - Dani Arnaout
Dani Arnaout
Coroutines talk ppt
Coroutines talk pptCoroutines talk ppt
Coroutines talk ppt
Shahroz Khan
Swift server-side-let swift2016
Swift server-side-let swift2016Swift server-side-let swift2016
Swift server-side-let swift2016
Eric Ahn
Multithreading on iOS
Multithreading on iOSMultithreading on iOS
Multithreading on iOS
Make School
forwarder.java.txt java forwarder class waits for an in.docx
forwarder.java.txt java forwarder class waits for an in.docxforwarder.java.txt java forwarder class waits for an in.docx
forwarder.java.txt java forwarder class waits for an in.docx
budbarber38650
Java Full Throttle
Java Full ThrottleJava Full Throttle
Java Full Throttle
Jos辿 Paumard
Building a scalable learning platform - Erik Veld - Codemotion Amsterdam 2018
Building a scalable learning platform - Erik Veld - Codemotion Amsterdam 2018Building a scalable learning platform - Erik Veld - Codemotion Amsterdam 2018
Building a scalable learning platform - Erik Veld - Codemotion Amsterdam 2018
Codemotion
"Less Painful iOS Development" by Samuel Edwin (Tokopedia)
"Less Painful iOS Development" by Samuel Edwin (Tokopedia)"Less Painful iOS Development" by Samuel Edwin (Tokopedia)
"Less Painful iOS Development" by Samuel Edwin (Tokopedia)
Tech in Asia ID
Socket.io (part 1)
Socket.io (part 1)Socket.io (part 1)
Socket.io (part 1)
Andrea Tarquini
CP3108B (Mozilla) Sharing Session on Add-on SDK
CP3108B (Mozilla) Sharing Session on Add-on SDKCP3108B (Mozilla) Sharing Session on Add-on SDK
CP3108B (Mozilla) Sharing Session on Add-on SDK
Mifeng
Vapor Swift is not only for iOS anymore
Vapor  Swift is not only for iOS anymoreVapor  Swift is not only for iOS anymore
Vapor Swift is not only for iOS anymore
Milan V鱈t
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
jeffz
Java Basics
Java BasicsJava Basics
Java Basics
Sunil OS
The Joy of Server Side Swift Development
The Joy  of Server Side Swift DevelopmentThe Joy  of Server Side Swift Development
The Joy of Server Side Swift Development
Giordano Scalzo
BUILDING APPS WITH ASYNCIO
BUILDING APPS WITH ASYNCIOBUILDING APPS WITH ASYNCIO
BUILDING APPS WITH ASYNCIO
Mykola Novik
Server Side Swift
Server Side SwiftServer Side Swift
Server Side Swift
Chad Moone
Why the Dark Side should use Swift and a SOLID Architecture
Why the Dark Side should use Swift and a SOLID ArchitectureWhy the Dark Side should use Swift and a SOLID Architecture
Why the Dark Side should use Swift and a SOLID Architecture
Jorge Ortiz
invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]
David Buck
LAU ACM - Introduction to Swift - Dani Arnaout
LAU ACM - Introduction to Swift - Dani ArnaoutLAU ACM - Introduction to Swift - Dani Arnaout
LAU ACM - Introduction to Swift - Dani Arnaout
Dani Arnaout
Coroutines talk ppt
Coroutines talk pptCoroutines talk ppt
Coroutines talk ppt
Shahroz Khan
Swift server-side-let swift2016
Swift server-side-let swift2016Swift server-side-let swift2016
Swift server-side-let swift2016
Eric Ahn
Multithreading on iOS
Multithreading on iOSMultithreading on iOS
Multithreading on iOS
Make School
forwarder.java.txt java forwarder class waits for an in.docx
forwarder.java.txt java forwarder class waits for an in.docxforwarder.java.txt java forwarder class waits for an in.docx
forwarder.java.txt java forwarder class waits for an in.docx
budbarber38650
Building a scalable learning platform - Erik Veld - Codemotion Amsterdam 2018
Building a scalable learning platform - Erik Veld - Codemotion Amsterdam 2018Building a scalable learning platform - Erik Veld - Codemotion Amsterdam 2018
Building a scalable learning platform - Erik Veld - Codemotion Amsterdam 2018
Codemotion
"Less Painful iOS Development" by Samuel Edwin (Tokopedia)
"Less Painful iOS Development" by Samuel Edwin (Tokopedia)"Less Painful iOS Development" by Samuel Edwin (Tokopedia)
"Less Painful iOS Development" by Samuel Edwin (Tokopedia)
Tech in Asia ID
CP3108B (Mozilla) Sharing Session on Add-on SDK
CP3108B (Mozilla) Sharing Session on Add-on SDKCP3108B (Mozilla) Sharing Session on Add-on SDK
CP3108B (Mozilla) Sharing Session on Add-on SDK
Mifeng
Vapor Swift is not only for iOS anymore
Vapor  Swift is not only for iOS anymoreVapor  Swift is not only for iOS anymore
Vapor Swift is not only for iOS anymore
Milan V鱈t
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
jeffz
Java Basics
Java BasicsJava Basics
Java Basics
Sunil OS

Recently uploaded (20)

Ship Show Ask at Lean Agile Edinburgh 2025
Ship Show Ask at Lean Agile Edinburgh 2025Ship Show Ask at Lean Agile Edinburgh 2025
Ship Show Ask at Lean Agile Edinburgh 2025
rouanw
Adobe Marketo Engage Champion Deep Dive: Extending Marketo With AEM Forms
Adobe Marketo Engage Champion Deep Dive: Extending Marketo With AEM FormsAdobe Marketo Engage Champion Deep Dive: Extending Marketo With AEM Forms
Adobe Marketo Engage Champion Deep Dive: Extending Marketo With AEM Forms
BradBedford3
EASEUS Partition Master Crack with License Code [Latest]
EASEUS Partition Master Crack with License Code [Latest]EASEUS Partition Master Crack with License Code [Latest]
EASEUS Partition Master Crack with License Code [Latest]
bhagasufyan
Web Development Services by Icubetechnolabs.pdf
Web Development Services by Icubetechnolabs.pdfWeb Development Services by Icubetechnolabs.pdf
Web Development Services by Icubetechnolabs.pdf
ICUBETECHNOLABS
SAP Document Compliance Overview -Imp document.pdf
SAP Document Compliance Overview -Imp document.pdfSAP Document Compliance Overview -Imp document.pdf
SAP Document Compliance Overview -Imp document.pdf
annapureddyn
Rise of the Phoenix: Lesson Learned Build an AI-powered Test Gen Engine
Rise of the Phoenix: Lesson Learned Build an AI-powered Test Gen EngineRise of the Phoenix: Lesson Learned Build an AI-powered Test Gen Engine
Rise of the Phoenix: Lesson Learned Build an AI-powered Test Gen Engine
stevebrudz1
Wondershare Filmora Crack Free Download
Wondershare Filmora  Crack Free DownloadWondershare Filmora  Crack Free Download
Wondershare Filmora Crack Free Download
zqeevcqb3t
Trivium: A Framework For Symbolic Metaprogramming in C++
Trivium: A Framework For Symbolic Metaprogramming in C++Trivium: A Framework For Symbolic Metaprogramming in C++
Trivium: A Framework For Symbolic Metaprogramming in C++
andreasmaniotis
Online Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi NcrOnline Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi Ncr
Home
Chimera Tool 41.26.2101 Crack License Key Free Download
Chimera Tool 41.26.2101 Crack License Key Free DownloadChimera Tool 41.26.2101 Crack License Key Free Download
Chimera Tool 41.26.2101 Crack License Key Free Download
nasirali027m
How John started to like TDD (instead of hating it) - TED talk
How John started to like TDD (instead of hating it) - TED talkHow John started to like TDD (instead of hating it) - TED talk
How John started to like TDD (instead of hating it) - TED talk
Nacho Cougil
Why Hire Python Developers? Key Benefits for Your Business
Why Hire Python Developers? Key Benefits for Your BusinessWhy Hire Python Developers? Key Benefits for Your Business
Why Hire Python Developers? Key Benefits for Your Business
Mypcot Infotech
AI Agents and More:Build Your AI Assistans
AI Agents and More:Build Your AI AssistansAI Agents and More:Build Your AI Assistans
AI Agents and More:Build Your AI Assistans
HusseinMalikMammadli
Douwan Preactivated Plus Crack 2025-Latest
Douwan Preactivated Plus Crack 2025-LatestDouwan Preactivated Plus Crack 2025-Latest
Douwan Preactivated Plus Crack 2025-Latest
mubeen010khan
Odoo WooCommerce Connector, Multiple Woocommerce store connection
Odoo WooCommerce Connector,  Multiple Woocommerce store connectionOdoo WooCommerce Connector,  Multiple Woocommerce store connection
Odoo WooCommerce Connector, Multiple Woocommerce store connection
Aagam infotech
Enscape Latest 2025 Crack Free Download
Enscape Latest 2025  Crack Free DownloadEnscape Latest 2025  Crack Free Download
Enscape Latest 2025 Crack Free Download
rnzu5cxw0y
Cybersecurity & Innovation: The Future of Mobile App Development
Cybersecurity & Innovation: The Future of Mobile App DevelopmentCybersecurity & Innovation: The Future of Mobile App Development
Cybersecurity & Innovation: The Future of Mobile App Development
iProgrammer Solutions Private Limited
Software Development Services: A Complete Guide
Software Development Services: A Complete GuideSoftware Development Services: A Complete Guide
Software Development Services: A Complete Guide
Andrew Wade
VADY: Unlocking Growth Through Data-Driven CFO Strategies
VADY: Unlocking Growth Through Data-Driven CFO StrategiesVADY: Unlocking Growth Through Data-Driven CFO Strategies
VADY: Unlocking Growth Through Data-Driven CFO Strategies
NewFangledVision
Shooman_11 Software Reliability (1).pptx
Shooman_11 Software Reliability (1).pptxShooman_11 Software Reliability (1).pptx
Shooman_11 Software Reliability (1).pptx
NAZMUSSAKIBMDADIL200
Ship Show Ask at Lean Agile Edinburgh 2025
Ship Show Ask at Lean Agile Edinburgh 2025Ship Show Ask at Lean Agile Edinburgh 2025
Ship Show Ask at Lean Agile Edinburgh 2025
rouanw
Adobe Marketo Engage Champion Deep Dive: Extending Marketo With AEM Forms
Adobe Marketo Engage Champion Deep Dive: Extending Marketo With AEM FormsAdobe Marketo Engage Champion Deep Dive: Extending Marketo With AEM Forms
Adobe Marketo Engage Champion Deep Dive: Extending Marketo With AEM Forms
BradBedford3
EASEUS Partition Master Crack with License Code [Latest]
EASEUS Partition Master Crack with License Code [Latest]EASEUS Partition Master Crack with License Code [Latest]
EASEUS Partition Master Crack with License Code [Latest]
bhagasufyan
Web Development Services by Icubetechnolabs.pdf
Web Development Services by Icubetechnolabs.pdfWeb Development Services by Icubetechnolabs.pdf
Web Development Services by Icubetechnolabs.pdf
ICUBETECHNOLABS
SAP Document Compliance Overview -Imp document.pdf
SAP Document Compliance Overview -Imp document.pdfSAP Document Compliance Overview -Imp document.pdf
SAP Document Compliance Overview -Imp document.pdf
annapureddyn
Rise of the Phoenix: Lesson Learned Build an AI-powered Test Gen Engine
Rise of the Phoenix: Lesson Learned Build an AI-powered Test Gen EngineRise of the Phoenix: Lesson Learned Build an AI-powered Test Gen Engine
Rise of the Phoenix: Lesson Learned Build an AI-powered Test Gen Engine
stevebrudz1
Wondershare Filmora Crack Free Download
Wondershare Filmora  Crack Free DownloadWondershare Filmora  Crack Free Download
Wondershare Filmora Crack Free Download
zqeevcqb3t
Trivium: A Framework For Symbolic Metaprogramming in C++
Trivium: A Framework For Symbolic Metaprogramming in C++Trivium: A Framework For Symbolic Metaprogramming in C++
Trivium: A Framework For Symbolic Metaprogramming in C++
andreasmaniotis
Online Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi NcrOnline Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi Ncr
Home
Chimera Tool 41.26.2101 Crack License Key Free Download
Chimera Tool 41.26.2101 Crack License Key Free DownloadChimera Tool 41.26.2101 Crack License Key Free Download
Chimera Tool 41.26.2101 Crack License Key Free Download
nasirali027m
How John started to like TDD (instead of hating it) - TED talk
How John started to like TDD (instead of hating it) - TED talkHow John started to like TDD (instead of hating it) - TED talk
How John started to like TDD (instead of hating it) - TED talk
Nacho Cougil
Why Hire Python Developers? Key Benefits for Your Business
Why Hire Python Developers? Key Benefits for Your BusinessWhy Hire Python Developers? Key Benefits for Your Business
Why Hire Python Developers? Key Benefits for Your Business
Mypcot Infotech
AI Agents and More:Build Your AI Assistans
AI Agents and More:Build Your AI AssistansAI Agents and More:Build Your AI Assistans
AI Agents and More:Build Your AI Assistans
HusseinMalikMammadli
Douwan Preactivated Plus Crack 2025-Latest
Douwan Preactivated Plus Crack 2025-LatestDouwan Preactivated Plus Crack 2025-Latest
Douwan Preactivated Plus Crack 2025-Latest
mubeen010khan
Odoo WooCommerce Connector, Multiple Woocommerce store connection
Odoo WooCommerce Connector,  Multiple Woocommerce store connectionOdoo WooCommerce Connector,  Multiple Woocommerce store connection
Odoo WooCommerce Connector, Multiple Woocommerce store connection
Aagam infotech
Enscape Latest 2025 Crack Free Download
Enscape Latest 2025  Crack Free DownloadEnscape Latest 2025  Crack Free Download
Enscape Latest 2025 Crack Free Download
rnzu5cxw0y
Software Development Services: A Complete Guide
Software Development Services: A Complete GuideSoftware Development Services: A Complete Guide
Software Development Services: A Complete Guide
Andrew Wade
VADY: Unlocking Growth Through Data-Driven CFO Strategies
VADY: Unlocking Growth Through Data-Driven CFO StrategiesVADY: Unlocking Growth Through Data-Driven CFO Strategies
VADY: Unlocking Growth Through Data-Driven CFO Strategies
NewFangledVision
Shooman_11 Software Reliability (1).pptx
Shooman_11 Software Reliability (1).pptxShooman_11 Software Reliability (1).pptx
Shooman_11 Software Reliability (1).pptx
NAZMUSSAKIBMDADIL200

Swift initcopy

  • 1. let swiftInitialzersTalk = Talk(for lang: ) FORWARD SWIFT 16 | BY @JORDANMORGAN10
  • 2. WHO AM I? IOS DEV @ iOS dev since iOS 6 Talks, blog, online courses, etc.
  • 3. FORWARD SWIFT 16: SWIFT INITIALIZERS WHY TALK ABOUT SWIFTS INITIALIZERS? A common point of friction there is no escaping them let foo = Box()
  • 4. FORWARD SWIFT 16: SWIFT INITIALIZERS OBJECTIVE-C INIT - (instancetype)init { self = [super init]; if (self) { //Setup code... } return self; }
  • 5. FORWARD SWIFT 16: SWIFT INITIALIZERS TRYING THAT IN SWIFT class Foo { init() { self = super.init() if self { } return self } }
  • 6. FORWARD SWIFT 16: SWIFT INITIALIZERS OBJECTIVE-C INITS != SWIFT INITS Why?
  • 7. FORWARD SWIFT 16: SWIFT INITIALIZERS SWIFTS DESIGN GOALS SAFE FAST EXPRESSIVE
  • 8. FORWARD SWIFT 16: SWIFT INITIALIZERS SWIFTS DESIGN GOALS SAFE FAST EXPRESSIVE SAFE EXPRESSIVE
  • 9. OPTING FOR SAFETY SOMETIMES MEANS SWIFT WILL FEEL STRICT, BUT WE BELIEVE THAT CLARITY SAVES TIME IN THE LONG RUN. FORWARD SWIFT 16: SWIFT INITIALIZERS SWIFTS DESIGN GOALS SAFE EXPRESSIVESWIFT BENEFITS FROM DECADES OF ADVANCEMENT IN COMPUTER SCIENCE TO OFFER SYNTAX THAT IS A JOY TO USE, WITH MODERN FEATURES DEVELOPERS EXPECT.
  • 10. FORWARD SWIFT 16: SWIFT INITIALIZERS THE MOST BASIC SWIFT INIT: TAKE TWO class Foo { init() { self = super.init() if self { } return self } } class Foo { init() { } } class Foo { } let aFoo = Foo()
  • 11. Phase One Init() is called Memory allocated Each of the instance stored props gets a value Memory is fully initialized Init() delegation kicks in - does the same thing Instance methods or self are not allowed here FORWARD SWIFT 16: SWIFT INITIALIZERS TWO PHASE INITIALIZATION class Foo { } let aFoo = Foo() Memory
  • 12. Phase Two Each Init() can customize the instance further Self is allowed, instance methods can be called but they de鍖nitely dont have to FORWARD SWIFT 16: SWIFT INITIALIZERS TWO PHASE INITIALIZATION class Foo { } let aFoo = Foo() Memory
  • 13. FORWARD SWIFT 16: SWIFT INITIALIZERS BUT WAITTHERES MORE! class Foo { init() {} } class Foo { required init() {} } class Foo { convenience init() {} } class Foo { init?() } struct Foo { init() {} }
  • 14. FORWARD SWIFT 16: SWIFT INITIALIZERS KEY POINTS TO REMEMBER WITH SWIFT INITIALIZERS Swift inits vs Objective-C inits are very different More thought comes into play with inheritance Its largely driven by de鍖nitive initialization which means, all properties need a value! Swift properties cannot be in an indeterminate state before the instance is used
  • 15. This wont compile - why? FORWARD SWIFT 16: SWIFT INITIALIZERS WORKING WITH STRUCTS struct ConferenceTalk { var talkName:String init() { } }
  • 16. This wont compile - why? FORWARD SWIFT 16: SWIFT INITIALIZERS WORKING WITH STRUCTS struct ConferenceTalk { var talkName:String? init() { } } struct ConferenceTalk { var talkName:String init() { } } This becomes the designated initializer for ConferenceTalk
  • 17. FORWARD SWIFT 16: SWIFT INITIALIZERS WORKING WITH STRUCTS struct ConferenceTalk { var talkName:String? init() { } } struct ConferenceTalk { var talkName = "" init() { } } struct ConferenceTalk { var talkName:String init() { self.talkName = "" } } struct ConferenceTalk { var talkName = { /*...*/ return ""}() init() { } }
  • 18. struct ConferenceTalk { var presenter:String? var talkName = { self.presenter = "Something" return "" }() init() { } } FORWARD SWIFT 16: SWIFT INITIALIZERS WORKING WITH STRUCTS struct ConferenceTalk { var talkName = { /*...*/ return ""}() init() { } } Compilation Error!
  • 19. Ties a propertys init closely to its declaration Intent is clear Initializers inheritance Type inference! default init() for free //Use defaults struct ConferenceTalk { var talkDuration = 0.0 } FORWARD SWIFT 16: SWIFT INITIALIZERS WORKING WITH STRUCTS - USE DEFAULT VALUES
  • 20. FORWARD SWIFT 16: SWIFT INITIALIZERS WORKING WITH STRUCTS What about when defaults dont make sense? struct ConferenceTalk { var talkDuration = 0.0 var speakerName:String var topics:[String] }
  • 21. Memberwise Initializers No default values? No prob! * Custom inits() wipe this out FORWARD SWIFT 16: SWIFT INITIALIZERS WORKING WITH STRUCTS struct ConferenceTalk { var talkDuration = 0.0 var speakerName:String var topics:[String] } let fsTalk = ConferenceTalk(talkDuration: 45, speakerName: "Jordan", topics: ["Swift", "Inits"])
  • 22. but dont wanna lose my free one! Extensions allow this Only convenience inits() though FORWARD SWIFT 16: SWIFT INITIALIZERS WORKING WITH STRUCTS - WAIT, I WANT A CUSTOM INIT() extension ConferenceTalk { //An init }
  • 23. FORWARD SWIFT 16: SWIFT INITIALIZERS WORKING WITH STRUCTS - WAIT, I WANT A CUSTOM INIT() extension ConferenceTalk { init(jordansTalk duration:Double) { self.init(talkDuration:duration, speakerName:"Jordan", topics:["Swift", "Inits"]) } } let myTalk = ConferenceTalk(jordansTalk: 45)
  • 24. FORWARD SWIFT 16: SWIFT INITIALIZERS WORKING WITH CLASSES A.K.A. HARD MODE not really, but there is more to think about Swift properties cannot be in an indeterminate state before the instance is used - and - Any instance must have 鍖rst dibs on setting any properties that it introduced
  • 25. FORWARD SWIFT 16: SWIFT INITIALIZERS DESIGNATED INITIALIZERS - EVERY CLASS NEEDS ONE Eventually, every instance gets initialized from a designated init() Enforces that each property introduced by that class has a value Then it calls an initializer from its superclass class ConferenceTalk { var speakerName:String init(speaker:String) { self.speakerName = speaker } } let conTalk = ConferenceTalk(speaker: "Jordan")
  • 26. FORWARD SWIFT 16: SWIFT INITIALIZERS DESIGNATED INITIALIZERS CONT. Think of them as a funnel Typically, each class only has one of these public init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?)
  • 27. FORWARD SWIFT 16: SWIFT INITIALIZERS CONVENIENCE INITIALIZERS - HELPFUL BUT NOT REQUIRED Supporting, helpful initializers Great for speci鍖c use cases Theyll eventually hit a designated initializer
  • 28. FORWARD SWIFT 16: SWIFT INITIALIZERS CONVENIENCE INITIALIZERS - EXAMPLE class ConferenceTalk { var speakerName:String init(speaker:String) { self.speakerName = speaker } convenience init() { self.init(speaker:"Unknown") } } let unknownTalk = ConferenceTalk() //unknownTalk.speakerName == "Unknown"
  • 29. FORWARD SWIFT 16: SWIFT INITIALIZERS CONVENIENCE INITIALIZERS - HELPFUL/NOT REQUIRED init(speaker:String) { self.speakerName = speaker } convenience init() { self.init(speaker:"Unknown") } let unknownTalk = ConferenceTalk()
  • 30. FORWARD SWIFT 16: SWIFT INITIALIZERS LAWS OF THE LAND Rule 1 A designated initializer must call a designated initializer from its immediate superclass. class ForwardSwiftTalk : ConferenceTalk { let talkLocation:String init(location:String) { self.talkLocation = location super.init(speaker: "") } }
  • 31. FORWARD SWIFT 16: SWIFT INITIALIZERS LAWS OF THE LAND Rule 2 A convenience initializer must call another initializer from the same class. class ForwardSwiftTalk : ConferenceTalk { let talkLocation:String init(location:String) { self.talkLocation = location super.init(speaker: "") } convenience init() { self.init(location: "Hall A") } }
  • 32. FORWARD SWIFT 16: SWIFT INITIALIZERS LAWS OF THE LAND Rule 3 A convenience initializer must ultimately call a designated initializer. class ForwardSwiftTalk : ConferenceTalk { let talkLocation:String init(location:String) { self.talkLocation = location super.init(speaker: "") } convenience init() { self.init(location: "Hall A") } }
  • 33. FORWARD SWIFT 16: SWIFT INITIALIZERS THE EASY WAY TO REMEMBER THIS? Designated Initializers delegate up Convenience Initializers delegate across
  • 34. FORWARD SWIFT 16: SWIFT INITIALIZERS WHAT HAPPENS WHEN I SUBCLASS? class ConferenceTalk { var speakerName:String init(speaker:String) { self.speakerName = speaker } convenience init() { self.init(speaker:"Unknown") } } class ForwardSwiftTalk : ConferenceTalk { //Now Wut ??? }
  • 35. FORWARD SWIFT 16: SWIFT INITIALIZERS INHERITANCE Unlike Objective-C - you dont always get supers inits() But if: The subclass doesnt have any custom inits() then If you have an implementation of all of supers designated inits either from rule 1 or by a custom implementation - then you get convenience inits() too! let fsTalk = ForwardSwiftTalk()
  • 36. FORWARD SWIFT 16: SWIFT INITIALIZERS INHERITANCE IN ACTION class ConferenceTalk { var speakerName:String init(speaker:String) { self.speakerName = speaker } convenience init() { self.init(speaker:"Unknown") } } class ForwardSwiftTalk : ConferenceTalk { let talkLocation:String init(location:String) { self.talkLocation = location super.init(speaker: "") } } let fsTalk = ForwardSwiftTalk(location: "Hall A")
  • 37. FORWARD SWIFT 16: SWIFT INITIALIZERS class ConferenceTalk class ForwardSwiftTalk : ConferenceTalk init(location:String) { self.talkLocation = location super.init(speaker: "") } init(location:String) { self.talkLocation = location super.init(speaker: "") }
  • 38. FORWARD SWIFT 16: SWIFT INITIALIZERS SUBCLASS CONVENIENCE HAVE THE SAME RULES class ForwardSwiftTalk : ConferenceTalk { let talkLocation:String init(location:String) { self.talkLocation = location super.init(speaker: "") } convenience init() { self.init(location: "Hall A") } } let fsTalk = ForwardSwiftTalk()
  • 39. Each class is responsible for setting initial values for things that it introduces! FORWARD SWIFT 16: SWIFT INITIALIZERS THE TRICK REALLY IS TO REMEMBER THAT class ForwardSwiftTalk : ConferenceTalk { let talkLocation:String init(location:String) { self.talkLocation = location super.init(speaker: "") } } class ForwardSwiftTalk : ConferenceTalk { let talkLocation:String init(location:String) { super.init(speaker: "") self.talkLocation = location } }
  • 40. Why? Because supers designated init() had the chance to set them before anyone else did (i.e. FowardSwiftTalk) FORWARD SWIFT 16: SWIFT INITIALIZERS AFTER THAT POINT - YOU CAN CUSTOMIZE SUPERS PROPS class ForwardSwiftTalk : ConferenceTalk { let talkLocation:String init(location:String) { self.talkLocation = location super.init(speaker: "") self.speakerName = "俗_( )_/俗" } } FYI: This is crazy town if youre still wearing Objective-C glasses
  • 41. Failable inits() allow for you to say This might not work Most famously Here, weve got an optional UIImage instance FORWARD SWIFT 16: SWIFT INITIALIZERS ENOUGH ABOUT INHERITANCE - LETS TALK FAILURE let maybeAnImage = UIImage(named: "Jordan_Excercising")
  • 42. FORWARD SWIFT 16: SWIFT INITIALIZERS FAILABLE INITIALIZERS EXAMPLE class ConferenceTalk { var speakerName:String init?(speaker:String) { if speaker.isEmpty { return nil } self.speakerName = speaker } } let emptyTalk = ConferenceTalk(speaker: "") if let aTalk = emptyTalk { //We've got something }
  • 43. FORWARD SWIFT 16: SWIFT INITIALIZERS FAILABLE INITIALIZERS ARE QUITE FANCY, BECAUSE They can delegate up and across to one of supers failable initializers to another failable initializer within the instance
  • 44. FORWARD SWIFT 16: SWIFT INITIALIZERS FLEXIBLE: OVERRIDE A FAILABLE WITH A NON-FAILABLE class ConferenceTalk { var speakerName:String? init(){} init?(speaker:String) { if speaker.isEmpty { return nil } self.speakerName = speaker } } class ForwardSwiftTalk : ConferenceTalk { let talkLocation:String override init() { self.talkLocation = "" super.init() self.speakerName = "No Speaker Set" } override init(speaker:String) { self.talkLocation = "" super.init() self.speakerName = speaker.isEmpty ? "No Speaker Set" : speaker } }
  • 45. FORWARD SWIFT 16: SWIFT INITIALIZERS YOU CAN TRIGGER A FAILURE ANYTIME class ConferenceTalk { var speakerName:String init?(speaker:String) { if speaker.isEmpty { return nil } self.speakerName = speaker } } class ForwardSwiftTalk : ConferenceTalk { let talkLocation:String init?(location:String, speaker:String) { if location.isEmpty { return nil } self.talkLocation = location super.init(speaker: speaker) } }
  • 46. FORWARD SWIFT 16: SWIFT INITIALIZERS LASTLY, LETS TALK REQUIRED INITIALIZERS Use these to signify that subclasses must implement it class ConferenceTalk { var speakerName:String required init(speaker:String) { self.speakerName = speaker } } class ForwardSwiftTalk : ConferenceTalk { let talkLocation:String init(location:String) { self.talkLocation = location super.init(speaker: "") } } Compilation Error!
  • 47. FORWARD SWIFT 16: SWIFT INITIALIZERS ISSUES WITH SUBCLASSING UIVIEWCONTROLLER? THIS IS WHY. class FooViewController:UIViewController { let aValue:String init(someValue:String) { self.aValue = someValue super.init(nibName: "", bundle: nil) } }
  • 48. FORWARD SWIFT 16: SWIFT INITIALIZERS ISSUES WITH SUBCLASSING UIVIEWCONTROLLER? THIS IS WHY. class FooViewController:UIViewController { let aValue:String init(someValue:String) { self.aValue = someValue super.init(nibName: "", bundle: nil) } } class FooViewController:UIViewController { let aValue:String init(someValue:String) { self.aValue = someValue super.init(nibName: "", bundle: nil) } required init?(coder aDecoder: NSCoder) { self.aValue = "" super.init(coder: aDecoder) } }
  • 49. FORWARD SWIFT 16: SWIFT INITIALIZERS WRAP UP: TO MAKE THINGS EASY JUST REMEMBER THAT Always start with making sure your properties have a value before anything else An instance always has 鍖rsties on setting its introduced instances. So when inheriting, call supers init before you try and set its properties Look out for required inits (i.e. UIViewController) Value types are easier (no inheritance to worry about) Dont think about Objective-C inits at all when writing Swift ones
  • 50. FORWARD SWIFT 16: SWIFT INITIALIZERS THE PLUGS @jordanmorgan10 on the Twittersphere bit.ly/iosdevguide - Also pluralsight.com for iOS courses. @bufferdevs | over鍖ow.buffer.com | github for open source
  • 52. let restOfFS16 = FSCon(be super:.Awesome)