-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #234 from Team-Smeme/develop
[RELEASE] 코칭뷰 1차 QA
- Loading branch information
Showing
80 changed files
with
1,128 additions
and
1,962 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// HighlightModifier.swift | ||
// Smeem-iOS | ||
// | ||
// Created by Joon Baek on 11/26/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
/* | ||
# 사용법 | ||
- `diaryText`: 강조 표시를 적용할 전체 텍스트 (String) | ||
- `corrections`: 강조할 문장의 목록 (CoachingResponse 배열) | ||
- `highlightIndex`: 강조할 문장의 인덱스 (Int) | ||
|
||
`Text` 뷰에 `.modifier(HighlightModifier(...))`로 적용 | ||
|
||
# 예제 코드 | ||
|
||
Text(diaryText) | ||
.modifier(HighlightModifier( | ||
diaryText: diaryText, | ||
corrections: coachingResponse.corrections, | ||
highlightIndex: currentIndex | ||
)) | ||
*/ | ||
|
||
struct HighlightModifier: ViewModifier { | ||
let diaryText: String | ||
let corrections: [CoachingResponse] | ||
let highlightIndex: Int | ||
|
||
func body(content: Content) -> some View { | ||
var attributedText = AttributedString(diaryText) | ||
|
||
for (index, correction) in corrections.enumerated() { | ||
if index == highlightIndex, let range = attributedText.range(of: correction.originalSentence) { | ||
attributedText[range].backgroundColor = Color(UIColor.point) | ||
attributedText[range].foregroundColor = Color(UIColor.smeemWhite) | ||
} | ||
} | ||
|
||
return Text(attributedText) | ||
} | ||
} |
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
12 changes: 0 additions & 12 deletions
12
Smeem-iOS/Smeem-iOS/Global/Protocols/DataSend/AuthDataSendProtocol.swift
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
Smeem-iOS/Smeem-iOS/Global/Protocols/DataSend/DataBindProtocol.swift
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
Smeem-iOS/Smeem-iOS/Global/Protocols/DataSend/TrainingAlarmDataSendProtocol.swift
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
Smeem-iOS/Smeem-iOS/Global/Protocols/NextButtonDelegate.swift
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -12,5 +12,7 @@ protocol Store { | |
associatedtype State | ||
|
||
var state: State { get } | ||
|
||
@MainActor | ||
func send(action: Action) | ||
} |
File renamed without changes.
Oops, something went wrong.