[Swift] UIButton 코드로 직접 구현하기 (Create UIButton programmatically in Swift )
Develop/Swift 2021. 3. 30. 16:47

안녕하세요. 미닛메이드 Minnit 입니다😌 뷰를 구성할 때 object들을 Storyboard로 구현하시나요 코드로 구현하시나요? 저는 보통 Storyboard를 사용하는 편인데,경우에 따라 코드로 구현해야할 때가 있더라구요 ! 이번에는 코드로 UIButton을 구현하고, Constraint까지 잡아보겠습니다 ~~ 이번 글에서는 translatesAutoresizingMaskIntoConstraints 를 이용해서 Button의 Constraint를 코드로 구현해볼 거예요! translatesAutoresizingMaskIntoConstraints 란 뭘까요? Apple🍎의 공식 문서를 확인해보면 "뷰의 autoresizing mask가 자동 레이아웃 제약 조건으로 변환되는지 여부를 결정하는 Bool ..