This repository has been archived by the owner on Jan 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: 비밀번호 찾기 화면 내 label lineheight 적용 #82
- Loading branch information
1 parent
6ce275a
commit 516a49a
Showing
2 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
Weekand/Weekand/Presentation/Common/View/WMultiLineTextLabel.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// WMultiLineTextLabel.swift | ||
// Weekand | ||
// | ||
// Created by 이호영 on 2022/07/25. | ||
// | ||
|
||
import UIKit | ||
|
||
class WMultiLineTextLabel: UILabel { | ||
|
||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
setupView() | ||
} | ||
|
||
required init?(coder aDecoder: NSCoder) { | ||
super.init(coder: aDecoder) | ||
setupView() | ||
} | ||
|
||
func setupView() { | ||
font = WFont.body1() | ||
numberOfLines = 0 | ||
} | ||
|
||
func setText(string: String) { | ||
let attrString = NSMutableAttributedString(string: string) | ||
let paragraphStyle = NSMutableParagraphStyle() | ||
paragraphStyle.lineHeightMultiple = 1.33 | ||
attrString.addAttribute(NSAttributedString.Key.paragraphStyle, value: paragraphStyle, range: NSMakeRange(0, attrString.length)) | ||
attributedText = attrString | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters