I was trying to use UIPasteboard.general.url to get some content, and I found that UIPasteboard.general.string could get the Universal Clipboard (other devices' clipboard like Mac's and iPad's) while UIPasteboard.general.url could only get the local Clipboard.
Below is a simply way to reproduce (in SwiftUI)
2. Second you simply paste it into your iOS device(Universal Clipboard on) and copy it so that your local pasteboard have this content. And then click the above button in your iOS device, you'll see something like this in your log
Below is a simply way to reproduce (in SwiftUI)
Code Block swift Button(Text("getURL")){ print("url is \(UIPasteboard.general.url)") print("string is \(UIPasteboard.general.string)") }
First you copy this link (actually any url string is OK) in Mac http://pic1.win4000.com/wallpaper/2019-08-05/5d47e530bcf01.jpg . And click the above button in your iOS device, you'll see something like this in your log
Code Block url is nil string is Optional("http://pic1.win4000.com/wallpaper/2019-08-05/5d47e530bcf01.jpg")
2. Second you simply paste it into your iOS device(Universal Clipboard on) and copy it so that your local pasteboard have this content. And then click the above button in your iOS device, you'll see something like this in your log
Code Block url is Optional("http://pic1.win4000.com/wallpaper/2019-08-05/5d47e530bcf01.jpg") string is Optional("http://pic1.win4000.com/wallpaper/2019-08-05/5d47e530bcf01.jpg")