From 3914e85241bb869f6d0d4d45641417326d3abf71 Mon Sep 17 00:00:00 2001 From: hyungyu Kim Date: Tue, 14 Dec 2021 17:49:09 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]=20#145=20-=20=EB=A9=94=EC=9D=B8=20flip=20?= =?UTF-8?q?=EC=86=8D=EB=8F=84=20=EC=A1=B0=EC=A0=88=20=EB=B0=8F=20=EA=B3=B5?= =?UTF-8?q?=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