Skip to content

Commit

Permalink
Merge pull request #9 from GO-SOPT-iOS-Part/2ndWeek_2
Browse files Browse the repository at this point in the history
2주차 과제
  • Loading branch information
ena-isme authored Jul 30, 2023
2 parents 48f07f7 + 93cd990 commit 9c78cb4
Show file tree
Hide file tree
Showing 34 changed files with 768 additions and 1 deletion.
Binary file modified 1stWeek/.DS_Store
Binary file not shown.
Binary file modified 1stWeek/Seminar/.DS_Store
Binary file not shown.
Binary file not shown.
36 changes: 36 additions & 0 deletions 2ndWeek/Assignment/Assignment/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// AppDelegate.swift
// Assignment
//
// Created by 신지원 on 2023/07/01.
//

import UIKit

@main
class AppDelegate: UIResponder, UIApplicationDelegate {



func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
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.
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.
}


}

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 6 additions & 0 deletions 2ndWeek/Assignment/Assignment/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "btn_before.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "x-circle@3x 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "eye@3x 1.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "eye-slash@3x 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "image 3.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "image 3-2.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "image 4.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
32 changes: 32 additions & 0 deletions 2ndWeek/Assignment/Assignment/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?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>UIAppFonts</key>
<array>
<string>Pretendard-Black.ttf</string>
<string>Pretendard-Bold.ttf</string>
<string>Pretendard-Light.ttf</string>
<string>Pretendard-Medium.ttf</string>
<string>Pretendard-Regular.ttf</string>
<string>Pretendard-Thin.ttf</string>
</array>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
</dict>
</array>
</dict>
</dict>
</dict>
</plist>
53 changes: 53 additions & 0 deletions 2ndWeek/Assignment/Assignment/SceneDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
//
// SceneDelegate.swift
// Assignment
//
// Created by 신지원 on 2023/07/01.
//

import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

var window: UIWindow?


func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
self.window = UIWindow(windowScene: windowScene)
let navigationController = UINavigationController(rootViewController: ViewController())
self.window?.rootViewController = navigationController
self.window?.makeKeyAndVisible()
}

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).
}

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.
}


}

74 changes: 74 additions & 0 deletions 2ndWeek/Assignment/Assignment/SecondViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//
// SecondViewController.swift
// Assignment
//
// Created by 신지원 on 2023/07/04.
//

import UIKit

class SecondViewController: UIViewController {

private var tvingLogoImage = UIImageView()
var showIdLabel = UILabel()
private var backButton = UIButton()

var id : String?
var nickname : String?

override func viewDidLoad() {
super.viewDidLoad()

setStyle()
setLayout()
// Do any additional setup after loading the view.
}

private func setStyle() {
view.addSubviews(tvingLogoImage,showIdLabel,backButton)
view.backgroundColor = .black

tvingLogoImage.then {
$0.image = UIImage(named: "tvingLogo")
}
showIdLabel.then {
guard let nickname = nickname else { return }

$0.text = "\(nickname)\n반가워요!"
$0.font = UIFont(name: "Pretendard-Bold", size: 23)
$0.textColor = .tvingGray1
$0.textAlignment = .center
$0.numberOfLines = 2
}
backButton.then {
$0.setTitle("메인으로", for: .normal)
$0.titleLabel?.font = UIFont(name: "Pretendard-Bold", size: 14)
$0.titleLabel?.textColor = .white
$0.layer.backgroundColor = UIColor.tvingRed.cgColor

$0.addTarget(self, action: #selector(backButtonTapped), for: .touchUpInside)
}
}

private func setLayout() {

tvingLogoImage.snp.makeConstraints {
$0.top.equalToSuperview().inset(58)
$0.width.equalToSuperview()
$0.height.equalTo(210)
}
showIdLabel.snp.makeConstraints {
$0.top.equalTo(tvingLogoImage.snp.bottom).offset(67)
$0.centerX.equalToSuperview()
}
backButton.snp.makeConstraints {
$0.top.equalTo(tvingLogoImage.snp.bottom).offset(425)
$0.height.equalTo(52)
$0.leading.trailing.equalToSuperview().inset(20)
}
}

@objc func backButtonTapped() {
self.dismiss(animated: true)
}
}
23 changes: 23 additions & 0 deletions 2ndWeek/Assignment/Assignment/StringExtension.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// StringExtension.swift
// Assignment
//
// Created by 신지원 on 2023/07/30.
//

import UIKit

extension String {
func isValidEmail() -> Bool {
let pattern = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}"

guard self.range(of: pattern, options: .regularExpression) != nil else { return false }
return true
}

func isOnlyKorean() -> Bool {
let pattern = "[가-힣]"
guard self.range(of: pattern, options: .regularExpression) != nil else { return false }
return true
}
}
Loading

0 comments on commit 9c78cb4

Please sign in to comment.