Windows 8 for iOS Developers (Part I)

I happened to attend a weekly class by Joe Conway, the author of iOS Programming “The Big Nerd Ranch Guide”. The class covered ObjectiveC and iOS development, but today I’d like to talk about what wasn’t covered in this class: mainly discuss how can an iOS/Apple developer get into Windows 8 world, and what are the differences between iOS and Windows 8 development from the programmer’s prospective. Especially, this post is for Apple iOS developers: it may sound strange, but despite the obvious differences between the platforms, you’ll easily find ways of doing familiar tasks in Windows 8.

I have to admit that Joe’s task was daunting, but Joe handled it brilliantly. With about 20 Microsoft developers in the audience he had to give an ObjectiveC iOS class. The great news for iOS developers: by learning Windows you will actually advance in your computer science class, and may be even by a lot! As Joe put it: there’re two sides of the spectrum: one is people who ask me to fix syntax errors, another is you guys with “why can’t you do it that way”? With Windows some relatively hard tasks become easy and possible: editing animations, asynchronous programming, neat process management, I hope these topics will be interesting for you. This won’t be a side-by-side comparison, instead I’ll focus on helping developers move from iOS to Windows and learn something new along the way.

Design Differences


In Windows 8 we like starting with design. Design is what makes Windows 8 and Windows Phone visually and aesthetically different. Apple and iOS design is distinctively skeuomorphic, using properties of objects from the real world (like brushed metal, stitched leather or the now famous Swiss Railroad clock). Windows 8 design is distinctively digital and minimalistic. It doesn’t mean one is better than the other: these are two different design schools. Windows design guidelines are very pragmatic about design approach: a game app doesn’t need to be digital, while a financial app would benefit from a simpler, minimalistic interface. A great resource for iOS/Apple developers and designers for Windows design, has the simplest URL: http://design.windows.com.

If you’re interested in migrating your iPad app to Windows 8, this design case study is a great place to start: http://msdn.microsoft.com/en-US/library/windows/apps/hh868262. For designers we have tons of design assets, in Photoshop and Illustrator format: http://msdn.microsoft.com/en-us/library/windows/apps/hh975421.aspx

From Objective-C to Windows C++, C# or JavaScript

If your only language for the last few years has been Objective-C, I have good news for you. You don’t have to learn something completely new: Objective-C is very close to C or C++, and even C# and JavaScript on the big scale of things (really big scale of things). As developers we’ll start with documentation. Just like the Mac developer library, Microsoft has Microsoft Developer Library, or MSDN: http://msdn.microsoft.com. Everything I’m posting here is very well documented there.

So, you’re coming from an Objective-C background and want to try some Windows coding? I started to put this table together as a point of reference: it’s not intended as a comprehensive comparison, but more as a reference for developer of where to start. You can also skip through this table, and we’ll go straight to the topics.

Topic 

Windows 8 and Windows Phone 

iOS 

Design 

http://design.microsoft.com

http://developer.apple.com/library/ios/

#documentation/userexperience/conceptual/

mobilehig/Introduction/Introduction.html 

Documentation 

http://msdn.microsoft.com

http://developer.apple.com/library

Native Languages

C#, JavaScript, C++ 

Objective-C 

Application Package 

APPX or XAP 

Bundles

Model View Controller 

Supported (also includes HTML and XAML databindings)

Supported (enforced) 

Initialization 

Constructor

Item(

          string name, 

          int dollars, 

         string  serialNumber)

{ 

    Name = name; 

    Dollars = dollars; 

    SerialNumber = serialNumber; 

}

 

Designated initializer

-(id) initWithItemName:(NSString *)name 

valueInDollars:(int)value 

serialNumber:(NSString *)sNumber 

{ 

 self = [super init]; 

 if(self){ 

  [self setItemName:name]; 

  [self setSerialNumber:sNumber]; 

  [self setDollars:valueInDollars];

 } 

} 

 

Memory Management 

.NET and JavaScript in WinRT support full garbage collection

Objective-C is very close to C, so you need to take care of the memory management, although recently some improvements were made with Automatic Reference Counting (ARC) a new feature in XCode, which you can enable on the compiler, but you are not required to use it

Tools 

Visual Studio 2012 (for everything)

Expression Blend (for animation editing and such) 

XCode 4.5

Animation Editing 

Expression Blend and XAML edits animations with timelines and keyframes 

There’s Core Animation, but without editing (code-only) 

Data Binding Markup

Data Binding is available via HTML or XAML markup 

Not available

Localization 

Localization supported XLIFF standard, with UI tools for translation: Multiligual Toolkit for Visual Studio 

Command line and resource localization 

Asynchronous Programming

C#: async and await and promises in JavaScript

Limited, but possible with block objects.

Data Query Language

LINQ

Not available

Process Lifecycle

Suspended, Terminated states

No suspended state signaled to the apps

Charms and Contracts

Windows 8 is all about contracts between apps: these charms for Search, Share and Settings is something you want to learn as you move from iOS to Windows. This is new and this is cool!

Not available

This is just a brief overview of the most interesting comparative and “go-to” pointers I found for iOS folks to begin with Windows 8. Honestly, it’s much more interesting to go from Objective-C to C# than vice versa. May be this is because Microsoft really made great investments in technology, and you really need to be motivated to go from .NET code to Objective-C. For the purpose of this review, I’m actually surprised that similar paradigms are understood by both camps of developers mostly without translation.

 


 


 


 


 


 

  

One thought on “Windows 8 for iOS Developers (Part I)”

Comments are closed.