-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#163] picker Item 이름 중 가독성이 떨어지던 것들을 보기 쉽게 수정
- NS관련 객체에 CustomStringConvertible을 구현
- Loading branch information
Showing
6 changed files
with
134 additions
and
5 deletions.
There are no files selected for viewing
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
29 changes: 29 additions & 0 deletions
29
YDS-Storybook/Extension/Description/NSLineBreakMode+CustomStringConvertible.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,29 @@ | ||
// | ||
// NSLineBreakMode+CustomStringConvertible.swift | ||
// YDS-Storybook | ||
// | ||
// Created by 강민석 on 2022/08/18. | ||
// | ||
|
||
import UIKit | ||
|
||
extension NSLineBreakMode: CustomStringConvertible { | ||
public var description: String { | ||
switch self { | ||
case .byWordWrapping: | ||
return "byWordWrapping" | ||
case .byCharWrapping: | ||
return "byCharWrapping" | ||
case .byClipping: | ||
return "byClipping" | ||
case .byTruncatingHead: | ||
return "byTruncatingHead" | ||
case .byTruncatingTail: | ||
return "byTruncatingTail" | ||
case .byTruncatingMiddle: | ||
return "byTruncatingMiddle" | ||
@unknown default: | ||
return "unknown" | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...ok/Extension/Description/NSParagraphStyle.LineBreakStrategy+CustomStringConvertible.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,36 @@ | ||
// | ||
// NSParagraphStyle.LineBreakStrategy+CustomStringConvertible.swift | ||
// YDS-Storybook | ||
// | ||
// Created by 강민석 on 2022/08/18. | ||
// | ||
|
||
import UIKit | ||
|
||
extension NSParagraphStyle.LineBreakStrategy: CustomStringConvertible { | ||
public var description: String { | ||
if #available(iOS 14.0, *) { | ||
switch self { | ||
case .pushOut: | ||
return "pushOut" | ||
case .hangulWordPriority: | ||
return "hangulWordPriority" | ||
case .standard: | ||
return "standard" | ||
case []: | ||
return "none" | ||
default: | ||
return "unknown" | ||
} | ||
} else { | ||
switch self { | ||
case .pushOut: | ||
return "pushOut" | ||
case []: | ||
return "none" | ||
default: | ||
return "unknown" | ||
} | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
YDS-Storybook/Extension/Description/UIModalPresentationStyle+CustomStringConvertible.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,37 @@ | ||
// | ||
// UIModalPresentationStyle+CustomStringConvertible.swift | ||
// YDS-Storybook | ||
// | ||
// Created by 강민석 on 2022/08/18. | ||
// | ||
|
||
import UIKit | ||
|
||
extension UIModalPresentationStyle: CustomStringConvertible { | ||
public var description: String { | ||
switch self { | ||
case .fullScreen: | ||
return "fullScreen" | ||
case .pageSheet: | ||
return "pageSheet" | ||
case .formSheet: | ||
return "formSheet" | ||
case .currentContext: | ||
return "currentContext" | ||
case .custom: | ||
return "custom" | ||
case .overFullScreen: | ||
return "overFullScreen" | ||
case .overCurrentContext: | ||
return "overCurrentContext" | ||
case .popover: | ||
return "popover" | ||
case .none: | ||
return "none" | ||
case .automatic: | ||
return "automatic" | ||
@unknown default: | ||
return "unknown" | ||
} | ||
} | ||
} |
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
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