Giter Club home page Giter Club logo

vkexpandablebutton's Introduction

VKExpandableButton

Description

VKExpandableButton is a simple and easy-to-use expandable button written in Swift. You can put any String or UIImage inside it's content and customize it as you wish.

Installation

For now you can install VKExpandableButton manually only.

  1. Add VKExpandableButton.swift class into your Swift project (or via Bridging header into Obj-C project).

  2. Add UIView in your storyboard and subclass it as VKExpandableButton or Create it manually from code.

Example project

Example project shows how you can four VKExpandableButton with different content. To test it, clone the repo and run it from the Example directory.

Usage

Directions

VKExpandableButton supports four different directions:
* Top
* Right
* Bottom
* Left

Example

As mentioned before VKExpandableButton is easy to use. Here is a quick code example:

// Add manually VKExpandableButton with text content via code
// Direction: RIGHT (from left to right)
self.buttonRight = VKExpandableButton(frame: CGRectMake(16, 28, 80, 44))
self.buttonRight.direction      = .Right
self.buttonRight.options        = ["Auto", "On", "Off"]
self.buttonRight.currentValue   = self.buttonRight.options[0]
        
self.buttonRight.optionSelectionBlock = {
	index in
	print("[Right] Did select option at index: \(index)")
}
        
self.view.addSubview(self.buttonRight)

Customization

This class is very flexible for customization. You can set text/selection/backgroud colors, text fonts, image insets etc. See more info in VKExpandableButton.swift file. Also you can combine both String and UIImage content in a single button.

Author

Vladislav Kovalyov, http://woopss.com/

License

VKExpandableButton is available under the MIT License. See the LICENSE file for more info.

vkexpandablebutton's People

Contributors

faker22 avatar

Watchers

Imtiaz Ahmed 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.