Все коллекции
Onboarding.Online SDK integration
Manual for adding swift-onboarding-sdk to a new project. UI interface - Storyboard. Xcode installation
Manual for adding swift-onboarding-sdk to a new project. UI interface - Storyboard. Xcode installation
В
Автор: Валерия Зимницкая
Обновлено больше недели назад

  1. Download Xcode from the App Store and install it:
    1.1 Open App Store on your PC where MacOS is set.
    1.2 Enter “xcode” into the search bar. Wait for the search results and click "Get" in the "Xcode" card:

  2. Once installed, click on the "Xcode" icon at the bottom of the MacOS panel bar:

  3. Select the operating systems which you would like to create your application for. Please note IOS is required for installing swift-onboarding-sdk.

  4. After completing the settings, you will see the Xcode action selection menu. Select "Create a new Xcode project."

  5. You need to select the “IOS” platform type and the “App” template and click the "Next" button:

  6. The “Choose options for your new project” window will open. You should fill out the following:
    - Product name;
    - Organization identifier.
    Select Interface: StoryBoard.
    Click the "Next" button to proceed.

  7. In the window that opens, select the location where you want to save your project and click "Create."

  8. After the project has been created and opened, go to the project dependency settings: “Project -> Package dependency”

    Click the “+” (Add package dependency) button.

  9. 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.

  10. 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.

  11. 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!

  12. 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)

    }

  13. If you have already obtained an onboarding.online service project, download the json file of your onboarding Onboarding.online-> project -> onboarding -> json

  14. Drag the file into your Xcode project. After that, a settings window for adding a file will appear.

  15. Select "Copy if needed," "Create groups" and click "Finish."

  16. 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

    }

  17. Click the run button, wait for the simulator to launch, and enjoy your first onboarding!

Нашли ответ на свой вопрос?