Skip to content

Commit

Permalink
Remove storyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikołaj Piechocki committed Oct 16, 2020
1 parent a55bc56 commit 09f892a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 108 deletions.
12 changes: 0 additions & 12 deletions ExampleApp/ExampleApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
8DA476A625399CFA00B79A0A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DA476A525399CFA00B79A0A /* AppDelegate.swift */; };
8DA476A825399CFA00B79A0A /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DA476A725399CFA00B79A0A /* SceneDelegate.swift */; };
8DA476AA25399CFA00B79A0A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DA476A925399CFA00B79A0A /* ViewController.swift */; };
8DA476AD25399CFA00B79A0A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8DA476AB25399CFA00B79A0A /* Main.storyboard */; };
8DA476AF25399CFD00B79A0A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8DA476AE25399CFD00B79A0A /* Assets.xcassets */; };
8DA476B225399CFD00B79A0A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8DA476B025399CFD00B79A0A /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
Expand All @@ -20,7 +19,6 @@
8DA476A525399CFA00B79A0A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
8DA476A725399CFA00B79A0A /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
8DA476A925399CFA00B79A0A /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
8DA476AC25399CFA00B79A0A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
8DA476AE25399CFD00B79A0A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
8DA476B125399CFD00B79A0A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
8DA476B325399CFD00B79A0A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -61,7 +59,6 @@
8DA476A525399CFA00B79A0A /* AppDelegate.swift */,
8DA476A725399CFA00B79A0A /* SceneDelegate.swift */,
8DA476A925399CFA00B79A0A /* ViewController.swift */,
8DA476AB25399CFA00B79A0A /* Main.storyboard */,
8DA476AE25399CFD00B79A0A /* Assets.xcassets */,
8DA476B025399CFD00B79A0A /* LaunchScreen.storyboard */,
8DA476B325399CFD00B79A0A /* Info.plist */,
Expand Down Expand Up @@ -128,7 +125,6 @@
files = (
8DA476B225399CFD00B79A0A /* LaunchScreen.storyboard in Resources */,
8DA476AF25399CFD00B79A0A /* Assets.xcassets in Resources */,
8DA476AD25399CFA00B79A0A /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -148,14 +144,6 @@
/* End PBXSourcesBuildPhase section */

/* Begin PBXVariantGroup section */
8DA476AB25399CFA00B79A0A /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
8DA476AC25399CFA00B79A0A /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
8DA476B025399CFD00B79A0A /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
Expand Down
25 changes: 7 additions & 18 deletions ExampleApp/ExampleApp/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,34 +1,23 @@
//
// AppDelegate.swift
// ExampleApp
//
// Created by Mikolaj Piechocki on 16/10/2020.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {



func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}

// MARK: UISceneSession Lifecycle

func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
func application(_ application: UIApplication,
configurationForConnecting connectingSceneSession: UISceneSession,
options: UIScene.ConnectionOptions) -> UISceneConfiguration {
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}

func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
func application(_ application: UIApplication,
didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
}


Expand Down
24 changes: 0 additions & 24 deletions ExampleApp/ExampleApp/Base.lproj/Main.storyboard

This file was deleted.

4 changes: 0 additions & 4 deletions ExampleApp/ExampleApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
Expand All @@ -43,8 +41,6 @@
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
Expand Down
45 changes: 4 additions & 41 deletions ExampleApp/ExampleApp/SceneDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,52 +1,15 @@
//
// SceneDelegate.swift
// ExampleApp
//
// Created by Mikolaj Piechocki on 16/10/2020.
//

import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

var window: UIWindow?


func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
}

func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
guard let scene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: scene)
window?.rootViewController = ViewController()
window?.makeKeyAndVisible()
}

func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}

func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}

func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}

func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}


}

10 changes: 1 addition & 9 deletions ExampleApp/ExampleApp/ViewController.swift
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
//
// ViewController.swift
// ExampleApp
//
// Created by Mikolaj Piechocki on 16/10/2020.
//

import UIKit

class ViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
view.backgroundColor = .blue
}


}

0 comments on commit 09f892a

Please sign in to comment.