Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

Swift enum With Switch Statement

enum PizzaSize {
  case small, medium, large
}

var size = PizzaSize.medium

switch(size) {
  case .small:
    print("I ordered a small size pizza.")

  case .medium:
    print("I ordered a medium size pizza.")

   case .large:
     print("I ordered a large size pizza.");
}
Comment

PREVIOUS NEXT
Code Example
Swift :: var i = 2 repeat { i *= i * 2 } while i < 100 print(i) 
Swift :: Swift Assigning and accessing a value from an optional 
Swift :: int in swift 
Swift :: swift - salesforce chat only 
Swift :: Swift guard Statement Inside a Function 
Swift :: data source in swift 
Swift :: Swift Boolean Literals 
Swift :: swift hmac256 
Swift :: how to print body moya swift 
Swift :: customize change color size MDCActivityIndicator swift 
Swift :: Create a Set in Swift 
Swift :: Swift Create static type Singleton Object 
Swift :: xib image shown on simulator but not on device 
Swift :: ns transport swift code 
Swift :: Swift Labeled Statement with continue 
Swift :: AMAZONCONNECT 
Swift :: Swift Add Elements to a Dictionary 
Swift :: load plist swift 
Swift :: UITableViewRowAction access button 
Ruby :: rails send test email 
Ruby :: ruby reorder keys in hash 
Ruby :: ruby get line from a file 
Ruby :: shopify cart show total save 
Ruby :: ruby catch all exceptions 
Ruby :: rails validate presence 
Ruby :: how to write CSV file in rails 
Ruby :: ruby array unshift 
Ruby :: rails logger stdout 
Ruby :: remove ascii characters from string ruby 
Ruby :: rails always 2 decimal 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =