Image for post
Image for post

How many useful things can you learn from a single tweet?

Unexpectedly, a lot! Some people tweet about Xcode hidden features, neat Swift tricks or time-saving shortcuts. Let’s learn how to become a more productive developer in 140 symbols.

Twitter tip #1
Did you know, that it’s possible to convert any Swift error into an NSError? With this little tip John Sundell shows how to make error handling cleaner:

One more gem just in the comment to John’s tweet. Kostas Kremizas also advises how to use NSError domains and codes for pattern matching:

Twitter tip #2
An interesting approach for creating cross platform models which uses an image as a property (for iOS and macOS):

You can find the full Gist here and learn more from John’s podcast (the episode with Guilherme Rambo on reverse engineering and macOS development).

Twitter tip #3
Simple advice on how to convert String to Data in a readable and cleaner way:

Twitter tip #4
Everyone should know this! Print Tyler’s tweet and hang it above your monitor:

Twitter tip #5
And this is a great way to debug your AutoLayout constraints. Just enable _UIConstraintBasedLayoutPlaySoundOnUnsatisfiable flag in the user defaults:

Twitter tip #6
Want to create a neat protocol-oriented API which can only be mutated internally? Check this snippet:

Twitter tip #7
An awesome tip for those who care about the disk space. This little command will remove all unavailable simulators from Xcode. Thanks Julio!

Twitter tip #8
You can make optional chaining easier and more readable. Our friend, Paul Taykalo,‏ knows how to make your life better :) And here is the full Gist.

Twitter tip #9
Use elementsEqual() method on unordered collections (Set or Dictionary, for example) with caution. It could lead to wrong results because it uses elements order as well for comparison:

Twitter tip #10
Know your tool! This little trick in Xcode 9 will enable Swift generated interface mode in “Quick Open” search bar. So, you will see all results in Swift:

Twitter tip #11
Daniel Martín‏ shares an internal Xcode SourceKit console. It lets you send YAML requests and crashes the service if you need to:

Twitter tip #12
Have you ever file a radar? If yes, you’ll find this small bash script by Ole Begemann pretty useful. It collects Xcode and macOS versions and saves it to the pasteboard. So you can easily paste it to your radar:

Twitter tip #13
One last useful Twitter gem with more design focus. It’s a collection of 32 UI tips for improving design skills. Can be super valuable for indie engineers:

Thanks to all the community for these hacks! Please, add your favourite Twitter tips in the comments. I will come back with more tips next month.

P.S.: Maybe you know, that I’m a startup founder and we’re working hard to push Flawless App forward. If you have some time to support our tool for visual quality check, please give us your honest feedback. The more feedback we get, the more we can improve Flawless App. Thanks :)

Flawless iOS

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store