6 May 2013

Create Your Own Level Editor: Part 1/3

Hungry Crocodile waiting for food

Don’t keep your crocodile waiting — start designing some levels to feed him!

This is a blog post by iOS Tutorial Team member Barbara Reichart who is currently doing her PhD at TUM, where she teaches software engineering and iOS development. In her free time she develops games (Treeo Games). Her first published game is Tw!nkle. You can also follow her on Google+.

In this tutorial, you’ll learn how to make a level editor for the Cut the Rope clone that was previously covered on this site.

Using the level editor you can easily make new levels. All you have to do is drag and drop the ropes and pineapples to where you like them.

What is cool about this level editor is that it is build into the game, so players can create their own levels directly on their device.

Although a level editor can be incredibly fun for the end-user, it’s also pretty handy for the game developer to quickly assemble levels instead of hand-coding them.

An added benefit is that a level editor allows you to test-drive your game concepts. This can be especially important for physics games like Cut the Rope, as sometimes it can be hard to predict the behavior of the physics engine, but very easy to test those behaviors in real-time.

A level editor is a great way to increase the longevity and utility of your game by providing your players with the power to create their own levels — and even share their creations with other game fanatics.

In this tutorial, you will create a level editor for the Cut the Verlet game that was previously covered on this site. Didn’t catch the game creation tutorial the first time around? You can read about the game implementation in the tutorials below:

Keep reading!

3 May 2013

AVFoundation Tutorial: Adding Overlays and Animations to Videos

How to Add Borders,Overlays and Animations To Videos in iOS<br />

How to Add Borders,Overlays and Animations To Videos in iOS

This is a blog post by iOS Tutorial Team member Abdul Azeem, senior software architect and co-founder at Datainvent Systems, a software development and IT services company.

The preceding AVFoundation tutorial in this series, How to Play, Record, and Edit Videos in iOS received some great response from readers. In fact, most readers wanted even more tips on advanced editing features that could add that extra touch of polish to their videos.

This follow-up AVFoundation tutorial is full of fresh new tricks to add some cool and professional effects to your videos.

The first AVFoundation tutorial showed you how to:

  • Select and play a video from the media library.
  • Record and save a video to the media library.
  • Merge multiple videos together into a combined video, complete with a custom soundtrack!

This new AVFoundation tutorial will build upon that by teaching all you budding video editors how to add the following effects to your videos:

  • Colored borders with custom sizes.
  • Multiple overlays.
  • Text for subtitles or captions.
  • Tilt effects.
  • Twinkle, rotate, and fade animation effects!

To get the most out of this tutorial, you will need to have some knowledge of the AVFoundation video rendering concepts described in the previous tutorial such as AVAsset and AVComposition. If you need to brush up on these topics, check out the previous tutorial before continuing. You could also refer to the Apple documentation for even more detailed information on the subject.

Ready? Lights, Camera… Action! :] Keep reading!

2 May 2013

Background Modes in iOS Tutorial

Learn how to make your app do stuff even when it is no longer active

Learn how to make your app do stuff even when it is no longer active

This is a blog post by iOS Tutorial Team member Gustavo Ambrozio, a software engineer with over 20 years experience, including over three years of iOS experience. He is now a happy senior software engineer for PocketGems coding mobile games. You can also find him on .

Beginning with iOS 4, you can design your apps to stay suspended in memory when users push the home button. Even though the app is in memory, its operations are paused until the user starts it again. Or are they?

Of course there are exceptions to this rule! In certain situations, the app can still run some operations in the background. This tutorial will teach you how and when to use (almost) all of these background operations.

There are important restrictions on the use of background operations. This is not a magic solution for getting “real” multitasking on iOS. Most apps will still get completely suspended when the user switches to another app. Your app is only allowed to keep running in the background in very specific cases — playing audio, getting location updates, downloading new issues for Newsstand apps, and handling VoIP calls.

If your app does not need to do any of these things, then you’re out of luck… with one exception: all apps get up to 10 minutes to finish whatever they were doing before the app is truly suspended.

So backgrounding may not be for you. But if it is, keep reading!

As you’ll soon learn, there are five basic background modes available to you in iOS. The project you’ll build in this tutorial is a simple tabbed application where each tab demonstrates the backgrounding abilities of one of the modes – from continuously playing audio to listening for incoming voice-over-IP connections.

Let’s get started!

Keep reading!

1 May 2013

Objectively Speaking 2: A Crash Course in Objective-C for iOS 6

This is the 2nd post by iOS Tutorial Team Member Linda Burke, an indie iOS developer and the founder of canApps.

Driving test

If you are a software developer skilled in another platform, but want to start learning iPhone development (and hence Objective-C) – this is the tutorial series for you!

This tutorial picks up where the first Objective-C tutorial left off. Now that you’re feeling the need for speed, it’s time to head out on a road trip and test your new-found skills!

This tutorial will take you on an Objective-C excursion to see some new sights, travel down some winding roads, and put the pedal to the metal while learning some great new concepts.

In this Objective-C tutorial, you will create a simple movie quotes quiz app. Along the way, you’ll become acquainted with a number of aspects of Objective-C, including:

  • mutable arrays
  • property lists
  • classes
  • methods
  • @property
  • protocols and delegates
  • additional string functions
  • and much more!

Warning: iPhone development with Objective-C can be highly addictive! Don’t be surprised to find yourself burning the midnight oil while a nice stack of dishes piles up in the kitchen! :] Keep reading!

Tags: , , ,

25 April 2013

Trigonometry for Game Programming: Part 2/2

Learn Trigonometry for Game Programming!

This is a post by iOS Tutorial Team member Matthijs Hollemans, an experienced iOS developer and designer. You can find him on and Twitter.

Welcome back to the Trigonometry for Game Programming series!

In the first part of the series, you learned the basics of trigonometry and experienced for yourself how useful it is for making games. You saw that math doesn’t have to be boring – as long as you have a fun project to apply it to, such as making your own games.

Oh yes, and you built the foundation for a solid little space shooter game!

In this second and final part of the series, you will add missiles, an orbiting asteroid shield and an animated “game over” screen to your game. Along the way, you’ll learn more about sine and cosine and see some other useful ways to put the power of trig to work in your games.

Get ready to ride the sine wave back into space! Keep reading!

Tags: , , , , ,

24 April 2013

Trigonometry for Game Programming: Part 1/2

Learn Trigonometry for game programming!

This is a post by iOS Tutorial Team member Matthijs Hollemans, an experienced iOS developer and designer. You can find him on and Twitter.

Does the thought of doing mathematics give you cold sweats? Are you ready to give up on your career as a budding game developer because the math just doesn’t make any sense to you?

Don’t fret – math can be fun, and this cool 2-part game tutorial will back up that claim!

Here’s a little secret: as an app developer, you don’t really need to know a lot of math. If you can add or multiply two numbers together, you’re already halfway there. Most of the computations that we do in our professional lives don’t go much beyond basic arithmetic.

That said, for making games it is useful to have a few more math skills in your toolbox. You don’t need to become as smart as Archimedes or Einstein, but a basic understanding of trigonometry, combined with some common sense, will take you a long way.

In this tutorial, you will learn about some important trigonometric functions and how you can use them in your games. Then you’ll get some practice applying the theories by developing a simple spaces shooter iPhone game that requires a lot of trigonometry, using the Cocos2D game framework.

Don’t worry if you’ve never used Cocos2D before or are going to use a different framework for your game – the mathematics we’ll cover in this tutorial will apply to your engine no matter what. And you don’t need any prior experience, as I’ll walk through the process step-by-step.

If you supply the common sense, this tutorial will get you up to speed on the trig, so let’s get started!

Keep reading!

Tags: , , , , ,

22 April 2013

PhoneGap Tutorial: A Cross-Platform Zombie App

Learn how to create a to-do app to survive the zombie apocalypse in this PhoneGap tutorial!

Learn how to create a to-do app to survive the zombie apocalypse in this PhoneGap tutorial!

