iOS 8, Scene Kit @ 60FPS, programmed in F#, using Xamarin.iOS

I have the best job in the world:

[code lang="fsharp"]
namespace SceneKitFSharp

open System
open MonoTouch.UIKit
open MonoTouch.Foundation
open MonoTouch.SceneKit
open MonoTouch.CoreAnimation

type MySceneKitController () =
inherit UIViewController()

override this.ViewDidLoad () =
let scene = new SCNScene ()

//Positions everyone!
let boxNode = new SCNNode ()
boxNode.Geometry \<- new SCNBox(
Width = 1 …

more ...

Using Xamarin.Forms.Maps: You have to Init() first!

The first time I wrote a Xamarin.Forms.Maps program, I couldn't figure out why my map wasn't appearing. And then I put a call to Xamarin.FormsMaps.Init() into the AppDelegate (iOS) and MainActivity (Android):

Shared:

[code lang="csharp"]
public class App
{
public static Page GetMainPage ()
{
return new ContentPage …

more ...

Reviewing Values for iOS UIViewContentMode with Xamarin and F#

Who can remember the scaling behavior of UIView.ContentMode? Not me!

So I wrote this quick little F# program to review them:

[code lang="fsharp"]
namespace Simple

open System
open MonoTouch.UIKit
open MonoTouch.Foundation
open System.Drawing

type ContentView ( color : UIColor ) as self =
inherit UIView ()
do
self.BackgroundColor \< - color …

more ...

Review of my Xamarin F# Event Code Leads To Improvements

Not at all surprisingly, it turns out that F# events need not be the crufty structures I showed in my previous post.

First, Xamarin's David Siegel suggested "Let the Event type be inferred, don't define a delegate type, and send simple typed values rather than EventArgs:"

open System

type Control …

more ...

Review of my first real F# program written in Xamarin

tl;dr: F# has a long learning curve (it takes a long time to master) but productivity happens quickly.


I recently wrote my first real application in F#. Although I've been using F# for many of my scripting needs for about a year and use F# to explore iOS APIs …

more ...

F# iOS Program: 39 lines of code

Xamarin loves F#!

fsharp_too

Of course you can use F# to program iOS and Android applications using Xamarin and Visual Studio!

[code lang="fsharp"]
namespace Simple

open System
open MonoTouch.UIKit
open MonoTouch.Foundation
open System.Drawing

type ContentView ( color : UIColor ) as self =
inherit UIView ()
do
self.BackgroundColor \< - color

type SimpleController …

more ...

Cheatsheet for iOS 7 Design Sizes

Helpful: http://ivomynttinen.com/blog/the-ios-7-design-cheat-sheet/

more ...

Natively Recognize Barcodes/QR Codes in iOS 7 with Xamarin.iOS

There have been great barcode-reading libraries available for Xamarin for some time, but iOS 7 has built-in barcode-recognition support.

There's only one tricky bit: you have to tell the AVCaptureMetadataOutput what types of barcodes you're interested in after you've added it to the AVCaptureSession. (I suppose what happens behind the …

more ...

My Favorite iOS 7 APIs Part 3 : CoreMotion (iPhone 5S only)

The new M7 coprocessor in the iPhone 5S makes pedometer apps trivial:

[code lang="csharp"]
if(CMStepCounter.IsStepCountingAvailable)
{
var counter = new CMStepCounter();
//Last 8 hours
counter.QueryStepCount(NSDate.FromTimeIntervalSinceNow(-8 * 60 * 60), NSDate.Now, NSOperationQueue.CurrentQueue, StepQueryHandler);
}

void StepQueryHandler(int nssteps, NSError error)
{
Console.WriteLine(nssteps);
}
[/code]

more ...

My Favorite iOS 7 APIs: Multipeer Connectivity

Multipeer Connectivity allows you to discover and share data with other iOS devices within Bluetooth radio range or on the same WiFi subnet. It is much easier to use than Bonjour.

I wrote a simple MPC chat program in Xamarin.iOS.

There's necessarily a few hundred lines of code, but …

more ...