GithubHelp home page GithubHelp logo

johnnyoin / floatingactionsheetcontroller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from staticdreams/floatingactionsheetcontroller

0.0 2.0 0.0 45 KB

FloatingActionSheetController is a cool design ActionSheetController library written in Swift2.

License: MIT License

Swift 96.59% Ruby 1.82% Objective-C 1.59%

floatingactionsheetcontroller's Introduction

FloationgActionSheetController

Platform Language CocoaPods Shield Carthage compatible License

FloatingActionSheetController is a cool design ActionSheetController library written in Swift2.

Overview

Requirements

  • Xcode 8+
  • Swift3
  • iOS 8.0+

Installation

CocoaPods

# Podfile
use_frameworks!
target 'YOUR_TARGET_NAME' do
  pod "FloatingActionSheetController"
end

Carthage

# Cartfile
github "ra1028/FloatingActionSheetController"

Usage

Import FloationgActionSheetController at first.

import FloatingActionSheetController

example

let action1 = FloatingAction(title: "title") { action in
    // Do something.
}
let action2 = FloatingAction(title: "title") { action in
    // Do something.
}
let action3 = FloatingAction(title: "title", handleImmediately: true) { action in
    // Do something.
    // If set to 'true' the handleImmediately, handler will be execute soon when Action was select.
}
let group1 = FloatingActionGroup(action: action1)
let group2 = FloatingActionGroup(action: action2, action3)
FloatingActionSheetController(actionGroup: group1, group2)
    .present(in: self)

We have prepared a rich initializer to each Class. Please refer to the demo app and source code.

animations

Custom animation styles. Please check the overview or demo app for animation details

public enum AnimationStyle {
    case slideUp
    case slideDown
    case slideLeft
    case slideRight
    case pop
}

How to use

FloatingActionSheetController(actionGroup: group, animationStyle: .slideLeft)
let actionSheet = FloatingActionSheetController(actionGroup: group)
actionSheet.animationStyle = .slideLeft

appearance customization

let actionSheet = FloatingActionSheetController(actionGroup: group1)
// Color of action sheet
actionSheet.itemTintColor = .white
// Color of title texts
actionSheet.textColor = .black
// Font of title texts
actionSheet.font = .boldSystemFont(ofSize: 15)
// background dimming color
actionSheet.dimmingColor = UIColor(white: 1, alpha: 0.7)

If you wants to customize FloatingAction individually.

var action = FloatingAction(title: "title") { action in
    // Do something.
}
action.tintColor = .whiteColor()
action.textColor = .blackColor()
action.font = .boldSystemFont(ofSize: 15)

License

FloatingActionSheetController is available under the MIT license. See the LICENSE file for more info.

floatingactionsheetcontroller's People

Contributors

ra1028 avatar johnnyoin avatar staticdreams avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.