iOS Dev Weekly - iOS Dev Weekly - Issue 565

How do you like to format your code? I like mine formatted automatically! 🤖
 

iOS Dev Weekly

 
View on the Web    Archives

ISSUE 565  July 1st 2022

 
Comment

  Comment  

 

I’ve seen a few people talking positively about Xcode 14’s slightly firmer hand in re-indenting code as you type or paste code into the editor. I’m a fan of these new features, too, but in my opinion, they don’t go anywhere near far enough.

Brace yourselves for a potentially controversial opinion!

As part of my “you know what” work, I do a fair amount of editing of CSS and JavaScript files, and I use Prettier to format my files automatically. I also configured my editor, Nova, to run prettier every time I save a file using this extension. I have no way to opt-out, either. If I save a file to disk, Prettier formats it.

Prettier is an opinionated code formatter, and I love it. There are a couple of configuration options, but not that many. I know that many of you will have strong views on formatting Swift code and would happily argue a case on why one formatting style is better than another. In my opinion, the specific style genuinely doesn’t matter. The primary thing that matters is consistency.

It’s wild how freeing it is never to have to format code, and I love it. I’m now at the stage where I don’t even try to indent or format JavaScript or CSS. I just put the cursor in roughly the right place and start typing, hit save, and see my code instantly formatted. I also miss this feature every time I write in Swift. 😅

I’d love to see an option to auto re-indent on every save in a future version of Xcode. I’d even like it to go further and use swift-format to bring in much stricter rules for formatting Swift code, and I don’t care what the rules are. If someone at Apple chooses that there should be seven blank lines in between function definitions, I’m okay with that, and you probably would be, too, after a couple of weeks of living with it.

There would be several advantages to this. From experience, I can confidently say that code is easier to write this way, and while you might feel a desire to fight against it at first, it passes. Pull requests are also more straightforward as you wouldn’t be able to save an unformatted Swift file, let alone get it into git. But that’s not all. It’s also easier for everyone (rather than just the people on your team) to understand code if we have a formatting standard.

Apple would need to lead this effort, though. They’re the only ones who can define a style everyone would widely adopt, and wide adoption is critical. It may sound far-fetched, but they wouldn’t be the first to do it. Prettier is very popular, and I believe the Go community has embraced standard formatting that go fmt applies.

What do you say, Apple? Will you make my wish come true in Xcode 15?

Dave Verwer

 
 

  Sponsored Link  

 

Scalable Apple silicon M1 in the cloud, for your iOS CI/CD by Bitrise

Accelerate your transition to Apple Silicon through our fully virtualized, scalable M1 compute options, and build and test faster than ever.

bitrise.io

 
 
 

  News  

 

Behind the times?

It’s easy to think that if you’re not already adopting every new SwiftUI API, you’re falling behind. You’re not! I try and link to something that reinforces this message at this point in the beta cycle every year, and Matt Ronge gave me the perfect tweet to link to this year.

I also get regular emails from readers asking if I would link to more Objective-C blog posts. The reality is that very few (if any!) people are still writing about Objective-C, but that doesn’t mean no one is using it. It may not be in the limelight anymore, but it’s not dead.

twitter.com

 
 

  Tools  

 

Swift Regex

There are plenty of online regular expression tools, so why would I link to another? Because none of them, apart from this one from Kishikawa Katsumi, supports the new Swift RegexBuilder DSL! It's running the expressions server-side, too, so you're getting an accurate representation of how your regular expression will work.

swiftregex.com

 

X-SwiftFormat

You won’t get an Apple-defined formatting style or auto-format on saving your files, but you can run either swift-format or Nick Lockwood’s SwiftFormat on your currently open file with an Xcode extension. Thanks to Rui Aureliano for creating this!

github.com

 

Multiliner

Talking of Xcode extensions, here’s a new one from Andrew Zheng that does only one thing, but it’s something you might find yourself doing several times every day. Take an array, initialiser, or function call you wrote on one line and expand it to cover multiple lines. Simple!

github.com

 
 

  Code  

 

Get URLs for system folders in iOS 16

Finally!

It wasn't a huge pain to use the full APIs for getting to commonly used directory paths, but it was long-winded enough that I'd usually make a helper method that effectively did what this new API provides. The changes to directory checking when appending to a file system URL are also fantastic. Thanks to Natalia Panferova for writing this up!

nilcoalescing.com

 

Creating custom extension points for Mac apps with ExtensionKit

