/Users/Ibrahim/Desktop/codecov/swift-standard/standard-swift/AppDelegate.swift: 1| |// 2| |// AppDelegate.swift 3| |// standard-swift 4| |// 5| |// Created by Ibrahim on 7/9/19. 6| |// Copyright © 2019 Ibrahim. All rights reserved. 7| |// 8| | 9| |import UIKit 10| | 11| |@UIApplicationMain 12| |class AppDelegate: UIResponder, UIApplicationDelegate { 13| | 14| | 15| | 16| 4| func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 17| 4| // Override point for customization after application launch. 18| 4| return true 19| 4| } 20| | 21| | // MARK: UISceneSession Lifecycle 22| | 23| 0| func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 24| 0| // Called when a new scene session is being created. 25| 0| // Use this method to select a configuration to create the new scene with. 26| 0| return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 27| 0| } 28| | 29| 0| func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 30| 0| // Called when the user discards a scene session. 31| 0| // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 32| 0| // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 33| 0| } 34| | 35| | 36| |} 37| | /Users/Ibrahim/Desktop/codecov/swift-standard/standard-swift/ContentDetail.swift: 1| |// 2| |// ContentDetail.swift 3| |// standard-swift 4| |// 5| |// Created by Ibrahim on 7/10/19. 6| |// Copyright © 2019 Ibrahim. All rights reserved. 7| |// 8| | 9| |import SwiftUI 10| | 11| |struct ContentDetail : View { 12| | 13| | var name:String 14| | var title: String 15| | 16| 1| var body: some View { 17| 1| VStack{ 18| 1| Image("codecov1").resizable() 19| 1| .frame(width: 70.0, height: 70.0).clipShape(Circle()) 20| 1| Text("\(name)").font(.title) 21| 1| Text("\(title)") 22| 1| 23| 1| } 24| 1| 25| 1| } 26| |} 27| | 28| | /Users/Ibrahim/Desktop/codecov/swift-standard/standard-swift/ContentRow.swift: 1| |// 2| |// ContentRow.swift 3| |// standard-swift 4| |// 5| |// Created by Ibrahim on 7/10/19. 6| |// Copyright © 2019 Ibrahim. All rights reserved. 7| |// 8| | 9| |import SwiftUI 10| | 11| |struct ContentRow : View { 12| | 13| | var name:String 14| | var nickName:String 15| | 16| 20| var body: some View { 17| 20| HStack{ 18| 20| Image("codecov1").resizable() 19| 20| .frame(width: 55.0, height: 55.0).clipShape(Circle()).padding(.trailing,10) 20| 20| VStack(alignment: .leading){ 21| 20| Text("\(name)").font(.title) 22| 20| Text("\(nickName)") 23| 20| } 24| 20| Spacer() 25| 20| }.padding(.init(top: 25, leading: 10, bottom: 25, trailing: 25)) 26| 20| } 27| |} 28| | /Users/Ibrahim/Desktop/codecov/swift-standard/standard-swift/ContentView.swift: 1| |// 2| |// ContentView.swift 3| |// standard-swift 4| |// 5| |// Created by Ibrahim on 7/9/19. 6| |// Copyright © 2019 Ibrahim. All rights reserved. 7| |// 8| | 9| |import SwiftUI 10| | 11| |struct ContentView : View { 12| 4| var body: some View { 13| 4| 14| 4| NavigationView { 15| 20| List(developers) { developer in 16| 20| NavigationLink(destination: ContentDetail(name: developer.name,title: developer.title)) { 17| 20| ContentRow(name: developer.name,nickName: developer.nickName) 18| 20| } 19| 20| } 20| 4| .navigationBarTitle(Text("Devs @ Codecov")) 21| 4| } 22| 4| } 23| |} 24| | /Users/Ibrahim/Desktop/codecov/swift-standard/standard-swift/Index.swift: 1| |// 2| |// Index.swift 3| |// standard-swift 4| |// 5| |// Created by Ibrahim on 7/9/19. 6| |// Copyright © 2019 Ibrahim. All rights reserved. 7| |// 8| | 9| |import Foundation 10| |class Index { 11| | 12| | 13| | //Partially be covered by unit tests 14| 1| func uncovered_if(a: Bool = true) -> Bool { 15| 1| if(a == true){ 16| 1| return false 17| 1| }else{ 18| 0| return true 19| 0| } 20| 0| } 21| | 22| | //Will be fully covered by unit tests 23| 1| func fully_covered() -> Bool { 24| 1| return true 25| 1| } 26| | 27| | //Will not be covered by unit tests 28| 0| func uncovered() -> Bool { 29| 0| return true 30| 0| } 31| | 32| | 33| |} 34| | /Users/Ibrahim/Desktop/codecov/swift-standard/standard-swift/SceneDelegate.swift: 1| |// 2| |// SceneDelegate.swift 3| |// standard-swift 4| |// 5| |// Created by Ibrahim on 7/9/19. 6| |// Copyright © 2019 Ibrahim. 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| 4| func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 18| 4| // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 19| 4| // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 20| 4| // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 21| 4| 22| 4| // Use a UIHostingController as window root view controller 23| 4| if let windowScene = scene as? UIWindowScene { 24| 4| let window = UIWindow(windowScene: windowScene) 25| 4| window.rootViewController = UIHostingController(rootView: ContentView()) 26| 4| self.window = window 27| 4| window.makeKeyAndVisible() 28| 4| } 29| 4| } 30| | 31| 0| func sceneDidDisconnect(_ scene: UIScene) { 32| 0| // Called as the scene is being released by the system. 33| 0| // This occurs shortly after the scene enters the background, or when its session is discarded. 34| 0| // Release any resources associated with this scene that can be re-created the next time the scene connects. 35| 0| // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). 36| 0| } 37| | 38| 4| func sceneDidBecomeActive(_ scene: UIScene) { 39| 4| // Called when the scene has moved from an inactive state to an active state. 40| 4| // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 41| 4| } 42| | 43| 0| func sceneWillResignActive(_ scene: UIScene) { 44| 0| // Called when the scene will move from an active state to an inactive state. 45| 0| // This may occur due to temporary interruptions (ex. an incoming phone call). 46| 0| } 47| | 48| 4| func sceneWillEnterForeground(_ scene: UIScene) { 49| 4| // Called as the scene transitions from the background to the foreground. 50| 4| // Use this method to undo the changes made on entering the background. 51| 4| } 52| | 53| 0| func sceneDidEnterBackground(_ scene: UIScene) { 54| 0| // Called as the scene transitions from the foreground to the background. 55| 0| // Use this method to save data, release shared resources, and store enough scene-specific state information 56| 0| // to restore the scene back to its current state. 57| 0| } 58| | 59| | 60| |} 61| |