Swift - Snippets: Unterschied zwischen den Versionen

Aus Wikizone
Wechseln zu: Navigation, Suche
Zeile 3: Zeile 3:
 
  https://www.swift.org/
 
  https://www.swift.org/
 
== Random ==
 
== Random ==
 
+
let score = Int.random(in: 1...10)
 +
let rating = Int.random(in: 1..<10)
 +
let floatNumber = Float.random(in: 1...10)
 +
let bool = Bool.random(in: 1...10)
  
 
== Time ==
 
== Time ==

Version vom 28. Dezember 2022, 08:00 Uhr

Links

Swift (Programmiersprache)
https://www.swift.org/

Random

let score = Int.random(in: 1...10)
let rating = Int.random(in: 1..<10)
let floatNumber = Float.random(in: 1...10)
let bool = Bool.random(in: 1...10)

Time

Swift - delay code execution

Gestures and Motions

Swift - Shake Motion