-
Notifications
You must be signed in to change notification settings - Fork 8
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
"let scene" and "let transition" raise a warning #1
Comments
Hi Sonoblaise, I believe you may be talking about the method called loadScene() that is added to the MenuScene, GameScene and GameOverScene classes near the end of the class. Both "scene" and "transition" are used in the next line of the method that tells the view to present the scene like this. self.view?.presentScene(scene, transition: transition) I double checked the book to make sure that is there. Below is an example of the complete method loadScene() as it would appear in MenuScene. private func loadScene() {
let scene = GameScene(size: kViewSize)
let transition = SKTransition.fade(with: SKColor.black, duration: 0.5)
self.view?.presentScene(scene, transition: transition)
} Let me know if you still have questions or if that wasn't clear in the book so I can update it. Thanks! |
I just realized, when writing the second loadScene() function that the I think I'm just not used to have an IDE that is so responsive. And I've Sorry for bothering you! On Thursday, 22 September 2016, Jeremy Novak [email protected]
Blaise Bernier - Soundman FOH/Mon, PA Tech514-358-3481 |
No worries :) Yes, the LLVM compiler (compiler in Xcode) is pretty quick on the draw as you type with errors and warnings. Hopefully you'll be used to it soon. Glad it is working for you. |
Found a piece of explanation that should be revised. Page 60, when you It just made me wonder where the mistake was. I usually read the code, Great work BTW! The book is well done so far. In a few spots I would have On Thursday, 22 September 2016, Jeremy Novak [email protected]
Blaise Bernier - Soundman FOH/Mon, PA Tech514-358-3481 |
Great point, I will make that more clear. Yes, it is taking a starting and ending CGFloat and returning a CGFloat just as you figured out. Glad you are enjoying the book, and really appreciate the feedback! |
I finally finished the whole thing, modified a few details to my own taste Page 104 :
barBackground.addChild(starsIcon) barBackground.addChild(starsLabel) // This should be here
Page 105 :
Page 107 :
Page 143 :
Page 149 :
Thanks again for the great work! Blaise Bernier - Mixer (FOH/Mon) - PA Tech - System Designer(514) 358-3481 [email protected]2016-09-26 18:37 GMT-04:00 Jeremy Novak [email protected]:
|
Appreciate you pointing those out. I'll get the book updated today with your errata. Thanks, and glad you enjoyed the book! |
Glad I could help! I'll probably start on the timberman book today too. On Thursday, 29 September 2016, Jeremy Novak [email protected]
Blaise Bernier - Soundman FOH/Mon, PA Tech514-358-3481 |
Oh, sadly I see that you are still updating it to swift 3! No rush! At On Thursday, 29 September 2016, Blaise Bernier [email protected] wrote:
Blaise Bernier - Soundman FOH/Mon, PA Tech514-358-3481 |
The Timberman book should be done in the next week, I'm a few chapters in right now. I updated this book with your errata, should be available to update from the store within the next few hours. Thanks again! |
You're welcome! I really got to like Swift because of your book. There is Looking forward to timberman! On Thursday, 29 September 2016, Jeremy Novak [email protected]
Blaise Bernier - Soundman FOH/Mon, PA Tech514-358-3481 |
During Chapter 2, when we set the scene and the transitions in the code, both lines raise a Warning telling us "Initialization of immutable value 'transition' was never used; consider replacing with assignment to _ or removing it.
Should we declare those constants in the class declaration without initializing them and instead of declaring inside a function only initialize them?
I'm new to swift, but I have a solid background in programming... rusty, but solid ;)
The text was updated successfully, but these errors were encountered: