Switch Animations: Create Dynamic Switches animations in Swift

Boost the UI and UX of your application with an engaging collection of switches animations created using the Swift programming language.

A Collection of Animated Switches

animate switch
switches animations
switches animations in Swift 5.1

I occasionally peruse Dribbble to for UI/UX designer ideas. Non-native control elements are frequently used in these designs. Some, like checkboxes, don’t have a natural analogue in UIKit, whereas switches do— with the exception that they’re incredibly difficult to customise. A UISwitch cannot even be made larger. What if you have to use a switch that was entirely specifically created for your programme, like this one?

It wouldn’t be a good idea to subclass UISwitch if you wanted to apply any of these designs because you can’t really change the colours much other than the on/off tint. I then decided to try to redesign the UISwitch so that I could have total control over every feature and make it simple to style in the future.

It wouldn’t be a good idea to subclass UISwitch if you wanted to apply any of these designs because you can’t really change the colours much other than the on/off tint. So I decided to try re-engineering the UISwitch to give me total control over every feature and make it simple to style in the future.It turns out that creating these control elements from scratch is actually rather simple (and a lot of fun!). I even added the option to turn on or off text or graphics. For those who are unaware, UISwitch provides two options: onImage and offImage, which, when set, have no further effect.

As a result, I incorporated a few of the Dribble switches Daily UI tasks in this module.Cool and sophisticated animations, designs, and effects may be found in this library. Additionally, you can modify behaviours and make your application’s UI cooler by using customisable settings. With the help of this library, adding a material design switch to your app is simple.

You can experiment with the properties and alter them to suit your UI requirements. Here are a few instances:

Usage example of Switch Animations

Class Example
Switcher
SwitcherFullStrtech
SDSwitch
YapDarkAndLightModeSwitch
YapAnimatedSwitch
SDSwitch
YapFullTextSwitch
JDSwitch
YapSmileSwitch
YapLiquidSwitch
YapSwitchSlim
YapGradientSwitch
YapHalfStretchSwitch
YapSwitch
YapFullStretchSwitch
YapSwitch

Requirements

  • iOS 10.0+ / Mac OS X 10.9+ / watchOS 2.0+ / tvOS 9.0+
  • Xcode 8.0+

Installation

CocoaPods

To integrate Switches Animations into your Xcode project using CocoaPods, specify it in your Podfile:

use_frameworks!

pod 'Switches'

Next, execute the given command.

$ pod install

Swift Package Manager (SPM)

Prerequisites

  • OSX

Update Package.swift

To integrate Switches Animations in your project, add the proper description to your Package.swift file:

// swift-tools-version:5.0
import PackageDescription

let package = Package(
    name: "YOUR_PROJECT_NAME",
    dependencies: [
        .package(url: "https://github.com/jwd-ali/Switch-Animations.git")
    ],
    targets: [
        .target(
            name: "YOUR_TARGET_NAME",
            dependencies: ["Switch-Animations"]
        ),
        ...
    ]
)

Carthage

Switches Animations must be specified in your Cartfile in order to be included in your Xcode project using Carthage:

github "jwd-ali/Switch-Animations"

Manually

If you prefer not to use a dependency manager, you can integrate Switches Animations into your project manually.

  • Include the Sources folder in your project.

Integration

See the Demo Xcode project its easy to understand with proper comments on properties .

Download

switch animations

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *