Every week, one of our iOS devs shares a special tip in the engineering meeting. Here’s this week’s tip from @[email protected]:

Treat your Xcode search results as a to-do list and delete (⌫) results when you no longer need them. #iOSDevTips

Another tip from @[email protected]:

If you work on one project every day, you’re probably tired of cd-ing to that directory. Save keystrokes by adding "cd /project/directory/here" to your .bash_profile or .zshenv. Now, every new Terminal window and tab will start there! #iOSdevtips

This week’s tip is from @[email protected]:

It’s that time of the year again when your application certificates have expired. Did you know you can renew and export your new certificates directly from Xcode’s preferences? #iOSdevtips

Today’s tip is from @[email protected]:

Use the 🔎 icon in Xcode’s Search Navigator to search for patterns like <Any>. Then, you copy and paste those patterns into the Replace field to do large, complex find and replace operations.

A good example might be making all your classes final. 💫

A testing tip from @[email protected]:

If you use @[email protected]’s SnapshotTesting library, you can see the images and diffs for failing tests right from within Xcode’s Log Navigator. They use a recent Xcode feature called Test Attachments, and it’s so handy. ✨

https://github.com/pointfreeco/swift-snapshot-testing

GitHub - pointfreeco/swift-snapshot-testing: 📸 Delightful Swift snapshot testing.

📸 Delightful Swift snapshot testing. Contribute to pointfreeco/swift-snapshot-testing development by creating an account on GitHub.

GitHub

Today’s tip is from @[email protected] about localization:

🌍 Ever forget to localize a string? Use Xcode’s Refactor → Wrap in NSLocalized String command to make localizing your UI copy a snap.

Right click on any string, run the command, add the comment, and you’re done. #iOSDevTips https://t.co/LroOb0fDsW

Lickability on Twitter

“Today’s tip is from @mb about localization: 🌍 Ever forget to localize a string? Use Xcode’s Refactor → Wrap in NSLocalized String command to make localizing your UI copy a snap. Right click on any string, run the command, add the comment, and you’re done. #iOSDevTips https://t.co/LroOb0fDsW”

@[email protected] 📣 We’re back from holiday break with more #iOSDevTips! This one is from our friend @[email protected] and makes working on changes to big files much easier. https://twitter.com/gregheo/status/1098257145496166400?s=20
Greg Heo on Twitter

“New favorite Xcode keyboard shortcut: control-backslash. For a big file that you've changed and then scrolled around in, gets you back to your changes 📝 https://t.co/1GmOqT5InR”

Twitter

⤵️ Ever forget which SwiftUI property wrapper you’re supposed to use in a given situation? Happens to the best of us. This week’s #iOSDevTips is from @[email protected], who made this handy interactive decision tree to help you remember.

https://www.hackingwithswift.com/articles/227/which-swiftui-property-wrapper

Which SwiftUI property wrapper to choose in any situation

Decide which property wrapper is the right choice for your needs.

🧠 Today’s #iOSDevTips installment comes from @[email protected]. It’s a philosophy on naming they bring up in code review a lot:

If you can’t figure out a good, simple name for your type, it may be poorly factored code. Try splitting up the object into small pieces that are easier to name. 🪄

🌟 We’re back with more #iOSDevTips! This one comes from @[email protected], and it’s part of a great post full of Xcode tips that you should check out: https://www.hackingwithswift.com/articles/229/24-quick-xcode-tips
24 Quick Xcode Tips

Write code faster, build better tests, and navigate around projects more efficiently.

🔗 Today’s #iOSDevTips on Universal Links comes from @[email protected]:

Is your app site association file growing too large? We were able to massively simplify one for a client by using the updated format and new substitution variables introduced in iOS 13.5.

🆕 https://developer.apple.com/documentation/bundleresources/applinks/substitutionvariables

Apple Developer Documentation

We’re back with more #iOSDevTips 💥

@[email protected] heard about this site via @[email protected] and wanted to share the love—lets you convert your JSON into Codable models for Swift:

👉 http://quicktype.io

Convert JSON to Swift, C#, TypeScript, Objective-C, Go, Java, C++ and more • quicktype

quicktype generates types and helper code for reading JSON in C#, Swift, JavaScript, Flow, Python, TypeScript, Go, Rust, Objective-C, Kotlin, C++ and more. Customize online with advanced options, or download a command-line tool.

For our #iOSDevTips post this week, @[email protected] spotted this tweet about a really handy keyboard shortcut that’s especially useful in large Xcode projects. ⌨️

Once you learn it, you’ll use it daily.💡 https://twitter.com/jordanmorgan10/status/1368985366586396676

Jordan Morgan on Twitter

“Here's one that saves my 🥓 when working in larger Xcode projects: Shift + Command + J It automatically finds the current file in Project Navigator and focuses it for you 💫 https://t.co/N9y82RxDVC”

Twitter

🛠✨ This week’s #iOSDevTips tweet comes from @[email protected], and @[email protected] has started using it regularly when Refactor and Edit All in Scope don’t fit the bill!

