To initialize the Amplify API category, you are required to use the `Amplify.add()` method for the plugin followed by calling `Amplify.configure()`.

<BlockSwitcher>

<Block name="SwiftUI">

Create a custom `AppDelegate` with the following imports and `application:didFinishLaunchingWithOptions` method:

```swift
import Amplify
import AWSAPIPlugin
import UIKit

class AppDelegate: NSObject, UIApplicationDelegate {
    func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {

        do {
            try Amplify.add(plugin: AWSAPIPlugin(modelRegistration: AmplifyModels()))
            try Amplify.configure()
            print("Amplify configured with API plugin")
        } catch {
            print("Failed to initialize Amplify with \(error)")
        }

        return true
    }
}
```

Then in your `App` scene, use the `UIApplicationDelegateAdaptor` property wrapper to use your custom `AppDelegate`:

```swift
@main
struct MyAmplifyApp: App {
    @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate

    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}
```

</Block>

<Block name="UIKit">

Add the following imports to the top of your `AppDelegate.swift` file:

```swift
import Amplify
import AWSAPIPlugin
```

Add the following code to the AppDelegate's `application:didFinishLaunchingWithOptions` method:

```swift
func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {

    do {
        try Amplify.add(plugin: AWSAPIPlugin(modelRegistration: AmplifyModels()))
        try Amplify.configure()
        print("Amplify configured with API plugin")
    } catch {
        print("Failed to initialize Amplify with \(error)")
    }

    return true
}
```

</Block>

</BlockSwitcher>

Upon building and running this application you should see the following in your console window:

```console
Amplify configured with API plugin
```
