I often find that developers are confused about which component is best for them: ZStack or overlay (+background). So I hope this short article will clarify the differences and help delve deeper into the unique properties of these two modifiers.
https://fatbobman.com/en/posts/in-depth-exploration-of-overlay-and-background-modifiers-in-swiftui/
#SwiftUI #layout
Great long-read of making a native text editor app as a solo dev (you probably heard or used it - Paper app).
https://papereditor.app/dev
In the second part the author concentrates on the deep-tech stuff - how text editing works internally.
https://papereditor.app/internals
I found the strength to write an article about making customizable components in SwiftUI.
p.s. the standard for writing articles has been met, expect the next article to be published next year. 😄
https://otbivnoe.ru/2024/02/25/Making-Customizable-SwiftUI-Components.html
#SwiftUI #design_system
Clickbait news. Apple introduces new programming language!
… for writing configurations.
It combines the simplicity of static languages with the capabilities of general programming, featuring classes, functions, conditions, and loops. Pkl ensures safety with type checks, offers ease of use with IDE integration, and supports package sharing and integration into various programming languages.
https://pkl-lang.org/blog/introducing-pkl.html
This article is a great reminder to avoid using AnyView as much as possible, or use it carefully when really necessary. The author conducted some measurements of using AnyView (and without it) in lists and compared the results.
https://martinmitrevski.com/2024/01/02/anyviews-impact-on-swiftui-performance/
#SwiftUI #performance
Apple has announced that, beginning January 2024, all Apple Developer Program memberships will include 25 compute hours per month on Xcode Cloud at no additional cost.
https://developer.apple.com/news/?id=ik9z4ll6
#Cloud
As in the previous article the author once again made a really great job. This time he prepared an in-depth analysis of the ViewThatFits
component, providing a detailed explanation of its functionality and the underlying reasons for its operation. Moreover, the author went a step further by recreating this component using the Layout protocol, showcasing both a profound understanding and practical application of the subject matter.
https://medium.com/the-swift-cooperative/mastering-viewthatfits-3294d74cb17b
#SwiftUI #Layout
For those who already use the Logger type, Xcode 15 brings handy improvement — support of filtering console logs and more directly in Xcode, eliminating the need to launch the Console app. You can filter logs by their type (networking, ui), jump to code where a log message has been triggered and so on.
https://augmentedcode.io/2023/10/16/changes-to-structured-logging-in-xcode-15/
#Xcode #logging
The author made research and reverse-engineering of inner working of async/await. This substantial article promises to be an in-depth exploration of the subject, so be sure to have plenty of tea ready.
https://swiftrocks.com/how-async-await-works-internally-in-swift
#Swift #concurrency
Airbnb shared their SwiftUI adoption story, including their motivation for replacing Epoxy (declarative UI framework) and UIKit, their integration process, and the results and challenges they've faced.
https://medium.com/airbnb-engineering/unlocking-swiftui-at-airbnb-ea58f50cde49
#SwiftUI #AirBnb
Explore an in-depth article on SwiftUI's layout process. The author provides a comprehensive breakdown, including the Layout
protocol, the functionality of frame
, fixedSize
, and idealSize
, and much more.
https://betterprogramming.pub/swiftui-layout-the-mystery-of-size-b82ce99e61d8
#SwiftUI #Layout
Kodeco (ex raywenderlich) released a free book with huge amount of common patterns for building user interface in SwiftUI.
https://www.kodeco.com/books/swiftui-cookbook/v1.0
#SwiftUI #book
Github just announced Dependabot for Swift! For those unfamiliar, this tool automatically generates pull requests with updated dependencies, ensuring any security vulnerabilities are promptly fixed.
https://github.blog/changelog/2023-08-01-swift-support-for-dependabot-updates/
#github
TIL there’s a secret debug menu 🤯
https://x.com/hrumarek/status/1190942518080397317?s=46&t=YNy4qFziI3PFPTlrSCXpmA
A bit of nostalgia from the early 2000s 😍
https://digitalbunker.dev/dvd-screensaver-swiftui/
#SwiftUI
Apple’s released Swift 5.10 – it's making concurrent programming safer with full data isolation. This milestone sets the stage for Swift 6, which will enforce data isolation by default, improving usability and eliminating data races.
https://swift.org/blog/swift-5.10-released/
#swift #concurrency
Oh, look at this gem! Chris Eidhof from objc.io has built a guide for visually understanding how SwiftUI's layout system works. It's even possible to adjust some layout parameters to thoroughly grasp the consept.
https://www.swiftuifieldguide.com
#swiftui #layout
A few non-obvious tips about using dynamic member lookup in conjunction with SwiftUI Binding.
https://chris.eidhof.nl/post/swiftui-binding-tricks/
#SwiftUI
I came across a great video about creating a Design System using the example of button styling. I particularly liked the approach of expanding a simple button with additional fields such as description and title by combining different styles.
https://youtu.be/Z7rJKr6Jlho?si=cIYfiJaOOHFioV7x
#SwiftUI #design_system
Interesting approach for storing API keys by using on-demand resources with enabled prefetching instead of embedding them directly in code, that could lead to expose them as plain strings when extracted from IPA files.
https://augmentedcode.io/2023/11/27/using-on-demand-resources-for-securely-storing-api-keys-in-ios-apps/
#Security
There is a lot of criticism of GeometryReader in the iOS community: some try to avoid it, others consider it very useful, others don’t even know what it is. All these problems are discussed in a long article prepared by the author.
https://betterprogramming.pub/geometryreader-blessing-or-curse-1ebd2d5005ec
#SwiftUI #Layout
One of my favorite blogs is regularly sharing in-depth articles about SwiftUI. In their latest post, the author delves into the new CustomAnimation protocol, explaining what it is and how to use it effectively.
https://swiftui-lab.com/swiftui-animations-part6/
For more animation-related posts, check out the full series here
https://swiftui-lab.com/category/animations/
#SwiftUI #animations
If you're already using the latest Xcode, you can find a brief overview of debugging enhancements and new features within Swift 5.9 itself.
https://www.swift.org/blog/whats-new-swift-debugging-5.9/
https://www.swift.org/blog/swift-5.9-released/
#Swift
Lottie now officially supports SwiftUI.
https://github.com/airbnb/lottie-ios/discussions/2189
#Animations #Lottie
If you're looking to implement drag-and-drop reordering functionality similar to what the List in SwiftUI offers, but for Grid and Stack components, there's a comprehensive custom solution.
https://danielsaidi.com/blog/2023/08/30/enabling-drag-reordering-in-swiftui-lazy-grids-and-stacks
#SwiftUI
Friendly reminder:
From Fall 2023 you’ll receive an email from Apple if you upload an app to App Store Connect that uses required reason API without describing the reason in its privacy manifest file. From Spring 2024, apps that don’t describe their use of required reason API in their privacy manifest file won’t be accepted by App Store Connect.
p.s. User Defaults API is in this list as well.
So an author wrote a shell script that helps you to identify the use of such API in your code base.
https://blog.eidinger.info/how-to-check-if-you-use-a-required-reason-api
#privacy
I've attempted multiple times to access the tint
or foreground
color using the @Environment
in custom components, but each time I ended up by passing this color through the initializer. However, I recently discovered a solution that seems to work seamlessly. For instance, a value set via the foregroundColor
modifier can be easily accessed using the ForegroundShapeStyle
(refer to the attached screenshot). The same approach can be applied to the tint color as well.
https://kylehugh.es/documents/how-to-read-foreground-and-tint-colors-in-swiftui-views/
#SwiftUI
To celebrate the major update of the Composable Architecture (1.0), the team is doing a library tour. If you've always wanted to take a look at this library, now is the perfect time to do so.
https://www.pointfree.co/episodes/ep243-tour-of-the-composable-architecture-1-0-the-basics
#composable_architecture