Same thing here...
Post
Replies
Boosts
Views
Activity
Seems to work in iOS 15, so this is what I'm doing now:
requestAuthorization {
/// got permissions
}
func requestAuthorization(completion: @escaping (() -> Void)) {
if #available(iOS 15, *) { /// works, so use `addOnly`
PHPhotoLibrary.requestAuthorization(for: .addOnly) { (status) in
if status == .authorized || status == .limited {
completion()
}
}
} else if #available(iOS 14, *) { /// use `readWrite` directly instead. This will ask for both read and write access, but at least it doesn't crash...
PHPhotoLibrary.requestAuthorization(for: .readWrite) { (status) in
if status == .authorized || status == .limited {
completion()
}
}
} else { /// for older iOS just do `requestAuthorization`
PHPhotoLibrary.requestAuthorization { (status) in
if status == .authorized {
completion()
}
}
}
}
Same thing is happening to me. Has anyone found a workaround?
Updating to Big Sur 11.0.1 worked for me!
Here's some similar problems: When running on older iOS Simulator, error “Failed to start launchd_sim: could not bind to session, launchd_sim may have crashed or quit responding” - https://stackoverflow.com/q/65172944/14351818 (I asked)
Simulator crashing with iOS < 14. Started happening since Big Sur - https://developer.apple.com/forums/thread/667921
iOS Simulator is Crashing on startup - https://stackoverflow.com/q/64071652/14351818
Same here. Here's some similar problems:
When running on older iOS Simulator, error “Failed to start launchd_sim: could not bind to session, launchd_sim may have crashed or quit responding” - https://stackoverflow.com/q/65172944/14351818 (I asked)
"Failed to start launchd_sim: could not bind to session, launchd_sim may have crashed" - https://developer.apple.com/forums/thread/667088
iOS Simulator is Crashing on startup - https://stackoverflow.com/q/64071652/14351818
Same here! Did anyone find a workaround?
EDIT: Deleted contents of ~/Library/Developer/Xcode/iOS DeviceSupport, as @tszpan suggested, and after a while it's working now!
Just updated to Xcode 12 GM and this is happening.
Hey @Claude31, thanks for your help! It's now working if I do
@GestureState private var isPressed = false
...
let drag = DragGesture(minimumDistance: 0)
.updating($isPressed) { (value, gestureState, transaction) in
gestureState = true
}
return content
.gesture(drag)
.onChange(of: isPressed, perform: { (pressed) in
if pressed {
print("changed")
} else {
print("ended")
}
})
as suggested by someone else and also Apple. Here's the feedback Apple sent:
Thank you for filing this feedback report. We reviewed your report and determined the behavior you experienced is currently functioning as intended.
The gesture is cancelled in this case not ended (two fingers can't match a one-finger drag). You can use GestureState to handle the cancellation.
You can close this feedback by clicking on the "Close Feedback" link. Thank you.
I think these are the currently supported languages (in iOS 14):
[ "en-US" , "fr-FR" , "it-IT" , "de-DE" , "es-ES" , "pt-BR" , "zh-Hans" , "zh-Hant" ]
Dansk isn't on there -- the most similar would probably be "de-DE" (German). And in iOS 13, the only supported language is "en-US". Check out this blog (it's in Japanese but you can use Google Translate) koze.hatenablog.jp/entry/2020/06/23/093000
Yep, same crash here. I'm adding a CALayer that animates its width.
libxpc.dylib`_xpc_api_misuse:
0x7fff522fe0b4 <+0>: pushq %rbp
0x7fff522fe0b5 <+1>: movq %rsp, %rbp
0x7fff522fe0b8 <+4>: pushq %rbx
0x7fff522fe0b9 <+5>: subq $0xa8, %rsp
0x7fff522fe0c0 <+12>: movq %rdi, %r9
0x7fff522fe0c3 <+15>: movaps 0xdc06(%rip), %xmm0 ; __xpcVersionNumber + 160
0x7fff522fe0ca <+22>: leaq -0xb0(%rbp), %rbx
0x7fff522fe0d1 <+29>: movaps %xmm0, 0x90(%rbx)
0x7fff522fe0d8 <+36>: movaps %xmm0, 0x80(%rbx)
0x7fff522fe0df <+43>: movaps %xmm0, 0x70(%rbx)
0x7fff522fe0e3 <+47>: movaps %xmm0, 0x60(%rbx)
0x7fff522fe0e7 <+51>: movaps %xmm0, 0x50(%rbx)
0x7fff522fe0eb <+55>: movaps %xmm0, 0x40(%rbx)
0x7fff522fe0ef <+59>: movaps %xmm0, 0x30(%rbx)
0x7fff522fe0f3 <+63>: movaps %xmm0, 0x20(%rbx)
0x7fff522fe0f7 <+67>: movaps %xmm0, 0x10(%rbx)
0x7fff522fe0fb <+71>: movaps %xmm0, (%rbx)
0x7fff522fe0fe <+74>: leaq 0x115ad(%rip), %r8 ; "XPC API Misuse: %s"
0x7fff522fe105 <+81>: movl $0xa0, %esi
0x7fff522fe10a <+86>: movl $0xa0, %ecx
0x7fff522fe10f <+91>: movq %rbx, %rdi
0x7fff522fe112 <+94>: movl $0x0, %edx
0x7fff522fe117 <+99>: xorl %eax, %eax
0x7fff522fe119 <+101>: callq 0x7fff5230add8 ; symbol stub for: __snprintf_chk
0x7fff522fe11e <+106>: movq %rbx, 0x37abe863(%rip) ; gCRAnnotations + 8
0x7fff522fe125 <+113>: leaq 0x11599(%rip), %rax ; "API Misuse"
0x7fff522fe12c <+120>: movq %rax, 0x37abe85d(%rip) ; gCRAnnotations + 16> 0x7fff522fe133 <+127>: ud2
I'm only getting this issue on the iOS 13.6 simulator, not on a real device.
See my answer here - https://developer.apple.com/forums/thread/649371?answerId=619294022#619294022. I have both a SwiftUI and UIKit solution.
If you're using the Swift Playgrounds app (for Mac and iPad)...
You need to first add a sound file to the project: Press the “+” icon
Tap the paper icon
Tap Insert From…
Insert a sound file from the Files app
Then, if you're using SwiftUI:
import AVFoundation
import SwiftUI
import PlaygroundSupport
struct SwiftUIAudioPlayerView: View {
		
		/// the audio player that will play your audio file. Can't be a local variable.
		/// Must be a `@State` property because we need to modify it later
		@State var audioPlayer: AVAudioPlayer?
		
		var body: some View {
				Button(action: {
						self.playAudio() /// play audio when tapped
				}) {
						Text("Play Audio!") /// what the button looks like
				}
		}
		
		func playAudio() { /// function to play audio
				
				/// the URL of the audio file.
				/// forResource = name of the file.
				/// withExtension = extension, usually "mp3"
				if let audioURL = Bundle.main.url(forResource: "slow-spring-board", withExtension: "mp3") {
						do {
								try self.audioPlayer = AVAudioPlayer(contentsOf: audioURL) /// make the audio player
								self.audioPlayer?.numberOfLoops = 0 /// Number of times to loop the audio
								self.audioPlayer?.play() /// start playing
								
						} catch {
								print("Couldn't play audio. Error: \(error)")
						}
						
				} else {
						print("No audio file found")
				}
		}
}
let swiftuiAudioPlayerView = SwiftUIAudioPlayerView()
PlaygroundPage.current.setLiveView(swiftuiAudioPlayerView)
...or UIKit:
import AVFoundation
import SwiftUI
import PlaygroundSupport
class UIKitAudioPlayerView: UIView {
		
		/// the audio player that will play your audio file. Can't be a local variable.
		var audioPlayer: AVAudioPlayer?
		
		/// so we only make and connect the button once
		var hasLoadedView = false
		var audioButton = UIButton()
		
		/// the view is guarenteed to be loaded at `layoutSubviews()`
		override func layoutSubviews() {
				super.layoutSubviews()
				
				if !hasLoadedView {
						hasLoadedView = true
						
						audioButton.setTitle("Play Audio!", for: .normal)
						audioButton.setTitleColor(UIColor.blue, for: .normal)
						backgroundColor = .white
						
						addSubview(audioButton) /// add the button to the view
						audioButton.addTarget(self, action: #selector(playAudio), for: .touchUpInside)
				}
				
				/// positioning (center-align the button)
				let middleXOfView = bounds.width / 2
				let middleYOfView = bounds.height / 2
				let buttonFrame = CGRect(x: middleXOfView - 60, y: middleYOfView - 20, width: 120, height: 40)
				audioButton.frame = buttonFrame
		}
		
		@objc func playAudio() { /// function to play audio
				
				/// the URL of the audio file.
				/// forResource = name of the file.
				/// withExtension = extension, usually "mp3"
				if let audioURL = Bundle.main.url(forResource: "slow-spring-board", withExtension: "mp3") {
						do {
								try self.audioPlayer = AVAudioPlayer(contentsOf: audioURL) /// make the audio player
								self.audioPlayer?.numberOfLoops = 0 /// Number of times to loop the audio
								self.audioPlayer?.play() /// start playing
								
						} catch {
								print("Couldn't play audio. Error: \(error)")
						}
						
				} else {
						print("No audio file found")
				}
		}
}
let uikitAudioPlayerView = UIKitAudioPlayerView()
PlaygroundPage.current.setLiveView(uikitAudioPlayerView)
Replace "slow-spring-board" with the name of your sound file.
The trick here is to use Bundle.main.url(forResource:withExtension:). You MUST do this. If you try adding a file literal via the “+” button (by tapping an already-imported file), it won’t work. - from a Medium article I'm writing on this topic (not published yet)
Same here. The Forums support says - https://developer.apple.com/support/forums/ that you can only edit posts within 15 minutes of publishing, but doesn't mention deleting (besides how moderators can delete).
Yes. You'll be able to release iOS 14 apps in the Fall, when iOS 14 is released.