Skip to Content

CaptchaFox for iOS

You can protect your native iOS apps (UIKit and SwiftUI) using the official iOS library . It requires iOS 15 or later and Xcode 16 or later.

Setup

  1. In the CaptchaFox portal, create a new site configuration using the iOS integration
  2. In Xcode, choose File > Add Package Dependencies…, enter https://github.com/CaptchaFox/captchafox-ios and add the CaptchaFox library to your app target
  3. Follow the usage instructions in the readme 
  4. Enter the sitekey and domain from your site configuration
  5. Show the Captcha on your application screen and verify the resolved token in your backend

Example

import CaptchaFox import SwiftUI struct SignUpView: View { @State private var showsCaptcha = false private let configuration = CaptchaFoxConfiguration( siteKey: "YOUR_SITEKEY", baseURL: URL(string: "https://YOUR_DOMAIN")! ) var body: some View { Button("Sign up") { showsCaptcha = true } .captchaFoxModal(isPresented: $showsCaptcha, configuration: configuration, onVerify: { token in // Send the token to your backend. }) } }
Last updated on