Last active
December 26, 2022 06:25
-
-
Save aliakhtar49/5236818b36050ca58c987084ed8a9102 to your computer and use it in GitHub Desktop.
Integration
This file contains hidden or 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
// Step 1 : Initialize View and interface | |
private let paymentDetailsInjector: PaymentDetailsViewLoadable = PaymentDetailsViewLoader() | |
private let paymentDetailsViewContainer: UIView = UIView() | |
// Step 2 : listen call backs and load view | |
private func commonInit() { | |
paymentDetailsInjector.renderView( | |
componentId: "123", | |
into: paymentDetailsViewContainer | |
) | |
paymentDetailsInjector.output.sink { [weak self] output in | |
switch output { | |
case .hide: | |
// Hide logic client will implement | |
break | |
} | |
}.store(in: &subscriptions) | |
} | |
// Step 3 : Client add container view inside it's screen where it wants our component to load | |
func configureContainerView() { | |
scrollStackViewContainer.addArrangedSubview(paymentSummaryViewContainer) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment