Browse Questions
  • Polymorphism lets code work with values of different underlying types through a single shared interface.
  • Secure Comparator is a zero-knowledge protocol that lets two parties confirm they hold the same secret without either side transmitting it, or leaking anything usable when the secrets differ.
  • Build configurations control compiler optimisations and flags.
  • Use Secure Message when two parties with separate key pairs exchange data, and Secure Cell when a single party encrypts data for itself.

Answer: Build configurations control compiler optimisations and flags. Debug is for development; Release is what ships to users.

DebugRelease
OptimisationNone (-Onone)Full (-O)
Debug symbols✅ Included❌ Stripped
AssertionsActiveDisabled
#if DEBUGtruefalse
Build speedFastSlow
Runtime speedSlowFast

Code Example:

// Code only runs in Debug builds
#if DEBUG
func printDebugInfo() {
    print("User: \(currentUser)")
    print("API: \(apiBaseURL)")
}
#endif

// Assertion — removed in Release builds, no performance impact in production
assert(!items.isEmpty, "Items should never be empty here")

// Fatal error — always present (use for programmer errors)
guard let url = URL(string: urlString) else {
    fatalError("Invalid hardcoded URL — developer error")
}