Every Seller has a Bestseller, check out all bestsellers worldwide

Prebuilt iOS Views

We’re excited to introduce prebuilt UI views that make it incredibly easy to add authentication flows to your iOS applications.

These new SwiftUI views provide complete authentication experiences out of the box, eliminating the need to build custom sign-in and user management interfaces from scratch. With just a few lines of code, you can now add authentication and user management to your iOS app that matches iOS design standards and includes advanced features like multi-factor authentication, social sign-in, and comprehensive user profile management.

The AuthView provides a comprehensive authentication experience supporting both sign-in and sign-up flows, multi-factor authentication, password reset, account recovery and more.

HomeView.swift
import SwiftUI
import Clerk

struct HomeView: View {
  @Environment(\.clerk) private var clerk
  @State private var authIsPresented = false

  var body: some View {
    ZStack {
      if clerk.user != nil {
          UserButton()
            .frame(width: 36, height: 36)
      } else {
        Button("Sign in") {
          authIsPresented = true
        }
      }
    }
    .sheet(isPresented: $authIsPresented) {
      AuthView()
    }
  }
}

The UserButton displays the current user’s profile image in a circular button and opens the full user profile when tapped.

The UserButton is a circular button that displays the signed-in user's profile image.

HomeView.swift
.toolbar {
  ToolbarItem(placement: .navigationBarTrailing) {
    if clerk.user != nil {
      UserButton()
        .frame(width: 36, height: 36)
    }
  }
}

The UserProfileView provides a complete interface for users to manage their accounts, including personal information, security settings, account switching, and sign-out functionality.

The UserProfileView renders a comprehensive user profile interface that displays user information and provides account management options.

ProfileView.swift
import SwiftUI
import Clerk

struct ProfileView: View {
  @Environment(\.clerk) private var clerk

  var body: some View {
    if clerk.user != nil {
      UserProfileView(isDismissable: false)
    }
  }
}

The new theming system allows you to customize the appearance of all Clerk views to match your app’s design.

App.swift
import SwiftUI
import Clerk

@main
struct MyApp: App {
  var body: some Scene {
    WindowGroup {
      ContentView()
        .environment(\.clerkTheme, customTheme)
    }
  }
}

let customTheme = ClerkTheme(
  colors: .init(
    primary: Color(.brandPrimary)
  ),
  fonts: .init(
    fontFamily: "Avenir"
  ),
  design: .init(
    borderRadius: 12
  )
)

Light and Dark Mode Support

All Clerk iOS views automatically support both light and dark mode appearance, adapting seamlessly to the user’s system preferences.

To get started follow the Quickstart Guide and see the views docs:

Note: Prebuilt iOS views are available on iOS platforms only (iOS, iPadOS, macCatalyst).

We’re excited to see what you build with these new views! Share your feedback and join the conversation in our Discord community.

Trending Products

- 24% Apple iPhone 12 Mini – Parent...
Original price was: $248.90.Current price is: $190.00.

Apple iPhone 12 Mini – Parent...

0
Add to compare
- 24% Apple iPhone SE 2nd Gen – Par...
Original price was: $166.87.Current price is: $126.42.

Apple iPhone SE 2nd Gen – Par...

0
Add to compare
- 29% Apple iPhone 7 32GB Unlocked AT&amp...
Original price was: $135.35.Current price is: $95.99.

Apple iPhone 7 32GB Unlocked AT&...

0
Add to compare
- 39% Apple iPhone 14 – Parent (Ren...
Original price was: $705.15.Current price is: $429.97.

Apple iPhone 14 – Parent (Ren...

0
Add to compare
- 29% Apple iPhone 12 Pro Max, PARENT (Re...
Original price was: $525.00.Current price is: $375.00.

Apple iPhone 12 Pro Max, PARENT (Re...

0
Add to compare
- 41% Apple iPhone 8 64GB Unlocked &#8211...
Original price was: $234.60.Current price is: $138.00.

Apple iPhone 8 64GB Unlocked –...

0
Add to compare
- 31% Apple iPhone 15 Plus 5G (512GB, 6GB...
Original price was: $706.15.Current price is: $487.00.

Apple iPhone 15 Plus 5G (512GB, 6GB...

0
Add to compare
- 34% Apple iPhone 14 Pro (Renewed)
Original price was: $785.18.Current price is: $519.99.

Apple iPhone 14 Pro (Renewed)

0
Add to compare
- 26% Apple iPhone 15 Pro Max – Par...
Original price was: $1,127.24.Current price is: $834.99.

Apple iPhone 15 Pro Max – Par...

0
Add to compare
- 24% Apple iPhone 11 Pro, US Version, 25...
Original price was: $357.56.Current price is: $272.95.

Apple iPhone 11 Pro, US Version, 25...

0
Add to compare
.

We will be happy to hear your thoughts

Leave a reply

BestSellersMarkets
Logo
Register New Account
Compare items
  • Total (0)
Compare
0
Shopping cart