Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#5] 스플래시 화면 구현 #12

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions TodayVideo/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'TodayVideo' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

# Pods for TodayVideo
pod 'SnapKit'
target 'TodayVideoTests' do
inherit! :search_paths
# Pods for testing
end

target 'TodayVideoUITests' do
# Pods for testing
end

end
16 changes: 16 additions & 0 deletions TodayVideo/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
PODS:
- SnapKit (5.7.1)

DEPENDENCIES:
- SnapKit

SPEC REPOS:
trunk:
- SnapKit

SPEC CHECKSUMS:
SnapKit: d612e99e678a2d3b95bf60b0705ed0a35c03484a

PODFILE CHECKSUM: 5fd0e82f9fae1f129233777aee57aa7cc753fb9d

COCOAPODS: 1.16.2
206 changes: 183 additions & 23 deletions TodayVideo/TodayVideo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions TodayVideo/TodayVideo.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
32 changes: 32 additions & 0 deletions TodayVideo/TodayVideo/Extension/UIColor+Extensions.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// UIColor+Extensions.swift
// TodayVideo
//
// Created by iOS Dev on 1/15/25.
//

import UIKit

extension UIColor {
// SplashView
static let background = UIColor(hex: "#070202") ?? .black
static let title1 = UIColor(hex: "#4AFFF3") ?? .red
static let title2 = UIColor(hex: "#264CA5") ?? .red
static let title3 = UIColor(hex: "#000000") ?? .black
}

extension UIColor {
public convenience init?(hex: String) {
let hexFormatted = hex.trimmingCharacters(in: .whitespacesAndNewlines).replacingOccurrences(of: "#", with: "")
let hexSize = 6
guard hexFormatted.count == hexSize,
let hexNumber = UInt64(hexFormatted, radix: 16) else {
return nil
}
let red = CGFloat((hexNumber & 0xFF0000) >> 16) / 255.0
let green = CGFloat((hexNumber & 0x00FF00) >> 8) / 255.0
let blue = CGFloat(hexNumber & 0x0000FF) / 255.0

self.init(red: red, green: green, blue: blue, alpha: 1.0)
}
}
24 changes: 24 additions & 0 deletions TodayVideo/TodayVideo/SplashView/SplashPresenter.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// Presenter.swift
// TodayVideo
//
// Created by iOS Dev on 12/30/24.
//

import UIKit

protocol SplashPresenterProtocol {
func pushToContentsView()
}

final class SplashPresenter: SplashPresenterProtocol {
var router: SplashRouterProtocol?

func pushToContentsView() {
let freezeMargin = 2.0

DispatchQueue.main.asyncAfter(deadline: .now() + freezeMargin) {
self.router?.pushToContentsView()
}
}
}
32 changes: 32 additions & 0 deletions TodayVideo/TodayVideo/SplashView/SplashRouter.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// Router.swift
// TodayVideo
//
// Created by iOS Dev on 12/30/24.
//

import UIKit

protocol SplashRouterProtocol {
func pushToContentsView()
}

final class SplashRouter: SplashRouterProtocol {
weak var splashView: SplashView?

static func createSplashViewModule() -> SplashView {
let view = SplashView()
var presenter = SplashPresenter()
let router = SplashRouter()

view.presenter = presenter
presenter.router = router

return view
}

func pushToContentsView() {
// 영화, 드라마 선택화면으로 push
splashView?.navigationController?.setViewControllers([UIViewController()], animated: true)
}
}
51 changes: 51 additions & 0 deletions TodayVideo/TodayVideo/SplashView/SplashView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// ViewController.swift
// TodayVideo
//
// Created by iOS Dev on 12/30/24.
//

import UIKit
import SnapKit

final class SplashView: UIViewController {
var presenter: SplashPresenterProtocol?

override func viewDidLoad() {
super.viewDidLoad()

drawUI()
}

func drawUI() {
self.view.backgroundColor = .background

let title1 = UILabel()
let title2 = UILabel()
let title3 = UILabel()

[title1, title2, title3].forEach { title in
title.text = "오늘뭐봄?!"
title.font = .systemFont(ofSize: 48.0, weight: .black)
title.textAlignment = .center
self.view.addSubview(title)
}

title1.textColor = .title1
title2.textColor = .title2
title3.textColor = .title3

title3.snp.makeConstraints { make in
make.center.equalToSuperview()
}
title2.snp.makeConstraints { make in
make.centerX.equalTo(title3.snp.centerX).offset(2)
make.centerY.equalTo(title3)
}
title1.snp.makeConstraints { make in
make.centerX.equalTo(title3.snp.centerX).offset(-4)
make.centerY.equalTo(title3)
}
}
}

8 changes: 0 additions & 8 deletions TodayVideo/TodayVideo/View/Entity.swift

This file was deleted.

8 changes: 0 additions & 8 deletions TodayVideo/TodayVideo/View/Interactor.swift

This file was deleted.

8 changes: 0 additions & 8 deletions TodayVideo/TodayVideo/View/Presenter.swift

This file was deleted.

8 changes: 0 additions & 8 deletions TodayVideo/TodayVideo/View/Router.swift

This file was deleted.

19 changes: 0 additions & 19 deletions TodayVideo/TodayVideo/View/View.swift

This file was deleted.

Loading