Last active
September 17, 2020 04:44
-
-
Save MojtabaHs/08ef36acf40aeb7febdfddd71f9d232a to your computer and use it in GitHub Desktop.
This file contains 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
#if DEBUG | |
import SwiftUI | |
protocol UIViewControllerRepresentableHelper: UIViewControllerRepresentable { | |
var configuration: (UIViewControllerType) -> () { get set } | |
} | |
extension UIViewControllerRepresentableHelper { | |
func makeUIViewController(context: Context) -> UIViewControllerType { UIViewControllerType() } | |
func updateUIViewController(_ uiViewController: UIViewControllerType, context: Context) { configuration(uiViewController) } | |
} | |
#endif | |
// MARK: - Usage: | |
struct <#UIViewControllerForSwiftUI#>: UIViewControllerRepresentableHelper { | |
typealias UIViewControllerType = TripDetailsCollectionViewController | |
var configuration = { (view: UIViewControllerType) in } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment