Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

Swift Switch Statement with Range

let ageGroup = 33

switch ageGroup {
  case 0...16:
    print("Child")

  case 17...30:
    print("Young Adults")

  case 31...45:
    print("Middle-aged Adults")

  default:
    print("Old-aged Adults")
}
Comment

PREVIOUS NEXT
Code Example
Swift :: swift array map to another array 
Swift :: swiftui foreach enum not all cases 
Swift :: initialize array with zero in swift 
Swift :: swift fit label to text 
Swift :: how to show notification icon on tabbar item swift 
Swift :: Swift Bitwise AND Operator 
Swift :: swift extension Array where element 
Swift :: swift replace newlines with space 
Swift :: view will appear 
Swift :: How to remove the last item from an array in swift 
Swift :: abstract class in swift 
Swift :: variable sum in swift 
Swift :: clothes that you wear in Diwali 
Swift :: send receive udp swift 
Swift :: xcode how to get aspect ratio of device 
Swift :: Logical Operators Swift 
Swift :: uitableview total number of rows 
Swift :: Swift break statement with nested loops 
Swift :: swift multiline comment 
Swift :: continue keyword in swift language 
Swift :: Swift Find Number of Dictionary Elements 
Swift :: swift uibutton text resets to default 
Swift :: Swift Hashable Protocol 
Swift :: swift collectionview ispagingenabled change page size 
Swift :: Swift Nil-coalescing operator 
Ruby :: rails include route helpers in console 
Ruby :: rails activestorage get image url 
Ruby :: rails g resource 
Ruby :: ruby loop through array from last item backwards 
Ruby :: ruby symbolize_keys 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =