I’ve been through a lot of tech books and this scene kit is really new, as is swift to me. After going through each of your sections and following and copying the code I am still running into to problems. This is probably my biggest problem is in general with books / tutorials. If you follow the directions and still can’t get it right and are new to learning the “right way” it really can turn some one off immediately.
- I couldn’t get the diffused blue to show up no matter what I did to the scene when I build (moving off black screen)
- I added the new swift file for random geometry and when I build I get a fatal error.
I think its really important to have a complete new person to these concepts
go through each topic find the ways to break your samples. I’ve been able to break most software, and code.
I’m kinda stuck right now and not sure what to do.
I suspect the PDF is not good for copying and pasting anything as the line breaks get messed up. For good measure I went back in and typed everything out by hand again.
fatal error: unexpectedly found nil while unwrapping an Optional value
Thanks for your valuable input. You’re absolutely right, copying and pasting code from a PDF is not the best approach. We will give this some thought, to see if we can improve on this. Possibly including an additional resource file that includes all the code snippets into a single text file for your copy and pasting convenience? :]
Sorry to hear that you’re now stuck - what I suggest is to reference the Solution projects. Open up the solution project on the side, and instead of copying and pasting the code from the PDF, do so from the Solution project, maybe this somehow resolves your current issue, and you can at least continue.
Hope that helps. Thanks for your feedback and support.
I’ll give it a try here in a bit - I suggest is to maybe have a “gist” or git file for each of the sub-section code samples.
Any idea what they view would not show the diffused color?
About your idea of code snippets, please consider the following two:
- A playground
- Xcode snippets with specific names such as rwtut1chp1 or so
I know the snippets can be hard to make if you make them dynamic (dynamic variables inside the <# #>), but can be fast if simply drag/drop each section.
The easiest one would still be a full git project with a commit after each section/chapter, to allow moving easily in between.
Thanks for the hard work.
Let me guess, you are stuck on Chapter 15, adding in motion, correct? I have the same exact problem. Typing everything in exactly as I see it. I even pasted the entire swift file and it has not solved the issue. I am pulling my hair out trying to resolve this one as well… The solution works fine, but the code in the book does not. Going to take hours comparing the differences in the files to find the problem, and it may just exist in the scene editor, not the swift files.