Latest 0.1.0
Homepage https://github.com/praveenkumarsomu/CustomNavigationBar
License MIT
Platforms ios 11.0
Authors

This is a drop-in component for creating custom navigation bar for iPhone Apps.

It will allow you to setup subtitle as well in addition to the title. You can customize the theme by setting background color and other properties. I created this using Swift 4.2 but you can use it for 4 as well.

Installation

This can be installed directly into your application via CocoaPods or by directly importing the source code files.

CocoaPods Installation

The recommended path for installation is CocoaPods. CocoaPods provides a simple, versioned dependency management system that automates the tedious and error prone aspects of manually configuring libraries and frameworks. You can add CustomNavigationbar to your project via CocoaPods by doing the following: ( Make sure you are in the Project folder in the terminal before setting up pods)

$ sudo gem install cocoapods

$ pod setup

Now create a Podfile in the root of your project directory and add the following:

pod ‘CustomNavigationBar’

Complete the installation by executing:

$ pod install

Getting Started

Open your work space and add call the addCustomNavbarView method in the viewDidLoad function thats it you are done. Looks so simple 😉. Now we will see the parameters what we can modify from your ViewController which makes this more powerful.

backgroundColor – This is to set the background color to the Navigation bar, this is UIColor type and default value is blue.

title – It is string type and it will be displayed as title

subTitle – It is string type and it will be displayed as sub title

titleFont – It is UIFont type and you can set title font by passing your custom font. Default value is nil i.e System font

subtitleFont – It is UIFont type and you can set subtitle font by passing your custom font, Default value is nil i.e System font

titleTextColor – It is UiColor type and you can set title color by passing your custom color value. default color is white

subtitleTextColor – It is UiColor type and you can set subtitle color by passing your custom color value. default color is white

titleAlignment – It is NSTextAlignment type you can set the title text alignment center, left or right by passing your type.

subtitleAlignment – It is NSTextAlignment type you can set the subtitle text alignment center, left or right by passing your type.

showBackButton – You can hide passing this value false, default value is true. Normally I’ll hide this for initial screens and pop ups it is up to your requirement.

backButtonImage – You can customize back button image by passing UIImage as parameter.

In All the Parameters title, subTitle and backButtonImage are required parameters if you want to show back button.

Latest podspec

{
    "name": "CustomNavigationBar",
    "version": "0.1.0",
    "summary": "This is for pod version 0.1.0",
    "description": "This will help you to customise your Navigation bar and to set title and subtitle and your own theme",
    "homepage": "https://github.com/praveenkumarsomu/CustomNavigationBar",
    "license": "MIT",
    "authors": {
        "Praveen": "[email protected]"
    },
    "source": {
        "git": "https://github.com/praveenkumarsomu/CustomNavigationBar.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "11.0"
    },
    "source_files": "CustomNavigationBar/NavigationBarView.swift"
}

Pin It on Pinterest

Share This