twostraws / CodeScanner

A SwiftUI view that is able to scan barcodes, QR codes, and more, and send back what was found.
MIT License
986 stars 272 forks source link

@MainActor warnings when calling startRunning/stopRunning on background thread #105

Open brunomunizaf opened 1 year ago

brunomunizaf commented 1 year ago

Hi Paul,

Would you mind adding these two flags to your Package.swift? I'm facing @MainActor warnings that startRunning/stopRunning did not got called on the main thread.

for target in package.targets {
  if target.type == .binary { continue }
  target.swiftSettings = target.swiftSettings ?? []
  target.swiftSettings?.append(
    .unsafeFlags([
      "-Xfrontend", "-strict-concurrency=targeted",
      "-Xfrontend", "-enable-actor-data-race-checks"
    ], .when(configuration: .debug))
  )
}
nathanfallet commented 1 year ago

Hello! Feel free to open a PR to suggest your changes, and we'll be happy to review it and merge it.