EntityURLRepresentation
struct · iOS 18.0+ · SDK 27.1
struct EntityURLRepresentation<Entity> where Entity : AppEntityThe type that provides the URL for an app entity. If you adopt the ``URLRepresentableEntity`` protocol in an app entity, use this type to build the URL for your entity. Construct the type as a Swift string that contains characters suitable for use in a URL. To incorporate content from your app entity's properties into the URL, include a key path to the property in your string. The following example shows an app entity that represents a specific inventory item. Before returning the URL, this type replaces the `\(\.$contentID)` key path with the value in the `contentID` property. ```swift struct MyAppData: AppEntity, URLRepresentableEntity { static let defaultQuery = MyAppDataQuery() @Property(title: "Content ID") var contentID: String static var urlRepresentation = URLRepresentation("https://example.com/note=\(.$contentID)") } ``` Make sure the properties you include in your URL representation contain a URL-friendly type. The system automatically converts properties of type <doc://com.apple.documentation/documentation/swift/string>, <doc://com.apple.documentation/documentation/swift/int>, and <doc://com.apple.documentation/documentation/Foundation/URL> to values suitable for inclusion in a URL. To incorporate other types, implement the ``CustomURLRepresentationParameterConvertible`` protocol in the type.
Members (0)
This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.
Skipped declarations
3 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
EntityURLRepresentation.init(_:)
The containing type needs Swift generic type arguments. (no canonical witness for Entity)
EntityURLRepresentation.init(stringLiteral:)
The containing type needs Swift generic type arguments. (no canonical witness for Entity)
EntityURLRepresentation.init(stringInterpolation:)
The containing type needs Swift generic type arguments. (no canonical witness for Entity)