-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add NS_DESIGNATED_INITIALIZER to ASViewController initWithNode: #1054
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty harmless. The migration pathway here is straightforward.
a451b34
to
c83c428
Compare
d10c2a2
to
d216bcc
Compare
By doing so, and initiating we can not use such initializer: init()
{
let displayNode = ASDisplayNode()
displayNode.backgroundColor = .backgroundColor
super.init(node: displayNode)
setup()
} |
@maicki can you please explain why you have changed the designated initializer? now in the whole project I should replace |
@hashemp206 Hey - what is your use case using an |
@maicki I'm encapsulating node creation in // MARK: Object lifecycle
override init(node: ASDisplayNode? = nil)
{
let displayNode = ASDisplayNode()
displayNode.backgroundColor = .backgroundColor
super.init(node: displayNode)
displayNode.addSubnode(collectionNode)
hidesBottomBarWhenPushed = true
setup()
} I prefer initiation with empty parameter than passing nil node, because I may forgot to pass nil node, and the init method won't called! I don't create node outside of ViewController and pass it to the ViewController. display node creation is part of ViewController responsibility. |
…ureGroup#1054) * Add NS_DESIGNATED_INITIALIZER to ASViewController initWithNode: * Add changelog
This may introduce an API change in the
ASViewController
and changes in client code is needed but I will put that up for now.