Post

Replies

Boosts

Views

Activity

Will .swiftpm file work in iPad playgrounds file if made in Xcode ?
Hi everyone, I've made a project in Xcode app playground project (.swiftpm) I have an AR component in my app which I've tested on an iPhone where it works fine but as the submission are only judged on either the iPads or the Macs. Since my app has an AR functionality so my will only be judged on an iPad. Unfortunately I don't have an access to an iPad. I'm worried that will this project of mine even work on an iPad because I've never used an iPad's playground before. If anyone has an experience that a swift app playground project made with Xcode will build and run on an iPad's swift playground please do let me know. Although I've adjusted my app to look and work great on an iPad as well. Thank you!!
1
0
1.2k
Apr ’23
Bundle.main.url/path cannot locate audio file.
Hii, I wanted to use some audio files for my project that I'm building for Swift Student Challenge. But when I'm trying to locate the audio file I get an error or crash because the playground cannot locate or find the path to that audio file. I'm using Xcode app playground project. My code : func playSound(soundName:String){ if let url = Bundle.main.url(forResource: "CFile", withExtension: "mp3"){ do { self.audioPlayer = try AVAudioPlayer(contentsOf: url) self.audioPlayer?.prepareToPlay() self.audioPlayer?.play() }catch { print("Error : \(error)") } } else{ print("ERROR") } // let url = Bundle.main.url(forResource: "C", withExtension: "wav") // audioPlayer = try! AVAudioPlayer(contentsOf: url!) // self.audioPlayer.play() } } If anyone has a solution please help me to fix this thing because sound is an important part of my project. Thank you!!!
1
0
1.4k
Apr ’23