Skip to main content

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.

LMUniversalFeedScreen

Functionality

UI Components

  • contentStack: Main content container
  • topicContainerView and topicStackView: Topic selection UI
  • topicSelectionButton: Navigate to "All Topics"
  • topicCollection: Display filtered topics
  • clearButton: Clear filtered topics
  • createPostButton: Create new post
  • createPostLoaderView: Loading animation for post creation
  • postList: Instance of LMFeedPostListScreen for displaying the standard post list
  • didTapSearchButton(): 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

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
}