Skip to content

ref: convert SentrySamplerDecision from ObjC to Swift #8100

Description

@github-actions

Note

The pull request "ref: convert SentrySamplerDecision from ObjC to Swift" was created by @philprime but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear.

Converts SentrySamplerDecision from Objective-C to Swift as part of the ongoing Swift migration effort. This type had no internal ObjC dependencies (leaf node in the dependency graph), making it a clean candidate for conversion.

The Swift class is public @objcMembers so it appears in the generated -Swift.h header for consumption by ObjC .m files. Since ObjC++ (.mm) files cannot import the generated Swift header, a small C helper (sentry_samplerDecisionEquals) is provided in SentrySamplerDecisionHelper to bridge that gap.

Changes:

  • Removed SentrySamplerDecision.h / .m
  • Added SentrySamplerDecision.swift in Sources/Swift/Core/
  • Added SentrySamplerDecisionHelper.h / .m with extern "C" linkage for ObjC++ compatibility
  • Removed stale #import "SentrySamplerDecision.h" from 7 files
  • Updated SentryProfiledTracerConcurrency.mm to use the helper function
  • Updated project.pbxproj accordingly

#skip-changelog

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions