Create Post Header
Overview
LMFeedCreatePostHeaderView
represents a header view for the post creation or edit screen. It displays the user's profile image, username.
File Location:
LMFeedCreatePostHeaderView.swift
UI Components
containerView
: A LMFeedView that serves as the main container view that holds all other subviews.stackView
: A LMFeedStackView that arranges the profile image, username label, and edit button horizontally.imageContainerView
: A LMFeedView container that holds the user's profile image.userProfileImage
: A LMFeedImageView that displays the user's profile image.userNameLabel
: A LMFeedLabel that displays the user's username.editAuthorButton
: A LMFeedButton that represents the edit button for the author.
Methods
configure()
: Configures the header view with the providedContentModel
data.
Customization
CustomHeaderView.swift
class CustomHeaderView: LMFeedCreatePostHeaderView {
override func setupAppearance() {
super.setupAppearance()
containerView.backgroundColor = .green
userNameLabel.textColor = .white
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMUIComponents.shared.createPostHeaderView = CustomHeaderView.self
// ...
return true
}