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):
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
elementsEqual() method on unordered collections (
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 :)