Swift4 Day88:Chain Animations連動動畫
Swift4 / iOS11 / 2018.04.07
Published in
2 min readApr 6, 2018
基礎設定
利用translatesAutoresizingMaskIntoConstraints與centerXAnchor讓文字在圖面中間,設定layout。
文字換行
numberOfLines = 0,才能讓畫面呈現完整的文字。原本都是預設1。
搭配\n是在文字中下一行的方法。
widthAnchor設定與兩側的距離
Extract Method
Xcode直接幫你做一個funciton(這好驚人第一次看到🙀)
addGestureRecognizer
Add animations
請看程式碼完整:按這
alpha = 0後會有fade的感覺,bodyLabel與titleLabel不同之處,在於bodyLabeldelay: 0.5。
出自:
Lets Build That App的Swift: How to Chain Animations for Impressive Visual Effects,很棒的Youtube頻道🙆