2016-09-22 100 views
0
label.snp.makeConstraints { (make) -> Void in 

     make.width.equalTo(box).dividedBy(2) 

     make.top.equalTo(100) 

     make.left.greaterThanOrEqualTo(box.snp.left).offset(15) 
} 

我希望你更新後的約束在動畫關閉您的視圖調用layoutIfNeeded()由buttonswift 3如何通過snapkit將動畫添加到任何UI?

+0

要引用多行代碼塊,您可以在每行的開頭放置4個空格。 – DavidA

回答

1

動畫這個label到另一個位置。

UIView.animateWithDuration(0.2, delay: 0, options: [], animations: {() -> Void in 
     self.view.layoutIfNeeded() 
    }) 

希望這會有所幫助。

+0

謝謝,你解決了吧 –

+0

沒問題。樂於幫助。 –