Skip to content
This repository was archived by the owner on Jul 21, 2022. It is now read-only.

ZacharyKhan/ZKNavigationController

Repository files navigation

ZKNavigationController

Version License Platform

Demo

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Set your Navigation Controller AND module to ZKNavigationController via storyboard or in viewDidLoad().

then import ZKNavigationController in your viewController.

Installation

ZKNavigationController is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "ZKNavigationController"

Usage

import UIKit
import Foundation
import ZKNavigationController

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    @IBAction func showAlertButtonHandler(sender: AnyObject) {
        self.show(withIcon: true)
    }
    
    @IBAction func showWithoutIconHandler(sender: AnyObject) {
        self.show(withIcon: false)
    }

    func show(withIcon withIcon:Bool!) {
        if let navController : ZKNavigationController = self.navigationController as? ZKNavigationController {
            if !withIcon {
                let popupView = ZKNavigationPopupView(navigationController: navController, Icon: nil, Message: "Showing a ZKAlert")
                navController.showAlert(popupView)
            } else {
                let icon = ZKIcon(image: UIImage(named: "image"))
                let popupView = ZKNavigationPopupView(navigationController: navController, Icon: icon, Message: "Showing a ZKAlert")
                navController.showAlert(popupView)
            }
        } else {
            print("Navigation controller is not of type ZKNavigationController")
        }
    }
}

Contribution

If you would like to contribute to ZKNagivationController, please fork the repo.

For ALL feature requests and bugs, please submit an issue.

Author

You can reach me on Twitter -> @ZacharyKhan3

License

ZKNavigationController is available under the MIT license. See the LICENSE file for more info.

About

iOS Navigation Controller Alert in Swift

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •