점진적 과부하 개발 블로그

Swift UIButton 커스텀 하기 본문

Swift

Swift UIButton 커스텀 하기

지용빡 2022. 9. 7. 22:18
반응형
Swift UIButton 커스텀 하기 - Code Based

전체 코드

    let customButton: UIButton = {
        let button = UIButton()
        // setTitle
        button.setTitle(" Custom Button ", for: .normal)
        // backgroundColor
        button.backgroundColor = .secondarySystemBackground
        // setTitle 텍스트 컬러
        button.setTitleColor(.systemIndigo, for: .normal)
        // cornerRadius
        button.layer.cornerRadius = 8.0
        
        return button
    }()

 

반응형