Social Media
GitHub
Navigation
Powered by Squarespace

Entries in iOS (11)

Saturday
Jul212012

Finding relevant WWDC videos

As I've said before, I find the WWDC videos to be invaluable and I try watch all of them eventually. But there are a lot of them, and it can be hard to find what's relevant. And a lot of them I go back and watch again when I start working with a different part of a project.

So I've developed a trick, and I thought I'd share it with you all.

I go to the site where the videos are hosted and click on the "view all in iTunes button". From iTunes, I download all the slides (Click a track like "Essentials", then click "Slides" just above the list, and then click the "Get Tracks" button in the header).

I keep all the slides for WWDC 2010, 2011 and 2012 in subdirectories of a folder named "WWDC slides" in my Documents directory. It's indexed by Spotlight on my Mac.

From then on, when I'm working on a project, and I'm having trouble with something, or trying to remember something I might have seen, I open up that folder in Finder, and type the Class or Method names of the Classes I'm working with, and Spotlight will tell me the session names of the videos I might want to watch.

So, for example, if I type 'NSFetchRequest', the first result is "Session 214 - Core Data Best Practices" from WWDC2012. I type 'registerNib:', and I get "Session 125 - UITableView Changes, Tips, Tricks" from WWDC2011 (among others).

Then I just go to iTunes or the website, and I know which video to go watch.

It's a handy trick (and I use it to search through all my eBooks on programming, as well), and when I've recommended specific videos to people, I've had several of them ask me how I keep the videos straight.

So hopefully it's useful to some of you.

Saturday
Jul072012

New Work In Progress - Million Words: Multiplayer Crossword Game for Parents and Kids that Grades on a Curve

Although I do iOS Contracting to pay my bills (at least to date), I hope one day to earn a living from my own apps, and, although it's not ready for release, the time has come to unveil my new project.

GamePlay ExampleMillion Words is a turn-based crossword game where you're scored not by what letters you managed to get into your word, but by the grade level of your word, relative to your age. This way my six-year-old daughter could play "HELLO" and I could play "HELICOPTER" and we would get the same number of points (more or less).

The Problem

When I got my retina iPad, my iPad 2 became my wife's iPad, and my first generation iPad got freed up for my six-year-old (when I'm not using it to test how my code runs on old hardware). I erased the data and gave it to her so she could set it up as "hers". Being six, she uses it primarily to play games, and I was frustrated to notice that those games fell into two categories:

  • Educational Games, whose content she would exhaust in short order and lose interest in, and
  • Fun, Endless games that she could play over and over, but that had limited educational value (think PopCap).

So I started trying to think of what kind of game would keep her interest and teach her something, and thought that, like the console First Person Shooters, a multiplayer game might keep her interested, and I thought it would be fun to play a turn-based game with my daughter while I'm stuck at work. But I couldn't find one, so I decided I'd make one.

My Attempted Solution

So a turn-based crossword game seemed a natural fit (remember, I want it to be educational, and spelling is a place she (and I think most kids in the SMS-generation) could use some practice). But the existing ones don't work well for younger kids. First of all, they get crushed by the bigger words that parents can spell. Secondly, they get frustrated when they have a pile of letters that don't spell a word (and don't we all).

I licensed educational word lists from an American University for the content (American English only so far, but I might do UK/Australia as well if I can find a source). This also has the benefit of excluding those stupid 2-letter and 3-letter so-called "words" that people memorize just to play in word games and never use in conversation or composition.

So I decided the game would give you an adjusted score based on the grade-level of the word and your age. And I decided that (at least for kids) the game would make sure that there was at least one word at your level that could be spelled with the letters you were given (which can be done in a computer game, but not with letter tiles in a bag). That also makes it possible to make a "hint" system, so it can keep them from getting stuck (and maybe even teach them new words).

Board Became Too UnbalancedOf course, that creates a problem that I can't end the game when the "bag of letters" is empty - because there isn't one. So I came up with a different way: I'm hooking the letters to a Physics Engine and letting gravity end the game.

There are two cool things about this (aside from the visuals): First, if you intentionally play words that connect other words (which is an additional level of difficulty), then you can keep the board "stable" and play longer. Second, it enables an interesting "Solitaire" variant, where you are playing by yourself, just trying to see how large a board you can construct before it crashes. And, just maybe, it's an interesting enough aspect that adults might like to play against each other, as well.Board Where Words Interlock

The possibilities

And there are lots of other things I have on the drawing board: letting parents put their children's current spelling lists in the game, using the iOS5 dictionary to make "suggestions" when words are misspelled and to show the definitions of words.

And the most interesting possibility, I got from the name. My six-year-old told me I should call it "A Million Words" because it sounded cool to her. I told her the game didn't have that many words in it, but she insisted. And, honestly, I haven't thought of a name I like better (and I've tried, believe me). So I decided to take the other perspective and try to figure out what I could do to make the game fit the name. And what I decided was that I was going to track, on the website, the total number of words spelled by all the players of the game, and have a countdown to when A Million Words had been spelled, aggregate, in-game. And once that milestone was reached (as it hopefully will be), then the countdown would start being broken down by demographics: which age group would reach a Million Words spelled first: the kids or the adults? I think if I do that right, it could be an interesting marketing opportunity.

The future

VINES ThemeSo, obviously, I'm not done, yet. I hope to be done by the holidays this year, but we'll see what happens. I still have a lot to do:

  1. Game balancing - getting the scoring right so different ages are competitive

  2. Monetization - I think now I want to make it Freemium and sell themed and power-ups like Temple Run, but I want to avoid the Smurfberry Fiasco

  3. In-game chat and Matchmaking - How do I allow that within a family, but don't let strangers chat with your kids.

And to get all that right, I'm going to need play testers of all different ages, and that means people have to know about the game. And I'm far more worried about the game launching to obscurity than the idea being stolen. So I decided to unveil the game and start talking about it.

TL;DR (In Conclusion)

I'm writing a crossword game where people of different educational levels can compete on a level playing field (so to speak). I'm hoping it will be done late this year, and I'm trying to validate that it's the kind of game people might want to play. I hope that, if you're interested, you'll Sign up for the mailing list.

Saturday
Oct292011

HTTP Testing to the edge on iOS: The School of Hard Mocks

I'm a big fan of Automated Testing, even on iOS projects, but even when I was doing mostly Ruby, Java and C# work, I was never a big user of mock objects.

Now, I'll admit that Mock objects can be useful under some circumstances, but I've seen them used too often in cases where a bunch of different developers each build their own little fiefdoms of their own code surrounded by Mock Objects where they interact with anything else. Each developer's code runs perfectly when being tested against Mock input, but when you put all that code together, you can't get a transaction working end-to-end, because the real world doesn't obey the assumptions inherent in the Mocks.

So the Automated tests I write have more of a tendency to be more like what are called "Integration Tests", even though I use "Unit Testing Frameworks" to write them.

When you combine that with the fact that I write a lot of iOS apps that talk to web servers, I want a way to test how my code talks to HTTP. And I want to know that my code handles things even when any library I happen to be using hands me errors to deal with.

When I first solved this problem years ago, we were using the Google Toolbox for Mac as our unit test framework, because SenTest didn't work well back then. So, at the time, I built a solution based on GTM, but I went recently to try to recreate that solution for a new customer, and I realized that the files I had used had been deleted from GTM.

So I went spelunking back in the history of GTM, and pulled out the last version of the the files I needed before they were removed, and put them up on github in a new repository I'm calling SyntheticServerTest.

The way you use it is to look at the example test file.

You just have to run:

[testServer startServerWithDocumentRoot:]

With a document root directory that contains web content (I usually use 'curl -O' to pull known pages (either good or errors) from the server and write them to that directory), and have a mechanism so, that, while your test is running, the host part of the URL gets replaced with

@"localhost:%d",[testServer port]

and the test HTTP server, running in the background (in the simulator or on the device), will get the HTTP request and hand you back the test data file in response.

This way, you can test your App's entire HTTP stack, including any parsing libraries you may be using, with both real data (that doesn't require you to be on line) and with bad data, to make sure you are correctly handling whatever errors your parsing or network library is throwing off.

Tuesday
May172011

How can you edit, build and install iPhone and iPad Apps without being near a Mac?

XCAB Intro 011 001

I'm going to walk you through the process that XCAB uses (These steps are taken from this SlideShow).

XCAB Intro 012 001

I have a refurb mini in my Living Room that I bought to be an Home Sharing server, and it’s more than up to the task.  I’ve run it on my laptop, too, from time to time.

As far as the iOS device, an iPad is obviously better to use for editing, because of the screen real estate, but the process is the same for both.

XCAB Intro 013 001

I like Textastic for the iPad and Nebulous Notes on the iPhone, but you can use any Drop-box enabled editor that isn't locked to a particular folder in your Dropbox (and hopefully for your sake has a fixed-width font).

XCAB Intro 014 001

The way you make your changes is pretty specific, see this demo video for an example.

XCAB Intro 015 001

When XCAB notices the changes show up in Dropbox, it checks them into a Git repository.  In theory, it could use Subversion or Mercurial, but I prefer Git, so that's what got implemented first.

XCAB Intro 016 001

The script looks for new git commits and builds new ones that it finds.  Note that this can also allow you to get notifications of new builds of an existing branch of an existing project that you didn't make.

XCAB Intro 017 001

iOS-Beta-Builder is used to generate a web page that will allow an over-the-air install on an iOS device.

XCAB Intro 018 001

It copies the web pages and the ipa into your Dropbox public folder.

XCAB Intro 019 001

It sends you a Boxcar notification with the URL you can click on to install the newly-built app.

XCAB Intro 020 001

Safari hands off to the OS to do the install.

XCAB Intro 021 001

And you're done.  Feel free to lather, rinse and repeat.

 

Monday
May162011

Video Demo: How to program an iPad by using an iPad, no jailbreak required

Here's a video I put together to demonstrate how to use the code that I wrote that I blogged about last week to program an iPad with an iPad, without having to lug your laptop around with you (or jailbreak your device):

Please excuse the fuzziness, I recorded it from my iPad 2 using a setup that converted it to a Standard Definition Analog TV signal along the way. Hopefully, it is close enough that you can get the idea of how it works.