Footer View
Overview
LikeMindsFeed SDK Footer View for displaying action buttons for post interactions in a feed. These components are designed to handle different use cases, including standard posts and question-and-answer format posts.
- Social Feed Footer View
- QnA Theme Footer View
Functionality
UI Elements
containerView
: A view that contains all other subviewsactionStackView
: A horizontal stack view that organizes the action buttonslikeButton
: A button to like/unlike the postlikeTextButton
: A button displaying the like countcommentButton
: A button for adding commentssaveButton
: A button to save/unsave the postshareButton
: A button to share the postspacer
: A view used for spacing within the stack views
Data Variables
delegate
: An instance ofLMFeedPostFooterViewProtocol
to handle interactionspostID
: The identifier of the postlikeCount
: The count of likes for the post
Methods
configure()
: Configures the footer view with the provided data and sets up the delegate for cell interactionsgetLikeText()
: Generates the appropriate text based on the like countgetCommentText()
: Generates the appropriate text based on the comment countdidTapLikeButton()
: Handles the action when the like button is tappeddidTapLikeTextButton()
: Handles the action when the like text button is tappeddidTapCommentButton()
: Handles the action when the comment button is tappeddidTapSaveButton()
: Handles the action when the save button is tappeddidTapShareButton()
: Handles the action when the share button is tappeddidTapPost()
: Handles the action when the entire footer is tapped
Customisation
- Footer View
- QnA Footer View
CustomFooterView.swift
class CustomFooterView: LMFeedPostFooterView {
override func setupAppearance() {
super.setupAppearance()
backgroundColor = .green
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMUIComponents.shared.footerView = CustomFooterView.self
// ...
return true
}
CustomFooterView.swift
class CustomFooterView: LMFeedPostQnAFooterView {
override func setupAppearance() {
super.setupAppearance()
backgroundColor = .green
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMUIComponents.shared.qnaFooterView = CustomFooterView.self
// ...
return true
}