diff --git a/seminar2-assignment/Assets.xcassets/AppIcon.appiconset/Contents.json b/seminar2-assignment/Assets.xcassets/AppIcon.appiconset/Contents.json index 8b33891..eb481e3 100644 --- a/seminar2-assignment/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/seminar2-assignment/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "weather-2021-12-07.png", + "filename" : "image 1.png", "idiom" : "universal", "platform" : "ios", "size" : "1024x1024" diff --git a/seminar2-assignment/Assets.xcassets/AppIcon.appiconset/image 1.png b/seminar2-assignment/Assets.xcassets/AppIcon.appiconset/image 1.png new file mode 100644 index 0000000..75332b8 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/AppIcon.appiconset/image 1.png differ diff --git a/seminar2-assignment/Assets.xcassets/AppIcon.appiconset/weather-2021-12-07.png b/seminar2-assignment/Assets.xcassets/AppIcon.appiconset/weather-2021-12-07.png deleted file mode 100644 index cc0e217..0000000 Binary files a/seminar2-assignment/Assets.xcassets/AppIcon.appiconset/weather-2021-12-07.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/Moon.imageset/Frame 2.png b/seminar2-assignment/Assets.xcassets/Moon.imageset/Frame 2.png deleted file mode 100644 index ba1e15d..0000000 Binary files a/seminar2-assignment/Assets.xcassets/Moon.imageset/Frame 2.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/Moon.imageset/Frame 2@2x.png b/seminar2-assignment/Assets.xcassets/Moon.imageset/Frame 2@2x.png deleted file mode 100644 index cf67d00..0000000 Binary files a/seminar2-assignment/Assets.xcassets/Moon.imageset/Frame 2@2x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/Moon.imageset/Frame 2@3x.png b/seminar2-assignment/Assets.xcassets/Moon.imageset/Frame 2@3x.png deleted file mode 100644 index 47a2dce..0000000 Binary files a/seminar2-assignment/Assets.xcassets/Moon.imageset/Frame 2@3x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/backgroundLarge.imageset/Img.png b/seminar2-assignment/Assets.xcassets/backgroundLarge.imageset/Img.png deleted file mode 100644 index 7565046..0000000 Binary files a/seminar2-assignment/Assets.xcassets/backgroundLarge.imageset/Img.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/backgroundLarge.imageset/Img@2x.png b/seminar2-assignment/Assets.xcassets/backgroundLarge.imageset/Img@2x.png deleted file mode 100644 index babcc0c..0000000 Binary files a/seminar2-assignment/Assets.xcassets/backgroundLarge.imageset/Img@2x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/backgroundLarge.imageset/Img@3x.png b/seminar2-assignment/Assets.xcassets/backgroundLarge.imageset/Img@3x.png deleted file mode 100644 index f6b555c..0000000 Binary files a/seminar2-assignment/Assets.xcassets/backgroundLarge.imageset/Img@3x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/backgroundS.imageset/list.png b/seminar2-assignment/Assets.xcassets/backgroundS.imageset/list.png deleted file mode 100644 index e38297e..0000000 Binary files a/seminar2-assignment/Assets.xcassets/backgroundS.imageset/list.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/backgroundS.imageset/list@2x.png b/seminar2-assignment/Assets.xcassets/backgroundS.imageset/list@2x.png deleted file mode 100644 index 1460cee..0000000 Binary files a/seminar2-assignment/Assets.xcassets/backgroundS.imageset/list@2x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/backgroundS.imageset/list@3x.png b/seminar2-assignment/Assets.xcassets/backgroundS.imageset/list@3x.png deleted file mode 100644 index dc0397d..0000000 Binary files a/seminar2-assignment/Assets.xcassets/backgroundS.imageset/list@3x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/background_image1.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/background_image1.imageset/Contents.json new file mode 100644 index 0000000..181bdfc --- /dev/null +++ b/seminar2-assignment/Assets.xcassets/background_image1.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "verticalBackground.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "verticalBackground@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "verticalBackground@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/seminar2-assignment/Assets.xcassets/background_image1.imageset/verticalBackground.png b/seminar2-assignment/Assets.xcassets/background_image1.imageset/verticalBackground.png new file mode 100644 index 0000000..fc4269c Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/background_image1.imageset/verticalBackground.png differ diff --git a/seminar2-assignment/Assets.xcassets/background_image1.imageset/verticalBackground@2x.png b/seminar2-assignment/Assets.xcassets/background_image1.imageset/verticalBackground@2x.png new file mode 100644 index 0000000..62f2955 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/background_image1.imageset/verticalBackground@2x.png differ diff --git a/seminar2-assignment/Assets.xcassets/background_image1.imageset/verticalBackground@3x.png b/seminar2-assignment/Assets.xcassets/background_image1.imageset/verticalBackground@3x.png new file mode 100644 index 0000000..a2eb7df Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/background_image1.imageset/verticalBackground@3x.png differ diff --git a/seminar2-assignment/Assets.xcassets/background_image2.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/background_image2.imageset/Contents.json new file mode 100644 index 0000000..9351aca --- /dev/null +++ b/seminar2-assignment/Assets.xcassets/background_image2.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "horizontalBackground.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "horizontalBackground@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "horizontalBackground@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/seminar2-assignment/Assets.xcassets/background_image2.imageset/horizontalBackground.png b/seminar2-assignment/Assets.xcassets/background_image2.imageset/horizontalBackground.png new file mode 100644 index 0000000..34259f6 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/background_image2.imageset/horizontalBackground.png differ diff --git a/seminar2-assignment/Assets.xcassets/background_image2.imageset/horizontalBackground@2x.png b/seminar2-assignment/Assets.xcassets/background_image2.imageset/horizontalBackground@2x.png new file mode 100644 index 0000000..c1276fb Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/background_image2.imageset/horizontalBackground@2x.png differ diff --git a/seminar2-assignment/Assets.xcassets/background_image2.imageset/horizontalBackground@3x.png b/seminar2-assignment/Assets.xcassets/background_image2.imageset/horizontalBackground@3x.png new file mode 100644 index 0000000..e33e804 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/background_image2.imageset/horizontalBackground@3x.png differ diff --git a/seminar2-assignment/Assets.xcassets/cloudy_image.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/cloudy_image.imageset/Contents.json new file mode 100644 index 0000000..5d42690 --- /dev/null +++ b/seminar2-assignment/Assets.xcassets/cloudy_image.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "cloudMoon.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "cloudMoon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "cloudMoon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/seminar2-assignment/Assets.xcassets/cloudy_image.imageset/cloudMoon.png b/seminar2-assignment/Assets.xcassets/cloudy_image.imageset/cloudMoon.png new file mode 100644 index 0000000..f969076 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/cloudy_image.imageset/cloudMoon.png differ diff --git a/seminar2-assignment/Assets.xcassets/cloudy_image.imageset/cloudMoon@2x.png b/seminar2-assignment/Assets.xcassets/cloudy_image.imageset/cloudMoon@2x.png new file mode 100644 index 0000000..a7b85c5 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/cloudy_image.imageset/cloudMoon@2x.png differ diff --git a/seminar2-assignment/Assets.xcassets/cloudy_image.imageset/cloudMoon@3x.png b/seminar2-assignment/Assets.xcassets/cloudy_image.imageset/cloudMoon@3x.png new file mode 100644 index 0000000..dc217fe Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/cloudy_image.imageset/cloudMoon@3x.png differ diff --git a/seminar2-assignment/Assets.xcassets/Moon.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/dot_image.imageset/Contents.json similarity index 71% rename from seminar2-assignment/Assets.xcassets/Moon.imageset/Contents.json rename to seminar2-assignment/Assets.xcassets/dot_image.imageset/Contents.json index 1abbabf..9c61a68 100644 --- a/seminar2-assignment/Assets.xcassets/Moon.imageset/Contents.json +++ b/seminar2-assignment/Assets.xcassets/dot_image.imageset/Contents.json @@ -1,17 +1,17 @@ { "images" : [ { - "filename" : "Frame 2.png", + "filename" : "ellipse.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "Frame 2@2x.png", + "filename" : "ellipse@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "Frame 2@3x.png", + "filename" : "ellipse@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/seminar2-assignment/Assets.xcassets/dot_image.imageset/ellipse.png b/seminar2-assignment/Assets.xcassets/dot_image.imageset/ellipse.png new file mode 100644 index 0000000..659b6da Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/dot_image.imageset/ellipse.png differ diff --git a/seminar2-assignment/Assets.xcassets/dot_image.imageset/ellipse@2x.png b/seminar2-assignment/Assets.xcassets/dot_image.imageset/ellipse@2x.png new file mode 100644 index 0000000..a684bbe Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/dot_image.imageset/ellipse@2x.png differ diff --git a/seminar2-assignment/Assets.xcassets/dot_image.imageset/ellipse@3x.png b/seminar2-assignment/Assets.xcassets/dot_image.imageset/ellipse@3x.png new file mode 100644 index 0000000..dc171c8 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/dot_image.imageset/ellipse@3x.png differ diff --git a/seminar2-assignment/Assets.xcassets/ellipsis_image.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/ellipsis_image.imageset/Contents.json new file mode 100644 index 0000000..24e259a --- /dev/null +++ b/seminar2-assignment/Assets.xcassets/ellipsis_image.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ellipsisCircle.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ellipsisCircle@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ellipsisCircle@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/seminar2-assignment/Assets.xcassets/ellipsis_image.imageset/ellipsisCircle.png b/seminar2-assignment/Assets.xcassets/ellipsis_image.imageset/ellipsisCircle.png new file mode 100644 index 0000000..ad4956f Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/ellipsis_image.imageset/ellipsisCircle.png differ diff --git a/seminar2-assignment/Assets.xcassets/ellipsis_image.imageset/ellipsisCircle@2x.png b/seminar2-assignment/Assets.xcassets/ellipsis_image.imageset/ellipsisCircle@2x.png new file mode 100644 index 0000000..f0d1285 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/ellipsis_image.imageset/ellipsisCircle@2x.png differ diff --git a/seminar2-assignment/Assets.xcassets/ellipsis_image.imageset/ellipsisCircle@3x.png b/seminar2-assignment/Assets.xcassets/ellipsis_image.imageset/ellipsisCircle@3x.png new file mode 100644 index 0000000..53de304 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/ellipsis_image.imageset/ellipsisCircle@3x.png differ diff --git a/seminar2-assignment/Assets.xcassets/find.imageset/Frame 8.svg b/seminar2-assignment/Assets.xcassets/find.imageset/Frame 8.svg deleted file mode 100644 index b100ed1..0000000 --- a/seminar2-assignment/Assets.xcassets/find.imageset/Frame 8.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/seminar2-assignment/Assets.xcassets/find.imageset/Frame 8@2x.png b/seminar2-assignment/Assets.xcassets/find.imageset/Frame 8@2x.png deleted file mode 100644 index 7653107..0000000 Binary files a/seminar2-assignment/Assets.xcassets/find.imageset/Frame 8@2x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/find.imageset/Frame 8@3x.png b/seminar2-assignment/Assets.xcassets/find.imageset/Frame 8@3x.png deleted file mode 100644 index 3133d0f..0000000 Binary files a/seminar2-assignment/Assets.xcassets/find.imageset/Frame 8@3x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/list.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/gps_image.imageset/Contents.json similarity index 70% rename from seminar2-assignment/Assets.xcassets/list.imageset/Contents.json rename to seminar2-assignment/Assets.xcassets/gps_image.imageset/Contents.json index ee21fc8..e5abe94 100644 --- a/seminar2-assignment/Assets.xcassets/list.imageset/Contents.json +++ b/seminar2-assignment/Assets.xcassets/gps_image.imageset/Contents.json @@ -1,17 +1,17 @@ { "images" : [ { - "filename" : "Frame 12.svg", + "filename" : "location.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "Frame 12@2x.png", + "filename" : "location@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "Frame 12@3x.png", + "filename" : "location@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/seminar2-assignment/Assets.xcassets/gps_image.imageset/location.png b/seminar2-assignment/Assets.xcassets/gps_image.imageset/location.png new file mode 100644 index 0000000..c9670f1 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/gps_image.imageset/location.png differ diff --git a/seminar2-assignment/Assets.xcassets/gps_image.imageset/location@2x.png b/seminar2-assignment/Assets.xcassets/gps_image.imageset/location@2x.png new file mode 100644 index 0000000..859ee4d Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/gps_image.imageset/location@2x.png differ diff --git a/seminar2-assignment/Assets.xcassets/gps_image.imageset/location@3x.png b/seminar2-assignment/Assets.xcassets/gps_image.imageset/location@3x.png new file mode 100644 index 0000000..5258f23 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/gps_image.imageset/location@3x.png differ diff --git a/seminar2-assignment/Assets.xcassets/heavy_rain_image.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/heavy_rain_image.imageset/Contents.json new file mode 100644 index 0000000..736fb70 --- /dev/null +++ b/seminar2-assignment/Assets.xcassets/heavy_rain_image.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "cloudHeavyRain.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "cloudHeavyRain@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "cloudHeavyRain@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/seminar2-assignment/Assets.xcassets/heavy_rain_image.imageset/cloudHeavyRain.png b/seminar2-assignment/Assets.xcassets/heavy_rain_image.imageset/cloudHeavyRain.png new file mode 100644 index 0000000..903cc0e Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/heavy_rain_image.imageset/cloudHeavyRain.png differ diff --git a/seminar2-assignment/Assets.xcassets/heavy_rain_image.imageset/cloudHeavyRain@2x.png b/seminar2-assignment/Assets.xcassets/heavy_rain_image.imageset/cloudHeavyRain@2x.png new file mode 100644 index 0000000..e9ed257 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/heavy_rain_image.imageset/cloudHeavyRain@2x.png differ diff --git a/seminar2-assignment/Assets.xcassets/heavy_rain_image.imageset/cloudHeavyRain@3x.png b/seminar2-assignment/Assets.xcassets/heavy_rain_image.imageset/cloudHeavyRain@3x.png new file mode 100644 index 0000000..86bd05d Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/heavy_rain_image.imageset/cloudHeavyRain@3x.png differ diff --git a/seminar2-assignment/Assets.xcassets/list.imageset/Frame 12.svg b/seminar2-assignment/Assets.xcassets/list.imageset/Frame 12.svg deleted file mode 100644 index b0a0fa1..0000000 --- a/seminar2-assignment/Assets.xcassets/list.imageset/Frame 12.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/seminar2-assignment/Assets.xcassets/list.imageset/Frame 12@2x.png b/seminar2-assignment/Assets.xcassets/list.imageset/Frame 12@2x.png deleted file mode 100644 index efd3c62..0000000 Binary files a/seminar2-assignment/Assets.xcassets/list.imageset/Frame 12@2x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/list.imageset/Frame 12@3x.png b/seminar2-assignment/Assets.xcassets/list.imageset/Frame 12@3x.png deleted file mode 100644 index b75bc88..0000000 Binary files a/seminar2-assignment/Assets.xcassets/list.imageset/Frame 12@3x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/backgroundS.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/list_image.imageset/Contents.json similarity index 100% rename from seminar2-assignment/Assets.xcassets/backgroundS.imageset/Contents.json rename to seminar2-assignment/Assets.xcassets/list_image.imageset/Contents.json diff --git a/seminar2-assignment/Assets.xcassets/list_image.imageset/list.png b/seminar2-assignment/Assets.xcassets/list_image.imageset/list.png new file mode 100644 index 0000000..87ea8c1 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/list_image.imageset/list.png differ diff --git a/seminar2-assignment/Assets.xcassets/list_image.imageset/list@2x.png b/seminar2-assignment/Assets.xcassets/list_image.imageset/list@2x.png new file mode 100644 index 0000000..c071e4b Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/list_image.imageset/list@2x.png differ diff --git a/seminar2-assignment/Assets.xcassets/list_image.imageset/list@3x.png b/seminar2-assignment/Assets.xcassets/list_image.imageset/list@3x.png new file mode 100644 index 0000000..ec32747 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/list_image.imageset/list@3x.png differ diff --git a/seminar2-assignment/Assets.xcassets/magnifying_glass_image.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/magnifying_glass_image.imageset/Contents.json new file mode 100644 index 0000000..e56be93 --- /dev/null +++ b/seminar2-assignment/Assets.xcassets/magnifying_glass_image.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "magnifyingglass.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "magnifyingglass@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "magnifyingglass@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/seminar2-assignment/Assets.xcassets/magnifying_glass_image.imageset/magnifyingglass.png b/seminar2-assignment/Assets.xcassets/magnifying_glass_image.imageset/magnifyingglass.png new file mode 100644 index 0000000..674a4b2 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/magnifying_glass_image.imageset/magnifyingglass.png differ diff --git a/seminar2-assignment/Assets.xcassets/magnifying_glass_image.imageset/magnifyingglass@2x.png b/seminar2-assignment/Assets.xcassets/magnifying_glass_image.imageset/magnifyingglass@2x.png new file mode 100644 index 0000000..9aa9e71 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/magnifying_glass_image.imageset/magnifyingglass@2x.png differ diff --git a/seminar2-assignment/Assets.xcassets/magnifying_glass_image.imageset/magnifyingglass@3x.png b/seminar2-assignment/Assets.xcassets/magnifying_glass_image.imageset/magnifyingglass@3x.png new file mode 100644 index 0000000..5efde4a Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/magnifying_glass_image.imageset/magnifyingglass@3x.png differ diff --git a/seminar2-assignment/Assets.xcassets/map.imageset/Frame 9.svg b/seminar2-assignment/Assets.xcassets/map.imageset/Frame 9.svg deleted file mode 100644 index 3adedf3..0000000 --- a/seminar2-assignment/Assets.xcassets/map.imageset/Frame 9.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/seminar2-assignment/Assets.xcassets/map.imageset/Frame 9@2x.png b/seminar2-assignment/Assets.xcassets/map.imageset/Frame 9@2x.png deleted file mode 100644 index 0ed428c..0000000 Binary files a/seminar2-assignment/Assets.xcassets/map.imageset/Frame 9@2x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/map.imageset/Frame 9@3x.png b/seminar2-assignment/Assets.xcassets/map.imageset/Frame 9@3x.png deleted file mode 100644 index d43d9fc..0000000 Binary files a/seminar2-assignment/Assets.xcassets/map.imageset/Frame 9@3x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/backgroundLarge.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/map_image.imageset/Contents.json similarity index 73% rename from seminar2-assignment/Assets.xcassets/backgroundLarge.imageset/Contents.json rename to seminar2-assignment/Assets.xcassets/map_image.imageset/Contents.json index 274b329..2667fd7 100644 --- a/seminar2-assignment/Assets.xcassets/backgroundLarge.imageset/Contents.json +++ b/seminar2-assignment/Assets.xcassets/map_image.imageset/Contents.json @@ -1,17 +1,17 @@ { "images" : [ { - "filename" : "Img.png", + "filename" : "map.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "Img@2x.png", + "filename" : "map@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "Img@3x.png", + "filename" : "map@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/seminar2-assignment/Assets.xcassets/map_image.imageset/map.png b/seminar2-assignment/Assets.xcassets/map_image.imageset/map.png new file mode 100644 index 0000000..f60c9f4 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/map_image.imageset/map.png differ diff --git a/seminar2-assignment/Assets.xcassets/map_image.imageset/map@2x.png b/seminar2-assignment/Assets.xcassets/map_image.imageset/map@2x.png new file mode 100644 index 0000000..661048b Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/map_image.imageset/map@2x.png differ diff --git a/seminar2-assignment/Assets.xcassets/map_image.imageset/map@3x.png b/seminar2-assignment/Assets.xcassets/map_image.imageset/map@3x.png new file mode 100644 index 0000000..20d634b Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/map_image.imageset/map@3x.png differ diff --git a/seminar2-assignment/Assets.xcassets/more.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/more.imageset/Contents.json deleted file mode 100644 index 053cf02..0000000 --- a/seminar2-assignment/Assets.xcassets/more.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "filename" : "Frame 7.svg", - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "Frame 7@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "Frame 7@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/seminar2-assignment/Assets.xcassets/more.imageset/Frame 7.svg b/seminar2-assignment/Assets.xcassets/more.imageset/Frame 7.svg deleted file mode 100644 index 7e2ceeb..0000000 --- a/seminar2-assignment/Assets.xcassets/more.imageset/Frame 7.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/seminar2-assignment/Assets.xcassets/more.imageset/Frame 7@2x.png b/seminar2-assignment/Assets.xcassets/more.imageset/Frame 7@2x.png deleted file mode 100644 index 3edfdb6..0000000 Binary files a/seminar2-assignment/Assets.xcassets/more.imageset/Frame 7@2x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/more.imageset/Frame 7@3x.png b/seminar2-assignment/Assets.xcassets/more.imageset/Frame 7@3x.png deleted file mode 100644 index f3ab7a3..0000000 Binary files a/seminar2-assignment/Assets.xcassets/more.imageset/Frame 7@3x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/moreRain.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/moreRain.imageset/Contents.json deleted file mode 100644 index d715a2f..0000000 --- a/seminar2-assignment/Assets.xcassets/moreRain.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "filename" : "Frame 4.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "Frame 4@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "Frame 4@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/seminar2-assignment/Assets.xcassets/moreRain.imageset/Frame 4.png b/seminar2-assignment/Assets.xcassets/moreRain.imageset/Frame 4.png deleted file mode 100644 index 8b1fc94..0000000 Binary files a/seminar2-assignment/Assets.xcassets/moreRain.imageset/Frame 4.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/moreRain.imageset/Frame 4@2x.png b/seminar2-assignment/Assets.xcassets/moreRain.imageset/Frame 4@2x.png deleted file mode 100644 index b95dfa1..0000000 Binary files a/seminar2-assignment/Assets.xcassets/moreRain.imageset/Frame 4@2x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/moreRain.imageset/Frame 4@3x.png b/seminar2-assignment/Assets.xcassets/moreRain.imageset/Frame 4@3x.png deleted file mode 100644 index 33ea1dc..0000000 Binary files a/seminar2-assignment/Assets.xcassets/moreRain.imageset/Frame 4@3x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/now.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/now.imageset/Contents.json deleted file mode 100644 index 73cff39..0000000 --- a/seminar2-assignment/Assets.xcassets/now.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "filename" : "Frame 10.svg", - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "Frame 10@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "Frame 10@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/seminar2-assignment/Assets.xcassets/now.imageset/Frame 10.svg b/seminar2-assignment/Assets.xcassets/now.imageset/Frame 10.svg deleted file mode 100644 index 58442bf..0000000 --- a/seminar2-assignment/Assets.xcassets/now.imageset/Frame 10.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/seminar2-assignment/Assets.xcassets/now.imageset/Frame 10@2x.png b/seminar2-assignment/Assets.xcassets/now.imageset/Frame 10@2x.png deleted file mode 100644 index 9f0c1ec..0000000 Binary files a/seminar2-assignment/Assets.xcassets/now.imageset/Frame 10@2x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/now.imageset/Frame 10@3x.png b/seminar2-assignment/Assets.xcassets/now.imageset/Frame 10@3x.png deleted file mode 100644 index 0437325..0000000 Binary files a/seminar2-assignment/Assets.xcassets/now.imageset/Frame 10@3x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/one.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/one.imageset/Contents.json deleted file mode 100644 index d80d086..0000000 --- a/seminar2-assignment/Assets.xcassets/one.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "filename" : "Frame 11.svg", - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "Frame 11@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "Frame 11@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/seminar2-assignment/Assets.xcassets/one.imageset/Frame 11.svg b/seminar2-assignment/Assets.xcassets/one.imageset/Frame 11.svg deleted file mode 100644 index d69254f..0000000 --- a/seminar2-assignment/Assets.xcassets/one.imageset/Frame 11.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/seminar2-assignment/Assets.xcassets/one.imageset/Frame 11@2x.png b/seminar2-assignment/Assets.xcassets/one.imageset/Frame 11@2x.png deleted file mode 100644 index b820032..0000000 Binary files a/seminar2-assignment/Assets.xcassets/one.imageset/Frame 11@2x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/one.imageset/Frame 11@3x.png b/seminar2-assignment/Assets.xcassets/one.imageset/Frame 11@3x.png deleted file mode 100644 index 27ad90c..0000000 Binary files a/seminar2-assignment/Assets.xcassets/one.imageset/Frame 11@3x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/party_cloudy_image.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/party_cloudy_image.imageset/Contents.json new file mode 100644 index 0000000..f8de096 --- /dev/null +++ b/seminar2-assignment/Assets.xcassets/party_cloudy_image.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "cloudSunRain.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "cloudSunRain@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "cloudSunRain@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/seminar2-assignment/Assets.xcassets/party_cloudy_image.imageset/cloudSunRain.png b/seminar2-assignment/Assets.xcassets/party_cloudy_image.imageset/cloudSunRain.png new file mode 100644 index 0000000..171b5b7 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/party_cloudy_image.imageset/cloudSunRain.png differ diff --git a/seminar2-assignment/Assets.xcassets/party_cloudy_image.imageset/cloudSunRain@2x.png b/seminar2-assignment/Assets.xcassets/party_cloudy_image.imageset/cloudSunRain@2x.png new file mode 100644 index 0000000..7a1a025 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/party_cloudy_image.imageset/cloudSunRain@2x.png differ diff --git a/seminar2-assignment/Assets.xcassets/party_cloudy_image.imageset/cloudSunRain@3x.png b/seminar2-assignment/Assets.xcassets/party_cloudy_image.imageset/cloudSunRain@3x.png new file mode 100644 index 0000000..111bbc8 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/party_cloudy_image.imageset/cloudSunRain@3x.png differ diff --git a/seminar2-assignment/Assets.xcassets/rain.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/rain.imageset/Contents.json deleted file mode 100644 index 9892e2d..0000000 --- a/seminar2-assignment/Assets.xcassets/rain.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "filename" : "Frame 3.svg", - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "Frame 3@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "Frame 3@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/seminar2-assignment/Assets.xcassets/rain.imageset/Frame 3.svg b/seminar2-assignment/Assets.xcassets/rain.imageset/Frame 3.svg deleted file mode 100644 index 367669f..0000000 --- a/seminar2-assignment/Assets.xcassets/rain.imageset/Frame 3.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/seminar2-assignment/Assets.xcassets/rain.imageset/Frame 3@2x.png b/seminar2-assignment/Assets.xcassets/rain.imageset/Frame 3@2x.png deleted file mode 100644 index dd93d92..0000000 Binary files a/seminar2-assignment/Assets.xcassets/rain.imageset/Frame 3@2x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/rain.imageset/Frame 3@3x.png b/seminar2-assignment/Assets.xcassets/rain.imageset/Frame 3@3x.png deleted file mode 100644 index 71bb65f..0000000 Binary files a/seminar2-assignment/Assets.xcassets/rain.imageset/Frame 3@3x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/rain_image.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/rain_image.imageset/Contents.json new file mode 100644 index 0000000..41441b9 --- /dev/null +++ b/seminar2-assignment/Assets.xcassets/rain_image.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "cloudDrizzle.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "cloudDrizzle@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "cloudDrizzle@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/seminar2-assignment/Assets.xcassets/rain_image.imageset/cloudDrizzle.png b/seminar2-assignment/Assets.xcassets/rain_image.imageset/cloudDrizzle.png new file mode 100644 index 0000000..f56ffcf Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/rain_image.imageset/cloudDrizzle.png differ diff --git a/seminar2-assignment/Assets.xcassets/rain_image.imageset/cloudDrizzle@2x.png b/seminar2-assignment/Assets.xcassets/rain_image.imageset/cloudDrizzle@2x.png new file mode 100644 index 0000000..c4e5bfb Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/rain_image.imageset/cloudDrizzle@2x.png differ diff --git a/seminar2-assignment/Assets.xcassets/rain_image.imageset/cloudDrizzle@3x.png b/seminar2-assignment/Assets.xcassets/rain_image.imageset/cloudDrizzle@3x.png new file mode 100644 index 0000000..06f37e9 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/rain_image.imageset/cloudDrizzle@3x.png differ diff --git a/seminar2-assignment/Assets.xcassets/sunRain.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/sunRain.imageset/Contents.json deleted file mode 100644 index 1646f05..0000000 --- a/seminar2-assignment/Assets.xcassets/sunRain.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "filename" : "Frame 6.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "Frame 6@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "Frame 6@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/seminar2-assignment/Assets.xcassets/sunRain.imageset/Frame 6.png b/seminar2-assignment/Assets.xcassets/sunRain.imageset/Frame 6.png deleted file mode 100644 index d5ef26a..0000000 Binary files a/seminar2-assignment/Assets.xcassets/sunRain.imageset/Frame 6.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/sunRain.imageset/Frame 6@2x.png b/seminar2-assignment/Assets.xcassets/sunRain.imageset/Frame 6@2x.png deleted file mode 100644 index d0f1a2d..0000000 Binary files a/seminar2-assignment/Assets.xcassets/sunRain.imageset/Frame 6@2x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/sunRain.imageset/Frame 6@3x.png b/seminar2-assignment/Assets.xcassets/sunRain.imageset/Frame 6@3x.png deleted file mode 100644 index 10d7855..0000000 Binary files a/seminar2-assignment/Assets.xcassets/sunRain.imageset/Frame 6@3x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/find.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/temperature_bar_image1.imageset/Contents.json similarity index 71% rename from seminar2-assignment/Assets.xcassets/find.imageset/Contents.json rename to seminar2-assignment/Assets.xcassets/temperature_bar_image1.imageset/Contents.json index c4daa49..ac2c014 100644 --- a/seminar2-assignment/Assets.xcassets/find.imageset/Contents.json +++ b/seminar2-assignment/Assets.xcassets/temperature_bar_image1.imageset/Contents.json @@ -1,17 +1,15 @@ { "images" : [ { - "filename" : "Frame 8.svg", + "filename" : "temperature_bar_image1.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "Frame 8@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "Frame 8@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/seminar2-assignment/Assets.xcassets/temperature_bar_image1.imageset/temperature_bar_image1.png b/seminar2-assignment/Assets.xcassets/temperature_bar_image1.imageset/temperature_bar_image1.png new file mode 100644 index 0000000..e206b70 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/temperature_bar_image1.imageset/temperature_bar_image1.png differ diff --git a/seminar2-assignment/Assets.xcassets/map.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/temperature_bar_image10.imageset/Contents.json similarity index 71% rename from seminar2-assignment/Assets.xcassets/map.imageset/Contents.json rename to seminar2-assignment/Assets.xcassets/temperature_bar_image10.imageset/Contents.json index 922b0a2..c024642 100644 --- a/seminar2-assignment/Assets.xcassets/map.imageset/Contents.json +++ b/seminar2-assignment/Assets.xcassets/temperature_bar_image10.imageset/Contents.json @@ -1,17 +1,15 @@ { "images" : [ { - "filename" : "Frame 9.svg", + "filename" : "temperature_bar_image10.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "Frame 9@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "Frame 9@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/seminar2-assignment/Assets.xcassets/temperature_bar_image10.imageset/temperature_bar_image10.png b/seminar2-assignment/Assets.xcassets/temperature_bar_image10.imageset/temperature_bar_image10.png new file mode 100644 index 0000000..6191d7f Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/temperature_bar_image10.imageset/temperature_bar_image10.png differ diff --git a/seminar2-assignment/Assets.xcassets/temperature_bar_image2.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/temperature_bar_image2.imageset/Contents.json new file mode 100644 index 0000000..cca0b74 --- /dev/null +++ b/seminar2-assignment/Assets.xcassets/temperature_bar_image2.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "temperature_bar_image2.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/seminar2-assignment/Assets.xcassets/temperature_bar_image2.imageset/temperature_bar_image2.png b/seminar2-assignment/Assets.xcassets/temperature_bar_image2.imageset/temperature_bar_image2.png new file mode 100644 index 0000000..611ce77 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/temperature_bar_image2.imageset/temperature_bar_image2.png differ diff --git a/seminar2-assignment/Assets.xcassets/temperature_bar_image3.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/temperature_bar_image3.imageset/Contents.json new file mode 100644 index 0000000..0fc0849 --- /dev/null +++ b/seminar2-assignment/Assets.xcassets/temperature_bar_image3.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "temperature_bar_image3.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/seminar2-assignment/Assets.xcassets/temperature_bar_image3.imageset/temperature_bar_image3.png b/seminar2-assignment/Assets.xcassets/temperature_bar_image3.imageset/temperature_bar_image3.png new file mode 100644 index 0000000..af1384c Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/temperature_bar_image3.imageset/temperature_bar_image3.png differ diff --git a/seminar2-assignment/Assets.xcassets/temperature_bar_image4.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/temperature_bar_image4.imageset/Contents.json new file mode 100644 index 0000000..1416eb2 --- /dev/null +++ b/seminar2-assignment/Assets.xcassets/temperature_bar_image4.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "temperature_bar_image4.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/seminar2-assignment/Assets.xcassets/temperature_bar_image4.imageset/temperature_bar_image4.png b/seminar2-assignment/Assets.xcassets/temperature_bar_image4.imageset/temperature_bar_image4.png new file mode 100644 index 0000000..16c9a04 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/temperature_bar_image4.imageset/temperature_bar_image4.png differ diff --git a/seminar2-assignment/Assets.xcassets/temperature_bar_image5.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/temperature_bar_image5.imageset/Contents.json new file mode 100644 index 0000000..9039d35 --- /dev/null +++ b/seminar2-assignment/Assets.xcassets/temperature_bar_image5.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "temperature_bar_image5.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/seminar2-assignment/Assets.xcassets/temperature_bar_image5.imageset/temperature_bar_image5.png b/seminar2-assignment/Assets.xcassets/temperature_bar_image5.imageset/temperature_bar_image5.png new file mode 100644 index 0000000..af1384c Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/temperature_bar_image5.imageset/temperature_bar_image5.png differ diff --git a/seminar2-assignment/Assets.xcassets/temperature_bar_image6.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/temperature_bar_image6.imageset/Contents.json new file mode 100644 index 0000000..f83f64d --- /dev/null +++ b/seminar2-assignment/Assets.xcassets/temperature_bar_image6.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "temperature_bar_image6.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/seminar2-assignment/Assets.xcassets/temperature_bar_image6.imageset/temperature_bar_image6.png b/seminar2-assignment/Assets.xcassets/temperature_bar_image6.imageset/temperature_bar_image6.png new file mode 100644 index 0000000..e901e7d Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/temperature_bar_image6.imageset/temperature_bar_image6.png differ diff --git a/seminar2-assignment/Assets.xcassets/temperature_bar_image7.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/temperature_bar_image7.imageset/Contents.json new file mode 100644 index 0000000..f817bef --- /dev/null +++ b/seminar2-assignment/Assets.xcassets/temperature_bar_image7.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "temperature_bar_image7.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/seminar2-assignment/Assets.xcassets/temperature_bar_image7.imageset/temperature_bar_image7.png b/seminar2-assignment/Assets.xcassets/temperature_bar_image7.imageset/temperature_bar_image7.png new file mode 100644 index 0000000..6191d7f Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/temperature_bar_image7.imageset/temperature_bar_image7.png differ diff --git a/seminar2-assignment/Assets.xcassets/temperature_bar_image8.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/temperature_bar_image8.imageset/Contents.json new file mode 100644 index 0000000..934dfeb --- /dev/null +++ b/seminar2-assignment/Assets.xcassets/temperature_bar_image8.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "temperature_bar_image8.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/seminar2-assignment/Assets.xcassets/temperature_bar_image8.imageset/temperature_bar_image8.png b/seminar2-assignment/Assets.xcassets/temperature_bar_image8.imageset/temperature_bar_image8.png new file mode 100644 index 0000000..6191d7f Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/temperature_bar_image8.imageset/temperature_bar_image8.png differ diff --git a/seminar2-assignment/Assets.xcassets/temperature_bar_image9.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/temperature_bar_image9.imageset/Contents.json new file mode 100644 index 0000000..8fbce32 --- /dev/null +++ b/seminar2-assignment/Assets.xcassets/temperature_bar_image9.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "temperature_bar_image9.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/seminar2-assignment/Assets.xcassets/temperature_bar_image9.imageset/temperature_bar_image9.png b/seminar2-assignment/Assets.xcassets/temperature_bar_image9.imageset/temperature_bar_image9.png new file mode 100644 index 0000000..3cd5dc8 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/temperature_bar_image9.imageset/temperature_bar_image9.png differ diff --git a/seminar2-assignment/Assets.xcassets/thunder.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/thunder.imageset/Contents.json deleted file mode 100644 index 7286438..0000000 --- a/seminar2-assignment/Assets.xcassets/thunder.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "filename" : "Frame 5.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "Frame 5@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "Frame 5@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/seminar2-assignment/Assets.xcassets/thunder.imageset/Frame 5.png b/seminar2-assignment/Assets.xcassets/thunder.imageset/Frame 5.png deleted file mode 100644 index e96bdc5..0000000 Binary files a/seminar2-assignment/Assets.xcassets/thunder.imageset/Frame 5.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/thunder.imageset/Frame 5@2x.png b/seminar2-assignment/Assets.xcassets/thunder.imageset/Frame 5@2x.png deleted file mode 100644 index 01ea1c4..0000000 Binary files a/seminar2-assignment/Assets.xcassets/thunder.imageset/Frame 5@2x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/thunder.imageset/Frame 5@3x.png b/seminar2-assignment/Assets.xcassets/thunder.imageset/Frame 5@3x.png deleted file mode 100644 index 6b1c200..0000000 Binary files a/seminar2-assignment/Assets.xcassets/thunder.imageset/Frame 5@3x.png and /dev/null differ diff --git a/seminar2-assignment/Assets.xcassets/thunderstorms_image.imageset/Contents.json b/seminar2-assignment/Assets.xcassets/thunderstorms_image.imageset/Contents.json new file mode 100644 index 0000000..07ccdb1 --- /dev/null +++ b/seminar2-assignment/Assets.xcassets/thunderstorms_image.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "cloudBolt.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "cloudBolt@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "cloudBolt@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/seminar2-assignment/Assets.xcassets/thunderstorms_image.imageset/cloudBolt.png b/seminar2-assignment/Assets.xcassets/thunderstorms_image.imageset/cloudBolt.png new file mode 100644 index 0000000..22870e0 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/thunderstorms_image.imageset/cloudBolt.png differ diff --git a/seminar2-assignment/Assets.xcassets/thunderstorms_image.imageset/cloudBolt@2x.png b/seminar2-assignment/Assets.xcassets/thunderstorms_image.imageset/cloudBolt@2x.png new file mode 100644 index 0000000..3163077 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/thunderstorms_image.imageset/cloudBolt@2x.png differ diff --git a/seminar2-assignment/Assets.xcassets/thunderstorms_image.imageset/cloudBolt@3x.png b/seminar2-assignment/Assets.xcassets/thunderstorms_image.imageset/cloudBolt@3x.png new file mode 100644 index 0000000..f5d69e6 Binary files /dev/null and b/seminar2-assignment/Assets.xcassets/thunderstorms_image.imageset/cloudBolt@3x.png differ diff --git a/seminar2-assignment/CurrentWeatherDataModel.swift b/seminar2-assignment/CurrentWeatherDataModel.swift new file mode 100644 index 0000000..60d257b --- /dev/null +++ b/seminar2-assignment/CurrentWeatherDataModel.swift @@ -0,0 +1,67 @@ +// +// CurrentWeatherDataModel.swift +// seminar2-assignment +// +// Created by Hyori Choi on 11/14/23. +// + +import Foundation + +// MARK: - CurrentWeatherDataModel +struct CurrentWeatherDataModel: Codable { + let coord: Coord + let weather: [Weather] + let base: String + let main: Main + let visibility: Int + let wind: Wind + let clouds: Clouds + let dt: Int + let sys: Sys + let timezone, id: Int + let name: String + let cod: Int +} + +// MARK: - Clouds +struct Clouds: Codable { + let all: Int +} + +// MARK: - Coord +struct Coord: Codable { + let lon, lat: Double +} + +// MARK: - Main +struct Main: Codable { + let temp, feelsLike, tempMin, tempMax: Double + let pressure, humidity: Int + + enum CodingKeys: String, CodingKey { + case temp + case feelsLike = "feels_like" + case tempMin = "temp_min" + case tempMax = "temp_max" + case pressure, humidity + } +} + +// MARK: - Sys +struct Sys: Codable { + let type, id: Int? + let country: String + let sunrise, sunset: Int +} + +// MARK: - Weather +struct Weather: Codable { + let id: Int + let main, description, icon: String +} + +// MARK: - Wind +struct Wind: Codable { + let speed: Double + let deg: Int +} diff --git a/seminar2-assignment/CurrentWeatherService.swift b/seminar2-assignment/CurrentWeatherService.swift new file mode 100644 index 0000000..127ee98 --- /dev/null +++ b/seminar2-assignment/CurrentWeatherService.swift @@ -0,0 +1,65 @@ +// +// CurrentWeatherService.swift +// seminar2-assignment +// +// Created by Hyori Choi on 11/14/23. +// + +import Foundation + +class CurrentWeatherService { + + static let shared = CurrentWeatherService() + private init() {} + + func makeRequest(location: String) -> URLRequest { + let apiKey = Bundle.main.object(forInfoDictionaryKey: "API_KEY") as? String + let url = URL(string: "https://api.openweathermap.org/data/2.5/weather?q=\(location)&appid=\(apiKey!)")! + var request = URLRequest(url: url) + request.httpMethod = "GET" + let header = ["Content-Type": "application/json"] + header.forEach { + request.addValue($0.value, forHTTPHeaderField: $0.key) + } + return request + } + + func GetCurrentWeatherData(location: String) async throws -> CurrentWeatherDataModel { + do { + let request = self.makeRequest(location: location) + let (data, response) = try await URLSession.shared.data(for: request) + dump(request) + guard let httpResponse = response as? HTTPURLResponse else { + throw NetworkError.responseError + } + dump(response) + guard let parseData = parseCurrentWeatherData(data: data) + else { + throw NetworkError.responseDecodingError + } + return parseData + } catch { + throw error + } + + } + + + private func parseCurrentWeatherData(data: Data) -> CurrentWeatherDataModel? { + do { + let jsonDecoder = JSONDecoder() + let result = try jsonDecoder.decode(CurrentWeatherDataModel.self, from: data) + return result + } catch { + print(error) + return nil + } + } + + private func configureHTTPError(errorCode: Int) -> Error { + return NetworkError(rawValue: errorCode) + ?? NetworkError.unknownError + } + +} + diff --git a/seminar2-assignment/CustomTableHeaderView.swift b/seminar2-assignment/CustomTableHeaderView.swift new file mode 100644 index 0000000..558bd7c --- /dev/null +++ b/seminar2-assignment/CustomTableHeaderView.swift @@ -0,0 +1,68 @@ +// +// CustomTableHeaderView.swift +// seminar2-assignment +// +// Created by Hyori Choi on 11/14/23. +// + +import UIKit + +import SnapKit +import Then + +class CustomTableHeaderView: UITableViewHeaderFooterView { + + static let identifier: String = "CustomTableHeaderView" + + let calendarImageView = UIImageView() + let titleLabel = UILabel() + + override init(reuseIdentifier: String?) { + super.init(reuseIdentifier: reuseIdentifier) + self.setUI() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + +} + +extension CustomTableHeaderView { + + private func setUI() { + setStyle() + setLayout() + } + + private func setStyle() { + calendarImageView.do { + $0.image = UIImage(systemName: "calendar") + $0.tintColor = UIColor.white.withAlphaComponent(0.3) + } + + titleLabel.do { + $0.text = "10일간의 일기예보" + $0.textColor = UIColor.white.withAlphaComponent(0.3) + $0.font = UIFont(name: "SFProDisplay-Regular", size: 14) + } + } + + private func setLayout() { + [calendarImageView, titleLabel].forEach { + addSubview($0) + } + + calendarImageView.snp.makeConstraints { + $0.leading.equalToSuperview().inset(20) + $0.centerY.equalToSuperview() + $0.size.equalTo(17) + } + + titleLabel.snp.makeConstraints { + $0.leading.equalTo(calendarImageView.snp.trailing).offset(5) + $0.centerY.equalToSuperview() + } + } + +} diff --git a/seminar2-assignment/Fonts/SF-Pro-Display-Medium.otf b/seminar2-assignment/Fonts/SF-Pro-Display-Medium.otf new file mode 100755 index 0000000..cf88e12 Binary files /dev/null and b/seminar2-assignment/Fonts/SF-Pro-Display-Medium.otf differ diff --git a/seminar2-assignment/Fonts/SF-Pro-Display-Regular.otf b/seminar2-assignment/Fonts/SF-Pro-Display-Regular.otf new file mode 100755 index 0000000..ef46a6a Binary files /dev/null and b/seminar2-assignment/Fonts/SF-Pro-Display-Regular.otf differ diff --git a/seminar2-assignment/Fonts/SF-Pro-Display-Thin.otf b/seminar2-assignment/Fonts/SF-Pro-Display-Thin.otf new file mode 100755 index 0000000..57dd502 Binary files /dev/null and b/seminar2-assignment/Fonts/SF-Pro-Display-Thin.otf differ diff --git a/seminar2-assignment/Fonts/SF-Pro-Italic.ttf b/seminar2-assignment/Fonts/SF-Pro-Italic.ttf new file mode 100755 index 0000000..f94665a Binary files /dev/null and b/seminar2-assignment/Fonts/SF-Pro-Italic.ttf differ diff --git a/seminar2-assignment/Fonts/SF-Pro.ttf b/seminar2-assignment/Fonts/SF-Pro.ttf new file mode 100755 index 0000000..60ea3e7 Binary files /dev/null and b/seminar2-assignment/Fonts/SF-Pro.ttf differ diff --git a/seminar2-assignment/Info.plist b/seminar2-assignment/Info.plist index fe5bef1..74c1320 100644 --- a/seminar2-assignment/Info.plist +++ b/seminar2-assignment/Info.plist @@ -10,8 +10,8 @@ SF-Pro-Display-Regular.otf SF-Pro-Display-Thin.otf - CFBundleIdentifier - + API_KEY + $(API_KEY) UIApplicationSceneManifest UIApplicationSupportsMultipleScenes diff --git a/seminar2-assignment/NetworkError.swift b/seminar2-assignment/NetworkError.swift new file mode 100644 index 0000000..77275ca --- /dev/null +++ b/seminar2-assignment/NetworkError.swift @@ -0,0 +1,31 @@ +// +// NetworkError.swift +// seminar2-assignment +// +// Created by Hyori Choi on 11/14/23. +// + +import Foundation + +enum NetworkError: Int, Error, CustomStringConvertible { + var description: String { self.errorDescription } + case requstEncodingError + case responseDecodingError + case responseError + case unknownError + case clientError = 400 + case serverError = 500 + case notFoundError = 404 + + var errorDescription: String { + switch self { + case .clientError: return "400:CLIENT_ERROR" + case .requstEncodingError: return "REQUEST_ENCODING_ERROR" + case .responseError: return "RESPONSE_ERROR" + case .responseDecodingError: return "RESPONSE_DECODING_ERROR" + case .unknownError: return "UNKNOWN_ERROR" + case .serverError: return "500:SERVER_ERROR" + case .notFoundError: return "404:NOT_FOUND_ERROR" + } + } +} diff --git a/seminar2-assignment/SceneDelegate.swift b/seminar2-assignment/SceneDelegate.swift index d1befe5..2b2eedf 100644 --- a/seminar2-assignment/SceneDelegate.swift +++ b/seminar2-assignment/SceneDelegate.swift @@ -19,7 +19,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { guard let windowScene = (scene as? UIWindowScene) else { return } let window = UIWindow(windowScene: windowScene) - window.rootViewController = ViewController() + window.rootViewController = UINavigationController(rootViewController: ViewController()) window.makeKeyAndVisible() self.window = window } diff --git a/seminar2-assignment/Secrets.xcconfig b/seminar2-assignment/Secrets.xcconfig new file mode 100644 index 0000000..6c21d23 --- /dev/null +++ b/seminar2-assignment/Secrets.xcconfig @@ -0,0 +1,11 @@ +// +// Secrets.xcconfig +// seminar2-assignment +// +// Created by Hyori Choi on 11/14/23. +// + +// Configuration settings file format documentation can be found at: +// https://help.apple.com/xcode/#/dev745c5c974 + +API_KEY = 17c352b1e494be918b7b160d6284cd9c diff --git a/seminar2-assignment/TimelyWeatherCollectionViewCell.swift b/seminar2-assignment/TimelyWeatherCollectionViewCell.swift new file mode 100644 index 0000000..3d16819 --- /dev/null +++ b/seminar2-assignment/TimelyWeatherCollectionViewCell.swift @@ -0,0 +1,101 @@ +// +// TimelyWeatherCollectionViewCell.swift +// seminar2-assignment +// +// Created by Hyori Choi on 11/14/23. +// + +import UIKit + +import SnapKit +import Then + +class TimelyWeatherCollectionViewCell: UICollectionViewCell { + + static let identifier: String = "TimelyWeatherCollectionViewCell" + + private let stackView = UIStackView() + private let timeLabel = UILabel() + private let weatherImageView = UIImageView() + private let temperatureLabel = UILabel() + + override init(frame: CGRect) { + super.init(frame: frame) + self.setUI() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + +} + +extension TimelyWeatherCollectionViewCell { + + private func setUI() { + setStyle() + setLayout() + } + + private func setStyle() { + stackView.do { + $0.axis = .vertical + $0.alignment = .center + $0.distribution = .equalSpacing } + + timeLabel.do { + $0.textColor = .white + $0.font = UIFont(name: "SFProDisplay-Medium", size: 16) + } + + weatherImageView.do { + $0.contentMode = .scaleAspectFit + } + + temperatureLabel.do { + $0.textColor = .white + $0.font = UIFont(name: "SFProDisplay-Medium", size: 18) + } + } + + private func setLayout() { + contentView.addSubview(stackView) + + stackView.snp.makeConstraints { + $0.top.bottom.equalToSuperview().inset(20) + $0.leading.trailing.equalToSuperview() + } + + [timeLabel, weatherImageView, temperatureLabel].forEach { + stackView.addArrangedSubview($0) + } + + weatherImageView.snp.makeConstraints { + $0.size.equalTo(20) + } + } + + func bindData(data: TimelyWeatherListData) { + timeLabel.text = "\(data.time)" + setWeatherImage(weather: data.weather) + temperatureLabel.text = "\(data.temperatue)°" + } + + private func setWeatherImage(weather: String) { + switch weather { + case "흐림": + weatherImageView.image = UIImage(named: "cloudy_image") + case "폭우": + weatherImageView.image = UIImage(named: "heavy_rain_image") + case "다소 흐림": + weatherImageView.image = UIImage(named: "party_cloudy_image") + case "비": + weatherImageView.image = UIImage(named: "rain_image") + case "번개": + weatherImageView.image = UIImage(named: "thunderstorms_image") + default: + weatherImageView.image = UIImage(named: "cloudy_image") + } + } + +} diff --git a/seminar2-assignment/TimelyWeatherListData.swift b/seminar2-assignment/TimelyWeatherListData.swift new file mode 100644 index 0000000..e2b8170 --- /dev/null +++ b/seminar2-assignment/TimelyWeatherListData.swift @@ -0,0 +1,35 @@ +// +// TimelyWeatherListData.swift +// seminar2-assignment +// +// Created by Hyori Choi on 11/14/23. +// + +import Foundation + +struct TimelyWeatherListData { + let time: String + let weather: String + let temperatue: Int + + init(time: String, weather: String, temperature: Int) { + self.time = time + self.weather = weather + self.temperatue = temperature + } +} + +var timelyWeatherListData: [TimelyWeatherListData] = [ + .init(time: "지금", weather: "흐림", temperature: 9), + .init(time: "오후 12시", weather: "폭우", temperature: 10), + .init(time: "오후 1시", weather: "비", temperature: 11), + .init(time: "오후 2시", weather: "다소 흐림", temperature: 12), + .init(time: "오후 3시", weather: "흐림", temperature: 11), + .init(time: "오후 4시", weather: "폭우", temperature: 10), + .init(time: "오후 5시", weather: "흐림", temperature: 10), + .init(time: "오후 6시", weather: "흐림", temperature: 10), + .init(time: "오후 7시", weather: "흐림", temperature: 10), + .init(time: "오후 8시", weather: "흐림", temperature: 9), + .init(time: "오후 9시", weather: "흐림", temperature: 9), + .init(time: "오후 10시", weather: "흐림", temperature: 9), +] diff --git a/seminar2-assignment/ViewController.swift b/seminar2-assignment/ViewController.swift index 8819954..b2f5df6 100644 --- a/seminar2-assignment/ViewController.swift +++ b/seminar2-assignment/ViewController.swift @@ -7,195 +7,157 @@ import UIKit +import SnapKit +import Then + class ViewController: UIViewController { - let scrollView: UIScrollView = { - let scrollView = UIScrollView() - scrollView.translatesAutoresizingMaskIntoConstraints = false - return scrollView - }() - - - @objc func tapCodePushButton() { - // let vc = WeatherViewController() - // - // self.navigationController?.pushViewController(vc, animated: true) - let svc = WeatherViewController() - svc.modalPresentationStyle = .fullScreen - self.present(svc, animated: true, completion: nil) + + private lazy var rightBarButtonItem = UIBarButtonItem() + private let locationSearchController = UISearchController() + private let tableView = UITableView(frame: .zero, style: .plain) + var searchWeatherInfoListData = weatherInfoListData + + override func viewDidLoad() { + super.viewDidLoad() + self.view.backgroundColor = .black + self.setNavigation() + self.setUI() + self.setSearchController() + Task { + await fetchWeatherInfo() + } + self.setTableViewConfig() } - private var buttonWithImage: UIButton = { - let buttonView = UIButton() - buttonView.translatesAutoresizingMaskIntoConstraints = false - buttonView.setImage(UIImage(named: "backgroundS"), for: .normal) + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + self.navigationController?.navigationBar.isHidden = false + self.navigationItem.searchController?.searchBar.isHidden = false + } + +} - - let myLocationLabel = UILabel() - myLocationLabel.text = "나의 위치" - myLocationLabel.font = UIFont(name: "SFProDisplay-Bold", size: 34) - myLocationLabel.textColor = .white - - let locationLabel = UILabel() - locationLabel.text = "의정부시" - locationLabel.font = UIFont(name: "SFProDisplay-Bold", size: 17) - locationLabel.textColor = .white - - let weatherLabel = UILabel() - weatherLabel.text = "흐림" - weatherLabel.font = UIFont(name: "SFProDisplay-Bold", size: 16) - weatherLabel.textColor = .white - - let temperatureLabel = UILabel() - temperatureLabel.text = "21°" - temperatureLabel.font = UIFont(name: "SFProDisplay-Light", size: 52) - temperatureLabel.textColor = .white - - let maxmin = UILabel() - maxmin.text = "최고: 29° 최저: 15°" - maxmin.font = UIFont(name: "SFProDisplay-Bold", size: 15) - maxmin.textColor = .white - - - [myLocationLabel, locationLabel, weatherLabel, temperatureLabel, maxmin].forEach{ - $0.translatesAutoresizingMaskIntoConstraints = false - buttonView.addSubview($0) +extension ViewController { + + private func setUI() { + setStyle() + setLayout() + } + + private func setStyle() { + rightBarButtonItem.do { + $0.isHidden = false + $0.image = UIImage(named: "ellipsis_image") + $0.tintColor = .white } - NSLayoutConstraint.activate([myLocationLabel.topAnchor.constraint(equalTo: buttonView.topAnchor, constant: 15), - myLocationLabel.leadingAnchor.constraint(equalTo: buttonView.leadingAnchor, constant: 40)]) - NSLayoutConstraint.activate([locationLabel.topAnchor.constraint(equalTo: buttonView.topAnchor, constant: 55), - locationLabel .leadingAnchor.constraint(equalTo: buttonView.leadingAnchor, constant: 40)]) - NSLayoutConstraint.activate([weatherLabel.topAnchor.constraint(equalTo: buttonView.topAnchor, constant: 87), - weatherLabel.leadingAnchor.constraint(equalTo: buttonView.leadingAnchor, constant: 40)]) - NSLayoutConstraint.activate([temperatureLabel.topAnchor.constraint(equalTo: buttonView.topAnchor, constant: 4), - temperatureLabel.leadingAnchor.constraint(equalTo: buttonView.leadingAnchor, constant: 280)]) - NSLayoutConstraint.activate([maxmin.topAnchor.constraint(equalTo: buttonView.topAnchor, constant: 87), - maxmin.leadingAnchor.constraint(equalTo: weatherLabel.leadingAnchor, constant: 200)]) - - buttonView.addTarget(self, action: #selector(tapCodePushButton), for: .touchUpInside) - - return buttonView -}() - override func viewDidLoad() { - super.viewDidLoad() - self.view.backgroundColor = .black - - - self.view.addSubview(navigationBar) - self.view.addSubview(scrollView) - scrollView.addSubview(buttonWithImage) - - navigationBar.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor).isActive = true - navigationBar.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true - navigationBar.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true - - let navItem = UINavigationItem() - - let rightButton = UIBarButtonItem(image: UIImage(named: "more"), style: .plain, target: self, action: nil) - rightButton.tintColor = .white - navItem.rightBarButtonItem = rightButton - - let titleLabel = UILabel() - titleLabel.text = "날씨" - titleLabel.textColor = .white - titleLabel.font = UIFont(name: "SFProDisplay-Bold", size: 40) - titleLabel.sizeToFit() - - - - - let leftPaddingView = UIView(frame: CGRect(x: 0, y: 0, width: 6, height: titleLabel.frame.size.height)) - let titleContainerView = UIView() - titleContainerView.addSubview(leftPaddingView) - titleContainerView.addSubview(titleLabel) - titleContainerView.translatesAutoresizingMaskIntoConstraints = false - let searchController = UISearchController(searchResultsController: nil) - searchController.hidesNavigationBarDuringPresentation = false - searchController.obscuresBackgroundDuringPresentation = false - searchController.searchBar.tintColor = .white - searchController.searchBar.searchBarStyle = .minimal - searchController.searchBar.placeholder = "도시 또는 공항 검색" - self.navigationItem.searchController = searchController - self.definesPresentationContext = true - - navItem.titleView = titleContainerView - - // Add the search bar below the title - navItem.searchController = searchController - - navigationBar.setItems([navItem], animated: true) - - NSLayoutConstraint.activate([ - scrollView.topAnchor.constraint(equalTo: navigationBar.bottomAnchor), scrollView.leadingAnchor.constraint(equalTo: view.leadingAnchor), - scrollView.trailingAnchor.constraint(equalTo: view.trailingAnchor), - scrollView.bottomAnchor.constraint(equalTo: view.bottomAnchor), - - buttonWithImage.topAnchor.constraint(equalTo: scrollView.topAnchor), - buttonWithImage.leadingAnchor.constraint(equalTo: scrollView.leadingAnchor), - buttonWithImage.widthAnchor.constraint(equalTo: scrollView.widthAnchor), - buttonWithImage.heightAnchor.constraint(equalToConstant: 117) - ]) + locationSearchController.do { + $0.searchBar.searchTextField.attributedPlaceholder = NSAttributedString(string: "도시 또는 공항 검색", attributes: [NSAttributedString.Key.foregroundColor : #colorLiteral(red: 0.6178889275, green: 0.6178889275, blue: 0.6178889275, alpha: 1)]) + $0.searchBar.searchTextField.backgroundColor = #colorLiteral(red: 0.1353607476, green: 0.1353607476, blue: 0.1353607476, alpha: 1) + $0.searchBar.searchTextField.textColor = .white + $0.searchBar.tintColor = .white + $0.searchBar.setValue("취소", forKey: "cancelButtonText") + $0.hidesNavigationBarDuringPresentation = true } - let navigationBar: UINavigationBar = { - let navigationBar = UINavigationBar() - navigationBar.translatesAutoresizingMaskIntoConstraints = false - return navigationBar - }() - private var leftStackView: UIStackView = { - let stackView = UIStackView() - stackView.axis = .vertical - stackView.distribution = .fillEqually - stackView.spacing = 0 - return stackView - }() - - - private var rightStackView: UIStackView = { - let stackView = UIStackView() - stackView.axis = .vertical - stackView.distribution = .fillEqually - stackView.spacing = 0 - return stackView - }() - private var scrollView1 : UIScrollView = { - let view = UIScrollView() - // view.backgroundColor = .blue - return view - }() - private var contentView : UIView = { - let view = UIView() - // view.backgroundColor = .green - return view - }() - + tableView.do { + $0.backgroundColor = .black + $0.separatorStyle = .none + } + } + + private func setLayout() { + self.view.addSubview(tableView) - - private func setLayout() { - self.view.addSubview(scrollView) - - scrollView.addSubview(contentView) - scrollView.translatesAutoresizingMaskIntoConstraints = false - contentView.translatesAutoresizingMaskIntoConstraints = false - - NSLayoutConstraint.activate([ - scrollView.topAnchor.constraint(equalTo: self.view.topAnchor), - scrollView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor), - scrollView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor), - scrollView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor) - ]) - - NSLayoutConstraint.activate([ - contentView.leadingAnchor.constraint(equalTo: scrollView.contentLayoutGuide.leadingAnchor), - contentView.trailingAnchor.constraint(equalTo: scrollView.contentLayoutGuide.trailingAnchor), - contentView.topAnchor.constraint(equalTo: scrollView.contentLayoutGuide.topAnchor), - contentView.bottomAnchor.constraint(equalTo: scrollView.contentLayoutGuide.bottomAnchor), - contentView.widthAnchor.constraint(equalTo: scrollView.widthAnchor), - contentView.heightAnchor.constraint(greaterThanOrEqualTo: view.heightAnchor) - ]) - - + tableView.snp.makeConstraints { + $0.top.bottom.equalTo(self.view.safeAreaLayoutGuide) + $0.leading.trailing.equalToSuperview().inset(16) } + } + + private func setNavigation() { + self.navigationItem.rightBarButtonItem = rightBarButtonItem + self.navigationItem.title = "날씨" + self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white] + self.navigationController?.navigationBar.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white] + self.navigationController?.navigationBar.barTintColor = .black + self.navigationController?.navigationBar.prefersLargeTitles = true + } + + private func setSearchController() { + self.navigationItem.searchController = locationSearchController + self.navigationItem.hidesSearchBarWhenScrolling = false + self.locationSearchController.searchBar.searchTextField.textColor = .white + self.locationSearchController.searchBar.searchTextField.leftView?.tintColor = #colorLiteral(red: 0.6178889275, green: 0.6178889275, blue: 0.6178889275, alpha: 1) + self.locationSearchController.searchResultsUpdater = self + } + + private func setTableViewConfig() { + self.tableView.register(WeatherInfoTableViewCell.self, + forCellReuseIdentifier: WeatherInfoTableViewCell.identifier) + self.tableView.delegate = self + self.tableView.dataSource = self + } + + private func fetchWeatherInfo() async { + let locations = ["seoul", "daegu", "ulsan", "chuncheon", "jeju"] -}; + for location in locations { + do { + let currentWeather = try await CurrentWeatherService.shared.GetCurrentWeatherData(location: location) + let weatherInfo = WeatherInfoListData(location: currentWeather.name, timezone: currentWeather.timezone, weather: currentWeather.weather[0].main, temperature: currentWeather.main.temp, maxTemperature: currentWeather.main.tempMax, minTemperature: currentWeather.main.tempMin) + weatherInfoListData.append(weatherInfo) + searchWeatherInfoListData = weatherInfoListData + } catch { + print(error) + } + } + tableView.reloadData() + } + +} + +extension ViewController: UITableViewDelegate { + + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + return 135 + } + + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + let weatherDetailedInfoPageVC = WeatherDetailedInfoPageVC() + weatherDetailedInfoPageVC.initialPage = weatherInfoListData.firstIndex(of: searchWeatherInfoListData[indexPath.row])! + self.navigationController?.pushViewController(weatherDetailedInfoPageVC, animated: true) + } + +} + + +extension ViewController: UITableViewDataSource { + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return searchWeatherInfoListData.count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + guard let cell = tableView.dequeueReusableCell(withIdentifier: WeatherInfoTableViewCell.identifier, + for: indexPath) as? WeatherInfoTableViewCell else {return UITableViewCell()} + cell.backgroundColor = UIColor.black.withAlphaComponent(0.1) + cell.selectionStyle = .none + cell.bindData(data: searchWeatherInfoListData[indexPath.row]) + return cell + } + +} + +extension ViewController: UISearchResultsUpdating { + func updateSearchResults(for searchController: UISearchController) { + guard let searchText = searchController.searchBar.text else { return } + if searchText.isEmpty { + searchWeatherInfoListData = weatherInfoListData + } else { + searchWeatherInfoListData = weatherInfoListData.filter { $0.location.lowercased().contains(searchText.lowercased()) } + } + tableView.reloadData() + } +} diff --git a/seminar2-assignment/WeatherBriefingView.swift b/seminar2-assignment/WeatherBriefingView.swift new file mode 100644 index 0000000..b425514 --- /dev/null +++ b/seminar2-assignment/WeatherBriefingView.swift @@ -0,0 +1,72 @@ +// +// WeatherBriefingView.swift +// seminar2-assignment +// +// Created by Hyori Choi on 11/14/23. +// + +import UIKit + +import SnapKit +import Then + +class WeatherBriefingView: UIView { + + private let descriptionLabel = UILabel() + private let lineView = UIView() + + init() { + super.init(frame: .zero) + self.setUI() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + +} + +extension WeatherBriefingView { + + private func setUI() { + setStyle() + setLayout() + } + + private func setStyle() { + descriptionLabel.do { + $0.numberOfLines = 0 + $0.textColor = .white + $0.font = UIFont(name: "SFProDisplay-Regular", size: 16) + } + + lineView.do { + $0.backgroundColor = UIColor.white.withAlphaComponent(0.3) + } + } + + private func setLayout() { + [descriptionLabel, lineView].forEach { + addSubview($0) + } + + descriptionLabel.snp.makeConstraints { + $0.top.leading.trailing.equalToSuperview() + } + + self.snp.makeConstraints { + $0.bottom.equalTo(descriptionLabel.snp.bottom).offset(10) + } + + lineView.snp.makeConstraints { + $0.bottom.equalToSuperview() + $0.leading.trailing.equalToSuperview() + $0.height.equalTo(1) + } + } + + func bindData(text: String) { + descriptionLabel.text = text + } + +} diff --git a/seminar2-assignment/WeatherDetailedInfoPageVC.swift b/seminar2-assignment/WeatherDetailedInfoPageVC.swift new file mode 100644 index 0000000..c65ef28 --- /dev/null +++ b/seminar2-assignment/WeatherDetailedInfoPageVC.swift @@ -0,0 +1,158 @@ +// +// WeatherDetailedInfoPageVC.swift +// seminar2-assignment +// +// Created by Hyori Choi on 11/14/23. +// +import UIKit + +import SnapKit +import Then + +class WeatherDetailedInfoPageVC: UIPageViewController { + + var initialPage = 0 + + private var pages = [UIViewController]() + private let pageControl = UIPageControl() + private let toolbar = UIToolbar(frame: CGRect(x: 0, y: 0, width: 100, height: 100)) + private let lineView = UIView() + private let mapButton = UIButton() + private let listButton = UIButton() + + init() { + super.init(transitionStyle: .scroll, navigationOrientation: .horizontal, options: nil) + } + + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func viewDidLoad() { + super.viewDidLoad() + self.setPage() + self.setDelegate() + self.setUI() + self.setToolBar() + self.setAddTarget() + } + +} + +extension WeatherDetailedInfoPageVC { + + private func setPage() { + for i in 0.. UIViewController? { + guard let currentIndex = pages.firstIndex(of: viewController) else { return nil } + + guard currentIndex > 0 else { return nil } + return pages[currentIndex - 1] + } + + func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController? { + guard let currentIndex = pages.firstIndex(of: viewController) else { return nil } + + guard currentIndex < (pages.count - 1) else { return nil } + return pages[currentIndex + 1] + } + +} + +extension WeatherDetailedInfoPageVC: UIPageViewControllerDelegate { + + func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) { + guard completed else { return } + if let currentViewController = viewControllers?.first, + let currentIndex = pages.firstIndex(of: currentViewController) { + pageControl.currentPage = currentIndex + } + } + +} diff --git a/seminar2-assignment/WeatherDetailedInfoVC.swift b/seminar2-assignment/WeatherDetailedInfoVC.swift new file mode 100644 index 0000000..ffd1983 --- /dev/null +++ b/seminar2-assignment/WeatherDetailedInfoVC.swift @@ -0,0 +1,200 @@ +// +// WeatherDetailedInfoVC.swift +// seminar2-assignment +// +// Created by Hyori Choi on 11/14/23. +// + +import UIKit + +import SnapKit +import Then + +class WeatherDetailedInfoVC: UIViewController { + + private let verticalScrollView = UIScrollView() + private var contentView = UIView() + private let weatherDetailedInfoView = WeatherDetailedInfoView() + private let descriptionView = UIView() + private let weatherBriefingView = WeatherBriefingView() + private let collectionView = UICollectionView(frame: .zero, collectionViewLayout: UICollectionViewFlowLayout()) + private let tableView = UITableView(frame: .zero, style: .plain) + + override func viewDidLoad() { + super.viewDidLoad() + self.navigationController?.navigationBar.isHidden = true + self.setBackgroundImage() + self.setCollectionViewConfig() + self.setTableViewConfig() + self.setUI() + } + +} + +extension WeatherDetailedInfoVC { + + private func setUI() { + setStyle() + setLayout() + } + + private func setStyle() { + verticalScrollView.do { + $0.showsVerticalScrollIndicator = false + } + + descriptionView.do { + $0.backgroundColor = UIColor.black.withAlphaComponent(0.2) + $0.layer.cornerRadius = 20 + } + + weatherBriefingView.do { + $0.bindData(text: "08:00~09:00에 강우 상태가, 18:00에 한때 흐린 상태가 예상됩니다.") + } + + collectionView.do { + $0.showsHorizontalScrollIndicator = false + $0.backgroundColor = .clear + $0.layer.cornerRadius = 20 + } + + tableView.do { + $0.sectionHeaderTopPadding = 0 + $0.showsVerticalScrollIndicator = false + $0.isScrollEnabled = false + $0.backgroundColor = .black.withAlphaComponent(0.1) + $0.layer.cornerRadius = 20 + $0.separatorStyle = .none + } + } + + private func setLayout() { + self.view.addSubview(verticalScrollView) + + verticalScrollView.snp.makeConstraints { + $0.top.leading.trailing.equalToSuperview() + $0.bottom.equalToSuperview().inset(80) + } + + verticalScrollView.addSubview(contentView) + + contentView.snp.makeConstraints { + $0.edges.equalTo(verticalScrollView) + $0.width.equalTo(verticalScrollView) + $0.height.greaterThanOrEqualTo(verticalScrollView.snp.height) + } + + [weatherDetailedInfoView, descriptionView, tableView].forEach { + contentView.addSubview($0) + } + + weatherDetailedInfoView.snp.makeConstraints { + $0.top.equalToSuperview().inset(15) + $0.height.equalTo(212) + $0.centerX.equalToSuperview() + } + + descriptionView.snp.makeConstraints { + $0.top.equalTo(weatherDetailedInfoView.snp.bottom).offset(100) + $0.leading.trailing.equalToSuperview().inset(20) + } + + [weatherBriefingView, collectionView].forEach { + descriptionView.addSubview($0) + } + + weatherBriefingView.snp.makeConstraints { + $0.top.equalTo(descriptionView).inset(10) + $0.leading.trailing.equalTo(descriptionView).inset(16) + } + + collectionView.snp.makeConstraints { + $0.top.equalTo(weatherBriefingView.snp.bottom) + $0.leading.trailing.bottom.equalTo(descriptionView) + $0.height.equalTo(120) + } + + tableView.snp.makeConstraints { + $0.top.equalTo(descriptionView.snp.bottom).offset(10) + $0.bottom.equalTo(contentView).inset(30) + $0.leading.trailing.equalToSuperview().inset(16) + $0.height.equalTo(590) + } + } + + private func setBackgroundImage() { + let backgroundImageView = UIImageView(image: UIImage(named: "background_image1")) + backgroundImageView.contentMode = .scaleAspectFill + backgroundImageView.frame = view.bounds + view.insertSubview(backgroundImageView, at: 0) + } + + private func setCollectionViewConfig() { + self.collectionView.register(TimelyWeatherCollectionViewCell.self, + forCellWithReuseIdentifier: TimelyWeatherCollectionViewCell.identifier) + self.collectionView.delegate = self + self.collectionView.dataSource = self + let flowLayout = UICollectionViewFlowLayout() + flowLayout.itemSize = CGSize(width: (UIScreen.main.bounds.width - 60) / 5 , height: 142) + flowLayout.scrollDirection = .horizontal + self.collectionView.setCollectionViewLayout(flowLayout, animated: false) + } + + private func setTableViewConfig() { + self.tableView.register(WeatherForecastTableViewCell.self, + forCellReuseIdentifier: WeatherForecastTableViewCell.identifier) + self.tableView.register(CustomTableHeaderView.self, forHeaderFooterViewReuseIdentifier: CustomTableHeaderView.identifier) + self.tableView.delegate = self + self.tableView.dataSource = self + } + + func bindData(data: WeatherInfoListData) { + weatherDetailedInfoView.bindData(data: data) + } + +} + +extension WeatherDetailedInfoVC: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout { + + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return timelyWeatherListData.count + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + guard let item = collectionView.dequeueReusableCell(withReuseIdentifier: TimelyWeatherCollectionViewCell.identifier, + for: indexPath) as? TimelyWeatherCollectionViewCell else {return UICollectionViewCell()} + item.bindData(data: timelyWeatherListData[indexPath.row]) + return item + } + +} + +extension WeatherDetailedInfoVC: UITableViewDelegate, UITableViewDataSource { + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return weatherForecastListData.count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + guard let cell = tableView.dequeueReusableCell(withIdentifier: WeatherForecastTableViewCell.identifier, + for: indexPath) as? WeatherForecastTableViewCell else {return UITableViewCell()} + cell.bindData(data: weatherForecastListData[indexPath.row]) + cell.backgroundColor = .clear + cell.selectionStyle = .none + return cell + } + + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + 55 + } + + func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { + let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: CustomTableHeaderView.identifier) as? CustomTableHeaderView + return headerView + } + + func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { + 40 + } + +} diff --git a/seminar2-assignment/WeatherDetailedInfoView.swift b/seminar2-assignment/WeatherDetailedInfoView.swift new file mode 100644 index 0000000..84df54f --- /dev/null +++ b/seminar2-assignment/WeatherDetailedInfoView.swift @@ -0,0 +1,111 @@ +// +// WeatherDetailedInfoView.swift +// seminar2-assignment +// +// Created by Hyori Choi on 11/14/23. +// + +import UIKit + +import SnapKit +import Then + +class WeatherDetailedInfoView: UIView { + + private let locationLabel: UILabel = UILabel() + private let temperatureLabel = UILabel() + private let weatherLabel = UILabel() + private let stackView = UIStackView() + private let maxTemperatureLabel = UILabel() + private let minTemperatureLabel = UILabel() + + init() { + super.init(frame: .zero) + self.setUI() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + +} + +extension WeatherDetailedInfoView { + + private func setUI() { + setStyle() + setLayout() + } + + private func setStyle() { + locationLabel.do { + $0.textColor = .white + $0.font = UIFont(name: "SFProDisplay-Medium", size: 45) + } + + temperatureLabel.do { + $0.textColor = .white + $0.font = UIFont(name: "SFProDisplay-Thin", size: 108) + } + + weatherLabel.do { + $0.textColor = .white + $0.font = UIFont(name: "SFProDisplay-Medium", size: 25) + } + + stackView.do { + $0.axis = .horizontal + $0.distribution = .fillEqually + $0.spacing = 10 + } + + maxTemperatureLabel.do { + $0.textColor = .white + $0.font = UIFont(name: "SFProDisplay-Medium", size: 23) + } + + minTemperatureLabel.do { + $0.textColor = .white + $0.font = UIFont(name: "SFProDisplay-Medium", size: 23) + } + } + + private func setLayout() { + [locationLabel, temperatureLabel, weatherLabel, stackView].forEach { + addSubview($0) + } + + locationLabel.snp.makeConstraints { + $0.top.equalToSuperview().inset(20) + $0.centerX.equalToSuperview() + } + + temperatureLabel.snp.makeConstraints { + $0.top.equalTo(locationLabel.snp.bottom) + $0.centerX.equalToSuperview().offset(10) + } + + weatherLabel.snp.makeConstraints { + $0.top.equalTo(temperatureLabel.snp.bottom) + $0.centerX.equalToSuperview() + } + + stackView.snp.makeConstraints { + $0.top.equalTo(weatherLabel.snp.bottom).offset(3) + $0.centerX.equalToSuperview() + } + + [maxTemperatureLabel, minTemperatureLabel].forEach { + stackView.addArrangedSubview($0) + } + } + + func bindData(data: WeatherInfoListData) { + self.locationLabel.text = data.location + self.temperatureLabel.text = "\(data.temperature)°" + self.weatherLabel.text = data.weather + self.maxTemperatureLabel.text = "최고:\(data.maxTemperature)°" + self.minTemperatureLabel.text = "최저:\(data.minTemperature)°" + } + +} diff --git a/seminar2-assignment/WeatherForecastListData.swift b/seminar2-assignment/WeatherForecastListData.swift new file mode 100644 index 0000000..baee0a9 --- /dev/null +++ b/seminar2-assignment/WeatherForecastListData.swift @@ -0,0 +1,39 @@ +// +// WeatherForecastListData.swift +// seminar2-assignment +// +// Created by Hyori Choi on 11/14/23. +// + +import Foundation + +struct WeatherForecastListData { + let day: String + let weather: String + let minTemperature: Int + let image: String + let maxTemperature: Int + let rainGauge: Int + + init(day: String, weather: String, minTemperature: Int, image: String, maxTemperature: Int, rainGauge: Int = 0) { + self.day = day + self.weather = weather + self.minTemperature = minTemperature + self.image = image + self.maxTemperature = maxTemperature + self.rainGauge = rainGauge + } +} + +var weatherForecastListData: [WeatherForecastListData] = [ + .init(day: "오늘", weather: "맑음", minTemperature: 15, image: "temperature_bar_image1", maxTemperature: 29), + .init(day: "월", weather: "비", minTemperature: 15, image: "temperature_bar_image2", maxTemperature: 29, rainGauge: 40), + .init(day: "화", weather: "흐림", minTemperature: 15, image: "temperature_bar_image3", maxTemperature: 29), + .init(day: "수", weather: "비", minTemperature: 15, image: "temperature_bar_image4", maxTemperature: 29, rainGauge: 30), + .init(day: "목", weather: "맑음", minTemperature: 15, image: "temperature_bar_image5", maxTemperature: 29), + .init(day: "금", weather: "비", minTemperature: 15, image: "temperature_bar_image6", maxTemperature: 29, rainGauge: 20), + .init(day: "토", weather: "흐림", minTemperature: 15, image: "temperature_bar_image7", maxTemperature: 29), + .init(day: "일", weather: "비", minTemperature: 15, image: "temperature_bar_image8", maxTemperature: 29, rainGauge: 50), + .init(day: "월", weather: "맑음", minTemperature: 15, image: "temperature_bar_image9", maxTemperature: 29), + .init(day: "화", weather: "비", minTemperature: 15, image: "temperature_bar_image10", maxTemperature: 29, rainGauge: 70), +] diff --git a/seminar2-assignment/WeatherForecastTableViewCell.swift b/seminar2-assignment/WeatherForecastTableViewCell.swift new file mode 100644 index 0000000..55c4d78 --- /dev/null +++ b/seminar2-assignment/WeatherForecastTableViewCell.swift @@ -0,0 +1,154 @@ +// +// WeatherForecastTableViewCell.swift +// seminar2-assignment +// +// Created by Hyori Choi on 11/14/23. +// + +import UIKit + +class WeatherForecastTableViewCell: UITableViewCell { + + static let identifier: String = "WeatherForecastTableViewCell" + + private let lineView = UIView() + private let dayLabel = UILabel() + private let stackView = UIStackView() + private let weatherImageView = UIImageView() + private let rainGaugeLabel = UILabel() + private let minTemperatureLabel = UILabel() + private let temperatureBarImageView = UIImageView() + private let maxTemperatureLabel = UILabel() + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + self.setUI() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + +} + +extension WeatherForecastTableViewCell { + + private func setUI() { + setStyle() + setLayout() + } + + private func setStyle() { + lineView.do { + $0.backgroundColor = UIColor.white.withAlphaComponent(0.3) + } + + dayLabel.do { + $0.textColor = .white + $0.font = UIFont(name: "SFProDisplay-Medium", size: 20) + $0.textAlignment = .left + } + + stackView.do { + $0.alignment = .center + $0.axis = .vertical + $0.spacing = 1 + } + + weatherImageView.do { + $0.contentMode = .scaleAspectFit + } + + rainGaugeLabel.do { + $0.textColor = UIColor(red: 129/255, green: 207/255, blue: 250/255, alpha: 1.0) + $0.font = UIFont(name: "SFProDisplay-Medium", size: 13) + } + + minTemperatureLabel.do { + $0.textColor = UIColor.white.withAlphaComponent(0.3) + $0.font = UIFont(name: "SFProDisplay-Regular", size: 19) + $0.textAlignment = .right + } + + temperatureBarImageView.do { + $0.contentMode = .scaleAspectFit + } + + maxTemperatureLabel.do { + $0.textColor = .white + $0.font = UIFont(name: "SFProDisplay-Regular", size: 19) + $0.textAlignment = .right + } + + } + + private func setLayout() { + [lineView, dayLabel, stackView, maxTemperatureLabel, minTemperatureLabel, temperatureBarImageView].forEach { + self.contentView.addSubview($0) + } + + lineView.snp.makeConstraints { + $0.leading.trailing.equalToSuperview().inset(20) + $0.height.equalTo(1) + } + + dayLabel.snp.makeConstraints { + $0.leading.equalToSuperview().inset(20) + $0.centerY.equalToSuperview() + $0.width.equalTo(41) + } + + stackView.snp.makeConstraints { + $0.leading.equalTo(dayLabel.snp.trailing).offset(25) + $0.centerY.equalToSuperview() + $0.width.equalTo(33) + } + + stackView.addArrangedSubview(weatherImageView) + + weatherImageView.snp.makeConstraints { + $0.width.height.equalTo(25) + } + + minTemperatureLabel.snp.makeConstraints { + $0.trailing.equalTo(temperatureBarImageView.snp.leading).offset(-5) + $0.centerY.equalToSuperview() + $0.width.equalTo(40) + } + + temperatureBarImageView.snp.makeConstraints { + $0.trailing.equalTo(maxTemperatureLabel.snp.leading).offset(-5) + $0.centerY.equalToSuperview() + } + + maxTemperatureLabel.snp.makeConstraints { + $0.trailing.equalTo(lineView) + $0.centerY.equalToSuperview() + $0.width.equalTo(40) + } + } + + func bindData(data: WeatherForecastListData) { + self.dayLabel.text = data.day + self.setWeatherImage(weather: data.weather) + self.maxTemperatureLabel.text = "\(data.maxTemperature)°" + self.temperatureBarImageView.image = UIImage(named: data.image) + self.minTemperatureLabel.text = "\(data.minTemperature)°" + self.rainGaugeLabel.text = "\(data.rainGauge)%" + } + + private func setWeatherImage(weather: String) { + switch weather { + case "맑음": + weatherImageView.image = UIImage(systemName: "sun.max.fill")?.withRenderingMode(.alwaysOriginal) + case "흐림": + weatherImageView.image = UIImage(systemName: "cloud.fill")?.withRenderingMode(.alwaysOriginal) + case "비": + weatherImageView.image = UIImage(systemName: "cloud.rain.fill")?.withRenderingMode(.alwaysOriginal) + stackView.addArrangedSubview(rainGaugeLabel) + default: + weatherImageView.image = UIImage(systemName: "sun.max.fill")?.withRenderingMode(.alwaysOriginal) + } + } + +} diff --git a/seminar2-assignment/WeatherInfoListData.swift b/seminar2-assignment/WeatherInfoListData.swift new file mode 100644 index 0000000..80dace7 --- /dev/null +++ b/seminar2-assignment/WeatherInfoListData.swift @@ -0,0 +1,42 @@ +// +// WeatherInfoListData.swift +// seminar2-assignment +// +// Created by Hyori Choi on 11/14/23. +// + +import Foundation + +struct WeatherInfoListData: Equatable { + let location: String + let time: String + let weather: String + let temperature: Int + let maxTemperature: Int + let minTemperature: Int + + init(location: String, timezone: Int, weather: String, temperature: Double, maxTemperature: Double, minTemperature: Double) { + self.location = location + self.time = convertTime(timezone: timezone) + self.weather = weather + self.temperature = convertTemperature(temperature: temperature) + self.maxTemperature = convertTemperature(temperature: maxTemperature) + self.minTemperature = convertTemperature(temperature: minTemperature) + } +} + +var weatherInfoListData: [WeatherInfoListData] = [] + +func convertTemperature(temperature: Double) -> Int { + return Int(round((temperature - 273.15))) +} + +func convertTime(timezone: Int) -> String { + let timeZone = TimeZone(secondsFromGMT: timezone) + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "HH:mm" + dateFormatter.timeZone = timeZone + let currentDate = Date() + let formattedTime = dateFormatter.string(from: currentDate) + return formattedTime +} diff --git a/seminar2-assignment/WeatherInfoTableViewCell.swift b/seminar2-assignment/WeatherInfoTableViewCell.swift new file mode 100644 index 0000000..6e8bf52 --- /dev/null +++ b/seminar2-assignment/WeatherInfoTableViewCell.swift @@ -0,0 +1,132 @@ +// +// WeatherInfoTableViewCell.swift +// seminar2-assignment +// +// Created by Hyori Choi on 11/14/23. +// +import UIKit + +import SnapKit +import Then + +class WeatherInfoTableViewCell: UITableViewCell { + + static let identifier: String = "WeatherInfoTableViewCell" + + private let backgroundImageView = UIImageView(image: UIImage(named: "background_image2")) + private let locationLabel = UILabel() + private let timeLabel = UILabel() + private let weatherLabel = UILabel() + private let temperatureLabel = UILabel() + private let maxTemperatureLabel = UILabel() + private let minTemperatureLabel = UILabel() + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + self.setUI() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func layoutSubviews() { + super.layoutSubviews() + contentView.frame = contentView.frame.inset(by: UIEdgeInsets(top: 10, left: 0, bottom: 10, right: 0)) + } + +} + +extension WeatherInfoTableViewCell { + + private func setUI() { + setStyle() + setLayout() + } + + private func setStyle() { + backgroundImageView.do { + $0.contentMode = .scaleAspectFill + } + + locationLabel.do { + $0.textColor = .white + $0.font = UIFont(name: "SFProDisplay-Bold", size: 25) + } + + timeLabel.do { + $0.textColor = .white + $0.font = UIFont(name: "SFProDisplay-Medium", size: 16) + } + + weatherLabel.do { + $0.textColor = .white + $0.font = UIFont(name: "SFProDisplay-Regular", size: 15) + } + + temperatureLabel.do { + $0.textColor = .white + $0.font = UIFont(name: "SFProDisplay-Light", size: 50) + } + + maxTemperatureLabel.do { + $0.textColor = .white + $0.font = UIFont(name: "SFProDisplay-Medium", size: 15) + } + + minTemperatureLabel.do { + $0.textColor = .white + $0.font = UIFont(name: "SFProDisplay-Medium", size: 15) + } + } + + private func setLayout() { + [backgroundImageView, locationLabel, timeLabel, weatherLabel, temperatureLabel, maxTemperatureLabel, minTemperatureLabel].forEach { + contentView.addSubview($0) + } + + backgroundImageView.snp.makeConstraints { + $0.edges.equalTo(contentView) + } + + locationLabel.snp.makeConstraints { + $0.top.equalTo(contentView).inset(7) + $0.leading.equalTo(contentView).inset(15) + } + + timeLabel.snp.makeConstraints { + $0.top.equalTo(locationLabel.snp.bottom) + $0.leading.equalTo(locationLabel.snp.leading) + } + + weatherLabel.snp.makeConstraints { + $0.bottom.equalTo(contentView).inset(7) + $0.leading.equalTo(locationLabel) + } + + temperatureLabel.snp.makeConstraints { + $0.top.equalTo(locationLabel) + $0.trailing.equalTo(contentView).inset(15) + } + + minTemperatureLabel.snp.makeConstraints { + $0.bottom.equalTo(weatherLabel) + $0.trailing.equalTo(temperatureLabel) + } + + maxTemperatureLabel.snp.makeConstraints { + $0.bottom.equalTo(weatherLabel) + $0.trailing.equalTo(minTemperatureLabel.snp.leading).offset(-5) + } + } + + func bindData(data: WeatherInfoListData) { + self.locationLabel.text = data.location + self.timeLabel.text = data.time + self.weatherLabel.text = data.weather + self.temperatureLabel.text = "\(data.temperature)°" + self.maxTemperatureLabel.text = "최고:\(data.maxTemperature)°" + self.minTemperatureLabel.text = "최저:\(data.minTemperature)°" + } + +} diff --git a/seminar2-assignment/WeatherScroll.swift b/seminar2-assignment/WeatherScroll.swift deleted file mode 100644 index f4f8e97..0000000 --- a/seminar2-assignment/WeatherScroll.swift +++ /dev/null @@ -1,54 +0,0 @@ -// -// WeatherScroll.swift -// seminar2-assignment -// -// Created by Hyori Choi on 11/10/23. -// - -import UIKit - -func weatherScroll(time: String, imageName: String, temperature: String) -> UIView { - - let itemView: UIView = { - let view = UIView() - view.frame = CGRect(x: 0, y: 0, width: 44, height: 122) - return view - }() - - let timeLabel: UILabel = { - let label = UILabel() - label.text = time - label.textColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1) - label.font = UIFont(name: "SFProDisplay-Medium", size: 17) - return label - }() - - let weatherImage: UIImageView = { - let imageView = UIImageView() - imageView.image = UIImage(named: imageName) - return imageView - }() - - let temperatureLabel: UILabel = { - let label = UILabel() - label.text = temperature - label.textColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1) - label.font = UIFont(name: "SFProDisplay-Medium", size: 22) - return label - }() - - [timeLabel, weatherImage, temperatureLabel].forEach { - $0.translatesAutoresizingMaskIntoConstraints = false - itemView.addSubview($0) - } - - NSLayoutConstraint.activate([timeLabel.topAnchor.constraint(equalTo: itemView.topAnchor)]) - NSLayoutConstraint.activate([weatherImage.topAnchor.constraint(equalTo: timeLabel.bottomAnchor, constant: 14)]) - NSLayoutConstraint.activate([temperatureLabel.topAnchor.constraint(equalTo: weatherImage.bottomAnchor, constant: 14)]) - - NSLayoutConstraint.activate([timeLabel.centerXAnchor.constraint(equalTo: itemView.centerXAnchor)]) - NSLayoutConstraint.activate([weatherImage.centerXAnchor.constraint(equalTo: itemView.centerXAnchor)]) - NSLayoutConstraint.activate([temperatureLabel.centerXAnchor.constraint(equalTo: itemView.centerXAnchor)]) - - return itemView - } diff --git a/seminar2-assignment/WeatherViewController.swift b/seminar2-assignment/WeatherViewController.swift index 805da36..ea2125f 100644 --- a/seminar2-assignment/WeatherViewController.swift +++ b/seminar2-assignment/WeatherViewController.swift @@ -15,7 +15,7 @@ class WeatherViewController: UIViewController { super.viewDidLoad() self.view.layoutIfNeeded() setBackGround() - setWeatherScroll() + setWeatherScroll() } @objc func pop() { @@ -30,6 +30,10 @@ class WeatherViewController: UIViewController { }() private func setBackGround(){ + self.view.addSubview(collectionView) + collectionView.snp.makeConstraints { + $0.edges.equalToSuperview() + } backgroundImageView.translatesAutoresizingMaskIntoConstraints = false self.view.addSubview(backgroundImageView) NSLayoutConstraint.activate([backgroundImageView.topAnchor.constraint(equalTo: self.view.topAnchor), @@ -51,7 +55,7 @@ class WeatherViewController: UIViewController { contentView.heightAnchor.constraint(equalToConstant: 1000)]) contentView.widthAnchor.constraint(equalTo: scrollView.widthAnchor).isActive = true setLayout() - + } private func setLayout() { @@ -80,10 +84,10 @@ class WeatherViewController: UIViewController { contentView.leadingAnchor.constraint(equalTo: scrollView.leadingAnchor), contentView.trailingAnchor.constraint(equalTo: scrollView.trailingAnchor) ]) -// smallView.addSubview(descriptionLabel) -// smallView.addSubview(line) -// smallView.addSubview(TimeStackView) -// + // smallView.addSubview(descriptionLabel) + // smallView.addSubview(line) + // smallView.addSubview(TimeStackView) + // timeScroll.addSubview(TimeStackView) [descriptionLabel, line, timeScroll].forEach{ $0.translatesAutoresizingMaskIntoConstraints = false @@ -91,22 +95,22 @@ class WeatherViewController: UIViewController { } NSLayoutConstraint.activate([descriptionLabel.topAnchor.constraint(equalTo: smallView.topAnchor, constant: 1), - descriptionLabel.leadingAnchor.constraint(equalTo: smallView.leadingAnchor, constant: 15), - descriptionLabel.trailingAnchor.constraint(equalTo: smallView.trailingAnchor, constant: -15), - descriptionLabel.widthAnchor.constraint(equalToConstant: 305), - descriptionLabel.heightAnchor.constraint(equalToConstant: 45)]) - + descriptionLabel.leadingAnchor.constraint(equalTo: smallView.leadingAnchor, constant: 15), + descriptionLabel.trailingAnchor.constraint(equalTo: smallView.trailingAnchor, constant: -15), + descriptionLabel.widthAnchor.constraint(equalToConstant: 305), + descriptionLabel.heightAnchor.constraint(equalToConstant: 45)]) + NSLayoutConstraint.activate([ line.heightAnchor.constraint(equalToConstant: 0.1), -line.topAnchor.constraint(equalTo: descriptionLabel.bottomAnchor, constant: 66), - line.leadingAnchor.constraint(equalTo: smallView.leadingAnchor, constant: 14), - line.trailingAnchor.constraint(equalTo: smallView.trailingAnchor, constant: -14), - line.bottomAnchor.constraint(equalTo: smallView.bottomAnchor, constant: -20)]) - - NSLayoutConstraint.activate([timeScroll.topAnchor.constraint(equalTo: descriptionLabel.bottomAnchor, constant: 10), - timeScroll.leadingAnchor.constraint(equalTo: smallView.leadingAnchor, constant: 10), - timeScroll.trailingAnchor.constraint(equalTo: smallView.trailingAnchor, constant: -10), - timeScroll.bottomAnchor.constraint(equalTo: smallView.bottomAnchor, constant: -10)]) - + line.topAnchor.constraint(equalTo: descriptionLabel.bottomAnchor, constant: 66), + line.leadingAnchor.constraint(equalTo: smallView.leadingAnchor, constant: 14), + line.trailingAnchor.constraint(equalTo: smallView.trailingAnchor, constant: -14), + line.bottomAnchor.constraint(equalTo: smallView.bottomAnchor, constant: -20)]) + + NSLayoutConstraint.activate([timeScroll.topAnchor.constraint(equalTo: descriptionLabel.bottomAnchor, constant: 10), + timeScroll.leadingAnchor.constraint(equalTo: smallView.leadingAnchor, constant: 10), + timeScroll.trailingAnchor.constraint(equalTo: smallView.trailingAnchor, constant: -10), + timeScroll.bottomAnchor.constraint(equalTo: smallView.bottomAnchor, constant: -10)]) + } @@ -121,7 +125,7 @@ line.topAnchor.constraint(equalTo: descriptionLabel.bottomAnchor, constant: 66), let scrollView = UIScrollView() scrollView.translatesAutoresizingMaskIntoConstraints = false scrollView.contentSize = CGSize(width: scrollView.frame.width, height: 100)// 적절한 높이 값) - + return scrollView }() private var contentView: UIView = { @@ -215,7 +219,14 @@ line.topAnchor.constraint(equalTo: descriptionLabel.bottomAnchor, constant: 66), let imageView = UIImageView(image: UIImage(named: "one")) return imageView }() + private let collectionView = UICollectionView(frame: .zero, collectionViewLayout: UICollectionViewFlowLayout()).then { + $0.backgroundColor = .black + } + + } + + extension WeatherViewController { private func setWeatherScroll() { let ItemArray = [weatherScroll(time: "Now", imageName: "thunder", temperature: "21°"),