I had completely missed the announcement of ExtensionKit during this year’s WWDC. It’s an entirely new framework that, to quote Apple, allows you to “extend the functionality of other apps by presenting a user interface”. That sounds exciting, and if you think that’d be the kind of framework Gui Rambo would be interested in, you’d be right. 🕵️‍♂️

rambo.codes

 

Understanding SwiftUI's ViewThatFits container

Is the ViewThatFits the most significant step forward in writing apps that adapt well to device/window sizes? I think it might be! Natascha Fadeeva has an excellent summary of how you can start using this new view.

tanaschita.com

 

Plurals

Pluralising a number in a string is easy, right? Well, as Danielle Grenier explains, it depends on how far you take it. I love a deep dive into a problem like this. 🚀

etsy.com

 
 

  Jobs  

 

Senior iOS Engineer (Swift) @ GoodNotes – GoodNotes is a top-rated paid-for productivity app, available to use on iPad, iPhone and Mac devices with over 10m MAU. You will own your projects and work alongside a high-calibre cross-functional team to continue delivering a product our users love! – Remote (within European or Asia-Pacific timezones) or on-site (Hong Kong or United Kingdom)

Senior iOS Engineer @ DuckDuckGo – An opportunity to work on a fast growing suite of privacy products (iOS & macOS browsers, upcoming new products for mobile/desktop) that will genuinely make the Internet a better place and that will bring it back to its core ideals. And all of that in an environment built for remote from ground up! – Remote (Anywhere)

Senior iOS Developer @ Dwell – Dwell App helps 100K+ believers cultivate a habit of living in the Bible. We love helping people connect more deeply with God through Scripture, and we enjoy the challenge of using technology to accomplish that mission. Our team is on the hunt for a new iOS team member who aligns with our mission. – Remote (within US timezones)

Senior iOS Developer @ Flightradar24 – Join the team at Flightradar24, working on the world's most popular flight tracking service. This is your chance to be part of our small but mighty mobile team, work on every part of our iOS app and have a big impact on over 3 million daily users. – Remote (within European timezones)

iOS Developer @ Rethink First – Join our team: Rethink First is a pioneer and market leader with an award-winning B2B and B2B2C SaaS solutions to drive mental and behavioral. You can expect a healthy work life balance with flexible hours, fully remote work, and a competitive benefits and comp plan. – Remote (within US timezones)

Senior iOS Engineer @ onX – Are you a Software Engineer that loves the outdoors? onX is hiring iOS Engineers. If you’re passionate about building great software, love playing outside, and believe in protecting access to public lands - then join onX, where we empower millions of outdoor enthusiasts to explore the unknown! – Remote (within US timezones) or on-site (United States in MT)

Senior iOS Developer @ E-gineering, Inc. – E-gineering is 100% employee-owned. We value our people and serve with excellence and integrity. For 12+ years, we have been recognized as the Best Places to Work in Indiana, consistently ranking in the top 3 of our category. – Remote (within US timezones)

Senior iOS Engineer @ Doximity – Doximity, the medical network used by over 80% of US clinicians, is hiring passionate iOS engineers (fully remote!). Come be part of an amazing product team + work on an app that is constantly evolving. Use your skills (Swift, MVVM, FRP) to be an integral part of our newly launched telemed feature. – Remote (within US timezones)

Senior iOS Developer @ Chariot Solutions – Chariot Solutions is a Philly based consulting company that strives to create a product company culture. Celebrating our 20th year in business, we work hard to win exciting projects with some of the top companies in the world, while helping our employees maintain a great work life balance. – Remote (within US timezones)

Senior iOS Developer @ Covenant Eyes – The combination of competitive compensation, family atmosphere, low turnover, and a people-first culture make this an excellent place to work. We are proud to have been named #2 in Mid-Sized company category of Michigan Top Workplaces 2021 (Detroit Free Press). We are a 100% Employee Owned company! – Remote (within US timezones) with some on-site work (United States in MI)

Mobile Full Stack Engineer @ Expensify – Join our passionate team of top-notch engineers to solve a real-world problem, and help people spend less time managing expenses and more time pursuing their real goals. – Remote (Anywhere) with some on-site work (Australia, United Kingdom, or United States in CA, MI, NY, or OR)

 

There are many more jobs available over on iOS Dev Jobs. Sign up for a filtered email digest of jobs that match what you're looking for and get a fresh set of jobs in your inbox every Monday.

 
 

  And finally...  

 

Did you hear about that new programming language, Swift?

