Episode 46
Let Me Solve All Your Problems
September 13th, 2021
1 hr 54 mins 54 secs
Season 1
Tags
About this Episode
Welcome to Code Completion, Episode 46! We are a group of iOS developers and educators hoping to share what we love most about development, Apple technology, and completing your code!
Follow us @CodeCompletion on Twitter to hear about our upcoming livestreams, videos, and other content.
Today, we discuss:
- Code Completion Club: https://codecompletion.io/jointheclub
- Indie App Spotlight, with a new app for you to check out:
- Jellycuts by Zachary Lineman (@LinemanZachary): https://jellycuts.com
- Our experience using SwiftUI, best practices, and hidden complexity.
- Underdog devs link: https://www.underdogdevs.org/
- Asam sharp (@azamsharp) on Twitter: https://twitter.com/i/web/status/1422716472099487744
- SwiftUI Lab: https://swiftui-lab.com
- Objc.io - Understanding SwiftUI: https://www.objc.io/books/thinking-in-swiftui/
- WWDC21 - Demystify SwiftUI: https://developer.apple.com/videos/play/wwdc2021/10022/
- The best architecture for SwiftUI does not exist.
- Enums are great in Swift, and everyone should use them.
- What announcements we expect at Apple’s California Streaming event.
- Ceramic Apple Watches are a danger to paint jobs everywhere.
Also, join us for #CompleteTheCode and Compiler Error, two segments that test both your knowledge and our knowledge on Swift, Apple, and all things development!
Your hosts for this week:
Be sure to also sign up to our monthly newsletter, where we will recap the topics we discussed, reveal the answers to #CompleteTheCode, and share even more things we learned in between episodes.
You are what makes this show possible, so please be sure to share this with your friends and family who are also interested in any part of the app development process.
Sponsor
This week's episode of Code Completion is brought to you by Weekly Swift Exercises. Go to https://twitter.com/swiftexercises today to check it out!
Complete the Code
How would you transform the code below to use the new async/await pattern?
// How would you transform the code below to use the new async/await pattern?
print("Preparing request…")
urlSession.dataTask(with: httpRequest) { data, response, error in
DispatchQueue.main.async {
print("Received response: \(response)")
}
}.resume()
print("Sent request!")
Be sure to tweet us with hashtag #CompleteTheCode if you know the answer!
Compiler Error
This week's Compiler Error has a theme: SwiftUI View Modifiers!
1 - Much like UIKit, SwiftUI allows the interface orientation to be manipulated using statusBar(orientation:)
, moving the status bar to one of the four screen edges.
2 - Tooltips can be added to SwiftUI views using the help(_:)
modifier, helping to guide the user around the interface without them needing to directly invoke any actions.
3 - Any view in the hierarchy can be modified with onOpenURL(perform:)
to perform localized URL handling so long as it is part of the hierarchy when the URL is opened.
4 - A badge can be added to tab bar items using the badge(_:)
modifier, but this will also add a visual indicator to list rows to help convey supplementary information.