Post

Replies

Boosts

Views

Activity

How should WKWebView configure networkServiceType for 5G network slicing?
I’m adding 5G network slicing support to a web browser app using WKWebView. The app declares: com.apple.developer.networking.slicing.appcategory: webBrowser-9003 com.apple.developer.networking.slicing.trafficcategory: defaultslice-1 The documentation says that apps should also set networkServiceType on URLRequest or URLSessionConfiguration. However, most requests made by a WKWebView, including subresources, JavaScript fetches, and WebSockets, are created internally by WebKit. Is declaring webBrowser-9003 and defaultslice-1 sufficient for WKWebView traffic, or is there a supported way to configure the network service type for the entire WKWebView network session?
0
0
905
Jun ’26
UIToolbar Missing from View Hierarchy Since iOS 26
Since iOS 26, navigationController?.toolbar no longer appears in the view hierarchy, and UIToolbar itself is not visible in the view tree. Is there currently any supported way to access the toolbar’s container view or its underlying view hierarchy? However, the API itself is not deprecated. https://developer.apple.com/documentation/uikit/uinavigationcontroller/toolbar
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
341
Feb ’26
Issue with Margin During Navigation Transition in iOS 18+
The new .navigationTransition feature introduced in SwiftUI for iOS 18+ offers an impressive animated screen transition. However, during the transition, the parent view shrinks, leaving a white margin (or black in dark mode) around the edges. If the background color of the parent view matches this margin color, it appears seamless. However, as shown in the attached example, when using a custom color or gradient background, the margin becomes visually disruptive. Is there a way to address this? import SwiftUI struct ContentView: View { @Namespace var namespace var body: some View { NavigationStack { Form { NavigationLink { ZStack { Color.yellow.ignoresSafeArea() Text("Detail View") } .navigationTitle("Transition") .navigationTransition(.zoom(sourceID: "hellow", in: namespace)) } label: { Text("Open") .font(.largeTitle) .matchedTransitionSource(id: "hellow", in: namespace) } } .scrollContentBackground(.hidden) .background(Color.mint.ignoresSafeArea()) } } } #Preview { ContentView() } Applying .ignoreSafeArea() to the background view doesn’t seem to resolve the issue, which suggests this margin might not be related to the safe area. Any insights or solutions would be greatly appreciated.
Topic: UI Frameworks SubTopic: SwiftUI
1
0
535
Nov ’24
Preventing Swipe-to-Dismiss on SwiftUI Sheets no longer working in iOS 18.1 (22B83)
The interactiveDismissDisabled() function in SwiftUI's Sheet no longer works as expected in iOS 18.1 (22B83). It was working as expected until iOS 18.0.1. Are there any other users experiencing the same issue? struct ContentView: View { @State private var openSheet = false var body: some View { NavigationStack { Button("Open") { openSheet = true } .sheet(isPresented: $openSheet) { SheetView() } } } } struct SheetView: View { @Environment(\.dismiss) private var dismiss var body: some View { NavigationStack { Text("This is the Sheet") .toolbar { ToolbarItem(placement: .cancellationAction) { Button("Cancel") { dismiss() } } } .interactiveDismissDisabled() } } } Supplementary information: In iOS 18.1, even Apple's native Journal app allows users to swipe-to-dismiss the sheet when creating a new entry. Previously, a confirmation dialog would be displayed, but this is no longer the case.​​​​​​​​​​​​​​​​
Topic: UI Frameworks SubTopic: SwiftUI
1
0
590
Oct ’24
iOS18.1 Issue SwiftUI’s App
The interactiveDismissDisabled() function in SwiftUI's Sheet no longer works as expected in iOS 18.1 (22B83). It was working as expected until iOS 18.0.1. Are there any other users experiencing the same issue? struct ContentView: View { @State private var openSheet = false var body: some View { NavigationStack { Button("Open") { openSheet = true } .sheet(isPresented: $openSheet) { SheetView() } } } } struct SheetView: View { @Environment(\.dismiss) private var dismiss var body: some View { NavigationStack { Text("This is the Sheet") .toolbar { ToolbarItem(placement: .cancellationAction) { Button("Cancel") { dismiss() } } } .interactiveDismissDisabled() } } } Supplementary information: In iOS 18.1, even Apple's native Journal app allows users to swipe-to-dismiss the sheet when creating a new entry. Previously, a confirmation dialog would be displayed, but this is no longer the case.​​​​​​​​​​​​​​​​
3
5
1.8k
Oct ’24
Unable to Access SwiftData Tutorial
I frequently referred to Apple’s tutorial on SwiftData in Swift, but recently I haven’t been able to access it. Is there a reason why? Create, update, and delete data - De velop in Swift Tutorials https://developer.apple.com/tutorials/develop-in-swift/create-update-and-delete-data
1
0
332
Oct ’24
Reproducing Apple’s Journal App List UI & Swipe Animations
I'm struggling to recreate the UI of Apple's Journal app. The List in the Journal app has each element as an independent entity, and the swipe animations for deletion and editing are unlike anything I've seen before. To replicate this, I attempted the following code, which seems to work initially. However, when I swipe to delete, a red area with mismatched sizing appears due to the plain List style. import SwiftUI struct ContentView: View { @State private var items = Array(0...5) var body: some View { List { ForEach(items, id: \.self) { item in Text(String(item)) .padding() .frame(maxWidth: .infinity) .background(Color.white) .cornerRadius(10) .shadow(radius: 5) .listRowBackground(Color.clear) .listRowSeparator(.hidden) } .swipeActions(edge: .trailing){ Button(role: .destructive) { print("delete action.") } label: { Image(systemName: "trash.fill") } } } .listStyle(.plain) } } Does anyone have ideas or suggestions on how to recreate a List similar to the Journal app using SwiftUI or UIKit? Additionally, does anyone know how Apple might have implemented this? Any comments, even minor ones, would be greatly appreciated. Thank you!
Topic: UI Frameworks SubTopic: SwiftUI
1
0
423
Oct ’24
PhotosPicker is not working properly
Hello! I want to use PhotosPicker, but I'm encountering an error with the line item.loadTransferable(type: Data.self) which says Instance method 'loadTransferable(type:)' requires that 'Data' conform to 'Transferable'. I cannot execute the code because of this error. Why is this happening? Any information would be helpful. I tried changing type: Data.self to type: UIImage.self, but it still didn’t work. I am using Xcode 15.4, and my target version is iOS 17.4. import SwiftUI import PhotosUI struct PhotosPicker: View { @State var selectedItems: [PhotosPickerItem] = [] @State var selectedImages: [UIImage] = [] var body: some View { VStack { if !selectedImages.isEmpty { ScrollView(.horizontal, showsIndicators: false) { HStack { ForEach(selectedImages, id: \.self) { image in Image(uiImage: image) .resizable() .scaledToFill() .frame(width: 300, height: 200) } } } } PhotosPicker( selection: $selectedItems, selectionBehavior: .ordered, matching: .images ) { Text("image!") } } .onChange(of: selectedItems) { items in Task { selectedImages = [] for item in items { guard let data = try await item.loadTransferable(type: Data.self) else { continue } guard let uiImage = UIImage(data: data) else { continue } selectedImages.append(uiImage) } } } } }
Topic: UI Frameworks SubTopic: SwiftUI
4
0
1.2k
Aug ’24
modifyHeaders Safari Extension
I want to execute the modifyHeaders method using a Safari extension. However, it doesn't work when I execute it in Safari. It works in Chrome. Why is that? I used this document as reference: Part of manifest.json "declarative_net_request": {         "rule_resources": [{             "id": "ruleset",             "enabled": true,             "path": "rules.json"         }]     },     "host_permissions": [ "<all_urls>" ],     "permissions": [         "declarativeNetRequestWithHostAccess"     ] rules.json [     {       "id": 1,       "priority": 1,       "action": {         "type": "modifyHeaders",         "responseHeaders": [           {             "header": "Content-Disposition",             "operation": "remove"           }         ]       },       "condition": {         "regexFilter": ".*",         "resourceTypes": [           "main_frame",           "sub_frame"         ]       }     } ] [https://developer.apple.com/documentation/safariservices/safari_web_extensions/blocking_content_with_your_safari_web_extension]
1
0
1.5k
Jun ’24
How should WKWebView configure networkServiceType for 5G network slicing?
I’m adding 5G network slicing support to a web browser app using WKWebView. The app declares: com.apple.developer.networking.slicing.appcategory: webBrowser-9003 com.apple.developer.networking.slicing.trafficcategory: defaultslice-1 The documentation says that apps should also set networkServiceType on URLRequest or URLSessionConfiguration. However, most requests made by a WKWebView, including subresources, JavaScript fetches, and WebSockets, are created internally by WebKit. Is declaring webBrowser-9003 and defaultslice-1 sufficient for WKWebView traffic, or is there a supported way to configure the network service type for the entire WKWebView network session?
Replies
0
Boosts
0
Views
905
Activity
Jun ’26
UIToolbar Missing from View Hierarchy Since iOS 26
Since iOS 26, navigationController?.toolbar no longer appears in the view hierarchy, and UIToolbar itself is not visible in the view tree. Is there currently any supported way to access the toolbar’s container view or its underlying view hierarchy? However, the API itself is not deprecated. https://developer.apple.com/documentation/uikit/uinavigationcontroller/toolbar
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
1
Boosts
0
Views
341
Activity
Feb ’26
Unable to download or run iOS 14.x Simulator on macOS 26 (Xcode 26.2)
Hello, Is there currently any workaround to install and run an iOS 14.x simulator on macOS 26? So far, I have checked Xcode 26.2, and the oldest simulator runtime available there appears to be iOS 15.0. I may be missing something, so I wanted to confirm if anyone has found a way to use iOS 14.x on this macOS version. Thank you.
Replies
2
Boosts
0
Views
443
Activity
Jan ’26
Back Swipe Not Working on iPad
Is it the default behavior that the standard back swipe (interactivePopGestureRecognizer) does not work when running a designed for iPhone app on an iPad? To my knowledge, all apps behave this way. Are there any workarounds?
Replies
0
Boosts
0
Views
337
Activity
Feb ’25
Issue with Margin During Navigation Transition in iOS 18+
The new .navigationTransition feature introduced in SwiftUI for iOS 18+ offers an impressive animated screen transition. However, during the transition, the parent view shrinks, leaving a white margin (or black in dark mode) around the edges. If the background color of the parent view matches this margin color, it appears seamless. However, as shown in the attached example, when using a custom color or gradient background, the margin becomes visually disruptive. Is there a way to address this? import SwiftUI struct ContentView: View { @Namespace var namespace var body: some View { NavigationStack { Form { NavigationLink { ZStack { Color.yellow.ignoresSafeArea() Text("Detail View") } .navigationTitle("Transition") .navigationTransition(.zoom(sourceID: "hellow", in: namespace)) } label: { Text("Open") .font(.largeTitle) .matchedTransitionSource(id: "hellow", in: namespace) } } .scrollContentBackground(.hidden) .background(Color.mint.ignoresSafeArea()) } } } #Preview { ContentView() } Applying .ignoreSafeArea() to the background view doesn’t seem to resolve the issue, which suggests this margin might not be related to the safe area. Any insights or solutions would be greatly appreciated.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
535
Activity
Nov ’24
Preventing Swipe-to-Dismiss on SwiftUI Sheets no longer working in iOS 18.1 (22B83)
The interactiveDismissDisabled() function in SwiftUI's Sheet no longer works as expected in iOS 18.1 (22B83). It was working as expected until iOS 18.0.1. Are there any other users experiencing the same issue? struct ContentView: View { @State private var openSheet = false var body: some View { NavigationStack { Button("Open") { openSheet = true } .sheet(isPresented: $openSheet) { SheetView() } } } } struct SheetView: View { @Environment(\.dismiss) private var dismiss var body: some View { NavigationStack { Text("This is the Sheet") .toolbar { ToolbarItem(placement: .cancellationAction) { Button("Cancel") { dismiss() } } } .interactiveDismissDisabled() } } } Supplementary information: In iOS 18.1, even Apple's native Journal app allows users to swipe-to-dismiss the sheet when creating a new entry. Previously, a confirmation dialog would be displayed, but this is no longer the case.​​​​​​​​​​​​​​​​
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
590
Activity
Oct ’24
iOS18.1 Issue SwiftUI’s App
The interactiveDismissDisabled() function in SwiftUI's Sheet no longer works as expected in iOS 18.1 (22B83). It was working as expected until iOS 18.0.1. Are there any other users experiencing the same issue? struct ContentView: View { @State private var openSheet = false var body: some View { NavigationStack { Button("Open") { openSheet = true } .sheet(isPresented: $openSheet) { SheetView() } } } } struct SheetView: View { @Environment(\.dismiss) private var dismiss var body: some View { NavigationStack { Text("This is the Sheet") .toolbar { ToolbarItem(placement: .cancellationAction) { Button("Cancel") { dismiss() } } } .interactiveDismissDisabled() } } } Supplementary information: In iOS 18.1, even Apple's native Journal app allows users to swipe-to-dismiss the sheet when creating a new entry. Previously, a confirmation dialog would be displayed, but this is no longer the case.​​​​​​​​​​​​​​​​
Replies
3
Boosts
5
Views
1.8k
Activity
Oct ’24
Unable to Access SwiftData Tutorial
I frequently referred to Apple’s tutorial on SwiftData in Swift, but recently I haven’t been able to access it. Is there a reason why? Create, update, and delete data - De velop in Swift Tutorials https://developer.apple.com/tutorials/develop-in-swift/create-update-and-delete-data
Replies
1
Boosts
0
Views
332
Activity
Oct ’24
Reproducing Apple’s Journal App List UI & Swipe Animations
I'm struggling to recreate the UI of Apple's Journal app. The List in the Journal app has each element as an independent entity, and the swipe animations for deletion and editing are unlike anything I've seen before. To replicate this, I attempted the following code, which seems to work initially. However, when I swipe to delete, a red area with mismatched sizing appears due to the plain List style. import SwiftUI struct ContentView: View { @State private var items = Array(0...5) var body: some View { List { ForEach(items, id: \.self) { item in Text(String(item)) .padding() .frame(maxWidth: .infinity) .background(Color.white) .cornerRadius(10) .shadow(radius: 5) .listRowBackground(Color.clear) .listRowSeparator(.hidden) } .swipeActions(edge: .trailing){ Button(role: .destructive) { print("delete action.") } label: { Image(systemName: "trash.fill") } } } .listStyle(.plain) } } Does anyone have ideas or suggestions on how to recreate a List similar to the Journal app using SwiftUI or UIKit? Additionally, does anyone know how Apple might have implemented this? Any comments, even minor ones, would be greatly appreciated. Thank you!
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
423
Activity
Oct ’24
PhotosPicker is not working properly
Hello! I want to use PhotosPicker, but I'm encountering an error with the line item.loadTransferable(type: Data.self) which says Instance method 'loadTransferable(type:)' requires that 'Data' conform to 'Transferable'. I cannot execute the code because of this error. Why is this happening? Any information would be helpful. I tried changing type: Data.self to type: UIImage.self, but it still didn’t work. I am using Xcode 15.4, and my target version is iOS 17.4. import SwiftUI import PhotosUI struct PhotosPicker: View { @State var selectedItems: [PhotosPickerItem] = [] @State var selectedImages: [UIImage] = [] var body: some View { VStack { if !selectedImages.isEmpty { ScrollView(.horizontal, showsIndicators: false) { HStack { ForEach(selectedImages, id: \.self) { image in Image(uiImage: image) .resizable() .scaledToFill() .frame(width: 300, height: 200) } } } } PhotosPicker( selection: $selectedItems, selectionBehavior: .ordered, matching: .images ) { Text("image!") } } .onChange(of: selectedItems) { items in Task { selectedImages = [] for item in items { guard let data = try await item.loadTransferable(type: Data.self) else { continue } guard let uiImage = UIImage(data: data) else { continue } selectedImages.append(uiImage) } } } } }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
4
Boosts
0
Views
1.2k
Activity
Aug ’24
modifyHeaders Safari Extension
I want to execute the modifyHeaders method using a Safari extension. However, it doesn't work when I execute it in Safari. It works in Chrome. Why is that? I used this document as reference: Part of manifest.json "declarative_net_request": {         "rule_resources": [{             "id": "ruleset",             "enabled": true,             "path": "rules.json"         }]     },     "host_permissions": [ "<all_urls>" ],     "permissions": [         "declarativeNetRequestWithHostAccess"     ] rules.json [     {       "id": 1,       "priority": 1,       "action": {         "type": "modifyHeaders",         "responseHeaders": [           {             "header": "Content-Disposition",             "operation": "remove"           }         ]       },       "condition": {         "regexFilter": ".*",         "resourceTypes": [           "main_frame",           "sub_frame"         ]       }     } ] [https://developer.apple.com/documentation/safariservices/safari_web_extensions/blocking_content_with_your_safari_web_extension]
Replies
1
Boosts
0
Views
1.5k
Activity
Jun ’24