swift switch
var x = 1
switch x {
case 0: // if x = 0
print("x = 0")
case 1: // if x = 1
print("x = 1")
default: // if x is not 0 nor 1
print("no x value")
}for i in 1 ... 100 {
switch (i % 3, i % 5) {
case (0, 0):
print("FizzBuzz")
case (0, _):
print("Fizz")
case (_, 0):
print("Buzz")
default:
print(i)
}
}
Also in Swift:
- how to change background color of stackview swift
- Expression of type 'UIViewController?' is unused warning when pop view controller in swift 3.0
- how to show notification icon on tabbar item swift
- swift uitableview cell spacing
- xcode cannot find uiimagepickercontrolleroriginalimage in scope
- swift sort array
- switch statements swift
- remove child from firebase swift
- uilabel font size swift
- swift uitableview insert cell
- swift uitextfield only numbers keyboard lock programmatically
- swift thread.sleep
- show alert swiftui
- limit log file size swift
- how to swift pie chart quartzcore framework
- swift wait 5 seconds
- swift corner radious of view controller
- Get the length of a String swift
- swift how to add a completion block to a function
- Core Data Quickest way to delete all instances of an entity swift
- time formats swift
- swift list
- swift out of bound elelemnt
- swift set uicolor