Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

날씨앱 [STEP 1] Wan #22

Open
wants to merge 21 commits into
base: rft_2_wannn
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 105 additions & 23 deletions WeatherForecast/WeatherForecast.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,34 @@
objects = {

/* Begin PBXBuildFile section */
60EC0E812BA032760042C815 /* DateFormatter+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60EC0E802BA032760042C815 /* DateFormatter+.swift */; };
60EC0E852BA0431A0042C815 /* WeatherJSONService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60EC0E842BA0431A0042C815 /* WeatherJSONService.swift */; };
60EC0E892BA0673F0042C815 /* TempUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60EC0E882BA0673F0042C815 /* TempUnit.swift */; };
60EC0E8B2BA087720042C815 /* WeatherJSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60EC0E8A2BA087720042C815 /* WeatherJSON.swift */; };
60EC0E8F2BA1C2520042C815 /* WeatherImageService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60EC0E8E2BA1C2520042C815 /* WeatherImageService.swift */; };
60EC0E912BA1CD590042C815 /* WeatherDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60EC0E902BA1CD590042C815 /* WeatherDetailView.swift */; };
C741F6702B58F00500A4DDC0 /* Weather.swift in Sources */ = {isa = PBXBuildFile; fileRef = C741F66F2B58F00500A4DDC0 /* Weather.swift */; };
C7743D8D2B21C38100DF0D09 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7743D8C2B21C38100DF0D09 /* AppDelegate.swift */; };
C7743D8F2B21C38100DF0D09 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7743D8E2B21C38100DF0D09 /* SceneDelegate.swift */; };
C7743D912B21C38100DF0D09 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7743D902B21C38100DF0D09 /* ViewController.swift */; };
C7743D942B21C38100DF0D09 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C7743D922B21C38100DF0D09 /* Main.storyboard */; };
C7743D912B21C38100DF0D09 /* WeatherViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7743D902B21C38100DF0D09 /* WeatherViewController.swift */; };
C7743D962B21C38200DF0D09 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C7743D952B21C38200DF0D09 /* Assets.xcassets */; };
C7743D992B21C38200DF0D09 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C7743D972B21C38200DF0D09 /* LaunchScreen.storyboard */; };
C7743DA12B21C3B400DF0D09 /* WeatherTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7743DA02B21C3B400DF0D09 /* WeatherTableViewCell.swift */; };
C7743DA32B21CA8600DF0D09 /* WeatherDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7743DA22B21CA8500DF0D09 /* WeatherDetailViewController.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
60EC0E802BA032760042C815 /* DateFormatter+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DateFormatter+.swift"; sourceTree = "<group>"; };
60EC0E842BA0431A0042C815 /* WeatherJSONService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeatherJSONService.swift; sourceTree = "<group>"; };
60EC0E882BA0673F0042C815 /* TempUnit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TempUnit.swift; sourceTree = "<group>"; };
60EC0E8A2BA087720042C815 /* WeatherJSON.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeatherJSON.swift; sourceTree = "<group>"; };
60EC0E8E2BA1C2520042C815 /* WeatherImageService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeatherImageService.swift; sourceTree = "<group>"; };
60EC0E902BA1CD590042C815 /* WeatherDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeatherDetailView.swift; sourceTree = "<group>"; };
C741F66F2B58F00500A4DDC0 /* Weather.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Weather.swift; sourceTree = "<group>"; };
C7743D892B21C38100DF0D09 /* WeatherForecast.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WeatherForecast.app; sourceTree = BUILT_PRODUCTS_DIR; };
C7743D8C2B21C38100DF0D09 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
C7743D8E2B21C38100DF0D09 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
C7743D902B21C38100DF0D09 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
C7743D932B21C38100DF0D09 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
C7743D902B21C38100DF0D09 /* WeatherViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeatherViewController.swift; sourceTree = "<group>"; };
C7743D952B21C38200DF0D09 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
C7743D982B21C38200DF0D09 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
C7743D9A2B21C38200DF0D09 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand All @@ -43,6 +53,88 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
60EC0E772BA02A2B0042C815 /* Scene */ = {
isa = PBXGroup;
children = (
60EC0E792BA02A540042C815 /* WeatherDetail */,
60EC0E782BA02A3C0042C815 /* Weather */,
);
path = Scene;
sourceTree = "<group>";
};
60EC0E782BA02A3C0042C815 /* Weather */ = {
isa = PBXGroup;
children = (
C7743D902B21C38100DF0D09 /* WeatherViewController.swift */,
C7743DA02B21C3B400DF0D09 /* WeatherTableViewCell.swift */,
);
path = Weather;
sourceTree = "<group>";
};
60EC0E792BA02A540042C815 /* WeatherDetail */ = {
isa = PBXGroup;
children = (
C7743DA22B21CA8500DF0D09 /* WeatherDetailViewController.swift */,
60EC0E902BA1CD590042C815 /* WeatherDetailView.swift */,
);
path = WeatherDetail;
sourceTree = "<group>";
};
60EC0E7A2BA02A820042C815 /* Resource */ = {
isa = PBXGroup;
children = (
C7743D8C2B21C38100DF0D09 /* AppDelegate.swift */,
C7743D8E2B21C38100DF0D09 /* SceneDelegate.swift */,
);
path = Resource;
sourceTree = "<group>";
};
60EC0E7B2BA02A8C0042C815 /* Source */ = {
isa = PBXGroup;
children = (
60EC0E832BA041390042C815 /* Service */,
60EC0E7F2BA032660042C815 /* Utils */,
60EC0E7C2BA02AC80042C815 /* Model */,
60EC0E772BA02A2B0042C815 /* Scene */,
);
path = Source;
sourceTree = "<group>";
};
60EC0E7C2BA02AC80042C815 /* Model */ = {
isa = PBXGroup;
children = (
C741F66F2B58F00500A4DDC0 /* Weather.swift */,
60EC0E882BA0673F0042C815 /* TempUnit.swift */,
60EC0E8A2BA087720042C815 /* WeatherJSON.swift */,
);
path = Model;
sourceTree = "<group>";
};
60EC0E7F2BA032660042C815 /* Utils */ = {
isa = PBXGroup;
children = (
60EC0E822BA0327B0042C815 /* Extensions */,
);
path = Utils;
sourceTree = "<group>";
};
60EC0E822BA0327B0042C815 /* Extensions */ = {
isa = PBXGroup;
children = (
60EC0E802BA032760042C815 /* DateFormatter+.swift */,
);
path = Extensions;
sourceTree = "<group>";
};
60EC0E832BA041390042C815 /* Service */ = {
isa = PBXGroup;
children = (
60EC0E842BA0431A0042C815 /* WeatherJSONService.swift */,
60EC0E8E2BA1C2520042C815 /* WeatherImageService.swift */,
);
path = Service;
sourceTree = "<group>";
};
C7743D802B21C38100DF0D09 = {
isa = PBXGroup;
children = (
Expand All @@ -62,13 +154,8 @@
C7743D8B2B21C38100DF0D09 /* WeatherForecast */ = {
isa = PBXGroup;
children = (
C7743D8C2B21C38100DF0D09 /* AppDelegate.swift */,
C7743D8E2B21C38100DF0D09 /* SceneDelegate.swift */,
C7743DA02B21C3B400DF0D09 /* WeatherTableViewCell.swift */,
C7743D902B21C38100DF0D09 /* ViewController.swift */,
C741F66F2B58F00500A4DDC0 /* Weather.swift */,
C7743DA22B21CA8500DF0D09 /* WeatherDetailViewController.swift */,
C7743D922B21C38100DF0D09 /* Main.storyboard */,
60EC0E7A2BA02A820042C815 /* Resource */,
60EC0E7B2BA02A8C0042C815 /* Source */,
C7743D952B21C38200DF0D09 /* Assets.xcassets */,
C7743D972B21C38200DF0D09 /* LaunchScreen.storyboard */,
C7743D9A2B21C38200DF0D09 /* Info.plist */,
Expand Down Expand Up @@ -136,7 +223,6 @@
files = (
C7743D992B21C38200DF0D09 /* LaunchScreen.storyboard in Resources */,
C7743D962B21C38200DF0D09 /* Assets.xcassets in Resources */,
C7743D942B21C38100DF0D09 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -147,26 +233,24 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
60EC0E852BA0431A0042C815 /* WeatherJSONService.swift in Sources */,
C7743DA12B21C3B400DF0D09 /* WeatherTableViewCell.swift in Sources */,
C7743D912B21C38100DF0D09 /* ViewController.swift in Sources */,
60EC0E892BA0673F0042C815 /* TempUnit.swift in Sources */,
C7743D912B21C38100DF0D09 /* WeatherViewController.swift in Sources */,
C7743D8D2B21C38100DF0D09 /* AppDelegate.swift in Sources */,
60EC0E812BA032760042C815 /* DateFormatter+.swift in Sources */,
C7743DA32B21CA8600DF0D09 /* WeatherDetailViewController.swift in Sources */,
60EC0E8F2BA1C2520042C815 /* WeatherImageService.swift in Sources */,
C741F6702B58F00500A4DDC0 /* Weather.swift in Sources */,
60EC0E912BA1CD590042C815 /* WeatherDetailView.swift in Sources */,
60EC0E8B2BA087720042C815 /* WeatherJSON.swift in Sources */,
C7743D8F2B21C38100DF0D09 /* SceneDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXVariantGroup section */
C7743D922B21C38100DF0D09 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
C7743D932B21C38100DF0D09 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
C7743D972B21C38200DF0D09 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
Expand Down Expand Up @@ -308,7 +392,6 @@
INFOPLIST_FILE = WeatherForecast/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -335,7 +418,6 @@
INFOPLIST_FILE = WeatherForecast/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
LD_RUNPATH_SEARCH_PATHS = (
Expand Down
51 changes: 0 additions & 51 deletions WeatherForecast/WeatherForecast/Base.lproj/Main.storyboard

This file was deleted.

2 changes: 0 additions & 2 deletions WeatherForecast/WeatherForecast/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
Expand Down
30 changes: 30 additions & 0 deletions WeatherForecast/WeatherForecast/Resource/SceneDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// WeatherForecast - SceneDelegate.swift
// Created by yagom.
// Copyright © yagom. All rights reserved.
//

import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

var window: UIWindow?

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {

guard let scene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: scene)

let weatherService: WeatherJSONService = WeatherJSONService()
let imageService: WeatherImageService = WeatherImageService()
let tempUnit = TempUnit.fahrenheit

let viewController = WeatherViewController(tempUnit: tempUnit,
weatherService: weatherService,
imageService: imageService)
let navigationController = UINavigationController(rootViewController: viewController)
window?.rootViewController = navigationController
window?.makeKeyAndVisible()
}
}

51 changes: 0 additions & 51 deletions WeatherForecast/WeatherForecast/SceneDelegate.swift

This file was deleted.

39 changes: 39 additions & 0 deletions WeatherForecast/WeatherForecast/Source/Model/TempUnit.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// TempUnit.swift
// WeatherForecast
//
// Created by 홍승완 on 2024/03/12.
//


// MARK: - Temperature Unit
enum TempUnit: String {
case celsius, fahrenheit

var symbol: String {
switch self {
case .celsius:
return "℃"
case .fahrenheit:
return "℉"
}
}

var description: String {
switch self {
case .celsius:
return "섭씨"
case .fahrenheit:
return "화씨"
}
}

mutating func toggle() {
switch self {
case .celsius:
self = .fahrenheit
case .fahrenheit:
self = .celsius
}
}
Comment on lines +31 to +38
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

온도 단위(섭씨, 화씨)를 변경하는 책임을 잘 할당해 보셨네요.👍

}
Loading