Created
October 25, 2019 21:58
-
-
Save victorpanitz/a6e02973324a64161e25827ef4ab2980 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SeriesSuggestionIntent.swift | |
// | |
// This file was automatically generated and should not be edited. | |
// | |
#if canImport(Intents) | |
import Intents | |
@available(iOS 12.0, watchOS 5.0, *) @available(macOS, unavailable) @available(tvOS, unavailable) | |
@objc(SeriesSuggestionIntent) | |
public class SeriesSuggestionIntent: INIntent { | |
@NSManaged public var genre: String? | |
@available(iOS 13.0, watchOS 6.0, *) | |
@NSManaged public var topSeries: NSNumber? | |
} | |
/*! | |
@abstract Protocol to declare support for handling a SeriesSuggestionIntent. By implementing this protocol, a class can provide logic for resolving, confirming and handling the intent. | |
@discussion The minimum requirement for an implementing class is that it should be able to handle the intent. The confirmation method is optional. The handling method is always called last, after confirming the intent. | |
*/ | |
@available(iOS 12.0, watchOS 5.0, *) @available(macOS, unavailable) @available(tvOS, unavailable) | |
@objc(SeriesSuggestionIntentHandling) | |
public protocol SeriesSuggestionIntentHandling: NSObjectProtocol { | |
/*! | |
@abstract Handling method - Execute the task represented by the SeriesSuggestionIntent that's passed in | |
@discussion Called to actually execute the intent. The app must return a response for this intent. | |
@param intent The input intent | |
@param completion The response handling block takes a SeriesSuggestionIntentResponse containing the details of the result of having executed the intent | |
@see SeriesSuggestionIntentResponse | |
*/ | |
@objc(handleSeriesSuggestion:completion:) | |
func handle(intent: SeriesSuggestionIntent, completion: @escaping (SeriesSuggestionIntentResponse) -> Swift.Void) | |
/*! | |
@abstract Resolution methods - Determine if this intent is ready for the next step (confirmation) | |
@discussion Called to make sure the app extension is capable of handling this intent in its current form. This method is for validating if the intent needs any further fleshing out. | |
@param intent The input intent | |
@param completion The response block contains an INIntentResolutionResult for the parameter being resolved | |
@see INIntentResolutionResult | |
*/ | |
@available(iOS 13.0, watchOS 6.0, *) | |
@objc(resolveGenreForSeriesSuggestion:withCompletion:) | |
func resolveGenre(for intent: SeriesSuggestionIntent, with completion: @escaping (INStringResolutionResult) -> Swift.Void) | |
@available(iOS 13.0, watchOS 6.0, *) | |
@objc(resolveTopSeriesForSeriesSuggestion:withCompletion:) | |
func resolveTopSeries(for intent: SeriesSuggestionIntent, with completion: @escaping (INBooleanResolutionResult) -> Swift.Void) | |
/*! | |
@abstract Confirmation method - Validate that this intent is ready for the next step (i.e. handling) | |
@discussion Called prior to asking the app to handle the intent. The app should return a response object that contains additional information about the intent, which may be relevant for the system to show the user prior to handling. If unimplemented, the system will assume the intent is valid, and will assume there is no additional information relevant to this intent. | |
@param intent The input intent | |
@param completion The response block contains a SeriesSuggestionIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling. | |
@see SeriesSuggestionIntentResponse | |
*/ | |
@objc(confirmSeriesSuggestion:completion:) | |
optional func confirm(intent: SeriesSuggestionIntent, completion: @escaping (SeriesSuggestionIntentResponse) -> Swift.Void) | |
} | |
/*! | |
@abstract Constants indicating the state of the response. | |
*/ | |
@available(iOS 12.0, watchOS 5.0, *) @available(macOS, unavailable) @available(tvOS, unavailable) | |
@objc public enum SeriesSuggestionIntentResponseCode: Int { | |
case unspecified = 0 | |
case ready | |
case continueInApp | |
case inProgress | |
case success | |
case failure | |
case failureRequiringAppLaunch | |
} | |
@available(iOS 12.0, watchOS 5.0, *) @available(macOS, unavailable) @available(tvOS, unavailable) | |
@objc(SeriesSuggestionIntentResponse) | |
public class SeriesSuggestionIntentResponse: INIntentResponse { | |
/*! | |
@abstract The response code indicating your success or failure in confirming or handling the intent. | |
*/ | |
@objc public fileprivate(set) var code: SeriesSuggestionIntentResponseCode = .unspecified | |
/*! | |
@abstract Initializes the response object with the specified code and user activity object. | |
@discussion The app extension has the option of capturing its private state as an NSUserActivity and returning it as the 'currentActivity'. If the app is launched, an NSUserActivity will be passed in with the private state. The NSUserActivity may also be used to query the app's UI extension (if provided) for a view controller representing the current intent handling state. In the case of app launch, the NSUserActivity will have its activityType set to the name of the intent. This intent object will also be available in the NSUserActivity.interaction property. | |
@param code The response code indicating your success or failure in confirming or handling the intent. | |
@param userActivity The user activity object to use when launching your app. Provide an object if you want to add information that is specific to your app. If you specify nil, the system automatically creates a user activity object for you, sets its type to the class name of the intent being handled, and fills it with an INInteraction object containing the intent and your response. | |
*/ | |
@objc(initWithCode:userActivity:) | |
public convenience init(code: SeriesSuggestionIntentResponseCode, userActivity: NSUserActivity?) { | |
self.init() | |
self.code = code | |
self.userActivity = userActivity | |
} | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment