SwiftLee Weekly - Issue 250


This week's SwiftLee Weekly covers:

  • Noncopyable types in Swift
  • Exploring MLX Swift
  • Xcode Library Customization

Enjoy this week's SwiftLee Weekly!

THIS WEEK'S BLOG POST

SwiftUI Button: Custom Styles, Variants, and Best Practices

SwiftUI provides different APIs to style buttons. You can use system styling using view modifiers or custom button styles. While writing this article, I learned about PrimitiveButtonStyle, which allows you to define both custom interactions and styling.

New: Code for this week's article can be found on GitHub. I've started this repository to invite you to contribute new article ideas or feedback on existing articles.

SPONSORED

Screenshotbot: Scale up your snapshot tests, without the friction

Spending too much time maintaining snapshot tests? Screenshotbot works with your existing snapshot tests and stores your images. Say goodbye to Git LFS. Screenshotbot notifies you on pull-requests when snapshots change. Curious? Try out Screenshotbot!

CURATED FROM THE COMMUNITY

Noncopyable types in Swift

While I haven’t run into a situation of needing noncopyable types myself, there are cases where this Swift feature can be essential to prevent invalid states or conflicts. Well explained by Natalia Panferova.
nilcoalescing.com

Finding unused code with Periphery

Unused code is tech-debt you need to maintain while it’s wasted time. “it’s difficult to prune old unused code while keeping up the velocity of new features”, well said by Adam Wulf. The tool described in this article can help you clean up your codebase.
adamwulf.me

Exploring MLX Swift: Adding On-Device Inference to your App

Do you know what MLX stands for? It’s a machine learning framework by Apple specifically designed for Apple Silicon. Read this article by Rudrank if this sparks your interest.
rudrank.com

Xcode Library customization with SPM plugin

While many of us only use SPM to link packages, you can do much more. This article describes creating an SPM plugin that generates library content. Oh, and this article also reminds us of the LibraryContentProvider protocol, which is very interesting!
artemnovichkov.com

Understanding opaque types in Swift

I wrote about Opaque types before and even gave a few talks since it’s complex for many. This concise article by Natascha Fadeeva might help you better understand this topic.
tanaschita.com

SWIFT EVOLUTION

An overview of last week's Swift Proposal state changes. Check them out when they're in review, as it's your opportunity to influence the direction of Swift's future.

There have not been any state changes in the past 7 days.

QUESTION OF THE WEEK

What objectives might a Principal Engineer's role be asked to endorse?
Robin

Before I went indie in March this year, I had been a Staff iOS Engineer for 7+ years at WeTransfer. While the Principal level follows after, there's one thing both levels had in common: confusion about responsibilities.

I've seen senior developers struggling to be promoted to Staff, switching jobs, and getting hired as Principal Engineer. One company might qualify you as a Principal, while others feel like you're just starting.

I'd love to reference staffeng.com in this answer as it helped me to qualify the different Staff engineers we've had at WeTransfer. While it does not answer the question, it does inform you of the various types of Staff Engineers that exist at these levels.

A principal engineer typically operates at a strategic level, influencing technical direction, mentoring teams, and ensuring alignment between business goals and engineering solutions. This is a continuation of a Staff Engineer's responsibilities, and there are often just a few Principal Engineers who are divided by discipline and aim to work together.

If you’re aiming for a Principal Engineer position, start by familiarizing yourself with the role. Review job postings from various companies to understand what they value and expect from candidates in this position.

Want to have your question answered next week? Ask your question via this form (anonymously) or reply to this email with your question.

EARN ROCKETSIM LIFETIME

Share and Earn RocketSim Lifetime & a 1-on-1 coaching session

Apple has recognized RocketSim as an Essential Developer Tool in the Mac App Store, and now you can get lifetime Pro access by sharing your unique referral link!

How to get started:

[RH_REFLINK GOES HERE]

Rewards:

  • Earn your first reward after just 3 sign-ups.
  • Check your progress anytime using your referral dashboard.
  • The grand prize? A personalized 1-on-1 career coaching session!

Several subscribers have already claimed their rewards—will you be next?

Thank you so much for your support, and until next Tuesday,

Antoine

SwiftLee Weekly by Antoine van der Lee

SwiftLee Weekly keeps you up-to-date with the latest Swift Evolution proposals, delivers 5 handpicked articles from the community, and challenges your knowledge with a weekly question. Enjoy a monthly giveaway and dive into a fresh new article from SwiftLee every week. Plus, unlock $264 worth of exclusive discounts by subscribing.

Read more from SwiftLee Weekly by Antoine van der Lee

This week's SwiftLee Weekly covers: Dealing with in-app subscription billing issues Getting started with Swift Localization using SPM Enjoy this week's SwiftLee Weekly! THIS WEEK'S BLOG POST Swift Tutorials: Learn Swift with Easy-to-Follow Code Examples Since 2015, I've published over 250 articles. Yet, a good starting point didn't exist, and outside of search engine results, it's pretty hard to discover all the valuable content I've written. Therefore, I used this holiday week to publish an...

This week's SwiftLee Weekly covers: Exploring Apple Intelligence SwiftUI Design System Mutable let in Swift Enjoy this week's SwiftLee Weekly! THIS WEEK'S BLOG POST SF Symbol: How to for Swift & SwiftUI Remember the days you've had to search for a specific icon all across the web? We can be blessed with the quality of SF Symbols, which we can use for free in our apps. This week's article covers everything around the 6,000+ symbols you can use, from animations and variants to creating custom...

This week's SwiftLee Weekly covers: Concurrency step-by-step Geometry Effect in SwiftUI Reducing an iOS app's size by half Enjoy this week's SwiftLee Weekly! Oh, p.s., I'm finally on Bluesky. THIS WEEK'S BLOG POST Enum explained in-depth with code examples in Swift It's been a while since I wrote the first version of this article. Swift enums are well-known in their basics, but do you know how to use the fallthrough keyword? Or statements like guard case and if case? Now and then, I revisit...