Kodeco Forums

Learn To Code iOS Apps With Swift Tutorial 5: Making it Beautiful

In this fifth and final part of the series, you take the Tap Me game from the previous tutorial and make it look a little more visually appealing.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/1573-learn-to-code-ios-apps-with-swift-tutorial-5-making-it-beautiful

Having trouble with the Tap Me button. I don’t have a “Supporting Files” Folder. If I drag the resources folder onto the Document Outline, I am able to go through the steps as described to include the button png files to the background. This does not work when I run the simulator. The text only Tap Me shows, though the game does run. If I do delete that text as instructed, the simulator displays only a black screen. These are the instructions that are causing me difficulty without a Supporting Files folder…
“Then, you’ll want to download the Tap Me Resources, which is basically a collection of the images and sounds that you will need for this project. After you download it, you should open up the folder and select all of the items inside. Drag these items over to the Supporting Files folder in your Document Outline.”

Thank you so much for your tutorial.
I wonder if you can help me with how to make 3 or 4 separate audio buttons?
Thank you so much.

Unfortunately, that’s out of the scope of this tutorial. My suggestion, play around and fun and see what you can come up with.

Hello. I have been working on your tutorial but I am getting an error. I only have one sound currently, which is a clicking sound for when you tap the button.

When I run the code I get an error.

ERROR: 181: timed out after 0.012s (747 747); mMajorChangePending=0

Although I get the error I still hear the sound. I have copied the code exactly like it is in the tutorial, I just eliminated the sounds I don’t want.

What can be the problem?

I get the same error in 2D iOS & tvOS Games by Tutorial, Chapter 4 - Background music. The error is intermittent.

ZombieConga[20167:4408765] 13:49:06.221 ERROR: 181: timed out after 0.012s (2063 2064); mMajorChangePending=0

Any help/suggestions to avoid the error would be appreciated.

Whenever I add sound there is a delay when the sound if first played, after that it works fine. Is there a way around this delay when it first loads the sound?

actually, I was able to solve my own problem by adding

.prepareToPlay() before play() so it looked like

buttonPressed.prepareToPlay()
buttonPressed.play()

and it worked as expected

Click on File and "Add Files to “program name”. Choose your helper files and you should be good to go. Do the same for the sound files.