Last active
December 4, 2018 17:56
-
-
Save juliancadi/4533b689fba07cb250d9fd4902a99e8f to your computer and use it in GitHub Desktop.
Nibless UIView in favor of initializer dependency injection.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
open class NiblessView: UIView { | |
public override init(frame: CGRect) { | |
super.init(frame: frame) | |
} | |
@available(*, unavailable, | |
message: "Loading this view from a nib is unsupported in favor of initializer dependency injection." | |
) | |
public required init?(coder aDecoder: NSCoder) { | |
fatalError("Loading this view from a nib is unsupported in favor of initializer dependency injection.") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment