I'm relatively new to Swift and am receiving a Multiple Closures with Trailing Closure Violation:... warning from SwiftLint. My code that causes this looks like the below. Any idea on how I can refactor my code so that it doesn't violate SwiftLint. Thanks so much for your help
let RepaymentCoordinator = PayCoordinator(
deLinkedErrorCompletion: { topvc, account in
self.delinkedErrorCompletion(topvc, account: account)
}
) { [weak self] _, isPayNowCallCompleted in
guard let self = self else { return }
if self.accountDetailsCoordinator != nil, isPayNowCallCompleted {
self.accountDetailsCoordinator?.reloadBuyNowPayLaterAccountDetails()
}
}
The PayCoordinator.init
:
public init(
topViewController: UIViewController,
repaymentProvider: BuyNowPayLaterRepaymentProvidable,
deLinkedErrorCompletion: @escaping BuyNowPayLaterRepaymentCoordinatorDeLinkedErrorCompletion,
flowDidFinishCompletion: @escaping BuyNowPayLaterRepaymentCoordinatorFlowDidFinishCompletion
) {
self.topViewController = topViewController
self.repaymentProvider = repaymentProvider
self.deLinkedErrorCompletion = deLinkedErrorCompletion
self.flowDidFinishCompletion = flowDidFinishCompletion
super.init()
}