TVML tvOS 10

So there’s an updated TVML Catalog sample code project out.

Instead of having js files that make an XML file, it’s just a straight XML file now. Makes much more sense to me to have it this way.

TVML Catalog: Using TVML Templates
Another thing they’ve changed is they suggest using Ruby instead of Python.
ruby -run -ehttpd . -p9001

I think this might  be to get around the fact videos locally didn’t work with Python, I still need to test this.

In most of my previous files I was using template=”.xml.js” whereas now they use documentURL=”.xml” so one to check on.

I’ve also amended a couple of files to get video playback working, the documentcontroller.js was the place to add it.

A useful dub dub video to watch is the following.

WWDC 212 – Developing tvOS Apps Using TVMLKit: Part 1
The video/slides do cover a basic example:
// Setting up a TVMLKit JS Video Player
var video = new MediaItem(‘video’, ‘‘);
video.title = ‘My Great Movie’;
video.description = ‘An extensive description…’;
video.resumeTime = 10.0; // seconds
var playlist = new Playlist();
var player = new Player();
player.playlist = playlist;; // Present the player


The AudioVideo sample code hasn’t been updated yet and there isn’t an example of video playback in the above Catalog sample, the WWDC video was handy though. I like the embedded player in a lockup.

TVMLAudioVideo: Audio and Video Playback on tvOS
Check out the new MediaContent docs:


Using iTMSTransporter to upload Game Centre Achievements

I’m currently creating a game Movem, and I wanted to add some Game Center achievements. I’d done this before in another app I’m making for Kernowland Quizzes (still in development). There are only a couple of achievements there so wasn’t much hassle to create them manually but here I want 1 for each of the 50 levels. This would be a big pain to do.

So I turned to twitter and asked @KrauseFx as I thought he might know.

Researching a little I found the app should be in either Xcode or App Transporter. Some SO answers said it was under the MacOS folder but I found it to be now just under itms in the Contents folder.

/Applications/ bin

Now to find some information about the app itself, lets look to iTunesConnect Resources and Help under Apps.

Open the terminal and navigate to the above folder:

./iTMSTransporter -m diagnostic

Next we want to download the information we have on an app so we can use the lookupMetadata flag.

./iTMSTransporter -m lookupMetadata -u # -p # -apple_id # -subitemtype GameCenterAchievement -destination "#"

Replace the #s with your actual inputs.

This will download a file “AppleID.itmsp”, if you double click this it will open in Application Loader, you don’t want this, instead Right+Click and Show Package Contents:

Show Package Contents.png

There’s a file called “metadata.xml”, open this in your editor of choice, Xcode works fine since it’s just XML.

I’m interested in the Game Center info so scroll down:


Within here are a couple of achievements I’ve already created, from research errors can occur if you remove these and re-upload so either leave them in and only make additions to the file or remove them from iTunesConnect and run lookupMetadata again.

I needed at least one already created so I had a template to work with.

I created a playground as this would be the quickest way to create what I needed

for i in 1...50 {
    print(blah \(i))

Now I just needed to replace the number with \(i) in all the places necessary and show the console.

Copy and paste that back into the “metadata.xml” and I’m ready to upload.

First thing to do is verify the file.

./iTMSTransporter -m verify -f "#/[AppleId].itmsp" -u # -p #

Now I can upload.

./iTMSTransporter -m upload -f "#/[AppleId].itmsp" -u # -p #

There was one thing that was missing, the image file:

ERROR: The file Game_20Center_20Level.png is from the list of files requested by Apple, but it was not found locally.

To fix this I just renamed the file I’d uploaded in iTunesConnect to match the above and added it to the PackageContents folder and all was good.

I’d originally tried the “lookupMetadata” without the -subitemtype flag but got an error when trying to upload,

ERROR ITMS-10001: "Multiple items in this package use the same vendor ID. Use unique vendor IDs for the items [leaderboard, achievement] and resubmit the package." at Software/SoftwareMetadata
<main> DBG-X: The error code is: 1102


Learn more about Game Center in Chapters 25 and 26 of 2D iOS & tvOS Games by Tutorials from Ray Wenderlich.


What’s New in iTunes Connect

WWDC 2013 – Session 306 – iOS, OS X

Movem progress

I’ve made some progress on my movem game

Main Menu

Level select parsed from the plist

HUD updating with Moves, Pushes and Level

Movem Level Editor

I’ve been working a little more on my Movem port, and there are over 50 levels, so I thought I’d make a level editor, one to speed up creating the levels, one because it’s flipped using the code from boxxle and two because I could then create my own levels.

Screen Shot 2016-03-19 at 22.11.37.png

True I still need to create a sokoban solver to make sure

I used one to create a solution for another iOS game once:


I used the following as a starting block for my level builder:


Movem iOS game

So I found an implementation of an iOS Sokoban game

It’s a year old so my first step was to update it.

I ran the Xcode updater then got to the left over errors.

var isPaused: Bool = false

Touches Began

override func touchesBegan(touches: Set<UITouch>?, withEvent event: UIEvent?)
let touch = touches!.first


func checkForWin()
if ~isBoxOnGoal(box)
if !isBoxOnGoal(box)

I swapped out some images

Then i wanted to tile a background sprite

I found then I converted it


let digits = countElements(String(number))
let digits = String(number).characters.count


Apple Public Beta

Signed up for the Public beta, shouldn’t it be this easy for devs or am I just being lazy?

You install a certificate, which then requires a restart, really!
You’re advised to make a backup.

Archive an iOS backup with iTunes

Then you can install the update over the air (OTA), very simple.

It installs a nice Feedback app:



I’ve been looking into CloudKit today and it looks really good.

The website is slick. Very easy to use and nice destination between Dev and Prod

Just watched WWDC 2015 – Session 710 CloudKit JS and Web Services

Think this is what I’ll use for the bowling app.

Was looking into CoreData, already using FMDB, but syncing was an issue, do I store it in Dropbox. I needed to do more researching into CoreData and iCloud, this seems the better solution, plus I can sync to the Mac App I want to make and now make a website too.

There are other sessions

  • 715 – Tips and Tricks
  • 704 – What’s New in CloudKit


  • 208 – Introducing CloudKit
  • 231 – Advanced CloudKit