Unit 1: Introduction to iPhone and iOS Platform with Swift - Subjective Questions

INT372 — Iphone Application Programming • Practice Questions with Detailed Answers

20 questions

1

Distinguish between iOS and macOS with respect to their purpose, user interface, hardware support, and application development.

2

Explain the major features of the iOS platform and describe the tools commonly used to develop an iPhone application.

3

Define object-oriented programming and explain its main principles with reference to Swift.

4

Describe how a class is declared and instantiated in Swift. Include properties, an initializer, and an instance method in your explanation.

5

Explain inheritance, method overriding, and reference semantics in Swift classes with a suitable example.

6

Differentiate between variables declared using var and constants declared using let in Swift. Also explain type inference and type annotation.

7

Explain optionals and optional binding in Swift. Why are optionals important in iPhone application development?

8

Describe the creation, access, modification, traversal, and common operations of an array in Swift.

9

Compare arrays and dictionaries in Swift. State suitable situations for using each collection.

10

Define a method in Swift and distinguish among instance methods, type methods, mutating methods, and method parameters.

11

What is meant by sending a message to an object? Explain how this idea relates to method calls and dynamic dispatch in Swift.

12

Define a closure in Swift and explain its syntax, parameters, return values, and type inference with an example.

13

Explain trailing closures, value capture, and escaping closures in Swift. Discuss one memory-management risk associated with closures.

14

Describe how to declare, access, update, remove, and iterate over entries in a Swift dictionary.

15

Define a structure in Swift and compare structures with classes in terms of semantics, inheritance, initialization, and usage.

16

Explain value semantics using a Swift structure and contrast the result with assigning a class instance.

17

Define an enumeration in Swift. Explain raw values, associated values, methods, and pattern matching.

18

Compare structs and enums in Swift and explain when an enum is preferable to a struct.

19

Explain the purpose and syntax of the guard statement in Swift. Compare guard with if for validating conditions.

20

Design and explain a Swift model that combines a class or struct, enum, array, dictionary, closure, method, and guard statement for a simple iPhone course-registration feature.