Skip to content

Commit

Permalink
[Fix] Keyneez#46 - 머지 컨플릭트 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
kpk0616 committed Jan 13, 2023
2 parents d84c035 + a8a34d5 commit 06ae8e6
Show file tree
Hide file tree
Showing 38 changed files with 776 additions and 496 deletions.
237 changes: 119 additions & 118 deletions Keyneez/Keyneez.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>Keyneez.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>20</integer>
<integer>35</integer>
</dict>
<key>ReactiveSwift (Playground) 1.xcscheme</key>
<dict>
Expand Down
10 changes: 2 additions & 8 deletions Keyneez/Keyneez/Application/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,13 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>UIFileSharingEnabled</key>
<true/>
<key>BASE_URL</key>
<string>$(BASE_URL)</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSPhotoLibraryUsageDescription</key>
<string>키니즈 ID서비스를 사용하려면 &apos;카메라&apos; 접근권한을 허용해야 해요.</string>
<key>NSCameraUsageDescription</key>
<string>키니즈 ID서비스를 사용하려면 &apos;카메라&apos; 접근권한을 허용해야 해요.</string>
<key>UIAppFonts</key>
<array>
<string>Pretendard-Bold.otf</string>
Expand All @@ -40,5 +32,7 @@
</array>
</dict>
</dict>
<key>UIFileSharingEnabled</key>
<true/>
</dict>
</plist>
13 changes: 5 additions & 8 deletions Keyneez/Keyneez/Application/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
let window = UIWindow(windowScene: windowScene)
window.overrideUserInterfaceStyle = UIUserInterfaceStyle.light

let rootVC = KeyneezTabbarController()
let navigationController = UINavigationController(rootViewController: rootVC)
navigationController.navigationBar.isHidden = true

window.rootViewController = navigationController
window.makeKeyAndVisible()
let rootVC = LandingPageViewController()

// let tabbarVC = LandingPageViewController()
// window.rootViewController = tabbarVC
// let tabbarVC = UINavigationController(rootViewController: rootVC)
// tabbarVC.isNavigationBarHidden = true
let tabbarVC = KeyneezTabbarController()
window.rootViewController = tabbarVC
window.makeKeyAndVisible()
self.window = window
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import UIKit
import SnapKit
//import Toast
import Toast_Swift
import Then

