Khoa 🔥 Profile picture
Mar 16 6 tweets 2 min read
Swift is a very typesafe and expressive language.

With newer features mean we can find new ways to write even more concise Swift code.

Below are 5 sweet techniques that you can use to supercharge your codebase #iosdev 💪🤩
💪 allSatisfy

Instead of using filter and count, you can use allSatisfy to check whether all element satisfies a given condition Image
💪 keyPath

Available since Swift 5.2, keyPath is a type that references a property, allowing us to write much cleaner code.

Given that it is a type, we can store keyPath, pass it around, and combine them. Image
💪 Tuple
We can use tuples to sort based on multiple properties.

A tuple of Comparable elements conforms to Comparable protocol, meaning that each element in 2 tuples is compared in order.

Here we want to show a list of payments, sorted by beneficiary name, then to date. Image
💪 Raw string

With raw string, quotes and backslash are not treated as terminators or escape characters.

All we have to do is to use surround our string with hash # Image
💪 Subscript

Subscript has been around since the beginning in Swift, allowing us to specify accessing with square brackets.

What's nifty, is that it allows multiple parameters, and we can even name external parameters. Image

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Khoa 🔥

Khoa 🔥 Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @onmyway133

Mar 14
Always want to invest more in your iOS knowledge but don't know where to start?

Here are 7 of the best iOS and SwiftUI courses to subscribe to 👩‍🏫🧑‍🏫

(Disclaimer: I'm not affiliated to any, these are merely based on what I've tried and found useful)
🌼 Hacking With Swift+
by @twostraw

Subscription service that offers exclusive tips and techniques, as well as whole app creation. Some free content are intriguing enough not to miss.

hackingwithswift.com/plus
🌼 Design+Code
by @designcodeio

The content here is top-notch. Get access to premium courses and tutorials, f.e. Build Quick App and Advanced Development with SwiftUI. The content is updated frequently for new SwiftUI versions

designcode.io
Read 8 tweets
Mar 3
I just want to share a list of 8 iOS information websites that have kept me updated during my development career.

I didn't know I need these, but then I bookmarked for use every day ⚡️
⚡️ iOS and iPadOS usage

Official iOS and iPad OS usage statistics by @AppStore measured by devices that transacted recently.

A friendly reminder that 98% of all iOS devices introduced in the last 4 years install iOS 14 and iOS 15 💪

developer.apple.com/support/app-st…
⚡️ Xcode Releases

Updated links and detailed information of all available Xcode versions and their direct DMG link. I've stopped downloading Xcode from AppStore after I found out that the direct link download is more stable.

xcodereleases.com
Read 9 tweets
Mar 2
How do you keep up with iOS development when things are moving quite fast?

To me, it's about reading newsletters 😎

Here are 4 newsletters that I've found insightful over the years ⚡️
📬 @iOSDevWeekly

Do you know when the first issue came out? August 5th 2011!

For over 10 years, @daveverwer has accompanied iOS community and delivered great summaries.

To me, iOSDevWeekly is where all the best and popular resources are mentioned

iosdevweekly.com
📬 iOS Goodies

Started by @peres, @_tiagoalmeida and now maintained by @marius_const, it is an open-sourced where everyone is welcome to submit.

Easily to find essential articles, libraries quickly every issue. Not to mention the good introduction.

ios-goodies.com
Read 5 tweets
Nov 3, 2021
Do you plan to get started in Mac development, especially with SwiftUI?

I'm by no mean Mac expert, but I've made quite a few Mac apps and I've bookmarked some useful resources and tools along the way.

Since many have asked me for recommendation, here is the list 🧵👇
🖥 First of all, how is macOS different from other platforms like iOS, tvOS and watchOS?

Each device has different capabilities and is meant for different purposes.

The Mac is:
- Flexible
- Focused
- Expensive
- Capable
🖥 Human Interface Guidelines

The above 4 points are the distinct theme of Mac, and is from the Human Interface Guidelines, or HIG for short.

Be sure to check it to learn more about macOS design decisions. developer.apple.com/design/human-i…
Read 15 tweets
Nov 2, 2021
Hi iOS and macOS developers, where are you currently hanging out?

Here are the active communities on @SlackHQ I've joined and founded useful 🧵👇
🌍 iOS Developers

The most active community for iOS and Swift developers I've found, with over 30,000 members. You can find many familiar faces here eg. @donnywals @aaron_pearce

ios-developers.io
🌍 Airport Community

Originally created by @jsngr and @SiddDevs as place to discover new TestFlight apps, now there's active community here discussing and showing new beta.

airport.community/slack
Read 10 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(