Skip to content

Update folders to properly follow SPM conventions#57

Closed
stefanomondino wants to merge 1 commit intoefremidze:masterfrom
stefanomondino:master
Closed

Update folders to properly follow SPM conventions#57
stefanomondino wants to merge 1 commit intoefremidze:masterfrom
stefanomondino:master

Conversation

@stefanomondino
Copy link
Copy Markdown

@stefanomondino stefanomondino commented Aug 25, 2025

Checklist

Motivation and Context

VisualEffectView is declared as a dependency of a third party framework our project is using.
After latest update, our app integration (made with Tuist through SPM) stopped working because of how VisualEffectView is structured in terms of folders.

As described here SPM convention states that source files should be inside a dedicated "Sources/" folder. Tuist follows this convention (check here and fails because source files are not in such folder, but in "Sources" folder (with no subfolder named as the library itself).

Description

I've moved all the files in a subfolder. I've also updated the cocoapods integration (is it still supported?) and also updated the version number.

Summary by CodeRabbit

  • Chores

    • Released version 5.0.7 for distribution.
    • Updated package configuration to include the correct source files for installation.
  • Refactor

    • Reorganized project structure for better maintainability and modularity.
    • Added an internal helper to streamline view behavior.
  • Notes

    • No user-facing changes; existing functionality remains the same.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 25, 2025

Walkthrough

Updates the podspec to version 5.0.7 and narrows source file glob to Sources/VisualEffectView/*.swift. The Xcode project file is upgraded and reorganized: groups rebuilt, file references regenerated, build phases updated, and a new UIViewEffectView+Helpers.swift is added to sources.

Changes

Cohort / File(s) Summary of Changes
Podspec update
VisualEffectView.podspec
Bumped s.version 5.0.0 → 5.0.7; changed s.source_files from Sources/*.swift to Sources/VisualEffectView/*.swift.
Xcode project reorg
VisualEffectView.xcodeproj/.../project.pbxproj
Upgraded objectVersion 54 → 63; restructured groups (new VisualEffectView and Sources); regenerated file references/build file entries; updated headers/sources build phases; added UIViewEffectView+Helpers.swift; replaced existing references for VisualEffectView.h, VisualEffectView.swift, VisualEffectView+SwiftUI.swift.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

Hop hop, a tidy burrow I weave,
Pods at 5.0.7—now I believe!
New helpers nested, groups aligned,
Headers and sources neatly combined.
I twitch my nose at Xcode’s maze—
Paths pruned clean for build-time days. 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (6)
VisualEffectView.podspec (1)

18-18: Narrowed source_files path aligns with SPM layout; decide on header exposure for CocoaPods

Pointing to "Sources/VisualEffectView/*.swift" is correct given the new structure. The project still ships VisualEffectView.h in the Xcode target, but the podspec excludes it. If Objective‑C consumers need that umbrella header, add it as a public header; otherwise consider removing the header to avoid confusion.

Option A — expose header:

 s.source_files     = "Sources/VisualEffectView/*.swift"
+s.public_header_files = "Sources/VisualEffectView/VisualEffectView.h"

Option B — keep Swift-only (no action), but please confirm no Obj‑C usage is intended.

VisualEffectView.xcodeproj/project.pbxproj (5)

6-6: Project format upgraded (objectVersion = 63) — document minimum Xcode

objectVersion 63 targets Xcode 15+. If you still want to support older Xcode versions for contributors, note the minimum Xcode version in the README; otherwise, all good.


50-53: Typo in filename: consider renaming “UIViewEffectView+Helpers.swift” → “UIVisualEffectView+Helpers.swift”

The file extends UIVisualEffectView but is named “UIViewEffectView…”. It compiles fine, but the name is misleading and can hinder searchability and code discovery.

Proposed rename (pbxproj edits shown; also rename the file on disk under Sources/VisualEffectView):

-70C155AE2E5C70D300D5BFA9 /* UIViewEffectView+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C155A72E5C70D300D5BFA9 /* UIViewEffectView+Helpers.swift */; };
+70C155AE2E5C70D300D5BFA9 /* UIVisualEffectView+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C155A72E5C70D300D5BFA9 /* UIVisualEffectView+Helpers.swift */; };

-70C155A72E5C70D300D5BFA9 /* UIViewEffectView+Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewEffectView+Helpers.swift"; sourceTree = "<group>"; };
+70C155A72E5C70D300D5BFA9 /* UIVisualEffectView+Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIVisualEffectView+Helpers.swift"; sourceTree = "<group>"; };

-70C155A72E5C70D300D5BFA9 /* UIViewEffectView+Helpers.swift */,
+70C155A72E5C70D300D5BFA9 /* UIVisualEffectView+Helpers.swift */,

Also applies to: 84-91, 271-273


158-159: Header included in Xcode target but excluded from podspec

This is fine if Carthage/manual frameworks need the umbrella header while CocoaPods and SPM stay Swift-only. If you want consistent behavior across all managers, either: (a) add the header to the podspec as public (see podspec comment), or (b) remove the header from the target.


271-274: SwiftUI source is included — consider availability guards for broader reuse

If you ever re‑enable multi‑platforms or older OSes, guard the SwiftUI shim file to prevent compile issues outside iOS 13+:

+// In Sources/VisualEffectView/VisualEffectView+SwiftUI.swift
+#if canImport(SwiftUI)
+import SwiftUI
+#if os(iOS)
 // existing contents…
+#endif
+#endif

424-447: Align deployment target and marketing version with podspec

  • Deployment target: Podspec declares iOS 14.0, but the project inherits iOS 15.6 from the project-level settings. Explicitly set the framework target to 14.0 so Carthage/manual builds match the podspec.
  • Versioning: The target’s MARKETING_VERSION is 4.1.5 while the podspec is 5.0.7. Align to avoid mixed-version artifacts.

Apply:

       buildSettings = {
         CLANG_ENABLE_MODULES = YES;
         CODE_SIGN_IDENTITY = "";
         DEFINES_MODULE = YES;
         DEVELOPMENT_TEAM = "";
         DYLIB_COMPATIBILITY_VERSION = 1;
         DYLIB_CURRENT_VERSION = 1;
         DYLIB_INSTALL_NAME_BASE = "@rpath";
         ENABLE_MODULE_VERIFIER = YES;
         GENERATE_INFOPLIST_FILE = YES;
+        IPHONEOS_DEPLOYMENT_TARGET = 14.0;
         INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
         LD_RUNPATH_SEARCH_PATHS = (
           "$(inherited)",
           "@executable_path/Frameworks",
           "@loader_path/Frameworks",
         );
-        MARKETING_VERSION = 4.1.5;
+        MARKETING_VERSION = 5.0.7;
         MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11";
         PRODUCT_BUNDLE_IDENTIFIER = com.example.VisualEffectView;
         PRODUCT_NAME = "$(TARGET_NAME)";
         SKIP_INSTALL = YES;
         SWIFT_OPTIMIZATION_LEVEL = "-Onone";
       };

Repeat the same two lines for the Release config block of the VisualEffectView target.

Also applies to: 449-473

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 2cd639c and 3b2ad0d.

📒 Files selected for processing (2)
  • VisualEffectView.podspec (1 hunks)
  • VisualEffectView.xcodeproj/project.pbxproj (5 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
VisualEffectView.podspec (3)
Sources/VisualEffectView.swift (2)
  • blurEffect (12-89)
  • _value (93-109)
Sources/VisualEffectView+SwiftUI.swift (2)
  • updateUIView (38-45)
  • colorTint (11-46)
Sources/UIViewEffectView+Helpers.swift (1)
  • backdropView (10-30)
VisualEffectView.xcodeproj/project.pbxproj (3)
Sources/VisualEffectView.swift (1)
  • blurEffect (12-89)
Sources/VisualEffectView+SwiftUI.swift (2)
  • updateUIView (38-45)
  • colorTint (11-46)
Sources/UIViewEffectView+Helpers.swift (2)
  • applyChanges (27-29)
  • backdropView (10-30)
🔇 Additional comments (2)
VisualEffectView.xcodeproj/project.pbxproj (2)

10-13: New sources correctly added to build phase

The helper, SwiftUI, and primary Swift files are wired into Sources and the header into Headers. LGTM.


84-102: Package.swift target configuration is correct
The Package.swift defines the VisualEffectView target simply with .target(name: "VisualEffectView") and does not specify a custom path. SwiftPM will default to Sources/VisualEffectView, which matches the Xcode group layout. No changes needed.

@efremidze
Copy link
Copy Markdown
Owner

efremidze commented Aug 29, 2025

I've merged your changes.

Thank you @stefanomondino!!!

@efremidze efremidze closed this Aug 29, 2025
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.

2 participants