private struct Constant {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import UIKit
import Toast_Swift

private struct Constant {
static let firstTextFieldTop: CGFloat = 91
Expand Down Expand Up @@ -39,17 +40,52 @@ class DanalUserDataViewController: NiblessViewController, NavigationBarProtocol,

private lazy var birthTextField: UITextField = KeyneezTextFieldFactory.formStyleTextfield(placeholder: "생년월일(6자)", borderStyle: .underline(padding: 1)).build()

private let nextButton = UIButton().then {
private lazy var nextButton = UIButton().then {
$0.keyneezButtonStyle(style: .blackUnact, title: "다음으로")
$0.addTarget(self, action: #selector(touchUpNextVC), for: .touchUpInside)
}
var nameTextCount: Int = 0
var phoneTextCount: Int = 0
var birthTextCount: Int = 0

private func signUp(with dto: ProductDanalRequestDto,
completion: @escaping((ProductDanalResponseDto) -> Void)) {

UserAPIProvider.shared.postUserInfo(param: dto) { [weak self] result in
guard self != nil else { return }
switch result {
case .success(let data):
// 같은 유저가 있을 때
guard let userdata = data else {
// UI change
DispatchQueue.main.async {
self!.view.makeToast("이미 존재하는 휴대폰 입니다.", duration: 0.7, position: .center)
}
return
}
// new one
DispatchQueue.main.async {
completion(userdata)
self?.pushToNextVC(VC: JellyMakeViewController())
}

case .failure(let error):
print(error)
}
}
}

@objc
private func touchUpNextVC() {
pushToNextVC(VC: JellyMakeViewController())
if let name = nameTextField.text,
let phone = phoneTextField.text,
let birthday = birthTextField.text {
var danalRequestDTO = ProductDanalRequestDto(userName: name, userBirth: birthday,
userGender: " ", userPhone: phone)
signUp(with: danalRequestDTO) { userdata in
UserSession.shared.accessToken = userdata.accessToken
}
}
}

private func setKeyboard() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ extension HashTagCollectionViewCell {
}
func dataBind(model: HashTagContentModel) {
hashTagImageView.image = UIImage(named: model.image)
hashTagLabel.text = model.text
hashTagLabel.text = "#" + model.text
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ final class HashTagViewController: NiblessViewController, NavigationBarProtocol
})

// MARK: - UI Components
lazy var selectedIndex = [Int]()
lazy var selectedHashTag = [Int]()

private lazy var titleLabel: UILabel = .init().then {
$0.text = "관심있는 해시태그에\n체크해주세요"
Expand All @@ -56,9 +56,42 @@ final class HashTagViewController: NiblessViewController, NavigationBarProtocol
$0.addTarget(self, action: #selector(touchUpNextVC), for: .touchUpInside)
}

var propensityNumber: Int = 0
func dataBind(propensity: Int) {
propensityNumber = propensity
}

private func jellyInfo(token: String, with dto: ProductJellyRequstDto, completion: @escaping(ProductJellyResponseDto) -> Void) {

UserAPIProvider.shared.patchUserInfo(token: token, param: dto) { [weak self] result in
guard self != nil else { return }
switch result {
case .success(let data):
DispatchQueue.main.async {
// let dataArray: [Any] = [data?.userKey, data?.userName, data?.userAge, data?.userGender, data?.userPhone, data?.userBirth, data?.userSchool, data?.userCharacter, data?.userPassword, data?.userOcr, data?.ocrDir, data?.userBenefit, data?.characters]
let nextVC = JellyProductViewController()
guard let data = data else {return}
nextVC.dataBind(data: data)
self!.pushToNextVC(VC: nextVC)
}
case .failure(let error):
print(error)
}
}
}

@objc
private func touchUpNextVC() {
pushToNextVC(VC: JellyProductViewController())
var selectedHashTagText: [String] = []
for index in selectedHashTag {
selectedHashTagText.append(hashTagData[index].text)

}
var jellyInfoRequestDto = ProductJellyRequstDto(disposition: propensityTagUnclickData[propensityNumber].text, interest: selectedHashTagText)
guard let token = UserSession.shared.accessToken else {return}
jellyInfo(token: token, with: jellyInfoRequestDto) { userdata in

}
}

private let clickCountLabel: UILabel = .init().then {
Expand Down Expand Up @@ -163,26 +196,26 @@ extension HashTagViewController: UICollectionViewDataSource {

if cell?.indexView.isHidden == true {

if selectedIndex.count < 3 {
selectedIndex.append(indexPath.row)
guard let index = selectedIndex.firstIndex(of: indexPath.row) else { return }
if selectedHashTag.count < 3 {
selectedHashTag.append(indexPath.row)
guard let index = selectedHashTag.firstIndex(of: indexPath.row) else { return }
cell?.selectView(index: index)
clickCountLabel.text = String(selectedIndex.count)
clickCountLabel.text = String(selectedHashTag.count)

}
} else {
guard let index = selectedIndex.firstIndex(of: indexPath.item) else { return }
selectedIndex.remove(at: index)
guard let index = selectedHashTag.firstIndex(of: indexPath.item) else { return }
selectedHashTag.remove(at: index)
cell?.unSelectiView()
selectedIndex.forEach {
selectedHashTag.forEach {
let cell = collectionView.cellForItem(at: [0, $0]) as? HashTagCollectionViewCell
guard let newIndex = selectedIndex.firstIndex(of: $0) else {
guard let newIndex = selectedHashTag.firstIndex(of: $0) else {
return }
cell?.changeIndexLabel(index: newIndex)
}
clickCountLabel.text = String(selectedIndex.count)
clickCountLabel.text = String(selectedHashTag.count)
}
if selectedIndex.count == 3 {
if selectedHashTag.count == 3 {
nextButton.keyneezButtonStyle(style: .blackAct, title: "다음으로")
allCountLabel.textColor = .mint500
clickCountLabel.textColor = .mint500
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,17 @@ class JellyProductViewController: NiblessViewController {
$0.addTarget(self, action: #selector(touchUpNextVC), for: .touchUpInside)
}

var userData: ProductJellyResponseDto?
func dataBind(data: ProductJellyResponseDto) {
userData = data
}

@objc
private func touchUpNextVC() {
pushToNextVC(VC: SimplePwdViewController())
let nextVC = SimplePwdViewController()
guard let userData = userData else {return}
nextVC.dataBind(data: userData)
pushToNextVC(VC: nextVC)
}

override func viewDidLoad() {
Expand Down
25 changes: 13 additions & 12 deletions Keyneez/Keyneez/Global/Auth/SignUp/Model/SignUpContentModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ struct HashTagContentModel {
}

var hashTagData: [HashTagContentModel] = [
HashTagContentModel(image: "amusementPark", text: "#놀이공원"),
HashTagContentModel(image: "active", text: "#대외활동"),
HashTagContentModel(image: "traffic", text: "#대중교통"),
HashTagContentModel(image: "movie", text: "#영화관"),
HashTagContentModel(image: "add", text: "#혜택"),
HashTagContentModel(image: "travel", text: "#여행"),
HashTagContentModel(image: "scholaship", text: "#장학"),
HashTagContentModel(image: "art", text: "#미술관"),
HashTagContentModel(image: "checkCard", text: "#체크카드"),
HashTagContentModel(image: "volunteer", text: "#봉사"),
HashTagContentModel(image: "museum", text: "#박물관"),
HashTagContentModel(image: "career", text: "#진로")
HashTagContentModel(image: "amusementPark", text: "놀이공원"),
HashTagContentModel(image: "active", text: "대외활동"),
HashTagContentModel(image: "traffic", text: "대중교통"),
HashTagContentModel(image: "movie", text: "영화관"),
HashTagContentModel(image: "add", text: "혜택"),
HashTagContentModel(image: "travel", text: "여행"),
HashTagContentModel(image: "scholaship", text: "장학"),
HashTagContentModel(image: "art", text: "미술관"),
HashTagContentModel(image: "checkCard", text: "체크카드"),
HashTagContentModel(image: "volunteer", text: "봉사"),
HashTagContentModel(image: "museum", text: "박물관"),
HashTagContentModel(image: "career", text: "진로")
]

struct JellyContentModel {
Expand All @@ -65,6 +65,7 @@ var jellyIconData: [JellyContentModel] = [
struct SimplePwdContentModel {
let text: String
}

var pwdNumberData: [SimplePwdContentModel] = [
SimplePwdContentModel(text: "8"),
SimplePwdContentModel(text: "9"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ final class PropensityTagViewController: NiblessViewController, NavigationBarPro
}
private let curiousButton = UIButton().then {
$0.tag = 1
$0.isSelected = false
$0.propensityTagButtonStyle(style: .propensityTagUnact, title: propensityTagUnclickData[$0.tag].text)
$0.isUserInteractionEnabled = true
$0.addTarget(self, action: #selector(selectOptionBtnAction), for: .touchUpInside)
Expand All @@ -63,7 +62,13 @@ final class PropensityTagViewController: NiblessViewController, NavigationBarPro

@objc
private func touchUpNextVC() {
pushToNextVC(VC: HashTagViewController())
let hashTagVC = HashTagViewController()
for button in btnArray {
if button.isSelected == true {
hashTagVC.dataBind(propensity: button.tag)
pushToNextVC(VC: hashTagVC)
}
}
}

private var btnArray = [UIButton]()
Expand Down Expand Up @@ -98,6 +103,7 @@ final class PropensityTagViewController: NiblessViewController, NavigationBarPro
let width = ((button.titleLabel?.frame.width)!) + Constant.btnMargin * 2
return width
}

}

extension PropensityTagViewController {
Expand Down
Loading

0 comments on commit 06ae8e6

Please sign in to comment.