Skip to main content

Create Post Header

Overview

LMFeedCreatePostHeaderView represents a header view for the post creation or edit screen. It displays the user's profile image, username.

LMFeedCreatePostHeaderView

UI Components

  • containerView: The main container view that holds all other subviews.
  • stackView: A horizontal LMStackView that arranges the profile image, username label, and edit button.
  • imageContainerView: A container view that holds the user's profile image.
  • userProfileImage: An LMImageView that displays the user's profile image.
  • userNameLabel: An LMLabel that displays the user's username.
  • editAuthorButton: An LMButton that represents the edit button for the author.

Methods

  • configure(): Configures the header view with the provided ContentModel 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
}