All Projects → cocoatoucher → Aiflatswitch

cocoatoucher / Aiflatswitch

Licence: mit
Nicely animated flat design switch alternative to UISwitch

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Aiflatswitch

Flutter Neumorphic
A complete, ready to use, Neumorphic ui kit for Flutter, 🕶️ dark mode compatible
Stars: ✭ 988 (+9.29%)
Mutual labels:  material, design, flat, button
Fiftyshadesof
An elegant context-care loading placeholder for Android
Stars: ✭ 1,110 (+22.79%)
Mutual labels:  material, design, custom
Arclayout
With Arc Layout explore new styles and approaches on material design
Stars: ✭ 1,662 (+83.85%)
Mutual labels:  material, design, custom
Switch
🐰 A simple and powerful switch for checkbox.
Stars: ✭ 492 (-45.58%)
Mutual labels:  switch, checkbox
Material Framework
[Unmaintained] An easy to use material design based framework.
Stars: ✭ 383 (-57.63%)
Mutual labels:  material, design
Materialimageloading
Material image loading implementation
Stars: ✭ 396 (-56.19%)
Mutual labels:  material, custom
Md Date Time Picker
An implementation of Material Design Picker components in vanilla CSS, JS, and HTML
Stars: ✭ 272 (-69.91%)
Mutual labels:  material, design
Formbase
Better default styles for common input elements.
Stars: ✭ 560 (-38.05%)
Mutual labels:  design, checkbox
Tutoshowcase
A simple and Elegant Showcase view for Android
Stars: ✭ 499 (-44.8%)
Mutual labels:  material, design
Bootstrap Switch
Turn checkboxes and radio buttons in toggle switches.
Stars: ✭ 5,132 (+467.7%)
Mutual labels:  switch, checkbox
Vue Js Toggle Button
🍥 Vue.js 2 toggle / switch button - simple, pretty, customizable
Stars: ✭ 836 (-7.52%)
Mutual labels:  switch, button
Fabsmenu
A simple library to use a menu of FloatingActionButtons from Design Support Library that follow Material Design Guidelines
Stars: ✭ 324 (-64.16%)
Mutual labels:  material, design
Vxe Table
🐬 vxe-table vue 表格解决方案
Stars: ✭ 4,242 (+369.25%)
Mutual labels:  switch, checkbox
Shinebutton
This is a UI lib for Android. Effects like shining.
Stars: ✭ 4,105 (+354.09%)
Mutual labels:  custom, button
Jc button
Arduino library to debounce button switches, detect presses, releases, and long presses
Stars: ✭ 289 (-68.03%)
Mutual labels:  switch, button
Kotlinpleaseanimate
Kotlin, please, can you animate my views ?
Stars: ✭ 541 (-40.15%)
Mutual labels:  material, design
Chips Input Layout
A customizable Android ViewGroup for displaying Chips (specified in the Material Design Guide).
Stars: ✭ 591 (-34.62%)
Mutual labels:  material, design
Flat Remix Gtk
Flat Remix is a GTK application theme inspired by material design. It is mostly flat using a colorful palette with some shadows, highlights, and gradients for some depth.
Stars: ✭ 634 (-29.87%)
Mutual labels:  material, flat
Steppers
Steppers view library for Android, based on Google Material design guidelines
Stars: ✭ 786 (-13.05%)
Mutual labels:  material, design
Expectanim
Describe your animation and run !
Stars: ✭ 2,787 (+208.3%)
Mutual labels:  material, design

AIFlatSwitch

A smooth, nice looking and IBDesignable flat design switch for iOS. Can be used instead of UISwitch.

Inspired by Creativedash's Dribbble post here

Flat switch animation

cocoapods

Requirements

  • iOS 8.0+, tvOS 12.0+
  • Xcode 11.0+
  • Swift 5

Usage

Creating the flat switch

  • Either programmatically
var flatSwitch = AIFlatSwitch(frame: CGRectMake(0, 0, 50, 50))
  • Or in Interface Builder

Methods

To change its selected state:

flatSwitch.isSelected = true
  • [x] IBInspectable

or:

flatSwitch.setSelected(true, animated: true)

To listen to its state changes:

@IBAction func handleSwitchValueChange(sender: AnyObject) {
		if let flatSwitch = sender as? AIFlatSwitch {
			print(flatSwitch.isSelected)
		}
	}

Animation observer callbacks:

flatSwitch.selectionAnimationDidStart = { isSelected in
    print("New state: \(isSelected)")
}

flatSwitch.selectionAnimationDidStop = { isSelected in
    print("State when animation stopped: \(isSelected)")
}

Styling the switch:

flatSwitch.lineWidth = 2.0
flatSwitch.strokeColor = UIColor.blue
flatSwitch.trailStrokeColor = UIColor.red
flatSwitch.backgroundLayerColor = UIColor.red
flatSwitch.animatesOnTouch = false
  • [x] IBInspectable

Contribution guidelines

  • Make your changes in your branch
  • Bump the pod version in AIFlatSwitch.podspec file (e.g. 1.0.1 to 1.0.2)
  • Make sure the Example project compiles and works fine in the Simulator
  • Find references to your source code changes in README.md and update them (e.g. method names, changed features)
  • Create a pull request

License

AIFlatSwitch is released under the MIT license. See LICENSE for details.

animated check button, checkmark

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].