- SOLID 원칙을 지키면서 구현합니다.
- 메서드는 짧게, 한가지 기능만 수행하도록 합니다.
- 빠른 구현보다는 항상 깨끗하고 잘 테스트된 코드를 우선시합니다.
- 단순성: 복잡한 것 보다, 단순한 해법을 선택합니다.
- DRY (Don't Repeat Yourself): 코드 중복을 철저히 피합니다.
- 최소 상태: 가능한한 적은 상태만으로 동작하도록 합니다.
- 상수 정의: 매직 넘버나 문자열은 명확한 이름의 상수로 정의합니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Also, if you have a bug or a feature request, please go to bugreporter.apple.com. Today we want to focus on questions that will help the broader audience. So, please send us your questions using the Slido panel here in WebEx. Once our moderators approve the questions, they'll appear for everyone to up vote, so we can narrow in on the questions that are of most interest to all of you. So let's jump in. I'm going to claim moderator privilege and start with a couple of questions that I'm particularly interested in. So the first thing I would like to talk about to get the ball rolling is, I just want to ask each of you what your favorite new Swift UI API is this year. Summer, why don't you kick us off? All right, I'm gonna have to go with our new rich text editor. was a big labor of love for my team, and it was super fun, 'cause we got to work cross functionally with foundation, text kit, cortex, UAKit, app kit, everybody. Excellent. Nick, how about you? Uh, for me, this is definitely a safe area bar, kind of an |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
TextShape(sample) | |
.fill(.orange) | |
.stroke(.blue, lineWidth: 2) | |
} | |
var sample: AttributedString { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Responsive Chips Selection | |
// See Also: https://youtu.be/T82izB2XBMA?si=Cnf6rGdyisG8ZWoX | |
import SwiftUI | |
struct Tag: Hashable { | |
var name: String | |
var color: Color | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct Star: Hashable, Identifiable { | |
var id = UUID() | |
var color: Color | |
var speed: Double | |
static var sun: Star { | |
Star(color: .red.mix(with: .orange, by: 0.2), speed: 1) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
// MARK: - Exercise Data Model | |
struct ExerciseSet: Identifiable { | |
let id = UUID() | |
var weight: Double | |
var reps: Int | |
var isCompleted: Bool = false | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct FinancialHealthSheetPreview: View { | |
@State private var showFinancialHealthSheet = false | |
var body: some View { | |
VStack { | |
Button(action: { | |
showFinancialHealthSheet.toggle() | |
}, label: { | |
HStack { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
@State var start: Date = .now | |
var body: some View { | |
TimelineView(.animation) { context in | |
let progress = context.date.timeIntervalSince(start) / 10 | |
ZStack { | |
Sphere(color: .red).frame(width: 30) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Workout data model | |
struct WorkoutData { | |
let name: String | |
let date: Date | |
let duration: TimeInterval | |
let exerciseCount: Int | |
let effortPercentage: Double | |
} | |
struct WorkoutExpandedCard: View { |
NewerOlder