 iOS Code Review | Curated code improvement tips - Issue #26

#26・
29

issues

Subscribe to our newsletter

By subscribing, you agree with Revue’s Terms of Service and Privacy Policy and understand that  iOS Code Review | Curated code improvement tips will receive your email address.

 iOS Code Review
 iOS Code Review
Hi there,
Every time I sit down to write an intro to an issue, I struggle between staying positive and the desire to address current events in the outside world. And every time I land on the decision to let this newsletter be a small island on the internet dedicated to learning something new in the field we’re passionate about.
If you are affected by war, the pandemic, or any of the other struggles in our crazy world - know that I think of you every time I write this 💛
And thanks to all of you for being loyal readers! Seeing the high open rates and receiving your feedback keeps my heart warm(-er) ☺️
So I hope you find something interesting in today’s collection. Let’s dive in?

Accessible custom tab bars
.tabBar accessibility trait is almost magical when it comes to making a custom tab bar view behave like a system one.
Daniel Devesa Derksen-Staats
Day 42. I'll never recommend creating a custom component if there is a native one that does the job. But if you develop a custom tab bar, .tabBar accessibility trait comes to the rescue. Apply to a container view and its buttons will be announced as tabs. #365DaysIOSAccessibility https://t.co/pME3aSGWfo
If you want to learn more about this, Bas Broek wrote a detailed article on implementing accessible custom tab bars:
Interactive image preview transition
This is so cool. I didn’t even realize that QuickLook framework can be used on iOS! Check out this short thread by Jordan:
Jordan Morgan
What!! I was today year's old when I realized you can use the QuickLook framework to perform this custom view controller transition for you....

....with one delegate method 🤯

I have written this transition myself several times, and it is *not* trivial to get right! https://t.co/HWgmmcGVwK
Sink
Danijela Vrzan
Do you know why it's called sink?
It's a common term in math and engineering that refers to end location of anything that flows (water, data, etc.).
Source is where the flow starts and sink is where the flow ends.
In Combine, stream flows towards .sink(receiveValue:). https://t.co/rp86gluVXF
Building safe APIs
The whole Swift language is built upon safety principles, so it only makes sense to apply them to our own APIs:
Bruno Rocha
A rule for making framework that has been working well for me: "How to make sure people can't misuse this API?"
Most issues I see in large apps are not because the framework devs made bad calls, but because people found clever ways to use the APIs that backfire in the long run.
NSPersistentCloudKitContainer trickiness
A comprehensive write up about the realities of using Core Data with CloudKit syncing. The article is a few months old, and just now it’s been updated with new findings. So if you’ve seen it before - it’s worth checking out again.
🤘☮️
Alright, that’s it for today. 
What do you think about me writing the comment above the tweet or link? Does it work? Or do you think it should be after? I’m curious to hear what you think. Let me know by replying to this email :)
Did you enjoy this issue? Let me know by pressing the buttons below, so I can improve the newsletter 🙌
Did you enjoy this issue? Yes No
 iOS Code Review
 iOS Code Review @ios_code_review

Bi-weekly newsletter amplifying code improvement tips from the Apple developer community in a bite-sized format. Swift, Objective-C, iOS, macOS, SwiftUI, UIKit and more. Curated by Marina Gornostaeva and published every other Thursday.

In order to unsubscribe, click here.
If you were forwarded this newsletter and you like it, you can subscribe here.
Created with Revue by Twitter.