Skip to content

Commit

Permalink
Merge pull request #12 from DO-SOPT-iOS-Part/refact/#11
Browse files Browse the repository at this point in the history
[Refact] - #11 Weather App MVC 패턴 적용
  • Loading branch information
mcrkgus authored Dec 17, 2023
2 parents 1ddd701 + ab1ac81 commit e700f74
Show file tree
Hide file tree
Showing 31 changed files with 457 additions and 242 deletions.
144 changes: 108 additions & 36 deletions SOPT33_assignment2/SOPT33_assignment2.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
838AA6872ADB93AF00CC766B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 838AA6862ADB93AF00CC766B /* ViewController.swift */; };
838AA68C2ADB93B100CC766B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 838AA68B2ADB93B100CC766B /* Assets.xcassets */; };
838AA68F2ADB93B100CC766B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 838AA68D2ADB93B100CC766B /* LaunchScreen.storyboard */; };
838AA6972ADB976D00CC766B /* Img.png in Resources */ = {isa = PBXBuildFile; fileRef = 838AA6962ADB976D00CC766B /* Img.png */; };
838AA69A2ADD675800CC766B /* SF-Pro-Display-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 838AA6992ADD675800CC766B /* SF-Pro-Display-Bold.otf */; };
838AA69C2ADD677B00CC766B /* SF-Pro-Display-Light.otf in Resources */ = {isa = PBXBuildFile; fileRef = 838AA69B2ADD677B00CC766B /* SF-Pro-Display-Light.otf */; };
838AA69E2ADD678900CC766B /* SF-Pro-Display-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = 838AA69D2ADD678900CC766B /* SF-Pro-Display-Medium.otf */; };
Expand All @@ -34,13 +33,16 @@
839479952AEFF3D200DE7A90 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = 839479942AEFF3D200DE7A90 /* SnapKit */; };
8394799B2AF3F0CD00DE7A90 /* DayWeatherListData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8394799A2AF3F0CD00DE7A90 /* DayWeatherListData.swift */; };
8394799D2AF4A97800DE7A90 /* DayWeatherCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8394799C2AF4A97800DE7A90 /* DayWeatherCollectionViewCell.swift */; };
83BA693F2AE025E3000AD795 /* list.png in Resources */ = {isa = PBXBuildFile; fileRef = 83BA693E2AE025E3000AD795 /* list.png */; };
83DCC7B82AF8D270000EC679 /* TopCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83DCC7B72AF8D270000EC679 /* TopCollectionViewCell.swift */; };
83DCC7BA2AF8D549000EC679 /* TimeWeatherCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83DCC7B92AF8D549000EC679 /* TimeWeatherCollectionViewCell.swift */; };
83DCC7BC2AF8D715000EC679 /* TimeWeatherListData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83DCC7BB2AF8D715000EC679 /* TimeWeatherListData.swift */; };
83FEC0452B1E162800D91AE4 /* UIStackView+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83FEC0442B1E162800D91AE4 /* UIStackView+.swift */; };
83FEC0472B1E166700D91AE4 /* NSObject+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83FEC0462B1E166700D91AE4 /* NSObject+.swift */; };
83FEC0492B1F0F2400D91AE4 /* UIView+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83FEC0482B1F0F2400D91AE4 /* UIView+.swift */; };
83FEC0552B1F91B300D91AE4 /* DetailWeatherList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83FEC0542B1F91B300D91AE4 /* DetailWeatherList.swift */; };
83FEC0572B20E7B200D91AE4 /* WeatherListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83FEC0562B20E7B200D91AE4 /* WeatherListView.swift */; };
83FEC05B2B27606E00D91AE4 /* ImageLiterals.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83FEC05A2B27606E00D91AE4 /* ImageLiterals.swift */; };
83FEC05D2B2760EC00D91AE4 /* UIImage+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83FEC05C2B2760EC00D91AE4 /* UIImage+.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -60,7 +62,6 @@
838AA68B2ADB93B100CC766B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
838AA68E2ADB93B100CC766B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
838AA6902ADB93B100CC766B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
838AA6962ADB976D00CC766B /* Img.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Img.png; sourceTree = "<group>"; };
838AA6992ADD675800CC766B /* SF-Pro-Display-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-Bold.otf"; sourceTree = "<group>"; };
838AA69B2ADD677B00CC766B /* SF-Pro-Display-Light.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-Light.otf"; sourceTree = "<group>"; };
838AA69D2ADD678900CC766B /* SF-Pro-Display-Medium.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Display-Medium.otf"; sourceTree = "<group>"; };
Expand All @@ -72,13 +73,16 @@
8394798C2AEFC38400DE7A90 /* WeatherListData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeatherListData.swift; sourceTree = "<group>"; };
8394799A2AF3F0CD00DE7A90 /* DayWeatherListData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DayWeatherListData.swift; sourceTree = "<group>"; };
8394799C2AF4A97800DE7A90 /* DayWeatherCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DayWeatherCollectionViewCell.swift; sourceTree = "<group>"; };
83BA693E2AE025E3000AD795 /* list.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = list.png; sourceTree = "<group>"; };
83DCC7B72AF8D270000EC679 /* TopCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopCollectionViewCell.swift; sourceTree = "<group>"; };
83DCC7B92AF8D549000EC679 /* TimeWeatherCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeWeatherCollectionViewCell.swift; sourceTree = "<group>"; };
83DCC7BB2AF8D715000EC679 /* TimeWeatherListData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeWeatherListData.swift; sourceTree = "<group>"; };
83FEC0442B1E162800D91AE4 /* UIStackView+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIStackView+.swift"; sourceTree = "<group>"; };
83FEC0462B1E166700D91AE4 /* NSObject+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSObject+.swift"; sourceTree = "<group>"; };
83FEC0482B1F0F2400D91AE4 /* UIView+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+.swift"; sourceTree = "<group>"; };
83FEC0542B1F91B300D91AE4 /* DetailWeatherList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailWeatherList.swift; sourceTree = "<group>"; };
83FEC0562B20E7B200D91AE4 /* WeatherListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeatherListView.swift; sourceTree = "<group>"; };
83FEC05A2B27606E00D91AE4 /* ImageLiterals.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageLiterals.swift; sourceTree = "<group>"; };
83FEC05C2B2760EC00D91AE4 /* UIImage+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+.swift"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -106,7 +110,6 @@
isa = PBXGroup;
children = (
83DCC7B92AF8D549000EC679 /* TimeWeatherCollectionViewCell.swift */,
83DCC7BB2AF8D715000EC679 /* TimeWeatherListData.swift */,
835E9E482AFBEE0300D5E4C5 /* HourCollectionViewCell.swift */,
834960842AFD4BAE00A78244 /* SecondCustomHeaderView.swift */,
834960862AFD4BBC00A78244 /* SecondCustomFooterView.swift */,
Expand All @@ -118,7 +121,6 @@
isa = PBXGroup;
children = (
8394799C2AF4A97800DE7A90 /* DayWeatherCollectionViewCell.swift */,
8394799A2AF3F0CD00DE7A90 /* DayWeatherListData.swift */,
835E9E4A2AFCCB8200D5E4C5 /* CustomHeaderView.swift */,
8349607F2AFD42E300A78244 /* CustomFooterView.swift */,
);
Expand All @@ -128,8 +130,9 @@
834960C92B025B1400A78244 /* Network */ = {
isa = PBXGroup;
children = (
83FEC0532B1F7D3600D91AE4 /* Service */,
83FEC0522B1F7D2F00D91AE4 /* Data */,
834960C72B025AF800A78244 /* NetworkError.swift */,
834960C02B011B6500A78244 /* WeatherService.swift */,
);
path = Network;
sourceTree = "<group>";
Expand All @@ -154,13 +157,12 @@
838AA6812ADB93AF00CC766B /* SOPT33_assignment2 */ = {
isa = PBXGroup;
children = (
834960C92B025B1400A78244 /* Network */,
83FEC0422B1E158200D91AE4 /* Application */,
83FEC0432B1E159800D91AE4 /* Global */,
839479972AF3F06B00DE7A90 /* DayWeatherList */,
839479962AF3F05500DE7A90 /* WeatherList */,
838AA6962ADB976D00CC766B /* Img.png */,
83BA693E2AE025E3000AD795 /* list.png */,
834960C92B025B1400A78244 /* Network */,
83FEC04C2B1F7B3400D91AE4 /* Model */,
83FEC04A2B1F7AD700D91AE4 /* VC */,
83FEC04B2B1F7B1500D91AE4 /* Cell */,
838AA68D2ADB93B100CC766B /* LaunchScreen.storyboard */,
838AA6902ADB93B100CC766B /* Info.plist */,
);
Expand All @@ -180,34 +182,13 @@
path = Fonts;
sourceTree = "<group>";
};
839479962AF3F05500DE7A90 /* WeatherList */ = {
isa = PBXGroup;
children = (
838AA6862ADB93AF00CC766B /* ViewController.swift */,
8394798A2AEFC31B00DE7A90 /* WeatherListTableViewCell.swift */,
8394798C2AEFC38400DE7A90 /* WeatherListData.swift */,
834960C22B011D2A00A78244 /* OpenWeatherData.swift */,
);
path = WeatherList;
sourceTree = "<group>";
};
839479972AF3F06B00DE7A90 /* DayWeatherList */ = {
isa = PBXGroup;
children = (
838AA6A62ADD79C100CC766B /* ResultViewController.swift */,
834960812AFD4B3900A78244 /* FirstSection */,
834960822AFD4B4400A78244 /* SecondSection */,
834960832AFD4B5800A78244 /* ThirdSection */,
);
path = DayWeatherList;
sourceTree = "<group>";
};
83FEC0412B1E156400D91AE4 /* Extension */ = {
isa = PBXGroup;
children = (
83FEC0482B1F0F2400D91AE4 /* UIView+.swift */,
83FEC0442B1E162800D91AE4 /* UIStackView+.swift */,
83FEC0462B1E166700D91AE4 /* NSObject+.swift */,
83FEC05C2B2760EC00D91AE4 /* UIImage+.swift */,
);
path = Extension;
sourceTree = "<group>";
Expand All @@ -224,13 +205,102 @@
83FEC0432B1E159800D91AE4 /* Global */ = {
isa = PBXGroup;
children = (
83FEC0582B27604A00D91AE4 /* Literals */,
838AA68B2ADB93B100CC766B /* Assets.xcassets */,
838AA6A32ADD687A00CC766B /* Fonts */,
83FEC0412B1E156400D91AE4 /* Extension */,
);
path = Global;
sourceTree = "<group>";
};
83FEC04A2B1F7AD700D91AE4 /* VC */ = {
isa = PBXGroup;
children = (
838AA6862ADB93AF00CC766B /* ViewController.swift */,
838AA6A62ADD79C100CC766B /* ResultViewController.swift */,
);
path = VC;
sourceTree = "<group>";
};
83FEC04B2B1F7B1500D91AE4 /* Cell */ = {
isa = PBXGroup;
children = (
83FEC04F2B1F7B8900D91AE4 /* WeatherList */,
83FEC04E2B1F7B7F00D91AE4 /* DetailWeatherList */,
);
path = Cell;
sourceTree = "<group>";
};
83FEC04C2B1F7B3400D91AE4 /* Model */ = {
isa = PBXGroup;
children = (
83FEC0512B1F7C7800D91AE4 /* WeatherList */,
83FEC0502B1F7C6C00D91AE4 /* DetailWeatherList */,
);
path = Model;
sourceTree = "<group>";
};
83FEC04E2B1F7B7F00D91AE4 /* DetailWeatherList */ = {
isa = PBXGroup;
children = (
83FEC0542B1F91B300D91AE4 /* DetailWeatherList.swift */,
834960812AFD4B3900A78244 /* FirstSection */,
834960822AFD4B4400A78244 /* SecondSection */,
834960832AFD4B5800A78244 /* ThirdSection */,
);
path = DetailWeatherList;
sourceTree = "<group>";
};
83FEC04F2B1F7B8900D91AE4 /* WeatherList */ = {
isa = PBXGroup;
children = (
8394798A2AEFC31B00DE7A90 /* WeatherListTableViewCell.swift */,
83FEC0562B20E7B200D91AE4 /* WeatherListView.swift */,
);
path = WeatherList;
sourceTree = "<group>";
};
83FEC0502B1F7C6C00D91AE4 /* DetailWeatherList */ = {
isa = PBXGroup;
children = (
8394799A2AF3F0CD00DE7A90 /* DayWeatherListData.swift */,
83DCC7BB2AF8D715000EC679 /* TimeWeatherListData.swift */,
);
path = DetailWeatherList;
sourceTree = "<group>";
};
83FEC0512B1F7C7800D91AE4 /* WeatherList */ = {
isa = PBXGroup;
children = (
8394798C2AEFC38400DE7A90 /* WeatherListData.swift */,
);
path = WeatherList;
sourceTree = "<group>";
};
83FEC0522B1F7D2F00D91AE4 /* Data */ = {
isa = PBXGroup;
children = (
834960C22B011D2A00A78244 /* OpenWeatherData.swift */,
);
path = Data;
sourceTree = "<group>";
};
83FEC0532B1F7D3600D91AE4 /* Service */ = {
isa = PBXGroup;
children = (
834960C02B011B6500A78244 /* WeatherService.swift */,
);
path = Service;
sourceTree = "<group>";
};
83FEC0582B27604A00D91AE4 /* Literals */ = {
isa = PBXGroup;
children = (
83FEC05A2B27606E00D91AE4 /* ImageLiterals.swift */,
);
path = Literals;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -299,8 +369,6 @@
files = (
838AA6A22ADD67A500CC766B /* SF-Pro-Display-Thin.otf in Resources */,
838AA69E2ADD678900CC766B /* SF-Pro-Display-Medium.otf in Resources */,
83BA693F2AE025E3000AD795 /* list.png in Resources */,
838AA6972ADB976D00CC766B /* Img.png in Resources */,
838AA69C2ADD677B00CC766B /* SF-Pro-Display-Light.otf in Resources */,
838AA68F2ADB93B100CC766B /* LaunchScreen.storyboard in Resources */,
838AA69A2ADD675800CC766B /* SF-Pro-Display-Bold.otf in Resources */,
Expand All @@ -319,12 +387,15 @@
838AA6A72ADD79C100CC766B /* ResultViewController.swift in Sources */,
838AA6A52ADD77A300CC766B /* Font.swift in Sources */,
834960852AFD4BAE00A78244 /* SecondCustomHeaderView.swift in Sources */,
83FEC0572B20E7B200D91AE4 /* WeatherListView.swift in Sources */,
83DCC7B82AF8D270000EC679 /* TopCollectionViewCell.swift in Sources */,
8394798B2AEFC31B00DE7A90 /* WeatherListTableViewCell.swift in Sources */,
83FEC05D2B2760EC00D91AE4 /* UIImage+.swift in Sources */,
8394799B2AF3F0CD00DE7A90 /* DayWeatherListData.swift in Sources */,
83DCC7BC2AF8D715000EC679 /* TimeWeatherListData.swift in Sources */,
83FEC0472B1E166700D91AE4 /* NSObject+.swift in Sources */,
83FEC0452B1E162800D91AE4 /* UIStackView+.swift in Sources */,
83FEC0552B1F91B300D91AE4 /* DetailWeatherList.swift in Sources */,
8394798D2AEFC38400DE7A90 /* WeatherListData.swift in Sources */,
838AA6872ADB93AF00CC766B /* ViewController.swift in Sources */,
834960C82B025AF800A78244 /* NetworkError.swift in Sources */,
Expand All @@ -333,6 +404,7 @@
834960802AFD42E300A78244 /* CustomFooterView.swift in Sources */,
838AA6832ADB93AF00CC766B /* AppDelegate.swift in Sources */,
835E9E492AFBEE0300D5E4C5 /* HourCollectionViewCell.swift in Sources */,
83FEC05B2B27606E00D91AE4 /* ImageLiterals.swift in Sources */,
834960C32B011D2A00A78244 /* OpenWeatherData.swift in Sources */,
834960872AFD4BBC00A78244 /* SecondCustomFooterView.swift in Sources */,
8394799D2AF4A97800DE7A90 /* DayWeatherCollectionViewCell.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"images" : [
{
"filename" : "Img-1.png",
"idiom" : "universal",
"scale" : "1x"
},
Expand All @@ -10,6 +11,7 @@
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// UIImage+.swift
// SOPT33_assignment2
//
// Created by Gahyun Kim on 2023/12/12.
//

import UIKit

extension UIImage {
static func load(named imageName: String) -> UIImage {
guard let image = UIImage(named: imageName, in: nil, compatibleWith: nil) else {
return UIImage()
}
return image
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// ImageLiterals.swift
// SOPT33_assignment2
//
// Created by Gahyun Kim on 2023/12/12.
//

import UIKit

enum ImageLiterals {
enum img {
static var background: UIImage { .load(named: "background")}
static var list: UIImage { .load(named: "list")}
}

enum icon {
static var cloud: UIImage { .load(named: "cloud")}
static var drizzle: UIImage { .load(named: "drizzle")}
static var rain: UIImage { .load(named: "rain")}
static var sunshower: UIImage { .load(named: "sunshower")}
static var thunder: UIImage { .load(named: "thunder")}
static var current: UIImage { .load(named: "current")}
static var map: UIImage { .load(named: "map")}
static var menu: UIImage { .load(named: "menu")}
static var other: UIImage { .load(named: "other")}
static var pre: UIImage { .load(named: "pre")}
static var search: UIImage { .load(named: "search")}
static var tempbar: UIImage { .load(named: "tempbar")}
}
}
Binary file removed SOPT33_assignment2/SOPT33_assignment2/Img.png
Binary file not shown.
Loading

0 comments on commit e700f74

Please sign in to comment.