Skip to content

Instantly share code, notes, and snippets.

@juliancadi
Last active December 4, 2018 17:56
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 juliancadi/4533b689fba07cb250d9fd4902a99e8f to your computer and use it in GitHub Desktop.
Save juliancadi/4533b689fba07cb250d9fd4902a99e8f to your computer and use it in GitHub Desktop.
Nibless UIView in favor of initializer dependency injection.
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