Custom UI
SpotImCustomUIDelegate
The SDK supports to customize the following UI components via SpotImCustomUIDelegate
:








In order to add your own customization for SpotIm UI elements, you have to implement the SpotImCustomUIDelegate
protocol as follows:
extension ArticleViewController: SpotImCustomUIDelegate {
func customizeView(view: CustomizableView, isDarkMode: Bool, postId: String) {
switch view {
case .loginPrompt(let textView):
// set your own customization
break
// set more customizations to other CustomizableView
default:
break
}
}
}
In SpotIm.createSpotImFlowCoordinator
, set your SpotImCustomUIDelegate
to the coordinator as follows:
SpotIm.createSpotImFlowCoordinator(loginDelegate: self) { result in
switch result {
case .success(let coordinator):
self.spotIMCoordinator = coordinator
coordinator.setCustomUIDelegate(delegate: self) // set the delegate
}
}
Other customization
You can customize the text for sorting options
// Method signature
setCustomSortByOptionText(option: SpotImSortByOption, text: String)
// SpotImSortByOption enum
enum SpotImSortByOption {
case best
case newest
case oldest
}
// Example
SpotIm.setCustomSortByOptionText(option: .best, text: "CustomTitle")
Updated 1 day ago
Did this page help you?