1 Import Foundation2 3 for varI=1; i<=Ten; i++ {4 println (i)5 }6 7Let str1="ADL;FJASDFL;OUEWROUQWPERUADF"8 forCinchstr1 {9 SwitchC {Ten Case "a","F","o": One println (c) A - default: - vart="" the - } - } - varx= + + Switchx { - Case 1...9 : +println"Digit number") A Case Ten... About: atprintln"10-digit number") - Case -...999: -println"number of hundred") - Case +...9999: -println"thousand number") - default: in vart="" - } to + varPoint = (Ten,Ten) - Switchpoint{ the Case(0,0): *println"0,0") $ Case(1...Ten,1...Ten):Panax Notoginsengprintln"x:\ (point.0)-y:\ (Point.1)") - Case(_,Ten): theprintln"xxxxx") + default: A vart="" the } + //Value Binding - Switchpoint{ $ Case(Let X,Ten): $ println (x) - CaseLet (x, y): -println"two values are bound") the CaseLet (x, y)wherex = =y: -println"determine if the values are equal before binding")Wuyi default: the vart="" -}
Beginner Swift Note flow control (v)