Archive for the ‘WWDC’ Category

If I had my druthers: Swift 2.2, Swift 3.0, ABIs, etc

If I could wave a magic wand, I’d push Swift 3.0 out by a year or even better three years and fix Swift 2 as the standard App Store language (and for Linux, and upcoming Windows) exactly as is, barring a few tweaks and fixes over this time.

[tl;dr summary: Make big breaking changes later and once rather than sooner and multiple times. If a delay allows a single stable language transition, it is to be preferred. Aim for post-3.0 language updates to be additive not transformative.]

Swift 2.2 is a great language. It’s amazing to work in. It offers utility and concepts that Objective-C cannot provide. It pushes iOS and OS X development forward in an important and exciting way, affecting development not just on Apple platforms but wherever Swift touches. From first class structure and enumeration types to protocol oriented programming, Swift 2.2 delivers the goodies.

If you need just one compelling single example, take CGRect: Swift 2.2 lets you expand this essential structure with methods and properties that let you center on a zero origin, or scale and transform, or add math to combine instances. It’s so practically useful that going back to ObjC to work in geometry metaphysically hurts.

Swift 2.2 gets it right in so many ways, that it seems ridiculous to throw it away at the end of the year. A language this good should have a lifetime longer than 8 or 10 months. I’d be really happy if at the WWDC keynote, Tim Cook said, “We got it so right, we’re going to stick with Swift 2, let you build your code for long term use, and make sure the transition to Swift 3 will be perfect.”

The move to Swift 3.0 isn’t just going to be disruptive. It’s going to be traumatic. With its expansive renamification and redesigned core types and APIs, Swift 3 is going to be a tidal wave of retraining and refactoring. And with a list of objectives that didn’t quite make the cut, and a laundry list of of items that should have, Swift 3 just doesn’t have enough time or scope to be perfected.

So why not just push it back?  Let us devs use Swift 2.2, which is terrific, for a few more years and get Swift 3 right the first time?

It’s not as if Swift Evolution needs to be fast paced and hectic. The bikeshedding, the simple natural discussion overhead, the need to foster a courteous open source community means the natural speed of development has taken a huge hit.

These arbitrary “update every year” advances that Apple has bought into are more than a little ridiculous when it comes to firmware and OS updates; for languages it pushes beyond the practical.

Orson Welles promised that Paul Masson would sell no wine before its time. Apple should take a lesson from Welles and ship no language before the follow-up version has properly evolved.

I want to see Apple slow down, take some deep breaths, and seriously consider letting Swift 2.2 come into its own rather than cutting it down after a few months of use.

As it is, I am constantly having to answer “Is it time yet to switch to Swift?” As this breakneck development continues, I’ve been hesitant to recommend jumping aboard the Swift train for simple practical reasons.

I’d be far more confident with my advice if I could see a 2-3 year window with stable code that could benefit from Swift’s modern language features, and a payoff of investment in training and refactoring that won’t have to be re-addressed with each new beta and each new release.

To paraphrase a line from Aesop, slow and steady really does win the language race.

Like my posts? Consider buying a book or two or three. Thanks!

What you need to know

I will keep updating this post. The downloads are on the new developer site in Resources > [technology] > Download

Complications

Where this apparently ridiculous term comes from.

Confidentiality

If I’m reading this correctly, it’s full steam ahead:

You will not be bound by the foregoing confidentiality terms with regard to technical information about pre-release Apple Software and services disclosed by Apple at WWDC (Apple’s Worldwide Developers Conference), except that You may not post screen shots of, write public reviews of, or redistribute any pre-release Apple Software, Apple Services or hardware.

This is pretty much identical to what Ole Begemann found in last year’s terms.

Swift 2.0

Swift updates to version 2.0. What’s new in Swift 2.0 page is now live. Read here.

  • A pre-release version of both the Swift Programming Language and the Cocoa book are now available in the US iBooks store.
  • New language features.
  • If you do not have access to the US store, you can read the online docs at this link.
  • Get your fresh Swift Standard Library reference here.

This bit is my favorite: The SDKs have been updated to annotate API that cannot return nil so you don’t need to use optionals as often.

Swift 2.0 supports error handling:

func loadData() throws { }
func test() {
 do {
    try loadData()
 } catch {
    print(error)
 }
}

Swift 2.0 adds syntax to support:

  • Powerful control flow with do, guard, defer, and repeat
  • Keyword naming rules unified for functions and methods
  • Protocol extensions and default implementations
  • Extended pattern matching to work in if clauses and for loops

Swift 2.0 also provides availability checking for language and API features. You’ll find more information about Swift 2.0 on the Swift dev blog.

WWDC Sessions

The WWDC session schedule is now live.

Developer Program

The iOS and Mac programs have merged into a single membership.

The new Apple Developer Program combines everything you need to develop, distribute, and manage your apps on all Apple platforms into one single program, making it easier than ever to bring your creativity to over a billion customers around the world. Get your apps ready for the App Store on iPhone, iPad, Mac, and Apple Watch, by enrolling in the Apple Developer Program today.

There’s a transition page that doesn’t seem to be live quite yet. This is the link to it (for when it does go live).

Edit your developer.apple.com/ios and developer.apple.com/mac bookmarks. They no longer work. Point your browser to developer.apple.com instead.

Technology overview pages are live. Read about watchOS 2, iOS 9, OS X Elk(apitan) here.

The Developer program no longer requires you to be a paid member to test on devices:

Xcode 7 and Swift now make it easier for everyone to build apps and run them directly on their Apple devices. Simply sign in with your Apple ID, and turn your idea into an app that you can touch on your iPad, iPhone, or Apple Watch. Download Xcode 7 beta and try it yourself today. Program membership is not required.

Paid membership is still required for pre-release access and other familiar benefits.

Xcode 7

What’s new in Xcode 7

Xcode 7 includes everything you need to create amazing apps for iPhone, iPad, Mac, and Apple Watch. The Swift programming language has been updated and is now faster than ever, with great features that make your code even easier to read and write. And with the new playgrounds you can experiment with new APIs or author gorgeous interactive documentation using embedded resources, additional source code, and rich text comments. Xcode’s user interface testing feature can even record your app in action and generate tests for you.

New features include code coverage (which bits of your source are tested), UI Testing (“ensuring that changes you make in code don’t show up as unwanted changes to your users”), iOS Energy gauge (“The new iOS energy gauge alerts you to times when your app is using significant energy”), and more. Full details here.

Download your copy of Xcode 7 here. (4.22 download. 8.7 GB install. Holy crap.) Release notes here.

Distribution

“App Thinning”/Slicing similar to what I suggested here. Apps will automatically update to new processors without having to lipo your builds.

The App Store will allow 64-bit-only software submission starting later this year.

Interface Builder

Screen Shot 2015-06-08 at 2.26.41 PM

Interface Builder adds a new constraint visualization tool so you not only see the list of constraints, you get a rough idea of how they fit into your design.

Objective-C

ObjC introduces generics. Can’t wait to play!

Dev Forum

Get your premium dev forum user id now. I just snagged “erica”. W00.

Misc

Download your own copy of the San Francisco font here.