ivanvorobei / SPFakeBar

Very similar to original Navigation Bar. Full customisable - height, buttons and other

Home Page:https://opensource.ivanvorobei.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SPFakeBar

About

Very similar to original Navigation Bar. Full customisable - height, buttons and many other. Used it as simple view.

Not support transition and native back button.

If you like the project, don't forget to put star ★ and follow me on GitHub:

Navigate

Requirements

Swift 4.2 & 5.0. Ready for use on iOS 10+

Installation

CocoaPods:

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate SPFakeBar into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'SPFakeBar'

Manually

If you prefer not to use any of the aforementioned dependency managers, you can integrate SPFakeBar into your project manually. Put Source/SPFakeBar folder in your Xcode project. Make sure to enable Copy items if needed and Create groups.

Usage

You may want to add a navigation bar to your modal controller. Since it became impossible to change or customize the native controller in swift 4 (I couldn’t even find a way to change the height of the bar), I had to recreate navigation bar from the ground up. Visually it looks real, but it doesn’t execute the necessary functions:

import UIKit
import SPFakeBar

class ModalController: UIViewController {
    
    let navBar = SPFakeBarView(style: .stork)
        
    override func viewDidLoad() {
        super.viewDidLoad()

        self.view.backgroundColor = UIColor.white

        self.navBar.titleLabel.text = "Title"
        self.navBar.leftButton.setTitle("Cancel", for: .normal)
        self.navBar.leftButton.addTarget(self, action: #selector(self.dismissAction), for: .touchUpInside)

        self.view.addSubview(self.navBar)
    }
}

You only need to add a navigation bar to the main view, it will automatically layout. Use style .stork in init of SPFakeBarView. Here is visual preview with Navigation Bar and without it:

Other Projects

I love being helpful. Here I have provided a list of libraries that I keep up to date. For see video previews of libraries without install open opensource.ivanvorobei.by website.
I have libraries with native interface and managing permissions. Also available pack of useful extensions for boost your development process.

Russian Community

Подписывайся в телеграмм-канал, если хочешь получать уведомления о новых туториалах.
Со сложными и непонятными задачами помогут в чате.

Видео-туториалы выклыдываю на YouTube:

Tutorials on YouTube

About

Very similar to original Navigation Bar. Full customisable - height, buttons and other

https://opensource.ivanvorobei.io

License:MIT License


Languages

Language:Swift 95.6%Language:Ruby 4.4%