Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to customize labels and buttons of SwiftyOnboardOverlay or SwiftyOnboard #35

Open
IslasGiga opened this issue Oct 8, 2018 · 3 comments

Comments

@IslasGiga
Copy link

IslasGiga commented Oct 8, 2018

I'm trying to customize labels of SwiftyOnboard (change colors, font...) and the skip button, but it's not working.

@litsdm
Copy link

litsdm commented Nov 15, 2018

@IslasGiga I looked at SwiftyOnBoard's code and it is using an enum that has only .light and .dark, this enum is overriding any colors you are setting on this two functions:

// SwiftyOnBoardOverlay.swift
open func set(style: SwiftyOnboardStyle) {
        switch style {
        case .light:
            continueButton.setTitleColor(.white, for: .normal)
            skipButton.setTitleColor(.white, for: .normal)
            pageControl.currentPageIndicatorTintColor = UIColor.white
        case .dark:
            continueButton.setTitleColor(.black, for: .normal)
            skipButton.setTitleColor(.black, for: .normal)
            pageControl.currentPageIndicatorTintColor = UIColor.black
        }
    }

// SwiftyOnBoardPage.swift
func set(style: SwiftyOnboardStyle) {
        switch style {
        case .light:
            title.textColor = .white
            subTitle.textColor = .white
        case .dark:
            title.textColor = .black
            subTitle.textColor = .black
        }
    }

So you can only change between black and white text for now. I don't have much time to write a PR to fix this right now but I'll try to do it when on my free time. You can also try fixing this issue yourself and submitting the PR!

@hemangshah
Copy link

@cdiezmoran, great looking in code! I would suggest you to add custom type for SwiftyOnboardStyle that let devs can use they own style.

@spaquet
Copy link

spaquet commented Jan 19, 2019

You can create your own overlay too.
If you want to cover the changes you just mentioned I would suggest overriding the properties of this objects in swiftyOnboardViewForOverlay as explained in the documentation and the examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants