Skip to content

Commit d712a9c

Browse files
chore: Add @mainactor annotations for Swift 6 concurrency [Phase 2] (#254)
Continues Swift 6 concurrency migration by adding @mainactor annotations to delegate implementations and UI-related classes
1 parent 29fba61 commit d712a9c

4 files changed

Lines changed: 5 additions & 2 deletions

File tree

GoogleMaps-Swift/GoogleMapsSwiftXCFrameworkDemos/Swift/Samples/AnimatedCurrentLocationViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ final class AnimatedCurrentLocationViewController: UIViewController {
7070
}
7171
}
7272

73-
extension AnimatedCurrentLocationViewController: CLLocationManagerDelegate {
73+
extension AnimatedCurrentLocationViewController: @MainActor CLLocationManagerDelegate {
7474
func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) {
7575
if locationManager.authorizationStatus == .denied {
7676
print("Please authorize location services")

GoogleMaps-Swift/GoogleMapsSwiftXCFrameworkDemos/Swift/Samples/CustomIndoorViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class CustomIndoorViewController: UIViewController {
6464

6565
}
6666

67-
extension CustomIndoorViewController: GMSIndoorDisplayDelegate {
67+
extension CustomIndoorViewController: @MainActor GMSIndoorDisplayDelegate {
6868

6969
func didChangeActiveBuilding(_ building: GMSIndoorBuilding?) {
7070
guard let building = building else {

GoogleMaps-Swift/GoogleMapsSwiftXCFrameworkDemos/Swift/Samples/DataDrivenStylingBasicViewController.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ private struct FeatureLayerConfig {
3232
let highlightPlaceID: String
3333
}
3434

35+
@MainActor
3536
private class SliderControls {
3637
let view: UIStackView
3738
let fillColor: UISlider
3839
let strokeColor: UISlider
3940
let strokeWidth: UISlider
4041
let label: UILabel
4142

43+
@MainActor
4244
private static func addSliderAndLabel(to parent: UIStackView, text: String, initialValue: Float)
4345
-> UISlider
4446
{

GoogleMaps-Swift/GoogleMapsSwiftXCFrameworkDemos/Swift/Samples/DataDrivenStylingSearchViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ private struct PlaceTextSearchResponse: Codable {
5050
let places: [Place]
5151
}
5252

53+
@MainActor
5354
private class PlaceLookupController: NSObject {
5455
let serial: Int
5556
let controller: DataDrivenStylingSearchViewController

0 commit comments

Comments
 (0)