Skip to content

Commit

Permalink
Merge pull request #620 from TeamNado-Sunbae/chore/#582-Onboarding-Image
Browse files Browse the repository at this point in the history
โœ… [CHORE] ์˜จ๋ณด๋”ฉ ์ด๋ฏธ์ง€ ์ˆ˜์ •
  • Loading branch information
jane1choi authored Oct 26, 2022
2 parents b16d1a2 + 28649f2 commit 978884b
Show file tree
Hide file tree
Showing 37 changed files with 158 additions and 229 deletions.
13 changes: 13 additions & 0 deletions NadoSunbae-iOS/NadoSunbae-iOS/Global/Extension/UILabel+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,17 @@ extension UILabel {
attributedText = attributedString
}

/// ํŠน์ • ๋ฌธ์ž์—ด ํฐํŠธ ๋ณ€๊ฒฝ ๋ฐ ํ–‰๊ฐ„ ์กฐ์ • ๋ฉ”์„œ๋“œ
func setTextFontWithLineSpacing(targetStringList: [String], font: UIFont, lineSpacing: CGFloat) {
let fullText = text ?? ""
let attributedString = NSMutableAttributedString(string: fullText)
let style = NSMutableParagraphStyle()
style.lineSpacing = lineSpacing
targetStringList.forEach {
let range = (fullText as NSString).range(of: $0)
attributedString.addAttributes([.font: font as Any], range: range)
attributedString.addAttribute(NSAttributedString.Key.paragraphStyle, value: style, range: NSMakeRange(0, attributedString.length))
}
attributedText = attributedString
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19455" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina5_9" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19454"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -14,27 +14,30 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="FirstOnboardingCVC" customModule="NadoSunbae_iOS" customModuleProvider="target">
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="FirstOnboardingCVC" customModule="NadoSunbae" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AVP-ES-6l6">
<rect key="frame" x="32" y="492.5" width="273" height="86.5"/>
<rect key="frame" x="32" y="489" width="273" height="120"/>
<constraints>
<constraint firstAttribute="height" constant="120" id="aPo-Vn-PYu"/>
</constraints>
<string key="text">๋‚˜๋„์„ ๋ฐฐ์—์„œ
์†์‰ฝ๊ฒŒ ์„ ๋ฐฐ๋“ค์˜ ์ƒ์ƒ ํ›„๊ธฐ์™€
์งˆ์˜์‘๋‹ต์„ ํ™•์ธํ•˜์„ธ์š”.</string>
<fontDescription key="fontDescription" name="Pretendard-Regular" family="Pretendard" pointSize="24"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="749" image="group678" translatesAutoresizingMaskIntoConstraints="NO" id="bEQ-g0-8GI">
<rect key="frame" x="0.0" y="0.0" width="375" height="415.5"/>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="749" image="onboardingFirstPage" translatesAutoresizingMaskIntoConstraints="NO" id="bEQ-g0-8GI">
<rect key="frame" x="0.0" y="0.0" width="375" height="412"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="group87" translatesAutoresizingMaskIntoConstraints="NO" id="zKO-Xu-N3C">
<rect key="frame" x="32" y="454.5" width="24" height="24"/>
<rect key="frame" x="32" y="451" width="24" height="24"/>
<constraints>
<constraint firstAttribute="width" constant="24" id="RAN-kY-KMD"/>
<constraint firstAttribute="height" constant="24" id="VMT-kQ-phG"/>
Expand All @@ -44,7 +47,7 @@
</view>
<viewLayoutGuide key="safeArea" id="ZTg-uK-7eu"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="AVP-ES-6l6" secondAttribute="bottom" constant="233" id="8dF-x8-Gbp"/>
<constraint firstAttribute="bottom" secondItem="AVP-ES-6l6" secondAttribute="bottom" constant="203" id="8dF-x8-Gbp"/>
<constraint firstItem="zKO-Xu-N3C" firstAttribute="top" secondItem="bEQ-g0-8GI" secondAttribute="bottom" constant="39" id="AKR-rg-rcc"/>
<constraint firstItem="AVP-ES-6l6" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="32" id="PP1-kY-lvt"/>
<constraint firstItem="bEQ-g0-8GI" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="UWH-cj-5kJ"/>
Expand All @@ -60,7 +63,7 @@
</collectionViewCell>
</objects>
<resources>
<image name="group678" width="375" height="436"/>
<image name="group87" width="24" height="24"/>
<image name="onboardingFirstPage" width="375" height="420"/>
</resources>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,29 @@ class OnboardingCVC: BaseCVC {
// MARK: Life Cycle
override func awakeFromNib() {
super.awakeFromNib()
configureUI()
}
}

// MARK: - UI
extension OnboardingCVC {
private func configureUI() {
subTitleLabel.setLineSpacing(lineSpacing: 5)
subTitleLabel.textAlignment = .center
}
}

// MARK: - Custom Methods
extension OnboardingCVC {

/// ๋ฐ์ดํ„ฐ ์„ธํŒ… ํ•จ์ˆ˜
func setData(contentData: OnboardingContentData) {
func setData(index: Int, contentData: OnboardingContentData) {
titleLabel.text = contentData.title
subTitleLabel.text = contentData.subtitle
mainImgView.image = contentData.makeImg()

switch index {
case 2:
subTitleLabel.setTextFontWithLineSpacing(targetStringList: ["1:1 ์งˆ๋ฌธ", "๊ธฐ์กด์— ๋‚˜๋ˆด๋˜ ์งˆ์˜์‘๋‹ต"], font: .PretendardSB(size: 14), lineSpacing: 5)
subTitleLabel.textAlignment = .center
case 3:
subTitleLabel.setTextFontWithLineSpacing(targetStringList: ["๊ฐ ํ•™๊ณผ ํ•™์ƒ๋“ค๋กœ ๊ตฌ์„ฑ๋œ ์ปค๋ฎค๋‹ˆํ‹ฐ"], font: .PretendardSB(size: 14), lineSpacing: 5)
subTitleLabel.textAlignment = .center
default:
subTitleLabel.setLineSpacing(lineSpacing: 5)
subTitleLabel.textAlignment = .center
}
}
}

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19455" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19454"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand All @@ -18,24 +18,27 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="OnboardingCVC" customModule="NadoSunbae_iOS" customModuleProvider="target">
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="OnboardingCVC" customModule="NadoSunbae" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="์ƒ์ƒํ•œ ํ•™๊ณผ ํ›„๊ธฐ" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2kv-Vh-R6u">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" text="์ƒ์ƒํ•œ ํ•™๊ณผ ํ›„๊ธฐ" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2kv-Vh-R6u">
<rect key="frame" x="111" y="96" width="153" height="29"/>
<fontDescription key="fontDescription" name="Pretendard-SemiBold" family="Pretendard" pointSize="23.399999618530273"/>
<color key="textColor" name="mainDefault"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="749" image="group687" translatesAutoresizingMaskIntoConstraints="NO" id="jwr-rW-5X5">
<rect key="frame" x="24" y="215" width="327" height="399"/>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="749" image="onboarding1" translatesAutoresizingMaskIntoConstraints="NO" id="jwr-rW-5X5">
<rect key="frame" x="24" y="215" width="327" height="431"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GSB-6A-eFV">
<rect key="frame" x="73" y="157" width="229" height="34"/>
<rect key="frame" x="73" y="145" width="229" height="66"/>
<constraints>
<constraint firstAttribute="height" constant="66" id="6yT-Jo-llB"/>
</constraints>
<string key="text">์žฅ๋‹จ์ , ๋ญ˜๋ฐฐ์šฐ๋‚˜์š”?, ์ถ”์ฒœ์ˆ˜์—…, ๋น„์ถ”์ˆ˜์—…,
ํ–ฅํ›„์ง„๋กœ, ๊ฟ€ํŒ ๋“ฑ์œผ๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ์–ด์š”.</string>
<fontDescription key="fontDescription" name="Pretendard-Regular" family="Pretendard" pointSize="14"/>
Expand All @@ -49,10 +52,10 @@
<constraint firstItem="GSB-6A-eFV" firstAttribute="centerX" secondItem="ZTg-uK-7eu" secondAttribute="centerX" id="1Vc-lu-nab"/>
<constraint firstItem="jwr-rW-5X5" firstAttribute="centerX" secondItem="ZTg-uK-7eu" secondAttribute="centerX" id="2rY-ke-7g5"/>
<constraint firstItem="2kv-Vh-R6u" firstAttribute="centerX" secondItem="ZTg-uK-7eu" secondAttribute="centerX" id="3YE-pP-fYu"/>
<constraint firstItem="jwr-rW-5X5" firstAttribute="top" secondItem="GSB-6A-eFV" secondAttribute="bottom" constant="24" id="AX2-y5-zfv"/>
<constraint firstItem="GSB-6A-eFV" firstAttribute="top" secondItem="2kv-Vh-R6u" secondAttribute="bottom" constant="32" id="HIE-NI-dzD"/>
<constraint firstItem="jwr-rW-5X5" firstAttribute="top" secondItem="GSB-6A-eFV" secondAttribute="bottom" constant="4" id="AX2-y5-zfv"/>
<constraint firstItem="GSB-6A-eFV" firstAttribute="top" secondItem="2kv-Vh-R6u" secondAttribute="bottom" constant="20" id="HIE-NI-dzD"/>
<constraint firstItem="2kv-Vh-R6u" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="96" id="U5I-yh-OJ8"/>
<constraint firstAttribute="bottom" secondItem="jwr-rW-5X5" secondAttribute="bottom" constant="198" id="kJ7-89-eaI"/>
<constraint firstAttribute="bottom" secondItem="jwr-rW-5X5" secondAttribute="bottom" constant="166" id="kJ7-89-eaI"/>
</constraints>
<connections>
<outlet property="mainImgView" destination="jwr-rW-5X5" id="hLN-ml-4Wo"/>
Expand All @@ -63,7 +66,7 @@
</collectionViewCell>
</objects>
<resources>
<image name="group687" width="327" height="412"/>
<image name="onboarding1" width="327" height="412"/>
<namedColor name="mainDefault">
<color red="0.0" green="0.78431372549019607" blue="0.69019607843137254" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
Expand Down

This file was deleted.

Loading

0 comments on commit 978884b

Please sign in to comment.