- Today
- Total
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- scheduledTimer
- struct
- decode
- 명령어
- Linux
- cocoapods
- Request
- Optional
- r
- Observable
- substr
- SQL
- 연산자
- MVC
- Python
- barplot
- 티스토리챌린지
- sigmoid
- tapply
- ReLU
- rxswift
- rest api
- 딥러닝
- SWIFT
- 시각화
- deeplearning
- HTTP
- 오블완
- ios
- swiftUI
목록closure (2)
iOS 개발 기록 블로그

일반적인 함수의 형태는 아래와 같다. func functionName (param1: dataType, param2: dataType) -> dataType { return output } 특정 데이터가 입력되어 함수를 통과하면 데이터가 출력된다. 이 입력된 데이터들을 또 다른 함수를 통과하도록 할 수 있다. import UIKit import Foundation func calculator(n1: Int, n2: Int, operation: (Int, Int) -> Int) -> Int{ return operation(n1, n2) } func add(n1: Int, n2: Int) -> Int{ return n1 + n2 } print(calculator(n1: 2, n2: 3, operation: ..

오픈 API를 사용하여 데이터를 받는 것을 Networking이라고 한다. 우리의 APP은 API를 통해 Web Server에 데이터를 요청한다. 우리가 필요한 데이터를 쿼리(Query)를 통해 요청(Request)한다. 웹 서버는 이 쿼리를 해석하고 필요로 하는 데이터를 보내준다. 이를 Response라고 한다. 이러한 일련의 프로세스를 'Networking'이라고 한다. Networking의 단계 Create a URL Create a URLSession Give URLSession a task Start the task WeatherManager.swift 파일 struct WeatherManager { let weatherURL = "https://api.openweathermap.org/data..