티스토리 뷰
728x90
let a = 100
let b = 200
func plus (num001 : Int, num002 : Int) -> (Int) {
return (num001 + num002)
}
func minus (_ num001 : Int, _ num002 : Int) -> (Int) {
return (num001 - num002)
}
func multiply (_ num001 : Int, _ num002 : Int) -> (Int) {
return (num001 * num002)
}
var inputButtonType = "+"
if inputButtonType == "+" {
print("result", plus(num001: a, num002: b))
} else if inputButtonType == "-" {
print("result", minus(a, b))
} else if inputButtonType == "*" {
print("result", multiply(a, b))
}
func displayCalc(result: ((Int, Int) -> Int)) {
print("result", result(a, b))
}
if inputButtonType == "+" {
displayCalc(result: plus)
}
728x90
'ios' 카테고리의 다른 글
| enum : Int (0) | 2022.05.24 |
|---|---|
| main interface (start view) (0) | 2022.05.24 |
| function (0) | 2022.05.23 |
| closure (0) | 2022.05.23 |
| check positive number || upper case || check lower case (0) | 2022.05.22 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- check permissions
- 화면 고정
- StringWriter
- simpleName
- 화면 방향 고정
- javaClass
- 영문 키보드
- 클래스 이름
- android studio
- 코틀린
- Android
- 안드로이드
- logtag
- andorid
- kotlin
- permissions
- 로그캣
- custom web view
- 웹뷰
- web view
- screenorientation
- new project
- 외부 브라우저
- Inputmode
- web chrome view
- defaultInputmode
- web view settings
- logcat
- create project
- create new project
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
글 보관함
