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, question-and-answer format posts, and video feed posts.
- Social Feed Footer View
- QnA Theme Footer View
- Video Feed Footer View
File Location:
LMFeedPostFooterView.swift
Functionality
UI Elements
containerView
: A LMFeedView which serves as main container viewactionStackView
: A LMFeedStackView that organizes the action buttons horizontally or verticallylikeButton
: A LMFeedButton to like/unlike the postlikeTextButton
: A LMFeedButton displaying the like countcommentButton
: A LMFeedButton for adding commentssaveButton
: A LMFeedButton to save/unsave the postshareButton
: A LMFeedButton to share the postspacer
: A LMFeedView used for spacing within the stack viewsmoreButton
(Video Footer only): A LMFeedButton to show more options (menu)
Data Variables
delegate
: An instance ofLMFeedPostFooterViewProtocol
to handle interactionsvideoDelegate
(Video Footer only): An instance ofLMFeedVideoFooterViewProtocol
to handle video-specific actionspostID
: 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 tappeddidTapFooterMenuButton()
(Video Footer only): Handles the action when the more/menu button is tapped
Customisation
- Footer View
- QnA Footer View
- Video 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
}
CustomVideoFooterView.swift
class CustomVideoFooterView: LMFeedVideoPostFooterView {
override func setupAppearance() {
super.setupAppearance()
backgroundColor = .blue
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMUIComponents.shared.videoFooterView = CustomVideoFooterView.self
// ...
return true
}