Post

Replies

Boosts

Views

Activity

How to Maintain Background Color Consistency During ZoomTransitions in SwiftUI?
I’m currently working on a SwiftUI project and trying to implement a transition effect similar to ZoomTransitions. However, I’ve run into an issue. When transitioning from Page A to Page B using .navigationTransition(.zoom(sourceID: "world", in: animation)), Page A shrinks as expected, but its background color changes to the default white instead of the color I preset. I want the background color of Page A to remain consistent with my preset during the entire transition process. Here’s a simplified version of my code: Page A PartnerCard() .matchedTransitionSource(id: item.id, in: animation) Page B ``.navigationTransition(.zoom(sourceID: "world", in: animation))
0
0
40
8h
Why are asynchronous tasks not executed in Xcode Canvas, and why do they only work in the simulator?
Hi everyone, I'm new to Xcode and iOS development. I've encountered an issue where asynchronous tasks seem to not execute in Xcode Canvas, but they work fine in the simulator. Can anyone explain why this might be happening or what I could do to fix it? Thank you for your help! struct PartnerProfileView: View { @State private var showSheet: Bool = true let partnerName: String var body: some View { ZStack(alignment: .bottom) { Color("EFEFF4_0F2534") ScrollView(showsIndicators: false) { headerSection() infoSection() .padding(.bottom, 5) sectionTitle("Other Skills") skillsGrid() sectionTitle("···") dynamicsSection() } .frame(maxWidth: .infinity, maxHeight: .infinity) CustomTabBar() } .navigationBarHidden(true) .ignoresSafeArea(edges: .all) .onAppear { print("PartnerProfileView received") Task { await BottomCustomPopup().present() } } .onChange(of: showSheet) { oldState, newValue in print("oldState \(oldState)") print("newValue \(newValue)") } } } //@MainActor struct BottomCustomPopup: BottomPopup { var body: some View { HStack(spacing: 0) { Text("Hello World") Spacer() Button(action: { Task { await dismissLastPopup() }}) { Text("Dismiss") } } .padding(.vertical, 20) .padding(.leading, 24) .padding(.trailing, 16) } }
1
0
103
5d