일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- dart
- SampleApp
- GIT
- SwiftUI
- WiFi
- uikit
- designpattern
- tuist
- singleton
- isolate
- Xcode
- builder
- 문법
- EventLoop
- philipshue
- swift
- OpenAI
- concurrency
- state
- WWDC24
- AppleDeveloper
- flutter
- factory
- dartz
- network
- Architecture
- iot
- Adapter
- weatherkit
- LifeCycle
- Today
- Total
목록swift (17)
Jaebi의 Binary는 호남선
DartSwiftType Annotation`Double myDouble``let myDouble: Double`String declaration`String myString = 'hi'``var myString: String = "hi"`String interpolation`'${value}'``“\(value)"`Function`String greet(String msg) {}``func greet(msg: String) -> String {}`Function with implicit return`String greet() => "hi"``func greet() -> String {"hi"}`Schedule code to be executed when current scope is exited`de..
목차Protocols and Extensionsprotocol (interface) → `protocol`protocol ExampleProtocol { var simpleDescription: String { get } mutating func adjust()} classes, enumerations, and structures can all adopt protocolsmodify structure → `mutating`class SimpleClass: ExampleProtocol { var simpleDescription: String = "A very simple class." var anotherProperty: Int = 69105 func adjust() {..
목차Objects and Classesclass → `class`var shape = Shape()shape.numberOfSides = 7var shapeDescription = shape.simpleDescription()use `init` to create initializer`self` is used to distinguish the name property from the name argument to the initializerclass NamedShape { var numberOfSides: Int = 0 var name: String init(name: String) { self.name = name }}use `deinit` to deinitialize: ..
목차Valuesvar → variablelet → constanttype 명시 → `let explicitDouble: Double = 70`type conversion → wrap with `Int()`, `Double()`, `String()`String 표기 (string interpolation)기존 Flutter의 `'${value}'` -> Swift에서는 `"\(value)"`three double quotation marks(`"""`) → multiple line stringsarrays and dictionaries → use `[]`array → var fruits = `["limes", "pears", "apples"]`dictionary → var jobs = `["Jae": "S..