美文网首页Swift 高级进阶iOS 开发进阶
Swift 重写系统长按拖拽Cell的图标

Swift 重写系统长按拖拽Cell的图标

作者: 屈涯 | 来源:发表于2019-08-26 16:03 被阅读0次
    override func layoutSubviews() {
        super.layoutSubviews()
        for  view: UIView in self.subviews {
            let viewStr = NSStringFromClass(type(of: view)).components(separatedBy: ".").last!
            if viewStr == "UITableViewCellReorderControl" {
                for subview: UIView in view.subviews where subview is UIImageView {
                        let selectView = subview as? UIImageView ?? UIImageView()
                        selectView.image = UIImage.init(named: "icon_move")
                        selectView.snp.makeConstraints { (make) in
                            make.centerY.equalTo(self)
                            make.width.equalTo(28)
                            make.height.equalTo(28)
                            make.right.equalTo(-20)
                        }
                }
            }
        }
    }

相关文章

网友评论

    本文标题:Swift 重写系统长按拖拽Cell的图标

    本文链接:https://www.haomeiwen.com/subject/amhdectx.html