Skip to content

Instantly share code, notes, and snippets.

@regnerjr
Created January 2, 2019 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save regnerjr/18c11cfbff4e423cec3b4cf0bf7b0ece to your computer and use it in GitHub Desktop.
Save regnerjr/18c11cfbff4e423cec3b4cf0bf7b0ece to your computer and use it in GitHub Desktop.
Exercise Ambiguous Views in Swift
+#if DEBUG
+extension UIView {
+ @available(*, deprecated, message: "This warning is here so you don't ship this code")
+ @objc func exerciseAmbiguityInLayoutRepeatedly() {
+ if self.hasAmbiguousLayout {
+ Timer.scheduledTimer(timeInterval: 0.5,
+ target: self,
+ selector: #selector(UIView.exerciseAmbiguityInLayout),
+ userInfo: nil,
+ repeats: true)
+ }
+ }
+}
+#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment