Kodebits: May 2026 in Review
Month two of Kodebits included 18 bite-sized coding insights across iOS, Android and Flutter. Here’s the full archive, grouped by platform and sorted from warm-up to deep end. By Sam Davies.
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress, bookmark, personalise your learner profile and more!
Create accountAlready a member of Kodeco? Sign in
Contents
Kodebits: May 2026 in Review
5 mins
Following on from last month’s first roundup, Kodebits continued through May at the same cadence: short challenges and snippets you can work through in a coffee break, dropping first on social media and then living on the Kodebits archive for the long term.
We published 18 bits in May, again spanning iOS/Swift, Android/Kotlin and Flutter/Dart. This roundup gathers them in one place, grouped by platform and ordered from easiest to hardest, with a short note on what each one is good for. If you missed any, this is the catch-up.
When you visit each of the Kodebit pages, you’ll see the problem, along with a solution and explanation. We’ve also provided links to content across the site that will allow you to delve deeper into the topic covered.
iOS & Swift
Ten Kodebits in May continue Swift’s run as our most-covered platform. The lineup leans into collection manipulation and the Result type — taken together with April’s bits, this is becoming a fairly thorough tour of how Swift expects you to transform and propagate data. There’s also a pair on closure capture semantics for anyone who didn’t sleep well after April’s Day 5, and a couple of beginner-friendly bits on optionals and computed properties for anyone working through the fundamentals.
Beginner
- Day 18: Optional Chaining A revisit of optional chaining in a fresh context. Day 1 covered the same ground; if it didn’t quite stick the first time, this is a good second pass.
- Day 31: Computed Property A property whose value is calculated on each access rather than stored. Useful when something can be derived from other state: there’s no risk of the two getting out of sync, and no extra memory to manage.
Intermediate
-
Day 15: Filter Then Sort Chain
filterandsortedto transform an array in a single readable expression. Once you start composing collection operators this way, looping over arrays imperatively starts to feel like the long way round. -
Day 21: Result Map Value Continues the
Resultstory from April’s Day 8, this time focusing on transforming the success payload while preserving the error type. Practice for working with networking or any throwing API that’s wrapped inResult. -
Day 23: Dictionary Defaults Use the default-value subscript on
Dictionaryto read or mutate keys that might not be present. The cleanest way to write counting, grouping, or accumulator code withoutif letladders. -
Day 24: Result Failure Path The counterpart to Day 21. Use
mapErrorto transform the failure case while leaving success values untouched. Useful when you want to translate low-level errors into something your callers can actually act on. - Day 27: Optional Chaining A second optional-chaining challenge, this time a notch tougher. Tests whether you can predict the result when chains involve method calls and subscripts at different points along the line.
-
Day 28: Enum Associated Values Enums in Swift can carry payloads, which is how
Result,Optional, and most of the type system’s expressive corners are built. This bit gets you comfortable destructuring them with pattern matching.
Advanced
- Day 17: Closure Reference Capture Building on April’s Day 5, this digs into how closures hold strong references to captured variables and what that means for retain cycles. The bug that quietly leaks memory in real apps.
- Day 25: Capture List Value Use a capture list to take a snapshot of a value at the point the closure is created, rather than reading the current value when it eventually runs. The fix for “but I just set it to 5, why is it printing 10?”
Android & Kotlin
Four Kodebits in May — three on collections (counting with predicates, default-on-miss map access, and lazy Sequence evaluation), plus a look at extension functions, the Kotlin feature you’ll reach for daily once you’ve used it once.
Beginner
-
Day 19: Count With Predicate Use
count { ... }to count elements that satisfy a condition, without an intermediatefiltercall. The kind of small expressive win that adds up across a codebase. -
Day 30: Extension Function Add methods to existing types from the outside. Lets you write
"Ko".twice()as thoughtwicehad always been part ofString. One of Kotlin’s most reach-for-it-daily features, and a frequent reason Java code translates to something much shorter in Kotlin.
Intermediate
-
Day 20: Map getOrPut Read a key from a map, or insert and return a default if it’s missing — all in a single call. Much cleaner than the equivalent
containsKey-plus-putpattern, and the natural building block for grouping or memoisation.
Advanced
-
Day 16: Sequence Map Take Use a
Sequenceto evaluate transformations lazily, somapandtakeonly do as much work as you actually need. Essential reading if you’re working with large collections or chained operations where eager evaluation would be wasteful.
Flutter & Dart
Four Kodebits in May, mostly at the gentle end of the dial. We revisit ?? and cascade notation from April — ?? twice, at progressively trickier levels — and add a quick set-membership check. A good month if you’ve been meaning to brush up on Dart syntax without committing to anything heavy.
Beginner
-
Day 22: Null-Aware Operator A focused look at the
??operator on its own. If April’s Day 12 combination of safe access and fallback felt like a lot, this isolates the fallback half so you can see it in clear air. -
Day 26: Set Membership Check Test for the presence of an element in a
Setand let Dart’s type system help you do it correctly. A reminder that picking the right collection matters as much as the operations you run on it. -
Day 29: Cascade Notation A second look at the
..operator, this time as a quick reflex test. If you got April’s Day 4 first time round, this should be a satisfying flick.
Intermediate
-
Day 32: Null-Aware Operator A return to
??at a tougher level. If Day 22 introduced the operator in clear air, this one tests whether you can predict the result when the left-hand expression is doing a bit more work.