DZone
Web Dev Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Web Dev Zone > A Swiftcycle Built Four Two

A Swiftcycle Built Four Two

Swift 4.2 has been released! Check out this post to learn more about the new goodies in Swift, including synthesized conditional conformances and dynamic member lookups.

Alex Curylo user avatar by
Alex Curylo
·
Sep. 28, 18 · Web Dev Zone · News
Like (1)
Save
Tweet
5.04K Views

Join the DZone community and get the full member experience.

Join For Free

And now that we’ve got our apps compatible with this year’s OS and devices, it's time to take a closer look at all the goodies in the latest Swift that people have been discovering since WWDC, now that it’s official and all:

Swift 4.2 Released

Swift 4.2 is now officially released! Swift 4.2 builds on the strengths of Swift 4, delivering faster compile times, improving the debugging experience, updating the standard library, and converging on binary compatibility.

You can watch a quick overview of it on the WWDC 2018: What’s New in Swift presentation and try out some of the new features in this playground put together by Ole Begemann.

With the completion of conditional conformance support, Swift 4.2 makes significant progress in implementing the vision of generics in the language. Watch this Swift Generics WWDC 2018 presentation for more details.

Migrating to Swift 4.2

Allegedly, the Xcode migrator should take care of pretty much everything, but it choked a lot for us. Either way, you are not likely to find a lot of breaking changes; aside from some minor renaming, check out this post, Upgrading To Swift 4.2, for further discussion.

Most everything new is additive. Although it’s a very close runner-up for the synthesized conditional conformances in Swift 4.2. It’s just auto-magic!

The biggest immediate aid to our coding is CaseIterable, which, contrary to what the name might lead you to expect, isn’t just for enums but for any type with a finite number of values. Check out this post, Enumerating enum cases in Swift, for more details.

Now, the biggie in terms of power and in generating powerful opinions, shall we say? It is this centerpiece feature:

User-Defined “Dynamic Member Lookup” Types

This proposal introduces a new @dynamicMemberLookup attribute. Types that use it provide “dot” syntax for arbitrary names that are resolved at runtime and in a completely type-safe way. The driving motivation for this feature is to improve interoperability with inherently dynamic languages, like Python, Javascript, Ruby, and others. That said, this feature is designed in such a way that it can be applied to other inherently dynamic domains.

This is definitely an “enough rope to shoot yourself in the head” kind of feature. On the other hand, Swift’s chances of ever becoming more than an Apple ghetto are enhanced significantly with this, so we figure you should all be cheering for the future job prospects! For more on this, check out this post on the @dynamicMemberLookup and commentary here.

And, while we’re speaking dynamically and all, over at Chez Wenderlich, there’s an excellent overview of the dynamic features in Swift up to and including this latest release.

That’s about it for the majorly interesting new stuff, but there are some more interesting releases to check out:

  • Ole Begemann’s above-referenced Playground: What’s new in Swift 4.2

  • Ray Wenderlich has a What’s New in Swift 4.2 (part three).

  • Michael Tsai’s Swift 4.2 Released

  • Finally, if you really want to get ahead of the game, check out What’s new in Swift 5.0!

Swift (programming language)

Published at DZone with permission of Alex Curylo, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Unit Vs Integration Testing: What's the Difference?
  • JUnit 5 Tutorial: Nice and Easy [Video]
  • Top Six Kubernetes Best Practices for Fleet Management
  • Application Scalability — How To Do Efficient Scaling

Comments

Web Dev Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo