Quantcast
Channel: Kodeco | High quality programming tutorials: iOS, Android, Swift, Kotlin, Unity, and more
Viewing all articles
Browse latest Browse all 4400

Video Tutorial: Introduction to Swift Part 9: Enums

$
0
0

Challenge

Your challenge is to make an enum with the three Microsoft CEOs: Bill Gates, Steve Ballmer, and Satya Nadella. Make Satya Nadella the default, and add a description() method. Design your enum so that the following code works:

let currentCEO = MicrosoftCEOs()
println(currentCEO.description())
 
let oFirstCEO = MicrosoftCEOs.fromRaw(1)
if let firstCEO = oFirstCEO {
  println(firstCEO.description())
} else {
  println("No such value")
}

Download demo

Download challenge

Video Tutorial: Introduction to Swift Part 9: Enums is a post from: Ray Wenderlich

The post Video Tutorial: Introduction to Swift Part 9: Enums appeared first on Ray Wenderlich.


Viewing all articles
Browse latest Browse all 4400

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>