Giter Club home page Giter Club logo

fulans / ypnavigationbartransition Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yiplee/ypnavigationbartransition

0.0 1.0 0.0 8.77 MB

A Full functional UINavigationBar framework for making bar transition more natural! You don't need to call any UINavigationBar api, implementing YPNavigationBarConfigureStyle protocol for your view controller instead. (类似微信 iOS Navigation Bar 的切换方案)

License: MIT License

Objective-C 92.00% Ruby 7.46% Shell 0.54%

ypnavigationbartransition's Introduction

YPNavigationBarTransition

Build Status Pods Version Carthage Compatible

A Fully functional UINavigationBar framework for making bar transition more natural! You don't need to call any UINavigationBar api, implementing YPNavigationBarConfigureStyle protocol for your view controller instead.

类似微信 UINavigationBar 效果的切换方案,支持任意透明半透明图片背景等等不同样式的 UINavigationBar 的切换。

features

  • Transparent & translucent navigation bar 支持不透明、全透明和半透明的 navigation bar
  • Pure color bar 支持设置 navigation bar 背景颜色
  • Background image bar 支持设置 navigation bar 背景图片
  • Update navigationBar style dynamicly 可以动态调整 navigation bar 样式
  • Written in Objective-C with full Swift interop support

不同颜色和透明度的 bar 之间的切换

图片背景的 navigation bar

动态调整 navigation bar 样式

Requirements

  • Xcode 9.0+
  • iOS 8.0+

Installation

CocoaPods

The preferred installation method is with CocoaPods. Add the following to your Podfile:

# use_frameworks! is needed for swift projects
use_frameworks!
pod 'YPNavigationBarTransition', '~> 2.0'

Carthage

For Carthage, add the following to your Cartfile:

github "yiplee/YPNavigationBarTransition" ~> 2.0

Getting Started

1. Import Framework

// objc
#import <YPNavigationBarTransition/YPNavigationBarTransition.h>
// swift
import YPNavigationBarTransition

2. Replace UINavigationController with YPNavigationController

3. Implement Protocol YPNavigationBarConfigureStyle for YPNavigationController in Category

// objc (this will be your app's default navigationbar style)
@implementation YPNavigationController (Configure)

- (YPNavigationBarConfigurations) yp_navigtionBarConfiguration {
    return YPNavigationBarStyleBlack | YPNavigationBarBackgroundStyleTranslucent | YPNavigationBarBackgroundStyleNone;
}

- (UIColor *) yp_navigationBarTintColor {
    return [UIColor whiteColor];
}
// swift (this will be your app's default navigationbar style)
extension YPNavigationController : NavigationBarConfigureStyle {
    public func yp_navigtionBarConfiguration() -> YPNavigationBarConfigurations {
        return [.styleBlack]
    }

    public func yp_navigationBarTintColor() -> UIColor! {
        return UIColor.white
    }
}

License

MIT. See the LICENSE file for details.

ypnavigationbartransition's People

Contributors

janyave avatar kinarobin avatar liaoworking avatar yiplee avatar z-hui avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.