Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- Linux
- pandas
- PER
- PyQt
- IOS
- ASP
- Excel
- 날짜
- javascript
- GIT
- MS-SQL
- swift
- 리눅스
- tensorflow
- sqlite
- 다이어트
- 유니티
- mssql
- ubuntu
- Unity
- node.js
- PyQt5
- python
- port
- flutter
- 함수
- MySQL
- 라즈베리파이
- urllib
- 맛집
Archives
아미(아름다운미소)
SWIFT 클로저 본문
클로저 란?
func hello(message: String) -> (String, String) -> String { return { (firstName: String, lastName: String) -> String in return lastName + firstName + message } }
func hello(message: String) -> (String, String) -> String { return { firstName, lastName in return lastName + firstName + message } }
func hello(message: String) -> (String, String) -> String { return { return $1 + $0 + message } }
func hello(message: String) -> (String, String) -> String { return { $1 + $0 + message } }
let hello: (String, String) -> String = { $1 + $0 + "님 안녕하세요!" } hello("a", "b")
let hello: ((String, String) -> String)? hello?("a", "b")
'랭귀지 > SWIFT' 카테고리의 다른 글
웹 브라우져(Web View) (0) | 2018.01.21 |
---|---|
얼럿 사용해 경고 표시하기 (Alert) (0) | 2018.01.08 |
swift 피커 뷰 앱 만들기 (0) | 2018.01.07 |
swift 타이머 사용하여 1초마다 1씩 증가하기 (0) | 2018.01.05 |
날짜와 시간 다루기 (Swift) (0) | 2018.01.03 |
Comments