Skip to content

Commit

Permalink
Updated to support XCode 6.0 GM.
Browse files Browse the repository at this point in the history
This includes the latest updates to the language specification but also alters the project settings for the playgrounds to target 'iossimulator' rather than 'macosx'. This was necessary as the release of XCode 6.0 GM broke playgrounds that targeted OSX.

This new configuration does work on both of the current versions of XCode (6.0 GM and 6.1 Beta 2)
  • Loading branch information
nettlep committed Sep 16, 2014
1 parent af42c38 commit a34e157
Show file tree
Hide file tree
Showing 47 changed files with 85 additions and 135 deletions.
4 changes: 2 additions & 2 deletions 10. Properties.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
4 changes: 2 additions & 2 deletions 11. Methods.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
4 changes: 2 additions & 2 deletions 12. Subscripts.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
4 changes: 2 additions & 2 deletions 13. Inheritance.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
4 changes: 2 additions & 2 deletions 14a. Initialization.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
4 changes: 2 additions & 2 deletions 14b. Initializer Chaining.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
4 changes: 2 additions & 2 deletions 15. Deinitialization.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
4 changes: 2 additions & 2 deletions 16. ARC.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
4 changes: 2 additions & 2 deletions 17. Optional Chaining.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
4 changes: 2 additions & 2 deletions 18. Type Casting.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
4 changes: 2 additions & 2 deletions 19. Nested Types.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
6 changes: 3 additions & 3 deletions 19. Nested Types.playground/section-1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct BlackjackCard
case .Jack, .Queen, .King:
return Values(first: 10, second: nil)
default:
return Values(first: self.toRaw(), second: nil)
return Values(first: self.rawValue, second: nil)
}
}
}
Expand All @@ -65,7 +65,7 @@ struct BlackjackCard

