Ryan asked about how to extract the content from a pdf file, draw on it, and email it in iOS.

One way to do this is using Core Graphics, as shown in the following snippet:

If you have a question feel free to contact me through my blog. I get lots of questions like this, but I do my best to respond to them all.

]]>https://mikebluestein.com/2015/06/27/reader-qa-pdfs-in-ios/feed/1mikebluesteinLoad a Collada File in Scene Kithttps://mikebluestein.com/2015/06/12/load-a-collada-file-in-scene-kit/
https://mikebluestein.com/2015/06/12/load-a-collada-file-in-scene-kit/#commentsFri, 12 Jun 2015 18:51:18 +0000http://mikebluestein.com/?p=970Read more Load a Collada File in Scene Kit]]>My friend @lobrien (whose blog you should read if you don’t already) was asking about loading Collada files in Scene Kit, so I whipped up a quick example:

In the Xamarin Studio solution pad, the folder containing the Collada file has a .scnassets suffix, and the model has a build action of SceneKitAsset:

Given this, the model is rendered as shown below:

There’s also a Collada build action as well. I’ve never used that option though. If someone wants to elaborate on what that does (perhaps supporting animations embedded in Collada files? just a guess) please add a comment here.

]]>https://mikebluestein.com/2015/06/08/couchbase-lite-xamarin-slides/feed/3mikebluesteingHow I Lost 30 Pounds with Xamarin and Couchbase Lite Couchbase Connect 2015Updated Scratch Ticket Codehttps://mikebluestein.com/2015/05/30/updated-scratch-ticket-code/
https://mikebluestein.com/2015/05/30/updated-scratch-ticket-code/#commentsSat, 30 May 2015 17:41:18 +0000http://mikebluestein.com/?p=933Read more Updated Scratch Ticket Code]]>Someone asked a question in the Xamarin forums last week about the scratch ticket code I wrote a while back, so I decided to update it to work with the unified API and show how to get an image from the view, which is what the person in the forums was asking for.

One thing I find super useful in Xamarin Studio is the ability to see the image at runtime in the debugger (similar to what you’d get in Xamarin Sketches), as shown below:

]]>https://mikebluestein.com/2015/05/30/updated-scratch-ticket-code/feed/5mikebluesteinimage from viewApple Watch Development Slideshttps://mikebluestein.com/2015/05/23/apple-watch-development-slides/
https://mikebluestein.com/2015/05/23/apple-watch-development-slides/#respondSat, 23 May 2015 15:54:54 +0000http://mikebluestein.com/?p=925]]>]]>https://mikebluestein.com/2015/05/23/apple-watch-development-slides/feed/0mikebluesteinVoice Dictation with WatchKit and Xamarinhttps://mikebluestein.com/2015/05/02/voice-dictation-with-watchkit-and-xamarin/
https://mikebluestein.com/2015/05/02/voice-dictation-with-watchkit-and-xamarin/#commentsSat, 02 May 2015 18:40:13 +0000http://mikebluestein.wordpress.com/?p=901Read more Voice Dictation with WatchKit and Xamarin]]>Apple Watch has fantastic support for converting speech to text. However, there isn’t any direct API access to the text to speech engine in WatchKit. You can get access to it in your apps though via the Apple provided text input controller.

You can open a text input controller via WKInterfaceController’s PresentTextInputController method. For example, here’s how I show a list of golf course names to start a new golf round in my app GolfWatch:

In this case a list of course names is displayed along with a button, which when tapped opens a ui to receive speech input. The results are passed to the completion method specified in the third argument to PresentTextInputController. If you only want speech input, simply pass an empty suggestions array in the first argument and the user will be taken directly to the speech input screen on the device (speech input isn’t supported in the simulator).

]]>https://mikebluestein.com/2015/05/02/voice-dictation-with-watchkit-and-xamarin/feed/2mikebluesteingolf watch text inputVisual Studio Code with Xamarin on a Machttps://mikebluestein.com/2015/04/29/visual-studio-code-with-xamarin-on-a-mac/
https://mikebluestein.com/2015/04/29/visual-studio-code-with-xamarin-on-a-mac/#commentsWed, 29 Apr 2015 17:46:55 +0000http://mikebluestein.wordpress.com/?p=895Read more Visual Studio Code with Xamarin on a Mac]]>Microsoft just announced a new cross-platform editor that has many of the features of Visual Studio called Visual Studio Code. I downloaded it on my Mac to try out with a Xamarin.iOS project and see if it works. I was pleased discover it works out of the box (as far as I can tell on a first look).

Visual Studio Code works against files and folders. When you open a folder where a Xamarin.iOS project lives, all the files load fine and features such as links to references and even intellisense on iOS classes work great.

Here’s a class that implements a UIView subclass for example showing intellisense on CALayer:

]]>https://mikebluestein.com/2015/04/29/visual-studio-code-with-xamarin-on-a-mac/feed/5mikebluesteinvscodeNGraphics in a Xamarin Sketchhttps://mikebluestein.com/2015/03/17/ngraphics-in-a-xamarin-sketch/
https://mikebluestein.com/2015/03/17/ngraphics-in-a-xamarin-sketch/#commentsTue, 17 Mar 2015 00:32:17 +0000http://mikebluestein.wordpress.com/?p=868Read more NGraphics in a Xamarin Sketch]]>Frank Krueger published a new open source graphics library called NGraphics today. As with everything Frank does it looks pretty awesome. It even has its own editor where you can type in code and live preview the output. So you probably won’t need what I’m about to show you, but I was curious if it would work with Xamarin Sketches (just for kicks).

Sure enough, all I had to do was add LoadAssembly calls to reference NGraphics assemblies in the sketch and add the assemblies to the sketchname.sketchcs.Resources folder alongside the sketchcs file. Then, since Frank includes methods to return native image types, such as NSImage on Mac, I can leverage the sketch visualizers in Xamarin Studio to get a live preview.

Here’s Frank’s sample code to draw a house in a sketch:

]]>https://mikebluestein.com/2015/03/17/ngraphics-in-a-xamarin-sketch/feed/3mikebluesteinngraphicssketchSketches in Xamarin Studio Alphahttps://mikebluestein.com/2014/12/10/sketches-in-xamarin-studio-alpha/
https://mikebluestein.com/2014/12/10/sketches-in-xamarin-studio-alpha/#respondWed, 10 Dec 2014 22:38:06 +0000http://mikebluestein.wordpress.com/?p=844Read more Sketches in Xamarin Studio Alpha]]>A new version of Sketches just landed in the latest Xamarin Studio alpha. Let’s take a look at a couple new things that have been added.

In the previous version, images could be loaded in a sketch given the path on disk. Now, you can add a .Resources folder next to the sketch file, with the naming convention of sketchname.sketchcs.Resources.

For example, with a sketch named Sample.sketchcs, I created a folder named Sample.sketchcs.Resources at the same location as the sketch file, and added a file named hockey.png in the folder. WIth this I can write code like the following in the sketch:

using AppKit;
var image = NSImage.ImageNamed ("hockey");

Then I can visualize the image in the sketch:

Speaking of visualizers, they have been greatly enhanced in the latest version. For example, one of the many visualizers that has been added is for a CIImage. Therefore you can quickly iterate and test the results of different Core Image filters without needing to deploy an app!

For example, here’s some code to apply a noir effect to the above photo: