Skip to content

Commit

Permalink
Merge pull request #150 from BudgetBuddiesTeam/develop
Browse files Browse the repository at this point in the history
[Release] 1.1.0에서 1.2.0으로 업데이트
  • Loading branch information
jayn2u authored Aug 23, 2024
2 parents 268372e + d3d61f9 commit 4f0ec45
Show file tree
Hide file tree
Showing 91 changed files with 2,337 additions and 670 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ final class CategoryRouterTests: XCTestCase {
/// /categories/add/{userId} 엔드포인트 테스트 메소드
func testAddCategory() {
// Request Variable
let categoryRequestDTO = CategoryRequestDTO(
userID: self.userId, name: "프론트엔드 화이팅", isDefault: false)
let categoryRequestDTO = CategoryRequestDTO(name: "프론트엔드 화이팅", isDefault: false)

// Network Transmitting Code
provider.request(.addCategory(userId: self.userId, categoryRequest: categoryRequestDTO)) {
Expand Down Expand Up @@ -74,7 +73,7 @@ final class CategoryRouterTests: XCTestCase {
// - none

// Network Transmitting Code
provider.request(.getCategory(userId: self.userId)) { result in
provider.request(.getCategories(userId: self.userId)) { result in
defer { self.expectation.fulfill() }

switch result {
Expand Down Expand Up @@ -106,4 +105,26 @@ final class CategoryRouterTests: XCTestCase {

// MARK: - 카테고리 제거

func testDeleteCategory() {
let categoryId = 13
provider.request(.deleteCategory(userId: self.userId, categoryId: categoryId)) { result in
defer { self.expectation.fulfill() }

switch result {
case .success(let response):
debugPrint("/categories/delete/{categoryId} API 연결 성공")
debugPrint(response.statusCode)
XCTAssertEqual(response.statusCode, 200, ErrorMessage.TellsWhatRightStatusCodeIs)
debugPrint(response.request?.url as Any)
case .failure(let error):
XCTFail("/categories/delete/{categoryId} API 연결 실패 : \(error.localizedDescription)")
}
}

waitForExpectations(timeout: self.timeoutValue) { error in
if let error = error {
XCTFail("카테고리 제거 테스팅 간 에러 발생 : \(error.localizedDescription)")
}
}
}
}
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.
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.
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.
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.
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.
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.
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
@@ -1 +1,158 @@
{"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Assets.xcassets/AppIcon.appiconset/","scale":"1x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"72x72","expected-size":"72","filename":"72.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"76x76","expected-size":"152","filename":"152.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"50x50","expected-size":"100","filename":"100.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"76x76","expected-size":"76","filename":"76.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"50x50","expected-size":"50","filename":"50.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"72x72","expected-size":"144","filename":"144.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"40x40","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"83.5x83.5","expected-size":"167","filename":"167.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"20x20","expected-size":"20","filename":"20.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"}]}
{
"images" : [
{
"filename" : "40.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "60.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "29.png",
"idiom" : "iphone",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "58.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "87.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "80.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "120.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "57.png",
"idiom" : "iphone",
"scale" : "1x",
"size" : "57x57"
},
{
"filename" : "114.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "57x57"
},
{
"filename" : "120.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "180.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "20.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"filename" : "40.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "29.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "58.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "40.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "80.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "50.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "50x50"
},
{
"filename" : "100.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "50x50"
},
{
"filename" : "72.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "72x72"
},
{
"filename" : "144.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "72x72"
},
{
"filename" : "76.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "152.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "167.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "1024.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "Image.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 @@

20 changes: 20 additions & 0 deletions BudgetBuddies/BudgetBuddies/Sources/Extensions/UITextField+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,24 @@ extension UITextField {
.kern, value: spacing, range: NSRange(location: 0, length: attributedString.length))
self.attributedText = attributedString
}

/// 텍스트필드 왼쪽에 빈 뷰를 추가하는 함수입니다.
///
/// - Parameters:
/// - width: 빈뷰의 너비값입니다.
/// - height: 빈뷰의 높이값입니다.
func addLeftView(width: Int, height: Int) {
let leftView = UIView(frame: CGRect(x: 0, y: 0, width: width, height: height))

self.leftView = leftView
self.leftViewMode = .always
}

/// TextField에서 사용하기 불편한 세팅을 제거합니다.
func setComfortableTextField() {
self.autocapitalizationType = .none // 첫 글자 자동 대문자
self.autocorrectionType = .no // 추천 글자를 보여줄지
self.spellCheckingType = .no // 오류난 글자를 고쳐줄지
self.clearButtonMode = .always // 텍스트필드에 전체 지우기 버튼 생성
}
}
8 changes: 8 additions & 0 deletions BudgetBuddies/BudgetBuddies/Sources/Extensions/UIView+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,12 @@ extension UIView {
func addSubviews(_ views: UIView...) {
views.forEach { addSubview($0) }
}

func setShadow(opacity: Float, Radius: CGFloat, offSet: CGSize) {
self.layer.shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.1).cgColor
self.layer.shadowOpacity = opacity
self.layer.shadowRadius = Radius / 2 //반경 (피그마랑 비슷하게 가려면 절반을 나눠야 함..)
self.layer.shadowOffset = offSet
self.layer.masksToBounds = false
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
//
// UIViewController+.swift
// BudgetBuddies
//
// Created by 김승원 on 8/22/24.
//

import UIKit

extension UIViewController {

/// 기본 네비게이션바 세팅하는 함수입니다.
///
/// - Parameter backgroundColor: 배경 색입니다.
func setupDefaultNavigationBar(backgroundColor: UIColor) {
let appearance = UINavigationBarAppearance()
appearance.configureWithDefaultBackground()
// 색상
appearance.backgroundColor = backgroundColor
appearance.shadowColor = nil

// 네비게이션 바 타이틀 폰트, 자간 설정
let titleFont = BudgetBuddiesFontFamily.Pretendard.semiBold.font(size: 18)
let titleAttributes: [NSAttributedString.Key: Any] = [
.font: titleFont,
.foregroundColor: BudgetBuddiesAsset.AppColor.textBlack.color,
.kern: -0.45,
]

appearance.titleTextAttributes = titleAttributes

navigationController?.navigationBar.standardAppearance = appearance
navigationController?.navigationBar.compactAppearance = appearance
navigationController?.navigationBar.scrollEdgeAppearance = appearance
navigationController?.navigationBar.isHidden = false
}

/// 네비게이션바 회색 백 버튼을 설정하는 함수입니다.
///
/// - Parameter selector: selector함수입니다. #selector(<함수이름>)형식입니다.
func addBackButton(selector: Selector) {
lazy var backButton: UIBarButtonItem = {
let btn = UIBarButtonItem(
image: UIImage(systemName: "chevron.left"),
style: .done,
target: self,
action: selector)
btn.tintColor = BudgetBuddiesAsset.AppColor.subGray.color
return btn
}()

navigationItem.leftBarButtonItem = backButton
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ import Foundation
// MARK: - CategoryRequest

struct CategoryRequestDTO: Codable {
let userID: Int
let name: String
let isDefault: Bool

enum CodingKeys: String, CodingKey {
case userID = "userId"
case name, isDefault
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ import Moya
*/

enum CategoryRouter {

/// 카테고리 추가 엔드포인트
case addCategory(userId: Int, categoryRequest: CategoryRequestDTO)
case getCategory(userId: Int)
/// 카테고리 조회 엔드포인트
case getCategories(userId: Int)
/// 카테고리 제거 엔드포인트
case deleteCategory(userId: Int, categoryId: Int)
}

extension CategoryRouter: TargetType {
Expand All @@ -28,26 +33,32 @@ extension CategoryRouter: TargetType {
switch self {
case .addCategory(let userId, _):
return "/categories/add/\(userId)"
case .getCategory(let userId):
case .getCategories(let userId):
return "categories/get/\(userId)"
case .deleteCategory(_, let categoryId):
return "categories/delete/\(categoryId)"
}
}

var method: Moya.Method {
switch self {
case .addCategory:
return .post
case .getCategory:
case .getCategories:
return .get
case .deleteCategory:
return .delete
}
}

var task: Moya.Task {
switch self {
case .addCategory(_, let categoryRequest):
return .requestJSONEncodable(categoryRequest)
case .getCategory:
case .getCategories:
return .requestPlain
case .deleteCategory(let userId, _):
return .requestParameters(parameters: ["userId": userId], encoding: URLEncoding.queryString)
}
}

Expand Down
Loading

0 comments on commit 4f0ec45

Please sign in to comment.