Skip to content

Instantly share code, notes, and snippets.

@PiersonBro
Last active August 29, 2015 14:06
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 PiersonBro/26e0ee63569d31fdc157 to your computer and use it in GitHub Desktop.
Save PiersonBro/26e0ee63569d31fdc157 to your computer and use it in GitHub Desktop.
Opting Out Of 'Required' Initializers in Swift
import Foundation
import UIKit
class OptOut: UIView {
let magicConstant: Int
override init(frame: CGRect) {
magicConstant = 0
super.init(frame: frame)
}
required init(coder aDecoder: NSCoder) {
fatalError("Calling an Unsupported Intializer.")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment