Mention what are the type of integers does Swift have?
Answer / iosraj
Swift provides unsigned and signed integers in 8, 16, 32 and 64 bit forms. Similar to C these integers follow a naming convention. For instance, unsigned integer is denoted by type UInt8 while 32 bit signed integer will be denoted by type Int32.
| Is This Answer Correct ? | 0 Yes | 0 No |
struct Planet { var name: String var distanceFromSun: Double } let planets = [ Planet(name: "Mercury", distanceFromSun: 0.387), Planet(name: "Venus", distanceFromSun: 0.722), Planet(name: "Earth", distanceFromSun: 1.0), Planet(name: "Mars", distanceFromSun: 1.52), Planet(name: "Jupiter", distanceFromSun: 5.20), Planet(name: "Saturn", distanceFromSun: 9.58), Planet(name: "Uranus", distanceFromSun: 19.2), Planet(name: "Neptune", distanceFromSun: 30.1) ] let result1 = planets.map { $0.name } let result2 = planets.reduce(0) { $0 + $1.distanceFromSun } What are the types and values of the result1 and result2 variables? Explain why.
In swift, what type of object are basic data types?
What is difference between xcode and swift?
Is singleton thread safe swift?
Is c++ similar to swift?
What is type aliasing in swift?
What is race condition in swift?
Is swift coding easy?
What is the purpose of swift?
What is string in swift?
Explain what Lazy stored properties is and when it is useful?
Which compiler is used in swift?