generated from baekteun/Tuist_Modular_Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
๐ :: (#4) ํ์๊ฐ์
ํผ๋ธ๋ฆฌ์ฑ
- Loading branch information
Showing
66 changed files
with
1,547 additions
and
110 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
excluded: | ||
- "Sources/Application/NeedleGenerated.swift" | ||
- "Tuist" |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,27 @@ | ||
import Foundation | ||
import SwiftUI | ||
|
||
public final class AppState: ObservableObject { | ||
@propertyWrapper | ||
public struct AppState: DynamicProperty { | ||
@EnvironmentObject private var object: AppStateProvider | ||
|
||
public var wrappedValue: AppStateProvider { | ||
object | ||
} | ||
|
||
public init() { } | ||
} | ||
|
||
public final class AppStateProvider: ObservableObject { | ||
@Published public var sceneFlow: SceneFlow | ||
@Published public var rule: RuleExample | ||
|
||
public init(sceneFlow: SceneFlow) { | ||
public init(sceneFlow: SceneFlow, rule: RuleExample) { | ||
self.sceneFlow = sceneFlow | ||
self.rule = rule | ||
} | ||
} | ||
|
||
public enum RuleExample { | ||
case student | ||
case manager | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import SwiftUI | ||
import UIKit | ||
|
||
public extension View { | ||
func hideKeyboardWhenTap() -> some View { | ||
onAppear(perform: UIApplication.shared.hideKeyboard) | ||
} | ||
} | ||
|
||
public extension UIApplication { | ||
func hideKeyboard() { | ||
guard | ||
let scene = connectedScenes.first as? UIWindowScene, | ||
let window = scene.windows.first | ||
else { return } | ||
let tapRecognizer = UITapGestureRecognizer(target: window, action: #selector(UIView.endEditing)) | ||
tapRecognizer.cancelsTouchesInView = false | ||
tapRecognizer.delegate = self | ||
window.addGestureRecognizer(tapRecognizer) | ||
} | ||
} | ||
|
||
extension UIApplication: UIGestureRecognizerDelegate { | ||
public func gestureRecognizer( | ||
_ gestureRecognizer: UIGestureRecognizer, | ||
shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer | ||
) -> Bool { | ||
return false | ||
} | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.