/ Navigation

Make threat with screen that have differents navigation bar style

Make threat with screen that have differents navigation bar style

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

NavigationKit

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()
        NavigationManager.shared.navigationController=self;
        // 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 navigationData:NavigationData=NavigationData.init(NavigationManager.NavigationStyle.custom(NavigationManager.BarColor.transparent,titleColor: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 navigationData: NavigationData=NavigationData.init(NavigationManager.NavigationStyle.custom(NavigationManager.BarColor.customColor(UIColor.blue), titleColor:  UIColor.white))
   
       public override func viewDidLoad() {
       super.viewDidLoad()
   }
}

if you want to hide Navigation bar.

class ThiredViewController: UIViewController,NavigationDelegate {

   var navigationData: NavigationData=NavigationData.init(NavigationManager.NavigationStyle.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 navigationData: NavigationData=NavigationData.init(NavigationManager.NavigationStyle.custom(NavigationManager.BarColor.backgroundImage(UIImage.init(named:"navigationImage")!), titleColor: UIColor.white))
   
       public override func viewDidLoad() {
       super.viewDidLoad()
   }
}
  • Thired

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

NavigationManager.shared.defaultData = NavigationData.init(NavigationManager.NavigationStyle.custom(NavigationManager.BarColor.customColor(UIColor.blue), titleColor:  UIColor.white))

Configure Successfully

You can refresh navigation style by

(self.navigationController as? MainNavigationController)?.refrehNavigationData();

GitHub

Comments