Macs in Chemistry

Insanely Great Science

Swift or Objective-C?



Swift for Tensorflow (and other things).


After creating MolSeeker and iBabel4 I've been investigating the use of Swift and in particular the open-source use. provides a nice introduction and overview, it also highlights the Google Summer of Code Swift projects which are a fabulous way for students to get involved.

The Google Swift for TensorFlow group have been very active, and Tyrolabs have recently posted a detailed summary, including a comparison with other languages.

Two years ago, a small team at Google started working on making Swift the first mainstream language with first-class language-integrated differentiable programming capabilities. The scope and initial results of the project have been remarkable, and general public usability is not very far off.

They have now provided support for Jupyter notebooks

There is also an interesting blog post here

IBM also seem to be using swift and are highlighting leveraging Watson.

Developers can take advantage of the Watson Developer Cloud’s Swift SDK to easily build Watson-powered applications for iOS or Linux platforms. Leverage the power of Watson’s advanced artificial intelligence, machine learning, and deep learning techniques to understand unstructured data and engage with users in new ways.

Since Swift is a relatively new language it is worth looking at the ongoing evolution.


programming help


I'm looking at using spectrophores for comparing molecules there is a commandline tool for creating the fingerprints and I've written the code below for calculating the euclidian distance between the finger prints.

The output from the obspectrophore tool is shown below for an individual record and the "ID_000002" is the identifier for each molecule record.


Input file:       /Users/username/Desktop/SampleFiles/publishedfrags.sdf
Normalization:    No
Accuracy:         20 degrees
Stereo treatment: No
Resolution:       3 Angstrom

ID_000002   1.49549 2.12041 1.75615 3.2692  4.92872 3.76183 3.61444 3.72374 3.76777 6.28071 6.29508 3.72293 2.84116 2.85055 10.5207 10.5353 15.5128 13.9755 11.3767 20.0578 16.3018 16.4986 20.8431 15.5037 28.5218 31.3143 29.1957 24.1175 20.2475 20.7571 6.87729 23.1364 21.7477 26.0813 9.92146 25.4475 0.937131    0.87351 2.91767 2.9165  0.823157    0.845468    0.39668 3.15164 1.9814  0.923294    0.769458    3.01774

The file that I want to search will have many, many records.

My script is shown below, it works fine but I'm wondering if I can speed it up, in particular the calculation of the euclidian distance between the finger prints I've heard of the accelerate framework but can find much in terms of examples or tutorials of how to use it,

import AppKit
import PlaygroundSupport
import Foundation

var mainFilePath = "/Users/username/Desktop/SampleFiles/publishedfrags.spectrophore" // main file to search against
var theFullpathString = "/Users/username/Desktop/SampleFiles/publishedfrags.txt" // results output file

var iFilepath = "/Users/username/Desktop/SampleFiles/selectedfrag.sdf" //query molecule

var oFilePath = "/Users/username/Desktop/SampleFiles/selectedfrag.txt"

var obshellCommand = ""

var queryMoltitle = ""
var mol1array:[String] = []
var mol1Doubles: [Double] = []
var mainMoltitle = ""
var mainMolarray:[String] = []
var molRecord:[String] = []
var molDouble:[Double] = []

var obspectrophoreResults = ""

