From bbd694dbd900a34f2c5603c84a8c00abc058033c Mon Sep 17 00:00:00 2001 From: InKwon James Kim Date: Fri, 3 Jan 2020 15:42:50 +0900 Subject: [PATCH] Fixed UI --- GME Remit/Extensions/UILabel+Ext.swift | 25 ++++ .../View/ManageAgreement.storyboard | 111 ++++++++++-------- .../View/ManageAgreementViewController.swift | 5 + 3 files changed, 89 insertions(+), 52 deletions(-) diff --git a/GME Remit/Extensions/UILabel+Ext.swift b/GME Remit/Extensions/UILabel+Ext.swift index 31436076..fc26f8da 100644 --- a/GME Remit/Extensions/UILabel+Ext.swift +++ b/GME Remit/Extensions/UILabel+Ext.swift @@ -13,4 +13,29 @@ extension UILabel { minimumScaleFactor = scale adjustsFontSizeToFitWidth = boolean } + + func setLineSpacing(lineSpacing: CGFloat = 0.0, lineHeightMultiple: CGFloat = 0.0) { + + guard let labelText = self.text else { return } + + let paragraphStyle = NSMutableParagraphStyle() + paragraphStyle.lineSpacing = lineSpacing + paragraphStyle.lineHeightMultiple = lineHeightMultiple + + let attributedString:NSMutableAttributedString + if let labelattributedText = self.attributedText { + attributedString = NSMutableAttributedString(attributedString: labelattributedText) + } else { + attributedString = NSMutableAttributedString(string: labelText) + } + + attributedString.addAttribute( + NSAttributedString.Key.paragraphStyle, + value:paragraphStyle, + range: NSMakeRange(0, attributedString.length) + ) + + self.attributedText = attributedString + } + } diff --git a/GME Remit/Modules/ManageAgreement/User Interface/View/ManageAgreement.storyboard b/GME Remit/Modules/ManageAgreement/User Interface/View/ManageAgreement.storyboard index 4f595a8e..667d0129 100644 --- a/GME Remit/Modules/ManageAgreement/User Interface/View/ManageAgreement.storyboard +++ b/GME Remit/Modules/ManageAgreement/User Interface/View/ManageAgreement.storyboard @@ -1,6 +1,6 @@ - + @@ -25,52 +25,53 @@ - + - + - - + + - + - - - + + - + - + - + @@ -79,13 +80,13 @@ + + + - + - + - + @@ -123,13 +127,13 @@