Post

Replies

Boosts

Views

Created

WebPage doesn't seem to update view when changed in SwiftUi
I tried the new WebView api in swiftui and tried to pass webPage for this view to be able to control the navigation of the user by giving him the option to go back or forward using nav buttons but the view doesn't get's updated when the webPage.backForwardList.backList so the buttons remains disabled. code snippet: @available(iOS 26, *) struct LinkWebViewFor26: View { let url: URL @State var webPage = WebPage() @Environment(\.dismiss) private var dismiss var body: some View { WebView(webPage) .webViewBackForwardNavigationGestures(.disabled) .task { webPage.load(url) } .toolbar { ToolbarItem(placement: .topBarTrailing) { Button { dismiss() } label: { Image(systemName: "checkmark") } .buttonStyle(.glassProminent) } ToolbarItemGroup(placement: .topBarLeading) { BackForwardMenu( list: webPage.backForwardList.backList, label: .init(text: "Backward", systemImage: "chevron.backward") ) { item in webPage.load(item) } BackForwardMenu( list: webPage.backForwardList.forwardList.reversed(), label: .init(text: "Forward", systemImage: "chevron.forward") ) { item in webPage.load(item) } } } .onChange(of: webPage.backForwardList) { _, _ in print(webPage.backForwardList.backList) } } }
1
0
167
Sep ’25
AVAssetExportSession failed to export audio
I am trying to use AVAssetExportSession to export audio form video but every time I try it, it fails and I don't know why ?! this is the code import AVFoundation protocol AudioExtractionProtocol { func extractAudio(from fileUrl: URL, to outputUrl: URL) } final class AudioExtraction { private var avAsset: AVAsset? private var avAssetExportSession: AVAssetExportSession? init() {} } //MARK: - AudioExtraction conforms to AudioExtractionProtocol extension AudioExtraction: AudioExtractionProtocol { func extractAudio(from fileUrl: URL, to outputUrl: URL) { createAVAsset(for: fileUrl) createAVAssetExportSession(for: outputUrl) exportAudio() } } //MARK: - Private Methods extension AudioExtraction { private func createAVAsset(for fileUrl: URL) { avAsset = AVAsset(url: fileUrl) } private func createAVAssetExportSession(for outputUrl: URL) { guard let avAsset else { return } avAssetExportSession = AVAssetExportSession(asset: avAsset, presetName: AVAssetExportPresetAppleM4A) avAssetExportSession?.outputURL = outputUrl } private func exportAudio() { guard let avAssetExportSession else { return } print("I am here \n") avAssetExportSession.exportAsynchronously { if avAssetExportSession.status == .failed { print("\(avAssetExportSession.status)\n") } } } } func test_AudioExtraction_extractAudioAndWriteItToFile() { let videoUrl = URL(string: "https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerMeltdowns.mp4")! let audioExtraction: AudioExtractionProtocol = AudioExtraction() audioExtraction.extractAudio(from: videoUrl, to: FileMangerTest.audioFile) FileMangerTest.tearDown() } class FileMangerTest { private static let fileManger = FileManager.default private static var directoryUrl: URL { fileManger.urls(for: .cachesDirectory, in: .userDomainMask).first! } static var audioFile: URL { directoryUrl.appendingPathComponent("audio", conformingTo: .mpeg4Audio) } static func tearDown() { try? fileManger.removeItem(at: audioFile) } static func contant(at url: URL) -> Data? { return fileManger.contents(atPath: url.absoluteString) } }
0
0
578
Jul ’24
How to make my iPhone app view on an iPad
my app was rejected by this reason: While we appreciate that your app is intended primarily for use on iPhone, in order to bring your app into compliance with App Store guidelines, all apps designed for use on iPhone must still be formatted correctly and behave properly when run on iPad. How can I solve this problem without adding iPad as a destination in Xcode.
2
0
781
Aug ’23
Mac App signing
I am trying to sign my Mac app to use Network Extensions capability. But every time I create a profile it displays that to me: on the other hand on the website it displays this to me:
Replies
3
Boosts
0
Views
146
Activity
Feb ’26
Xcode 26.1 iOS isn't installed error
I have download the 26.1 simulator after updating app this morning then out of the blue Xcode prevents me from running app and forces me to download sim again.
Replies
0
Boosts
0
Views
53
Activity
Nov ’25
WebPage doesn't seem to update view when changed in SwiftUi
I tried the new WebView api in swiftui and tried to pass webPage for this view to be able to control the navigation of the user by giving him the option to go back or forward using nav buttons but the view doesn't get's updated when the webPage.backForwardList.backList so the buttons remains disabled. code snippet: @available(iOS 26, *) struct LinkWebViewFor26: View { let url: URL @State var webPage = WebPage() @Environment(\.dismiss) private var dismiss var body: some View { WebView(webPage) .webViewBackForwardNavigationGestures(.disabled) .task { webPage.load(url) } .toolbar { ToolbarItem(placement: .topBarTrailing) { Button { dismiss() } label: { Image(systemName: "checkmark") } .buttonStyle(.glassProminent) } ToolbarItemGroup(placement: .topBarLeading) { BackForwardMenu( list: webPage.backForwardList.backList, label: .init(text: "Backward", systemImage: "chevron.backward") ) { item in webPage.load(item) } BackForwardMenu( list: webPage.backForwardList.forwardList.reversed(), label: .init(text: "Forward", systemImage: "chevron.forward") ) { item in webPage.load(item) } } } .onChange(of: webPage.backForwardList) { _, _ in print(webPage.backForwardList.backList) } } }
Replies
1
Boosts
0
Views
167
Activity
Sep ’25
Camera Capture Extension with AVMultiCamPiP
I am using AVMulti so the user captures two images how can I access those images if there is only one url that stores the captured images for the lockScreenCapture extension ? Plus how can I detect if the user opened the app from the extension to be able to navigate the user to the right screen ?
Replies
4
Boosts
0
Views
485
Activity
Jan ’25
LockedCameraCaptureExtension doesn't work
I have added this extension to my app and followed the steps of the documentation but it didn't work. when I press the shortcut from the control center it only open the app and when I put it on the lockScreen it doesn't do anything. I don't know what I am missing
Replies
1
Boosts
0
Views
344
Activity
Jan ’25
Camera Capture Extension with AVMultiCamPiP
I wanted to ask if I can use Camera Capture Extension with AVMultiCamPiP, because the LockedCameraCaptureUIScene only return in the closure one session and I can't use the same session for both the front and back at the same time
Replies
1
Boosts
0
Views
401
Activity
Jan ’25
iOS 18 dark icons are not working on a real device
I have added dark, tinted and light version for my app icon, it only works on the simulator but when I run the app on a real device it doesn't work at all and only display the default light icon.
Topic: Design SubTopic: General Tags:
Replies
0
Boosts
2
Views
722
Activity
Sep ’24
SwiftUI @Entry isn't working
I am trying to use the new @Entry macro to add new EnvironmentValues as the documentation: https://developer.apple.com/documentation/swiftui/entry() say but I keep getting errors. I am using iOS 17.4, Xcode 15.3.
Replies
3
Boosts
0
Views
795
Activity
Jul ’24
AVAssetExportSession failed to export audio
I am trying to use AVAssetExportSession to export audio form video but every time I try it, it fails and I don't know why ?! this is the code import AVFoundation protocol AudioExtractionProtocol { func extractAudio(from fileUrl: URL, to outputUrl: URL) } final class AudioExtraction { private var avAsset: AVAsset? private var avAssetExportSession: AVAssetExportSession? init() {} } //MARK: - AudioExtraction conforms to AudioExtractionProtocol extension AudioExtraction: AudioExtractionProtocol { func extractAudio(from fileUrl: URL, to outputUrl: URL) { createAVAsset(for: fileUrl) createAVAssetExportSession(for: outputUrl) exportAudio() } } //MARK: - Private Methods extension AudioExtraction { private func createAVAsset(for fileUrl: URL) { avAsset = AVAsset(url: fileUrl) } private func createAVAssetExportSession(for outputUrl: URL) { guard let avAsset else { return } avAssetExportSession = AVAssetExportSession(asset: avAsset, presetName: AVAssetExportPresetAppleM4A) avAssetExportSession?.outputURL = outputUrl } private func exportAudio() { guard let avAssetExportSession else { return } print("I am here \n") avAssetExportSession.exportAsynchronously { if avAssetExportSession.status == .failed { print("\(avAssetExportSession.status)\n") } } } } func test_AudioExtraction_extractAudioAndWriteItToFile() { let videoUrl = URL(string: "https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerMeltdowns.mp4")! let audioExtraction: AudioExtractionProtocol = AudioExtraction() audioExtraction.extractAudio(from: videoUrl, to: FileMangerTest.audioFile) FileMangerTest.tearDown() } class FileMangerTest { private static let fileManger = FileManager.default private static var directoryUrl: URL { fileManger.urls(for: .cachesDirectory, in: .userDomainMask).first! } static var audioFile: URL { directoryUrl.appendingPathComponent("audio", conformingTo: .mpeg4Audio) } static func tearDown() { try? fileManger.removeItem(at: audioFile) } static func contant(at url: URL) -> Data? { return fileManger.contents(atPath: url.absoluteString) } }
Replies
0
Boosts
0
Views
578
Activity
Jul ’24
Detect if the current day have any events using EventKit
I was wondering how can I detect if a certain day have events using EventKit, without fetching the events. To display something like that:/Users/eng.omarelsayed/Downloads/IMG_D9B141B15D79-1.jpeg the dots under each day, which represent that this day contain event in it.
Replies
1
Boosts
0
Views
627
Activity
May ’24
How to detect if an event in EventKit is a virtula event or not ?
I started to use the EventKit APi and I like it so much but one missing thing is that I am trying to detect if the event is online or not. so if the event is online I will display something like apple does if not I will display the location od the event.
Replies
1
Boosts
0
Views
863
Activity
Apr ’24
How to make my iPhone app view on an iPad
my app was rejected by this reason: While we appreciate that your app is intended primarily for use on iPhone, in order to bring your app into compliance with App Store guidelines, all apps designed for use on iPhone must still be formatted correctly and behave properly when run on iPad. How can I solve this problem without adding iPad as a destination in Xcode.
Replies
2
Boosts
0
Views
781
Activity
Aug ’23