varabeis / Spfakebar
Programming Languages
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
SPPermissions
Allow request permissions with native dialog UI and interactive animations. Also you can request permissions without dialog. Check state any permission. You can start using this project with just two lines of code and easy customisation.
SPAlert
It is popup from Apple Music & Feedback in AppStore. Contains Done & Heart presets. Done present with draw path animation. I clone Apple's alerts as much as possible. You can find this alerts in AppStore after feedback, after added song to library in Apple Music. I am also add alert without icon, as simple message.
SPDiffable
Apple's diffable API requerid models for each object type. If you want use it in many place, you pass many time to implemenet and get over duplicates codes. This project help you do it elegant with shared models and special cell providers for one-usage models.
Russian Community
В телеграм-канале Код Воробья пишу о iOS разработке. Видео-туториалы выклыдываю на YouTube: