diff --git a/pochak/pochak.xcodeproj/project.pbxproj b/pochak/pochak.xcodeproj/project.pbxproj index 18fcc3e7..95674f1a 100644 --- a/pochak/pochak.xcodeproj/project.pbxproj +++ b/pochak/pochak.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 56; + objectVersion = 70; objects = { /* Begin PBXBuildFile section */ @@ -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 = ""; }; /* End PBXFileReference section */ +/* Begin PBXFileSystemSynchronizedRootGroup section */ + 082638162CDDEDE000EE1521 /* Views */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Views; sourceTree = ""; }; +/* End PBXFileSystemSynchronizedRootGroup section */ + /* Begin PBXFrameworksBuildPhase section */ EA1B0B542A49D23A00F86FBC /* Frameworks */ = { isa = PBXFrameworksBuildPhase; @@ -853,6 +857,7 @@ 373815142A89E6BE0032066A /* Login */ = { isa = PBXGroup; children = ( + 082638162CDDEDE000EE1521 /* Views */, EAAACDB42A5168280041B1B9 /* Login.storyboard */, 373815152A89E6D30032066A /* SocialJoinViewController.swift */, 3766F4122C3A69E5001DD239 /* TermsOfAgreeViewController.swift */, @@ -1373,6 +1378,9 @@ ); dependencies = ( ); + fileSystemSynchronizedGroups = ( + 082638162CDDEDE000EE1521 /* Views */, + ); name = pochak; productName = pochak; productReference = EA1B0B572A49D23A00F86FBC /* pochak.app */; diff --git a/pochak/pochak/Global/Extensions/UILabel+.swift b/pochak/pochak/Global/Extensions/UILabel+.swift index 79b93fb3..8ab0f122 100644 --- a/pochak/pochak/Global/Extensions/UILabel+.swift +++ b/pochak/pochak/Global/Extensions/UILabel+.swift @@ -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 + ) + } } diff --git a/pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Checkmark.png b/pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Checkmark.png new file mode 100644 index 00000000..b1f8f34d Binary files /dev/null and b/pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Checkmark.png differ diff --git a/pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Checkmark@2x.png b/pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Checkmark@2x.png new file mode 100644 index 00000000..f5a5ca27 Binary files /dev/null and b/pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Checkmark@2x.png differ diff --git a/pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Checkmark@3x.png b/pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Checkmark@3x.png new file mode 100644 index 00000000..75a80264 Binary files /dev/null and b/pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Checkmark@3x.png differ diff --git a/pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Contents.json b/pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Contents.json new file mode 100644 index 00000000..91ff5752 --- /dev/null +++ b/pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Checkmark.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Checkmark@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Checkmark@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/pochak/pochak/UI/Login/Base.lproj/Login.storyboard b/pochak/pochak/UI/Login/Base.lproj/Login.storyboard index ccab4f0d..b4f400c0 100644 --- a/pochak/pochak/UI/Login/Base.lproj/Login.storyboard +++ b/pochak/pochak/UI/Login/Base.lproj/Login.storyboard @@ -1,9 +1,9 @@ - + - + @@ -14,9 +14,15 @@ Pretendard-Bold + + Pretendard-Light + Pretendard-Medium + + Pretendard-SemiBold + @@ -422,9 +428,6 @@ - - -