본문 바로가기

Programming/Swift

(68)
타입: Structures (구조체) and Classes (클래스) vs. Enumerations (열거형) 중요 개념: 타입/ 인스턴스/ 프로퍼티/ 메서드 A type = a blueprint An instance = a house (you built from the blueprint) 블루프린트는 각 집의 features 특징과 behaviors 행동을 보여줌. Features -> properties Behaviors -> methods e.g. 지하철 매표 자판기 Features (= properties) 색깔 크기 Behaviors (= methods) 돈 출력 표 출력 블루프린트는 각 집의 features (프로퍼티)와 behavior (메서드)를 보여줌. In a type, features are called properties And behaviors are called methods. Prope..
야곰 스위프트 기초 퀴즈 - 데이터 타입 let numberOne: Int = 123 let numberTwo: Double = 123 let numberThree: UInt = -123 Negative integer '-123' overflows when stored into unsigned type 'UInt' let character: Character = 'A' Single-quoted string literal found, use '"' let string: String = "A" var arrayOne: Array = [1,2,3] var arrayTwo: [Int] = Array() var arrayThree:[Int] = [Int] Cannot convert value of type '[Int].Type' to specified ..
continue vs. return vs. break Continue The continue statement tells a loop to stop what it’s doing and start again at the beginning of the next iteration through the loop. It says “I am done with the current loop iteration” without leaving the loop altogether. if문 조건에 안 맞는다고 해서 for문을 아예 나가버리는 것이 아님. 그러니 다시 다음 조건문 케이스 실행하는 것. The following example removes all vowels and spaces from a lowercase string to create a cryptic puzzl..
if let vs. guard let if let firstNumber = Int("4"), let secondNumber = Int("42"), firstNumber
GCD Concepts To understand GCD, you need to be comfortable with several concepts related to concurrency and threading. Concurrency In iOS, a process or application consists of one or more threads. The operating system scheduler manages the threads independently of each other. Each thread can execute concurrently, but it’s up to the system to decide if this happens, when this happens, and how it happens. Sing..
[ios] Self-Sizing Table View Cells baked-corn.tistory.com/124 [ios] Self-Sizing Table View Cells [ios] Self-Sizing Table View Cells 안녕하세요. 오늘은 테이블 뷰의 셀의 크기를 동적으로 관리하는 방법에 대해 알아보는 시간을 갖도록 하겠습니다. 기본적으로 UITableViewCell 의 높이는 UITableViewDelegat.. baked-corn.tistory.com 참고자료 Working with Self-Sizing Table View Cells Raywenderlich - Self-Sizing Table View Cells
Protocol: CLLocationManagerDelegate The methods that you use to receive events from an associated location manager object. Declaration protocol CLLocationManagerDelegate Overview The location manager calls its delegate’s methods to report location-related events to your app. Implement this protocol in an app-specific object and use the methods to update your app. For example, you might use the current location to update the user’s..
Optional developer.apple.com/documentation/swift/optional Apple Developer Documentation developer.apple.com www.appcoda.com/beginners-guide-optionals-swift/#:~:text=Other%20than%20forced%20unwrapping%2C%20optional,a%20temporary%20constant%20or%20variable. A Beginner's Guide to Optionals in Swift Two weeks ago, we covered the basics of Swift. In coming weeks, we'll write a series of tutorials to cover a n..
Structures and Classes docs.swift.org/swift-book/LanguageGuide/ClassesAndStructures.html Structures and Classes — The Swift Programming Language (Swift 5.3) Structures and Classes Structures and classes are general-purpose, flexible constructs that become the building blocks of your program’s code. You define properties and methods to add functionality to your structures and classes using the same syntax you docs.swif..
Choosing Between Structures and Classes Decide how to store data and model behavior. Overview Structures and classes are good choices for storing data and modeling behavior in your apps, but their similarities can make it difficult to choose one over the other. Consider the following recommendations to help choose which option makes sense when adding a new data type to your app. Use structures by default. Use classes when you need Obj..