Skip to content

Commit

Permalink
SplashViewController added
Browse files Browse the repository at this point in the history
  • Loading branch information
DemidenGo committed Oct 17, 2023
1 parent 1774a64 commit c14603f
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 20 deletions.
20 changes: 16 additions & 4 deletions TradingView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,23 @@
/* Begin PBXBuildFile section */
92F5D90C2ADF18110065CA99 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92F5D90B2ADF18110065CA99 /* AppDelegate.swift */; };
92F5D90E2ADF18110065CA99 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92F5D90D2ADF18110065CA99 /* SceneDelegate.swift */; };
92F5D9102ADF18110065CA99 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92F5D90F2ADF18110065CA99 /* ViewController.swift */; };
92F5D9152ADF18120065CA99 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 92F5D9142ADF18120065CA99 /* Assets.xcassets */; };
92F5D9182ADF18120065CA99 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 92F5D9162ADF18120065CA99 /* LaunchScreen.storyboard */; };
92F5D9212ADF20890065CA99 /* TraderModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92F5D9202ADF20890065CA99 /* TraderModel.swift */; };
92F5D9272ADF330F0065CA99 /* SplashViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92F5D9262ADF330F0065CA99 /* SplashViewController.swift */; };
92F5D92A2ADF36080065CA99 /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92F5D9292ADF36080065CA99 /* Image.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
92F5D9082ADF18110065CA99 /* TradingView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TradingView.app; sourceTree = BUILT_PRODUCTS_DIR; };
92F5D90B2ADF18110065CA99 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
92F5D90D2ADF18110065CA99 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
92F5D90F2ADF18110065CA99 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
92F5D9142ADF18120065CA99 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
92F5D9172ADF18120065CA99 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
92F5D9192ADF18120065CA99 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
92F5D9202ADF20890065CA99 /* TraderModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TraderModel.swift; sourceTree = "<group>"; };
92F5D9262ADF330F0065CA99 /* SplashViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashViewController.swift; sourceTree = "<group>"; };
92F5D9292ADF36080065CA99 /* Image.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Image.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -58,8 +60,9 @@
children = (
92F5D90B2ADF18110065CA99 /* AppDelegate.swift */,
92F5D90D2ADF18110065CA99 /* SceneDelegate.swift */,
92F5D9262ADF330F0065CA99 /* SplashViewController.swift */,
92F5D91F2ADF204D0065CA99 /* Model */,
92F5D90F2ADF18110065CA99 /* ViewController.swift */,
92F5D9282ADF35F30065CA99 /* Resources */,
92F5D9142ADF18120065CA99 /* Assets.xcassets */,
92F5D9162ADF18120065CA99 /* LaunchScreen.storyboard */,
92F5D9192ADF18120065CA99 /* Info.plist */,
Expand All @@ -75,6 +78,14 @@
path = Model;
sourceTree = "<group>";
};
92F5D9282ADF35F30065CA99 /* Resources */ = {
isa = PBXGroup;
children = (
92F5D9292ADF36080065CA99 /* Image.swift */,
);
path = Resources;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -145,10 +156,11 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
92F5D9102ADF18110065CA99 /* ViewController.swift in Sources */,
92F5D90C2ADF18110065CA99 /* AppDelegate.swift in Sources */,
92F5D90E2ADF18110065CA99 /* SceneDelegate.swift in Sources */,
92F5D9212ADF20890065CA99 /* TraderModel.swift in Sources */,
92F5D9272ADF330F0065CA99 /* SplashViewController.swift in Sources */,
92F5D92A2ADF36080065CA99 /* Image.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
12 changes: 12 additions & 0 deletions TradingView/Resources/Image.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// Image.swift
// TradingView
//
// Created by Юрий Демиденко on 18.10.2023.
//

import UIKit

enum Images {
static let launchScreen = UIImage(named: "LaunchScreen")
}
5 changes: 4 additions & 1 deletion TradingView/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let _ = (scene as? UIWindowScene) else { return }
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: windowScene)
window?.rootViewController = SplashViewController()
window?.makeKeyAndVisible()
}
}
34 changes: 34 additions & 0 deletions TradingView/SplashViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// SplashViewController.swift
// TradingView
//
// Created by Юрий Демиденко on 18.10.2023.
//

import UIKit

final class SplashViewController: UIViewController {

private lazy var backgroundImageView: UIImageView = {
let imageView = UIImageView()
imageView.translatesAutoresizingMaskIntoConstraints = false
imageView.image = Images.launchScreen
imageView.contentMode = .scaleAspectFill
return imageView
}()

override func viewDidLoad() {
super.viewDidLoad()
setupConstraints()
}

private func setupConstraints() {
[backgroundImageView].forEach { view.addSubview($0) }
NSLayoutConstraint.activate([
backgroundImageView.topAnchor.constraint(equalTo: view.topAnchor),
backgroundImageView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
backgroundImageView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
backgroundImageView.trailingAnchor.constraint(equalTo: view.trailingAnchor)
])
}
}
15 changes: 0 additions & 15 deletions TradingView/ViewController.swift

This file was deleted.

0 comments on commit c14603f

Please sign in to comment.