본문 바로가기

프로그래밍/Swift25

[Swift] Control Flow (제어문) Referneces https://docs.swift.org/swift-book/LanguageGuide/ControlFlow.html Contents For-In Loops While (while, repeat-while) Conditional Statements (if, switch) Control Transfer Statements (continue, break, fallthrough, labeled statements) Early Exit (guard) Checking API Availability Swift에서는 while 루프, if, guard, switch 그리고 break와 continue 등의 다양한 제어문을 지원합니다. 하나씩 알아보도록 하겠습니다. For-In Loops 배열의 항목.. 2021. 12. 16.
[Swift] Collection Type (Array, Set, Dictionary) References https://docs.swift.org/swift-book/LanguageGuide/CollectionTypes.html Contents Mutability of Collections Arrays Sets Performing Set Operations Dictionaries Swift는 Arrays(배열), Sets(집합), Dictionaries(딕셔너리), 3가지의 주요 콜렉션 타입을 지원합니다. 배열은 순서가 있는 값들의 콜렉션이고, Set은 유니크한 값들의 순서없는 콜렉션이며, 딕셔너리는 key-value 관계의 값들의 순서가 없는 콜렉션입니다. 이 콜렉션 타입들은 저장할 수 있는 value 또는 key 타입에 대해 항상 명확합니다. 따라서 잘못된 타입의 값을 콜렉션에 실수로.. 2021. 12. 15.
[Swift] 문자열과 문자 (Strings and Characters) References https://docs.swift.org/swift-book/LanguageGuide/StringsAndCharacters.html Contents String Literals Initializing Empty String String Mutability Strings are Value Types Working with Characters Concatenating Strings and Characters String Interpolation Unicode Counting Characters Accessing and Modifying a String Substrings Comparing Strings Unicode Representations of Strings Strings(문자열)은.. 2021. 12. 14.
[Swift] Basic Operators References https://docs.swift.org/swift-book/LanguageGuide/BasicOperators.html Contents Assignment Operators Comparison Operators Nil-Coalescing Operators Range Operators 연산자(operator)는 그냥 스킵하려고 했는데, C 스타일과는 다른 부분이 몇 가지 있어서 그 부분만 체크하고 넘어가려고 합니다. Assignment Operator 대입 연산자(a = b)는 a의 값을 b의 값으로 업데이트하거나 초기화할 때 사용됩니다. let b = 10 var a = 5 a = b // a is now equal to 10 여러 값을 갖는 튜플의 경우에도 다양한 대입이 가능합니다.. 2021. 12. 12.
[Swift] Basic 문법 References https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html Contents Swift 기본 문법 와이프는 디자인 쪽 일을 하는데, 얼마전에 와이프와 앱을 함께 만들어보기로 했습니다. 둘 다 iOS 앱 쪽은 처음이니 서로 공부하며 준비를 하기로 해서 틈틈히 swift 언어에 대해서 공부하려고 합니다. 일을 하면서 공부하기 때문에 너무 깊게 살펴보지 않고 스윽 훑어보는 식으로 공식 사이트에서 제공되는 문서를 보며 공부하고 정리해 볼 예정입니다. Swift ? Swift는 iOS, macOS, watchOS, tvOS app 개발을 위한 애플의 프로그래밍 언어입니다. Swift의 많은 부분은 C와 Objective-C와 닮았습니다. 정수.. 2021. 12. 12.