Skip to content

Commit

Permalink
[Release] v1.0.2 version update
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoe0929 committed Oct 9, 2024
2 parents eba5ba6 + 38837ea commit c06ef18
Show file tree
Hide file tree
Showing 32 changed files with 461 additions and 154 deletions.
4 changes: 2 additions & 2 deletions DDANZI_iOS/DDANZI_iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1903,7 +1903,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.1;
MARKETING_VERSION = 1.0.2;
PRODUCT_BUNDLE_IDENTIFIER = "com.orangeCo.DDANZI-iOS.dev";
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down Expand Up @@ -1940,7 +1940,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.1;
MARKETING_VERSION = 1.0.2;
PRODUCT_BUNDLE_IDENTIFIER = "com.orangeCo.DDANZI-iOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down
20 changes: 20 additions & 0 deletions DDANZI_iOS/DDANZI_iOS/Common/Extension/String+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,24 @@ extension String {

return koreanFormatter.string(from: date)
}

func convertToDateFormat() -> String? {
// 입력 형식에 맞는 DateFormatter 생성
let inputFormatter = DateFormatter()
inputFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS"
inputFormatter.locale = Locale(identifier: "en_US_POSIX")

// String -> Date로 변환
guard let date = inputFormatter.date(from: self) else {
return nil
}

// 원하는 출력 형식으로 DateFormatter 설정
let outputFormatter = DateFormatter()
outputFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" // 24시간 형식
outputFormatter.locale = Locale(identifier: "en_US_POSIX")

// Date -> String으로 변환 후 반환
return outputFormatter.string(from: date)
}
}
23 changes: 16 additions & 7 deletions DDANZI_iOS/DDANZI_iOS/Common/Extension/UILabel+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,22 @@ extension UILabel {
self.attributedText = attributedString
}

func setUnderline(range: NSRange) {

guard let attributedString = self.mutableAttributedString() else { return }

attributedString.addAttribute(NSAttributedString.Key.underlineStyle, value: NSUnderlineStyle.single.rawValue, range: range)
self.attributedText = attributedString
}
func setUnderline(for rangeText: String) {
guard let fullText = self.text else { return }

let attributedString = NSMutableAttributedString(string: fullText)

// 해당 구간의 NSRange 찾기
if let range = fullText.range(of: rangeText) {
let nsRange = NSRange(range, in: fullText)

// 밑줄 스타일 적용
attributedString.addAttribute(.underlineStyle, value: NSUnderlineStyle.single.rawValue, range: nsRange)
}

// UILabel의 attributedText에 설정
self.attributedText = attributedString
}

