Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin committed Dec 21, 2018
1 parent 46b5e34 commit 2edcbdd
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 15 deletions.
5 changes: 0 additions & 5 deletions swift_14_generics.playground/Contents.swift
Expand Up @@ -87,8 +87,3 @@ swapTwoValues( &myString1, &myString2 )

print("After call swapTwoFloats: myString1 is now \(myString1), and myString2 is now \(myString2)")






2 changes: 1 addition & 1 deletion swift_15_optionals.playground/Contents.swift
Expand Up @@ -83,7 +83,7 @@ print("The player's health is \(player1.health) points.")
// the ? allows you to use that property but only in the case where it
// is not nil.

print("The player's current weapon is \(player1.weapon?.name).")
print("The player's current weapon is \(player1.weapon?.name as String?).")

//------------------------------------------------------------------------------

Expand Down
6 changes: 3 additions & 3 deletions swift_6_looping.playground/Contents.swift
Expand Up @@ -44,12 +44,12 @@ for (name, score) in playerScores {

//------------------------------------------------------------------------------

// String provides a characters property that exposes a character collection
// view which can be used to feed data to a For-In loop.
// If a String is passed to a For-In loop, it will be treated as a character
// collection which can be iterated through character by character.

var myString = "LOL"

for character in myString.characters {
for character in myString {
print(character)
}

Expand Down
1 change: 0 additions & 1 deletion swift_8_functions_advanced.playground/Contents.swift
Expand Up @@ -116,4 +116,3 @@ func processNumbers(_ number1: Int, _ number2: Int) -> Int {
let result = processNumbers(1, 2)

print(result)

7 changes: 2 additions & 5 deletions swift_9_enumerations.playground/Contents.swift
Expand Up @@ -86,14 +86,14 @@ print(team1.rawValue)

var team2 = Team(rawValue: "Bravo")

print("\(team2)")
print("\(team2 as Team?)")


// If the raw value that was passed in can not be turned into an enumeration
// the initializer will return nil.
var team3 = Team(rawValue: "X-Ray")

print("\(team3)")
print("\(team3 as Team?)")


//------------------------------------------------------------------------------
Expand Down Expand Up @@ -190,6 +190,3 @@ var armor = ArmorTypes()

print("Default armor type is: \(armor)")




0 comments on commit 2edcbdd

Please sign in to comment.