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

Swift 如何实现呀 感觉有点懵呢 #56

Open
chihaodong opened this issue Aug 16, 2020 · 2 comments
Open

Swift 如何实现呀 感觉有点懵呢 #56

chihaodong opened this issue Aug 16, 2020 · 2 comments

Comments

@chihaodong
Copy link

chihaodong commented Aug 16, 2020

  • (YPNavigationBarConfigurations) yp_navigtionBarConfiguration {
    YPNavigationBarConfigurations configurations = YPNavigationBarShow;
    if (_gradientProgress < 0.5) {
    configurations |= YPNavigationBarStyleBlack;
    }

    if (_gradientProgress == 1) {
    configurations |= YPNavigationBarBackgroundStyleOpaque;
    }

    configurations |= YPNavigationBarBackgroundStyleColor;
    return configurations;
    }

这段代码 如何转向Swift

例如 这:
YPNavigationBarConfigurations configurations = YPNavigationBarShow;
configurations |= YPNavigationBarStyleBlack;

并且Swift中 不调用 .show (YPNavigationBarShow) 这个枚举
谢谢

@yiplee
Copy link
Owner

yiplee commented Aug 18, 2020

extension YPNavigationController : NavigationBarConfigureStyle {
    public func yp_navigtionBarConfiguration() -> YPNavigationBarConfigurations {
        return [.styleBlack]
    }
    
    public func yp_navigationBarTintColor() -> UIColor! {
        return .white
    }
}

大概是这样,swift 我现在也不知道更新成什么样了 😂

@chihaodong
Copy link
Author

extension YPNavigationController : NavigationBarConfigureStyle {
    public func yp_navigtionBarConfiguration() -> YPNavigationBarConfigurations {
        return [.styleBlack]
    }
    
    public func yp_navigationBarTintColor() -> UIColor! {
        return .white
    }
}

大概是这样,swift 我现在也不知道更新成什么样了 😂

你这些我都用过了,但是在swift 下 .show 那个枚举 用不了,而且确实是有些问题 还望后期更新下 支持Swift 辛苦了

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

2 participants