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

rogermolas/RMFloatingAction

Repository files navigation

RMFloatingAction

Build Status Status license Version Twitter

RMFloatingAction is a floating action button, that support both custom backgoround image and color.

Demo

Installation

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

pod "RMFloatingAction"

Run the following command in your Terminal

$ pod install

Using background image

let buttons = [
    RMFloatingButton(title: "1", image:  UIImage(named: "closeButton")),
    RMFloatingButton(title: "2", image:  UIImage(named: "closeButton")),
    RMFloatingButton(title: "3", image:  UIImage(named: "closeButton"))]
let floatingVc = RMFloatingViewController(buttons: buttons, fromView: sender)
floatingVc.delegate = self
floatingVc.setDirection(button: .up, label: .left)
self.present(floatingVc, animated: true, completion: nil)

Using background color

let buttons = [
    RMFloatingButton(title: "Name: 1", backgroundColor: UIColor.red),
    RMFloatingButton(title: "Name: 2", backgroundColor: UIColor.green),
    RMFloatingButton(title: "Name: 3", backgroundColor: UIColor.blue)]
let floatingVc = RMFloatingViewController(buttons: buttons, fromView: sender)
floatingVc.delegate = self
floatingVc.setDirection(button: .down, label: .right)
self.present(floatingVc, animated: true, completion: nil)

All buttons and labels can use positioning options ( e.g. up, down, left, right) that defined in public enum RMFloatingDirection

Author

rogermolas, [email protected]

License

The MIT License (MIT)

Copyright (c) 2018 Roger Molas

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Android like floating action button, Available on cococapods

Resources

License

Stars

Watchers

Forks

Packages

No packages published