Universal Feed
Overview
LikeMindsFeed offers various Universal Feed Screen implementations to cater to different use cases. These screens are responsible for displaying a feed with topic selection, post list, and create post functionality, with each variant optimized for specific content types or interactions.
- Social Feed
- QnA Feed
Functionality
UI Components
contentStack
: Main content containertopicContainerView
andtopicStackView
: Topic selection UItopicSelectionButton
: Navigate to "All Topics"topicCollection
: Display filtered topicsclearButton
: Clear filtered topicscreatePostButton
: Create new postcreatePostLoaderView
: Loading animation for post creationpostList
: Instance of LMFeedPostListScreen for displaying the standard post listdidTapSearchButton()
: Navigates to standard search post screen
Methods
postCreationInProgress(notification:)
: Handles the post creation in progress notification.postCreationSuccessful()
: Handles the post creation successful notification.postError(notification:)
: Handles post creation and edit errors.
Action Handlers
didTapAllTopicsButton()
: Navigates to the Topic Selection screen.didTapClearButton()
: Clears the selected topics.didTapNewPostButton()
: Navigates to the "Create Post" screen.didTapNotificationButton()
: Navigates to the notification screen.
Customisation
- Social Feed
- QnA Feed
CustomUniversalFeedScreen.swift
class CustomUniversalFeedScreen: LMUniversalFeedScreen {
override func setupAppearance() {
super.setupAppearance()
view.backgroundColor = .lightGray
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
Components.shared.universalFeedScreen = CustomUniversalFeedScreen.self
// ...
return true
}
CustomQnAUniversalFeed.swift
class CustomQnAUniversalFeed: LMFeedQnAUniversalFeed {
override func setupAppearance() {
super.setupAppearance()
tableView.backgroundColor = .lightGray
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
Components.shared.qnaUniversalFeed = CustomQnAUniversalFeed.self
// ...
return true
}