https://twitter.com/MuseumShuffle/status/1379584369388625922

Chris Wu on Twitter

“TIL that in Xcode's "Find and Replace" section if you hold down the option key "Replace All" will change to "Replace All In Selection".”

Twitter

Another week, another #iOSDevTips tweet!

We often attach gifs or videos to our pull requests to show reviewers our features in action. With Xcode 12.5, we’re able to save a few steps and record directly from the simulator! 😍

https://twitter.com/txaiwieser/status/1387892348378652672?s=20

Txai Wieser 🌿 on Twitter

“New on Xcode 12.5: If you hold the option key the Simulator shows an option to record the device screen. You can save it as a video or GIF! https://t.co/rnc2LqZPvA”

Twitter

🤩 Our tip this week is from @[email protected]!

To sort all the files in an Xcode group by either name or by type, select the group and navigate to Edit → Sort → By Name or By Type. #iOSDevTips

Here's a tip from @[email protected] 📣

Starting in Xcode 11, you can mark assets as “development assets,” and they won't be added to your shipping app—which is great for test data in SwiftUI previews! #iOSDevTips

https://useyourloaf.com/blog/swiftui-preview-data/

SwiftUI Preview Data

Where do you put your SwiftUI preview data? See how Xcode development assets can help.

This week's tip is from @[email protected]!

You can specify a hex value when defining colors in asset catalogs by selecting an individual color variant and using the Attributes Inspector. Comes in pretty handy if your design system uses hex values! 🎨 #iOSDevTips

Andi Rohn 🏳️‍⚧️ on Twitter

“"Xcode 13 adds column breakpoints which work like a more granular version of line breakpoints. Here’s how you use them." Via https://t.co/r5aCL576F2”

Twitter

✨ A tip from @[email protected]:

I don’t know who needs to hear this, but if you’re using an M1 Mac and your dependencies don’t support multiple simulator architectures, check “Open using Rosetta” in the Info Panel on Xcode and Simulator, and relaunch! #iOSDevTips

💡 This week's tip comes from @[email protected]:

If you're unsatisfied with Xcode Simulator gifs, you can adjust the quality and animation smoothness in the Simulator Preferences menu below—no more choppy gifs! #iOSDevTips

🤝Here’s a tip from @[email protected]: don’t forget to credit your teammates when you’re pair programming using @[email protected]’s co-authors feature. #iOSDevTips

Here’s how to use it: https://docs.github.com/en/github/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors

Creating a commit with multiple authors - GitHub Docs

You can attribute a commit to more than one author by adding one or more Co-authored-by trailers to the commit's message. Co-authored commits are visible on GitHub.

🌟Today’s tip is from our friend @[email protected]! Another super useful keyboard shortcut to remember:

#iOSDevTips https://twitter.com/jordanmorgan10/status/1428081541700325377

Jordan Morgan on Twitter

“💡Did you know? Xcode Edition 💡 You can zoom out and see all of your open tabs, the same way that you can in Safari, within Xcode. I use this to gain context on all that I've got going on and to quickly choose a file instead of tabbing my way there. The shortcut is "⌘ ⇧ \" https://t.co/DW8AauDlWQ”

Twitter

@[email protected] 🅰️ In iOS 15, you can limit the min and max sizes of Dynamic Type in any view using the new minimum and maximum contentSizeCategory properties.

This is great for making sure your layout doesn't break at huge sizes (but don't overdo it). #iOSDevTips

https://useyourloaf.com/blog/restricting-dynamic-type-sizes/

Restricting Dynamic Type Sizes

In iOS 15 you can set limits on the minimum and maximum sizes of dynamic type.

⌨️ One of our most-used Xcode keyboard shortcuts is ⌃⌘↑ — which lets you jump straight to an Objective-C header file for the current class, or generated interface for a Swift file. #iOSDevTips
🎨 Great tip from @[email protected] for transforming colors into human-readable names! #iOSDevTips https://twitter.com/jordanmorgan10/status/1450457677503635467?s=21
Jordan Morgan on Twitter

“🎨 Cool API Alert 🎨 AXNameFromColor. Snag a human readable string from any CGColor ✨ You can use this for accessibility traits to boost VoiceOver experiences, or even leverage its utility outside of accessibility specific scenarios where you simply need a color's name.”

Twitter
@[email protected] 🅰️🔍 This tip is especially useful if you work on apps that support Dynamic Type! #iOSDevTips
https://twitter.com/marcoarment/status/1457346686972571650?s=21
Marco Arment on Twitter

“THANK YOU to whoever added preferred-text-size changes as keyboard shortcuts in the iOS Simulator! (I don’t know how long they’ve been there)”

Twitter

@[email protected] Ever have your unit tests fail and end up with a console full of logs you don't understand? We've been loving this new feature from Kaleidoscope that helps you get to the bottom of it! 🕵️‍♂️🔍 #iOSDevTips

https://twitter.com/kaleidoscopeapp/status/1478411978527940613?s=20&t=Rne_1y84L3SBk6Lt84gGGQ