var description: String
{
var output = "A \(suit.toRaw()) with a value of \(rank.values.first)"
var output = "A \(suit.rawValue) with a value of \(rank.values.first)"
if let second = rank.values.second
{
output += " or \(second)"
Expand All @@ -84,4 +84,4 @@ let theAceOfSpades = BlackjackCard(rank: .Ace, suit: .Spades)
theAceOfSpades.description

// To access the nested type, we can drill down into the type using type names:
let heartsSymbol = String( BlackjackCard.Suit.Hearts.toRaw() )
let heartsSymbol = String( BlackjackCard.Suit.Hearts.rawValue )
2 changes: 1 addition & 1 deletion 19. Nested Types.playground/timeline.xctimeline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
version = "3.0">
<TimelineItems>
<LoggerValueHistoryTimelineItem
documentLocation = "#CharacterRangeLen=0&amp;CharacterRangeLoc=3044&amp;EndingColumnNumber=5&amp;EndingLineNumber=2&amp;StartingColumnNumber=4&amp;StartingLineNumber=2&amp;Timestamp=424626841.358527">
documentLocation = "#CharacterRangeLen=0&amp;CharacterRangeLoc=3047&amp;EndingColumnNumber=5&amp;EndingLineNumber=2&amp;StartingColumnNumber=4&amp;StartingLineNumber=2&amp;Timestamp=432601065.869592">
</LoggerValueHistoryTimelineItem>
</TimelineItems>
</Timeline>
4 changes: 2 additions & 2 deletions 1a. The Basics.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
4 changes: 2 additions & 2 deletions 1b. Type alliases.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
4 changes: 2 additions & 2 deletions 1c. Tuples.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
4 changes: 2 additions & 2 deletions 1d. Optionals.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
2 changes: 1 addition & 1 deletion 1d. Optionals.playground/section-1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ assumedString = nil
// let errorString: String = assumedString

// Like any other optional, we can still check if it holds a value:
if assumedString
if assumedString != nil
{
"We have a value"
}
Expand Down
2 changes: 1 addition & 1 deletion 1d. Optionals.playground/timeline.xctimeline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
version = "3.0">
<TimelineItems>
<LoggerValueHistoryTimelineItem
documentLocation = "#CharacterRangeLen=0&amp;CharacterRangeLoc=6943&amp;EndingColumnNumber=5&amp;EndingLineNumber=2&amp;StartingColumnNumber=4&amp;StartingLineNumber=2&amp;Timestamp=429120028.697866">
documentLocation = "#CharacterRangeLen=0&amp;CharacterRangeLoc=6950&amp;EndingColumnNumber=5&amp;EndingLineNumber=2&amp;StartingColumnNumber=4&amp;StartingLineNumber=2&amp;Timestamp=432600545.276631">
</LoggerValueHistoryTimelineItem>
</TimelineItems>
</Timeline>
4 changes: 2 additions & 2 deletions 1e. Assertions.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
4 changes: 2 additions & 2 deletions 2. Basic operations.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
11 changes: 3 additions & 8 deletions 2. Basic operations.playground/section-1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,10 @@ a + b
// String concatenation uses the + operator:
"hello, " + "world"

// You can add characters, too, which form a string
// To add characters, convert them to a string
let dog: Character = "🐶"
let cow: Character = "🐮" // Why is this an "Enum Value" ?
let dogCow = dog + cow

// You can also add characters to a string
let str = "abc"
let chr: Character = "d"
chr + str + chr
let cow: Character = "🐮"
let dogCow = String(dog) + String(cow)

// Ternary operators work on three targets:
truefalse ? a : b
Expand Down
2 changes: 1 addition & 1 deletion 2. Basic operations.playground/timeline.xctimeline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
version = "3.0">
<TimelineItems>
<LoggerValueHistoryTimelineItem
documentLocation = "#CharacterRangeLen=0&amp;CharacterRangeLoc=3545&amp;EndingColumnNumber=5&amp;EndingLineNumber=2&amp;StartingColumnNumber=4&amp;StartingLineNumber=2&amp;Timestamp=424365404.031085">
documentLocation = "#CharacterRangeLen=0&amp;CharacterRangeLoc=3422&amp;EndingColumnNumber=5&amp;EndingLineNumber=2&amp;StartingColumnNumber=4&amp;StartingLineNumber=2&amp;Timestamp=432600756.313844">
</LoggerValueHistoryTimelineItem>
</TimelineItems>
</Timeline>
4 changes: 2 additions & 2 deletions 20. Extensions.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
12 changes: 0 additions & 12 deletions 20. Extensions.playground/section-1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,3 @@ extension Character
Character("a").kind == .Vowel
Character("h").kind == .Consonant
Character("+").kind == .Other












2 changes: 1 addition & 1 deletion 20. Extensions.playground/timeline.xctimeline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
version = "3.0">
<TimelineItems>
<LoggerValueHistoryTimelineItem
documentLocation = "#CharacterRangeLen=0&amp;CharacterRangeLoc=5377&amp;EndingColumnNumber=5&amp;EndingLineNumber=2&amp;StartingColumnNumber=4&amp;StartingLineNumber=2&amp;Timestamp=429121495.027786">
documentLocation = "#CharacterRangeLen=0&amp;CharacterRangeLoc=5366&amp;EndingColumnNumber=5&amp;EndingLineNumber=2&amp;StartingColumnNumber=4&amp;StartingLineNumber=2&amp;Timestamp=432601082.881947">
</LoggerValueHistoryTimelineItem>
</TimelineItems>
</Timeline>
4 changes: 2 additions & 2 deletions 21. Protocols.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
4 changes: 2 additions & 2 deletions 22. Generics.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
4 changes: 2 additions & 2 deletions 23. Advanced Operators.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
4 changes: 2 additions & 2 deletions 3. Strings and Characters.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
8 changes: 0 additions & 8 deletions 3. Strings and Characters.playground/section-1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,6 @@ countElements(originalString)
// Strings can be concatenated with strings and characters
var helloworld = "hello, " + "world"

// Add a character
var bang: Character = "!"
helloworld + bang

// Concatenate a character onto the end of the string
helloworld += bang
helloworld

// ------------------------------------------------------------------------------------------------
// String interpolation
//
Expand Down
2 changes: 1 addition & 1 deletion 3. Strings and Characters.playground/timeline.xctimeline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
version = "3.0">
<TimelineItems>
<LoggerValueHistoryTimelineItem
documentLocation = "#CharacterRangeLen=0&amp;CharacterRangeLoc=3442&amp;EndingColumnNumber=5&amp;EndingLineNumber=9&amp;StartingColumnNumber=4&amp;StartingLineNumber=9&amp;Timestamp=428206997.492356">
documentLocation = "#CharacterRangeLen=0&amp;CharacterRangeLoc=3293&amp;EndingColumnNumber=5&amp;EndingLineNumber=9&amp;StartingColumnNumber=4&amp;StartingLineNumber=9&amp;Timestamp=432600783.307522">
</LoggerValueHistoryTimelineItem>
</TimelineItems>
</Timeline>
4 changes: 2 additions & 2 deletions 4a. Arrays.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
4 changes: 2 additions & 2 deletions 4b. Dictionaries.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='3.0' sdk='macosx'>
<playground version='3.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
<timeline fileName='timeline.xctimeline'/>
</playground>
</playground>
Loading

0 comments on commit a34e157

Please sign in to comment.