Skip to main content

Posts

Showing posts with the label Swift Test Upwork

Swift Test Upwork Answers 2019

1. Which of the following structures has both computed and stored properties? Answers: • struct Rect { var origin = CGPointZero var center: CGPoint { get { // } set { // } } } • struct Rect { var center: CGPoint { get { // } set { // } } } • struct Rect { let origin = CGPointZero } • struct Rect { var origin = CGPointZero var center: CGPointMake(0,0) } 2. Which of these statements declares cityArray as a mutable array? Answers: var cityArray = [«Portland»,»San Francisco»,»Cupertino»] 3. Considering var index = UInt8.max, which of the following operation results to the value of zero for var index? Answers: • index = index &- 1 • index = index &+ 1 • index = index &* 1 • index = index &/ 255 4. All Swift classes must inherit from which root class? Answers: • Swift classes do not require a root class. • NSObject • @ObjC • Root 5. What does a retainCount represent in ARC? Answers: • The current number of strong references to an object. • The cu...