I am implementing iOS14 widgets with configuration intent that allows users to select a Tweet when the users tap "Edit Widget".
Implementation works well but the image is not sized to the specified width and height in the selection pop up, and seems to be capped at the row height.
Code:
class IntentHandler: INExtension, SelectTweetIntentHandling {
func provideTweetOptionsCollection(for intent: SelectTweetIntent, with completion: @escaping (INObjectCollection<TweetParam>?, Error?) -> Void) {
let tweetParams = [
TweetParam(identifier: "1", display: "Title 1", subtitle: "Subtitle 1", image: INImage(url: URL(string: "https://i.pinimg.com/474x/69/77/b7/6977b70a129ec184527433bbdf9fe457.jpg")!, width: 200, height: 200)),
TweetParam(identifier: "2", display: "Title 2", subtitle: "Subtitle 2", image: INImage(url: URL(string: "https://i.pinimg.com/474x/69/77/b7/6977b70a129ec184527433bbdf9fe457.jpg")!, width: 200, height: 200)),
TweetParam(identifier: "3", display: "Title 3", subtitle: "Subtitle 3", image: INImage(url: URL(string: "https://i.pinimg.com/474x/69/77/b7/6977b70a129ec184527433bbdf9fe457.jpg")!, width: 200, height: 200))
]
let collection = INObjectCollection(items: tweetParams)
completion(collection, nil)
}
override func handler(for intent: INIntent) -> Any {
// This is the default implementation. If you want different objects to handle different intents,
// you can override this and return the handler you want for that particular intent.
return self
}
}
Noticed that I had specified size 200x200 as an exaggeration, but the image size does not respect that. How do I manually size the image to my specified size.
