Skip to content

Instantly share code, notes, and snippets.

@romainmenke
Created September 19, 2015 14:39
Show Gist options
  • Save romainmenke/c785a6c2defcb6714439 to your computer and use it in GitHub Desktop.
Save romainmenke/c785a6c2defcb6714439 to your computer and use it in GitHub Desktop.
import UIKit
var toggleSwitch = UISwitch()
var realFrame : CGRect?
let frame = toggleSwitch.frame
let bounds = toggleSwitch.bounds
let subViews = toggleSwitch.subviews
let internalView = subViews.first!
let internalSubViews = internalView.subviews
for i in 0..<internalSubViews.count {
guard let imageView = internalSubViews[i] as? UIImageView else {
continue
}
realFrame = imageView.frame
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment