Add Media View
Overview
LMFeedAddMediaView
represents a custom view for adding media to a post creation screen. This view displays an image and a title label, along with an optional separator view.
UI Components
containerView
: A containerLMView
that holds all other subviews.imageView
: AnLMImageView
that displays the provided image.titleLabel
: AnLMLabel
that displays the provided title text.separatorView
: AnLMView
that acts as a separator line at the bottom of the view.
Data Variables
imageHeight
: ACGFloat
value that determines the height of theimageView
. The default value is 24.
Methods
configure()
: Configures the view with the provided title text, image, and an option to hide the separator view.
Customization
CustomAddMediaView.swift
class CustomAddMediaView: LMFeedAddMediaView {
override func setupAppearance() {
super.setupAppearance()
containerView.backgroundColor = .green
titleLabel.textColor = .white
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMUIComponents.shared.addMediaView = CustomAddMediaView.self
// ...
return true
}