Skip to main content

Setting up

About 1 minSwiftiOSArticle(s)bloghackingwithswift.comcrashcourseswiftxcodeappstoreios

Setting up 관련

Hacking with iOS – learn to code iPhone and iPad apps with free Swift tutorials

Learn Swift coding for iOS with these free tutorials – learn Swift, iOS, and Xcode

Setting up | Hacking with iOS

Setting up

I don't want to put you off, but this is by far the longest project in the series. It's not the most complicated, but it's long, coming in just short of 500 lines in total. That said, I hope it'll be worth it, because the end result is great: we're going to make a Fruit Ninja-style game, where slicing penguins is good and slicing bombs is bad. I think I must unconsciously have something against penguins…

Anyway, in this project you're going to meet SKShapeNode and AVAudioPlayer, you're going to create SKAction groups, you're going to create shapes with UIBezierPath, and more. So, it's the usual recipe: make something cool, and learn at the same time.

This project is hard because you need to write a lot of code before you can start to see results, which I personally find frustrating. I much prefer it when I can write a few lines, see the result, write a few lines more, see the result again, and so on. That isn't possible here, so I suggest you make some coffee before you begin.

Still here? OK!

Create a new SpriteKit project in Xcode, name it Project23, then do the usual cleaning job to create a completely empty SpriteKit project: remove all the code from didMove(to:) and touchesBegan(), change the anchor point and size of GameScene.sks, and so on.

You should also download the files for this project from GitHub (twostraws/HackingWithSwift)open in new window, then copy its Content folder into your Xcode project.

Please force the app to run only on landscape iPads before continuing.

Reminder

Don’t forget to use a real device for this project, or, if you must, the lowest-spec iPad in the simulator.


이찬희 (MarkiiimarK)
Never Stop Learning.