Open the required project, go to the dependency settings: “Project -> Package dependency”
1.1 Click the “+” (Add package dependency) button.
You will see the “Apple swift packages” window.
Paste the link https://github.com/onboarding-online/swift-onboarding-sdk in the “Search or Enter Package URL” field.
Xcode will show the settings for adding SDK. Make sure the settings look like this “Dependency rule -> branch : main” and click the “Add package” button.
You will see the library verification window. Wait till the verification ends and click “Add package.”
The package integration has been completed. Only a few code lines remain to be added to your project!
If you use Interface -> Storyboard (Point 6) for the project initializing:
12.1. Open the AppDelegate file (or wherever you want to add an onboarding launcher: ScreenService).
12.2 Add to the file header the following:
import OnboardingiOSSDK
12.3 Find the function:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {}
12.4 Add the piece of code to it:
OnboardingService.shared.startOnboarding(projectId: "",localJSONFileName: "",
useLocalJSONAfterTimeout: 1.0) { onboardingResults in
print(onboardingResults)
}
If you have already obtained an onboarding.online service project, download the json file of your onboarding Onboarding.online-> project -> onboarding -> json
Drag the file into your Xcode project. After that, a settings window for adding a file will appear.
Select "Copy if needed," "Create groups" and click "Finish."
Add the file name to the onboarding launch function:
16.1 Open the "AppDelegate" file (or wherever you want to add an onboarding launcher: ScreenService);
16.2 Add the name of the json file you have downloaded.
OnboardingService.shared.startOnboarding(projectId: "",localJSONFileName: "onboarding-v#1-23",
useLocalJSONAfterTimeout: 1.0) { data in
}
Click the run button, wait for the simulator to launch, and enjoy your first onboarding!
В
Автор: Валерия Зимницкая
Обновлено больше недели назад