Skip to content
A Customizable Switch UI for iOS, Inspired from Google's Material Design in Swift
Swift
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
MJMaterialSwitch.xcodeproj 1. Updated to Swift 5 Aug 26, 2019
MJMaterialSwitch 1. Updated to Swift 5 Aug 26, 2019
.gitignore 1. Updated to Swift 5 Aug 26, 2019
LICENSE Initial commit Mar 24, 2017
MJMaterialSwitch.png 1. Added Image May 31, 2017
Property.png Added Images May 31, 2017
README.md Update README.md Aug 26, 2019
TiitleTheme.png Added Images May 31, 2017

README.md

MJMaterialSwitch

Overview

MJMaterialSwitch is google's material design like switch UI with animation features.

This library has cool and sophisticated animations, ripple effect and bounce effect. Also, customizable properties can be tweaked behaviors and enhance your application UI cool.

With this library, you can easily implement material design switch to your app.



Usage

The simplest setup:

let androidSwitchSmall = MJMaterialSwitch(withSize: .small, style: MJMaterialSwitchStyle.light, state: MJMaterialSwitchState.on)
self.androidSwitchSmall.delegate = self
self.view.addSubview(self.androidSwitchSmall)

This is the simplest and easiest initialization. The style, size and initial state of MJMaterialSwitch instance is set to all default value as shown below.

Customize Behaviors

MJMaterialSwitch has many prateters to customize behaviors as you like.

Style and size

//MARK: - Switch type
public enum MJMaterialSwitchStyle {
    case light, dark, medium
}
//MARK: - Initial MJMaterialSwitch size (big, normal, small)
public enum MJMaterialSwitchSize {
    case big, normal, small
}

Author

Jaleel Nazir nazirjaleel@gmail.com

License

MJMaterialSwitch is available under the MIT license.

You can’t perform that action at this time.