Latest 1.0.0
Homepage https://github.com/yellowme/Bugle
License MIT
Platforms ios 10.0
Authors

Version
License
Platform

Bugle, is a helper for displaying alerts without writing boilerplate code.

Installation

CocoaPods

CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To give Bugle a try with an example project, run the following command:

$ pod try Bugle

To integrate Bugle into your Xcode project, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.0'
use_frameworks!

target 'MyApp' do
    pod 'Bugle'
end

Then, run the following command:

$ pod install

Usage

In your application:didFinishLaunchingWithOptions: method, setup the shared instance of Bugle:

Bugle.setup(with: options)

Where options is a configuration struct:

extension AppDelegate {
    fileprivate var options: BugleOptions {
        return [
            //.tint: UIColor.green,
            .cancel: "No",
            .title: "Bugle App Delegate title!",
            .action: "Understood",
            //.errorTint: UIColor.yellow
        ]
    }
}

See the properties section for more information about BugleOptions keys and values.

Also, If you want to liste to actions on the dialog just add the BugleDelegate:

extension ViewController: BugleDelegate {
    func didConfirm() {
        debugPrint("Confirm bugle")
    }

    // This method is optional
    func didCancel() {
        //TODO: Do something
    }
}

Then:

Bugle.shared.play("Hello World", on: self)

or you can override some setup:

let options: BugleOptions = [
    .cancel: "No, forget it",
    .title: "Are you sure?",
    .action:  "Yes, I'm a savage",
]
Bugle.shared.play("Push to master", options, on: self, ofType: .risky)

Properties

Property Type Required
title String :white_check_mark:
action String :white_check_mark:
cancel String :white_check_mark:
tint UIColor :x:
errorTint UIColor :x:

Contributors

License

Bugle is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "Bugle",
    "version": "1.0.0",
    "summary": "Bugle, is a helper for displaying alerts without writing boilerplate code.",
    "homepage": "https://github.com/yellowme/Bugle",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Luis Burgos": "[email protected]"
    },
    "source": {
        "git": "https://github.com/yellowme/Bugle.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "10.0"
    },
    "source_files": [
        "Bugle/Sources/**/*.{swift,h,m,c}"
    ]
}

Pin It on Pinterest

Share This