Skip to content

Instantly share code, notes, and snippets.

@russell-archer
Created October 8, 2018 23:49
Show Gist options
  • Save russell-archer/b2959134101b0e35f613587403de773c to your computer and use it in GitHub Desktop.
Save russell-archer/b2959134101b0e35f613587403de773c to your computer and use it in GitHub Desktop.
ShowRandomColor. Handle the intent
//
// IntentHandler.swift
// ColorIntent
//
// Created by Russell Archer on 05/10/2018.
// Copyright © 2018 Russell Archer. All rights reserved.
//
import Intents
class IntentHandler: INExtension {
override func handler(for intent: INIntent) -> Any {
guard intent is ShowRandomColorIntent else {
fatalError("Can't handle intent \(intent)")
}
return ColorIntentHandler()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment