Socket
Socket
Sign inDemoInstall

github.com/ltebean/LTNavigationBar

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/ltebean/LTNavigationBar


Version published
Created
Source

LTNavigationbar

swift version

https://github.com/ltebean/LTNavigationBar/tree/swift3.0

Purpose

It is hard to change the appearance of UINavigationBar dynamically, so I made this lib to make the job easy.

Demo

1. Changing the background color:

LTNavigationbar

2. Making navigation bar scroll along with a scroll view:

LTNavigationbar

Usage

First, import this lib:

#import "UINavigationBar+Awesome.h"

The category includes lots of method that helps to change UINavigationBar's appearance dynamically:

@interface UINavigationBar (Awesome)
- (void)lt_setBackgroundColor:(UIColor *)backgroundColor;
- (void)lt_setElementsAlpha:(CGFloat)alpha;
- (void)lt_setTranslationY:(CGFloat)translationY;
- (void)lt_reset;
@end

You can call the various setter wherever you want, like:

[self.navigationController.navigationBar lt_setBackgroundColor:[UIColor blueColor]];

And usually in viewWillDisappear, you should call this method to avoid any side effects:

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [self.navigationController.navigationBar lt_reset];
}

See the example for details~

FAQs

Package last updated on 26 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc