In the previous instalment of of this mini-series I detailed how to make Monogame work on Android purely in F#. In this installment I tackle iOS. I’m going to assume you already have Xamarin Studio, the F# iOS templates and Monogame installed, as well as a valid iOS Developer licence.
Monogame on iOS in F# is actually trivial.
Go to new Project, select F#, select the target device (iPhone, iPad or Universal). Select Single View Application. Add references to MonoGame.Framework.dll and Lindgren.Network.dll for iOS.
Delete the *ViewController.fs file.
In AppDelegate.fs add the Game class definition from the previous 2 tutorials
type Game() as game = inherit Microsoft.Xna.Framework.Game() let manager = new Microsoft.Xna.Framework.GraphicsDeviceManager(game) override __.Draw _ = game.GraphicsDevice.Clear Microsoft.Xna.Framework.Color.CornflowerBlue
and replace the FinishedLaunching member with the following
override this.FinishedLaunching (app, options) = let game = new Game() game.Run() true
Hey presto – the code should run fine. In fact running on iOS is easier than MacOS and Android.
Next time I’ll quickly cover a neat way to build content for Windows, Mac, Android and iOS easily. The pre-requisites are a valid XNA SDK install (which itself has a pre-requisite of VS2010).
Pingback: F# Weekly #31 2013 | Sergey Tihon's Blog
Pingback: Xamarin Link Roundup – 6 Aug 2013 | Well Technically…
Pingback: F# and Monogame Part 4 – Content Pipeline | Neil Danson's Blog
Pingback: F# on Android