-
Notifications
You must be signed in to change notification settings - Fork 2
Support UI Module
The LiUIComponents module is an optional UI support library that includes a support-focused Community workflow. It includes a set of ViewControllers and Views supporting message lists, message posting, community browsing and navigation, and keyword search. The module depends on LiCore.
See Community iOS SDK UI components for descriptions of our screen elements and view controllers.
This guide includes:
If you have not already done so, clone the li-ios-sdk package. Follow the instructions for adding the SDK project and dependencies in Getting Started with the Community iOS SDK.
The following example shows how to start our Support UI. It is similar to what you'll see in our LithiumExample app. We recommend reviewing our example app before starting SDK development.
The code in this guide starts the Support UI on performing the onStartCommunity action. We'll create an instance of LiHomeViewController, set the Community name, and set the color for the buttons.
The following code shows how to launch the UI, including:
- Set up the Community name and tint color for the actions.
- Create an instance of
LiHomeViewControllerusing the factory methodmakeHomeViewController. - Present
LiHomeViewController.
import UIKit
import LiSDKUIComponents
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func onStartCommunity(_ sender: UIButton) {
//Set tint color of the buttons
LiUISDKManager.sharedInstance.set(globalTintColor: .red)
//Set name of the community
LiUISDKManager.sharedInstance.set(communityName: "Lithium Community")
//create an instance of LiHomeViewController
let homeViewController = LiHomeViewController.makeHomeViewController(isSSOLogin: false, ssoToken: nil, deviceToken: deviceToken, notificationProvider: NotificationProviders.apns)
//If your view controller is already part of a navigation controller.
self.navigationController?.pushViewController(homeViewController, animated: false)
// else if you are presenting a model then do the following
//let navController = UINavigationController(rootViewController: homeViewController)
//self.present(navController, animated: true, completion: nil)
}
}
At this point, you can build and run your app.
See Community iOS SDK UI components for descriptions of our UI elements and view controllers.