This is a post by iOS Tutorial Team Member Dani Arnaout, a Computer Engineering Undergraduate at BAU,Lebanon. Dani has a YouTube channel full of programming & iOS related videos.

PhoneGap is a mobile development framework that allows developers to build applications for a variety of mobile platforms, using familiar web technologies such as HTML, CSS, and JavaScript.

The concept is that you can develop one application using the PhoneGap architecture, and then deploy to multiple mobile platforms — without the need to re-write any code!

In this tutorial, you’ll learn the basics of using PhoneGap to make a simple to-do app, with a twist – it’s an app to help you survive the Zombie Apocalypse!

In the process, you’ll learn a ton about PhoneGap – such as installing PhoneGap, writing Javascript code, using local storage, and much more.

This tutorial assumes you have some basic familiarity with HTML, CSS, and Javascript. If you are new to these technologies you can still follow along with the tutorial, but you’ll be missing some background knowledge, so I recommend you read a book on those when you get a chance.

So if you think you have the brains, keep reading to get started – the zombies are waiting! Keep reading!

Tags: , ,

21 April 2013

Readers’ App Reviews – April 2013

More great apps by fellow readers!

More great apps by fellow readers!

This is a post by Reader’s Apps Reviewer Ryan Poolos, an iOS Developer and founder of Frozen Fire Studios. Check out his latest project, iHelp.

Just because Apple didn’t announce anything this month, that didn’t stop you guys! There were a ton of apps submitted this month.

This month we’ve got:

  • A bird that lost his girlfriend
  • Ninjas with rocket launchers
  • An app to help you with your guitar lessons
  • A dog approved baseball game (woof!)
  • And much more!

Keep reading for some app reviews for awesome apps made by your fellow readers! Keep reading!

Tags:

20 April 2013

Arduino Tutorial for Complete Beginners: Using a Button

Learn how to work with buttons - the real kind!

Learn how to work with buttons – the real kind!

Evan Stoddard is a high school student that enjoys iOS development in his spare time. Tweet at him or check out his .

Imagine your alarm goes off, and due to a late night you hit the snooze button and get right back to sleep. You realize you’re late for work so you punch a few buttons on your phone to call your boss to tell him a story about how you got a flat tire. You quickly start your car with the remote starter and set the alarm for the house.

I bet some of you have been in a scenario like that once or twice, but you probably weren’t thinking about an invention that you were using that changed the technology industry: the button!

A button is simply a device you can press to connect two pieces of metal together, allowing a current to pass. It’s extremely handy for all sorts of applications.

This tutorial is for those who want to learn more about how electronics (like buttons) work. You’ll use an open-source micro-controller called the Arduino to make a LED light turn on and off.

This tutorial is for complete beginners to Arduino development, but it also goes well with Dani Arnaout’s tutorial if you’ve already gone through that one.

OK, so keep scrolling that mouse button to get started! Keep reading!

Tags: , ,

Core Graphics Tutorial: Curves and Layers

Working with Core Graphics Need Not Be So Rage Producing

Working with Core Graphics Need Not Be So Rage Producing

This is a blog post by Brian Moakley, who is not only an iOS developer and fiction writer, but also holds the honor of being Razeware’s first fulltime employee. You can find him on and Twitter.

Welcome back to our Core Graphics tutorial series! In this series, you’ll learn how to get started with Core Graphics – with practical examples.

In tutorials one, two, and three, you learned how to customize a table view from start to finish – just with Core Graphics.

In tutorial four, you learned how to make a custom glossy UIButton with Core Graphics.

In tutorial five, you learned how to create repeating patterns with very few lines of code.

In this tutorial, you will learn the Core Graphics drawing model and how it dictates the order in the order that you draw your shapes.

You’ll also learn how to draw Quadratic and Bezier curves as well as applying transforms to existing shapes.

Finally, you’ll use Core Graphics layers to clone your drawings with the ease and style of a James Bond super-villian. :]

There’s a lot to cover, so make yourself comfortable, crack those knuckles, and fire up Xcode. It’s time to do some drawing. Keep reading!

