<commit_before># Day 1 :: Swift for Blaggers

{float=left}
![](images/01/thumbnail.png)
It won't have gone unnoticed that at WWDC this year, in addition to announcing
iOS8, they also introduced a new programming language in the form of Swift. This
is quite a different language from objective-C in that it is strongly-typed and
includes some features common to more modern languages.

{float=right}
![](images/01/swift_logo.png)
In the interests of embracing anything and everything that's new and shiny, this
book will exclusively use Swift. There is a wealth of information out
there about how to learn Swift, and how to interact with the Cocoa libraries -
in fact you can't go wrong with starting out by reading through the official
books:

- [The Swift Programming Language](https://itunes.apple.com/us/book/the-swift-programming-language/id881256329)
- [Using Swift with Cocoa and Objective-C](https://itunes.apple.com/us/book/using-swift-cocoa-objective/id888894773)

You should also check out the official
[swift blog](https://developer.apple.com/swift/blog/), and some of the other
[resources](https://developer.apple.com/swift/resources/) made available by
Apple.

Since there is so much good info out there about how to use Swift, this chapter is
not going to attempt to cover any of that. Instead, it's going to run through
some of the important gotchas and potential pain points when using Swift for
the first time - especially when relating to the system frameworks.

There is an Xcode 6 playground which accompanies this chapter - including short
samples for each of the sections. You can get hold of it at
[github.com/ShinobiControls/iOS8-day-by-day](https://github.com/ShinobiControls/iOS8-day-by-day).


## Initialization

Swift formalizes the concepts surround initialization of objects somewhat -
including designated -vs- convenience initializers, and sets a very specific
order of the operations to be called within the initialization phases of an<commit_msg>Attempting to fix images<commit_after># Day 1 :: Swift for Blaggers

{float=left}
![](images/01/thumbnail.png)

It won't have gone unnoticed that at WWDC this year, in addition to announcing
iOS8, they also introduced a new programming language in the form of Swift. This
is quite a different language from objective-C in that it is strongly-typed and
includes some features common to more modern languages.

{width=20%,float=right}
![](images/01/swift_logo.png)

In the interests of embracing anything and everything that's new and shiny, this
book will exclusively use Swift. There is a wealth of information out
there about how to learn Swift, and how to interact with the Cocoa libraries -
in fact you can't go wrong with starting out by reading through the official
books:

- [The Swift Programming Language](https://itunes.apple.com/us/book/the-swift-programming-language/id881256329)
- [Using Swift with Cocoa and Objective-C](https://itunes.apple.com/us/book/using-swift-cocoa-objective/id888894773)

You should also check out the official
[swift blog](https://developer.apple.com/swift/blog/), and some of the other
[resources](https://developer.apple.com/swift/resources/) made available by
Apple.

Since there is so much good info out there about how to use Swift, this chapter is
not going to attempt to cover any of that. Instead, it's going to run through
some of the important gotchas and potential pain points when using Swift for
the first time - especially when relating to the system frameworks.

There is an Xcode 6 playground which accompanies this chapter - including short
samples for each of the sections. You can get hold of it at
[github.com/ShinobiControls/iOS8-day-by-day](https://github.com/ShinobiControls/iOS8-day-by-day).


## Initialization

Swift formalizes the concepts surround initialization of objects somewhat -
including designated -vs- convenience initializers, and sets a very specific
order of the operations to be called within the initialization phases of an
{'fraction_non_alphanumeric': 0.06954556866683405, 'fraction_numerical': 0.014059753954305799, 'mean_word_length': 4.691428571428571, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7221150', 'n_tokens_mistral': 1137, 'n_tokens_neox': 1020, 'n_words': 514}