fun-ny Faces : Face-based Augmented Reality with F# and the iPhone X

fun-ny Faces : Face-based Augmented Reality with F# and the iPhone X

Each year, the F# programming community creates an advent calendar of blog posts, coordinated by Sergey Tihon on his blog. This is my attempt to battle Impostor Syndrome and share something that might be of interest to the community …

more ...

Programmatic AutoLayout Constraints Basics for Xamarin

  1. Create element without an explicit Frame.
  2. Set TranslatesAutoresizingMaskIntroConstraints = false
  3. Create an array of NSLayoutConstraints
  4. Work top-to-bottom, left-to-right, or vice versa. Do this consistently throughout program
  5. Use Layout Anchors
  6. Use the top-level UIViews SafeAreaLayoutGuide to position relative to the Window / screen
  7. For each dimension, set its location (LeadingAnchor / TopAnchor or …
more ...

Debugging provisioning profiles on the command line

Raise your hand if you've ever struggled with getting your app's bundle identifier, info.plist, and entitlements.plist to match up with your provisioning profile.

I tried to explain provisioning profiles using the ten-hundred most common words, but in slightly-less-common words, a development prov-pro associates: A team, a developer, an …

more ...

Mysterious crashes in your iOS 10 program? Check your info.plist

If you're developing for iOS 10 and your app "silently" crashes (especially if it's an older app), the culprit could well be the increased privacy requirements in iOS 10. Namepaces such as HomeKit now require specific privacy-related keys to be in your info.plist (for instance, NSHomeKitUsageDescription). If you don't …

more ...

Streaming a Web video to AppleTV with Xamarin

If you have the URL of a streaming video, it's easy to display on an AppleTV, even though tvOS does not have a UIWebView (which would make it really easy). You have to use some AVFoundation code, such as:

[code lang="csharp"]
var src = NSUrl.FromString("https://somevideo");
var asset …

more ...

The Half-Baked Neural Net APIs of iOS 10

iOS 10 contains 2 sets of APIs relating to Artificial Neural Nets and Deep Learning, aka The New New Thing. Unfortunately, both APIs are bizarrely incomplete: they allow you to specify the topology of the neural net, but have no facility for training.

I say this is "bizarre" for two …

more ...

WWDC Remote Viewing Protips

I attended the 2015 WWDC and made these notes afterwards. Aside from the specifics re. the Apple Watch and AppleTV, they may be of value to those who are considering streaming sessions next week:

WWDC: Post-show Streaming is the Key to Value

From an editorial perspective, one thing that is …

more ...

Tracking Apple Pencil angles and pressure with Xamarin

Rumor has it that Apple will support the Apple Pencil in the forthcoming iPad. If so, more developers will want to use the new features of UITouch -- force, angle, and elevation -- supported by the incredibly-precise stylus.

Basically, it's trivial:

-- Force is UITouch.Force;
-- Angle is UITouch.GetAzimuthAngle(UIView); and
-- Angle …

more ...

Hair-Tearing-Out-Thing Explainer (Provisioning Profiles):

There is a company called Round Red Food. They make brain-phones and brain-watches and brain-televisions. These brain-things run brain-books written by Round Red Food. But Round Red Food also allows other people to write brain-books.

Round Red Food wants to control what brain-books run on their brain-things. To do this …

more ...

Animating the stroke color of a CAShapeLayer with Xamarin

I wanted to indicate the most recent move in an AI-on-AI game of TicTacToe, so I wanted to have the most recent move be highlighted. The Xs and Os are CAShapeLayer objects.

Here's the code to do it, ~~featuring a very ugly hack to cast an IntPtr to an NSObject …

more ...