Skip to content

Commit 3258ddc

Browse files
committed
Updated all code for Xcode Version 6.3 Beta 1 (6D520o)
1 parent eed098f commit 3258ddc

File tree

93 files changed

+398
-414
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+398
-414
lines changed

chapter-addressBook/Retrieving Properties of Address Book Entries/Retrieving Properties of Address Book Entries/AppDelegate.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@
7777
// for person: ABRecordRef in allPeople{
7878
//
7979
// let firstName = ABRecordCopyValue(person,
80-
// kABPersonFirstNameProperty).takeRetainedValue() as String
80+
// kABPersonFirstNameProperty).takeRetainedValue() as! String
8181
//
8282
// let lastName = ABRecordCopyValue(person,
83-
// kABPersonLastNameProperty).takeRetainedValue() as String
83+
// kABPersonLastNameProperty).takeRetainedValue() as! String
8484
//
8585
// let email: ABMultiValueRef = ABRecordCopyValue(person,
8686
// kABPersonEmailProperty).takeRetainedValue()
@@ -151,7 +151,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
151151
for counter in 0..<ABMultiValueGetCount(emails){
152152

153153
let email = ABMultiValueCopyValueAtIndex(emails,
154-
counter).takeRetainedValue() as String
154+
counter).takeRetainedValue() as! String
155155

156156
println(email)
157157

@@ -168,9 +168,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
168168
for person: ABRecordRef in allPeople{
169169

170170
let firstName = ABRecordCopyValue(person,
171-
kABPersonFirstNameProperty).takeRetainedValue() as String
171+
kABPersonFirstNameProperty).takeRetainedValue() as! String
172172
let lastName = ABRecordCopyValue(person,
173-
kABPersonLastNameProperty).takeRetainedValue() as String
173+
kABPersonLastNameProperty).takeRetainedValue() as! String
174174

175175
println("First name = \(firstName)")
176176
println("Last name = \(lastName)")

chapter-addressBook/Retrieving a Person Entity with System UI/Retrieving a Person Entity with System UI/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
//
6464
// for index in 0..<countOfPhones{
6565
// let phone = ABMultiValueCopyValueAtIndex(phones,
66-
// index).takeRetainedValue() as String
66+
// index).takeRetainedValue() as! String
6767
//
6868
// println(phone)
6969
//

chapter-addressBook/Retrieving a Property of a Person Entity with System UI/Retrieving a Property of a Person Entity with System UI/ViewController.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ ABPeoplePickerNavigationControllerDelegate {
5959
let index = Int(identifier) as CFIndex
6060

6161
let address: NSDictionary = ABMultiValueCopyValueAtIndex(addresses,
62-
index).takeRetainedValue() as NSDictionary
62+
index).takeRetainedValue() as! NSDictionary
6363

64-
let country = address[kABPersonAddressCountryKey as String] as String
65-
let city = address[kABPersonAddressCityKey as String] as String
66-
let street = address[kABPersonAddressStreetKey as String] as String
64+
let country = address[kABPersonAddressCountryKey as String] as! String
65+
let city = address[kABPersonAddressCityKey as String] as! String
66+
let street = address[kABPersonAddressStreetKey as String] as! String
6767

6868
println("Country = \(country)")
6969
println("City = \(city)")

chapter-addressBook/Retrieving and Setting a Person's Address Book Image/Retrieving and Setting a Person's Address Book Image/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
3737

3838
func imageForPerson(person: ABRecordRef) -> UIImage?{
3939

40-
let data = ABPersonCopyImageData(person).takeRetainedValue() as NSData
40+
let data = ABPersonCopyImageData(person).takeRetainedValue() as! NSData
4141

4242
let image = UIImage(data: data)
4343
return image

chapter-addressBook/Searching the Address Book/Searching the Address Book/AppDelegate.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
4646
for person: ABRecordRef in people{
4747

4848
let firstName = ABRecordCopyValue(person,
49-
kABPersonFirstNameProperty).takeRetainedValue() as String
49+
kABPersonFirstNameProperty).takeRetainedValue() as! String
5050

5151
let lastName = ABRecordCopyValue(person,
52-
kABPersonLastNameProperty).takeRetainedValue() as String
52+
kABPersonLastNameProperty).takeRetainedValue() as! String
5353

5454
if firstName == paramFirstName &&
5555
lastName == paramLastName{
@@ -69,7 +69,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
6969
for group: ABRecordRef in groups{
7070

7171
let groupName = ABRecordCopyValue(group,
72-
kABGroupNameProperty).takeRetainedValue() as String
72+
kABGroupNameProperty).takeRetainedValue() as! String
7373

7474
if groupName == name{
7575
return true

chapter-basics/Accepting User Text Input with UITextField/Accepting User Text Input with UITextField/ViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@
8686
// func calculateAndDisplayTextFieldLengthWithText(text: String){
8787
//
8888
// var characterOrCharacters = "Character"
89-
// if countElements(text) != 1{
89+
// if count(text) != 1{
9090
// characterOrCharacters += "s"
9191
// }
9292
//
93-
// let stringLength = countElements(text)
93+
// let stringLength = count(text)
9494
//
9595
// label.text = "\(stringLength) \(characterOrCharacters)"
9696
//

chapter-basics/Creating Scrollable Content with UIScrollView/Creating Scrollable Content with UIScrollView/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class ViewController: UIViewController, UIScrollViewDelegate {
7070
scrollView.alpha = 1
7171
}
7272

73-
func scrollViewDidEndDragging(scrollView: UIScrollView!,
73+
func scrollViewDidEndDragging(scrollView: UIScrollView,
7474
willDecelerate decelerate: Bool){
7575
scrollView.alpha = 1
7676
}

chapter-basics/Displaying Alerts and Action Sheets/Displaying Alerts and Action Sheets/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class ViewController: UIViewController {
8080
handler: {[weak self] (paramAction:UIAlertAction!) in
8181

8282
if let textFields = self!.controller?.textFields{
83-
let theTextFields = textFields as [UITextField]
83+
let theTextFields = textFields as! [UITextField]
8484
let userName = theTextFields[0].text
8585
println("Your username is \(userName)")
8686
}

chapter-basics/Displaying Long Lines of Text with UITextView/Displaying Long Lines of Text with UITextView/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class ViewController: UIViewController {
6969

7070
/* Get the frame of the keyboard */
7171
let keyboardRectAsObject =
72-
notification.userInfo![UIKeyboardFrameEndUserInfoKey] as NSValue
72+
notification.userInfo![UIKeyboardFrameEndUserInfoKey] as! NSValue
7373

7474
/* Place it in a CGRect */
7575
var keyboardRect = CGRectZero

chapter-basics/Displaying Static Text with UILabel/Displaying Static Text with UILabel/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class ViewController: UIViewController {
113113

114114
let string = "iOS SDK" as NSString
115115

116-
let result = NSMutableAttributedString(string: string)
116+
let result = NSMutableAttributedString(string: String(string))
117117

118118
let attributesForFirstWord = [
119119
NSFontAttributeName : UIFont.boldSystemFontOfSize(60),

0 commit comments

Comments
 (0)