The power of subscripts in Swift | Swift by Sundell
This article has been archived, as it was published several years ago, so some of its information might now be outdated. For more recent articles, please visit the main article feed. Using subscripting to access elements within various collections, like arrays and dictionaries, is something that’s very common not only in Swift — but in almost all relatively modern programming languages. However, the way subscripting is actually implemented in Swift is both quite unique, and really powerful — as it lets us add subscripting APIs to our own types, just like those found in the standard library. This week, let’s take a look at how subscripting works in Swift, and a few different ways to incorporate it into the way we design APIs — including some brand new capabilities that are being added in Swift 5.1. Arguably the biggest benefit of subscripting is the incredibly lightweight syntax that it gives us at the call site. Rather than having to call specific methods with names that we either need
This article has been archived, as it was published several years ago, so some of its information might now be outdated. For more recent articles, please visit the main article feed . The power of subscripts in Swift subscripts language features the power of Swift 5.0 Published on 18 Aug 2019 Using subscripting to access elements within various collections, like arrays and dictionaries, is something that’s very common not only in Swift — but in almost all relatively modern programming languages. However, the way subscripting is actually implemented in Swift is both quite unique, and really pow
Explore this link on the map →related reading
- A half-hour to learn Rustfasterthanli.me
- SwiftUI by Example - free quick start tutorials for Swift developershackingwithswift.com
- Notes • Nick Arnernickarner.com
- Documentationdocs.swift.org
- The Slice Type - The Rust Programming Languagedoc.rust-lang.org
- Swift Protocol 背后的故事(Swift 5.6/5.7) | 雪峰的blogzxfcumtcs.github.io
- Swift Macros: Understanding Freestanding & Attached Macros - QuickBird Studiosquickbirdstudios.com
- Rust Language Cheat Sheetcheats.rs
- Swift: From Protocol to AssociatedType then Type Erasure | Welcome to Monstarlab’s Engineering Blogengineering.monstar-lab.com
- Property wrappers in Swift | Swift by Sundellswiftbysundell.com
- Combine | Apple Developer Documentationdeveloper.apple.com
- Building a menu using List - a free SwiftUI by Example tutorialhackingwithswift.com