private func mutableAttributedString() -> NSMutableAttributedString? {
guard let labelText = self.text, let labelFont = self.font else { return nil }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x24",
"green" : "0x24",
"red" : "0xC9"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x54",
"green" : "0x54",
"red" : "0xE6"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 4 additions & 2 deletions DDANZI_iOS/DDANZI_iOS/Common/Resource/Literals/String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ enum StringLiterals {

enum Link {
enum Terms {
static let privacy = ""
static let serviceTerm = ""
static let privacy = "https://www.notion.so/5a8b57e78f594988aaab08b8160c3072?pvs=4"
static let serviceTerm = "https://www.notion.so/faa1517ffed44f6a88021a41407ed736?pvs=4"
static let sellTerm = "https://brawny-guan-098.notion.site/6d77260d027148ceb0f806f0911c284a?pvs=4"
static let purchaseTerm = "https://brawny-guan-098.notion.site/56bcbc1ed0f3454ba08fa1070fa5413d?pvs=4"
}
}
}
9 changes: 9 additions & 0 deletions DDANZI_iOS/DDANZI_iOS/Data/Endpoint/ItemEndpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ enum ItemEndpoint {
case itemCheck(body: ItemCheckRequestBody)
case itemConfirmed(id: String)
case registeItem(body: RegisteItemBody)
case deleteItem(id: String)
case detailItem(id: String)
case optionItem(id: String)

Expand Down Expand Up @@ -49,6 +50,8 @@ extension ItemEndpoint: BaseTargetType {
return "/api/v1/item/product/\(id)"
case .registeItem:
return "/api/v1/item"
case .deleteItem(let id):
return "/api/v1/item/\(id)"
case .detailItem(let id):
return "/api/v1/item/\(id)"
case .optionItem(let id):
Expand All @@ -68,6 +71,8 @@ extension ItemEndpoint: BaseTargetType {
return .get
case .registeItem:
return .post
case .deleteItem:
return .delete
case .detailItem:
return .get
case .optionItem:
Expand All @@ -87,6 +92,8 @@ extension ItemEndpoint: BaseTargetType {
return .requestPlain
case .registeItem(let body):
return .requestJSONEncodable(body)
case .deleteItem:
return .requestPlain
case .detailItem:
return .requestPlain
case .optionItem:
Expand All @@ -110,6 +117,8 @@ extension ItemEndpoint: BaseTargetType {
return APIConstants.hasAccessTokenHeader
case .optionItem:
return APIConstants.hasAccessTokenHeader
case .deleteItem(id: let id):
return APIConstants.hasAccessTokenHeader
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ final class CustomNavigationBarView: UIView {
$0.textColor = .black
}

private let backButton = UIButton().then {
let backButton = UIButton().then {
$0.setImage(.leftBtn, for: .normal)
$0.imageView?.contentMode = .scaleAspectFit
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import Then

final class ProductChipView: UIView {
private let label = UILabel().then {
$0.font = .body5R14
$0.textColor = .black
$0.font = .body6M12
$0.textColor = .gray3
}

init(labelText: String) {
Expand All @@ -31,9 +31,8 @@ final class ProductChipView: UIView {
}

private func setHierarchy() {
self.backgroundColor = .white
self.backgroundColor = .gray1
self.makeCornerRound(radius: 5)
self.makeBorder(width: 1, color: .black)
self.addSubview(label)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import UIKit

class DdanziTabBarController: UITabBarController {
private var tabs: [UIViewController] = []
final class DdanziTabBarController: UITabBarController {
private var tabBarViewControllers: [UIViewController] = []
private let tabBarHeight: CGFloat = 100

private let homeViewController = HomeViewController()
Expand All @@ -35,17 +35,17 @@ class DdanziTabBarController: UITabBarController {
}

func setTabBarItems() {
tabs = [
tabBarViewControllers = [
UINavigationController(rootViewController: homeViewController),
UINavigationController(rootViewController: mypageViewController)
]

TabBarItem.allCases.forEach {
tabs[$0.rawValue].tabBarItem = $0.asTabBarItem()
tabs[$0.rawValue].tabBarItem.tag = $0.rawValue
tabBarViewControllers[$0.rawValue].tabBarItem = $0.asTabBarItem()
tabBarViewControllers[$0.rawValue].tabBarItem.tag = $0.rawValue
}

setViewControllers(tabs, animated: true)
setViewControllers(tabBarViewControllers, animated: true)
}

func setTabBarAppearance() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,12 @@ final class AccountAddViewController: UIViewController {
let body = UserAccountRequestDTO(accountName: accountName, bank: bank, accountNumber: accountNumber)
Providers.MypageProvider.request(target: .editUserAccount(accountId, body), instance: BaseResponse<UserAccountDTO>.self) { response in
guard let data = response.data else { return }
if response.status != 200 || response.status != 201 {
self.view.showToast(message: "계좌 등록 오류 입니다. 잠시 후 다시 시도해주세요", at: 100)
} else {
if response.status == 200 || response.status == 201 {
self.accountRegisteredRelay.accept(true)
self.navigationController?.popViewController(animated: true)
}
} else {
self.view.showToast(message: "계좌 등록 오류 입니다. 잠시 후 다시 시도해주세요", at: 100)
}
}
}

Expand All @@ -173,6 +174,8 @@ final class AccountAddViewController: UIViewController {
if response.status == 200 || response.status == 201 {
self.accountRegisteredRelay.accept(true)
self.navigationController?.popViewController(animated: true)
} else {
self.view.showToast(message: "계좌 등록 오류 입니다. 잠시 후 다시 시도해주세요", at: 100)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import RxSwift
import RxCocoa

final class AddressFormViewController: UIViewController {

var onAddressChanged: ((Address) -> Void)?
var newAddress: Address?
private let disposeBag = DisposeBag()

private var currentAddressInfo: Address?
Expand Down Expand Up @@ -124,12 +125,16 @@ final class AddressFormViewController: UIViewController {

private func postAddress(body: UserAddressRequestDTO) {
Providers.MypageProvider.request(target: .addUserAddress(body), instance: BaseResponse<UserAddressResponseDTO>.self) { result in
let newAddress = Address(name: body.recipient, address: "(\(body.zipCode) \(body.address), \(body.detailAddress))", phone: body.recipientPhone)
self.onAddressChanged?(newAddress)
self.navigationController?.popViewController(animated: true)
}
}

private func editAddress(addressId: Int, body: UserAddressRequestDTO) {
Providers.MypageProvider.request(target: .editUserAddress(addressId, body), instance: BaseResponse<UserAddressResponseDTO>.self) { response in
let newAddress = Address(name: body.recipient, address: "(\(body.zipCode) \(body.address), \(body.detailAddress))", phone: body.recipientPhone)
self.onAddressChanged?(newAddress)
self.navigationController?.popViewController(animated: true)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ import RxCocoa
import RxDataSources

class AddressSettingViewController: UIViewController {
var onAddressChanged: ((Address) -> Void)?

private let disposeBag = DisposeBag()
private var addressList: [Address] = []

private var newAddress: Address?
private let addressListSubject = BehaviorSubject<[Address]>(value: [])
private var addressId = 0

Expand Down Expand Up @@ -44,6 +47,13 @@ class AddressSettingViewController: UIViewController {
fetchAddress()
}

override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
if let newAddress = self.newAddress {
onAddressChanged?(newAddress)
}
}

override func viewDidLoad() {
super.viewDidLoad()
fetchAddress()
Expand Down Expand Up @@ -121,14 +131,17 @@ class AddressSettingViewController: UIViewController {
.map { [SectionModel(model: "배송지 관리", items: $0)] }
.bind(to: collectionView.rx.items(dataSource: dataSource))
.disposed(by: disposeBag)

}

private func bind() {
navigationBarView.backButtonTap
.subscribe(onNext: { [weak self] in
self?.navigationController?.popViewController(animated: true)
})
.subscribe(with: self) { owner, _ in
if let newAddress = self.newAddress {
owner.onAddressChanged?(newAddress)
}// 변경된 주소를 클로저로 전달
owner.navigationController?.popViewController(animated: true)
}
.disposed(by: disposeBag)

addButton.rx.tap
Expand Down Expand Up @@ -158,9 +171,11 @@ class AddressSettingViewController: UIViewController {
let address = data.address,
let detailAddress = data.detailAddress,
let phone = data.recipientPhone {
let newAddress = Address(addressId: addressId, name: name,address: "(\(zipcode) \(address), \(detailAddress))",phone: phone)
self.newAddress = Address(addressId: addressId, name: name,address: "(\(zipcode) \(address), \(detailAddress))",phone: phone)
self.addressId = data.addressID ?? 0
self.addressListSubject.onNext([newAddress])
if let newAddress = self.newAddress {
self.addressListSubject.onNext([newAddress])
}
self.collectionView.reloadData()
self.collectionView.isHidden = false
self.addButton.isHidden = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ class BankAccountViewController: UIViewController {
$0.setImage(.blueArrow, for: .normal)
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
fetchAccountInfo()
}

override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
Expand Down Expand Up @@ -137,7 +142,11 @@ class BankAccountViewController: UIViewController {
if let bank = data.bank,
let accountNumber = data.accountNumber,
let accountId = data.accountId {
self.bankNameLabel.text = bank
if let bank = BankList.banks.first(where: { $0.code == bank }) {
self.bankNameLabel.text = bank.name // 은행 이름 설정
} else {
self.bankNameLabel.text = "알 수 없는 은행" // 매칭되지 않는 경우 처리
}
self.nameLabel.text = data.name
self.accountNumberLabel.text = accountNumber
self.accountButton.isHidden = false
Expand All @@ -159,10 +168,16 @@ class BankAccountViewController: UIViewController {
.disposed(by: disposeBag)

registerButton.rx.tap
.subscribe(onNext: { [weak self] in
.subscribe(with: self) { owner, _ in
// 계좌 등록 화면으로 이동하는 로직 추가
self?.navigateToAccountRegistration()
})
owner.navigateToAccountRegistration()
}
.disposed(by: disposeBag)

accountButton.rx.tap
.subscribe(with: self) { owner, _ in
owner.navigateToAccountRegistration()
}
.disposed(by: disposeBag)
}

Expand Down
Loading

0 comments on commit c06ef18

Please sign in to comment.