0
응용 프로그램에서 기록을 실행하기위한 코드가 있습니다.클릭하면 레이블이 업데이트됩니다.
=을 누르는 것뿐만 아니라 숫자를 바로 표시 할 수 있도록 개선하려면 어떻게해야합니까?
내 programm에 :
// Connected to button "="
@IBAction func equalitySignPressed(sender: UIButton) {
if stillTyping {
secondOperand = currentInput
}
dotIsPlaced = false
addHistory(text: operationSign + displayResultLabel.text!)
switch operationSign {
case "+":
operateWithTwoOperands{$0 + $1}
case "-":
operateWithTwoOperands{$0 - $1}
case "×":
operateWithTwoOperands{$0 * $1}
case "÷":
operateWithTwoOperands{$0/$1}
default: break
}
}
func addHistory(text: String){
//Add text
resultLabelText.text = resultLabelText.text! + "" + text
}
전류 출력 : 여기
같은 값을 넣을 수 있습니다 "addObserver (자기, forKeyPath : #keyPath (INPUTS), 옵션 : [.old로, .new를, 컨텍스트 : 전무)" ??? – B2Fq
에서 viewController. UIViewController 구현 부분. –