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
| @propertyWrapper | |
| public struct DzUserDefault<Value> { | |
| public let key: String | |
| public let defaultValue: Value | |
| public var storage: UserDefaults = .standard | |
| public var wrappedValue: Value { | |
| get { | |
| return storage.object(forKey: key) as? Value ?? defaultValue | |
| } |
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 Breathe_App: View { | |
| @State var isAnimation:Bool = true | |
| var body: some View { | |
| ZStack { |
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
| struct ContentView3: View { | |
| var body: some View { | |
| HStack { | |
| // 위쪽만 | |
| Rectangle() | |
| .overlay{ | |
| Image(systemName: "person.crop.circle") | |
| .resizable() | |
| .frame(width: 100, height: 100) | |
| } |
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
| struct ContentView2: View { | |
| var body: some View { | |
| HStack { | |
| // 1. 라운드 지정된 값 적용 | |
| Rectangle() | |
| .overlay{ | |
| Image(systemName: "person.crop.circle") | |
| .resizable() | |
| .frame(width: 100, height: 100) | |
| } |
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
| struct ContentView1: View { | |
| var body: some View { | |
| VStack { | |
| Image(systemName: "globe") | |
| .imageScale(.large) | |
| .foregroundColor(.accentColor) | |
| Text("Hello, world!") | |
| } | |
| .padding() | |
| .background(.red) |
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
| struct ContentView3: View { | |
| var body: some View { | |
| VStack { | |
| // 패딩 X | |
| Text("Hello, world!") | |
| .border(Color.black, width: 1) | |
| // 패딩 .all | |
| Text("Hello, world!") | |
| .padding(.all, 8) |
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
| struct ContentView2: View { | |
| var body: some View { | |
| VStack { | |
| // 패딩 X | |
| Text("Hello, world!") | |
| .border(Color.black, width: 1) | |
| // 패딩 EdgeInsets 활용 | |
| Text("Hello, world!") | |
| .padding(EdgeInsets(top: 2, leading: 6, bottom: 8, trailing: 10)) | |
| .border(Color.black, width: 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
| struct ContentView: View { | |
| var body: some View { | |
| VStack { | |
| // 패딩 X | |
| Text("Hello, world!") | |
| .border(Color.black, width: 1) | |
| // 패딩 기본값 | |
| Text("Hello, world!") | |
| .padding() // 텍스트 필드의 패딩값 주기 | |
| .border(Color.black, width: 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
| // 타이머 관련 변수선언 (애니메이션 효과를 위해) | |
| let timer = Timer.publish(every: 1.0, on: .main, in: .common).autoconnect() | |
| @State var value = 0.0 | |
| (..... 생략 .....) | |
| // 이미지 그리고 위에 overlay 를 통한 텍스트 위치 표기해주기. | |
| Image(uiImage: image) | |
| .resizable() | |
| .scaledToFit() |
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
| // TextView Scan관련 | |
| extension ContentVM { | |
| // import Vision // Text 뽑아오는게 있내 <-- 필수 | |
| // 1. Text 빼오는거 샘플 | |
| func detectText(_ image: UIImage) { | |
| guard let image = image.cgImage else { | |
| print("Invalid image") | |
| return | |
| } |
NewerOlder