Skip to content

salah-mohammed/NavigationKit

Repository files navigation

Result

alt text

NavigationKit

Navigation Kit used for make threat with screen that have differents navigation bar style, make change style of bar easy.

Advantages

  • set Background Image for navigation bar and title color for every single screen.
  • set color for navigation bar and their title for every single screen.
  • Hide navigation bar feature for every single screen.
  • can make navigation bar color transparent for every single screen.
  • can set default navigation bar style if Viewcontroller not implement NavigationDelegate will take this default style.

Requirements

  • IOS 13+
  • Swift 5+

How used (configuration):

Pod install

pod 'NavigationKit',:git => "https://github.com/salah-mohammed/NavigationKit.git"
 
  • First
public class MainNavigationController: NavigationController {

    public override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
    }
    
}
  • Second

if you want set Navigation bar transparent and change title color .

class FirstViewController: UIViewController,NavigationDelegate {
 
   var style=Navigation.Style.init(Navigation.Style.custom(.all(AppStyle.transparentBarStyle),UIColor.black))
    
    public override func viewDidLoad() {
        super.viewDidLoad()
    }
 }

if you want to set Navigation bar color and set title color for it.

 class SecondViewController: UIViewController,NavigationDelegate {
 
 var style=Navigation.Style.init(Navigation.Style.custom(.all(AppStyle.greenBarStyle),UIColor.white))
   
       public override func viewDidLoad() {
       super.viewDidLoad()
   }
}

if you want to hide Navigation bar.

class ThiredViewController: UIViewController,NavigationDelegate {

   var style=Navigation.Style.init(Navigation.Style.hide);
   
       public override func viewDidLoad() {
       super.viewDidLoad()
   }
}

if you want to set background image for Navigation bar and set title color for it.

class ForthViewController: UIViewController,NavigationDelegate {

   var style=Navigation.Style.init(Navigation.Style.custom(.all(AppStyle.backgroundImageBarStyle),UIColor.white))
   
       public override func viewDidLoad() {
       super.viewDidLoad()
   }
}
  • Thired

if you want to set default style 'if Viewcontroller not implement NavigationInfoDelegate'

Navigation.shared.defaultStyle = Navigation.Style.custom(.all(AppStyle.yelloBarStyle),UIColor.white)

Configure Successfully

You can refresh navigation style by

self.navigationController?.refrehStyle();

License

NavigationKit is released under the MIT license. See LICENSE for details.

Developer's information to communicate