Skip to content

Commit

Permalink
Fix: V, X 이모티콘일 경우 폰트 사이즈 다르게 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
jgj0131 committed Aug 12, 2022
1 parent 5719dbe commit de8c457
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Binary file not shown.
14 changes: 11 additions & 3 deletions Urgent/Urgent/View/UIViewController/CardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,11 @@ extension CardViewController: SendDataDelegate {
useButton.setTitle(UserDefaults.standard.string(forKey: "useButtonTitle"), for: .normal)
latitudeAndLongitude = "\(data["위도"]!), \(data["경도"]!)"
emergencyBellValue.text = (data["비상벨설치여부"] == "Y" ? "비상벨 ✅" + (data["비상벨설치장소"] == "" ? "" : " (위치: \(data["비상벨설치장소"] ?? "")") : "비상벨 ❌")
emergencyBellValue.attributedText = changeTextColor(text: emergencyBellValue.text ?? "")
emergencyBellValue.attributedText = changeTextSize(text: emergencyBellValue.text ?? "")
cctvValue.text = data["화장실입구CCTV설치유무"] == "Y" ? "입구 앞 CCTV ✅" : "입구 앞 CCTV ❌"
cctvValue.attributedText = changeTextColor(text: cctvValue.text ?? "")
cctvValue.attributedText = changeTextSize(text: cctvValue.text ?? "")
diaperValue.text = (data["기저귀교환대유무"] == "Y" ? "기저귀교환대 ✅" + (data["비상벨설치장소"] == "" ? "" : " (위치: \(data["기저귀교환대장소"] ?? "")") : "기저귀교환대 ❌")
diaperValue.attributedText = changeTextColor(text: diaperValue.text ?? "")
diaperValue.attributedText = changeTextSize(text: diaperValue.text ?? "")
}

func changeTextColor(text: String) -> NSMutableAttributedString {
Expand All @@ -252,6 +252,14 @@ extension CardViewController: SendDataDelegate {
attributedStr.addAttribute(.foregroundColor, value: UIColor(red: 1, green: 100/255, blue: 78/255, alpha: 1), range: (text as NSString).range(of: "없음"))
return attributedStr
}

func changeTextSize(text: String) -> NSMutableAttributedString {
let font: UIFont = UIFont(name: "Avenir Book", size: 15)!
let attributedStr = NSMutableAttributedString(string: text)
attributedStr.addAttribute(.font, value: font, range: (text as NSString).range(of: ""))
attributedStr.addAttribute(.font, value: font, range: (text as NSString).range(of: ""))
return attributedStr
}
}

extension CardViewController: MFMessageComposeViewControllerDelegate {
Expand Down
2 changes: 1 addition & 1 deletion Urgent/Urgent/View/UIViewController/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ extension ViewController: CLLocationManagerDelegate {
let annotations: [CustomAnnotation] = self.restroomData.getDataForFata().map { datum in
if datum["위도"] != "", datum["경도"] != "", datum["소재지도로명주소"] != nil {
let data = datum
let item = POIItem(data: data, coordinate: CLLocationCoordinate2DMake(Double(datum["위도"] ?? "0.00") ?? 35.395899, Double(datum["경도"] ?? "0.00") ?? 126.668518))
let item = POIItem(data: data, coordinate: CLLocationCoordinate2DMake(Double(datum["위도"] ?? "0.00") ?? 0.1, Double(datum["경도"] ?? "0.00") ?? 0.1))
let annotation = CustomAnnotation()
annotation.coordinate = item.coordinate
annotation.title = data["소재지도로명주소"] ?? ""
Expand Down

0 comments on commit de8c457

Please sign in to comment.