Skip to content

Instantly share code, notes, and snippets.

@aliakhtar49
Last active December 26, 2022 06:25
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 aliakhtar49/5236818b36050ca58c987084ed8a9102 to your computer and use it in GitHub Desktop.
Save aliakhtar49/5236818b36050ca58c987084ed8a9102 to your computer and use it in GitHub Desktop.
Integration
// 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