EZSwiftExtensions/Sources/UISwitchExtensions.swift

22 lines
313 B
Swift

//
// UISwitchExtensions.swift
// EZSwiftExtensions
//
// Created by Goktug Yilmaz on 4/22/16.
// Copyright © 2016 Goktug Yilmaz. All rights reserved.
//
#if os(iOS)
import UIKit
extension UISwitch {
/// EZSE: toggles Switch
public func toggle() {
self.setOn(!self.isOn, animated: true)
}
}
#endif