tanabe1478 / BreadCrumbControl

BreadCrumb Control for iOS (Swift)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BreadCrumbControl

Carthage compatible CocoaPods

BreadCrumb Control for iOS written in Swift.

animatedsample

sample

The properties of "BreadCrumb" are fully accessible for the developer: color, animation, etc. This control is provided with a sample application that lets you change the properties of the control in real-time.

Compatibility

This control is compatible with iOS 8. Swift 4.2 compatible.

Installation in Xcode project

It is a very easy control to include in your project.

Manually

Add to your iOS project: BreadCrumb.swift, CustomButton.swift, BreadCrumbs.xcassets.

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate this into your Xcode project using CocoaPods, specify it in your Podfile:

platform :ios, '8.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'BreadCrumbControl'
end

Carthage

BreadCrumbControl is Carthage compatible. Add the following into your Cartfile, then run carthage update.

github "apparition47/BreadCrumbControl"

Usage

In order to use BreadCrumb control, you can instantiate it programmatically, or create a custom view in Interface Builder and assign it to an ivar of your app. Once you have an instance, you can use the control properties to configure it. See ViewController.swift for detail code.

import BreadCrumbControl // if using CocoaPods or Carthage

class ViewController: UIViewController {
    @IBOutlet weak var breadcrumbControl: CBreadcrumbControl!
    override func viewDidLoad() {
        self.breadcrumbView.delegate = self

        self.breadcrumbView.buttonFont = UIFont.boldSystemFont(ofSize: 16)
        self.breadcrumbView.style = .gradientFlatStyle
        self.breadcrumbView.itemsBreadCrumb = ["Config", "Alarm"]
    }
}

extension ViewController: BreadCrumbControlDelegate {
    func didTouchItem(index: Int, item: String) {
        let alertView = UIAlertView();
        alertView.addButton(withTitle: "OK")
        alertView.title = "Item touched"
        alertView.message = "\(item) (index= \(index))"
        alertView.show()
    }

    func didTouchRootButton() {
        let alertView = UIAlertView();
        alertView.addButton(withTitle: "OK")
        alertView.title = "Root button touched"
        alertView.show()
    }
}

Screenshots

sampleapplication

Credits

License

BSD

About

BreadCrumb Control for iOS (Swift)

License:Other


Languages

Language:Swift 98.9%Language:Ruby 1.1%