• Stars
    star
    1,541
  • Rank 30,365 (Top 0.6 %)
  • Language
    Swift
  • License
    MIT License
  • Created about 9 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

โค๏ธ Floating Action Button for iOS

Floaty

Swift 5.0 Version License Platform Build Status

Floaty is simple floating action button for iOS. (formerly KCFloatingActionButton)

Why change the name?

  1. Follow the swift naming convention.
  2. KCFloatingActionButton is too long.

Preview

Preview gif

Requirements

  • iOS 10.0+
  • Swift 5.0

Installation

CocoaPods

use_frameworks!
pod 'Floaty', '~> 4.2.0'

Carthage

github "kciter/Floaty"

Swift Package Manager

Once you have your Swift package set up, adding Floaty as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/kciter/Floaty.git", from: "4.2.1")
]

Manually

To install manually the Floaty in an app, just drag the Floaty/*.swift file into your project.

Usage

Storyboard support

Storyboard support1

Storyboard support2

Dependent on the UIWindow.

Floaty.global.button.addItem(title: "Hello, World!")
Floaty.global.show()

Dependent on the UIWindow

Dependent on the UIViewController.

let floaty = Floaty()
floaty.addItem(title: "Hello, World!")
self.view.addSubview(floaty)

Dependent on the UIViewController

Use icon

let floaty = Floaty()
floaty.addItem("Hello, World!", icon: UIImage(named: "icon")!)
self.view.addSubview(floaty)

Use icon

Use handler

Swift

let floaty = Floaty()
floaty.addItem("I got a handler", icon: UIImage(named: "icon")!, handler: { item in
    let alert = UIAlertController(title: "Hey", message: "I'm hungry...", preferredStyle: .alert)
    alert.addAction(UIAlertAction(title: "Me too", style: .default, handler: nil))
    self.present(alert, animated: true, completion: nil)
    floaty.close()
})
self.view.addSubview(floaty)

Use handler

Use custom item

let item = FloatyItem()
item.buttonColor = UIColor.blueColor()
item.title = "Custom item"
Floaty.global.button.addItem(item: item)

Use custom item

RTL Support

You can use the rtlMode property to mirror the Floaty Button for rtl languages.

Floaty.global.rtlMode = true

Rtl Enabled Rtl Disabled

Sticky

You can use the sticky property.

floaty.sticky = true // sticking to parent UIScrollView(also UITableView, UICollectionView)
scrollView.addSubview(floaty)

Friendly Tap

You can use the friendlyTap property.

fab.friendlyTap = true
scrollView.addSubview(fab)

With the default location of the frame, the button is now tappable until the right and rightbottom of the screen. This prevents tapping behind it by accident.

Animation type

PopFadeSlide Left
Pop animation gif Fade animation gif Slide left animation gif
Slide UpNone
Slide up animation gif None animation gif

ToDo

  • Labels to come at the right hand side of the FAB Item menu.

Donate

If you like this open source, you can sponsor it. ๐Ÿ˜„

Paypal me

License

The MIT License (MIT)

Copyright (c) 2015 Lee Sun-Hyoup

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.

More Repositories

1

qart.js

Generate artistic QR code. ๐ŸŽจ
JavaScript
3,142
star
2

awesome-style-guide

A list of awesomeโญstyle guide.
Ruby
1,058
star
3

GlitchLabel

G..lit...c...hing UILa..bel fo..r iO...S ๐Ÿ“บ
Swift
1,038
star
4

react-barcode

A <Barcode/> component for use with React.
Makefile
287
star
5

HorizontalDial

A horizontal scroll dial like Instagram.
Swift
210
star
6

simple-slack-bot

You can easily make Slack Bot!! โญ
Ruby
159
star
7

aws-ecr-action

This Action allows you to create Docker images and push into a ECR repository.
Shell
124
star
8

SelectionDialog

Simple selection dialog
Swift
117
star
9

jazzlang

์ƒค๋นฑ๋‘๋น„๋šœ๋ฐฅ ๋‘๋น„๋‘๋น„๋‘๋น„๋‘๋น„ ๋šœ๋น„๋‘๋ฐฅ ์‚ฌ๋ฐ”๋‘๋น„๋‘๋ด ์ƒค๋ฐ”๋‹ค ๋‘๋ถธ๋‘ก ๐ŸŽท
HTML
115
star
10

thing

A rule-based entity management library written in Kotlin
Kotlin
56
star
11

FBLiveAPISample-iOS

Facebook Live API Sample for iOS
Swift
56
star
12

vimgolf-finder

Simple VimGolf challenge finder. ๐Ÿ”Ž
Ruby
48
star
13

MySQLForNonDeveloper

๋น„๊ฐœ๋ฐœ์ž๋ฅผ ์œ„ํ•œ MySQL โฝ(หƒฬตอˆฬ‘แด—ห‚ฬตอˆฬ‘)โฝ
34
star
14

coding-interview-js

JavaScript
29
star
15

vue-ime-model

v-model directive for countries using IME.
JavaScript
26
star
16

RxGoogleMaps

RxGoogleMaps is a RxSwift wrapper for GoogleMaps delegate.
Swift
24
star
17

RxAutoUpdater

Auto update to data for UITableView/UICollectionView
Swift
23
star
18

terraform-apply-for-aws-action

Create, change, and improve AWS infrastructure by Terraform.
Shell
21
star
19

OnlyDesignable

This is only a collection of designable views for storyboards.
Swift
20
star
20

NNGameFramework

๋„ฅ์ŠคํŠธ ํ•™์ƒ๋“ค์„ ์œ„ํ•œ ๊ฐ„๋‹จํ•œ 2D ํ”„๋ ˆ์ž„์›Œํฌ
C
18
star
21

daily

daily run your routine commands very easy! ๐Ÿ‘
Shell
17
star
22

eos-project-vue-boilerplate-simple

Rewrite (https://github.com/EOSIO/eosio-project-boilerplate-simple) to Vue.js
Shell
13
star
23

dead-toast

๐Ÿž Dead simple Javascript Toast like Android.
JavaScript
12
star
24

NNEngine

NHN NEXT Game Engine
C++
10
star
25

resume

Lee Sun-Hyoup's Rรฉsumรฉ
HTML
9
star
26

slack_hungry

Slack ๋ฐฅ ๋ฉ”๋‰ด ์ถ”์ฒœ ๋ด‡.
Python
7
star
27

DeepLearningTetris

Python
7
star
28

laravel-vue-bootstrap

PHP
7
star
29

polymorphic-react-component-sample

TypeScript
6
star
30

vue-weather

JavaScript
5
star
31

HangeulKit

Swift
5
star
32

qart-cli

QArt.js for CLI
4
star
33

dotfiles

Shell
4
star
34

jquery-simple-chart

jQuery ์ฐจํŠธ ํ”Œ๋Ÿฌ๊ทธ์ธ ์ž…๋‹ˆ๋‹ค.
JavaScript
4
star
35

RainyDay

3
star
36

kciter

3
star
37

notevuek

JavaScript
3
star
38

brainfuck-impl

Brainfuck implementations each other in different languages.
JavaScript
3
star
39

TreeStana

JavaScript
3
star
40

kciter.github.io

TypeScript
2
star
41

vue-stagram

JavaScript
2
star
42

FlappyBirdClone

FlappyBirdClone
2
star
43

microfrontend-sample

JavaScript
2
star
44

next-subsystem

TypeScript
2
star
45

iOS-FinishTest

Swift
2
star
46

mf-sdu-test

TypeScript
2
star
47

vuex-counter-example

JavaScript
2
star
48

pokestop-alram

ํฌ์ผ€์Šคํƒ‘ ์•Œ๋žŒ์ž„
Shell
2
star
49

Android-FinishTest

Java
1
star
50

jenkins-pipeline-test

JavaScript
1
star
51

expandable-spring-architecture

1
star