Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (19 sloc) 454 Bytes
//
// UISwitchExtensions.swift
// SwifterSwift
//
// Created by Omar Albeik on 08/12/2016.
// Copyright © 2016 SwifterSwift
//
#if canImport(UIKit) && os(iOS)
import UIKit
// MARK: - Methods
public extension UISwitch {
/// SwifterSwift: Toggle a UISwitch
///
/// - Parameter animated: set true to animate the change (default is true)
func toggle(animated: Bool = true) {
setOn(!isOn, animated: animated)
}
}
#endif
You can’t perform that action at this time.