-
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.
feature: ErrorFeature Example 모듈과 두 에러뷰 UI
- Loading branch information
Showing
12 changed files
with
232 additions
and
1 deletion.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
...s/Feature/ErrorFeature/Example/Resources/Assets.xcassets/AppIcon.appiconset/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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "ICON_DEMO.png", | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"size" : "1024x1024" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
Projects/Feature/ErrorFeature/Example/Resources/Assets.xcassets/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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+1.58 MB
Projects/Feature/ErrorFeature/Example/Resources/Font/Pretendard-Bold.otf
Binary file not shown.
Binary file added
BIN
+1.59 MB
Projects/Feature/ErrorFeature/Example/Resources/Font/Pretendard-Medium.otf
Binary file not shown.
Binary file added
BIN
+1.58 MB
Projects/Feature/ErrorFeature/Example/Resources/Font/Pretendard-Regular.otf
Binary file not shown.
Binary file added
BIN
+1.59 MB
Projects/Feature/ErrorFeature/Example/Resources/Font/Pretendard-SemiBold.otf
Binary file not shown.
48 changes: 48 additions & 0 deletions
48
Projects/Feature/ErrorFeature/Example/Resources/LaunchScreen.storyboard
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,48 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> | ||
<device id="retina6_12" orientation="portrait" appearance="light"/> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<scenes> | ||
<!--View Controller--> | ||
<scene sceneID="EHf-IW-A2E"> | ||
<objects> | ||
<viewController id="01J-lp-oVM" sceneMemberID="viewController"> | ||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> | ||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<subviews> | ||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd"> | ||
<rect key="frame" x="0.0" y="832" width="393" height="0.0"/> | ||
<fontDescription key="fontDescription" type="system" pointSize="17"/> | ||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ErrorFeature 모듈 데모앱" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb"> | ||
<rect key="frame" x="0.0" y="263.66666666666669" width="393" height="43"/> | ||
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/> | ||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
</subviews> | ||
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/> | ||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | ||
<constraints> | ||
<constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="obG-Y5-kRd" secondAttribute="centerX" id="5cz-MP-9tL"/> | ||
<constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/> | ||
<constraint firstItem="obG-Y5-kRd" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" constant="20" symbolic="YES" id="SfN-ll-jLj"/> | ||
<constraint firstAttribute="bottom" secondItem="obG-Y5-kRd" secondAttribute="bottom" constant="20" id="Y44-ml-fuU"/> | ||
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/> | ||
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="x7j-FC-K8j"/> | ||
</constraints> | ||
</view> | ||
</viewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="53" y="375"/> | ||
</scene> | ||
</scenes> | ||
</document> |
34 changes: 34 additions & 0 deletions
34
Projects/Feature/ErrorFeature/Example/Sources/ContentView.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,34 @@ | ||
import SwiftUI | ||
|
||
import ErrorFeature | ||
|
||
struct ContentView: View { | ||
@State var isNetworkErrorViewPresented = false | ||
@State var isRequestErrorViewPresented = false | ||
|
||
var body: some View { | ||
VStack(spacing: 20) { | ||
Spacer() | ||
|
||
Button(title: "네트워크 에러 뷰") { | ||
isNetworkErrorViewPresented = true | ||
} | ||
|
||
Button(title: "서버통신 에러 뷰") { | ||
isRequestErrorViewPresented = true | ||
} | ||
|
||
Spacer() | ||
} | ||
.fullScreenCover(isPresented: $isNetworkErrorViewPresented) { | ||
NetworkErrorView() | ||
} | ||
.fullScreenCover(isPresented: $isRequestErrorViewPresented) { | ||
RequestErrorView() | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
ContentView() | ||
} |
10 changes: 10 additions & 0 deletions
10
Projects/Feature/ErrorFeature/Example/Sources/ErrorFeatureApp.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,10 @@ | ||
import SwiftUI | ||
|
||
@main | ||
struct ErrorFeatureApp: App { | ||
var body: some Scene { | ||
WindowGroup { | ||
ContentView() | ||
} | ||
} | ||
} |
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
52 changes: 52 additions & 0 deletions
52
Projects/Feature/ErrorFeature/Sources/NetworkError/NetworkErrorView.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,52 @@ | ||
// | ||
// NetworkErrorView.swift | ||
// ErrorFeature | ||
// | ||
// Created by 김지현 on 11/14/24. | ||
// Copyright © 2024 PomoNyang. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
import DesignSystem | ||
|
||
public struct NetworkErrorView: View { | ||
@Environment(\.dismiss) var dismiss | ||
|
||
public init() { | ||
|
||
} | ||
|
||
public var body: some View { | ||
HStack { | ||
Spacer() | ||
|
||
VStack(spacing: Alias.Spacing.xxxLarge) { | ||
Spacer() | ||
|
||
DesignSystemAsset.Image.imgOnboarding1.swiftUIImage | ||
|
||
VStack(spacing: Alias.Spacing.small) { | ||
Text("인터넷 연결이 불안정해요") | ||
.font(Typography.header4) | ||
.foregroundStyle(Alias.Color.Text.primary) | ||
Text("연결 상태를 확인한 후\n다시 시도해 주세요.") | ||
.multilineTextAlignment(.center) | ||
.font(Typography.bodyR) | ||
.foregroundStyle(Alias.Color.Text.secondary) | ||
} | ||
.padding(.bottom, 34) | ||
|
||
Button(title: "다시 시도하기") { | ||
dismiss() | ||
} | ||
.buttonStyle(.box(level: .primary, size: .large, width: .medium)) | ||
|
||
Spacer() | ||
} | ||
|
||
Spacer() | ||
} | ||
.background(Alias.Color.Background.primary) | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
Projects/Feature/ErrorFeature/Sources/RequestError/RequestErrorView.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,66 @@ | ||
// | ||
// RequestErrorView.swift | ||
// ErrorFeature | ||
// | ||
// Created by 김지현 on 11/14/24. | ||
// Copyright © 2024 PomoNyang. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
import DesignSystem | ||
|
||
public struct RequestErrorView: View { | ||
@Environment(\.dismiss) var dismiss | ||
|
||
public init() { | ||
|
||
} | ||
|
||
public var body: some View { | ||
HStack { | ||
Spacer() | ||
|
||
VStack(spacing: Alias.Spacing.xxxLarge) { | ||
Spacer() | ||
|
||
DesignSystemAsset.Image.imgOnboarding1.swiftUIImage | ||
|
||
VStack(spacing: Alias.Spacing.small) { | ||
Text("문제가 발생했어요") | ||
.font(Typography.header4) | ||
.foregroundStyle(Alias.Color.Text.primary) | ||
Text("잠시 후에 다시 확인해주세요.\n문제가 지속된다면 고객센터에 문의해주세요.") | ||
.multilineTextAlignment(.center) | ||
.font(Typography.bodyR) | ||
.foregroundStyle(Alias.Color.Text.secondary) | ||
} | ||
.padding(.bottom, 34) | ||
|
||
VStack(spacing: Alias.Spacing.large) { | ||
Button(title: "홈으로 이동") { | ||
dismiss() | ||
} | ||
.buttonStyle(.box(level: .primary, size: .large, width: .medium)) | ||
|
||
Button( | ||
action: { | ||
print("고객센터 문의") | ||
}, | ||
label: { | ||
Text("고객센터 문의") | ||
.font(Typography.bodyR) | ||
.underline(pattern: .solid, color: Alias.Color.Text.tertiary) | ||
.foregroundStyle(Alias.Color.Text.tertiary) | ||
} | ||
) | ||
} | ||
|
||
Spacer() | ||
} | ||
|
||
Spacer() | ||
} | ||
.background(Alias.Color.Background.primary) | ||
} | ||
} |