is only available in iOS x or newer 🍎 iOS

Swift: 'X' is only available in iOS 16.0 or newer

You used an API that requires a newer iOS than your deployment target.

Seen on: iOS

Meaning

Either raise the deployment target, or guard the call with if #available / @available and provide a fallback.

Common causes

  • Deployment target lower than the API’s availability
  • Copying sample code written for a newer iOS
  • SwiftUI modifiers introduced in newer releases

⚡ Quick fix

  1. Wrap with if #available(iOS 16, *) { … } else { … }
  2. Raise IPHONEOS_DEPLOYMENT_TARGET if you can drop older iOS
  3. Mark the containing function @available

Detailed fix by platform

Swift

  1. swift
    if #available(iOS 16.0, *) {
        NavigationStack { content }
    } else {
        NavigationView { content }
    }

How to diagnose

  1. Target — Deployment target
  2. API — Availability in docs

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.