Apple Swift attracts a flock of coding tools
- 08 December, 2016 22:00
Apple’s Swift programming language rolled out to much fanfare in the spring of 2014. Since then, it has become a fertile platform for supplemental tooling, thanks to third-party projects ranging from an application server to a testing framework and a mobile form builder.
Built to succeed Objective-C, Swift has taken off in popularity, thanks in part to Apple’s decision to open-source the language. Language popularity indexes such as PyPL and Tiobe have seen dramatic rises for Swift, hitting the top 10 in PyPL and 13th in Tiobe’s index in November.
This rise in popularity has been underscored by a growing ecosystem of tools supporting the language. The proliferation of tooling for Swift has been spawned by the language reaching a sufficient level of maturity, says Sean Stephens, CEO of PerfectlySoft, which offers tools for server-side Swift deployment and enables development of web and REST services using the language.
“I would say we’ve reached a point maturity of Swift that people are now comfortable going out and building tools for the language,” Stephens says.
Apple’s iOS development lineage has helped propel tools development, adds Martin Barreto, CTO of tools builder XmartLabs.
“There was a huge community around Objective-C, and most of them moved on to Swift due to its benefits,” Barreto says. “It’s a natural movement.”
Swift’s vibrant ecosystem
The scope of tools developed for Swift is notable.
PerfectlySoft, for one, offers its Perfect server-side Swift development framework for building REST and web services using Swift. It is geared toward providing back-end server connections for mobile apps. The company also offers Perfect Assistant, a tool set for application deployment and leveraging the Swift Package Manager. Perfect Assistant can help those who are not Swift programmers to get started with the language, Stephens says.
SwiftLint from Realm is another tool geared toward helping Swift developers, by enforcing Swift style and conventions.
“We originally developed SwiftLint in May 2015 as a proof-of-concept for a talk” at a technical conference, says J.P. Simard, Realm’s Cocoa lead. “Part of our motivation was to convey that Swift users don’t need to wait for Apple to produce useful tooling around the language, that these tools can be built by the community.”
SwiftLint features defaults to configurable templates to promote style consistency. Realm, meanwhile, is bullish on Swift, calling it concise and elegant with strong type support.
“Today there are more than 100,000 active developers using Realm, and across those devs we’ve seen it rapidly overtake Objective-C as the language of choice for iOS apps,” says Simard.
Eureka, from Xmartlabs, is an iOS form builder in Swift. It offers developers time savings when developing app settings, login, or any data-entry user interface, Barreto says.
“It’s currently used in 15,000 apps, including many of the top 200 App Store apps,” Barreto says, adding that the community around Eureka offers various plugins to customize how users enter information.
Quick is a behavior-driven development framework for both Swift and Objective-C. Nimble is a matcher framework for the same two languages. Both are developed and maintained by Jeff Hui.
“I developed Nimble to help write tests in the style I preferred—behavior-driven development—as opposed to a JUnit-style of testing,” says Hui. “Also, it was a great way to learn the nuance of Swift’s generics system when Swift was first announced.”
Both Quick and Nimble are stable at this stage, says Hui, a senior software engineer at Mayvenn. But more documentation is needed.
“It was only a matter of time [before tools started emerging for Swift],” he says. “Like any programming language that is popular, there will be tools built to make it easier for developers to use it.”
Also riding the Swift wave is SwiftyJSON, for dealing with JSON data in the language.
“Swift is very strict about types. But although explicit typing is good for saving us from mistakes, it becomes painful when dealing with JSON and other areas that are, by nature, implicit about types,” the SwiftyJSON GitHub repo states. SwiftyJSON looks to provide a better way for Swift to work with JSON, handling functions such as optional wrapping.
TypeLift, meanwhile, is developing a number of Swift tools. SwiftCheck is a testing library for generating random data to test program properties; it is also called QuickCheck for Swift. And TypeLift’s Swiftz is a library for functional programming in Swift. It defines functional data structures, functions, idioms, and extensions to augment the Swift standard library.
“Swift is Apple’s attempt to take Bjarne Stroustrup literally when he spoke of a ‘smaller, cleaner language struggling to get out [of C++],’” says Robert Widman, co-founder of TypeLift and author of SwiftCheck. Swift was the product of a meticulous design process by experts, says Widman, adding that the language’s open, inclusive community has prompted developers to write tools and frameworks for it.
- Seven Swift 2 enhancements every iOS developer will love
- Swift vs. Objective-C: 10 reasons the future favors Swift
- Bossie Awards 2016: The best open source application development tools
- First look: Visual Studio for Mac is here at last, almost
- 15 low-code tools for building mobile apps fast
- PowerApps first look: Create mobile apps without coding