-
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 #10 from GO-SOPT-iOS-Part/3rdWeek
3주차 세미나
- Loading branch information
Showing
15 changed files
with
587 additions
and
0 deletions.
There are no files selected for viewing
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 | ||
// Seminar | ||
// | ||
// Created by 신지원 on 2023/08/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
3rdWeek/Seminar/Seminar/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
3rdWeek/Seminar/Seminar/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
3rdWeek/Seminar/Seminar/Assets.xcassets/princess.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" : "스크린샷 2023-08-01 오후 2.53.09.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+1.86 MB
...eminar/Seminar/Assets.xcassets/princess.imageset/스크린샷 2023-08-01 오후 2.53.09.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,26 @@ | ||
// | ||
// BaseView.swift | ||
// Seminar | ||
// | ||
// Created by 신지원 on 2023/08/01. | ||
// | ||
|
||
import UIKit | ||
|
||
class BaseView: UIView { | ||
|
||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
|
||
setStyle() | ||
setLayout() | ||
} | ||
|
||
@available(*, unavailable) | ||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
func setStyle() {} | ||
func setLayout() {} | ||
} |
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,58 @@ | ||
// | ||
// BaseViewController.swift | ||
// Seminar | ||
// | ||
// Created by 신지원 on 2023/08/01. | ||
// | ||
|
||
import UIKit | ||
|
||
class BaseViewController: UIViewController { | ||
|
||
// MARK: Properties | ||
|
||
lazy private(set) var className: String = { | ||
return type(of: self).description().components(separatedBy: ".").last ?? "" | ||
}() | ||
|
||
// MARK: Initializing | ||
|
||
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { | ||
super.init(nibName: nil, bundle: nil) | ||
} | ||
|
||
@available(*, unavailable) | ||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
deinit { | ||
print("DEINIT: \(className)") | ||
} | ||
|
||
// MARK: Life Cycle | ||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
setStyle() | ||
setLayout() | ||
} | ||
|
||
override func viewWillAppear(_ animated: Bool) { | ||
super.viewWillAppear(animated) | ||
|
||
navigationController?.setNavigationBarHidden(true, animated: true) | ||
} | ||
|
||
// MARK: UI | ||
|
||
/// Attributes (속성) 설정 메서드 | ||
func setStyle() { | ||
|
||
view.backgroundColor = .white | ||
} | ||
|
||
/// Hierarchy, Constraints (계층 및 제약조건) 설정 메서드 | ||
func setLayout() {} | ||
|
||
} |
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,64 @@ | ||
// | ||
// CarrotData.swift | ||
// Seminar | ||
// | ||
// Created by 신지원 on 2023/08/01. | ||
// | ||
|
||
import UIKit | ||
|
||
extension Carrot { | ||
|
||
static func dummy() -> [Carrot] { | ||
return [Carrot(image: .princess, | ||
product: "에어팟 프로 2", | ||
place: "하계 2동", | ||
time: "일주일 전", | ||
tradeStatus: .completed, | ||
price: 200000), | ||
Carrot(image: .princess, | ||
product: | ||
"아이폰 11 Pro", | ||
place: "하계 3동", | ||
time: "4월 2일", | ||
tradeStatus: .reservation, | ||
price: 100000), | ||
Carrot(image: .princess, | ||
product: | ||
"에어팟 맥스", | ||
place: "공릉 2동", | ||
time: "1일 전", | ||
tradeStatus: .shared, | ||
price: 100000), | ||
Carrot(image: .princess, | ||
product: | ||
"아이패드1", | ||
place: "공릉 1동", | ||
time: "6시간 전", | ||
tradeStatus: .completed, | ||
price: 100000), | ||
Carrot(image: .princess, | ||
product: | ||
"아이패드 2", | ||
place: "중계 2동", | ||
time: "3시간 전", | ||
tradeStatus: .clear, | ||
price: 100000) | ||
, | ||
Carrot(image: .princess, | ||
product: | ||
"안팔아요", | ||
place: "중계 2동", | ||
time: "4월 3일", | ||
tradeStatus: .completed, | ||
price: 10000) | ||
, | ||
Carrot(image: .princess, | ||
product: | ||
"아이폰 14 Pro", | ||
place: "중계 2동", | ||
time: "3월 31일", | ||
tradeStatus: .reservation, | ||
price: 1000)] | ||
} | ||
} |
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,51 @@ | ||
// | ||
// CarrotEnum.swift | ||
// Seminar | ||
// | ||
// Created by 신지원 on 2023/08/01. | ||
// | ||
|
||
import UIKit | ||
|
||
struct Carrot { | ||
let image: UIImage | ||
let product: String | ||
let place: String | ||
let time: String | ||
let tradeStatus: Trade | ||
let price: Int | ||
} | ||
|
||
@frozen | ||
enum Trade { | ||
case reservation | ||
case completed | ||
case shared | ||
case clear | ||
|
||
var title: String { | ||
switch self { | ||
case .reservation: | ||
return "예약중" | ||
case .completed: | ||
return "거래완료" | ||
case .shared: | ||
return "나눔완료" | ||
case .clear: | ||
return "거래중" | ||
} | ||
} | ||
|
||
var backgroundColor: UIColor { | ||
switch self { | ||
case .reservation: | ||
return .gray | ||
case .completed: | ||
return .black | ||
case .shared: | ||
return .black | ||
case .clear: | ||
return .systemGreen | ||
} | ||
} | ||
} |
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,14 @@ | ||
// | ||
// CarrotImage.swift | ||
// Seminar | ||
// | ||
// Created by 신지원 on 2023/08/01. | ||
// | ||
|
||
import UIKit.UIImage | ||
|
||
extension UIImage { | ||
|
||
static var princess: UIImage { UIImage(named: "princess")! } | ||
|
||
} |
Oops, something went wrong.