Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Screenshots 📸
고민, 과정, 근거 💬
공지를 눌러서 공지 세부 사항으로 넘어가야 하는데 Disclosure를 어떻게 없앨까?
ZStack
을 활용하여NavigationLink
를 만든 뒤 opacity를 0으로 설정해서 보이지 않도록 구현했습니다.Figma에 나와있는 bullet-style을 어떻게 구현해야할까?
단순히 공지사항에 문자를 그대로 보여주기만 하면 되는 문제이긴 하나, bullet이 들어왔을 때 동그라미 형식으로 띄워줘야하는 문제가 있었습니다.
그리고 bullet-style 텍스트와 그 외 텍스트는 폰트가 다르므로, 구분해서 적용해야했습니다.
해결
텍스트가 처음에
-
또는*
로 시작하는지Regex
를 통해 확인합니다.만약 찾으면
BulletTextView
에게 text를 넘깁니다.디자인을 보면, 상위 불렛과, 그 외 하위 불렛으로 나뉘어 표현되기도 합니다. 따라서
-
,*
이전의 공백의 개수를 알아야할 필요가 있습니다.그리고
Regex
로 확인할 수 있습니다.[1]또한, 하위불렛과 상위불렛끼리 구분할 때 띄어쓰기가 일관되지 않을 것을 고려하여 공백 개수에서 2만큼 나누었습니다.
예를 들면, 공백이
2개
이거나3개
라면 2로 나누어 전부1
로 맞추는 거예요!References 📋