Post

Replies

Boosts

Views

Activity

Reply to macOS 26: retain cycle detected when navigation link label contains a Swift Chart
I'm also experiencing this issue, but I'm not using Charts. It's when navigating back to my Home tab on macOS only. This works fine on iOS. import SwiftData import SwiftUI struct ContentView: View { @Environment(\.modelContext) private var modelContext @Query private var publications: [Publication] @State private var publicationError: EncodedPublicationError? @State private var showErrorAlert = false @State private var selectedTab = 0 var body: some View { NavigationStack { TabView(selection: $selectedTab) { ScrollView { FeaturedView() RecentlyOpenedView() Spacer(minLength: 20) RecentlyUpdatedView() Spacer(minLength: 60) } .tag(0) .tabItem { Label("Home", systemImage: "house.fill") } LibraryView() .tag(1) .tabItem { Label("Library", systemImage: "books.vertical.fill") } QuestionView() .tag(2) .tabItem { Label("Answers", systemImage: "text.bubble.fill") } SearchView() .tag(3) .tabItem { Label("Search", systemImage: "magnifyingglass") } } .navigationTitle(navigationTitle) .tabViewStyle(.sidebarAdaptable) .refreshable { await refreshPublications() } } .overlay { if publications.isEmpty { initialSetupView } } .alert(isPresented: $showErrorAlert, error: publicationError) { Button("OK", role: .cancel) { } } .task { if publications.isEmpty { await refreshPublications() } } } private var navigationTitle: String { switch selectedTab { case 0: return "Home" case 1: return "Library" case 2: return "Answers" case 3: return "Search" default: return "" } } @ViewBuilder private var initialSetupView: some View { Color.primary .colorInvert() .overlay { ProgressView { Text("Loading Publications…") } } .ignoresSafeArea() .transition(.opacity) } // MARK: - Data Refresh @MainActor private func refreshPublications() async { let importer = PublicationImporter(modelContainer: modelContext.container) do { try await importer.backgroundInsert() } catch { self.publicationError = error as? EncodedPublicationError self.showErrorAlert = true } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’25
Reply to iOS Safari Extension Memory Limit 6MB
Hey folks - same question here. The limit for Safari Extensions is explicitly set to 6MB. Any reason/justification why? Thanks!
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to Invalid product identifier for IAP on tvOS
Using the new StoreKit 2 framework seemed to remedy this issue. The sample code provided by Apple is extremely helpful in getting that set up.
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
Feb ’22
Reply to macOS 26: retain cycle detected when navigation link label contains a Swift Chart
I'm also experiencing this issue, but I'm not using Charts. It's when navigating back to my Home tab on macOS only. This works fine on iOS. import SwiftData import SwiftUI struct ContentView: View { @Environment(\.modelContext) private var modelContext @Query private var publications: [Publication] @State private var publicationError: EncodedPublicationError? @State private var showErrorAlert = false @State private var selectedTab = 0 var body: some View { NavigationStack { TabView(selection: $selectedTab) { ScrollView { FeaturedView() RecentlyOpenedView() Spacer(minLength: 20) RecentlyUpdatedView() Spacer(minLength: 60) } .tag(0) .tabItem { Label("Home", systemImage: "house.fill") } LibraryView() .tag(1) .tabItem { Label("Library", systemImage: "books.vertical.fill") } QuestionView() .tag(2) .tabItem { Label("Answers", systemImage: "text.bubble.fill") } SearchView() .tag(3) .tabItem { Label("Search", systemImage: "magnifyingglass") } } .navigationTitle(navigationTitle) .tabViewStyle(.sidebarAdaptable) .refreshable { await refreshPublications() } } .overlay { if publications.isEmpty { initialSetupView } } .alert(isPresented: $showErrorAlert, error: publicationError) { Button("OK", role: .cancel) { } } .task { if publications.isEmpty { await refreshPublications() } } } private var navigationTitle: String { switch selectedTab { case 0: return "Home" case 1: return "Library" case 2: return "Answers" case 3: return "Search" default: return "" } } @ViewBuilder private var initialSetupView: some View { Color.primary .colorInvert() .overlay { ProgressView { Text("Loading Publications…") } } .ignoresSafeArea() .transition(.opacity) } // MARK: - Data Refresh @MainActor private func refreshPublications() async { let importer = PublicationImporter(modelContainer: modelContext.container) do { try await importer.backgroundInsert() } catch { self.publicationError = error as? EncodedPublicationError self.showErrorAlert = true } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’25