Modernize codebase for iOS 17+ / macOS 14+ with Swift 6#49
Draft
Modernize codebase for iOS 17+ / macOS 14+ with Swift 6#49
Conversation
BREAKING CHANGES: - Deployment targets: iOS 14 → iOS 17, macOS 11 → macOS 14 - Swift tools version: 5.5 → 6.0 - Parameter name fix: `isConitnue` → `isContinue` - Property name fix: `hight` → `high` - PartData init: `index` parameter is now required Swift Concurrency Migration: - RouletteWorker: Timer → Task + AsyncStream (~60fps) - Added @mainactor and Sendable conformance - SlotRouletteWorker/Speed deprecated in favor of unified types @observable Migration: - RouletteModel: ObservableObject → @observable macro - SlotRouletteModel: Same migration - PassthroughSubject → callback pattern View Updates: - RouletteView: Generic StopView support - RouletteInternalView: Direct model passing (no @EnvironmentObject) - SlotRouletteView: #Preview macro - Removed AnyView usage in Content enum Architecture Simplification: - Removed delegate pattern from PartData - Added [PartData].calculateAngles() extension - All types now Sendable-compliant Tests: - Migrated from XCTest to Swift Testing (@suite, @test, #expect) - Removed unused mock files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- DemoApp: partDatasを名前付きタプル配列を使った簡潔な実装に変更 - ContentView: @ObservedObjectから@Stateに変更しonReceiveを削除 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
SwiftUIのObservationフレームワークに合わせ、コールバックベースの 通知からstate観察ベースの設計に変更。 - RouletteModel: onDecide削除、decidedPart計算プロパティ追加 - RouletteView: startOnAppearをonChange(of: state)ベースに変更 - SlotRouletteModel: onDecide削除 - ContentView: onChange(of: state)でdecidedPartを更新 BREAKING CHANGE: onDecideコールバックは廃止されました。 代わりにmodel.stateを観察してください。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- README: Requirements追加、コード例をObservation/state観察パターンに更新 - DemoApp: initでモデル初期化、NavigationStack使用、decidedPart活用 - ContentView: #Previewマクロ使用、decidedPart計算プロパティ活用 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
fummicc1
commented
Dec 18, 2025
Comment on lines
+40
to
+42
| .onChange(of: model.state) { _, newState in | ||
| if case .stop(let part, _) = newState, let text = part.content.text { | ||
| title = text |
Owner
Author
There was a problem hiding this comment.
I don't think this observation is necessary because a state inside Observation object automatically notifies the change to views who depend on that state.
If it's true, please update README documentation as well.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
BREAKING CHANGES:
isConitnue→isContinuehight→highindexparameter is now requiredSwift Concurrency Migration:
@observable Migration:
View Updates:
Architecture Simplification:
Tests:
🤖 Generated with Claude Code