iOS开发Swift开发UI页面链式调用库推荐

首页链接

https://github.com/zhiguangqiao/ChainableUIKit

安装方法

复制代码
  pod 'ChainableUIKit'

调用片段

UIButton

复制代码
import ChainableUIKit

    private let button = UIButton().chain
        .setTitleColor(.init(hex: "#9583EB"), state: .normal)
        .setTitle("全部视频", state: .normal)
        .setTitleColor(.white, state: .selected)
        .fixSize(CGSizeMake(54, 32))
        .titleFont(.systemFont(ofSize: 12))
        .cornerRadius(4)
        .view

UILabel

复制代码
import ChainableUIKit

    private let videoNumber = UILabel()
        .chain
        .text("1")
        .textColor(.init(hex: "#141B26"))
        .font(.boldSystemFont(ofSize: 30))
        .view

UIStackView

复制代码
import ChainableUIKit

    private lazy var videoNumberStackView = UIStackView().chain
        .axis(.horizontal)
        .alignment(.center)
        .backgroundColor(.white)
        .arrangedViews([
            UILabel()
            .chain
            .text("video")
            .textColor(.init(hex: "#141B26"))
            .font(.boldSystemFont(ofSize: 10))
            .view
            ,videoNumber])
        .view

UITextField

复制代码
import ChainableUIKit

    private let scoreTF = UITextField()
        .chain
        .backgroundColor(.init(hex: "#FFE3A6"))
        .textAlignment(.center)
        .keyboardType(.numberPad)
        .textColor(.init(hex: "#141B26"))
        .view
相关推荐
麻瓜呀12 小时前
vue2 Element-ui框架相关常见问题-表单组件重置显示异常
运维·服务器·ui
升讯威在线客服系统16 小时前
从 GC 抖动到稳定低延迟:在升讯威客服系统中实践 Span 与 Memory 的高性能优化
java·javascript·python·算法·性能优化·php·swift
Swift社区17 小时前
LeetCode 390 消除游戏 - Swift 题解
leetcode·游戏·swift
少云清18 小时前
【UI自动化测试】4_PO模式 _PO模式封装
ui·po模式
菜鸟小芯18 小时前
【GLM-5 陪练式创意 UI 实战】第二篇:创意魔法盒 —— 从 “开心” 到 “科技感”,AI 驱动的 UI 风格迭代
科技·ui
甲枫叶19 小时前
【claude+weelinking产品经理系列15】UI/UX 打磨——产品经理的审美终于能自己实现
java·人工智能·python·ui·产品经理·ai编程·ux
zhougl99619 小时前
前端UI框架
前端·ui
少云清19 小时前
【UI自动化测试】3_PO模式 _封装思想
python·ui·po模式
左手厨刀右手茼蒿1 天前
Flutter for OpenHarmony: Flutter 三方库 image_size_getter 零加载极速获取图片尺寸(鸿蒙 UI 布局优化必备)
android·服务器·flutter·ui·华为·harmonyos