Has 'kUTTypeFlatRTFD' been renamed?

148 views Asked by At

When trying to access the constant kUTTypeFlatRTFD (or any of the text types for that matter) I get the issue that it is an unresolved identifier.

It appears to not be deprecated, and available as part of MobileCoreServices: https://developer.apple.com/reference/mobilecoreservices/kuttypeflatrtfd

Currently, even the simple print(kUTTypeFlatRTFD); results in this compiler error when placed in a blank view controller of a new iOS project.

Is there a special way to access this in Swift 3+?

1

There are 1 answers

0
Jordan Smith On BEST ANSWER

If you can't find a type or constant, make sure you have imported the relevant library. For your case, import MobileCoreServices should do the trick.

Normally, you will import Foundation or import UIKit at the top of a Swift file (for iOS projects anyway). If what you need isn't contained in that library you need to explicitly import it.