hamsik22 / NBC_4W_Caculator

내일배움캠프 iOS_5기 4~6주차 1팀 개인프로젝트(계산기)
0 stars 0 forks source link

[Level4]: Set Button Color #8

Closed hamsik22 closed 2 days ago

hamsik22 commented 2 days ago

개요

7 : 연산버튼 배경색 변경(->주황색)

작업내용

private func setupHStackView(_ elements: [String]) -> UIStackView { 
    for item in elements {
            buttons.append(makeButton(item))
            // some Code...
    }
}
private func makeButton(_ title: String) -> UIButton { 

        if Int(title) != nil {
            button.backgroundColor = UIColor(red: 58/255, green: 58/255, blue: 58/255, alpha: 1.0)
        } else {
            button.backgroundColor = .orange
        }
    // some Code...
}

close #7