iOS Navigation Bar with customs shapes (Zigzag, Wave and Square) written in Swift 2.
To run the example project, clone the repo, and run pod install
from the Example directory first.
####CocoaPods
AGNavigationBarShape is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "AGNavigationBarShape"
####Manually
Add the AGNavigationBarShape.swift
file to your project.
##Usage
###Setup
Add import AGNavigationBarShape
in your file
In your app delegate:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
let rootViewController = UIStoryboard.init(name: "Main", bundle: nil).instantiateInitialViewController()
let navController = UINavigationController(navigationBarClass: AGNavigationBarShape.self, toolbarClass: nil)
(navController.navigationBar as? AGNavigationBarShape)?.mode = .Zigzag
(navController.navigationBar as? AGNavigationBarShape)?.color = UIColor.purpleColor()
(navController.navigationBar as? AGNavigationBarShape)?.cycles = 5
navController.viewControllers = [rootViewController!]
window?.rootViewController = navController
window?.makeKeyWindow()
return true
}
####Storyboard Support
- Add
AGNavigationBarShape
Class and Module to UINavigationController's navigationBar in Identity Inspector
- If you want to custom it, set options in the Attributes Inspector tab
- Choose shape mode (0: Zigzag, 1: Wave, 2: Square) (Zigzag by default)
- Custom number of cycle (9 by default)
- Custom background color (orange by default)
Aurelien Grifasi, [email protected]
AGNavigationBarShape is available under the MIT license. See the LICENSE file for more info.