Skip to main content

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.

LMFeedPostFooterView

File Location:
LMFeedPostFooterView.swift

Functionality

UI Elements

  • containerView: A LMFeedView which serves as main container view
  • actionStackView: A LMFeedStackView that organizes the action buttons horizontally or vertically
  • likeButton: A LMFeedButton to like/unlike the post
  • likeTextButton: A LMFeedButton displaying the like count
  • commentButton: A LMFeedButton for adding comments
  • saveButton: A LMFeedButton to save/unsave the post
  • shareButton: A LMFeedButton to share the post
  • spacer: A LMFeedView used for spacing within the stack views
  • moreButton (Video Footer only): A LMFeedButton to show more options (menu)

Data Variables

  • delegate: An instance of LMFeedPostFooterViewProtocol to handle interactions
  • videoDelegate (Video Footer only): An instance of LMFeedVideoFooterViewProtocol to handle video-specific actions
  • postID: The identifier of the post
  • likeCount: The count of likes for the post

Methods

  • configure(): Configures the footer view with the provided data and sets up the delegate for cell interactions
  • getLikeText(): Generates the appropriate text based on the like count
  • getCommentText(): Generates the appropriate text based on the comment count
  • didTapLikeButton(): Handles the action when the like button is tapped
  • didTapLikeTextButton(): Handles the action when the like text button is tapped
  • didTapCommentButton(): Handles the action when the comment button is tapped
  • didTapSaveButton(): Handles the action when the save button is tapped
  • didTapShareButton(): Handles the action when the share button is tapped
  • didTapPost(): Handles the action when the entire footer is tapped
  • didTapFooterMenuButton() (Video Footer only): Handles the action when the more/menu button is tapped

Customisation

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
}