Skip to content

Commit

Permalink
Merge pull request #420 from TeamNADA/feature/#396
Browse files Browse the repository at this point in the history
feat: 명함 생성 뒷면 기능 확인 (#396)
  • Loading branch information
hyun99999 authored Apr 15, 2023
2 parents dc14f41 + 3cab4c3 commit 7b532dc
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 55 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina5_9" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand All @@ -23,7 +23,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FHO-mj-1yu">
<rect key="frame" x="24" y="114" width="327" height="540"/>
<rect key="frame" x="24" y="120" width="327" height="540"/>
<color key="backgroundColor" systemColor="systemGray6Color"/>
<gestureRecognizers/>
<constraints>
Expand All @@ -32,12 +32,12 @@
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="10"/>
<integer key="value" value="20"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uDr-em-N5O">
<rect key="frame" x="0.0" y="44" width="375" height="50"/>
<rect key="frame" x="0.0" y="50" width="375" height="50"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="JTT-Cr-gmG">
<rect key="frame" x="24" y="13" width="24" height="24"/>
Expand All @@ -64,7 +64,7 @@
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Cgr-Tn-nVH">
<rect key="frame" x="41.666666666666657" y="670" width="291.66666666666674" height="40.666666666666629"/>
<rect key="frame" x="41.666666666666657" y="676" width="291.66666666666674" height="40.666666666666629"/>
<string key="text">명함을 좌우로 넘겨 앞/뒷면을 확인해보세요.
한 번 만든 명함은 수정할 수 없습니다.</string>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
Expand Down
7 changes: 3 additions & 4 deletions NADA-iOS-forRelease/Sources/Cells/CardCell/BackCardCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import UIKit

import VerticalCardSwiper
import Kingfisher

Expand All @@ -18,11 +19,8 @@ class BackCardCell: CardCell {
// MARK: - @IBOutlet Properties
@IBOutlet weak var backgroundImageView: UIImageView!
@IBOutlet weak var tasteTitleLabel: UILabel!

@IBOutlet var tasteImageViews: [UIImageView]!

@IBOutlet var tasteLabels: [UILabel]!

@IBOutlet weak var tmiTitleLabel: UILabel!
@IBOutlet weak var shareButton: UIButton!
@IBOutlet weak var tmiLabel: UILabel!
Expand Down Expand Up @@ -60,10 +58,11 @@ extension BackCardCell {

tmiLabel.font = .textRegular04
tmiLabel.textColor = .background
tmiLabel.numberOfLines = 0
}

func initCell(cardTasteInfo: [CardTasteInfo], tmi: String?, isShareable: Bool = false) {
let cardTasteInfo: [CardTasteInfo] = cardTasteInfo.sorted { $0.sortOrder < $1.sortOrder }
let cardTasteInfo: [CardTasteInfo] = cardTasteInfo.sorted { $0.sortOrder > $1.sortOrder }

for index in stride(from: 0, to: cardTasteInfo.count, by: 2) {
if cardTasteInfo[index].isChoose {
Expand Down
24 changes: 12 additions & 12 deletions NADA-iOS-forRelease/Sources/Cells/CardCell/BackCardCell.xib
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down Expand Up @@ -99,49 +99,49 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yWc-gu-ca5">
<rect key="frame" x="48" y="102" width="42" height="21"/>
<rect key="frame" x="36" y="102" width="42" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0VZ-Iq-YfG">
<rect key="frame" x="237" y="102" width="42" height="21"/>
<rect key="frame" x="249" y="102" width="42" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="trU-Am-jlp">
<rect key="frame" x="48" y="153" width="42" height="21"/>
<rect key="frame" x="36" y="153" width="42" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cJI-Zc-w2j">
<rect key="frame" x="237" y="153" width="42" height="21"/>
<rect key="frame" x="249" y="153" width="42" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="19t-Fx-dQ8">
<rect key="frame" x="48" y="204" width="42" height="21"/>
<rect key="frame" x="36" y="204" width="42" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EUO-lM-Tml">
<rect key="frame" x="237" y="204" width="42" height="21"/>
<rect key="frame" x="249" y="204" width="42" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6T0-dr-P6W">
<rect key="frame" x="48" y="255" width="42" height="21"/>
<rect key="frame" x="36" y="255" width="42" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aNc-su-6SN">
<rect key="frame" x="237" y="255" width="42" height="21"/>
<rect key="frame" x="249" y="255" width="42" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
Expand Down Expand Up @@ -170,7 +170,7 @@
<constraint firstItem="trU-Am-jlp" firstAttribute="centerY" secondItem="Sfm-fL-vo0" secondAttribute="centerY" id="JjA-np-XJG"/>
<constraint firstItem="bNI-yG-96K" firstAttribute="top" secondItem="XT5-iW-6kG" secondAttribute="bottom" constant="3.5" id="Kaa-x2-BOP"/>
<constraint firstItem="aNc-su-6SN" firstAttribute="trailing" secondItem="0VZ-Iq-YfG" secondAttribute="trailing" id="Nyw-zl-nns"/>
<constraint firstItem="0VZ-Iq-YfG" firstAttribute="trailing" secondItem="sLy-tM-Foc" secondAttribute="trailing" constant="-24" id="Tk3-aq-AiS"/>
<constraint firstItem="0VZ-Iq-YfG" firstAttribute="trailing" secondItem="sLy-tM-Foc" secondAttribute="trailing" constant="-12" id="Tk3-aq-AiS"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="Ch6-5U-VOL" secondAttribute="trailing" constant="24" id="VvQ-c1-IEH"/>
<constraint firstItem="XT5-iW-6kG" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="24" id="Y36-eF-FL8"/>
<constraint firstItem="19t-Fx-dQ8" firstAttribute="centerY" secondItem="Z3d-Jw-0bl" secondAttribute="centerY" id="Y3l-pu-rSB"/>
Expand All @@ -197,7 +197,7 @@
<constraint firstItem="5Bo-yc-zB1" firstAttribute="trailing" secondItem="sLy-tM-Foc" secondAttribute="trailing" id="tea-0m-xv9"/>
<constraint firstItem="sLy-tM-Foc" firstAttribute="trailing" secondItem="FfP-9G-1a3" secondAttribute="trailing" id="uPF-Uu-eOa"/>
<constraint firstItem="5Bo-yc-zB1" firstAttribute="top" secondItem="Z3d-Jw-0bl" secondAttribute="bottom" constant="16" id="v44-xR-hy4"/>
<constraint firstItem="yWc-gu-ca5" firstAttribute="leading" secondItem="sLy-tM-Foc" secondAttribute="leading" constant="24" id="vgT-ka-S97"/>
<constraint firstItem="yWc-gu-ca5" firstAttribute="leading" secondItem="sLy-tM-Foc" secondAttribute="leading" constant="12" id="vgT-ka-S97"/>
<constraint firstItem="sLy-tM-Foc" firstAttribute="leading" secondItem="FfP-9G-1a3" secondAttribute="leading" id="wCX-42-FQN"/>
<constraint firstItem="6T0-dr-P6W" firstAttribute="centerY" secondItem="5Bo-yc-zB1" secondAttribute="centerY" id="xTO-WH-sTR"/>
</constraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ class BackCardCreationCollectionViewCell: UICollectionViewCell {
static let identifier = "BackCardCreationCollectionViewCell"

var flavorList: [String]?
// TODO: - UITextView 꽉 채우고 최대 글자수 지정.
private let maxLength: Int = 0
private let maxLength: Int = 140
private var requiredCollectionViewList = [UICollectionView]()

public weak var backCardCreationDelegate: BackCardCreationDelegate?
Expand Down Expand Up @@ -202,4 +201,9 @@ extension BackCardCreationCollectionViewCell: UITextViewDelegate {
checkBackCardStatus()
textView.borderWidth = 0
}
func textViewDidChange(_ textView: UITextView) {
if textView.text.count > 140 {
textView.deleteBackward()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ extension FrontCardCreationCollectionViewCell {
} else {
frontCardCreationDelegate?.frontCardCreation(requiredInfo: false)
}
if let _ = defaultImageIndex {
if let defaultImageIndex {
frontCardCreationDelegate?.frontCardCreation(with: FrontCardDataModel(birth: birthLabel.text ?? "",
cardName: cardTitleTextField.text ?? "",
userName: userNameTextField.text ?? "",
Expand All @@ -212,7 +212,8 @@ extension FrontCardCreationCollectionViewCell {
mbti: mbtiLabel.text,
phoneNumber: phoneNumberTextField.text,
sns: instagramIDTextField.text,
urls: linkURLTextField.text == nil ? nil : [linkURLTextField.text ?? ""]))
urls: linkURLTextField.text == nil ? nil : [linkURLTextField.text ?? ""],
defaultImageIndex: defaultImageIndex))
}
}
static func nib() -> UINib {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@ struct CardCreationRequest: Codable {
}

// MARK: - FrontCard

struct FrontCardDataModel: Codable {
let birth, cardName, userName: String

let departmentName, mailAddress, mbti, phoneNumber, sns: String?
let urls: [String]?
let defaultImageIndex: Int
}

// MARK: - BackCard

struct BackCardDataModel: Codable {
let tastes: [String]
let tmi: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ extension CardService: TargetType {
return .requestJSONEncodable(requestModel)
case .imageUpload(let image):
var multiPartData: [Moya.MultipartFormData] = []
let imageData = MultipartFormData(provider: .data(image.pngData() ?? Data()), name: "image", mimeType: "image/png")
let imageData = MultipartFormData(provider: .data(image.pngData() ?? Data()), name: "image", fileName: "image", mimeType: "image/png")
multiPartData.append(imageData)

return .uploadMultipart(multiPartData)
Expand Down
Loading

0 comments on commit 7b532dc

Please sign in to comment.