Tag

Questions tagged “Swift

Start from this tag, then add more in the filter bar to narrow further. The URL keeps your choices so you can bookmark or share the same view.

Tags

Select any combination. A question must include every tag you pick (AND).

Swift
Tag: Swift

What collection types are available in Swift, and when would you use each one?

Explain Swift's protocol-driven collection model, then compare Array, Set, Dictionary, and Range by behavior, complexity, hashing, ordering, copy-on-write, and thread-safety tradeoffs

Which design patterns have you used in iOS, and what tradeoffs did they have?

Group design patterns into creational, structural, and behavioral, then explain real iOS examples from SDKs and your own implementation experience with the tradeoffs that matter in production

What is the difference between let and var in Swift?

Explain that `let` creates an immutable binding while `var` creates a mutable one, then separate how that rule behaves for value types versus reference types

What is the difference between print and debugPrint in Swift?

Explain that `print` prefers a user-facing string while `debugPrint` prefers a debug representation, then show when their output is identical and when it diverges

How does struct memory layout work in Swift?

Explain `MemoryLayout`, padding, alignment, and stride; show why stored-property order changes a struct's footprint; and connect it to arrays, performance, and low-level interop