View profile

Public Extension - Issue #9️⃣4️⃣

Welcome to this week’s Public Extension. We’re proud to be the only newsletter compiled in New York C
Public Extension - Issue #9️⃣4️⃣
By Joe Fabisevich • Issue #5 • View online
Welcome to this week’s Public Extension. We’re proud to be the only newsletter compiled in New York City that sends you a new Swift extension to make your development life easier every week.
Most extensions are brought to you by our fine community, so please reach out and submit an extension of your own to be featured! 🎉

This Week's Extension
(Click to view code in full)
(Click to view code in full)
I really love this extension. It’s a fun thing you can do in Swift thanks to how flexible and extensible the language is, with a pretty obvious API surface. Any inset that’s not explicitly specified will default to zero, so it’s pretty hard to misuse.

Adam came up with the original idea of using key paths and a syntax that looks like this:
let insets: UIEdgeInsets = [\.top: 8, \.bottom: 8]
Daniel took it one step further and cleaned up the syntax to end up with the result we have above. Both are good choices, depending on how much you enjoy looking at keyPath literals.

Either way, you can’t go wrong, only .right. 😏
Did you enjoy this issue?
Joe Fabisevich

Public Extensions: 9/10 doctors agree that a bit of Swift code in your inbox every week is good for your soul. The other doctor has had their medical license revoked.

Sign up now and you'll wake up to a new extension in your inbox every Sunday.

And always check your sources kids.
https://github.com/mergesort/Public-Extension

If you don't want these updates anymore, please unsubscribe here
If you were forwarded this newsletter and you like it, you can subscribe here
Powered by Revue