Skip to content
Open
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
169 changes: 163 additions & 6 deletions Kream.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,29 @@

/* Begin PBXBuildFile section */
5239955B2CAEF016005A358A /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = 5239955A2CAEF016005A358A /* SnapKit */; };
52A7C0F82CEB6F5400F668E3 /* CombineMoya in Frameworks */ = {isa = PBXBuildFile; productRef = 52A7C0F72CEB6F5400F668E3 /* CombineMoya */; };
52A7C0FA2CEB6F5400F668E3 /* Moya in Frameworks */ = {isa = PBXBuildFile; productRef = 52A7C0F92CEB6F5400F668E3 /* Moya */; };
52A7C0FC2CEB6F5400F668E3 /* ReactiveMoya in Frameworks */ = {isa = PBXBuildFile; productRef = 52A7C0FB2CEB6F5400F668E3 /* ReactiveMoya */; };
52A7C0FE2CEB6F5400F668E3 /* RxMoya in Frameworks */ = {isa = PBXBuildFile; productRef = 52A7C0FD2CEB6F5400F668E3 /* RxMoya */; };
52C6308B2CE1FF740098C775 /* KakaoSDK in Frameworks */ = {isa = PBXBuildFile; productRef = 52C6308A2CE1FF740098C775 /* KakaoSDK */; };
52C6308D2CE1FF740098C775 /* KakaoSDKAuth in Frameworks */ = {isa = PBXBuildFile; productRef = 52C6308C2CE1FF740098C775 /* KakaoSDKAuth */; };
52C6308F2CE1FF740098C775 /* KakaoSDKCert in Frameworks */ = {isa = PBXBuildFile; productRef = 52C6308E2CE1FF740098C775 /* KakaoSDKCert */; };
52C630912CE1FF740098C775 /* KakaoSDKCertCore in Frameworks */ = {isa = PBXBuildFile; productRef = 52C630902CE1FF740098C775 /* KakaoSDKCertCore */; };
52C630932CE1FF740098C775 /* KakaoSDKCommon in Frameworks */ = {isa = PBXBuildFile; productRef = 52C630922CE1FF740098C775 /* KakaoSDKCommon */; };
52C630952CE1FF740098C775 /* KakaoSDKFriend in Frameworks */ = {isa = PBXBuildFile; productRef = 52C630942CE1FF740098C775 /* KakaoSDKFriend */; };
52C630972CE1FF740098C775 /* KakaoSDKFriendCore in Frameworks */ = {isa = PBXBuildFile; productRef = 52C630962CE1FF740098C775 /* KakaoSDKFriendCore */; };
52C630992CE1FF740098C775 /* KakaoSDKNavi in Frameworks */ = {isa = PBXBuildFile; productRef = 52C630982CE1FF740098C775 /* KakaoSDKNavi */; };
52C6309B2CE1FF740098C775 /* KakaoSDKShare in Frameworks */ = {isa = PBXBuildFile; productRef = 52C6309A2CE1FF740098C775 /* KakaoSDKShare */; };
52C6309D2CE1FF740098C775 /* KakaoSDKTalk in Frameworks */ = {isa = PBXBuildFile; productRef = 52C6309C2CE1FF740098C775 /* KakaoSDKTalk */; };
52C6309F2CE1FF740098C775 /* KakaoSDKTemplate in Frameworks */ = {isa = PBXBuildFile; productRef = 52C6309E2CE1FF740098C775 /* KakaoSDKTemplate */; };
52C630A12CE1FF740098C775 /* KakaoSDKUser in Frameworks */ = {isa = PBXBuildFile; productRef = 52C630A02CE1FF740098C775 /* KakaoSDKUser */; };
52C630E02CE4320C0098C775 /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = 52C630DF2CE4320C0098C775 /* KeychainAccess */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
52C34CF12CA47B3E00DB8986 /* Kream.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Kream.app; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */


/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
52C34D032CA47B4000DB8986 /* Exceptions for "Kream" folder in "Kream" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
Expand All @@ -31,11 +47,6 @@
exceptions = (
52C34D032CA47B4000DB8986 /* Exceptions for "Kream" folder in "Kream" target */,
);

