Post

Replies

Boosts

Views

Activity

UIPasteboard.general no longer accessible from INExtension?
Hello everyone! I have this code in my INExtension: UIPasteboard.general.items.removeAll() Up through iOS 14.5, this worked correctly. However, in 14.5.1 and 14.6 beta 2, the following error message appears in the console, and the system pasteboard remains unchanged. Could not save pasteboard named com.apple.UIKit.pboard.general. Error: Error Domain=PBErrorDomain Code=11 "The pasteboard name com.apple.UIKit.pboard.general is not valid." UserInfo={NSLocalizedDescription=The pasteboard name com.apple.UIKit.pboard.general is not valid.} I filed FB9098625. Is anyone else having this issue?
10
0
5.8k
May ’21
Importing Unknown UTTypes at Runtime
Hello everyone! I am running into an issue trying to use UTType with identifiers that are not known until runtime. For example, running this code import UniformTypeIdentifiers let type = UTType(importedAs: "com.example.fileformat") creates a console warning [Type Declaration Issues] Type "com.example.fileformat" was expected to be declared and imported in the Info.plist of Debug, but it was not found. and a Xcode runtime warning However, the UTType object is initialized and can be used. identifier: com.example.fileformat isPublic:   false isDynamic:  false isDeclared: true Normally, this would be a simple "just add it to Info.plist", but with my program it is impossible to know all possible types at build time (content from NSPasteboard). Does anyone know if this is a warning that can be ignored, or is this undefined behavior? Thanks!
1
2
3.3k
Jun ’21