Software Dev

Automatically resolve Xcode project file conflicts

Xcode project files are complex and not meant to be human-readable, so they can be scary to merge. When there’s a conflict, it’s never fun.

The tool Kintsugi intends to automatically solve these conflicts for you “99.9% of the time.”

πŸ‘‰Automatically merging conflicts in Xcode project files | github

The name Kintsugi (ι‡‘ηΆ™γŽ) is well-chosen, meaning “the art of repairing broken pottery by mending it with gold.” 🀯

Another interesting note: this project relies on a framework called Xcodeproj that lets you create and modify Xcode project files automatically. That sounds likes a better alternative than a homespun shell script. πŸ‘

via iOS Dev Weekly

Software Dev

Debug network connections right from Xcode

Debugging live network traffic in your app is always interesting. There are some great apps for tracking your network connections, such as the cross-platform classic Charles Proxy, the more modern and Mac-assed alternative Proxyman, and even an embedded framework like Pulse.

And now with Xcode 13, you can forgo the third-party apps altogether if you so choose. This comes in especially handy if your company has third-party apps locked down. πŸ€·πŸ»β€β™‚οΈ

πŸ‘‰ Check out Inspecting HTTP Traffic With Instruments

Or go straight to the source with Apple’s WWDC session Analyze HTTP traffic in Instruments.

via iOS Dev Weekly.

Software Dev

Getting Started with Instruments

Has there ever been a more powerful, but under-utilised tool than Instruments?

Instruments is a tool included with Xcode that helps you analyze, profile, and debug your live iOS app. Solve memory leaks. Visualize memory. Monitor disk, network, memory, and battery usage. You can even find zombies. πŸ§Ÿβ€β™‚οΈ

It lets you do incredible things but is also overwhelming to new developers, in which case this Ray Wenderlich tutorial can come in pretty handy.

πŸ‘‰ Getting Started with Instruments

There’s also an Apple WWDC presentation with this same name. πŸ˜†

Visual Memory Debugger

Via iOS Dev Weekly.

Software Dev

It’s Time for Snapshot Testing

I love the idea of snapshot testing. It’s a simple way to automatically test an app’s UI.

It works like this:

  1. Set the app up in a certain state and take a screenshot. Save the screenshot. πŸ“Έ
  2. Next time when you run the same test, you compare screenshots. πŸ“· πŸ“Έ
  3. If something changed unexpectedly, then you know there’s trouble. πŸ’₯

Here’s a nice series about how to do it for iOS/ Xcode.

πŸ‘‰ Snapshot Testing. Testing the UI and Beyond (Part 1)

And GitHub: swift-snapshot-testing

The coolest thing is that you actually upload your screenshots in any new pull requests, so you can literally see what the change is all about (“The perfect pull request”). 🀯

Image for post

Via iOS Dev Weekly.

Software Dev

New Wisdom On Configuring Xcode Projects for Different Environments

It seems like it would be simple and/or obvious how to configure your app to point to different environments (dev, QA, prod, etc.). But alas, it is neither simple nor obvious.

Here is some easy, practical wisdom that breaks down five different ways to configure different environments in an Xcode project. Spoiler: it finally lands on Script Phases. πŸ€·πŸ»β€β™‚οΈ

πŸ‘‰ How to configure Xcode projects for different environments

First of all, ❗️ do not use targets for environmental configuration purposes

Via iOS Dev Weekly.

Software Dev

Fun Xcode Search Tip

Here’s a great tip for anyone using Xcode: when you’re going through a list of search results, you can just delete the items you’re not interesting in. 🀯 It’s so weirdly simple and obvious but surprising.

Via iOS Dev Weekly.

Software Dev

Scroll Hitch Rate

Xcode 12 is adding a new metric to objectively track how smoothly your app scrolls. This is kind of cool since scrolling smoothness feels right and is a sign of a good design.

Via iOS Dev Weekly.

Software Dev

Frame vs Bounds in iOS

Frames and bounds are a really core concept in iOS development. They are both just rectangles in different coordinate systems. Simple, right? Well, not always. πŸ€¦πŸ»β€β™‚οΈ

If you ever still get lost on frames vs. bounds in iOS development, here’s a good quick summary.

πŸ‘‰ Frame vs Bounds in iOS

And here’s a good example of how a transform can affect the frame and bounds differently, via iOS Dev Weekly.

πŸ‘‰ CGAffineTransform and Auto Layout

Software Dev

Scroll Views in Interface Builder

There are a couple of tricks to getting your scroll view working in an Xcode storyboard. The great fluffy.es blog carefully walks you through it. πŸ‘

πŸ‘‰ How to use scroll view in Interface Builder / Storyboard (Xcode 11)

This site also has some really helpful notes on intrinsic size. And a great series on Making Sense of Auto Layout. Who knew? This guy is good. He’s giving Ray Wenderlich a run for his money. 😲

constraint explanation