Swift 拖拽可吸边悬浮按钮
闲来无事写个小Demo
上图
代码片
func addDragFloatBtn() {
let btn = UIButton(frame: CGRect(x: 10, y: 200, width: 80, height: 80))
btn.backgroundColor = UIColor.orange
btn.layer.cornerRadius = 20.0
self.view .addSubview(btn)
btn.addTarget(self, action: #selector(floatBtnAction(sender: