Turns out that the NSSecureCoding content was the URL, but in hexadecimal. Here's how I'm converting it to String:
let urlHex = dict.debugDescription
.replacingOccurrences(of: "Optional(", with: "")
.replacingOccurrences(of: ")", with: "")
.replacingOccurrences(of: "<", with: "")
.replacingOccurrences(of: ">", with: "")
.replacingOccurrences(of: " ", with: "")
guard let urlHexData = Data(fromHexEncodedString: urlHex) else { return }
guard let url = String(data: urlHexData, encoding: .utf8) else { return }
extension Data {
// From http://stackoverflow.com/a/40278391
init?(fromHexEncodedString string: String) {
func decodeNibble(u: UInt16) -> UInt8? {
switch(u) {
case 0x30 ... 0x39:
return UInt8(u - 0x30)
case 0x41 ... 0x46:
return UInt8(u - 0x41 + 10)
case 0x61 ... 0x66:
return UInt8(u - 0x61 + 10)
default:
return nil
}
}
self.init(capacity: string.utf16.count/2)
var even = true
var byte: UInt8 = 0
for c in string.utf16 {
guard let val = decodeNibble(u: c) else { return nil }
if even {
byte = val << 4
} else {
byte += val
self.append(byte)
}
even = !even
}
guard even else { return nil }
}
}
Now on iOS 15.0+ you can initialize a button with the ButtonRole .destructive:
Button(role: .destructive, action: { print(""}) {
Label("Delete", systemImage: "trash")
}
Post not yet marked as solved
I have exactly the same problem. Have you found a way to express this?
Post not yet marked as solved
I have seen similar issues when sharing from the Music app. Some users reported that my action extension disappeared from the share sheet, and the only way to make it reappear is to restart the phone.
Post not yet marked as solved
I think this is a Catalyst bug, as I'm also encountering this same situation: didUpdateLocations is never called. Here I'm using it inside the main app, so I don't think it has something to do with Widgets.
Post not yet marked as solved
Thanks for the update @JoeKun!
I'll wait for the fix to be deployed. In the meantime, please let me know if you need more details about the problem, or if I can help in any other way.
Thanks!
Post not yet marked as solved
It now works as expected on beta 5.
Post not yet marked as solved
It now works as expected on beta 5.
I was able to fix this by turning the App Groups capability off and on on all of my app target's on the Signing & Capabilities tab on Xcode.
Post not yet marked as solved
This suddenly started to happen with me too, a few days ago. Have you been able to find a solution?
Post not yet marked as solved
Just a few more details: I found that disabling autoresizing mask and setting individual constraints on the collection view fixes the problem:
private func configureHierarchy() {
		collectionView = UICollectionView(frame: view.bounds, collectionViewLayout: createLayout())
		collectionView.delegate = self
		collectionView.translatesAutoresizingMaskIntoConstraints = false
		view.addSubview(collectionView)
		NSLayoutConstraint.activate([
				collectionView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
				collectionView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
				collectionView.topAnchor.constraint(equalTo: view.topAnchor),
				collectionView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
		])
}
Not sure thought if this is how it was supposed to work, or if it's a bug with the .flexibleWidth autoresize mask.
The only thing that still bothers me is that it takes a while for the collection view to assume the .sidebar appearance. When opening the app for the first time, it seems that the collection view has the .sidebarPlain appearance, and then it changes to .sidebar. But I am initializing the layout list configuration with the .sidebar, so not sure why this happens.
That was it, thank you so much!
Post not yet marked as solved
Same here... It works as expected on iOS 12.4.
Post not yet marked as solved
It was fixed on iOS 13 beta 5!
Post not yet marked as solved
It was fixed on iOS 13 beta 5!