├── .DS_Store ├── media └── ss.png ├── WeatherAppSwiftUI ├── Assets.xcassets │ ├── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json ├── Views │ ├── ViewModelProtocol.swift │ ├── Main │ │ ├── MainViewVM.swift │ │ └── MainView.swift │ ├── DayList │ │ ├── DayInfoRow.swift │ │ ├── DayList.swift │ │ └── DayListViewModel.swift │ └── Detail │ │ └── DetailView.swift ├── Extension │ ├── Date+extentions.swift │ └── Color+extensions.swift ├── Network │ └── FetchData.swift ├── AppDelegate.swift ├── Base.lproj │ └── LaunchScreen.storyboard ├── Info.plist └── SceneDelegate.swift ├── WeatherAppSwiftUI.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcuserdata │ │ └── evrenyasar.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── xcuserdata │ └── evrenyasar.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ └── xcschememanagement.plist └── project.pbxproj └── README.md /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/necatievrenyasar/SwiftUI-WeatherApp/HEAD/.DS_Store -------------------------------------------------------------------------------- /media/ss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/necatievrenyasar/SwiftUI-WeatherApp/HEAD/media/ss.png -------------------------------------------------------------------------------- /WeatherAppSwiftUI/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /WeatherAppSwiftUI/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /WeatherAppSwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WeatherAppSwiftUI.xcodeproj/xcuserdata/evrenyasar.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /WeatherAppSwiftUI.xcodeproj/project.xcworkspace/xcuserdata/evrenyasar.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/necatievrenyasar/SwiftUI-WeatherApp/HEAD/WeatherAppSwiftUI.xcodeproj/project.xcworkspace/xcuserdata/evrenyasar.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /WeatherAppSwiftUI/Views/ViewModelProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewModelProtocol.swift 3 | // WeatherAppSwiftUI 4 | // 5 | // Created by Evren Yaşar on 3.01.2020. 6 | // Copyright © 2020 Evren Yaşar. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | protocol ViewModelProtocol { 11 | func start() 12 | } 13 | -------------------------------------------------------------------------------- /WeatherAppSwiftUI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /WeatherAppSwiftUI/Views/Main/MainViewVM.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewVM.swift 3 | // WeatherAppSwiftUI 4 | // 5 | // Created by Evren Yaşar on 3.01.2020. 6 | // Copyright © 2020 Evren Yaşar. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | final class MainViewVM: ViewModelProtocol{ 11 | 12 | func start() {} 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /WeatherAppSwiftUI/Extension/Date+extentions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Date+extentions.swift 3 | // WeatherAppSwiftUI 4 | // 5 | // Created by Evren Yaşar on 28.12.2019. 6 | // Copyright © 2019 Evren Yaşar. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | extension Date { 11 | func formatter(_ format:String) -> String { 12 | let dateFormat = DateFormatter() 13 | dateFormat.dateFormat = format 14 | return dateFormat.string(from: self) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /WeatherAppSwiftUI.xcodeproj/xcuserdata/evrenyasar.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | WeatherAppSwiftUI.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /WeatherAppSwiftUI/Extension/Color+extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Color+extensions.swift 3 | // WeatherAppSwiftUI 4 | // 5 | // Created by Evren Yaşar on 3.01.2020. 6 | // Copyright © 2020 Evren Yaşar. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | extension Color { 11 | static let topColor = Color(red: 146/255, green: 78/255, blue: 163/255) 12 | static let centerColor = Color(red: 64/255, green: 49/255, blue: 140/255) 13 | static let bottomColor = Color(red: 40/255, green: 30/255, blue: 90/255) 14 | } 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SwiftUI-Weather App 2 | 3 | 🚀 This demo is very simple project, which designed to understand SwiftUI. It includes Main screen, DayList screen and detail screen. 4 | 5 | ## Features 6 | 7 | - [x] Implemented with SwiftUI 8 | - [x] Work with mock data 9 | - [x] Swift 5.1 new features 10 | - [x] MVVM 11 | 12 | ## Screenshot 13 | ![ss](https://user-images.githubusercontent.com/1447937/72296817-96f10580-366b-11ea-957c-023efeac958f.png) 14 | 15 | ## Todo 16 | - [ ] SwiftUI + Network requeset 17 | - [ ] CoreML 18 | - [ ] Test case 19 | - [ ] MVVM for MainView 20 | 21 | 22 | -------------------------------------------------------------------------------- /WeatherAppSwiftUI/Network/FetchData.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FetchData.swift 3 | // WeatherAppSwiftUI 4 | // 5 | // Created by Evren Yaşar on 28.12.2019. 6 | // Copyright © 2019 Evren Yaşar. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | class FetchData: ObservableObject { 11 | 12 | @Published var resultData = Data() 13 | 14 | init(url: String) { 15 | guard let url = URL(string: url) else {return} 16 | URLSession.shared.dataTask(with: url) { (data, response, error) in 17 | guard let data = data else {return} 18 | DispatchQueue.main.async { 19 | self.resultData = data 20 | } 21 | } 22 | 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /WeatherAppSwiftUI/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // WeatherAppSwiftUI 4 | // 5 | // Created by Evren Yaşar on 27.12.2019. 6 | // Copyright © 2019 Evren Yaşar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 17 | // Override point for customization after application launch. 18 | return true 19 | } 20 | 21 | // MARK: UISceneSession Lifecycle 22 | 23 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 24 | // Called when a new scene session is being created. 25 | // Use this method to select a configuration to create the new scene with. 26 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 27 | } 28 | 29 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 30 | // Called when the user discards a scene session. 31 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 32 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 33 | } 34 | 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /WeatherAppSwiftUI/Views/DayList/DayInfoRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DayInfoRow.swift 3 | // WeatherAppSwiftUI 4 | // 5 | // Created by Evren Yaşar on 28.12.2019. 6 | // Copyright © 2019 Evren Yaşar. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | struct DayInfoRow: View { 11 | 12 | private var bottomColor = Color(red: 40/255, green: 30/255, blue: 90/255) 13 | let model: DayRowModel 14 | init(model: DayRowModel) { 15 | self.model = model 16 | } 17 | 18 | var body: some View { 19 | Group { 20 | HStack { 21 | //Day And Date 22 | VStack(alignment: .leading, spacing: 8) { 23 | Text(model.day).font(.system(size: 20)).fontWeight(.medium).foregroundColor(.white) 24 | Text(model.date).font(.system(size: 14)).foregroundColor(.gray) 25 | }.padding(EdgeInsets(top: 24, leading: 28, bottom: 24, trailing: 0)) 26 | Spacer() 27 | Text(model.degree).font(.system(size: 24)).foregroundColor(Color.white).padding(.trailing, -6) 28 | Text("°").font(.system(size: 24)).foregroundColor(Color.white).padding(.trailing, 2).padding(.top, -10) 29 | Image(systemName: model.weather.icon) 30 | .resizable() 31 | .aspectRatio(contentMode: .fit) 32 | .frame(width: 30, height: 50, alignment: .center) 33 | .padding(.trailing,20) 34 | .foregroundColor(Color.white) 35 | } 36 | }.background(LinearGradient(gradient: Gradient(colors: [self.bottomColor, Color.clear]), startPoint: .top, endPoint: .bottom).opacity(0.1)) 37 | .background(Color.clear) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /WeatherAppSwiftUI/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /WeatherAppSwiftUI/Views/Main/MainView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MainView.swift 3 | // WeatherAppSwiftUI 4 | // 5 | // Created by Evren Yaşar on 3.01.2020. 6 | // Copyright © 2020 Evren Yaşar. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct MainView: View { 12 | 13 | private var viewModel = MainViewVM() 14 | @State var inputText: String = "" 15 | @State var showingDayList = false 16 | 17 | 18 | var body: some View { 19 | ZStack { 20 | LinearGradient(gradient: Gradient(colors: [.topColor,.centerColor,.bottomColor]), 21 | startPoint: .topLeading, 22 | endPoint: .bottom) 23 | .edgesIgnoringSafeArea(.all) 24 | VStack(alignment: .center, spacing: 140){ 25 | Text("Weather App") 26 | .foregroundColor(Color.white) 27 | .font(Font.system(size: 50)) 28 | HStack { 29 | TextField("What is weather in Istanbul?", text: $inputText) 30 | .frame(width: 360, height: 40, alignment:.center) 31 | .fixedSize() 32 | .background(Color.white) 33 | .clipShape(RoundedRectangle(cornerRadius: 8)) 34 | Button(action: { 35 | self.showingDayList.toggle() 36 | }) { 37 | Image(systemName: "magnifyingglass") 38 | .font(.largeTitle) 39 | .foregroundColor(.white) 40 | } 41 | } 42 | Spacer() 43 | } 44 | .padding(.top, 150.0) 45 | 46 | }.sheet(isPresented: $showingDayList) { 47 | DayList() 48 | } 49 | } 50 | } 51 | 52 | struct MainView_Previews: PreviewProvider { 53 | static var previews: some View { 54 | MainView() 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /WeatherAppSwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /WeatherAppSwiftUI/Views/DayList/DayList.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // WeatherAppSwiftUI 4 | // 5 | // Created by Evren Yaşar on 27.12.2019. 6 | // Copyright © 2019 Evren Yaşar. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct DayList: View { 12 | 13 | private var topColor = Color(red: 146/255, green: 78/255, blue: 163/255) 14 | private var centerColor = Color(red: 64/255, green: 49/255, blue: 140/255) 15 | private var bottomColor = Color(red: 40/255, green: 30/255, blue: 90/255) 16 | 17 | @ObservedObject var viewModel = DayListViewModel() 18 | 19 | 20 | init() { 21 | UINavigationBar.appearance().backgroundColor = UIColor(red: 40/255, green: 30/255, blue: 90/255, alpha: 1) 22 | UINavigationBar.appearance().largeTitleTextAttributes = [ 23 | .foregroundColor: UIColor.white] 24 | UITableView.appearance().backgroundColor = UIColor.clear 25 | } 26 | 27 | var body: some View { 28 | NavigationView { 29 | ZStack { 30 | LinearGradient(gradient: Gradient(colors: [topColor,centerColor, bottomColor]), startPoint: .topLeading, endPoint: .bottom) 31 | .edgesIgnoringSafeArea(.all) 32 | VStack { 33 | ForEach(self.viewModel.datas) { value in 34 | NavigationLink(destination: DetailView(title:"" )){ 35 | DayInfoRow(model: value) 36 | } 37 | } 38 | .listRowBackground(Color.clear) 39 | } 40 | .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: Alignment.topLeading) 41 | 42 | .navigationBarTitle(Text("Weather App"), displayMode: .inline) 43 | } 44 | 45 | }.onAppear { 46 | self.viewModel.start() 47 | } 48 | } 49 | 50 | } 51 | 52 | struct ContentView_Previews: PreviewProvider { 53 | static var previews: some View { 54 | DayList() 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /WeatherAppSwiftUI/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | UISceneConfigurations 28 | 29 | UIWindowSceneSessionRoleApplication 30 | 31 | 32 | UISceneConfigurationName 33 | Default Configuration 34 | UISceneDelegateClassName 35 | $(PRODUCT_MODULE_NAME).SceneDelegate 36 | 37 | 38 | 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UISupportedInterfaceOrientations~ipad 53 | 54 | UIInterfaceOrientationPortrait 55 | UIInterfaceOrientationPortraitUpsideDown 56 | UIInterfaceOrientationLandscapeLeft 57 | UIInterfaceOrientationLandscapeRight 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /WeatherAppSwiftUI/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // WeatherAppSwiftUI 4 | // 5 | // Created by Evren Yaşar on 27.12.2019. 6 | // Copyright © 2019 Evren Yaşar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SwiftUI 11 | 12 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 18 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 19 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 20 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 21 | 22 | // Create the SwiftUI view that provides the window contents. 23 | let contentView = DayList() 24 | let mainView = MainView() 25 | // Use a UIHostingController as window root view controller. 26 | if let windowScene = scene as? UIWindowScene { 27 | let window = UIWindow(windowScene: windowScene) 28 | window.rootViewController = UIHostingController(rootView: mainView) 29 | self.window = window 30 | window.makeKeyAndVisible() 31 | } 32 | } 33 | 34 | func sceneDidDisconnect(_ scene: UIScene) { 35 | // Called as the scene is being released by the system. 36 | // This occurs shortly after the scene enters the background, or when its session is discarded. 37 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 38 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). 39 | } 40 | 41 | func sceneDidBecomeActive(_ scene: UIScene) { 42 | // Called when the scene has moved from an inactive state to an active state. 43 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 44 | } 45 | 46 | func sceneWillResignActive(_ scene: UIScene) { 47 | // Called when the scene will move from an active state to an inactive state. 48 | // This may occur due to temporary interruptions (ex. an incoming phone call). 49 | } 50 | 51 | func sceneWillEnterForeground(_ scene: UIScene) { 52 | // Called as the scene transitions from the background to the foreground. 53 | // Use this method to undo the changes made on entering the background. 54 | } 55 | 56 | func sceneDidEnterBackground(_ scene: UIScene) { 57 | // Called as the scene transitions from the foreground to the background. 58 | // Use this method to save data, release shared resources, and store enough scene-specific state information 59 | // to restore the scene back to its current state. 60 | } 61 | 62 | 63 | } 64 | 65 | -------------------------------------------------------------------------------- /WeatherAppSwiftUI/Views/Detail/DetailView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DetailView.swift 3 | // WeatherAppSwiftUI 4 | // 5 | // Created by Evren Yaşar on 29.12.2019. 6 | // Copyright © 2019 Evren Yaşar. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct DetailRowModel: Identifiable { 12 | var id = UUID() 13 | var degree: Int 14 | var time: String 15 | var weather: WeatherType 16 | } 17 | 18 | 19 | struct DetailView: View { 20 | 21 | private var data: [DetailRowModel] { 22 | return [.init(degree: 12, time: "09:00", weather: .clouds), 23 | .init(degree: 13, time: "12:00", weather: .rain), 24 | .init(degree: 11, time: "15:00", weather: .clouds), 25 | .init(degree: 12, time: "17:00", weather: .rain)] 26 | } 27 | 28 | private let title: String 29 | 30 | 31 | 32 | init(title: String) { 33 | self.title = title 34 | } 35 | 36 | var body: some View { 37 | 38 | ZStack { 39 | LinearGradient(gradient: Gradient(colors: [.topColor,.centerColor,.bottomColor]), startPoint: .topLeading, endPoint: .bottom) 40 | .edgesIgnoringSafeArea(.all) 41 | VStack { 42 | HStack { 43 | Text("12") 44 | .font(.system(size: 100)) 45 | .foregroundColor(.white) 46 | .fontWeight(.medium) 47 | Text("°") 48 | .font(.system(size: 50)) 49 | .foregroundColor(.white) 50 | .fontWeight(.medium) 51 | .padding(.top, -40) 52 | .padding(.leading, -10) 53 | 54 | }.padding(.top, 100) 55 | 56 | Text("Ankara") 57 | .font(.system(size: 36)) 58 | .foregroundColor(.white) 59 | .fontWeight(.medium) 60 | .padding(.top, 40) 61 | 62 | Text("Today 9:00 pm") 63 | .font(.system(size: 15)) 64 | .foregroundColor(.gray) 65 | .padding(.top, 20) 66 | 67 | Spacer() 68 | HStack(spacing: 34) { 69 | TimeWeatherRow(model: data[0]) 70 | TimeWeatherRow(model: data[1]) 71 | TimeWeatherRow(model: data[2]) 72 | TimeWeatherRow(model: data[3]) 73 | } 74 | Spacer() 75 | } 76 | .navigationBarTitle(Text("Detail View"), displayMode: .inline) 77 | } 78 | } 79 | 80 | } 81 | 82 | struct DetailView_Previews: PreviewProvider { 83 | static var previews: some View { 84 | DetailView(title: "Sunday") 85 | } 86 | } 87 | 88 | struct TimeWeatherRow: View { 89 | 90 | let data: DetailRowModel 91 | init(model: DetailRowModel) { 92 | self.data = model 93 | } 94 | 95 | var body: some View { 96 | VStack { 97 | HStack { 98 | Text("\(data.degree)") 99 | .font(.system(size: 40)) 100 | .foregroundColor(.white) 101 | Text("°") 102 | .font(.system(size: 30)) 103 | .foregroundColor(.white) 104 | .fontWeight(.medium) 105 | .padding(.leading, -10).padding(.top, -24) 106 | }.padding(.bottom, -24) 107 | ZStack { 108 | Circle() 109 | .stroke(Color.gray, lineWidth: 1) 110 | .frame(width: 54, height: 64, alignment: .center) 111 | 112 | Image(systemName:data.weather.icon) 113 | .resizable() 114 | .aspectRatio(contentMode: .fit) 115 | .frame(width: 30, height: 50, alignment: .center) 116 | .foregroundColor(.white) 117 | } 118 | Text(data.time) 119 | .font(.system(size: 16)) 120 | .foregroundColor(.white) 121 | } 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /WeatherAppSwiftUI/Views/DayList/DayListViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DayListViewModel.swift 3 | // WeatherAppSwiftUI 4 | // 5 | // Created by Evren Yaşar on 28.12.2019. 6 | // Copyright © 2019 Evren Yaşar. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | enum WeatherType { 12 | case snow, rain, sun, clouds 13 | 14 | var icon: String { 15 | switch self { 16 | case .clouds: 17 | return "cloud" 18 | case .rain: 19 | return "cloud.rain" 20 | case .snow: 21 | return "cloud.snow" 22 | case .sun: 23 | return "sun.min" 24 | } 25 | } 26 | } 27 | 28 | struct DayRowModel: Identifiable { 29 | var id = UUID() 30 | var day: String 31 | var date: String 32 | var degree: String 33 | var weather: WeatherType 34 | } 35 | 36 | class DayListViewModel: ObservableObject { 37 | 38 | @Published var datas: [DayRowModel] = [] 39 | 40 | private var mockData: [DayRowModel] { 41 | return [.init(day: "Sunday", date: "10 Jun", degree: "19", weather: .sun), 42 | .init(day: "Monday", date: "11 Jun", degree: "12", weather: .rain), 43 | .init(day: "Wednesday", date: "12 Jun", degree: "15", weather: .sun), 44 | .init(day: "Thursday", date: "13 Jun", degree: "-2", weather: .snow), 45 | .init(day: "Friday", date: "14 Jun", degree: "-4", weather: .snow),] 46 | } 47 | 48 | func start() { 49 | datas = mockData 50 | } 51 | 52 | func fetchData() { 53 | //api.openweathermap.org/data/2.5/forecast?q=London 54 | //https://samples.openweathermap.org/data/2.5/forecast?id=524901&appid=b6907d289e10d714a6e88b30761fae22 55 | //api.openweathermap.org/data/2.5/forecast?q=London 56 | guard let url = URL(string: "https://api.openweathermap.org/data/2.5/forecast?id=524901&appid=49b4f4f80b7a69e2cff0fd5ba62f0ec1") else {return} 57 | datas.removeAll() 58 | URLSession.shared.dataTask(with: url) { (data, response, error) in 59 | if let error = error { 60 | print("[Error] \(error.localizedDescription)") 61 | return 62 | } 63 | 64 | guard let data = data else {return} 65 | 66 | DispatchQueue.main.async { 67 | do { 68 | let result = try JSONDecoder().decode(WeatherParser.self, from: data) 69 | let finalData = result.list.compactMap { (ref) -> DayRowModel? in 70 | if let day = self.dayFilter(data: ref) { 71 | return self.convertData(day) 72 | } 73 | return nil 74 | } 75 | self.datas = finalData 76 | }catch let error { 77 | print("[Error] \(error.localizedDescription)") 78 | } 79 | 80 | } 81 | }.resume() 82 | } 83 | 84 | private func dayFilter(data: WeatherAndTime) -> WeatherAndTime? { 85 | let timeInterval = Double(data.dt) 86 | let convertedDate = Date(timeIntervalSince1970: timeInterval) 87 | if convertedDate.formatter("HH") == "12" { 88 | return data 89 | } 90 | return data 91 | } 92 | 93 | 94 | private func convertData(_ data: WeatherAndTime) -> DayRowModel? { 95 | print("aaaa \(data.dtTxt) - \(kelvinToCelsius(data.mainTemp.temp))") 96 | 97 | let timeInterval = Double(data.dt) 98 | let convertedDate = Date(timeIntervalSince1970: timeInterval) 99 | return DayRowModel(day: convertedDate.formatter("EEEE"), date: convertedDate.formatter("yyyy-MMM-dd"), degree: "40", weather:.sun) 100 | } 101 | 102 | 103 | 104 | func kelvinToCelsius(_ kelvin: Double) -> Double { 105 | kelvin - 273.15 106 | } 107 | 108 | } 109 | 110 | 111 | struct WeatherParser: Codable { 112 | let cod: String 113 | let message: Double 114 | let cnt: Int 115 | let list: [WeatherAndTime] 116 | } 117 | 118 | // MARK: - List 119 | struct WeatherAndTime: Codable { 120 | let dt: Int 121 | let mainTemp: MainTemp 122 | let weather: [Weather] 123 | let dtTxt: String 124 | 125 | enum CodingKeys: String, CodingKey { 126 | case dt, weather, mainTemp = "main" 127 | case dtTxt = "dt_txt" 128 | } 129 | } 130 | 131 | struct Weather: Codable { 132 | let id: Int 133 | let main: MainEnum 134 | let weatherDescription: Description 135 | let icon: String 136 | 137 | enum CodingKeys: String, CodingKey { 138 | case id, main 139 | case weatherDescription = "description" 140 | case icon 141 | } 142 | } 143 | 144 | struct MainTemp: Codable { 145 | let temp: Double 146 | } 147 | 148 | enum MainEnum: String, Codable { 149 | 150 | case clear = "Clear" 151 | case clouds = "Clouds" 152 | case rain = "Rain" 153 | case snow = "Snow" 154 | } 155 | 156 | 157 | 158 | enum Description: String, Codable { 159 | case brokenClouds = "broken clouds" 160 | case clearSky = "clear sky" 161 | case fewClouds = "few clouds" 162 | case lightRain = "light rain" 163 | case lightSnow = "light snow" 164 | case scatteredClouds = "scattered clouds" 165 | case overcastClouds = "overcast clouds" 166 | } 167 | -------------------------------------------------------------------------------- /WeatherAppSwiftUI.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B20B987823BF718900D0C685 /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B20B987723BF718900D0C685 /* MainView.swift */; }; 11 | B20B987A23BF71CD00D0C685 /* Color+extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B20B987923BF71CD00D0C685 /* Color+extensions.swift */; }; 12 | B20B988223BF81DF00D0C685 /* MainViewVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = B20B988123BF81DF00D0C685 /* MainViewVM.swift */; }; 13 | B20B988423BF820B00D0C685 /* ViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B20B988323BF820B00D0C685 /* ViewModelProtocol.swift */; }; 14 | B24CC6DF23B7F30D00A81849 /* Date+extentions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B24CC6DE23B7F30D00A81849 /* Date+extentions.swift */; }; 15 | B266CBE423B93A130006CF7C /* DetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B266CBE323B93A130006CF7C /* DetailView.swift */; }; 16 | B26FD77F23B7D90F006E0412 /* DayInfoRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B26FD77E23B7D90F006E0412 /* DayInfoRow.swift */; }; 17 | B26FD78623B7DDA1006E0412 /* FetchData.swift in Sources */ = {isa = PBXBuildFile; fileRef = B26FD78523B7DDA1006E0412 /* FetchData.swift */; }; 18 | B26FD78823B7E13D006E0412 /* DayListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B26FD78723B7E13D006E0412 /* DayListViewModel.swift */; }; 19 | B27DACDB23B692DB0032F2FC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B27DACDA23B692DB0032F2FC /* AppDelegate.swift */; }; 20 | B27DACDD23B692DB0032F2FC /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B27DACDC23B692DB0032F2FC /* SceneDelegate.swift */; }; 21 | B27DACDF23B692DB0032F2FC /* DayList.swift in Sources */ = {isa = PBXBuildFile; fileRef = B27DACDE23B692DB0032F2FC /* DayList.swift */; }; 22 | B27DACE123B692DD0032F2FC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B27DACE023B692DD0032F2FC /* Assets.xcassets */; }; 23 | B27DACE423B692DD0032F2FC /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B27DACE323B692DD0032F2FC /* Preview Assets.xcassets */; }; 24 | B27DACE723B692DD0032F2FC /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B27DACE523B692DD0032F2FC /* LaunchScreen.storyboard */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXFileReference section */ 28 | B20B987723BF718900D0C685 /* MainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = ""; }; 29 | B20B987923BF71CD00D0C685 /* Color+extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Color+extensions.swift"; sourceTree = ""; }; 30 | B20B988123BF81DF00D0C685 /* MainViewVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewVM.swift; sourceTree = ""; }; 31 | B20B988323BF820B00D0C685 /* ViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewModelProtocol.swift; sourceTree = ""; }; 32 | B24CC6DE23B7F30D00A81849 /* Date+extentions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Date+extentions.swift"; sourceTree = ""; }; 33 | B266CBE323B93A130006CF7C /* DetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailView.swift; sourceTree = ""; }; 34 | B26FD77E23B7D90F006E0412 /* DayInfoRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DayInfoRow.swift; sourceTree = ""; }; 35 | B26FD78523B7DDA1006E0412 /* FetchData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchData.swift; sourceTree = ""; }; 36 | B26FD78723B7E13D006E0412 /* DayListViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DayListViewModel.swift; sourceTree = ""; }; 37 | B27DACD723B692DB0032F2FC /* WeatherAppSwiftUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WeatherAppSwiftUI.app; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | B27DACDA23B692DB0032F2FC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 39 | B27DACDC23B692DB0032F2FC /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 40 | B27DACDE23B692DB0032F2FC /* DayList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DayList.swift; sourceTree = ""; }; 41 | B27DACE023B692DD0032F2FC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 42 | B27DACE323B692DD0032F2FC /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 43 | B27DACE623B692DD0032F2FC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | B27DACE823B692DD0032F2FC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | B27DACD423B692DB0032F2FC /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | B24CC6DD23B7F2FB00A81849 /* Extension */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | B24CC6DE23B7F30D00A81849 /* Date+extentions.swift */, 62 | B20B987923BF71CD00D0C685 /* Color+extensions.swift */, 63 | ); 64 | path = Extension; 65 | sourceTree = ""; 66 | }; 67 | B26FD78023B7DA5B006E0412 /* Network */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | B26FD78523B7DDA1006E0412 /* FetchData.swift */, 71 | ); 72 | path = Network; 73 | sourceTree = ""; 74 | }; 75 | B26FD78123B7DA69006E0412 /* Views */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | B26FD78323B7DA81006E0412 /* Main */, 79 | B26FD78223B7DA6E006E0412 /* DayList */, 80 | B26FD78423B7DA86006E0412 /* Detail */, 81 | B20B988323BF820B00D0C685 /* ViewModelProtocol.swift */, 82 | ); 83 | path = Views; 84 | sourceTree = ""; 85 | }; 86 | B26FD78223B7DA6E006E0412 /* DayList */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | B27DACDE23B692DB0032F2FC /* DayList.swift */, 90 | B26FD78723B7E13D006E0412 /* DayListViewModel.swift */, 91 | B26FD77E23B7D90F006E0412 /* DayInfoRow.swift */, 92 | ); 93 | path = DayList; 94 | sourceTree = ""; 95 | }; 96 | B26FD78323B7DA81006E0412 /* Main */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | B20B987723BF718900D0C685 /* MainView.swift */, 100 | B20B988123BF81DF00D0C685 /* MainViewVM.swift */, 101 | ); 102 | path = Main; 103 | sourceTree = ""; 104 | }; 105 | B26FD78423B7DA86006E0412 /* Detail */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | B266CBE323B93A130006CF7C /* DetailView.swift */, 109 | ); 110 | path = Detail; 111 | sourceTree = ""; 112 | }; 113 | B27DACCE23B692DB0032F2FC = { 114 | isa = PBXGroup; 115 | children = ( 116 | B27DACD923B692DB0032F2FC /* WeatherAppSwiftUI */, 117 | B27DACD823B692DB0032F2FC /* Products */, 118 | ); 119 | sourceTree = ""; 120 | }; 121 | B27DACD823B692DB0032F2FC /* Products */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | B27DACD723B692DB0032F2FC /* WeatherAppSwiftUI.app */, 125 | ); 126 | name = Products; 127 | sourceTree = ""; 128 | }; 129 | B27DACD923B692DB0032F2FC /* WeatherAppSwiftUI */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | B24CC6DD23B7F2FB00A81849 /* Extension */, 133 | B26FD78123B7DA69006E0412 /* Views */, 134 | B26FD78023B7DA5B006E0412 /* Network */, 135 | B27DACDA23B692DB0032F2FC /* AppDelegate.swift */, 136 | B27DACDC23B692DB0032F2FC /* SceneDelegate.swift */, 137 | B27DACE023B692DD0032F2FC /* Assets.xcassets */, 138 | B27DACE523B692DD0032F2FC /* LaunchScreen.storyboard */, 139 | B27DACE823B692DD0032F2FC /* Info.plist */, 140 | B27DACE223B692DD0032F2FC /* Preview Content */, 141 | ); 142 | path = WeatherAppSwiftUI; 143 | sourceTree = ""; 144 | }; 145 | B27DACE223B692DD0032F2FC /* Preview Content */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | B27DACE323B692DD0032F2FC /* Preview Assets.xcassets */, 149 | ); 150 | path = "Preview Content"; 151 | sourceTree = ""; 152 | }; 153 | /* End PBXGroup section */ 154 | 155 | /* Begin PBXNativeTarget section */ 156 | B27DACD623B692DB0032F2FC /* WeatherAppSwiftUI */ = { 157 | isa = PBXNativeTarget; 158 | buildConfigurationList = B27DACEB23B692DD0032F2FC /* Build configuration list for PBXNativeTarget "WeatherAppSwiftUI" */; 159 | buildPhases = ( 160 | B27DACD323B692DB0032F2FC /* Sources */, 161 | B27DACD423B692DB0032F2FC /* Frameworks */, 162 | B27DACD523B692DB0032F2FC /* Resources */, 163 | ); 164 | buildRules = ( 165 | ); 166 | dependencies = ( 167 | ); 168 | name = WeatherAppSwiftUI; 169 | productName = WeatherAppSwiftUI; 170 | productReference = B27DACD723B692DB0032F2FC /* WeatherAppSwiftUI.app */; 171 | productType = "com.apple.product-type.application"; 172 | }; 173 | /* End PBXNativeTarget section */ 174 | 175 | /* Begin PBXProject section */ 176 | B27DACCF23B692DB0032F2FC /* Project object */ = { 177 | isa = PBXProject; 178 | attributes = { 179 | LastSwiftUpdateCheck = 1120; 180 | LastUpgradeCheck = 1120; 181 | ORGANIZATIONNAME = "Evren Yaşar"; 182 | TargetAttributes = { 183 | B27DACD623B692DB0032F2FC = { 184 | CreatedOnToolsVersion = 11.2.1; 185 | }; 186 | }; 187 | }; 188 | buildConfigurationList = B27DACD223B692DB0032F2FC /* Build configuration list for PBXProject "WeatherAppSwiftUI" */; 189 | compatibilityVersion = "Xcode 9.3"; 190 | developmentRegion = en; 191 | hasScannedForEncodings = 0; 192 | knownRegions = ( 193 | en, 194 | Base, 195 | ); 196 | mainGroup = B27DACCE23B692DB0032F2FC; 197 | productRefGroup = B27DACD823B692DB0032F2FC /* Products */; 198 | projectDirPath = ""; 199 | projectRoot = ""; 200 | targets = ( 201 | B27DACD623B692DB0032F2FC /* WeatherAppSwiftUI */, 202 | ); 203 | }; 204 | /* End PBXProject section */ 205 | 206 | /* Begin PBXResourcesBuildPhase section */ 207 | B27DACD523B692DB0032F2FC /* Resources */ = { 208 | isa = PBXResourcesBuildPhase; 209 | buildActionMask = 2147483647; 210 | files = ( 211 | B27DACE723B692DD0032F2FC /* LaunchScreen.storyboard in Resources */, 212 | B27DACE423B692DD0032F2FC /* Preview Assets.xcassets in Resources */, 213 | B27DACE123B692DD0032F2FC /* Assets.xcassets in Resources */, 214 | ); 215 | runOnlyForDeploymentPostprocessing = 0; 216 | }; 217 | /* End PBXResourcesBuildPhase section */ 218 | 219 | /* Begin PBXSourcesBuildPhase section */ 220 | B27DACD323B692DB0032F2FC /* Sources */ = { 221 | isa = PBXSourcesBuildPhase; 222 | buildActionMask = 2147483647; 223 | files = ( 224 | B24CC6DF23B7F30D00A81849 /* Date+extentions.swift in Sources */, 225 | B20B987823BF718900D0C685 /* MainView.swift in Sources */, 226 | B266CBE423B93A130006CF7C /* DetailView.swift in Sources */, 227 | B20B988223BF81DF00D0C685 /* MainViewVM.swift in Sources */, 228 | B20B988423BF820B00D0C685 /* ViewModelProtocol.swift in Sources */, 229 | B20B987A23BF71CD00D0C685 /* Color+extensions.swift in Sources */, 230 | B27DACDB23B692DB0032F2FC /* AppDelegate.swift in Sources */, 231 | B26FD78823B7E13D006E0412 /* DayListViewModel.swift in Sources */, 232 | B26FD77F23B7D90F006E0412 /* DayInfoRow.swift in Sources */, 233 | B27DACDD23B692DB0032F2FC /* SceneDelegate.swift in Sources */, 234 | B26FD78623B7DDA1006E0412 /* FetchData.swift in Sources */, 235 | B27DACDF23B692DB0032F2FC /* DayList.swift in Sources */, 236 | ); 237 | runOnlyForDeploymentPostprocessing = 0; 238 | }; 239 | /* End PBXSourcesBuildPhase section */ 240 | 241 | /* Begin PBXVariantGroup section */ 242 | B27DACE523B692DD0032F2FC /* LaunchScreen.storyboard */ = { 243 | isa = PBXVariantGroup; 244 | children = ( 245 | B27DACE623B692DD0032F2FC /* Base */, 246 | ); 247 | name = LaunchScreen.storyboard; 248 | sourceTree = ""; 249 | }; 250 | /* End PBXVariantGroup section */ 251 | 252 | /* Begin XCBuildConfiguration section */ 253 | B27DACE923B692DD0032F2FC /* Debug */ = { 254 | isa = XCBuildConfiguration; 255 | buildSettings = { 256 | ALWAYS_SEARCH_USER_PATHS = NO; 257 | CLANG_ANALYZER_NONNULL = YES; 258 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 259 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 260 | CLANG_CXX_LIBRARY = "libc++"; 261 | CLANG_ENABLE_MODULES = YES; 262 | CLANG_ENABLE_OBJC_ARC = YES; 263 | CLANG_ENABLE_OBJC_WEAK = YES; 264 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 265 | CLANG_WARN_BOOL_CONVERSION = YES; 266 | CLANG_WARN_COMMA = YES; 267 | CLANG_WARN_CONSTANT_CONVERSION = YES; 268 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 269 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 270 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 271 | CLANG_WARN_EMPTY_BODY = YES; 272 | CLANG_WARN_ENUM_CONVERSION = YES; 273 | CLANG_WARN_INFINITE_RECURSION = YES; 274 | CLANG_WARN_INT_CONVERSION = YES; 275 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 276 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 277 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 278 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 279 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 280 | CLANG_WARN_STRICT_PROTOTYPES = YES; 281 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 282 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 283 | CLANG_WARN_UNREACHABLE_CODE = YES; 284 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 285 | COPY_PHASE_STRIP = NO; 286 | DEBUG_INFORMATION_FORMAT = dwarf; 287 | ENABLE_STRICT_OBJC_MSGSEND = YES; 288 | ENABLE_TESTABILITY = YES; 289 | GCC_C_LANGUAGE_STANDARD = gnu11; 290 | GCC_DYNAMIC_NO_PIC = NO; 291 | GCC_NO_COMMON_BLOCKS = YES; 292 | GCC_OPTIMIZATION_LEVEL = 0; 293 | GCC_PREPROCESSOR_DEFINITIONS = ( 294 | "DEBUG=1", 295 | "$(inherited)", 296 | ); 297 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 298 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 299 | GCC_WARN_UNDECLARED_SELECTOR = YES; 300 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 301 | GCC_WARN_UNUSED_FUNCTION = YES; 302 | GCC_WARN_UNUSED_VARIABLE = YES; 303 | IPHONEOS_DEPLOYMENT_TARGET = 13.2; 304 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 305 | MTL_FAST_MATH = YES; 306 | ONLY_ACTIVE_ARCH = YES; 307 | SDKROOT = iphoneos; 308 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 309 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 310 | }; 311 | name = Debug; 312 | }; 313 | B27DACEA23B692DD0032F2FC /* Release */ = { 314 | isa = XCBuildConfiguration; 315 | buildSettings = { 316 | ALWAYS_SEARCH_USER_PATHS = NO; 317 | CLANG_ANALYZER_NONNULL = YES; 318 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 319 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 320 | CLANG_CXX_LIBRARY = "libc++"; 321 | CLANG_ENABLE_MODULES = YES; 322 | CLANG_ENABLE_OBJC_ARC = YES; 323 | CLANG_ENABLE_OBJC_WEAK = YES; 324 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 325 | CLANG_WARN_BOOL_CONVERSION = YES; 326 | CLANG_WARN_COMMA = YES; 327 | CLANG_WARN_CONSTANT_CONVERSION = YES; 328 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 329 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 330 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 331 | CLANG_WARN_EMPTY_BODY = YES; 332 | CLANG_WARN_ENUM_CONVERSION = YES; 333 | CLANG_WARN_INFINITE_RECURSION = YES; 334 | CLANG_WARN_INT_CONVERSION = YES; 335 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 336 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 337 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 338 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 339 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 340 | CLANG_WARN_STRICT_PROTOTYPES = YES; 341 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 342 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 343 | CLANG_WARN_UNREACHABLE_CODE = YES; 344 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 345 | COPY_PHASE_STRIP = NO; 346 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 347 | ENABLE_NS_ASSERTIONS = NO; 348 | ENABLE_STRICT_OBJC_MSGSEND = YES; 349 | GCC_C_LANGUAGE_STANDARD = gnu11; 350 | GCC_NO_COMMON_BLOCKS = YES; 351 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 352 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 353 | GCC_WARN_UNDECLARED_SELECTOR = YES; 354 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 355 | GCC_WARN_UNUSED_FUNCTION = YES; 356 | GCC_WARN_UNUSED_VARIABLE = YES; 357 | IPHONEOS_DEPLOYMENT_TARGET = 13.2; 358 | MTL_ENABLE_DEBUG_INFO = NO; 359 | MTL_FAST_MATH = YES; 360 | SDKROOT = iphoneos; 361 | SWIFT_COMPILATION_MODE = wholemodule; 362 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 363 | VALIDATE_PRODUCT = YES; 364 | }; 365 | name = Release; 366 | }; 367 | B27DACEC23B692DD0032F2FC /* Debug */ = { 368 | isa = XCBuildConfiguration; 369 | buildSettings = { 370 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 371 | CODE_SIGN_STYLE = Automatic; 372 | DEVELOPMENT_ASSET_PATHS = "\"WeatherAppSwiftUI/Preview Content\""; 373 | DEVELOPMENT_TEAM = LKU8459YDL; 374 | ENABLE_PREVIEWS = YES; 375 | INFOPLIST_FILE = WeatherAppSwiftUI/Info.plist; 376 | LD_RUNPATH_SEARCH_PATHS = ( 377 | "$(inherited)", 378 | "@executable_path/Frameworks", 379 | ); 380 | PRODUCT_BUNDLE_IDENTIFIER = com.tripian.WeatherAppSwiftUI; 381 | PRODUCT_NAME = "$(TARGET_NAME)"; 382 | SWIFT_VERSION = 5.0; 383 | TARGETED_DEVICE_FAMILY = "1,2"; 384 | }; 385 | name = Debug; 386 | }; 387 | B27DACED23B692DD0032F2FC /* Release */ = { 388 | isa = XCBuildConfiguration; 389 | buildSettings = { 390 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 391 | CODE_SIGN_STYLE = Automatic; 392 | DEVELOPMENT_ASSET_PATHS = "\"WeatherAppSwiftUI/Preview Content\""; 393 | DEVELOPMENT_TEAM = LKU8459YDL; 394 | ENABLE_PREVIEWS = YES; 395 | INFOPLIST_FILE = WeatherAppSwiftUI/Info.plist; 396 | LD_RUNPATH_SEARCH_PATHS = ( 397 | "$(inherited)", 398 | "@executable_path/Frameworks", 399 | ); 400 | PRODUCT_BUNDLE_IDENTIFIER = com.tripian.WeatherAppSwiftUI; 401 | PRODUCT_NAME = "$(TARGET_NAME)"; 402 | SWIFT_VERSION = 5.0; 403 | TARGETED_DEVICE_FAMILY = "1,2"; 404 | }; 405 | name = Release; 406 | }; 407 | /* End XCBuildConfiguration section */ 408 | 409 | /* Begin XCConfigurationList section */ 410 | B27DACD223B692DB0032F2FC /* Build configuration list for PBXProject "WeatherAppSwiftUI" */ = { 411 | isa = XCConfigurationList; 412 | buildConfigurations = ( 413 | B27DACE923B692DD0032F2FC /* Debug */, 414 | B27DACEA23B692DD0032F2FC /* Release */, 415 | ); 416 | defaultConfigurationIsVisible = 0; 417 | defaultConfigurationName = Release; 418 | }; 419 | B27DACEB23B692DD0032F2FC /* Build configuration list for PBXNativeTarget "WeatherAppSwiftUI" */ = { 420 | isa = XCConfigurationList; 421 | buildConfigurations = ( 422 | B27DACEC23B692DD0032F2FC /* Debug */, 423 | B27DACED23B692DD0032F2FC /* Release */, 424 | ); 425 | defaultConfigurationIsVisible = 0; 426 | defaultConfigurationName = Release; 427 | }; 428 | /* End XCConfigurationList section */ 429 | }; 430 | rootObject = B27DACCF23B692DB0032F2FC /* Project object */; 431 | } 432 | --------------------------------------------------------------------------------