/* Begin PBXFileSystemSynchronizedRootGroup section */
52C34CF32CA47B3E00DB8986 /* Kream */ = {
isa = PBXFileSystemSynchronizedRootGroup;

path = Kream;
sourceTree = "<group>";
};
Expand All @@ -47,6 +58,23 @@
buildActionMask = 2147483647;
files = (
5239955B2CAEF016005A358A /* SnapKit in Frameworks */,
52C630952CE1FF740098C775 /* KakaoSDKFriend in Frameworks */,
52C630E02CE4320C0098C775 /* KeychainAccess in Frameworks */,
52A7C0FC2CEB6F5400F668E3 /* ReactiveMoya in Frameworks */,
52C6308B2CE1FF740098C775 /* KakaoSDK in Frameworks */,
52C630992CE1FF740098C775 /* KakaoSDKNavi in Frameworks */,
52A7C0FE2CEB6F5400F668E3 /* RxMoya in Frameworks */,
52C630912CE1FF740098C775 /* KakaoSDKCertCore in Frameworks */,
52C6309F2CE1FF740098C775 /* KakaoSDKTemplate in Frameworks */,
52C630972CE1FF740098C775 /* KakaoSDKFriendCore in Frameworks */,
52A7C0F82CEB6F5400F668E3 /* CombineMoya in Frameworks */,
52C6308D2CE1FF740098C775 /* KakaoSDKAuth in Frameworks */,
52A7C0FA2CEB6F5400F668E3 /* Moya in Frameworks */,
52C630A12CE1FF740098C775 /* KakaoSDKUser in Frameworks */,
52C6309D2CE1FF740098C775 /* KakaoSDKTalk in Frameworks */,
52C6309B2CE1FF740098C775 /* KakaoSDKShare in Frameworks */,
52C630932CE1FF740098C775 /* KakaoSDKCommon in Frameworks */,
52C6308F2CE1FF740098C775 /* KakaoSDKCert in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -90,6 +118,23 @@
name = Kream;
packageProductDependencies = (
5239955A2CAEF016005A358A /* SnapKit */,
52C6308A2CE1FF740098C775 /* KakaoSDK */,
52C6308C2CE1FF740098C775 /* KakaoSDKAuth */,
52C6308E2CE1FF740098C775 /* KakaoSDKCert */,
52C630902CE1FF740098C775 /* KakaoSDKCertCore */,
52C630922CE1FF740098C775 /* KakaoSDKCommon */,
52C630942CE1FF740098C775 /* KakaoSDKFriend */,
52C630962CE1FF740098C775 /* KakaoSDKFriendCore */,
52C630982CE1FF740098C775 /* KakaoSDKNavi */,
52C6309A2CE1FF740098C775 /* KakaoSDKShare */,
52C6309C2CE1FF740098C775 /* KakaoSDKTalk */,
52C6309E2CE1FF740098C775 /* KakaoSDKTemplate */,
52C630A02CE1FF740098C775 /* KakaoSDKUser */,
52C630DF2CE4320C0098C775 /* KeychainAccess */,
52A7C0F72CEB6F5400F668E3 /* CombineMoya */,
52A7C0F92CEB6F5400F668E3 /* Moya */,
52A7C0FB2CEB6F5400F668E3 /* ReactiveMoya */,
52A7C0FD2CEB6F5400F668E3 /* RxMoya */,
);
productName = Kream;
productReference = 52C34CF12CA47B3E00DB8986 /* Kream.app */;
Expand Down Expand Up @@ -121,6 +166,9 @@
minimizedProjectReferenceProxies = 1;
packageReferences = (
523995592CAEF016005A358A /* XCRemoteSwiftPackageReference "SnapKit" */,
52C630892CE1FF740098C775 /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */,
52C630DE2CE4320C0098C775 /* XCRemoteSwiftPackageReference "KeychainAccess" */,
52A7C0F62CEB6F5400F668E3 /* XCRemoteSwiftPackageReference "Moya" */,
);
preferredProjectObjectVersion = 77;
productRefGroup = 52C34CF22CA47B3E00DB8986 /* Products */;
Expand Down Expand Up @@ -356,6 +404,30 @@
minimumVersion = 5.7.1;
};
};
52A7C0F62CEB6F5400F668E3 /* XCRemoteSwiftPackageReference "Moya" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/Moya/Moya";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 15.0.3;
};
};
52C630892CE1FF740098C775 /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/kakao/kakao-ios-sdk";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 2.23.0;
};
};
52C630DE2CE4320C0098C775 /* XCRemoteSwiftPackageReference "KeychainAccess" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/kishikawakatsumi/KeychainAccess";
requirement = {
branch = master;
kind = branch;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
Expand All @@ -364,6 +436,91 @@
package = 523995592CAEF016005A358A /* XCRemoteSwiftPackageReference "SnapKit" */;
productName = SnapKit;
};
52A7C0F72CEB6F5400F668E3 /* CombineMoya */ = {
isa = XCSwiftPackageProductDependency;
package = 52A7C0F62CEB6F5400F668E3 /* XCRemoteSwiftPackageReference "Moya" */;
productName = CombineMoya;
};
52A7C0F92CEB6F5400F668E3 /* Moya */ = {
isa = XCSwiftPackageProductDependency;
package = 52A7C0F62CEB6F5400F668E3 /* XCRemoteSwiftPackageReference "Moya" */;
productName = Moya;
};
52A7C0FB2CEB6F5400F668E3 /* ReactiveMoya */ = {
isa = XCSwiftPackageProductDependency;
package = 52A7C0F62CEB6F5400F668E3 /* XCRemoteSwiftPackageReference "Moya" */;
productName = ReactiveMoya;
};
52A7C0FD2CEB6F5400F668E3 /* RxMoya */ = {
isa = XCSwiftPackageProductDependency;
package = 52A7C0F62CEB6F5400F668E3 /* XCRemoteSwiftPackageReference "Moya" */;
productName = RxMoya;
};
52C6308A2CE1FF740098C775 /* KakaoSDK */ = {
isa = XCSwiftPackageProductDependency;
package = 52C630892CE1FF740098C775 /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */;
productName = KakaoSDK;
};
52C6308C2CE1FF740098C775 /* KakaoSDKAuth */ = {
isa = XCSwiftPackageProductDependency;
package = 52C630892CE1FF740098C775 /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */;
productName = KakaoSDKAuth;
};
52C6308E2CE1FF740098C775 /* KakaoSDKCert */ = {
isa = XCSwiftPackageProductDependency;
package = 52C630892CE1FF740098C775 /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */;
productName = KakaoSDKCert;
};
52C630902CE1FF740098C775 /* KakaoSDKCertCore */ = {
isa = XCSwiftPackageProductDependency;
package = 52C630892CE1FF740098C775 /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */;
productName = KakaoSDKCertCore;
};
52C630922CE1FF740098C775 /* KakaoSDKCommon */ = {
isa = XCSwiftPackageProductDependency;
package = 52C630892CE1FF740098C775 /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */;
productName = KakaoSDKCommon;
};
52C630942CE1FF740098C775 /* KakaoSDKFriend */ = {
isa = XCSwiftPackageProductDependency;
package = 52C630892CE1FF740098C775 /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */;
productName = KakaoSDKFriend;
};
52C630962CE1FF740098C775 /* KakaoSDKFriendCore */ = {
isa = XCSwiftPackageProductDependency;
package = 52C630892CE1FF740098C775 /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */;
productName = KakaoSDKFriendCore;
};
52C630982CE1FF740098C775 /* KakaoSDKNavi */ = {
isa = XCSwiftPackageProductDependency;
package = 52C630892CE1FF740098C775 /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */;
productName = KakaoSDKNavi;
};
52C6309A2CE1FF740098C775 /* KakaoSDKShare */ = {
isa = XCSwiftPackageProductDependency;
package = 52C630892CE1FF740098C775 /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */;
productName = KakaoSDKShare;
};
52C6309C2CE1FF740098C775 /* KakaoSDKTalk */ = {
isa = XCSwiftPackageProductDependency;
package = 52C630892CE1FF740098C775 /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */;
productName = KakaoSDKTalk;
};
52C6309E2CE1FF740098C775 /* KakaoSDKTemplate */ = {
isa = XCSwiftPackageProductDependency;
package = 52C630892CE1FF740098C775 /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */;
productName = KakaoSDKTemplate;
};
52C630A02CE1FF740098C775 /* KakaoSDKUser */ = {
isa = XCSwiftPackageProductDependency;
package = 52C630892CE1FF740098C775 /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */;
productName = KakaoSDKUser;
};
52C630DF2CE4320C0098C775 /* KeychainAccess */ = {
isa = XCSwiftPackageProductDependency;
package = 52C630DE2CE4320C0098C775 /* XCRemoteSwiftPackageReference "KeychainAccess" */;
productName = KeychainAccess;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 52C34CE92CA47B3E00DB8986 /* Project object */;
Expand Down
11 changes: 7 additions & 4 deletions Kream/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import UIKit
import KakaoSDKCommon

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Kakao SDK 초기화
KakaoSDK.initSDK(appKey: "2c8ab94e144d90c1bb9598fb2443dea1")

// 윈도우 생성 및 설정
window = UIWindow(frame: UIScreen.main.bounds)
// ProductDetailViewController를 루트 뷰 컨트롤러로 설정
let productDetailViewController = ProductDetailViewController()
let navigationController = UINavigationController(rootViewController: productDetailViewController)

// ProductDetailViewController를 루트 뷰 컨트롤러로 설정
let loginViewController = LoginViewController()
let navigationController = UINavigationController(rootViewController: loginViewController)
window?.rootViewController = navigationController

window?.makeKeyAndVisible()

return true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
{
"images" : [
{

"filename" : "mypage_icon.png",

"idiom" : "universal",
"scale" : "1x"
},
{

"idiom" : "universal",
"scale" : "2x"
},
{

"filename" : "my_icon 2.png",

"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
13 changes: 13 additions & 0 deletions Kream/Models/KeywordModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// Untitled.swift
// Kream
//
// Created by 임소은 on 11/18/24.
//

import Foundation


struct NewKeywordModel {
let keyword: String
}
25 changes: 0 additions & 25 deletions Kream/Models/LoginModel.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Foundation


class LoginViewModel {

// UserDefaults에 저장할 키 정의
Expand Down Expand Up @@ -49,27 +48,3 @@ class LoginViewModel {
}
}


// 이메일과 비밀번호를 처리하는 모델
struct LoginModel {
var email: String = ""
var password: String = ""


func isValidEmail() -> Bool {
let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}"
let emailTest = NSPredicate(format:"SELF MATCHES %@", emailRegEx)
return emailTest.evaluate(with: email)
}


func isValidPassword() -> Bool {
return password.count >= 6
}


func isLoginValid() -> Bool {
return isValidEmail() && isValidPassword()
}
}

19 changes: 19 additions & 0 deletions Kream/Models/ProductModels.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Foundation

struct ProductSearchResponse: Decodable {
let products: [KeywordModel]
let total: Int
let skip: Int
let limit: Int
}

struct KeywordModel: Decodable {
let id: Int
let title: String
let description: String
let price: Double
let brand: String
let category: String
let thumbnail: String
}

50 changes: 50 additions & 0 deletions Kream/ProductAPI.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//
// ProductAPI.swift.swift
// Kream
//
// Created by 임소은 on 11/18/24.
//

import UIKit
import SnapKit
import Moya
import Foundation

enum ProductAPI {
case searchProducts(query: String)
}

extension ProductAPI: TargetType {
var baseURL: URL {
return URL(string: "https://dummyjson.com")!
}

var path: String {
switch self {
case .searchProducts:
return "/products/search"
}
}

var method: Moya.Method {
switch self {
case .searchProducts:
return .get
}
}

var task: Task {
switch self {
case .searchProducts(let query):
return .requestParameters(parameters: ["q": query], encoding: URLEncoding.default)
}
}

var headers: [String: String]? {
return ["Content-Type": "application/json"]
}

var sampleData: Data {
return Data()
}
}
Loading