Yep, that works. Here is the workaround:
@MainActor
func Button(_ str: String, image: ImageResource, action: @escaping () -> ()) -> some View {
Button(action: action) {
Label(str, image: image)
}
}
Post
Replies
Boosts
Views
Activity
I've verified this on a second machine. Easy to see the issue by adding an image to your Assets and this piece of code:
Button("Test", image: .myImage, action: {})
This will build but crash on launch.
Thanks Quinn! I guess it is just my head playing tricks on me. Damn... and the sandbox means that there is no way to do this from an App Store app?
Yep, I'm still seeing the issue with ClosedRanges on beta 5.
I'm seeing this when I attempt to use a ClosedRange as the type of a model property.
It's a bug.
I just saw this: https://mastodon.social/@denisdepalatis/110561280521551715
I'm seeing this now too with Xcode 12.1. Reboot solved the issue.
I can confirm that this is still an issue on beta 6. To reproduce, use the following to get a file descriptor, instead of NSFileHandle.int fd = open([fileUrl path].UTF8String, ORDWR);and then, the following to acquire a file lock:-int ret = flock(fd, LOCKSH); The FileHandle was just to release the fd when the object went away. This code right here never crashes for me:
let lock2URL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: sharedContainerIdentifier)!.appendingPathComponent("shared2.lock")
var fd: Int32 = -1
try? Data().write(to: lock2URL, options: .atomic)
fd = open(lock2URL.path, O_RDWR)
assert(fd >= 0)
assert(flock(fd, LOCK_SH) == 0)
followed by backgrounding the app and verifying that it is suspended in the debugger.
I'm testing on an iPhone 6s with iOS 14 beta 6.
I'm trying to reproduce this issue with beta 6, but haven't been able to do it. Can anyone confirm that they still see it? I have an extension and an app both using flock to take a lock on a file in a shared container and the app appears to be able to suspend just fine while holding the lock.
This is using flock(fileHandle.fileDescriptor, LOCK_EX | LOCK_NB).