Skip to content
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
8 changes: 6 additions & 2 deletions Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
CE665612295D92E400C64E12 /* UserDefaultWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE665611295D92E400C64E12 /* UserDefaultWrapper.swift */; };
CE665615295D989A00C64E12 /* .swiftlint.yml in Resources */ = {isa = PBXBuildFile; fileRef = CE665614295D989A00C64E12 /* .swiftlint.yml */; };
CEC2A6852961F92C00160BF7 /* CustomButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEC2A6842961F92C00160BF7 /* CustomButton.swift */; };
CEC2A68729629B9B00160BF7 /* SignInVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEC2A68629629B9B00160BF7 /* SignInVC.swift */; };
CEEC6B3A2961C4F300D00E1E /* CourseDrawingHomeVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEEC6B392961C4F300D00E1E /* CourseDrawingHomeVC.swift */; };
CEEC6B3C2961C51A00D00E1E /* CourseStorageVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEEC6B3B2961C51A00D00E1E /* CourseStorageVC.swift */; };
CEEC6B3E2961C53700D00E1E /* CourseDiscoveryVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEEC6B3D2961C53700D00E1E /* CourseDiscoveryVC.swift */; };
Expand Down Expand Up @@ -98,7 +99,6 @@
CE6655C0295D82F000C64E12 /* .gitkeep */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitkeep; sourceTree = "<group>"; };
CE6655C1295D82F700C64E12 /* .gitkeep */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitkeep; sourceTree = "<group>"; };
CE6655C5295D83B700C64E12 /* .gitkeep */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitkeep; sourceTree = "<group>"; };
CE6655C6295D83BD00C64E12 /* .gitkeep */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitkeep; sourceTree = "<group>"; };
CE6655C7295D849F00C64E12 /* StringLiterals.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringLiterals.swift; sourceTree = "<group>"; };
CE6655C9295D84DD00C64E12 /* UserDefaultKeyList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultKeyList.swift; sourceTree = "<group>"; };
CE6655CC295D856300C64E12 /* KeyPathFindable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyPathFindable.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -137,6 +137,7 @@
CE665611295D92E400C64E12 /* UserDefaultWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultWrapper.swift; sourceTree = "<group>"; };
CE665614295D989A00C64E12 /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = "<group>"; };
CEC2A6842961F92C00160BF7 /* CustomButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomButton.swift; sourceTree = "<group>"; };
CEC2A68629629B9B00160BF7 /* SignInVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInVC.swift; sourceTree = "<group>"; };
CEEC6B392961C4F300D00E1E /* CourseDrawingHomeVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDrawingHomeVC.swift; sourceTree = "<group>"; };
CEEC6B3B2961C51A00D00E1E /* CourseStorageVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseStorageVC.swift; sourceTree = "<group>"; };
CEEC6B3D2961C53700D00E1E /* CourseDiscoveryVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDiscoveryVC.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -530,7 +531,7 @@
CE6655C3295D837800C64E12 /* VC */ = {
isa = PBXGroup;
children = (
CE6655C6295D83BD00C64E12 /* .gitkeep */,
CEC2A68629629B9B00160BF7 /* SignInVC.swift */,
);
path = VC;
sourceTree = "<group>";
Expand Down Expand Up @@ -741,6 +742,7 @@
files = (
CE665604295D91B100C64E12 /* makeAlert.swift in Sources */,
CE6655EA295D88B200C64E12 /* UITabBar+.swift in Sources */,
CEC2A68729629B9B00160BF7 /* SignInVC.swift in Sources */,
CE665602295D918000C64E12 /* JsonCoder.swift in Sources */,
CE4545CD295D7AF4003201E1 /* TaBarController.swift in Sources */,
CE6655F4295D898400C64E12 /* UIViewController+.swift in Sources */,
Expand Down Expand Up @@ -931,6 +933,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 9K86FQHDLU;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "Runnect-iOS/Info.plist";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
Expand Down Expand Up @@ -958,6 +961,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 9K86FQHDLU;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "Runnect-iOS/Info.plist";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
Expand Down
4 changes: 4 additions & 0 deletions Runnect-iOS/Runnect-iOS/Global/Literal/ColorLiterals.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
import UIKit

extension UIColor {
static var w1: UIColor {
return UIColor(hex: "#ffffff")
}

static var g1: UIColor {
return UIColor(hex: "#171717")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -11,15 +14,38 @@
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_background" translatesAutoresizingMaskIntoConstraints="NO" id="0oE-j0-KDA">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_logo" translatesAutoresizingMaskIntoConstraints="NO" id="Z8W-1P-2mg">
<rect key="frame" x="89.666666666666686" y="417.66666666666669" width="214" height="42"/>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="0oE-j0-KDA" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="42h-lb-ieb"/>
<constraint firstItem="Z8W-1P-2mg" firstAttribute="centerY" secondItem="6Tk-OE-BBY" secondAttribute="centerY" id="SOA-ru-Dph"/>
<constraint firstItem="0oE-j0-KDA" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="T2w-Of-0sD"/>
<constraint firstAttribute="bottom" secondItem="0oE-j0-KDA" secondAttribute="bottom" id="bPQ-DZ-KPC"/>
<constraint firstItem="Z8W-1P-2mg" firstAttribute="centerX" secondItem="6Tk-OE-BBY" secondAttribute="centerX" id="squ-2z-sDo"/>
<constraint firstAttribute="trailing" secondItem="0oE-j0-KDA" secondAttribute="trailing" id="wK0-Z4-ueA"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="img_background" width="390" height="844"/>
<image name="img_logo" width="214" height="42"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
guard let windowScene = (scene as? UIWindowScene) else { return }

let window = UIWindow(windowScene: windowScene)
window.rootViewController = TabBarController()
window.rootViewController = UINavigationController(rootViewController: SplashVC())
self.window = window
window.makeKeyAndVisible()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ extension CustomButton {
self.layer.cornerRadius = 10

self.setBackgroundColor(.m1, for: .normal)
self.setBackgroundColor(.g2, for: .disabled)
self.setBackgroundColor(.g3, for: .disabled)
self.setAttributedTitle(
NSAttributedString(
string: title,
Expand Down
Empty file.
126 changes: 126 additions & 0 deletions Runnect-iOS/Runnect-iOS/Presentation/SignIn/VC/SignInVC.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
//
// SignInVC.swift
// Runnect-iOS
//
// Created by sejin on 2023/01/02.
//

import UIKit

final class SignInVC: UIViewController {

// MARK: - Properties

private let nicknameMaxLength = 7

// MARK: - UI Components

private let directionLabel = UILabel().then {
let attributedString = NSMutableAttributedString(string: "RUNNECT", attributes: [.font: UIFont.h2, .foregroundColor: UIColor.m1])
attributedString.append(NSAttributedString(string: "에서\n사용할 이름을 입력해주세요", attributes: [.font: UIFont.h2_2, .foregroundColor: UIColor.g1]))
$0.attributedText = attributedString
$0.numberOfLines = 2
}

private let personImageView = UIImageView().then {
$0.image = ImageLiterals.imgPerson
$0.backgroundColor = .w1
$0.clipsToBounds = true
}

private lazy var nicknameTextField = UITextField().then {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.alignment = .center
$0.attributedPlaceholder = NSAttributedString(string: "닉네임을 입력해주세요", attributes: [.font: UIFont.h5, .foregroundColor: UIColor.g3, .paragraphStyle: paragraphStyle])
$0.font = .h5
$0.textColor = .g1
$0.textAlignment = .center
$0.layer.cornerRadius = 10
$0.layer.borderWidth = 1
$0.layer.borderColor = UIColor.g3.cgColor
$0.addTarget(self, action: #selector(textFieldTextDidChange), for: .editingChanged)
}

private let startButton = CustomButton(title: "시작하기").setEnabled(false)

// MARK: - View Life Cycle

override func viewDidLoad() {
super.viewDidLoad()
self.setUI()
self.setLayout()
self.setDelegate()
}
}

// MARK: - Methods

extension SignInVC {
private func setDelegate() {
self.nicknameTextField.delegate = self
}

private func changeTextFieldLayerColor(_ isEditing: Bool) {
nicknameTextField.layer.borderColor = isEditing ? UIColor.m1.cgColor : UIColor.g3.cgColor
}
}

// MARK: - @objc Function

extension SignInVC {
@objc private func textFieldTextDidChange() {
guard let text = nicknameTextField.text else { return }

startButton.isEnabled = !text.isEmpty
changeTextFieldLayerColor(!text.isEmpty)

if text.count > nicknameMaxLength {
let index = text.index(text.startIndex, offsetBy: nicknameMaxLength)
let newString = text[text.startIndex..<index]
self.nicknameTextField.text = String(newString)
}
}
}

// MARK: - UI & Layout

extension SignInVC {
private func setUI() {
view.backgroundColor = .w1
}

private func setLayout() {
view.addSubviews(directionLabel, personImageView, nicknameTextField, startButton)

directionLabel.snp.makeConstraints { make in
make.top.equalTo(view.safeAreaLayoutGuide).inset(60)
make.leading.equalTo(view.safeAreaLayoutGuide).inset(24)
}

personImageView.snp.makeConstraints { make in
make.centerX.equalTo(view.safeAreaLayoutGuide)
make.top.equalTo(directionLabel.snp.bottom).offset(93.adjustedH)
}

nicknameTextField.snp.makeConstraints { make in
make.top.equalTo(personImageView.snp.bottom).offset(34)
make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(30)
make.height.equalTo(44)
}

startButton.snp.makeConstraints { make in
make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(30)
make.bottom.equalToSuperview().inset(34)
make.height.equalTo(44)
}
}
}

// MARK: - UITextFieldDelegate

extension SignInVC: UITextFieldDelegate {
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.resignFirstResponder()
return true
}
}
58 changes: 57 additions & 1 deletion Runnect-iOS/Runnect-iOS/Presentation/Splash/VC/SplashVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,65 @@

import UIKit

class SplashVC: UIViewController {
import SnapKit
import Then

final class SplashVC: UIViewController {

// MARK: - UI Components

private let backgroundImageView = UIImageView().then {
$0.image = ImageLiterals.imgBackground
$0.contentMode = .scaleAspectFill
}

private let logoImageView = UIImageView().then {
$0.image = ImageLiterals.imgLogo
$0.contentMode = .scaleAspectFill
}

// MARK: - View Life Cycle

override func viewDidLoad() {
super.viewDidLoad()
self.setUI()
self.setNavigationBar()
self.setLayout()
self.pushToSignInView()
}
}

// MARK: - Methods

extension SplashVC {
private func pushToSignInView() {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
let signInVC = SignInVC()
self.navigationController?.pushViewController(signInVC, animated: true)
}
}
}

// MARK: - UI & Layout

extension SplashVC {
private func setUI() {
view.backgroundColor = .m1
}

private func setNavigationBar() {
self.navigationController?.isNavigationBarHidden = true
}

private func setLayout() {
view.addSubviews(backgroundImageView, logoImageView)

backgroundImageView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}

logoImageView.snp.makeConstraints { make in
make.center.equalTo(view.safeAreaLayoutGuide)
}
}
}