首页 > 技术文章 > swift 移除所有子控件

qingzZ 2018-09-12 16:13 原文

    /// 移除所有子控件
    func removeAllSubViews(){
        if self.view.subviews.count>0{
            self.view.subviews.forEach({$0.removeFromSuperview()})
        }
    }
    

  

推荐阅读