Use JAMFs Casper API with Swift

I have updated JAMFs Cocoa example with a Swift version I am using internally at work.  The code is up on GitHub for anyone to use.  This example counts and displays the number of managed machines in a JSS. Pretty simple. 

https://github.com/jason-tratta/SwiftJSS

I have been slow to get on the Swift train.  Now that I’m here….full steam ahead.  I am really enjoying it.  I had been so stubborn to code outside of Objective-C.  

Just one important code note.  The JSS will sometimes return JSON instead of XML.  You can always force XML with this code.  This was not part of the original SDK example. 

  let theRequest = NSMutableURLRequest(URL : NSURL(string:urlWithPath)!)

        theRequest.timeoutInterval = 60;

        theRequest.addValue(“application/xml”, forHTTPHeaderField:“Accept”)