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 and question-and-answer format posts.

LMFeedPostFooterView

Functionality

UI Elements

  • containerView: A view that contains all other subviews
  • actionStackView: A horizontal stack view that organizes the action buttons
  • likeButton: A button to like/unlike the post
  • likeTextButton: A button displaying the like count
  • commentButton: A button for adding comments
  • saveButton: A button to save/unsave the post
  • shareButton: A button to share the post
  • spacer: A view used for spacing within the stack views

Data Variables

  • delegate: An instance of LMFeedPostFooterViewProtocol to handle interactions
  • 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

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
}