Create Post Header
Overview
LMFeedCreatePostHeaderView
represents a header view for the post creation or edit screen. It displays the user's profile image, username.
UI Components
containerView
: The main container view that holds all other subviews.stackView
: A horizontalLMStackView
that arranges the profile image, username label, and edit button.imageContainerView
: A container view that holds the user's profile image.userProfileImage
: AnLMImageView
that displays the user's profile image.userNameLabel
: AnLMLabel
that displays the user's username.editAuthorButton
: AnLMButton
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
}