분류 전체보기(64)
-
3. [A Swift Tour]Functions and Closures
func greet(name: String, 날짜: String) -> String { return "방가방가 \(name), 오늘은 \(날짜) 이에요 ^^."} let PMS_INTRO = greet("PMS Friends", 날짜: "7월 17일") print(PMS_INTRO) // return값 사용하기func calculateStatistics(scores: [Int]) -> (min: Int, max: Int, sum: Int) { var min = scores[0] var max = scores[0] var sum = 0 for score in scores { if score > max { max = score } else if score < min { min = score } sum += ..
2016.07.17 -
2. [A Swift Tour]Control Flow
Optional ( ? ) nilvar optionalString: String? = "Hello"print(optionalString == nil) if let name = optionalName { // nil 이면 falselet imformalGreeting = "Hi \(nickName ?? fulName)" // nickName이 nil이면 fulName을 사용 IFif score > 50 { ... } else { ...} FORfor score in individualScores {for (kind, numbers) in interestingNumbers {for i in 0..
2016.07.17 -
1. [A Swift Tour]변수, 상수,형변환,문장포멧,배열,사전
변수, 상수 선언var myVariable = 42 let myConstant = 43let implicitInteger = 70let implicitDouble = 70.0let explicitDouble: Double = 70 String 형 변환let width = 94String(width) 문장 format - \(변수) - \(변수 + 변수) Array, Dictionaryvar shoppingList = ["catfish", "water", "tulips", "blue print"]shoppingList[1] = "bottle of water"shoppingList = [] // 배열 초기화 let emptyArray = [String]() // 빈 배열 생성 var occupations =..
2016.07.17 -
객체와 클래스
객체 기반 프로그래밍(OOP) 객체(Object) 인식론적으로 보면 경험을 통해서 의식에 주어진 대상 또는 인식 주체와의 관계에서 본 실재(實在) -철학사전 클래스(Class) 객체지향 프로그래밍에서 클래스는 객체 생성을 위해 확장가능한 프로그램 코드 템플릿이다. -위키페디아
2015.06.18 -
Maven 셋팅
보호되어 있는 글입니다.
2015.06.02 -
swift의 클로저란?
In Swift functions are just named Closures. 스위프트에서 함수는 단지 이름을 가진 클로저이다. func repeat(count: Int, task: () -> ()) { for i in 0..count { task() } } repeat(2, { println("Hello!") }) 출처 : 애플 스위프트 소개 동영상 (402_sd_introduction_to_swift.mov-, attachment)
2015.04.08