Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

Bloco de código
titleAppDelegate.swift
collapsetrue
func application(_ application: UIApplication,

                     didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

        self.window = UIWindow(frame: UIScreen.main.bounds)

        let viewcontroller = ViewController()

        self.window?.rootViewController = viewcontroller

        let tips = ["fluig SDK iOS", "second tip", "third tip"]

        let conf = LoginFlowConfiguration(

            backgroundVideoUrl: Bundle.main.url(forResource: "backgroundLogin", withExtension: "mp4"),

            emailRequestPageTips: tips,

            passwordRequestPageTips: tips,

            onSuccessReplaceRootWith: viewcontroller

        )

        LoginFlow(configuration: conf).startAsRoot(window: self.window!)

        self.window?.makeKeyAndVisible()

        return true

    }


É possível personalizar este fluxo instanciando um objeto da classe LoginFlowConfiguration.

Bloco de código
titleLoginFlowConfiguration
collapsetrue
/// - parameters:
    ///     - logoImage: The image to be used as a logo on login screens.
    ///     - backgroundVideoUrl: The url of the video to be used as the background on login screens.
    ///This takes precedence over `backgroundImageUrl`
    ///     - backgroundImage: The image to be userd as background on login screens.
    ///     - gradiendStartColor: The color to be used on login screens background.
    ///     - gradiendEndColor: Composes with `gradientStartColor` to form a gradient to be used on login
    ///screens background.
    ///     - emailRequestPageTips: If informed show a pager with tips to be shown on email request login screen
    ///     passwordRequestPageTips:  If informed show a pager with tips to be shown on password request login screen
    ///     - onSuccessReplaceRootWith: If informed is used to replace the application root ViewController
    ///on successfull login, otherwise a notification is sent via NotificationCenter.
    public init(logoImage: UIImage? = nil,
                backgroundVideoUrl: URL? = nil,
                backgroundImage: UIImage? = nil,
                gradientStartColor: UIColor = UIColor.fluigSdk.pink,
                gradientEndColor: UIColor = UIColor.fluigSdk.lightOrange,
                emailRequestPageTips: [String] = [],
                passwordRequestPageTips: [String] = [],
                onSuccessReplaceRootWith: UIViewController? = nil) {
        self.logoImage = logoImage
        self.backgroundVideoUrl = backgroundVideoUrl
        self.backgroundImage = backgroundImage
        self.gradientStartColor = gradientStartColor
        self.gradientEndColor = gradientEndColor
        self.emailRequestPageTips = emailRequestPageTips
        self.passwordRequestPageTips = passwordRequestPageTips
        self.onSuccessReplaceRootWith = onSuccessReplaceRootWith
    }