From 8e07894dda0c5ae9ce0c25523df009fccbedcfa1 Mon Sep 17 00:00:00 2001 From: hyungyu Kim Date: Tue, 14 Dec 2021 17:23:28 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[FIX]=20#145=20-=20=EB=A9=94=EC=9D=B8=20fli?= =?UTF-8?q?p=20=EC=86=8D=EB=8F=84=20=EC=A1=B0=EC=A0=88=20=EB=B0=8F=20?= =?UTF-8?q?=EA=B3=B5=EC=9C=A0=EB=B2=84=ED=8A=BC=20=ED=9E=88=EB=93=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 메인 flip 속도 변경 1 -> 0.5 --- .../Sources/Cells/CardCell/MainCardCell.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/NADA-iOS-forRelease/Sources/Cells/CardCell/MainCardCell.swift b/NADA-iOS-forRelease/Sources/Cells/CardCell/MainCardCell.swift index e5870969..02a59541 100644 --- a/NADA-iOS-forRelease/Sources/Cells/CardCell/MainCardCell.swift +++ b/NADA-iOS-forRelease/Sources/Cells/CardCell/MainCardCell.swift @@ -36,7 +36,6 @@ class MainCardCell: CardCell { // MARK: - Extensions extension MainCardCell { - private func setUI() { } public func setFrontCard() { guard let frontCard = FrontCardCell.nib().instantiate(withOwner: self, options: nil).first as? FrontCardCell else { return } @@ -102,11 +101,11 @@ extension MainCardCell { isFront = true } if swipeGesture.direction == .right { - UIView.transition(with: contentView, duration: 1, options: .transitionFlipFromLeft, animations: nil) { _ in + UIView.transition(with: contentView, duration: 0.5, options: .transitionFlipFromLeft, animations: nil) { _ in self.contentView.subviews[0].removeFromSuperview() } } else { - UIView.transition(with: contentView, duration: 1, options: .transitionFlipFromRight, animations: nil) { _ in + UIView.transition(with: contentView, duration: 0.5, options: .transitionFlipFromRight, animations: nil) { _ in self.contentView.subviews[0].removeFromSuperview() } } From a767234bd90910614b676a69739bc8aed46facb3 Mon Sep 17 00:00:00 2001 From: hyungyu Kim Date: Tue, 14 Dec 2021 17:25:24 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[FIX]=20#145=20-=20=EB=A9=94=EC=9D=B8=20fli?= =?UTF-8?q?p=20=EC=86=8D=EB=8F=84=20=EC=A1=B0=EC=A0=88=20=EB=B0=8F=20?= =?UTF-8?q?=EA=B3=B5=EC=9C=A0=EB=B2=84=ED=8A=BC=20=ED=9E=88=EB=93=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 사용하지 않는 `setUI()` 메서드 삭제 --- NADA-iOS-forRelease/Sources/Cells/CardCell/MainCardCell.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/NADA-iOS-forRelease/Sources/Cells/CardCell/MainCardCell.swift b/NADA-iOS-forRelease/Sources/Cells/CardCell/MainCardCell.swift index 02a59541..7a6c5a2c 100644 --- a/NADA-iOS-forRelease/Sources/Cells/CardCell/MainCardCell.swift +++ b/NADA-iOS-forRelease/Sources/Cells/CardCell/MainCardCell.swift @@ -21,8 +21,7 @@ class MainCardCell: CardCell { override func awakeFromNib() { super.awakeFromNib() - - setUI() + setGestureRecognizer() } From 3914e85241bb869f6d0d4d45641417326d3abf71 Mon Sep 17 00:00:00 2001 From: hyungyu Kim Date: Tue, 14 Dec 2021 17:49:09 +0900 Subject: [PATCH 3/4] =?UTF-8?q?[FIX]=20#145=20-=20=EB=A9=94=EC=9D=B8=20fli?= =?UTF-8?q?p=20=EC=86=8D=EB=8F=84=20=EC=A1=B0=EC=A0=88=20=EB=B0=8F=20?= =?UTF-8?q?=EA=B3=B5=EC=9C=A0=EB=B2=84=ED=8A=BC=20=ED=9E=88=EB=93=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 명함 상세뷰 공유하기 hidden - 명함생성 미리보기뷰 공유하기 hidden - 메인 명함 공유하기 보이게하기 > 워닝이 없는 곳에서의 self 지웠습니당 --- .../Sources/Cells/CardCell/BackCardCell.swift | 27 ++++++++++--------- .../Cells/CardCell/FrontCardCell.swift | 10 +++++-- .../Sources/Cells/CardCell/MainCardCell.swift | 10 ++++--- .../CardCreationPreviewViewController.swift | 14 ++++++++-- .../CardDetail/CardDetailViewController.swift | 10 ++++--- 5 files changed, 49 insertions(+), 22 deletions(-) diff --git a/NADA-iOS-forRelease/Sources/Cells/CardCell/BackCardCell.swift b/NADA-iOS-forRelease/Sources/Cells/CardCell/BackCardCell.swift index a7adc97d..be518e9e 100644 --- a/NADA-iOS-forRelease/Sources/Cells/CardCell/BackCardCell.swift +++ b/NADA-iOS-forRelease/Sources/Cells/CardCell/BackCardCell.swift @@ -64,34 +64,37 @@ extension BackCardCell { _ isSauced: Bool, _ firstTMI: String, _ secondTMI: String, - _ thirdTMI: String) { + _ thirdTMI: String, + isShareable: Bool) { if let bgImage = UIImage(named: backgroundImageString) { self.backgroundImageView.image = bgImage } - self.mintImageView.image = isMint == true ? + mintImageView.image = isMint == true ? UIImage(named: "iconTasteOnMincho") : UIImage(named: "iconTasteOffMincho") - self.noMintImageView.image = isMint == false ? + noMintImageView.image = isMint == false ? UIImage(named: "iconTasteOnBanmincho") : UIImage(named: "iconTasteOffBanmincho") - self.sojuImageView.image = isSoju == true ? + sojuImageView.image = isSoju == true ? UIImage(named: "iconTasteOnSoju") : UIImage(named: "iconTasteOffSoju") - self.beerImageView.image = isSoju == false ? + beerImageView.image = isSoju == false ? UIImage(named: "iconTasteOnBeer") : UIImage(named: "iconTasteOffBeer") - self.pourEatImageView.image = isBoomuk == true ? + pourEatImageView.image = isBoomuk == true ? UIImage(named: "iconTasteOnBumeok") : UIImage(named: "iconTasteOffBumeok") - self.putSauceEatImageView.image = isBoomuk == false ? + putSauceEatImageView.image = isBoomuk == false ? UIImage(named: "iconTasteOnZzik") : UIImage(named: "iconTasteOffZzik") - self.sauceChickenImageView.image = isSauced == true ? + sauceChickenImageView.image = isSauced == true ? UIImage(named: "iconTasteOnSeasoned") : UIImage(named: "iconTasteOffSeasoned") - self.friedChickenImageView.image = isSauced == false ? + friedChickenImageView.image = isSauced == false ? UIImage(named: "iconTasteOnFried") : UIImage(named: "iconTasteOffFried") - self.firstTmiLabel.text = firstTMI - self.secondTmiLabel.text = secondTMI - self.thirdTmiLabel.text = thirdTMI + firstTmiLabel.text = firstTMI + secondTmiLabel.text = secondTMI + thirdTmiLabel.text = thirdTMI + + shareButton.isHidden = !isShareable } /// 명함생성할 때 image 를 UIImage 로 가져올 경우 사용 diff --git a/NADA-iOS-forRelease/Sources/Cells/CardCell/FrontCardCell.swift b/NADA-iOS-forRelease/Sources/Cells/CardCell/FrontCardCell.swift index e0965d98..21965a5a 100644 --- a/NADA-iOS-forRelease/Sources/Cells/CardCell/FrontCardCell.swift +++ b/NADA-iOS-forRelease/Sources/Cells/CardCell/FrontCardCell.swift @@ -101,7 +101,8 @@ extension FrontCardCell { _ birth: String, _ mbti: String, _ instagramID: String, - _ linkURL: String) { + _ linkURL: String, + isShareable: Bool) { if let bgImage = UIImage(named: backgroundImage) { self.backgroundImageView.image = bgImage } @@ -112,6 +113,8 @@ extension FrontCardCell { mbtiLabel.text = mbti instagramIDLabel.text = instagramID linkURLLabel.text = linkURL + + shareButton.isHidden = !isShareable } /// 명함생성할 때 image 를 UIImage 로 가져올 경우 사용 @@ -122,7 +125,8 @@ extension FrontCardCell { _ birth: String, _ mbti: String, _ instagramID: String, - _ linkURL: String) { + _ linkURL: String, + isShareable: Bool) { backgroundImageView.image = backgroundImage ?? UIImage() titleLabel.text = cardTitle descriptionLabel.text = cardDescription @@ -131,5 +135,7 @@ extension FrontCardCell { mbtiLabel.text = mbti instagramIDLabel.text = instagramID linkURLLabel.text = linkURL + + shareButton.isHidden = !isShareable } } diff --git a/NADA-iOS-forRelease/Sources/Cells/CardCell/MainCardCell.swift b/NADA-iOS-forRelease/Sources/Cells/CardCell/MainCardCell.swift index 7a6c5a2c..891be0be 100644 --- a/NADA-iOS-forRelease/Sources/Cells/CardCell/MainCardCell.swift +++ b/NADA-iOS-forRelease/Sources/Cells/CardCell/MainCardCell.swift @@ -14,6 +14,7 @@ class MainCardCell: CardCell { // MARK: - Properties private var isFront = true + private var isShareable = true public var cardDataModel: Card? @@ -47,7 +48,8 @@ extension MainCardCell { cardDataModel.birthDate, cardDataModel.mbti, cardDataModel.instagram ?? "", - cardDataModel.link ?? "") + cardDataModel.link ?? "", + isShareable: isShareable) contentView.addSubview(frontCard) } @@ -78,7 +80,8 @@ extension MainCardCell { cardDataModel.isSauced, cardDataModel.oneTMI ?? "", cardDataModel.twoTMI ?? "", - cardDataModel.thirdTMI ?? "") + cardDataModel.thirdTMI ?? "", + isShareable: isShareable) contentView.addSubview(backCard) isFront = false @@ -94,7 +97,8 @@ extension MainCardCell { cardDataModel.birthDate, cardDataModel.mbti, cardDataModel.instagram ?? "", - cardDataModel.link ?? "") + cardDataModel.link ?? "", + isShareable: isShareable) contentView.addSubview(frontCard) isFront = true diff --git a/NADA-iOS-forRelease/Sources/ViewControllers/CardCreation/CardCreationPreviewViewController.swift b/NADA-iOS-forRelease/Sources/ViewControllers/CardCreation/CardCreationPreviewViewController.swift index 25a18e73..4847233a 100644 --- a/NADA-iOS-forRelease/Sources/ViewControllers/CardCreation/CardCreationPreviewViewController.swift +++ b/NADA-iOS-forRelease/Sources/ViewControllers/CardCreation/CardCreationPreviewViewController.swift @@ -16,6 +16,7 @@ class CardCreationPreviewViewController: UIViewController { private var isFront = true private var cardCreationRequest: CardCreationRequest? + private var isShareable = false // MARK: - @IBOutlet Properties @@ -83,7 +84,15 @@ extension CardCreationPreviewViewController { frontCard.frame = CGRect(x: 0, y: 0, width: cardView.frame.width, height: cardView.frame.height) guard let frontCardDataModel = frontCardDataModel else { return } - frontCard.initCell(cardBackgroundImage, frontCardDataModel.title, frontCardDataModel.description, frontCardDataModel.name, frontCardDataModel.birthDate, frontCardDataModel.mbti, frontCardDataModel.instagramID, frontCardDataModel.linkURL) + frontCard.initCell(cardBackgroundImage, + frontCardDataModel.title, + frontCardDataModel.description, + frontCardDataModel.name, + frontCardDataModel.birthDate, + frontCardDataModel.mbti, + frontCardDataModel.instagramID, + frontCardDataModel.linkURL, + isShareable: isShareable) cardView.addSubview(frontCard) } @@ -147,7 +156,8 @@ extension CardCreationPreviewViewController { frontCardDataModel.birthDate, frontCardDataModel.mbti, frontCardDataModel.instagramID, - frontCardDataModel.linkURL) + frontCardDataModel.linkURL, + isShareable: isShareable) cardView.addSubview(frontCard) isFront = true diff --git a/NADA-iOS-forRelease/Sources/ViewControllers/CardDetail/CardDetailViewController.swift b/NADA-iOS-forRelease/Sources/ViewControllers/CardDetail/CardDetailViewController.swift index 282f54d4..6957f370 100644 --- a/NADA-iOS-forRelease/Sources/ViewControllers/CardDetail/CardDetailViewController.swift +++ b/NADA-iOS-forRelease/Sources/ViewControllers/CardDetail/CardDetailViewController.swift @@ -38,6 +38,7 @@ class CardDetailViewController: UIViewController { @IBOutlet weak var backButton: UIButton! public var cardDataModel: Card? + private var isShareable: Bool = false private var isFront = true var status: Status = .group @@ -98,7 +99,8 @@ extension CardDetailViewController { cardDataModel?.birthDate ?? "", cardDataModel?.mbti ?? "", cardDataModel?.instagram ?? "", - cardDataModel?.link ?? "") + cardDataModel?.link ?? "", + isShareable: isShareable) cardView.addSubview(frontCard) } @@ -126,7 +128,8 @@ extension CardDetailViewController { cardDataModel?.isSauced ?? true, cardDataModel?.oneTMI ?? "", cardDataModel?.twoTMI ?? "", - cardDataModel?.thirdTMI ?? "") + cardDataModel?.thirdTMI ?? "", + isShareable: isShareable) cardView.addSubview(backCard) isFront = false @@ -141,7 +144,8 @@ extension CardDetailViewController { cardDataModel?.birthDate ?? "", cardDataModel?.mbti ?? "", cardDataModel?.instagram ?? "", - cardDataModel?.link ?? "") + cardDataModel?.link ?? "", + isShareable: isShareable) cardView.addSubview(frontCard) isFront = true From 7f9097e387017eca83175f0201632385487837a8 Mon Sep 17 00:00:00 2001 From: hyungyu Kim Date: Tue, 14 Dec 2021 19:38:49 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[FIX]=20#145=20-=20=EB=A9=94=EC=9D=B8=20fli?= =?UTF-8?q?p=20=EC=86=8D=EB=8F=84=20=EC=A1=B0=EC=A0=88=20=EB=B0=8F=20?= =?UTF-8?q?=EA=B3=B5=EC=9C=A0=EB=B2=84=ED=8A=BC=20=ED=9E=88=EB=93=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 명함 메인뷰 공유하기 보이게 하기 - 팀나다뷰 공유하기 hidden --- .../Sources/Cells/CardCell/MainCardCell.swift | 8 ++++---- .../ViewControllers/Main/FrontViewController.swift | 1 + .../ViewControllers/TeamNADA/TeamNADAViewController.swift | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/NADA-iOS-forRelease/Sources/Cells/CardCell/MainCardCell.swift b/NADA-iOS-forRelease/Sources/Cells/CardCell/MainCardCell.swift index 891be0be..b2ed15c2 100644 --- a/NADA-iOS-forRelease/Sources/Cells/CardCell/MainCardCell.swift +++ b/NADA-iOS-forRelease/Sources/Cells/CardCell/MainCardCell.swift @@ -14,8 +14,8 @@ class MainCardCell: CardCell { // MARK: - Properties private var isFront = true - private var isShareable = true + public var isShareable: Bool? public var cardDataModel: Card? // MARK: - View Life Cycle @@ -49,7 +49,7 @@ extension MainCardCell { cardDataModel.mbti, cardDataModel.instagram ?? "", cardDataModel.link ?? "", - isShareable: isShareable) + isShareable: isShareable ?? false) contentView.addSubview(frontCard) } @@ -81,7 +81,7 @@ extension MainCardCell { cardDataModel.oneTMI ?? "", cardDataModel.twoTMI ?? "", cardDataModel.thirdTMI ?? "", - isShareable: isShareable) + isShareable: isShareable ?? false) contentView.addSubview(backCard) isFront = false @@ -98,7 +98,7 @@ extension MainCardCell { cardDataModel.mbti, cardDataModel.instagram ?? "", cardDataModel.link ?? "", - isShareable: isShareable) + isShareable: isShareable ?? false) contentView.addSubview(frontCard) isFront = true diff --git a/NADA-iOS-forRelease/Sources/ViewControllers/Main/FrontViewController.swift b/NADA-iOS-forRelease/Sources/ViewControllers/Main/FrontViewController.swift index 88b9872e..3b50cd09 100644 --- a/NADA-iOS-forRelease/Sources/ViewControllers/Main/FrontViewController.swift +++ b/NADA-iOS-forRelease/Sources/ViewControllers/Main/FrontViewController.swift @@ -147,6 +147,7 @@ extension FrontViewController: VerticalCardSwiperDatasource { guard let cell = verticalCardSwiperView.dequeueReusableCell(withReuseIdentifier: Const.Xib.mainCardCell, for: index) as? MainCardCell else { return CardCell() } guard let cardDataList = cardDataList else { return CardCell() } cell.initCell(cardDataModel: cardDataList[index]) + cell.isShareable = true cell.setFrontCard() return cell diff --git a/NADA-iOS-forRelease/Sources/ViewControllers/TeamNADA/TeamNADAViewController.swift b/NADA-iOS-forRelease/Sources/ViewControllers/TeamNADA/TeamNADAViewController.swift index 9fdc3e0e..8709f776 100644 --- a/NADA-iOS-forRelease/Sources/ViewControllers/TeamNADA/TeamNADAViewController.swift +++ b/NADA-iOS-forRelease/Sources/ViewControllers/TeamNADA/TeamNADAViewController.swift @@ -167,6 +167,7 @@ extension TeamNADAViewController: VerticalCardSwiperDatasource { guard let cell = verticalCardSwiperView.dequeueReusableCell(withReuseIdentifier: Const.Xib.mainCardCell, for: index) as? MainCardCell else { return CardCell() } guard let cardDataList = cardDataList else { return CardCell() } cell.initCell(cardDataModel: cardDataList[index]) + cell.isShareable = false cell.setFrontCard() return cell