I did consider putting a calendar reminder for five years from now instead of linking to it this week. But I don't have the patience for a joke with that long a payoff! 😂

 
You received this email because you subscribed via the iOS Dev Weekly site.
We'll be sorry to see you go but you can unsubscribe instantly.
 
Shiny Development Ltd. Daresbury Innovation Centre Keckwick Lane Daresbury Cheshire WA4 4FS United Kingdom
 
 

 
 
©2022 iOS Dev Weekly | Privacy Policy | Twitter | Suggest a Link
 
Published with Curated

Older messages

iOS Dev Weekly - Issue 564

Friday, June 24, 2022

Discoverability and Siri. What's the answer? 🤷‍♂️ View on the Web Archives ISSUE 564 June 24th 2022 Comment I know this is a bit of an NSHipster move, but a new API from last week's WWDC has

iOS Dev Weekly - Issue 563

Friday, June 17, 2022

The best way to think about SwiftUI and how you should treat new technology. 😶‍🌫️ View on the Web Archives ISSUE 563 June 17th 2022 Comment I've lost count of how many times I've seen someone

iOS Dev Weekly - Issue 562

Friday, June 10, 2022

So many announcements and new APIs, and all we can talk about is regular expressions? 😂 View on the Web Archives ISSUE 562 June 10th 2022 Comment So, I successfully predicted this wasn't the big AR

iOS Dev Weekly - Issue 561

Saturday, June 4, 2022

There's just one more thing I need to mention before WWDC! A quick feature announcement for the Swift Package Index! 🚀 View on the Web Archives ISSUE 561 June 3rd 2022 Comment Coming up with ideas

iOS Dev Weekly - Issue 560

Friday, May 27, 2022

Don't want to write your own back-end server? Should you choose something from a big company, or use Parse… Wait. What? 🤯 View on the Web Archives ISSUE 560 May 27th 2022 Comment Do you remember

You Might Also Like

JSter #218 - Libraries and more

Wednesday, May 1, 2024

All JavaScript is good JavaScript. I'm close to done with my SurviveJS rework. The new site will have more content while being much lighter and faster to compile so that's all good. Libraries

BetterDev #258 - Build an 8-bit computer from scratch and Home automation with ESP8266

Wednesday, May 1, 2024

Better Dev #258 Apr 30, 2024 Hi all, We come back with a new issue this week. If you like BetterDev, please help spead word out by refer to your friends. Buy me a coffee would be great too. Build an 8-

Interface Interference 👎

Wednesday, May 1, 2024

Amid the AI device dunking, should everything “just be an app”? Here's a version for your browser. Hunting for the end of the long tail • April 30, 2024 Interface Interference The problem

Some Tesla Supercharger jobs get a jolt

Tuesday, April 30, 2024

Plus: Amazon CodeWhisperer changes its name and Arc gets a Windows version View this email online in your browser By Christine Hall Tuesday, April 30, 2024 Welcome to TechCrunch PM, bringing you the

Relief From Tinnitus: Free Discovery Call!

Tuesday, April 30, 2024

Do you suffer from tinnitus or a ringing in your ears? 1 in 3 adults over the age of 65 will suffer from this condition and often don't know there are things you can do to help. Our friends at

WebAIM April 2024 Newsletter

Tuesday, April 30, 2024

WebAIM April 2024 Newsletter Read this newsletter online at https://webaim.org/newsletter/2024/april Feature Web Accessibility in the 2024 Presidential Campaigns WebAIM's John Northup ran the US

👀 Being More Productive on a Smaller Screen — How to Hide Games on Steam Family Sharing

Tuesday, April 30, 2024

Also: What to Expect From Apple's "Let Loose" Event, and More! How-To Geek Logo April 30, 2024 Did You Know The letter J is the only letter that makes no appearance on the Periodic Table.

PEP 686, Lazy Evaluation, Serverless Python, and More

Tuesday, April 30, 2024

PEP 686: Make UTF-8 Mode Default #627 – APRIL 30, 2024 VIEW IN BROWSER The PyCoder's Weekly Logo PEP 686: Make UTF-8 Mode Default This Python Enhancement Proposal outlines making UTF-8 the default

Daily Coding Problem: Problem #1427 [Easy]

Tuesday, April 30, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Amazon. Given an array and a number k that's smaller than the length of the array,

🎙 My advice for film + TV creatives on the AI wave

Tuesday, April 30, 2024

Learning AI fast + Karate Kid references ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