Example

When a user clicks on the user profile avatar at the post creator area, UIKit will open User profile page

However, you can intercept the event and define your own logic following the example below.

Usage

  1. Subclass EkoEventHandler and override its default functions.


class CustomEventHandler: EkoEventHandler {
    
    override func userDidTap(from source: EkoViewController, userId: String) {

        let settings = EkoUserProfilePageSettings()
        settings.shouldChatButtonHide = false
        
        let viewController = EkoUserProfilePageViewController.make(withUserId: userId, settings: settings)
        source.navigationController?.pushViewController(viewController, animated: true)
    }
    
    override func communityDidTap(from source: EkoViewController, communityId: String) {
        
        let settings = EkoCommunityProfilePageSettings()
        settings.shouldChatButtonHide = false
        
        let viewController = EkoCommunityProfilePageViewController.make(withCommunityId: communityId, settings: settings)
        source.navigationController?.pushViewController(viewController, animated: true)
    }
    
}

2. Assign a class instance through a set function of UpstraUIKitManager

UpstraUIKitManager.set(eventHandler: CustomEventHandler())

Last updated