Swiftpack.co - DuetHealth/Fabulous as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by DuetHealth.
DuetHealth/Fabulous 3.0.0
A material-inspired floating action button for iOS.
⭐️ 2
🕓 47 weeks ago
iOS
.package(url: "https://github.com/DuetHealth/Fabulous.git", from: "3.0.0")

License: MIT Swift Package Manager Carthage Cocoapods

Fabulous

Fabulous is a material-inspired floating action button with a little Human Interface flair. Supports singular, primary actions or a collection of speed-dial actions.

Demo

Usage

Installation

Swift Package Manager:

// swift-tools-version:5.0

import PackageDescription

let package = Package(
  name: "FabulousTestProject",
  dependencies: [
    .package(url: "https://github.com/DuetHealth/Fabulous.git", from: "3.0.0")
  ],
  targets: [
    .target(name: "FabulousTestProject", dependencies: ["Fabulous"])
  ]
)

Cocoapods: pod 'Fabulous', '~> 2.0'. See Fabulous.podspec for more information.

Carthage: github "DuetHealth/Fabulous" ~> 2.0 && carthage update

Adding a fab

Adding a fab currently involves making modifications to the underlying view controller's view hierarchy, so you should ensure that the view has at least been loaded to begin using a fab. Actually installing the fab in the hierarchy is simple.

class ExampleViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Keep a reference around (for reasons.)
        let fab = FabulousViewController(overlying: self)
        fab.addAction(FabulousAction(title: "Action 1", image: UIImage(named: "action-1")) {
            print("Fabulous!")
        })

        fab.addAction(FabulousAction(title: "Action 2", image: UIImage(named: "action-2")) {
            print("Marvelous!")
        })
    }

}
class ExampleViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // No need for the reference? Use a builder-style constructor.
        FabulousViewController(overlying: self) { fab in
        
            fab.addAction(FabulousAction(title: "Action 1", image: UIImage(named: "action-1")) {
                print("Fabulous!")
            })

            fab.addAction(FabulousAction(title: "Action 2", image: UIImage(named: "action-2")) {
                print("Marvelous!")
            })

        }
    }

}

License

Fabulous is MIT-licensed. The MIT license is included in the root of the repository.

GitHub

link
Stars: 2
Last commit: 47 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

3 years ago

Removed Objective-C, now all Swift

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics