Remove #if canImport(FoundationModels) checks from codebase#34078
Remove #if canImport(FoundationModels) checks from codebase#34078Cramsden wants to merge 1 commit into
Conversation
💪 Quality guardian4 tests files modified. You're a champion of test coverage! 🚀 🥇 Perfect PR sizeSmaller PRs are easier to review. Thanks for making life easy for reviewers! ✨ 🎉 BrowserViewController got smallerNice! ✅ New file code coverageNo new file detected so code coverage gate wasn't ran. ✅ Existing file code coverageNo modified file had significant enough changes for the coverage gate to run. Client.app: Coverage: 41.32
ComponentLibrary: Coverage: 38.39
SummarizeKit: Coverage: 71.85
Generated by 🚫 Danger Swift against 22b6f11 |
| #if canImport(FoundationModels) | ||
| let glassEffect = UIGlassEffect() | ||
| glassEffect.isInteractive = true | ||
| effectView.effect = glassEffect | ||
| #else | ||
| effectView.effect = UIBlurEffect(style: .systemUltraThinMaterial) | ||
| #endif |
There was a problem hiding this comment.
Some of these are tricky. They look as if we are missing the fallback but the function is marked @available so I guess it makes sense. 😆
| } | ||
|
|
||
| func isAppleSummarizerEnabled() -> Bool { | ||
| #if canImport(FoundationModels) |
There was a problem hiding this comment.
Should this become an @available iOS 26 check? Is apple summarizer only possible iOS 26+? 🤔 We might have to check with @issammani .
There was a problem hiding this comment.
This function is not doing anything iOS26 specific. The function that actually writes to user defaults to say it is available is marked as only for iOS 26 but if the user default value is not written it will return false so this should not need to be marked with an iOS 26 check.
There was a problem hiding this comment.
Ok I didn't walk through the codepath but I do see in SummarizerServiceFactory.swift there's a isAppleSummarizerEnabled and iOS 26 availability check. Hopefully that means <iOS 26 drops back to the hosted model just fine.
| } | ||
|
|
||
| func isAppleSummarizerEnabled() -> Bool { | ||
| #if canImport(FoundationModels) |
There was a problem hiding this comment.
Ok I didn't walk through the codepath but I do see in SummarizerServiceFactory.swift there's a isAppleSummarizerEnabled and iOS 26 availability check. Hopefully that means <iOS 26 drops back to the hosted model just fine.
📜 Tickets
Jira ticket
💡 Description
removes all #if canImport(FoundationModels) checks across the codebase, keeping the positive (FoundationModels / iOS 26) path and dropping the pre-iOS 26 fallback branches and now-stale explanatory comments. Bitrise is now on iOS26 so we don't need these anymore.
🎥 Demos
Demo
📝 Checklist