Skip to content

Commit

Permalink
[FIX] TeamNADA#145 - 메인 flip 속도 조절 및 공유버튼 히든
Browse files Browse the repository at this point in the history
- 명함 상세뷰 공유하기 hidden
- 명함생성 미리보기뷰 공유하기 hidden
- 메인 명함 공유하기 보이게하기
> 워닝이 없는 곳에서의 self 지웠습니당
  • Loading branch information
hyun99999 committed Dec 14, 2021
1 parent a767234 commit 3914e85
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 22 deletions.
27 changes: 15 additions & 12 deletions NADA-iOS-forRelease/Sources/Cells/CardCell/BackCardCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 로 가져올 경우 사용
Expand Down
10 changes: 8 additions & 2 deletions NADA-iOS-forRelease/Sources/Cells/CardCell/FrontCardCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -112,6 +113,8 @@ extension FrontCardCell {
mbtiLabel.text = mbti
instagramIDLabel.text = instagramID
linkURLLabel.text = linkURL

shareButton.isHidden = !isShareable
}

/// 명함생성할 때 image 를 UIImage 로 가져올 경우 사용
Expand All @@ -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
Expand All @@ -131,5 +135,7 @@ extension FrontCardCell {
mbtiLabel.text = mbti
instagramIDLabel.text = instagramID
linkURLLabel.text = linkURL

shareButton.isHidden = !isShareable
}
}
10 changes: 7 additions & 3 deletions NADA-iOS-forRelease/Sources/Cells/CardCell/MainCardCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class MainCardCell: CardCell {
// MARK: - Properties

private var isFront = true
private var isShareable = true

public var cardDataModel: Card?

Expand Down Expand Up @@ -47,7 +48,8 @@ extension MainCardCell {
cardDataModel.birthDate,
cardDataModel.mbti,
cardDataModel.instagram ?? "",
cardDataModel.link ?? "")
cardDataModel.link ?? "",
isShareable: isShareable)

contentView.addSubview(frontCard)
}
Expand Down Expand Up @@ -78,7 +80,8 @@ extension MainCardCell {
cardDataModel.isSauced,
cardDataModel.oneTMI ?? "",
cardDataModel.twoTMI ?? "",
cardDataModel.thirdTMI ?? "")
cardDataModel.thirdTMI ?? "",
isShareable: isShareable)

contentView.addSubview(backCard)
isFront = false
Expand All @@ -94,7 +97,8 @@ extension MainCardCell {
cardDataModel.birthDate,
cardDataModel.mbti,
cardDataModel.instagram ?? "",
cardDataModel.link ?? "")
cardDataModel.link ?? "",
isShareable: isShareable)

contentView.addSubview(frontCard)
isFront = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class CardCreationPreviewViewController: UIViewController {

private var isFront = true
private var cardCreationRequest: CardCreationRequest?
private var isShareable = false

// MARK: - @IBOutlet Properties

Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -147,7 +156,8 @@ extension CardCreationPreviewViewController {
frontCardDataModel.birthDate,
frontCardDataModel.mbti,
frontCardDataModel.instagramID,
frontCardDataModel.linkURL)
frontCardDataModel.linkURL,
isShareable: isShareable)

cardView.addSubview(frontCard)
isFront = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -98,7 +99,8 @@ extension CardDetailViewController {
cardDataModel?.birthDate ?? "",
cardDataModel?.mbti ?? "",
cardDataModel?.instagram ?? "",
cardDataModel?.link ?? "")
cardDataModel?.link ?? "",
isShareable: isShareable)

cardView.addSubview(frontCard)
}
Expand Down Expand Up @@ -126,7 +128,8 @@ extension CardDetailViewController {
cardDataModel?.isSauced ?? true,
cardDataModel?.oneTMI ?? "",
cardDataModel?.twoTMI ?? "",
cardDataModel?.thirdTMI ?? "")
cardDataModel?.thirdTMI ?? "",
isShareable: isShareable)

cardView.addSubview(backCard)
isFront = false
Expand All @@ -141,7 +144,8 @@ extension CardDetailViewController {
cardDataModel?.birthDate ?? "",
cardDataModel?.mbti ?? "",
cardDataModel?.instagram ?? "",
cardDataModel?.link ?? "")
cardDataModel?.link ?? "",
isShareable: isShareable)

cardView.addSubview(frontCard)
isFront = true
Expand Down

0 comments on commit 3914e85

Please sign in to comment.