Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: 개인정보 및 약관 동의 페이지 디자인 수정 #105

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion pochak/pochak.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 56;
objectVersion = 70;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -470,6 +470,10 @@
F9A6AE07B1A942C2FFC48F28 /* Pods-pochak-pochakUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-pochak-pochakUITests.release.xcconfig"; path = "Target Support Files/Pods-pochak-pochakUITests/Pods-pochak-pochakUITests.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFileSystemSynchronizedRootGroup section */
082638162CDDEDE000EE1521 /* Views */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Views; sourceTree = "<group>"; };
/* End PBXFileSystemSynchronizedRootGroup section */

/* Begin PBXFrameworksBuildPhase section */
EA1B0B542A49D23A00F86FBC /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
Expand Down Expand Up @@ -853,6 +857,7 @@
373815142A89E6BE0032066A /* Login */ = {
isa = PBXGroup;
children = (
082638162CDDEDE000EE1521 /* Views */,
EAAACDB42A5168280041B1B9 /* Login.storyboard */,
373815152A89E6D30032066A /* SocialJoinViewController.swift */,
3766F4122C3A69E5001DD239 /* TermsOfAgreeViewController.swift */,
Expand Down Expand Up @@ -1373,6 +1378,9 @@
);
dependencies = (
);
fileSystemSynchronizedGroups = (
082638162CDDEDE000EE1521 /* Views */,
);
name = pochak;
productName = pochak;
productReference = EA1B0B572A49D23A00F86FBC /* pochak.app */;
Expand Down
38 changes: 38 additions & 0 deletions pochak/pochak/Global/Extensions/UILabel+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,42 @@ extension UILabel {
attributedText = attributeString
}
}

/// UILabel 내의 특정 문자열의 CGRect를 반환하는 메소드
/// - Parameter subText: CGRect값을 알고 싶은 특정 문자열
/// - Returns: 해당 문자열의 CGRect
func boundingRectForCharacterRange(subText: String) -> CGRect? {
guard let attributedText = attributedText else { return nil }
guard let text = self.text else { return nil }

guard let subRange = text.range(of: subText) else { return nil }
let range = NSRange(subRange, in: text)

// attributedText를 기반으로 한 NSTextStorage를 선언하고 NSLayoutManager를 추가
let layoutManager = NSLayoutManager()
let textStorage = NSTextStorage(attributedString: attributedText)
textStorage.addLayoutManager(layoutManager)

// instrinsicContentSize를 기반으로 NSTextContainer를 선언
let textContainer = NSTextContainer(size: intrinsicContentSize)

// 정확한 CGRect를 구해야하므로 padding 값은 0
textContainer.lineFragmentPadding = 0.0

// layoutManager에 추가
layoutManager.addTextContainer(textContainer)
var glyphRange = NSRange()

// 주어진 범위(rage)에 대한 실질적인 glyphRange 구하기
layoutManager.characterRange(
forGlyphRange: range,
actualGlyphRange: &glyphRange
)

// textContainer 내의 지정된 glyphRange에 대한 CGRect 값 반환
return layoutManager.boundingRect(
forGlyphRange: glyphRange,
in: textContainer
)
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Checkmark.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
18 changes: 8 additions & 10 deletions pochak/pochak/UI/Login/Base.lproj/Login.storyboard
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="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="w5l-aB-8rx">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="w5l-aB-8rx">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Image references" minToolsVersion="12.0"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
Expand All @@ -14,9 +14,15 @@
<array key="Pretendard-Bold.ttf">
<string>Pretendard-Bold</string>
</array>
<array key="Pretendard-Light.ttf">
<string>Pretendard-Light</string>
</array>
<array key="Pretendard-Medium.ttf">
<string>Pretendard-Medium</string>
</array>
<array key="Pretendard-SemiBold.ttf">
<string>Pretendard-SemiBold</string>
</array>
</customFonts>
<scenes>
<!--Social Join View Controller-->
Expand Down Expand Up @@ -422,9 +428,6 @@
<state key="normal" title="보기">
<color key="titleColor" name="gray04"/>
</state>
<connections>
<action selector="openPrivacyPolicy:" destination="3Iw-Cb-BdT" eventType="touchUpInside" id="glY-T0-Ucx"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="c7L-9Z-VnX">
<rect key="frame" x="260" y="149.66666666666669" width="30" height="30"/>
Expand All @@ -433,9 +436,6 @@
<state key="normal" title="보기">
<color key="titleColor" name="gray04"/>
</state>
<connections>
<action selector="openTermsOfUSe:" destination="3Iw-Cb-BdT" eventType="touchUpInside" id="h0F-15-PlT"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="W25-HF-kds">
<rect key="frame" x="10" y="298.33333333333337" width="280" height="33.333333333333314"/>
Expand Down Expand Up @@ -497,8 +497,6 @@
<outlet property="backgroundView" destination="9PP-lq-jel" id="zfn-GI-c1I"/>
<outlet property="pochakCorpLabel" destination="QJt-RG-HKZ" id="01Q-WZ-lzQ"/>
<outlet property="pochakLabel" destination="zpj-Id-v3Y" id="Cqc-Vk-xSt"/>
<outlet property="seePrivacyPolicy" destination="vJI-PQ-G2a" id="9ze-Sn-jR8"/>
<outlet property="seeTermsOfUse" destination="c7L-9Z-VnX" id="13B-J4-PUe"/>
<outlet property="titleLabel" destination="6GH-cM-sso" id="KEY-zp-4im"/>
</connections>
</viewController>
Expand Down
4 changes: 2 additions & 2 deletions pochak/pochak/UI/Login/SocialJoinViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class SocialJoinViewController: UIViewController, SendDelegate {

private func changeViewControllerAccordingToisNewMemeberStateForGoogle(_ isNewMember : Bool, _ resultDataForGoogle : GoogleLoginModel){
if isNewMember == true {
guard let termsOfAgreeVC = self.storyboard?.instantiateViewController(withIdentifier: "TermsOfAgreeVC") as? TermsOfAgreeViewController else {return}
let termsOfAgreeVC = TermsOfAgreeViewController()
termsOfAgreeVC.modalPresentationStyle = .overCurrentContext // 투명도가 있으면 투명도에 맞춰서 나오게 해주는 코드(뒤에있는 배경이 보일 수 있게)
termsOfAgreeVC.delegate = self
self.present(termsOfAgreeVC, animated: false, completion: nil)
Expand All @@ -144,7 +144,7 @@ class SocialJoinViewController: UIViewController, SendDelegate {
if isNewMember == true {
print("inside changeVCForApple")
// 프로필 설정 페이지로 이동
guard let termsOfAgreeVC = self.storyboard?.instantiateViewController(withIdentifier: "TermsOfAgreeVC") as? TermsOfAgreeViewController else {return}
let termsOfAgreeVC = TermsOfAgreeViewController()
termsOfAgreeVC.modalPresentationStyle = .overCurrentContext // 투명도가 있으면 투명도에 맞춰서 나오게 해주는 코드(뒤에있는 배경이 보일 수 있게)
termsOfAgreeVC.delegate = self
self.present(termsOfAgreeVC, animated: false, completion: nil)
Expand Down
Loading