A Customizable Material Design Switch UI for iOS - MJMaterialSwitch

A Customizable Material Design Switch UI for iOS - MJMaterialSwitch

MJMaterialSwitch - A Customizable Switch UI for iOS, Inspired from Google's Material Design in Swift.



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.


The simplest setup by code:

let xPos: CGFloat = (UIScreen.main.bounds.width / 2 ) - 22.5
let yPos: CGFloat = (UIScreen.main.bounds.height / 2 ) + 50.0
self.switch2 = MJMaterialSwitch(frame: CGRect(x: xPos , y: yPos, width: 64, height: 60))
self.switch2.addTarget(self, action: #selector(switchStateChanged(_:)), for: UIControl.Event.valueChanged)
self.switch2.tarckEdgeInset = UIEdgeInsets(top: 18, left: 0, bottom: 18, right: 0)
self.switch2.tag = 2
switch2.trackOnTintColor = UIColor.red.withAlphaComponent(0.6)
switch2.thumbOnTintColor = UIColor.red

// Call update UI method in last.


This is the simplest and easiest initialization.

Usage by xib and Storyboard

  • Create UIView and set the MJMaterialSwitch class.
  • Create IBOutlet to add valueChanged target for the click actions

Customize Behaviors

MJMaterialSwitch has many prateters to customize behaviors as you like.

Style and size

var thumbOnTintColor: UIColor!
var thumbOffTintColor: UIColor!

var trackOnTintColor: UIColor!
var trackOffTintColor: UIColor!

var thumbDisabledTintColor: UIColor!
var trackDisabledTintColor: UIColor!

var isBounceEnabled: Bool = false
var isRippleEnabled: Bool = true
var rippleFillColor: UIColor = .gray


Jaleel Nazir [email protected] Buy me coffe: paypal

Download Details:

Author: JaleelNazir Download Link: Download The Source Code Official Website: https://github.com/JaleelNazir/MJMaterialSwitch License: MIT

swift ui ux user-experience

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

A Comprehensive Guide to UI

UI or User Interface is the interface that is the access point where users interact with computers. It is also a way through which users can interact with a website or an application. UI design typically refers to graphical user interfaces but also includes others, such as voice-controlled ones, a keyboard, a mouse, and the appearance of a desktop.

Intro to UI/UX | User Interface vs User Experience | UI/UX Tutorials for Beginners

Great Learning brings you to this live session on "Intro to UI/UX". User Experience (UX) and User Interface (UI) designs are important fields that are often underlooked during software development, but they play a big silent role in attracting customers by providing a visually appealing, smooth, and functional experience to them. Adobe XD is a very popular free tool that allows us to create prototypes and wireframes that help us to design web and mobile applications. In this session, we learn the basics of UI/UX philosophy, the difference between them, wireframing, prototyping, user testing, etc. We will also be learning what the UX process is, what a prototype is, an example of user testing, tools that will be used for this purpose, UI Concepts, and a lot more. All of this will help you form a framework that will help you build the career of your choice and bring you to appreciate this under-appreciated practice.

User Experience Design: Which are the top UI/UX design firms in San Francisco Bay Area?

AppClues Infotech is an independent best UI/UX design company in New York, USA that offers superior UI/UX design services to clients that helps business growth.

Hire UI/UX Designer | Hire Creative UI/UX Designer

WebClues Infotech is a leading website and mobile development services company. We specialize in full stack development services as well as iOS and Andriod app creation.

Hire Dedicated UI/UX Developer

Do you need UI/UX Designers for hire? **[Hire Dedicated UI/UX Developer](https://hourlydeveloper.io/hire-dedicated-ui-ux-developer/ "Hire Dedicated UI/UX Developer")** from **[HourlyDeveloper.io](https://hourlydeveloper.io/...