generated from GSM-MSG/MSG-Repository-Generator
-
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.
Merge pull request #338 from GSM-MSG/334-authentication-form-ui-building
๐ :: [#334] GSM ์ธ์ฆ์ Form UI ์ถ๊ฐ
- Loading branch information
Showing
14 changed files
with
484 additions
and
38 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
Projects/Core/DesignSystem/Resources/Icon/Icons.xcassets/Xmark.imageset/Contents.json
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,7 +1,7 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "xmark.svg", | ||
"filename" : "Xmark.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
|
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
72 changes: 58 additions & 14 deletions
72
Projects/Feature/GSMAuthenticationFormFeature/Demo/Sources/AppDelegate.swift
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,19 +1,63 @@ | ||
import UIKit | ||
import SwiftUI | ||
@testable import GSMAuthenticationFormFeature | ||
|
||
@main | ||
final class AppDelegate: UIResponder, UIApplicationDelegate { | ||
var window: UIWindow? | ||
struct GSMAuthenticationFormDemoApp: App { | ||
var body: some Scene { | ||
WindowGroup { | ||
let uiModel = GSMAuthenticationFormUIModel( | ||
areas: [ | ||
.init( | ||
title: "Area", | ||
files: [], | ||
sections: [ | ||
.init( | ||
title: "Section1", | ||
description: "Description", | ||
currentFieldCount: 2, | ||
fields: [ | ||
.init( | ||
key: "text", | ||
type: .text(value: nil), | ||
placeholder: "text placeholder" | ||
), | ||
.init( | ||
key: "number", | ||
type: .number(value: nil), | ||
placeholder: "number placeholder" | ||
), | ||
.init( | ||
key: "file", | ||
type: .file(fileName: nil), | ||
placeholder: "file placeholder" | ||
) | ||
] | ||
), | ||
.init( | ||
title: "Section2", | ||
description: "Description", | ||
currentFieldCount: 3, | ||
fields: [ | ||
.init( | ||
key: "boolean", | ||
type: .boolean(isSelcted: false), | ||
placeholder: nil | ||
), | ||
.init( | ||
key: "select", | ||
type: .select(selectedValue: nil, values: ["a", "b", "c"]), | ||
placeholder: "select placeholder" | ||
) | ||
] | ||
) | ||
] | ||
) | ||
] | ||
) | ||
|
||
func application( | ||
_ application: UIApplication, | ||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil | ||
) -> Bool { | ||
window = UIWindow(frame: UIScreen.main.bounds) | ||
let viewController = UIViewController() | ||
viewController.view.backgroundColor = .yellow | ||
window?.rootViewController = viewController | ||
window?.makeKeyAndVisible() | ||
|
||
return true | ||
GSMAuthenticationFormBuilderView(uiModel: uiModel) { interaction in | ||
|
||
} | ||
} | ||
} | ||
} |
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
7 changes: 7 additions & 0 deletions
7
...cts/Feature/GSMAuthenticationFormFeature/Sources/Intent/GSMAuthenticationFormIntent.swift
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,7 @@ | ||
final class GSMAuthenticationFormIntent: GSMAuthenticationFormIntentProtocol { | ||
weak var model: (any GSMAuthenticationFormActionProtocol)? | ||
|
||
init(model: any GSMAuthenticationFormActionProtocol) { | ||
self.model = model | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...ure/GSMAuthenticationFormFeature/Sources/Intent/GSMAuthenticationFormIntentProtocol.swift
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 @@ | ||
protocol GSMAuthenticationFormIntentProtocol { | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
Projects/Feature/GSMAuthenticationFormFeature/Sources/Model/GSMAuthenticationFormModel.swift
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,7 @@ | ||
final class GSMAuthenticationFormModel: GSMAuthenticationFormStateProtocol { | ||
|
||
} | ||
|
||
extension GSMAuthenticationFormModel: GSMAuthenticationFormActionProtocol { | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
...ature/GSMAuthenticationFormFeature/Sources/Model/GSMAuthenticationFormModelProtocol.swift
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,8 @@ | ||
|
||
protocol GSMAuthenticationFormStateProtocol { | ||
|
||
} | ||
|
||
protocol GSMAuthenticationFormActionProtocol: AnyObject { | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
...cts/Feature/GSMAuthenticationFormFeature/Sources/Model/GSMAuthenticationFormUIModel.swift
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,39 @@ | ||
import Foundation | ||
|
||
// swiftlint: disable nesting | ||
struct GSMAuthenticationFormUIModel { | ||
let areas: [Area] | ||
|
||
struct Area { | ||
let title: String | ||
let files: [File] | ||
let sections: [Section] | ||
|
||
struct File { | ||
let name: String | ||
let url: String | ||
} | ||
|
||
struct Section { | ||
let title: String | ||
let description: String | ||
let currentFieldCount: Int | ||
let fields: [Field] | ||
|
||
struct Field { | ||
let key: String | ||
let type: FieldType | ||
let placeholder: String? | ||
|
||
enum FieldType { | ||
case text(value: String?) | ||
case number(value: Int?) | ||
case boolean(isSelcted: Bool?) | ||
case file(fileName: String?) | ||
case select(selectedValue: String?, values: [String]) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
// swiftlint: enable nesting |
Oops, something went wrong.