Movatterモバイル変換


[0]ホーム

URL:


Dev guideRecipesAPI ReferenceChangelog
Dev guideAPI ReferenceRecipesChangelogUser GuideGitHubDev CommunityOptimizely AcademySubmit a ticketLog InFeature Experimentation
Dev guide
All
Pages
Start typing to search…

Install the Swift SDK

The steps necessary to install the Optimizely Feature Experimentation Swift SDK into your application.

The Optimizely Feature Experimentation Swift SDK is written completely in Swift and uses its native types and patterns. It is available for distribution through CocoaPods, Carthage, or Swift Package Manager (SPM).

You can use this SDK with apps written in Swift and Objective-C.

Requirements

  • Swift client applications must use Swift 5 or higher.
  • Minimum OS version supported is iOS 10.0, tvOS 10.0 and watchOS 3.0.

CocoaPods

  1. Add this line to the Podfile:
pod 'OptimizelySwiftSDK','~> 4.0.0-beta'
  1. Run the command:
pod install

For more installation information, see theCocoaPods Getting Started Guide.

Carthage

  1. Add this line to theCartfile:
github "optimizely/swift-sdk" ~> "4.0.0-beta"
  1. Run the command:
carthage update
  1. Link the frameworks to your project. Go to your project target'sLink Binary With Libraries and drag over these frameworks from the Carthage/Build/<platform> folder:
Optimizely.framework
  1. To ensure that proper bitcode-related files and dSYMs are copied when archiving your app, you must install a Carthage build script:a. Add a newRun Script phase in your target'sBuild Phase.b. Include this line in the script area:/usr/local/bin/carthage copy-frameworksc. Add the frameworks to theInput Files list:$(SRCROOT)/Carthage/Build/<platform>/Optimizely.frameworkd. Add the paths to the copied frameworks to the Output Files list:$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Optimizely.framework

For more installation information, see theCarthage GitHub repository.

Swift Package Manager (SPM)

Add the following line to the dependencies value of your Package.swift:

dependencies: [    .package(url: "https://github.com/optimizely/swift-sdk.git", .upToNextMinor(from: “4.0.0-beta”))]

If you have a name conflict with other swift packages when you add the Optimizely Feature Experimentation swift-sdk dependency to Xcode, you can also try with its aliased repo:https://github.com/optimizely/optimizely-swift-sdk.git.

📘

Note

  • All public types start with theOptimizely prefix for clarity.
  • This release includes a wrapper for all public APIs to support Objective-C client applications. See thedemo Swift app on GitHub.

Updated 17 days ago



[8]ページ先頭

©2009-2025 Movatter.jp