Tags: , , , , , , ,

19 April 2013

Core Graphics Tutorial: Patterns

Create a cool grip pattern effect with Core Graphics!

Create a cool grip pattern effect with Core Graphics!

Update 4/19/2013 Fully updated for Xcode 4.6, and ARC. (original post by Ray Wenderlich, update by Brian Moakley).

Welcome back to another tutorial in our Core Graphics tutorial series! This tutorial series covers how to get started with Core Graphics – with practical examples.

In tutorials one, two, and three, you learned how to customize a table view from start to finish – just with Core Graphics.

In tutorial four, you learned how to make a custom glossy UIButton, just with Core Graphics.

In this Core Graphics tutorial, you’re going to learn how to recreate a “grip” background pattern that is popular in many apps today. You know you’ve seen it out there – and you must admit, it looks pretty cool!

Along the way, you’ll reinforce some of the concepts you’ve already learned about drawing arcs and shadows, and you’ll learn how to use the built-in pattern drawing capabilities of Core Graphics.

So grip your keyboard and let’s get started! Keep reading!

Tags: , , , , ,

18 April 2013

Core Graphics Tutorial: Glossy Buttons

Create your own cool and flexible buttons from scratch!

Create your own cool and flexible buttons from scratch!

Update 4/18/2013 Fully updated for Xcode 4.6, and ARC. (original post by Ray Wenderlich, update by Brian Moakley).

Welcome back to another tutorial in the Core Graphics tutorial series! In this tutorial series, you learn how to get started with Core Graphics – with practical examples.

In tutorials one, two, and three, you learned how to customize a table view from start to finish – just with Core Graphics.

In this Core Graphics tutorial, you’re going to tackle a different practical example – how to customize a UIButton.

In the process, you’ll learn how to draw rounded rects, how to easily tint your Core Graphics drawings, and reinforce some of the concepts you’ve already covered.

As Alex Curylo from Under The Bridge has mentioned many times, there are a lot of good options out there for how to customize your UIButtons already. My personal favorite for quick and easy button making is Button Maker by Dermot Daly, by the way.

But I think what’s been missing in this discussion is a detailed Core Graphics tutorial for how to customize the buttons yourself, from start to finish. It’s pretty simple, and this way you can get the exact look you’re going for in your app.

So let’s get started and make some buttons! Keep reading!

Tags: , , , , ,

17 April 2013

Core Graphics Tutorial: Arcs and Paths

Drawing Arcs, Oh My!

Drawing Arcs, Oh My!

Update 4/17/2013 Fully updated for Xcode 4.6, and ARC. (original post by Ray Wenderlich, update by Brian Moakley).

This is the third part of a tutorial series covering how to get started with the Core Graphics API – via practical examples!

In the first part of the series, you learned how to draw lines, rectangles, gradients – via making pretty table view cell backgrounds.

In the second part of the series, you learned how to draw shadows and gloss effects – via making a pretty table view cell header.

In this article, you’ll finally finish up your table view by adding the footer, and adding some finishing touches. You’ll also learn about drawing arcs and working more with clipping and paths along the way!

If you don’t have it already, grab a copy of the sample project where you left off in the last Core Graphics tutorial. Keep reading!

Tags: , , , , ,

16 April 2013

Core Graphics Tutorial: Shadows and Gloss

Custom draw the header of this table!

Custom draw the header of this table!

Update 4/16/2013 Fully updated for Xcode 4.6, and ARC. (original post by Ray Wenderlich, update by Brian Moakley).

This is the second part of a tutorial series covering how to get started with the Core Graphics API – via practical examples!

The first part of the series covered how to draw lines, rectangles, gradients – via making pretty table view cell backgrounds.

In this article, you’ll move on to customizing the header for the table. Along the way, you’ll solidify some of your existing knowledge, and learn how to draw shadows and gloss effects!

If you don’t have it already, grab a copy of the sample project from that last Core Graphics tutorial. Keep reading!

Tags: , , , , ,