-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from GO-SOPT-iOS-Part/2ndWeek_2
2주차 과제
- Loading branch information
Showing
34 changed files
with
768 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+1.87 KB
(110%)
...eproj/project.xcworkspace/xcuserdata/shinjiwon.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
} | ||
|
||
|
||
} | ||
|
11 changes: 11 additions & 0 deletions
11
2ndWeek/Assignment/Assignment/Assets.xcassets/AccentColor.colorset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
2ndWeek/Assignment/Assignment/Assets.xcassets/AppIcon.appiconset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
2ndWeek/Assignment/Assignment/Assets.xcassets/backBtn.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
Binary file added
BIN
+309 Bytes
2ndWeek/Assignment/Assignment/Assets.xcassets/backBtn.imageset/btn_before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
2ndWeek/Assignment/Assignment/Assets.xcassets/clearBtn.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
Binary file added
BIN
+775 Bytes
2ndWeek/Assignment/Assignment/Assets.xcassets/clearBtn.imageset/x-circle@3x 2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
2ndWeek/Assignment/Assignment/Assets.xcassets/eyeBtn.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
Binary file added
BIN
+670 Bytes
2ndWeek/Assignment/Assignment/Assets.xcassets/eyeBtn.imageset/eye@3x 1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
2ndWeek/Assignment/Assignment/Assets.xcassets/noeyeBtn.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
Binary file added
BIN
+912 Bytes
2ndWeek/Assignment/Assignment/Assets.xcassets/noeyeBtn.imageset/eye-slash@3x 2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
2ndWeek/Assignment/Assignment/Assets.xcassets/tvingLogo.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
Binary file added
BIN
+26.5 KB
2ndWeek/Assignment/Assignment/Assets.xcassets/tvingLogo.imageset/image 3-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10 KB
2ndWeek/Assignment/Assignment/Assets.xcassets/tvingLogo.imageset/image 3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10 KB
2ndWeek/Assignment/Assignment/Assets.xcassets/tvingLogo.imageset/image 4.png
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
} | ||
|
||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
Oops, something went wrong.