Swiftgram/SiriIntentsUI/IntentViewController.swift
2018-11-14 23:03:33 +04:00

47 lines
1.5 KiB
Swift

//
// IntentViewController.swift
// SiriIntentsUI
//
// Created by Peter on 9/2/16.
// Copyright © 2016 Telegram. All rights reserved.
//
import IntentsUI
// As an example, this extension's Info.plist has been configured to handle interactions for INSendMessageIntent.
// You will want to replace this or add other intents as appropriate.
// The intents whose interactions you wish to handle must be declared in the extension's Info.plist.
// You can test this example integration by saying things to Siri like:
// "Send a message using <myApp>"
class IntentViewController: UIViewController, INUIHostedViewControlling {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// MARK: - INUIHostedViewControlling
// Prepare your view controller for the interaction to handle.
func configure(with interaction: INInteraction!, context: INUIHostedViewContext, completion: ((CGSize) -> Void)!) {
// Do configuration here, including preparing views and calculating a desired size for presentation.
if let completion = completion {
completion(self.desiredSize)
}
}
var desiredSize: CGSize {
//return self.extensionContext!.hostedViewMaximumAllowedSize
return CGSize()
}
}