Universal Feed
Overview
LMUniversalFeedScreen
displays a universal feed screen with a topic selection bar and a list of posts, create post button.
UI Components
contentStack
: ALMStackView
that holds the main content of the view controller.topicContainerView
: ALMView
that containstopicStackView
.topicStackView
: ALMStackView
that holds the topic selection UI elements.topicSelectionButton
: ALMButton
that allows the user to navigate to the "All Topics" screen.topicCollection
: ALMCollectionView
that displays the filtered topics.clearButton
: ALMButton
that allows the user to clear the filtered topics.postList
: An instance of LMFeedPostListScreen that displays the list of posts.createPostButton
: ALMButton
that allows the user to create a new post.createPostLoaderView
: ALMFeedAddMediaPreview
view that displays a loading animation during post creation.
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.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()
tableView.backgroundColor = .lightGray
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
Components.shared.universalFeedScreen = CustomUniversalFeedScreen.self
// ...
return true
}