Skip to content

Commit

Permalink
Merge pull request #234 from Team-Smeme/develop
Browse files Browse the repository at this point in the history
[RELEASE] 코칭뷰 1차 QA
  • Loading branch information
cchanmi authored Dec 8, 2024
2 parents e81508b + cbc8db2 commit 5a3ab73
Show file tree
Hide file tree
Showing 80 changed files with 1,128 additions and 1,962 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/smeemDev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ name: Swift
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

jobs:
build:
Expand All @@ -18,12 +16,26 @@ jobs:
- uses: actions/checkout@v4
- name: Set Xcode version
run: sudo xcode-select -switch /Applications/Xcode_16.app
- name: List available devices
run: xcrun simctl list devices
- name: Resolve Dependencies
run: xcodebuild -resolvePackageDependencies
working-directory: ./Smeem-iOS
- name: Create Debug.xcconfig
run: echo "${{ secrets.DEBUG_CONFIG }}" > ./Smeem-iOS/Debug.xcconfig
- name: Build
run: xcodebuild build -project Smeem-iOS/Smeem-iOS.xcodeproj -scheme Smeem-Dev -destination 'platform=iOS Simulator,name=iPhone 14 Pro,OS=17.2'
run: xcodebuild clean test -project Smeem-iOS/Smeem-iOS.xcodeproj -scheme Smeem-Dev -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.2' -quiet

# 성공 시 Discord 알림
- name: Notify Discord on success
if: success()
run: |
curl -H "Content-Type: application/json" \
-d '{"username": "GitHub Actions", "content": "✅ Build succeeded for branch `${{ github.ref_name }}`."}' \
${{ secrets.DISCORD_WEBHOOK_URL_DEV }}
# # 실패 시 Discord 알림
- name: Notify Discord on failure
if: failure()
run: |
curl -H "Content-Type: application/json" \
-d '{"username": "GitHub Actions", "content": "❌ Build failed for branch `${{ github.ref_name }}`. Check logs for details."}' \
${{ secrets.DISCORD_WEBHOOK_URL_DEV }}
359 changes: 120 additions & 239 deletions Smeem-iOS/Smeem-iOS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

31 changes: 0 additions & 31 deletions Smeem-iOS/Smeem-iOS/Global/Extensions/MoyaProvier+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,6 @@
import Foundation
import Moya

class ServiceNetwork {

static let shared = ServiceNetwork()

private init() {}

func request<T: Decodable, Target: TargetType>(_ target: Target) async throws -> T {
let provider = MoyaProvider<Target>(plugins: [MoyaLoggingPlugin()])

return try await withCheckedThrowingContinuation { continuation in
provider.request(target) { result in
switch result {
case .success(let response):
do {
try NetworkManager.statusCodeErrorHandling(statusCode: response.statusCode)
if let data = try response.map(GeneralResponse<T>.self).data {
continuation.resume(returning: data)
} else {
continuation.resume(throwing: SmeemError.clientError)
}
} catch {
continuation.resume(throwing: SmeemError.clientError)
}
case .failure(let error):
continuation.resume(throwing: error)
}
}
}
}
}

extension MoyaProvider {
func request<T: Decodable>(_ target: Target) async throws -> T {
try await withCheckedThrowingContinuation { continuation in
Expand Down
45 changes: 45 additions & 0 deletions Smeem-iOS/Smeem-iOS/Global/HighlightModifier.swift
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)
}
}
5 changes: 5 additions & 0 deletions Smeem-iOS/Smeem-iOS/Global/Literals/ColorLiterals.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ extension UIColor {
return UIColor(hex: "#171716", alpha: 0.3)
}

/// 400, 500 토스트
static var errorToastBackground: UIColor {
return UIColor(hex: "#171716")
}

static var summaryBackground: UIColor {
return UIColor(hex: "#FAFAFA")
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

15 changes: 0 additions & 15 deletions Smeem-iOS/Smeem-iOS/Global/Protocols/NextButtonDelegate.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ protocol Store {
associatedtype State

var state: State { get }

@MainActor
func send(action: Action)
}
Loading

0 comments on commit 5a3ab73

Please sign in to comment.