Skip to content

Modernize codebase for iOS 17+ / macOS 14+ with Swift 6#49

Draft
fummicc1 wants to merge 4 commits intomainfrom
modernize-ios17-swift6
Draft

Modernize codebase for iOS 17+ / macOS 14+ with Swift 6#49
fummicc1 wants to merge 4 commits intomainfrom
modernize-ios17-swift6

Conversation

@fummicc1
Copy link
Owner

BREAKING CHANGES:

  • Deployment targets: iOS 14 → iOS 17, macOS 11 → macOS 14
  • Swift tools version: 5.5 → 6.0
  • Parameter name fix: isConitnueisContinue
  • Property name fix: highthigh
  • 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

fummicc1 and others added 4 commits December 18, 2025 19:13
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>
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
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant