SwiftUI Weekly - Issue #130
The curated collection of links about SwiftUI. Delivered every Monday.
Sponsor
Glassfy
Simplify building, managing, and growing in-app purchases. Offload backend work and building paywalls to us. Build for free today.
Reading
Adding a stretchable header to a SwiftUI ScrollView
Many iOS apps have screens where the header view stretches out when you pull down the screen. It’s a commonly used and loved component, so it’s strange that it’s not natively available in UIKit or SwiftUI. In this post, let’s look at how to implement such a header view.
Styling Components in SwiftUI
SwiftUI has a great API for styling views independent of a view’s implementation. In this post, we’ll look at how we can style custom views in the same way.
Tracking hover location in SwiftUI
The new modifier lets us read the current HoverPhase and reports the exact location of the pointer when it's within the view's bounds. Let's see it in action.
Observing the content offset of a SwiftUI ScrollView
When building various kinds of scrollable UIs, it’s very common to want to observe the current scroll position (or content offset, as UIScrollView
calls it) in order to trigger layout changes, load additional data when needed, or perform other kinds of actions depending on what content the user is currently viewing.
Changing orientation for a single screen in SwiftUI
Last week, we started to migrate the playback feature in iPlayer to our brand new SwiftUI navigation. Very quickly, we ran into an issue with the way our app works on iPhone devices and the inability to easily achieve the same behavior using SwiftUI.
Videos
Make Money While You Sleep 😴 Build A Tip Jar In SwiftUI Using StoreKit2 💰
In this tutorial, we'll learn how to create a tip jar in a SwiftUI app using the StoreKit2 framework. We'll start by setting up our project and configuring our in-app purchase products. Then, we'll implement the user interface for our tip jar, including a button to initiate the purchase process and a label to display the current balance. Along the way, we'll explore best practices for handling in-app purchases and handling errors. By the end of this video, you'll have a fully functional tip jar in your SwiftUI app, ready for users to start tipping.
Matched Geometry Effects between fullScreenCover
In this Video I'm going to teach how to use matched geometry effect between View and SwiftUI's fullScreenCover using SwiftUI 4.0.