Kaleidoscope on Twitter

“Want to avoid the drudgery of interpreting complex XCTest failures? Kaleidoscope makes the diffs easy to spot! Here’s how: https://t.co/5kF29gH4G5”

Twitter

@[email protected] Last year, we found a performance issue in UICollectionViewDiffableDataSource. After reporting the bug & speaking to Apple at WWDC, @[email protected] was excited that it's now fixed in the iOS 15.4 beta!

If you have this issue, try Xcode beta 🎉 #iOSDevTips

https://twitter.com/mb/status/1445431586430799877

Matthew Bischoff on Twitter

“ friends that work on UIKIt, I’d really appreciate you taking a look at a pretty big performance regression in UICollectionViewDiffableDataSource that @Cordavi recently found. applefeedback://FB9649428 https://t.co/Na6Fgd0CQO”

Twitter

👀 Ever wanted to know where and how Apple uses web views in their Mac apps? Use the Web Inspector from Safari → Develop → App Name. #iOSDevTips

https://twitter.com/jimniels/status/1498337278875348994?s=20&t=79LHntuSfogtuJxNJXJAzg

Jim Nielsen on Twitter

“📝 Blogged some about how you can use Safari’s Web Inspector to look under the hood of certain views in macOS. No real utility here—just fun. Thx to @samhenrigold for the tip. https://t.co/TbeeWODla9”

Twitter

🔎 Have you ever needed to check if one Swift string contains another regardless of case? Use the options parameter on the .range() method & specify .caseInsensitive — thanks to our friend @[email protected] for the tip! #iOSDevTips

https://www.hackingwithswift.com/example-code/strings/how-to-run-a-case-insensitive-search-for-one-string-inside-another

How to run a case-insensitive search for one string inside another - free Swift 5.4 example code and tips

Learn Swift coding for iOS with these free tutorials

Hacking with Swift

@[email protected] 📲 Ever needed to find the device ID of a running iOS Simulator? Try this handy Terminal command from @[email protected]:

xcrun simctl list | egrep '(Booted)'

#iOSDevTips

📲 Ever needed to find the device ID of a running iOS Simulator? Try this handy Terminal command from @[email protected]:

xcrun simctl list | egrep '(Booted)'

#iOSDevTips

👀 For those times you don’t want to be distracted by Twitter, did you know that you can fullscreen Xcode and the Simulator side-by-side with split screen?

#iOSDevTips via @[email protected]

⏰ It’s super easy to forget about the Date.formatted() method that was introduced in iOS 15—so thank you to our friend @[email protected] for this #iOSDevTips reminder https://twitter.com/MuseumShuffle/status/1524738580068941826
Chris Wu on Twitter

“Wow! Rising star @tundsdev showed me there's a much easier way to display the specific date I wanted that will adapt to locales. I've been using .formatted(date:, time:) a lot but had no idea that this other variation existed.”

Twitter

If you’re ever writing UI tests and you want to see a textual representation of the UI tree, run print(XCUIApplication().debugDescription) 🤖

Thanks for the tip @[email protected]! #iOSDevTips

🔎 This is a great #iOSDevTips from @[email protected] ! We’re already using this new feature in iOS 16 to find and fix hangs in our apps.

https://twitter.com/qzervaas/status/1547123259484672000

Quentin Zervaas on Twitter

“The new “Hang Detection” developer option in iOS 16 is amazing. (Settings app > Developer > Hang Detection) Found 2 easily-fixed hangs immediately in Streaks. Device auto-records stack-trace when a hang occurs.”

Twitter

Our engineers have been waiting for this feature since SwiftUI was introduced! Thanks @[email protected] for the #iOSDevTips 🙏

https://twitter.com/clarko/status/1552383186604216321?s=21&t=0p4GnP-oBWCqgbOK7o30tQ

Clarko on Twitter

“Whoa, pull-to-refresh has a new trick in iOS 16 beta 4 👀 Used to be, SwiftUI could only do it on Lists. You have a Grid? Tough cookies. Now seems to work on any ScrollView!”

Twitter

🪧 Our designer was super excited that UIMenu gained size options for elements in iOS 16!

Specify them with the preferredElementSize API:
https://developer.apple.com/documentation/uikit/uimenu/4013313-preferredelementsize?changes=latest_minor

#iOSDevTips

Apple Developer Documentation

If you’re not already using an 8pt grid in your designs, @[email protected] makes it super easy to get into the habit with a configurable nudge shortcut. Set it up in the Canvas Preferences, under “Nudging” 👇 #iOSDevTips

🪫 If the Xcode 14 beta is draining your laptop battery, our friend @[email protected] put together a blog post with a workaround! It's been a lifesaver. #iOSDevTips

https://blog.nihongo-app.com/stop-xcode-14-beta-from-pegging-cpu/

Stop Xcode 14 beta from draining your battery

There's a bug in Xcode 14 betas 4-6 that causes your CPU to go crazy and drain your battery. Here's a workaround.

Nihongo Blog
@lickability Holy s***. 30 GB for an IDE....