//MARK: function for submitting obabel shell scripts
func shell(_ command: String) -> String {
       let task = Process()
       task.launchPath = "/bin/bash"
       task.arguments = ["-c", command]

       let pipe = Pipe()
       task.standardOutput = pipe

       let data = pipe.fileHandleForReading.readDataToEndOfFile()
       let output: String = NSString(data: data, encoding: String.Encoding.utf8.rawValue)! as String

       return output
obshellCommand = "usr/local/bin/obspectrophore" + " -i " + iFilepath

let theText = shell(obshellCommand)

let index = theText.range(of: "Angstrom\n\n") // remove header
var thend = index?.upperBound

let forArray = theText[(thend!)..<theText.endIndex]
mol1array = forArray.components(separatedBy: "\t")  //might need to be \t or 4 spaces
queryMoltitle = mol1array.first!

mol1array.removeLast(1) // need to remove because command returns ended with linefeed

mol1Doubles = { (value) -> Double in return Double(value)! }


let themainText = try! String(contentsOfFile: mainFilePath, encoding: String.Encoding.utf8)

let mainIndex = themainText.range(of: "Angstrom\n\n")
var themainend = mainIndex?.upperBound

let textForarray = themainText[(themainend!)..<themainText.endIndex]

let forMainArray = textForarray.components(separatedBy: "\n") as [String]
//let forMainArray = textForarray.split(separator: "\n")

//let mainMolarray = forMainArray.components(separatedBy: "\t")  //might need to be \t or 4 spaces

let thelength = (forMainArray.count)
print(thelength) // file created by obspectrophore contains final carriage return
for n in 1...(thelength - 1) {
    var sum = 0.0
    var result = 0.0
    molRecord = forMainArray[n - 1].components(separatedBy: "\t") as [String]
    mainMoltitle = molRecord.first!
    molRecord.removeFirst(1) // remove moltitle
    molRecord.removeLast(1)  // remove trailing tab
    molDouble = { (value) -> Double in return Double(value)! }
    //mol1Doubles is query molecule
    for i in 0..<mol1Doubles.count
    //calc distance
      let temp =  ((mol1Doubles[i] - molDouble[i])*(mol1Doubles[i] - molDouble[i]))
        sum = sum + temp
        result = Double(sqrt(sum))

    let theResult = mainMoltitle + "\t" + String(format: "%0.2f", arguments:[result])
 //print(mainMoltitle, result)

    let myshellcommand = "echo " + theResult + " >> " + oFilePath



molSeeker: Find molecular structures.


At the start of 2020 I decided that I'd try learning to program in Swift using Xcode, I've never had any formal programming training and I've always regarded myself as a cut-and-paste programmer. I've dabbled with various languages from AppleScript and shell scripting through ApplescriptObjC to Python. After reading how Xcode was supposed to greatly simplify the process I thought I'd give it a try. After going through a couple of tutorials and reading this excellent introduction to Swift I set about writing my first app.

I thought I'd capture my efforts and share them in and perhaps encourage others to have a go.

The final product from my efforts "molSeeker" is available for free download. It is a simple app that uses a couple of web services to get molecular structures, SMILES and inChiKeys.

Full details here,



Swift for TensorFlow Models


This repository contains TensorFlow models written in Swift.

Swift for TensorFlow is a next-generation platform for machine learning, incorporating the latest research across machine learning, compilers, differentiable programming, systems design, and beyond. This is an early-stage project: it is not feature-complete nor production-ready, but it is ready for pioneers to try in projects, give feedback, and help shape the future!

This is the second public release of Swift for TensorFlow, available across Google Colaboratory, Linux, and macOS.


Swift 5 Released


Swift 5 is a major milestone in the evolution of the language.

Swift 5 makes shipping apps dramatically better. The Swift runtime is now built right in to iOS, macOS, watchOS and tvOS. Your app no longer needs to bundle this library for these latest OS releases. And with great App Store support, your users will get faster downloads and smaller apps. Additional Features in Swift 5 * String reimplemented with UTF-8 encoding which can often result in faster code * Exclusive access to memory is now enforced by default on debug and release builds * SIMD Vector and Result types added to the Standard Library * Performance improvements to Dictionary and Set * Support for dynamically callable types to improve interoperability with dynamic languages such as Python, JavaScript and Ruby


A Jupyter Kernel for Swift


I'm constantly impressed by the expansion of Jupyter it is rapidly becoming the first-choice platform for interactive computing.

The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning, and much more.

A latest expansion is a Jupyter Kernel for Swift, intended to make it possible to use Jupyter with the Swift for TensorFlow project.

Swift for TensorFlow is a new way to develop machine learning models. It gives you the power of TensorFlow directly integrated into the Swift programming language. With Swift, you can write the following imperative code, and Swift automatically turns it into a single TensorFlow Graph and runs it with the full performance of TensorFlow Sessions on CPU, GPU and TPU.

Requires MacOS 10.13.5 or later, with Xcode 10.0 beta or later


Swift 4.1 in a Jupyter Notebook


I'm a great fan of Jupyter Notebooks but I only ever use python.

The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text

A recent post by Ray Yamamoto Hilton caught my eye who recently put together a little experiment to demonstrate using Swift 4.1 from within Jupyter Notebooks.

You can download a demo notebook here.



Top 20 programming languages


Red Monk have published their Programming Language Rankings. The data source used for these queries is the GitHub Archive.

  1. JavaScript
  2. Java
  3. Python
  4. PHP
  5. C#
  6. C++
  7. CSS
  8. Ruby
  9. C
  10. Swift
  11. Objective-C
  12. Shell
  13. R
  14. TypeScript
  15. Scala
  16. Go
  17. PowerShell
  18. Perl
  19. Haskell
  20. Lua

Swift (+1): Finally, the apprentice is now the master. Technically, this isn’t entirely accurate, as Swift merely tied the language it effectively replaced – Objective C – rather than passing it. Still, it’s difficult to view this run as anything but a changing of the guard. Apple’s support for Objective C and the consequent opportunities it created via the iOS platform have kept the language in a high profile role almost as long as we’ve been doing these rankings. Even as Swift grew at an incredible rate, Objective C’s history kept it out in front of its replacement. Eventually, however, the trajectories had to intersect, and this quarter’s run is the first occasion in which this has happened. In a world in which it’s incredibly difficult to break into the Top 25 of language rankings, let alone the Top 10, Swift managed the chore in less than four years. It remains a growth phenomenon, even if its ability to penetrate the server side has not met expectations.


Xcode 9.0 is available for download


The new version of Xcode is available for download. Xcode 9.0 includes Swift 4 and SDKs for iOS 11, watchOS 4, tvOS 11 and macOS High Sierra 10.13.

  • The source code editor has been completely rebuilt for amazing speed. It scrolls at a constantly smooth rate, no matter the files size, also supports Markdown.
  • Refactoring to easily select and modify structure of code
  • Swift 4 compiler can also compile Swift 3 to aid transition
  • Xcode 9 makes working with source control – and with GitHub – easier and more tightly integrated.
  • Simulator app updated.


App Development with Swift


Apple Education has just announced a new app development curriculum designed to teach students how to start using Swift to create fully functional iPhone apps.

The course is available for free on iBooks and can be read on iPad, iPhone, and Mac..

This course is designed to teach you the skills needed to be an app developer capable of bringing your own ideas to life. Whether you’re new to coding or want to expand your skills, by the end of this course you should be able to build a fully functioning app of your own design.

The 900 page book is available here


Functional Swift Conference 2017 slides available


The slides for the Functional Swift Conference 2017 are now online here


Swift Playgrounds


Swift Playgrounds is a revolutionary new app for iPad that makes learning Swift interactive and fun. Solve puzzles to master the basics using Swift, ideal for keeping occupied over the Christmas break.

Learning to code with Swift Playgrounds is incredibly engaging. The app comes with a complete set of Apple-designed lessons. Play your way through the basics in “Fundamentals of Swift” using real code to guide a character through a 3D world. Then move on to more advanced concepts.

There is a video here

I also notice that there have been a few updates to the Swift Algorithm Club there are now 79 contributors and an ever increasing list of algorithms.

All content is licensed under the terms of the MIT open source license.


Scriptarian: Scripting Studio for macOS


Scriptarian allows you to easily automate macOS using the Swift programming language, providing an alternative to AppleScript.

Scriptarian is built using Swift the new open-source programming language developed by Apple. Scriptarian analyzes all of your installed applications for AppleScript support and dynamically generates native Swift interfaces for them.

In addition to full support for the Swift Standard Library, Scriptarian includes ScriptingKit, a scripting framework we built from the ground up with Swift in mind. It lets you communicate with any AppleScript-enabled app and even provides various utility functions for speech synthesis, sound playback, file management, process management, and more. keynote


Objective-C id as Swift Any


The latest update on the Swift Blog describes one of the important changes in Swift 3.

In Swift 3, the id type in Objective-C now maps to the Any type in Swift, which describes a value of any type, whether a class, enum, struct, or any other Swift type.


Swift Algorithm Club


The Swift Algorithm Club is a new site that described implementations of popular algorithms and data structures in Swift. However there is also an added bonus in that there are also detailed explanations of how they work. The list below gives an idea of what is available or under construction, and I’m sure they would be delighted to receive contributions.

The algorithms


  • Linear Search. Find an element in an array.
  • Binary Search. Quickly find elements in a sorted array.
  • Count Occurrences. Count how often a value appears in an array.
  • Select Minimum / Maximum. Find the minimum/maximum value in an array.
  • k-th Largest Element. Find the k-th largest element in an array, such as the median.
  • Selection Sampling. Randomly choose a bunch of items from a collection.
  • Union-Find. Keeps track of disjoint sets and lets you quickly merge them.

String Search

  • Brute-Force String Search. A naive method.
  • Boyer-Moore. A fast method to search for substrings. It skips ahead based on a look-up table, to avoid looking at every character in the text.
  • Knuth-Morris-Pratt
  • Rabin-Karp
  • Longest Common Subsequence. Find the longest sequence of characters that appear in the same order in both strings.


It's fun to see how sorting algorithms work, but in practice you'll almost never have to provide your own sorting routines. Swift's own sort() is more than up to the job. But if you're curious, read on...

Basic sorts:

  • Insertion Sort
  • Selection Sort
  • Shell Sort

Fast sorts:

  • Quicksort
  • Merge Sort
  • Heap Sort

Special-purpose sorts:

  • Counting Sort
  • Radix Sort
  • Topological Sort

Bad sorting algorithms (don't use these!):

  • Bubble Sort


  • Run-Length Encoding (RLE). Store repeated values as a single byte and a count.
  • Huffman Coding. Store more common elements using a smaller number of bits.


  • Shuffle. Randomly rearranges the contents of an array.
  • Comb Sort. An improve upon the Bubble Sort algorithm.


  • Greatest Common Divisor (GCD). Special bonus: the least common multiple.
  • Permutations and Combinations. Get your combinatorics on!
  • Shunting Yard Algorithm. Convert infix expressions to postfix.
  • Statistics

Machine learning

  • k-Means Clustering. Unsupervised classifier that partitions data into k clusters.
  • k-Nearest Neighbors
  • Linear Regression
  • Logistic Regression
  • Neural Networks
  • PageRank


Swift 3.0 released


The latest version of swift has been released.

Swift 3 is a source-breaking release, largely due to the changes in SE-0005 and SE-0006. These changes not only impact the names of the Standard Library APIs, but also completely change how Objective-C APIs (particularly from Cocoa) import into Swift. Many of the changes are largely mechanical, but they can be numerous in a typical Swift project. To help with moving to Swift 3, Xcode 8.0 contains a code migrator that can automatically handle many of the need source changes. There is also a migration guide available to guide you through many of the changes — especially through the ones that are less mechanical and require more direct scrutiny.

Thus there is better translation of Objective-C APIs into Swift, meaning that code imported from Objective-C and translated into Swift will be more readable and Swift-like. The bad news is any code previously imported from Objective-C into Swift will not work in Swift 3; it will need to be re-imported.

There was also a blog post describing how to work with JSON in swift, this is particularly important if your app communicates with a web application, information returned from the server is more often than not formatted as JSON.

import Foundation

let data: Data // received from a network request, for example
let json = try? JSONSerialization.jsonObject(with: data, options: [])


Xcode 8 released


With the release of iOS 10 comes an update to Xcode. Xcode 8.0 is a free download for OS X 10.11 or later. (An Apple ID is required for iOS development, and App Store submissions require registration in the Apple Developer Program.) The latest version brings Swift 3 and SDKs for iOS 10, watchOS 3, tvOS 10, macOS Sierra, Siri extensions, iMessage apps, and sticker packs for Messages, along with many other changes.

Xcode 8 includes everything you need to create amazing apps for iPhone, iPad, Mac, Apple Watch, and Apple TV. This radically faster version of the IDE features new editor extensions that you can use to completely customize your coding experience. New runtime issues alert you to hidden bugs by pointing out memory leaks, and a new Memory Debugger dives deep into your object graph. Swift 3 includes more natural and consistent API naming, which you can experiment with in the new Swift Playgrounds app for iPad.

Swift 3 is the first major release of the innovative programming language built completely in the open with the community of developers at This release unifies core API naming rules under a new public API Naming Guidelines document that makes writing Swift code feel even more natural. Popular system APIs such as Core Graphics and Grand Central Dispatch are more expressive and harmonize well with Swift.


End to End Swift


This looks interesting, Perfect

Perfect is an application server for Linux or OS X which provides a framework for developing web and other REST services in the Swift programming language. Its primary focus is on facilitating mobile apps which require backend server software, enabling you to use one language for both front and back ends.

Perfect relies on Home Brew for installing dependencies on OS X, once done you are up and running and can follow the Perfect tutorials


Swift 3


Swift Blog Update

Swift 3 beta was just released as part of Xcode 8 beta and includes numerous enhancements, many contributed by the open source community. The primary goal of Swift 3 is to implement the last major source changes necessary to allow Swift to coalesce as a consistent language throughout, resulting in a much more stable syntax for future releases.


Swift Programming Language Evolution


If you want to stay on top of the proposed changes to the Swift programming language then this repository is worth a browse

This repository tracks the ongoing evolution of Swift. It contains:

Goals for upcoming Swift releases (this document). The Swift evolution review schedule tracking proposals to change Swift. The Swift evolution process that governs the evolution of Swift. Commonly Rejected Changes, proposals which have been denied in the past. This document describes goals for the Swift language on a per-release basis, usually listing minor releases adding to the currently shipping version and one major release out. Each release will have many smaller features or changes independent of these larger goals, and not all goals are reached for each release.


Swift @ IBM


For those interested in learning more about Swift there are a couple of blogs that are worth keeping an eye on. Swift is a modern open-source programming language for iOS, OS X, tvOS, watchOS and Linux.

There is the official Swift blog from Apple which has updates and code snippets, however more recently there has been a lot of activity of the Swift@ IBM blog.

In particular Bring Swift to the Cloud and the IBM Swift Sandbox that allows you to write Swift code in a browser and then execute it. You can try it out here

Introduced in 2014, Swift is one of the fastest growing and most widely used programming languages. In just over two months since Apple open sourced the Swift language and IBM released its Swift Sandbox for early exploration of server-side programming in Swift, more than 100,000 developers from around the world have used the IBM Swift Sandbox and more than half a million code runs have been executed in the Sandbox to date

Press release




If you want to convert your Objective_Code to Swift this could be very useful ObjCConverter.

There is also an online converter if you want to try before you buy

The latest post on the Swift blog highlights interactive playgrounds.

Xcode 7.3 beta 3 adds interactive iOS and OS X playgrounds that allow you to click, drag, type, and otherwise interact with the user interfaces you code into your playground. These interfaces react just as they would within a full application. Interactive playgrounds help you to quickly prototype and build your applications, and simply provide another great way to interact with your code.


Swift Open Source


As I previously highlighted after the WWDC Apple have announced that Swift is now open source.

More details are on the Swift blog

Swift is now open source. Today Apple launched the open source Swift community, as well as amazing new tools and resources including: – a site dedicated to the open source Swift community Public source code repositories at A new Swift package manager project for easily sharing and building code A Swift-native core libraries project with higher-level functionality above the standard library Platform support for all Apple platforms as well as Linux is an entirely new site dedicated to open source Swift. This site hosts resources for the community of developers that want to help evolve Swift, contribute fixes, and most importantly, interact with each other. It also provides development snapshots for Apple and Linux platforms, requires OS X 10.11 (El Capitan) or Ubuntu 14.04 or 15.10 (64-bit).

Source code is available on Github




This is probably the application that many programmers have been waiting for, CodeSwitch is the first Objective-C to Swift code converter for Mac OS X.

CodeSwitch will convert all of your Objective-C code into Swift code instantly. Simply copy-and-paste any Objective-C code into this program, and it will translate it to Swift in milliseconds.

So those legacy programs won't need a complete rewrite!

The latest post on the Swift blog highlights a new feature in Xcode 7.1, the ability to embed file, image, and color literals into your playground’s code.

For instance, there’s no need to type “myImage.jpg” in the editor – just drag your image from the Finder and the actual image will appear in-line with your code.

Useful if you tend to name images, image1, image 2 etc ;-)




I've mentioned the Swift blog before and I note there is a new entry describing the additions to Xcode 7.

I've also come across a couple of blogs that also be of interest Inessential by Brent Simmons, Kickingbear, and Weheartswift which helps you learn Swift from scratch.


Strings in Swift 2


The latest entry on the Swift Blog discusses a change in the way Strings are handled in Swift.

Read more here


Swift 2.0


More news on Swift 2.0 on the Swift Blog

Today at WWDC, we announced Swift 2.0. This new version has even better performance, a new error handling API, and first-class support for availability checking. And platform APIs feel even more natural in Swift with enhancements to the Apple SDKs.

Open Source In addition to new features, the big news is that Apple will be making Swift open source later this year. We are all incredibly excited about this, and look forward to giving you a lot more information as the open source release gets nearer. Here is what we can tell you so far:

Swift source code will be released under an OSI-approved permissive license. Contributions from the community will be accepted — and encouraged. At launch we intend to contribute ports for OS X, iOS, and Linux. Source code will include the Swift compiler and standard library. We think it would be amazing for Swift to be on all your favorite platforms. We are excited about the opportunities an open source Swift creates for our industry. Baked-in safety features combined with excellent speed mean it has the chance to dramatically improve software versus using C-based languages. Swift is packed with modern features, it’s fun to write, and we believe it will get used in a lot of places. Together, we have an exciting road ahead.


Swift Open Source


Perhaps one of the more unexpected news items from WWDC2015.

Swift is now Open Source!


Swift Updates


The latest update to Xcode 6.3 includes Swift 1.2, latest reports suggests a significant improvement in speed.

Rather than feeling like using a computer that’s 10 years obsolete, algorithms that were borderline rate limiting running in the main UI thread just happen like they ought to. As a reality check, I re-ran the horrendously underperforming algorithm that I complained about awhile back, and rather than taking 320 seconds to calculate 7 log P values, it now gets the job done in 30 seconds.

The latest entry on the Swift blog also describes means to improve performance.


New playgrounds in Swift


The latest entry on the Swift blog highlights additions to the playgrounds within Xcode 6.3 beta 3.

Playgrounds are now represented within Xcode as a bundle with a disclosure triangle that reveals Resources and Sources folders when clicked. These folders contain additional content that is easily accessible from your playground’s main Swift code. To see these folders, choose View > Navigators > Show Project Navigator (or just hit Command-1)

There is an example playground that calculates Mandelbrot set which looks like fun to play with.



Swift course on iTunes U


I just noticed that there is are new Swift programming courses available on iTunes U.

The outstanding Stanford University iOS development courses on iTunes U has been updated to use Swift. The first two lectures from the new “Developing iOS 8 Apps with Swift” class are now live and additional lessons will be added as they are taught. In addition there is also a new course from Plymouth University in the UK.


Swift's unprecendented growth


he latest RedMonk Programming Language Rankings are now available, these rankings have been run since 2010 using essentially the same methodology so we can compare with historical data. The plot below compares popularity of Stack Overflow and GitHub.


Whilst the top ten is pretty much as expected

1 JavaScript
2 Java
4 Python
5 C#
5 C++
5 Ruby
9 C
10 Objective-C

Perhaps the most important change is just outside the top 20.

the growth that Swift experienced is essentially unprecedented in the history of these rankings. When we see dramatic growth from a language it typically has jumped somewhere between 5 and 10 spots, and the closer the language gets to the Top 20 or within it, the more difficult growth is to come by. And yet Swift has gone from our 68th ranked language during Q3 to number 22 this quarter, a jump of 46 spots.

Swift is an innovative new programming language for Cocoa and Cocoa Touch and you can find out more about Swift on the Apple Developer site,


New Swift website


In addition to the Swift Blog there is now a dedicated Swift website

Swift is an innovative new programming language for Cocoa and Cocoa Touch. Writing code is interactive and fun, the syntax is concise yet expressive, and apps run lightning-fast. Swift is ready for your next iOS and OS X project — or for addition into your current app — because Swift code works side-by-side with Objective-C.

The latest entry on the Swift blog deals with “Failable Initialisers” a new feature in Swift 1.1 part of Xcode 6.1.


Impressions of Apple’s Swift, after a bit of practice


Swift is a new programming language from Apple for iOS and OS X apps that builds on the best of C and Objective-C, without the constraints of C compatibility. I’m delighted to hear that people are starting to explore it’s use in scientific applications. Dr. Alex M. Clark has posted his early impressions on the Cheminformatics blog, well worth a read.

There is also the Swift blog for more interesting tips.


Swift now at 1.0


It has just been announced that Swift has reached 1.0.

Today is the GM date for Swift on iOS. We have one more GM date to go for Mac. Swift for OS X currently requires the SDK for OS X Yosemite, and when Yosemite ships later this fall, Swift will also be GM on the Mac. In the meantime, you can keep developing your Mac apps with Swift by downloading the beta of Xcode 6.1.

Swift is an innovative new programming language for Cocoa and Cocoa Touch. Writing code is interactive and fun, the syntax is concise yet expressive, and apps run lightning-fast. Swift is ready for your next iOS and OS X project — or for addition into your current app — because Swift code works side-by-side with Objective-C.


Latest update on Swift blog


The latest post on the Swift developers blog concerns Value and Reference Types

Types in Swift fall into one of two categories: first, “value types”, where each instance keeps a unique copy of its data, usually defined as a struct, enum, or tuple. The second, “reference types”, where instances share a single copy of the data, and the type is usually defined as a class. In this post we explore the merits of value and reference types, and how to choose between them.


Balloons playground


An update on the swift blog

Many people have asked about the Balloons playground we demonstrated when introducing Swift at WWDC. Balloons shows that writing code can be interactive and fun, while presenting several great features of playgrounds. Now you can learn how the special effects were done with this tutorial version of ‘Balloons.playground’, which includes documentation and suggestions for experimentation.

This playground uses new features of SpriteKit and requires the latest beta versions of Xcode 6 and OS X Yosemite


Swift blog


Apple have started a new blog to help developers interested in Swift, Swift is a new programming language for Cocoa and Cocoa Touch.

Get started with Swift by downloading Xcode 6 beta, now available to all Registered Apple Developers for free. The Swift Resources tab has a ton of great links to videos, documentation, books, and sample code to help you become one of the world's first Swift experts. There's never been a better time to get coding!

The first blog entry deals with the issue of compatibility, and how to ensure your app will continue to function as the language evolves.