SkeletonLayout
@MainActor
open class SkeletonLayout : SkeletonView
骨架屏布局视图,可从视图生成骨架屏,嵌套到UIScrollView即可实现滚动
-
相对布局视图
Declaration
Swift
@MainActor open weak var layoutView: UIView? { get set }
-
指定相对布局视图初始化
Declaration
Swift
@MainActor public init(layoutView: UIView?)
-
Undocumented
Declaration
Swift
@MainActor override public init(frame: CGRect)
-
Undocumented
Declaration
Swift
@MainActor public required init?(coder: NSCoder)
-
设置相对滚动视图,实现跟随下拉刷新等效果。block参数为contentOffset.y(不大于0),默认设置顶部布局跟随滚动
Declaration
Swift
@MainActor open func setScrollView(_ scrollView: UIScrollView, scrollBlock: (@MainActor @Sendable (CGFloat) -> Void)? = nil)
-
批量添加子视图(兼容骨架视图),返回生成的骨架视图数组
Declaration
Swift
@discardableResult @MainActor open func addSkeletonViews(_ views: [UIView]) -> [SkeletonView]
-
批量添加子视图(兼容骨架视图),支持自定义骨架,返回生成的骨架视图数组
Declaration
Swift
@discardableResult @MainActor open func addSkeletonViews(_ views: [UIView], block: (@MainActor (SkeletonView, Int) -> Void)?) -> [SkeletonView]
-
添加单个子视图(兼容骨架视图),返回生成的骨架视图
Declaration
Swift
@discardableResult @MainActor open func addSkeletonView(_ view: UIView) -> SkeletonView
-
添加单个子视图(兼容骨架视图),支持自定义骨架,返回生成的骨架视图
Declaration
Swift
@discardableResult @MainActor open func addSkeletonView(_ view: UIView, block: (@MainActor (SkeletonView) -> Void)?) -> SkeletonView
-
添加单个布局视图(兼容骨架视图),返回生成的骨架布局
Declaration
Swift
@discardableResult @MainActor open func addSkeletonLayout(_ view: UIView) -> SkeletonLayout
-
添加单个布局视图(兼容骨架视图),支持自定义骨架,返回生成的骨架布局
Declaration
Swift
@discardableResult @MainActor open func addSkeletonLayout(_ view: UIView, block: (@MainActor (SkeletonLayout) -> Void)?) -> SkeletonLayout
-
解析视图为骨架视图
Declaration
Swift
@MainActor open class func parseSkeletonView(_ view: UIView) -> SkeletonView
-
解析布局视图为骨架布局
Declaration
Swift
@MainActor open class func parseSkeletonLayout(_ view: UIView) -> SkeletonLayout