Skip to content

Instantly share code, notes, and snippets.

@MarcoEidinger
Last active September 4, 2021 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarcoEidinger/5bb8c506ddf7765fbcfa366b0d4b102a to your computer and use it in GitHub Desktop.
Save MarcoEidinger/5bb8c506ddf7765fbcfa366b0d4b102a to your computer and use it in GitHub Desktop.
Gists for "Rich and interactive cards in SwiftUI" blog post. Original: https://github.com/MarcoEidinger/ms-adaptivecards-ios-example
import Foundation
import SwiftUI
struct AdaptiveCardView: UIViewControllerRepresentable {
var cardJson: String
func makeUIViewController(context: Context) -> AdaptiveCardViewController {
let vc = AdaptiveCardViewController()
vc.cardJson = cardJson
return vc
}
func updateUIViewController(_ uiViewController: AdaptiveCardViewController, context: Context) {
uiViewController.loadViewIfNeeded()
}
typealias UIViewControllerType = AdaptiveCardViewController
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment