Post List View
Overview
LikeMindsFeed offers various Post List Screen implementations to cater to different use cases. These screens are responsible for displaying a list of posts in a feed, with each variant optimized for specific content types or interactions.
- Social Feed
- QnA Feed
Functionality
Protocols
LMFeedPostListVCFromProtocol
Defines methods that are triggered from Post List Screens and handled by the parent view controller conforming to it.
tableViewScrolled(_ scrollView: UIScrollView)
: Gives a callback to the parent view controller that the post list view has been scrolled.postDataFetched(isEmpty: Bool)
: Gives a callback to parent view controller that data has been fetched.
LMFeedPostListVCToProtocol
Defines methods that are triggered from the parent view controller and handled by Post List Screens.
loadPostsWithTopics(_ topics: [String])
: Tells the Post List Screen to fetch data with the selected topic ids.
Protocols Implemented
- LMFeedPostHeaderViewProtocol
- LMFeedPostFooterViewProtocol
- LMPostWidgetTableViewCellProtocol
- LMFeedLinkProtocol
- LMFeedPostDocumentCellProtocol
UI Components
postList
: ALMTableView
that displays the list of posts.refreshControl
: AUIRefreshControl
for allowing the user to pull-to-refresh the feed.emptyListView
: ALMFeedNoPostWidget
that is displayed when there are no posts in the feed.
Methods
configureTableViewCells(_ tableView: LMTableView)
: Registers cell types for the table view.didTapPost(postID: String)
: Handles navigation to post detail view. Navigates to LMFeedPostDetailScreendidTapCommentButton(for postID: String)
: Handles opening the comment section for a post. Navigates to LMFeedPostDetailScreen
Cells Registered
Customisations
- Social Feed
- QnA Feed
CustomPostListScreen.swift
class CustomPostListScreen: LMFeedPostListScreen {
override func setupAppearance() {
super.setupAppearance()
tableView.backgroundColor = .lightGray
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
Components.shared.feedListScreen = CustomPostListScreen.self
// ...
return true
}
CustomQnAUniversalFeed.swift
class CustomQnAPostListScreen: LMFeedQnAPostListScreen {
override func setupAppearance() {
super.setupAppearance()
tableView.backgroundColor = .lightGray
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
Components.shared.qnaPostListScreen = CustomQnAPostListScreen.self
// ...
return true
}