mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2024-12-08 14:46:42 +01:00
36 lines
764 B
Swift
36 lines
764 B
Swift
//
|
|
// UIView.swift
|
|
//
|
|
//
|
|
// Created by MainasuK on 2022-4-13.
|
|
//
|
|
|
|
import UIKit
|
|
import MastodonCore
|
|
|
|
extension UIView {
|
|
|
|
static let separatorColor: UIColor = {
|
|
UIColor(dynamicProvider: { collection in
|
|
switch collection.userInterfaceStyle {
|
|
case .dark:
|
|
return ThemeService.shared.currentTheme.value.separator
|
|
default:
|
|
return .separator
|
|
}
|
|
})
|
|
}()
|
|
|
|
|
|
public static var separatorLine: UIView {
|
|
let line = UIView()
|
|
line.backgroundColor = UIView.separatorColor
|
|
return line
|
|
}
|
|
|
|
public static func separatorLineHeight(of view: UIView) -> CGFloat {
|
|
return 1.0 / view.traitCollection.displayScale
|
|
}
|
|
|
|
}
|