From ded1c1ab147151fb4773967cb3a68c632c1eafa0 Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Thu, 15 Oct 2020 13:00:23 -0700 Subject: [PATCH 1/9] Translation into Swift Concurrency model --- iOS/ARKit/ARCoachingOverlayView.swift | 4 +- iOS/ARKit/ARConfiguration.swift | 2 + iOS/ARKit/ARReferenceImage.swift | 2 + iOS/ARKit/ARSCNView.swift | 6 +- iOS/ARKit/ARSKView.swift | 6 +- iOS/ARKit/ARSession.swift | 22 +-- iOS/AVFoundation/AVAssetDownloadTask.swift | 10 +- iOS/AVFoundation/AVAssetExportSession.swift | 9 ++ iOS/AVFoundation/AVAssetImageGenerator.swift | 1 + iOS/AVFoundation/AVAssetResourceLoader.swift | 4 +- iOS/AVFoundation/AVAssetWriter.swift | 6 +- .../AVAsynchronousKeyValueLoading.swift | 1 + .../AVCaptureAudioDataOutput.swift | 2 +- .../AVCaptureDataOutputSynchronizer.swift | 2 +- .../AVCaptureDepthDataOutput.swift | 4 +- iOS/AVFoundation/AVCaptureDevice.swift | 10 ++ iOS/AVFoundation/AVCaptureFileOutput.swift | 4 +- .../AVCaptureMetadataOutput.swift | 2 +- iOS/AVFoundation/AVCapturePhotoOutput.swift | 15 +- .../AVCaptureStillImageOutput.swift | 5 + .../AVCaptureVideoDataOutput.swift | 4 +- iOS/AVFoundation/AVContentKeySession.swift | 21 ++- iOS/AVFoundation/AVPlayer.swift | 8 ++ iOS/AVFoundation/AVPlayerItem.swift | 4 + .../AVPlayerItemMediaDataCollector.swift | 2 +- iOS/AVFoundation/AVPlayerItemOutput.swift | 4 +- .../AVSampleBufferAudioRenderer.swift | 1 + .../AVSampleBufferRenderSynchronizer.swift | 1 + iOS/AVKit/AVPictureInPictureController.swift | 5 +- iOS/AVKit/AVPlaybackRouteSelecting.swift | 1 + iOS/AVKit/AVPlayerViewController.swift | 6 +- iOS/AVKit/AVRoutePickerView.swift | 2 +- iOS/Accounts/ACAccountStore.swift | 4 + .../ABNewPersonViewController.swift | 2 +- .../ABPeoplePickerNavigationController.swift | 6 +- .../ABUnknownPersonViewController.swift | 2 +- .../AppTrackingTransparency.swift | 1 + iOS/AudioToolbox/AUAudioUnit.swift | 1 + ...AuthenticationModificationController.swift | 4 +- ...ticationModificationExtensionContext.swift | 1 + .../ASAuthorizationAppleIDProvider.swift | 1 + .../ASAuthorizationController.swift | 4 +- ...roviderExtensionAuthorizationRequest.swift | 1 + .../ASCredentialIdentityStore.swift | 5 + ...ASCredentialProviderExtensionContext.swift | 1 + .../AutomaticAssessmentConfiguration.swift | 4 +- iOS/BackgroundTasks/BGTaskScheduler.swift | 1 + iOS/CallKit/CXCallController.swift | 5 + .../CXCallDirectoryExtensionContext.swift | 1 + iOS/CallKit/CXCallDirectoryManager.swift | 4 + iOS/CallKit/CXProvider.swift | 5 +- iOS/CarPlay/CPInterfaceController.swift | 26 +++- iOS/CarPlay/CPListTemplate.swift | 4 +- iOS/CarPlay/CPMapTemplate.swift | 17 +-- iOS/CarPlay/CPPointOfInterestTemplate.swift | 4 +- iOS/CarPlay/CPSearchTemplate.swift | 2 + iOS/CarPlay/CPTabBarTemplate.swift | 2 +- .../CPTemplateApplicationDashboardScene.swift | 4 +- iOS/CarPlay/CPTemplateApplicationScene.swift | 12 +- iOS/ClassKit/CLSContext.swift | 1 + iOS/ClassKit/CLSContextProvider.swift | 1 + iOS/ClassKit/CLSDataStore.swift | 3 + iOS/ClockKit/CLKWatchFaceLibrary.swift | 1 + iOS/CloudKit/CKContainer.swift | 26 ++++ iOS/CloudKit/CKDatabase.swift | 16 +++ iOS/Contacts/CNContactStore.swift | 1 + .../CNContactPickerViewController.swift | 10 +- iOS/ContactsUI/CNContactViewController.swift | 2 +- iOS/CoreAudioKit/AUViewController.swift | 1 + iOS/CoreBluetooth/CBCentralManager.swift | 12 +- iOS/CoreBluetooth/CBPeripheral.swift | 28 ++-- iOS/CoreBluetooth/CBPeripheralManager.swift | 20 +-- iOS/CoreData/NSFetchedResultsController.swift | 8 +- iOS/CoreData/NSPersistentContainer.swift | 1 + .../NSPersistentStoreCoordinator.swift | 2 + iOS/CoreHaptics/CHHapticEngine.swift | 2 + iOS/CoreLocation/CLGeocoder.swift | 9 ++ iOS/CoreLocation/CLLocationManager.swift | 2 + .../CLLocationManagerDelegate.swift | 32 ++--- iOS/CoreML/MLModel.swift | 2 + iOS/CoreML/MLModelCollection.swift | 1 + .../CMHeadphoneMotionManagerDelegate.swift | 4 +- iOS/CoreNFC/CoreNFC.swift | 128 ++++++++++++++++-- iOS/CoreSpotlight/CSSearchableIndex.swift | 10 +- .../CTCellularPlanProvisioning.swift | 2 + .../CTTelephonyNetworkInfo.swift | 2 +- iOS/DeviceCheck/DCAppAttestService.swift | 3 + iOS/DeviceCheck/DCDevice.swift | 1 + iOS/EventKit/EKEventStore.swift | 2 + iOS/EventKitUI/EKCalendarChooser.swift | 6 +- .../EKEventEditViewController.swift | 2 +- iOS/EventKitUI/EKEventViewController.swift | 2 +- iOS/ExposureNotification/ENManager.swift | 6 + iOS/ExternalAccessory/EAAccessory.swift | 2 +- .../EAAccessoryManager.swift | 2 + .../EAWiFiUnconfiguredAccessoryBrowser.swift | 8 +- iOS/FileProvider/Extension.swift | 8 ++ iOS/FileProvider/NSFileProviderActions.swift | 20 +++ .../NSFileProviderEnumerating.swift | 7 +- iOS/Foundation/NSBundle.swift | 2 + iOS/Foundation/NSExtensionContext.swift | 2 + iOS/Foundation/NSFileManager.swift | 3 + iOS/Foundation/NSFilePresenter.swift | 27 ++-- iOS/Foundation/NSFileVersion.swift | 2 + iOS/Foundation/NSHTTPCookieStorage.swift | 2 + iOS/Foundation/NSItemProvider.swift | 3 + iOS/Foundation/NSKeyedArchiver.swift | 6 +- iOS/Foundation/NSNetServices.swift | 26 ++-- iOS/Foundation/NSURLCache.swift | 2 + iOS/Foundation/NSURLConnection.swift | 22 +-- iOS/Foundation/NSURLCredentialStorage.swift | 4 + iOS/Foundation/NSURLProtocol.swift | 12 +- iOS/Foundation/NSURLSession.swift | 52 ++++--- iOS/Foundation/NSUserActivity.swift | 7 +- iOS/Foundation/NSXMLParser.swift | 12 +- iOS/GLKit/GLKTextureLoader.swift | 8 ++ iOS/GameController/GCController.swift | 1 + iOS/GameKit/GKAchievement.swift | 4 + iOS/GameKit/GKAchievementDescription.swift | 2 + iOS/GameKit/GKChallenge.swift | 11 ++ iOS/GameKit/GKCloudPlayer.swift | 1 + iOS/GameKit/GKEventListener.swift | 4 +- ...GKFriendRequestComposeViewController.swift | 2 +- iOS/GameKit/GKGameCenterViewController.swift | 2 +- iOS/GameKit/GKGameSession.swift | 11 ++ iOS/GameKit/GKGameSessionEventListener.swift | 12 +- iOS/GameKit/GKLeaderboard.swift | 18 +++ iOS/GameKit/GKLeaderboardSet.swift | 5 + iOS/GameKit/GKLocalPlayer.swift | 15 ++ iOS/GameKit/GKMatch.swift | 18 ++- iOS/GameKit/GKMatchmaker.swift | 16 ++- iOS/GameKit/GKMatchmakerViewController.swift | 10 +- iOS/GameKit/GKNotificationBanner.swift | 4 + iOS/GameKit/GKPlayer.swift | 3 + iOS/GameKit/GKSavedGame.swift | 10 ++ iOS/GameKit/GKSavedGameListener.swift | 2 +- iOS/GameKit/GKScore.swift | 2 + iOS/GameKit/GKTurnBasedMatch.swift | 40 +++++- .../GKTurnBasedMatchmakerViewController.swift | 4 +- iOS/GameplayKit/GKAgent.swift | 2 +- iOS/HealthKit/HKHealthStore.swift | 20 +++ iOS/HealthKit/HKHeartbeatSeriesBuilder.swift | 3 + .../HKQuantitySeriesSampleBuilder.swift | 2 + iOS/HealthKit/HKWorkoutBuilder.swift | 6 + iOS/HealthKit/HKWorkoutRouteBuilder.swift | 2 + iOS/HomeKit/HMAccessory.swift | 20 +-- iOS/HomeKit/HMAccessoryBrowser.swift | 4 +- iOS/HomeKit/HMActionSet.swift | 3 + iOS/HomeKit/HMCameraSnapshotControl.swift | 4 +- iOS/HomeKit/HMCameraStream.swift | 1 + iOS/HomeKit/HMCameraStreamControl.swift | 4 +- iOS/HomeKit/HMCharacteristic.swift | 4 + iOS/HomeKit/HMCharacteristicEvent.swift | 2 + iOS/HomeKit/HMCharacteristicWriteAction.swift | 1 + iOS/HomeKit/HMEventTrigger.swift | 13 ++ iOS/HomeKit/HMHome.swift | 90 +++++++----- iOS/HomeKit/HMHomeManager.swift | 15 +- .../HMNetworkConfigurationProfile.swift | 2 +- iOS/HomeKit/HMRoom.swift | 1 + iOS/HomeKit/HMService.swift | 2 + iOS/HomeKit/HMServiceGroup.swift | 3 + iOS/HomeKit/HMTimerTrigger.swift | 3 + iOS/HomeKit/HMTrigger.swift | 4 + iOS/HomeKit/HMZone.swift | 3 + .../ILMessageFilterExtensionContext.swift | 1 + .../ILMessageFilterQueryHandling.swift | 1 + iOS/ImageCaptureCore/ICCameraDevice.swift | 34 ++--- iOS/ImageCaptureCore/ICCameraFile.swift | 6 + iOS/ImageCaptureCore/ICDevice.swift | 20 ++- iOS/ImageCaptureCore/ICDeviceBrowser.swift | 14 +- iOS/Intents/INActivateCarSignalIntent.swift | 4 + iOS/Intents/INAddMediaIntent.swift | 4 + iOS/Intents/INAddTasksIntent.swift | 14 ++ iOS/Intents/INAppendToNoteIntent.swift | 4 + .../INBookRestaurantReservationIntent.swift | 7 + iOS/Intents/INCancelRideIntent.swift | 2 + iOS/Intents/INCancelWorkoutIntent.swift | 3 + iOS/Intents/INCreateNoteIntent.swift | 5 + iOS/Intents/INCreateTaskListIntent.swift | 5 + iOS/Intents/INDeleteTasksIntent.swift | 4 + iOS/Intents/INEndWorkoutIntent.swift | 3 + ...rantReservationBookingDefaultsIntent.swift | 3 + ...eRestaurantReservationBookingsIntent.swift | 5 + iOS/Intents/INGetCarLockStatusIntent.swift | 3 + .../INGetCarPowerLevelStatusIntent.swift | 5 +- iOS/Intents/INGetRestaurantGuestIntent.swift | 2 + iOS/Intents/INGetRideStatusIntent.swift | 4 +- ...tRestaurantReservationBookingsIntent.swift | 3 + iOS/Intents/INGetVisualCodeIntent.swift | 3 + iOS/Intents/INInteraction.swift | 4 + iOS/Intents/INListCarsIntent.swift | 2 + iOS/Intents/INListRideOptionsIntent.swift | 4 + iOS/Intents/INPauseWorkoutIntent.swift | 3 + iOS/Intents/INPayBillIntent.swift | 9 ++ iOS/Intents/INPlayMediaIntent.swift | 14 ++ iOS/Intents/INRelevantShortcutStore.swift | 1 + iOS/Intents/INRequestPaymentIntent.swift | 11 ++ iOS/Intents/INRequestRideIntent.swift | 8 ++ iOS/Intents/INResumeWorkoutIntent.swift | 3 + iOS/Intents/INSaveProfileInCarIntent.swift | 5 + iOS/Intents/INSearchCallHistoryIntent.swift | 10 ++ iOS/Intents/INSearchForAccountsIntent.swift | 6 + iOS/Intents/INSearchForBillsIntent.swift | 7 + iOS/Intents/INSearchForMediaIntent.swift | 3 + iOS/Intents/INSearchForMessagesIntent.swift | 10 ++ .../INSearchForNotebookItemsIntent.swift | 14 ++ iOS/Intents/INSearchForPhotosIntent.swift | 8 ++ iOS/Intents/INSendMessageIntent.swift | 13 ++ iOS/Intents/INSendPaymentIntent.swift | 11 ++ iOS/Intents/INSendRideFeedbackIntent.swift | 2 + iOS/Intents/INSetAudioSourceInCarIntent.swift | 4 + iOS/Intents/INSetCarLockStatusIntent.swift | 4 + .../INSetClimateSettingsInCarIntent.swift | 15 ++ .../INSetDefrosterSettingsInCarIntent.swift | 6 + iOS/Intents/INSetMessageAttributeIntent.swift | 3 + iOS/Intents/INSetProfileInCarIntent.swift | 9 ++ iOS/Intents/INSetRadioStationIntent.swift | 7 + .../INSetSeatSettingsInCarIntent.swift | 10 ++ iOS/Intents/INSetTaskAttributeIntent.swift | 13 ++ iOS/Intents/INSnoozeTasksIntent.swift | 4 + iOS/Intents/INStartAudioCallIntent.swift | 5 + iOS/Intents/INStartCallIntent.swift | 7 + iOS/Intents/INStartPhotoPlaybackIntent.swift | 6 + iOS/Intents/INStartVideoCallIntent.swift | 3 + iOS/Intents/INStartWorkoutIntent.swift | 7 + iOS/Intents/INTransferMoneyIntent.swift | 7 + iOS/Intents/INUpdateMediaAffinityIntent.swift | 4 + iOS/Intents/INVoiceShortcutCenter.swift | 2 + iOS/IntentsUI/INImage_IntentsUI.swift | 2 + .../INUIAddVoiceShortcutViewController.swift | 4 +- .../INUIEditVoiceShortcutViewController.swift | 6 +- iOS/IntentsUI/INUIHostedViewControlling.swift | 3 + iOS/LinkPresentation/LPMetadataProvider.swift | 1 + iOS/MapKit/MKDirections.swift | 2 + iOS/MapKit/MKLocalSearch.swift | 1 + iOS/MapKit/MKLocalSearchCompleter.swift | 4 +- iOS/MapKit/MKMapItem.swift | 4 + iOS/MapKit/MKMapSnapshotter.swift | 2 + iOS/MapKit/MKMapView.swift | 28 ++-- iOS/MediaPlayer/MPMediaLibrary.swift | 4 + iOS/MediaPlayer/MPMediaPickerController.swift | 4 +- iOS/MediaPlayer/MPMediaPlaylist.swift | 4 + .../MPMusicPlayerApplicationController.swift | 1 + iOS/MediaPlayer/MPMusicPlayerController.swift | 2 + .../MPPlayableContentDataSource.swift | 3 + .../MPPlayableContentDelegate.swift | 8 +- .../MFMailComposeViewController.swift | 2 +- .../MFMessageComposeViewController.swift | 2 +- iOS/Messages/MSConversation.swift | 12 ++ iOS/Metal/MTLDevice.swift | 9 ++ iOS/Metal/MTLLibrary.swift | 6 + iOS/MetalKit/MTKTextureLoader.swift | 11 ++ .../MetalPerformanceShaders.swift | 1 + iOS/MetricKit/MXMetricManager.swift | 4 +- .../MCAdvertiserAssistant.swift | 2 +- .../MCBrowserViewController.swift | 2 +- .../MCNearbyServiceAdvertiser.swift | 4 +- .../MCNearbyServiceBrowser.swift | 2 +- iOS/MultipeerConnectivity/MCSession.swift | 13 +- iOS/NaturalLanguage/NLTagger.swift | 2 + iOS/NearbyInteraction/NISession.swift | 6 +- iOS/NetworkExtension/NetworkExtension.swift | 102 +++++++++++++- .../NCWidgetProviding.swift | 4 +- iOS/PDFKit/PDFDocument.swift | 16 +-- iOS/PassKit/PKAddPassesViewController.swift | 2 +- .../PKAddPaymentPassViewController.swift | 3 +- ...PKAddSecureElementPassViewController.swift | 4 +- .../PKAddShareablePassConfiguration.swift | 1 + ...KDisbursementAuthorizationController.swift | 6 +- ...PKIssuerProvisioningExtensionHandler.swift | 4 + iOS/PassKit/PKPassLibrary.swift | 10 ++ .../PKPaymentAuthorizationController.swift | 38 ++++-- ...tAuthorizationViewControllerDelegate.swift | 40 ++++-- .../PKPaymentInformationEventExtension.swift | 6 + iOS/PencilKit/PKCanvasView.swift | 8 +- iOS/PencilKit/PKToolPicker.swift | 8 +- iOS/Photos/PHAssetResourceManager.swift | 2 + iOS/Photos/PHLivePhotoEditingContext.swift | 4 + iOS/Photos/PHPhotoLibrary.swift | 6 +- iOS/PhotosUI/PHContentEditingController.swift | 2 + iOS/PhotosUI/PHLivePhotoView.swift | 2 +- iOS/PhotosUI/PHPicker.swift | 2 +- iOS/PushKit/PKPushRegistry.swift | 10 +- iOS/QuartzCore/CAAnimation.swift | 4 +- iOS/QuickLook/QLPreviewController.swift | 6 +- iOS/QuickLook/QLPreviewingController.swift | 2 + .../QLThumbnailGenerator.swift | 2 + iOS/ReplayKit/RPBroadcast.swift | 8 +- iOS/ReplayKit/RPBroadcastExtension.swift | 1 + iOS/ReplayKit/RPPreviewViewController.swift | 4 +- iOS/ReplayKit/RPScreenRecorder.swift | 10 +- .../SFContentBlockerManager.swift | 3 + .../SFSafariViewController.swift | 4 +- iOS/SceneKit/SCNAction.swift | 2 + iOS/SceneKit/SCNCameraController.swift | 2 +- iOS/SceneKit/SCNConstraint.swift | 2 +- iOS/SceneKit/SCNPhysicsWorld.swift | 6 +- iOS/SceneKit/SCNSceneRenderer.swift | 9 +- iOS/SensorKit/SensorKit.swift | 9 +- iOS/SoundAnalysis/SNAnalyzer.swift | 1 + iOS/SoundAnalysis/SNResult.swift | 6 +- iOS/Speech/SFSpeechRecognitionTask.swift | 8 +- iOS/SpriteKit/SKNode.swift | 1 + iOS/SpriteKit/SKPhysicsWorld.swift | 4 +- iOS/SpriteKit/SKScene.swift | 8 +- iOS/SpriteKit/SKTexture.swift | 2 + iOS/SpriteKit/SKTextureAtlas.swift | 4 + iOS/StoreKit/SKCloudServiceController.swift | 10 ++ .../SKCloudServiceSetupViewController.swift | 4 +- iOS/StoreKit/SKOverlay.swift | 6 +- iOS/StoreKit/SKPaymentQueue.swift | 4 +- .../SKProductStorePromotionController.swift | 8 ++ iOS/StoreKit/SKProductsRequest.swift | 2 +- iOS/StoreKit/SKRequest.swift | 4 +- .../SKStoreProductViewController.swift | 2 +- iOS/UIKit/NSLayoutManager.swift | 6 +- iOS/UIKit/NSTextStorage.swift | 2 +- iOS/UIKit/UIActionSheet.swift | 4 +- iOS/UIKit/UIAlertView.swift | 4 +- iOS/UIKit/UIApplication.swift | 54 +++++--- iOS/UIKit/UICloudSharingController.swift | 4 +- iOS/UIKit/UICollectionView.swift | 21 +-- iOS/UIKit/UIColorPickerViewController.swift | 4 +- iOS/UIKit/UIContextMenuInteraction.swift | 1 + iOS/UIKit/UIDiffableDataSource.swift | 4 + iOS/UIKit/UIDocument.swift | 5 + .../UIDocumentBrowserViewController.swift | 10 +- .../UIDocumentInteractionController.swift | 8 +- iOS/UIKit/UIDocumentMenuViewController.swift | 2 +- .../UIDocumentPickerViewController.swift | 4 +- iOS/UIKit/UIDragInteraction.swift | 3 +- iOS/UIKit/UIDynamicAnimator.swift | 2 +- iOS/UIKit/UIFocus.swift | 4 +- iOS/UIKit/UIFocusAnimationCoordinator.swift | 5 + iOS/UIKit/UIFontPickerViewController.swift | 4 +- iOS/UIKit/UIGuidedAccess.swift | 2 +- iOS/UIKit/UIImagePickerController.swift | 4 +- iOS/UIKit/UIIndirectScribbleInteraction.swift | 4 +- iOS/UIKit/UIInputViewController.swift | 1 + iOS/UIKit/UIInteraction.swift | 2 +- iOS/UIKit/UILargeContentViewer.swift | 2 +- iOS/UIKit/UINavigationBar.swift | 4 +- iOS/UIKit/UINavigationController.swift | 2 +- iOS/UIKit/UIPageViewController.swift | 3 +- iOS/UIKit/UIPasteboard.swift | 8 ++ iOS/UIKit/UIPencilInteraction.swift | 2 +- iOS/UIKit/UIPickerView.swift | 2 +- iOS/UIKit/UIPointerInteraction.swift | 1 + iOS/UIKit/UIPopoverController.swift | 2 +- .../UIPopoverPresentationController.swift | 2 +- iOS/UIKit/UIPresentationController.swift | 4 +- iOS/UIKit/UIPreviewInteraction.swift | 6 +- iOS/UIKit/UIPrintInteractionController.swift | 6 +- iOS/UIKit/UIPrinter.swift | 1 + iOS/UIKit/UIPrinterPickerController.swift | 6 +- iOS/UIKit/UIScene.swift | 11 +- iOS/UIKit/UIScreenshotService.swift | 2 + iOS/UIKit/UIScribbleInteraction.swift | 2 +- iOS/UIKit/UIScrollView.swift | 16 +-- iOS/UIKit/UISearchBar.swift | 4 +- iOS/UIKit/UISearchController.swift | 4 +- iOS/UIKit/UISearchDisplayController.swift | 10 +- iOS/UIKit/UISplitViewController.swift | 6 +- iOS/UIKit/UISpringLoadedInteraction.swift | 4 +- iOS/UIKit/UITabBar.swift | 6 +- iOS/UIKit/UITabBarController.swift | 4 +- iOS/UIKit/UITableView.swift | 24 ++-- iOS/UIKit/UITextField.swift | 8 +- iOS/UIKit/UITextInput.swift | 6 +- iOS/UIKit/UITextInteraction.swift | 2 +- iOS/UIKit/UITextView.swift | 8 +- iOS/UIKit/UITraitCollection.swift | 2 +- iOS/UIKit/UIVideoEditorController.swift | 6 +- iOS/UIKit/UIView.swift | 14 ++ iOS/UIKit/UIViewAnimating.swift | 2 + iOS/UIKit/UIViewController.swift | 10 +- iOS/UIKit/UIWebView.swift | 6 +- iOS/UIKit/UIWindowScene.swift | 3 +- .../UNUserNotificationCenter.swift | 12 +- .../UNNotificationContentExtension.swift | 5 +- .../VSAccountManager.swift | 1 + .../VNDocumentCameraViewController.swift | 6 +- iOS/WatchConnectivity/WCSession.swift | 26 ++-- iOS/WebKit/NSAttributedString.swift | 8 ++ iOS/WebKit/WKContentRuleListStore.swift | 4 + iOS/WebKit/WKHTTPCookieStore.swift | 5 +- iOS/WebKit/WKNavigationDelegate.swift | 18 +-- iOS/WebKit/WKScriptMessageHandler.swift | 2 +- .../WKScriptMessageHandlerWithReply.swift | 2 +- iOS/WebKit/WKUIDelegate.swift | 10 +- iOS/WebKit/WKURLSchemeTask.swift | 8 +- iOS/WebKit/WKWebView.swift | 13 ++ iOS/WebKit/WKWebsiteDataStore.swift | 3 + iOS/iAd/ADBannerView.swift | 6 +- iOS/iAd/ADClient.swift | 6 + iOS/iAd/ADInterstitialAd.swift | 8 +- .../AVPlayerViewController_iAdPreroll.swift | 2 + macOS/AVFoundation/AVAssetExportSession.swift | 9 ++ .../AVFoundation/AVAssetImageGenerator.swift | 1 + .../AVFoundation/AVAssetResourceLoader.swift | 4 +- macOS/AVFoundation/AVAssetWriter.swift | 6 +- .../AVAsynchronousKeyValueLoading.swift | 1 + .../AVCaptureAudioDataOutput.swift | 2 +- macOS/AVFoundation/AVCaptureDevice.swift | 2 + macOS/AVFoundation/AVCaptureFileOutput.swift | 10 +- macOS/AVFoundation/AVCapturePhotoOutput.swift | 6 +- .../AVCaptureStillImageOutput.swift | 1 + .../AVCaptureVideoDataOutput.swift | 4 +- macOS/AVFoundation/AVContentKeySession.swift | 21 ++- macOS/AVFoundation/AVPlayer.swift | 8 ++ macOS/AVFoundation/AVPlayerItem.swift | 4 + .../AVPlayerItemMediaDataCollector.swift | 2 +- macOS/AVFoundation/AVPlayerItemOutput.swift | 4 +- ...VPlayerItemProtectedContentAdditions.swift | 2 + .../AVSampleBufferAudioRenderer.swift | 1 + .../AVSampleBufferGenerator.swift | 1 + .../AVSampleBufferRenderSynchronizer.swift | 1 + .../AVKit/AVPictureInPictureController.swift | 5 +- macOS/AVKit/AVPlayerView.swift | 6 +- macOS/AVKit/AVRoutePickerView.swift | 2 +- macOS/Accounts/ACAccountStore.swift | 4 + macOS/AppKit/NSAlert.swift | 2 + macOS/AppKit/NSAnimation.swift | 6 +- macOS/AppKit/NSAnimationContext.swift | 2 + macOS/AppKit/NSApplication.swift | 28 ++-- macOS/AppKit/NSBrowser.swift | 6 +- macOS/AppKit/NSCollectionView.swift | 14 +- macOS/AppKit/NSComboBox.swift | 2 +- macOS/AppKit/NSControl.swift | 8 +- macOS/AppKit/NSDocument.swift | 20 +++ macOS/AppKit/NSDocumentController.swift | 8 ++ macOS/AppKit/NSDrawer.swift | 4 +- macOS/AppKit/NSFilePromiseProvider.swift | 2 + macOS/AppKit/NSImage.swift | 6 +- macOS/AppKit/NSKeyValueBinding.swift | 4 +- macOS/AppKit/NSLayoutManager.swift | 6 +- macOS/AppKit/NSMenu.swift | 2 +- macOS/AppKit/NSOutlineView.swift | 18 +-- macOS/AppKit/NSPDFPanel.swift | 1 + macOS/AppKit/NSPageController.swift | 4 +- macOS/AppKit/NSPopover.swift | 6 +- macOS/AppKit/NSRuleEditor.swift | 2 +- macOS/AppKit/NSSavePanel.swift | 8 +- macOS/AppKit/NSScrubber.swift | 12 +- macOS/AppKit/NSSearchField.swift | 4 +- macOS/AppKit/NSSharingService.swift | 12 +- macOS/AppKit/NSSound.swift | 2 +- macOS/AppKit/NSSpeechRecognizer.swift | 2 +- macOS/AppKit/NSSpeechSynthesizer.swift | 6 +- macOS/AppKit/NSSpellChecker.swift | 2 + macOS/AppKit/NSSplitView.swift | 2 +- macOS/AppKit/NSStackView.swift | 2 +- macOS/AppKit/NSTabView.swift | 4 +- macOS/AppKit/NSTableView.swift | 14 +- .../NSTableViewDiffableDataSource.swift | 1 + macOS/AppKit/NSText.swift | 6 +- macOS/AppKit/NSTextFinder.swift | 4 +- macOS/AppKit/NSTextStorage.swift | 2 +- macOS/AppKit/NSTextView.swift | 4 +- macOS/AppKit/NSToolbar.swift | 2 +- macOS/AppKit/NSViewController.swift | 2 + macOS/AppKit/NSWindow.swift | 50 +++---- macOS/AppKit/NSWindowRestoration.swift | 4 + macOS/AppKit/NSWorkspace.swift | 12 ++ .../AppTrackingTransparency.swift | 1 + macOS/AudioToolbox/AUAudioUnit.swift | 1 + .../AudioVideoBridging.swift | 16 +-- .../ASAuthorizationAppleIDProvider.swift | 1 + .../ASAuthorizationController.swift | 4 +- ...roviderExtensionAuthorizationRequest.swift | 1 + .../ASCredentialIdentityStore.swift | 5 + ...ASCredentialProviderExtensionContext.swift | 1 + .../ASWebAuthenticationSessionRequest.swift | 4 +- .../AutomaticAssessmentConfiguration.swift | 4 +- macOS/Automator/AMWorkflowController.swift | 8 +- macOS/CallKit/CXCallController.swift | 3 + macOS/CallKit/CXProvider.swift | 5 +- macOS/ClassKit/CLSContext.swift | 1 + macOS/ClassKit/CLSContextProvider.swift | 1 + macOS/ClassKit/CLSDataStore.swift | 3 + macOS/CloudKit/CKContainer.swift | 26 ++++ macOS/CloudKit/CKDatabase.swift | 16 +++ macOS/Collaboration/CBIdentityPicker.swift | 1 + macOS/Contacts/CNContactStore.swift | 1 + .../ContactsUI/CNContactPickerDelegate.swift | 2 +- macOS/CoreAudioKit/AUViewController.swift | 1 + macOS/CoreBluetooth/CBCentralManager.swift | 10 +- macOS/CoreBluetooth/CBPeripheral.swift | 28 ++-- macOS/CoreBluetooth/CBPeripheralManager.swift | 20 +-- .../CoreData/NSFetchedResultsController.swift | 8 +- macOS/CoreData/NSPersistentContainer.swift | 1 + .../NSPersistentStoreCoordinator.swift | 2 + macOS/CoreHaptics/CHHapticEngine.swift | 2 + macOS/CoreLocation/CLGeocoder.swift | 9 ++ macOS/CoreLocation/CLLocationManager.swift | 2 + .../CLLocationManagerDelegate.swift | 34 ++--- macOS/CoreML/MLModel.swift | 2 + macOS/CoreML/MLModelCollection.swift | 1 + macOS/CoreSpotlight/CSSearchableIndex.swift | 10 +- macOS/CoreWLAN/CWWiFiClient.swift | 14 +- macOS/DeviceCheck/DCDevice.swift | 1 + macOS/EventKit/EKEventStore.swift | 2 + macOS/ExecutionPolicy/EPDeveloperTool.swift | 1 + macOS/ExternalAccessory/EAAccessory.swift | 2 +- macOS/FileProvider/Extension.swift | 26 ++++ .../FileProvider/NSFileProviderActions.swift | 10 ++ .../NSFileProviderEnumerating.swift | 7 +- .../NSFileProviderReplicatedExtension.swift | 6 +- macOS/FinderSync/FinderSync.swift | 3 + macOS/Foundation/NSExtensionContext.swift | 2 + macOS/Foundation/NSFileManager.swift | 5 + macOS/Foundation/NSFilePresenter.swift | 27 ++-- macOS/Foundation/NSFileVersion.swift | 2 + macOS/Foundation/NSHTTPCookieStorage.swift | 2 + macOS/Foundation/NSItemProvider.swift | 3 + macOS/Foundation/NSKeyedArchiver.swift | 6 +- macOS/Foundation/NSNetServices.swift | 26 ++-- macOS/Foundation/NSSpellServer.swift | 4 +- macOS/Foundation/NSURLCache.swift | 2 + macOS/Foundation/NSURLConnection.swift | 22 +-- macOS/Foundation/NSURLCredentialStorage.swift | 4 + macOS/Foundation/NSURLDownload.swift | 16 +-- macOS/Foundation/NSURLProtocol.swift | 12 +- macOS/Foundation/NSURLSession.swift | 52 ++++--- macOS/Foundation/NSUserActivity.swift | 7 +- macOS/Foundation/NSUserNotification.swift | 4 +- macOS/Foundation/NSUserScriptTask.swift | 4 + macOS/Foundation/NSXMLParser.swift | 12 +- macOS/GLKit/GLKTextureLoader.swift | 8 ++ macOS/GameController/GCController.swift | 1 + macOS/GameKit/GKAchievement.swift | 6 + macOS/GameKit/GKAchievementDescription.swift | 2 + .../GameKit/GKAchievementViewController.swift | 2 +- macOS/GameKit/GKChallenge.swift | 11 ++ macOS/GameKit/GKChallengeEventHandler.swift | 8 +- .../GameKit/GKChallengesViewController.swift | 2 +- macOS/GameKit/GKCloudPlayer.swift | 1 + macOS/GameKit/GKEventListener.swift | 4 +- ...GKFriendRequestComposeViewController.swift | 2 +- .../GameKit/GKGameCenterViewController.swift | 2 +- macOS/GameKit/GKGameSession.swift | 11 ++ .../GameKit/GKGameSessionEventListener.swift | 12 +- macOS/GameKit/GKLeaderboard.swift | 20 +++ macOS/GameKit/GKLeaderboardSet.swift | 5 + .../GameKit/GKLeaderboardViewController.swift | 2 +- macOS/GameKit/GKLocalPlayer.swift | 19 +++ macOS/GameKit/GKMatch.swift | 16 ++- macOS/GameKit/GKMatchmaker.swift | 14 +- .../GameKit/GKMatchmakerViewController.swift | 10 +- macOS/GameKit/GKNotificationBanner.swift | 4 + macOS/GameKit/GKPlayer.swift | 3 + macOS/GameKit/GKPublicProtocols.swift | 6 +- macOS/GameKit/GKSavedGame.swift | 10 ++ macOS/GameKit/GKSavedGameListener.swift | 2 +- macOS/GameKit/GKScore.swift | 4 + macOS/GameKit/GKTurnBasedMatch.swift | 40 +++++- .../GKTurnBasedMatchmakerViewController.swift | 4 +- macOS/GameplayKit/GKAgent.swift | 2 +- .../IMServicePlugInChatRoomSupport.swift | 16 +-- ...vicePlugInFileTransferSessionSupport.swift | 6 +- .../IMServicePlugInGroupListSupport.swift | 4 +- ...IMServicePlugInInstantMessageSupport.swift | 12 +- .../IMServicePlugInProtocols.swift | 8 +- macOS/IOUSBHost/IOUSBHostObject.swift | 1 + macOS/IOUSBHost/IOUSBHostPipe.swift | 3 + macOS/IOUSBHost/IOUSBHostStream.swift | 1 + macOS/ImageCaptureCore/ICCameraDevice.swift | 34 ++--- macOS/ImageCaptureCore/ICCameraFile.swift | 6 + macOS/ImageCaptureCore/ICDevice.swift | 24 ++-- macOS/ImageCaptureCore/ICDeviceBrowser.swift | 6 +- macOS/ImageCaptureCore/ICScannerDevice.swift | 12 +- macOS/Intents/INInteraction.swift | 4 + .../LinkPresentation/LPMetadataProvider.swift | 1 + macOS/MapKit/MKDirections.swift | 2 + macOS/MapKit/MKLocalSearch.swift | 1 + macOS/MapKit/MKLocalSearchCompleter.swift | 4 +- macOS/MapKit/MKMapSnapshotter.swift | 2 + macOS/MapKit/MKMapView.swift | 26 ++-- macOS/Metal/MTLBuffer.swift | 2 +- macOS/Metal/MTLDevice.swift | 9 ++ macOS/Metal/MTLLibrary.swift | 6 + macOS/MetalKit/MTKTextureLoader.swift | 15 ++ .../MetalPerformanceShaders.swift | 1 + .../MCAdvertiserAssistant.swift | 2 +- .../MCBrowserViewController.swift | 2 +- .../MCNearbyServiceAdvertiser.swift | 4 +- .../MCNearbyServiceBrowser.swift | 2 +- macOS/MultipeerConnectivity/MCSession.swift | 13 +- macOS/NaturalLanguage/NLTagger.swift | 2 + macOS/NetworkExtension/NetworkExtension.swift | 82 +++++++++++ .../NCWidgetListViewController.swift | 4 +- .../NCWidgetProviding.swift | 6 +- macOS/PDFKit/PDFDocument.swift | 16 +-- macOS/ParavirtualizedGraphics/PGDevice.swift | 2 +- .../PKAddShareablePassConfiguration.swift | 1 + macOS/PassKit/PKPassLibrary.swift | 6 + .../PKPaymentAuthorizationController.swift | 38 ++++-- ...tAuthorizationViewControllerDelegate.swift | 36 +++-- .../PKPaymentInformationEventExtension.swift | 3 + macOS/Photos/PHAssetResourceManager.swift | 2 + macOS/Photos/PHLivePhotoEditingContext.swift | 4 + macOS/Photos/PHPhotoLibrary.swift | 6 +- .../PhotosUI/PHContentEditingController.swift | 2 + macOS/PhotosUI/PHLivePhotoView.swift | 2 +- .../PHProjectExtensionController.swift | 6 + macOS/PushKit/PKPushRegistry.swift | 8 +- macOS/QuartzCore/CAAnimation.swift | 4 +- .../QLThumbnailGenerator.swift | 2 + macOS/ReplayKit/RPBroadcast.swift | 10 +- macOS/ReplayKit/RPBroadcastExtension.swift | 2 + macOS/ReplayKit/RPPreviewViewController.swift | 4 +- macOS/ReplayKit/RPScreenRecorder.swift | 8 +- .../SFContentBlockerManager.swift | 2 + .../SafariServices/SFSafariApplication.swift | 6 + macOS/SafariServices/SFSafariExtension.swift | 1 + .../SFSafariExtensionHandling.swift | 3 +- .../SFSafariExtensionManager.swift | 1 + macOS/SafariServices/SFSafariPage.swift | 3 + macOS/SafariServices/SFSafariTab.swift | 4 + macOS/SafariServices/SFSafariWindow.swift | 4 + macOS/SceneKit/SCNAction.swift | 4 + macOS/SceneKit/SCNCameraController.swift | 2 +- macOS/SceneKit/SCNConstraint.swift | 2 +- macOS/SceneKit/SCNPhysicsWorld.swift | 6 +- macOS/SceneKit/SCNSceneRenderer.swift | 10 +- macOS/SoundAnalysis/SNAnalyzer.swift | 1 + macOS/SoundAnalysis/SNResult.swift | 6 +- macOS/Speech/SFSpeechRecognitionTask.swift | 8 +- macOS/SpriteKit/SKNode.swift | 1 + macOS/SpriteKit/SKPhysicsWorld.swift | 4 +- macOS/SpriteKit/SKScene.swift | 8 +- macOS/SpriteKit/SKTexture.swift | 2 + macOS/SpriteKit/SKTextureAtlas.swift | 4 + macOS/StoreKit/SKCloudServiceController.swift | 7 + macOS/StoreKit/SKPaymentQueue.swift | 4 +- .../SKProductStorePromotionController.swift | 8 ++ macOS/StoreKit/SKProductsRequest.swift | 2 +- macOS/StoreKit/SKRequest.swift | 4 +- .../SKStoreProductViewController.swift | 2 +- macOS/SystemExtensions/SystemExtensions.swift | 4 +- .../UNUserNotificationCenter.swift | 12 +- .../Virtualization/VZVirtioSocketDevice.swift | 1 + macOS/Virtualization/VZVirtualMachine.swift | 3 + .../VZVirtualMachineDelegate.swift | 4 +- macOS/WebKit/NSAttributedString.swift | 8 ++ macOS/WebKit/WKContentRuleListStore.swift | 4 + macOS/WebKit/WKHTTPCookieStore.swift | 5 +- macOS/WebKit/WKNavigationDelegate.swift | 18 +-- macOS/WebKit/WKScriptMessageHandler.swift | 2 +- .../WKScriptMessageHandlerWithReply.swift | 2 +- macOS/WebKit/WKUIDelegate.swift | 10 +- macOS/WebKit/WKURLSchemeTask.swift | 8 +- macOS/WebKit/WKWebView.swift | 13 ++ macOS/WebKit/WKWebsiteDataStore.swift | 3 + macOS/WebKit/WebDocument.swift | 2 +- macOS/WebKit/WebEditingDelegate.swift | 10 +- macOS/WebKit/WebFrameLoadDelegate.swift | 24 ++-- macOS/WebKit/WebResourceLoadDelegate.swift | 12 +- tvOS/AVFoundation/AVAssetExportSession.swift | 9 ++ tvOS/AVFoundation/AVAssetImageGenerator.swift | 1 + tvOS/AVFoundation/AVAssetResourceLoader.swift | 4 +- tvOS/AVFoundation/AVAssetWriter.swift | 6 +- .../AVAsynchronousKeyValueLoading.swift | 1 + tvOS/AVFoundation/AVCaptureDevice.swift | 10 ++ .../AVCaptureStillImageOutput.swift | 4 + tvOS/AVFoundation/AVContentKeySession.swift | 13 +- tvOS/AVFoundation/AVPlayer.swift | 8 ++ tvOS/AVFoundation/AVPlayerItem.swift | 4 + .../AVPlayerItemMediaDataCollector.swift | 2 +- tvOS/AVFoundation/AVPlayerItemOutput.swift | 4 +- .../AVSampleBufferAudioRenderer.swift | 1 + .../AVSampleBufferRenderSynchronizer.swift | 1 + .../AVContentProposalViewController.swift | 1 + tvOS/AVKit/AVPictureInPictureController.swift | 5 +- tvOS/AVKit/AVPlayerItem.swift | 2 + tvOS/AVKit/AVPlayerViewController.swift | 22 ++- tvOS/AVKit/AVRoutePickerView.swift | 2 +- .../AppTrackingTransparency.swift | 1 + tvOS/AudioToolbox/AUAudioUnit.swift | 1 + .../ASAuthorizationAppleIDProvider.swift | 1 + .../ASAuthorizationController.swift | 4 +- tvOS/BackgroundTasks/BGTaskScheduler.swift | 1 + tvOS/CloudKit/CKContainer.swift | 24 ++++ tvOS/CloudKit/CKDatabase.swift | 16 +++ tvOS/CoreBluetooth/CBCentralManager.swift | 12 +- tvOS/CoreBluetooth/CBPeripheral.swift | 28 ++-- tvOS/CoreBluetooth/CBPeripheralManager.swift | 20 +-- .../CoreData/NSFetchedResultsController.swift | 8 +- tvOS/CoreData/NSPersistentContainer.swift | 1 + .../NSPersistentStoreCoordinator.swift | 2 + tvOS/CoreHaptics/CHHapticEngine.swift | 2 + tvOS/CoreLocation/CLGeocoder.swift | 9 ++ tvOS/CoreLocation/CLLocationManager.swift | 2 + .../CLLocationManagerDelegate.swift | 8 +- tvOS/CoreML/MLModel.swift | 2 + tvOS/CoreSpotlight/CSSearchableIndex.swift | 2 + tvOS/DeviceCheck/DCDevice.swift | 1 + tvOS/ExternalAccessory/EAAccessory.swift | 2 +- .../EAAccessoryManager.swift | 2 + tvOS/Foundation/NSBundle.swift | 2 + tvOS/Foundation/NSExtensionContext.swift | 2 + tvOS/Foundation/NSFilePresenter.swift | 25 ++-- tvOS/Foundation/NSFileVersion.swift | 2 + tvOS/Foundation/NSHTTPCookieStorage.swift | 2 + tvOS/Foundation/NSItemProvider.swift | 3 + tvOS/Foundation/NSKeyedArchiver.swift | 6 +- tvOS/Foundation/NSNetServices.swift | 26 ++-- tvOS/Foundation/NSURLCache.swift | 2 + tvOS/Foundation/NSURLConnection.swift | 22 +-- tvOS/Foundation/NSURLCredentialStorage.swift | 4 + tvOS/Foundation/NSURLProtocol.swift | 12 +- tvOS/Foundation/NSURLSession.swift | 52 ++++--- tvOS/Foundation/NSUserActivity.swift | 3 +- tvOS/Foundation/NSXMLParser.swift | 12 +- tvOS/GLKit/GLKTextureLoader.swift | 8 ++ tvOS/GameController/GCController.swift | 1 + tvOS/GameKit/GKAchievement.swift | 4 + tvOS/GameKit/GKAchievementDescription.swift | 2 + tvOS/GameKit/GKChallenge.swift | 9 ++ tvOS/GameKit/GKCloudPlayer.swift | 1 + tvOS/GameKit/GKEventListener.swift | 4 +- tvOS/GameKit/GKGameCenterViewController.swift | 2 +- tvOS/GameKit/GKGameSession.swift | 11 ++ tvOS/GameKit/GKGameSessionEventListener.swift | 12 +- .../GKGameSessionSharingViewController.swift | 2 +- tvOS/GameKit/GKLeaderboard.swift | 16 +++ tvOS/GameKit/GKLeaderboardSet.swift | 4 + tvOS/GameKit/GKLocalPlayer.swift | 13 ++ tvOS/GameKit/GKMatch.swift | 12 +- tvOS/GameKit/GKMatchmaker.swift | 12 +- tvOS/GameKit/GKMatchmakerViewController.swift | 6 +- tvOS/GameKit/GKNotificationBanner.swift | 4 + tvOS/GameKit/GKPlayer.swift | 3 + tvOS/GameKit/GKScore.swift | 2 + tvOS/GameKit/GKTurnBasedMatch.swift | 38 +++++- .../GKTurnBasedMatchmakerViewController.swift | 2 +- tvOS/GameplayKit/GKAgent.swift | 2 +- tvOS/HomeKit/HMAccessory.swift | 19 +-- tvOS/HomeKit/HMCameraSnapshotControl.swift | 4 +- tvOS/HomeKit/HMCameraStreamControl.swift | 4 +- tvOS/HomeKit/HMCharacteristic.swift | 3 + tvOS/HomeKit/HMHome.swift | 65 ++++----- tvOS/HomeKit/HMHomeManager.swift | 10 +- .../HMNetworkConfigurationProfile.swift | 2 +- tvOS/Intents/INAddMediaIntent.swift | 4 + tvOS/Intents/INInteraction.swift | 4 + tvOS/Intents/INPlayMediaIntent.swift | 14 ++ tvOS/Intents/INSearchForMediaIntent.swift | 3 + .../Intents/INUpdateMediaAffinityIntent.swift | 4 + tvOS/IntentsUI/INImage_IntentsUI.swift | 2 + tvOS/MapKit/MKDirections.swift | 2 + tvOS/MapKit/MKLocalSearch.swift | 1 + tvOS/MapKit/MKLocalSearchCompleter.swift | 4 +- tvOS/MapKit/MKMapSnapshotter.swift | 2 + tvOS/MapKit/MKMapView.swift | 24 ++-- .../MPMusicPlayerApplicationController.swift | 1 + .../MediaPlayer/MPMusicPlayerController.swift | 2 + tvOS/MediaPlayer/MPNowPlayingSession.swift | 5 +- tvOS/Metal/MTLDevice.swift | 7 + tvOS/Metal/MTLLibrary.swift | 4 + tvOS/MetalKit/MTKTextureLoader.swift | 11 ++ .../MetalPerformanceShaders.swift | 1 + .../MCAdvertiserAssistant.swift | 2 +- .../MCBrowserViewController.swift | 2 +- .../MCNearbyServiceAdvertiser.swift | 4 +- .../MCNearbyServiceBrowser.swift | 2 +- tvOS/MultipeerConnectivity/MCSession.swift | 13 +- tvOS/NaturalLanguage/NLTagger.swift | 2 + tvOS/Photos/PHAssetResourceManager.swift | 2 + tvOS/Photos/PHLivePhotoEditingContext.swift | 4 + tvOS/Photos/PHPhotoLibrary.swift | 6 +- tvOS/PhotosUI/PHLivePhotoView.swift | 2 +- tvOS/QuartzCore/CAAnimation.swift | 4 +- tvOS/ReplayKit/RPBroadcast.swift | 8 +- tvOS/ReplayKit/RPBroadcastExtension.swift | 1 + tvOS/ReplayKit/RPPreviewViewController.swift | 2 +- tvOS/ReplayKit/RPScreenRecorder.swift | 10 +- tvOS/SceneKit/SCNAction.swift | 2 + tvOS/SceneKit/SCNCameraController.swift | 2 +- tvOS/SceneKit/SCNConstraint.swift | 2 +- tvOS/SceneKit/SCNPhysicsWorld.swift | 6 +- tvOS/SceneKit/SCNSceneRenderer.swift | 9 +- tvOS/SoundAnalysis/SNAnalyzer.swift | 1 + tvOS/SoundAnalysis/SNResult.swift | 6 +- tvOS/SpriteKit/SKNode.swift | 1 + tvOS/SpriteKit/SKPhysicsWorld.swift | 4 +- tvOS/SpriteKit/SKScene.swift | 8 +- tvOS/SpriteKit/SKTexture.swift | 2 + tvOS/SpriteKit/SKTextureAtlas.swift | 4 + tvOS/StoreKit/SKCloudServiceController.swift | 10 ++ tvOS/StoreKit/SKPaymentQueue.swift | 4 +- .../SKProductStorePromotionController.swift | 8 ++ tvOS/StoreKit/SKProductsRequest.swift | 2 +- tvOS/StoreKit/SKRequest.swift | 4 +- tvOS/TVMLKit/TVApplicationController.swift | 7 +- tvOS/TVMLKit/TVBrowserViewController.swift | 2 +- tvOS/TVMLKit/TVDocumentViewController.swift | 6 +- tvOS/TVMLKit/TVPlayback.swift | 1 + tvOS/TVMLKit/TVViewElement.swift | 2 + .../TVTopShelfContentProvider.swift | 1 + tvOS/TVServices/TVUserManager.swift | 2 + .../TVCollectionViewFullScreenLayout.swift | 2 +- tvOS/UIKit/NSLayoutManager.swift | 6 +- tvOS/UIKit/NSTextStorage.swift | 2 +- tvOS/UIKit/UIApplication.swift | 36 +++-- tvOS/UIKit/UICollectionView.swift | 17 ++- tvOS/UIKit/UIDiffableDataSource.swift | 4 + tvOS/UIKit/UIDynamicAnimator.swift | 2 +- tvOS/UIKit/UIFocus.swift | 4 +- tvOS/UIKit/UIFocusAnimationCoordinator.swift | 5 + tvOS/UIKit/UIGuidedAccess.swift | 2 +- tvOS/UIKit/UIInputViewController.swift | 1 + tvOS/UIKit/UIInteraction.swift | 2 +- tvOS/UIKit/UINavigationBar.swift | 4 +- tvOS/UIKit/UINavigationController.swift | 2 +- tvOS/UIKit/UIPageViewController.swift | 3 +- tvOS/UIKit/UIPopoverController.swift | 2 +- tvOS/UIKit/UIPresentationController.swift | 4 +- tvOS/UIKit/UIScene.swift | 11 +- tvOS/UIKit/UIScreenshotService.swift | 2 + tvOS/UIKit/UIScrollView.swift | 16 +-- tvOS/UIKit/UISearchBar.swift | 4 +- tvOS/UIKit/UISearchController.swift | 4 +- tvOS/UIKit/UISplitViewController.swift | 6 +- tvOS/UIKit/UITabBar.swift | 2 +- tvOS/UIKit/UITabBarController.swift | 2 +- tvOS/UIKit/UITableView.swift | 18 +-- tvOS/UIKit/UITextField.swift | 8 +- tvOS/UIKit/UITextInput.swift | 6 +- tvOS/UIKit/UITextInteraction.swift | 2 +- tvOS/UIKit/UITextView.swift | 8 +- tvOS/UIKit/UITraitCollection.swift | 2 +- tvOS/UIKit/UIView.swift | 14 ++ tvOS/UIKit/UIViewAnimating.swift | 2 + tvOS/UIKit/UIViewController.swift | 10 +- .../UNUserNotificationCenter.swift | 6 + .../VSAccountManager.swift | 1 + .../AVAsynchronousKeyValueLoading.swift | 1 + watchOS/AVFoundation/AVCaptureDevice.swift | 10 ++ .../AVCaptureStillImageOutput.swift | 4 + .../AVFoundation/AVContentKeySession.swift | 21 ++- watchOS/AVFoundation/AVPlayer.swift | 8 ++ watchOS/AVFoundation/AVPlayerItem.swift | 4 + .../AVPlayerItemMediaDataCollector.swift | 2 +- watchOS/AVFoundation/AVPlayerItemOutput.swift | 2 +- .../AVSampleBufferAudioRenderer.swift | 1 + .../AVSampleBufferRenderSynchronizer.swift | 1 + .../ASAuthorizationAppleIDProvider.swift | 1 + .../ASAuthorizationController.swift | 4 +- .../ClockKit/CLKComplicationDataSource.swift | 2 +- watchOS/ClockKit/CLKWatchFaceLibrary.swift | 1 + watchOS/CloudKit/CKContainer.swift | 26 ++++ watchOS/CloudKit/CKDatabase.swift | 16 +++ watchOS/Contacts/CNContactStore.swift | 1 + watchOS/CoreBluetooth/CBCentralManager.swift | 12 +- watchOS/CoreBluetooth/CBPeripheral.swift | 28 ++-- .../CoreBluetooth/CBPeripheralManager.swift | 20 +-- .../CoreData/NSFetchedResultsController.swift | 8 +- watchOS/CoreData/NSPersistentContainer.swift | 1 + .../NSPersistentStoreCoordinator.swift | 2 + watchOS/CoreLocation/CLGeocoder.swift | 9 ++ watchOS/CoreLocation/CLLocationManager.swift | 2 + .../CLLocationManagerDelegate.swift | 10 +- watchOS/CoreML/MLModel.swift | 2 + .../CMHeadphoneMotionManagerDelegate.swift | 4 +- watchOS/EventKit/EKEventStore.swift | 2 + watchOS/Foundation/NSBundle.swift | 2 + watchOS/Foundation/NSExtensionContext.swift | 2 + watchOS/Foundation/NSFilePresenter.swift | 25 ++-- watchOS/Foundation/NSFileVersion.swift | 2 + watchOS/Foundation/NSHTTPCookieStorage.swift | 2 + watchOS/Foundation/NSItemProvider.swift | 3 + watchOS/Foundation/NSKeyedArchiver.swift | 6 +- watchOS/Foundation/NSURLCache.swift | 2 + watchOS/Foundation/NSURLConnection.swift | 20 +-- .../Foundation/NSURLCredentialStorage.swift | 4 + watchOS/Foundation/NSURLProtocol.swift | 12 +- watchOS/Foundation/NSURLSession.swift | 52 ++++--- watchOS/Foundation/NSUserActivity.swift | 7 +- watchOS/Foundation/NSXMLParser.swift | 12 +- watchOS/GameKit/GKAchievement.swift | 6 + .../GameKit/GKAchievementDescription.swift | 1 + watchOS/GameKit/GKLeaderboard.swift | 20 +++ watchOS/GameKit/GKLeaderboardSet.swift | 4 + watchOS/GameKit/GKLocalPlayer.swift | 21 +++ watchOS/GameKit/GKMatch.swift | 2 + watchOS/GameKit/GKMatchmaker.swift | 4 +- watchOS/GameKit/GKPlayer.swift | 1 + watchOS/GameKit/GKPublicProtocols.swift | 14 +- watchOS/GameKit/GKScore.swift | 4 + watchOS/GameKit/GKTurnBasedMatch.swift | 44 +++++- watchOS/HealthKit/HKHealthStore.swift | 15 ++ .../HealthKit/HKHeartbeatSeriesBuilder.swift | 3 + watchOS/HealthKit/HKLiveWorkoutBuilder.swift | 4 +- .../HKQuantitySeriesSampleBuilder.swift | 2 + watchOS/HealthKit/HKWorkoutBuilder.swift | 6 + watchOS/HealthKit/HKWorkoutRouteBuilder.swift | 2 + watchOS/HealthKit/HKWorkoutSession.swift | 6 +- watchOS/HomeKit/HMAccessory.swift | 19 +-- watchOS/HomeKit/HMCameraSnapshotControl.swift | 4 +- watchOS/HomeKit/HMCameraStream.swift | 1 + watchOS/HomeKit/HMCameraStreamControl.swift | 4 +- watchOS/HomeKit/HMCharacteristic.swift | 3 + watchOS/HomeKit/HMHome.swift | 65 ++++----- watchOS/HomeKit/HMHomeManager.swift | 10 +- .../HMNetworkConfigurationProfile.swift | 2 +- .../Intents/INActivateCarSignalIntent.swift | 4 + watchOS/Intents/INAddMediaIntent.swift | 4 + watchOS/Intents/INAddTasksIntent.swift | 14 ++ watchOS/Intents/INAppendToNoteIntent.swift | 4 + watchOS/Intents/INCancelWorkoutIntent.swift | 3 + watchOS/Intents/INCreateNoteIntent.swift | 5 + watchOS/Intents/INCreateTaskListIntent.swift | 5 + watchOS/Intents/INDeleteTasksIntent.swift | 4 + watchOS/Intents/INEndWorkoutIntent.swift | 3 + .../Intents/INGetCarLockStatusIntent.swift | 3 + .../INGetCarPowerLevelStatusIntent.swift | 3 + watchOS/Intents/INGetRideStatusIntent.swift | 4 +- watchOS/Intents/INGetVisualCodeIntent.swift | 3 + watchOS/Intents/INInteraction.swift | 4 + watchOS/Intents/INListCarsIntent.swift | 2 + watchOS/Intents/INListRideOptionsIntent.swift | 4 + watchOS/Intents/INPauseWorkoutIntent.swift | 3 + watchOS/Intents/INPayBillIntent.swift | 9 ++ watchOS/Intents/INPlayMediaIntent.swift | 14 ++ watchOS/Intents/INRelevantShortcutStore.swift | 1 + watchOS/Intents/INRequestPaymentIntent.swift | 11 ++ watchOS/Intents/INRequestRideIntent.swift | 8 ++ watchOS/Intents/INResumeWorkoutIntent.swift | 3 + .../Intents/INSearchCallHistoryIntent.swift | 10 ++ .../Intents/INSearchForAccountsIntent.swift | 6 + watchOS/Intents/INSearchForBillsIntent.swift | 7 + watchOS/Intents/INSearchForMediaIntent.swift | 3 + .../Intents/INSearchForMessagesIntent.swift | 10 ++ .../INSearchForNotebookItemsIntent.swift | 14 ++ watchOS/Intents/INSearchForPhotosIntent.swift | 8 ++ watchOS/Intents/INSendMessageIntent.swift | 13 ++ watchOS/Intents/INSendPaymentIntent.swift | 11 ++ .../Intents/INSetCarLockStatusIntent.swift | 4 + .../Intents/INSetTaskAttributeIntent.swift | 13 ++ watchOS/Intents/INSnoozeTasksIntent.swift | 4 + watchOS/Intents/INStartAudioCallIntent.swift | 5 + watchOS/Intents/INStartCallIntent.swift | 7 + .../Intents/INStartPhotoPlaybackIntent.swift | 6 + watchOS/Intents/INStartWorkoutIntent.swift | 7 + watchOS/Intents/INTransferMoneyIntent.swift | 7 + .../Intents/INUpdateMediaAffinityIntent.swift | 4 + watchOS/Intents/INVoiceShortcutCenter.swift | 2 + watchOS/NaturalLanguage/NLTagger.swift | 2 + .../NetworkExtension/NetworkExtension.swift | 6 + watchOS/PassKit/PKPassLibrary.swift | 6 + .../PKPaymentAuthorizationController.swift | 38 ++++-- .../PKPaymentInformationEventExtension.swift | 6 + watchOS/PushKit/PKPushRegistry.swift | 8 +- watchOS/SceneKit/SCNAction.swift | 2 + watchOS/SceneKit/SCNCameraController.swift | 2 +- watchOS/SceneKit/SCNConstraint.swift | 2 +- watchOS/SceneKit/SCNPhysicsWorld.swift | 6 +- watchOS/SceneKit/SCNSceneRenderer.swift | 9 +- watchOS/SoundAnalysis/SNAnalyzer.swift | 1 + watchOS/SoundAnalysis/SNResult.swift | 6 +- watchOS/SpriteKit/SKNode.swift | 1 + watchOS/SpriteKit/SKPhysicsWorld.swift | 4 +- watchOS/SpriteKit/SKScene.swift | 8 +- watchOS/SpriteKit/SKTexture.swift | 2 + watchOS/SpriteKit/SKTextureAtlas.swift | 4 + .../StoreKit/SKCloudServiceController.swift | 8 ++ watchOS/StoreKit/SKPaymentQueue.swift | 4 +- watchOS/StoreKit/SKProductsRequest.swift | 2 +- watchOS/StoreKit/SKRequest.swift | 4 +- .../UNUserNotificationCenter.swift | 12 +- watchOS/WatchConnectivity/WCSession.swift | 22 +-- watchOS/WatchKit/WKCrownSequencer.swift | 4 +- .../WatchKit/WKExtendedRuntimeSession.swift | 4 +- watchOS/WatchKit/WKExtension.swift | 20 +-- watchOS/WatchKit/WKInterfaceController.swift | 6 + 976 files changed, 5140 insertions(+), 1856 deletions(-) diff --git a/iOS/ARKit/ARCoachingOverlayView.swift b/iOS/ARKit/ARCoachingOverlayView.swift index 332191c..368a95b 100644 --- a/iOS/ARKit/ARCoachingOverlayView.swift +++ b/iOS/ARKit/ARCoachingOverlayView.swift @@ -22,7 +22,7 @@ class ARCoachingOverlayView : UIView { } @available(iOS 13.0, *) protocol ARCoachingOverlayViewDelegate : NSObjectProtocol { - optional func coachingOverlayViewDidRequestSessionReset(_ coachingOverlayView: ARCoachingOverlayView) + @asyncHandler optional func coachingOverlayViewDidRequestSessionReset(_ coachingOverlayView: ARCoachingOverlayView) optional func coachingOverlayViewWillActivate(_ coachingOverlayView: ARCoachingOverlayView) - optional func coachingOverlayViewDidDeactivate(_ coachingOverlayView: ARCoachingOverlayView) + @asyncHandler optional func coachingOverlayViewDidDeactivate(_ coachingOverlayView: ARCoachingOverlayView) } diff --git a/iOS/ARKit/ARConfiguration.swift b/iOS/ARKit/ARConfiguration.swift index b3df1f8..9c09787 100644 --- a/iOS/ARKit/ARConfiguration.swift +++ b/iOS/ARKit/ARConfiguration.swift @@ -145,5 +145,7 @@ class ARGeoTrackingConfiguration : ARConfiguration { var maximumNumberOfTrackedImages: Int var detectionObjects: Set class func checkAvailability(completionHandler: @escaping (Bool, Error?) -> Void) + class func checkAvailability() async throws -> Bool class func checkAvailability(at coordinate: CLLocationCoordinate2D, completionHandler: @escaping (Bool, Error?) -> Void) + class func checkAvailability(at coordinate: CLLocationCoordinate2D) async throws -> Bool } diff --git a/iOS/ARKit/ARReferenceImage.swift b/iOS/ARKit/ARReferenceImage.swift index 90018f5..8279cd5 100644 --- a/iOS/ARKit/ARReferenceImage.swift +++ b/iOS/ARKit/ARReferenceImage.swift @@ -7,6 +7,8 @@ class ARReferenceImage : NSObject { var resourceGroupName: String? { get } @available(iOS 13.0, *) func validate(completionHandler: @escaping (Error?) -> Void) + @available(iOS 13.0, *) + func validate() async throws init(_ image: CGImage, orientation: CGImagePropertyOrientation, physicalWidth: CGFloat) init(_ pixelBuffer: CVPixelBuffer, orientation: CGImagePropertyOrientation, physicalWidth: CGFloat) class func referenceImages(inGroupNamed name: String, bundle: Bundle?) -> Set? diff --git a/iOS/ARKit/ARSCNView.swift b/iOS/ARKit/ARSCNView.swift index 05125af..c73909e 100644 --- a/iOS/ARKit/ARSCNView.swift +++ b/iOS/ARKit/ARSCNView.swift @@ -23,10 +23,10 @@ extension ARSCNView { @available(iOS 11.0, *) protocol ARSCNViewDelegate : ARSessionObserver, SCNSceneRendererDelegate { optional func renderer(_ renderer: SCNSceneRenderer, nodeFor anchor: ARAnchor) -> SCNNode? - optional func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) + @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) optional func renderer(_ renderer: SCNSceneRenderer, willUpdate node: SCNNode, for anchor: ARAnchor) - optional func renderer(_ renderer: SCNSceneRenderer, didUpdate node: SCNNode, for anchor: ARAnchor) - optional func renderer(_ renderer: SCNSceneRenderer, didRemove node: SCNNode, for anchor: ARAnchor) + @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didUpdate node: SCNNode, for anchor: ARAnchor) + @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didRemove node: SCNNode, for anchor: ARAnchor) } @available(iOS 11.0, *) typealias ARSCNDebugOptions = SCNDebugOptions diff --git a/iOS/ARKit/ARSKView.swift b/iOS/ARKit/ARSKView.swift index 6522f92..c595337 100644 --- a/iOS/ARKit/ARSKView.swift +++ b/iOS/ARKit/ARSKView.swift @@ -2,10 +2,10 @@ @available(iOS 11.0, *) protocol ARSKViewDelegate : ARSessionObserver, SKViewDelegate { optional func view(_ view: ARSKView, nodeFor anchor: ARAnchor) -> SKNode? - optional func view(_ view: ARSKView, didAdd node: SKNode, for anchor: ARAnchor) + @asyncHandler optional func view(_ view: ARSKView, didAdd node: SKNode, for anchor: ARAnchor) optional func view(_ view: ARSKView, willUpdate node: SKNode, for anchor: ARAnchor) - optional func view(_ view: ARSKView, didUpdate node: SKNode, for anchor: ARAnchor) - optional func view(_ view: ARSKView, didRemove node: SKNode, for anchor: ARAnchor) + @asyncHandler optional func view(_ view: ARSKView, didUpdate node: SKNode, for anchor: ARAnchor) + @asyncHandler optional func view(_ view: ARSKView, didRemove node: SKNode, for anchor: ARAnchor) } @available(iOS 11.0, *) class ARSKView : SKView, ARSessionProviding { diff --git a/iOS/ARKit/ARSession.swift b/iOS/ARKit/ARSession.swift index 3017f6c..dad2452 100644 --- a/iOS/ARKit/ARSession.swift +++ b/iOS/ARKit/ARSession.swift @@ -27,7 +27,11 @@ class ARSession : NSObject { @available(iOS 12.0, *) func getCurrentWorldMap(completionHandler: @escaping (ARWorldMap?, Error?) -> Void) @available(iOS 12.0, *) + func getCurrentWorldMap() async throws -> ARWorldMap? + @available(iOS 12.0, *) func createReferenceObject(transform: simd_float4x4, center: simd_float3, extent: simd_float3, completionHandler: @escaping (ARReferenceObject?, Error?) -> Void) + @available(iOS 12.0, *) + func createReferenceObject(transform: simd_float4x4, center: simd_float3, extent: simd_float3) async throws -> ARReferenceObject? @available(iOS 13.0, *) func raycast(_ query: ARRaycastQuery) -> [ARRaycastResult] @available(iOS 13.0, *) @@ -36,27 +40,29 @@ class ARSession : NSObject { func update(with collaborationData: ARSession.CollaborationData) @available(iOS 14.0, *) func getGeoLocation(forPoint position: simd_float3, completionHandler: @escaping (CLLocationCoordinate2D, CLLocationDistance, Error?) -> Void) + @available(iOS 14.0, *) + func getGeoLocation(forPoint position: simd_float3) async throws -> (CLLocationCoordinate2D, CLLocationDistance) } @available(iOS 11.0, *) protocol ARSessionObserver : NSObjectProtocol { - optional func session(_ session: ARSession, didFailWithError error: Error) + @asyncHandler optional func session(_ session: ARSession, didFailWithError error: Error) optional func session(_ session: ARSession, cameraDidChangeTrackingState camera: ARCamera) optional func sessionWasInterrupted(_ session: ARSession) optional func sessionInterruptionEnded(_ session: ARSession) @available(iOS 11.3, *) optional func sessionShouldAttemptRelocalization(_ session: ARSession) -> Bool - optional func session(_ session: ARSession, didOutputAudioSampleBuffer audioSampleBuffer: CMSampleBuffer) + @asyncHandler optional func session(_ session: ARSession, didOutputAudioSampleBuffer audioSampleBuffer: CMSampleBuffer) @available(iOS 13.0, *) - optional func session(_ session: ARSession, didOutputCollaborationData data: ARSession.CollaborationData) + @asyncHandler optional func session(_ session: ARSession, didOutputCollaborationData data: ARSession.CollaborationData) @available(iOS 14.0, *) - optional func session(_ session: ARSession, didChange geoTrackingStatus: ARGeoTrackingStatus) + @asyncHandler optional func session(_ session: ARSession, didChange geoTrackingStatus: ARGeoTrackingStatus) } @available(iOS 11.0, *) protocol ARSessionDelegate : ARSessionObserver { - optional func session(_ session: ARSession, didUpdate frame: ARFrame) - optional func session(_ session: ARSession, didAdd anchors: [ARAnchor]) - optional func session(_ session: ARSession, didUpdate anchors: [ARAnchor]) - optional func session(_ session: ARSession, didRemove anchors: [ARAnchor]) + @asyncHandler optional func session(_ session: ARSession, didUpdate frame: ARFrame) + @asyncHandler optional func session(_ session: ARSession, didAdd anchors: [ARAnchor]) + @asyncHandler optional func session(_ session: ARSession, didUpdate anchors: [ARAnchor]) + @asyncHandler optional func session(_ session: ARSession, didRemove anchors: [ARAnchor]) } protocol ARSessionProviding : NSObjectProtocol { @available(iOS 11.0, *) diff --git a/iOS/AVFoundation/AVAssetDownloadTask.swift b/iOS/AVFoundation/AVAssetDownloadTask.swift index b8cb04d..ccdcf65 100644 --- a/iOS/AVFoundation/AVAssetDownloadTask.swift +++ b/iOS/AVFoundation/AVAssetDownloadTask.swift @@ -24,17 +24,17 @@ class AVAggregateAssetDownloadTask : URLSessionTask { @available(iOS 9.0, *) protocol AVAssetDownloadDelegate : URLSessionTaskDelegate { @available(iOS 10.0, *) - optional func urlSession(_ session: URLSession, assetDownloadTask: AVAssetDownloadTask, didFinishDownloadingTo location: URL) + @asyncHandler optional func urlSession(_ session: URLSession, assetDownloadTask: AVAssetDownloadTask, didFinishDownloadingTo location: URL) @available(iOS 9.0, *) - optional func urlSession(_ session: URLSession, assetDownloadTask: AVAssetDownloadTask, didLoad timeRange: CMTimeRange, totalTimeRangesLoaded loadedTimeRanges: [NSValue], timeRangeExpectedToLoad: CMTimeRange) + @asyncHandler optional func urlSession(_ session: URLSession, assetDownloadTask: AVAssetDownloadTask, didLoad timeRange: CMTimeRange, totalTimeRangesLoaded loadedTimeRanges: [NSValue], timeRangeExpectedToLoad: CMTimeRange) @available(iOS 9.0, *) - optional func urlSession(_ session: URLSession, assetDownloadTask: AVAssetDownloadTask, didResolve resolvedMediaSelection: AVMediaSelection) + @asyncHandler optional func urlSession(_ session: URLSession, assetDownloadTask: AVAssetDownloadTask, didResolve resolvedMediaSelection: AVMediaSelection) @available(iOS 11.0, *) optional func urlSession(_ session: URLSession, aggregateAssetDownloadTask: AVAggregateAssetDownloadTask, willDownloadTo location: URL) @available(iOS 11.0, *) - optional func urlSession(_ session: URLSession, aggregateAssetDownloadTask: AVAggregateAssetDownloadTask, didCompleteFor mediaSelection: AVMediaSelection) + @asyncHandler optional func urlSession(_ session: URLSession, aggregateAssetDownloadTask: AVAggregateAssetDownloadTask, didCompleteFor mediaSelection: AVMediaSelection) @available(iOS 11.0, *) - optional func urlSession(_ session: URLSession, aggregateAssetDownloadTask: AVAggregateAssetDownloadTask, didLoad timeRange: CMTimeRange, totalTimeRangesLoaded loadedTimeRanges: [NSValue], timeRangeExpectedToLoad: CMTimeRange, for mediaSelection: AVMediaSelection) + @asyncHandler optional func urlSession(_ session: URLSession, aggregateAssetDownloadTask: AVAggregateAssetDownloadTask, didLoad timeRange: CMTimeRange, totalTimeRangesLoaded loadedTimeRanges: [NSValue], timeRangeExpectedToLoad: CMTimeRange, for mediaSelection: AVMediaSelection) } @available(iOS 9.0, *) class AVAssetDownloadURLSession : URLSession { diff --git a/iOS/AVFoundation/AVAssetExportSession.swift b/iOS/AVFoundation/AVAssetExportSession.swift index 1735cd7..9e685b7 100644 --- a/iOS/AVFoundation/AVAssetExportSession.swift +++ b/iOS/AVFoundation/AVAssetExportSession.swift @@ -55,6 +55,7 @@ class AVAssetExportSession : NSObject { var status: AVAssetExportSession.Status { get } var error: Error? { get } func exportAsynchronously(completionHandler handler: @escaping () -> Void) + func exportAsynchronously() async var progress: Float { get } func cancelExport() } @@ -63,11 +64,15 @@ extension AVAssetExportSession { class func exportPresets(compatibleWith asset: AVAsset) -> [String] @available(iOS 6.0, *) class func determineCompatibility(ofExportPreset presetName: String, with asset: AVAsset, outputFileType: AVFileType?, completionHandler handler: @escaping (Bool) -> Void) + @available(iOS 6.0, *) + class func determineCompatibility(ofExportPreset presetName: String, with asset: AVAsset, outputFileType: AVFileType?) async -> Bool } extension AVAssetExportSession { var supportedFileTypes: [AVFileType] { get } @available(iOS 6.0, *) func determineCompatibleFileTypes(completionHandler handler: @escaping ([AVFileType]) -> Void) + @available(iOS 6.0, *) + func determineCompatibleFileTypes() async -> [AVFileType] } extension AVAssetExportSession { var timeRange: CMTimeRange @@ -80,7 +85,11 @@ extension AVAssetExportSession { @available(iOS 13.0, *) func estimateMaximumDuration(completionHandler handler: @escaping (CMTime, Error?) -> Void) @available(iOS 13.0, *) + func estimateMaximumDuration() async throws -> CMTime + @available(iOS 13.0, *) func estimateOutputFileLength(completionHandler handler: @escaping (Int64, Error?) -> Void) + @available(iOS 13.0, *) + func estimateOutputFileLength() async throws -> Int64 } extension AVAssetExportSession { var metadata: [AVMetadataItem]? diff --git a/iOS/AVFoundation/AVAssetImageGenerator.swift b/iOS/AVFoundation/AVAssetImageGenerator.swift index 8f84dbd..300a83a 100644 --- a/iOS/AVFoundation/AVAssetImageGenerator.swift +++ b/iOS/AVFoundation/AVAssetImageGenerator.swift @@ -38,6 +38,7 @@ class AVAssetImageGenerator : NSObject { init(asset: AVAsset) func copyCGImage(at requestedTime: CMTime, actualTime: UnsafeMutablePointer?) throws -> CGImage func generateCGImagesAsynchronously(forTimes requestedTimes: [NSValue], completionHandler handler: @escaping AVAssetImageGeneratorCompletionHandler) + func generateCGImagesAsynchronously(forTimes requestedTimes: [NSValue]) async throws -> (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result) func cancelAllCGImageGeneration() } typealias AVAssetImageGeneratorCompletionHandler = (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result, Error?) -> Void diff --git a/iOS/AVFoundation/AVAssetResourceLoader.swift b/iOS/AVFoundation/AVAssetResourceLoader.swift index 4fc318e..95d3d57 100644 --- a/iOS/AVFoundation/AVAssetResourceLoader.swift +++ b/iOS/AVFoundation/AVAssetResourceLoader.swift @@ -11,11 +11,11 @@ protocol AVAssetResourceLoaderDelegate : NSObjectProtocol { @available(iOS 8.0, *) optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForRenewalOfRequestedResource renewalRequest: AVAssetResourceRenewalRequest) -> Bool @available(iOS 7.0, *) - optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel loadingRequest: AVAssetResourceLoadingRequest) + @asyncHandler optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel loadingRequest: AVAssetResourceLoadingRequest) @available(iOS 8.0, *) optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForResponseTo authenticationChallenge: URLAuthenticationChallenge) -> Bool @available(iOS 8.0, *) - optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel authenticationChallenge: URLAuthenticationChallenge) + @asyncHandler optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel authenticationChallenge: URLAuthenticationChallenge) } @available(iOS 12.0, *) class AVAssetResourceLoadingRequestor : NSObject { diff --git a/iOS/AVFoundation/AVAssetWriter.swift b/iOS/AVFoundation/AVAssetWriter.swift index a0176ac..aa9053a 100644 --- a/iOS/AVFoundation/AVAssetWriter.swift +++ b/iOS/AVFoundation/AVAssetWriter.swift @@ -35,6 +35,8 @@ class AVAssetWriter : NSObject { func cancelWriting() @available(iOS 6.0, *) func finishWriting(completionHandler handler: @escaping () -> Void) + @available(iOS 6.0, *) + func finishWriting() async } extension AVAssetWriter { var movieFragmentInterval: CMTime @@ -74,6 +76,6 @@ extension AVAssetWriter { } @available(iOS 14.0, *) protocol AVAssetWriterDelegate : NSObjectProtocol { - optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType, segmentReport: AVAssetSegmentReport?) - optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType) + @asyncHandler optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType, segmentReport: AVAssetSegmentReport?) + @asyncHandler optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType) } diff --git a/iOS/AVFoundation/AVAsynchronousKeyValueLoading.swift b/iOS/AVFoundation/AVAsynchronousKeyValueLoading.swift index a340868..cd4a315 100644 --- a/iOS/AVFoundation/AVAsynchronousKeyValueLoading.swift +++ b/iOS/AVFoundation/AVAsynchronousKeyValueLoading.swift @@ -11,4 +11,5 @@ enum AVKeyValueStatus : Int { protocol AVAsynchronousKeyValueLoading { func statusOfValue(forKey key: String, error outError: NSErrorPointer) -> AVKeyValueStatus func loadValuesAsynchronously(forKeys keys: [String], completionHandler handler: (() -> Void)? = nil) + func loadValuesAsynchronously(forKeys keys: [String]) async } diff --git a/iOS/AVFoundation/AVCaptureAudioDataOutput.swift b/iOS/AVFoundation/AVCaptureAudioDataOutput.swift index 6615cf4..30256c0 100644 --- a/iOS/AVFoundation/AVCaptureAudioDataOutput.swift +++ b/iOS/AVFoundation/AVCaptureAudioDataOutput.swift @@ -9,5 +9,5 @@ class AVCaptureAudioDataOutput : AVCaptureOutput { } @available(iOS 4.0, *) protocol AVCaptureAudioDataOutputSampleBufferDelegate : NSObjectProtocol { - optional func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) + @asyncHandler optional func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) } diff --git a/iOS/AVFoundation/AVCaptureDataOutputSynchronizer.swift b/iOS/AVFoundation/AVCaptureDataOutputSynchronizer.swift index 5c23bb2..383c1c9 100644 --- a/iOS/AVFoundation/AVCaptureDataOutputSynchronizer.swift +++ b/iOS/AVFoundation/AVCaptureDataOutputSynchronizer.swift @@ -9,7 +9,7 @@ class AVCaptureDataOutputSynchronizer : NSObject { } @available(iOS 11.0, *) protocol AVCaptureDataOutputSynchronizerDelegate : NSObjectProtocol { - func dataOutputSynchronizer(_ synchronizer: AVCaptureDataOutputSynchronizer, didOutput synchronizedDataCollection: AVCaptureSynchronizedDataCollection) + @asyncHandler func dataOutputSynchronizer(_ synchronizer: AVCaptureDataOutputSynchronizer, didOutput synchronizedDataCollection: AVCaptureSynchronizedDataCollection) } @available(iOS 11.0, *) class AVCaptureSynchronizedDataCollection : NSObject, NSFastEnumeration { diff --git a/iOS/AVFoundation/AVCaptureDepthDataOutput.swift b/iOS/AVFoundation/AVCaptureDepthDataOutput.swift index 89f1bed..55d0505 100644 --- a/iOS/AVFoundation/AVCaptureDepthDataOutput.swift +++ b/iOS/AVFoundation/AVCaptureDepthDataOutput.swift @@ -9,6 +9,6 @@ class AVCaptureDepthDataOutput : AVCaptureOutput { } @available(iOS 11.0, *) protocol AVCaptureDepthDataOutputDelegate : NSObjectProtocol { - optional func depthDataOutput(_ output: AVCaptureDepthDataOutput, didOutput depthData: AVDepthData, timestamp: CMTime, connection: AVCaptureConnection) - optional func depthDataOutput(_ output: AVCaptureDepthDataOutput, didDrop depthData: AVDepthData, timestamp: CMTime, connection: AVCaptureConnection, reason: AVCaptureOutput.DataDroppedReason) + @asyncHandler optional func depthDataOutput(_ output: AVCaptureDepthDataOutput, didOutput depthData: AVDepthData, timestamp: CMTime, connection: AVCaptureConnection) + @asyncHandler optional func depthDataOutput(_ output: AVCaptureDepthDataOutput, didDrop depthData: AVDepthData, timestamp: CMTime, connection: AVCaptureConnection, reason: AVCaptureOutput.DataDroppedReason) } diff --git a/iOS/AVFoundation/AVCaptureDevice.swift b/iOS/AVFoundation/AVCaptureDevice.swift index 78ec12a..2788a89 100644 --- a/iOS/AVFoundation/AVCaptureDevice.swift +++ b/iOS/AVFoundation/AVCaptureDevice.swift @@ -270,6 +270,8 @@ extension AVCaptureDevice { var lensPosition: Float { get } @available(iOS 8.0, *) func setFocusModeLocked(lensPosition: Float, completionHandler handler: ((CMTime) -> Void)? = nil) + @available(iOS 8.0, *) + func setFocusModeLocked(lensPosition: Float) async -> CMTime } extension AVCaptureDevice { func isExposureModeSupported(_ exposureMode: AVCaptureDevice.ExposureMode) -> Bool @@ -288,6 +290,8 @@ extension AVCaptureDevice { @available(iOS 8.0, *) func setExposureModeCustom(duration: CMTime, iso ISO: Float, completionHandler handler: ((CMTime) -> Void)? = nil) @available(iOS 8.0, *) + func setExposureModeCustom(duration: CMTime, iso ISO: Float) async -> CMTime + @available(iOS 8.0, *) var exposureTargetOffset: Float { get } @available(iOS 8.0, *) var exposureTargetBias: Float { get } @@ -297,6 +301,8 @@ extension AVCaptureDevice { var maxExposureTargetBias: Float { get } @available(iOS 8.0, *) func setExposureTargetBias(_ bias: Float, completionHandler handler: ((CMTime) -> Void)? = nil) + @available(iOS 8.0, *) + func setExposureTargetBias(_ bias: Float) async -> CMTime } extension AVCaptureDevice { @available(iOS 13.0, *) @@ -317,6 +323,8 @@ extension AVCaptureDevice { @available(iOS 8.0, *) func setWhiteBalanceModeLocked(with whiteBalanceGains: AVCaptureDevice.WhiteBalanceGains, completionHandler handler: ((CMTime) -> Void)? = nil) @available(iOS 8.0, *) + func setWhiteBalanceModeLocked(with whiteBalanceGains: AVCaptureDevice.WhiteBalanceGains) async -> CMTime + @available(iOS 8.0, *) func chromaticityValues(for whiteBalanceGains: AVCaptureDevice.WhiteBalanceGains) -> AVCaptureDevice.WhiteBalanceChromaticityValues @available(iOS 8.0, *) func deviceWhiteBalanceGains(for chromaticityValues: AVCaptureDevice.WhiteBalanceChromaticityValues) -> AVCaptureDevice.WhiteBalanceGains @@ -363,6 +371,8 @@ extension AVCaptureDevice { class func authorizationStatus(for mediaType: AVMediaType) -> AVAuthorizationStatus @available(iOS 7.0, *) class func requestAccess(for mediaType: AVMediaType, completionHandler handler: @escaping (Bool) -> Void) + @available(iOS 7.0, *) + class func requestAccess(for mediaType: AVMediaType) async -> Bool } extension AVCaptureDevice { } diff --git a/iOS/AVFoundation/AVCaptureFileOutput.swift b/iOS/AVFoundation/AVCaptureFileOutput.swift index b55e785..9f10548 100644 --- a/iOS/AVFoundation/AVCaptureFileOutput.swift +++ b/iOS/AVFoundation/AVCaptureFileOutput.swift @@ -13,8 +13,8 @@ class AVCaptureFileOutput : AVCaptureOutput { } @available(iOS 4.0, *) protocol AVCaptureFileOutputRecordingDelegate : NSObjectProtocol { - optional func fileOutput(_ output: AVCaptureFileOutput, didStartRecordingTo fileURL: URL, from connections: [AVCaptureConnection]) - func fileOutput(_ output: AVCaptureFileOutput, didFinishRecordingTo outputFileURL: URL, from connections: [AVCaptureConnection], error: Error?) + @asyncHandler optional func fileOutput(_ output: AVCaptureFileOutput, didStartRecordingTo fileURL: URL, from connections: [AVCaptureConnection]) + @asyncHandler func fileOutput(_ output: AVCaptureFileOutput, didFinishRecordingTo outputFileURL: URL, from connections: [AVCaptureConnection], error: Error?) } @available(iOS 4.0, *) class AVCaptureMovieFileOutput : AVCaptureFileOutput { diff --git a/iOS/AVFoundation/AVCaptureMetadataOutput.swift b/iOS/AVFoundation/AVCaptureMetadataOutput.swift index 4482bab..b07320f 100644 --- a/iOS/AVFoundation/AVCaptureMetadataOutput.swift +++ b/iOS/AVFoundation/AVCaptureMetadataOutput.swift @@ -11,5 +11,5 @@ class AVCaptureMetadataOutput : AVCaptureOutput { } @available(iOS 6.0, *) protocol AVCaptureMetadataOutputObjectsDelegate : NSObjectProtocol { - optional func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection) + @asyncHandler optional func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection) } diff --git a/iOS/AVFoundation/AVCapturePhotoOutput.swift b/iOS/AVFoundation/AVCapturePhotoOutput.swift index 086e3d7..939da5a 100644 --- a/iOS/AVFoundation/AVCapturePhotoOutput.swift +++ b/iOS/AVFoundation/AVCapturePhotoOutput.swift @@ -4,6 +4,7 @@ class AVCapturePhotoOutput : AVCaptureOutput { func capturePhoto(with settings: AVCapturePhotoSettings, delegate: AVCapturePhotoCaptureDelegate) var preparedPhotoSettingsArray: [AVCapturePhotoSettings] { get } func setPreparedPhotoSettingsArray(_ preparedPhotoSettingsArray: [AVCapturePhotoSettings], completionHandler: ((Bool, Error?) -> Void)? = nil) + func setPreparedPhotoSettingsArray(_ preparedPhotoSettingsArray: [AVCapturePhotoSettings]) async throws -> Bool var __availablePhotoPixelFormatTypes: [NSNumber] { get } var availablePhotoCodecTypes: [AVVideoCodecType] { get } var __availableRawPhotoPixelFormatTypes: [NSNumber] { get } @@ -95,16 +96,16 @@ extension AVCapturePhotoOutput { protocol AVCapturePhotoCaptureDelegate : NSObjectProtocol { optional func photoOutput(_ output: AVCapturePhotoOutput, willBeginCaptureFor resolvedSettings: AVCaptureResolvedPhotoSettings) optional func photoOutput(_ output: AVCapturePhotoOutput, willCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings) - optional func photoOutput(_ output: AVCapturePhotoOutput, didCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings) + @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings) @available(iOS 11.0, *) - optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) + @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) @available(iOS, introduced: 10.0, deprecated: 11.0) - optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photoSampleBuffer: CMSampleBuffer?, previewPhoto previewPhotoSampleBuffer: CMSampleBuffer?, resolvedSettings: AVCaptureResolvedPhotoSettings, bracketSettings: AVCaptureBracketedStillImageSettings?, error: Error?) + @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photoSampleBuffer: CMSampleBuffer?, previewPhoto previewPhotoSampleBuffer: CMSampleBuffer?, resolvedSettings: AVCaptureResolvedPhotoSettings, bracketSettings: AVCaptureBracketedStillImageSettings?, error: Error?) @available(iOS, introduced: 10.0, deprecated: 11.0) - optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingRawPhoto rawSampleBuffer: CMSampleBuffer?, previewPhoto previewPhotoSampleBuffer: CMSampleBuffer?, resolvedSettings: AVCaptureResolvedPhotoSettings, bracketSettings: AVCaptureBracketedStillImageSettings?, error: Error?) - optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishRecordingLivePhotoMovieForEventualFileAt outputFileURL: URL, resolvedSettings: AVCaptureResolvedPhotoSettings) - optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingLivePhotoToMovieFileAt outputFileURL: URL, duration: CMTime, photoDisplayTime: CMTime, resolvedSettings: AVCaptureResolvedPhotoSettings, error: Error?) - optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishCaptureFor resolvedSettings: AVCaptureResolvedPhotoSettings, error: Error?) + @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingRawPhoto rawSampleBuffer: CMSampleBuffer?, previewPhoto previewPhotoSampleBuffer: CMSampleBuffer?, resolvedSettings: AVCaptureResolvedPhotoSettings, bracketSettings: AVCaptureBracketedStillImageSettings?, error: Error?) + @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishRecordingLivePhotoMovieForEventualFileAt outputFileURL: URL, resolvedSettings: AVCaptureResolvedPhotoSettings) + @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingLivePhotoToMovieFileAt outputFileURL: URL, duration: CMTime, photoDisplayTime: CMTime, resolvedSettings: AVCaptureResolvedPhotoSettings, error: Error?) + @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishCaptureFor resolvedSettings: AVCaptureResolvedPhotoSettings, error: Error?) } @available(iOS 10.0, *) class AVCapturePhotoSettings : NSObject, NSCopying { diff --git a/iOS/AVFoundation/AVCaptureStillImageOutput.swift b/iOS/AVFoundation/AVCaptureStillImageOutput.swift index e9f149b..794e92c 100644 --- a/iOS/AVFoundation/AVCaptureStillImageOutput.swift +++ b/iOS/AVFoundation/AVCaptureStillImageOutput.swift @@ -15,6 +15,7 @@ class AVCaptureStillImageOutput : AVCaptureOutput { @available(iOS 5.0, *) var isCapturingStillImage: Bool { get } func captureStillImageAsynchronously(from connection: AVCaptureConnection, completionHandler handler: @escaping (CMSampleBuffer?, Error?) -> Void) + func captureStillImageAsynchronously(from connection: AVCaptureConnection) async throws -> CMSampleBuffer? class func jpegStillImageNSDataRepresentation(_ jpegSampleBuffer: CMSampleBuffer) -> Data? } @available(iOS 8.0, *) @@ -40,6 +41,10 @@ extension AVCaptureStillImageOutput { var isLensStabilizationDuringBracketedCaptureEnabled: Bool @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use AVCapturePhotoOutput setPreparedPhotoSettingsArray:completionHandler: instead.") func prepareToCaptureStillImageBracket(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings], completionHandler handler: @escaping (Bool, Error?) -> Void) + @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use AVCapturePhotoOutput setPreparedPhotoSettingsArray:completionHandler: instead.") + func prepareToCaptureStillImageBracket(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings]) async throws -> Bool @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead.") func captureStillImageBracketAsynchronously(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings], completionHandler handler: @escaping (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?, Error?) -> Void) + @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead.") + func captureStillImageBracketAsynchronously(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings]) async throws -> (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?) } diff --git a/iOS/AVFoundation/AVCaptureVideoDataOutput.swift b/iOS/AVFoundation/AVCaptureVideoDataOutput.swift index 27099a9..ec5db38 100644 --- a/iOS/AVFoundation/AVCaptureVideoDataOutput.swift +++ b/iOS/AVFoundation/AVCaptureVideoDataOutput.swift @@ -28,7 +28,7 @@ extension AVCaptureVideoDataOutput { } @available(iOS 4.0, *) protocol AVCaptureVideoDataOutputSampleBufferDelegate : NSObjectProtocol { - optional func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) + @asyncHandler optional func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) @available(iOS 6.0, *) - optional func captureOutput(_ output: AVCaptureOutput, didDrop sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) + @asyncHandler optional func captureOutput(_ output: AVCaptureOutput, didDrop sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) } diff --git a/iOS/AVFoundation/AVContentKeySession.swift b/iOS/AVFoundation/AVContentKeySession.swift index babe6d8..ee3b7d0 100644 --- a/iOS/AVFoundation/AVContentKeySession.swift +++ b/iOS/AVFoundation/AVContentKeySession.swift @@ -29,10 +29,16 @@ class AVContentKeySession : NSObject { func renewExpiringResponseData(for contentKeyRequest: AVContentKeyRequest) @available(iOS 11.0, *) func makeSecureTokenForExpirationDate(ofPersistableContentKey persistableContentKeyData: Data, completionHandler handler: @escaping (Data?, Error?) -> Void) + @available(iOS 11.0, *) + func makeSecureTokenForExpirationDate(ofPersistableContentKey persistableContentKeyData: Data) async throws -> Data? @available(iOS 12.2, *) func invalidatePersistableContentKey(_ persistableContentKeyData: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) @available(iOS 12.2, *) + func invalidatePersistableContentKey(_ persistableContentKeyData: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil) async throws -> Data? + @available(iOS 12.2, *) func invalidateAllPersistableContentKeys(forApp appIdentifier: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) + @available(iOS 12.2, *) + func invalidateAllPersistableContentKeys(forApp appIdentifier: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil) async throws -> Data? } struct AVContentKeySessionServerPlaybackContextOption : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable { init(rawValue: String) @@ -83,18 +89,18 @@ extension AVContentKeyRequest.RetryReason { } @available(iOS 10.3, *) protocol AVContentKeySessionDelegate : NSObjectProtocol { - func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest) - optional func contentKeySession(_ session: AVContentKeySession, didProvideRenewingContentKeyRequest keyRequest: AVContentKeyRequest) - optional func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVPersistableContentKeyRequest) + @asyncHandler func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest) + @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didProvideRenewingContentKeyRequest keyRequest: AVContentKeyRequest) + @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVPersistableContentKeyRequest) @available(iOS 11.0, *) - optional func contentKeySession(_ session: AVContentKeySession, didUpdatePersistableContentKey persistableContentKey: Data, forContentKeyIdentifier keyIdentifier: Any) - optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequest keyRequest: AVContentKeyRequest, didFailWithError err: Error) + @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didUpdatePersistableContentKey persistableContentKey: Data, forContentKeyIdentifier keyIdentifier: Any) + @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequest keyRequest: AVContentKeyRequest, didFailWithError err: Error) optional func contentKeySession(_ session: AVContentKeySession, shouldRetry keyRequest: AVContentKeyRequest, reason retryReason: AVContentKeyRequest.RetryReason) -> Bool @available(iOS 12.0, *) optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequestDidSucceed keyRequest: AVContentKeyRequest) - optional func contentKeySessionContentProtectionSessionIdentifierDidChange(_ session: AVContentKeySession) + @asyncHandler optional func contentKeySessionContentProtectionSessionIdentifierDidChange(_ session: AVContentKeySession) @available(iOS 12.0, *) - optional func contentKeySessionDidGenerateExpiredSessionReport(_ session: AVContentKeySession) + @asyncHandler optional func contentKeySessionDidGenerateExpiredSessionReport(_ session: AVContentKeySession) } @available(iOS 10.3, *) class AVContentKeyRequest : NSObject { @@ -106,6 +112,7 @@ class AVContentKeyRequest : NSObject { var options: [String : Any] { get } var canProvidePersistableContentKey: Bool { get } func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) + func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil) async throws -> Data? func processContentKeyResponse(_ keyResponse: AVContentKeyResponse) func processContentKeyResponseError(_ error: Error) @available(iOS, introduced: 10.3, deprecated: 11.2, message: "Use respondByRequestingPersistableContentKeyRequestAndReturnError: instead.") diff --git a/iOS/AVFoundation/AVPlayer.swift b/iOS/AVFoundation/AVPlayer.swift index 72be28f..0d713f4 100644 --- a/iOS/AVFoundation/AVPlayer.swift +++ b/iOS/AVFoundation/AVPlayer.swift @@ -74,12 +74,18 @@ extension AVPlayer { func seek(to date: Date) @available(iOS 5.0, *) func seek(to date: Date, completionHandler: @escaping (Bool) -> Void) + @available(iOS 5.0, *) + func seek(to date: Date) async -> Bool func seek(to time: CMTime) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) @available(iOS 5.0, *) func seek(to time: CMTime, completionHandler: @escaping (Bool) -> Void) @available(iOS 5.0, *) + func seek(to time: CMTime) async -> Bool + @available(iOS 5.0, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: @escaping (Bool) -> Void) + @available(iOS 5.0, *) + func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool } extension AVPlayer { @available(iOS 10.0, *) @@ -89,6 +95,8 @@ extension AVPlayer { @available(iOS 6.0, *) func preroll(atRate rate: Float, completionHandler: ((Bool) -> Void)? = nil) @available(iOS 6.0, *) + func preroll(atRate rate: Float) async -> Bool + @available(iOS 6.0, *) func cancelPendingPrerolls() @available(iOS 6.0, *) var masterClock: CMClock? diff --git a/iOS/AVFoundation/AVPlayerItem.swift b/iOS/AVFoundation/AVPlayerItem.swift index 0c9ae6d..177cd90 100644 --- a/iOS/AVFoundation/AVPlayerItem.swift +++ b/iOS/AVFoundation/AVPlayerItem.swift @@ -85,8 +85,12 @@ extension AVPlayerItem { @available(iOS 5.0, *) func seek(to time: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(iOS 5.0, *) + func seek(to time: CMTime) async -> Bool + @available(iOS 5.0, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(iOS 5.0, *) + func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + @available(iOS 5.0, *) func cancelPendingSeeks() func currentDate() -> Date? @available(iOS 6.0, *) diff --git a/iOS/AVFoundation/AVPlayerItemMediaDataCollector.swift b/iOS/AVFoundation/AVPlayerItemMediaDataCollector.swift index 3cb5c44..7f30fe1 100644 --- a/iOS/AVFoundation/AVPlayerItemMediaDataCollector.swift +++ b/iOS/AVFoundation/AVPlayerItemMediaDataCollector.swift @@ -11,5 +11,5 @@ class AVPlayerItemMetadataCollector : AVPlayerItemMediaDataCollector { } protocol AVPlayerItemMetadataCollectorPushDelegate : NSObjectProtocol { @available(iOS 9.3, *) - func metadataCollector(_ metadataCollector: AVPlayerItemMetadataCollector, didCollect metadataGroups: [AVDateRangeMetadataGroup], indexesOfNewGroups: IndexSet, indexesOfModifiedGroups: IndexSet) + @asyncHandler func metadataCollector(_ metadataCollector: AVPlayerItemMetadataCollector, didCollect metadataGroups: [AVDateRangeMetadataGroup], indexesOfNewGroups: IndexSet, indexesOfModifiedGroups: IndexSet) } diff --git a/iOS/AVFoundation/AVPlayerItemOutput.swift b/iOS/AVFoundation/AVPlayerItemOutput.swift index edc4d88..365f9dd 100644 --- a/iOS/AVFoundation/AVPlayerItemOutput.swift +++ b/iOS/AVFoundation/AVPlayerItemOutput.swift @@ -52,7 +52,7 @@ extension AVPlayerItemLegibleOutput.TextStylingResolution { } protocol AVPlayerItemLegibleOutputPushDelegate : AVPlayerItemOutputPushDelegate { @available(iOS 7.0, *) - optional func legibleOutput(_ output: AVPlayerItemLegibleOutput, didOutputAttributedStrings strings: [NSAttributedString], nativeSampleBuffers nativeSamples: [Any], forItemTime itemTime: CMTime) + @asyncHandler optional func legibleOutput(_ output: AVPlayerItemLegibleOutput, didOutputAttributedStrings strings: [NSAttributedString], nativeSampleBuffers nativeSamples: [Any], forItemTime itemTime: CMTime) } protocol AVPlayerItemOutputPushDelegate : NSObjectProtocol { @available(iOS 6.0, *) @@ -68,5 +68,5 @@ class AVPlayerItemMetadataOutput : AVPlayerItemOutput { } protocol AVPlayerItemMetadataOutputPushDelegate : AVPlayerItemOutputPushDelegate { @available(iOS 8.0, *) - optional func metadataOutput(_ output: AVPlayerItemMetadataOutput, didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup], from track: AVPlayerItemTrack?) + @asyncHandler optional func metadataOutput(_ output: AVPlayerItemMetadataOutput, didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup], from track: AVPlayerItemTrack?) } diff --git a/iOS/AVFoundation/AVSampleBufferAudioRenderer.swift b/iOS/AVFoundation/AVSampleBufferAudioRenderer.swift index 290cce1..a4b4154 100644 --- a/iOS/AVFoundation/AVSampleBufferAudioRenderer.swift +++ b/iOS/AVFoundation/AVSampleBufferAudioRenderer.swift @@ -11,6 +11,7 @@ extension AVSampleBufferAudioRenderer { } extension AVSampleBufferAudioRenderer { func flush(fromSourceTime time: CMTime, completionHandler: @escaping (Bool) -> Void) + func flush(fromSourceTime time: CMTime) async -> Bool } extension NSNotification.Name { @available(iOS 11.0, *) diff --git a/iOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift b/iOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift index 690998a..275ce02 100644 --- a/iOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift +++ b/iOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift @@ -15,6 +15,7 @@ extension AVSampleBufferRenderSynchronizer { var renderers: [AVQueuedSampleBufferRendering] { get } func addRenderer(_ renderer: AVQueuedSampleBufferRendering) func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime, completionHandler: ((Bool) -> Void)? = nil) + func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool } extension AVSampleBufferRenderSynchronizer { func addPeriodicTimeObserver(forInterval interval: CMTime, queue: DispatchQueue?, using block: @escaping (CMTime) -> Void) -> Any diff --git a/iOS/AVKit/AVPictureInPictureController.swift b/iOS/AVKit/AVPictureInPictureController.swift index 32efd57..9632826 100644 --- a/iOS/AVKit/AVPictureInPictureController.swift +++ b/iOS/AVKit/AVPictureInPictureController.swift @@ -24,9 +24,10 @@ class AVPictureInPictureController : NSObject { @available(iOS 9.0, *) protocol AVPictureInPictureControllerDelegate : NSObjectProtocol { optional func pictureInPictureControllerWillStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) - optional func pictureInPictureControllerDidStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) + @asyncHandler optional func pictureInPictureControllerDidStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, failedToStartPictureInPictureWithError error: Error) optional func pictureInPictureControllerWillStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) - optional func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) + @asyncHandler optional func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void) + optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController) async -> Bool } diff --git a/iOS/AVKit/AVPlaybackRouteSelecting.swift b/iOS/AVKit/AVPlaybackRouteSelecting.swift index 3adc10e..1d63865 100644 --- a/iOS/AVKit/AVPlaybackRouteSelecting.swift +++ b/iOS/AVKit/AVPlaybackRouteSelecting.swift @@ -12,4 +12,5 @@ extension AVAudioSession { @available(iOS 13.0, *) extension AVAudioSession { func prepareRouteSelectionForPlayback(completionHandler: @escaping (Bool, AVAudioSession.RouteSelection) -> Void) + func prepareRouteSelectionForPlayback() async -> (Bool, AVAudioSession.RouteSelection) } diff --git a/iOS/AVKit/AVPlayerViewController.swift b/iOS/AVKit/AVPlayerViewController.swift index ae85eb4..f609aba 100644 --- a/iOS/AVKit/AVPlayerViewController.swift +++ b/iOS/AVKit/AVPlayerViewController.swift @@ -34,15 +34,17 @@ protocol AVPlayerViewControllerDelegate : NSObjectProtocol { @available(iOS 8.0, *) optional func playerViewControllerWillStartPictureInPicture(_ playerViewController: AVPlayerViewController) @available(iOS 8.0, *) - optional func playerViewControllerDidStartPictureInPicture(_ playerViewController: AVPlayerViewController) + @asyncHandler optional func playerViewControllerDidStartPictureInPicture(_ playerViewController: AVPlayerViewController) @available(iOS 8.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, failedToStartPictureInPictureWithError error: Error) @available(iOS 8.0, *) optional func playerViewControllerWillStopPictureInPicture(_ playerViewController: AVPlayerViewController) @available(iOS 8.0, *) - optional func playerViewControllerDidStopPictureInPicture(_ playerViewController: AVPlayerViewController) + @asyncHandler optional func playerViewControllerDidStopPictureInPicture(_ playerViewController: AVPlayerViewController) @available(iOS 8.0, *) optional func playerViewControllerShouldAutomaticallyDismissAtPictureInPictureStart(_ playerViewController: AVPlayerViewController) -> Bool @available(iOS 8.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void) + @available(iOS 8.0, *) + optional func playerViewController(_ playerViewController: AVPlayerViewController) async -> Bool } diff --git a/iOS/AVKit/AVRoutePickerView.swift b/iOS/AVKit/AVRoutePickerView.swift index 529b7f9..3c1fae8 100644 --- a/iOS/AVKit/AVRoutePickerView.swift +++ b/iOS/AVKit/AVRoutePickerView.swift @@ -10,5 +10,5 @@ protocol AVRoutePickerViewDelegate : NSObjectProtocol { @available(iOS 11.0, *) optional func routePickerViewWillBeginPresentingRoutes(_ routePickerView: AVRoutePickerView) @available(iOS 11.0, *) - optional func routePickerViewDidEndPresentingRoutes(_ routePickerView: AVRoutePickerView) + @asyncHandler optional func routePickerViewDidEndPresentingRoutes(_ routePickerView: AVRoutePickerView) } diff --git a/iOS/Accounts/ACAccountStore.swift b/iOS/Accounts/ACAccountStore.swift index aa13404..887debe 100644 --- a/iOS/Accounts/ACAccountStore.swift +++ b/iOS/Accounts/ACAccountStore.swift @@ -17,9 +17,13 @@ class ACAccountStore : NSObject { func accountType(withAccountTypeIdentifier typeIdentifier: String!) -> ACAccountType! func accounts(with accountType: ACAccountType!) -> [Any]! func saveAccount(_ account: ACAccount!, withCompletionHandler completionHandler: ACAccountStoreSaveCompletionHandler!) + func saveAccount(_ account: ACAccount!) async throws -> Bool func requestAccessToAccounts(with accountType: ACAccountType!, options: [AnyHashable : Any]! = [:], completion: ACAccountStoreRequestAccessCompletionHandler!) + func requestAccessToAccounts(with accountType: ACAccountType!, options: [AnyHashable : Any]! = [:]) async throws -> Bool func renewCredentials(for account: ACAccount!, completion completionHandler: ACAccountStoreCredentialRenewalHandler!) + func renewCredentials(for account: ACAccount!) async throws -> ACAccountCredentialRenewResult func removeAccount(_ account: ACAccount!, withCompletionHandler completionHandler: ACAccountStoreRemoveCompletionHandler!) + func removeAccount(_ account: ACAccount!) async throws -> Bool } extension NSNotification.Name { @available(iOS, introduced: 5.0, deprecated: 14.0, message: "Public notification deprecated. Internal clients, see private header for replacement") diff --git a/iOS/AddressBookUI/ABNewPersonViewController.swift b/iOS/AddressBookUI/ABNewPersonViewController.swift index 35f972b..f47edde 100644 --- a/iOS/AddressBookUI/ABNewPersonViewController.swift +++ b/iOS/AddressBookUI/ABNewPersonViewController.swift @@ -8,5 +8,5 @@ class ABNewPersonViewController : UIViewController { } protocol ABNewPersonViewControllerDelegate : NSObjectProtocol { @available(iOS 2.0, *) - func newPersonViewController(_ newPersonView: ABNewPersonViewController, didCompleteWithNewPerson person: ABRecord?) + @asyncHandler func newPersonViewController(_ newPersonView: ABNewPersonViewController, didCompleteWithNewPerson person: ABRecord?) } diff --git a/iOS/AddressBookUI/ABPeoplePickerNavigationController.swift b/iOS/AddressBookUI/ABPeoplePickerNavigationController.swift index d65367f..88e4b19 100644 --- a/iOS/AddressBookUI/ABPeoplePickerNavigationController.swift +++ b/iOS/AddressBookUI/ABPeoplePickerNavigationController.swift @@ -59,11 +59,11 @@ let ABPersonSocialProfilesProperty: String let ABPersonPostalAddressesProperty: String protocol ABPeoplePickerNavigationControllerDelegate : NSObjectProtocol { @available(iOS 8.0, *) - optional func peoplePickerNavigationController(_ peoplePicker: ABPeoplePickerNavigationController, didSelectPerson person: ABRecord) + @asyncHandler optional func peoplePickerNavigationController(_ peoplePicker: ABPeoplePickerNavigationController, didSelectPerson person: ABRecord) @available(iOS 8.0, *) - optional func peoplePickerNavigationController(_ peoplePicker: ABPeoplePickerNavigationController, didSelectPerson person: ABRecord, property: ABPropertyID, identifier: ABMultiValueIdentifier) + @asyncHandler optional func peoplePickerNavigationController(_ peoplePicker: ABPeoplePickerNavigationController, didSelectPerson person: ABRecord, property: ABPropertyID, identifier: ABMultiValueIdentifier) @available(iOS 2.0, *) - optional func peoplePickerNavigationControllerDidCancel(_ peoplePicker: ABPeoplePickerNavigationController) + @asyncHandler optional func peoplePickerNavigationControllerDidCancel(_ peoplePicker: ABPeoplePickerNavigationController) @available(iOS, introduced: 2.0, deprecated: 8.0) optional func peoplePickerNavigationController(_ peoplePicker: ABPeoplePickerNavigationController, shouldContinueAfterSelectingPerson person: ABRecord) -> Bool @available(iOS, introduced: 2.0, deprecated: 8.0) diff --git a/iOS/AddressBookUI/ABUnknownPersonViewController.swift b/iOS/AddressBookUI/ABUnknownPersonViewController.swift index 94a8fd1..4e64e88 100644 --- a/iOS/AddressBookUI/ABUnknownPersonViewController.swift +++ b/iOS/AddressBookUI/ABUnknownPersonViewController.swift @@ -11,7 +11,7 @@ class ABUnknownPersonViewController : UIViewController { } protocol ABUnknownPersonViewControllerDelegate : NSObjectProtocol { @available(iOS 2.0, *) - func unknownPersonViewController(_ unknownCardViewController: ABUnknownPersonViewController, didResolveToPerson person: ABRecord?) + @asyncHandler func unknownPersonViewController(_ unknownCardViewController: ABUnknownPersonViewController, didResolveToPerson person: ABRecord?) @available(iOS 3.0, *) optional func unknownPersonViewController(_ personViewController: ABUnknownPersonViewController, shouldPerformDefaultActionForPerson person: ABRecord, property: ABPropertyID, identifier: ABMultiValueIdentifier) -> Bool } diff --git a/iOS/AppTrackingTransparency/AppTrackingTransparency.swift b/iOS/AppTrackingTransparency/AppTrackingTransparency.swift index 8f9566c..fd5c191 100644 --- a/iOS/AppTrackingTransparency/AppTrackingTransparency.swift +++ b/iOS/AppTrackingTransparency/AppTrackingTransparency.swift @@ -14,5 +14,6 @@ extension ATTrackingManager { class ATTrackingManager : NSObject { class var trackingAuthorizationStatus: ATTrackingManager.AuthorizationStatus { get } class func requestTrackingAuthorization(completionHandler completion: @escaping (ATTrackingManager.AuthorizationStatus) -> Void) + class func requestTrackingAuthorization() async -> ATTrackingManager.AuthorizationStatus } var AppTrackingTransparencyVersionNumber: Double diff --git a/iOS/AudioToolbox/AUAudioUnit.swift b/iOS/AudioToolbox/AUAudioUnit.swift index cdac694..6efc8d8 100644 --- a/iOS/AudioToolbox/AUAudioUnit.swift +++ b/iOS/AudioToolbox/AUAudioUnit.swift @@ -32,6 +32,7 @@ class AUAudioUnit : NSObject { init(componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = []) throws convenience init(componentDescription: AudioComponentDescription) throws class func instantiate(with componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = [], completionHandler: @escaping (AUAudioUnit?, Error?) -> Void) + class func instantiate(with componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = []) async throws -> AUAudioUnit? var componentDescription: AudioComponentDescription { get } var component: AudioComponent { get } var componentName: String? { get } diff --git a/iOS/AuthenticationServices/ASAccountAuthenticationModificationController.swift b/iOS/AuthenticationServices/ASAccountAuthenticationModificationController.swift index 00ddcf6..0b54d90 100644 --- a/iOS/AuthenticationServices/ASAccountAuthenticationModificationController.swift +++ b/iOS/AuthenticationServices/ASAccountAuthenticationModificationController.swift @@ -1,8 +1,8 @@ @available(iOS 14.0, *) protocol ASAccountAuthenticationModificationControllerDelegate : NSObjectProtocol { - optional func accountAuthenticationModificationController(_ controller: ASAccountAuthenticationModificationController, didSuccessfullyComplete request: ASAccountAuthenticationModificationRequest, userInfo: [AnyHashable : Any]? = nil) - optional func accountAuthenticationModificationController(_ controller: ASAccountAuthenticationModificationController, didFail request: ASAccountAuthenticationModificationRequest, error: Error) + @asyncHandler optional func accountAuthenticationModificationController(_ controller: ASAccountAuthenticationModificationController, didSuccessfullyComplete request: ASAccountAuthenticationModificationRequest, userInfo: [AnyHashable : Any]? = nil) + @asyncHandler optional func accountAuthenticationModificationController(_ controller: ASAccountAuthenticationModificationController, didFail request: ASAccountAuthenticationModificationRequest, error: Error) } @available(iOS 14.0, *) protocol ASAccountAuthenticationModificationControllerPresentationContextProviding : NSObjectProtocol { diff --git a/iOS/AuthenticationServices/ASAccountAuthenticationModificationExtensionContext.swift b/iOS/AuthenticationServices/ASAccountAuthenticationModificationExtensionContext.swift index 7ca426c..31b50de 100644 --- a/iOS/AuthenticationServices/ASAccountAuthenticationModificationExtensionContext.swift +++ b/iOS/AuthenticationServices/ASAccountAuthenticationModificationExtensionContext.swift @@ -2,6 +2,7 @@ @available(iOS 14.0, *) class ASAccountAuthenticationModificationExtensionContext : NSExtensionContext { func getSignInWithAppleUpgradeAuthorization(state: String?, nonce: String?, completionHandler: @escaping (ASAuthorizationAppleIDCredential?, Error?) -> Void) + func getSignInWithAppleUpgradeAuthorization(state: String?, nonce: String?) async throws -> ASAuthorizationAppleIDCredential? func completeUpgradeToSignInWithApple(userInfo: [AnyHashable : Any]? = nil) func completeChangePasswordRequest(updatedCredential: ASPasswordCredential, userInfo: [AnyHashable : Any]? = nil) } diff --git a/iOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift b/iOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift index 8feca12..2d144f9 100644 --- a/iOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift +++ b/iOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift @@ -16,4 +16,5 @@ extension ASAuthorizationAppleIDProvider { class ASAuthorizationAppleIDProvider : NSObject, ASAuthorizationProvider { func createRequest() -> ASAuthorizationAppleIDRequest func getCredentialState(forUserID userID: String, completion: @escaping (ASAuthorizationAppleIDProvider.CredentialState, Error?) -> Void) + func getCredentialState(forUserID userID: String) async throws -> ASAuthorizationAppleIDProvider.CredentialState } diff --git a/iOS/AuthenticationServices/ASAuthorizationController.swift b/iOS/AuthenticationServices/ASAuthorizationController.swift index 9246547..027a7a6 100644 --- a/iOS/AuthenticationServices/ASAuthorizationController.swift +++ b/iOS/AuthenticationServices/ASAuthorizationController.swift @@ -1,8 +1,8 @@ @available(iOS 13.0, *) protocol ASAuthorizationControllerDelegate : NSObjectProtocol { - optional func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) - optional func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) + @asyncHandler optional func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) + @asyncHandler optional func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) } @available(iOS 13.0, *) protocol ASAuthorizationControllerPresentationContextProviding : NSObjectProtocol { diff --git a/iOS/AuthenticationServices/ASAuthorizationProviderExtensionAuthorizationRequest.swift b/iOS/AuthenticationServices/ASAuthorizationProviderExtensionAuthorizationRequest.swift index 54475f9..f46b8ae 100644 --- a/iOS/AuthenticationServices/ASAuthorizationProviderExtensionAuthorizationRequest.swift +++ b/iOS/AuthenticationServices/ASAuthorizationProviderExtensionAuthorizationRequest.swift @@ -24,6 +24,7 @@ class ASAuthorizationProviderExtensionAuthorizationRequest : NSObject { func complete(httpResponse: HTTPURLResponse, httpBody: Data?) func complete(error: Error) func presentAuthorizationViewController(completion: @escaping (Bool, Error?) -> Void) + func presentAuthorizationViewController() async throws -> Bool var url: URL { get } var requestedOperation: ASAuthorizationProviderAuthorizationOperation { get } var httpHeaders: [String : String] { get } diff --git a/iOS/AuthenticationServices/ASCredentialIdentityStore.swift b/iOS/AuthenticationServices/ASCredentialIdentityStore.swift index afea9df..055ceca 100644 --- a/iOS/AuthenticationServices/ASCredentialIdentityStore.swift +++ b/iOS/AuthenticationServices/ASCredentialIdentityStore.swift @@ -14,8 +14,13 @@ struct ASCredentialIdentityStoreError : _BridgedStoredNSError { class ASCredentialIdentityStore : NSObject { class var shared: ASCredentialIdentityStore { get } func getState(_ completion: @escaping (ASCredentialIdentityStoreState) -> Void) + func getState() async -> ASCredentialIdentityStoreState func saveCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity], completion: ((Bool, Error?) -> Void)? = nil) + func saveCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool func removeCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity], completion: ((Bool, Error?) -> Void)? = nil) + func removeCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool func removeAllCredentialIdentities(_ completion: ((Bool, Error?) -> Void)? = nil) + func removeAllCredentialIdentities() async throws -> Bool func replaceCredentialIdentities(with newCredentialIdentities: [ASPasswordCredentialIdentity], completion: ((Bool, Error?) -> Void)? = nil) + func replaceCredentialIdentities(with newCredentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool } diff --git a/iOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift b/iOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift index 4ce8dd3..ac01301 100644 --- a/iOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift +++ b/iOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift @@ -2,5 +2,6 @@ @available(iOS 12.0, *) class ASCredentialProviderExtensionContext : NSExtensionContext { func completeRequest(withSelectedCredential credential: ASPasswordCredential, completionHandler: ((Bool) -> Void)? = nil) + func completeRequest(withSelectedCredential credential: ASPasswordCredential) async -> Bool func completeExtensionConfigurationRequest() } diff --git a/iOS/AutomaticAssessmentConfiguration/AutomaticAssessmentConfiguration.swift b/iOS/AutomaticAssessmentConfiguration/AutomaticAssessmentConfiguration.swift index 507d64e..ebe31b6 100644 --- a/iOS/AutomaticAssessmentConfiguration/AutomaticAssessmentConfiguration.swift +++ b/iOS/AutomaticAssessmentConfiguration/AutomaticAssessmentConfiguration.swift @@ -39,10 +39,10 @@ class AEAssessmentSession : NSObject { } @available(iOS 13.4, *) protocol AEAssessmentSessionDelegate : NSObjectProtocol { - optional func assessmentSessionDidBegin(_ session: AEAssessmentSession) + @asyncHandler optional func assessmentSessionDidBegin(_ session: AEAssessmentSession) optional func assessmentSession(_ session: AEAssessmentSession, failedToBeginWithError error: Error) optional func assessmentSession(_ session: AEAssessmentSession, wasInterruptedWithError error: Error) - optional func assessmentSessionDidEnd(_ session: AEAssessmentSession) + @asyncHandler optional func assessmentSessionDidEnd(_ session: AEAssessmentSession) } @available(iOS 13.4, *) let AEAssessmentErrorDomain: String diff --git a/iOS/BackgroundTasks/BGTaskScheduler.swift b/iOS/BackgroundTasks/BGTaskScheduler.swift index fe4ee5d..1129d30 100644 --- a/iOS/BackgroundTasks/BGTaskScheduler.swift +++ b/iOS/BackgroundTasks/BGTaskScheduler.swift @@ -20,4 +20,5 @@ class BGTaskScheduler : NSObject { func cancel(taskRequestWithIdentifier identifier: String) func cancelAllTaskRequests() func getPendingTaskRequests(completionHandler: @escaping ([BGTaskRequest]) -> Void) + func getPendingTaskRequests() async -> [BGTaskRequest] } diff --git a/iOS/CallKit/CXCallController.swift b/iOS/CallKit/CXCallController.swift index af8c7e3..c48876d 100644 --- a/iOS/CallKit/CXCallController.swift +++ b/iOS/CallKit/CXCallController.swift @@ -4,8 +4,13 @@ class CXCallController : NSObject { init(queue: DispatchQueue) var callObserver: CXCallObserver { get } func request(_ transaction: CXTransaction, completion: @escaping (Error?) -> Void) + func request(_ transaction: CXTransaction) async throws @available(iOS 11.0, *) func requestTransaction(with actions: [CXAction], completion: @escaping (Error?) -> Void) @available(iOS 11.0, *) + func requestTransaction(with actions: [CXAction]) async throws + @available(iOS 11.0, *) func requestTransaction(with action: CXAction, completion: @escaping (Error?) -> Void) + @available(iOS 11.0, *) + func requestTransaction(with action: CXAction) async throws } diff --git a/iOS/CallKit/CXCallDirectoryExtensionContext.swift b/iOS/CallKit/CXCallDirectoryExtensionContext.swift index d7866c7..188ef16 100644 --- a/iOS/CallKit/CXCallDirectoryExtensionContext.swift +++ b/iOS/CallKit/CXCallDirectoryExtensionContext.swift @@ -19,4 +19,5 @@ class CXCallDirectoryExtensionContext : NSExtensionContext { @available(iOS 11.0, *) func removeAllIdentificationEntries() func completeRequest(completionHandler completion: ((Bool) -> Void)? = nil) + func completeRequest() async -> Bool } diff --git a/iOS/CallKit/CXCallDirectoryManager.swift b/iOS/CallKit/CXCallDirectoryManager.swift index 528f7d7..8bb17c1 100644 --- a/iOS/CallKit/CXCallDirectoryManager.swift +++ b/iOS/CallKit/CXCallDirectoryManager.swift @@ -13,7 +13,11 @@ extension CXCallDirectoryManager { class CXCallDirectoryManager : NSObject { class var sharedInstance: CXCallDirectoryManager { get } func reloadExtension(withIdentifier identifier: String, completionHandler completion: ((Error?) -> Void)? = nil) + func reloadExtension(withIdentifier identifier: String) async throws func getEnabledStatusForExtension(withIdentifier identifier: String, completionHandler completion: @escaping (CXCallDirectoryManager.EnabledStatus, Error?) -> Void) + func getEnabledStatusForExtension(withIdentifier identifier: String) async throws -> CXCallDirectoryManager.EnabledStatus @available(iOS 13.4, *) func openSettings(completionHandler completion: ((Error?) -> Void)? = nil) + @available(iOS 13.4, *) + func openSettings() async throws } diff --git a/iOS/CallKit/CXProvider.swift b/iOS/CallKit/CXProvider.swift index c6e07da..aee0802 100644 --- a/iOS/CallKit/CXProvider.swift +++ b/iOS/CallKit/CXProvider.swift @@ -11,8 +11,8 @@ enum CXCallEndedReason : Int { } @available(iOS 10.0, *) protocol CXProviderDelegate : NSObjectProtocol { - func providerDidReset(_ provider: CXProvider) - optional func providerDidBegin(_ provider: CXProvider) + @asyncHandler func providerDidReset(_ provider: CXProvider) + @asyncHandler optional func providerDidBegin(_ provider: CXProvider) optional func provider(_ provider: CXProvider, execute transaction: CXTransaction) -> Bool optional func provider(_ provider: CXProvider, perform action: CXStartCallAction) optional func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) @@ -28,6 +28,7 @@ class CXProvider : NSObject { init(configuration: CXProviderConfiguration) func setDelegate(_ delegate: CXProviderDelegate?, queue: DispatchQueue?) func reportNewIncomingCall(with UUID: UUID, update: CXCallUpdate, completion: @escaping (Error?) -> Void) + func reportNewIncomingCall(with UUID: UUID, update: CXCallUpdate) async throws func reportCall(with UUID: UUID, updated update: CXCallUpdate) func reportCall(with UUID: UUID, endedAt dateEnded: Date?, reason endedReason: CXCallEndedReason) func reportOutgoingCall(with UUID: UUID, startedConnectingAt dateStartedConnecting: Date?) diff --git a/iOS/CarPlay/CPInterfaceController.swift b/iOS/CarPlay/CPInterfaceController.swift index 348ba0b..9b9dcbf 100644 --- a/iOS/CarPlay/CPInterfaceController.swift +++ b/iOS/CarPlay/CPInterfaceController.swift @@ -8,17 +8,31 @@ class CPInterfaceController : NSObject { @available(iOS 14.0, *) func setRootTemplate(_ rootTemplate: CPTemplate, animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) + func setRootTemplate(_ rootTemplate: CPTemplate, animated: Bool) async throws -> Bool + @available(iOS 14.0, *) func pushTemplate(_ templateToPush: CPTemplate, animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) + func pushTemplate(_ templateToPush: CPTemplate, animated: Bool) async throws -> Bool + @available(iOS 14.0, *) func popTemplate(animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) + func popTemplate(animated: Bool) async throws -> Bool + @available(iOS 14.0, *) func popToRootTemplate(animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) + func popToRootTemplate(animated: Bool) async throws -> Bool + @available(iOS 14.0, *) func pop(to targetTemplate: CPTemplate, animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) + func pop(to targetTemplate: CPTemplate, animated: Bool) async throws -> Bool + @available(iOS 14.0, *) func presentTemplate(_ templateToPresent: CPTemplate, animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) + func presentTemplate(_ templateToPresent: CPTemplate, animated: Bool) async throws -> Bool + @available(iOS 14.0, *) func dismissTemplate(animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) + @available(iOS 14.0, *) + func dismissTemplate(animated: Bool) async throws -> Bool var presentedTemplate: CPTemplate? { get } var rootTemplate: CPTemplate { get } var topTemplate: CPTemplate? { get } @@ -43,14 +57,14 @@ class CPInterfaceController : NSObject { @available(iOS 12.0, *) protocol CPInterfaceControllerDelegate : NSObjectProtocol { optional func templateWillAppear(_ aTemplate: CPTemplate, animated: Bool) - optional func templateDidAppear(_ aTemplate: CPTemplate, animated: Bool) + @asyncHandler optional func templateDidAppear(_ aTemplate: CPTemplate, animated: Bool) optional func templateWillDisappear(_ aTemplate: CPTemplate, animated: Bool) - optional func templateDidDisappear(_ aTemplate: CPTemplate, animated: Bool) + @asyncHandler optional func templateDidDisappear(_ aTemplate: CPTemplate, animated: Bool) } @available(iOS, introduced: 12.0, deprecated: 13.0) protocol CPApplicationDelegate : UIApplicationDelegate { - func application(_ application: UIApplication, didConnectCarInterfaceController interfaceController: CPInterfaceController, to window: CPWindow) - func application(_ application: UIApplication, didDisconnectCarInterfaceController interfaceController: CPInterfaceController, from window: CPWindow) - optional func application(_ application: UIApplication, didSelect navigationAlert: CPNavigationAlert) - optional func application(_ application: UIApplication, didSelect maneuver: CPManeuver) + @asyncHandler func application(_ application: UIApplication, didConnectCarInterfaceController interfaceController: CPInterfaceController, to window: CPWindow) + @asyncHandler func application(_ application: UIApplication, didDisconnectCarInterfaceController interfaceController: CPInterfaceController, from window: CPWindow) + @asyncHandler optional func application(_ application: UIApplication, didSelect navigationAlert: CPNavigationAlert) + @asyncHandler optional func application(_ application: UIApplication, didSelect maneuver: CPManeuver) } diff --git a/iOS/CarPlay/CPListTemplate.swift b/iOS/CarPlay/CPListTemplate.swift index 713daaa..fe015f4 100644 --- a/iOS/CarPlay/CPListTemplate.swift +++ b/iOS/CarPlay/CPListTemplate.swift @@ -25,5 +25,7 @@ class CPListTemplate : CPTemplate, CPBarButtonProviding { @available(iOS, introduced: 12.0, deprecated: 14.0) protocol CPListTemplateDelegate : NSObjectProtocol { @available(iOS, introduced: 12.0, deprecated: 14.0) - func listTemplate(_ listTemplate: CPListTemplate, didSelect item: CPListItem, completionHandler: @escaping () -> Void) + @asyncHandler func listTemplate(_ listTemplate: CPListTemplate, didSelect item: CPListItem, completionHandler: @escaping () -> Void) + @available(iOS, introduced: 12.0, deprecated: 14.0) + func listTemplate(_ listTemplate: CPListTemplate, didSelect item: CPListItem) async } diff --git a/iOS/CarPlay/CPMapTemplate.swift b/iOS/CarPlay/CPMapTemplate.swift index f34aa76..29e3e14 100644 --- a/iOS/CarPlay/CPMapTemplate.swift +++ b/iOS/CarPlay/CPMapTemplate.swift @@ -57,27 +57,28 @@ class CPMapTemplate : CPTemplate, CPBarButtonProviding { var currentNavigationAlert: CPNavigationAlert? { get } func present(navigationAlert: CPNavigationAlert, animated: Bool) func dismissNavigationAlert(animated: Bool, completion: @escaping (Bool) -> Void) + func dismissNavigationAlert(animated: Bool) async -> Bool } @available(iOS 12.0, *) protocol CPMapTemplateDelegate : NSObjectProtocol { optional func mapTemplate(_ mapTemplate: CPMapTemplate, shouldShowNotificationFor maneuver: CPManeuver) -> Bool optional func mapTemplate(_ mapTemplate: CPMapTemplate, shouldUpdateNotificationFor maneuver: CPManeuver, with travelEstimates: CPTravelEstimates) -> Bool optional func mapTemplate(_ mapTemplate: CPMapTemplate, shouldShowNotificationFor navigationAlert: CPNavigationAlert) -> Bool - optional func mapTemplateDidShowPanningInterface(_ mapTemplate: CPMapTemplate) + @asyncHandler optional func mapTemplateDidShowPanningInterface(_ mapTemplate: CPMapTemplate) optional func mapTemplateWillDismissPanningInterface(_ mapTemplate: CPMapTemplate) - optional func mapTemplateDidDismissPanningInterface(_ mapTemplate: CPMapTemplate) + @asyncHandler optional func mapTemplateDidDismissPanningInterface(_ mapTemplate: CPMapTemplate) optional func mapTemplate(_ mapTemplate: CPMapTemplate, panBeganWith direction: CPMapTemplate.PanDirection) optional func mapTemplate(_ mapTemplate: CPMapTemplate, panEndedWith direction: CPMapTemplate.PanDirection) optional func mapTemplate(_ mapTemplate: CPMapTemplate, panWith direction: CPMapTemplate.PanDirection) - optional func mapTemplateDidBeginPanGesture(_ mapTemplate: CPMapTemplate) - optional func mapTemplate(_ mapTemplate: CPMapTemplate, didUpdatePanGestureWithTranslation translation: CGPoint, velocity: CGPoint) - optional func mapTemplate(_ mapTemplate: CPMapTemplate, didEndPanGestureWithVelocity velocity: CGPoint) + @asyncHandler optional func mapTemplateDidBeginPanGesture(_ mapTemplate: CPMapTemplate) + @asyncHandler optional func mapTemplate(_ mapTemplate: CPMapTemplate, didUpdatePanGestureWithTranslation translation: CGPoint, velocity: CGPoint) + @asyncHandler optional func mapTemplate(_ mapTemplate: CPMapTemplate, didEndPanGestureWithVelocity velocity: CGPoint) optional func mapTemplate(_ mapTemplate: CPMapTemplate, willShow navigationAlert: CPNavigationAlert) - optional func mapTemplate(_ mapTemplate: CPMapTemplate, didShow navigationAlert: CPNavigationAlert) + @asyncHandler optional func mapTemplate(_ mapTemplate: CPMapTemplate, didShow navigationAlert: CPNavigationAlert) optional func mapTemplate(_ mapTemplate: CPMapTemplate, willDismiss navigationAlert: CPNavigationAlert, dismissalContext: CPNavigationAlert.DismissalContext) - optional func mapTemplate(_ mapTemplate: CPMapTemplate, didDismiss navigationAlert: CPNavigationAlert, dismissalContext: CPNavigationAlert.DismissalContext) + @asyncHandler optional func mapTemplate(_ mapTemplate: CPMapTemplate, didDismiss navigationAlert: CPNavigationAlert, dismissalContext: CPNavigationAlert.DismissalContext) optional func mapTemplate(_ mapTemplate: CPMapTemplate, selectedPreviewFor trip: CPTrip, using routeChoice: CPRouteChoice) optional func mapTemplate(_ mapTemplate: CPMapTemplate, startedTrip trip: CPTrip, using routeChoice: CPRouteChoice) - optional func mapTemplateDidCancelNavigation(_ mapTemplate: CPMapTemplate) + @asyncHandler optional func mapTemplateDidCancelNavigation(_ mapTemplate: CPMapTemplate) optional func mapTemplate(_ mapTemplate: CPMapTemplate, displayStyleFor maneuver: CPManeuver) -> CPManeuverDisplayStyle } diff --git a/iOS/CarPlay/CPPointOfInterestTemplate.swift b/iOS/CarPlay/CPPointOfInterestTemplate.swift index a116eaa..3d4cd88 100644 --- a/iOS/CarPlay/CPPointOfInterestTemplate.swift +++ b/iOS/CarPlay/CPPointOfInterestTemplate.swift @@ -1,8 +1,8 @@ @available(iOS 14.0, *) protocol CPPointOfInterestTemplateDelegate : NSObjectProtocol { - func pointOfInterestTemplate(_ pointOfInterestTemplate: CPPointOfInterestTemplate, didChangeMapRegion region: MKCoordinateRegion) - optional func pointOfInterestTemplate(_ pointOfInterestTemplate: CPPointOfInterestTemplate, didSelectPointOfInterest pointOfInterest: CPPointOfInterest) + @asyncHandler func pointOfInterestTemplate(_ pointOfInterestTemplate: CPPointOfInterestTemplate, didChangeMapRegion region: MKCoordinateRegion) + @asyncHandler optional func pointOfInterestTemplate(_ pointOfInterestTemplate: CPPointOfInterestTemplate, didSelectPointOfInterest pointOfInterest: CPPointOfInterest) } @available(iOS 14.0, *) class CPPointOfInterestTemplate : CPTemplate { diff --git a/iOS/CarPlay/CPSearchTemplate.swift b/iOS/CarPlay/CPSearchTemplate.swift index ab20cd7..510e6cc 100644 --- a/iOS/CarPlay/CPSearchTemplate.swift +++ b/iOS/CarPlay/CPSearchTemplate.swift @@ -6,6 +6,8 @@ class CPSearchTemplate : CPTemplate { @available(iOS 12.0, *) protocol CPSearchTemplateDelegate : NSObjectProtocol { func searchTemplate(_ searchTemplate: CPSearchTemplate, updatedSearchText searchText: String, completionHandler: @escaping ([CPListItem]) -> Void) + func searchTemplate(_ searchTemplate: CPSearchTemplate, updatedSearchText searchText: String) async -> [CPListItem] func searchTemplate(_ searchTemplate: CPSearchTemplate, selectedResult item: CPListItem, completionHandler: @escaping () -> Void) + func searchTemplate(_ searchTemplate: CPSearchTemplate, selectedResult item: CPListItem) async optional func searchTemplateSearchButtonPressed(_ searchTemplate: CPSearchTemplate) } diff --git a/iOS/CarPlay/CPTabBarTemplate.swift b/iOS/CarPlay/CPTabBarTemplate.swift index d46656e..296216f 100644 --- a/iOS/CarPlay/CPTabBarTemplate.swift +++ b/iOS/CarPlay/CPTabBarTemplate.swift @@ -10,5 +10,5 @@ class CPTabBarTemplate : CPTemplate { } @available(iOS 14.0, *) protocol CPTabBarTemplateDelegate : NSObjectProtocol { - func tabBarTemplate(_ tabBarTemplate: CPTabBarTemplate, didSelect selectedTemplate: CPTemplate) + @asyncHandler func tabBarTemplate(_ tabBarTemplate: CPTabBarTemplate, didSelect selectedTemplate: CPTemplate) } diff --git a/iOS/CarPlay/CPTemplateApplicationDashboardScene.swift b/iOS/CarPlay/CPTemplateApplicationDashboardScene.swift index 4c492b0..cff8229 100644 --- a/iOS/CarPlay/CPTemplateApplicationDashboardScene.swift +++ b/iOS/CarPlay/CPTemplateApplicationDashboardScene.swift @@ -1,8 +1,8 @@ @available(iOS 13.4, *) protocol CPTemplateApplicationDashboardSceneDelegate : UISceneDelegate { - optional func templateApplicationDashboardScene(_ templateApplicationDashboardScene: CPTemplateApplicationDashboardScene, didConnect dashboardController: CPDashboardController, to window: UIWindow) - optional func templateApplicationDashboardScene(_ templateApplicationDashboardScene: CPTemplateApplicationDashboardScene, didDisconnect dashboardController: CPDashboardController, from window: UIWindow) + @asyncHandler optional func templateApplicationDashboardScene(_ templateApplicationDashboardScene: CPTemplateApplicationDashboardScene, didConnect dashboardController: CPDashboardController, to window: UIWindow) + @asyncHandler optional func templateApplicationDashboardScene(_ templateApplicationDashboardScene: CPTemplateApplicationDashboardScene, didDisconnect dashboardController: CPDashboardController, from window: UIWindow) } @available(iOS 13.4, *) class CPTemplateApplicationDashboardScene : UIScene { diff --git a/iOS/CarPlay/CPTemplateApplicationScene.swift b/iOS/CarPlay/CPTemplateApplicationScene.swift index 3bf1b14..c67ef89 100644 --- a/iOS/CarPlay/CPTemplateApplicationScene.swift +++ b/iOS/CarPlay/CPTemplateApplicationScene.swift @@ -1,14 +1,14 @@ @available(iOS 13.0, *) protocol CPTemplateApplicationSceneDelegate : UISceneDelegate { - optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didConnect interfaceController: CPInterfaceController, to window: CPWindow) + @asyncHandler optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didConnect interfaceController: CPInterfaceController, to window: CPWindow) @available(iOS 14.0, *) - optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didConnect interfaceController: CPInterfaceController) - optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didDisconnect interfaceController: CPInterfaceController, from window: CPWindow) + @asyncHandler optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didConnect interfaceController: CPInterfaceController) + @asyncHandler optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didDisconnect interfaceController: CPInterfaceController, from window: CPWindow) @available(iOS 14.0, *) - optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didDisconnectInterfaceController interfaceController: CPInterfaceController) - optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didSelect navigationAlert: CPNavigationAlert) - optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didSelect maneuver: CPManeuver) + @asyncHandler optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didDisconnectInterfaceController interfaceController: CPInterfaceController) + @asyncHandler optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didSelect navigationAlert: CPNavigationAlert) + @asyncHandler optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didSelect maneuver: CPManeuver) } @available(iOS 13.0, *) class CPTemplateApplicationScene : UIScene { diff --git a/iOS/ClassKit/CLSContext.swift b/iOS/ClassKit/CLSContext.swift index 436063f..ee3eaa4 100644 --- a/iOS/ClassKit/CLSContext.swift +++ b/iOS/ClassKit/CLSContext.swift @@ -89,4 +89,5 @@ extension CLSContext { func removeFromParent() func addChildContext(_ child: CLSContext) func descendant(matchingIdentifierPath identifierPath: [String], completion: @escaping (CLSContext?, Error?) -> Void) + func descendant(matchingIdentifierPath identifierPath: [String]) async throws -> CLSContext? } diff --git a/iOS/ClassKit/CLSContextProvider.swift b/iOS/ClassKit/CLSContextProvider.swift index 12a190e..c2ff932 100644 --- a/iOS/ClassKit/CLSContextProvider.swift +++ b/iOS/ClassKit/CLSContextProvider.swift @@ -2,4 +2,5 @@ @available(iOS 12.2, *) protocol CLSContextProvider { func updateDescendants(of context: CLSContext, completion: @escaping (Error?) -> Void) + func updateDescendants(of context: CLSContext) async throws } diff --git a/iOS/ClassKit/CLSDataStore.swift b/iOS/ClassKit/CLSDataStore.swift index b475be3..e626453 100644 --- a/iOS/ClassKit/CLSDataStore.swift +++ b/iOS/ClassKit/CLSDataStore.swift @@ -11,12 +11,15 @@ class CLSDataStore : NSObject { var runningActivity: CLSActivity? { get } weak var delegate: @sil_weak CLSDataStoreDelegate? func save(completion: ((Error?) -> Void)? = nil) + func save() async throws @available(iOS 12.2, *) func completeAllAssignedActivities(matching contextPath: [String]) } @available(iOS 11.3, *) extension CLSDataStore { func contexts(matching predicate: NSPredicate, completion: @escaping ([CLSContext], Error?) -> Void) + func contexts(matching predicate: NSPredicate) async throws -> [CLSContext] func contexts(matchingIdentifierPath identifierPath: [String], completion: @escaping ([CLSContext], Error?) -> Void) + func contexts(matchingIdentifierPath identifierPath: [String]) async throws -> [CLSContext] func remove(_ context: CLSContext) } diff --git a/iOS/ClockKit/CLKWatchFaceLibrary.swift b/iOS/ClockKit/CLKWatchFaceLibrary.swift index a5893c8..ea5a12d 100644 --- a/iOS/ClockKit/CLKWatchFaceLibrary.swift +++ b/iOS/ClockKit/CLKWatchFaceLibrary.swift @@ -15,4 +15,5 @@ extension CLKWatchFaceLibrary { @available(iOS 14.0, *) class CLKWatchFaceLibrary : NSObject { func addWatchFace(at fileURL: URL, completionHandler handler: @escaping (Error?) -> Void) + func addWatchFace(at fileURL: URL) async throws } diff --git a/iOS/CloudKit/CKContainer.swift b/iOS/CloudKit/CKContainer.swift index d564da8..476ae2d 100644 --- a/iOS/CloudKit/CKContainer.swift +++ b/iOS/CloudKit/CKContainer.swift @@ -51,6 +51,7 @@ extension NSNotification.Name { } extension CKContainer { func accountStatus(completionHandler: @escaping (CKAccountStatus, Error?) -> Void) + func accountStatus() async throws -> CKAccountStatus } @available(iOS 8.0, *) struct CKContainer_Application_Permissions : OptionSet { @@ -70,34 +71,59 @@ enum CKContainer_Application_PermissionStatus : Int { typealias CKContainer_Application_PermissionBlock = (CKContainer_Application_PermissionStatus, Error?) -> Void extension CKContainer { func status(forApplicationPermission applicationPermission: CKContainer_Application_Permissions, completionHandler: @escaping CKContainer_Application_PermissionBlock) + func status(forApplicationPermission applicationPermission: CKContainer_Application_Permissions) async throws -> CKContainer_Application_PermissionStatus func requestApplicationPermission(_ applicationPermission: CKContainer_Application_Permissions, completionHandler: @escaping CKContainer_Application_PermissionBlock) + func requestApplicationPermission(_ applicationPermission: CKContainer_Application_Permissions) async throws -> CKContainer_Application_PermissionStatus } extension CKContainer { func fetchUserRecordID(completionHandler: @escaping (CKRecord.ID?, Error?) -> Void) + func fetchUserRecordID() async throws -> CKRecord.ID? @available(iOS 10.0, *) func discoverAllIdentities(completionHandler: @escaping ([CKUserIdentity]?, Error?) -> Void) @available(iOS 10.0, *) + func discoverAllIdentities() async throws -> [CKUserIdentity]? + @available(iOS 10.0, *) func discoverUserIdentity(withEmailAddress email: String, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(iOS 10.0, *) + func discoverUserIdentity(withEmailAddress email: String) async throws -> CKUserIdentity? + @available(iOS 10.0, *) func discoverUserIdentity(withPhoneNumber phoneNumber: String, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(iOS 10.0, *) + func discoverUserIdentity(withPhoneNumber phoneNumber: String) async throws -> CKUserIdentity? + @available(iOS 10.0, *) func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) + @available(iOS 10.0, *) + func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKUserIdentity? } extension CKContainer { @available(iOS 10.0, *) func fetchShareParticipant(withEmailAddress emailAddress: String, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(iOS 10.0, *) + func fetchShareParticipant(withEmailAddress emailAddress: String) async throws -> CKShare.Participant? + @available(iOS 10.0, *) func fetchShareParticipant(withPhoneNumber phoneNumber: String, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(iOS 10.0, *) + func fetchShareParticipant(withPhoneNumber phoneNumber: String) async throws -> CKShare.Participant? + @available(iOS 10.0, *) func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(iOS 10.0, *) + func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKShare.Participant? + @available(iOS 10.0, *) func fetchShareMetadata(with url: URL, completionHandler: @escaping (CKShare.Metadata?, Error?) -> Void) @available(iOS 10.0, *) + func fetchShareMetadata(with url: URL) async throws -> CKShare.Metadata? + @available(iOS 10.0, *) func accept(_ metadata: CKShare.Metadata, completionHandler: @escaping (CKShare?, Error?) -> Void) + @available(iOS 10.0, *) + func accept(_ metadata: CKShare.Metadata) async throws -> CKShare? } extension CKContainer { @available(iOS 9.3, *) func __fetchAllLongLivedOperationIDs(completionHandler: @escaping ([String]?, Error?) -> Void) @available(iOS 9.3, *) + func __fetchAllLongLivedOperationIDs() async throws -> [String]? + @available(iOS 9.3, *) func __fetchLongLivedOperation(withID operationID: String, completionHandler: @escaping (CKOperation?, Error?) -> Void) + @available(iOS 9.3, *) + func __fetchLongLivedOperation(withID operationID: String) async throws -> CKOperation? } diff --git a/iOS/CloudKit/CKDatabase.swift b/iOS/CloudKit/CKDatabase.swift index 3aba93c..5d84ac0 100644 --- a/iOS/CloudKit/CKDatabase.swift +++ b/iOS/CloudKit/CKDatabase.swift @@ -25,19 +25,35 @@ class CKDatabase : NSObject { } extension CKDatabase { func fetch(withRecordID recordID: CKRecord.ID, completionHandler: @escaping (CKRecord?, Error?) -> Void) + func fetch(withRecordID recordID: CKRecord.ID) async throws -> CKRecord? func save(_ record: CKRecord, completionHandler: @escaping (CKRecord?, Error?) -> Void) + func save(_ record: CKRecord) async throws -> CKRecord? func delete(withRecordID recordID: CKRecord.ID, completionHandler: @escaping (CKRecord.ID?, Error?) -> Void) + func delete(withRecordID recordID: CKRecord.ID) async throws -> CKRecord.ID? func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?, completionHandler: @escaping ([CKRecord]?, Error?) -> Void) + func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?) async throws -> [CKRecord]? func fetchAllRecordZones(completionHandler: @escaping ([CKRecordZone]?, Error?) -> Void) + func fetchAllRecordZones() async throws -> [CKRecordZone]? func fetch(withRecordZoneID zoneID: CKRecordZone.ID, completionHandler: @escaping (CKRecordZone?, Error?) -> Void) + func fetch(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone? func save(_ zone: CKRecordZone, completionHandler: @escaping (CKRecordZone?, Error?) -> Void) + func save(_ zone: CKRecordZone) async throws -> CKRecordZone? func delete(withRecordZoneID zoneID: CKRecordZone.ID, completionHandler: @escaping (CKRecordZone.ID?, Error?) -> Void) + func delete(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone.ID? @available(iOS 8.0, *) func __fetch(withSubscriptionID subscriptionID: String, completionHandler: @escaping (CKSubscription?, Error?) -> Void) @available(iOS 8.0, *) + func __fetch(withSubscriptionID subscriptionID: String) async throws -> CKSubscription? + @available(iOS 8.0, *) func fetchAllSubscriptions(completionHandler: @escaping ([CKSubscription]?, Error?) -> Void) @available(iOS 8.0, *) + func fetchAllSubscriptions() async throws -> [CKSubscription]? + @available(iOS 8.0, *) func save(_ subscription: CKSubscription, completionHandler: @escaping (CKSubscription?, Error?) -> Void) @available(iOS 8.0, *) + func save(_ subscription: CKSubscription) async throws -> CKSubscription? + @available(iOS 8.0, *) func __delete(withSubscriptionID subscriptionID: String, completionHandler: @escaping (String?, Error?) -> Void) + @available(iOS 8.0, *) + func __delete(withSubscriptionID subscriptionID: String) async throws -> String? } diff --git a/iOS/Contacts/CNContactStore.swift b/iOS/Contacts/CNContactStore.swift index 34eac4a..8d190a2 100644 --- a/iOS/Contacts/CNContactStore.swift +++ b/iOS/Contacts/CNContactStore.swift @@ -18,6 +18,7 @@ enum CNAuthorizationStatus : Int { class CNContactStore : NSObject { class func authorizationStatus(for entityType: CNEntityType) -> CNAuthorizationStatus func requestAccess(for entityType: CNEntityType, completionHandler: @escaping (Bool, Error?) -> Void) + func requestAccess(for entityType: CNEntityType) async throws -> Bool func unifiedContacts(matching predicate: NSPredicate, keysToFetch keys: [CNKeyDescriptor]) throws -> [CNContact] func unifiedContact(withIdentifier identifier: String, keysToFetch keys: [CNKeyDescriptor]) throws -> CNContact func enumerateContacts(with fetchRequest: CNContactFetchRequest, usingBlock block: @escaping (CNContact, UnsafeMutablePointer) -> Void) throws diff --git a/iOS/ContactsUI/CNContactPickerViewController.swift b/iOS/ContactsUI/CNContactPickerViewController.swift index 4dcc7d9..f82d1d3 100644 --- a/iOS/ContactsUI/CNContactPickerViewController.swift +++ b/iOS/ContactsUI/CNContactPickerViewController.swift @@ -9,9 +9,9 @@ class CNContactPickerViewController : UIViewController { } @available(iOS 9.0, *) protocol CNContactPickerDelegate : NSObjectProtocol { - optional func contactPickerDidCancel(_ picker: CNContactPickerViewController) - optional func contactPicker(_ picker: CNContactPickerViewController, didSelect contact: CNContact) - optional func contactPicker(_ picker: CNContactPickerViewController, didSelect contactProperty: CNContactProperty) - optional func contactPicker(_ picker: CNContactPickerViewController, didSelect contacts: [CNContact]) - optional func contactPicker(_ picker: CNContactPickerViewController, didSelectContactProperties contactProperties: [CNContactProperty]) + @asyncHandler optional func contactPickerDidCancel(_ picker: CNContactPickerViewController) + @asyncHandler optional func contactPicker(_ picker: CNContactPickerViewController, didSelect contact: CNContact) + @asyncHandler optional func contactPicker(_ picker: CNContactPickerViewController, didSelect contactProperty: CNContactProperty) + @asyncHandler optional func contactPicker(_ picker: CNContactPickerViewController, didSelect contacts: [CNContact]) + @asyncHandler optional func contactPicker(_ picker: CNContactPickerViewController, didSelectContactProperties contactProperties: [CNContactProperty]) } diff --git a/iOS/ContactsUI/CNContactViewController.swift b/iOS/ContactsUI/CNContactViewController.swift index edef8b8..dbc4bdc 100644 --- a/iOS/ContactsUI/CNContactViewController.swift +++ b/iOS/ContactsUI/CNContactViewController.swift @@ -21,5 +21,5 @@ class CNContactViewController : UIViewController { @available(iOS 9.0, *) protocol CNContactViewControllerDelegate : NSObjectProtocol { optional func contactViewController(_ viewController: CNContactViewController, shouldPerformDefaultActionFor property: CNContactProperty) -> Bool - optional func contactViewController(_ viewController: CNContactViewController, didCompleteWith contact: CNContact?) + @asyncHandler optional func contactViewController(_ viewController: CNContactViewController, didCompleteWith contact: CNContact?) } diff --git a/iOS/CoreAudioKit/AUViewController.swift b/iOS/CoreAudioKit/AUViewController.swift index 27b1667..41091d9 100644 --- a/iOS/CoreAudioKit/AUViewController.swift +++ b/iOS/CoreAudioKit/AUViewController.swift @@ -12,6 +12,7 @@ class AUAudioUnitViewConfiguration : NSObject, NSSecureCoding { @available(iOS 9.0, *) extension AUAudioUnit { func requestViewController(completionHandler: @escaping (UIViewController?) -> Void) + func requestViewController() async -> UIViewController? @available(iOS 11.0, *) func supportedViewConfigurations(_ availableViewConfigurations: [AUAudioUnitViewConfiguration]) -> IndexSet @available(iOS 11.0, *) diff --git a/iOS/CoreBluetooth/CBCentralManager.swift b/iOS/CoreBluetooth/CBCentralManager.swift index 73465bd..d4187f5 100644 --- a/iOS/CoreBluetooth/CBCentralManager.swift +++ b/iOS/CoreBluetooth/CBCentralManager.swift @@ -47,19 +47,19 @@ class CBCentralManager : CBManager { } protocol CBCentralManagerDelegate : NSObjectProtocol { @available(iOS 5.0, *) - func centralManagerDidUpdateState(_ central: CBCentralManager) + @asyncHandler func centralManagerDidUpdateState(_ central: CBCentralManager) @available(iOS 5.0, *) optional func centralManager(_ central: CBCentralManager, willRestoreState dict: [String : Any]) @available(iOS 5.0, *) - optional func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) + @asyncHandler optional func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) @available(iOS 5.0, *) - optional func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) + @asyncHandler optional func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) @available(iOS 5.0, *) - optional func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) + @asyncHandler optional func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) @available(iOS 5.0, *) - optional func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) + @asyncHandler optional func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) @available(iOS 13.0, *) optional func centralManager(_ central: CBCentralManager, connectionEventDidOccur event: CBConnectionEvent, for peripheral: CBPeripheral) @available(iOS 13.0, *) - optional func centralManager(_ central: CBCentralManager, didUpdateANCSAuthorizationFor peripheral: CBPeripheral) + @asyncHandler optional func centralManager(_ central: CBCentralManager, didUpdateANCSAuthorizationFor peripheral: CBPeripheral) } diff --git a/iOS/CoreBluetooth/CBPeripheral.swift b/iOS/CoreBluetooth/CBPeripheral.swift index 63f424b..c04b173 100644 --- a/iOS/CoreBluetooth/CBPeripheral.swift +++ b/iOS/CoreBluetooth/CBPeripheral.swift @@ -44,33 +44,33 @@ class CBPeripheral : CBPeer { } protocol CBPeripheralDelegate : NSObjectProtocol { @available(iOS 6.0, *) - optional func peripheralDidUpdateName(_ peripheral: CBPeripheral) + @asyncHandler optional func peripheralDidUpdateName(_ peripheral: CBPeripheral) @available(iOS 7.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]) @available(iOS, introduced: 5.0, deprecated: 8.0) - optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, error: Error?) + @asyncHandler optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, error: Error?) @available(iOS 8.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didReadRSSI RSSI: NSNumber, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didReadRSSI RSSI: NSNumber, error: Error?) @available(iOS 5.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) @available(iOS 5.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesFor service: CBService, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesFor service: CBService, error: Error?) @available(iOS 5.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) @available(iOS 5.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) @available(iOS 5.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) @available(iOS 5.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: Error?) @available(iOS 5.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didDiscoverDescriptorsFor characteristic: CBCharacteristic, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverDescriptorsFor characteristic: CBCharacteristic, error: Error?) @available(iOS 5.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor descriptor: CBDescriptor, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor descriptor: CBDescriptor, error: Error?) @available(iOS 5.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor descriptor: CBDescriptor, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor descriptor: CBDescriptor, error: Error?) @available(iOS 5.0, *) optional func peripheralIsReady(toSendWriteWithoutResponse peripheral: CBPeripheral) @available(iOS 11.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?) } diff --git a/iOS/CoreBluetooth/CBPeripheralManager.swift b/iOS/CoreBluetooth/CBPeripheralManager.swift index 512462f..888603a 100644 --- a/iOS/CoreBluetooth/CBPeripheralManager.swift +++ b/iOS/CoreBluetooth/CBPeripheralManager.swift @@ -51,27 +51,27 @@ class CBPeripheralManager : CBManager { } protocol CBPeripheralManagerDelegate : NSObjectProtocol { @available(iOS 6.0, *) - func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) + @asyncHandler func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) @available(iOS 6.0, *) optional func peripheralManager(_ peripheral: CBPeripheralManager, willRestoreState dict: [String : Any]) @available(iOS 6.0, *) - optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error: Error?) + @asyncHandler optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error: Error?) @available(iOS 6.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) @available(iOS 6.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didSubscribeTo characteristic: CBCharacteristic) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didSubscribeTo characteristic: CBCharacteristic) @available(iOS 6.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didUnsubscribeFrom characteristic: CBCharacteristic) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didUnsubscribeFrom characteristic: CBCharacteristic) @available(iOS 6.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveRead request: CBATTRequest) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveRead request: CBATTRequest) @available(iOS 6.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) @available(iOS 6.0, *) optional func peripheralManagerIsReady(toUpdateSubscribers peripheral: CBPeripheralManager) @available(iOS 6.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) @available(iOS 6.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didUnpublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didUnpublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) @available(iOS 11.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: Error?) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: Error?) } diff --git a/iOS/CoreData/NSFetchedResultsController.swift b/iOS/CoreData/NSFetchedResultsController.swift index 18c5899..742ff8a 100644 --- a/iOS/CoreData/NSFetchedResultsController.swift +++ b/iOS/CoreData/NSFetchedResultsController.swift @@ -34,15 +34,15 @@ enum NSFetchedResultsChangeType : UInt { } protocol NSFetchedResultsControllerDelegate : NSObjectProtocol { @available(iOS 13.0, *) - optional func controller(_ controller: NSFetchedResultsController, didChangeContentWith diff: CollectionDifference) + @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChangeContentWith diff: CollectionDifference) @available(iOS 3.0, *) - optional func controller(_ controller: NSFetchedResultsController, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) + @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) @available(iOS 3.0, *) - optional func controller(_ controller: NSFetchedResultsController, didChange sectionInfo: NSFetchedResultsSectionInfo, atSectionIndex sectionIndex: Int, for type: NSFetchedResultsChangeType) + @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChange sectionInfo: NSFetchedResultsSectionInfo, atSectionIndex sectionIndex: Int, for type: NSFetchedResultsChangeType) @available(iOS 3.0, *) optional func controllerWillChangeContent(_ controller: NSFetchedResultsController) @available(iOS 3.0, *) - optional func controllerDidChangeContent(_ controller: NSFetchedResultsController) + @asyncHandler optional func controllerDidChangeContent(_ controller: NSFetchedResultsController) @available(iOS 4.0, *) optional func controller(_ controller: NSFetchedResultsController, sectionIndexTitleForSectionName sectionName: String) -> String? } diff --git a/iOS/CoreData/NSPersistentContainer.swift b/iOS/CoreData/NSPersistentContainer.swift index 5ca9480..3036085 100644 --- a/iOS/CoreData/NSPersistentContainer.swift +++ b/iOS/CoreData/NSPersistentContainer.swift @@ -10,6 +10,7 @@ class NSPersistentContainer : NSObject { convenience init(name: String) init(name: String, managedObjectModel model: NSManagedObjectModel) func loadPersistentStores(completionHandler block: @escaping (NSPersistentStoreDescription, Error?) -> Void) + func loadPersistentStores() async throws -> NSPersistentStoreDescription func newBackgroundContext() -> NSManagedObjectContext func performBackgroundTask(_ block: @escaping (NSManagedObjectContext) -> Void) } diff --git a/iOS/CoreData/NSPersistentStoreCoordinator.swift b/iOS/CoreData/NSPersistentStoreCoordinator.swift index 73adbab..2875986 100644 --- a/iOS/CoreData/NSPersistentStoreCoordinator.swift +++ b/iOS/CoreData/NSPersistentStoreCoordinator.swift @@ -83,6 +83,8 @@ class NSPersistentStoreCoordinator : NSObject, NSLocking { func addPersistentStore(ofType storeType: String, configurationName configuration: String?, at storeURL: URL?, options: [AnyHashable : Any]? = nil) throws -> NSPersistentStore @available(iOS 10.0, *) func addPersistentStore(with storeDescription: NSPersistentStoreDescription, completionHandler block: @escaping (NSPersistentStoreDescription, Error?) -> Void) + @available(iOS 10.0, *) + func addPersistentStore(with storeDescription: NSPersistentStoreDescription) async throws -> NSPersistentStoreDescription func remove(_ store: NSPersistentStore) throws func setMetadata(_ metadata: [String : Any]?, for store: NSPersistentStore) func metadata(for store: NSPersistentStore) -> [String : Any] diff --git a/iOS/CoreHaptics/CHHapticEngine.swift b/iOS/CoreHaptics/CHHapticEngine.swift index f683144..6d80bb7 100644 --- a/iOS/CoreHaptics/CHHapticEngine.swift +++ b/iOS/CoreHaptics/CHHapticEngine.swift @@ -35,8 +35,10 @@ class CHHapticEngine : NSObject { var isAutoShutdownEnabled: Bool init() throws func start(completionHandler: CHHapticEngine.CompletionHandler? = nil) + func start() async throws func start() throws func stop(completionHandler: CHHapticEngine.CompletionHandler? = nil) + func stop() async throws func notifyWhenPlayersFinished(finishedHandler: @escaping CHHapticEngine.FinishedHandler) func makePlayer(with pattern: CHHapticPattern) throws -> CHHapticPatternPlayer func makeAdvancedPlayer(with pattern: CHHapticPattern) throws -> CHHapticAdvancedPatternPlayer diff --git a/iOS/CoreLocation/CLGeocoder.swift b/iOS/CoreLocation/CLGeocoder.swift index 2d5502f..22bd97d 100644 --- a/iOS/CoreLocation/CLGeocoder.swift +++ b/iOS/CoreLocation/CLGeocoder.swift @@ -4,14 +4,23 @@ typealias CLGeocodeCompletionHandler = ([CLPlacemark]?, Error?) -> Void class CLGeocoder : NSObject { var isGeocoding: Bool { get } func reverseGeocodeLocation(_ location: CLLocation, completionHandler: @escaping CLGeocodeCompletionHandler) + func reverseGeocodeLocation(_ location: CLLocation) async throws -> [CLPlacemark]? @available(iOS 11.0, *) func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?, completionHandler: @escaping CLGeocodeCompletionHandler) + @available(iOS 11.0, *) + func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?) async throws -> [CLPlacemark]? @available(iOS, introduced: 5.0, deprecated: 11.0, message: "Use -geocodePostalAddress:completionHandler:") func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any], completionHandler: @escaping CLGeocodeCompletionHandler) + @available(iOS, introduced: 5.0, deprecated: 11.0, message: "Use -geocodePostalAddress:completionHandler:") + func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any]) async throws -> [CLPlacemark]? func geocodeAddressString(_ addressString: String, completionHandler: @escaping CLGeocodeCompletionHandler) + func geocodeAddressString(_ addressString: String) async throws -> [CLPlacemark]? func geocodeAddressString(_ addressString: String, in region: CLRegion?, completionHandler: @escaping CLGeocodeCompletionHandler) + func geocodeAddressString(_ addressString: String, in region: CLRegion?) async throws -> [CLPlacemark]? @available(iOS 11.0, *) func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?, completionHandler: @escaping CLGeocodeCompletionHandler) + @available(iOS 11.0, *) + func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?) async throws -> [CLPlacemark]? func cancelGeocode() } extension CLGeocoder { diff --git a/iOS/CoreLocation/CLLocationManager.swift b/iOS/CoreLocation/CLLocationManager.swift index d5bea7b..516d1a7 100644 --- a/iOS/CoreLocation/CLLocationManager.swift +++ b/iOS/CoreLocation/CLLocationManager.swift @@ -92,6 +92,8 @@ class CLLocationManager : NSObject { @available(iOS 14.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String, completion: ((Error?) -> Void)? = nil) @available(iOS 14.0, *) + func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) async throws + @available(iOS 14.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) func startUpdatingLocation() func stopUpdatingLocation() diff --git a/iOS/CoreLocation/CLLocationManagerDelegate.swift b/iOS/CoreLocation/CLLocationManagerDelegate.swift index 2505a6f..d00ffe2 100644 --- a/iOS/CoreLocation/CLLocationManagerDelegate.swift +++ b/iOS/CoreLocation/CLLocationManagerDelegate.swift @@ -1,41 +1,41 @@ protocol CLLocationManagerDelegate : NSObjectProtocol { @available(iOS 6.0, *) - optional func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) @available(iOS 3.0, *) - optional func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) @available(iOS 3.0, *) optional func locationManagerShouldDisplayHeadingCalibration(_ manager: CLLocationManager) -> Bool @available(iOS 7.0, *) - optional func locationManager(_ manager: CLLocationManager, didDetermineState state: CLRegionState, for region: CLRegion) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didDetermineState state: CLRegionState, for region: CLRegion) @available(iOS, introduced: 7.0, deprecated: 13.0) - optional func locationManager(_ manager: CLLocationManager, didRangeBeacons beacons: [CLBeacon], in region: CLBeaconRegion) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didRangeBeacons beacons: [CLBeacon], in region: CLBeaconRegion) @available(iOS, introduced: 7.0, deprecated: 13.0) optional func locationManager(_ manager: CLLocationManager, rangingBeaconsDidFailFor region: CLBeaconRegion, withError error: Error) @available(iOS 13.0, *) - optional func locationManager(_ manager: CLLocationManager, didRange beacons: [CLBeacon], satisfying beaconConstraint: CLBeaconIdentityConstraint) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didRange beacons: [CLBeacon], satisfying beaconConstraint: CLBeaconIdentityConstraint) @available(iOS 13.0, *) - optional func locationManager(_ manager: CLLocationManager, didFailRangingFor beaconConstraint: CLBeaconIdentityConstraint, error: Error) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didFailRangingFor beaconConstraint: CLBeaconIdentityConstraint, error: Error) @available(iOS 4.0, *) - optional func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) @available(iOS 4.0, *) - optional func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) @available(iOS 2.0, *) - optional func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) @available(iOS 4.0, *) optional func locationManager(_ manager: CLLocationManager, monitoringDidFailFor region: CLRegion?, withError error: Error) @available(iOS, introduced: 4.2, deprecated: 14.0) - optional func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) @available(iOS 14.0, *) - optional func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) + @asyncHandler optional func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) @available(iOS 5.0, *) - optional func locationManager(_ manager: CLLocationManager, didStartMonitoringFor region: CLRegion) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didStartMonitoringFor region: CLRegion) @available(iOS 6.0, *) - optional func locationManagerDidPauseLocationUpdates(_ manager: CLLocationManager) + @asyncHandler optional func locationManagerDidPauseLocationUpdates(_ manager: CLLocationManager) @available(iOS 6.0, *) - optional func locationManagerDidResumeLocationUpdates(_ manager: CLLocationManager) + @asyncHandler optional func locationManagerDidResumeLocationUpdates(_ manager: CLLocationManager) @available(iOS 6.0, *) - optional func locationManager(_ manager: CLLocationManager, didFinishDeferredUpdatesWithError error: Error?) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didFinishDeferredUpdatesWithError error: Error?) @available(iOS 8.0, *) - optional func locationManager(_ manager: CLLocationManager, didVisit visit: CLVisit) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didVisit visit: CLVisit) } diff --git a/iOS/CoreML/MLModel.swift b/iOS/CoreML/MLModel.swift index 4e3b614..ff43ba8 100644 --- a/iOS/CoreML/MLModel.swift +++ b/iOS/CoreML/MLModel.swift @@ -9,6 +9,8 @@ class MLModel : NSObject { convenience init(contentsOf url: URL, configuration: MLModelConfiguration) throws @available(iOS 14.0, *) class func __loadContents(of url: URL, configuration: MLModelConfiguration, completionHandler handler: @escaping (MLModel?, Error?) -> Void) + @available(iOS 14.0, *) + class func __loadContents(of url: URL, configuration: MLModelConfiguration) async throws -> MLModel? func prediction(from input: MLFeatureProvider) throws -> MLFeatureProvider func prediction(from input: MLFeatureProvider, options: MLPredictionOptions) throws -> MLFeatureProvider @available(iOS 12.0, *) diff --git a/iOS/CoreML/MLModelCollection.swift b/iOS/CoreML/MLModelCollection.swift index f16cd50..f72113b 100644 --- a/iOS/CoreML/MLModelCollection.swift +++ b/iOS/CoreML/MLModelCollection.swift @@ -6,6 +6,7 @@ class MLModelCollection : NSObject { var deploymentID: String { get } class func __beginAccessingModelCollection(withIdentifier identifier: String, completionHandler: @escaping (MLModelCollection?, Error?) -> Void) -> Progress class func __endAccessingModelCollection(withIdentifier identifier: String, completionHandler: @escaping (Bool, Error?) -> Void) + class func __endAccessingModelCollection(withIdentifier identifier: String) async throws -> Bool } @available(macOS 11.0, iOS 14.0, *) diff --git a/iOS/CoreMotion/CMHeadphoneMotionManagerDelegate.swift b/iOS/CoreMotion/CMHeadphoneMotionManagerDelegate.swift index 242a5a8..001e518 100644 --- a/iOS/CoreMotion/CMHeadphoneMotionManagerDelegate.swift +++ b/iOS/CoreMotion/CMHeadphoneMotionManagerDelegate.swift @@ -1,6 +1,6 @@ @available(iOS 14.0, *) protocol CMHeadphoneMotionManagerDelegate : NSObjectProtocol { - optional func headphoneMotionManagerDidConnect(_ manager: CMHeadphoneMotionManager) - optional func headphoneMotionManagerDidDisconnect(_ manager: CMHeadphoneMotionManager) + @asyncHandler optional func headphoneMotionManagerDidConnect(_ manager: CMHeadphoneMotionManager) + @asyncHandler optional func headphoneMotionManagerDidDisconnect(_ manager: CMHeadphoneMotionManager) } diff --git a/iOS/CoreNFC/CoreNFC.swift b/iOS/CoreNFC/CoreNFC.swift index d5a4137..4d7adb7 100644 --- a/iOS/CoreNFC/CoreNFC.swift +++ b/iOS/CoreNFC/CoreNFC.swift @@ -71,11 +71,11 @@ protocol NFCReaderSessionProtocol : NSObjectProtocol { @available(iOS 11.0, *) protocol __NFCReaderSessionDelegate : NSObjectProtocol { @available(iOS 11.0, *) - func readerSessionDidBecomeActive(_ session: NFCReaderSession) + @asyncHandler func readerSessionDidBecomeActive(_ session: NFCReaderSession) @available(iOS 11.0, *) - func readerSession(_ session: NFCReaderSession, didInvalidateWithError error: Error) + @asyncHandler func readerSession(_ session: NFCReaderSession, didInvalidateWithError error: Error) @available(iOS 11.0, *) - optional func readerSession(_ session: NFCReaderSession, didDetect tags: [__NFCTag]) + @asyncHandler optional func readerSession(_ session: NFCReaderSession, didDetect tags: [__NFCTag]) } @available(iOS 11.0, *) class NFCReaderSession : NSObject, NFCReaderSessionProtocol { @@ -126,11 +126,11 @@ class NFCTagCommandConfiguration : NSObject, NSCopying { @available(iOS 13.0, *) protocol __NFCTagReaderSessionDelegate : NSObjectProtocol { @available(iOS 13.0, *) - func tagReaderSession(_ session: NFCTagReaderSession, didInvalidateWithError error: Error) + @asyncHandler func tagReaderSession(_ session: NFCTagReaderSession, didInvalidateWithError error: Error) @available(iOS 13.0, *) - optional func tagReaderSessionDidBecomeActive(_ session: NFCTagReaderSession) + @asyncHandler optional func tagReaderSessionDidBecomeActive(_ session: NFCTagReaderSession) @available(iOS 13.0, *) - optional func tagReaderSession(_ session: NFCTagReaderSession, didDetect tags: [__NFCTag]) + @asyncHandler optional func tagReaderSession(_ session: NFCTagReaderSession, didDetect tags: [__NFCTag]) } @available(iOS 13.0, *) class NFCTagReaderSession : NFCReaderSession { @@ -142,6 +142,8 @@ class NFCTagReaderSession : NFCReaderSession { func restartPolling() @available(iOS 13.0, *) func __connect(to tag: __NFCTag, completionHandler: @escaping (Error?) -> Void) + @available(iOS 13.0, *) + func __connect(to tag: __NFCTag) async throws } @available(iOS 13.0, *) @@ -168,13 +170,13 @@ extension NFCTagReaderSession { @available(iOS 11.0, *) protocol NFCNDEFReaderSessionDelegate : NSObjectProtocol { @available(iOS 11.0, *) - func readerSession(_ session: NFCNDEFReaderSession, didInvalidateWithError error: Error) + @asyncHandler func readerSession(_ session: NFCNDEFReaderSession, didInvalidateWithError error: Error) @available(iOS 11.0, *) - func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage]) + @asyncHandler func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage]) @available(iOS 13.0, *) - optional func readerSession(_ session: NFCNDEFReaderSession, didDetect tags: [NFCNDEFTag]) + @asyncHandler optional func readerSession(_ session: NFCNDEFReaderSession, didDetect tags: [NFCNDEFTag]) @available(iOS 13.0, *) - optional func readerSessionDidBecomeActive(_ session: NFCNDEFReaderSession) + @asyncHandler optional func readerSessionDidBecomeActive(_ session: NFCNDEFReaderSession) } @available(iOS 11.0, *) class NFCNDEFReaderSession : NFCReaderSession { @@ -184,6 +186,8 @@ class NFCNDEFReaderSession : NFCReaderSession { func restartPolling() @available(iOS 13.0, *) func connect(to tag: NFCNDEFTag, completionHandler: @escaping (Error?) -> Void) + @available(iOS 13.0, *) + func connect(to tag: NFCNDEFTag) async throws } extension NSUserActivity { @available(iOS 12.0, *) @@ -276,67 +280,131 @@ protocol NFCISO15693Tag : NFCNDEFTag, __NFCTag { @available(iOS 11.0, *) func sendCustomCommand(commandConfiguration: NFCISO15693CustomCommandConfiguration, completionHandler: @escaping (Data, Error?) -> Void) @available(iOS 11.0, *) + func sendCustomCommand(commandConfiguration: NFCISO15693CustomCommandConfiguration) async throws -> Data + @available(iOS 11.0, *) func readMultipleBlock(readConfiguration: NFCISO15693ReadMultipleBlocksConfiguration, completionHandler: @escaping (Data, Error?) -> Void) + @available(iOS 11.0, *) + func readMultipleBlock(readConfiguration: NFCISO15693ReadMultipleBlocksConfiguration) async throws -> Data @available(iOS 13.0, *) func stayQuiet(completionHandler: @escaping (Error?) -> Void) @available(iOS 13.0, *) + func stayQuiet() async throws + @available(iOS 13.0, *) func readSingleBlock(requestFlags flags: NFCISO15693RequestFlag, blockNumber: UInt8, completionHandler: @escaping (Data, Error?) -> Void) @available(iOS 13.0, *) + func readSingleBlock(requestFlags flags: NFCISO15693RequestFlag, blockNumber: UInt8) async throws -> Data + @available(iOS 13.0, *) func writeSingleBlock(requestFlags flags: NFCISO15693RequestFlag, blockNumber: UInt8, dataBlock: Data, completionHandler: @escaping (Error?) -> Void) @available(iOS 13.0, *) + func writeSingleBlock(requestFlags flags: NFCISO15693RequestFlag, blockNumber: UInt8, dataBlock: Data) async throws + @available(iOS 13.0, *) func lockBlock(requestFlags flags: NFCISO15693RequestFlag, blockNumber: UInt8, completionHandler: @escaping (Error?) -> Void) @available(iOS 13.0, *) + func lockBlock(requestFlags flags: NFCISO15693RequestFlag, blockNumber: UInt8) async throws + @available(iOS 13.0, *) func readMultipleBlocks(requestFlags flags: NFCISO15693RequestFlag, blockRange: NSRange, completionHandler: @escaping ([Data], Error?) -> Void) @available(iOS 13.0, *) + func readMultipleBlocks(requestFlags flags: NFCISO15693RequestFlag, blockRange: NSRange) async throws -> [Data] + @available(iOS 13.0, *) func writeMultipleBlocks(requestFlags flags: NFCISO15693RequestFlag, blockRange: NSRange, dataBlocks: [Data], completionHandler: @escaping (Error?) -> Void) @available(iOS 13.0, *) + func writeMultipleBlocks(requestFlags flags: NFCISO15693RequestFlag, blockRange: NSRange, dataBlocks: [Data]) async throws + @available(iOS 13.0, *) func select(requestFlags flags: NFCISO15693RequestFlag, completionHandler: @escaping (Error?) -> Void) @available(iOS 13.0, *) + func select(requestFlags flags: NFCISO15693RequestFlag) async throws + @available(iOS 13.0, *) func resetToReady(requestFlags flags: NFCISO15693RequestFlag, completionHandler: @escaping (Error?) -> Void) @available(iOS 13.0, *) + func resetToReady(requestFlags flags: NFCISO15693RequestFlag) async throws + @available(iOS 13.0, *) func writeAFI(requestFlags flags: NFCISO15693RequestFlag, afi: UInt8, completionHandler: @escaping (Error?) -> Void) @available(iOS 13.0, *) + func writeAFI(requestFlags flags: NFCISO15693RequestFlag, afi: UInt8) async throws + @available(iOS 13.0, *) func lockAFI(requestFlags flags: NFCISO15693RequestFlag, completionHandler: @escaping (Error?) -> Void) @available(iOS 13.0, *) + func lockAFI(requestFlags flags: NFCISO15693RequestFlag) async throws + @available(iOS 13.0, *) func writeDSFID(requestFlags flags: NFCISO15693RequestFlag, dsfid: UInt8, completionHandler: @escaping (Error?) -> Void) + @available(iOS 13.0, *) + func writeDSFID(requestFlags flags: NFCISO15693RequestFlag, dsfid: UInt8) async throws @available(iOS, introduced: 13.0, deprecated: 14.0) func lockDFSID(requestFlags flags: NFCISO15693RequestFlag, completionHandler: @escaping (Error?) -> Void) + @available(iOS, introduced: 13.0, deprecated: 14.0) + func lockDFSID(requestFlags flags: NFCISO15693RequestFlag) async throws @available(iOS 14.0, *) func lockDSFID(requestFlags flags: NFCISO15693RequestFlag, completionHandler: @escaping (Error?) -> Void) + @available(iOS 14.0, *) + func lockDSFID(requestFlags flags: NFCISO15693RequestFlag) async throws @available(iOS, introduced: 13.0, deprecated: 14.0) func getSystemInfo(requestFlags flags: NFCISO15693RequestFlag, completionHandler: @escaping (Int, Int, Int, Int, Int, Error?) -> Void) + @available(iOS, introduced: 13.0, deprecated: 14.0) + func getSystemInfo(requestFlags flags: NFCISO15693RequestFlag) async throws -> (Int, Int, Int, Int, Int) @available(iOS 14.0, *) func __getSystemInfoAndUID(with flags: NFCISO15693RequestFlag, completionHandler: @escaping (Data?, Int, Int, Int, Int, Int, Error?) -> Void) + @available(iOS 14.0, *) + func __getSystemInfoAndUID(with flags: NFCISO15693RequestFlag) async throws -> (Data?, Int, Int, Int, Int, Int) @available(iOS 13.0, *) func getMultipleBlockSecurityStatus(requestFlags flags: NFCISO15693RequestFlag, blockRange: NSRange, completionHandler: @escaping ([NSNumber], Error?) -> Void) + @available(iOS 13.0, *) + func getMultipleBlockSecurityStatus(requestFlags flags: NFCISO15693RequestFlag, blockRange: NSRange) async throws -> [NSNumber] @available(iOS 14.0, *) func __fastReadMultipleBlocks(with flags: NFCISO15693RequestFlag, blockRange: NSRange, completionHandler: @escaping ([Data], Error?) -> Void) + @available(iOS 14.0, *) + func __fastReadMultipleBlocks(with flags: NFCISO15693RequestFlag, blockRange: NSRange) async throws -> [Data] @available(iOS 13.0, *) func customCommand(requestFlags flags: NFCISO15693RequestFlag, customCommandCode: Int, customRequestParameters: Data, completionHandler: @escaping (Data, Error?) -> Void) @available(iOS 13.0, *) + func customCommand(requestFlags flags: NFCISO15693RequestFlag, customCommandCode: Int, customRequestParameters: Data) async throws -> Data + @available(iOS 13.0, *) func extendedReadSingleBlock(requestFlags flags: NFCISO15693RequestFlag, blockNumber: Int, completionHandler: @escaping (Data, Error?) -> Void) @available(iOS 13.0, *) + func extendedReadSingleBlock(requestFlags flags: NFCISO15693RequestFlag, blockNumber: Int) async throws -> Data + @available(iOS 13.0, *) func extendedWriteSingleBlock(requestFlags flags: NFCISO15693RequestFlag, blockNumber: Int, dataBlock: Data, completionHandler: @escaping (Error?) -> Void) @available(iOS 13.0, *) + func extendedWriteSingleBlock(requestFlags flags: NFCISO15693RequestFlag, blockNumber: Int, dataBlock: Data) async throws + @available(iOS 13.0, *) func extendedLockBlock(requestFlags flags: NFCISO15693RequestFlag, blockNumber: Int, completionHandler: @escaping (Error?) -> Void) @available(iOS 13.0, *) + func extendedLockBlock(requestFlags flags: NFCISO15693RequestFlag, blockNumber: Int) async throws + @available(iOS 13.0, *) func extendedReadMultipleBlocks(requestFlags flags: NFCISO15693RequestFlag, blockRange: NSRange, completionHandler: @escaping ([Data], Error?) -> Void) + @available(iOS 13.0, *) + func extendedReadMultipleBlocks(requestFlags flags: NFCISO15693RequestFlag, blockRange: NSRange) async throws -> [Data] @available(iOS 14.0, *) func __extendedWriteMultipleBlocks(withRequestFlags flags: NFCISO15693RequestFlag, blockRange: NSRange, dataBlocks: [Data], completionHandler: @escaping (Error?) -> Void) @available(iOS 14.0, *) + func __extendedWriteMultipleBlocks(withRequestFlags flags: NFCISO15693RequestFlag, blockRange: NSRange, dataBlocks: [Data]) async throws + @available(iOS 14.0, *) func __authenticate(withRequestFlags flags: NFCISO15693RequestFlag, cryptoSuiteIdentifier: Int, message: Data, completionHandler: @escaping (NFCISO15693ResponseFlag, Data, Error?) -> Void) @available(iOS 14.0, *) + func __authenticate(withRequestFlags flags: NFCISO15693RequestFlag, cryptoSuiteIdentifier: Int, message: Data) async throws -> (NFCISO15693ResponseFlag, Data) + @available(iOS 14.0, *) func __keyUpdate(withRequestFlags flags: NFCISO15693RequestFlag, keyIdentifier: Int, message: Data, completionHandler: @escaping (NFCISO15693ResponseFlag, Data, Error?) -> Void) @available(iOS 14.0, *) + func __keyUpdate(withRequestFlags flags: NFCISO15693RequestFlag, keyIdentifier: Int, message: Data) async throws -> (NFCISO15693ResponseFlag, Data) + @available(iOS 14.0, *) func __challenge(withRequestFlags flags: NFCISO15693RequestFlag, cryptoSuiteIdentifier: Int, message: Data, completionHandler: @escaping (Error?) -> Void) @available(iOS 14.0, *) + func __challenge(withRequestFlags flags: NFCISO15693RequestFlag, cryptoSuiteIdentifier: Int, message: Data) async throws + @available(iOS 14.0, *) func __readBuffer(withRequestFlags flags: NFCISO15693RequestFlag, completionHandler: @escaping (NFCISO15693ResponseFlag, Data, Error?) -> Void) @available(iOS 14.0, *) + func __readBuffer(withRequestFlags flags: NFCISO15693RequestFlag) async throws -> (NFCISO15693ResponseFlag, Data) + @available(iOS 14.0, *) func __extendedGetMultipleBlockSecurityStatus(with flags: NFCISO15693RequestFlag, blockRange: NSRange, completionHandler: @escaping ([NSNumber], Error?) -> Void) @available(iOS 14.0, *) + func __extendedGetMultipleBlockSecurityStatus(with flags: NFCISO15693RequestFlag, blockRange: NSRange) async throws -> [NSNumber] + @available(iOS 14.0, *) func __extendedFastReadMultipleBlocks(with flags: NFCISO15693RequestFlag, blockRange: NSRange, completionHandler: @escaping ([Data], Error?) -> Void) @available(iOS 14.0, *) + func __extendedFastReadMultipleBlocks(with flags: NFCISO15693RequestFlag, blockRange: NSRange) async throws -> [Data] + @available(iOS 14.0, *) func __sendRequest(withFlag flags: Int, commandCode: Int, data: Data?, completionHandler: @escaping (NFCISO15693ResponseFlag, Data?, Error?) -> Void) + @available(iOS 14.0, *) + func __sendRequest(withFlag flags: Int, commandCode: Int, data: Data?) async throws -> (NFCISO15693ResponseFlag, Data?) } @available(iOS 11.0, *) @@ -393,11 +461,19 @@ protocol NFCNDEFTag : NSCopying, NSSecureCoding, NSObjectProtocol { @available(iOS 13.0, *) func queryNDEFStatus(completionHandler: @escaping (NFCNDEFStatus, Int, Error?) -> Void) @available(iOS 13.0, *) + func queryNDEFStatus() async throws -> (NFCNDEFStatus, Int) + @available(iOS 13.0, *) func readNDEF(completionHandler: @escaping (NFCNDEFMessage?, Error?) -> Void) @available(iOS 13.0, *) + func readNDEF() async throws -> NFCNDEFMessage? + @available(iOS 13.0, *) func writeNDEF(_ ndefMessage: NFCNDEFMessage, completionHandler: @escaping (Error?) -> Void) @available(iOS 13.0, *) + func writeNDEF(_ ndefMessage: NFCNDEFMessage) async throws + @available(iOS 13.0, *) func writeLock(completionHandler: @escaping (Error?) -> Void) + @available(iOS 13.0, *) + func writeLock() async throws } @available(iOS 14.0, *) enum NFCFeliCaPollingRequestCode : Int { @@ -468,23 +544,43 @@ protocol NFCFeliCaTag : NFCNDEFTag, __NFCTag { @available(iOS 13.0, *) func polling(systemCode: Data, requestCode: NFCFeliCaPollingRequestCode, timeSlot: NFCFeliCaPollingTimeSlot, completionHandler: @escaping (Data, Data, Error?) -> Void) @available(iOS 13.0, *) + func polling(systemCode: Data, requestCode: NFCFeliCaPollingRequestCode, timeSlot: NFCFeliCaPollingTimeSlot) async throws -> (Data, Data) + @available(iOS 13.0, *) func requestService(nodeCodeList: [Data], completionHandler: @escaping ([Data], Error?) -> Void) @available(iOS 13.0, *) + func requestService(nodeCodeList: [Data]) async throws -> [Data] + @available(iOS 13.0, *) func requestResponse(completionHandler: @escaping (Int, Error?) -> Void) @available(iOS 13.0, *) + func requestResponse() async throws -> Int + @available(iOS 13.0, *) func readWithoutEncryption(serviceCodeList: [Data], blockList: [Data], completionHandler: @escaping (Int, Int, [Data], Error?) -> Void) @available(iOS 13.0, *) + func readWithoutEncryption(serviceCodeList: [Data], blockList: [Data]) async throws -> (Int, Int, [Data]) + @available(iOS 13.0, *) func writeWithoutEncryption(serviceCodeList: [Data], blockList: [Data], blockData: [Data], completionHandler: @escaping (Int, Int, Error?) -> Void) @available(iOS 13.0, *) + func writeWithoutEncryption(serviceCodeList: [Data], blockList: [Data], blockData: [Data]) async throws -> (Int, Int) + @available(iOS 13.0, *) func requestSystemCode(completionHandler: @escaping ([Data], Error?) -> Void) @available(iOS 13.0, *) + func requestSystemCode() async throws -> [Data] + @available(iOS 13.0, *) func requestServiceV2(nodeCodeList: [Data], completionHandler: @escaping (Int, Int, NFCFeliCaEncryptionId, [Data], [Data], Error?) -> Void) @available(iOS 13.0, *) + func requestServiceV2(nodeCodeList: [Data]) async throws -> (Int, Int, NFCFeliCaEncryptionId, [Data], [Data]) + @available(iOS 13.0, *) func requestSpecificationVersion(completionHandler: @escaping (Int, Int, Data, Data, Error?) -> Void) @available(iOS 13.0, *) + func requestSpecificationVersion() async throws -> (Int, Int, Data, Data) + @available(iOS 13.0, *) func resetMode(completionHandler: @escaping (Int, Int, Error?) -> Void) @available(iOS 13.0, *) + func resetMode() async throws -> (Int, Int) + @available(iOS 13.0, *) func sendFeliCaCommand(commandPacket: Data, completionHandler: @escaping (Data, Error?) -> Void) + @available(iOS 13.0, *) + func sendFeliCaCommand(commandPacket: Data) async throws -> Data } @available(iOS 14.0, *) @@ -543,6 +639,8 @@ protocol NFCISO7816Tag : NFCNDEFTag, __NFCTag { var proprietaryApplicationDataCoding: Bool { get } @available(iOS 13.0, *) func sendCommand(apdu: NFCISO7816APDU, completionHandler: @escaping (Data, UInt8, UInt8, Error?) -> Void) + @available(iOS 13.0, *) + func sendCommand(apdu: NFCISO7816APDU) async throws -> (Data, UInt8, UInt8) } @available(iOS 14.0, *) @@ -574,7 +672,11 @@ protocol NFCMiFareTag : NFCNDEFTag, __NFCTag { @available(iOS 13.0, *) func sendMiFareCommand(commandPacket command: Data, completionHandler: @escaping (Data, Error?) -> Void) @available(iOS 13.0, *) + func sendMiFareCommand(commandPacket command: Data) async throws -> Data + @available(iOS 13.0, *) func sendMiFareISO7816Command(_ apdu: NFCISO7816APDU, completionHandler: @escaping (Data, UInt8, UInt8, Error?) -> Void) + @available(iOS 13.0, *) + func sendMiFareISO7816Command(_ apdu: NFCISO7816APDU) async throws -> (Data, UInt8, UInt8) } @available(iOS 14.0, *) @@ -728,11 +830,11 @@ class NFCVASResponse : NSObject, NSCopying { @available(iOS 13.0, *) protocol NFCVASReaderSessionDelegate : NSObjectProtocol { @available(iOS 13.0, *) - optional func readerSessionDidBecomeActive(_ session: NFCVASReaderSession) + @asyncHandler optional func readerSessionDidBecomeActive(_ session: NFCVASReaderSession) @available(iOS 13.0, *) - func readerSession(_ session: NFCVASReaderSession, didInvalidateWithError error: Error) + @asyncHandler func readerSession(_ session: NFCVASReaderSession, didInvalidateWithError error: Error) @available(iOS 13.0, *) - func readerSession(_ session: NFCVASReaderSession, didReceive responses: [NFCVASResponse]) + @asyncHandler func readerSession(_ session: NFCVASReaderSession, didReceive responses: [NFCVASResponse]) } @available(iOS 13.0, *) class NFCVASReaderSession : NFCReaderSession { diff --git a/iOS/CoreSpotlight/CSSearchableIndex.swift b/iOS/CoreSpotlight/CSSearchableIndex.swift index 9d77131..e41521e 100644 --- a/iOS/CoreSpotlight/CSSearchableIndex.swift +++ b/iOS/CoreSpotlight/CSSearchableIndex.swift @@ -22,21 +22,27 @@ class CSSearchableIndex : NSObject { init(name: String) init(name: String, protectionClass: FileProtectionType?) func indexSearchableItems(_ items: [CSSearchableItem], completionHandler: ((Error?) -> Void)? = nil) + func indexSearchableItems(_ items: [CSSearchableItem]) async throws func deleteSearchableItems(withIdentifiers identifiers: [String], completionHandler: ((Error?) -> Void)? = nil) + func deleteSearchableItems(withIdentifiers identifiers: [String]) async throws func deleteSearchableItems(withDomainIdentifiers domainIdentifiers: [String], completionHandler: ((Error?) -> Void)? = nil) + func deleteSearchableItems(withDomainIdentifiers domainIdentifiers: [String]) async throws func deleteAllSearchableItems(completionHandler: ((Error?) -> Void)? = nil) + func deleteAllSearchableItems() async throws } extension CSSearchableIndex { func beginBatch() func endBatch(withClientState clientState: Data, completionHandler: ((Error?) -> Void)? = nil) + func endBatch(withClientState clientState: Data) async throws func fetchLastClientState(completionHandler: @escaping (Data?, Error?) -> Void) + func fetchLastClientState() async throws -> Data? } @available(iOS 9.0, *) protocol CSSearchableIndexDelegate : NSObjectProtocol { func searchableIndex(_ searchableIndex: CSSearchableIndex, reindexAllSearchableItemsWithAcknowledgementHandler acknowledgementHandler: @escaping () -> Void) func searchableIndex(_ searchableIndex: CSSearchableIndex, reindexSearchableItemsWithIdentifiers identifiers: [String], acknowledgementHandler: @escaping () -> Void) - optional func searchableIndexDidThrottle(_ searchableIndex: CSSearchableIndex) - optional func searchableIndexDidFinishThrottle(_ searchableIndex: CSSearchableIndex) + @asyncHandler optional func searchableIndexDidThrottle(_ searchableIndex: CSSearchableIndex) + @asyncHandler optional func searchableIndexDidFinishThrottle(_ searchableIndex: CSSearchableIndex) @available(iOS 11.0, *) optional func data(for searchableIndex: CSSearchableIndex, itemIdentifier: String, typeIdentifier: String) throws -> Data @available(iOS 11.0, *) diff --git a/iOS/CoreTelephony/CTCellularPlanProvisioning.swift b/iOS/CoreTelephony/CTCellularPlanProvisioning.swift index 42c1e72..1400119 100644 --- a/iOS/CoreTelephony/CTCellularPlanProvisioning.swift +++ b/iOS/CoreTelephony/CTCellularPlanProvisioning.swift @@ -5,4 +5,6 @@ class CTCellularPlanProvisioning : NSObject { func supportsCellularPlan() -> Bool @available(iOS 12.0, *) func addPlan(with request: CTCellularPlanProvisioningRequest, completionHandler: @escaping (CTCellularPlanProvisioningAddPlanResult) -> Void) + @available(iOS 12.0, *) + func addPlan(with request: CTCellularPlanProvisioningRequest) async -> CTCellularPlanProvisioningAddPlanResult } diff --git a/iOS/CoreTelephony/CTTelephonyNetworkInfo.swift b/iOS/CoreTelephony/CTTelephonyNetworkInfo.swift index 0428bf5..f8fea20 100644 --- a/iOS/CoreTelephony/CTTelephonyNetworkInfo.swift +++ b/iOS/CoreTelephony/CTTelephonyNetworkInfo.swift @@ -33,7 +33,7 @@ let CTRadioAccessTechnologyNRNSA: String let CTRadioAccessTechnologyNR: String @available(iOS 13.0, *) protocol CTTelephonyNetworkInfoDelegate : NSObjectProtocol { - optional func dataServiceIdentifierDidChange(_ identifier: String) + @asyncHandler optional func dataServiceIdentifierDidChange(_ identifier: String) } @available(iOS 4.0, *) class CTTelephonyNetworkInfo : NSObject { diff --git a/iOS/DeviceCheck/DCAppAttestService.swift b/iOS/DeviceCheck/DCAppAttestService.swift index bdda139..e3a1805 100644 --- a/iOS/DeviceCheck/DCAppAttestService.swift +++ b/iOS/DeviceCheck/DCAppAttestService.swift @@ -4,6 +4,9 @@ class DCAppAttestService : NSObject { class var shared: DCAppAttestService { get } var isSupported: Bool { get } func generateKey(completionHandler: @escaping (String?, Error?) -> Void) + func generateKey() async throws -> String? func attestKey(_ keyId: String, clientDataHash: Data, completionHandler: @escaping (Data?, Error?) -> Void) + func attestKey(_ keyId: String, clientDataHash: Data) async throws -> Data? func generateAssertion(_ keyId: String, clientDataHash: Data, completionHandler: @escaping (Data?, Error?) -> Void) + func generateAssertion(_ keyId: String, clientDataHash: Data) async throws -> Data? } diff --git a/iOS/DeviceCheck/DCDevice.swift b/iOS/DeviceCheck/DCDevice.swift index e6b052a..e3a484f 100644 --- a/iOS/DeviceCheck/DCDevice.swift +++ b/iOS/DeviceCheck/DCDevice.swift @@ -4,4 +4,5 @@ class DCDevice : NSObject { class var current: DCDevice { get } var isSupported: Bool { get } func generateToken(completionHandler completion: @escaping (Data?, Error?) -> Void) + func generateToken() async throws -> Data? } diff --git a/iOS/EventKit/EKEventStore.swift b/iOS/EventKit/EKEventStore.swift index 647359f..a2e3720 100644 --- a/iOS/EventKit/EKEventStore.swift +++ b/iOS/EventKit/EKEventStore.swift @@ -12,6 +12,8 @@ class EKEventStore : NSObject { class func authorizationStatus(for entityType: EKEntityType) -> EKAuthorizationStatus @available(iOS 6.0, *) func requestAccess(to entityType: EKEntityType, completion: @escaping EKEventStoreRequestAccessCompletionHandler) + @available(iOS 6.0, *) + func requestAccess(to entityType: EKEntityType) async throws -> Bool var eventStoreIdentifier: String { get } @available(iOS 12.0, *) var delegateSources: [EKSource] { get } diff --git a/iOS/EventKitUI/EKCalendarChooser.swift b/iOS/EventKitUI/EKCalendarChooser.swift index 245c798..4e032ce 100644 --- a/iOS/EventKitUI/EKCalendarChooser.swift +++ b/iOS/EventKitUI/EKCalendarChooser.swift @@ -21,7 +21,7 @@ class EKCalendarChooser : UIViewController { var selectedCalendars: Set } protocol EKCalendarChooserDelegate : NSObjectProtocol { - optional func calendarChooserSelectionDidChange(_ calendarChooser: EKCalendarChooser) - optional func calendarChooserDidFinish(_ calendarChooser: EKCalendarChooser) - optional func calendarChooserDidCancel(_ calendarChooser: EKCalendarChooser) + @asyncHandler optional func calendarChooserSelectionDidChange(_ calendarChooser: EKCalendarChooser) + @asyncHandler optional func calendarChooserDidFinish(_ calendarChooser: EKCalendarChooser) + @asyncHandler optional func calendarChooserDidCancel(_ calendarChooser: EKCalendarChooser) } diff --git a/iOS/EventKitUI/EKEventEditViewController.swift b/iOS/EventKitUI/EKEventEditViewController.swift index 9777f65..82c718a 100644 --- a/iOS/EventKitUI/EKEventEditViewController.swift +++ b/iOS/EventKitUI/EKEventEditViewController.swift @@ -16,7 +16,7 @@ class EKEventEditViewController : UINavigationController { } protocol EKEventEditViewDelegate : NSObjectProtocol { @available(iOS 4.0, *) - func eventEditViewController(_ controller: EKEventEditViewController, didCompleteWith action: EKEventEditViewAction) + @asyncHandler func eventEditViewController(_ controller: EKEventEditViewController, didCompleteWith action: EKEventEditViewAction) @available(iOS 4.0, *) optional func eventEditViewControllerDefaultCalendar(forNewEvents controller: EKEventEditViewController) -> EKCalendar } diff --git a/iOS/EventKitUI/EKEventViewController.swift b/iOS/EventKitUI/EKEventViewController.swift index b458ce8..c83f8b2 100644 --- a/iOS/EventKitUI/EKEventViewController.swift +++ b/iOS/EventKitUI/EKEventViewController.swift @@ -16,5 +16,5 @@ class EKEventViewController : UIViewController { } protocol EKEventViewDelegate : NSObjectProtocol { @available(iOS 4.2, *) - func eventViewController(_ controller: EKEventViewController, didCompleteWith action: EKEventViewAction) + @asyncHandler func eventViewController(_ controller: EKEventViewController, didCompleteWith action: EKEventViewAction) } diff --git a/iOS/ExposureNotification/ENManager.swift b/iOS/ExposureNotification/ENManager.swift index 1ef9847..c11d587 100644 --- a/iOS/ExposureNotification/ENManager.swift +++ b/iOS/ExposureNotification/ENManager.swift @@ -27,12 +27,16 @@ class ENManager : NSObject { var exposureNotificationStatus: ENStatus { get } var invalidationHandler: (() -> Void)? func activate(completionHandler: @escaping ENErrorHandler) + func activate() async throws func invalidate() @available(iOS 13.7, *) func getUserTraveled(completionHandler: @escaping ENGetUserTraveledHandler) + @available(iOS 13.7, *) + func getUserTraveled() async throws -> Bool class var authorizationStatus: ENAuthorizationStatus { get } var exposureNotificationEnabled: Bool { get } func setExposureNotificationEnabled(_ enabled: Bool, completionHandler: @escaping ENErrorHandler) + func setExposureNotificationEnabled(_ enabled: Bool) async throws @available(iOS 13.7, *) func detectExposures(configuration: ENExposureConfiguration, completionHandler: @escaping ENDetectExposuresHandler) -> Progress func detectExposures(configuration: ENExposureConfiguration, diagnosisKeyURLs: [URL], completionHandler: @escaping ENDetectExposuresHandler) -> Progress @@ -41,5 +45,7 @@ class ENManager : NSObject { @available(iOS 13.7, *) func getExposureWindows(summary: ENExposureDetectionSummary, completionHandler: @escaping ENGetExposureWindowsHandler) -> Progress func getDiagnosisKeys(completionHandler: @escaping ENGetDiagnosisKeysHandler) + func getDiagnosisKeys() async throws -> [ENTemporaryExposureKey]? func getTestDiagnosisKeys(completionHandler: @escaping ENGetDiagnosisKeysHandler) + func getTestDiagnosisKeys() async throws -> [ENTemporaryExposureKey]? } diff --git a/iOS/ExternalAccessory/EAAccessory.swift b/iOS/ExternalAccessory/EAAccessory.swift index ddaa549..935eaf6 100644 --- a/iOS/ExternalAccessory/EAAccessory.swift +++ b/iOS/ExternalAccessory/EAAccessory.swift @@ -27,5 +27,5 @@ class EAAccessory : NSObject { } protocol EAAccessoryDelegate : NSObjectProtocol { @available(iOS 3.0, *) - optional func accessoryDidDisconnect(_ accessory: EAAccessory) + @asyncHandler optional func accessoryDidDisconnect(_ accessory: EAAccessory) } diff --git a/iOS/ExternalAccessory/EAAccessoryManager.swift b/iOS/ExternalAccessory/EAAccessoryManager.swift index c9aeb50..be889f2 100644 --- a/iOS/ExternalAccessory/EAAccessoryManager.swift +++ b/iOS/ExternalAccessory/EAAccessoryManager.swift @@ -26,6 +26,8 @@ class EAAccessoryManager : NSObject { class func shared() -> EAAccessoryManager @available(iOS 6, *) func showBluetoothAccessoryPicker(withNameFilter predicate: NSPredicate?, completion: EABluetoothAccessoryPickerCompletion? = nil) + @available(iOS 6, *) + func showBluetoothAccessoryPicker(withNameFilter predicate: NSPredicate?) async throws @available(iOS 3.0, *) func registerForLocalNotifications() @available(iOS 3.0, *) diff --git a/iOS/ExternalAccessory/EAWiFiUnconfiguredAccessoryBrowser.swift b/iOS/ExternalAccessory/EAWiFiUnconfiguredAccessoryBrowser.swift index f24431e..b494ca3 100644 --- a/iOS/ExternalAccessory/EAWiFiUnconfiguredAccessoryBrowser.swift +++ b/iOS/ExternalAccessory/EAWiFiUnconfiguredAccessoryBrowser.swift @@ -27,11 +27,11 @@ class EAWiFiUnconfiguredAccessoryBrowser : NSObject { } protocol EAWiFiUnconfiguredAccessoryBrowserDelegate : NSObjectProtocol { @available(iOS 8.0, *) - func accessoryBrowser(_ browser: EAWiFiUnconfiguredAccessoryBrowser, didUpdate state: EAWiFiUnconfiguredAccessoryBrowserState) + @asyncHandler func accessoryBrowser(_ browser: EAWiFiUnconfiguredAccessoryBrowser, didUpdate state: EAWiFiUnconfiguredAccessoryBrowserState) @available(iOS 8.0, *) - func accessoryBrowser(_ browser: EAWiFiUnconfiguredAccessoryBrowser, didFindUnconfiguredAccessories accessories: Set) + @asyncHandler func accessoryBrowser(_ browser: EAWiFiUnconfiguredAccessoryBrowser, didFindUnconfiguredAccessories accessories: Set) @available(iOS 8.0, *) - func accessoryBrowser(_ browser: EAWiFiUnconfiguredAccessoryBrowser, didRemoveUnconfiguredAccessories accessories: Set) + @asyncHandler func accessoryBrowser(_ browser: EAWiFiUnconfiguredAccessoryBrowser, didRemoveUnconfiguredAccessories accessories: Set) @available(iOS 8.0, *) - func accessoryBrowser(_ browser: EAWiFiUnconfiguredAccessoryBrowser, didFinishConfiguringAccessory accessory: EAWiFiUnconfiguredAccessory, with status: EAWiFiUnconfiguredAccessoryConfigurationStatus) + @asyncHandler func accessoryBrowser(_ browser: EAWiFiUnconfiguredAccessoryBrowser, didFinishConfiguringAccessory accessory: EAWiFiUnconfiguredAccessory, with status: EAWiFiUnconfiguredAccessoryConfigurationStatus) } diff --git a/iOS/FileProvider/Extension.swift b/iOS/FileProvider/Extension.swift index 26b3784..61c0fd2 100644 --- a/iOS/FileProvider/Extension.swift +++ b/iOS/FileProvider/Extension.swift @@ -6,7 +6,9 @@ class NSFileProviderExtension : NSObject { func urlForItem(withPersistentIdentifier identifier: NSFileProviderItemIdentifier) -> URL? func persistentIdentifierForItem(at url: URL) -> NSFileProviderItemIdentifier? func providePlaceholder(at url: URL, completionHandler: @escaping (Error?) -> Void) + func providePlaceholder(at url: URL) async throws func startProvidingItem(at url: URL, completionHandler: @escaping (Error?) -> Void) + func startProvidingItem(at url: URL) async throws func stopProvidingItem(at url: URL) func itemChanged(at url: URL) } @@ -25,13 +27,19 @@ class NSFileProviderManager : NSObject { class var `default`: NSFileProviderManager { get } convenience init?(for domain: NSFileProviderDomain) func signalEnumerator(for containerItemIdentifier: NSFileProviderItemIdentifier, completionHandler completion: @escaping (Error?) -> Void) + func signalEnumerator(for containerItemIdentifier: NSFileProviderItemIdentifier) async throws func register(_ task: URLSessionTask, forItemWithIdentifier identifier: NSFileProviderItemIdentifier, completionHandler completion: @escaping (Error?) -> Void) + func register(_ task: URLSessionTask, forItemWithIdentifier identifier: NSFileProviderItemIdentifier) async throws var providerIdentifier: String { get } var documentStorageURL: URL { get } class func writePlaceholder(at placeholderURL: URL, withMetadata metadata: NSFileProviderItem) throws class func placeholderURL(for url: URL) -> URL class func add(_ domain: NSFileProviderDomain, completionHandler: @escaping (Error?) -> Void) + class func add(_ domain: NSFileProviderDomain) async throws class func remove(_ domain: NSFileProviderDomain, completionHandler: @escaping (Error?) -> Void) + class func remove(_ domain: NSFileProviderDomain) async throws class func getDomainsWithCompletionHandler(_ completionHandler: @escaping ([NSFileProviderDomain], Error?) -> Void) + class func getDomains() async throws -> [NSFileProviderDomain] class func removeAllDomains(completionHandler: @escaping (Error?) -> Void) + class func removeAllDomains() async throws } diff --git a/iOS/FileProvider/NSFileProviderActions.swift b/iOS/FileProvider/NSFileProviderActions.swift index ea852a4..f7cfdc9 100644 --- a/iOS/FileProvider/NSFileProviderActions.swift +++ b/iOS/FileProvider/NSFileProviderActions.swift @@ -3,21 +3,41 @@ extension NSFileProviderExtension { @available(iOS 8.0, *) func importDocument(at fileURL: URL, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) @available(iOS 8.0, *) + func importDocument(at fileURL: URL, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? + @available(iOS 8.0, *) func createDirectory(withName directoryName: String, inParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) @available(iOS 8.0, *) + func createDirectory(withName directoryName: String, inParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? + @available(iOS 8.0, *) func renameItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toName itemName: String, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) @available(iOS 8.0, *) + func renameItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toName itemName: String) async throws -> NSFileProviderItem? + @available(iOS 8.0, *) func reparentItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemWithIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, newName: String?, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) @available(iOS 8.0, *) + func reparentItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemWithIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, newName: String?) async throws -> NSFileProviderItem? + @available(iOS 8.0, *) func trashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) @available(iOS 8.0, *) + func trashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? + @available(iOS 8.0, *) func untrashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier?, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) @available(iOS 8.0, *) + func untrashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier?) async throws -> NSFileProviderItem? + @available(iOS 8.0, *) func deleteItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (Error?) -> Void) @available(iOS 8.0, *) + func deleteItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws + @available(iOS 8.0, *) func setLastUsedDate(_ lastUsedDate: Date?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) @available(iOS 8.0, *) + func setLastUsedDate(_ lastUsedDate: Date?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? + @available(iOS 8.0, *) func setTagData(_ tagData: Data?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) @available(iOS 8.0, *) + func setTagData(_ tagData: Data?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? + @available(iOS 8.0, *) func setFavoriteRank(_ favoriteRank: NSNumber?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) + @available(iOS 8.0, *) + func setFavoriteRank(_ favoriteRank: NSNumber?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? } diff --git a/iOS/FileProvider/NSFileProviderEnumerating.swift b/iOS/FileProvider/NSFileProviderEnumerating.swift index b3c1757..3f2f440 100644 --- a/iOS/FileProvider/NSFileProviderEnumerating.swift +++ b/iOS/FileProvider/NSFileProviderEnumerating.swift @@ -18,13 +18,13 @@ extension NSFileProviderPage { static let initialPageSortedByName: NSData } protocol NSFileProviderEnumerationObserver : NSObjectProtocol { - func didEnumerate(_ updatedItems: [NSFileProviderItemProtocol]) + @asyncHandler func didEnumerate(_ updatedItems: [NSFileProviderItemProtocol]) func finishEnumerating(upTo nextPage: NSFileProviderPage?) func finishEnumeratingWithError(_ error: Error) } protocol NSFileProviderChangeObserver : NSObjectProtocol { - func didUpdate(_ updatedItems: [NSFileProviderItemProtocol]) - func didDeleteItems(withIdentifiers deletedItemIdentifiers: [NSFileProviderItemIdentifier]) + @asyncHandler func didUpdate(_ updatedItems: [NSFileProviderItemProtocol]) + @asyncHandler func didDeleteItems(withIdentifiers deletedItemIdentifiers: [NSFileProviderItemIdentifier]) func finishEnumeratingChanges(upTo anchor: NSFileProviderSyncAnchor, moreComing: Bool) func finishEnumeratingWithError(_ error: Error) } @@ -33,6 +33,7 @@ protocol NSFileProviderEnumerator : NSObjectProtocol { func enumerateItems(for observer: NSFileProviderEnumerationObserver, startingAt page: NSFileProviderPage) optional func enumerateChanges(for observer: NSFileProviderChangeObserver, from syncAnchor: NSFileProviderSyncAnchor) optional func currentSyncAnchor(completionHandler: @escaping (NSFileProviderSyncAnchor?) -> Void) + optional func currentSyncAnchor() async -> NSFileProviderSyncAnchor? } extension NSFileProviderExtension { func enumerator(for containerItemIdentifier: NSFileProviderItemIdentifier) throws -> NSFileProviderEnumerator diff --git a/iOS/Foundation/NSBundle.swift b/iOS/Foundation/NSBundle.swift index 40fe7cd..1c892e4 100644 --- a/iOS/Foundation/NSBundle.swift +++ b/iOS/Foundation/NSBundle.swift @@ -99,7 +99,9 @@ class NSBundleResourceRequest : NSObject, ProgressReporting { var tags: Set { get } var bundle: Bundle { get } func beginAccessingResources(completionHandler: @escaping (Error?) -> Void) + func beginAccessingResources() async throws func conditionallyBeginAccessingResources(completionHandler: @escaping (Bool) -> Void) + func conditionallyBeginAccessingResources() async -> Bool func endAccessingResources() } extension Bundle { diff --git a/iOS/Foundation/NSExtensionContext.swift b/iOS/Foundation/NSExtensionContext.swift index 2e85434..4624399 100644 --- a/iOS/Foundation/NSExtensionContext.swift +++ b/iOS/Foundation/NSExtensionContext.swift @@ -3,8 +3,10 @@ class NSExtensionContext : NSObject { var inputItems: [Any] { get } func completeRequest(returningItems items: [Any]?, completionHandler: ((Bool) -> Void)? = nil) + func completeRequest(returningItems items: [Any]?) async -> Bool func cancelRequest(withError error: Error) func open(_ URL: URL, completionHandler: ((Bool) -> Void)? = nil) + func open(_ URL: URL) async -> Bool } @available(iOS 8.0, *) let NSExtensionItemsAndErrorsKey: String diff --git a/iOS/Foundation/NSFileManager.swift b/iOS/Foundation/NSFileManager.swift index d82c9fc..58f485f 100644 --- a/iOS/Foundation/NSFileManager.swift +++ b/iOS/Foundation/NSFileManager.swift @@ -117,6 +117,8 @@ class FileManager : NSObject { @NSCopying var ubiquityIdentityToken: (NSCoding & NSCopying & NSObjectProtocol)? { get } @available(iOS 11.0, *) func getFileProviderServicesForItem(at url: URL, completionHandler: @escaping ([NSFileProviderServiceName : NSFileProviderService]?, Error?) -> Void) + @available(iOS 11.0, *) + func getFileProviderServicesForItem(at url: URL) async throws -> [NSFileProviderServiceName : NSFileProviderService]? @available(iOS 7.0, *) func containerURL(forSecurityApplicationGroupIdentifier groupIdentifier: String) -> URL? } @@ -212,6 +214,7 @@ extension FileManager { @available(iOS 11.0, *) class NSFileProviderService : NSObject { func getFileProviderConnection(completionHandler: @escaping (NSXPCConnection?, Error?) -> Void) + func getFileProviderConnection() async throws -> NSXPCConnection? var name: NSFileProviderServiceName { get } } extension FileAttributeKey { diff --git a/iOS/Foundation/NSFilePresenter.swift b/iOS/Foundation/NSFilePresenter.swift index de811af..4256b55 100644 --- a/iOS/Foundation/NSFilePresenter.swift +++ b/iOS/Foundation/NSFilePresenter.swift @@ -6,27 +6,30 @@ protocol NSFilePresenter : NSObjectProtocol { optional func relinquishPresentedItem(toReader reader: @escaping ((() -> Void)?) -> Void) optional func relinquishPresentedItem(toWriter writer: @escaping ((() -> Void)?) -> Void) optional func savePresentedItemChanges(completionHandler: @escaping (Error?) -> Void) + optional func savePresentedItemChanges() async throws optional func accommodatePresentedItemDeletion(completionHandler: @escaping (Error?) -> Void) - optional func presentedItemDidMove(to newURL: URL) - optional func presentedItemDidChange() + optional func accommodatePresentedItemDeletion() async throws + @asyncHandler optional func presentedItemDidMove(to newURL: URL) + @asyncHandler optional func presentedItemDidChange() @available(iOS 11.0, *) - optional func presentedItemDidChangeUbiquityAttributes(_ attributes: Set) + @asyncHandler optional func presentedItemDidChangeUbiquityAttributes(_ attributes: Set) @available(iOS 11.0, *) optional var observedPresentedItemUbiquityAttributes: Set { get } @available(iOS 5.0, *) - optional func presentedItemDidGain(_ version: NSFileVersion) + @asyncHandler optional func presentedItemDidGain(_ version: NSFileVersion) @available(iOS 5.0, *) - optional func presentedItemDidLose(_ version: NSFileVersion) + @asyncHandler optional func presentedItemDidLose(_ version: NSFileVersion) @available(iOS 5.0, *) - optional func presentedItemDidResolveConflict(_ version: NSFileVersion) + @asyncHandler optional func presentedItemDidResolveConflict(_ version: NSFileVersion) optional func accommodatePresentedSubitemDeletion(at url: URL, completionHandler: @escaping (Error?) -> Void) - optional func presentedSubitemDidAppear(at url: URL) - optional func presentedSubitem(at oldURL: URL, didMoveTo newURL: URL) - optional func presentedSubitemDidChange(at url: URL) + optional func accommodatePresentedSubitemDeletion(at url: URL) async throws + @asyncHandler optional func presentedSubitemDidAppear(at url: URL) + @asyncHandler optional func presentedSubitem(at oldURL: URL, didMoveTo newURL: URL) + @asyncHandler optional func presentedSubitemDidChange(at url: URL) @available(iOS 5.0, *) - optional func presentedSubitem(at url: URL, didGain version: NSFileVersion) + @asyncHandler optional func presentedSubitem(at url: URL, didGain version: NSFileVersion) @available(iOS 5.0, *) - optional func presentedSubitem(at url: URL, didLose version: NSFileVersion) + @asyncHandler optional func presentedSubitem(at url: URL, didLose version: NSFileVersion) @available(iOS 5.0, *) - optional func presentedSubitem(at url: URL, didResolve version: NSFileVersion) + @asyncHandler optional func presentedSubitem(at url: URL, didResolve version: NSFileVersion) } diff --git a/iOS/Foundation/NSFileVersion.swift b/iOS/Foundation/NSFileVersion.swift index df2a724..eedf01e 100644 --- a/iOS/Foundation/NSFileVersion.swift +++ b/iOS/Foundation/NSFileVersion.swift @@ -18,6 +18,8 @@ class NSFileVersion : NSObject { class func unresolvedConflictVersionsOfItem(at url: URL) -> [NSFileVersion]? @available(iOS 8.0, *) class func getNonlocalVersionsOfItem(at url: URL, completionHandler: @escaping ([NSFileVersion]?, Error?) -> Void) + @available(iOS 8.0, *) + class func getNonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion]? class func version(itemAt url: URL, forPersistentIdentifier persistentIdentifier: Any) -> NSFileVersion? var url: URL { get } var localizedName: String? { get } diff --git a/iOS/Foundation/NSHTTPCookieStorage.swift b/iOS/Foundation/NSHTTPCookieStorage.swift index 64f575a..7ff1993 100644 --- a/iOS/Foundation/NSHTTPCookieStorage.swift +++ b/iOS/Foundation/NSHTTPCookieStorage.swift @@ -29,6 +29,8 @@ extension HTTPCookieStorage { func storeCookies(_ cookies: [HTTPCookie], for task: URLSessionTask) @available(iOS 8.0, *) func getCookiesFor(_ task: URLSessionTask, completionHandler: @escaping ([HTTPCookie]?) -> Void) + @available(iOS 8.0, *) + func getCookiesFor(_ task: URLSessionTask) async -> [HTTPCookie]? } extension NSNotification.Name { @available(iOS 2.0, *) diff --git a/iOS/Foundation/NSItemProvider.swift b/iOS/Foundation/NSItemProvider.swift index 6d01366..cf7c3fb 100644 --- a/iOS/Foundation/NSItemProvider.swift +++ b/iOS/Foundation/NSItemProvider.swift @@ -77,6 +77,7 @@ class NSItemProvider : NSObject, NSCopying { convenience init?(contentsOf fileURL: URL!) func registerItem(forTypeIdentifier typeIdentifier: String, loadHandler: @escaping NSItemProvider.LoadHandler) func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil, completionHandler: NSItemProvider.CompletionHandler? = nil) + func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding? } @available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) @@ -95,6 +96,8 @@ extension NSItemProvider { var previewImageHandler: NSItemProvider.LoadHandler? @available(iOS 8.0, *) func loadPreviewImage(options: [AnyHashable : Any]! = [:], completionHandler: NSItemProvider.CompletionHandler!) + @available(iOS 8.0, *) + func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding? } @available(iOS 8.0, *) let NSExtensionJavaScriptPreprocessingResultsKey: String diff --git a/iOS/Foundation/NSKeyedArchiver.swift b/iOS/Foundation/NSKeyedArchiver.swift index c307c6e..ca5125a 100644 --- a/iOS/Foundation/NSKeyedArchiver.swift +++ b/iOS/Foundation/NSKeyedArchiver.swift @@ -80,17 +80,17 @@ extension NSKeyedUnarchiver { } protocol NSKeyedArchiverDelegate : NSObjectProtocol { optional func archiver(_ archiver: NSKeyedArchiver, willEncode object: Any) -> Any? - optional func archiver(_ archiver: NSKeyedArchiver, didEncode object: Any?) + @asyncHandler optional func archiver(_ archiver: NSKeyedArchiver, didEncode object: Any?) optional func archiver(_ archiver: NSKeyedArchiver, willReplace object: Any?, with newObject: Any?) optional func archiverWillFinish(_ archiver: NSKeyedArchiver) - optional func archiverDidFinish(_ archiver: NSKeyedArchiver) + @asyncHandler optional func archiverDidFinish(_ archiver: NSKeyedArchiver) } protocol NSKeyedUnarchiverDelegate : NSObjectProtocol { optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, cannotDecodeObjectOfClassName name: String, originalClasses classNames: [String]) -> AnyClass? optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, didDecode object: Any?) -> Any? optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, willReplace object: Any, with newObject: Any) optional func unarchiverWillFinish(_ unarchiver: NSKeyedUnarchiver) - optional func unarchiverDidFinish(_ unarchiver: NSKeyedUnarchiver) + @asyncHandler optional func unarchiverDidFinish(_ unarchiver: NSKeyedUnarchiver) } extension NSObject { var classForKeyedArchiver: AnyClass? { get } diff --git a/iOS/Foundation/NSNetServices.swift b/iOS/Foundation/NSNetServices.swift index 5a93c79..e711800 100644 --- a/iOS/Foundation/NSNetServices.swift +++ b/iOS/Foundation/NSNetServices.swift @@ -70,23 +70,23 @@ class NetServiceBrowser : NSObject { @available(iOS 2.0, *) protocol NetServiceDelegate : NSObjectProtocol { optional func netServiceWillPublish(_ sender: NetService) - optional func netServiceDidPublish(_ sender: NetService) - optional func netService(_ sender: NetService, didNotPublish errorDict: [String : NSNumber]) + @asyncHandler optional func netServiceDidPublish(_ sender: NetService) + @asyncHandler optional func netService(_ sender: NetService, didNotPublish errorDict: [String : NSNumber]) optional func netServiceWillResolve(_ sender: NetService) - optional func netServiceDidResolveAddress(_ sender: NetService) - optional func netService(_ sender: NetService, didNotResolve errorDict: [String : NSNumber]) - optional func netServiceDidStop(_ sender: NetService) - optional func netService(_ sender: NetService, didUpdateTXTRecord data: Data) + @asyncHandler optional func netServiceDidResolveAddress(_ sender: NetService) + @asyncHandler optional func netService(_ sender: NetService, didNotResolve errorDict: [String : NSNumber]) + @asyncHandler optional func netServiceDidStop(_ sender: NetService) + @asyncHandler optional func netService(_ sender: NetService, didUpdateTXTRecord data: Data) @available(iOS 7.0, *) - optional func netService(_ sender: NetService, didAcceptConnectionWith inputStream: InputStream, outputStream: OutputStream) + @asyncHandler optional func netService(_ sender: NetService, didAcceptConnectionWith inputStream: InputStream, outputStream: OutputStream) } @available(iOS 2.0, *) protocol NetServiceBrowserDelegate : NSObjectProtocol { optional func netServiceBrowserWillSearch(_ browser: NetServiceBrowser) - optional func netServiceBrowserDidStopSearch(_ browser: NetServiceBrowser) - optional func netServiceBrowser(_ browser: NetServiceBrowser, didNotSearch errorDict: [String : NSNumber]) - optional func netServiceBrowser(_ browser: NetServiceBrowser, didFindDomain domainString: String, moreComing: Bool) - optional func netServiceBrowser(_ browser: NetServiceBrowser, didFind service: NetService, moreComing: Bool) - optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemoveDomain domainString: String, moreComing: Bool) - optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemove service: NetService, moreComing: Bool) + @asyncHandler optional func netServiceBrowserDidStopSearch(_ browser: NetServiceBrowser) + @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didNotSearch errorDict: [String : NSNumber]) + @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didFindDomain domainString: String, moreComing: Bool) + @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didFind service: NetService, moreComing: Bool) + @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemoveDomain domainString: String, moreComing: Bool) + @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemove service: NetService, moreComing: Bool) } diff --git a/iOS/Foundation/NSURLCache.swift b/iOS/Foundation/NSURLCache.swift index 2a6a278..3b69788 100644 --- a/iOS/Foundation/NSURLCache.swift +++ b/iOS/Foundation/NSURLCache.swift @@ -46,5 +46,7 @@ extension URLCache { @available(iOS 8.0, *) func getCachedResponse(for dataTask: URLSessionDataTask, completionHandler: @escaping (CachedURLResponse?) -> Void) @available(iOS 8.0, *) + func getCachedResponse(for dataTask: URLSessionDataTask) async -> CachedURLResponse? + @available(iOS 8.0, *) func removeCachedResponse(for dataTask: URLSessionDataTask) } diff --git a/iOS/Foundation/NSURLConnection.swift b/iOS/Foundation/NSURLConnection.swift index bcc0a2b..036f9b9 100644 --- a/iOS/Foundation/NSURLConnection.swift +++ b/iOS/Foundation/NSURLConnection.swift @@ -22,31 +22,31 @@ class NSURLConnection : NSObject { } @available(iOS 2.0, *) protocol NSURLConnectionDelegate : NSObjectProtocol { - optional func connection(_ connection: NSURLConnection, didFailWithError error: Error) + @asyncHandler optional func connection(_ connection: NSURLConnection, didFailWithError error: Error) optional func connectionShouldUseCredentialStorage(_ connection: NSURLConnection) -> Bool optional func connection(_ connection: NSURLConnection, willSendRequestFor challenge: URLAuthenticationChallenge) @available(iOS, introduced: 3.0, deprecated: 8.0, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") optional func connection(_ connection: NSURLConnection, canAuthenticateAgainstProtectionSpace protectionSpace: URLProtectionSpace) -> Bool @available(iOS, introduced: 2.0, deprecated: 8.0, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") - optional func connection(_ connection: NSURLConnection, didReceive challenge: URLAuthenticationChallenge) + @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive challenge: URLAuthenticationChallenge) @available(iOS, introduced: 2.0, deprecated: 8.0, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") - optional func connection(_ connection: NSURLConnection, didCancel challenge: URLAuthenticationChallenge) + @asyncHandler optional func connection(_ connection: NSURLConnection, didCancel challenge: URLAuthenticationChallenge) } @available(iOS 2.0, *) protocol NSURLConnectionDataDelegate : NSURLConnectionDelegate { optional func connection(_ connection: NSURLConnection, willSend request: URLRequest, redirectResponse response: URLResponse?) -> URLRequest? - optional func connection(_ connection: NSURLConnection, didReceive response: URLResponse) - optional func connection(_ connection: NSURLConnection, didReceive data: Data) + @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive response: URLResponse) + @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive data: Data) optional func connection(_ connection: NSURLConnection, needNewBodyStream request: URLRequest) -> InputStream? - optional func connection(_ connection: NSURLConnection, didSendBodyData bytesWritten: Int, totalBytesWritten: Int, totalBytesExpectedToWrite: Int) + @asyncHandler optional func connection(_ connection: NSURLConnection, didSendBodyData bytesWritten: Int, totalBytesWritten: Int, totalBytesExpectedToWrite: Int) optional func connection(_ connection: NSURLConnection, willCacheResponse cachedResponse: CachedURLResponse) -> CachedURLResponse? - optional func connectionDidFinishLoading(_ connection: NSURLConnection) + @asyncHandler optional func connectionDidFinishLoading(_ connection: NSURLConnection) } @available(iOS 2.0, *) protocol NSURLConnectionDownloadDelegate : NSURLConnectionDelegate { - optional func connection(_ connection: NSURLConnection, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, expectedTotalBytes: Int64) - optional func connectionDidResumeDownloading(_ connection: NSURLConnection, totalBytesWritten: Int64, expectedTotalBytes: Int64) - func connectionDidFinishDownloading(_ connection: NSURLConnection, destinationURL: URL) + @asyncHandler optional func connection(_ connection: NSURLConnection, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, expectedTotalBytes: Int64) + @asyncHandler optional func connectionDidResumeDownloading(_ connection: NSURLConnection, totalBytesWritten: Int64, expectedTotalBytes: Int64) + @asyncHandler func connectionDidFinishDownloading(_ connection: NSURLConnection, destinationURL: URL) } extension NSURLConnection { @available(iOS, introduced: 2.0, deprecated: 9.0, message: "Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h") @@ -55,4 +55,6 @@ extension NSURLConnection { extension NSURLConnection { @available(iOS, introduced: 5.0, deprecated: 9.0, message: "Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h") class func sendAsynchronousRequest(_ request: URLRequest, queue: OperationQueue, completionHandler handler: @escaping (URLResponse?, Data?, Error?) -> Void) + @available(iOS, introduced: 5.0, deprecated: 9.0, message: "Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h") + class func sendAsynchronousRequest(_ request: URLRequest, queue: OperationQueue) async throws -> (URLResponse?, Data?) } diff --git a/iOS/Foundation/NSURLCredentialStorage.swift b/iOS/Foundation/NSURLCredentialStorage.swift index 7f8ca50..bafd134 100644 --- a/iOS/Foundation/NSURLCredentialStorage.swift +++ b/iOS/Foundation/NSURLCredentialStorage.swift @@ -15,12 +15,16 @@ extension URLCredentialStorage { @available(iOS 8.0, *) func getCredentials(for protectionSpace: URLProtectionSpace, task: URLSessionTask, completionHandler: @escaping ([String : URLCredential]?) -> Void) @available(iOS 8.0, *) + func getCredentials(for protectionSpace: URLProtectionSpace, task: URLSessionTask) async -> [String : URLCredential]? + @available(iOS 8.0, *) func set(_ credential: URLCredential, for protectionSpace: URLProtectionSpace, task: URLSessionTask) @available(iOS 8.0, *) func remove(_ credential: URLCredential, for protectionSpace: URLProtectionSpace, options: [String : Any]? = nil, task: URLSessionTask) @available(iOS 8.0, *) func getDefaultCredential(for space: URLProtectionSpace, task: URLSessionTask, completionHandler: @escaping (URLCredential?) -> Void) @available(iOS 8.0, *) + func getDefaultCredential(for space: URLProtectionSpace, task: URLSessionTask) async -> URLCredential? + @available(iOS 8.0, *) func setDefaultCredential(_ credential: URLCredential, for protectionSpace: URLProtectionSpace, task: URLSessionTask) } extension NSNotification.Name { diff --git a/iOS/Foundation/NSURLProtocol.swift b/iOS/Foundation/NSURLProtocol.swift index 2e177ef..69d1a15 100644 --- a/iOS/Foundation/NSURLProtocol.swift +++ b/iOS/Foundation/NSURLProtocol.swift @@ -3,12 +3,12 @@ protocol URLProtocolClient : NSObjectProtocol { func urlProtocol(_ protocol: URLProtocol, wasRedirectedTo request: URLRequest, redirectResponse: URLResponse) func urlProtocol(_ protocol: URLProtocol, cachedResponseIsValid cachedResponse: CachedURLResponse) - func urlProtocol(_ protocol: URLProtocol, didReceive response: URLResponse, cacheStoragePolicy policy: URLCache.StoragePolicy) - func urlProtocol(_ protocol: URLProtocol, didLoad data: Data) - func urlProtocolDidFinishLoading(_ protocol: URLProtocol) - func urlProtocol(_ protocol: URLProtocol, didFailWithError error: Error) - func urlProtocol(_ protocol: URLProtocol, didReceive challenge: URLAuthenticationChallenge) - func urlProtocol(_ protocol: URLProtocol, didCancel challenge: URLAuthenticationChallenge) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didReceive response: URLResponse, cacheStoragePolicy policy: URLCache.StoragePolicy) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didLoad data: Data) + @asyncHandler func urlProtocolDidFinishLoading(_ protocol: URLProtocol) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didFailWithError error: Error) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didReceive challenge: URLAuthenticationChallenge) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didCancel challenge: URLAuthenticationChallenge) } @available(iOS 2.0, *) class URLProtocol : NSObject { diff --git a/iOS/Foundation/NSURLSession.swift b/iOS/Foundation/NSURLSession.swift index 0c79a13..a251220 100644 --- a/iOS/Foundation/NSURLSession.swift +++ b/iOS/Foundation/NSURLSession.swift @@ -13,10 +13,15 @@ class URLSession : NSObject { func finishTasksAndInvalidate() func invalidateAndCancel() func reset(completionHandler: @escaping () -> Void) + func reset() async func flush(completionHandler: @escaping () -> Void) + func flush() async func getTasksWithCompletionHandler(_ completionHandler: @escaping ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) -> Void) + func getTasks() async -> ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) @available(iOS 9.0, *) func getAllTasks(completionHandler: @escaping ([URLSessionTask]) -> Void) + @available(iOS 9.0, *) + func getAllTasks() async -> [URLSessionTask] func dataTask(with request: URLRequest) -> URLSessionDataTask func dataTask(with url: URL) -> URLSessionDataTask func uploadTask(with request: URLRequest, fromFile fileURL: URL) -> URLSessionUploadTask @@ -119,11 +124,14 @@ class URLSessionUploadTask : URLSessionDataTask { @available(iOS 7.0, *) class URLSessionDownloadTask : URLSessionTask { func cancel(byProducingResumeData completionHandler: @escaping (Data?) -> Void) + func cancelByProducingResumeData() async -> Data? } @available(iOS 9.0, *) class URLSessionStreamTask : URLSessionTask { func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval, completionHandler: @escaping (Data?, Bool, Error?) -> Void) + func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval) async throws -> (Data?, Bool) func write(_ data: Data, timeout: TimeInterval, completionHandler: @escaping (Error?) -> Void) + func write(_ data: Data, timeout: TimeInterval) async throws func captureStreams() func closeWrite() func closeRead() @@ -169,7 +177,9 @@ extension URLSessionWebSocketTask { @available(iOS 13.0, *) class URLSessionWebSocketTask : URLSessionTask { func __send(_ message: __NSURLSessionWebSocketMessage, completionHandler: @escaping (Error?) -> Void) + func __send(_ message: __NSURLSessionWebSocketMessage) async throws func __receiveMessage(completionHandler: @escaping (__NSURLSessionWebSocketMessage?, Error?) -> Void) + func __receiveMessage() async throws -> __NSURLSessionWebSocketMessage? func sendPing(pongReceiveHandler: @escaping (Error?) -> Void) func cancel(with closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) var maximumMessageSize: Int @@ -275,51 +285,59 @@ extension URLSession { } @available(iOS 7.0, *) protocol URLSessionDelegate : NSObjectProtocol { - optional func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) - optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + @asyncHandler optional func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) + @asyncHandler optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) @available(iOS 7.0, *) - optional func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) + @asyncHandler optional func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) } @available(iOS 7.0, *) protocol URLSessionTaskDelegate : URLSessionDelegate { @available(iOS 11.0, *) optional func urlSession(_ session: URLSession, task: URLSessionTask, willBeginDelayedRequest request: URLRequest, completionHandler: @escaping (URLSession.DelayedRequestDisposition, URLRequest?) -> Void) @available(iOS 11.0, *) + optional func urlSession(_ session: URLSession, task: URLSessionTask, willBeginDelayedRequest request: URLRequest) async -> (URLSession.DelayedRequestDisposition, URLRequest?) + @available(iOS 11.0, *) optional func urlSession(_ session: URLSession, taskIsWaitingForConnectivity task: URLSessionTask) optional func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest, completionHandler: @escaping (URLRequest?) -> Void) - optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest) async -> URLRequest? + @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) optional func urlSession(_ session: URLSession, task: URLSessionTask, needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) - optional func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) + optional func urlSession(_ session: URLSession, task: URLSessionTask) async -> InputStream? + @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) @available(iOS 10.0, *) - optional func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) - optional func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) + @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) + @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) } @available(iOS 7.0, *) protocol URLSessionDataDelegate : URLSessionTaskDelegate { - optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) - optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome downloadTask: URLSessionDownloadTask) + @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse) async -> URLSession.ResponseDisposition + @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome downloadTask: URLSessionDownloadTask) @available(iOS 9.0, *) - optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome streamTask: URLSessionStreamTask) - optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) + @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome streamTask: URLSessionStreamTask) + @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse, completionHandler: @escaping (CachedURLResponse?) -> Void) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse) async -> CachedURLResponse? } @available(iOS 7.0, *) protocol URLSessionDownloadDelegate : URLSessionTaskDelegate { - func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) - optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) - optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) + @asyncHandler func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) + @asyncHandler optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) + @asyncHandler optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) } @available(iOS 9.0, *) protocol URLSessionStreamDelegate : URLSessionTaskDelegate { optional func urlSession(_ session: URLSession, readClosedFor streamTask: URLSessionStreamTask) optional func urlSession(_ session: URLSession, writeClosedFor streamTask: URLSessionStreamTask) optional func urlSession(_ session: URLSession, betterRouteDiscoveredFor streamTask: URLSessionStreamTask) - optional func urlSession(_ session: URLSession, streamTask: URLSessionStreamTask, didBecome inputStream: InputStream, outputStream: OutputStream) + @asyncHandler optional func urlSession(_ session: URLSession, streamTask: URLSessionStreamTask, didBecome inputStream: InputStream, outputStream: OutputStream) } @available(iOS 13.0, *) protocol URLSessionWebSocketDelegate : URLSessionTaskDelegate { - optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) - optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) + @asyncHandler optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) + @asyncHandler optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) } @available(iOS 7.0, *) let NSURLSessionDownloadTaskResumeData: String diff --git a/iOS/Foundation/NSUserActivity.swift b/iOS/Foundation/NSUserActivity.swift index d9e18ec..4ae2d3a 100644 --- a/iOS/Foundation/NSUserActivity.swift +++ b/iOS/Foundation/NSUserActivity.swift @@ -26,6 +26,7 @@ class NSUserActivity : NSObject { func resignCurrent() func invalidate() func getContinuationStreams(completionHandler: @escaping (InputStream?, OutputStream?, Error?) -> Void) + func getContinuationStreams() async throws -> (InputStream?, OutputStream?) @available(iOS 9.0, *) var isEligibleForHandoff: Bool @available(iOS 9.0, *) @@ -39,12 +40,16 @@ class NSUserActivity : NSObject { @available(iOS 12.0, *) class func deleteSavedUserActivities(withPersistentIdentifiers persistentIdentifiers: [NSUserActivityPersistentIdentifier], completionHandler handler: @escaping () -> Void) @available(iOS 12.0, *) + class func deleteSavedUserActivities(withPersistentIdentifiers persistentIdentifiers: [NSUserActivityPersistentIdentifier]) async + @available(iOS 12.0, *) class func deleteAllSavedUserActivities(completionHandler handler: @escaping () -> Void) + @available(iOS 12.0, *) + class func deleteAllSavedUserActivities() async } let NSUserActivityTypeBrowsingWeb: String @available(iOS 8.0, *) protocol NSUserActivityDelegate : NSObjectProtocol { optional func userActivityWillSave(_ userActivity: NSUserActivity) optional func userActivityWasContinued(_ userActivity: NSUserActivity) - optional func userActivity(_ userActivity: NSUserActivity, didReceive inputStream: InputStream, outputStream: OutputStream) + @asyncHandler optional func userActivity(_ userActivity: NSUserActivity, didReceive inputStream: InputStream, outputStream: OutputStream) } diff --git a/iOS/Foundation/NSXMLParser.swift b/iOS/Foundation/NSXMLParser.swift index bb29a90..36213c0 100644 --- a/iOS/Foundation/NSXMLParser.swift +++ b/iOS/Foundation/NSXMLParser.swift @@ -23,18 +23,18 @@ extension XMLParser { var columnNumber: Int { get } } protocol XMLParserDelegate : NSObjectProtocol { - optional func parserDidStartDocument(_ parser: XMLParser) - optional func parserDidEndDocument(_ parser: XMLParser) + @asyncHandler optional func parserDidStartDocument(_ parser: XMLParser) + @asyncHandler optional func parserDidEndDocument(_ parser: XMLParser) optional func parser(_ parser: XMLParser, foundNotationDeclarationWithName name: String, publicID: String?, systemID: String?) optional func parser(_ parser: XMLParser, foundUnparsedEntityDeclarationWithName name: String, publicID: String?, systemID: String?, notationName: String?) optional func parser(_ parser: XMLParser, foundAttributeDeclarationWithName attributeName: String, forElement elementName: String, type: String?, defaultValue: String?) optional func parser(_ parser: XMLParser, foundElementDeclarationWithName elementName: String, model: String) optional func parser(_ parser: XMLParser, foundInternalEntityDeclarationWithName name: String, value: String?) optional func parser(_ parser: XMLParser, foundExternalEntityDeclarationWithName name: String, publicID: String?, systemID: String?) - optional func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) - optional func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) - optional func parser(_ parser: XMLParser, didStartMappingPrefix prefix: String, toURI namespaceURI: String) - optional func parser(_ parser: XMLParser, didEndMappingPrefix prefix: String) + @asyncHandler optional func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) + @asyncHandler optional func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) + @asyncHandler optional func parser(_ parser: XMLParser, didStartMappingPrefix prefix: String, toURI namespaceURI: String) + @asyncHandler optional func parser(_ parser: XMLParser, didEndMappingPrefix prefix: String) optional func parser(_ parser: XMLParser, foundCharacters string: String) optional func parser(_ parser: XMLParser, foundIgnorableWhitespace whitespaceString: String) optional func parser(_ parser: XMLParser, foundProcessingInstructionWithTarget target: String, data: String?) diff --git a/iOS/GLKit/GLKTextureLoader.swift b/iOS/GLKit/GLKTextureLoader.swift index 533c0f3..1fce2c9 100644 --- a/iOS/GLKit/GLKTextureLoader.swift +++ b/iOS/GLKit/GLKTextureLoader.swift @@ -82,11 +82,19 @@ class GLKTextureLoader : NSObject { class func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil) throws -> GLKTextureInfo init(sharegroup: EAGLSharegroup) func texture(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func texture(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func texture(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func texture(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func texture(withName name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func texture(withName name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func texture(withContentsOf data: Data, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func texture(withContentsOf data: Data, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func texture(with cgImage: CGImage, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func texture(with cgImage: CGImage, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func cubeMap(withContentsOfFiles paths: [Any], options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func cubeMap(withContentsOfFiles paths: [Any], options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func cubeMap(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func cubeMap(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? } diff --git a/iOS/GameController/GCController.swift b/iOS/GameController/GCController.swift index 0e4007a..330bc2a 100644 --- a/iOS/GameController/GCController.swift +++ b/iOS/GameController/GCController.swift @@ -44,6 +44,7 @@ class GCController : NSObject, GCDevice { func capture() -> GCController class func controllers() -> [GCController] class func startWirelessControllerDiscovery(completionHandler: (() -> Void)? = nil) + class func startWirelessControllerDiscovery() async class func stopWirelessControllerDiscovery() @available(iOS 13.0, *) class func withMicroGamepad() -> GCController diff --git a/iOS/GameKit/GKAchievement.swift b/iOS/GameKit/GKAchievement.swift index 64364a8..ac39b09 100644 --- a/iOS/GameKit/GKAchievement.swift +++ b/iOS/GameKit/GKAchievement.swift @@ -2,12 +2,16 @@ @available(iOS 4.1, *) class GKAchievement : NSObject, NSCoding, NSSecureCoding { class func loadAchievements(completionHandler: (([GKAchievement]?, Error?) -> Void)? = nil) + class func loadAchievements() async throws -> [GKAchievement]? class func resetAchievements(completionHandler: ((Error?) -> Void)? = nil) + class func resetAchievements() async throws init(identifier: String) @available(iOS 8.0, *) init(identifier: String, player: GKPlayer) @available(iOS 6.0, *) class func report(_ achievements: [GKAchievement], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + @available(iOS 6.0, *) + class func report(_ achievements: [GKAchievement]) async throws var identifier: String var percentComplete: Double var isCompleted: Bool { get } diff --git a/iOS/GameKit/GKAchievementDescription.swift b/iOS/GameKit/GKAchievementDescription.swift index 91b02c7..1806936 100644 --- a/iOS/GameKit/GKAchievementDescription.swift +++ b/iOS/GameKit/GKAchievementDescription.swift @@ -2,6 +2,7 @@ @available(iOS 4.1, *) class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { class func loadAchievementDescriptions(completionHandler: (([GKAchievementDescription]?, Error?) -> Void)? = nil) + class func loadAchievementDescriptions() async throws -> [GKAchievementDescription]? var identifier: String { get } @available(iOS 6.0, *) var groupIdentifier: String? { get } @@ -15,6 +16,7 @@ class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { } extension GKAchievementDescription { func loadImage(completionHandler: ((UIImage?, Error?) -> Void)? = nil) + func loadImage() async throws -> UIImage? class func incompleteAchievementImage() -> UIImage class func placeholderCompletedAchievementImage() -> UIImage } diff --git a/iOS/GameKit/GKChallenge.swift b/iOS/GameKit/GKChallenge.swift index a41186d..ab8196b 100644 --- a/iOS/GameKit/GKChallenge.swift +++ b/iOS/GameKit/GKChallenge.swift @@ -10,6 +10,7 @@ enum GKChallengeState : Int { @available(iOS 6.0, *) class GKChallenge : NSObject, NSCoding, NSSecureCoding { class func loadReceivedChallenges(completionHandler: (([GKChallenge]?, Error?) -> Void)? = nil) + class func loadReceivedChallenges() async throws -> [GKChallenge]? func decline() @available(iOS 8.0, *) @NSCopying var issuingPlayer: GKPlayer? { get } @@ -37,20 +38,30 @@ class GKAchievementChallenge : GKChallenge { extension GKScore { @available(iOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to reportLeaderboardScores:withEligibleChallenges:withCompletionHandler instead") class func report(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + @available(iOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to reportLeaderboardScores:withEligibleChallenges:withCompletionHandler instead") + class func report(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge]) async throws @available(iOS 14.0, *) class func report(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + @available(iOS 14.0, *) + class func report(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge]) async throws } extension GKAchievement { @available(iOS 8.0, *) func selectChallengeablePlayers(_ players: [GKPlayer], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + @available(iOS 8.0, *) + func selectChallengeablePlayers(_ players: [GKPlayer]) async throws -> [GKPlayer]? @available(iOS 7.0, *) class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + @available(iOS 7.0, *) + class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge]) async throws } extension GKScore { } extension GKAchievement { @available(iOS, introduced: 6.0, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, pass GKPlayers to selectChallengeablePlayers:") func selectChallengeablePlayerIDs(_ playerIDs: [String]?, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) + @available(iOS, introduced: 6.0, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, pass GKPlayers to selectChallengeablePlayers:") + func selectChallengeablePlayerIDs(_ playerIDs: [String]?) async throws -> [String]? } typealias GKChallengeComposeCompletionBlock = (UIViewController, Bool, [String]?) -> Void extension GKScore { diff --git a/iOS/GameKit/GKCloudPlayer.swift b/iOS/GameKit/GKCloudPlayer.swift index f4a273c..bcc8705 100644 --- a/iOS/GameKit/GKCloudPlayer.swift +++ b/iOS/GameKit/GKCloudPlayer.swift @@ -2,4 +2,5 @@ @available(iOS, introduced: 10.0, deprecated: 12.0, message: "GKGameSession is deprecated. Use GKPlayer for both real-time and turn-based matchmaking APIs.") class GKCloudPlayer : GKBasePlayer { class func getCurrentSignedInPlayer(forContainer containerName: String?, completionHandler handler: @escaping (GKCloudPlayer?, Error?) -> Void) + class func getCurrentSignedInPlayer(forContainer containerName: String?) async throws -> GKCloudPlayer? } diff --git a/iOS/GameKit/GKEventListener.swift b/iOS/GameKit/GKEventListener.swift index dffdcab..c4240ae 100644 --- a/iOS/GameKit/GKEventListener.swift +++ b/iOS/GameKit/GKEventListener.swift @@ -3,9 +3,9 @@ protocol GKChallengeListener : NSObjectProtocol { @available(iOS 7.0, *) optional func player(_ player: GKPlayer, wantsToPlay challenge: GKChallenge) @available(iOS 7.0, *) - optional func player(_ player: GKPlayer, didReceive challenge: GKChallenge) + @asyncHandler optional func player(_ player: GKPlayer, didReceive challenge: GKChallenge) @available(iOS 7.0, *) - optional func player(_ player: GKPlayer, didComplete challenge: GKChallenge, issuedByFriend friendPlayer: GKPlayer) + @asyncHandler optional func player(_ player: GKPlayer, didComplete challenge: GKChallenge, issuedByFriend friendPlayer: GKPlayer) @available(iOS 7.0, *) optional func player(_ player: GKPlayer, issuedChallengeWasCompleted challenge: GKChallenge, byFriend friendPlayer: GKPlayer) } diff --git a/iOS/GameKit/GKFriendRequestComposeViewController.swift b/iOS/GameKit/GKFriendRequestComposeViewController.swift index 1743ad5..6b22b61 100644 --- a/iOS/GameKit/GKFriendRequestComposeViewController.swift +++ b/iOS/GameKit/GKFriendRequestComposeViewController.swift @@ -16,5 +16,5 @@ extension GKFriendRequestComposeViewController { @available(iOS, introduced: 4.2, deprecated: 10.0) protocol GKFriendRequestComposeViewControllerDelegate { @available(iOS, introduced: 4.2, deprecated: 10.0) - func friendRequestComposeViewControllerDidFinish(_ viewController: GKFriendRequestComposeViewController) + @asyncHandler func friendRequestComposeViewControllerDidFinish(_ viewController: GKFriendRequestComposeViewController) } diff --git a/iOS/GameKit/GKGameCenterViewController.swift b/iOS/GameKit/GKGameCenterViewController.swift index 66bdc3f..c4e5b49 100644 --- a/iOS/GameKit/GKGameCenterViewController.swift +++ b/iOS/GameKit/GKGameCenterViewController.swift @@ -33,5 +33,5 @@ extension GKGameCenterViewController { } protocol GKGameCenterControllerDelegate : NSObjectProtocol { @available(iOS 6.0, *) - func gameCenterViewControllerDidFinish(_ gameCenterViewController: GKGameCenterViewController) + @asyncHandler func gameCenterViewControllerDidFinish(_ gameCenterViewController: GKGameCenterViewController) } diff --git a/iOS/GameKit/GKGameSession.swift b/iOS/GameKit/GKGameSession.swift index ae762a1..bb427fd 100644 --- a/iOS/GameKit/GKGameSession.swift +++ b/iOS/GameKit/GKGameSession.swift @@ -22,15 +22,26 @@ class GKGameSession : NSObject { var maxNumberOfConnectedPlayers: Int { get } var badgedPlayers: [GKCloudPlayer] { get } class func createSession(inContainer containerName: String?, withTitle title: String, maxConnectedPlayers maxPlayers: Int, completionHandler: @escaping (GKGameSession?, Error?) -> Void) + class func createSession(inContainer containerName: String?, withTitle title: String, maxConnectedPlayers maxPlayers: Int) async throws -> GKGameSession? class func loadSessions(inContainer containerName: String?, completionHandler: @escaping ([GKGameSession]?, Error?) -> Void) + class func loadSessions(inContainer containerName: String?) async throws -> [GKGameSession]? class func load(withIdentifier identifier: String, completionHandler: @escaping (GKGameSession?, Error?) -> Void) + class func load(withIdentifier identifier: String) async throws -> GKGameSession? class func remove(withIdentifier identifier: String, completionHandler: @escaping (Error?) -> Void) + class func remove(withIdentifier identifier: String) async throws func getShareURL(completionHandler: @escaping (URL?, Error?) -> Void) + func getShareURL() async throws -> URL? func loadData(completionHandler: @escaping (Data?, Error?) -> Void) + func loadData() async throws -> Data? func save(_ data: Data, completionHandler: @escaping (Data?, Error?) -> Void) + func save(_ data: Data) async throws -> Data? func setConnectionState(_ state: GKConnectionState, completionHandler: @escaping (Error?) -> Void) + func setConnectionState(_ state: GKConnectionState) async throws func players(with state: GKConnectionState) -> [GKCloudPlayer] func send(_ data: Data, with transport: GKTransportType, completionHandler: @escaping (Error?) -> Void) + func send(_ data: Data, with transport: GKTransportType) async throws func sendMessage(withLocalizedFormatKey key: String, arguments: [String], data: Data?, to players: [GKCloudPlayer], badgePlayers: Bool, completionHandler: @escaping (Error?) -> Void) + func sendMessage(withLocalizedFormatKey key: String, arguments: [String], data: Data?, to players: [GKCloudPlayer], badgePlayers: Bool) async throws func clearBadge(for players: [GKCloudPlayer], completionHandler: @escaping (Error?) -> Void) + func clearBadge(for players: [GKCloudPlayer]) async throws } diff --git a/iOS/GameKit/GKGameSessionEventListener.swift b/iOS/GameKit/GKGameSessionEventListener.swift index 9beb7b7..a91acf7 100644 --- a/iOS/GameKit/GKGameSessionEventListener.swift +++ b/iOS/GameKit/GKGameSessionEventListener.swift @@ -1,12 +1,12 @@ @available(iOS, introduced: 10.0, deprecated: 12.0, message: "Use GKLocalPlayerListener for multiplayer event notifications.") protocol GKGameSessionEventListener : NSObjectProtocol { - optional func session(_ session: GKGameSession, didAdd player: GKCloudPlayer) - optional func session(_ session: GKGameSession, didRemove player: GKCloudPlayer) - optional func session(_ session: GKGameSession, player: GKCloudPlayer, didChange newState: GKConnectionState) - optional func session(_ session: GKGameSession, player: GKCloudPlayer, didSave data: Data) - optional func session(_ session: GKGameSession, didReceive data: Data, from player: GKCloudPlayer) - optional func session(_ session: GKGameSession, didReceiveMessage message: String, with data: Data, from player: GKCloudPlayer) + @asyncHandler optional func session(_ session: GKGameSession, didAdd player: GKCloudPlayer) + @asyncHandler optional func session(_ session: GKGameSession, didRemove player: GKCloudPlayer) + @asyncHandler optional func session(_ session: GKGameSession, player: GKCloudPlayer, didChange newState: GKConnectionState) + @asyncHandler optional func session(_ session: GKGameSession, player: GKCloudPlayer, didSave data: Data) + @asyncHandler optional func session(_ session: GKGameSession, didReceive data: Data, from player: GKCloudPlayer) + @asyncHandler optional func session(_ session: GKGameSession, didReceiveMessage message: String, with data: Data, from player: GKCloudPlayer) } extension GKGameSession { @available(iOS, introduced: 10.0, deprecated: 12.0, message: "Use GKLocalPlayer's registerListener: to register for GKLocalPlayerListener event notifications.") diff --git a/iOS/GameKit/GKLeaderboard.swift b/iOS/GameKit/GKLeaderboard.swift index 7797c78..21b8ab0 100644 --- a/iOS/GameKit/GKLeaderboard.swift +++ b/iOS/GameKit/GKLeaderboard.swift @@ -39,15 +39,27 @@ class GKLeaderboard : NSObject { @available(iOS 14.0, *) class func loadLeaderboards(IDs leaderboardIDs: [String]?, completionHandler: @escaping ([GKLeaderboard]?, Error?) -> Void) @available(iOS 14.0, *) + class func loadLeaderboards(IDs leaderboardIDs: [String]?) async throws -> [GKLeaderboard]? + @available(iOS 14.0, *) func loadPreviousOccurrence(completionHandler: @escaping (GKLeaderboard?, Error?) -> Void) @available(iOS 14.0, *) + func loadPreviousOccurrence() async throws -> GKLeaderboard? + @available(iOS 14.0, *) class func submitScore(_ score: Int, context: Int, player: GKPlayer, leaderboardIDs: [String], completionHandler: @escaping (Error?) -> Void) @available(iOS 14.0, *) + class func submitScore(_ score: Int, context: Int, player: GKPlayer, leaderboardIDs: [String]) async throws + @available(iOS 14.0, *) func submitScore(_ score: Int, context: Int, player: GKPlayer, completionHandler: @escaping (Error?) -> Void) @available(iOS 14.0, *) + func submitScore(_ score: Int, context: Int, player: GKPlayer) async throws + @available(iOS 14.0, *) func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange, completionHandler: @escaping (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Int, Error?) -> Void) @available(iOS 14.0, *) + func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange) async throws -> (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Int) + @available(iOS 14.0, *) func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope, completionHandler: @escaping (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Error?) -> Void) + @available(iOS 14.0, *) + func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope) async throws -> (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?) } extension GKLeaderboard { @available(iOS, introduced: 4.1, deprecated: 8.0, message: "Use initWithPlayers: instead") @@ -72,10 +84,16 @@ extension GKLeaderboard { init(players: [GKPlayer]) @available(iOS, introduced: 4.0, deprecated: 14.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") func loadScores(completionHandler: (([GKScore]?, Error?) -> Void)? = nil) + @available(iOS, introduced: 4.0, deprecated: 14.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") + func loadScores() async throws -> [GKScore]? @available(iOS, introduced: 6.0, deprecated: 14.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") class func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) + @available(iOS, introduced: 6.0, deprecated: 14.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") + class func loadLeaderboards() async throws -> [GKLeaderboard]? } extension GKLeaderboard { @available(iOS 7.0, *) func loadImage(completionHandler: ((UIImage?, Error?) -> Void)? = nil) + @available(iOS 7.0, *) + func loadImage() async throws -> UIImage? } diff --git a/iOS/GameKit/GKLeaderboardSet.swift b/iOS/GameKit/GKLeaderboardSet.swift index 97b3ed7..49c201b 100644 --- a/iOS/GameKit/GKLeaderboardSet.swift +++ b/iOS/GameKit/GKLeaderboardSet.swift @@ -6,13 +6,18 @@ class GKLeaderboardSet : NSObject, NSCoding, NSSecureCoding { var identifier: String? @available(iOS 7.0, *) class func loadLeaderboardSets(completionHandler: (([GKLeaderboardSet]?, Error?) -> Void)? = nil) + @available(iOS 7.0, *) + class func loadLeaderboardSets() async throws -> [GKLeaderboardSet]? @available(iOS 14.0, *) func loadLeaderboards(handler: @escaping ([GKLeaderboard]?, Error?) -> Void) } extension GKLeaderboardSet { @available(iOS, introduced: 7.0, deprecated: 14.0, message: "Use loadLeaderboardsWithHandler: instead.") func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) + @available(iOS, introduced: 7.0, deprecated: 14.0, message: "Use loadLeaderboardsWithHandler: instead.") + func loadLeaderboards() async throws -> [GKLeaderboard]? } extension GKLeaderboardSet { func loadImage(completionHandler: ((UIImage?, Error?) -> Void)? = nil) + func loadImage() async throws -> UIImage? } diff --git a/iOS/GameKit/GKLocalPlayer.swift b/iOS/GameKit/GKLocalPlayer.swift index 22ceeaf..f5c4230 100644 --- a/iOS/GameKit/GKLocalPlayer.swift +++ b/iOS/GameKit/GKLocalPlayer.swift @@ -12,13 +12,22 @@ class GKLocalPlayer : GKPlayer { var isPersonalizedCommunicationRestricted: Bool { get } @available(iOS 10.0, *) func loadRecentPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + @available(iOS 10.0, *) + func loadRecentPlayers() async throws -> [GKPlayer]? func loadChallengableFriends(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + func loadChallengableFriends() async throws -> [GKPlayer]? @available(iOS 7.0, *) func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 7.0, *) + func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String) async throws + @available(iOS 7.0, *) func loadDefaultLeaderboardIdentifier(completionHandler: ((String?, Error?) -> Void)? = nil) + @available(iOS 7.0, *) + func loadDefaultLeaderboardIdentifier() async throws -> String? @available(iOS 13.5, *) func fetchItems(forIdentityVerificationSignature completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) + @available(iOS 13.5, *) + func fetchItemsForIdentityVerificationSignature() async throws -> (URL?, Data?, Data?, UInt64) } protocol GKLocalPlayerListener : GKChallengeListener, GKInviteEventListener, GKSavedGameListener, GKTurnBasedEventListener { } @@ -37,12 +46,18 @@ extension NSNotification.Name { extension GKLocalPlayer { @available(iOS, introduced: 8.0, deprecated: 10.0) func loadFriendPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + @available(iOS, introduced: 8.0, deprecated: 10.0) + func loadFriendPlayers() async throws -> [GKPlayer]? @available(iOS, introduced: 7.0, deprecated: 13.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") func generateIdentityVerificationSignature(completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) + @available(iOS, introduced: 7.0, deprecated: 13.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") + func generateIdentityVerificationSignature() async throws -> (URL?, Data?, Data?, UInt64) } extension GKLocalPlayer { @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") func loadFriends(completionHandler: (([String]?, Error?) -> Void)? = nil) + @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") + func loadFriends() async throws -> [String]? @available(iOS, introduced: 4.1, deprecated: 8.0, message: " This property is obsolete, Use loadFriendPlayersWithCompletionHandler: instead") var friends: [String]? { get } } diff --git a/iOS/GameKit/GKMatch.swift b/iOS/GameKit/GKMatch.swift index 201dd91..3ba64c6 100644 --- a/iOS/GameKit/GKMatch.swift +++ b/iOS/GameKit/GKMatch.swift @@ -27,30 +27,36 @@ class GKMatch : NSObject { func voiceChat(withName name: String) -> GKVoiceChat? @available(iOS 8.0, *) func chooseBestHostingPlayer(completionHandler: @escaping (GKPlayer?) -> Void) + @available(iOS 8.0, *) + func chooseBestHostingPlayer() async -> GKPlayer? @available(iOS 6.0, *) func rematch(completionHandler: ((GKMatch?, Error?) -> Void)? = nil) + @available(iOS 6.0, *) + func rematch() async throws -> GKMatch? } protocol GKMatchDelegate : NSObjectProtocol { @available(iOS 8.0, *) - optional func match(_ match: GKMatch, didReceive data: Data, fromRemotePlayer player: GKPlayer) + @asyncHandler optional func match(_ match: GKMatch, didReceive data: Data, fromRemotePlayer player: GKPlayer) @available(iOS 9.0, *) - optional func match(_ match: GKMatch, didReceive data: Data, forRecipient recipient: GKPlayer, fromRemotePlayer player: GKPlayer) + @asyncHandler optional func match(_ match: GKMatch, didReceive data: Data, forRecipient recipient: GKPlayer, fromRemotePlayer player: GKPlayer) @available(iOS 4.1, *) - optional func match(_ match: GKMatch, player: GKPlayer, didChange state: GKPlayerConnectionState) + @asyncHandler optional func match(_ match: GKMatch, player: GKPlayer, didChange state: GKPlayerConnectionState) @available(iOS 4.1, *) - optional func match(_ match: GKMatch, didFailWithError error: Error?) + @asyncHandler optional func match(_ match: GKMatch, didFailWithError error: Error?) @available(iOS 8.0, *) optional func match(_ match: GKMatch, shouldReinviteDisconnectedPlayer player: GKPlayer) -> Bool @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use match:didReceiveData:fromRemotePlayer:") - optional func match(_ match: GKMatch, didReceive data: Data, fromPlayer playerID: String) + @asyncHandler optional func match(_ match: GKMatch, didReceive data: Data, fromPlayer playerID: String) @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use match:player:didChangeConnectionState:") - optional func match(_ match: GKMatch, player playerID: String, didChange state: GKPlayerConnectionState) + @asyncHandler optional func match(_ match: GKMatch, player playerID: String, didChange state: GKPlayerConnectionState) @available(iOS, introduced: 5.0, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use shouldReinviteDisconnectedPlayer:") optional func match(_ match: GKMatch, shouldReinvitePlayer playerID: String) -> Bool } extension GKMatch { @available(iOS, introduced: 6.0, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use chooseBestHostingPlayerWithCompletionHandler:") func chooseBestHostPlayer(completionHandler: @escaping (String?) -> Void) + @available(iOS, introduced: 6.0, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use chooseBestHostingPlayerWithCompletionHandler:") + func chooseBestHostPlayer() async -> String? @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use sendData:toPlayers:dataMode:error:") func send(_ data: Data, toPlayers playerIDs: [String], with mode: GKMatch.SendDataMode) throws @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use players instead.") diff --git a/iOS/GameKit/GKMatchmaker.swift b/iOS/GameKit/GKMatchmaker.swift index 4299ea0..a2c4357 100644 --- a/iOS/GameKit/GKMatchmaker.swift +++ b/iOS/GameKit/GKMatchmaker.swift @@ -60,28 +60,36 @@ class GKInvite : NSObject { } protocol GKInviteEventListener { @available(iOS 7.0, *) - optional func player(_ player: GKPlayer, didAccept invite: GKInvite) + @asyncHandler optional func player(_ player: GKPlayer, didAccept invite: GKInvite) @available(iOS 8.0, *) - optional func player(_ player: GKPlayer, didRequestMatchWithRecipients recipientPlayers: [GKPlayer]) + @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithRecipients recipientPlayers: [GKPlayer]) @available(iOS, introduced: 7.0, deprecated: 8.0, message: "This method is obsolete. It will never be invoked its implementation does nothing, use player:didRequestMatchWithRecipients:") - optional func player(_ player: GKPlayer, didRequestMatchWithPlayers playerIDsToInvite: [String]) + @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithPlayers playerIDsToInvite: [String]) } @available(iOS 4.1, *) class GKMatchmaker : NSObject { class func shared() -> GKMatchmaker @available(iOS 6.0, *) func match(for invite: GKInvite, completionHandler: ((GKMatch?, Error?) -> Void)? = nil) + @available(iOS 6.0, *) + func match(for invite: GKInvite) async throws -> GKMatch? func findMatch(for request: GKMatchRequest, withCompletionHandler completionHandler: ((GKMatch?, Error?) -> Void)? = nil) + func findMatch(for request: GKMatchRequest) async throws -> GKMatch? @available(iOS 8.0, *) func findPlayers(forHostedRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + @available(iOS 8.0, *) + func findPlayers(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer]? func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest, completionHandler: ((Error?) -> Void)? = nil) + func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest) async throws func cancel() @available(iOS 8.0, *) func cancelPendingInvite(to player: GKPlayer) @available(iOS 6.0, *) func finishMatchmaking(for match: GKMatch) func queryPlayerGroupActivity(_ playerGroup: Int, withCompletionHandler completionHandler: ((Int, Error?) -> Void)? = nil) + func queryPlayerGroupActivity(_ playerGroup: Int) async throws -> Int func queryActivity(completionHandler: ((Int, Error?) -> Void)? = nil) + func queryActivity() async throws -> Int @available(iOS 8.0, *) func startBrowsingForNearbyPlayers(handler reachableHandler: ((GKPlayer, Bool) -> Void)? = nil) @available(iOS 6.0, *) @@ -96,4 +104,6 @@ extension GKMatchmaker { func cancelInvite(toPlayer playerID: String) @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") func findPlayers(forHostedMatchRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) + @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") + func findPlayers(forHostedMatchRequest request: GKMatchRequest) async throws -> [String]? } diff --git a/iOS/GameKit/GKMatchmakerViewController.swift b/iOS/GameKit/GKMatchmakerViewController.swift index dd5389b..f49d6dc 100644 --- a/iOS/GameKit/GKMatchmakerViewController.swift +++ b/iOS/GameKit/GKMatchmakerViewController.swift @@ -27,15 +27,15 @@ protocol GKMatchmakerViewControllerDelegate : NSObjectProtocol { @available(iOS 4.1, *) func matchmakerViewControllerWasCancelled(_ viewController: GKMatchmakerViewController) @available(iOS 4.1, *) - func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFailWithError error: Error) + @asyncHandler func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFailWithError error: Error) @available(iOS 4.1, *) - optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFind match: GKMatch) + @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFind match: GKMatch) @available(iOS 8.0, *) - optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindHostedPlayers players: [GKPlayer]) + @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindHostedPlayers players: [GKPlayer]) @available(iOS 8.0, *) optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, hostedPlayerDidAccept player: GKPlayer) @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use matchmakerViewController:didFindHostedPlayers:") - optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindPlayers playerIDs: [String]) + @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindPlayers playerIDs: [String]) @available(iOS, introduced: 5.0, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use matchmakerViewController:hostedPlayerDidAccept:") - optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didReceiveAcceptFromHostedPlayer playerID: String) + @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didReceiveAcceptFromHostedPlayer playerID: String) } diff --git a/iOS/GameKit/GKNotificationBanner.swift b/iOS/GameKit/GKNotificationBanner.swift index 7bfc6ea..031db5e 100644 --- a/iOS/GameKit/GKNotificationBanner.swift +++ b/iOS/GameKit/GKNotificationBanner.swift @@ -3,6 +3,10 @@ class GKNotificationBanner : NSObject { @available(iOS 5.0, *) class func show(withTitle title: String?, message: String?, completionHandler: (() -> Void)? = nil) + @available(iOS 5.0, *) + class func show(withTitle title: String?, message: String?) async @available(iOS 6.0, *) class func show(withTitle title: String?, message: String?, duration: TimeInterval, completionHandler: (() -> Void)? = nil) + @available(iOS 6.0, *) + class func show(withTitle title: String?, message: String?, duration: TimeInterval) async } diff --git a/iOS/GameKit/GKPlayer.swift b/iOS/GameKit/GKPlayer.swift index 25b741f..22b1494 100644 --- a/iOS/GameKit/GKPlayer.swift +++ b/iOS/GameKit/GKPlayer.swift @@ -4,6 +4,7 @@ let GKPlayerIDNoLongerAvailable: String @available(iOS 4.1, *) class GKPlayer : GKBasePlayer { class func loadPlayers(forIdentifiers identifiers: [String], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer]? @available(iOS 13.0, *) func scopedIDsArePersistent() -> Bool @available(iOS 12.4, *) @@ -21,6 +22,8 @@ class GKPlayer : GKBasePlayer { extension GKPlayer { @available(iOS 5.0, *) func loadPhoto(for size: GKPlayer.PhotoSize, withCompletionHandler completionHandler: ((UIImage?, Error?) -> Void)? = nil) + @available(iOS 5.0, *) + func loadPhoto(for size: GKPlayer.PhotoSize) async throws -> UIImage? } extension GKPlayer { enum PhotoSize : Int { diff --git a/iOS/GameKit/GKSavedGame.swift b/iOS/GameKit/GKSavedGame.swift index d9b3963..84b3f6c 100644 --- a/iOS/GameKit/GKSavedGame.swift +++ b/iOS/GameKit/GKSavedGame.swift @@ -9,14 +9,24 @@ class GKSavedGame : NSObject, NSCopying { var modificationDate: Date? { get } @available(iOS 8.0, *) func loadData(completionHandler handler: ((Data?, Error?) -> Void)? = nil) + @available(iOS 8.0, *) + func loadData() async throws -> Data? } extension GKLocalPlayer : GKSavedGameListener { @available(iOS 8.0, *) func fetchSavedGames(completionHandler handler: (([GKSavedGame]?, Error?) -> Void)? = nil) @available(iOS 8.0, *) + func fetchSavedGames() async throws -> [GKSavedGame]? + @available(iOS 8.0, *) func saveGameData(_ data: Data, withName name: String, completionHandler handler: ((GKSavedGame?, Error?) -> Void)? = nil) @available(iOS 8.0, *) + func saveGameData(_ data: Data, withName name: String) async throws -> GKSavedGame? + @available(iOS 8.0, *) func deleteSavedGames(withName name: String, completionHandler handler: ((Error?) -> Void)? = nil) @available(iOS 8.0, *) + func deleteSavedGames(withName name: String) async throws + @available(iOS 8.0, *) func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data, completionHandler handler: (([GKSavedGame]?, Error?) -> Void)? = nil) + @available(iOS 8.0, *) + func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data) async throws -> [GKSavedGame]? } diff --git a/iOS/GameKit/GKSavedGameListener.swift b/iOS/GameKit/GKSavedGameListener.swift index 3d5e21b..77f043a 100644 --- a/iOS/GameKit/GKSavedGameListener.swift +++ b/iOS/GameKit/GKSavedGameListener.swift @@ -2,7 +2,7 @@ @available(iOS 8.0, *) protocol GKSavedGameListener : NSObjectProtocol { @available(iOS 8.0, *) - optional func player(_ player: GKPlayer, didModifySavedGame savedGame: GKSavedGame) + @asyncHandler optional func player(_ player: GKPlayer, didModifySavedGame savedGame: GKSavedGame) @available(iOS 8.0, *) optional func player(_ player: GKPlayer, hasConflictingSavedGames savedGames: [GKSavedGame]) } diff --git a/iOS/GameKit/GKScore.swift b/iOS/GameKit/GKScore.swift index e33c3e2..ce7464f 100644 --- a/iOS/GameKit/GKScore.swift +++ b/iOS/GameKit/GKScore.swift @@ -18,6 +18,8 @@ class GKScore : NSObject, NSCoding, NSSecureCoding { var shouldSetDefaultLeaderboard: Bool @available(iOS 6.0, *) class func report(_ scores: [GKScore], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + @available(iOS 6.0, *) + class func report(_ scores: [GKScore]) async throws } extension GKScore { } diff --git a/iOS/GameKit/GKTurnBasedMatch.swift b/iOS/GameKit/GKTurnBasedMatch.swift index aa52af9..d7f6098 100644 --- a/iOS/GameKit/GKTurnBasedMatch.swift +++ b/iOS/GameKit/GKTurnBasedMatch.swift @@ -52,9 +52,9 @@ extension GKTurnBasedParticipant { } protocol GKTurnBasedEventListener { @available(iOS 8.0, *) - optional func player(_ player: GKPlayer, didRequestMatchWithOtherPlayers playersToInvite: [GKPlayer]) + @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithOtherPlayers playersToInvite: [GKPlayer]) @available(iOS 7.0, *) - optional func player(_ player: GKPlayer, receivedTurnEventFor match: GKTurnBasedMatch, didBecomeActive: Bool) + @asyncHandler optional func player(_ player: GKPlayer, receivedTurnEventFor match: GKTurnBasedMatch, didBecomeActive: Bool) @available(iOS 5.0, *) optional func player(_ player: GKPlayer, matchEnded match: GKTurnBasedMatch) @available(iOS 7.0, *) @@ -66,7 +66,7 @@ protocol GKTurnBasedEventListener { @available(iOS 9.0, *) optional func player(_ player: GKPlayer, wantsToQuitMatch match: GKTurnBasedMatch) @available(iOS, introduced: 7.0, deprecated: 8.0, message: "use didRequestMatchWithOtherPlayers") - optional func player(_ player: GKPlayer, didRequestMatchWithPlayers playerIDsToInvite: [String]) + @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithPlayers playerIDsToInvite: [String]) } @available(iOS 6.0, *) var GKTurnTimeoutDefault: TimeInterval @@ -96,35 +96,65 @@ class GKTurnBasedMatch : NSObject { @available(iOS 7.0, *) var exchangeMaxInitiatedExchangesPerPlayer: Int { get } class func find(for request: GKMatchRequest, withCompletionHandler completionHandler: @escaping (GKTurnBasedMatch?, Error?) -> Void) + class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch? class func loadMatches(completionHandler: (([GKTurnBasedMatch]?, Error?) -> Void)? = nil) + class func loadMatches() async throws -> [GKTurnBasedMatch]? @available(iOS 5.0, *) class func load(withID matchID: String, withCompletionHandler completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) + @available(iOS 5.0, *) + class func load(withID matchID: String) async throws -> GKTurnBasedMatch? @available(iOS 6.0, *) func rematch(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) + @available(iOS 6.0, *) + func rematch() async throws -> GKTurnBasedMatch? @available(iOS 5.0, *) func acceptInvite(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(iOS 5.0, *) + func acceptInvite() async throws -> GKTurnBasedMatch? + @available(iOS 5.0, *) func declineInvite(completionHandler: ((Error?) -> Void)? = nil) + @available(iOS 5.0, *) + func declineInvite() async throws func remove(completionHandler: ((Error?) -> Void)? = nil) + func remove() async throws func loadMatchData(completionHandler: ((Data?, Error?) -> Void)? = nil) + func loadMatchData() async throws -> Data? @available(iOS 6.0, *) func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 6.0, *) + func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + @available(iOS 6.0, *) func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) + @available(iOS 6.0, *) + func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome) async throws func endMatchInTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) + func endMatchInTurn(withMatch matchData: Data) async throws @available(iOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?, completionHandler: ((Error?) -> Void)? = nil) + @available(iOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") + func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws @available(iOS 14.0, *) func endMatchInTurn(withMatch matchData: Data, leaderboardScores scores: [GKLeaderboardScore], achievements: [Any], completionHandler: @escaping (Error?) -> Void) + @available(iOS 14.0, *) + func endMatchInTurn(withMatch matchData: Data, leaderboardScores scores: [GKLeaderboardScore], achievements: [Any]) async throws @available(iOS 6.0, *) func saveCurrentTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) + @available(iOS 6.0, *) + func saveCurrentTurn(withMatch matchData: Data) async throws @available(iOS 7.0, *) func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange], completionHandler: ((Error?) -> Void)? = nil) @available(iOS 7.0, *) + func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws + @available(iOS 7.0, *) func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval, completionHandler: ((GKTurnBasedExchange?, Error?) -> Void)? = nil) @available(iOS 7.0, *) + func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange? + @available(iOS 7.0, *) func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) + @available(iOS 7.0, *) + func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws } @available(iOS 7.0, *) enum GKTurnBasedExchangeStatus : Int8 { @@ -155,7 +185,11 @@ class GKTurnBasedExchange : NSObject { @available(iOS 7.0, *) func cancel(withLocalizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(iOS 7.0, *) + func cancel(withLocalizableMessageKey key: String, arguments: [String]) async throws + @available(iOS 7.0, *) func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data, completionHandler: ((Error?) -> Void)? = nil) + @available(iOS 7.0, *) + func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws } @available(iOS 7.0, *) class GKTurnBasedExchangeReply : NSObject { diff --git a/iOS/GameKit/GKTurnBasedMatchmakerViewController.swift b/iOS/GameKit/GKTurnBasedMatchmakerViewController.swift index b9c09f4..d2c63f2 100644 --- a/iOS/GameKit/GKTurnBasedMatchmakerViewController.swift +++ b/iOS/GameKit/GKTurnBasedMatchmakerViewController.swift @@ -11,9 +11,9 @@ protocol GKTurnBasedMatchmakerViewControllerDelegate : NSObjectProtocol { @available(iOS 5.0, *) func turnBasedMatchmakerViewControllerWasCancelled(_ viewController: GKTurnBasedMatchmakerViewController) @available(iOS 5.0, *) - func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFailWithError error: Error) + @asyncHandler func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFailWithError error: Error) @available(iOS, introduced: 5.0, deprecated: 9.0, message: "use GKTurnBasedEventListener player:receivedTurnEventForMatch:didBecomeActive:") - optional func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFind match: GKTurnBasedMatch) + @asyncHandler optional func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFind match: GKTurnBasedMatch) @available(iOS, introduced: 5.0, deprecated: 9.0, message: "use GKTurnBasedEventListener player:wantsToQuitMatch:") optional func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, playerQuitFor match: GKTurnBasedMatch) } diff --git a/iOS/GameplayKit/GKAgent.swift b/iOS/GameplayKit/GKAgent.swift index e7296f2..f0fd956 100644 --- a/iOS/GameplayKit/GKAgent.swift +++ b/iOS/GameplayKit/GKAgent.swift @@ -3,7 +3,7 @@ protocol GKAgentDelegate : NSObjectProtocol { @available(iOS 9.0, *) optional func agentWillUpdate(_ agent: GKAgent) @available(iOS 9.0, *) - optional func agentDidUpdate(_ agent: GKAgent) + @asyncHandler optional func agentDidUpdate(_ agent: GKAgent) } @available(iOS 9.0, *) class GKAgent : GKComponent, NSSecureCoding { diff --git a/iOS/HealthKit/HKHealthStore.swift b/iOS/HealthKit/HKHealthStore.swift index ed95ae0..5be040c 100644 --- a/iOS/HealthKit/HKHealthStore.swift +++ b/iOS/HealthKit/HKHealthStore.swift @@ -6,19 +6,31 @@ class HKHealthStore : NSObject { func supportsHealthRecords() -> Bool func authorizationStatus(for type: HKObjectType) -> HKAuthorizationStatus func requestAuthorization(toShare typesToShare: Set?, read typesToRead: Set?, completion: @escaping (Bool, Error?) -> Void) + func requestAuthorization(toShare typesToShare: Set?, read typesToRead: Set?) async throws -> Bool @available(iOS 12.0, *) func getRequestStatusForAuthorization(toShare typesToShare: Set, read typesToRead: Set, completion: @escaping (HKAuthorizationRequestStatus, Error?) -> Void) + @available(iOS 12.0, *) + func getRequestStatusForAuthorization(toShare typesToShare: Set, read typesToRead: Set) async throws -> HKAuthorizationRequestStatus @available(iOS 9.0, *) func handleAuthorizationForExtension(completion: @escaping (Bool, Error?) -> Void) @available(iOS 9.0, *) + func handleAuthorizationForExtension() async throws -> Bool + @available(iOS 9.0, *) func earliestPermittedSampleDate() -> Date func save(_ object: HKObject, withCompletion completion: @escaping (Bool, Error?) -> Void) + func save(_ object: HKObject) async throws -> Bool func save(_ objects: [HKObject], withCompletion completion: @escaping (Bool, Error?) -> Void) + func save(_ objects: [HKObject]) async throws -> Bool func delete(_ object: HKObject, withCompletion completion: @escaping (Bool, Error?) -> Void) + func delete(_ object: HKObject) async throws -> Bool @available(iOS 9.0, *) func delete(_ objects: [HKObject], withCompletion completion: @escaping (Bool, Error?) -> Void) @available(iOS 9.0, *) + func delete(_ objects: [HKObject]) async throws -> Bool + @available(iOS 9.0, *) func deleteObjects(of objectType: HKObjectType, predicate: NSPredicate, withCompletion completion: @escaping (Bool, Int, Error?) -> Void) + @available(iOS 9.0, *) + func deleteObjects(of objectType: HKObjectType, predicate: NSPredicate) async throws -> (Bool, Int) func execute(_ query: HKQuery) func stop(_ query: HKQuery) @available(iOS, introduced: 9.0, deprecated: 11.0, message: "No longer supported") @@ -38,13 +50,19 @@ class HKHealthStore : NSObject { } extension HKHealthStore { func add(_ samples: [HKSample], to workout: HKWorkout, completion: @escaping (Bool, Error?) -> Void) + func add(_ samples: [HKSample], to workout: HKWorkout) async throws -> Bool @available(iOS 10.0, *) func startWatchApp(with workoutConfiguration: HKWorkoutConfiguration, completion: @escaping (Bool, Error?) -> Void) + @available(iOS 10.0, *) + func startWatchApp(with workoutConfiguration: HKWorkoutConfiguration) async throws -> Bool } extension HKHealthStore { func enableBackgroundDelivery(for type: HKObjectType, frequency: HKUpdateFrequency, withCompletion completion: @escaping (Bool, Error?) -> Void) + func enableBackgroundDelivery(for type: HKObjectType, frequency: HKUpdateFrequency) async throws -> Bool func disableBackgroundDelivery(for type: HKObjectType, withCompletion completion: @escaping (Bool, Error?) -> Void) + func disableBackgroundDelivery(for type: HKObjectType) async throws -> Bool func disableAllBackgroundDelivery(completion: @escaping (Bool, Error?) -> Void) + func disableAllBackgroundDelivery() async throws -> Bool } extension NSNotification.Name { @available(iOS 8.2, *) @@ -53,4 +71,6 @@ extension NSNotification.Name { extension HKHealthStore { @available(iOS 8.2, *) func preferredUnits(for quantityTypes: Set, completion: @escaping ([HKQuantityType : HKUnit], Error?) -> Void) + @available(iOS 8.2, *) + func preferredUnits(for quantityTypes: Set) async throws -> [HKQuantityType : HKUnit] } diff --git a/iOS/HealthKit/HKHeartbeatSeriesBuilder.swift b/iOS/HealthKit/HKHeartbeatSeriesBuilder.swift index f98445b..e5bdfcf 100644 --- a/iOS/HealthKit/HKHeartbeatSeriesBuilder.swift +++ b/iOS/HealthKit/HKHeartbeatSeriesBuilder.swift @@ -4,6 +4,9 @@ class HKHeartbeatSeriesBuilder : HKSeriesBuilder { class var maximumCount: Int { get } init(healthStore: HKHealthStore, device: HKDevice?, start startDate: Date) func addHeartbeatWithTimeInterval(sinceSeriesStartDate timeInterval: TimeInterval, precededByGap: Bool, completion: @escaping (Bool, Error?) -> Void) + func addHeartbeatWithTimeInterval(sinceSeriesStartDate timeInterval: TimeInterval, precededByGap: Bool) async throws -> Bool func addMetadata(_ metadata: [String : Any], completion: @escaping (Bool, Error?) -> Void) + func addMetadata(_ metadata: [String : Any]) async throws -> Bool func finishSeries(completion: @escaping (HKHeartbeatSeriesSample?, Error?) -> Void) + func finishSeries() async throws -> HKHeartbeatSeriesSample? } diff --git a/iOS/HealthKit/HKQuantitySeriesSampleBuilder.swift b/iOS/HealthKit/HKQuantitySeriesSampleBuilder.swift index dcdbd6d..6f187a5 100644 --- a/iOS/HealthKit/HKQuantitySeriesSampleBuilder.swift +++ b/iOS/HealthKit/HKQuantitySeriesSampleBuilder.swift @@ -9,6 +9,8 @@ class HKQuantitySeriesSampleBuilder : NSObject { func insert(_ quantity: HKQuantity, for dateInterval: DateInterval) throws func insert(_ quantity: HKQuantity, at date: Date) throws func finishSeries(metadata: [String : Any]?, endDate: Date?, completion: @escaping ([HKQuantitySample]?, Error?) -> Void) + func finishSeries(metadata: [String : Any]?, endDate: Date?) async throws -> [HKQuantitySample]? func finishSeries(metadata: [String : Any]?, completion: @escaping ([HKQuantitySample]?, Error?) -> Void) + func finishSeries(metadata: [String : Any]?) async throws -> [HKQuantitySample]? func discard() } diff --git a/iOS/HealthKit/HKWorkoutBuilder.swift b/iOS/HealthKit/HKWorkoutBuilder.swift index 012e783..08496a1 100644 --- a/iOS/HealthKit/HKWorkoutBuilder.swift +++ b/iOS/HealthKit/HKWorkoutBuilder.swift @@ -9,11 +9,17 @@ class HKWorkoutBuilder : NSObject { var workoutEvents: [HKWorkoutEvent] { get } init(healthStore: HKHealthStore, configuration: HKWorkoutConfiguration, device: HKDevice?) func beginCollection(withStart startDate: Date, completion: @escaping (Bool, Error?) -> Void) + func beginCollection(withStart startDate: Date) async throws -> Bool func add(_ samples: [HKSample], completion: @escaping (Bool, Error?) -> Void) + func add(_ samples: [HKSample]) async throws -> Bool func addWorkoutEvents(_ workoutEvents: [HKWorkoutEvent], completion: @escaping (Bool, Error?) -> Void) + func addWorkoutEvents(_ workoutEvents: [HKWorkoutEvent]) async throws -> Bool func addMetadata(_ metadata: [String : Any], completion: @escaping (Bool, Error?) -> Void) + func addMetadata(_ metadata: [String : Any]) async throws -> Bool func endCollection(withEnd endDate: Date, completion: @escaping (Bool, Error?) -> Void) + func endCollection(withEnd endDate: Date) async throws -> Bool func finishWorkout(completion: @escaping (HKWorkout?, Error?) -> Void) + func finishWorkout() async throws -> HKWorkout? func discardWorkout() func elapsedTime(at date: Date) -> TimeInterval func statistics(for quantityType: HKQuantityType) -> HKStatistics? diff --git a/iOS/HealthKit/HKWorkoutRouteBuilder.swift b/iOS/HealthKit/HKWorkoutRouteBuilder.swift index 8f3d7cc..128e640 100644 --- a/iOS/HealthKit/HKWorkoutRouteBuilder.swift +++ b/iOS/HealthKit/HKWorkoutRouteBuilder.swift @@ -3,5 +3,7 @@ class HKWorkoutRouteBuilder : HKSeriesBuilder { init(healthStore: HKHealthStore, device: HKDevice?) func addMetadata(_ metadata: [String : Any], completion: @escaping (Bool, Error?) -> Void) + func addMetadata(_ metadata: [String : Any]) async throws -> Bool func finishRoute(with workout: HKWorkout, metadata: [String : Any]?, completion: @escaping (HKWorkoutRoute?, Error?) -> Void) + func finishRoute(with workout: HKWorkout, metadata: [String : Any]?) async throws -> HKWorkoutRoute? } diff --git a/iOS/HomeKit/HMAccessory.swift b/iOS/HomeKit/HMAccessory.swift index b25bbad..391886b 100644 --- a/iOS/HomeKit/HMAccessory.swift +++ b/iOS/HomeKit/HMAccessory.swift @@ -29,20 +29,22 @@ class HMAccessory : NSObject { @available(iOS 11.3, *) var supportsIdentify: Bool { get } func updateName(_ name: String, completionHandler completion: @escaping (Error?) -> Void) + func updateName(_ name: String) async throws func identify(completionHandler completion: @escaping (Error?) -> Void) + func identify() async throws } @available(iOS 8.0, *) protocol HMAccessoryDelegate : NSObjectProtocol { - optional func accessoryDidUpdateName(_ accessory: HMAccessory) - optional func accessory(_ accessory: HMAccessory, didUpdateNameFor service: HMService) - optional func accessory(_ accessory: HMAccessory, didUpdateAssociatedServiceTypeFor service: HMService) - optional func accessoryDidUpdateServices(_ accessory: HMAccessory) + @asyncHandler optional func accessoryDidUpdateName(_ accessory: HMAccessory) + @asyncHandler optional func accessory(_ accessory: HMAccessory, didUpdateNameFor service: HMService) + @asyncHandler optional func accessory(_ accessory: HMAccessory, didUpdateAssociatedServiceTypeFor service: HMService) + @asyncHandler optional func accessoryDidUpdateServices(_ accessory: HMAccessory) @available(iOS 11.0, *) - optional func accessory(_ accessory: HMAccessory, didAdd profile: HMAccessoryProfile) + @asyncHandler optional func accessory(_ accessory: HMAccessory, didAdd profile: HMAccessoryProfile) @available(iOS 11.0, *) - optional func accessory(_ accessory: HMAccessory, didRemove profile: HMAccessoryProfile) - optional func accessoryDidUpdateReachability(_ accessory: HMAccessory) - optional func accessory(_ accessory: HMAccessory, service: HMService, didUpdateValueFor characteristic: HMCharacteristic) + @asyncHandler optional func accessory(_ accessory: HMAccessory, didRemove profile: HMAccessoryProfile) + @asyncHandler optional func accessoryDidUpdateReachability(_ accessory: HMAccessory) + @asyncHandler optional func accessory(_ accessory: HMAccessory, service: HMService, didUpdateValueFor characteristic: HMCharacteristic) @available(iOS 11.0, *) - optional func accessory(_ accessory: HMAccessory, didUpdateFirmwareVersion firmwareVersion: String) + @asyncHandler optional func accessory(_ accessory: HMAccessory, didUpdateFirmwareVersion firmwareVersion: String) } diff --git a/iOS/HomeKit/HMAccessoryBrowser.swift b/iOS/HomeKit/HMAccessoryBrowser.swift index d4fed39..6f6145f 100644 --- a/iOS/HomeKit/HMAccessoryBrowser.swift +++ b/iOS/HomeKit/HMAccessoryBrowser.swift @@ -8,6 +8,6 @@ class HMAccessoryBrowser : NSObject { } @available(iOS 8.0, *) protocol HMAccessoryBrowserDelegate : NSObjectProtocol { - optional func accessoryBrowser(_ browser: HMAccessoryBrowser, didFindNewAccessory accessory: HMAccessory) - optional func accessoryBrowser(_ browser: HMAccessoryBrowser, didRemoveNewAccessory accessory: HMAccessory) + @asyncHandler optional func accessoryBrowser(_ browser: HMAccessoryBrowser, didFindNewAccessory accessory: HMAccessory) + @asyncHandler optional func accessoryBrowser(_ browser: HMAccessoryBrowser, didRemoveNewAccessory accessory: HMAccessory) } diff --git a/iOS/HomeKit/HMActionSet.swift b/iOS/HomeKit/HMActionSet.swift index 3a0f45f..214e6f9 100644 --- a/iOS/HomeKit/HMActionSet.swift +++ b/iOS/HomeKit/HMActionSet.swift @@ -11,8 +11,11 @@ class HMActionSet : NSObject { @available(iOS 10.0, *) var lastExecutionDate: Date? { get } func updateName(_ name: String, completionHandler completion: @escaping HMErrorBlock) + func updateName(_ name: String) async throws func addAction(_ action: HMAction, completionHandler completion: @escaping HMErrorBlock) + func addAction(_ action: HMAction) async throws func removeAction(_ action: HMAction, completionHandler completion: @escaping HMErrorBlock) + func removeAction(_ action: HMAction) async throws } @available(iOS 9.0, *) let HMActionSetTypeWakeUp: String diff --git a/iOS/HomeKit/HMCameraSnapshotControl.swift b/iOS/HomeKit/HMCameraSnapshotControl.swift index d030c44..a3491a4 100644 --- a/iOS/HomeKit/HMCameraSnapshotControl.swift +++ b/iOS/HomeKit/HMCameraSnapshotControl.swift @@ -7,6 +7,6 @@ class HMCameraSnapshotControl : HMCameraControl { } @available(iOS 10.0, *) protocol HMCameraSnapshotControlDelegate : NSObjectProtocol { - optional func cameraSnapshotControl(_ cameraSnapshotControl: HMCameraSnapshotControl, didTake snapshot: HMCameraSnapshot?, error: Error?) - optional func cameraSnapshotControlDidUpdateMostRecentSnapshot(_ cameraSnapshotControl: HMCameraSnapshotControl) + @asyncHandler optional func cameraSnapshotControl(_ cameraSnapshotControl: HMCameraSnapshotControl, didTake snapshot: HMCameraSnapshot?, error: Error?) + @asyncHandler optional func cameraSnapshotControlDidUpdateMostRecentSnapshot(_ cameraSnapshotControl: HMCameraSnapshotControl) } diff --git a/iOS/HomeKit/HMCameraStream.swift b/iOS/HomeKit/HMCameraStream.swift index ac05359..2158bc2 100644 --- a/iOS/HomeKit/HMCameraStream.swift +++ b/iOS/HomeKit/HMCameraStream.swift @@ -5,4 +5,5 @@ class HMCameraStream : HMCameraSource { @available(iOS, introduced: 10.0, deprecated: 10.0) func setAudioStreamSetting(_ audioStreamSetting: HMCameraAudioStreamSetting) func updateAudioStreamSetting(_ audioStreamSetting: HMCameraAudioStreamSetting, completionHandler completion: @escaping (Error?) -> Void) + func updateAudioStreamSetting(_ audioStreamSetting: HMCameraAudioStreamSetting) async throws } diff --git a/iOS/HomeKit/HMCameraStreamControl.swift b/iOS/HomeKit/HMCameraStreamControl.swift index 076d602..488cd0e 100644 --- a/iOS/HomeKit/HMCameraStreamControl.swift +++ b/iOS/HomeKit/HMCameraStreamControl.swift @@ -9,6 +9,6 @@ class HMCameraStreamControl : HMCameraControl { } @available(iOS 10.0, *) protocol HMCameraStreamControlDelegate : NSObjectProtocol { - optional func cameraStreamControlDidStartStream(_ cameraStreamControl: HMCameraStreamControl) - optional func cameraStreamControl(_ cameraStreamControl: HMCameraStreamControl, didStopStreamWithError error: Error?) + @asyncHandler optional func cameraStreamControlDidStartStream(_ cameraStreamControl: HMCameraStreamControl) + @asyncHandler optional func cameraStreamControl(_ cameraStreamControl: HMCameraStreamControl, didStopStreamWithError error: Error?) } diff --git a/iOS/HomeKit/HMCharacteristic.swift b/iOS/HomeKit/HMCharacteristic.swift index 89e1c5a..442a2a4 100644 --- a/iOS/HomeKit/HMCharacteristic.swift +++ b/iOS/HomeKit/HMCharacteristic.swift @@ -12,7 +12,11 @@ class HMCharacteristic : NSObject { @available(iOS 9.0, *) var uniqueIdentifier: UUID { get } func writeValue(_ value: Any?, completionHandler completion: @escaping (Error?) -> Void) + func writeValue(_ value: Any?) async throws func readValue(completionHandler completion: @escaping (Error?) -> Void) + func readValue() async throws func enableNotification(_ enable: Bool, completionHandler completion: @escaping (Error?) -> Void) + func enableNotification(_ enable: Bool) async throws func updateAuthorizationData(_ data: Data?, completionHandler completion: @escaping (Error?) -> Void) + func updateAuthorizationData(_ data: Data?) async throws } diff --git a/iOS/HomeKit/HMCharacteristicEvent.swift b/iOS/HomeKit/HMCharacteristicEvent.swift index 09dafdc..a450424 100644 --- a/iOS/HomeKit/HMCharacteristicEvent.swift +++ b/iOS/HomeKit/HMCharacteristicEvent.swift @@ -6,6 +6,8 @@ class HMCharacteristicEvent : HMEvent, NSCopying, NSMutableCop @NSCopying var triggerValue: TriggerValueType? { get } @available(iOS, introduced: 9.0, deprecated: 11.0, message: "No longer supported.") func updateTriggerValue(_ triggerValue: TriggerValueType?, completionHandler completion: @escaping (Error?) -> Void) + @available(iOS, introduced: 9.0, deprecated: 11.0, message: "No longer supported.") + func updateTriggerValue(_ triggerValue: TriggerValueType?) async throws } @available(iOS 11.0, *) class HMMutableCharacteristicEvent : HMCharacteristicEvent where TriggerValueType : NSCopying { diff --git a/iOS/HomeKit/HMCharacteristicWriteAction.swift b/iOS/HomeKit/HMCharacteristicWriteAction.swift index 586d0b4..7dcd509 100644 --- a/iOS/HomeKit/HMCharacteristicWriteAction.swift +++ b/iOS/HomeKit/HMCharacteristicWriteAction.swift @@ -5,4 +5,5 @@ class HMCharacteristicWriteAction : HMAction where TargetValueT var characteristic: HMCharacteristic { get } @NSCopying var targetValue: TargetValueType { get } func updateTargetValue(_ targetValue: TargetValueType, completionHandler completion: @escaping (Error?) -> Void) + func updateTargetValue(_ targetValue: TargetValueType) async throws } diff --git a/iOS/HomeKit/HMEventTrigger.swift b/iOS/HomeKit/HMEventTrigger.swift index 1ae18b3..895a343 100644 --- a/iOS/HomeKit/HMEventTrigger.swift +++ b/iOS/HomeKit/HMEventTrigger.swift @@ -23,16 +23,29 @@ class HMEventTrigger : HMTrigger { @available(iOS, introduced: 9.0, deprecated: 11.0, message: "Use updateEvents:completionHandler: instead") func addEvent(_ event: HMEvent, completionHandler completion: @escaping (Error?) -> Void) @available(iOS, introduced: 9.0, deprecated: 11.0, message: "Use updateEvents:completionHandler: instead") + func addEvent(_ event: HMEvent) async throws + @available(iOS, introduced: 9.0, deprecated: 11.0, message: "Use updateEvents:completionHandler: instead") func removeEvent(_ event: HMEvent, completionHandler completion: @escaping (Error?) -> Void) + @available(iOS, introduced: 9.0, deprecated: 11.0, message: "Use updateEvents:completionHandler: instead") + func removeEvent(_ event: HMEvent) async throws @available(iOS 11.0, *) func updateEvents(_ events: [HMEvent], completionHandler completion: @escaping (Error?) -> Void) @available(iOS 11.0, *) + func updateEvents(_ events: [HMEvent]) async throws + @available(iOS 11.0, *) func updateEndEvents(_ endEvents: [HMEvent], completionHandler completion: @escaping (Error?) -> Void) + @available(iOS 11.0, *) + func updateEndEvents(_ endEvents: [HMEvent]) async throws func updatePredicate(_ predicate: NSPredicate?, completionHandler completion: @escaping (Error?) -> Void) + func updatePredicate(_ predicate: NSPredicate?) async throws @available(iOS 11.0, *) func updateRecurrences(_ recurrences: [DateComponents]?, completionHandler completion: @escaping (Error?) -> Void) @available(iOS 11.0, *) + func updateRecurrences(_ recurrences: [DateComponents]?) async throws + @available(iOS 11.0, *) func updateExecuteOnce(_ executeOnce: Bool, completionHandler completion: @escaping (Error?) -> Void) + @available(iOS 11.0, *) + func updateExecuteOnce(_ executeOnce: Bool) async throws } extension HMEventTrigger { @available(iOS, introduced: 9.0, deprecated: 11.0, message: "Use predicateForEvaluatingTriggerOccurringBeforeSignificantEvent: instead") diff --git a/iOS/HomeKit/HMHome.swift b/iOS/HomeKit/HMHome.swift index 8d9baab..60de51b 100644 --- a/iOS/HomeKit/HMHome.swift +++ b/iOS/HomeKit/HMHome.swift @@ -17,18 +17,27 @@ class HMHome : NSObject { @available(iOS 9.0, *) var uniqueIdentifier: UUID { get } func updateName(_ name: String, completionHandler completion: @escaping (Error?) -> Void) + func updateName(_ name: String) async throws } extension HMHome { var accessories: [HMAccessory] { get } func addAccessory(_ accessory: HMAccessory, completionHandler completion: @escaping (Error?) -> Void) + func addAccessory(_ accessory: HMAccessory) async throws func removeAccessory(_ accessory: HMAccessory, completionHandler completion: @escaping (Error?) -> Void) + func removeAccessory(_ accessory: HMAccessory) async throws func assignAccessory(_ accessory: HMAccessory, to room: HMRoom, completionHandler completion: @escaping (Error?) -> Void) + func assignAccessory(_ accessory: HMAccessory, to room: HMRoom) async throws func servicesWithTypes(_ serviceTypes: [String]) -> [HMService]? func unblockAccessory(_ accessory: HMAccessory, completionHandler completion: @escaping (Error?) -> Void) + func unblockAccessory(_ accessory: HMAccessory) async throws @available(iOS 10.0, *) func addAndSetupAccessories(completionHandler completion: @escaping (Error?) -> Void) + @available(iOS 10.0, *) + func addAndSetupAccessories() async throws @available(iOS 11.3, *) func addAndSetupAccessories(with payload: HMAccessorySetupPayload, completionHandler completion: @escaping ([HMAccessory]?, Error?) -> Void) + @available(iOS 11.3, *) + func addAndSetupAccessories(with payload: HMAccessorySetupPayload) async throws -> [HMAccessory]? @available(iOS 13.2, *) var supportsAddingNetworkRouter: Bool { get } } @@ -39,79 +48,96 @@ extension HMHome { var users: [HMUser] { get } @available(iOS 9.0, *) func manageUsers(completionHandler completion: @escaping (Error?) -> Void) + @available(iOS 9.0, *) + func manageUsers() async throws @available(iOS, introduced: 8.0, deprecated: 9.0) func addUser(completionHandler completion: @escaping (HMUser?, Error?) -> Void) @available(iOS, introduced: 8.0, deprecated: 9.0) + func addUser() async throws -> HMUser? + @available(iOS, introduced: 8.0, deprecated: 9.0) func removeUser(_ user: HMUser, completionHandler completion: @escaping (Error?) -> Void) + @available(iOS, introduced: 8.0, deprecated: 9.0) + func removeUser(_ user: HMUser) async throws @available(iOS 9.0, *) func homeAccessControl(for user: HMUser) -> HMHomeAccessControl } extension HMHome { var rooms: [HMRoom] { get } func addRoom(withName roomName: String, completionHandler completion: @escaping (HMRoom?, Error?) -> Void) + func addRoom(withName roomName: String) async throws -> HMRoom? func removeRoom(_ room: HMRoom, completionHandler completion: @escaping (Error?) -> Void) + func removeRoom(_ room: HMRoom) async throws func roomForEntireHome() -> HMRoom } extension HMHome { var zones: [HMZone] { get } func addZone(withName zoneName: String, completionHandler completion: @escaping (HMZone?, Error?) -> Void) + func addZone(withName zoneName: String) async throws -> HMZone? func removeZone(_ zone: HMZone, completionHandler completion: @escaping (Error?) -> Void) + func removeZone(_ zone: HMZone) async throws } extension HMHome { var serviceGroups: [HMServiceGroup] { get } func addServiceGroup(withName serviceGroupName: String, completionHandler completion: @escaping (HMServiceGroup?, Error?) -> Void) + func addServiceGroup(withName serviceGroupName: String) async throws -> HMServiceGroup? func removeServiceGroup(_ group: HMServiceGroup, completionHandler completion: @escaping (Error?) -> Void) + func removeServiceGroup(_ group: HMServiceGroup) async throws } extension HMHome { var actionSets: [HMActionSet] { get } func addActionSet(withName actionSetName: String, completionHandler completion: @escaping (HMActionSet?, Error?) -> Void) + func addActionSet(withName actionSetName: String) async throws -> HMActionSet? func removeActionSet(_ actionSet: HMActionSet, completionHandler completion: @escaping (Error?) -> Void) + func removeActionSet(_ actionSet: HMActionSet) async throws func executeActionSet(_ actionSet: HMActionSet, completionHandler completion: @escaping (Error?) -> Void) + func executeActionSet(_ actionSet: HMActionSet) async throws @available(iOS 9.0, *) func builtinActionSet(ofType actionSetType: String) -> HMActionSet? } extension HMHome { var triggers: [HMTrigger] { get } func addTrigger(_ trigger: HMTrigger, completionHandler completion: @escaping (Error?) -> Void) + func addTrigger(_ trigger: HMTrigger) async throws func removeTrigger(_ trigger: HMTrigger, completionHandler completion: @escaping (Error?) -> Void) + func removeTrigger(_ trigger: HMTrigger) async throws } @available(iOS 8.0, *) protocol HMHomeDelegate : NSObjectProtocol { - optional func homeDidUpdateName(_ home: HMHome) + @asyncHandler optional func homeDidUpdateName(_ home: HMHome) @available(iOS 11.0, *) - optional func homeDidUpdateAccessControl(forCurrentUser home: HMHome) - optional func home(_ home: HMHome, didAdd accessory: HMAccessory) - optional func home(_ home: HMHome, didRemove accessory: HMAccessory) - optional func home(_ home: HMHome, didAdd user: HMUser) - optional func home(_ home: HMHome, didRemove user: HMUser) - optional func home(_ home: HMHome, didUpdate room: HMRoom, for accessory: HMAccessory) - optional func home(_ home: HMHome, didAdd room: HMRoom) - optional func home(_ home: HMHome, didRemove room: HMRoom) - optional func home(_ home: HMHome, didUpdateNameFor room: HMRoom) - optional func home(_ home: HMHome, didAdd zone: HMZone) - optional func home(_ home: HMHome, didRemove zone: HMZone) - optional func home(_ home: HMHome, didUpdateNameFor zone: HMZone) - optional func home(_ home: HMHome, didAdd room: HMRoom, to zone: HMZone) - optional func home(_ home: HMHome, didRemove room: HMRoom, from zone: HMZone) - optional func home(_ home: HMHome, didAdd group: HMServiceGroup) - optional func home(_ home: HMHome, didRemove group: HMServiceGroup) - optional func home(_ home: HMHome, didUpdateNameFor group: HMServiceGroup) - optional func home(_ home: HMHome, didAdd service: HMService, to group: HMServiceGroup) - optional func home(_ home: HMHome, didRemove service: HMService, from group: HMServiceGroup) - optional func home(_ home: HMHome, didAdd actionSet: HMActionSet) - optional func home(_ home: HMHome, didRemove actionSet: HMActionSet) - optional func home(_ home: HMHome, didUpdateNameFor actionSet: HMActionSet) - optional func home(_ home: HMHome, didUpdateActionsFor actionSet: HMActionSet) - optional func home(_ home: HMHome, didAdd trigger: HMTrigger) - optional func home(_ home: HMHome, didRemove trigger: HMTrigger) - optional func home(_ home: HMHome, didUpdateNameFor trigger: HMTrigger) - optional func home(_ home: HMHome, didUpdate trigger: HMTrigger) - optional func home(_ home: HMHome, didUnblockAccessory accessory: HMAccessory) - optional func home(_ home: HMHome, didEncounterError error: Error, for accessory: HMAccessory) + @asyncHandler optional func homeDidUpdateAccessControl(forCurrentUser home: HMHome) + @asyncHandler optional func home(_ home: HMHome, didAdd accessory: HMAccessory) + @asyncHandler optional func home(_ home: HMHome, didRemove accessory: HMAccessory) + @asyncHandler optional func home(_ home: HMHome, didAdd user: HMUser) + @asyncHandler optional func home(_ home: HMHome, didRemove user: HMUser) + @asyncHandler optional func home(_ home: HMHome, didUpdate room: HMRoom, for accessory: HMAccessory) + @asyncHandler optional func home(_ home: HMHome, didAdd room: HMRoom) + @asyncHandler optional func home(_ home: HMHome, didRemove room: HMRoom) + @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor room: HMRoom) + @asyncHandler optional func home(_ home: HMHome, didAdd zone: HMZone) + @asyncHandler optional func home(_ home: HMHome, didRemove zone: HMZone) + @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor zone: HMZone) + @asyncHandler optional func home(_ home: HMHome, didAdd room: HMRoom, to zone: HMZone) + @asyncHandler optional func home(_ home: HMHome, didRemove room: HMRoom, from zone: HMZone) + @asyncHandler optional func home(_ home: HMHome, didAdd group: HMServiceGroup) + @asyncHandler optional func home(_ home: HMHome, didRemove group: HMServiceGroup) + @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor group: HMServiceGroup) + @asyncHandler optional func home(_ home: HMHome, didAdd service: HMService, to group: HMServiceGroup) + @asyncHandler optional func home(_ home: HMHome, didRemove service: HMService, from group: HMServiceGroup) + @asyncHandler optional func home(_ home: HMHome, didAdd actionSet: HMActionSet) + @asyncHandler optional func home(_ home: HMHome, didRemove actionSet: HMActionSet) + @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor actionSet: HMActionSet) + @asyncHandler optional func home(_ home: HMHome, didUpdateActionsFor actionSet: HMActionSet) + @asyncHandler optional func home(_ home: HMHome, didAdd trigger: HMTrigger) + @asyncHandler optional func home(_ home: HMHome, didRemove trigger: HMTrigger) + @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor trigger: HMTrigger) + @asyncHandler optional func home(_ home: HMHome, didUpdate trigger: HMTrigger) + @asyncHandler optional func home(_ home: HMHome, didUnblockAccessory accessory: HMAccessory) + @asyncHandler optional func home(_ home: HMHome, didEncounterError error: Error, for accessory: HMAccessory) @available(iOS 11.0, *) - optional func home(_ home: HMHome, didUpdate homeHubState: HMHomeHubState) + @asyncHandler optional func home(_ home: HMHome, didUpdate homeHubState: HMHomeHubState) @available(iOS 13.2, *) - optional func homeDidUpdateSupportedFeatures(_ home: HMHome) + @asyncHandler optional func homeDidUpdateSupportedFeatures(_ home: HMHome) } @available(iOS 8.0, *) let HMUserFailedAccessoriesKey: String diff --git a/iOS/HomeKit/HMHomeManager.swift b/iOS/HomeKit/HMHomeManager.swift index 8897533..f9d5c1d 100644 --- a/iOS/HomeKit/HMHomeManager.swift +++ b/iOS/HomeKit/HMHomeManager.swift @@ -15,17 +15,20 @@ class HMHomeManager : NSObject { var primaryHome: HMHome? { get } var homes: [HMHome] { get } func updatePrimaryHome(_ home: HMHome, completionHandler completion: @escaping (Error?) -> Void) + func updatePrimaryHome(_ home: HMHome) async throws func addHome(withName homeName: String, completionHandler completion: @escaping (HMHome?, Error?) -> Void) + func addHome(withName homeName: String) async throws -> HMHome? func removeHome(_ home: HMHome, completionHandler completion: @escaping (Error?) -> Void) + func removeHome(_ home: HMHome) async throws } @available(iOS 8.0, *) protocol HMHomeManagerDelegate : NSObjectProtocol { @available(iOS 13.0, *) - optional func homeManager(_ manager: HMHomeManager, didUpdate status: HMHomeManagerAuthorizationStatus) - optional func homeManagerDidUpdateHomes(_ manager: HMHomeManager) - optional func homeManagerDidUpdatePrimaryHome(_ manager: HMHomeManager) - optional func homeManager(_ manager: HMHomeManager, didAdd home: HMHome) - optional func homeManager(_ manager: HMHomeManager, didRemove home: HMHome) + @asyncHandler optional func homeManager(_ manager: HMHomeManager, didUpdate status: HMHomeManagerAuthorizationStatus) + @asyncHandler optional func homeManagerDidUpdateHomes(_ manager: HMHomeManager) + @asyncHandler optional func homeManagerDidUpdatePrimaryHome(_ manager: HMHomeManager) + @asyncHandler optional func homeManager(_ manager: HMHomeManager, didAdd home: HMHome) + @asyncHandler optional func homeManager(_ manager: HMHomeManager, didRemove home: HMHome) @available(iOS 13.0, *) - optional func homeManager(_ manager: HMHomeManager, didReceiveAddAccessoryRequest request: HMAddAccessoryRequest) + @asyncHandler optional func homeManager(_ manager: HMHomeManager, didReceiveAddAccessoryRequest request: HMAddAccessoryRequest) } diff --git a/iOS/HomeKit/HMNetworkConfigurationProfile.swift b/iOS/HomeKit/HMNetworkConfigurationProfile.swift index 374077d..2c0741c 100644 --- a/iOS/HomeKit/HMNetworkConfigurationProfile.swift +++ b/iOS/HomeKit/HMNetworkConfigurationProfile.swift @@ -6,5 +6,5 @@ class HMNetworkConfigurationProfile : HMAccessoryProfile { } @available(iOS 13.0, *) protocol HMNetworkConfigurationProfileDelegate : NSObjectProtocol { - optional func profileDidUpdateNetworkAccessMode(_ profile: HMNetworkConfigurationProfile) + @asyncHandler optional func profileDidUpdateNetworkAccessMode(_ profile: HMNetworkConfigurationProfile) } diff --git a/iOS/HomeKit/HMRoom.swift b/iOS/HomeKit/HMRoom.swift index 23a799f..c5b2b5e 100644 --- a/iOS/HomeKit/HMRoom.swift +++ b/iOS/HomeKit/HMRoom.swift @@ -6,4 +6,5 @@ class HMRoom : NSObject { @available(iOS 9.0, *) var uniqueIdentifier: UUID { get } func updateName(_ name: String, completionHandler completion: @escaping (Error?) -> Void) + func updateName(_ name: String) async throws } diff --git a/iOS/HomeKit/HMService.swift b/iOS/HomeKit/HMService.swift index 09699dd..18bb1cd 100644 --- a/iOS/HomeKit/HMService.swift +++ b/iOS/HomeKit/HMService.swift @@ -17,5 +17,7 @@ class HMService : NSObject { @available(iOS 10.0, *) var linkedServices: [HMService]? { get } func updateName(_ name: String, completionHandler completion: @escaping (Error?) -> Void) + func updateName(_ name: String) async throws func updateAssociatedServiceType(_ serviceType: String?, completionHandler completion: @escaping (Error?) -> Void) + func updateAssociatedServiceType(_ serviceType: String?) async throws } diff --git a/iOS/HomeKit/HMServiceGroup.swift b/iOS/HomeKit/HMServiceGroup.swift index e796ac8..b65888f 100644 --- a/iOS/HomeKit/HMServiceGroup.swift +++ b/iOS/HomeKit/HMServiceGroup.swift @@ -6,6 +6,9 @@ class HMServiceGroup : NSObject { @available(iOS 9.0, *) var uniqueIdentifier: UUID { get } func updateName(_ name: String, completionHandler completion: @escaping (Error?) -> Void) + func updateName(_ name: String) async throws func addService(_ service: HMService, completionHandler completion: @escaping (Error?) -> Void) + func addService(_ service: HMService) async throws func removeService(_ service: HMService, completionHandler completion: @escaping (Error?) -> Void) + func removeService(_ service: HMService) async throws } diff --git a/iOS/HomeKit/HMTimerTrigger.swift b/iOS/HomeKit/HMTimerTrigger.swift index bb9736e..629fdc5 100644 --- a/iOS/HomeKit/HMTimerTrigger.swift +++ b/iOS/HomeKit/HMTimerTrigger.swift @@ -7,6 +7,9 @@ class HMTimerTrigger : HMTrigger { var recurrence: DateComponents? { get } var recurrenceCalendar: Calendar? { get } func updateFireDate(_ fireDate: Date, completionHandler completion: @escaping (Error?) -> Void) + func updateFireDate(_ fireDate: Date) async throws func updateTimeZone(_ timeZone: TimeZone?, completionHandler completion: @escaping (Error?) -> Void) + func updateTimeZone(_ timeZone: TimeZone?) async throws func updateRecurrence(_ recurrence: DateComponents?, completionHandler completion: @escaping (Error?) -> Void) + func updateRecurrence(_ recurrence: DateComponents?) async throws } diff --git a/iOS/HomeKit/HMTrigger.swift b/iOS/HomeKit/HMTrigger.swift index 4bfcecd..e346831 100644 --- a/iOS/HomeKit/HMTrigger.swift +++ b/iOS/HomeKit/HMTrigger.swift @@ -8,7 +8,11 @@ class HMTrigger : NSObject { @available(iOS 9.0, *) var uniqueIdentifier: UUID { get } func updateName(_ name: String, completionHandler completion: @escaping (Error?) -> Void) + func updateName(_ name: String) async throws func addActionSet(_ actionSet: HMActionSet, completionHandler completion: @escaping (Error?) -> Void) + func addActionSet(_ actionSet: HMActionSet) async throws func removeActionSet(_ actionSet: HMActionSet, completionHandler completion: @escaping (Error?) -> Void) + func removeActionSet(_ actionSet: HMActionSet) async throws func enable(_ enable: Bool, completionHandler completion: @escaping (Error?) -> Void) + func enable(_ enable: Bool) async throws } diff --git a/iOS/HomeKit/HMZone.swift b/iOS/HomeKit/HMZone.swift index 7ea1f7d..26105de 100644 --- a/iOS/HomeKit/HMZone.swift +++ b/iOS/HomeKit/HMZone.swift @@ -6,6 +6,9 @@ class HMZone : NSObject { @available(iOS 9.0, *) var uniqueIdentifier: UUID { get } func updateName(_ name: String, completionHandler completion: @escaping (Error?) -> Void) + func updateName(_ name: String) async throws func addRoom(_ room: HMRoom, completionHandler completion: @escaping (Error?) -> Void) + func addRoom(_ room: HMRoom) async throws func removeRoom(_ room: HMRoom, completionHandler completion: @escaping (Error?) -> Void) + func removeRoom(_ room: HMRoom) async throws } diff --git a/iOS/IdentityLookup/ILMessageFilterExtensionContext.swift b/iOS/IdentityLookup/ILMessageFilterExtensionContext.swift index d151e72..e5ee939 100644 --- a/iOS/IdentityLookup/ILMessageFilterExtensionContext.swift +++ b/iOS/IdentityLookup/ILMessageFilterExtensionContext.swift @@ -2,4 +2,5 @@ @available(iOS 11.0, *) class ILMessageFilterExtensionContext : NSExtensionContext { func deferQueryRequestToNetwork(completion: @escaping (ILNetworkResponse?, Error?) -> Void) + func deferQueryRequestToNetwork() async throws -> ILNetworkResponse? } diff --git a/iOS/IdentityLookup/ILMessageFilterQueryHandling.swift b/iOS/IdentityLookup/ILMessageFilterQueryHandling.swift index 19cc7a1..3e07f76 100644 --- a/iOS/IdentityLookup/ILMessageFilterQueryHandling.swift +++ b/iOS/IdentityLookup/ILMessageFilterQueryHandling.swift @@ -2,4 +2,5 @@ @available(iOS 11.0, *) protocol ILMessageFilterQueryHandling : NSObjectProtocol { func handle(_ queryRequest: ILMessageFilterQueryRequest, context: ILMessageFilterExtensionContext, completion: @escaping (ILMessageFilterQueryResponse) -> Void) + func handle(_ queryRequest: ILMessageFilterQueryRequest, context: ILMessageFilterExtensionContext) async -> ILMessageFilterQueryResponse } diff --git a/iOS/ImageCaptureCore/ICCameraDevice.swift b/iOS/ImageCaptureCore/ICCameraDevice.swift index 6d69700..f01c510 100644 --- a/iOS/ImageCaptureCore/ICCameraDevice.swift +++ b/iOS/ImageCaptureCore/ICCameraDevice.swift @@ -94,46 +94,48 @@ class ICCameraDevice : ICDevice { var ptpEventHandler: (Data) -> Void @available(iOS 13.0, *) func requestSendPTPCommand(_ ptpCommand: Data, outData ptpData: Data?, completion: @escaping (Data, Data, Error?) -> Void) + @available(iOS 13.0, *) + func requestSendPTPCommand(_ ptpCommand: Data, outData ptpData: Data?) async throws -> (Data, Data) } protocol ICCameraDeviceDelegate : ICDeviceDelegate { @available(iOS 13.0, *) - func cameraDevice(_ camera: ICCameraDevice, didAdd items: [ICCameraItem]) + @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didAdd items: [ICCameraItem]) @available(iOS 13.0, *) - func cameraDevice(_ camera: ICCameraDevice, didRemove items: [ICCameraItem]) + @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didRemove items: [ICCameraItem]) @available(iOS 13.0, *) - func cameraDevice(_ camera: ICCameraDevice, didReceiveThumbnail thumbnail: CGImage?, for item: ICCameraItem, error: Error?) + @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didReceiveThumbnail thumbnail: CGImage?, for item: ICCameraItem, error: Error?) @available(iOS 13.0, *) - func cameraDevice(_ camera: ICCameraDevice, didReceiveMetadata metadata: [AnyHashable : Any]?, for item: ICCameraItem, error: Error?) + @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didReceiveMetadata metadata: [AnyHashable : Any]?, for item: ICCameraItem, error: Error?) @available(iOS 13.0, *) - func cameraDevice(_ camera: ICCameraDevice, didRenameItems items: [ICCameraItem]) + @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didRenameItems items: [ICCameraItem]) @available(iOS 13.0, *) - func cameraDeviceDidChangeCapability(_ camera: ICCameraDevice) + @asyncHandler func cameraDeviceDidChangeCapability(_ camera: ICCameraDevice) @available(iOS 13.0, *) - func cameraDevice(_ camera: ICCameraDevice, didReceivePTPEvent eventData: Data) + @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didReceivePTPEvent eventData: Data) @available(iOS 13.0, *) - func deviceDidBecomeReady(withCompleteContentCatalog device: ICCameraDevice) + @asyncHandler func deviceDidBecomeReady(withCompleteContentCatalog device: ICCameraDevice) @available(iOS 13.0, *) - func cameraDeviceDidRemoveAccessRestriction(_ device: ICDevice) + @asyncHandler func cameraDeviceDidRemoveAccessRestriction(_ device: ICDevice) @available(iOS 13.0, *) - func cameraDeviceDidEnableAccessRestriction(_ device: ICDevice) + @asyncHandler func cameraDeviceDidEnableAccessRestriction(_ device: ICDevice) @available(iOS 13.0, *) optional func cameraDevice(_ cameraDevice: ICCameraDevice, shouldGetThumbnailOf item: ICCameraItem) -> Bool @available(iOS 13.0, *) optional func cameraDevice(_ cameraDevice: ICCameraDevice, shouldGetMetadataOf item: ICCameraItem) -> Bool @available(iOS 13.0, *) - optional func cameraDevice(_ camera: ICCameraDevice, didCompleteDeleteFilesWithError error: Error?) + @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didCompleteDeleteFilesWithError error: Error?) @available(iOS 13.0, *) - optional func cameraDevice(_ camera: ICCameraDevice, didAdd item: ICCameraItem) + @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didAdd item: ICCameraItem) @available(iOS 13.0, *) - optional func cameraDevice(_ camera: ICCameraDevice, didRemove item: ICCameraItem) + @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didRemove item: ICCameraItem) @available(iOS 13.0, *) - optional func cameraDevice(_ camera: ICCameraDevice, didReceiveThumbnailFor item: ICCameraItem) + @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didReceiveThumbnailFor item: ICCameraItem) @available(iOS 13.0, *) - optional func cameraDevice(_ camera: ICCameraDevice, didReceiveMetadataFor item: ICCameraItem) + @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didReceiveMetadataFor item: ICCameraItem) } protocol ICCameraDeviceDownloadDelegate : NSObjectProtocol { @available(iOS 13.0, *) optional func didDownloadFile(_ file: ICCameraFile, error: Error?, options: [String : Any] = [:], contextInfo: UnsafeMutableRawPointer?) @available(iOS 13.0, *) - optional func didReceiveDownloadProgress(for file: ICCameraFile, downloadedBytes: off_t, maxBytes: off_t) + @asyncHandler optional func didReceiveDownloadProgress(for file: ICCameraFile, downloadedBytes: off_t, maxBytes: off_t) } diff --git a/iOS/ImageCaptureCore/ICCameraFile.swift b/iOS/ImageCaptureCore/ICCameraFile.swift index de25a5f..2ef3746 100644 --- a/iOS/ImageCaptureCore/ICCameraFile.swift +++ b/iOS/ImageCaptureCore/ICCameraFile.swift @@ -50,9 +50,15 @@ class ICCameraFile : ICCameraItem { @available(iOS 13.0, *) func requestThumbnailData(options: [ICCameraItemThumbnailOption : Any]? = nil, completion: @escaping (Data?, Error?) -> Void) @available(iOS 13.0, *) + func requestThumbnailData(options: [ICCameraItemThumbnailOption : Any]? = nil) async throws -> Data? + @available(iOS 13.0, *) func requestMetadataDictionary(options: [ICCameraItemMetadataOption : Any]? = nil, completion: @escaping ([AnyHashable : Any]?, Error?) -> Void) @available(iOS 13.0, *) + func requestMetadataDictionary(options: [ICCameraItemMetadataOption : Any]? = nil) async throws -> [AnyHashable : Any]? + @available(iOS 13.0, *) func requestDownload(options: [ICDownloadOption : Any]? = nil, completion: @escaping (String?, Error?) -> Void) -> Progress? @available(iOS 13.0, *) func requestReadData(atOffset offset: off_t, length: off_t, completion: @escaping (Data?, Error?) -> Void) + @available(iOS 13.0, *) + func requestReadData(atOffset offset: off_t, length: off_t) async throws -> Data? } diff --git a/iOS/ImageCaptureCore/ICDevice.swift b/iOS/ImageCaptureCore/ICDevice.swift index af977d0..7df3027 100644 --- a/iOS/ImageCaptureCore/ICDevice.swift +++ b/iOS/ImageCaptureCore/ICDevice.swift @@ -94,23 +94,29 @@ class ICDevice : NSObject { @available(iOS 13.0, *) func requestOpenSession(options: [ICSessionOptions : Any]? = nil, completion: @escaping (Error?) -> Void) @available(iOS 13.0, *) + func requestOpenSession(options: [ICSessionOptions : Any]? = nil) async throws + @available(iOS 13.0, *) func requestCloseSession(options: [ICSessionOptions : Any]? = nil, completion: @escaping (Error?) -> Void) @available(iOS 13.0, *) + func requestCloseSession(options: [ICSessionOptions : Any]? = nil) async throws + @available(iOS 13.0, *) func requestEject(completion: @escaping (Error?) -> Void) + @available(iOS 13.0, *) + func requestEject() async throws } protocol ICDeviceDelegate : NSObjectProtocol { @available(iOS 13.0, *) - func device(_ device: ICDevice, didCloseSessionWithError error: Error?) + @asyncHandler func device(_ device: ICDevice, didCloseSessionWithError error: Error?) @available(iOS 13.0, *) - func didRemove(_ device: ICDevice) + @asyncHandler func didRemove(_ device: ICDevice) @available(iOS 13.0, *) - func device(_ device: ICDevice, didOpenSessionWithError error: Error?) + @asyncHandler func device(_ device: ICDevice, didOpenSessionWithError error: Error?) @available(iOS 13.0, *) - optional func deviceDidBecomeReady(_ device: ICDevice) + @asyncHandler optional func deviceDidBecomeReady(_ device: ICDevice) @available(iOS 13.0, *) - optional func device(_ device: ICDevice, didReceiveStatusInformation status: [ICDeviceStatus : Any]) + @asyncHandler optional func device(_ device: ICDevice, didReceiveStatusInformation status: [ICDeviceStatus : Any]) @available(iOS 13.0, *) - optional func device(_ device: ICDevice, didEncounterError error: Error?) + @asyncHandler optional func device(_ device: ICDevice, didEncounterError error: Error?) @available(iOS 13.0, *) - optional func device(_ device: ICDevice, didEjectWithError error: Error?) + @asyncHandler optional func device(_ device: ICDevice, didEjectWithError error: Error?) } diff --git a/iOS/ImageCaptureCore/ICDeviceBrowser.swift b/iOS/ImageCaptureCore/ICDeviceBrowser.swift index 358ed68..cf90561 100644 --- a/iOS/ImageCaptureCore/ICDeviceBrowser.swift +++ b/iOS/ImageCaptureCore/ICDeviceBrowser.swift @@ -17,9 +17,9 @@ extension ICAuthorizationStatus { } protocol ICDeviceBrowserDelegate : NSObjectProtocol { @available(iOS 13.0, *) - func deviceBrowser(_ browser: ICDeviceBrowser, didAdd device: ICDevice, moreComing: Bool) + @asyncHandler func deviceBrowser(_ browser: ICDeviceBrowser, didAdd device: ICDevice, moreComing: Bool) @available(iOS 13.0, *) - func deviceBrowser(_ browser: ICDeviceBrowser, didRemove device: ICDevice, moreGoing: Bool) + @asyncHandler func deviceBrowser(_ browser: ICDeviceBrowser, didRemove device: ICDevice, moreGoing: Bool) @available(iOS 13.0, *) optional func deviceBrowser(_ browser: ICDeviceBrowser, deviceDidChangeName device: ICDevice) @available(iOS 13.0, *) @@ -27,11 +27,11 @@ protocol ICDeviceBrowserDelegate : NSObjectProtocol { @available(iOS 14.0, *) optional func deviceBrowserWillSuspendOperations(_ browser: ICDeviceBrowser) @available(iOS 14.0, *) - optional func deviceBrowserDidSuspendOperations(_ browser: ICDeviceBrowser) + @asyncHandler optional func deviceBrowserDidSuspendOperations(_ browser: ICDeviceBrowser) @available(iOS 14.0, *) - optional func deviceBrowserDidCancelSuspendOperations(_ browser: ICDeviceBrowser) + @asyncHandler optional func deviceBrowserDidCancelSuspendOperations(_ browser: ICDeviceBrowser) @available(iOS 14.0, *) - optional func deviceBrowserDidResumeOperations(_ browser: ICDeviceBrowser) + @asyncHandler optional func deviceBrowserDidResumeOperations(_ browser: ICDeviceBrowser) } @available(iOS 13.0, *) class ICDeviceBrowser : NSObject { @@ -50,7 +50,11 @@ class ICDeviceBrowser : NSObject { @available(iOS 14.0, *) func requestContentsAuthorization(completion: @escaping (ICAuthorizationStatus) -> Void) @available(iOS 14.0, *) + func requestContentsAuthorization() async -> ICAuthorizationStatus + @available(iOS 14.0, *) func controlAuthorizationStatus() -> ICAuthorizationStatus @available(iOS 14.0, *) func requestControlAuthorization(completion: @escaping (ICAuthorizationStatus) -> Void) + @available(iOS 14.0, *) + func requestControlAuthorization() async -> ICAuthorizationStatus } diff --git a/iOS/Intents/INActivateCarSignalIntent.swift b/iOS/Intents/INActivateCarSignalIntent.swift index ee22b02..c6e4980 100644 --- a/iOS/Intents/INActivateCarSignalIntent.swift +++ b/iOS/Intents/INActivateCarSignalIntent.swift @@ -8,7 +8,11 @@ class INActivateCarSignalIntent : INIntent { @available(iOS 10.3, *) protocol INActivateCarSignalIntentHandling : NSObjectProtocol { func handle(intent: INActivateCarSignalIntent, completion: @escaping (INActivateCarSignalIntentResponse) -> Void) + func handle(intent: INActivateCarSignalIntent) async -> INActivateCarSignalIntentResponse optional func confirm(intent: INActivateCarSignalIntent, completion: @escaping (INActivateCarSignalIntentResponse) -> Void) + optional func confirm(intent: INActivateCarSignalIntent) async -> INActivateCarSignalIntentResponse optional func resolveCarName(for intent: INActivateCarSignalIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveCarName(for intent: INActivateCarSignalIntent) async -> INSpeakableStringResolutionResult optional func resolveSignals(for intent: INActivateCarSignalIntent, with completion: @escaping (INCarSignalOptionsResolutionResult) -> Void) + optional func resolveSignals(for intent: INActivateCarSignalIntent) async -> INCarSignalOptionsResolutionResult } diff --git a/iOS/Intents/INAddMediaIntent.swift b/iOS/Intents/INAddMediaIntent.swift index 22a3991..c4b1643 100644 --- a/iOS/Intents/INAddMediaIntent.swift +++ b/iOS/Intents/INAddMediaIntent.swift @@ -9,7 +9,11 @@ class INAddMediaIntent : INIntent { @available(iOS 13.0, *) protocol INAddMediaIntentHandling : NSObjectProtocol { func handle(intent: INAddMediaIntent, completion: @escaping (INAddMediaIntentResponse) -> Void) + func handle(intent: INAddMediaIntent) async -> INAddMediaIntentResponse optional func confirm(intent: INAddMediaIntent, completion: @escaping (INAddMediaIntentResponse) -> Void) + optional func confirm(intent: INAddMediaIntent) async -> INAddMediaIntentResponse optional func resolveMediaItems(for intent: INAddMediaIntent, with completion: @escaping ([INAddMediaMediaItemResolutionResult]) -> Void) + optional func resolveMediaItems(for intent: INAddMediaIntent) async -> [INAddMediaMediaItemResolutionResult] optional func resolveMediaDestination(for intent: INAddMediaIntent, with completion: @escaping (INAddMediaMediaDestinationResolutionResult) -> Void) + optional func resolveMediaDestination(for intent: INAddMediaIntent) async -> INAddMediaMediaDestinationResolutionResult } diff --git a/iOS/Intents/INAddTasksIntent.swift b/iOS/Intents/INAddTasksIntent.swift index c1628bf..554820b 100644 --- a/iOS/Intents/INAddTasksIntent.swift +++ b/iOS/Intents/INAddTasksIntent.swift @@ -13,17 +13,31 @@ class INAddTasksIntent : INIntent { @available(iOS 11.0, *) protocol INAddTasksIntentHandling : NSObjectProtocol { func handle(intent: INAddTasksIntent, completion: @escaping (INAddTasksIntentResponse) -> Void) + func handle(intent: INAddTasksIntent) async -> INAddTasksIntentResponse optional func confirm(intent: INAddTasksIntent, completion: @escaping (INAddTasksIntentResponse) -> Void) + optional func confirm(intent: INAddTasksIntent) async -> INAddTasksIntentResponse @available(iOS, introduced: 11.0, deprecated: 13.0, message: "resolveTargetTaskListForAddTasks:withCompletion: is deprecated. Use resolveTargetTaskListForAddTasks:completion: instead") optional func resolveTargetTaskList(for intent: INAddTasksIntent, with completion: @escaping (INTaskListResolutionResult) -> Void) + @available(iOS, introduced: 11.0, deprecated: 13.0, message: "resolveTargetTaskListForAddTasks:withCompletion: is deprecated. Use resolveTargetTaskListForAddTasks:completion: instead") + optional func resolveTargetTaskList(for intent: INAddTasksIntent) async -> INTaskListResolutionResult @available(iOS 13.0, *) optional func resolveTargetTaskList(for intent: INAddTasksIntent, with completion: @escaping (INAddTasksTargetTaskListResolutionResult) -> Void) + @available(iOS 13.0, *) + optional func resolveTargetTaskList(for intent: INAddTasksIntent) async -> INAddTasksTargetTaskListResolutionResult optional func resolveTaskTitles(for intent: INAddTasksIntent, with completion: @escaping ([INSpeakableStringResolutionResult]) -> Void) + optional func resolveTaskTitles(for intent: INAddTasksIntent) async -> [INSpeakableStringResolutionResult] optional func resolveSpatialEventTrigger(for intent: INAddTasksIntent, with completion: @escaping (INSpatialEventTriggerResolutionResult) -> Void) + optional func resolveSpatialEventTrigger(for intent: INAddTasksIntent) async -> INSpatialEventTriggerResolutionResult @available(iOS, introduced: 11.0, deprecated: 13.0, message: "resolveTemporalEventTriggerForAddTasks:withCompletion: is deprecated. Use resolveTemporalEventTriggerForAddTasks:completion: instead") optional func resolveTemporalEventTrigger(for intent: INAddTasksIntent, with completion: @escaping (INTemporalEventTriggerResolutionResult) -> Void) + @available(iOS, introduced: 11.0, deprecated: 13.0, message: "resolveTemporalEventTriggerForAddTasks:withCompletion: is deprecated. Use resolveTemporalEventTriggerForAddTasks:completion: instead") + optional func resolveTemporalEventTrigger(for intent: INAddTasksIntent) async -> INTemporalEventTriggerResolutionResult @available(iOS 13.0, *) optional func resolveTemporalEventTrigger(for intent: INAddTasksIntent, with completion: @escaping (INAddTasksTemporalEventTriggerResolutionResult) -> Void) @available(iOS 13.0, *) + optional func resolveTemporalEventTrigger(for intent: INAddTasksIntent) async -> INAddTasksTemporalEventTriggerResolutionResult + @available(iOS 13.0, *) optional func resolvePriority(for intent: INAddTasksIntent, with completion: @escaping (INTaskPriorityResolutionResult) -> Void) + @available(iOS 13.0, *) + optional func resolvePriority(for intent: INAddTasksIntent) async -> INTaskPriorityResolutionResult } diff --git a/iOS/Intents/INAppendToNoteIntent.swift b/iOS/Intents/INAppendToNoteIntent.swift index 2bb1e2d..ac62e90 100644 --- a/iOS/Intents/INAppendToNoteIntent.swift +++ b/iOS/Intents/INAppendToNoteIntent.swift @@ -8,7 +8,11 @@ class INAppendToNoteIntent : INIntent { @available(iOS 11.0, *) protocol INAppendToNoteIntentHandling : NSObjectProtocol { func handle(intent: INAppendToNoteIntent, completion: @escaping (INAppendToNoteIntentResponse) -> Void) + func handle(intent: INAppendToNoteIntent) async -> INAppendToNoteIntentResponse optional func confirm(intent: INAppendToNoteIntent, completion: @escaping (INAppendToNoteIntentResponse) -> Void) + optional func confirm(intent: INAppendToNoteIntent) async -> INAppendToNoteIntentResponse optional func resolveTargetNote(for intent: INAppendToNoteIntent, with completion: @escaping (INNoteResolutionResult) -> Void) + optional func resolveTargetNote(for intent: INAppendToNoteIntent) async -> INNoteResolutionResult optional func resolveContent(for intent: INAppendToNoteIntent, with completion: @escaping (INNoteContentResolutionResult) -> Void) + optional func resolveContent(for intent: INAppendToNoteIntent) async -> INNoteContentResolutionResult } diff --git a/iOS/Intents/INBookRestaurantReservationIntent.swift b/iOS/Intents/INBookRestaurantReservationIntent.swift index 6192b1c..33555dc 100644 --- a/iOS/Intents/INBookRestaurantReservationIntent.swift +++ b/iOS/Intents/INBookRestaurantReservationIntent.swift @@ -14,10 +14,17 @@ class INBookRestaurantReservationIntent : INIntent, NSCopying { @available(iOS 10.0, *) protocol INBookRestaurantReservationIntentHandling : NSObjectProtocol { func handle(bookRestaurantReservation intent: INBookRestaurantReservationIntent, completion: @escaping (INBookRestaurantReservationIntentResponse) -> Void) + func handle(bookRestaurantReservation intent: INBookRestaurantReservationIntent) async -> INBookRestaurantReservationIntentResponse optional func confirm(bookRestaurantReservation intent: INBookRestaurantReservationIntent, completion: @escaping (INBookRestaurantReservationIntentResponse) -> Void) + optional func confirm(bookRestaurantReservation intent: INBookRestaurantReservationIntent) async -> INBookRestaurantReservationIntentResponse optional func resolveRestaurant(for intent: INBookRestaurantReservationIntent, completion: @escaping (INRestaurantResolutionResult) -> Void) + optional func resolveRestaurant(for intent: INBookRestaurantReservationIntent) async -> INRestaurantResolutionResult optional func resolveBookingDateComponents(for intent: INBookRestaurantReservationIntent, completion: @escaping (INDateComponentsResolutionResult) -> Void) + optional func resolveBookingDateComponents(for intent: INBookRestaurantReservationIntent) async -> INDateComponentsResolutionResult optional func resolvePartySize(for intent: INBookRestaurantReservationIntent, completion: @escaping (INIntegerResolutionResult) -> Void) + optional func resolvePartySize(for intent: INBookRestaurantReservationIntent) async -> INIntegerResolutionResult optional func resolveGuest(for intent: INBookRestaurantReservationIntent, completion: @escaping (INRestaurantGuestResolutionResult) -> Void) + optional func resolveGuest(for intent: INBookRestaurantReservationIntent) async -> INRestaurantGuestResolutionResult optional func resolveGuestProvidedSpecialRequestText(for intent: INBookRestaurantReservationIntent, completion: @escaping (INStringResolutionResult) -> Void) + optional func resolveGuestProvidedSpecialRequestText(for intent: INBookRestaurantReservationIntent) async -> INStringResolutionResult } diff --git a/iOS/Intents/INCancelRideIntent.swift b/iOS/Intents/INCancelRideIntent.swift index 46daaeb..07c69be 100644 --- a/iOS/Intents/INCancelRideIntent.swift +++ b/iOS/Intents/INCancelRideIntent.swift @@ -7,5 +7,7 @@ class INCancelRideIntent : INIntent { @available(iOS 11.0, *) protocol INCancelRideIntentHandling : NSObjectProtocol { func handle(cancelRide intent: INCancelRideIntent, completion: @escaping (INCancelRideIntentResponse) -> Void) + func handle(cancelRide intent: INCancelRideIntent) async -> INCancelRideIntentResponse optional func confirm(cancelRide intent: INCancelRideIntent, completion: @escaping (INCancelRideIntentResponse) -> Void) + optional func confirm(cancelRide intent: INCancelRideIntent) async -> INCancelRideIntentResponse } diff --git a/iOS/Intents/INCancelWorkoutIntent.swift b/iOS/Intents/INCancelWorkoutIntent.swift index e6d5e06..dabe5ae 100644 --- a/iOS/Intents/INCancelWorkoutIntent.swift +++ b/iOS/Intents/INCancelWorkoutIntent.swift @@ -7,6 +7,9 @@ class INCancelWorkoutIntent : INIntent { @available(iOS 10.0, *) protocol INCancelWorkoutIntentHandling : NSObjectProtocol { func handle(intent: INCancelWorkoutIntent, completion: @escaping (INCancelWorkoutIntentResponse) -> Void) + func handle(intent: INCancelWorkoutIntent) async -> INCancelWorkoutIntentResponse optional func confirm(intent: INCancelWorkoutIntent, completion: @escaping (INCancelWorkoutIntentResponse) -> Void) + optional func confirm(intent: INCancelWorkoutIntent) async -> INCancelWorkoutIntentResponse optional func resolveWorkoutName(for intent: INCancelWorkoutIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveWorkoutName(for intent: INCancelWorkoutIntent) async -> INSpeakableStringResolutionResult } diff --git a/iOS/Intents/INCreateNoteIntent.swift b/iOS/Intents/INCreateNoteIntent.swift index 16d963f..156036d 100644 --- a/iOS/Intents/INCreateNoteIntent.swift +++ b/iOS/Intents/INCreateNoteIntent.swift @@ -9,8 +9,13 @@ class INCreateNoteIntent : INIntent { @available(iOS 11.0, *) protocol INCreateNoteIntentHandling : NSObjectProtocol { func handle(intent: INCreateNoteIntent, completion: @escaping (INCreateNoteIntentResponse) -> Void) + func handle(intent: INCreateNoteIntent) async -> INCreateNoteIntentResponse optional func confirm(intent: INCreateNoteIntent, completion: @escaping (INCreateNoteIntentResponse) -> Void) + optional func confirm(intent: INCreateNoteIntent) async -> INCreateNoteIntentResponse optional func resolveTitle(for intent: INCreateNoteIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveTitle(for intent: INCreateNoteIntent) async -> INSpeakableStringResolutionResult optional func resolveContent(for intent: INCreateNoteIntent, with completion: @escaping (INNoteContentResolutionResult) -> Void) + optional func resolveContent(for intent: INCreateNoteIntent) async -> INNoteContentResolutionResult optional func resolveGroupName(for intent: INCreateNoteIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveGroupName(for intent: INCreateNoteIntent) async -> INSpeakableStringResolutionResult } diff --git a/iOS/Intents/INCreateTaskListIntent.swift b/iOS/Intents/INCreateTaskListIntent.swift index a1cce95..a24effa 100644 --- a/iOS/Intents/INCreateTaskListIntent.swift +++ b/iOS/Intents/INCreateTaskListIntent.swift @@ -9,8 +9,13 @@ class INCreateTaskListIntent : INIntent { @available(iOS 11.0, *) protocol INCreateTaskListIntentHandling : NSObjectProtocol { func handle(intent: INCreateTaskListIntent, completion: @escaping (INCreateTaskListIntentResponse) -> Void) + func handle(intent: INCreateTaskListIntent) async -> INCreateTaskListIntentResponse optional func confirm(intent: INCreateTaskListIntent, completion: @escaping (INCreateTaskListIntentResponse) -> Void) + optional func confirm(intent: INCreateTaskListIntent) async -> INCreateTaskListIntentResponse optional func resolveTitle(for intent: INCreateTaskListIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveTitle(for intent: INCreateTaskListIntent) async -> INSpeakableStringResolutionResult optional func resolveTaskTitles(for intent: INCreateTaskListIntent, with completion: @escaping ([INSpeakableStringResolutionResult]) -> Void) + optional func resolveTaskTitles(for intent: INCreateTaskListIntent) async -> [INSpeakableStringResolutionResult] optional func resolveGroupName(for intent: INCreateTaskListIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveGroupName(for intent: INCreateTaskListIntent) async -> INSpeakableStringResolutionResult } diff --git a/iOS/Intents/INDeleteTasksIntent.swift b/iOS/Intents/INDeleteTasksIntent.swift index 453281a..ae42ec1 100644 --- a/iOS/Intents/INDeleteTasksIntent.swift +++ b/iOS/Intents/INDeleteTasksIntent.swift @@ -17,7 +17,11 @@ extension INDeleteTasksIntent { @available(iOS 13.0, *) protocol INDeleteTasksIntentHandling : NSObjectProtocol { func handle(intent: INDeleteTasksIntent, completion: @escaping (INDeleteTasksIntentResponse) -> Void) + func handle(intent: INDeleteTasksIntent) async -> INDeleteTasksIntentResponse optional func confirm(intent: INDeleteTasksIntent, completion: @escaping (INDeleteTasksIntentResponse) -> Void) + optional func confirm(intent: INDeleteTasksIntent) async -> INDeleteTasksIntentResponse optional func resolveTaskList(for intent: INDeleteTasksIntent, with completion: @escaping (INDeleteTasksTaskListResolutionResult) -> Void) + optional func resolveTaskList(for intent: INDeleteTasksIntent) async -> INDeleteTasksTaskListResolutionResult optional func resolveTasks(for intent: INDeleteTasksIntent, with completion: @escaping ([INDeleteTasksTaskResolutionResult]) -> Void) + optional func resolveTasks(for intent: INDeleteTasksIntent) async -> [INDeleteTasksTaskResolutionResult] } diff --git a/iOS/Intents/INEndWorkoutIntent.swift b/iOS/Intents/INEndWorkoutIntent.swift index acf310b..e0f0238 100644 --- a/iOS/Intents/INEndWorkoutIntent.swift +++ b/iOS/Intents/INEndWorkoutIntent.swift @@ -7,6 +7,9 @@ class INEndWorkoutIntent : INIntent { @available(iOS 10.0, *) protocol INEndWorkoutIntentHandling : NSObjectProtocol { func handle(intent: INEndWorkoutIntent, completion: @escaping (INEndWorkoutIntentResponse) -> Void) + func handle(intent: INEndWorkoutIntent) async -> INEndWorkoutIntentResponse optional func confirm(intent: INEndWorkoutIntent, completion: @escaping (INEndWorkoutIntentResponse) -> Void) + optional func confirm(intent: INEndWorkoutIntent) async -> INEndWorkoutIntentResponse optional func resolveWorkoutName(for intent: INEndWorkoutIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveWorkoutName(for intent: INEndWorkoutIntent) async -> INSpeakableStringResolutionResult } diff --git a/iOS/Intents/INGetAvailableRestaurantReservationBookingDefaultsIntent.swift b/iOS/Intents/INGetAvailableRestaurantReservationBookingDefaultsIntent.swift index cba7377..ade38e6 100644 --- a/iOS/Intents/INGetAvailableRestaurantReservationBookingDefaultsIntent.swift +++ b/iOS/Intents/INGetAvailableRestaurantReservationBookingDefaultsIntent.swift @@ -8,6 +8,9 @@ class INGetAvailableRestaurantReservationBookingDefaultsIntent : INIntent { @available(iOS 10.0, *) protocol INGetAvailableRestaurantReservationBookingDefaultsIntentHandling : NSObjectProtocol { func handle(getAvailableRestaurantReservationBookingDefaults intent: INGetAvailableRestaurantReservationBookingDefaultsIntent, completion: @escaping (INGetAvailableRestaurantReservationBookingDefaultsIntentResponse) -> Void) + func handle(getAvailableRestaurantReservationBookingDefaults intent: INGetAvailableRestaurantReservationBookingDefaultsIntent) async -> INGetAvailableRestaurantReservationBookingDefaultsIntentResponse optional func confirm(getAvailableRestaurantReservationBookingDefaults intent: INGetAvailableRestaurantReservationBookingDefaultsIntent, completion: @escaping (INGetAvailableRestaurantReservationBookingDefaultsIntentResponse) -> Void) + optional func confirm(getAvailableRestaurantReservationBookingDefaults intent: INGetAvailableRestaurantReservationBookingDefaultsIntent) async -> INGetAvailableRestaurantReservationBookingDefaultsIntentResponse optional func resolveRestaurant(for intent: INGetAvailableRestaurantReservationBookingDefaultsIntent, completion: @escaping (INRestaurantResolutionResult) -> Void) + optional func resolveRestaurant(for intent: INGetAvailableRestaurantReservationBookingDefaultsIntent) async -> INRestaurantResolutionResult } diff --git a/iOS/Intents/INGetAvailableRestaurantReservationBookingsIntent.swift b/iOS/Intents/INGetAvailableRestaurantReservationBookingsIntent.swift index edb9d73..1414153 100644 --- a/iOS/Intents/INGetAvailableRestaurantReservationBookingsIntent.swift +++ b/iOS/Intents/INGetAvailableRestaurantReservationBookingsIntent.swift @@ -13,8 +13,13 @@ class INGetAvailableRestaurantReservationBookingsIntent : INIntent, NSCopying { @available(iOS 10.0, *) protocol INGetAvailableRestaurantReservationBookingsIntentHandling : NSObjectProtocol { func handle(getAvailableRestaurantReservationBookings intent: INGetAvailableRestaurantReservationBookingsIntent, completion: @escaping (INGetAvailableRestaurantReservationBookingsIntentResponse) -> Void) + func handle(getAvailableRestaurantReservationBookings intent: INGetAvailableRestaurantReservationBookingsIntent) async -> INGetAvailableRestaurantReservationBookingsIntentResponse optional func confirm(getAvailableRestaurantReservationBookings intent: INGetAvailableRestaurantReservationBookingsIntent, completion: @escaping (INGetAvailableRestaurantReservationBookingsIntentResponse) -> Void) + optional func confirm(getAvailableRestaurantReservationBookings intent: INGetAvailableRestaurantReservationBookingsIntent) async -> INGetAvailableRestaurantReservationBookingsIntentResponse optional func resolveRestaurant(for intent: INGetAvailableRestaurantReservationBookingsIntent, completion: @escaping (INRestaurantResolutionResult) -> Void) + optional func resolveRestaurant(for intent: INGetAvailableRestaurantReservationBookingsIntent) async -> INRestaurantResolutionResult optional func resolvePartySize(for intent: INGetAvailableRestaurantReservationBookingsIntent, completion: @escaping (INIntegerResolutionResult) -> Void) + optional func resolvePartySize(for intent: INGetAvailableRestaurantReservationBookingsIntent) async -> INIntegerResolutionResult optional func resolvePreferredBookingDateComponents(for intent: INGetAvailableRestaurantReservationBookingsIntent, completion: @escaping (INDateComponentsResolutionResult) -> Void) + optional func resolvePreferredBookingDateComponents(for intent: INGetAvailableRestaurantReservationBookingsIntent) async -> INDateComponentsResolutionResult } diff --git a/iOS/Intents/INGetCarLockStatusIntent.swift b/iOS/Intents/INGetCarLockStatusIntent.swift index 7d42437..58bacdb 100644 --- a/iOS/Intents/INGetCarLockStatusIntent.swift +++ b/iOS/Intents/INGetCarLockStatusIntent.swift @@ -7,6 +7,9 @@ class INGetCarLockStatusIntent : INIntent { @available(iOS 10.3, *) protocol INGetCarLockStatusIntentHandling : NSObjectProtocol { func handle(intent: INGetCarLockStatusIntent, completion: @escaping (INGetCarLockStatusIntentResponse) -> Void) + func handle(intent: INGetCarLockStatusIntent) async -> INGetCarLockStatusIntentResponse optional func confirm(intent: INGetCarLockStatusIntent, completion: @escaping (INGetCarLockStatusIntentResponse) -> Void) + optional func confirm(intent: INGetCarLockStatusIntent) async -> INGetCarLockStatusIntentResponse optional func resolveCarName(for intent: INGetCarLockStatusIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveCarName(for intent: INGetCarLockStatusIntent) async -> INSpeakableStringResolutionResult } diff --git a/iOS/Intents/INGetCarPowerLevelStatusIntent.swift b/iOS/Intents/INGetCarPowerLevelStatusIntent.swift index 80826dc..f9035f7 100644 --- a/iOS/Intents/INGetCarPowerLevelStatusIntent.swift +++ b/iOS/Intents/INGetCarPowerLevelStatusIntent.swift @@ -7,14 +7,17 @@ class INGetCarPowerLevelStatusIntent : INIntent { @available(iOS 10.3, *) protocol INGetCarPowerLevelStatusIntentHandling : NSObjectProtocol { func handle(intent: INGetCarPowerLevelStatusIntent, completion: @escaping (INGetCarPowerLevelStatusIntentResponse) -> Void) + func handle(intent: INGetCarPowerLevelStatusIntent) async -> INGetCarPowerLevelStatusIntentResponse @available(iOS 14.0, *) optional func startSendingUpdates(for intent: INGetCarPowerLevelStatusIntent, to observer: INGetCarPowerLevelStatusIntentResponseObserver) @available(iOS 14.0, *) optional func stopSendingUpdates(for intent: INGetCarPowerLevelStatusIntent) optional func confirm(intent: INGetCarPowerLevelStatusIntent, completion: @escaping (INGetCarPowerLevelStatusIntentResponse) -> Void) + optional func confirm(intent: INGetCarPowerLevelStatusIntent) async -> INGetCarPowerLevelStatusIntentResponse optional func resolveCarName(for intent: INGetCarPowerLevelStatusIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveCarName(for intent: INGetCarPowerLevelStatusIntent) async -> INSpeakableStringResolutionResult } @available(iOS 14.0, *) protocol INGetCarPowerLevelStatusIntentResponseObserver : NSObjectProtocol { - func didUpdate(getCarPowerLevelStatus response: INGetCarPowerLevelStatusIntentResponse) + @asyncHandler func didUpdate(getCarPowerLevelStatus response: INGetCarPowerLevelStatusIntentResponse) } diff --git a/iOS/Intents/INGetRestaurantGuestIntent.swift b/iOS/Intents/INGetRestaurantGuestIntent.swift index 9ffd03e..c064db6 100644 --- a/iOS/Intents/INGetRestaurantGuestIntent.swift +++ b/iOS/Intents/INGetRestaurantGuestIntent.swift @@ -5,5 +5,7 @@ class INGetRestaurantGuestIntent : INIntent { @available(iOS 10.0, *) protocol INGetRestaurantGuestIntentHandling : NSObjectProtocol { func handle(getRestaurantGuest intent: INGetRestaurantGuestIntent, completion: @escaping (INGetRestaurantGuestIntentResponse) -> Void) + func handle(getRestaurantGuest intent: INGetRestaurantGuestIntent) async -> INGetRestaurantGuestIntentResponse optional func confirm(getRestaurantGuest guestIntent: INGetRestaurantGuestIntent, completion: @escaping (INGetRestaurantGuestIntentResponse) -> Void) + optional func confirm(getRestaurantGuest guestIntent: INGetRestaurantGuestIntent) async -> INGetRestaurantGuestIntentResponse } diff --git a/iOS/Intents/INGetRideStatusIntent.swift b/iOS/Intents/INGetRideStatusIntent.swift index b2faa37..82e4da3 100644 --- a/iOS/Intents/INGetRideStatusIntent.swift +++ b/iOS/Intents/INGetRideStatusIntent.swift @@ -5,11 +5,13 @@ class INGetRideStatusIntent : INIntent { @available(iOS 10.0, *) protocol INGetRideStatusIntentHandling : NSObjectProtocol { func handle(intent: INGetRideStatusIntent, completion: @escaping (INGetRideStatusIntentResponse) -> Void) + func handle(intent: INGetRideStatusIntent) async -> INGetRideStatusIntentResponse func startSendingUpdates(for intent: INGetRideStatusIntent, to observer: INGetRideStatusIntentResponseObserver) func stopSendingUpdates(for intent: INGetRideStatusIntent) optional func confirm(intent: INGetRideStatusIntent, completion: @escaping (INGetRideStatusIntentResponse) -> Void) + optional func confirm(intent: INGetRideStatusIntent) async -> INGetRideStatusIntentResponse } @available(iOS 10.0, *) protocol INGetRideStatusIntentResponseObserver : NSObjectProtocol { - func didUpdate(getRideStatus response: INGetRideStatusIntentResponse) + @asyncHandler func didUpdate(getRideStatus response: INGetRideStatusIntentResponse) } diff --git a/iOS/Intents/INGetUserCurrentRestaurantReservationBookingsIntent.swift b/iOS/Intents/INGetUserCurrentRestaurantReservationBookingsIntent.swift index 45281fb..3188634 100644 --- a/iOS/Intents/INGetUserCurrentRestaurantReservationBookingsIntent.swift +++ b/iOS/Intents/INGetUserCurrentRestaurantReservationBookingsIntent.swift @@ -11,6 +11,9 @@ class INGetUserCurrentRestaurantReservationBookingsIntent : INIntent, NSCopying @available(iOS 10.0, *) protocol INGetUserCurrentRestaurantReservationBookingsIntentHandling : NSObjectProtocol { func handle(getUserCurrentRestaurantReservationBookings intent: INGetUserCurrentRestaurantReservationBookingsIntent, completion: @escaping (INGetUserCurrentRestaurantReservationBookingsIntentResponse) -> Void) + func handle(getUserCurrentRestaurantReservationBookings intent: INGetUserCurrentRestaurantReservationBookingsIntent) async -> INGetUserCurrentRestaurantReservationBookingsIntentResponse optional func confirm(getUserCurrentRestaurantReservationBookings intent: INGetUserCurrentRestaurantReservationBookingsIntent, completion: @escaping (INGetUserCurrentRestaurantReservationBookingsIntentResponse) -> Void) + optional func confirm(getUserCurrentRestaurantReservationBookings intent: INGetUserCurrentRestaurantReservationBookingsIntent) async -> INGetUserCurrentRestaurantReservationBookingsIntentResponse optional func resolveRestaurant(for intent: INGetUserCurrentRestaurantReservationBookingsIntent, completion: @escaping (INRestaurantResolutionResult) -> Void) + optional func resolveRestaurant(for intent: INGetUserCurrentRestaurantReservationBookingsIntent) async -> INRestaurantResolutionResult } diff --git a/iOS/Intents/INGetVisualCodeIntent.swift b/iOS/Intents/INGetVisualCodeIntent.swift index 58185e5..2b8abd8 100644 --- a/iOS/Intents/INGetVisualCodeIntent.swift +++ b/iOS/Intents/INGetVisualCodeIntent.swift @@ -7,6 +7,9 @@ class INGetVisualCodeIntent : INIntent { @available(iOS 11.0, *) protocol INGetVisualCodeIntentHandling : NSObjectProtocol { func handle(intent: INGetVisualCodeIntent, completion: @escaping (INGetVisualCodeIntentResponse) -> Void) + func handle(intent: INGetVisualCodeIntent) async -> INGetVisualCodeIntentResponse optional func confirm(intent: INGetVisualCodeIntent, completion: @escaping (INGetVisualCodeIntentResponse) -> Void) + optional func confirm(intent: INGetVisualCodeIntent) async -> INGetVisualCodeIntentResponse optional func resolveVisualCodeType(for intent: INGetVisualCodeIntent, with completion: @escaping (INVisualCodeTypeResolutionResult) -> Void) + optional func resolveVisualCodeType(for intent: INGetVisualCodeIntent) async -> INVisualCodeTypeResolutionResult } diff --git a/iOS/Intents/INInteraction.swift b/iOS/Intents/INInteraction.swift index e80e359..fbb9e5d 100644 --- a/iOS/Intents/INInteraction.swift +++ b/iOS/Intents/INInteraction.swift @@ -24,9 +24,13 @@ enum INInteractionDirection : Int { class INInteraction : NSObject, NSSecureCoding, NSCopying { init(intent: INIntent, response: INIntentResponse?) func donate(completion: ((Error?) -> Void)? = nil) + func donate() async throws class func deleteAll(completion: ((Error?) -> Void)? = nil) + class func deleteAll() async throws class func delete(with identifiers: [String], completion: ((Error?) -> Void)? = nil) + class func delete(with identifiers: [String]) async throws class func delete(with groupIdentifier: String, completion: ((Error?) -> Void)? = nil) + class func delete(with groupIdentifier: String) async throws @NSCopying var intent: INIntent { get } @NSCopying var intentResponse: INIntentResponse? { get } var intentHandlingStatus: INIntentHandlingStatus { get } diff --git a/iOS/Intents/INListCarsIntent.swift b/iOS/Intents/INListCarsIntent.swift index 11ed418..ee03fe0 100644 --- a/iOS/Intents/INListCarsIntent.swift +++ b/iOS/Intents/INListCarsIntent.swift @@ -5,5 +5,7 @@ class INListCarsIntent : INIntent { @available(iOS 14.0, *) protocol INListCarsIntentHandling : NSObjectProtocol { func handle(intent: INListCarsIntent, completion: @escaping (INListCarsIntentResponse) -> Void) + func handle(intent: INListCarsIntent) async -> INListCarsIntentResponse optional func confirm(intent: INListCarsIntent, completion: @escaping (INListCarsIntentResponse) -> Void) + optional func confirm(intent: INListCarsIntent) async -> INListCarsIntentResponse } diff --git a/iOS/Intents/INListRideOptionsIntent.swift b/iOS/Intents/INListRideOptionsIntent.swift index 4df79c1..2bc12e1 100644 --- a/iOS/Intents/INListRideOptionsIntent.swift +++ b/iOS/Intents/INListRideOptionsIntent.swift @@ -8,7 +8,11 @@ class INListRideOptionsIntent : INIntent { @available(iOS 10.0, *) protocol INListRideOptionsIntentHandling : NSObjectProtocol { func handle(intent: INListRideOptionsIntent, completion: @escaping (INListRideOptionsIntentResponse) -> Void) + func handle(intent: INListRideOptionsIntent) async -> INListRideOptionsIntentResponse optional func confirm(intent: INListRideOptionsIntent, completion: @escaping (INListRideOptionsIntentResponse) -> Void) + optional func confirm(intent: INListRideOptionsIntent) async -> INListRideOptionsIntentResponse optional func resolvePickupLocation(for intent: INListRideOptionsIntent, with completion: @escaping (INPlacemarkResolutionResult) -> Void) + optional func resolvePickupLocation(for intent: INListRideOptionsIntent) async -> INPlacemarkResolutionResult optional func resolveDropOffLocation(for intent: INListRideOptionsIntent, with completion: @escaping (INPlacemarkResolutionResult) -> Void) + optional func resolveDropOffLocation(for intent: INListRideOptionsIntent) async -> INPlacemarkResolutionResult } diff --git a/iOS/Intents/INPauseWorkoutIntent.swift b/iOS/Intents/INPauseWorkoutIntent.swift index 8320007..4191333 100644 --- a/iOS/Intents/INPauseWorkoutIntent.swift +++ b/iOS/Intents/INPauseWorkoutIntent.swift @@ -7,6 +7,9 @@ class INPauseWorkoutIntent : INIntent { @available(iOS 10.0, *) protocol INPauseWorkoutIntentHandling : NSObjectProtocol { func handle(intent: INPauseWorkoutIntent, completion: @escaping (INPauseWorkoutIntentResponse) -> Void) + func handle(intent: INPauseWorkoutIntent) async -> INPauseWorkoutIntentResponse optional func confirm(intent: INPauseWorkoutIntent, completion: @escaping (INPauseWorkoutIntentResponse) -> Void) + optional func confirm(intent: INPauseWorkoutIntent) async -> INPauseWorkoutIntentResponse optional func resolveWorkoutName(for intent: INPauseWorkoutIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveWorkoutName(for intent: INPauseWorkoutIntent) async -> INSpeakableStringResolutionResult } diff --git a/iOS/Intents/INPayBillIntent.swift b/iOS/Intents/INPayBillIntent.swift index 235213d..fbd9d1d 100644 --- a/iOS/Intents/INPayBillIntent.swift +++ b/iOS/Intents/INPayBillIntent.swift @@ -13,12 +13,21 @@ class INPayBillIntent : INIntent { @available(iOS 10.3, *) protocol INPayBillIntentHandling : NSObjectProtocol { func handle(intent: INPayBillIntent, completion: @escaping (INPayBillIntentResponse) -> Void) + func handle(intent: INPayBillIntent) async -> INPayBillIntentResponse optional func confirm(intent: INPayBillIntent, completion: @escaping (INPayBillIntentResponse) -> Void) + optional func confirm(intent: INPayBillIntent) async -> INPayBillIntentResponse optional func resolveBillPayee(for intent: INPayBillIntent, with completion: @escaping (INBillPayeeResolutionResult) -> Void) + optional func resolveBillPayee(for intent: INPayBillIntent) async -> INBillPayeeResolutionResult optional func resolveFromAccount(for intent: INPayBillIntent, with completion: @escaping (INPaymentAccountResolutionResult) -> Void) + optional func resolveFromAccount(for intent: INPayBillIntent) async -> INPaymentAccountResolutionResult optional func resolveTransactionAmount(for intent: INPayBillIntent, with completion: @escaping (INPaymentAmountResolutionResult) -> Void) + optional func resolveTransactionAmount(for intent: INPayBillIntent) async -> INPaymentAmountResolutionResult optional func resolveTransactionScheduledDate(for intent: INPayBillIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveTransactionScheduledDate(for intent: INPayBillIntent) async -> INDateComponentsRangeResolutionResult optional func resolveTransactionNote(for intent: INPayBillIntent, with completion: @escaping (INStringResolutionResult) -> Void) + optional func resolveTransactionNote(for intent: INPayBillIntent) async -> INStringResolutionResult optional func resolveBillType(for intent: INPayBillIntent, with completion: @escaping (INBillTypeResolutionResult) -> Void) + optional func resolveBillType(for intent: INPayBillIntent) async -> INBillTypeResolutionResult optional func resolveDueDate(for intent: INPayBillIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveDueDate(for intent: INPayBillIntent) async -> INDateComponentsRangeResolutionResult } diff --git a/iOS/Intents/INPlayMediaIntent.swift b/iOS/Intents/INPlayMediaIntent.swift index 3426012..9c2f066 100644 --- a/iOS/Intents/INPlayMediaIntent.swift +++ b/iOS/Intents/INPlayMediaIntent.swift @@ -33,17 +33,31 @@ extension INPlayMediaIntent { @available(iOS 12.0, *) protocol INPlayMediaIntentHandling : NSObjectProtocol { func handle(intent: INPlayMediaIntent, completion: @escaping (INPlayMediaIntentResponse) -> Void) + func handle(intent: INPlayMediaIntent) async -> INPlayMediaIntentResponse optional func confirm(intent: INPlayMediaIntent, completion: @escaping (INPlayMediaIntentResponse) -> Void) + optional func confirm(intent: INPlayMediaIntent) async -> INPlayMediaIntentResponse @available(iOS 13.0, *) optional func resolveMediaItems(for intent: INPlayMediaIntent, with completion: @escaping ([INPlayMediaMediaItemResolutionResult]) -> Void) @available(iOS 13.0, *) + optional func resolveMediaItems(for intent: INPlayMediaIntent) async -> [INPlayMediaMediaItemResolutionResult] + @available(iOS 13.0, *) optional func resolvePlayShuffled(for intent: INPlayMediaIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) @available(iOS 13.0, *) + optional func resolvePlayShuffled(for intent: INPlayMediaIntent) async -> INBooleanResolutionResult + @available(iOS 13.0, *) optional func resolvePlaybackRepeatMode(for intent: INPlayMediaIntent, with completion: @escaping (INPlaybackRepeatModeResolutionResult) -> Void) @available(iOS 13.0, *) + optional func resolvePlaybackRepeatMode(for intent: INPlayMediaIntent) async -> INPlaybackRepeatModeResolutionResult + @available(iOS 13.0, *) optional func resolveResumePlayback(for intent: INPlayMediaIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) @available(iOS 13.0, *) + optional func resolveResumePlayback(for intent: INPlayMediaIntent) async -> INBooleanResolutionResult + @available(iOS 13.0, *) optional func resolvePlaybackQueueLocation(for intent: INPlayMediaIntent, with completion: @escaping (INPlaybackQueueLocationResolutionResult) -> Void) @available(iOS 13.0, *) + optional func resolvePlaybackQueueLocation(for intent: INPlayMediaIntent) async -> INPlaybackQueueLocationResolutionResult + @available(iOS 13.0, *) optional func resolvePlaybackSpeed(for intent: INPlayMediaIntent, with completion: @escaping (INPlayMediaPlaybackSpeedResolutionResult) -> Void) + @available(iOS 13.0, *) + optional func resolvePlaybackSpeed(for intent: INPlayMediaIntent) async -> INPlayMediaPlaybackSpeedResolutionResult } diff --git a/iOS/Intents/INRelevantShortcutStore.swift b/iOS/Intents/INRelevantShortcutStore.swift index cccd44d..d12cded 100644 --- a/iOS/Intents/INRelevantShortcutStore.swift +++ b/iOS/Intents/INRelevantShortcutStore.swift @@ -3,4 +3,5 @@ class INRelevantShortcutStore : NSObject { class var `default`: INRelevantShortcutStore { get } func setRelevantShortcuts(_ shortcuts: [INRelevantShortcut], completionHandler: ((Error?) -> Void)? = nil) + func setRelevantShortcuts(_ shortcuts: [INRelevantShortcut]) async throws } diff --git a/iOS/Intents/INRequestPaymentIntent.swift b/iOS/Intents/INRequestPaymentIntent.swift index 863e65b..d2c891e 100644 --- a/iOS/Intents/INRequestPaymentIntent.swift +++ b/iOS/Intents/INRequestPaymentIntent.swift @@ -9,14 +9,25 @@ class INRequestPaymentIntent : INIntent { @available(iOS 10.0, *) protocol INRequestPaymentIntentHandling : NSObjectProtocol { func handle(intent: INRequestPaymentIntent, completion: @escaping (INRequestPaymentIntentResponse) -> Void) + func handle(intent: INRequestPaymentIntent) async -> INRequestPaymentIntentResponse optional func confirm(intent: INRequestPaymentIntent, completion: @escaping (INRequestPaymentIntentResponse) -> Void) + optional func confirm(intent: INRequestPaymentIntent) async -> INRequestPaymentIntentResponse @available(iOS, introduced: 10.0, deprecated: 11.0, message: "resolvePayerForRequestPayment:withCompletion: is deprecated. Use resolvePayerForRequestPayment:completion: instead") optional func resolvePayer(for intent: INRequestPaymentIntent, with completion: @escaping (INPersonResolutionResult) -> Void) + @available(iOS, introduced: 10.0, deprecated: 11.0, message: "resolvePayerForRequestPayment:withCompletion: is deprecated. Use resolvePayerForRequestPayment:completion: instead") + optional func resolvePayer(for intent: INRequestPaymentIntent) async -> INPersonResolutionResult @available(iOS 11.0, *) optional func resolvePayer(for intent: INRequestPaymentIntent, with completion: @escaping (INRequestPaymentPayerResolutionResult) -> Void) + @available(iOS 11.0, *) + optional func resolvePayer(for intent: INRequestPaymentIntent) async -> INRequestPaymentPayerResolutionResult @available(iOS, introduced: 10.0, deprecated: 11.0, message: "resolveCurrencyAmountForRequestPayment:withCompletion: is deprecated. Use resolveCurrencyAmountForRequestPayment:completion: instead") optional func resolveCurrencyAmount(for intent: INRequestPaymentIntent, with completion: @escaping (INCurrencyAmountResolutionResult) -> Void) + @available(iOS, introduced: 10.0, deprecated: 11.0, message: "resolveCurrencyAmountForRequestPayment:withCompletion: is deprecated. Use resolveCurrencyAmountForRequestPayment:completion: instead") + optional func resolveCurrencyAmount(for intent: INRequestPaymentIntent) async -> INCurrencyAmountResolutionResult @available(iOS 11.0, *) optional func resolveCurrencyAmount(for intent: INRequestPaymentIntent, with completion: @escaping (INRequestPaymentCurrencyAmountResolutionResult) -> Void) + @available(iOS 11.0, *) + optional func resolveCurrencyAmount(for intent: INRequestPaymentIntent) async -> INRequestPaymentCurrencyAmountResolutionResult optional func resolveNote(for intent: INRequestPaymentIntent, with completion: @escaping (INStringResolutionResult) -> Void) + optional func resolveNote(for intent: INRequestPaymentIntent) async -> INStringResolutionResult } diff --git a/iOS/Intents/INRequestRideIntent.swift b/iOS/Intents/INRequestRideIntent.swift index 3393a5b..dc054ad 100644 --- a/iOS/Intents/INRequestRideIntent.swift +++ b/iOS/Intents/INRequestRideIntent.swift @@ -22,11 +22,19 @@ extension INRequestRideIntent { @available(iOS 10.0, *) protocol INRequestRideIntentHandling : NSObjectProtocol { func handle(intent: INRequestRideIntent, completion: @escaping (INRequestRideIntentResponse) -> Void) + func handle(intent: INRequestRideIntent) async -> INRequestRideIntentResponse optional func confirm(intent: INRequestRideIntent, completion: @escaping (INRequestRideIntentResponse) -> Void) + optional func confirm(intent: INRequestRideIntent) async -> INRequestRideIntentResponse optional func resolvePickupLocation(for intent: INRequestRideIntent, with completion: @escaping (INPlacemarkResolutionResult) -> Void) + optional func resolvePickupLocation(for intent: INRequestRideIntent) async -> INPlacemarkResolutionResult optional func resolveDropOffLocation(for intent: INRequestRideIntent, with completion: @escaping (INPlacemarkResolutionResult) -> Void) + optional func resolveDropOffLocation(for intent: INRequestRideIntent) async -> INPlacemarkResolutionResult optional func resolveRideOptionName(for intent: INRequestRideIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveRideOptionName(for intent: INRequestRideIntent) async -> INSpeakableStringResolutionResult optional func resolvePartySize(for intent: INRequestRideIntent, with completion: @escaping (INIntegerResolutionResult) -> Void) + optional func resolvePartySize(for intent: INRequestRideIntent) async -> INIntegerResolutionResult @available(iOS 10.3, *) optional func resolveScheduledPickupTime(for intent: INRequestRideIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + @available(iOS 10.3, *) + optional func resolveScheduledPickupTime(for intent: INRequestRideIntent) async -> INDateComponentsRangeResolutionResult } diff --git a/iOS/Intents/INResumeWorkoutIntent.swift b/iOS/Intents/INResumeWorkoutIntent.swift index 803652c..8c3ee7a 100644 --- a/iOS/Intents/INResumeWorkoutIntent.swift +++ b/iOS/Intents/INResumeWorkoutIntent.swift @@ -7,6 +7,9 @@ class INResumeWorkoutIntent : INIntent { @available(iOS 10.0, *) protocol INResumeWorkoutIntentHandling : NSObjectProtocol { func handle(intent: INResumeWorkoutIntent, completion: @escaping (INResumeWorkoutIntentResponse) -> Void) + func handle(intent: INResumeWorkoutIntent) async -> INResumeWorkoutIntentResponse optional func confirm(intent: INResumeWorkoutIntent, completion: @escaping (INResumeWorkoutIntentResponse) -> Void) + optional func confirm(intent: INResumeWorkoutIntent) async -> INResumeWorkoutIntentResponse optional func resolveWorkoutName(for intent: INResumeWorkoutIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveWorkoutName(for intent: INResumeWorkoutIntent) async -> INSpeakableStringResolutionResult } diff --git a/iOS/Intents/INSaveProfileInCarIntent.swift b/iOS/Intents/INSaveProfileInCarIntent.swift index d5a5a58..498113c 100644 --- a/iOS/Intents/INSaveProfileInCarIntent.swift +++ b/iOS/Intents/INSaveProfileInCarIntent.swift @@ -18,8 +18,13 @@ extension INSaveProfileInCarIntent { @available(iOS 10.0, *) protocol INSaveProfileInCarIntentHandling : NSObjectProtocol { func handle(intent: INSaveProfileInCarIntent, completion: @escaping (INSaveProfileInCarIntentResponse) -> Void) + func handle(intent: INSaveProfileInCarIntent) async -> INSaveProfileInCarIntentResponse optional func confirm(intent: INSaveProfileInCarIntent, completion: @escaping (INSaveProfileInCarIntentResponse) -> Void) + optional func confirm(intent: INSaveProfileInCarIntent) async -> INSaveProfileInCarIntentResponse optional func resolveProfileNumber(for intent: INSaveProfileInCarIntent, with completion: @escaping (INIntegerResolutionResult) -> Void) + optional func resolveProfileNumber(for intent: INSaveProfileInCarIntent) async -> INIntegerResolutionResult @available(iOS 10.2, *) optional func resolveProfileName(for intent: INSaveProfileInCarIntent, with completion: @escaping (INStringResolutionResult) -> Void) + @available(iOS 10.2, *) + optional func resolveProfileName(for intent: INSaveProfileInCarIntent) async -> INStringResolutionResult } diff --git a/iOS/Intents/INSearchCallHistoryIntent.swift b/iOS/Intents/INSearchCallHistoryIntent.swift index f63d01a..41cf19c 100644 --- a/iOS/Intents/INSearchCallHistoryIntent.swift +++ b/iOS/Intents/INSearchCallHistoryIntent.swift @@ -24,13 +24,23 @@ extension INSearchCallHistoryIntent { @available(iOS 10.0, *) protocol INSearchCallHistoryIntentHandling : NSObjectProtocol { func handle(intent: INSearchCallHistoryIntent, completion: @escaping (INSearchCallHistoryIntentResponse) -> Void) + func handle(intent: INSearchCallHistoryIntent) async -> INSearchCallHistoryIntentResponse optional func confirm(intent: INSearchCallHistoryIntent, completion: @escaping (INSearchCallHistoryIntentResponse) -> Void) + optional func confirm(intent: INSearchCallHistoryIntent) async -> INSearchCallHistoryIntentResponse @available(iOS, introduced: 10.0, deprecated: 11.0, message: "resolveCallTypeForSearchCallHistory:withCompletion: is deprecated. Use resolveCallTypesForSearchCallHistory:withCompletion: instead") optional func resolveCallType(for intent: INSearchCallHistoryIntent, with completion: @escaping (INCallRecordTypeResolutionResult) -> Void) + @available(iOS, introduced: 10.0, deprecated: 11.0, message: "resolveCallTypeForSearchCallHistory:withCompletion: is deprecated. Use resolveCallTypesForSearchCallHistory:withCompletion: instead") + optional func resolveCallType(for intent: INSearchCallHistoryIntent) async -> INCallRecordTypeResolutionResult optional func resolveDateCreated(for intent: INSearchCallHistoryIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveDateCreated(for intent: INSearchCallHistoryIntent) async -> INDateComponentsRangeResolutionResult optional func resolveRecipient(for intent: INSearchCallHistoryIntent, with completion: @escaping (INPersonResolutionResult) -> Void) + optional func resolveRecipient(for intent: INSearchCallHistoryIntent) async -> INPersonResolutionResult @available(iOS 11.0, *) optional func resolveCallTypes(for intent: INSearchCallHistoryIntent, with completion: @escaping (INCallRecordTypeOptionsResolutionResult) -> Void) @available(iOS 11.0, *) + optional func resolveCallTypes(for intent: INSearchCallHistoryIntent) async -> INCallRecordTypeOptionsResolutionResult + @available(iOS 11.0, *) optional func resolveUnseen(for intent: INSearchCallHistoryIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) + @available(iOS 11.0, *) + optional func resolveUnseen(for intent: INSearchCallHistoryIntent) async -> INBooleanResolutionResult } diff --git a/iOS/Intents/INSearchForAccountsIntent.swift b/iOS/Intents/INSearchForAccountsIntent.swift index c38e6c5..d21df2e 100644 --- a/iOS/Intents/INSearchForAccountsIntent.swift +++ b/iOS/Intents/INSearchForAccountsIntent.swift @@ -10,9 +10,15 @@ class INSearchForAccountsIntent : INIntent { @available(iOS 11.0, *) protocol INSearchForAccountsIntentHandling : NSObjectProtocol { func handle(intent: INSearchForAccountsIntent, completion: @escaping (INSearchForAccountsIntentResponse) -> Void) + func handle(intent: INSearchForAccountsIntent) async -> INSearchForAccountsIntentResponse optional func confirm(intent: INSearchForAccountsIntent, completion: @escaping (INSearchForAccountsIntentResponse) -> Void) + optional func confirm(intent: INSearchForAccountsIntent) async -> INSearchForAccountsIntentResponse optional func resolveAccountNickname(for intent: INSearchForAccountsIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveAccountNickname(for intent: INSearchForAccountsIntent) async -> INSpeakableStringResolutionResult optional func resolveAccountType(for intent: INSearchForAccountsIntent, with completion: @escaping (INAccountTypeResolutionResult) -> Void) + optional func resolveAccountType(for intent: INSearchForAccountsIntent) async -> INAccountTypeResolutionResult optional func resolveOrganizationName(for intent: INSearchForAccountsIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveOrganizationName(for intent: INSearchForAccountsIntent) async -> INSpeakableStringResolutionResult optional func resolveRequestedBalanceType(for intent: INSearchForAccountsIntent, with completion: @escaping (INBalanceTypeResolutionResult) -> Void) + optional func resolveRequestedBalanceType(for intent: INSearchForAccountsIntent) async -> INBalanceTypeResolutionResult } diff --git a/iOS/Intents/INSearchForBillsIntent.swift b/iOS/Intents/INSearchForBillsIntent.swift index a4269cb..8ca2d45 100644 --- a/iOS/Intents/INSearchForBillsIntent.swift +++ b/iOS/Intents/INSearchForBillsIntent.swift @@ -11,10 +11,17 @@ class INSearchForBillsIntent : INIntent { @available(iOS 10.3, *) protocol INSearchForBillsIntentHandling : NSObjectProtocol { func handle(intent: INSearchForBillsIntent, completion: @escaping (INSearchForBillsIntentResponse) -> Void) + func handle(intent: INSearchForBillsIntent) async -> INSearchForBillsIntentResponse optional func confirm(intent: INSearchForBillsIntent, completion: @escaping (INSearchForBillsIntentResponse) -> Void) + optional func confirm(intent: INSearchForBillsIntent) async -> INSearchForBillsIntentResponse optional func resolveBillPayee(for intent: INSearchForBillsIntent, with completion: @escaping (INBillPayeeResolutionResult) -> Void) + optional func resolveBillPayee(for intent: INSearchForBillsIntent) async -> INBillPayeeResolutionResult optional func resolvePaymentDateRange(for intent: INSearchForBillsIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolvePaymentDateRange(for intent: INSearchForBillsIntent) async -> INDateComponentsRangeResolutionResult optional func resolveBillType(for intent: INSearchForBillsIntent, with completion: @escaping (INBillTypeResolutionResult) -> Void) + optional func resolveBillType(for intent: INSearchForBillsIntent) async -> INBillTypeResolutionResult optional func resolveStatus(for intent: INSearchForBillsIntent, with completion: @escaping (INPaymentStatusResolutionResult) -> Void) + optional func resolveStatus(for intent: INSearchForBillsIntent) async -> INPaymentStatusResolutionResult optional func resolveDueDateRange(for intent: INSearchForBillsIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveDueDateRange(for intent: INSearchForBillsIntent) async -> INDateComponentsRangeResolutionResult } diff --git a/iOS/Intents/INSearchForMediaIntent.swift b/iOS/Intents/INSearchForMediaIntent.swift index 753d2b8..365b44f 100644 --- a/iOS/Intents/INSearchForMediaIntent.swift +++ b/iOS/Intents/INSearchForMediaIntent.swift @@ -8,6 +8,9 @@ class INSearchForMediaIntent : INIntent { @available(iOS 13.0, *) protocol INSearchForMediaIntentHandling : NSObjectProtocol { func handle(intent: INSearchForMediaIntent, completion: @escaping (INSearchForMediaIntentResponse) -> Void) + func handle(intent: INSearchForMediaIntent) async -> INSearchForMediaIntentResponse optional func confirm(intent: INSearchForMediaIntent, completion: @escaping (INSearchForMediaIntentResponse) -> Void) + optional func confirm(intent: INSearchForMediaIntent) async -> INSearchForMediaIntentResponse optional func resolveMediaItems(for intent: INSearchForMediaIntent, with completion: @escaping ([INSearchForMediaMediaItemResolutionResult]) -> Void) + optional func resolveMediaItems(for intent: INSearchForMediaIntent) async -> [INSearchForMediaMediaItemResolutionResult] } diff --git a/iOS/Intents/INSearchForMessagesIntent.swift b/iOS/Intents/INSearchForMessagesIntent.swift index c2ef3ff..fb76f18 100644 --- a/iOS/Intents/INSearchForMessagesIntent.swift +++ b/iOS/Intents/INSearchForMessagesIntent.swift @@ -27,13 +27,23 @@ class INSearchForMessagesIntent : INIntent { @available(iOS 10.0, *) protocol INSearchForMessagesIntentHandling : NSObjectProtocol { func handle(intent: INSearchForMessagesIntent, completion: @escaping (INSearchForMessagesIntentResponse) -> Void) + func handle(intent: INSearchForMessagesIntent) async -> INSearchForMessagesIntentResponse optional func confirm(intent: INSearchForMessagesIntent, completion: @escaping (INSearchForMessagesIntentResponse) -> Void) + optional func confirm(intent: INSearchForMessagesIntent) async -> INSearchForMessagesIntentResponse optional func resolveRecipients(for intent: INSearchForMessagesIntent, with completion: @escaping ([INPersonResolutionResult]) -> Void) + optional func resolveRecipients(for intent: INSearchForMessagesIntent) async -> [INPersonResolutionResult] optional func resolveSenders(for intent: INSearchForMessagesIntent, with completion: @escaping ([INPersonResolutionResult]) -> Void) + optional func resolveSenders(for intent: INSearchForMessagesIntent) async -> [INPersonResolutionResult] optional func resolveAttributes(for intent: INSearchForMessagesIntent, with completion: @escaping (INMessageAttributeOptionsResolutionResult) -> Void) + optional func resolveAttributes(for intent: INSearchForMessagesIntent) async -> INMessageAttributeOptionsResolutionResult optional func resolveDateTimeRange(for intent: INSearchForMessagesIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveDateTimeRange(for intent: INSearchForMessagesIntent) async -> INDateComponentsRangeResolutionResult @available(iOS, introduced: 10.0, deprecated: 11.0, message: "resolveGroupNamesForSearchForMessages:withCompletion: is deprecated. Use resolveSpeakableGroupNamesForSearchForMessages:withCompletion: instead") optional func resolveGroupNames(for intent: INSearchForMessagesIntent, with completion: @escaping ([INStringResolutionResult]) -> Void) + @available(iOS, introduced: 10.0, deprecated: 11.0, message: "resolveGroupNamesForSearchForMessages:withCompletion: is deprecated. Use resolveSpeakableGroupNamesForSearchForMessages:withCompletion: instead") + optional func resolveGroupNames(for intent: INSearchForMessagesIntent) async -> [INStringResolutionResult] @available(iOS 11.0, *) optional func resolveSpeakableGroupNames(for intent: INSearchForMessagesIntent, with completion: @escaping ([INSpeakableStringResolutionResult]) -> Void) + @available(iOS 11.0, *) + optional func resolveSpeakableGroupNames(for intent: INSearchForMessagesIntent) async -> [INSpeakableStringResolutionResult] } diff --git a/iOS/Intents/INSearchForNotebookItemsIntent.swift b/iOS/Intents/INSearchForNotebookItemsIntent.swift index 5d30ed7..143637f 100644 --- a/iOS/Intents/INSearchForNotebookItemsIntent.swift +++ b/iOS/Intents/INSearchForNotebookItemsIntent.swift @@ -21,17 +21,31 @@ class INSearchForNotebookItemsIntent : INIntent { @available(iOS 11.0, *) protocol INSearchForNotebookItemsIntentHandling : NSObjectProtocol { func handle(intent: INSearchForNotebookItemsIntent, completion: @escaping (INSearchForNotebookItemsIntentResponse) -> Void) + func handle(intent: INSearchForNotebookItemsIntent) async -> INSearchForNotebookItemsIntentResponse optional func confirm(intent: INSearchForNotebookItemsIntent, completion: @escaping (INSearchForNotebookItemsIntentResponse) -> Void) + optional func confirm(intent: INSearchForNotebookItemsIntent) async -> INSearchForNotebookItemsIntentResponse optional func resolveTitle(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveTitle(for intent: INSearchForNotebookItemsIntent) async -> INSpeakableStringResolutionResult optional func resolveContent(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INStringResolutionResult) -> Void) + optional func resolveContent(for intent: INSearchForNotebookItemsIntent) async -> INStringResolutionResult optional func resolveItemType(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INNotebookItemTypeResolutionResult) -> Void) + optional func resolveItemType(for intent: INSearchForNotebookItemsIntent) async -> INNotebookItemTypeResolutionResult optional func resolveStatus(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INTaskStatusResolutionResult) -> Void) + optional func resolveStatus(for intent: INSearchForNotebookItemsIntent) async -> INTaskStatusResolutionResult optional func resolveLocation(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INPlacemarkResolutionResult) -> Void) + optional func resolveLocation(for intent: INSearchForNotebookItemsIntent) async -> INPlacemarkResolutionResult optional func resolveLocationSearchType(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INLocationSearchTypeResolutionResult) -> Void) + optional func resolveLocationSearchType(for intent: INSearchForNotebookItemsIntent) async -> INLocationSearchTypeResolutionResult optional func resolveDateTime(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveDateTime(for intent: INSearchForNotebookItemsIntent) async -> INDateComponentsRangeResolutionResult optional func resolveDateSearchType(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INDateSearchTypeResolutionResult) -> Void) + optional func resolveDateSearchType(for intent: INSearchForNotebookItemsIntent) async -> INDateSearchTypeResolutionResult @available(iOS 13.0, *) optional func resolveTemporalEventTriggerTypes(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INTemporalEventTriggerTypeOptionsResolutionResult) -> Void) @available(iOS 13.0, *) + optional func resolveTemporalEventTriggerTypes(for intent: INSearchForNotebookItemsIntent) async -> INTemporalEventTriggerTypeOptionsResolutionResult + @available(iOS 13.0, *) optional func resolveTaskPriority(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INTaskPriorityResolutionResult) -> Void) + @available(iOS 13.0, *) + optional func resolveTaskPriority(for intent: INSearchForNotebookItemsIntent) async -> INTaskPriorityResolutionResult } diff --git a/iOS/Intents/INSearchForPhotosIntent.swift b/iOS/Intents/INSearchForPhotosIntent.swift index 30d9f56..f08efa0 100644 --- a/iOS/Intents/INSearchForPhotosIntent.swift +++ b/iOS/Intents/INSearchForPhotosIntent.swift @@ -15,11 +15,19 @@ class INSearchForPhotosIntent : INIntent { @available(iOS 10.0, *) protocol INSearchForPhotosIntentHandling : NSObjectProtocol { func handle(intent: INSearchForPhotosIntent, completion: @escaping (INSearchForPhotosIntentResponse) -> Void) + func handle(intent: INSearchForPhotosIntent) async -> INSearchForPhotosIntentResponse optional func confirm(intent: INSearchForPhotosIntent, completion: @escaping (INSearchForPhotosIntentResponse) -> Void) + optional func confirm(intent: INSearchForPhotosIntent) async -> INSearchForPhotosIntentResponse optional func resolveDateCreated(for intent: INSearchForPhotosIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveDateCreated(for intent: INSearchForPhotosIntent) async -> INDateComponentsRangeResolutionResult optional func resolveLocationCreated(for intent: INSearchForPhotosIntent, with completion: @escaping (INPlacemarkResolutionResult) -> Void) + optional func resolveLocationCreated(for intent: INSearchForPhotosIntent) async -> INPlacemarkResolutionResult optional func resolveAlbumName(for intent: INSearchForPhotosIntent, with completion: @escaping (INStringResolutionResult) -> Void) + optional func resolveAlbumName(for intent: INSearchForPhotosIntent) async -> INStringResolutionResult @available(iOS 11.0, *) optional func resolveSearchTerms(for intent: INSearchForPhotosIntent, with completion: @escaping ([INStringResolutionResult]) -> Void) + @available(iOS 11.0, *) + optional func resolveSearchTerms(for intent: INSearchForPhotosIntent) async -> [INStringResolutionResult] optional func resolvePeopleInPhoto(for intent: INSearchForPhotosIntent, with completion: @escaping ([INPersonResolutionResult]) -> Void) + optional func resolvePeopleInPhoto(for intent: INSearchForPhotosIntent) async -> [INPersonResolutionResult] } diff --git a/iOS/Intents/INSendMessageIntent.swift b/iOS/Intents/INSendMessageIntent.swift index 315809f..4c43a12 100644 --- a/iOS/Intents/INSendMessageIntent.swift +++ b/iOS/Intents/INSendMessageIntent.swift @@ -19,16 +19,29 @@ class INSendMessageIntent : INIntent { @available(iOS 10.0, *) protocol INSendMessageIntentHandling : NSObjectProtocol { func handle(intent: INSendMessageIntent, completion: @escaping (INSendMessageIntentResponse) -> Void) + func handle(intent: INSendMessageIntent) async -> INSendMessageIntentResponse optional func confirm(intent: INSendMessageIntent, completion: @escaping (INSendMessageIntentResponse) -> Void) + optional func confirm(intent: INSendMessageIntent) async -> INSendMessageIntentResponse @available(iOS, introduced: 10.0, deprecated: 11.0, message: "resolveRecipientsForSendMessage:withCompletion: is deprecated. Use resolveRecipientsForSendMessage:completion: instead") optional func resolveRecipients(for intent: INSendMessageIntent, with completion: @escaping ([INPersonResolutionResult]) -> Void) + @available(iOS, introduced: 10.0, deprecated: 11.0, message: "resolveRecipientsForSendMessage:withCompletion: is deprecated. Use resolveRecipientsForSendMessage:completion: instead") + optional func resolveRecipients(for intent: INSendMessageIntent) async -> [INPersonResolutionResult] @available(iOS 11.0, *) optional func resolveRecipients(for intent: INSendMessageIntent, with completion: @escaping ([INSendMessageRecipientResolutionResult]) -> Void) + @available(iOS 11.0, *) + optional func resolveRecipients(for intent: INSendMessageIntent) async -> [INSendMessageRecipientResolutionResult] @available(iOS, introduced: 10.0, deprecated: 11.0, message: "resolveGroupNameForSendMessage:withCompletion: is deprecated. Use resolveSpeakableGroupNameForSendMessage:withCompletion: instead") optional func resolveGroupName(for intent: INSendMessageIntent, with completion: @escaping (INStringResolutionResult) -> Void) + @available(iOS, introduced: 10.0, deprecated: 11.0, message: "resolveGroupNameForSendMessage:withCompletion: is deprecated. Use resolveSpeakableGroupNameForSendMessage:withCompletion: instead") + optional func resolveGroupName(for intent: INSendMessageIntent) async -> INStringResolutionResult @available(iOS 14.0, *) optional func resolveOutgoingMessageType(for intent: INSendMessageIntent, with completion: @escaping (INOutgoingMessageTypeResolutionResult) -> Void) + @available(iOS 14.0, *) + optional func resolveOutgoingMessageType(for intent: INSendMessageIntent) async -> INOutgoingMessageTypeResolutionResult optional func resolveContent(for intent: INSendMessageIntent, with completion: @escaping (INStringResolutionResult) -> Void) + optional func resolveContent(for intent: INSendMessageIntent) async -> INStringResolutionResult @available(iOS 11.0, *) optional func resolveSpeakableGroupName(for intent: INSendMessageIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + @available(iOS 11.0, *) + optional func resolveSpeakableGroupName(for intent: INSendMessageIntent) async -> INSpeakableStringResolutionResult } diff --git a/iOS/Intents/INSendPaymentIntent.swift b/iOS/Intents/INSendPaymentIntent.swift index 6ff3a13..9428869 100644 --- a/iOS/Intents/INSendPaymentIntent.swift +++ b/iOS/Intents/INSendPaymentIntent.swift @@ -9,14 +9,25 @@ class INSendPaymentIntent : INIntent { @available(iOS 10.0, *) protocol INSendPaymentIntentHandling : NSObjectProtocol { func handle(intent: INSendPaymentIntent, completion: @escaping (INSendPaymentIntentResponse) -> Void) + func handle(intent: INSendPaymentIntent) async -> INSendPaymentIntentResponse optional func confirm(intent: INSendPaymentIntent, completion: @escaping (INSendPaymentIntentResponse) -> Void) + optional func confirm(intent: INSendPaymentIntent) async -> INSendPaymentIntentResponse @available(iOS, introduced: 10.0, deprecated: 11.0, message: "resolvePayeeForSendPayment:withCompletion: is deprecated. Use resolvePayeeForSendPayment:completion: instead") optional func resolvePayee(for intent: INSendPaymentIntent, with completion: @escaping (INPersonResolutionResult) -> Void) + @available(iOS, introduced: 10.0, deprecated: 11.0, message: "resolvePayeeForSendPayment:withCompletion: is deprecated. Use resolvePayeeForSendPayment:completion: instead") + optional func resolvePayee(for intent: INSendPaymentIntent) async -> INPersonResolutionResult @available(iOS 11.0, *) optional func resolvePayee(for intent: INSendPaymentIntent, with completion: @escaping (INSendPaymentPayeeResolutionResult) -> Void) + @available(iOS 11.0, *) + optional func resolvePayee(for intent: INSendPaymentIntent) async -> INSendPaymentPayeeResolutionResult @available(iOS, introduced: 10.0, deprecated: 11.0, message: "resolveCurrencyAmountForSendPayment:withCompletion: is deprecated. Use resolveCurrencyAmountForSendPayment:completion: instead") optional func resolveCurrencyAmount(for intent: INSendPaymentIntent, with completion: @escaping (INCurrencyAmountResolutionResult) -> Void) + @available(iOS, introduced: 10.0, deprecated: 11.0, message: "resolveCurrencyAmountForSendPayment:withCompletion: is deprecated. Use resolveCurrencyAmountForSendPayment:completion: instead") + optional func resolveCurrencyAmount(for intent: INSendPaymentIntent) async -> INCurrencyAmountResolutionResult @available(iOS 11.0, *) optional func resolveCurrencyAmount(for intent: INSendPaymentIntent, with completion: @escaping (INSendPaymentCurrencyAmountResolutionResult) -> Void) + @available(iOS 11.0, *) + optional func resolveCurrencyAmount(for intent: INSendPaymentIntent) async -> INSendPaymentCurrencyAmountResolutionResult optional func resolveNote(for intent: INSendPaymentIntent, with completion: @escaping (INStringResolutionResult) -> Void) + optional func resolveNote(for intent: INSendPaymentIntent) async -> INStringResolutionResult } diff --git a/iOS/Intents/INSendRideFeedbackIntent.swift b/iOS/Intents/INSendRideFeedbackIntent.swift index cb723ee..9728120 100644 --- a/iOS/Intents/INSendRideFeedbackIntent.swift +++ b/iOS/Intents/INSendRideFeedbackIntent.swift @@ -9,5 +9,7 @@ class INSendRideFeedbackIntent : INIntent { @available(iOS 11.0, *) protocol INSendRideFeedbackIntentHandling : NSObjectProtocol { func handle(sendRideFeedback sendRideFeedbackintent: INSendRideFeedbackIntent, completion: @escaping (INSendRideFeedbackIntentResponse) -> Void) + func handle(sendRideFeedback sendRideFeedbackintent: INSendRideFeedbackIntent) async -> INSendRideFeedbackIntentResponse optional func confirm(sendRideFeedback sendRideFeedbackIntent: INSendRideFeedbackIntent, completion: @escaping (INSendRideFeedbackIntentResponse) -> Void) + optional func confirm(sendRideFeedback sendRideFeedbackIntent: INSendRideFeedbackIntent) async -> INSendRideFeedbackIntentResponse } diff --git a/iOS/Intents/INSetAudioSourceInCarIntent.swift b/iOS/Intents/INSetAudioSourceInCarIntent.swift index f9eb586..52a1b15 100644 --- a/iOS/Intents/INSetAudioSourceInCarIntent.swift +++ b/iOS/Intents/INSetAudioSourceInCarIntent.swift @@ -8,7 +8,11 @@ class INSetAudioSourceInCarIntent : INIntent { @available(iOS 10.0, *) protocol INSetAudioSourceInCarIntentHandling : NSObjectProtocol { func handle(intent: INSetAudioSourceInCarIntent, completion: @escaping (INSetAudioSourceInCarIntentResponse) -> Void) + func handle(intent: INSetAudioSourceInCarIntent) async -> INSetAudioSourceInCarIntentResponse optional func confirm(intent: INSetAudioSourceInCarIntent, completion: @escaping (INSetAudioSourceInCarIntentResponse) -> Void) + optional func confirm(intent: INSetAudioSourceInCarIntent) async -> INSetAudioSourceInCarIntentResponse optional func resolveAudioSource(for intent: INSetAudioSourceInCarIntent, with completion: @escaping (INCarAudioSourceResolutionResult) -> Void) + optional func resolveAudioSource(for intent: INSetAudioSourceInCarIntent) async -> INCarAudioSourceResolutionResult optional func resolveRelativeAudioSourceReference(for intent: INSetAudioSourceInCarIntent, with completion: @escaping (INRelativeReferenceResolutionResult) -> Void) + optional func resolveRelativeAudioSourceReference(for intent: INSetAudioSourceInCarIntent) async -> INRelativeReferenceResolutionResult } diff --git a/iOS/Intents/INSetCarLockStatusIntent.swift b/iOS/Intents/INSetCarLockStatusIntent.swift index 9f2589b..d810645 100644 --- a/iOS/Intents/INSetCarLockStatusIntent.swift +++ b/iOS/Intents/INSetCarLockStatusIntent.swift @@ -16,7 +16,11 @@ extension INSetCarLockStatusIntent { @available(iOS 10.3, *) protocol INSetCarLockStatusIntentHandling : NSObjectProtocol { func handle(intent: INSetCarLockStatusIntent, completion: @escaping (INSetCarLockStatusIntentResponse) -> Void) + func handle(intent: INSetCarLockStatusIntent) async -> INSetCarLockStatusIntentResponse optional func confirm(intent: INSetCarLockStatusIntent, completion: @escaping (INSetCarLockStatusIntentResponse) -> Void) + optional func confirm(intent: INSetCarLockStatusIntent) async -> INSetCarLockStatusIntentResponse optional func resolveLocked(for intent: INSetCarLockStatusIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) + optional func resolveLocked(for intent: INSetCarLockStatusIntent) async -> INBooleanResolutionResult optional func resolveCarName(for intent: INSetCarLockStatusIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveCarName(for intent: INSetCarLockStatusIntent) async -> INSpeakableStringResolutionResult } diff --git a/iOS/Intents/INSetClimateSettingsInCarIntent.swift b/iOS/Intents/INSetClimateSettingsInCarIntent.swift index aee14c3..f3c4d16 100644 --- a/iOS/Intents/INSetClimateSettingsInCarIntent.swift +++ b/iOS/Intents/INSetClimateSettingsInCarIntent.swift @@ -36,18 +36,33 @@ extension INSetClimateSettingsInCarIntent { @available(iOS 10.0, *) protocol INSetClimateSettingsInCarIntentHandling : NSObjectProtocol { func handle(intent: INSetClimateSettingsInCarIntent, completion: @escaping (INSetClimateSettingsInCarIntentResponse) -> Void) + func handle(intent: INSetClimateSettingsInCarIntent) async -> INSetClimateSettingsInCarIntentResponse optional func confirm(intent: INSetClimateSettingsInCarIntent, completion: @escaping (INSetClimateSettingsInCarIntentResponse) -> Void) + optional func confirm(intent: INSetClimateSettingsInCarIntent) async -> INSetClimateSettingsInCarIntentResponse optional func resolveEnableFan(for intent: INSetClimateSettingsInCarIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) + optional func resolveEnableFan(for intent: INSetClimateSettingsInCarIntent) async -> INBooleanResolutionResult optional func resolveEnableAirConditioner(for intent: INSetClimateSettingsInCarIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) + optional func resolveEnableAirConditioner(for intent: INSetClimateSettingsInCarIntent) async -> INBooleanResolutionResult optional func resolveEnableClimateControl(for intent: INSetClimateSettingsInCarIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) + optional func resolveEnableClimateControl(for intent: INSetClimateSettingsInCarIntent) async -> INBooleanResolutionResult optional func resolveEnableAutoMode(for intent: INSetClimateSettingsInCarIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) + optional func resolveEnableAutoMode(for intent: INSetClimateSettingsInCarIntent) async -> INBooleanResolutionResult optional func resolveAirCirculationMode(for intent: INSetClimateSettingsInCarIntent, with completion: @escaping (INCarAirCirculationModeResolutionResult) -> Void) + optional func resolveAirCirculationMode(for intent: INSetClimateSettingsInCarIntent) async -> INCarAirCirculationModeResolutionResult optional func resolveFanSpeedIndex(for intent: INSetClimateSettingsInCarIntent, with completion: @escaping (INIntegerResolutionResult) -> Void) + optional func resolveFanSpeedIndex(for intent: INSetClimateSettingsInCarIntent) async -> INIntegerResolutionResult optional func resolveFanSpeedPercentage(for intent: INSetClimateSettingsInCarIntent, with completion: @escaping (INDoubleResolutionResult) -> Void) + optional func resolveFanSpeedPercentage(for intent: INSetClimateSettingsInCarIntent) async -> INDoubleResolutionResult optional func resolveRelativeFanSpeedSetting(for intent: INSetClimateSettingsInCarIntent, with completion: @escaping (INRelativeSettingResolutionResult) -> Void) + optional func resolveRelativeFanSpeedSetting(for intent: INSetClimateSettingsInCarIntent) async -> INRelativeSettingResolutionResult optional func resolveTemperature(for intent: INSetClimateSettingsInCarIntent, with completion: @escaping (INTemperatureResolutionResult) -> Void) + optional func resolveTemperature(for intent: INSetClimateSettingsInCarIntent) async -> INTemperatureResolutionResult optional func resolveRelativeTemperatureSetting(for intent: INSetClimateSettingsInCarIntent, with completion: @escaping (INRelativeSettingResolutionResult) -> Void) + optional func resolveRelativeTemperatureSetting(for intent: INSetClimateSettingsInCarIntent) async -> INRelativeSettingResolutionResult optional func resolveClimateZone(for intent: INSetClimateSettingsInCarIntent, with completion: @escaping (INCarSeatResolutionResult) -> Void) + optional func resolveClimateZone(for intent: INSetClimateSettingsInCarIntent) async -> INCarSeatResolutionResult @available(iOS 12.0, *) optional func resolveCarName(for intent: INSetClimateSettingsInCarIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + @available(iOS 12.0, *) + optional func resolveCarName(for intent: INSetClimateSettingsInCarIntent) async -> INSpeakableStringResolutionResult } diff --git a/iOS/Intents/INSetDefrosterSettingsInCarIntent.swift b/iOS/Intents/INSetDefrosterSettingsInCarIntent.swift index fe43893..274eb5b 100644 --- a/iOS/Intents/INSetDefrosterSettingsInCarIntent.swift +++ b/iOS/Intents/INSetDefrosterSettingsInCarIntent.swift @@ -22,9 +22,15 @@ extension INSetDefrosterSettingsInCarIntent { @available(iOS 10.0, *) protocol INSetDefrosterSettingsInCarIntentHandling : NSObjectProtocol { func handle(intent: INSetDefrosterSettingsInCarIntent, completion: @escaping (INSetDefrosterSettingsInCarIntentResponse) -> Void) + func handle(intent: INSetDefrosterSettingsInCarIntent) async -> INSetDefrosterSettingsInCarIntentResponse optional func confirm(intent: INSetDefrosterSettingsInCarIntent, completion: @escaping (INSetDefrosterSettingsInCarIntentResponse) -> Void) + optional func confirm(intent: INSetDefrosterSettingsInCarIntent) async -> INSetDefrosterSettingsInCarIntentResponse optional func resolveEnable(for intent: INSetDefrosterSettingsInCarIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) + optional func resolveEnable(for intent: INSetDefrosterSettingsInCarIntent) async -> INBooleanResolutionResult optional func resolveDefroster(for intent: INSetDefrosterSettingsInCarIntent, with completion: @escaping (INCarDefrosterResolutionResult) -> Void) + optional func resolveDefroster(for intent: INSetDefrosterSettingsInCarIntent) async -> INCarDefrosterResolutionResult @available(iOS 12.0, *) optional func resolveCarName(for intent: INSetDefrosterSettingsInCarIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + @available(iOS 12.0, *) + optional func resolveCarName(for intent: INSetDefrosterSettingsInCarIntent) async -> INSpeakableStringResolutionResult } diff --git a/iOS/Intents/INSetMessageAttributeIntent.swift b/iOS/Intents/INSetMessageAttributeIntent.swift index c860495..01d925b 100644 --- a/iOS/Intents/INSetMessageAttributeIntent.swift +++ b/iOS/Intents/INSetMessageAttributeIntent.swift @@ -8,6 +8,9 @@ class INSetMessageAttributeIntent : INIntent { @available(iOS 10.0, *) protocol INSetMessageAttributeIntentHandling : NSObjectProtocol { func handle(intent: INSetMessageAttributeIntent, completion: @escaping (INSetMessageAttributeIntentResponse) -> Void) + func handle(intent: INSetMessageAttributeIntent) async -> INSetMessageAttributeIntentResponse optional func confirm(intent: INSetMessageAttributeIntent, completion: @escaping (INSetMessageAttributeIntentResponse) -> Void) + optional func confirm(intent: INSetMessageAttributeIntent) async -> INSetMessageAttributeIntentResponse optional func resolveAttribute(for intent: INSetMessageAttributeIntent, with completion: @escaping (INMessageAttributeResolutionResult) -> Void) + optional func resolveAttribute(for intent: INSetMessageAttributeIntent) async -> INMessageAttributeResolutionResult } diff --git a/iOS/Intents/INSetProfileInCarIntent.swift b/iOS/Intents/INSetProfileInCarIntent.swift index fe306e0..48633c5 100644 --- a/iOS/Intents/INSetProfileInCarIntent.swift +++ b/iOS/Intents/INSetProfileInCarIntent.swift @@ -47,12 +47,21 @@ class INSetProfileInCarIntent : INIntent { @available(iOS 10.0, *) protocol INSetProfileInCarIntentHandling : NSObjectProtocol { func handle(intent: INSetProfileInCarIntent, completion: @escaping (INSetProfileInCarIntentResponse) -> Void) + func handle(intent: INSetProfileInCarIntent) async -> INSetProfileInCarIntentResponse optional func confirm(intent: INSetProfileInCarIntent, completion: @escaping (INSetProfileInCarIntentResponse) -> Void) + optional func confirm(intent: INSetProfileInCarIntent) async -> INSetProfileInCarIntentResponse optional func resolveProfileNumber(for intent: INSetProfileInCarIntent, with completion: @escaping (INIntegerResolutionResult) -> Void) + optional func resolveProfileNumber(for intent: INSetProfileInCarIntent) async -> INIntegerResolutionResult @available(iOS 10.2, *) optional func resolveProfileName(for intent: INSetProfileInCarIntent, with completion: @escaping (INStringResolutionResult) -> Void) + @available(iOS 10.2, *) + optional func resolveProfileName(for intent: INSetProfileInCarIntent) async -> INStringResolutionResult @available(iOS 12.0, *) optional func resolveCarName(for intent: INSetProfileInCarIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + @available(iOS 12.0, *) + optional func resolveCarName(for intent: INSetProfileInCarIntent) async -> INSpeakableStringResolutionResult @available(iOS, introduced: 10.0, deprecated: 11.0, message: "The property doesn't need to be resolved") optional func resolveDefaultProfile(forSetProfileInCar intent: INSetProfileInCarIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) + @available(iOS, introduced: 10.0, deprecated: 11.0, message: "The property doesn't need to be resolved") + optional func resolveDefaultProfile(forSetProfileInCar intent: INSetProfileInCarIntent) async -> INBooleanResolutionResult } diff --git a/iOS/Intents/INSetRadioStationIntent.swift b/iOS/Intents/INSetRadioStationIntent.swift index 91f4194..6371329 100644 --- a/iOS/Intents/INSetRadioStationIntent.swift +++ b/iOS/Intents/INSetRadioStationIntent.swift @@ -20,10 +20,17 @@ extension INSetRadioStationIntent { @available(iOS 10.0, *) protocol INSetRadioStationIntentHandling : NSObjectProtocol { func handle(intent: INSetRadioStationIntent, completion: @escaping (INSetRadioStationIntentResponse) -> Void) + func handle(intent: INSetRadioStationIntent) async -> INSetRadioStationIntentResponse optional func confirm(intent: INSetRadioStationIntent, completion: @escaping (INSetRadioStationIntentResponse) -> Void) + optional func confirm(intent: INSetRadioStationIntent) async -> INSetRadioStationIntentResponse optional func resolveRadioType(for intent: INSetRadioStationIntent, with completion: @escaping (INRadioTypeResolutionResult) -> Void) + optional func resolveRadioType(for intent: INSetRadioStationIntent) async -> INRadioTypeResolutionResult optional func resolveFrequency(for intent: INSetRadioStationIntent, with completion: @escaping (INDoubleResolutionResult) -> Void) + optional func resolveFrequency(for intent: INSetRadioStationIntent) async -> INDoubleResolutionResult optional func resolveStationName(for intent: INSetRadioStationIntent, with completion: @escaping (INStringResolutionResult) -> Void) + optional func resolveStationName(for intent: INSetRadioStationIntent) async -> INStringResolutionResult optional func resolveChannel(for intent: INSetRadioStationIntent, with completion: @escaping (INStringResolutionResult) -> Void) + optional func resolveChannel(for intent: INSetRadioStationIntent) async -> INStringResolutionResult optional func resolvePresetNumber(for intent: INSetRadioStationIntent, with completion: @escaping (INIntegerResolutionResult) -> Void) + optional func resolvePresetNumber(for intent: INSetRadioStationIntent) async -> INIntegerResolutionResult } diff --git a/iOS/Intents/INSetSeatSettingsInCarIntent.swift b/iOS/Intents/INSetSeatSettingsInCarIntent.swift index e048d64..aeead61 100644 --- a/iOS/Intents/INSetSeatSettingsInCarIntent.swift +++ b/iOS/Intents/INSetSeatSettingsInCarIntent.swift @@ -29,13 +29,23 @@ extension INSetSeatSettingsInCarIntent { @available(iOS 10.0, *) protocol INSetSeatSettingsInCarIntentHandling : NSObjectProtocol { func handle(intent: INSetSeatSettingsInCarIntent, completion: @escaping (INSetSeatSettingsInCarIntentResponse) -> Void) + func handle(intent: INSetSeatSettingsInCarIntent) async -> INSetSeatSettingsInCarIntentResponse optional func confirm(intent: INSetSeatSettingsInCarIntent, completion: @escaping (INSetSeatSettingsInCarIntentResponse) -> Void) + optional func confirm(intent: INSetSeatSettingsInCarIntent) async -> INSetSeatSettingsInCarIntentResponse optional func resolveEnableHeating(for intent: INSetSeatSettingsInCarIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) + optional func resolveEnableHeating(for intent: INSetSeatSettingsInCarIntent) async -> INBooleanResolutionResult optional func resolveEnableCooling(for intent: INSetSeatSettingsInCarIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) + optional func resolveEnableCooling(for intent: INSetSeatSettingsInCarIntent) async -> INBooleanResolutionResult optional func resolveEnableMassage(for intent: INSetSeatSettingsInCarIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) + optional func resolveEnableMassage(for intent: INSetSeatSettingsInCarIntent) async -> INBooleanResolutionResult optional func resolveSeat(for intent: INSetSeatSettingsInCarIntent, with completion: @escaping (INCarSeatResolutionResult) -> Void) + optional func resolveSeat(for intent: INSetSeatSettingsInCarIntent) async -> INCarSeatResolutionResult optional func resolveLevel(for intent: INSetSeatSettingsInCarIntent, with completion: @escaping (INIntegerResolutionResult) -> Void) + optional func resolveLevel(for intent: INSetSeatSettingsInCarIntent) async -> INIntegerResolutionResult optional func resolveRelativeLevelSetting(for intent: INSetSeatSettingsInCarIntent, with completion: @escaping (INRelativeSettingResolutionResult) -> Void) + optional func resolveRelativeLevelSetting(for intent: INSetSeatSettingsInCarIntent) async -> INRelativeSettingResolutionResult @available(iOS 12.0, *) optional func resolveCarName(for intent: INSetSeatSettingsInCarIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + @available(iOS 12.0, *) + optional func resolveCarName(for intent: INSetSeatSettingsInCarIntent) async -> INSpeakableStringResolutionResult } diff --git a/iOS/Intents/INSetTaskAttributeIntent.swift b/iOS/Intents/INSetTaskAttributeIntent.swift index a7320d5..8e7beb3 100644 --- a/iOS/Intents/INSetTaskAttributeIntent.swift +++ b/iOS/Intents/INSetTaskAttributeIntent.swift @@ -15,16 +15,29 @@ class INSetTaskAttributeIntent : INIntent { @available(iOS 11.0, *) protocol INSetTaskAttributeIntentHandling : NSObjectProtocol { func handle(intent: INSetTaskAttributeIntent, completion: @escaping (INSetTaskAttributeIntentResponse) -> Void) + func handle(intent: INSetTaskAttributeIntent) async -> INSetTaskAttributeIntentResponse optional func confirm(intent: INSetTaskAttributeIntent, completion: @escaping (INSetTaskAttributeIntentResponse) -> Void) + optional func confirm(intent: INSetTaskAttributeIntent) async -> INSetTaskAttributeIntentResponse optional func resolveTargetTask(for intent: INSetTaskAttributeIntent, with completion: @escaping (INTaskResolutionResult) -> Void) + optional func resolveTargetTask(for intent: INSetTaskAttributeIntent) async -> INTaskResolutionResult @available(iOS 13.0, *) optional func resolveTaskTitle(for intent: INSetTaskAttributeIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + @available(iOS 13.0, *) + optional func resolveTaskTitle(for intent: INSetTaskAttributeIntent) async -> INSpeakableStringResolutionResult optional func resolveStatus(for intent: INSetTaskAttributeIntent, with completion: @escaping (INTaskStatusResolutionResult) -> Void) + optional func resolveStatus(for intent: INSetTaskAttributeIntent) async -> INTaskStatusResolutionResult @available(iOS 13.0, *) optional func resolvePriority(for intent: INSetTaskAttributeIntent, with completion: @escaping (INTaskPriorityResolutionResult) -> Void) + @available(iOS 13.0, *) + optional func resolvePriority(for intent: INSetTaskAttributeIntent) async -> INTaskPriorityResolutionResult optional func resolveSpatialEventTrigger(for intent: INSetTaskAttributeIntent, with completion: @escaping (INSpatialEventTriggerResolutionResult) -> Void) + optional func resolveSpatialEventTrigger(for intent: INSetTaskAttributeIntent) async -> INSpatialEventTriggerResolutionResult @available(iOS, introduced: 11.0, deprecated: 13.0, message: "resolveTemporalEventTriggerForSetTaskAttribute:withCompletion: is deprecated. Use resolveTemporalEventTriggerForSetTaskAttribute:completion: instead") optional func resolveTemporalEventTrigger(for intent: INSetTaskAttributeIntent, with completion: @escaping (INTemporalEventTriggerResolutionResult) -> Void) + @available(iOS, introduced: 11.0, deprecated: 13.0, message: "resolveTemporalEventTriggerForSetTaskAttribute:withCompletion: is deprecated. Use resolveTemporalEventTriggerForSetTaskAttribute:completion: instead") + optional func resolveTemporalEventTrigger(for intent: INSetTaskAttributeIntent) async -> INTemporalEventTriggerResolutionResult @available(iOS 13.0, *) optional func resolveTemporalEventTrigger(for intent: INSetTaskAttributeIntent, with completion: @escaping (INSetTaskAttributeTemporalEventTriggerResolutionResult) -> Void) + @available(iOS 13.0, *) + optional func resolveTemporalEventTrigger(for intent: INSetTaskAttributeIntent) async -> INSetTaskAttributeTemporalEventTriggerResolutionResult } diff --git a/iOS/Intents/INSnoozeTasksIntent.swift b/iOS/Intents/INSnoozeTasksIntent.swift index c1ea41b..1e6e996 100644 --- a/iOS/Intents/INSnoozeTasksIntent.swift +++ b/iOS/Intents/INSnoozeTasksIntent.swift @@ -17,7 +17,11 @@ extension INSnoozeTasksIntent { @available(iOS 13.0, *) protocol INSnoozeTasksIntentHandling : NSObjectProtocol { func handle(intent: INSnoozeTasksIntent, completion: @escaping (INSnoozeTasksIntentResponse) -> Void) + func handle(intent: INSnoozeTasksIntent) async -> INSnoozeTasksIntentResponse optional func confirm(intent: INSnoozeTasksIntent, completion: @escaping (INSnoozeTasksIntentResponse) -> Void) + optional func confirm(intent: INSnoozeTasksIntent) async -> INSnoozeTasksIntentResponse optional func resolveTasks(for intent: INSnoozeTasksIntent, with completion: @escaping ([INSnoozeTasksTaskResolutionResult]) -> Void) + optional func resolveTasks(for intent: INSnoozeTasksIntent) async -> [INSnoozeTasksTaskResolutionResult] optional func resolveNextTriggerTime(for intent: INSnoozeTasksIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveNextTriggerTime(for intent: INSnoozeTasksIntent) async -> INDateComponentsRangeResolutionResult } diff --git a/iOS/Intents/INStartAudioCallIntent.swift b/iOS/Intents/INStartAudioCallIntent.swift index 6a31178..2263055 100644 --- a/iOS/Intents/INStartAudioCallIntent.swift +++ b/iOS/Intents/INStartAudioCallIntent.swift @@ -10,8 +10,13 @@ class INStartAudioCallIntent : INIntent { @available(iOS, introduced: 10.0, deprecated: 13.0, message: "INStartAudioCallIntent is deprecated. Please adopt INStartCallIntent instead") protocol INStartAudioCallIntentHandling : NSObjectProtocol { func handle(intent: INStartAudioCallIntent, completion: @escaping (INStartAudioCallIntentResponse) -> Void) + func handle(intent: INStartAudioCallIntent) async -> INStartAudioCallIntentResponse optional func confirm(intent: INStartAudioCallIntent, completion: @escaping (INStartAudioCallIntentResponse) -> Void) + optional func confirm(intent: INStartAudioCallIntent) async -> INStartAudioCallIntentResponse @available(iOS 11.0, *) optional func resolveDestinationType(for intent: INStartAudioCallIntent, with completion: @escaping (INCallDestinationTypeResolutionResult) -> Void) + @available(iOS 11.0, *) + optional func resolveDestinationType(for intent: INStartAudioCallIntent) async -> INCallDestinationTypeResolutionResult optional func resolveContacts(for intent: INStartAudioCallIntent, with completion: @escaping ([INPersonResolutionResult]) -> Void) + optional func resolveContacts(for intent: INStartAudioCallIntent) async -> [INPersonResolutionResult] } diff --git a/iOS/Intents/INStartCallIntent.swift b/iOS/Intents/INStartCallIntent.swift index 9063757..05bc4ac 100644 --- a/iOS/Intents/INStartCallIntent.swift +++ b/iOS/Intents/INStartCallIntent.swift @@ -15,10 +15,17 @@ class INStartCallIntent : INIntent { @available(iOS 13.0, *) protocol INStartCallIntentHandling : NSObjectProtocol { func handle(intent: INStartCallIntent, completion: @escaping (INStartCallIntentResponse) -> Void) + func handle(intent: INStartCallIntent) async -> INStartCallIntentResponse optional func confirm(intent: INStartCallIntent, completion: @escaping (INStartCallIntentResponse) -> Void) + optional func confirm(intent: INStartCallIntent) async -> INStartCallIntentResponse @available(iOS 14.0, *) optional func resolveCallRecordToCallBack(for intent: INStartCallIntent, with completion: @escaping (INCallRecordResolutionResult) -> Void) + @available(iOS 14.0, *) + optional func resolveCallRecordToCallBack(for intent: INStartCallIntent) async -> INCallRecordResolutionResult optional func resolveDestinationType(for intent: INStartCallIntent, with completion: @escaping (INCallDestinationTypeResolutionResult) -> Void) + optional func resolveDestinationType(for intent: INStartCallIntent) async -> INCallDestinationTypeResolutionResult optional func resolveContacts(for intent: INStartCallIntent, with completion: @escaping ([INStartCallContactResolutionResult]) -> Void) + optional func resolveContacts(for intent: INStartCallIntent) async -> [INStartCallContactResolutionResult] optional func resolveCallCapability(for intent: INStartCallIntent, with completion: @escaping (INStartCallCallCapabilityResolutionResult) -> Void) + optional func resolveCallCapability(for intent: INStartCallIntent) async -> INStartCallCallCapabilityResolutionResult } diff --git a/iOS/Intents/INStartPhotoPlaybackIntent.swift b/iOS/Intents/INStartPhotoPlaybackIntent.swift index 3fbcd82..e2bb488 100644 --- a/iOS/Intents/INStartPhotoPlaybackIntent.swift +++ b/iOS/Intents/INStartPhotoPlaybackIntent.swift @@ -15,9 +15,15 @@ class INStartPhotoPlaybackIntent : INIntent { @available(iOS 10.0, *) protocol INStartPhotoPlaybackIntentHandling : NSObjectProtocol { func handle(intent: INStartPhotoPlaybackIntent, completion: @escaping (INStartPhotoPlaybackIntentResponse) -> Void) + func handle(intent: INStartPhotoPlaybackIntent) async -> INStartPhotoPlaybackIntentResponse optional func confirm(intent: INStartPhotoPlaybackIntent, completion: @escaping (INStartPhotoPlaybackIntentResponse) -> Void) + optional func confirm(intent: INStartPhotoPlaybackIntent) async -> INStartPhotoPlaybackIntentResponse optional func resolveDateCreated(for intent: INStartPhotoPlaybackIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveDateCreated(for intent: INStartPhotoPlaybackIntent) async -> INDateComponentsRangeResolutionResult optional func resolveLocationCreated(for intent: INStartPhotoPlaybackIntent, with completion: @escaping (INPlacemarkResolutionResult) -> Void) + optional func resolveLocationCreated(for intent: INStartPhotoPlaybackIntent) async -> INPlacemarkResolutionResult optional func resolveAlbumName(for intent: INStartPhotoPlaybackIntent, with completion: @escaping (INStringResolutionResult) -> Void) + optional func resolveAlbumName(for intent: INStartPhotoPlaybackIntent) async -> INStringResolutionResult optional func resolvePeopleInPhoto(for intent: INStartPhotoPlaybackIntent, with completion: @escaping ([INPersonResolutionResult]) -> Void) + optional func resolvePeopleInPhoto(for intent: INStartPhotoPlaybackIntent) async -> [INPersonResolutionResult] } diff --git a/iOS/Intents/INStartVideoCallIntent.swift b/iOS/Intents/INStartVideoCallIntent.swift index 0053791..ee5239f 100644 --- a/iOS/Intents/INStartVideoCallIntent.swift +++ b/iOS/Intents/INStartVideoCallIntent.swift @@ -7,6 +7,9 @@ class INStartVideoCallIntent : INIntent { @available(iOS, introduced: 10.0, deprecated: 13.0, message: "INStartVideoCallIntent is deprecated. Please adopt INStartCallIntent instead") protocol INStartVideoCallIntentHandling : NSObjectProtocol { func handle(intent: INStartVideoCallIntent, completion: @escaping (INStartVideoCallIntentResponse) -> Void) + func handle(intent: INStartVideoCallIntent) async -> INStartVideoCallIntentResponse optional func confirm(intent: INStartVideoCallIntent, completion: @escaping (INStartVideoCallIntentResponse) -> Void) + optional func confirm(intent: INStartVideoCallIntent) async -> INStartVideoCallIntentResponse optional func resolveContacts(for intent: INStartVideoCallIntent, with completion: @escaping ([INPersonResolutionResult]) -> Void) + optional func resolveContacts(for intent: INStartVideoCallIntent) async -> [INPersonResolutionResult] } diff --git a/iOS/Intents/INStartWorkoutIntent.swift b/iOS/Intents/INStartWorkoutIntent.swift index d981879..e1a52e8 100644 --- a/iOS/Intents/INStartWorkoutIntent.swift +++ b/iOS/Intents/INStartWorkoutIntent.swift @@ -20,10 +20,17 @@ extension INStartWorkoutIntent { @available(iOS 10.0, *) protocol INStartWorkoutIntentHandling : NSObjectProtocol { func handle(intent: INStartWorkoutIntent, completion: @escaping (INStartWorkoutIntentResponse) -> Void) + func handle(intent: INStartWorkoutIntent) async -> INStartWorkoutIntentResponse optional func confirm(intent: INStartWorkoutIntent, completion: @escaping (INStartWorkoutIntentResponse) -> Void) + optional func confirm(intent: INStartWorkoutIntent) async -> INStartWorkoutIntentResponse optional func resolveWorkoutName(for intent: INStartWorkoutIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveWorkoutName(for intent: INStartWorkoutIntent) async -> INSpeakableStringResolutionResult optional func resolveGoalValue(for intent: INStartWorkoutIntent, with completion: @escaping (INDoubleResolutionResult) -> Void) + optional func resolveGoalValue(for intent: INStartWorkoutIntent) async -> INDoubleResolutionResult optional func resolveWorkoutGoalUnitType(for intent: INStartWorkoutIntent, with completion: @escaping (INWorkoutGoalUnitTypeResolutionResult) -> Void) + optional func resolveWorkoutGoalUnitType(for intent: INStartWorkoutIntent) async -> INWorkoutGoalUnitTypeResolutionResult optional func resolveWorkoutLocationType(for intent: INStartWorkoutIntent, with completion: @escaping (INWorkoutLocationTypeResolutionResult) -> Void) + optional func resolveWorkoutLocationType(for intent: INStartWorkoutIntent) async -> INWorkoutLocationTypeResolutionResult optional func resolveIsOpenEnded(for intent: INStartWorkoutIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) + optional func resolveIsOpenEnded(for intent: INStartWorkoutIntent) async -> INBooleanResolutionResult } diff --git a/iOS/Intents/INTransferMoneyIntent.swift b/iOS/Intents/INTransferMoneyIntent.swift index a5eafee..a3893b7 100644 --- a/iOS/Intents/INTransferMoneyIntent.swift +++ b/iOS/Intents/INTransferMoneyIntent.swift @@ -11,10 +11,17 @@ class INTransferMoneyIntent : INIntent { @available(iOS 11.0, *) protocol INTransferMoneyIntentHandling : NSObjectProtocol { func handle(intent: INTransferMoneyIntent, completion: @escaping (INTransferMoneyIntentResponse) -> Void) + func handle(intent: INTransferMoneyIntent) async -> INTransferMoneyIntentResponse optional func confirm(intent: INTransferMoneyIntent, completion: @escaping (INTransferMoneyIntentResponse) -> Void) + optional func confirm(intent: INTransferMoneyIntent) async -> INTransferMoneyIntentResponse optional func resolveFromAccount(for intent: INTransferMoneyIntent, with completion: @escaping (INPaymentAccountResolutionResult) -> Void) + optional func resolveFromAccount(for intent: INTransferMoneyIntent) async -> INPaymentAccountResolutionResult optional func resolveToAccount(for intent: INTransferMoneyIntent, with completion: @escaping (INPaymentAccountResolutionResult) -> Void) + optional func resolveToAccount(for intent: INTransferMoneyIntent) async -> INPaymentAccountResolutionResult optional func resolveTransactionAmount(for intent: INTransferMoneyIntent, with completion: @escaping (INPaymentAmountResolutionResult) -> Void) + optional func resolveTransactionAmount(for intent: INTransferMoneyIntent) async -> INPaymentAmountResolutionResult optional func resolveTransactionScheduledDate(for intent: INTransferMoneyIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveTransactionScheduledDate(for intent: INTransferMoneyIntent) async -> INDateComponentsRangeResolutionResult optional func resolveTransactionNote(for intent: INTransferMoneyIntent, with completion: @escaping (INStringResolutionResult) -> Void) + optional func resolveTransactionNote(for intent: INTransferMoneyIntent) async -> INStringResolutionResult } diff --git a/iOS/Intents/INUpdateMediaAffinityIntent.swift b/iOS/Intents/INUpdateMediaAffinityIntent.swift index 0684ce2..61d72cd 100644 --- a/iOS/Intents/INUpdateMediaAffinityIntent.swift +++ b/iOS/Intents/INUpdateMediaAffinityIntent.swift @@ -9,7 +9,11 @@ class INUpdateMediaAffinityIntent : INIntent { @available(iOS 13.0, *) protocol INUpdateMediaAffinityIntentHandling : NSObjectProtocol { func handle(intent: INUpdateMediaAffinityIntent, completion: @escaping (INUpdateMediaAffinityIntentResponse) -> Void) + func handle(intent: INUpdateMediaAffinityIntent) async -> INUpdateMediaAffinityIntentResponse optional func confirm(intent: INUpdateMediaAffinityIntent, completion: @escaping (INUpdateMediaAffinityIntentResponse) -> Void) + optional func confirm(intent: INUpdateMediaAffinityIntent) async -> INUpdateMediaAffinityIntentResponse optional func resolveMediaItems(for intent: INUpdateMediaAffinityIntent, with completion: @escaping ([INUpdateMediaAffinityMediaItemResolutionResult]) -> Void) + optional func resolveMediaItems(for intent: INUpdateMediaAffinityIntent) async -> [INUpdateMediaAffinityMediaItemResolutionResult] optional func resolveAffinityType(for intent: INUpdateMediaAffinityIntent, with completion: @escaping (INMediaAffinityTypeResolutionResult) -> Void) + optional func resolveAffinityType(for intent: INUpdateMediaAffinityIntent) async -> INMediaAffinityTypeResolutionResult } diff --git a/iOS/Intents/INVoiceShortcutCenter.swift b/iOS/Intents/INVoiceShortcutCenter.swift index 29a8ad0..24e4105 100644 --- a/iOS/Intents/INVoiceShortcutCenter.swift +++ b/iOS/Intents/INVoiceShortcutCenter.swift @@ -3,6 +3,8 @@ class INVoiceShortcutCenter : NSObject { class var shared: INVoiceShortcutCenter { get } func getAllVoiceShortcuts(completion completionHandler: @escaping ([INVoiceShortcut]?, Error?) -> Void) + func getAllVoiceShortcuts() async throws -> [INVoiceShortcut]? func getVoiceShortcut(with identifier: UUID, completion completionHandler: @escaping (INVoiceShortcut?, Error?) -> Void) + func getVoiceShortcut(with identifier: UUID) async throws -> INVoiceShortcut? func setShortcutSuggestions(_ suggestions: [INShortcut]) } diff --git a/iOS/IntentsUI/INImage_IntentsUI.swift b/iOS/IntentsUI/INImage_IntentsUI.swift index 8cb1b2e..0024af5 100644 --- a/iOS/IntentsUI/INImage_IntentsUI.swift +++ b/iOS/IntentsUI/INImage_IntentsUI.swift @@ -8,4 +8,6 @@ extension INImage { class func imageSize(for response: INIntentResponse) -> CGSize @available(iOS 11.0, *) func fetchUIImage(completion: @escaping (UIImage?) -> Void) + @available(iOS 11.0, *) + func fetchUIImage() async -> UIImage? } diff --git a/iOS/IntentsUI/INUIAddVoiceShortcutViewController.swift b/iOS/IntentsUI/INUIAddVoiceShortcutViewController.swift index d45f619..37b61d5 100644 --- a/iOS/IntentsUI/INUIAddVoiceShortcutViewController.swift +++ b/iOS/IntentsUI/INUIAddVoiceShortcutViewController.swift @@ -6,6 +6,6 @@ class INUIAddVoiceShortcutViewController : UIViewController { } @available(iOS 12.0, *) protocol INUIAddVoiceShortcutViewControllerDelegate : NSObjectProtocol { - func addVoiceShortcutViewController(_ controller: INUIAddVoiceShortcutViewController, didFinishWith voiceShortcut: INVoiceShortcut?, error: Error?) - func addVoiceShortcutViewControllerDidCancel(_ controller: INUIAddVoiceShortcutViewController) + @asyncHandler func addVoiceShortcutViewController(_ controller: INUIAddVoiceShortcutViewController, didFinishWith voiceShortcut: INVoiceShortcut?, error: Error?) + @asyncHandler func addVoiceShortcutViewControllerDidCancel(_ controller: INUIAddVoiceShortcutViewController) } diff --git a/iOS/IntentsUI/INUIEditVoiceShortcutViewController.swift b/iOS/IntentsUI/INUIEditVoiceShortcutViewController.swift index 2c63123..fb2a8fd 100644 --- a/iOS/IntentsUI/INUIEditVoiceShortcutViewController.swift +++ b/iOS/IntentsUI/INUIEditVoiceShortcutViewController.swift @@ -6,7 +6,7 @@ class INUIEditVoiceShortcutViewController : UIViewController { } @available(iOS 12.0, *) protocol INUIEditVoiceShortcutViewControllerDelegate : NSObjectProtocol { - func editVoiceShortcutViewController(_ controller: INUIEditVoiceShortcutViewController, didUpdate voiceShortcut: INVoiceShortcut?, error: Error?) - func editVoiceShortcutViewController(_ controller: INUIEditVoiceShortcutViewController, didDeleteVoiceShortcutWithIdentifier deletedVoiceShortcutIdentifier: UUID) - func editVoiceShortcutViewControllerDidCancel(_ controller: INUIEditVoiceShortcutViewController) + @asyncHandler func editVoiceShortcutViewController(_ controller: INUIEditVoiceShortcutViewController, didUpdate voiceShortcut: INVoiceShortcut?, error: Error?) + @asyncHandler func editVoiceShortcutViewController(_ controller: INUIEditVoiceShortcutViewController, didDeleteVoiceShortcutWithIdentifier deletedVoiceShortcutIdentifier: UUID) + @asyncHandler func editVoiceShortcutViewControllerDidCancel(_ controller: INUIEditVoiceShortcutViewController) } diff --git a/iOS/IntentsUI/INUIHostedViewControlling.swift b/iOS/IntentsUI/INUIHostedViewControlling.swift index ed84413..16a7cf5 100644 --- a/iOS/IntentsUI/INUIHostedViewControlling.swift +++ b/iOS/IntentsUI/INUIHostedViewControlling.swift @@ -18,8 +18,11 @@ enum INUIInteractiveBehavior : UInt { @available(iOS 10.0, *) protocol INUIHostedViewControlling : NSObjectProtocol { optional func configure(with interaction: INInteraction, context: INUIHostedViewContext, completion: @escaping (CGSize) -> Void) + optional func configure(with interaction: INInteraction, context: INUIHostedViewContext) async -> CGSize @available(iOS 11.0, *) optional func configureView(for parameters: Set, of interaction: INInteraction, interactiveBehavior: INUIInteractiveBehavior, context: INUIHostedViewContext, completion: @escaping (Bool, Set, CGSize) -> Void) + @available(iOS 11.0, *) + optional func configureView(for parameters: Set, of interaction: INInteraction, interactiveBehavior: INUIInteractiveBehavior, context: INUIHostedViewContext) async -> (Bool, Set, CGSize) } extension NSExtensionContext { @available(iOS 10.0, *) diff --git a/iOS/LinkPresentation/LPMetadataProvider.swift b/iOS/LinkPresentation/LPMetadataProvider.swift index bddb4fe..c5ca51f 100644 --- a/iOS/LinkPresentation/LPMetadataProvider.swift +++ b/iOS/LinkPresentation/LPMetadataProvider.swift @@ -2,6 +2,7 @@ @available(iOS 13.0, *) class LPMetadataProvider : NSObject { func startFetchingMetadata(for URL: URL, completionHandler: @escaping (LPLinkMetadata?, Error?) -> Void) + func startFetchingMetadata(for URL: URL) async throws -> LPLinkMetadata? func cancel() var shouldFetchSubresources: Bool var timeout: TimeInterval diff --git a/iOS/MapKit/MKDirections.swift b/iOS/MapKit/MKDirections.swift index 01692cb..95c8c48 100644 --- a/iOS/MapKit/MKDirections.swift +++ b/iOS/MapKit/MKDirections.swift @@ -7,7 +7,9 @@ extension MKDirections { class MKDirections : NSObject { init(request: MKDirections.Request) func calculate(completionHandler: @escaping MKDirections.DirectionsHandler) + func calculate() async throws -> MKDirections.Response? func calculateETA(completionHandler: @escaping MKDirections.ETAHandler) + func calculateETA() async throws -> MKDirections.ETAResponse? func cancel() var isCalculating: Bool { get } } diff --git a/iOS/MapKit/MKLocalSearch.swift b/iOS/MapKit/MKLocalSearch.swift index 51b23a3..3c723dc 100644 --- a/iOS/MapKit/MKLocalSearch.swift +++ b/iOS/MapKit/MKLocalSearch.swift @@ -8,6 +8,7 @@ class MKLocalSearch : NSObject { @available(iOS 14.0, *) init(request: MKLocalPointsOfInterestRequest) func start(completionHandler: @escaping MKLocalSearch.CompletionHandler) + func start() async throws -> MKLocalSearch.Response? func cancel() var isSearching: Bool { get } } diff --git a/iOS/MapKit/MKLocalSearchCompleter.swift b/iOS/MapKit/MKLocalSearchCompleter.swift index 0e4e56f..39cc6ac 100644 --- a/iOS/MapKit/MKLocalSearchCompleter.swift +++ b/iOS/MapKit/MKLocalSearchCompleter.swift @@ -33,8 +33,8 @@ class MKLocalSearchCompleter : NSObject { } @available(iOS 9.3, *) protocol MKLocalSearchCompleterDelegate : NSObjectProtocol { - optional func completerDidUpdateResults(_ completer: MKLocalSearchCompleter) - optional func completer(_ completer: MKLocalSearchCompleter, didFailWithError error: Error) + @asyncHandler optional func completerDidUpdateResults(_ completer: MKLocalSearchCompleter) + @asyncHandler optional func completer(_ completer: MKLocalSearchCompleter, didFailWithError error: Error) } @available(iOS 9.3, *) class MKLocalSearchCompletion : NSObject { diff --git a/iOS/MapKit/MKMapItem.swift b/iOS/MapKit/MKMapItem.swift index 656b48d..0355c19 100644 --- a/iOS/MapKit/MKMapItem.swift +++ b/iOS/MapKit/MKMapItem.swift @@ -17,7 +17,11 @@ class MKMapItem : NSObject { @available(iOS 13.2, *) func openInMaps(launchOptions: [String : Any]? = nil, from scene: UIScene?, completionHandler completion: ((Bool) -> Void)? = nil) @available(iOS 13.2, *) + func openInMaps(launchOptions: [String : Any]? = nil, from scene: UIScene?) async -> Bool + @available(iOS 13.2, *) class func openMaps(with mapItems: [MKMapItem], launchOptions: [String : Any]? = nil, from scene: UIScene?, completionHandler completion: ((Bool) -> Void)? = nil) + @available(iOS 13.2, *) + class func openMaps(with mapItems: [MKMapItem], launchOptions: [String : Any]? = nil, from scene: UIScene?) async -> Bool } @available(iOS 6.0, *) let MKLaunchOptionsDirectionsModeKey: String diff --git a/iOS/MapKit/MKMapSnapshotter.swift b/iOS/MapKit/MKMapSnapshotter.swift index bb3554c..0dd068b 100644 --- a/iOS/MapKit/MKMapSnapshotter.swift +++ b/iOS/MapKit/MKMapSnapshotter.swift @@ -6,7 +6,9 @@ extension MKMapSnapshotter { class MKMapSnapshotter : NSObject { init(options: MKMapSnapshotter.Options) func start(completionHandler: @escaping MKMapSnapshotter.CompletionHandler) + func start() async throws -> MKMapSnapshotter.Snapshot? func start(with queue: DispatchQueue, completionHandler: @escaping MKMapSnapshotter.CompletionHandler) + func start(with queue: DispatchQueue) async throws -> MKMapSnapshotter.Snapshot? func cancel() var isLoading: Bool { get } } diff --git a/iOS/MapKit/MKMapView.swift b/iOS/MapKit/MKMapView.swift index 9b67c02..5d3ed13 100644 --- a/iOS/MapKit/MKMapView.swift +++ b/iOS/MapKit/MKMapView.swift @@ -133,47 +133,47 @@ protocol MKMapViewDelegate : NSObjectProtocol { @available(iOS 3.0, *) optional func mapView(_ mapView: MKMapView, regionDidChangeAnimated animated: Bool) @available(iOS 11, *) - optional func mapViewDidChangeVisibleRegion(_ mapView: MKMapView) + @asyncHandler optional func mapViewDidChangeVisibleRegion(_ mapView: MKMapView) @available(iOS 3.0, *) optional func mapViewWillStartLoadingMap(_ mapView: MKMapView) @available(iOS 3.0, *) - optional func mapViewDidFinishLoadingMap(_ mapView: MKMapView) + @asyncHandler optional func mapViewDidFinishLoadingMap(_ mapView: MKMapView) @available(iOS 3.0, *) - optional func mapViewDidFailLoadingMap(_ mapView: MKMapView, withError error: Error) + @asyncHandler optional func mapViewDidFailLoadingMap(_ mapView: MKMapView, withError error: Error) @available(iOS 7.0, *) optional func mapViewWillStartRenderingMap(_ mapView: MKMapView) @available(iOS 7.0, *) - optional func mapViewDidFinishRenderingMap(_ mapView: MKMapView, fullyRendered: Bool) + @asyncHandler optional func mapViewDidFinishRenderingMap(_ mapView: MKMapView, fullyRendered: Bool) @available(iOS 3.0, *) optional func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? @available(iOS 3.0, *) - optional func mapView(_ mapView: MKMapView, didAdd views: [MKAnnotationView]) + @asyncHandler optional func mapView(_ mapView: MKMapView, didAdd views: [MKAnnotationView]) @available(iOS 3.0, *) optional func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, calloutAccessoryControlTapped control: UIControl) @available(iOS 4.0, *) - optional func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) + @asyncHandler optional func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) @available(iOS 4.0, *) - optional func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView) + @asyncHandler optional func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView) @available(iOS 4.0, *) optional func mapViewWillStartLocatingUser(_ mapView: MKMapView) @available(iOS 4.0, *) - optional func mapViewDidStopLocatingUser(_ mapView: MKMapView) + @asyncHandler optional func mapViewDidStopLocatingUser(_ mapView: MKMapView) @available(iOS 4.0, *) - optional func mapView(_ mapView: MKMapView, didUpdate userLocation: MKUserLocation) + @asyncHandler optional func mapView(_ mapView: MKMapView, didUpdate userLocation: MKUserLocation) @available(iOS 4.0, *) - optional func mapView(_ mapView: MKMapView, didFailToLocateUserWithError error: Error) + @asyncHandler optional func mapView(_ mapView: MKMapView, didFailToLocateUserWithError error: Error) @available(iOS 4.0, *) - optional func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, didChange newState: MKAnnotationView.DragState, fromOldState oldState: MKAnnotationView.DragState) + @asyncHandler optional func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, didChange newState: MKAnnotationView.DragState, fromOldState oldState: MKAnnotationView.DragState) @available(iOS 5.0, *) - optional func mapView(_ mapView: MKMapView, didChange mode: MKUserTrackingMode, animated: Bool) + @asyncHandler optional func mapView(_ mapView: MKMapView, didChange mode: MKUserTrackingMode, animated: Bool) @available(iOS 7.0, *) optional func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer @available(iOS 7.0, *) - optional func mapView(_ mapView: MKMapView, didAdd renderers: [MKOverlayRenderer]) + @asyncHandler optional func mapView(_ mapView: MKMapView, didAdd renderers: [MKOverlayRenderer]) @available(iOS, introduced: 4.0, deprecated: 13.0) optional func mapView(_ mapView: MKMapView, viewFor overlay: MKOverlay) -> MKOverlayView @available(iOS, introduced: 4.0, deprecated: 13.0) - optional func mapView(_ mapView: MKMapView, didAddOverlayViews overlayViews: [Any]) + @asyncHandler optional func mapView(_ mapView: MKMapView, didAddOverlayViews overlayViews: [Any]) @available(iOS 11.0, *) optional func mapView(_ mapView: MKMapView, clusterAnnotationForMemberAnnotations memberAnnotations: [MKAnnotation]) -> MKClusterAnnotation } diff --git a/iOS/MediaPlayer/MPMediaLibrary.swift b/iOS/MediaPlayer/MPMediaLibrary.swift index 779bae3..25c5a00 100644 --- a/iOS/MediaPlayer/MPMediaLibrary.swift +++ b/iOS/MediaPlayer/MPMediaLibrary.swift @@ -21,7 +21,11 @@ class MPMediaLibrary : NSObject, NSSecureCoding { @available(iOS 9.3, *) func addItem(withProductID productID: String, completionHandler: (([MPMediaEntity], Error?) -> Void)? = nil) @available(iOS 9.3, *) + func addItem(withProductID productID: String) async throws -> [MPMediaEntity] + @available(iOS 9.3, *) func getPlaylist(with uuid: UUID, creationMetadata: MPMediaPlaylistCreationMetadata?, completionHandler: @escaping (MPMediaPlaylist?, Error?) -> Void) + @available(iOS 9.3, *) + func getPlaylist(with uuid: UUID, creationMetadata: MPMediaPlaylistCreationMetadata?) async throws -> MPMediaPlaylist? } extension NSNotification.Name { static let MPMediaLibraryDidChange: NSNotification.Name diff --git a/iOS/MediaPlayer/MPMediaPickerController.swift b/iOS/MediaPlayer/MPMediaPickerController.swift index 101ae73..47acfc1 100644 --- a/iOS/MediaPlayer/MPMediaPickerController.swift +++ b/iOS/MediaPlayer/MPMediaPickerController.swift @@ -13,7 +13,7 @@ class MPMediaPickerController : UIViewController { } protocol MPMediaPickerControllerDelegate : NSObjectProtocol { @available(iOS 3.0, *) - optional func mediaPicker(_ mediaPicker: MPMediaPickerController, didPickMediaItems mediaItemCollection: MPMediaItemCollection) + @asyncHandler optional func mediaPicker(_ mediaPicker: MPMediaPickerController, didPickMediaItems mediaItemCollection: MPMediaItemCollection) @available(iOS 3.0, *) - optional func mediaPickerDidCancel(_ mediaPicker: MPMediaPickerController) + @asyncHandler optional func mediaPickerDidCancel(_ mediaPicker: MPMediaPickerController) } diff --git a/iOS/MediaPlayer/MPMediaPlaylist.swift b/iOS/MediaPlayer/MPMediaPlaylist.swift index cddd461..a157e8d 100644 --- a/iOS/MediaPlayer/MPMediaPlaylist.swift +++ b/iOS/MediaPlayer/MPMediaPlaylist.swift @@ -24,7 +24,11 @@ class MPMediaPlaylist : MPMediaItemCollection { @available(iOS 9.3, *) func addItem(withProductID productID: String, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 9.3, *) + func addItem(withProductID productID: String) async throws + @available(iOS 9.3, *) func add(_ mediaItems: [MPMediaItem], completionHandler: ((Error?) -> Void)? = nil) + @available(iOS 9.3, *) + func add(_ mediaItems: [MPMediaItem]) async throws } let MPMediaPlaylistPropertyPersistentID: String @available(iOS 9.0, *) diff --git a/iOS/MediaPlayer/MPMusicPlayerApplicationController.swift b/iOS/MediaPlayer/MPMusicPlayerApplicationController.swift index 4862882..88b787e 100644 --- a/iOS/MediaPlayer/MPMusicPlayerApplicationController.swift +++ b/iOS/MediaPlayer/MPMusicPlayerApplicationController.swift @@ -11,6 +11,7 @@ class MPMusicPlayerControllerMutableQueue : MPMusicPlayerControllerQueue { @available(iOS 10.3, *) class MPMusicPlayerApplicationController : MPMusicPlayerController { func perform(queueTransaction: @escaping (MPMusicPlayerControllerMutableQueue) -> Void, completionHandler: @escaping (MPMusicPlayerControllerQueue, Error?) -> Void) + func perform(queueTransaction: @escaping (MPMusicPlayerControllerMutableQueue) -> Void) async throws -> MPMusicPlayerControllerQueue } extension NSNotification.Name { @available(iOS 10.3, *) diff --git a/iOS/MediaPlayer/MPMusicPlayerController.swift b/iOS/MediaPlayer/MPMusicPlayerController.swift index 64eaf58..e6e561c 100644 --- a/iOS/MediaPlayer/MPMusicPlayerController.swift +++ b/iOS/MediaPlayer/MPMusicPlayerController.swift @@ -56,6 +56,8 @@ class MPMusicPlayerController : NSObject, MPMediaPlayback { func append(_ descriptor: MPMusicPlayerQueueDescriptor) @available(iOS 10.1, *) func prepareToPlay(completionHandler: @escaping (Error?) -> Void) + @available(iOS 10.1, *) + func prepareToPlay() async throws func skipToNextItem() func skipToBeginning() func skipToPreviousItem() diff --git a/iOS/MediaPlayer/MPPlayableContentDataSource.swift b/iOS/MediaPlayer/MPPlayableContentDataSource.swift index f7d9618..3a29149 100644 --- a/iOS/MediaPlayer/MPPlayableContentDataSource.swift +++ b/iOS/MediaPlayer/MPPlayableContentDataSource.swift @@ -2,9 +2,12 @@ @available(iOS, introduced: 7.1, deprecated: 14.0, message: "Use CarPlay framework") protocol MPPlayableContentDataSource : NSObjectProtocol { optional func beginLoadingChildItems(at indexPath: IndexPath, completionHandler: @escaping (Error?) -> Void) + optional func beginLoadingChildItems(at indexPath: IndexPath) async throws optional func childItemsDisplayPlaybackProgress(at indexPath: IndexPath) -> Bool @available(iOS, introduced: 10.0, deprecated: 14.0, message: "Use CarPlay framework") optional func contentItem(forIdentifier identifier: String, completionHandler: @escaping (MPContentItem?, Error?) -> Void) + @available(iOS, introduced: 10.0, deprecated: 14.0, message: "Use CarPlay framework") + optional func contentItem(forIdentifier identifier: String) async throws -> MPContentItem? func numberOfChildItems(at indexPath: IndexPath) -> Int func contentItem(at indexPath: IndexPath) -> MPContentItem? } diff --git a/iOS/MediaPlayer/MPPlayableContentDelegate.swift b/iOS/MediaPlayer/MPPlayableContentDelegate.swift index 7642e2d..dd266f1 100644 --- a/iOS/MediaPlayer/MPPlayableContentDelegate.swift +++ b/iOS/MediaPlayer/MPPlayableContentDelegate.swift @@ -3,10 +3,16 @@ protocol MPPlayableContentDelegate : NSObjectProtocol { @available(iOS, introduced: 7.1, deprecated: 14.0, message: "Use CarPlay framework") optional func playableContentManager(_ contentManager: MPPlayableContentManager, initiatePlaybackOfContentItemAt indexPath: IndexPath, completionHandler: @escaping (Error?) -> Void) + @available(iOS, introduced: 7.1, deprecated: 14.0, message: "Use CarPlay framework") + optional func playableContentManager(_ contentManager: MPPlayableContentManager, initiatePlaybackOfContentItemAt indexPath: IndexPath) async throws @available(iOS, introduced: 9.0, deprecated: 9.3, message: "Use Intents framework for initiating playback queues.") optional func playableContentManager(_ contentManager: MPPlayableContentManager, initializePlaybackQueueWithCompletionHandler completionHandler: @escaping (Error?) -> Void) + @available(iOS, introduced: 9.0, deprecated: 9.3, message: "Use Intents framework for initiating playback queues.") + optional func playableContentManager(_ contentManager: MPPlayableContentManager) async throws @available(iOS, introduced: 9.3, deprecated: 12.0, message: "Use Intents framework for initiating playback queues.") optional func playableContentManager(_ contentManager: MPPlayableContentManager, initializePlaybackQueueWithContentItems contentItems: [Any]?, completionHandler: @escaping (Error?) -> Void) + @available(iOS, introduced: 9.3, deprecated: 12.0, message: "Use Intents framework for initiating playback queues.") + optional func playableContentManager(_ contentManager: MPPlayableContentManager, initializePlaybackQueueWithContentItems contentItems: [Any]?) async throws @available(iOS, introduced: 8.4, deprecated: 14.0, message: "Use CarPlay framework") - optional func playableContentManager(_ contentManager: MPPlayableContentManager, didUpdate context: MPPlayableContentManagerContext) + @asyncHandler optional func playableContentManager(_ contentManager: MPPlayableContentManager, didUpdate context: MPPlayableContentManagerContext) } diff --git a/iOS/MessageUI/MFMailComposeViewController.swift b/iOS/MessageUI/MFMailComposeViewController.swift index 258a987..7d928e0 100644 --- a/iOS/MessageUI/MFMailComposeViewController.swift +++ b/iOS/MessageUI/MFMailComposeViewController.swift @@ -33,5 +33,5 @@ class MFMailComposeViewController : UINavigationController { } protocol MFMailComposeViewControllerDelegate : NSObjectProtocol { @available(iOS 3.0, *) - optional func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) + @asyncHandler optional func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) } diff --git a/iOS/MessageUI/MFMessageComposeViewController.swift b/iOS/MessageUI/MFMessageComposeViewController.swift index a7d4e5c..6f3a22d 100644 --- a/iOS/MessageUI/MFMessageComposeViewController.swift +++ b/iOS/MessageUI/MFMessageComposeViewController.swift @@ -40,5 +40,5 @@ class MFMessageComposeViewController : UINavigationController { } protocol MFMessageComposeViewControllerDelegate : NSObjectProtocol { @available(iOS 4.0, *) - func messageComposeViewController(_ controller: MFMessageComposeViewController, didFinishWith result: MessageComposeResult) + @asyncHandler func messageComposeViewController(_ controller: MFMessageComposeViewController, didFinishWith result: MessageComposeResult) } diff --git a/iOS/Messages/MSConversation.swift b/iOS/Messages/MSConversation.swift index bb3ec54..12d1f10 100644 --- a/iOS/Messages/MSConversation.swift +++ b/iOS/Messages/MSConversation.swift @@ -5,15 +5,27 @@ class MSConversation : NSObject { var remoteParticipantIdentifiers: [UUID] { get } var selectedMessage: MSMessage? { get } func insert(_ message: MSMessage, completionHandler: ((Error?) -> Void)? = nil) + func insert(_ message: MSMessage) async throws func insert(_ sticker: MSSticker, completionHandler: ((Error?) -> Void)? = nil) + func insert(_ sticker: MSSticker) async throws func insertText(_ text: String, completionHandler: ((Error?) -> Void)? = nil) + func insertText(_ text: String) async throws func insertAttachment(_ URL: URL, withAlternateFilename filename: String?, completionHandler: ((Error?) -> Void)? = nil) + func insertAttachment(_ URL: URL, withAlternateFilename filename: String?) async throws @available(iOS 11.0, *) func send(_ message: MSMessage, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) + func send(_ message: MSMessage) async throws + @available(iOS 11.0, *) func send(_ sticker: MSSticker, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) + func send(_ sticker: MSSticker) async throws + @available(iOS 11.0, *) func sendText(_ text: String, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) + func sendText(_ text: String) async throws + @available(iOS 11.0, *) func sendAttachment(_ URL: URL, withAlternateFilename filename: String?, completionHandler: ((Error?) -> Void)? = nil) + @available(iOS 11.0, *) + func sendAttachment(_ URL: URL, withAlternateFilename filename: String?) async throws } diff --git a/iOS/Metal/MTLDevice.swift b/iOS/Metal/MTLDevice.swift index 6d68915..45d4d62 100644 --- a/iOS/Metal/MTLDevice.swift +++ b/iOS/Metal/MTLDevice.swift @@ -181,18 +181,25 @@ protocol MTLDevice : NSObjectProtocol { func makeLibrary(data: __DispatchData) throws -> MTLLibrary func makeLibrary(source: String, options: MTLCompileOptions?) throws -> MTLLibrary func makeLibrary(source: String, options: MTLCompileOptions?, completionHandler: @escaping MTLNewLibraryCompletionHandler) + func makeLibrary(source: String, options: MTLCompileOptions?) async throws -> MTLLibrary? func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor) throws -> MTLRenderPipelineState func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer?) throws -> MTLRenderPipelineState func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, completionHandler: @escaping MTLNewRenderPipelineStateCompletionHandler) + func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor) async throws -> MTLRenderPipelineState? func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption, completionHandler: @escaping MTLNewRenderPipelineStateWithReflectionCompletionHandler) + func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLRenderPipelineState?, MTLRenderPipelineReflection?) func makeComputePipelineState(function computeFunction: MTLFunction) throws -> MTLComputePipelineState func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer?) throws -> MTLComputePipelineState func makeComputePipelineState(function computeFunction: MTLFunction, completionHandler: @escaping MTLNewComputePipelineStateCompletionHandler) + func makeComputePipelineState(function computeFunction: MTLFunction) async throws -> MTLComputePipelineState? func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption, completionHandler: @escaping MTLNewComputePipelineStateWithReflectionCompletionHandler) + func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption) async throws -> (MTLComputePipelineState?, MTLComputePipelineReflection?) @available(iOS 9.0, *) func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer?) throws -> MTLComputePipelineState @available(iOS 9.0, *) func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption, completionHandler: @escaping MTLNewComputePipelineStateWithReflectionCompletionHandler) + @available(iOS 9.0, *) + func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLComputePipelineState?, MTLComputePipelineReflection?) @available(iOS 10.0, *) func makeFence() -> MTLFence? func supportsFeatureSet(_ featureSet: MTLFeatureSet) -> Bool @@ -209,6 +216,8 @@ protocol MTLDevice : NSObjectProtocol { @available(iOS 11.0, *) func makeRenderPipelineState(tileDescriptor descriptor: MTLTileRenderPipelineDescriptor, options: MTLPipelineOption, completionHandler: @escaping MTLNewRenderPipelineStateWithReflectionCompletionHandler) @available(iOS 11.0, *) + func makeRenderPipelineState(tileDescriptor descriptor: MTLTileRenderPipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLRenderPipelineState?, MTLRenderPipelineReflection?) + @available(iOS 11.0, *) var maxThreadgroupMemoryLength: Int { get } @available(iOS 12.0, *) var maxArgumentBufferSamplerCount: Int { get } diff --git a/iOS/Metal/MTLLibrary.swift b/iOS/Metal/MTLLibrary.swift index 1c86e74..b318683 100644 --- a/iOS/Metal/MTLLibrary.swift +++ b/iOS/Metal/MTLLibrary.swift @@ -139,13 +139,19 @@ protocol MTLLibrary : NSObjectProtocol { func makeFunction(name: String, constantValues: MTLFunctionConstantValues) throws -> MTLFunction @available(iOS 10.0, *) func makeFunction(name: String, constantValues: MTLFunctionConstantValues, completionHandler: @escaping (MTLFunction?, Error?) -> Void) + @available(iOS 10.0, *) + func makeFunction(name: String, constantValues: MTLFunctionConstantValues) async throws -> MTLFunction? @available(iOS 14.0, *) func makeFunction(descriptor: MTLFunctionDescriptor, completionHandler: @escaping (MTLFunction?, Error?) -> Void) @available(iOS 14.0, *) + func makeFunction(descriptor: MTLFunctionDescriptor) async throws -> MTLFunction? + @available(iOS 14.0, *) func makeFunction(descriptor: MTLFunctionDescriptor) throws -> MTLFunction @available(iOS 14.0, *) func makeIntersectionFunction(descriptor: MTLIntersectionFunctionDescriptor, completionHandler: @escaping (MTLFunction?, Error?) -> Void) @available(iOS 14.0, *) + func makeIntersectionFunction(descriptor: MTLIntersectionFunctionDescriptor) async throws -> MTLFunction? + @available(iOS 14.0, *) func makeIntersectionFunction(descriptor: MTLIntersectionFunctionDescriptor) throws -> MTLFunction var functionNames: [String] { get } @available(iOS 14.0, *) diff --git a/iOS/MetalKit/MTKTextureLoader.swift b/iOS/MetalKit/MTKTextureLoader.swift index c2cf1ac..263811a 100644 --- a/iOS/MetalKit/MTKTextureLoader.swift +++ b/iOS/MetalKit/MTKTextureLoader.swift @@ -65,16 +65,27 @@ class MTKTextureLoader : NSObject { var device: MTLDevice { get } init(device: MTLDevice) func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) + func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? @available(iOS 10.0, *) func newTexture(name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) @available(iOS 10.0, *) + func newTexture(name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + @available(iOS 10.0, *) func newTextures(URLs: [URL], options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.ArrayCallback) @available(iOS 10.0, *) + func newTextures(URLs: [URL], options: [MTKTextureLoader.Option : Any]? = nil) async throws -> [MTLTexture] + @available(iOS 10.0, *) func newTextures(names: [String], scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.ArrayCallback) + @available(iOS 10.0, *) + func newTextures(names: [String], scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> [MTLTexture] func newTexture(data: Data, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) + func newTexture(data: Data, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? func newTexture(cgImage: CGImage, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) + func newTexture(cgImage: CGImage, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? @available(iOS 10.0, *) func newTexture(texture: MDLTexture, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) + @available(iOS 10.0, *) + func newTexture(texture: MDLTexture, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil) throws -> MTLTexture @available(iOS 10.0, *) func newTextures(URLs: [URL], options: [MTKTextureLoader.Option : Any]? = nil, error: NSErrorPointer) -> [MTLTexture] diff --git a/iOS/MetalPerformanceShaders/MetalPerformanceShaders.swift b/iOS/MetalPerformanceShaders/MetalPerformanceShaders.swift index 0b828d8..f3ff8bc 100644 --- a/iOS/MetalPerformanceShaders/MetalPerformanceShaders.swift +++ b/iOS/MetalPerformanceShaders/MetalPerformanceShaders.swift @@ -3739,6 +3739,7 @@ class MPSAccelerationStructure : MPSKernel, NSSecureCoding, NSCopying { init?(coder aDecoder: NSCoder, group: MPSAccelerationStructureGroup) func rebuild() func rebuild(completionHandler: @escaping MPSAccelerationStructureCompletionHandler) + func rebuild() async -> MPSAccelerationStructure? func encodeRefit(commandBuffer: MTLCommandBuffer) func copy(with zone: NSZone? = nil, group: MPSAccelerationStructureGroup) -> Self } diff --git a/iOS/MetricKit/MXMetricManager.swift b/iOS/MetricKit/MXMetricManager.swift index 59c7153..e3370f2 100644 --- a/iOS/MetricKit/MXMetricManager.swift +++ b/iOS/MetricKit/MXMetricManager.swift @@ -11,7 +11,7 @@ class MXMetricManager : NSObject { } @available(iOS 13.0, *) protocol MXMetricManagerSubscriber : NSObjectProtocol { - func didReceive(_ payloads: [MXMetricPayload]) + @asyncHandler func didReceive(_ payloads: [MXMetricPayload]) @available(iOS 14.0, *) - optional func didReceive(_ payloads: [MXDiagnosticPayload]) + @asyncHandler optional func didReceive(_ payloads: [MXDiagnosticPayload]) } diff --git a/iOS/MultipeerConnectivity/MCAdvertiserAssistant.swift b/iOS/MultipeerConnectivity/MCAdvertiserAssistant.swift index 7b07c22..c7127ae 100644 --- a/iOS/MultipeerConnectivity/MCAdvertiserAssistant.swift +++ b/iOS/MultipeerConnectivity/MCAdvertiserAssistant.swift @@ -13,5 +13,5 @@ protocol MCAdvertiserAssistantDelegate : NSObjectProtocol { @available(iOS 7.0, *) optional func advertiserAssistantWillPresentInvitation(_ advertiserAssistant: MCAdvertiserAssistant) @available(iOS 7.0, *) - optional func advertiserAssistantDidDismissInvitation(_ advertiserAssistant: MCAdvertiserAssistant) + @asyncHandler optional func advertiserAssistantDidDismissInvitation(_ advertiserAssistant: MCAdvertiserAssistant) } diff --git a/iOS/MultipeerConnectivity/MCBrowserViewController.swift b/iOS/MultipeerConnectivity/MCBrowserViewController.swift index 1bb6f11..0146dc8 100644 --- a/iOS/MultipeerConnectivity/MCBrowserViewController.swift +++ b/iOS/MultipeerConnectivity/MCBrowserViewController.swift @@ -11,7 +11,7 @@ class MCBrowserViewController : UIViewController, MCNearbyServiceBrowserDelegate } protocol MCBrowserViewControllerDelegate : NSObjectProtocol { @available(iOS 7.0, *) - func browserViewControllerDidFinish(_ browserViewController: MCBrowserViewController) + @asyncHandler func browserViewControllerDidFinish(_ browserViewController: MCBrowserViewController) @available(iOS 7.0, *) func browserViewControllerWasCancelled(_ browserViewController: MCBrowserViewController) @available(iOS 7.0, *) diff --git a/iOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift b/iOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift index 3eeeeb3..7fe5bb7 100644 --- a/iOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift +++ b/iOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift @@ -11,7 +11,7 @@ class MCNearbyServiceAdvertiser : NSObject { } protocol MCNearbyServiceAdvertiserDelegate : NSObjectProtocol { @available(iOS 7.0, *) - func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didReceiveInvitationFromPeer peerID: MCPeerID, withContext context: Data?, invitationHandler: @escaping (Bool, MCSession?) -> Void) + @asyncHandler func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didReceiveInvitationFromPeer peerID: MCPeerID, withContext context: Data?, invitationHandler: @escaping (Bool, MCSession?) -> Void) @available(iOS 7.0, *) - optional func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didNotStartAdvertisingPeer error: Error) + @asyncHandler optional func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didNotStartAdvertisingPeer error: Error) } diff --git a/iOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift b/iOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift index cd83037..bed3ee3 100644 --- a/iOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift +++ b/iOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift @@ -15,5 +15,5 @@ protocol MCNearbyServiceBrowserDelegate : NSObjectProtocol { @available(iOS 7.0, *) func browser(_ browser: MCNearbyServiceBrowser, lostPeer peerID: MCPeerID) @available(iOS 7.0, *) - optional func browser(_ browser: MCNearbyServiceBrowser, didNotStartBrowsingForPeers error: Error) + @asyncHandler optional func browser(_ browser: MCNearbyServiceBrowser, didNotStartBrowsingForPeers error: Error) } diff --git a/iOS/MultipeerConnectivity/MCSession.swift b/iOS/MultipeerConnectivity/MCSession.swift index c17f49a..febb26f 100644 --- a/iOS/MultipeerConnectivity/MCSession.swift +++ b/iOS/MultipeerConnectivity/MCSession.swift @@ -42,20 +42,21 @@ class MCSession : NSObject { } protocol MCSessionDelegate : NSObjectProtocol { @available(iOS 7.0, *) - func session(_ session: MCSession, peer peerID: MCPeerID, didChange state: MCSessionState) + @asyncHandler func session(_ session: MCSession, peer peerID: MCPeerID, didChange state: MCSessionState) @available(iOS 7.0, *) - func session(_ session: MCSession, didReceive data: Data, fromPeer peerID: MCPeerID) + @asyncHandler func session(_ session: MCSession, didReceive data: Data, fromPeer peerID: MCPeerID) @available(iOS 7.0, *) - func session(_ session: MCSession, didReceive stream: InputStream, withName streamName: String, fromPeer peerID: MCPeerID) + @asyncHandler func session(_ session: MCSession, didReceive stream: InputStream, withName streamName: String, fromPeer peerID: MCPeerID) @available(iOS 7.0, *) - func session(_ session: MCSession, didStartReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, with progress: Progress) + @asyncHandler func session(_ session: MCSession, didStartReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, with progress: Progress) @available(iOS 7.0, *) - func session(_ session: MCSession, didFinishReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, at localURL: URL?, withError error: Error?) + @asyncHandler func session(_ session: MCSession, didFinishReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, at localURL: URL?, withError error: Error?) @available(iOS 7.0, *) - optional func session(_ session: MCSession, didReceiveCertificate certificate: [Any]?, fromPeer peerID: MCPeerID, certificateHandler: @escaping (Bool) -> Void) + @asyncHandler optional func session(_ session: MCSession, didReceiveCertificate certificate: [Any]?, fromPeer peerID: MCPeerID, certificateHandler: @escaping (Bool) -> Void) } extension MCSession { func nearbyConnectionData(forPeer peerID: MCPeerID, withCompletionHandler completionHandler: @escaping (Data?, Error?) -> Void) + func nearbyConnectionData(forPeer peerID: MCPeerID) async throws -> Data? func connectPeer(_ peerID: MCPeerID, withNearbyConnectionData data: Data) func cancelConnectPeer(_ peerID: MCPeerID) } diff --git a/iOS/NaturalLanguage/NLTagger.swift b/iOS/NaturalLanguage/NLTagger.swift index 4f0e495..b33f461 100644 --- a/iOS/NaturalLanguage/NLTagger.swift +++ b/iOS/NaturalLanguage/NLTagger.swift @@ -37,6 +37,8 @@ class NLTagger : NSObject { func gazetteers(for tagScheme: NLTagScheme) -> [NLGazetteer] @available(iOS 13.0, *) class func requestAssets(for language: NLLanguage, tagScheme: NLTagScheme, completionHandler: @escaping (NLTagger.AssetsResult, Error?) -> Void) + @available(iOS 13.0, *) + class func requestAssets(for language: NLLanguage, tagScheme: NLTagScheme) async throws -> NLTagger.AssetsResult } @available(macOS 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *) diff --git a/iOS/NearbyInteraction/NISession.swift b/iOS/NearbyInteraction/NISession.swift index d705b7c..fc44c6f 100644 --- a/iOS/NearbyInteraction/NISession.swift +++ b/iOS/NearbyInteraction/NISession.swift @@ -21,9 +21,9 @@ extension NINearbyObject { } @available(iOS 14.0, *) protocol NISessionDelegate : NSObjectProtocol { - optional func session(_ session: NISession, didUpdate nearbyObjects: [NINearbyObject]) - optional func session(_ session: NISession, didRemove nearbyObjects: [NINearbyObject], reason: NINearbyObject.RemovalReason) + @asyncHandler optional func session(_ session: NISession, didUpdate nearbyObjects: [NINearbyObject]) + @asyncHandler optional func session(_ session: NISession, didRemove nearbyObjects: [NINearbyObject], reason: NINearbyObject.RemovalReason) optional func sessionWasSuspended(_ session: NISession) optional func sessionSuspensionEnded(_ session: NISession) - optional func session(_ session: NISession, didInvalidateWith error: Error) + @asyncHandler optional func session(_ session: NISession, didInvalidateWith error: Error) } diff --git a/iOS/NetworkExtension/NetworkExtension.swift b/iOS/NetworkExtension/NetworkExtension.swift index 810d599..96b2b9b 100644 --- a/iOS/NetworkExtension/NetworkExtension.swift +++ b/iOS/NetworkExtension/NetworkExtension.swift @@ -24,6 +24,8 @@ class NEAppProxyFlow : NSObject { @available(iOS 9.0, *) func open(withLocalEndpoint localEndpoint: NWHostEndpoint?, completionHandler: @escaping (Error?) -> Void) @available(iOS 9.0, *) + func open(withLocalEndpoint localEndpoint: NWHostEndpoint?) async throws + @available(iOS 9.0, *) func closeReadWithError(_ error: Error?) @available(iOS 9.0, *) func closeWriteWithError(_ error: Error?) @@ -63,6 +65,8 @@ class NEProvider : NSObject { @available(iOS 9.0, *) func sleep(completionHandler: @escaping () -> Void) @available(iOS 9.0, *) + func sleep() async + @available(iOS 9.0, *) func wake() @available(iOS 9.0, *) func createTCPConnection(to remoteEndpoint: NWEndpoint, enableTLS: Bool, tlsParameters TLSParameters: NWTLSParameters?, delegate: Any?) -> NWTCPConnection @@ -70,6 +74,8 @@ class NEProvider : NSObject { func createUDPSession(to remoteEndpoint: NWEndpoint, from localEndpoint: NWHostEndpoint?) -> NWUDPSession @available(iOS, introduced: 10.0, deprecated: 12.0) func displayMessage(_ message: String, completionHandler: @escaping (Bool) -> Void) + @available(iOS, introduced: 10.0, deprecated: 12.0) + func displayMessage(_ message: String) async -> Bool @available(iOS 9.0, *) var defaultPath: NWPath? { get } } @@ -96,8 +102,12 @@ class NETunnelProvider : NEProvider { @available(iOS 9.0, *) func handleAppMessage(_ messageData: Data, completionHandler: ((Data?) -> Void)? = nil) @available(iOS 9.0, *) + func handleAppMessage(_ messageData: Data) async -> Data? + @available(iOS 9.0, *) func setTunnelNetworkSettings(_ tunnelNetworkSettings: NETunnelNetworkSettings?, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 9.0, *) + func setTunnelNetworkSettings(_ tunnelNetworkSettings: NETunnelNetworkSettings?) async throws + @available(iOS 9.0, *) var protocolConfiguration: NEVPNProtocol { get } @available(iOS 9.0, *) var appRules: [NEAppRule]? { get } @@ -111,8 +121,12 @@ class NEAppProxyProvider : NETunnelProvider { @available(iOS 9.0, *) func startProxy(options: [String : Any]? = nil, completionHandler: @escaping (Error?) -> Void) @available(iOS 9.0, *) + func startProxy(options: [String : Any]? = nil) async throws + @available(iOS 9.0, *) func stopProxy(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) @available(iOS 9.0, *) + func stopProxy(with reason: NEProviderStopReason) async + @available(iOS 9.0, *) func cancelProxyWithError(_ error: Error?) @available(iOS 9.0, *) func handleNewFlow(_ flow: NEAppProxyFlow) -> Bool @@ -152,10 +166,16 @@ class NEVPNManager : NSObject { @available(iOS 8.0, *) func loadFromPreferences(completionHandler: @escaping (Error?) -> Void) @available(iOS 8.0, *) + func loadFromPreferences() async throws + @available(iOS 8.0, *) func removeFromPreferences(completionHandler: ((Error?) -> Void)? = nil) @available(iOS 8.0, *) + func removeFromPreferences() async throws + @available(iOS 8.0, *) func saveToPreferences(completionHandler: ((Error?) -> Void)? = nil) @available(iOS 8.0, *) + func saveToPreferences() async throws + @available(iOS 8.0, *) var onDemandRules: [NEOnDemandRule]? @available(iOS 8.0, *) var isOnDemandEnabled: Bool @@ -175,6 +195,8 @@ class NETunnelProviderManager : NEVPNManager { @available(iOS 9.0, *) class func loadAllFromPreferences(completionHandler: @escaping ([NETunnelProviderManager]?, Error?) -> Void) @available(iOS 9.0, *) + class func loadAllFromPreferences() async throws -> [NETunnelProviderManager]? + @available(iOS 9.0, *) func copyAppRules() -> [NEAppRule]? @available(iOS 9.0, *) var routingMethod: NETunnelProviderRoutingMethod { get } @@ -187,8 +209,12 @@ class NEAppProxyTCPFlow : NEAppProxyFlow { @available(iOS 9.0, *) func readData(completionHandler: @escaping (Data?, Error?) -> Void) @available(iOS 9.0, *) + func readData() async throws -> Data? + @available(iOS 9.0, *) func write(_ data: Data, withCompletionHandler completionHandler: @escaping (Error?) -> Void) @available(iOS 9.0, *) + func write(_ data: Data) async throws + @available(iOS 9.0, *) var remoteEndpoint: NWEndpoint { get } } @available(iOS 9.0, *) @@ -196,8 +222,12 @@ class NEAppProxyUDPFlow : NEAppProxyFlow { @available(iOS 9.0, *) func readDatagrams(completionHandler: @escaping ([Data]?, [NWEndpoint]?, Error?) -> Void) @available(iOS 9.0, *) + func readDatagrams() async throws -> ([Data]?, [NWEndpoint]?) + @available(iOS 9.0, *) func writeDatagrams(_ datagrams: [Data], sentBy remoteEndpoints: [NWEndpoint], completionHandler: @escaping (Error?) -> Void) @available(iOS 9.0, *) + func writeDatagrams(_ datagrams: [Data], sentBy remoteEndpoints: [NWEndpoint]) async throws + @available(iOS 9.0, *) var localEndpoint: NWEndpoint? { get } } @available(iOS 9.0, *) @@ -229,10 +259,16 @@ class NEDNSProxyManager : NSObject { @available(iOS 11.0, *) func loadFromPreferences(completionHandler: @escaping (Error?) -> Void) @available(iOS 11.0, *) + func loadFromPreferences() async throws + @available(iOS 11.0, *) func removeFromPreferences(completionHandler: @escaping (Error?) -> Void) @available(iOS 11.0, *) + func removeFromPreferences() async throws + @available(iOS 11.0, *) func saveToPreferences(completionHandler: @escaping (Error?) -> Void) @available(iOS 11.0, *) + func saveToPreferences() async throws + @available(iOS 11.0, *) var localizedDescription: String? @available(iOS 11.0, *) var providerProtocol: NEDNSProxyProviderProtocol? @@ -244,8 +280,12 @@ class NEDNSProxyProvider : NEProvider { @available(iOS 11.0, *) func startProxy(options: [String : Any]? = nil, completionHandler: @escaping (Error?) -> Void) @available(iOS 11.0, *) + func startProxy(options: [String : Any]? = nil) async throws + @available(iOS 11.0, *) func stopProxy(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) @available(iOS 11.0, *) + func stopProxy(with reason: NEProviderStopReason) async + @available(iOS 11.0, *) func cancelProxyWithError(_ error: Error?) @available(iOS 11.0, *) func handleNewFlow(_ flow: NEAppProxyFlow) -> Bool @@ -377,10 +417,16 @@ class NEDNSSettingsManager : NSObject { @available(iOS 14.0, *) func loadFromPreferences(completionHandler: @escaping (Error?) -> Void) @available(iOS 14.0, *) + func loadFromPreferences() async throws + @available(iOS 14.0, *) func removeFromPreferences(completionHandler: @escaping (Error?) -> Void) @available(iOS 14.0, *) + func removeFromPreferences() async throws + @available(iOS 14.0, *) func saveToPreferences(completionHandler: @escaping (Error?) -> Void) @available(iOS 14.0, *) + func saveToPreferences() async throws + @available(iOS 14.0, *) var localizedDescription: String? @available(iOS 14.0, *) var dnsSettings: NEDNSSettings? @@ -452,8 +498,12 @@ class NEFilterProvider : NEProvider { @available(iOS 9.0, *) func startFilter(completionHandler: @escaping (Error?) -> Void) @available(iOS 9.0, *) + func startFilter() async throws + @available(iOS 9.0, *) func stopFilter(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) @available(iOS 9.0, *) + func stopFilter(with reason: NEProviderStopReason) async + @available(iOS 9.0, *) var filterConfiguration: NEFilterProviderConfiguration { get } @available(iOS 11.0, *) func handle(_ report: NEFilterReport) @@ -534,8 +584,12 @@ class NEFilterControlProvider : NEFilterProvider { @available(iOS 9.0, *) func handleRemediation(for flow: NEFilterFlow, completionHandler: @escaping (NEFilterControlVerdict) -> Void) @available(iOS 9.0, *) + func handleRemediation(for flow: NEFilterFlow) async -> NEFilterControlVerdict + @available(iOS 9.0, *) func handleNewFlow(_ flow: NEFilterFlow, completionHandler: @escaping (NEFilterControlVerdict) -> Void) @available(iOS 9.0, *) + func handleNewFlow(_ flow: NEFilterFlow) async -> NEFilterControlVerdict + @available(iOS 9.0, *) func notifyRulesChanged() } @available(iOS 9.0, *) @@ -601,10 +655,16 @@ class NEFilterManager : NSObject { @available(iOS 8.0, *) func loadFromPreferences(completionHandler: @escaping (Error?) -> Void) @available(iOS 8.0, *) + func loadFromPreferences() async throws + @available(iOS 8.0, *) func removeFromPreferences(completionHandler: @escaping (Error?) -> Void) @available(iOS 8.0, *) + func removeFromPreferences() async throws + @available(iOS 8.0, *) func saveToPreferences(completionHandler: @escaping (Error?) -> Void) @available(iOS 8.0, *) + func saveToPreferences() async throws + @available(iOS 8.0, *) var localizedDescription: String? @available(iOS 9.0, *) var providerConfiguration: NEFilterProviderConfiguration? @@ -647,6 +707,8 @@ class NEHotspotNetwork : NSObject { var bssid: String { get } @available(iOS 14.0, *) class func fetchCurrent(completionHandler: @escaping (NEHotspotNetwork?) -> Void) + @available(iOS 14.0, *) + class func fetchCurrent() async -> NEHotspotNetwork? } @available(iOS 9.0, *) enum NEHotspotHelperCommandType : Int { @@ -859,11 +921,15 @@ class NEHotspotConfigurationManager : NSObject { @available(iOS 11.0, *) func apply(_ configuration: NEHotspotConfiguration, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) + func apply(_ configuration: NEHotspotConfiguration) async throws + @available(iOS 11.0, *) func removeConfiguration(forSSID SSID: String) @available(iOS 11.0, *) func removeConfiguration(forHS20DomainName domainName: String) @available(iOS 11.0, *) func getConfiguredSSIDs(completionHandler: @escaping ([String]) -> Void) + @available(iOS 11.0, *) + func getConfiguredSSIDs() async -> [String] } @available(iOS 9.0, *) class NEIPv4Settings : NSObject, NSSecureCoding, NSCopying { @@ -1002,10 +1068,14 @@ class NEPacketTunnelFlow : NSObject { @available(iOS 9.0, *) func readPackets(completionHandler: @escaping ([Data], [NSNumber]) -> Void) @available(iOS 9.0, *) + func readPackets() async -> ([Data], [NSNumber]) + @available(iOS 9.0, *) func writePackets(_ packets: [Data], withProtocols protocols: [NSNumber]) -> Bool @available(iOS 10.0, *) func readPacketObjects(completionHandler: @escaping ([NEPacket]) -> Void) @available(iOS 10.0, *) + func readPacketObjects() async -> [NEPacket] + @available(iOS 10.0, *) func writePacketObjects(_ packets: [NEPacket]) -> Bool } @available(iOS 9.0, *) @@ -1035,8 +1105,12 @@ class NEPacketTunnelProvider : NETunnelProvider { @available(iOS 9.0, *) func startTunnel(options: [String : NSObject]? = nil, completionHandler: @escaping (Error?) -> Void) @available(iOS 9.0, *) + func startTunnel(options: [String : NSObject]? = nil) async throws + @available(iOS 9.0, *) func stopTunnel(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) @available(iOS 9.0, *) + func stopTunnel(with reason: NEProviderStopReason) async + @available(iOS 9.0, *) func cancelTunnelWithError(_ error: Error?) @available(iOS 9.0, *) var packetFlow: NEPacketTunnelFlow { get } @@ -1255,12 +1329,20 @@ class NEAppPushManager : NSObject { @available(iOS 14.0, *) class func loadAllFromPreferences(completionHandler: @escaping ([NEAppPushManager]?, Error?) -> Void) @available(iOS 14.0, *) + class func loadAllFromPreferences() async throws -> [NEAppPushManager]? + @available(iOS 14.0, *) func loadFromPreferences(completionHandler: @escaping (Error?) -> Void) @available(iOS 14.0, *) + func loadFromPreferences() async throws + @available(iOS 14.0, *) func removeFromPreferences(completionHandler: @escaping (Error?) -> Void) @available(iOS 14.0, *) + func removeFromPreferences() async throws + @available(iOS 14.0, *) func saveToPreferences(completionHandler: @escaping (Error?) -> Void) @available(iOS 14.0, *) + func saveToPreferences() async throws + @available(iOS 14.0, *) var localizedDescription: String? @available(iOS 14.0, *) var isEnabled: Bool @@ -1270,7 +1352,7 @@ class NEAppPushManager : NSObject { @available(iOS 14.0, *) protocol NEAppPushDelegate : NSObjectProtocol { @available(iOS 14.0, *) - func appPushManager(_ manager: NEAppPushManager, didReceiveIncomingCallWithUserInfo userInfo: [AnyHashable : Any] = [:]) + @asyncHandler func appPushManager(_ manager: NEAppPushManager, didReceiveIncomingCallWithUserInfo userInfo: [AnyHashable : Any] = [:]) } @available(iOS 14.0, *) class NEAppPushProvider : NEProvider { @@ -1279,8 +1361,12 @@ class NEAppPushProvider : NEProvider { @available(iOS 14.0, *) func start(completionHandler: @escaping (Error?) -> Void) @available(iOS 14.0, *) + func start() async throws + @available(iOS 14.0, *) func stop(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) @available(iOS 14.0, *) + func stop(with reason: NEProviderStopReason) async + @available(iOS 14.0, *) func reportIncomingCall(userInfo: [AnyHashable : Any] = [:]) @available(iOS 14.0, *) func handleTimerEvent() @@ -1366,10 +1452,16 @@ class NWTCPConnection : NSObject { @available(iOS 9.0, *) func readLength(_ length: Int, completionHandler completion: @escaping (Data?, Error?) -> Void) @available(iOS 9.0, *) + func readLength(_ length: Int) async throws -> Data? + @available(iOS 9.0, *) func readMinimumLength(_ minimum: Int, maximumLength maximum: Int, completionHandler completion: @escaping (Data?, Error?) -> Void) @available(iOS 9.0, *) + func readMinimumLength(_ minimum: Int, maximumLength maximum: Int) async throws -> Data? + @available(iOS 9.0, *) func write(_ data: Data, completionHandler completion: @escaping (Error?) -> Void) @available(iOS 9.0, *) + func write(_ data: Data) async throws + @available(iOS 9.0, *) func writeClose() } @available(iOS 9.0, *) @@ -1379,9 +1471,13 @@ protocol NWTCPConnectionAuthenticationDelegate : NSObjectProtocol { @available(iOS 9.0, *) optional func provideIdentity(for connection: NWTCPConnection, completionHandler completion: @escaping (SecIdentity, [Any]) -> Void) @available(iOS 9.0, *) + optional func provideIdentity(for connection: NWTCPConnection) async -> (SecIdentity, [Any]) + @available(iOS 9.0, *) optional func shouldEvaluateTrust(for connection: NWTCPConnection) -> Bool @available(iOS 9.0, *) optional func evaluateTrust(for connection: NWTCPConnection, peerCertificateChain: [Any], completionHandler completion: @escaping (SecTrust) -> Void) + @available(iOS 9.0, *) + optional func evaluateTrust(for connection: NWTCPConnection, peerCertificateChain: [Any]) async -> SecTrust } @available(iOS 9.0, *) enum NWUDPSessionState : Int { @@ -1419,8 +1515,12 @@ class NWUDPSession : NSObject { @available(iOS 9.0, *) func writeMultipleDatagrams(_ datagramArray: [Data], completionHandler: @escaping (Error?) -> Void) @available(iOS 9.0, *) + func writeMultipleDatagrams(_ datagramArray: [Data]) async throws + @available(iOS 9.0, *) func writeDatagram(_ datagram: Data, completionHandler: @escaping (Error?) -> Void) @available(iOS 9.0, *) + func writeDatagram(_ datagram: Data) async throws + @available(iOS 9.0, *) func cancel() } class NWTLSParameters : NSObject { diff --git a/iOS/NotificationCenter/NCWidgetProviding.swift b/iOS/NotificationCenter/NCWidgetProviding.swift index 8564c83..96f4587 100644 --- a/iOS/NotificationCenter/NCWidgetProviding.swift +++ b/iOS/NotificationCenter/NCWidgetProviding.swift @@ -11,8 +11,10 @@ enum NCUpdateResult : UInt { protocol NCWidgetProviding : NSObjectProtocol { @available(iOS, introduced: 8.0, deprecated: 14.0, message: "Use WidgetKit instead. Today View extensions have been deprecated.") optional func widgetPerformUpdate(completionHandler: @escaping (NCUpdateResult) -> Void) + @available(iOS, introduced: 8.0, deprecated: 14.0, message: "Use WidgetKit instead. Today View extensions have been deprecated.") + optional func widgetPerformUpdate() async -> NCUpdateResult @available(iOS, introduced: 10.0, deprecated: 14.0, message: "Use WidgetKit instead. Today View extensions have been deprecated.") - optional func widgetActiveDisplayModeDidChange(_ activeDisplayMode: NCWidgetDisplayMode, withMaximumSize maxSize: CGSize) + @asyncHandler optional func widgetActiveDisplayModeDidChange(_ activeDisplayMode: NCWidgetDisplayMode, withMaximumSize maxSize: CGSize) @available(iOS, introduced: 8.0, deprecated: 10.0, message: "This method will not be called on widgets linked against iOS versions 10.0 and later.") optional func widgetMarginInsets(forProposedMarginInsets defaultMarginInsets: UIEdgeInsets) -> UIEdgeInsets } diff --git a/iOS/PDFKit/PDFDocument.swift b/iOS/PDFKit/PDFDocument.swift index 5288bae..8897d7e 100644 --- a/iOS/PDFKit/PDFDocument.swift +++ b/iOS/PDFKit/PDFDocument.swift @@ -122,14 +122,14 @@ class PDFDocument : NSObject, NSCopying { func selection(from startPage: PDFPage, atCharacterIndex startCharacter: Int, to endPage: PDFPage, atCharacterIndex endCharacter: Int) -> PDFSelection? } protocol PDFDocumentDelegate : NSObjectProtocol { - optional func documentDidUnlock(_ notification: Notification) - optional func documentDidBeginDocumentFind(_ notification: Notification) - optional func documentDidEndDocumentFind(_ notification: Notification) - optional func documentDidBeginPageFind(_ notification: Notification) - optional func documentDidEndPageFind(_ notification: Notification) - optional func documentDidFindMatch(_ notification: Notification) - @available(iOS 11.0, *) - optional func didMatchString(_ instance: PDFSelection) + @asyncHandler optional func documentDidUnlock(_ notification: Notification) + @asyncHandler optional func documentDidBeginDocumentFind(_ notification: Notification) + @asyncHandler optional func documentDidEndDocumentFind(_ notification: Notification) + @asyncHandler optional func documentDidBeginPageFind(_ notification: Notification) + @asyncHandler optional func documentDidEndPageFind(_ notification: Notification) + @asyncHandler optional func documentDidFindMatch(_ notification: Notification) + @available(iOS 11.0, *) + @asyncHandler optional func didMatchString(_ instance: PDFSelection) @available(iOS 11.0, *) optional func classForPage() -> AnyClass @available(iOS 11.0, *) diff --git a/iOS/PassKit/PKAddPassesViewController.swift b/iOS/PassKit/PKAddPassesViewController.swift index 0692b3b..38a7ddb 100644 --- a/iOS/PassKit/PKAddPassesViewController.swift +++ b/iOS/PassKit/PKAddPassesViewController.swift @@ -1,7 +1,7 @@ protocol PKAddPassesViewControllerDelegate : NSObjectProtocol { @available(iOS 6.0, *) - optional func addPassesViewControllerDidFinish(_ controller: PKAddPassesViewController) + @asyncHandler optional func addPassesViewControllerDidFinish(_ controller: PKAddPassesViewController) } @available(iOS 6.0, *) class PKAddPassesViewController : UIViewController { diff --git a/iOS/PassKit/PKAddPaymentPassViewController.swift b/iOS/PassKit/PKAddPaymentPassViewController.swift index 52a730d..4f6beb8 100644 --- a/iOS/PassKit/PKAddPaymentPassViewController.swift +++ b/iOS/PassKit/PKAddPaymentPassViewController.swift @@ -2,7 +2,8 @@ @available(iOS 9.0, *) protocol PKAddPaymentPassViewControllerDelegate : NSObjectProtocol { func addPaymentPassViewController(_ controller: PKAddPaymentPassViewController, generateRequestWithCertificateChain certificates: [Data], nonce: Data, nonceSignature: Data, completionHandler handler: @escaping (PKAddPaymentPassRequest) -> Void) - func addPaymentPassViewController(_ controller: PKAddPaymentPassViewController, didFinishAdding pass: PKPaymentPass?, error: Error?) + func addPaymentPassViewController(_ controller: PKAddPaymentPassViewController, generateRequestWithCertificateChain certificates: [Data], nonce: Data, nonceSignature: Data) async -> PKAddPaymentPassRequest + @asyncHandler func addPaymentPassViewController(_ controller: PKAddPaymentPassViewController, didFinishAdding pass: PKPaymentPass?, error: Error?) } @available(iOS 9.0, *) class PKAddPaymentPassViewController : UIViewController { diff --git a/iOS/PassKit/PKAddSecureElementPassViewController.swift b/iOS/PassKit/PKAddSecureElementPassViewController.swift index 25e541f..1903d99 100644 --- a/iOS/PassKit/PKAddSecureElementPassViewController.swift +++ b/iOS/PassKit/PKAddSecureElementPassViewController.swift @@ -2,8 +2,8 @@ @available(iOS 13.4, *) protocol PKAddSecureElementPassViewControllerDelegate : NSObjectProtocol { @available(iOS, introduced: 13.4, deprecated: 14.0, message: "Use addSecureElementPassViewController:didFinishAddingSecureElementPasses:error: instead") - func addSecureElementPassViewController(_ controller: PKAddSecureElementPassViewController, didFinishAdding pass: PKSecureElementPass?, error: Error?) - func addSecureElementPassViewController(_ controller: PKAddSecureElementPassViewController, didFinishAddingSecureElementPasses passes: [PKSecureElementPass]?, error: Error?) + @asyncHandler func addSecureElementPassViewController(_ controller: PKAddSecureElementPassViewController, didFinishAdding pass: PKSecureElementPass?, error: Error?) + @asyncHandler func addSecureElementPassViewController(_ controller: PKAddSecureElementPassViewController, didFinishAddingSecureElementPasses passes: [PKSecureElementPass]?, error: Error?) } @available(iOS 13.4, *) class PKAddSecureElementPassViewController : UIViewController { diff --git a/iOS/PassKit/PKAddShareablePassConfiguration.swift b/iOS/PassKit/PKAddShareablePassConfiguration.swift index 8565017..b7c541c 100644 --- a/iOS/PassKit/PKAddShareablePassConfiguration.swift +++ b/iOS/PassKit/PKAddShareablePassConfiguration.swift @@ -19,6 +19,7 @@ enum PKAddShareablePassConfigurationPrimaryAction : UInt { @available(iOS 14.0, *) class PKAddShareablePassConfiguration : PKAddSecureElementPassConfiguration { class func forPassMetaData(_ passMetadata: [PKShareablePassMetadata], provisioningPolicyIdentifier: String, action: PKAddShareablePassConfigurationPrimaryAction, completion: @escaping (PKAddShareablePassConfiguration?, Error?) -> Void) + class func forPassMetaData(_ passMetadata: [PKShareablePassMetadata], provisioningPolicyIdentifier: String, action: PKAddShareablePassConfigurationPrimaryAction) async throws -> PKAddShareablePassConfiguration? var primaryAction: PKAddShareablePassConfigurationPrimaryAction { get } var credentialsMetadata: [PKShareablePassMetadata] { get } var provisioningPolicyIdentifier: String { get } diff --git a/iOS/PassKit/PKDisbursementAuthorizationController.swift b/iOS/PassKit/PKDisbursementAuthorizationController.swift index a1cdba6..7b91c86 100644 --- a/iOS/PassKit/PKDisbursementAuthorizationController.swift +++ b/iOS/PassKit/PKDisbursementAuthorizationController.swift @@ -1,9 +1,9 @@ protocol PKDisbursementAuthorizationControllerDelegate : NSObjectProtocol { @available(iOS 12.2, *) - func disbursementAuthorizationController(_ controller: PKDisbursementAuthorizationController, didAuthorizeWith disbursementVoucher: PKDisbursementVoucher) + @asyncHandler func disbursementAuthorizationController(_ controller: PKDisbursementAuthorizationController, didAuthorizeWith disbursementVoucher: PKDisbursementVoucher) @available(iOS 12.2, *) - func disbursementAuthorizationControllerDidFinish(_ controller: PKDisbursementAuthorizationController) + @asyncHandler func disbursementAuthorizationControllerDidFinish(_ controller: PKDisbursementAuthorizationController) } class PKDisbursementAuthorizationController : NSObject { @available(iOS 12.2, *) @@ -13,5 +13,7 @@ class PKDisbursementAuthorizationController : NSObject { @available(iOS 12.2, *) func authorizeDisbursement(completion: @escaping (Bool, Error?) -> Void) @available(iOS 12.2, *) + func authorizeDisbursement() async throws -> Bool + @available(iOS 12.2, *) class func supportsDisbursements() -> Bool } diff --git a/iOS/PassKit/PKIssuerProvisioningExtensionHandler.swift b/iOS/PassKit/PKIssuerProvisioningExtensionHandler.swift index d2e6609..43e287d 100644 --- a/iOS/PassKit/PKIssuerProvisioningExtensionHandler.swift +++ b/iOS/PassKit/PKIssuerProvisioningExtensionHandler.swift @@ -2,7 +2,11 @@ @available(iOS 14.0, *) class PKIssuerProvisioningExtensionHandler : NSObject { func status(completion: @escaping (PKIssuerProvisioningExtensionStatus) -> Void) + func status() async -> PKIssuerProvisioningExtensionStatus func passEntries(completion: @escaping ([PKIssuerProvisioningExtensionPassEntry]) -> Void) + func passEntries() async -> [PKIssuerProvisioningExtensionPassEntry] func remotePassEntries(completion: @escaping ([PKIssuerProvisioningExtensionPassEntry]) -> Void) + func remotePassEntries() async -> [PKIssuerProvisioningExtensionPassEntry] func generateAddPaymentPassRequestForPassEntryWithIdentifier(_ identifier: String, configuration: PKAddPaymentPassRequestConfiguration, certificateChain certificates: [Data], nonce: Data, nonceSignature: Data, completionHandler completion: @escaping (PKAddPaymentPassRequest?) -> Void) + func generateAddPaymentPassRequestForPassEntryWithIdentifier(_ identifier: String, configuration: PKAddPaymentPassRequestConfiguration, certificateChain certificates: [Data], nonce: Data, nonceSignature: Data) async -> PKAddPaymentPassRequest? } diff --git a/iOS/PassKit/PKPassLibrary.swift b/iOS/PassKit/PKPassLibrary.swift index 93d9885..5befd3b 100644 --- a/iOS/PassKit/PKPassLibrary.swift +++ b/iOS/PassKit/PKPassLibrary.swift @@ -47,6 +47,8 @@ class PKPassLibrary : NSObject { func replacePass(with pass: PKPass) -> Bool @available(iOS 7.0, *) func addPasses(_ passes: [PKPass], withCompletionHandler completion: ((PKPassLibraryAddPassesStatus) -> Void)? = nil) + @available(iOS 7.0, *) + func addPasses(_ passes: [PKPass]) async -> PKPassLibraryAddPassesStatus @available(iOS 8.3, *) func openPaymentSetup() @available(iOS, introduced: 10.0, deprecated: 100000, message: "Use -[PKPassLibrary presentSecureElementPass:] instead") @@ -61,12 +63,20 @@ class PKPassLibrary : NSObject { func canAddFelicaPass() -> Bool @available(iOS, introduced: 8.0, deprecated: 100000, message: "Use activateSecureElementPass:withActivationData:completion: instead") func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data, completion: ((Bool, Error) -> Void)? = nil) + @available(iOS, introduced: 8.0, deprecated: 100000, message: "Use activateSecureElementPass:withActivationData:completion: instead") + func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data) async -> (Bool, Error) @available(iOS, introduced: 8.0, deprecated: 9.0, message: "Use activatePaymentPass:withActivationData:completion: instead") func activate(_ paymentPass: PKPaymentPass, withActivationCode activationCode: String, completion: ((Bool, Error) -> Void)? = nil) + @available(iOS, introduced: 8.0, deprecated: 9.0, message: "Use activatePaymentPass:withActivationData:completion: instead") + func activate(_ paymentPass: PKPaymentPass, withActivationCode activationCode: String) async -> (Bool, Error) @available(iOS 13.4, *) func activate(_ secureElementPass: PKSecureElementPass, activationData: Data, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 13.4, *) + func activate(_ secureElementPass: PKSecureElementPass, activationData: Data) async throws -> Bool + @available(iOS 13.4, *) func sign(_ signData: Data, using secureElementPass: PKSecureElementPass, completion: @escaping (Data?, Data?, Error?) -> Void) + @available(iOS 13.4, *) + func sign(_ signData: Data, using secureElementPass: PKSecureElementPass) async throws -> (Data?, Data?) } struct PKPassLibraryNotificationName : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable { init(_ rawValue: String) diff --git a/iOS/PassKit/PKPaymentAuthorizationController.swift b/iOS/PassKit/PKPaymentAuthorizationController.swift index e3a81a3..97caba1 100644 --- a/iOS/PassKit/PKPaymentAuthorizationController.swift +++ b/iOS/PassKit/PKPaymentAuthorizationController.swift @@ -1,27 +1,43 @@ protocol PKPaymentAuthorizationControllerDelegate : NSObjectProtocol { @available(iOS 10.0, *) - func paymentAuthorizationControllerDidFinish(_ controller: PKPaymentAuthorizationController) + @asyncHandler func paymentAuthorizationControllerDidFinish(_ controller: PKPaymentAuthorizationController) @available(iOS 11.0, *) - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) + @available(iOS 11.0, *) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationResult + @available(iOS, introduced: 10.0, deprecated: 11.0, message: "Use paymentAuthorizationController:didAuthorizePayment:handler: instead to provide more granular errors") + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) @available(iOS, introduced: 10.0, deprecated: 11.0, message: "Use paymentAuthorizationController:didAuthorizePayment:handler: instead to provide more granular errors") - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationStatus @available(iOS 10.0, *) optional func paymentAuthorizationControllerWillAuthorizePayment(_ controller: PKPaymentAuthorizationController) @available(iOS 14.0, *) - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) + @available(iOS 11.0, *) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) + @available(iOS 11.0, *) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod) async -> PKPaymentRequestShippingMethodUpdate @available(iOS 11.0, *) - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) @available(iOS 11.0, *) - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact) async -> PKPaymentRequestShippingContactUpdate @available(iOS 11.0, *) - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) + @available(iOS 11.0, *) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod) async -> PKPaymentRequestPaymentMethodUpdate + @available(iOS, introduced: 10.0, deprecated: 11.0, message: "Use paymentAuthorizationController:didSelectShippingMethod:handler: instead to provide more granular errors") + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) @available(iOS, introduced: 10.0, deprecated: 11.0, message: "Use paymentAuthorizationController:didSelectShippingMethod:handler: instead to provide more granular errors") - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod) async -> (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) @available(iOS, introduced: 10.0, deprecated: 11.0, message: "Use paymentAuthorizationController:didSelectShippingContact:handler: instead to provide more granular errors") - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) + @available(iOS, introduced: 10.0, deprecated: 11.0, message: "Use paymentAuthorizationController:didSelectShippingContact:handler: instead to provide more granular errors") + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact) async -> (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) + @available(iOS, introduced: 10.0, deprecated: 11.0, message: "Use paymentAuthorizationController:didSelectPaymentMethod:handler: instead to provide more granular errors") + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) @available(iOS, introduced: 10.0, deprecated: 11.0, message: "Use paymentAuthorizationController:didSelectPaymentMethod:handler: instead to provide more granular errors") - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod) async -> [PKPaymentSummaryItem] @available(iOS 14.0, *) optional func presentationWindow(for controller: PKPaymentAuthorizationController) -> UIWindow? } @@ -33,5 +49,7 @@ class PKPaymentAuthorizationController : NSObject { weak var delegate: @sil_weak PKPaymentAuthorizationControllerDelegate? init(paymentRequest request: PKPaymentRequest) func present(completion: ((Bool) -> Void)? = nil) + func present() async -> Bool func dismiss(completion: (() -> Void)? = nil) + func dismiss() async } diff --git a/iOS/PassKit/PKPaymentAuthorizationViewControllerDelegate.swift b/iOS/PassKit/PKPaymentAuthorizationViewControllerDelegate.swift index 9076a76..eb8ca10 100644 --- a/iOS/PassKit/PKPaymentAuthorizationViewControllerDelegate.swift +++ b/iOS/PassKit/PKPaymentAuthorizationViewControllerDelegate.swift @@ -1,27 +1,45 @@ protocol PKPaymentAuthorizationViewControllerDelegate : NSObjectProtocol { @available(iOS 8.0, *) - func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) + @asyncHandler func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) @available(iOS 11.0, *) - optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) + @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) + @available(iOS 11.0, *) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationResult @available(iOS 8.3, *) optional func paymentAuthorizationViewControllerWillAuthorizePayment(_ controller: PKPaymentAuthorizationViewController) @available(iOS 14.0, *) - optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) + @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) + @available(iOS 11.0, *) + @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) + @available(iOS 11.0, *) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod) async -> PKPaymentRequestShippingMethodUpdate @available(iOS 11.0, *) - optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) + @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) @available(iOS 11.0, *) - optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact) async -> PKPaymentRequestShippingContactUpdate @available(iOS 11.0, *) - optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) + @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) + @available(iOS 11.0, *) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod) async -> PKPaymentRequestPaymentMethodUpdate + @available(iOS, introduced: 8.0, deprecated: 11.0, message: "Use paymentAuthorizationViewController:didAuthorizePayment:handler: instead to provide more granular errors") + @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) @available(iOS, introduced: 8.0, deprecated: 11.0, message: "Use paymentAuthorizationViewController:didAuthorizePayment:handler: instead to provide more granular errors") - optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationStatus @available(iOS, introduced: 8.0, deprecated: 11.0, message: "Use paymentAuthorizationViewController:didSelectShippingMethod:handler: instead to provide more granular errors") - optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) + @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) + @available(iOS, introduced: 8.0, deprecated: 11.0, message: "Use paymentAuthorizationViewController:didSelectShippingMethod:handler: instead to provide more granular errors") + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod) async -> (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) + @available(iOS, introduced: 8.0, deprecated: 9.0, message: "ABRecordRef has been deprecated. Please migrate away from this delegate callback as soon as possible.") + @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingAddress address: ABRecord, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) @available(iOS, introduced: 8.0, deprecated: 9.0, message: "ABRecordRef has been deprecated. Please migrate away from this delegate callback as soon as possible.") - optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingAddress address: ABRecord, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingAddress address: ABRecord) async -> (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) @available(iOS, introduced: 9.0, deprecated: 11.0, message: "Use paymentAuthorizationViewController:didSelectShippingContact:handler: instead to provide more granular errors") - optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) + @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) + @available(iOS, introduced: 9.0, deprecated: 11.0, message: "Use paymentAuthorizationViewController:didSelectShippingContact:handler: instead to provide more granular errors") + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact) async -> (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) + @available(iOS, introduced: 9.0, deprecated: 11.0, message: "Use paymentAuthorizationViewController:didSelectPaymentMethod:handler: instead to provide more granular errors") + @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) @available(iOS, introduced: 9.0, deprecated: 11.0, message: "Use paymentAuthorizationViewController:didSelectPaymentMethod:handler: instead to provide more granular errors") - optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod) async -> [PKPaymentSummaryItem] } diff --git a/iOS/PassKit/PKPaymentInformationEventExtension.swift b/iOS/PassKit/PKPaymentInformationEventExtension.swift index dc1d681..43d4919 100644 --- a/iOS/PassKit/PKPaymentInformationEventExtension.swift +++ b/iOS/PassKit/PKPaymentInformationEventExtension.swift @@ -8,7 +8,13 @@ protocol PKPaymentInformationRequestHandling { @available(iOS 14.0, *) func handleInformationRequest(_ infoRequest: PKBarcodeEventMetadataRequest, completion: @escaping PKInformationRequestCompletionBlock) @available(iOS 14.0, *) + func handleInformationRequest(_ infoRequest: PKBarcodeEventMetadataRequest) async -> PKBarcodeEventMetadataResponse + @available(iOS 14.0, *) func handle(_ signatureRequest: PKBarcodeEventSignatureRequest, completion: @escaping PKSignatureRequestCompletionBlock) @available(iOS 14.0, *) + func handle(_ signatureRequest: PKBarcodeEventSignatureRequest) async -> PKBarcodeEventSignatureResponse + @available(iOS 14.0, *) func handle(_ configurationRequest: PKBarcodeEventConfigurationRequest, completion: @escaping () -> Void) + @available(iOS 14.0, *) + func handle(_ configurationRequest: PKBarcodeEventConfigurationRequest) async } diff --git a/iOS/PencilKit/PKCanvasView.swift b/iOS/PencilKit/PKCanvasView.swift index c7c2ba9..7a25ce2 100644 --- a/iOS/PencilKit/PKCanvasView.swift +++ b/iOS/PencilKit/PKCanvasView.swift @@ -1,10 +1,10 @@ @available(iOS 13.0, *) protocol PKCanvasViewDelegate : UIScrollViewDelegate { - optional func canvasViewDrawingDidChange(_ canvasView: PKCanvasView) - optional func canvasViewDidFinishRendering(_ canvasView: PKCanvasView) - optional func canvasViewDidBeginUsingTool(_ canvasView: PKCanvasView) - optional func canvasViewDidEndUsingTool(_ canvasView: PKCanvasView) + @asyncHandler optional func canvasViewDrawingDidChange(_ canvasView: PKCanvasView) + @asyncHandler optional func canvasViewDidFinishRendering(_ canvasView: PKCanvasView) + @asyncHandler optional func canvasViewDidBeginUsingTool(_ canvasView: PKCanvasView) + @asyncHandler optional func canvasViewDidEndUsingTool(_ canvasView: PKCanvasView) } enum PKCanvasViewDrawingPolicy : UInt { init?(rawValue: UInt) diff --git a/iOS/PencilKit/PKToolPicker.swift b/iOS/PencilKit/PKToolPicker.swift index 05c7a64..739f56a 100644 --- a/iOS/PencilKit/PKToolPicker.swift +++ b/iOS/PencilKit/PKToolPicker.swift @@ -1,10 +1,10 @@ @available(iOS 13.0, *) protocol PKToolPickerObserver : NSObjectProtocol { - optional func toolPickerSelectedToolDidChange(_ toolPicker: PKToolPicker) - optional func toolPickerIsRulerActiveDidChange(_ toolPicker: PKToolPicker) - optional func toolPickerVisibilityDidChange(_ toolPicker: PKToolPicker) - optional func toolPickerFramesObscuredDidChange(_ toolPicker: PKToolPicker) + @asyncHandler optional func toolPickerSelectedToolDidChange(_ toolPicker: PKToolPicker) + @asyncHandler optional func toolPickerIsRulerActiveDidChange(_ toolPicker: PKToolPicker) + @asyncHandler optional func toolPickerVisibilityDidChange(_ toolPicker: PKToolPicker) + @asyncHandler optional func toolPickerFramesObscuredDidChange(_ toolPicker: PKToolPicker) } @available(iOS 13.0, *) class PKToolPicker : NSObject { diff --git a/iOS/Photos/PHAssetResourceManager.swift b/iOS/Photos/PHAssetResourceManager.swift index bb29338..e3550ea 100644 --- a/iOS/Photos/PHAssetResourceManager.swift +++ b/iOS/Photos/PHAssetResourceManager.swift @@ -21,5 +21,7 @@ class PHAssetResourceManager : NSObject { @available(iOS 9, *) func writeData(for resource: PHAssetResource, toFile fileURL: URL, options: PHAssetResourceRequestOptions?, completionHandler: @escaping (Error?) -> Void) @available(iOS 9, *) + func writeData(for resource: PHAssetResource, toFile fileURL: URL, options: PHAssetResourceRequestOptions?) async throws + @available(iOS 9, *) func cancelDataRequest(_ requestID: PHAssetResourceDataRequestID) } diff --git a/iOS/Photos/PHLivePhotoEditingContext.swift b/iOS/Photos/PHLivePhotoEditingContext.swift index a65ca8c..5356720 100644 --- a/iOS/Photos/PHLivePhotoEditingContext.swift +++ b/iOS/Photos/PHLivePhotoEditingContext.swift @@ -26,8 +26,12 @@ class PHLivePhotoEditingContext : NSObject { @available(iOS 10, *) func prepareLivePhotoForPlayback(withTargetSize targetSize: CGSize, options: [String : Any]? = nil, completionHandler handler: @escaping (PHLivePhoto?, Error?) -> Void) @available(iOS 10, *) + func prepareLivePhotoForPlayback(withTargetSize targetSize: CGSize, options: [String : Any]? = nil) async throws -> PHLivePhoto? + @available(iOS 10, *) func saveLivePhoto(to output: PHContentEditingOutput, options: [String : Any]? = nil, completionHandler handler: @escaping (Bool, Error?) -> Void) @available(iOS 10, *) + func saveLivePhoto(to output: PHContentEditingOutput, options: [String : Any]? = nil) async throws -> Bool + @available(iOS 10, *) func cancel() } @available(iOS 10, iOS 10, *) diff --git a/iOS/Photos/PHPhotoLibrary.swift b/iOS/Photos/PHPhotoLibrary.swift index 584ff1f..9eadd67 100644 --- a/iOS/Photos/PHPhotoLibrary.swift +++ b/iOS/Photos/PHPhotoLibrary.swift @@ -26,12 +26,12 @@ enum PHAccessLevel : Int { @available(iOS 8, *) protocol PHPhotoLibraryChangeObserver : NSObjectProtocol { @available(iOS 8, *) - func photoLibraryDidChange(_ changeInstance: PHChange) + @asyncHandler func photoLibraryDidChange(_ changeInstance: PHChange) } @available(iOS 13, *) protocol PHPhotoLibraryAvailabilityObserver : NSObjectProtocol { @available(iOS 13, *) - func photoLibraryDidBecomeUnavailable(_ photoLibrary: PHPhotoLibrary) + @asyncHandler func photoLibraryDidBecomeUnavailable(_ photoLibrary: PHPhotoLibrary) } @available(iOS 8, *) class PHPhotoLibrary : NSObject { @@ -54,6 +54,8 @@ class PHPhotoLibrary : NSObject { @available(iOS 8, *) func performChanges(_ changeBlock: @escaping () -> Void, completionHandler: ((Bool, Error?) -> Void)? = nil) @available(iOS 8, *) + func performChanges(_ changeBlock: @escaping () -> Void) async throws -> Bool + @available(iOS 8, *) func performChangesAndWait(_ changeBlock: @escaping () -> Void) throws @available(iOS 8, *) func register(_ observer: PHPhotoLibraryChangeObserver) diff --git a/iOS/PhotosUI/PHContentEditingController.swift b/iOS/PhotosUI/PHContentEditingController.swift index deda016..1673584 100644 --- a/iOS/PhotosUI/PHContentEditingController.swift +++ b/iOS/PhotosUI/PHContentEditingController.swift @@ -8,6 +8,8 @@ protocol PHContentEditingController : NSObjectProtocol { @available(iOS 8, *) func finishContentEditing(completionHandler: @escaping (PHContentEditingOutput?) -> Void) @available(iOS 8, *) + func finishContentEditing() async -> PHContentEditingOutput? + @available(iOS 8, *) func cancelContentEditing() @available(iOS 8, *) var shouldShowCancelConfirmation: Bool { get } diff --git a/iOS/PhotosUI/PHLivePhotoView.swift b/iOS/PhotosUI/PHLivePhotoView.swift index 525e44e..552e0ae 100644 --- a/iOS/PhotosUI/PHLivePhotoView.swift +++ b/iOS/PhotosUI/PHLivePhotoView.swift @@ -41,5 +41,5 @@ protocol PHLivePhotoViewDelegate : NSObjectProtocol { @available(iOS 9.1, *) optional func livePhotoView(_ livePhotoView: PHLivePhotoView, willBeginPlaybackWith playbackStyle: PHLivePhotoViewPlaybackStyle) @available(iOS 9.1, *) - optional func livePhotoView(_ livePhotoView: PHLivePhotoView, didEndPlaybackWith playbackStyle: PHLivePhotoViewPlaybackStyle) + @asyncHandler optional func livePhotoView(_ livePhotoView: PHLivePhotoView, didEndPlaybackWith playbackStyle: PHLivePhotoViewPlaybackStyle) } diff --git a/iOS/PhotosUI/PHPicker.swift b/iOS/PhotosUI/PHPicker.swift index 92ad94b..6a126fa 100644 --- a/iOS/PhotosUI/PHPicker.swift +++ b/iOS/PhotosUI/PHPicker.swift @@ -42,7 +42,7 @@ class __PHPickerResult : NSObject { @available(iOS 14, *) protocol __PHPickerViewControllerDelegate : NSObjectProtocol { @available(iOS 14, *) - func picker(_ picker: PHPickerViewController, didFinishPicking results: [__PHPickerResult]) + @asyncHandler func picker(_ picker: PHPickerViewController, didFinishPicking results: [__PHPickerResult]) } @available(iOS 14, *) class PHPickerViewController : UIViewController { diff --git a/iOS/PushKit/PKPushRegistry.swift b/iOS/PushKit/PKPushRegistry.swift index 62e19ff..d5a0aab 100644 --- a/iOS/PushKit/PKPushRegistry.swift +++ b/iOS/PushKit/PKPushRegistry.swift @@ -16,11 +16,13 @@ class PKPushRegistry : NSObject { } protocol PKPushRegistryDelegate : NSObjectProtocol { @available(iOS 8.0, *) - func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) + @asyncHandler func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) @available(iOS, introduced: 8.0, deprecated: 11.0) - optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType) + @asyncHandler optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType) @available(iOS 11.0, *) - optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) + @asyncHandler optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) + @available(iOS 11.0, *) + optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType) async @available(iOS 8.0, *) - optional func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType) + @asyncHandler optional func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType) } diff --git a/iOS/QuartzCore/CAAnimation.swift b/iOS/QuartzCore/CAAnimation.swift index d2d7e67..87d14c9 100644 --- a/iOS/QuartzCore/CAAnimation.swift +++ b/iOS/QuartzCore/CAAnimation.swift @@ -29,9 +29,9 @@ class CAAnimation : NSObject, NSSecureCoding, NSCopying, CAMediaTiming, CAAction } protocol CAAnimationDelegate : NSObjectProtocol { @available(iOS 2.0, *) - optional func animationDidStart(_ anim: CAAnimation) + @asyncHandler optional func animationDidStart(_ anim: CAAnimation) @available(iOS 2.0, *) - optional func animationDidStop(_ anim: CAAnimation, finished flag: Bool) + @asyncHandler optional func animationDidStop(_ anim: CAAnimation, finished flag: Bool) } @available(iOS 2.0, *) class CAPropertyAnimation : CAAnimation { diff --git a/iOS/QuickLook/QLPreviewController.swift b/iOS/QuickLook/QLPreviewController.swift index 0e35c1f..48b9a20 100644 --- a/iOS/QuickLook/QLPreviewController.swift +++ b/iOS/QuickLook/QLPreviewController.swift @@ -27,7 +27,7 @@ protocol QLPreviewControllerDelegate : NSObjectProtocol { @available(iOS 4.0, *) optional func previewControllerWillDismiss(_ controller: QLPreviewController) @available(iOS 4.0, *) - optional func previewControllerDidDismiss(_ controller: QLPreviewController) + @asyncHandler optional func previewControllerDidDismiss(_ controller: QLPreviewController) @available(iOS 4.0, *) optional func previewController(_ controller: QLPreviewController, shouldOpen url: URL, for item: QLPreviewItem) -> Bool @available(iOS 4.0, *) @@ -39,7 +39,7 @@ protocol QLPreviewControllerDelegate : NSObjectProtocol { @available(iOS 13.0, *) optional func previewController(_ controller: QLPreviewController, editingModeFor previewItem: QLPreviewItem) -> QLPreviewItemEditingMode @available(iOS 13.0, *) - optional func previewController(_ controller: QLPreviewController, didUpdateContentsOf previewItem: QLPreviewItem) + @asyncHandler optional func previewController(_ controller: QLPreviewController, didUpdateContentsOf previewItem: QLPreviewItem) @available(iOS 13.0, *) - optional func previewController(_ controller: QLPreviewController, didSaveEditedCopyOf previewItem: QLPreviewItem, at modifiedContentsURL: URL) + @asyncHandler optional func previewController(_ controller: QLPreviewController, didSaveEditedCopyOf previewItem: QLPreviewItem, at modifiedContentsURL: URL) } diff --git a/iOS/QuickLook/QLPreviewingController.swift b/iOS/QuickLook/QLPreviewingController.swift index 9afeb41..0c11cd4 100644 --- a/iOS/QuickLook/QLPreviewingController.swift +++ b/iOS/QuickLook/QLPreviewingController.swift @@ -1,5 +1,7 @@ protocol QLPreviewingController : NSObjectProtocol { optional func preparePreviewOfSearchableItem(identifier: String, queryString: String?, completionHandler handler: @escaping (Error?) -> Void) + optional func preparePreviewOfSearchableItem(identifier: String, queryString: String?) async throws optional func preparePreviewOfFile(at url: URL, completionHandler handler: @escaping (Error?) -> Void) + optional func preparePreviewOfFile(at url: URL) async throws } diff --git a/iOS/QuickLookThumbnailing/QLThumbnailGenerator.swift b/iOS/QuickLookThumbnailing/QLThumbnailGenerator.swift index c2d3c8f..4696901 100644 --- a/iOS/QuickLookThumbnailing/QLThumbnailGenerator.swift +++ b/iOS/QuickLookThumbnailing/QLThumbnailGenerator.swift @@ -3,7 +3,9 @@ class QLThumbnailGenerator : NSObject { class var shared: QLThumbnailGenerator { get } func generateBestRepresentation(for request: QLThumbnailGenerator.Request, completion completionHandler: @escaping (QLThumbnailRepresentation?, Error?) -> Void) + func generateBestRepresentation(for request: QLThumbnailGenerator.Request) async throws -> QLThumbnailRepresentation? func generateRepresentations(for request: QLThumbnailGenerator.Request, update updateHandler: ((QLThumbnailRepresentation?, QLThumbnailRepresentation.RepresentationType, Error?) -> Void)? = nil) func cancel(_ request: QLThumbnailGenerator.Request) func saveBestRepresentation(for request: QLThumbnailGenerator.Request, to fileURL: URL, contentType: String, completion completionHandler: @escaping (Error?) -> Void) + func saveBestRepresentation(for request: QLThumbnailGenerator.Request, to fileURL: URL, contentType: String) async throws } diff --git a/iOS/ReplayKit/RPBroadcast.swift b/iOS/ReplayKit/RPBroadcast.swift index 81b364e..09bbd4a 100644 --- a/iOS/ReplayKit/RPBroadcast.swift +++ b/iOS/ReplayKit/RPBroadcast.swift @@ -9,7 +9,7 @@ class RPBroadcastActivityViewController : UIViewController { @available(iOS 10.0, *) protocol RPBroadcastActivityViewControllerDelegate : NSObjectProtocol { @available(iOS 10.0, *) - func broadcastActivityViewController(_ broadcastActivityViewController: RPBroadcastActivityViewController, didFinishWith broadcastController: RPBroadcastController?, error: Error?) + @asyncHandler func broadcastActivityViewController(_ broadcastActivityViewController: RPBroadcastActivityViewController, didFinishWith broadcastController: RPBroadcastController?, error: Error?) } @available(iOS 10.0, *) class RPBroadcastController : NSObject { @@ -27,10 +27,10 @@ class RPBroadcastController : NSObject { } @available(iOS 10.0, *) protocol RPBroadcastControllerDelegate : NSObjectProtocol { - optional func broadcastController(_ broadcastController: RPBroadcastController, didFinishWithError error: Error?) - optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateServiceInfo serviceInfo: [String : NSCoding & NSObjectProtocol]) + @asyncHandler optional func broadcastController(_ broadcastController: RPBroadcastController, didFinishWithError error: Error?) + @asyncHandler optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateServiceInfo serviceInfo: [String : NSCoding & NSObjectProtocol]) @available(iOS 11.0, *) - optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateBroadcast broadcastURL: URL) + @asyncHandler optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateBroadcast broadcastURL: URL) } @available(iOS 12.0, *) class RPSystemBroadcastPickerView : UIView, NSCoding { diff --git a/iOS/ReplayKit/RPBroadcastExtension.swift b/iOS/ReplayKit/RPBroadcastExtension.swift index bf933a4..f4cc6bd 100644 --- a/iOS/ReplayKit/RPBroadcastExtension.swift +++ b/iOS/ReplayKit/RPBroadcastExtension.swift @@ -1,6 +1,7 @@ extension NSExtensionContext { func loadBroadcastingApplicationInfo(completion handler: @escaping (String, String, UIImage?) -> Void) + func loadBroadcastingApplicationInfo() async -> (String, String, UIImage?) @available(iOS, introduced: 10.0, deprecated: 11.0, message: "No longer supported") func completeRequest(withBroadcast broadcastURL: URL, broadcastConfiguration: RPBroadcastConfiguration, setupInfo: [String : NSCoding & NSObjectProtocol]?) @available(iOS 11.0, *) diff --git a/iOS/ReplayKit/RPPreviewViewController.swift b/iOS/ReplayKit/RPPreviewViewController.swift index d6ad050..6ac7b0b 100644 --- a/iOS/ReplayKit/RPPreviewViewController.swift +++ b/iOS/ReplayKit/RPPreviewViewController.swift @@ -3,6 +3,6 @@ class RPPreviewViewController : UIViewController { weak var previewControllerDelegate: @sil_weak RPPreviewViewControllerDelegate? } protocol RPPreviewViewControllerDelegate : NSObjectProtocol { - optional func previewControllerDidFinish(_ previewController: RPPreviewViewController) - optional func previewController(_ previewController: RPPreviewViewController, didFinishWithActivityTypes activityTypes: Set) + @asyncHandler optional func previewControllerDidFinish(_ previewController: RPPreviewViewController) + @asyncHandler optional func previewController(_ previewController: RPPreviewViewController, didFinishWithActivityTypes activityTypes: Set) } diff --git a/iOS/ReplayKit/RPScreenRecorder.swift b/iOS/ReplayKit/RPScreenRecorder.swift index 81a4357..d81fbf0 100644 --- a/iOS/ReplayKit/RPScreenRecorder.swift +++ b/iOS/ReplayKit/RPScreenRecorder.swift @@ -15,10 +15,14 @@ class RPScreenRecorder : NSObject { func stopRecording(handler: ((RPPreviewViewController?, Error?) -> Void)? = nil) @available(iOS 14.0, *) func stopRecording(withOutput url: URL, completionHandler: ((Error?) -> Void)? = nil) + @available(iOS 14.0, *) + func stopRecording(withOutput url: URL) async throws func discardRecording(handler: @escaping () -> Void) @available(iOS 11.0, *) func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) + func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?) async throws + @available(iOS 11.0, *) func stopCapture(handler: ((Error?) -> Void)? = nil) weak var delegate: @sil_weak RPScreenRecorderDelegate? var isAvailable: Bool { get } @@ -34,8 +38,8 @@ class RPScreenRecorder : NSObject { @available(iOS 9.0, *) protocol RPScreenRecorderDelegate : NSObjectProtocol { @available(iOS, introduced: 9.0, deprecated: 10.0, message: "No longer supported") - optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWithError error: Error, previewViewController: RPPreviewViewController?) + @asyncHandler optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWithError error: Error, previewViewController: RPPreviewViewController?) @available(iOS 11.0, *) - optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWith previewViewController: RPPreviewViewController?, error: Error?) - optional func screenRecorderDidChangeAvailability(_ screenRecorder: RPScreenRecorder) + @asyncHandler optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWith previewViewController: RPPreviewViewController?, error: Error?) + @asyncHandler optional func screenRecorderDidChangeAvailability(_ screenRecorder: RPScreenRecorder) } diff --git a/iOS/SafariServices/SFContentBlockerManager.swift b/iOS/SafariServices/SFContentBlockerManager.swift index 6287490..128be23 100644 --- a/iOS/SafariServices/SFContentBlockerManager.swift +++ b/iOS/SafariServices/SFContentBlockerManager.swift @@ -15,6 +15,9 @@ enum SFContentBlockerErrorCode : Int { @available(iOS 9.0, *) class SFContentBlockerManager : NSObject { class func reloadContentBlocker(withIdentifier identifier: String, completionHandler: ((Error?) -> Void)? = nil) + class func reloadContentBlocker(withIdentifier identifier: String) async throws @available(iOS 10.0, *) class func getStateOfContentBlocker(withIdentifier identifier: String, completionHandler: @escaping (SFContentBlockerState?, Error?) -> Void) + @available(iOS 10.0, *) + class func getStateOfContentBlocker(withIdentifier identifier: String) async throws -> SFContentBlockerState? } diff --git a/iOS/SafariServices/SFSafariViewController.swift b/iOS/SafariServices/SFSafariViewController.swift index d51b058..e896ebd 100644 --- a/iOS/SafariServices/SFSafariViewController.swift +++ b/iOS/SafariServices/SFSafariViewController.swift @@ -31,8 +31,8 @@ protocol SFSafariViewControllerDelegate : NSObjectProtocol { optional func safariViewController(_ controller: SFSafariViewController, activityItemsFor URL: URL, title: String?) -> [UIActivity] @available(iOS 11.0, *) optional func safariViewController(_ controller: SFSafariViewController, excludedActivityTypesFor URL: URL, title: String?) -> [UIActivity.ActivityType] - optional func safariViewControllerDidFinish(_ controller: SFSafariViewController) - optional func safariViewController(_ controller: SFSafariViewController, didCompleteInitialLoad didLoadSuccessfully: Bool) + @asyncHandler optional func safariViewControllerDidFinish(_ controller: SFSafariViewController) + @asyncHandler optional func safariViewController(_ controller: SFSafariViewController, didCompleteInitialLoad didLoadSuccessfully: Bool) @available(iOS 11.0, *) optional func safariViewController(_ controller: SFSafariViewController, initialLoadDidRedirectTo URL: URL) @available(iOS 14.0, *) diff --git a/iOS/SceneKit/SCNAction.swift b/iOS/SceneKit/SCNAction.swift index faf38d7..702f3f1 100644 --- a/iOS/SceneKit/SCNAction.swift +++ b/iOS/SceneKit/SCNAction.swift @@ -3,8 +3,10 @@ typealias SCNActionTimingFunction = (Float) -> Float protocol SCNActionable : NSObjectProtocol { func runAction(_ action: SCNAction) func runAction(_ action: SCNAction, completionHandler block: (() -> Void)? = nil) + func runAction(_ action: SCNAction) async func runAction(_ action: SCNAction, forKey key: String?) func runAction(_ action: SCNAction, forKey key: String?, completionHandler block: (() -> Void)? = nil) + func runAction(_ action: SCNAction, forKey key: String?) async var hasActions: Bool { get } func action(forKey key: String) -> SCNAction? func removeAction(forKey key: String) diff --git a/iOS/SceneKit/SCNCameraController.swift b/iOS/SceneKit/SCNCameraController.swift index 3fb8c51..c2cd63e 100644 --- a/iOS/SceneKit/SCNCameraController.swift +++ b/iOS/SceneKit/SCNCameraController.swift @@ -14,7 +14,7 @@ enum SCNInteractionMode : Int { @available(iOS 11.0, *) protocol SCNCameraControllerDelegate : NSObjectProtocol { optional func cameraInertiaWillStart(for cameraController: SCNCameraController) - optional func cameraInertiaDidEnd(for cameraController: SCNCameraController) + @asyncHandler optional func cameraInertiaDidEnd(for cameraController: SCNCameraController) } @available(iOS 11.0, *) class SCNCameraController : NSObject { diff --git a/iOS/SceneKit/SCNConstraint.swift b/iOS/SceneKit/SCNConstraint.swift index 7b26a8f..c5124ef 100644 --- a/iOS/SceneKit/SCNConstraint.swift +++ b/iOS/SceneKit/SCNConstraint.swift @@ -78,7 +78,7 @@ class SCNSliderConstraint : SCNConstraint { @available(iOS 11.0, *) protocol SCNAvoidOccluderConstraintDelegate : NSObjectProtocol { optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, shouldAvoidOccluder occluder: SCNNode, for node: SCNNode) -> Bool - optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, didAvoidOccluder occluder: SCNNode, for node: SCNNode) + @asyncHandler optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, didAvoidOccluder occluder: SCNNode, for node: SCNNode) } @available(iOS 11.0, *) class SCNAvoidOccluderConstraint : SCNConstraint { diff --git a/iOS/SceneKit/SCNPhysicsWorld.swift b/iOS/SceneKit/SCNPhysicsWorld.swift index 74bf4d8..49f7d9b 100644 --- a/iOS/SceneKit/SCNPhysicsWorld.swift +++ b/iOS/SceneKit/SCNPhysicsWorld.swift @@ -22,9 +22,9 @@ extension SCNPhysicsWorld.TestSearchMode { static let all: SCNPhysicsWorld.TestSearchMode } protocol SCNPhysicsContactDelegate : NSObjectProtocol { - optional func physicsWorld(_ world: SCNPhysicsWorld, didBegin contact: SCNPhysicsContact) - optional func physicsWorld(_ world: SCNPhysicsWorld, didUpdate contact: SCNPhysicsContact) - optional func physicsWorld(_ world: SCNPhysicsWorld, didEnd contact: SCNPhysicsContact) + @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didBegin contact: SCNPhysicsContact) + @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didUpdate contact: SCNPhysicsContact) + @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didEnd contact: SCNPhysicsContact) } class SCNPhysicsWorld : NSObject, NSSecureCoding { var gravity: SCNVector3 diff --git a/iOS/SceneKit/SCNSceneRenderer.swift b/iOS/SceneKit/SCNSceneRenderer.swift index 302159c..e6973c6 100644 --- a/iOS/SceneKit/SCNSceneRenderer.swift +++ b/iOS/SceneKit/SCNSceneRenderer.swift @@ -53,6 +53,7 @@ protocol SCNSceneRenderer : NSObjectProtocol { var isTemporalAntialiasingEnabled: Bool { get set } func prepare(_ object: Any, shouldAbortBlock block: (() -> Bool)? = nil) -> Bool func prepare(_ objects: [Any], completionHandler: ((Bool) -> Void)? = nil) + func prepare(_ objects: [Any]) async -> Bool var showsStatistics: Bool { get set } @available(iOS 9.0, *) var debugOptions: SCNDebugOptions { get set } @@ -82,10 +83,10 @@ protocol SCNSceneRenderer : NSObjectProtocol { } protocol SCNSceneRendererDelegate : NSObjectProtocol { optional func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) - optional func renderer(_ renderer: SCNSceneRenderer, didApplyAnimationsAtTime time: TimeInterval) - optional func renderer(_ renderer: SCNSceneRenderer, didSimulatePhysicsAtTime time: TimeInterval) + @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didApplyAnimationsAtTime time: TimeInterval) + @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didSimulatePhysicsAtTime time: TimeInterval) @available(iOS 11.0, *) - optional func renderer(_ renderer: SCNSceneRenderer, didApplyConstraintsAtTime time: TimeInterval) + @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didApplyConstraintsAtTime time: TimeInterval) optional func renderer(_ renderer: SCNSceneRenderer, willRenderScene scene: SCNScene, atTime time: TimeInterval) - optional func renderer(_ renderer: SCNSceneRenderer, didRenderScene scene: SCNScene, atTime time: TimeInterval) + @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didRenderScene scene: SCNScene, atTime time: TimeInterval) } diff --git a/iOS/SensorKit/SensorKit.swift b/iOS/SensorKit/SensorKit.swift index c219244..36ee5b4 100644 --- a/iOS/SensorKit/SensorKit.swift +++ b/iOS/SensorKit/SensorKit.swift @@ -78,14 +78,14 @@ enum SRAuthorizationStatus : Int { @available(iOS 14.0, *) protocol SRSensorReaderDelegate : NSObjectProtocol { optional func sensorReader(_ reader: SRSensorReader, fetching fetchRequest: SRFetchRequest, didFetchResult result: SRFetchResult) -> Bool - optional func sensorReader(_ reader: SRSensorReader, didCompleteFetch fetchRequest: SRFetchRequest) + @asyncHandler optional func sensorReader(_ reader: SRSensorReader, didCompleteFetch fetchRequest: SRFetchRequest) optional func sensorReader(_ reader: SRSensorReader, fetching fetchRequest: SRFetchRequest, failedWithError error: Error) - optional func sensorReader(_ reader: SRSensorReader, didChange authorizationStatus: SRAuthorizationStatus) + @asyncHandler optional func sensorReader(_ reader: SRSensorReader, didChange authorizationStatus: SRAuthorizationStatus) optional func sensorReaderWillStartRecording(_ reader: SRSensorReader) optional func sensorReader(_ reader: SRSensorReader, startRecordingFailedWithError error: Error) - optional func sensorReaderDidStopRecording(_ reader: SRSensorReader) + @asyncHandler optional func sensorReaderDidStopRecording(_ reader: SRSensorReader) optional func sensorReader(_ reader: SRSensorReader, stopRecordingFailedWithError error: Error) - optional func sensorReader(_ reader: SRSensorReader, didFetch devices: [SRDevice]) + @asyncHandler optional func sensorReader(_ reader: SRSensorReader, didFetch devices: [SRDevice]) optional func sensorReader(_ reader: SRSensorReader, fetchDevicesDidFailWithError error: Error) } @available(iOS 14.0, *) @@ -99,6 +99,7 @@ class SRSensorReader : NSObject { var sensor: SRSensor { get } weak var delegate: @sil_weak SRSensorReaderDelegate? class func requestAuthorization(sensors: Set, completion: @escaping (Error?) -> Void) + class func requestAuthorization(sensors: Set) async throws } @available(iOS 14.0, *) let SRErrorDomain: String diff --git a/iOS/SoundAnalysis/SNAnalyzer.swift b/iOS/SoundAnalysis/SNAnalyzer.swift index 2103040..120a693 100644 --- a/iOS/SoundAnalysis/SNAnalyzer.swift +++ b/iOS/SoundAnalysis/SNAnalyzer.swift @@ -16,5 +16,6 @@ class SNAudioFileAnalyzer : NSObject { func removeAllRequests() func analyze() func analyze(completionHandler: @escaping (Bool) -> Void) + func analyze() async -> Bool func cancelAnalysis() } diff --git a/iOS/SoundAnalysis/SNResult.swift b/iOS/SoundAnalysis/SNResult.swift index 1e4c7f5..f2956c1 100644 --- a/iOS/SoundAnalysis/SNResult.swift +++ b/iOS/SoundAnalysis/SNResult.swift @@ -4,7 +4,7 @@ protocol SNResult : NSObjectProtocol { } @available(iOS 13.0, *) protocol SNResultsObserving : NSObjectProtocol { - func request(_ request: SNRequest, didProduce result: SNResult) - optional func request(_ request: SNRequest, didFailWithError error: Error) - optional func requestDidComplete(_ request: SNRequest) + @asyncHandler func request(_ request: SNRequest, didProduce result: SNResult) + @asyncHandler optional func request(_ request: SNRequest, didFailWithError error: Error) + @asyncHandler optional func requestDidComplete(_ request: SNRequest) } diff --git a/iOS/Speech/SFSpeechRecognitionTask.swift b/iOS/Speech/SFSpeechRecognitionTask.swift index 338e2d1..aa97ba2 100644 --- a/iOS/Speech/SFSpeechRecognitionTask.swift +++ b/iOS/Speech/SFSpeechRecognitionTask.swift @@ -20,10 +20,10 @@ class SFSpeechRecognitionTask : NSObject { } @available(iOS 10.0, *) protocol SFSpeechRecognitionTaskDelegate : NSObjectProtocol { - optional func speechRecognitionDidDetectSpeech(_ task: SFSpeechRecognitionTask) - optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didHypothesizeTranscription transcription: SFTranscription) - optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishRecognition recognitionResult: SFSpeechRecognitionResult) + @asyncHandler optional func speechRecognitionDidDetectSpeech(_ task: SFSpeechRecognitionTask) + @asyncHandler optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didHypothesizeTranscription transcription: SFTranscription) + @asyncHandler optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishRecognition recognitionResult: SFSpeechRecognitionResult) optional func speechRecognitionTaskFinishedReadingAudio(_ task: SFSpeechRecognitionTask) optional func speechRecognitionTaskWasCancelled(_ task: SFSpeechRecognitionTask) - optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishSuccessfully successfully: Bool) + @asyncHandler optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishSuccessfully successfully: Bool) } diff --git a/iOS/SpriteKit/SKNode.swift b/iOS/SpriteKit/SKNode.swift index 4e86f17..ac24ee2 100644 --- a/iOS/SpriteKit/SKNode.swift +++ b/iOS/SpriteKit/SKNode.swift @@ -65,6 +65,7 @@ class SKNode : UIResponder, NSCopying, NSSecureCoding, UIFocusItem { func inParentHierarchy(_ parent: SKNode) -> Bool func run(_ action: SKAction) func run(_ action: SKAction, completion block: @escaping () -> Void) + func run(_ action: SKAction) async func run(_ action: SKAction, withKey key: String) func hasActions() -> Bool func action(forKey key: String) -> SKAction? diff --git a/iOS/SpriteKit/SKPhysicsWorld.swift b/iOS/SpriteKit/SKPhysicsWorld.swift index 4bbdcf1..9e19ea5 100644 --- a/iOS/SpriteKit/SKPhysicsWorld.swift +++ b/iOS/SpriteKit/SKPhysicsWorld.swift @@ -1,7 +1,7 @@ protocol SKPhysicsContactDelegate : NSObjectProtocol { - optional func didBegin(_ contact: SKPhysicsContact) - optional func didEnd(_ contact: SKPhysicsContact) + @asyncHandler optional func didBegin(_ contact: SKPhysicsContact) + @asyncHandler optional func didEnd(_ contact: SKPhysicsContact) } class SKPhysicsWorld : NSObject, NSSecureCoding { var gravity: CGVector diff --git a/iOS/SpriteKit/SKScene.swift b/iOS/SpriteKit/SKScene.swift index bfcd6c3..0cbbc1d 100644 --- a/iOS/SpriteKit/SKScene.swift +++ b/iOS/SpriteKit/SKScene.swift @@ -11,10 +11,10 @@ enum SKSceneScaleMode : Int { @available(iOS 8.0, *) protocol SKSceneDelegate : NSObjectProtocol { optional func update(_ currentTime: TimeInterval, for scene: SKScene) - optional func didEvaluateActions(for scene: SKScene) - optional func didSimulatePhysics(for scene: SKScene) - optional func didApplyConstraints(for scene: SKScene) - optional func didFinishUpdate(for scene: SKScene) + @asyncHandler optional func didEvaluateActions(for scene: SKScene) + @asyncHandler optional func didSimulatePhysics(for scene: SKScene) + @asyncHandler optional func didApplyConstraints(for scene: SKScene) + @asyncHandler optional func didFinishUpdate(for scene: SKScene) } class SKScene : SKEffectNode { init(size: CGSize) diff --git a/iOS/SpriteKit/SKTexture.swift b/iOS/SpriteKit/SKTexture.swift index a487f7e..dc85201 100644 --- a/iOS/SpriteKit/SKTexture.swift +++ b/iOS/SpriteKit/SKTexture.swift @@ -30,7 +30,9 @@ class SKTexture : NSObject, NSCopying, NSSecureCoding { @available(iOS 9.0, *) func cgImage() -> CGImage class func preload(_ textures: [SKTexture], withCompletionHandler completionHandler: @escaping () -> Void) + class func preload(_ textures: [SKTexture]) async func preload(completionHandler: @escaping () -> Void) + func preload() async } extension SKTexture : _CustomPlaygroundQuickLookable { diff --git a/iOS/SpriteKit/SKTextureAtlas.swift b/iOS/SpriteKit/SKTextureAtlas.swift index 200fc95..ab5f507 100644 --- a/iOS/SpriteKit/SKTextureAtlas.swift +++ b/iOS/SpriteKit/SKTextureAtlas.swift @@ -5,9 +5,13 @@ class SKTextureAtlas : NSObject, NSSecureCoding { convenience init(dictionary properties: [String : Any]) func textureNamed(_ name: String) -> SKTexture class func preloadTextureAtlases(_ textureAtlases: [SKTextureAtlas], withCompletionHandler completionHandler: @escaping () -> Void) + class func preloadTextureAtlases(_ textureAtlases: [SKTextureAtlas]) async @available(iOS 9.0, *) class func preloadTextureAtlasesNamed(_ atlasNames: [String], withCompletionHandler completionHandler: @escaping (Error?, [SKTextureAtlas]) -> Void) + @available(iOS 9.0, *) + class func preloadTextureAtlasesNamed(_ atlasNames: [String]) async throws -> [SKTextureAtlas] func preload(completionHandler: @escaping () -> Void) + func preload() async var textureNames: [String] { get } } diff --git a/iOS/StoreKit/SKCloudServiceController.swift b/iOS/StoreKit/SKCloudServiceController.swift index 2d21aa5..29642de 100644 --- a/iOS/StoreKit/SKCloudServiceController.swift +++ b/iOS/StoreKit/SKCloudServiceController.swift @@ -25,14 +25,24 @@ class SKCloudServiceController : NSObject { class func requestAuthorization(_ handler: @escaping (SKCloudServiceAuthorizationStatus) -> Void) @available(iOS 9.3, *) func requestCapabilities(completionHandler: @escaping (SKCloudServiceCapability, Error?) -> Void) + @available(iOS 9.3, *) + func requestCapabilities() async throws -> SKCloudServiceCapability @available(iOS 11.0, *) func requestStorefrontCountryCode(completionHandler: @escaping (String?, Error?) -> Void) + @available(iOS 11.0, *) + func requestStorefrontCountryCode() async throws -> String? @available(iOS 9.3, *) func requestStorefrontIdentifier(completionHandler: @escaping (String?, Error?) -> Void) + @available(iOS 9.3, *) + func requestStorefrontIdentifier() async throws -> String? @available(iOS 11.0, *) func requestUserToken(forDeveloperToken developerToken: String, completionHandler: @escaping (String?, Error?) -> Void) + @available(iOS 11.0, *) + func requestUserToken(forDeveloperToken developerToken: String) async throws -> String? @available(iOS, introduced: 10.3, deprecated: 11.0) func requestPersonalizationToken(forClientToken clientToken: String, withCompletionHandler completionHandler: @escaping (String?, Error?) -> Void) + @available(iOS, introduced: 10.3, deprecated: 11.0) + func requestPersonalizationToken(forClientToken clientToken: String) async throws -> String? } extension NSNotification.Name { @available(iOS 9.3, *) diff --git a/iOS/StoreKit/SKCloudServiceSetupViewController.swift b/iOS/StoreKit/SKCloudServiceSetupViewController.swift index ee775ff..39f3fa3 100644 --- a/iOS/StoreKit/SKCloudServiceSetupViewController.swift +++ b/iOS/StoreKit/SKCloudServiceSetupViewController.swift @@ -20,10 +20,12 @@ class SKCloudServiceSetupViewController : UIViewController { weak var delegate: @sil_weak SKCloudServiceSetupViewControllerDelegate? @available(iOS 10.1, *) func load(options: [SKCloudServiceSetupOptionsKey : Any] = [:], completionHandler: ((Bool, Error?) -> Void)? = nil) + @available(iOS 10.1, *) + func load(options: [SKCloudServiceSetupOptionsKey : Any] = [:]) async throws -> Bool } protocol SKCloudServiceSetupViewControllerDelegate : NSObjectProtocol { @available(iOS 10.1, *) - optional func cloudServiceSetupViewControllerDidDismiss(_ cloudServiceSetupViewController: SKCloudServiceSetupViewController) + @asyncHandler optional func cloudServiceSetupViewControllerDidDismiss(_ cloudServiceSetupViewController: SKCloudServiceSetupViewController) } extension SKCloudServiceSetupOptionsKey { @available(iOS 10.1, *) diff --git a/iOS/StoreKit/SKOverlay.swift b/iOS/StoreKit/SKOverlay.swift index 32b0b0a..b9d191c 100644 --- a/iOS/StoreKit/SKOverlay.swift +++ b/iOS/StoreKit/SKOverlay.swift @@ -1,11 +1,11 @@ @available(iOS 14.0, *) protocol SKOverlayDelegate : NSObjectProtocol { - optional func storeOverlayDidFailToLoad(_ overlay: SKOverlay, error: Error) + @asyncHandler optional func storeOverlayDidFailToLoad(_ overlay: SKOverlay, error: Error) optional func storeOverlayWillStartPresentation(_ overlay: SKOverlay, transitionContext: SKOverlay.TransitionContext) - optional func storeOverlayDidFinishPresentation(_ overlay: SKOverlay, transitionContext: SKOverlay.TransitionContext) + @asyncHandler optional func storeOverlayDidFinishPresentation(_ overlay: SKOverlay, transitionContext: SKOverlay.TransitionContext) optional func storeOverlayWillStartDismissal(_ overlay: SKOverlay, transitionContext: SKOverlay.TransitionContext) - optional func storeOverlayDidFinishDismissal(_ overlay: SKOverlay, transitionContext: SKOverlay.TransitionContext) + @asyncHandler optional func storeOverlayDidFinishDismissal(_ overlay: SKOverlay, transitionContext: SKOverlay.TransitionContext) } @available(iOS 14.0, *) class SKOverlay : NSObject { diff --git a/iOS/StoreKit/SKPaymentQueue.swift b/iOS/StoreKit/SKPaymentQueue.swift index a91e4ca..b934994 100644 --- a/iOS/StoreKit/SKPaymentQueue.swift +++ b/iOS/StoreKit/SKPaymentQueue.swift @@ -58,7 +58,7 @@ protocol SKPaymentTransactionObserver : NSObjectProtocol { @available(iOS 11.0, *) optional func paymentQueue(_ queue: SKPaymentQueue, shouldAddStorePayment payment: SKPayment, for product: SKProduct) -> Bool @available(iOS 13.0, *) - optional func paymentQueueDidChangeStorefront(_ queue: SKPaymentQueue) + @asyncHandler optional func paymentQueueDidChangeStorefront(_ queue: SKPaymentQueue) @available(iOS 14.0, *) - optional func paymentQueue(_ queue: SKPaymentQueue, didRevokeEntitlementsForProductIdentifiers productIdentifiers: [String]) + @asyncHandler optional func paymentQueue(_ queue: SKPaymentQueue, didRevokeEntitlementsForProductIdentifiers productIdentifiers: [String]) } diff --git a/iOS/StoreKit/SKProductStorePromotionController.swift b/iOS/StoreKit/SKProductStorePromotionController.swift index 22d4953..ca1e767 100644 --- a/iOS/StoreKit/SKProductStorePromotionController.swift +++ b/iOS/StoreKit/SKProductStorePromotionController.swift @@ -14,9 +14,17 @@ class SKProductStorePromotionController : NSObject { @available(iOS 11.0, *) func fetchStorePromotionVisibility(for product: SKProduct, completionHandler: ((SKProductStorePromotionVisibility, Error?) -> Void)? = nil) @available(iOS 11.0, *) + func fetchStorePromotionVisibility(for product: SKProduct) async throws -> SKProductStorePromotionVisibility + @available(iOS 11.0, *) func update(storePromotionVisibility promotionVisibility: SKProductStorePromotionVisibility, for product: SKProduct, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) + func update(storePromotionVisibility promotionVisibility: SKProductStorePromotionVisibility, for product: SKProduct) async throws + @available(iOS 11.0, *) func fetchStorePromotionOrder(completionHandler: (([SKProduct], Error?) -> Void)? = nil) @available(iOS 11.0, *) + func fetchStorePromotionOrder() async throws -> [SKProduct] + @available(iOS 11.0, *) func update(storePromotionOrder: [SKProduct], completionHandler: ((Error?) -> Void)? = nil) + @available(iOS 11.0, *) + func update(storePromotionOrder: [SKProduct]) async throws } diff --git a/iOS/StoreKit/SKProductsRequest.swift b/iOS/StoreKit/SKProductsRequest.swift index 30e0102..0272e9a 100644 --- a/iOS/StoreKit/SKProductsRequest.swift +++ b/iOS/StoreKit/SKProductsRequest.swift @@ -1,7 +1,7 @@ protocol SKProductsRequestDelegate : SKRequestDelegate { @available(iOS 3.0, *) - func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) + @asyncHandler func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) } @available(iOS 3.0, *) class SKProductsRequest : SKRequest { diff --git a/iOS/StoreKit/SKRequest.swift b/iOS/StoreKit/SKRequest.swift index d03cc50..6a80961 100644 --- a/iOS/StoreKit/SKRequest.swift +++ b/iOS/StoreKit/SKRequest.swift @@ -10,7 +10,7 @@ class SKRequest : NSObject { } protocol SKRequestDelegate : NSObjectProtocol { @available(iOS 3.0, *) - optional func requestDidFinish(_ request: SKRequest) + @asyncHandler optional func requestDidFinish(_ request: SKRequest) @available(iOS 3.0, *) - optional func request(_ request: SKRequest, didFailWithError error: Error) + @asyncHandler optional func request(_ request: SKRequest, didFailWithError error: Error) } diff --git a/iOS/StoreKit/SKStoreProductViewController.swift b/iOS/StoreKit/SKStoreProductViewController.swift index 762ab69..e61c013 100644 --- a/iOS/StoreKit/SKStoreProductViewController.swift +++ b/iOS/StoreKit/SKStoreProductViewController.swift @@ -8,7 +8,7 @@ class SKStoreProductViewController : UIViewController { } protocol SKStoreProductViewControllerDelegate : NSObjectProtocol { @available(iOS 6.0, *) - optional func productViewControllerDidFinish(_ viewController: SKStoreProductViewController) + @asyncHandler optional func productViewControllerDidFinish(_ viewController: SKStoreProductViewController) } @available(iOS 6.0, *) let SKStoreProductParameterITunesItemIdentifier: String diff --git a/iOS/UIKit/NSLayoutManager.swift b/iOS/UIKit/NSLayoutManager.swift index 9266788..2397962 100644 --- a/iOS/UIKit/NSLayoutManager.swift +++ b/iOS/UIKit/NSLayoutManager.swift @@ -157,11 +157,11 @@ protocol NSLayoutManagerDelegate : NSObjectProtocol { @available(iOS 9.0, *) optional func layoutManager(_ layoutManager: NSLayoutManager, shouldSetLineFragmentRect lineFragmentRect: UnsafeMutablePointer, lineFragmentUsedRect: UnsafeMutablePointer, baselineOffset: UnsafeMutablePointer, in textContainer: NSTextContainer, forGlyphRange glyphRange: NSRange) -> Bool @available(iOS 7.0, *) - optional func layoutManagerDidInvalidateLayout(_ sender: NSLayoutManager) + @asyncHandler optional func layoutManagerDidInvalidateLayout(_ sender: NSLayoutManager) @available(iOS 7.0, *) - optional func layoutManager(_ layoutManager: NSLayoutManager, didCompleteLayoutFor textContainer: NSTextContainer?, atEnd layoutFinishedFlag: Bool) + @asyncHandler optional func layoutManager(_ layoutManager: NSLayoutManager, didCompleteLayoutFor textContainer: NSTextContainer?, atEnd layoutFinishedFlag: Bool) @available(iOS 7.0, *) - optional func layoutManager(_ layoutManager: NSLayoutManager, textContainer: NSTextContainer, didChangeGeometryFrom oldSize: CGSize) + @asyncHandler optional func layoutManager(_ layoutManager: NSLayoutManager, textContainer: NSTextContainer, didChangeGeometryFrom oldSize: CGSize) } @available(iOS, introduced: 7.0, deprecated: 9.0, message: "Use NSControlCharacterActionZeroAdvancement instead") var NSControlCharacterZeroAdvancementAction: Int { get } diff --git a/iOS/UIKit/NSTextStorage.swift b/iOS/UIKit/NSTextStorage.swift index dbb49e1..5087872 100644 --- a/iOS/UIKit/NSTextStorage.swift +++ b/iOS/UIKit/NSTextStorage.swift @@ -31,5 +31,5 @@ protocol NSTextStorageDelegate : NSObjectProtocol { @available(iOS 7.0, *) optional func textStorage(_ textStorage: NSTextStorage, willProcessEditing editedMask: NSTextStorage.EditActions, range editedRange: NSRange, changeInLength delta: Int) @available(iOS 7.0, *) - optional func textStorage(_ textStorage: NSTextStorage, didProcessEditing editedMask: NSTextStorage.EditActions, range editedRange: NSRange, changeInLength delta: Int) + @asyncHandler optional func textStorage(_ textStorage: NSTextStorage, didProcessEditing editedMask: NSTextStorage.EditActions, range editedRange: NSRange, changeInLength delta: Int) } diff --git a/iOS/UIKit/UIActionSheet.swift b/iOS/UIKit/UIActionSheet.swift index 56cd21e..d5b9262 100644 --- a/iOS/UIKit/UIActionSheet.swift +++ b/iOS/UIKit/UIActionSheet.swift @@ -42,9 +42,9 @@ protocol UIActionSheetDelegate : NSObjectProtocol { @available(iOS, introduced: 2.0, deprecated: 8.3, message: "Use UIAlertController instead.") optional func willPresent(_ actionSheet: UIActionSheet) @available(iOS, introduced: 2.0, deprecated: 8.3, message: "Use UIAlertController instead.") - optional func didPresent(_ actionSheet: UIActionSheet) + @asyncHandler optional func didPresent(_ actionSheet: UIActionSheet) @available(iOS, introduced: 2.0, deprecated: 8.3, message: "Use UIAlertController instead.") optional func actionSheet(_ actionSheet: UIActionSheet, willDismissWithButtonIndex buttonIndex: Int) @available(iOS, introduced: 2.0, deprecated: 8.3, message: "Use UIAlertController instead.") - optional func actionSheet(_ actionSheet: UIActionSheet, didDismissWithButtonIndex buttonIndex: Int) + @asyncHandler optional func actionSheet(_ actionSheet: UIActionSheet, didDismissWithButtonIndex buttonIndex: Int) } diff --git a/iOS/UIKit/UIAlertView.swift b/iOS/UIKit/UIAlertView.swift index 3621258..cc6677d 100644 --- a/iOS/UIKit/UIAlertView.swift +++ b/iOS/UIKit/UIAlertView.swift @@ -38,11 +38,11 @@ protocol UIAlertViewDelegate : NSObjectProtocol { @available(iOS, introduced: 2.0, deprecated: 9.0, message: "Use UIAlertController instead.") optional func willPresent(_ alertView: UIAlertView) @available(iOS, introduced: 2.0, deprecated: 9.0, message: "Use UIAlertController instead.") - optional func didPresent(_ alertView: UIAlertView) + @asyncHandler optional func didPresent(_ alertView: UIAlertView) @available(iOS, introduced: 2.0, deprecated: 9.0, message: "Use UIAlertController instead.") optional func alertView(_ alertView: UIAlertView, willDismissWithButtonIndex buttonIndex: Int) @available(iOS, introduced: 2.0, deprecated: 9.0, message: "Use UIAlertController instead.") - optional func alertView(_ alertView: UIAlertView, didDismissWithButtonIndex buttonIndex: Int) + @asyncHandler optional func alertView(_ alertView: UIAlertView, didDismissWithButtonIndex buttonIndex: Int) @available(iOS, introduced: 2.0, deprecated: 9.0, message: "Use UIAlertController instead.") optional func alertViewShouldEnableFirstOtherButton(_ alertView: UIAlertView) -> Bool } diff --git a/iOS/UIKit/UIApplication.swift b/iOS/UIKit/UIApplication.swift index 40c639f..7a79fa8 100644 --- a/iOS/UIKit/UIApplication.swift +++ b/iOS/UIKit/UIApplication.swift @@ -93,6 +93,8 @@ class UIApplication : UIResponder { func canOpenURL(_ url: URL) -> Bool @available(iOS 10.0, *) func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:], completionHandler completion: ((Bool) -> Void)? = nil) + @available(iOS 10.0, *) + func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:]) async -> Bool func sendEvent(_ event: UIEvent) @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Should not be used for applications that support multiple scenes as it returns a key window across all connected scenes") var keyWindow: UIWindow? { get } @@ -198,6 +200,8 @@ extension UIApplication { @available(iOS 10.3, *) func setAlternateIconName(_ alternateIconName: String?, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 10.3, *) + func setAlternateIconName(_ alternateIconName: String?) async throws + @available(iOS 10.3, *) var alternateIconName: String? { get } } extension UIApplication { @@ -280,13 +284,13 @@ extension UIApplication { } protocol UIApplicationDelegate : NSObjectProtocol { @available(iOS 2.0, *) - optional func applicationDidFinishLaunching(_ application: UIApplication) + @asyncHandler optional func applicationDidFinishLaunching(_ application: UIApplication) @available(iOS 6.0, *) optional func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool @available(iOS 3.0, *) optional func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool @available(iOS 2.0, *) - optional func applicationDidBecomeActive(_ application: UIApplication) + @asyncHandler optional func applicationDidBecomeActive(_ application: UIApplication) @available(iOS 2.0, *) optional func applicationWillResignActive(_ application: UIApplication) @available(iOS, introduced: 2.0, deprecated: 9.0) @@ -296,7 +300,7 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(iOS 9.0, *) optional func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool @available(iOS 2.0, *) - optional func applicationDidReceiveMemoryWarning(_ application: UIApplication) + @asyncHandler optional func applicationDidReceiveMemoryWarning(_ application: UIApplication) @available(iOS 2.0, *) optional func applicationWillTerminate(_ application: UIApplication) @available(iOS 2.0, *) @@ -304,49 +308,65 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use viewWillTransitionToSize:withTransitionCoordinator: instead.") optional func application(_ application: UIApplication, willChangeStatusBarOrientation newStatusBarOrientation: UIInterfaceOrientation, duration: TimeInterval) @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use viewWillTransitionToSize:withTransitionCoordinator: instead.") - optional func application(_ application: UIApplication, didChangeStatusBarOrientation oldStatusBarOrientation: UIInterfaceOrientation) + @asyncHandler optional func application(_ application: UIApplication, didChangeStatusBarOrientation oldStatusBarOrientation: UIInterfaceOrientation) @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use viewWillTransitionToSize:withTransitionCoordinator: instead.") optional func application(_ application: UIApplication, willChangeStatusBarFrame newStatusBarFrame: CGRect) @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use viewWillTransitionToSize:withTransitionCoordinator: instead.") - optional func application(_ application: UIApplication, didChangeStatusBarFrame oldStatusBarFrame: CGRect) + @asyncHandler optional func application(_ application: UIApplication, didChangeStatusBarFrame oldStatusBarFrame: CGRect) @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenter requestAuthorizationWithOptions:completionHandler:]") - optional func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings) + @asyncHandler optional func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings) @available(iOS 3.0, *) - optional func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) + @asyncHandler optional func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) @available(iOS 3.0, *) - optional func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) + @asyncHandler optional func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) @available(iOS, introduced: 3.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate willPresentNotification:withCompletionHandler:] or -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:] for user visible notifications and -[UIApplicationDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:] for silent remote notifications") - optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) + @asyncHandler optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) @available(iOS, introduced: 4.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate willPresentNotification:withCompletionHandler:] or -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]") - optional func application(_ application: UIApplication, didReceive notification: UILocalNotification) + @asyncHandler optional func application(_ application: UIApplication, didReceive notification: UILocalNotification) @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]") optional func application(_ application: UIApplication, handleActionWithIdentifier identifier: String?, for notification: UILocalNotification, completionHandler: @escaping () -> Void) + @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]") + optional func application(_ application: UIApplication, handleActionWithIdentifier identifier: String?, for notification: UILocalNotification) async @available(iOS, introduced: 9.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]") optional func application(_ application: UIApplication, handleActionWithIdentifier identifier: String?, forRemoteNotification userInfo: [AnyHashable : Any], withResponseInfo responseInfo: [AnyHashable : Any], completionHandler: @escaping () -> Void) + @available(iOS, introduced: 9.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]") + optional func application(_ application: UIApplication, handleActionWithIdentifier identifier: String?, forRemoteNotification userInfo: [AnyHashable : Any], withResponseInfo responseInfo: [AnyHashable : Any]) async @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]") optional func application(_ application: UIApplication, handleActionWithIdentifier identifier: String?, forRemoteNotification userInfo: [AnyHashable : Any], completionHandler: @escaping () -> Void) + @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]") + optional func application(_ application: UIApplication, handleActionWithIdentifier identifier: String?, forRemoteNotification userInfo: [AnyHashable : Any]) async @available(iOS, introduced: 9.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]") optional func application(_ application: UIApplication, handleActionWithIdentifier identifier: String?, for notification: UILocalNotification, withResponseInfo responseInfo: [AnyHashable : Any], completionHandler: @escaping () -> Void) + @available(iOS, introduced: 9.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]") + optional func application(_ application: UIApplication, handleActionWithIdentifier identifier: String?, for notification: UILocalNotification, withResponseInfo responseInfo: [AnyHashable : Any]) async + @available(iOS 7.0, *) + @asyncHandler optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) @available(iOS 7.0, *) - optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) + optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) async -> UIBackgroundFetchResult @available(iOS, introduced: 7.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead") optional func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) + @available(iOS, introduced: 7.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead") + optional func application(_ application: UIApplication) async -> UIBackgroundFetchResult @available(iOS 9.0, *) optional func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) + @available(iOS 9.0, *) + optional func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem) async -> Bool @available(iOS 7.0, *) optional func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) + @available(iOS 7.0, *) + optional func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String) async @available(iOS 8.2, *) optional func application(_ application: UIApplication, handleWatchKitExtensionRequest userInfo: [AnyHashable : Any]?, reply: @escaping ([AnyHashable : Any]?) -> Void) @available(iOS 9.0, *) optional func applicationShouldRequestHealthAuthorization(_ application: UIApplication) @available(iOS 4.0, *) - optional func applicationDidEnterBackground(_ application: UIApplication) + @asyncHandler optional func applicationDidEnterBackground(_ application: UIApplication) @available(iOS 4.0, *) optional func applicationWillEnterForeground(_ application: UIApplication) @available(iOS 4.0, *) optional func applicationProtectedDataWillBecomeUnavailable(_ application: UIApplication) @available(iOS 4.0, *) - optional func applicationProtectedDataDidBecomeAvailable(_ application: UIApplication) + @asyncHandler optional func applicationProtectedDataDidBecomeAvailable(_ application: UIApplication) @available(iOS 5.0, *) optional var window: UIWindow? { get set } @available(iOS 6.0, *) @@ -362,7 +382,7 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(iOS 6.0, *) optional func application(_ application: UIApplication, willEncodeRestorableStateWith coder: NSCoder) @available(iOS 6.0, *) - optional func application(_ application: UIApplication, didDecodeRestorableStateWith coder: NSCoder) + @asyncHandler optional func application(_ application: UIApplication, didDecodeRestorableStateWith coder: NSCoder) @available(iOS, introduced: 6.0, deprecated: 13.2, message: "Use application:shouldSaveSecureApplicationState: instead") optional func application(_ application: UIApplication, shouldSaveApplicationState coder: NSCoder) -> Bool @available(iOS, introduced: 6.0, deprecated: 13.2, message: "Use application:shouldRestoreSecureApplicationState: instead") @@ -372,13 +392,13 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(iOS 8.0, *) optional func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool @available(iOS 8.0, *) - optional func application(_ application: UIApplication, didFailToContinueUserActivityWithType userActivityType: String, error: Error) + @asyncHandler optional func application(_ application: UIApplication, didFailToContinueUserActivityWithType userActivityType: String, error: Error) @available(iOS 8.0, *) - optional func application(_ application: UIApplication, didUpdate userActivity: NSUserActivity) + @asyncHandler optional func application(_ application: UIApplication, didUpdate userActivity: NSUserActivity) @available(iOS 13.0, *) optional func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration @available(iOS 13.0, *) - optional func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) + @asyncHandler optional func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) } extension UIApplicationDelegate { diff --git a/iOS/UIKit/UICloudSharingController.swift b/iOS/UIKit/UICloudSharingController.swift index ab9f943..b7fea79 100644 --- a/iOS/UIKit/UICloudSharingController.swift +++ b/iOS/UIKit/UICloudSharingController.swift @@ -20,9 +20,9 @@ protocol UICloudSharingControllerDelegate : NSObjectProtocol { @available(iOS 10.0, *) optional func itemType(for csc: UICloudSharingController) -> String? @available(iOS 10.0, *) - optional func cloudSharingControllerDidSaveShare(_ csc: UICloudSharingController) + @asyncHandler optional func cloudSharingControllerDidSaveShare(_ csc: UICloudSharingController) @available(iOS 10.0, *) - optional func cloudSharingControllerDidStopSharing(_ csc: UICloudSharingController) + @asyncHandler optional func cloudSharingControllerDidStopSharing(_ csc: UICloudSharingController) } @available(iOS 10.0, *) class UICloudSharingController : UIViewController { diff --git a/iOS/UIKit/UICollectionView.swift b/iOS/UIKit/UICollectionView.swift index 6870750..c0047f0 100644 --- a/iOS/UIKit/UICollectionView.swift +++ b/iOS/UIKit/UICollectionView.swift @@ -53,25 +53,25 @@ protocol UICollectionViewDelegate : UIScrollViewDelegate { @available(iOS 6.0, *) optional func collectionView(_ collectionView: UICollectionView, shouldHighlightItemAt indexPath: IndexPath) -> Bool @available(iOS 6.0, *) - optional func collectionView(_ collectionView: UICollectionView, didHighlightItemAt indexPath: IndexPath) + @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didHighlightItemAt indexPath: IndexPath) @available(iOS 6.0, *) - optional func collectionView(_ collectionView: UICollectionView, didUnhighlightItemAt indexPath: IndexPath) + @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didUnhighlightItemAt indexPath: IndexPath) @available(iOS 6.0, *) optional func collectionView(_ collectionView: UICollectionView, shouldSelectItemAt indexPath: IndexPath) -> Bool @available(iOS 6.0, *) optional func collectionView(_ collectionView: UICollectionView, shouldDeselectItemAt indexPath: IndexPath) -> Bool @available(iOS 6.0, *) - optional func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) + @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) @available(iOS 6.0, *) - optional func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) + @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) @available(iOS 8.0, *) optional func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) @available(iOS 8.0, *) optional func collectionView(_ collectionView: UICollectionView, willDisplaySupplementaryView view: UICollectionReusableView, forElementKind elementKind: String, at indexPath: IndexPath) @available(iOS 6.0, *) - optional func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) + @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) @available(iOS 6.0, *) - optional func collectionView(_ collectionView: UICollectionView, didEndDisplayingSupplementaryView view: UICollectionReusableView, forElementOfKind elementKind: String, at indexPath: IndexPath) + @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didEndDisplayingSupplementaryView view: UICollectionReusableView, forElementOfKind elementKind: String, at indexPath: IndexPath) @available(iOS, introduced: 6.0, deprecated: 13.0) optional func collectionView(_ collectionView: UICollectionView, shouldShowMenuForItemAt indexPath: IndexPath) -> Bool @available(iOS, introduced: 6.0, deprecated: 13.0) @@ -85,7 +85,7 @@ protocol UICollectionViewDelegate : UIScrollViewDelegate { @available(iOS 9.0, *) optional func collectionView(_ collectionView: UICollectionView, shouldUpdateFocusIn context: UICollectionViewFocusUpdateContext) -> Bool @available(iOS 9.0, *) - optional func collectionView(_ collectionView: UICollectionView, didUpdateFocusIn context: UICollectionViewFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) + @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didUpdateFocusIn context: UICollectionViewFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) @available(iOS 9.0, *) optional func indexPathForPreferredFocusedView(in collectionView: UICollectionView) -> IndexPath? @available(iOS 9.0, *) @@ -99,9 +99,9 @@ protocol UICollectionViewDelegate : UIScrollViewDelegate { @available(iOS 13.0, *) optional func collectionView(_ collectionView: UICollectionView, shouldBeginMultipleSelectionInteractionAt indexPath: IndexPath) -> Bool @available(iOS 13.0, *) - optional func collectionView(_ collectionView: UICollectionView, didBeginMultipleSelectionInteractionAt indexPath: IndexPath) + @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didBeginMultipleSelectionInteractionAt indexPath: IndexPath) @available(iOS 13.0, *) - optional func collectionViewDidEndMultipleSelectionInteraction(_ collectionView: UICollectionView) + @asyncHandler optional func collectionViewDidEndMultipleSelectionInteraction(_ collectionView: UICollectionView) @available(iOS 13.0, *) optional func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? @available(iOS 13.0, *) @@ -155,6 +155,8 @@ class UICollectionView : UIScrollView, UIDataSourceTranslating { @available(iOS 7.0, *) func setCollectionViewLayout(_ layout: UICollectionViewLayout, animated: Bool, completion: ((Bool) -> Void)? = nil) @available(iOS 7.0, *) + func setCollectionViewLayout(_ layout: UICollectionViewLayout, animated: Bool) async -> Bool + @available(iOS 7.0, *) func startInteractiveTransition(to layout: UICollectionViewLayout, completion: UICollectionView.LayoutInteractiveTransitionCompletion? = nil) -> UICollectionViewTransitionLayout @available(iOS 7.0, *) func finishInteractiveTransition() @@ -185,6 +187,7 @@ class UICollectionView : UIScrollView, UIDataSourceTranslating { func reloadItems(at indexPaths: [IndexPath]) func moveItem(at indexPath: IndexPath, to newIndexPath: IndexPath) func performBatchUpdates(_ updates: (() -> Void)?, completion: ((Bool) -> Void)? = nil) + func performBatchUpdates(_ updates: (() -> Void)?) async -> Bool @available(iOS 9.0, *) func beginInteractiveMovementForItem(at indexPath: IndexPath) -> Bool @available(iOS 9.0, *) diff --git a/iOS/UIKit/UIColorPickerViewController.swift b/iOS/UIKit/UIColorPickerViewController.swift index a015f5f..16c99d9 100644 --- a/iOS/UIKit/UIColorPickerViewController.swift +++ b/iOS/UIKit/UIColorPickerViewController.swift @@ -1,8 +1,8 @@ @available(iOS 14.0, *) protocol UIColorPickerViewControllerDelegate : NSObjectProtocol { - optional func colorPickerViewControllerDidSelectColor(_ viewController: UIColorPickerViewController) - optional func colorPickerViewControllerDidFinish(_ viewController: UIColorPickerViewController) + @asyncHandler optional func colorPickerViewControllerDidSelectColor(_ viewController: UIColorPickerViewController) + @asyncHandler optional func colorPickerViewControllerDidFinish(_ viewController: UIColorPickerViewController) } @available(iOS 14.0, *) class UIColorPickerViewController : UIViewController { diff --git a/iOS/UIKit/UIContextMenuInteraction.swift b/iOS/UIKit/UIContextMenuInteraction.swift index 6af9530..a8d8f89 100644 --- a/iOS/UIKit/UIContextMenuInteraction.swift +++ b/iOS/UIKit/UIContextMenuInteraction.swift @@ -32,6 +32,7 @@ protocol UIContextMenuInteractionAnimating : NSObjectProtocol { var previewViewController: UIViewController? { get } func addAnimations(_ animations: @escaping () -> Void) func addCompletion(_ completion: @escaping () -> Void) + func addCompletion() async } @available(iOS 13.0, *) protocol UIContextMenuInteractionCommitAnimating : UIContextMenuInteractionAnimating { diff --git a/iOS/UIKit/UIDiffableDataSource.swift b/iOS/UIKit/UIDiffableDataSource.swift index 92e9fca..c06eacf 100644 --- a/iOS/UIKit/UIDiffableDataSource.swift +++ b/iOS/UIKit/UIDiffableDataSource.swift @@ -64,6 +64,7 @@ class UICollectionViewDiffableDataSourceReference : NSObject, UICollectionViewDa func snapshot() -> NSDiffableDataSourceSnapshotReference func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool, completion: (() -> Void)? = nil) + func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async func itemIdentifier(for indexPath: IndexPath) -> Any? func indexPath(forItemIdentifier identifier: Any) -> IndexPath? @available(iOS 14.0, *) @@ -73,6 +74,8 @@ class UICollectionViewDiffableDataSourceReference : NSObject, UICollectionViewDa @available(iOS 14.0, *) func applySnapshot(_ snapshot: NSDiffableDataSourceSectionSnapshotReference, toSection sectionIdentifier: Any, animatingDifferences: Bool, completion: (() -> Void)? = nil) @available(iOS 14.0, *) + func applySnapshot(_ snapshot: NSDiffableDataSourceSectionSnapshotReference, toSection sectionIdentifier: Any, animatingDifferences: Bool) async + @available(iOS 14.0, *) func snapshot(forSection section: Any) -> NSDiffableDataSourceSectionSnapshotReference @available(iOS 14.0, *) @NSCopying var sectionSnapshotHandlers: __UICollectionViewDiffableDataSourceSectionSnapshotHandlers @@ -84,6 +87,7 @@ class UITableViewDiffableDataSourceReference : NSObject, UITableViewDataSource { func snapshot() -> NSDiffableDataSourceSnapshotReference func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool, completion: (() -> Void)? = nil) + func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async func itemIdentifier(for indexPath: IndexPath) -> Any? func indexPath(forItemIdentifier identifier: Any) -> IndexPath? var defaultRowAnimation: UITableView.RowAnimation diff --git a/iOS/UIKit/UIDocument.swift b/iOS/UIKit/UIDocument.swift index 4222389..76c25e3 100644 --- a/iOS/UIKit/UIDocument.swift +++ b/iOS/UIKit/UIDocument.swift @@ -8,7 +8,9 @@ class UIDocument : NSObject, NSFilePresenter, ProgressReporting { var fileModificationDate: Date? var documentState: UIDocument.State { get } func open(completionHandler: ((Bool) -> Void)? = nil) + func open() async -> Bool func close(completionHandler: ((Bool) -> Void)? = nil) + func close() async -> Bool func load(fromContents contents: Any, ofType typeName: String?) throws func contents(forType typeName: String) throws -> Any func disableEditing() @@ -19,7 +21,9 @@ class UIDocument : NSObject, NSFilePresenter, ProgressReporting { func changeCountToken(for saveOperation: UIDocument.SaveOperation) -> Any func updateChangeCount(withToken changeCountToken: Any, for saveOperation: UIDocument.SaveOperation) func save(to url: URL, for saveOperation: UIDocument.SaveOperation, completionHandler: ((Bool) -> Void)? = nil) + func save(to url: URL, for saveOperation: UIDocument.SaveOperation) async -> Bool func autosave(completionHandler: ((Bool) -> Void)? = nil) + func autosave() async -> Bool var savingFileType: String? { get } func fileNameExtension(forType typeName: String?, saveOperation: UIDocument.SaveOperation) -> String func writeContents(_ contents: Any, andAttributes additionalFileAttributes: [AnyHashable : Any]? = nil, safelyTo url: URL, for saveOperation: UIDocument.SaveOperation) throws @@ -31,6 +35,7 @@ class UIDocument : NSObject, NSFilePresenter, ProgressReporting { func finishedHandlingError(_ error: Error, recovered: Bool) func userInteractionNoLongerPermitted(forError error: Error) func revert(toContentsOf url: URL, completionHandler: ((Bool) -> Void)? = nil) + func revert(toContentsOf url: URL) async -> Bool } extension UIDocument { @available(iOS 8.0, *) diff --git a/iOS/UIKit/UIDocumentBrowserViewController.swift b/iOS/UIKit/UIDocumentBrowserViewController.swift index 896ead6..2d83782 100644 --- a/iOS/UIKit/UIDocumentBrowserViewController.swift +++ b/iOS/UIKit/UIDocumentBrowserViewController.swift @@ -44,7 +44,9 @@ class UIDocumentBrowserViewController : UIViewController, NSCoding { var additionalLeadingNavigationBarButtonItems: [UIBarButtonItem] var additionalTrailingNavigationBarButtonItems: [UIBarButtonItem] func revealDocument(at url: URL, importIfNeeded: Bool, completion: ((URL?, Error?) -> Void)? = nil) + func revealDocument(at url: URL, importIfNeeded: Bool) async throws -> URL? func importDocument(at documentURL: URL, nextToDocumentAt neighbourURL: URL, mode importMode: UIDocumentBrowserViewController.ImportMode, completionHandler completion: @escaping (URL?, Error?) -> Void) + func importDocument(at documentURL: URL, nextToDocumentAt neighbourURL: URL, mode importMode: UIDocumentBrowserViewController.ImportMode) async throws -> URL? @available(iOS 12.0, *) func transitionController(forDocumentAt documentURL: URL) -> UIDocumentBrowserTransitionController @available(iOS, introduced: 11.0, deprecated: 12.0) @@ -59,11 +61,11 @@ class UIDocumentBrowserViewController : UIViewController, NSCoding { @available(iOS 11.0, *) protocol UIDocumentBrowserViewControllerDelegate : NSObjectProtocol { @available(iOS, introduced: 11.0, deprecated: 12.0) - optional func documentBrowser(_ controller: UIDocumentBrowserViewController, didPickDocumentURLs documentURLs: [URL]) + @asyncHandler optional func documentBrowser(_ controller: UIDocumentBrowserViewController, didPickDocumentURLs documentURLs: [URL]) @available(iOS 12.0, *) - optional func documentBrowser(_ controller: UIDocumentBrowserViewController, didPickDocumentsAt documentURLs: [URL]) - optional func documentBrowser(_ controller: UIDocumentBrowserViewController, didRequestDocumentCreationWithHandler importHandler: @escaping (URL?, UIDocumentBrowserViewController.ImportMode) -> Void) - optional func documentBrowser(_ controller: UIDocumentBrowserViewController, didImportDocumentAt sourceURL: URL, toDestinationURL destinationURL: URL) + @asyncHandler optional func documentBrowser(_ controller: UIDocumentBrowserViewController, didPickDocumentsAt documentURLs: [URL]) + @asyncHandler optional func documentBrowser(_ controller: UIDocumentBrowserViewController, didRequestDocumentCreationWithHandler importHandler: @escaping (URL?, UIDocumentBrowserViewController.ImportMode) -> Void) + @asyncHandler optional func documentBrowser(_ controller: UIDocumentBrowserViewController, didImportDocumentAt sourceURL: URL, toDestinationURL destinationURL: URL) optional func documentBrowser(_ controller: UIDocumentBrowserViewController, failedToImportDocumentAt documentURL: URL, error: Error?) optional func documentBrowser(_ controller: UIDocumentBrowserViewController, applicationActivitiesForDocumentURLs documentURLs: [URL]) -> [UIActivity] optional func documentBrowser(_ controller: UIDocumentBrowserViewController, willPresent activityViewController: UIActivityViewController) diff --git a/iOS/UIKit/UIDocumentInteractionController.swift b/iOS/UIKit/UIDocumentInteractionController.swift index 6c00a5b..5a73bfd 100644 --- a/iOS/UIKit/UIDocumentInteractionController.swift +++ b/iOS/UIKit/UIDocumentInteractionController.swift @@ -23,11 +23,11 @@ protocol UIDocumentInteractionControllerDelegate : NSObjectProtocol { optional func documentInteractionControllerRectForPreview(_ controller: UIDocumentInteractionController) -> CGRect optional func documentInteractionControllerViewForPreview(_ controller: UIDocumentInteractionController) -> UIView? optional func documentInteractionControllerWillBeginPreview(_ controller: UIDocumentInteractionController) - optional func documentInteractionControllerDidEndPreview(_ controller: UIDocumentInteractionController) + @asyncHandler optional func documentInteractionControllerDidEndPreview(_ controller: UIDocumentInteractionController) optional func documentInteractionControllerWillPresentOptionsMenu(_ controller: UIDocumentInteractionController) - optional func documentInteractionControllerDidDismissOptionsMenu(_ controller: UIDocumentInteractionController) + @asyncHandler optional func documentInteractionControllerDidDismissOptionsMenu(_ controller: UIDocumentInteractionController) optional func documentInteractionControllerWillPresentOpenInMenu(_ controller: UIDocumentInteractionController) - optional func documentInteractionControllerDidDismissOpenInMenu(_ controller: UIDocumentInteractionController) + @asyncHandler optional func documentInteractionControllerDidDismissOpenInMenu(_ controller: UIDocumentInteractionController) optional func documentInteractionController(_ controller: UIDocumentInteractionController, willBeginSendingToApplication application: String?) - optional func documentInteractionController(_ controller: UIDocumentInteractionController, didEndSendingToApplication application: String?) + @asyncHandler optional func documentInteractionController(_ controller: UIDocumentInteractionController, didEndSendingToApplication application: String?) } diff --git a/iOS/UIKit/UIDocumentMenuViewController.swift b/iOS/UIKit/UIDocumentMenuViewController.swift index 830b965..82506df 100644 --- a/iOS/UIKit/UIDocumentMenuViewController.swift +++ b/iOS/UIKit/UIDocumentMenuViewController.swift @@ -8,7 +8,7 @@ enum UIDocumentMenuOrder : UInt { } @available(iOS, introduced: 8.0, deprecated: 13.0, message: "UIDocumentMenuDelegate is deprecated. Use UIDocumentPickerViewController directly.") protocol UIDocumentMenuDelegate : NSObjectProtocol { - func documentMenu(_ documentMenu: UIDocumentMenuViewController, didPickDocumentPicker documentPicker: UIDocumentPickerViewController) + @asyncHandler func documentMenu(_ documentMenu: UIDocumentMenuViewController, didPickDocumentPicker documentPicker: UIDocumentPickerViewController) optional func documentMenuWasCancelled(_ documentMenu: UIDocumentMenuViewController) } @available(iOS, introduced: 8.0, deprecated: 11.0, message: "UIDocumentMenuViewController is deprecated. Use UIDocumentPickerViewController directly.") diff --git a/iOS/UIKit/UIDocumentPickerViewController.swift b/iOS/UIKit/UIDocumentPickerViewController.swift index 3f756ed..cf75451 100644 --- a/iOS/UIKit/UIDocumentPickerViewController.swift +++ b/iOS/UIKit/UIDocumentPickerViewController.swift @@ -1,11 +1,11 @@ protocol UIDocumentPickerDelegate : NSObjectProtocol { @available(iOS 11.0, *) - optional func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) + @asyncHandler optional func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) @available(iOS 8.0, *) optional func documentPickerWasCancelled(_ controller: UIDocumentPickerViewController) @available(iOS, introduced: 8.0, deprecated: 11.0) - optional func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentAt url: URL) + @asyncHandler optional func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentAt url: URL) } @available(iOS, introduced: 8.0, deprecated: 14.0, message: "Use appropriate initializers instead") enum UIDocumentPickerMode : UInt { diff --git a/iOS/UIKit/UIDragInteraction.swift b/iOS/UIKit/UIDragInteraction.swift index a760272..c802eed 100644 --- a/iOS/UIKit/UIDragInteraction.swift +++ b/iOS/UIKit/UIDragInteraction.swift @@ -3,6 +3,7 @@ protocol UIDragAnimating : NSObjectProtocol { func addAnimations(_ animations: @escaping () -> Void) func addCompletion(_ completion: @escaping (UIViewAnimatingPosition) -> Void) + func addCompletion() async -> UIViewAnimatingPosition } @available(iOS 11.0, *) class UIDragInteraction : NSObject, UIInteraction { @@ -23,7 +24,7 @@ protocol UIDragInteractionDelegate : NSObjectProtocol { optional func dragInteraction(_ interaction: UIDragInteraction, prefersFullSizePreviewsFor session: UIDragSession) -> Bool optional func dragInteraction(_ interaction: UIDragInteraction, sessionDidMove session: UIDragSession) optional func dragInteraction(_ interaction: UIDragInteraction, session: UIDragSession, willEndWith operation: UIDropOperation) - optional func dragInteraction(_ interaction: UIDragInteraction, session: UIDragSession, didEndWith operation: UIDropOperation) + @asyncHandler optional func dragInteraction(_ interaction: UIDragInteraction, session: UIDragSession, didEndWith operation: UIDropOperation) optional func dragInteraction(_ interaction: UIDragInteraction, sessionDidTransferItems session: UIDragSession) optional func dragInteraction(_ interaction: UIDragInteraction, itemsForAddingTo session: UIDragSession, withTouchAt point: CGPoint) -> [UIDragItem] optional func dragInteraction(_ interaction: UIDragInteraction, sessionForAddingItems sessions: [UIDragSession], withTouchAt point: CGPoint) -> UIDragSession? diff --git a/iOS/UIKit/UIDynamicAnimator.swift b/iOS/UIKit/UIDynamicAnimator.swift index a7c9a34..40eebb5 100644 --- a/iOS/UIKit/UIDynamicAnimator.swift +++ b/iOS/UIKit/UIDynamicAnimator.swift @@ -3,7 +3,7 @@ protocol UIDynamicAnimatorDelegate : NSObjectProtocol { @available(iOS 7.0, *) optional func dynamicAnimatorWillResume(_ animator: UIDynamicAnimator) @available(iOS 7.0, *) - optional func dynamicAnimatorDidPause(_ animator: UIDynamicAnimator) + @asyncHandler optional func dynamicAnimatorDidPause(_ animator: UIDynamicAnimator) } @available(iOS 7.0, *) class UIDynamicAnimator : NSObject { diff --git a/iOS/UIKit/UIFocus.swift b/iOS/UIKit/UIFocus.swift index 983b31a..d2f2b53 100644 --- a/iOS/UIKit/UIFocus.swift +++ b/iOS/UIKit/UIFocus.swift @@ -26,7 +26,7 @@ protocol UIFocusEnvironment : NSObjectProtocol { func setNeedsFocusUpdate() func updateFocusIfNeeded() func shouldUpdateFocus(in context: UIFocusUpdateContext) -> Bool - func didUpdateFocus(in context: UIFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) + @asyncHandler func didUpdateFocus(in context: UIFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) @available(iOS, introduced: 9.0, deprecated: 10.0) weak optional var preferredFocusedView: @sil_weak UIView? { get } @available(iOS 14.0, *) @@ -44,7 +44,7 @@ protocol UIFocusItem : UIFocusEnvironment { @available(iOS 12.0, *) var frame: CGRect { get } @available(iOS 12.0, *) - optional func didHintFocusMovement(_ hint: UIFocusMovementHint) + @asyncHandler optional func didHintFocusMovement(_ hint: UIFocusMovementHint) } @available(iOS 11.0, tvOS 11.0, *) diff --git a/iOS/UIKit/UIFocusAnimationCoordinator.swift b/iOS/UIKit/UIFocusAnimationCoordinator.swift index 55d9169..f81caf5 100644 --- a/iOS/UIKit/UIFocusAnimationCoordinator.swift +++ b/iOS/UIKit/UIFocusAnimationCoordinator.swift @@ -6,8 +6,13 @@ protocol UIFocusAnimationContext : NSObjectProtocol { @available(iOS 9.0, *) class UIFocusAnimationCoordinator : NSObject { func addCoordinatedAnimations(_ animations: (() -> Void)?, completion: (() -> Void)? = nil) + func addCoordinatedAnimations(_ animations: (() -> Void)?) async @available(iOS 11.0, *) func addCoordinatedFocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?, completion: (() -> Void)? = nil) @available(iOS 11.0, *) + func addCoordinatedFocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?) async + @available(iOS 11.0, *) func addCoordinatedUnfocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?, completion: (() -> Void)? = nil) + @available(iOS 11.0, *) + func addCoordinatedUnfocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?) async } diff --git a/iOS/UIKit/UIFontPickerViewController.swift b/iOS/UIKit/UIFontPickerViewController.swift index 1626895..7860611 100644 --- a/iOS/UIKit/UIFontPickerViewController.swift +++ b/iOS/UIKit/UIFontPickerViewController.swift @@ -1,8 +1,8 @@ @available(iOS 13.0, *) protocol UIFontPickerViewControllerDelegate : NSObjectProtocol { - optional func fontPickerViewControllerDidCancel(_ viewController: UIFontPickerViewController) - optional func fontPickerViewControllerDidPickFont(_ viewController: UIFontPickerViewController) + @asyncHandler optional func fontPickerViewControllerDidCancel(_ viewController: UIFontPickerViewController) + @asyncHandler optional func fontPickerViewControllerDidPickFont(_ viewController: UIFontPickerViewController) } @available(iOS 13.0, *) class UIFontPickerViewController : UIViewController { diff --git a/iOS/UIKit/UIGuidedAccess.swift b/iOS/UIKit/UIGuidedAccess.swift index 67a6c75..78e4558 100644 --- a/iOS/UIKit/UIGuidedAccess.swift +++ b/iOS/UIKit/UIGuidedAccess.swift @@ -24,7 +24,7 @@ extension UIAccessibility { @available(iOS 7.0, *) protocol UIGuidedAccessRestrictionDelegate : NSObjectProtocol { var guidedAccessRestrictionIdentifiers: [String]? { get } - func guidedAccessRestriction(withIdentifier restrictionIdentifier: String, didChange newRestrictionState: UIAccessibility.GuidedAccessRestrictionState) + @asyncHandler func guidedAccessRestriction(withIdentifier restrictionIdentifier: String, didChange newRestrictionState: UIAccessibility.GuidedAccessRestrictionState) func textForGuidedAccessRestriction(withIdentifier restrictionIdentifier: String) -> String? optional func detailTextForGuidedAccessRestriction(withIdentifier restrictionIdentifier: String) -> String? } diff --git a/iOS/UIKit/UIImagePickerController.swift b/iOS/UIKit/UIImagePickerController.swift index cbcd5dd..7e90786 100644 --- a/iOS/UIKit/UIImagePickerController.swift +++ b/iOS/UIKit/UIImagePickerController.swift @@ -114,9 +114,9 @@ class UIImagePickerController : UINavigationController, NSCoding { } protocol UIImagePickerControllerDelegate : NSObjectProtocol { @available(iOS 2.0, *) - optional func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) + @asyncHandler optional func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) @available(iOS 2.0, *) - optional func imagePickerControllerDidCancel(_ picker: UIImagePickerController) + @asyncHandler optional func imagePickerControllerDidCancel(_ picker: UIImagePickerController) } func UIImageWriteToSavedPhotosAlbum(_ image: UIImage, _ completionTarget: Any?, _ completionSelector: Selector?, _ contextInfo: UnsafeMutableRawPointer?) @available(iOS 3.1, *) diff --git a/iOS/UIKit/UIIndirectScribbleInteraction.swift b/iOS/UIKit/UIIndirectScribbleInteraction.swift index 3654cef..3cc55f8 100644 --- a/iOS/UIKit/UIIndirectScribbleInteraction.swift +++ b/iOS/UIKit/UIIndirectScribbleInteraction.swift @@ -9,10 +9,12 @@ typealias __UIScribbleElementIdentifier = NSCopying & NSObjectProtocol @available(iOS 14.0, *) protocol __UIIndirectScribbleInteractionDelegate : NSObjectProtocol { func indirectScribbleInteraction(_ interaction: __UIIndirectScribbleInteraction, requestElementsIn rect: CGRect, completion: @escaping ([__UIScribbleElementIdentifier]) -> Void) + func indirectScribbleInteraction(_ interaction: __UIIndirectScribbleInteraction, requestElementsIn rect: CGRect) async -> [__UIScribbleElementIdentifier] func indirectScribbleInteraction(_ interaction: __UIIndirectScribbleInteraction, isElementFocused elementIdentifier: __UIScribbleElementIdentifier) -> Bool func indirectScribbleInteraction(_ interaction: __UIIndirectScribbleInteraction, frameForElement elementIdentifier: __UIScribbleElementIdentifier) -> CGRect func indirectScribbleInteraction(_ interaction: __UIIndirectScribbleInteraction, focusElementIfNeeded elementIdentifier: __UIScribbleElementIdentifier, referencePoint focusReferencePoint: CGPoint, completion: @escaping ((UIResponder & UITextInput)?) -> Void) + func indirectScribbleInteraction(_ interaction: __UIIndirectScribbleInteraction, focusElementIfNeeded elementIdentifier: __UIScribbleElementIdentifier, referencePoint focusReferencePoint: CGPoint) async -> (UIResponder & UITextInput)? optional func indirectScribbleInteraction(_ interaction: __UIIndirectScribbleInteraction, shouldDelayFocusForElement elementIdentifier: __UIScribbleElementIdentifier) -> Bool optional func indirectScribbleInteraction(_ interaction: __UIIndirectScribbleInteraction, willBeginWritingInElement elementIdentifier: __UIScribbleElementIdentifier) - optional func indirectScribbleInteraction(_ interaction: __UIIndirectScribbleInteraction, didFinishWritingInElement elementIdentifier: __UIScribbleElementIdentifier) + @asyncHandler optional func indirectScribbleInteraction(_ interaction: __UIIndirectScribbleInteraction, didFinishWritingInElement elementIdentifier: __UIScribbleElementIdentifier) } diff --git a/iOS/UIKit/UIInputViewController.swift b/iOS/UIKit/UIInputViewController.swift index c77dd19..9fc1c62 100644 --- a/iOS/UIKit/UIInputViewController.swift +++ b/iOS/UIKit/UIInputViewController.swift @@ -28,4 +28,5 @@ class UIInputViewController : UIViewController, UITextInputDelegate { @available(iOS 10.0, *) func handleInputModeList(from view: UIView, with event: UIEvent) func requestSupplementaryLexicon(completion completionHandler: @escaping (UILexicon) -> Void) + func requestSupplementaryLexicon() async -> UILexicon } diff --git a/iOS/UIKit/UIInteraction.swift b/iOS/UIKit/UIInteraction.swift index ccdc2a0..ee8e40a 100644 --- a/iOS/UIKit/UIInteraction.swift +++ b/iOS/UIKit/UIInteraction.swift @@ -3,7 +3,7 @@ protocol UIInteraction : NSObjectProtocol { weak var view: @sil_weak UIView? { get } func willMove(to view: UIView?) - func didMove(to view: UIView?) + @asyncHandler func didMove(to view: UIView?) } extension UIView { @available(iOS 11.0, *) diff --git a/iOS/UIKit/UILargeContentViewer.swift b/iOS/UIKit/UILargeContentViewer.swift index 92832e8..81e96e9 100644 --- a/iOS/UIKit/UILargeContentViewer.swift +++ b/iOS/UIKit/UILargeContentViewer.swift @@ -18,7 +18,7 @@ class UILargeContentViewerInteraction : NSObject, UIInteraction { } @available(iOS 13.0, *) protocol UILargeContentViewerInteractionDelegate : NSObjectProtocol { - optional func largeContentViewerInteraction(_ interaction: UILargeContentViewerInteraction, didEndOn item: UILargeContentViewerItem?, at point: CGPoint) + @asyncHandler optional func largeContentViewerInteraction(_ interaction: UILargeContentViewerInteraction, didEndOn item: UILargeContentViewerItem?, at point: CGPoint) optional func largeContentViewerInteraction(_ interaction: UILargeContentViewerInteraction, itemAt point: CGPoint) -> UILargeContentViewerItem? optional func viewController(for interaction: UILargeContentViewerInteraction) -> UIViewController } diff --git a/iOS/UIKit/UINavigationBar.swift b/iOS/UIKit/UINavigationBar.swift index 68422e6..bae039b 100644 --- a/iOS/UIKit/UINavigationBar.swift +++ b/iOS/UIKit/UINavigationBar.swift @@ -48,9 +48,9 @@ protocol UINavigationBarDelegate : UIBarPositioningDelegate { @available(iOS 2.0, *) optional func navigationBar(_ navigationBar: UINavigationBar, shouldPush item: UINavigationItem) -> Bool @available(iOS 2.0, *) - optional func navigationBar(_ navigationBar: UINavigationBar, didPush item: UINavigationItem) + @asyncHandler optional func navigationBar(_ navigationBar: UINavigationBar, didPush item: UINavigationItem) @available(iOS 2.0, *) optional func navigationBar(_ navigationBar: UINavigationBar, shouldPop item: UINavigationItem) -> Bool @available(iOS 2.0, *) - optional func navigationBar(_ navigationBar: UINavigationBar, didPop item: UINavigationItem) + @asyncHandler optional func navigationBar(_ navigationBar: UINavigationBar, didPop item: UINavigationItem) } diff --git a/iOS/UIKit/UINavigationController.swift b/iOS/UIKit/UINavigationController.swift index d8deb79..de76da4 100644 --- a/iOS/UIKit/UINavigationController.swift +++ b/iOS/UIKit/UINavigationController.swift @@ -52,7 +52,7 @@ protocol UINavigationControllerDelegate : NSObjectProtocol { @available(iOS 2.0, *) optional func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) @available(iOS 2.0, *) - optional func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) + @asyncHandler optional func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) @available(iOS 7.0, *) optional func navigationControllerSupportedInterfaceOrientations(_ navigationController: UINavigationController) -> UIInterfaceOrientationMask @available(iOS 7.0, *) diff --git a/iOS/UIKit/UIPageViewController.swift b/iOS/UIKit/UIPageViewController.swift index c9fea8e..d92413f 100644 --- a/iOS/UIKit/UIPageViewController.swift +++ b/iOS/UIKit/UIPageViewController.swift @@ -49,12 +49,13 @@ class UIPageViewController : UIViewController { var gestureRecognizers: [UIGestureRecognizer] { get } var viewControllers: [UIViewController]? { get } func setViewControllers(_ viewControllers: [UIViewController]?, direction: UIPageViewController.NavigationDirection, animated: Bool, completion: ((Bool) -> Void)? = nil) + func setViewControllers(_ viewControllers: [UIViewController]?, direction: UIPageViewController.NavigationDirection, animated: Bool) async -> Bool } protocol UIPageViewControllerDelegate : NSObjectProtocol { @available(iOS 6.0, *) optional func pageViewController(_ pageViewController: UIPageViewController, willTransitionTo pendingViewControllers: [UIViewController]) @available(iOS 5.0, *) - optional func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) + @asyncHandler optional func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) @available(iOS 5.0, *) optional func pageViewController(_ pageViewController: UIPageViewController, spineLocationFor orientation: UIInterfaceOrientation) -> UIPageViewController.SpineLocation @available(iOS 7.0, *) diff --git a/iOS/UIKit/UIPasteboard.swift b/iOS/UIKit/UIPasteboard.swift index dccb7bd..84f65e1 100644 --- a/iOS/UIKit/UIPasteboard.swift +++ b/iOS/UIKit/UIPasteboard.swift @@ -66,11 +66,19 @@ class UIPasteboard : NSObject { @available(iOS 14.0, *) func __detectPatterns(forPatterns patterns: Set, completionHandler: @escaping (Set?, Error?) -> Void) @available(iOS 14.0, *) + func __detectPatterns(forPatterns patterns: Set) async throws -> Set? + @available(iOS 14.0, *) func __detectPatterns(forPatterns patterns: Set, inItemSet itemSet: IndexSet?, completionHandler: @escaping ([Set]?, Error?) -> Void) @available(iOS 14.0, *) + func __detectPatterns(forPatterns patterns: Set, inItemSet itemSet: IndexSet?) async throws -> [Set]? + @available(iOS 14.0, *) func __detectValues(forPatterns patterns: Set, completionHandler: @escaping ([UIPasteboard.DetectionPattern : Any]?, Error?) -> Void) @available(iOS 14.0, *) + func __detectValues(forPatterns patterns: Set) async throws -> [UIPasteboard.DetectionPattern : Any]? + @available(iOS 14.0, *) func __detectValues(forPatterns patterns: Set, inItemSet itemSet: IndexSet?, completionHandler: @escaping ([[UIPasteboard.DetectionPattern : Any]]?, Error?) -> Void) + @available(iOS 14.0, *) + func __detectValues(forPatterns patterns: Set, inItemSet itemSet: IndexSet?) async throws -> [[UIPasteboard.DetectionPattern : Any]]? } extension UIPasteboard { diff --git a/iOS/UIKit/UIPencilInteraction.swift b/iOS/UIKit/UIPencilInteraction.swift index 4d07237..6a2c01c 100644 --- a/iOS/UIKit/UIPencilInteraction.swift +++ b/iOS/UIKit/UIPencilInteraction.swift @@ -17,5 +17,5 @@ class UIPencilInteraction : NSObject, UIInteraction { } @available(iOS 12.1, *) protocol UIPencilInteractionDelegate : NSObjectProtocol { - optional func pencilInteractionDidTap(_ interaction: UIPencilInteraction) + @asyncHandler optional func pencilInteractionDidTap(_ interaction: UIPencilInteraction) } diff --git a/iOS/UIKit/UIPickerView.swift b/iOS/UIKit/UIPickerView.swift index af6f6fb..c06175b 100644 --- a/iOS/UIKit/UIPickerView.swift +++ b/iOS/UIKit/UIPickerView.swift @@ -32,5 +32,5 @@ protocol UIPickerViewDelegate : NSObjectProtocol { @available(iOS 2.0, *) optional func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView @available(iOS 2.0, *) - optional func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) + @asyncHandler optional func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) } diff --git a/iOS/UIKit/UIPointerInteraction.swift b/iOS/UIKit/UIPointerInteraction.swift index 6dadb14..68ae25c 100644 --- a/iOS/UIKit/UIPointerInteraction.swift +++ b/iOS/UIKit/UIPointerInteraction.swift @@ -22,4 +22,5 @@ class UIPointerRegionRequest : NSObject { protocol UIPointerInteractionAnimating : NSObjectProtocol { func addAnimations(_ animations: @escaping () -> Void) func addCompletion(_ completion: @escaping (Bool) -> Void) + func addCompletion() async -> Bool } diff --git a/iOS/UIKit/UIPopoverController.swift b/iOS/UIKit/UIPopoverController.swift index 6d88491..e81b41f 100644 --- a/iOS/UIKit/UIPopoverController.swift +++ b/iOS/UIKit/UIPopoverController.swift @@ -24,7 +24,7 @@ protocol UIPopoverControllerDelegate : NSObjectProtocol { @available(iOS, introduced: 3.2, deprecated: 9.0) optional func popoverControllerShouldDismissPopover(_ popoverController: UIPopoverController) -> Bool @available(iOS, introduced: 3.2, deprecated: 9.0) - optional func popoverControllerDidDismissPopover(_ popoverController: UIPopoverController) + @asyncHandler optional func popoverControllerDidDismissPopover(_ popoverController: UIPopoverController) @available(iOS, introduced: 7.0, deprecated: 9.0) optional func popoverController(_ popoverController: UIPopoverController, willRepositionPopoverTo rect: UnsafeMutablePointer, in view: AutoreleasingUnsafeMutablePointer) } diff --git a/iOS/UIKit/UIPopoverPresentationController.swift b/iOS/UIKit/UIPopoverPresentationController.swift index 379413f..0e631ea 100644 --- a/iOS/UIKit/UIPopoverPresentationController.swift +++ b/iOS/UIKit/UIPopoverPresentationController.swift @@ -5,7 +5,7 @@ protocol UIPopoverPresentationControllerDelegate : UIAdaptivePresentationControl @available(iOS, introduced: 8.0, deprecated: 13.0) optional func popoverPresentationControllerShouldDismissPopover(_ popoverPresentationController: UIPopoverPresentationController) -> Bool @available(iOS, introduced: 8.0, deprecated: 13.0) - optional func popoverPresentationControllerDidDismissPopover(_ popoverPresentationController: UIPopoverPresentationController) + @asyncHandler optional func popoverPresentationControllerDidDismissPopover(_ popoverPresentationController: UIPopoverPresentationController) @available(iOS 8.0, *) optional func popoverPresentationController(_ popoverPresentationController: UIPopoverPresentationController, willRepositionPopoverTo rect: UnsafeMutablePointer, in view: AutoreleasingUnsafeMutablePointer) } diff --git a/iOS/UIKit/UIPresentationController.swift b/iOS/UIKit/UIPresentationController.swift index 9fb7b7f..df2ae51 100644 --- a/iOS/UIKit/UIPresentationController.swift +++ b/iOS/UIKit/UIPresentationController.swift @@ -13,9 +13,9 @@ protocol UIAdaptivePresentationControllerDelegate : NSObjectProtocol { @available(iOS 13.0, *) optional func presentationControllerWillDismiss(_ presentationController: UIPresentationController) @available(iOS 13.0, *) - optional func presentationControllerDidDismiss(_ presentationController: UIPresentationController) + @asyncHandler optional func presentationControllerDidDismiss(_ presentationController: UIPresentationController) @available(iOS 13.0, *) - optional func presentationControllerDidAttemptToDismiss(_ presentationController: UIPresentationController) + @asyncHandler optional func presentationControllerDidAttemptToDismiss(_ presentationController: UIPresentationController) } @available(iOS 8.0, *) class UIPresentationController : NSObject, UIAppearanceContainer, UITraitEnvironment, UIContentContainer, UIFocusEnvironment { diff --git a/iOS/UIKit/UIPreviewInteraction.swift b/iOS/UIKit/UIPreviewInteraction.swift index 482a168..4172c22 100644 --- a/iOS/UIKit/UIPreviewInteraction.swift +++ b/iOS/UIKit/UIPreviewInteraction.swift @@ -9,11 +9,11 @@ class UIPreviewInteraction : NSObject { } protocol UIPreviewInteractionDelegate : NSObjectProtocol { @available(iOS 10.0, *) - func previewInteraction(_ previewInteraction: UIPreviewInteraction, didUpdatePreviewTransition transitionProgress: CGFloat, ended: Bool) + @asyncHandler func previewInteraction(_ previewInteraction: UIPreviewInteraction, didUpdatePreviewTransition transitionProgress: CGFloat, ended: Bool) @available(iOS 10.0, *) - func previewInteractionDidCancel(_ previewInteraction: UIPreviewInteraction) + @asyncHandler func previewInteractionDidCancel(_ previewInteraction: UIPreviewInteraction) @available(iOS 10.0, *) optional func previewInteractionShouldBegin(_ previewInteraction: UIPreviewInteraction) -> Bool @available(iOS 10.0, *) - optional func previewInteraction(_ previewInteraction: UIPreviewInteraction, didUpdateCommitTransition transitionProgress: CGFloat, ended: Bool) + @asyncHandler optional func previewInteraction(_ previewInteraction: UIPreviewInteraction, didUpdateCommitTransition transitionProgress: CGFloat, ended: Bool) } diff --git a/iOS/UIKit/UIPrintInteractionController.swift b/iOS/UIKit/UIPrintInteractionController.swift index 2bb6a95..a3e39e2 100644 --- a/iOS/UIKit/UIPrintInteractionController.swift +++ b/iOS/UIKit/UIPrintInteractionController.swift @@ -48,15 +48,15 @@ protocol UIPrintInteractionControllerDelegate : NSObjectProtocol { @available(iOS 4.2, *) optional func printInteractionControllerWillPresentPrinterOptions(_ printInteractionController: UIPrintInteractionController) @available(iOS 4.2, *) - optional func printInteractionControllerDidPresentPrinterOptions(_ printInteractionController: UIPrintInteractionController) + @asyncHandler optional func printInteractionControllerDidPresentPrinterOptions(_ printInteractionController: UIPrintInteractionController) @available(iOS 4.2, *) optional func printInteractionControllerWillDismissPrinterOptions(_ printInteractionController: UIPrintInteractionController) @available(iOS 4.2, *) - optional func printInteractionControllerDidDismissPrinterOptions(_ printInteractionController: UIPrintInteractionController) + @asyncHandler optional func printInteractionControllerDidDismissPrinterOptions(_ printInteractionController: UIPrintInteractionController) @available(iOS 4.2, *) optional func printInteractionControllerWillStartJob(_ printInteractionController: UIPrintInteractionController) @available(iOS 4.2, *) - optional func printInteractionControllerDidFinishJob(_ printInteractionController: UIPrintInteractionController) + @asyncHandler optional func printInteractionControllerDidFinishJob(_ printInteractionController: UIPrintInteractionController) @available(iOS 7.0, *) optional func printInteractionController(_ printInteractionController: UIPrintInteractionController, cutLengthFor paper: UIPrintPaper) -> CGFloat @available(iOS 9.0, *) diff --git a/iOS/UIKit/UIPrinter.swift b/iOS/UIKit/UIPrinter.swift index dbd4fbc..0747864 100644 --- a/iOS/UIKit/UIPrinter.swift +++ b/iOS/UIKit/UIPrinter.swift @@ -10,6 +10,7 @@ class UIPrinter : NSObject { var supportsColor: Bool { get } var supportsDuplex: Bool { get } func contactPrinter(_ completionHandler: ((Bool) -> Void)? = nil) + func contactPrinter() async -> Bool } extension UIPrinter { @available(iOS 8.0, *) diff --git a/iOS/UIKit/UIPrinterPickerController.swift b/iOS/UIKit/UIPrinterPickerController.swift index cbc411c..0a04759 100644 --- a/iOS/UIKit/UIPrinterPickerController.swift +++ b/iOS/UIKit/UIPrinterPickerController.swift @@ -10,13 +10,13 @@ protocol UIPrinterPickerControllerDelegate : NSObjectProtocol { @available(iOS 8.0, *) optional func printerPickerControllerWillPresent(_ printerPickerController: UIPrinterPickerController) @available(iOS 8.0, *) - optional func printerPickerControllerDidPresent(_ printerPickerController: UIPrinterPickerController) + @asyncHandler optional func printerPickerControllerDidPresent(_ printerPickerController: UIPrinterPickerController) @available(iOS 8.0, *) optional func printerPickerControllerWillDismiss(_ printerPickerController: UIPrinterPickerController) @available(iOS 8.0, *) - optional func printerPickerControllerDidDismiss(_ printerPickerController: UIPrinterPickerController) + @asyncHandler optional func printerPickerControllerDidDismiss(_ printerPickerController: UIPrinterPickerController) @available(iOS 8.0, *) - optional func printerPickerControllerDidSelectPrinter(_ printerPickerController: UIPrinterPickerController) + @asyncHandler optional func printerPickerControllerDidSelectPrinter(_ printerPickerController: UIPrinterPickerController) } @available(iOS 8.0, *) class UIPrinterPickerController : NSObject { diff --git a/iOS/UIKit/UIScene.swift b/iOS/UIKit/UIScene.swift index 2ea0214..297cecf 100644 --- a/iOS/UIKit/UIScene.swift +++ b/iOS/UIKit/UIScene.swift @@ -6,23 +6,24 @@ class UIScene : UIResponder { var delegate: UISceneDelegate? var activationState: UIScene.ActivationState { get } func open(_ url: URL, options: UIScene.OpenExternalURLOptions?, completionHandler completion: ((Bool) -> Void)? = nil) + func open(_ url: URL, options: UIScene.OpenExternalURLOptions?) async -> Bool var title: String! var activationConditions: UISceneActivationConditions } @available(iOS 13.0, *) protocol UISceneDelegate : NSObjectProtocol { optional func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) - optional func sceneDidDisconnect(_ scene: UIScene) - optional func sceneDidBecomeActive(_ scene: UIScene) + @asyncHandler optional func sceneDidDisconnect(_ scene: UIScene) + @asyncHandler optional func sceneDidBecomeActive(_ scene: UIScene) optional func sceneWillResignActive(_ scene: UIScene) optional func sceneWillEnterForeground(_ scene: UIScene) - optional func sceneDidEnterBackground(_ scene: UIScene) + @asyncHandler optional func sceneDidEnterBackground(_ scene: UIScene) optional func scene(_ scene: UIScene, openURLContexts URLContexts: Set) optional func stateRestorationActivity(for scene: UIScene) -> NSUserActivity? optional func scene(_ scene: UIScene, willContinueUserActivityWithType userActivityType: String) optional func scene(_ scene: UIScene, continue userActivity: NSUserActivity) - optional func scene(_ scene: UIScene, didFailToContinueUserActivityWithType userActivityType: String, error: Error) - optional func scene(_ scene: UIScene, didUpdate userActivity: NSUserActivity) + @asyncHandler optional func scene(_ scene: UIScene, didFailToContinueUserActivityWithType userActivityType: String, error: Error) + @asyncHandler optional func scene(_ scene: UIScene, didUpdate userActivity: NSUserActivity) } extension UIScene { @available(iOS 13.0, *) diff --git a/iOS/UIKit/UIScreenshotService.swift b/iOS/UIKit/UIScreenshotService.swift index 4149a4e..6e1b3aa 100644 --- a/iOS/UIKit/UIScreenshotService.swift +++ b/iOS/UIKit/UIScreenshotService.swift @@ -11,4 +11,6 @@ extension UIWindowScene { protocol UIScreenshotServiceDelegate : NSObjectProtocol { @available(iOS 13.0, *) optional func screenshotService(_ screenshotService: UIScreenshotService, generatePDFRepresentationWithCompletion completionHandler: @escaping (Data?, Int, CGRect) -> Void) + @available(iOS 13.0, *) + optional func screenshotService(_ screenshotService: UIScreenshotService) async -> (Data?, Int, CGRect) } diff --git a/iOS/UIKit/UIScribbleInteraction.swift b/iOS/UIKit/UIScribbleInteraction.swift index b83a4cc..d16a515 100644 --- a/iOS/UIKit/UIScribbleInteraction.swift +++ b/iOS/UIKit/UIScribbleInteraction.swift @@ -11,5 +11,5 @@ protocol UIScribbleInteractionDelegate : NSObjectProtocol { optional func scribbleInteraction(_ interaction: UIScribbleInteraction, shouldBeginAt location: CGPoint) -> Bool optional func scribbleInteractionShouldDelayFocus(_ interaction: UIScribbleInteraction) -> Bool optional func scribbleInteractionWillBeginWriting(_ interaction: UIScribbleInteraction) - optional func scribbleInteractionDidFinishWriting(_ interaction: UIScribbleInteraction) + @asyncHandler optional func scribbleInteractionDidFinishWriting(_ interaction: UIScribbleInteraction) } diff --git a/iOS/UIKit/UIScrollView.swift b/iOS/UIKit/UIScrollView.swift index 735fa82..aa115ba 100644 --- a/iOS/UIKit/UIScrollView.swift +++ b/iOS/UIKit/UIScrollView.swift @@ -108,31 +108,31 @@ class UIScrollView : UIView, NSCoding, UIFocusItemScrollableContainer { } protocol UIScrollViewDelegate : NSObjectProtocol { @available(iOS 2.0, *) - optional func scrollViewDidScroll(_ scrollView: UIScrollView) + @asyncHandler optional func scrollViewDidScroll(_ scrollView: UIScrollView) @available(iOS 3.2, *) - optional func scrollViewDidZoom(_ scrollView: UIScrollView) + @asyncHandler optional func scrollViewDidZoom(_ scrollView: UIScrollView) @available(iOS 2.0, *) optional func scrollViewWillBeginDragging(_ scrollView: UIScrollView) @available(iOS 5.0, *) optional func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) @available(iOS 2.0, *) - optional func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) + @asyncHandler optional func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) @available(iOS 2.0, *) optional func scrollViewWillBeginDecelerating(_ scrollView: UIScrollView) @available(iOS 2.0, *) - optional func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) + @asyncHandler optional func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) @available(iOS 2.0, *) - optional func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) + @asyncHandler optional func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) @available(iOS 2.0, *) optional func viewForZooming(in scrollView: UIScrollView) -> UIView? @available(iOS 3.2, *) optional func scrollViewWillBeginZooming(_ scrollView: UIScrollView, with view: UIView?) @available(iOS 2.0, *) - optional func scrollViewDidEndZooming(_ scrollView: UIScrollView, with view: UIView?, atScale scale: CGFloat) + @asyncHandler optional func scrollViewDidEndZooming(_ scrollView: UIScrollView, with view: UIView?, atScale scale: CGFloat) @available(iOS 2.0, *) optional func scrollViewShouldScrollToTop(_ scrollView: UIScrollView) -> Bool @available(iOS 2.0, *) - optional func scrollViewDidScrollToTop(_ scrollView: UIScrollView) + @asyncHandler optional func scrollViewDidScrollToTop(_ scrollView: UIScrollView) @available(iOS 11.0, *) - optional func scrollViewDidChangeAdjustedContentInset(_ scrollView: UIScrollView) + @asyncHandler optional func scrollViewDidChangeAdjustedContentInset(_ scrollView: UIScrollView) } diff --git a/iOS/UIKit/UISearchBar.swift b/iOS/UIKit/UISearchBar.swift index 27d07ee..02948b6 100644 --- a/iOS/UIKit/UISearchBar.swift +++ b/iOS/UIKit/UISearchBar.swift @@ -89,11 +89,11 @@ protocol UISearchBarDelegate : UIBarPositioningDelegate { @available(iOS 2.0, *) optional func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool @available(iOS 2.0, *) - optional func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) + @asyncHandler optional func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) @available(iOS 2.0, *) optional func searchBarShouldEndEditing(_ searchBar: UISearchBar) -> Bool @available(iOS 2.0, *) - optional func searchBarTextDidEndEditing(_ searchBar: UISearchBar) + @asyncHandler optional func searchBarTextDidEndEditing(_ searchBar: UISearchBar) @available(iOS 2.0, *) optional func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) @available(iOS 3.0, *) diff --git a/iOS/UIKit/UISearchController.swift b/iOS/UIKit/UISearchController.swift index 1e0ff3f..a8cb8ed 100644 --- a/iOS/UIKit/UISearchController.swift +++ b/iOS/UIKit/UISearchController.swift @@ -3,11 +3,11 @@ protocol UISearchControllerDelegate : NSObjectProtocol { @available(iOS 8.0, *) optional func willPresentSearchController(_ searchController: UISearchController) @available(iOS 8.0, *) - optional func didPresentSearchController(_ searchController: UISearchController) + @asyncHandler optional func didPresentSearchController(_ searchController: UISearchController) @available(iOS 8.0, *) optional func willDismissSearchController(_ searchController: UISearchController) @available(iOS 8.0, *) - optional func didDismissSearchController(_ searchController: UISearchController) + @asyncHandler optional func didDismissSearchController(_ searchController: UISearchController) @available(iOS 8.0, *) optional func presentSearchController(_ searchController: UISearchController) } diff --git a/iOS/UIKit/UISearchDisplayController.swift b/iOS/UIKit/UISearchDisplayController.swift index 829200c..18f4cf6 100644 --- a/iOS/UIKit/UISearchDisplayController.swift +++ b/iOS/UIKit/UISearchDisplayController.swift @@ -21,23 +21,23 @@ protocol UISearchDisplayDelegate : NSObjectProtocol { @available(iOS, introduced: 3.0, deprecated: 8.0) optional func searchDisplayControllerWillBeginSearch(_ controller: UISearchDisplayController) @available(iOS, introduced: 3.0, deprecated: 8.0) - optional func searchDisplayControllerDidBeginSearch(_ controller: UISearchDisplayController) + @asyncHandler optional func searchDisplayControllerDidBeginSearch(_ controller: UISearchDisplayController) @available(iOS, introduced: 3.0, deprecated: 8.0) optional func searchDisplayControllerWillEndSearch(_ controller: UISearchDisplayController) @available(iOS, introduced: 3.0, deprecated: 8.0) - optional func searchDisplayControllerDidEndSearch(_ controller: UISearchDisplayController) + @asyncHandler optional func searchDisplayControllerDidEndSearch(_ controller: UISearchDisplayController) @available(iOS, introduced: 3.0, deprecated: 8.0) - optional func searchDisplayController(_ controller: UISearchDisplayController, didLoadSearchResultsTableView tableView: UITableView) + @asyncHandler optional func searchDisplayController(_ controller: UISearchDisplayController, didLoadSearchResultsTableView tableView: UITableView) @available(iOS, introduced: 3.0, deprecated: 8.0) optional func searchDisplayController(_ controller: UISearchDisplayController, willUnloadSearchResultsTableView tableView: UITableView) @available(iOS, introduced: 3.0, deprecated: 8.0) optional func searchDisplayController(_ controller: UISearchDisplayController, willShowSearchResultsTableView tableView: UITableView) @available(iOS, introduced: 3.0, deprecated: 8.0) - optional func searchDisplayController(_ controller: UISearchDisplayController, didShowSearchResultsTableView tableView: UITableView) + @asyncHandler optional func searchDisplayController(_ controller: UISearchDisplayController, didShowSearchResultsTableView tableView: UITableView) @available(iOS, introduced: 3.0, deprecated: 8.0) optional func searchDisplayController(_ controller: UISearchDisplayController, willHideSearchResultsTableView tableView: UITableView) @available(iOS, introduced: 3.0, deprecated: 8.0) - optional func searchDisplayController(_ controller: UISearchDisplayController, didHideSearchResultsTableView tableView: UITableView) + @asyncHandler optional func searchDisplayController(_ controller: UISearchDisplayController, didHideSearchResultsTableView tableView: UITableView) @available(iOS, introduced: 3.0, deprecated: 8.0) optional func searchDisplayController(_ controller: UISearchDisplayController, shouldReloadTableForSearch searchString: String?) -> Bool @available(iOS, introduced: 3.0, deprecated: 8.0) diff --git a/iOS/UIKit/UISplitViewController.swift b/iOS/UIKit/UISplitViewController.swift index 994d45d..ea97dad 100644 --- a/iOS/UIKit/UISplitViewController.swift +++ b/iOS/UIKit/UISplitViewController.swift @@ -155,9 +155,9 @@ protocol UISplitViewControllerDelegate { @available(iOS 14.0, *) optional func splitViewController(_ svc: UISplitViewController, displayModeForExpandingToProposedDisplayMode proposedDisplayMode: UISplitViewController.DisplayMode) -> UISplitViewController.DisplayMode @available(iOS 14.0, *) - optional func splitViewControllerDidCollapse(_ svc: UISplitViewController) + @asyncHandler optional func splitViewControllerDidCollapse(_ svc: UISplitViewController) @available(iOS 14.0, *) - optional func splitViewControllerDidExpand(_ svc: UISplitViewController) + @asyncHandler optional func splitViewControllerDidExpand(_ svc: UISplitViewController) @available(iOS 14.0, *) optional func splitViewController(_ svc: UISplitViewController, willShow column: UISplitViewController.Column) @available(iOS 14.0, *) @@ -165,7 +165,7 @@ protocol UISplitViewControllerDelegate { @available(iOS 14.0, *) optional func splitViewControllerInteractivePresentationGestureWillBegin(_ svc: UISplitViewController) @available(iOS 14.0, *) - optional func splitViewControllerInteractivePresentationGestureDidEnd(_ svc: UISplitViewController) + @asyncHandler optional func splitViewControllerInteractivePresentationGestureDidEnd(_ svc: UISplitViewController) } extension UIViewController { var splitViewController: UISplitViewController? { get } diff --git a/iOS/UIKit/UISpringLoadedInteraction.swift b/iOS/UIKit/UISpringLoadedInteraction.swift index e315e86..f16b1ab 100644 --- a/iOS/UIKit/UISpringLoadedInteraction.swift +++ b/iOS/UIKit/UISpringLoadedInteraction.swift @@ -18,11 +18,11 @@ class UISpringLoadedInteraction : NSObject, UIInteraction { @available(iOS 11.0, *) protocol UISpringLoadedInteractionBehavior : NSObjectProtocol { func shouldAllow(_ interaction: UISpringLoadedInteraction, with context: UISpringLoadedInteractionContext) -> Bool - optional func interactionDidFinish(_ interaction: UISpringLoadedInteraction) + @asyncHandler optional func interactionDidFinish(_ interaction: UISpringLoadedInteraction) } @available(iOS 11.0, *) protocol UISpringLoadedInteractionEffect : NSObjectProtocol { - func interaction(_ interaction: UISpringLoadedInteraction, didChangeWith context: UISpringLoadedInteractionContext) + @asyncHandler func interaction(_ interaction: UISpringLoadedInteraction, didChangeWith context: UISpringLoadedInteractionContext) } @available(iOS 11.0, *) protocol UISpringLoadedInteractionContext : NSObjectProtocol { diff --git a/iOS/UIKit/UITabBar.swift b/iOS/UIKit/UITabBar.swift index 2ee3fcf..506d750 100644 --- a/iOS/UIKit/UITabBar.swift +++ b/iOS/UIKit/UITabBar.swift @@ -45,15 +45,15 @@ class UITabBar : UIView { } protocol UITabBarDelegate : NSObjectProtocol { @available(iOS 2.0, *) - optional func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) + @asyncHandler optional func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) @available(iOS 2.0, *) optional func tabBar(_ tabBar: UITabBar, willBeginCustomizing items: [UITabBarItem]) @available(iOS 2.0, *) - optional func tabBar(_ tabBar: UITabBar, didBeginCustomizing items: [UITabBarItem]) + @asyncHandler optional func tabBar(_ tabBar: UITabBar, didBeginCustomizing items: [UITabBarItem]) @available(iOS 2.0, *) optional func tabBar(_ tabBar: UITabBar, willEndCustomizing items: [UITabBarItem], changed: Bool) @available(iOS 2.0, *) - optional func tabBar(_ tabBar: UITabBar, didEndCustomizing items: [UITabBarItem], changed: Bool) + @asyncHandler optional func tabBar(_ tabBar: UITabBar, didEndCustomizing items: [UITabBarItem], changed: Bool) } extension UITabBar : UISpringLoadedInteractionSupporting { } diff --git a/iOS/UIKit/UITabBarController.swift b/iOS/UIKit/UITabBarController.swift index 9fea8ab..d04bc0b 100644 --- a/iOS/UIKit/UITabBarController.swift +++ b/iOS/UIKit/UITabBarController.swift @@ -15,13 +15,13 @@ protocol UITabBarControllerDelegate : NSObjectProtocol { @available(iOS 3.0, *) optional func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool @available(iOS 2.0, *) - optional func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) + @asyncHandler optional func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) @available(iOS 3.0, *) optional func tabBarController(_ tabBarController: UITabBarController, willBeginCustomizing viewControllers: [UIViewController]) @available(iOS 3.0, *) optional func tabBarController(_ tabBarController: UITabBarController, willEndCustomizing viewControllers: [UIViewController], changed: Bool) @available(iOS 2.0, *) - optional func tabBarController(_ tabBarController: UITabBarController, didEndCustomizing viewControllers: [UIViewController], changed: Bool) + @asyncHandler optional func tabBarController(_ tabBarController: UITabBarController, didEndCustomizing viewControllers: [UIViewController], changed: Bool) @available(iOS 7.0, *) optional func tabBarControllerSupportedInterfaceOrientations(_ tabBarController: UITabBarController) -> UIInterfaceOrientationMask @available(iOS 7.0, *) diff --git a/iOS/UIKit/UITableView.swift b/iOS/UIKit/UITableView.swift index eb16a6c..ece0533 100644 --- a/iOS/UIKit/UITableView.swift +++ b/iOS/UIKit/UITableView.swift @@ -72,11 +72,11 @@ protocol UITableViewDelegate : UIScrollViewDelegate { @available(iOS 6.0, *) optional func tableView(_ tableView: UITableView, willDisplayFooterView view: UIView, forSection section: Int) @available(iOS 6.0, *) - optional func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) + @asyncHandler optional func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) @available(iOS 6.0, *) - optional func tableView(_ tableView: UITableView, didEndDisplayingHeaderView view: UIView, forSection section: Int) + @asyncHandler optional func tableView(_ tableView: UITableView, didEndDisplayingHeaderView view: UIView, forSection section: Int) @available(iOS 6.0, *) - optional func tableView(_ tableView: UITableView, didEndDisplayingFooterView view: UIView, forSection section: Int) + @asyncHandler optional func tableView(_ tableView: UITableView, didEndDisplayingFooterView view: UIView, forSection section: Int) @available(iOS 2.0, *) optional func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat @available(iOS 2.0, *) @@ -98,17 +98,17 @@ protocol UITableViewDelegate : UIScrollViewDelegate { @available(iOS 6.0, *) optional func tableView(_ tableView: UITableView, shouldHighlightRowAt indexPath: IndexPath) -> Bool @available(iOS 6.0, *) - optional func tableView(_ tableView: UITableView, didHighlightRowAt indexPath: IndexPath) + @asyncHandler optional func tableView(_ tableView: UITableView, didHighlightRowAt indexPath: IndexPath) @available(iOS 6.0, *) - optional func tableView(_ tableView: UITableView, didUnhighlightRowAt indexPath: IndexPath) + @asyncHandler optional func tableView(_ tableView: UITableView, didUnhighlightRowAt indexPath: IndexPath) @available(iOS 2.0, *) optional func tableView(_ tableView: UITableView, willSelectRowAt indexPath: IndexPath) -> IndexPath? @available(iOS 3.0, *) optional func tableView(_ tableView: UITableView, willDeselectRowAt indexPath: IndexPath) -> IndexPath? @available(iOS 2.0, *) - optional func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) + @asyncHandler optional func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) @available(iOS 3.0, *) - optional func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) + @asyncHandler optional func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) @available(iOS 2.0, *) optional func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCell.EditingStyle @available(iOS 3.0, *) @@ -124,7 +124,7 @@ protocol UITableViewDelegate : UIScrollViewDelegate { @available(iOS 2.0, *) optional func tableView(_ tableView: UITableView, willBeginEditingRowAt indexPath: IndexPath) @available(iOS 2.0, *) - optional func tableView(_ tableView: UITableView, didEndEditingRowAt indexPath: IndexPath?) + @asyncHandler optional func tableView(_ tableView: UITableView, didEndEditingRowAt indexPath: IndexPath?) @available(iOS 2.0, *) optional func tableView(_ tableView: UITableView, targetIndexPathForMoveFromRowAt sourceIndexPath: IndexPath, toProposedIndexPath proposedDestinationIndexPath: IndexPath) -> IndexPath @available(iOS 2.0, *) @@ -140,7 +140,7 @@ protocol UITableViewDelegate : UIScrollViewDelegate { @available(iOS 9.0, *) optional func tableView(_ tableView: UITableView, shouldUpdateFocusIn context: UITableViewFocusUpdateContext) -> Bool @available(iOS 9.0, *) - optional func tableView(_ tableView: UITableView, didUpdateFocusIn context: UITableViewFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) + @asyncHandler optional func tableView(_ tableView: UITableView, didUpdateFocusIn context: UITableViewFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) @available(iOS 9.0, *) optional func indexPathForPreferredFocusedView(in tableView: UITableView) -> IndexPath? @available(iOS 11.0, *) @@ -148,9 +148,9 @@ protocol UITableViewDelegate : UIScrollViewDelegate { @available(iOS 13.0, *) optional func tableView(_ tableView: UITableView, shouldBeginMultipleSelectionInteractionAt indexPath: IndexPath) -> Bool @available(iOS 13.0, *) - optional func tableView(_ tableView: UITableView, didBeginMultipleSelectionInteractionAt indexPath: IndexPath) + @asyncHandler optional func tableView(_ tableView: UITableView, didBeginMultipleSelectionInteractionAt indexPath: IndexPath) @available(iOS 13.0, *) - optional func tableViewDidEndMultipleSelectionInteraction(_ tableView: UITableView) + @asyncHandler optional func tableViewDidEndMultipleSelectionInteraction(_ tableView: UITableView) @available(iOS 13.0, *) optional func tableView(_ tableView: UITableView, contextMenuConfigurationForRowAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? @available(iOS 13.0, *) @@ -210,6 +210,8 @@ class UITableView : UIScrollView, NSCoding, UIDataSourceTranslating { func scrollToNearestSelectedRow(at scrollPosition: UITableView.ScrollPosition, animated: Bool) @available(iOS 11.0, *) func performBatchUpdates(_ updates: (() -> Void)?, completion: ((Bool) -> Void)? = nil) + @available(iOS 11.0, *) + func performBatchUpdates(_ updates: (() -> Void)?) async -> Bool func beginUpdates() func endUpdates() func insertSections(_ sections: IndexSet, with animation: UITableView.RowAnimation) diff --git a/iOS/UIKit/UITextField.swift b/iOS/UIKit/UITextField.swift index 8309224..017e6c6 100644 --- a/iOS/UIKit/UITextField.swift +++ b/iOS/UIKit/UITextField.swift @@ -50,17 +50,17 @@ protocol UITextFieldDelegate : NSObjectProtocol { @available(iOS 2.0, *) optional func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool @available(iOS 2.0, *) - optional func textFieldDidBeginEditing(_ textField: UITextField) + @asyncHandler optional func textFieldDidBeginEditing(_ textField: UITextField) @available(iOS 2.0, *) optional func textFieldShouldEndEditing(_ textField: UITextField) -> Bool @available(iOS 2.0, *) - optional func textFieldDidEndEditing(_ textField: UITextField) + @asyncHandler optional func textFieldDidEndEditing(_ textField: UITextField) @available(iOS 10.0, *) - optional func textFieldDidEndEditing(_ textField: UITextField, reason: UITextField.DidEndEditingReason) + @asyncHandler optional func textFieldDidEndEditing(_ textField: UITextField, reason: UITextField.DidEndEditingReason) @available(iOS 2.0, *) optional func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool @available(iOS 13.0, *) - optional func textFieldDidChangeSelection(_ textField: UITextField) + @asyncHandler optional func textFieldDidChangeSelection(_ textField: UITextField) @available(iOS 2.0, *) optional func textFieldShouldClear(_ textField: UITextField) -> Bool @available(iOS 2.0, *) diff --git a/iOS/UIKit/UITextInput.swift b/iOS/UIKit/UITextInput.swift index 2303675..1eff7ac 100644 --- a/iOS/UIKit/UITextInput.swift +++ b/iOS/UIKit/UITextInput.swift @@ -120,7 +120,7 @@ protocol UITextInput : UIKeyInput { optional var selectionAffinity: UITextStorageDirection { get set } @available(iOS 5.1, *) optional func insertDictationResult(_ dictationResult: [UIDictationPhrase]) - optional func dictationRecordingDidEnd() + @asyncHandler optional func dictationRecordingDidEnd() optional func dictationRecognitionFailed() optional var insertDictationResultPlaceholder: Any { get } optional func frame(forDictationResultPlaceholder placeholder: Any) -> CGRect @@ -164,9 +164,9 @@ class UITextSelectionRect : NSObject { } protocol UITextInputDelegate : NSObjectProtocol { func selectionWillChange(_ textInput: UITextInput?) - func selectionDidChange(_ textInput: UITextInput?) + @asyncHandler func selectionDidChange(_ textInput: UITextInput?) func textWillChange(_ textInput: UITextInput?) - func textDidChange(_ textInput: UITextInput?) + @asyncHandler func textDidChange(_ textInput: UITextInput?) } protocol UITextInputTokenizer : NSObjectProtocol { @available(iOS 3.2, *) diff --git a/iOS/UIKit/UITextInteraction.swift b/iOS/UIKit/UITextInteraction.swift index ee76033..707a812 100644 --- a/iOS/UIKit/UITextInteraction.swift +++ b/iOS/UIKit/UITextInteraction.swift @@ -11,7 +11,7 @@ protocol UITextInteractionDelegate : NSObjectProtocol { @available(iOS 13.0, *) optional func interactionWillBegin(_ interaction: UITextInteraction) @available(iOS 13.0, *) - optional func interactionDidEnd(_ interaction: UITextInteraction) + @asyncHandler optional func interactionDidEnd(_ interaction: UITextInteraction) } @available(iOS 13.0, *) class UITextInteraction : NSObject, UIInteraction { diff --git a/iOS/UIKit/UITextView.swift b/iOS/UIKit/UITextView.swift index fe6c3e5..5842545 100644 --- a/iOS/UIKit/UITextView.swift +++ b/iOS/UIKit/UITextView.swift @@ -5,15 +5,15 @@ protocol UITextViewDelegate : UIScrollViewDelegate { @available(iOS 2.0, *) optional func textViewShouldEndEditing(_ textView: UITextView) -> Bool @available(iOS 2.0, *) - optional func textViewDidBeginEditing(_ textView: UITextView) + @asyncHandler optional func textViewDidBeginEditing(_ textView: UITextView) @available(iOS 2.0, *) - optional func textViewDidEndEditing(_ textView: UITextView) + @asyncHandler optional func textViewDidEndEditing(_ textView: UITextView) @available(iOS 2.0, *) optional func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool @available(iOS 2.0, *) - optional func textViewDidChange(_ textView: UITextView) + @asyncHandler optional func textViewDidChange(_ textView: UITextView) @available(iOS 2.0, *) - optional func textViewDidChangeSelection(_ textView: UITextView) + @asyncHandler optional func textViewDidChangeSelection(_ textView: UITextView) @available(iOS 10.0, *) optional func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool @available(iOS 10.0, *) diff --git a/iOS/UIKit/UITraitCollection.swift b/iOS/UIKit/UITraitCollection.swift index 49f572e..2358ade 100644 --- a/iOS/UIKit/UITraitCollection.swift +++ b/iOS/UIKit/UITraitCollection.swift @@ -52,7 +52,7 @@ protocol UITraitEnvironment : NSObjectProtocol { @available(iOS 8.0, *) var traitCollection: UITraitCollection { get } @available(iOS 8.0, *) - func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) + @asyncHandler func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) } extension UITraitCollection { @available(iOS 13.0, *) diff --git a/iOS/UIKit/UIVideoEditorController.swift b/iOS/UIKit/UIVideoEditorController.swift index 74c9bc0..3a0bfff 100644 --- a/iOS/UIKit/UIVideoEditorController.swift +++ b/iOS/UIKit/UIVideoEditorController.swift @@ -9,9 +9,9 @@ class UIVideoEditorController : UINavigationController { } protocol UIVideoEditorControllerDelegate : NSObjectProtocol { @available(iOS 3.1, *) - optional func videoEditorController(_ editor: UIVideoEditorController, didSaveEditedVideoToPath editedVideoPath: String) + @asyncHandler optional func videoEditorController(_ editor: UIVideoEditorController, didSaveEditedVideoToPath editedVideoPath: String) @available(iOS 3.1, *) - optional func videoEditorController(_ editor: UIVideoEditorController, didFailWithError error: Error) + @asyncHandler optional func videoEditorController(_ editor: UIVideoEditorController, didFailWithError error: Error) @available(iOS 3.1, *) - optional func videoEditorControllerDidCancel(_ editor: UIVideoEditorController) + @asyncHandler optional func videoEditorControllerDidCancel(_ editor: UIVideoEditorController) } diff --git a/iOS/UIKit/UIView.swift b/iOS/UIKit/UIView.swift index b0f83d2..c945d61 100644 --- a/iOS/UIKit/UIView.swift +++ b/iOS/UIKit/UIView.swift @@ -247,17 +247,29 @@ extension UIView { @available(iOS 4.0, *) class func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions = [], animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(iOS 4.0, *) + class func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool + @available(iOS 4.0, *) class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(iOS 4.0, *) + class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void) async -> Bool + @available(iOS 4.0, *) class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void) @available(iOS 7.0, *) class func animate(withDuration duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping dampingRatio: CGFloat, initialSpringVelocity velocity: CGFloat, options: UIView.AnimationOptions = [], animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) + @available(iOS 7.0, *) + class func animate(withDuration duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping dampingRatio: CGFloat, initialSpringVelocity velocity: CGFloat, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool @available(iOS 4.0, *) class func transition(with view: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(iOS 4.0, *) + class func transition(with view: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool + @available(iOS 4.0, *) class func transition(from fromView: UIView, to toView: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], completion: ((Bool) -> Void)? = nil) + @available(iOS 4.0, *) + class func transition(from fromView: UIView, to toView: UIView, duration: TimeInterval, options: UIView.AnimationOptions = []) async -> Bool @available(iOS 7.0, *) class func perform(_ animation: UIView.SystemAnimation, on views: [UIView], options: UIView.AnimationOptions = [], animations parallelAnimations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) + @available(iOS 7.0, *) + class func perform(_ animation: UIView.SystemAnimation, on views: [UIView], options: UIView.AnimationOptions = [], animations parallelAnimations: (() -> Void)?) async -> Bool @available(iOS 12.0, *) class func modifyAnimations(withRepeatCount count: CGFloat, autoreverses: Bool, animations: () -> Void) } @@ -265,6 +277,8 @@ extension UIView { @available(iOS 7.0, *) class func animateKeyframes(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.KeyframeAnimationOptions = [], animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(iOS 7.0, *) + class func animateKeyframes(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.KeyframeAnimationOptions = [], animations: @escaping () -> Void) async -> Bool + @available(iOS 7.0, *) class func addKeyframe(withRelativeStartTime frameStartTime: Double, relativeDuration frameDuration: Double, animations: @escaping () -> Void) } extension UIView { diff --git a/iOS/UIKit/UIViewAnimating.swift b/iOS/UIKit/UIViewAnimating.swift index ddb6341..56048d1 100644 --- a/iOS/UIKit/UIViewAnimating.swift +++ b/iOS/UIKit/UIViewAnimating.swift @@ -33,5 +33,7 @@ protocol UIViewImplicitlyAnimating : UIViewAnimating { optional func addAnimations(_ animation: @escaping () -> Void) @available(iOS 10.0, *) optional func addCompletion(_ completion: @escaping (UIViewAnimatingPosition) -> Void) + @available(iOS 10.0, *) + optional func addCompletion() async -> UIViewAnimatingPosition optional func continueAnimation(withTimingParameters parameters: UITimingCurveProvider?, durationFactor: CGFloat) } diff --git a/iOS/UIKit/UIViewController.swift b/iOS/UIKit/UIViewController.swift index 053a09f..fb090d9 100644 --- a/iOS/UIKit/UIViewController.swift +++ b/iOS/UIKit/UIViewController.swift @@ -35,9 +35,9 @@ protocol UIContentContainer : NSObjectProtocol { @available(iOS 8.0, *) var preferredContentSize: CGSize { get } @available(iOS 8.0, *) - func preferredContentSizeDidChange(forChildContentContainer container: UIContentContainer) + @asyncHandler func preferredContentSizeDidChange(forChildContentContainer container: UIContentContainer) @available(iOS 8.0, *) - func systemLayoutFittingSizeDidChange(forChildContentContainer container: UIContentContainer) + @asyncHandler func systemLayoutFittingSizeDidChange(forChildContentContainer container: UIContentContainer) @available(iOS 8.0, *) func size(forChildContentContainer container: UIContentContainer, withParentContainerSize parentSize: CGSize) -> CGSize @available(iOS 8.0, *) @@ -119,7 +119,11 @@ class UIViewController : UIResponder, NSCoding, UIAppearanceContainer, UITraitEn @available(iOS 5.0, *) func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) @available(iOS 5.0, *) + func present(_ viewControllerToPresent: UIViewController, animated flag: Bool) async + @available(iOS 5.0, *) func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) + @available(iOS 5.0, *) + func dismiss(animated flag: Bool) async @available(iOS 3.0, *) var modalTransitionStyle: UIModalTransitionStyle @available(iOS 3.2, *) @@ -192,6 +196,8 @@ extension UIViewController { @available(iOS 5.0, *) func transition(from fromViewController: UIViewController, to toViewController: UIViewController, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(iOS 5.0, *) + func transition(from fromViewController: UIViewController, to toViewController: UIViewController, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool + @available(iOS 5.0, *) func beginAppearanceTransition(_ isAppearing: Bool, animated: Bool) @available(iOS 5.0, *) func endAppearanceTransition() diff --git a/iOS/UIKit/UIWebView.swift b/iOS/UIKit/UIWebView.swift index bb168f8..1813ee0 100644 --- a/iOS/UIKit/UIWebView.swift +++ b/iOS/UIKit/UIWebView.swift @@ -75,9 +75,9 @@ protocol UIWebViewDelegate : NSObjectProtocol { @available(iOS, introduced: 2.0, deprecated: 12.0, message: "No longer supported.") optional func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebView.NavigationType) -> Bool @available(iOS, introduced: 2.0, deprecated: 12.0, message: "No longer supported.") - optional func webViewDidStartLoad(_ webView: UIWebView) + @asyncHandler optional func webViewDidStartLoad(_ webView: UIWebView) @available(iOS, introduced: 2.0, deprecated: 12.0, message: "No longer supported.") - optional func webViewDidFinishLoad(_ webView: UIWebView) + @asyncHandler optional func webViewDidFinishLoad(_ webView: UIWebView) @available(iOS, introduced: 2.0, deprecated: 12.0, message: "No longer supported.") - optional func webView(_ webView: UIWebView, didFailLoadWithError error: Error) + @asyncHandler optional func webView(_ webView: UIWebView, didFailLoadWithError error: Error) } diff --git a/iOS/UIKit/UIWindowScene.swift b/iOS/UIKit/UIWindowScene.swift index 88049c7..485e510 100644 --- a/iOS/UIKit/UIWindowScene.swift +++ b/iOS/UIKit/UIWindowScene.swift @@ -12,8 +12,9 @@ class UIWindowScene : UIScene { @available(iOS 13.0, *) protocol UIWindowSceneDelegate : UISceneDelegate { optional var window: UIWindow? { get set } - optional func windowScene(_ windowScene: UIWindowScene, didUpdate previousCoordinateSpace: UICoordinateSpace, interfaceOrientation previousInterfaceOrientation: UIInterfaceOrientation, traitCollection previousTraitCollection: UITraitCollection) + @asyncHandler optional func windowScene(_ windowScene: UIWindowScene, didUpdate previousCoordinateSpace: UICoordinateSpace, interfaceOrientation previousInterfaceOrientation: UIInterfaceOrientation, traitCollection previousTraitCollection: UITraitCollection) optional func windowScene(_ windowScene: UIWindowScene, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) + optional func windowScene(_ windowScene: UIWindowScene, performActionFor shortcutItem: UIApplicationShortcutItem) async -> Bool } extension UISceneSession.Role { @available(iOS 13.0, *) diff --git a/iOS/UserNotifications/UNUserNotificationCenter.swift b/iOS/UserNotifications/UNUserNotificationCenter.swift index ae103f2..f85e288 100644 --- a/iOS/UserNotifications/UNUserNotificationCenter.swift +++ b/iOS/UserNotifications/UNUserNotificationCenter.swift @@ -22,14 +22,20 @@ class UNUserNotificationCenter : NSObject { var supportsContentExtensions: Bool { get } class func current() -> UNUserNotificationCenter func requestAuthorization(options: UNAuthorizationOptions = [], completionHandler: @escaping (Bool, Error?) -> Void) + func requestAuthorization(options: UNAuthorizationOptions = []) async throws -> Bool func setNotificationCategories(_ categories: Set) func getNotificationCategories(completionHandler: @escaping (Set) -> Void) + func getNotificationCategories() async -> Set func getNotificationSettings(completionHandler: @escaping (UNNotificationSettings) -> Void) + func getNotificationSettings() async -> UNNotificationSettings func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + func add(_ request: UNNotificationRequest) async throws func getPendingNotificationRequests(completionHandler: @escaping ([UNNotificationRequest]) -> Void) + func getPendingNotificationRequests() async -> [UNNotificationRequest] func removePendingNotificationRequests(withIdentifiers identifiers: [String]) func removeAllPendingNotificationRequests() func getDeliveredNotifications(completionHandler: @escaping ([UNNotification]) -> Void) + func getDeliveredNotifications() async -> [UNNotification] func removeDeliveredNotifications(withIdentifiers identifiers: [String]) func removeAllDeliveredNotifications() } @@ -51,7 +57,11 @@ protocol UNUserNotificationCenterDelegate : NSObjectProtocol { @available(iOS 10.0, *) optional func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) @available(iOS 10.0, *) - optional func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) + optional func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification) async -> UNNotificationPresentationOptions + @available(iOS 10.0, *) + @asyncHandler optional func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) + @available(iOS 10.0, *) + optional func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async @available(iOS 12.0, *) optional func userNotificationCenter(_ center: UNUserNotificationCenter, openSettingsFor notification: UNNotification?) } diff --git a/iOS/UserNotificationsUI/UNNotificationContentExtension.swift b/iOS/UserNotificationsUI/UNNotificationContentExtension.swift index 98c46b3..17603c9 100644 --- a/iOS/UserNotificationsUI/UNNotificationContentExtension.swift +++ b/iOS/UserNotificationsUI/UNNotificationContentExtension.swift @@ -17,8 +17,9 @@ enum UNNotificationContentExtensionResponseOption : UInt { } @available(iOS 10.0, *) protocol UNNotificationContentExtension : NSObjectProtocol { - func didReceive(_ notification: UNNotification) - optional func didReceive(_ response: UNNotificationResponse, completionHandler completion: @escaping (UNNotificationContentExtensionResponseOption) -> Void) + @asyncHandler func didReceive(_ notification: UNNotification) + @asyncHandler optional func didReceive(_ response: UNNotificationResponse, completionHandler completion: @escaping (UNNotificationContentExtensionResponseOption) -> Void) + optional func didReceive(_ response: UNNotificationResponse) async -> UNNotificationContentExtensionResponseOption optional var mediaPlayPauseButtonType: UNNotificationContentExtensionMediaPlayPauseButtonType { get } optional var mediaPlayPauseButtonFrame: CGRect { get } @NSCopying optional var mediaPlayPauseButtonTintColor: UIColor { get } diff --git a/iOS/VideoSubscriberAccount/VSAccountManager.swift b/iOS/VideoSubscriberAccount/VSAccountManager.swift index d311acb..f792cea 100644 --- a/iOS/VideoSubscriberAccount/VSAccountManager.swift +++ b/iOS/VideoSubscriberAccount/VSAccountManager.swift @@ -24,6 +24,7 @@ extension VSCheckAccessOption { class VSAccountManager : NSObject { weak var delegate: @sil_weak VSAccountManagerDelegate? func checkAccessStatus(options: [VSCheckAccessOption : Any] = [:], completionHandler: @escaping (VSAccountAccessStatus, Error?) -> Void) + func checkAccessStatus(options: [VSCheckAccessOption : Any] = [:]) async throws -> VSAccountAccessStatus func enqueue(_ request: VSAccountMetadataRequest, completionHandler: @escaping (VSAccountMetadata?, Error?) -> Void) -> VSAccountManagerResult } @available(iOS 10.0, *) diff --git a/iOS/VisionKit/VNDocumentCameraViewController.swift b/iOS/VisionKit/VNDocumentCameraViewController.swift index 570f934..1fc482c 100644 --- a/iOS/VisionKit/VNDocumentCameraViewController.swift +++ b/iOS/VisionKit/VNDocumentCameraViewController.swift @@ -6,7 +6,7 @@ class VNDocumentCameraViewController : UIViewController { } @available(iOS 13.0, *) protocol VNDocumentCameraViewControllerDelegate : NSObjectProtocol { - optional func documentCameraViewController(_ controller: VNDocumentCameraViewController, didFinishWith scan: VNDocumentCameraScan) - optional func documentCameraViewControllerDidCancel(_ controller: VNDocumentCameraViewController) - optional func documentCameraViewController(_ controller: VNDocumentCameraViewController, didFailWithError error: Error) + @asyncHandler optional func documentCameraViewController(_ controller: VNDocumentCameraViewController, didFinishWith scan: VNDocumentCameraScan) + @asyncHandler optional func documentCameraViewControllerDidCancel(_ controller: VNDocumentCameraViewController) + @asyncHandler optional func documentCameraViewController(_ controller: VNDocumentCameraViewController, didFailWithError error: Error) } diff --git a/iOS/WatchConnectivity/WCSession.swift b/iOS/WatchConnectivity/WCSession.swift index f4f0d9f..55c3233 100644 --- a/iOS/WatchConnectivity/WCSession.swift +++ b/iOS/WatchConnectivity/WCSession.swift @@ -39,29 +39,29 @@ protocol WCSessionDelegate : NSObjectProtocol { @available(iOS 9.3, *) func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) @available(iOS 9.3, *) - func sessionDidBecomeInactive(_ session: WCSession) + @asyncHandler func sessionDidBecomeInactive(_ session: WCSession) @available(iOS 9.3, *) - func sessionDidDeactivate(_ session: WCSession) + @asyncHandler func sessionDidDeactivate(_ session: WCSession) @available(iOS 9.0, *) - optional func sessionWatchStateDidChange(_ session: WCSession) + @asyncHandler optional func sessionWatchStateDidChange(_ session: WCSession) @available(iOS 9.0, *) - optional func sessionReachabilityDidChange(_ session: WCSession) + @asyncHandler optional func sessionReachabilityDidChange(_ session: WCSession) @available(iOS 9.0, *) - optional func session(_ session: WCSession, didReceiveMessage message: [String : Any]) + @asyncHandler optional func session(_ session: WCSession, didReceiveMessage message: [String : Any]) @available(iOS 9.0, *) - optional func session(_ session: WCSession, didReceiveMessage message: [String : Any], replyHandler: @escaping ([String : Any]) -> Void) + @asyncHandler optional func session(_ session: WCSession, didReceiveMessage message: [String : Any], replyHandler: @escaping ([String : Any]) -> Void) @available(iOS 9.0, *) - optional func session(_ session: WCSession, didReceiveMessageData messageData: Data) + @asyncHandler optional func session(_ session: WCSession, didReceiveMessageData messageData: Data) @available(iOS 9.0, *) - optional func session(_ session: WCSession, didReceiveMessageData messageData: Data, replyHandler: @escaping (Data) -> Void) + @asyncHandler optional func session(_ session: WCSession, didReceiveMessageData messageData: Data, replyHandler: @escaping (Data) -> Void) @available(iOS 9.0, *) - optional func session(_ session: WCSession, didReceiveApplicationContext applicationContext: [String : Any]) + @asyncHandler optional func session(_ session: WCSession, didReceiveApplicationContext applicationContext: [String : Any]) @available(iOS 9.0, *) - optional func session(_ session: WCSession, didFinish userInfoTransfer: WCSessionUserInfoTransfer, error: Error?) + @asyncHandler optional func session(_ session: WCSession, didFinish userInfoTransfer: WCSessionUserInfoTransfer, error: Error?) @available(iOS 9.0, *) - optional func session(_ session: WCSession, didReceiveUserInfo userInfo: [String : Any] = [:]) + @asyncHandler optional func session(_ session: WCSession, didReceiveUserInfo userInfo: [String : Any] = [:]) @available(iOS 9.0, *) - optional func session(_ session: WCSession, didFinish fileTransfer: WCSessionFileTransfer, error: Error?) + @asyncHandler optional func session(_ session: WCSession, didFinish fileTransfer: WCSessionFileTransfer, error: Error?) @available(iOS 9.0, *) - optional func session(_ session: WCSession, didReceive file: WCSessionFile) + @asyncHandler optional func session(_ session: WCSession, didReceive file: WCSessionFile) } diff --git a/iOS/WebKit/NSAttributedString.swift b/iOS/WebKit/NSAttributedString.swift index 19b0962..1016e4e 100644 --- a/iOS/WebKit/NSAttributedString.swift +++ b/iOS/WebKit/NSAttributedString.swift @@ -11,9 +11,17 @@ extension NSAttributedString { @available(iOS 13.0, *) class func loadFromHTML(request: URLRequest, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], completionHandler: @escaping NSAttributedString.CompletionHandler) @available(iOS 13.0, *) + class func loadFromHTML(request: URLRequest, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString?, [NSAttributedString.DocumentAttributeKey : Any]?) + @available(iOS 13.0, *) class func loadFromHTML(fileURL: URL, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], completionHandler: @escaping NSAttributedString.CompletionHandler) @available(iOS 13.0, *) + class func loadFromHTML(fileURL: URL, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString?, [NSAttributedString.DocumentAttributeKey : Any]?) + @available(iOS 13.0, *) class func loadFromHTML(string: String, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], completionHandler: @escaping NSAttributedString.CompletionHandler) @available(iOS 13.0, *) + class func loadFromHTML(string: String, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString?, [NSAttributedString.DocumentAttributeKey : Any]?) + @available(iOS 13.0, *) class func loadFromHTML(data: Data, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], completionHandler: @escaping NSAttributedString.CompletionHandler) + @available(iOS 13.0, *) + class func loadFromHTML(data: Data, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString?, [NSAttributedString.DocumentAttributeKey : Any]?) } diff --git a/iOS/WebKit/WKContentRuleListStore.swift b/iOS/WebKit/WKContentRuleListStore.swift index 25110b1..78e6370 100644 --- a/iOS/WebKit/WKContentRuleListStore.swift +++ b/iOS/WebKit/WKContentRuleListStore.swift @@ -4,7 +4,11 @@ class WKContentRuleListStore : NSObject { class func `default`() -> Self! convenience init!(url: URL!) func compileContentRuleList(forIdentifier identifier: String!, encodedContentRuleList: String!, completionHandler: ((WKContentRuleList?, Error?) -> Void)!) + func compileContentRuleList(forIdentifier identifier: String!, encodedContentRuleList: String!) async throws -> WKContentRuleList? func lookUpContentRuleList(forIdentifier identifier: String!, completionHandler: ((WKContentRuleList?, Error?) -> Void)!) + func lookUpContentRuleList(forIdentifier identifier: String!) async throws -> WKContentRuleList? func removeContentRuleList(forIdentifier identifier: String!, completionHandler: ((Error?) -> Void)!) + func removeContentRuleList(forIdentifier identifier: String!) async throws func getAvailableContentRuleListIdentifiers(_ completionHandler: (([String]?) -> Void)!) + func getAvailableContentRuleListIdentifiers() async -> [String]? } diff --git a/iOS/WebKit/WKHTTPCookieStore.swift b/iOS/WebKit/WKHTTPCookieStore.swift index d951ea7..0be1db5 100644 --- a/iOS/WebKit/WKHTTPCookieStore.swift +++ b/iOS/WebKit/WKHTTPCookieStore.swift @@ -1,13 +1,16 @@ @available(iOS 11.0, *) protocol WKHTTPCookieStoreObserver : NSObjectProtocol { - optional func cookiesDidChange(in cookieStore: WKHTTPCookieStore) + @asyncHandler optional func cookiesDidChange(in cookieStore: WKHTTPCookieStore) } @available(iOS 11.0, *) class WKHTTPCookieStore : NSObject { func getAllCookies(_ completionHandler: @escaping ([HTTPCookie]) -> Void) + func getAllCookies() async -> [HTTPCookie] func setCookie(_ cookie: HTTPCookie, completionHandler: (() -> Void)? = nil) + func setCookie(_ cookie: HTTPCookie) async func delete(_ cookie: HTTPCookie, completionHandler: (() -> Void)? = nil) + func delete(_ cookie: HTTPCookie) async func add(_ observer: WKHTTPCookieStoreObserver) func remove(_ observer: WKHTTPCookieStoreObserver) } diff --git a/iOS/WebKit/WKNavigationDelegate.swift b/iOS/WebKit/WKNavigationDelegate.swift index 5ebea85..0ae3095 100644 --- a/iOS/WebKit/WKNavigationDelegate.swift +++ b/iOS/WebKit/WKNavigationDelegate.swift @@ -21,21 +21,23 @@ protocol WKNavigationDelegate : NSObjectProtocol { @available(iOS 8.0, *) optional func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void) @available(iOS 8.0, *) - optional func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) + @asyncHandler optional func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) @available(iOS 8.0, *) - optional func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) + @asyncHandler optional func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) @available(iOS 8.0, *) - optional func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) + @asyncHandler optional func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) @available(iOS 8.0, *) - optional func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) + @asyncHandler optional func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) @available(iOS 8.0, *) - optional func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) + @asyncHandler optional func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) @available(iOS 8.0, *) - optional func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) + @asyncHandler optional func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) @available(iOS 8.0, *) - optional func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + @asyncHandler optional func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + @available(iOS 8.0, *) + optional func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) @available(iOS 9.0, *) - optional func webViewWebContentProcessDidTerminate(_ webView: WKWebView) + @asyncHandler optional func webViewWebContentProcessDidTerminate(_ webView: WKWebView) @available(iOS 14.0, *) optional func webView(_ webView: WKWebView, authenticationChallenge challenge: URLAuthenticationChallenge, shouldAllowDeprecatedTLS decisionHandler: @escaping (Bool) -> Void) } diff --git a/iOS/WebKit/WKScriptMessageHandler.swift b/iOS/WebKit/WKScriptMessageHandler.swift index 5353228..ad44949 100644 --- a/iOS/WebKit/WKScriptMessageHandler.swift +++ b/iOS/WebKit/WKScriptMessageHandler.swift @@ -1,5 +1,5 @@ protocol WKScriptMessageHandler : NSObjectProtocol { @available(iOS 8.0, *) - func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) + @asyncHandler func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) } diff --git a/iOS/WebKit/WKScriptMessageHandlerWithReply.swift b/iOS/WebKit/WKScriptMessageHandlerWithReply.swift index c1e8c04..f44e724 100644 --- a/iOS/WebKit/WKScriptMessageHandlerWithReply.swift +++ b/iOS/WebKit/WKScriptMessageHandlerWithReply.swift @@ -1,5 +1,5 @@ protocol WKScriptMessageHandlerWithReply : NSObjectProtocol { @available(iOS 14.0, *) - func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage, replyHandler: @escaping (Any?, String?) -> Void) + @asyncHandler func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage, replyHandler: @escaping (Any?, String?) -> Void) } diff --git a/iOS/WebKit/WKUIDelegate.swift b/iOS/WebKit/WKUIDelegate.swift index aef90b2..5752bd3 100644 --- a/iOS/WebKit/WKUIDelegate.swift +++ b/iOS/WebKit/WKUIDelegate.swift @@ -3,13 +3,19 @@ protocol WKUIDelegate : NSObjectProtocol { @available(iOS 8.0, *) optional func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? @available(iOS 9.0, *) - optional func webViewDidClose(_ webView: WKWebView) + @asyncHandler optional func webViewDidClose(_ webView: WKWebView) @available(iOS 8.0, *) optional func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -> Void) @available(iOS 8.0, *) + optional func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo) async + @available(iOS 8.0, *) optional func webView(_ webView: WKWebView, runJavaScriptConfirmPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping (Bool) -> Void) @available(iOS 8.0, *) + optional func webView(_ webView: WKWebView, runJavaScriptConfirmPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo) async -> Bool + @available(iOS 8.0, *) optional func webView(_ webView: WKWebView, runJavaScriptTextInputPanelWithPrompt prompt: String, defaultText: String?, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping (String?) -> Void) + @available(iOS 8.0, *) + optional func webView(_ webView: WKWebView, runJavaScriptTextInputPanelWithPrompt prompt: String, defaultText: String?, initiatedByFrame frame: WKFrameInfo) async -> String? @available(iOS, introduced: 10.0, deprecated: 13.0) optional func webView(_ webView: WKWebView, shouldPreviewElement elementInfo: WKPreviewElementInfo) -> Bool @available(iOS, introduced: 10.0, deprecated: 13.0) @@ -19,6 +25,8 @@ protocol WKUIDelegate : NSObjectProtocol { @available(iOS 13.0, *) optional func webView(_ webView: WKWebView, contextMenuConfigurationForElement elementInfo: WKContextMenuElementInfo, completionHandler: @escaping (UIContextMenuConfiguration?) -> Void) @available(iOS 13.0, *) + optional func webView(_ webView: WKWebView, contextMenuConfigurationForElement elementInfo: WKContextMenuElementInfo) async -> UIContextMenuConfiguration? + @available(iOS 13.0, *) optional func webView(_ webView: WKWebView, contextMenuWillPresentForElement elementInfo: WKContextMenuElementInfo) @available(iOS 13.0, *) optional func webView(_ webView: WKWebView, contextMenuForElement elementInfo: WKContextMenuElementInfo, willCommitWithAnimator animator: UIContextMenuInteractionCommitAnimating) diff --git a/iOS/WebKit/WKURLSchemeTask.swift b/iOS/WebKit/WKURLSchemeTask.swift index f23b5f4..6457622 100644 --- a/iOS/WebKit/WKURLSchemeTask.swift +++ b/iOS/WebKit/WKURLSchemeTask.swift @@ -2,8 +2,8 @@ @available(iOS 11.0, *) protocol WKURLSchemeTask : NSObjectProtocol { var request: URLRequest { get } - func didReceive(_ response: URLResponse) - func didReceive(_ data: Data) - func didFinish() - func didFailWithError(_ error: Error) + @asyncHandler func didReceive(_ response: URLResponse) + @asyncHandler func didReceive(_ data: Data) + @asyncHandler func didFinish() + @asyncHandler func didFailWithError(_ error: Error) } diff --git a/iOS/WebKit/WKWebView.swift b/iOS/WebKit/WKWebView.swift index c74e7b1..98a0276 100644 --- a/iOS/WebKit/WKWebView.swift +++ b/iOS/WebKit/WKWebView.swift @@ -28,16 +28,27 @@ class WKWebView : UIView { func reloadFromOrigin() -> WKNavigation? func stopLoading() func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, Error?) -> Void)? = nil) + func evaluateJavaScript(_ javaScriptString: String) async throws -> Any? @available(iOS 14.0, *) func __evaluateJavaScript(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld, completionHandler: ((Any?, Error?) -> Void)? = nil) @available(iOS 14.0, *) + func __evaluateJavaScript(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any? + @available(iOS 14.0, *) func __callAsyncJavaScript(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld, completionHandler: ((Any?, Error?) -> Void)? = nil) + @available(iOS 14.0, *) + func __callAsyncJavaScript(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any? @available(iOS 11.0, *) func takeSnapshot(with snapshotConfiguration: WKSnapshotConfiguration?, completionHandler: @escaping (UIImage?, Error?) -> Void) + @available(iOS 11.0, *) + func takeSnapshot(with snapshotConfiguration: WKSnapshotConfiguration?) async throws -> UIImage? @available(iOS 14.0, *) func __createPDF(with pdfConfiguration: WKPDFConfiguration?, completionHandler: @escaping (Data?, Error?) -> Void) @available(iOS 14.0, *) + func __createPDF(with pdfConfiguration: WKPDFConfiguration?) async throws -> Data? + @available(iOS 14.0, *) func __createWebArchiveData(completionHandler: @escaping (Data, Error) -> Void) + @available(iOS 14.0, *) + func __createWebArchiveData() async -> (Data, Error) var allowsBackForwardNavigationGestures: Bool @available(iOS 9.0, *) var customUserAgent: String? @@ -48,6 +59,8 @@ class WKWebView : UIView { var pageZoom: CGFloat @available(iOS 14.0, *) func __find(_ string: String, with configuration: WKFindConfiguration?, completionHandler: @escaping (WKFindResult) -> Void) + @available(iOS 14.0, *) + func __find(_ string: String, with configuration: WKFindConfiguration?) async -> WKFindResult @available(iOS 11.0, *) class func handlesURLScheme(_ urlScheme: String) -> Bool @available(iOS 14.0, *) diff --git a/iOS/WebKit/WKWebsiteDataStore.swift b/iOS/WebKit/WKWebsiteDataStore.swift index 95488f3..aaab218 100644 --- a/iOS/WebKit/WKWebsiteDataStore.swift +++ b/iOS/WebKit/WKWebsiteDataStore.swift @@ -6,8 +6,11 @@ class WKWebsiteDataStore : NSObject, NSSecureCoding { var isPersistent: Bool { get } class func allWebsiteDataTypes() -> Set func fetchDataRecords(ofTypes dataTypes: Set, completionHandler: @escaping ([WKWebsiteDataRecord]) -> Void) + func fetchDataRecords(ofTypes dataTypes: Set) async -> [WKWebsiteDataRecord] func removeData(ofTypes dataTypes: Set, for dataRecords: [WKWebsiteDataRecord], completionHandler: @escaping () -> Void) + func removeData(ofTypes dataTypes: Set, for dataRecords: [WKWebsiteDataRecord]) async func removeData(ofTypes dataTypes: Set, modifiedSince date: Date, completionHandler: @escaping () -> Void) + func removeData(ofTypes dataTypes: Set, modifiedSince date: Date) async @available(iOS 11.0, *) var httpCookieStore: WKHTTPCookieStore { get } } diff --git a/iOS/iAd/ADBannerView.swift b/iOS/iAd/ADBannerView.swift index 0ccf87e..2e77a2f 100644 --- a/iOS/iAd/ADBannerView.swift +++ b/iOS/iAd/ADBannerView.swift @@ -41,10 +41,10 @@ class ADBannerView : UIView { protocol ADBannerViewDelegate : NSObjectProtocol { @available(iOS 5.0, *) optional func bannerViewWillLoadAd(_ banner: ADBannerView) - optional func bannerViewDidLoadAd(_ banner: ADBannerView) - optional func bannerView(_ banner: ADBannerView, didFailToReceiveAdWithError error: Error) + @asyncHandler optional func bannerViewDidLoadAd(_ banner: ADBannerView) + @asyncHandler optional func bannerView(_ banner: ADBannerView, didFailToReceiveAdWithError error: Error) optional func bannerViewActionShouldBegin(_ banner: ADBannerView, willLeaveApplication willLeave: Bool) -> Bool - optional func bannerViewActionDidFinish(_ banner: ADBannerView) + @asyncHandler optional func bannerViewActionDidFinish(_ banner: ADBannerView) } @available(iOS, introduced: 12.0, deprecated: 13.0) func ADClampedBannerSize(_ size: CGSize) -> CGSize diff --git a/iOS/iAd/ADClient.swift b/iOS/iAd/ADClient.swift index 6c2158e..962852c 100644 --- a/iOS/iAd/ADClient.swift +++ b/iOS/iAd/ADClient.swift @@ -24,10 +24,16 @@ class ADClient : NSObject { class func shared() -> ADClient @available(iOS, introduced: 7.1, deprecated: 9.0, message: "Use requestAttributionDetailsWithBlock instead.") func determineAppInstallationAttribution(completionHandler: @escaping (Bool) -> Void) + @available(iOS, introduced: 7.1, deprecated: 9.0, message: "Use requestAttributionDetailsWithBlock instead.") + func determineAppInstallationAttribution() async -> Bool @available(iOS, introduced: 8.0, deprecated: 9.0, message: "Use requestAttributionDetailsWithBlock instead.") func lookupAdConversionDetails(_ completionHandler: @escaping (Date?, Date?) -> Void) + @available(iOS, introduced: 8.0, deprecated: 9.0, message: "Use requestAttributionDetailsWithBlock instead.") + func lookupAdConversionDetails() async -> (Date?, Date?) @available(iOS 9.0, *) func requestAttributionDetails(_ completionHandler: @escaping ([String : NSObject]?, Error?) -> Void) + @available(iOS 9.0, *) + func requestAttributionDetailsWithBlock() async throws -> [String : NSObject]? @available(iOS, introduced: 8.0, deprecated: 13.0) func add(toSegments segmentIdentifiers: [String], replaceExisting: Bool) } diff --git a/iOS/iAd/ADInterstitialAd.swift b/iOS/iAd/ADInterstitialAd.swift index c5bb5c0..f2ceb8e 100644 --- a/iOS/iAd/ADInterstitialAd.swift +++ b/iOS/iAd/ADInterstitialAd.swift @@ -10,13 +10,13 @@ class ADInterstitialAd : NSObject { } @available(iOS, introduced: 4.3, deprecated: 10.0) protocol ADInterstitialAdDelegate : NSObjectProtocol { - func interstitialAdDidUnload(_ interstitialAd: ADInterstitialAd) - func interstitialAd(_ interstitialAd: ADInterstitialAd, didFailWithError error: Error) + @asyncHandler func interstitialAdDidUnload(_ interstitialAd: ADInterstitialAd) + @asyncHandler func interstitialAd(_ interstitialAd: ADInterstitialAd, didFailWithError error: Error) @available(iOS 5.0, *) optional func interstitialAdWillLoad(_ interstitialAd: ADInterstitialAd) - optional func interstitialAdDidLoad(_ interstitialAd: ADInterstitialAd) + @asyncHandler optional func interstitialAdDidLoad(_ interstitialAd: ADInterstitialAd) optional func interstitialAdActionShouldBegin(_ interstitialAd: ADInterstitialAd, willLeaveApplication willLeave: Bool) -> Bool - optional func interstitialAdActionDidFinish(_ interstitialAd: ADInterstitialAd) + @asyncHandler optional func interstitialAdActionDidFinish(_ interstitialAd: ADInterstitialAd) } @available(iOS, introduced: 12.0, deprecated: 13.0) class ADInterstitialAdPresentationViewController : UIViewController { diff --git a/iOS/iAd/AVPlayerViewController_iAdPreroll.swift b/iOS/iAd/AVPlayerViewController_iAdPreroll.swift index 3d7a1fc..82c69fd 100644 --- a/iOS/iAd/AVPlayerViewController_iAdPreroll.swift +++ b/iOS/iAd/AVPlayerViewController_iAdPreroll.swift @@ -6,5 +6,7 @@ extension AVPlayerViewController { @available(iOS 8.0, *) func playPrerollAd(completionHandler: @escaping (Error?) -> Void) @available(iOS 8.0, *) + func playPrerollAd() async throws + @available(iOS 8.0, *) func cancelPreroll() } diff --git a/macOS/AVFoundation/AVAssetExportSession.swift b/macOS/AVFoundation/AVAssetExportSession.swift index 697989b..214b325 100644 --- a/macOS/AVFoundation/AVAssetExportSession.swift +++ b/macOS/AVFoundation/AVAssetExportSession.swift @@ -73,6 +73,7 @@ class AVAssetExportSession : NSObject { var status: AVAssetExportSession.Status { get } var error: Error? { get } func exportAsynchronously(completionHandler handler: @escaping () -> Void) + func exportAsynchronously() async var progress: Float { get } func cancelExport() } @@ -81,11 +82,15 @@ extension AVAssetExportSession { class func exportPresets(compatibleWith asset: AVAsset) -> [String] @available(macOS 10.9, *) class func determineCompatibility(ofExportPreset presetName: String, with asset: AVAsset, outputFileType: AVFileType?, completionHandler handler: @escaping (Bool) -> Void) + @available(macOS 10.9, *) + class func determineCompatibility(ofExportPreset presetName: String, with asset: AVAsset, outputFileType: AVFileType?) async -> Bool } extension AVAssetExportSession { var supportedFileTypes: [AVFileType] { get } @available(macOS 10.9, *) func determineCompatibleFileTypes(completionHandler handler: @escaping ([AVFileType]) -> Void) + @available(macOS 10.9, *) + func determineCompatibleFileTypes() async -> [AVFileType] } extension AVAssetExportSession { var timeRange: CMTimeRange @@ -98,7 +103,11 @@ extension AVAssetExportSession { @available(macOS 10.15, *) func estimateMaximumDuration(completionHandler handler: @escaping (CMTime, Error?) -> Void) @available(macOS 10.15, *) + func estimateMaximumDuration() async throws -> CMTime + @available(macOS 10.15, *) func estimateOutputFileLength(completionHandler handler: @escaping (Int64, Error?) -> Void) + @available(macOS 10.15, *) + func estimateOutputFileLength() async throws -> Int64 } extension AVAssetExportSession { var metadata: [AVMetadataItem]? diff --git a/macOS/AVFoundation/AVAssetImageGenerator.swift b/macOS/AVFoundation/AVAssetImageGenerator.swift index e0d9069..7febc78 100644 --- a/macOS/AVFoundation/AVAssetImageGenerator.swift +++ b/macOS/AVFoundation/AVAssetImageGenerator.swift @@ -38,6 +38,7 @@ class AVAssetImageGenerator : NSObject { init(asset: AVAsset) func copyCGImage(at requestedTime: CMTime, actualTime: UnsafeMutablePointer?) throws -> CGImage func generateCGImagesAsynchronously(forTimes requestedTimes: [NSValue], completionHandler handler: @escaping AVAssetImageGeneratorCompletionHandler) + func generateCGImagesAsynchronously(forTimes requestedTimes: [NSValue]) async throws -> (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result) func cancelAllCGImageGeneration() } typealias AVAssetImageGeneratorCompletionHandler = (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result, Error?) -> Void diff --git a/macOS/AVFoundation/AVAssetResourceLoader.swift b/macOS/AVFoundation/AVAssetResourceLoader.swift index 3701088..27f68c3 100644 --- a/macOS/AVFoundation/AVAssetResourceLoader.swift +++ b/macOS/AVFoundation/AVAssetResourceLoader.swift @@ -11,11 +11,11 @@ protocol AVAssetResourceLoaderDelegate : NSObjectProtocol { @available(macOS 10.10, *) optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForRenewalOfRequestedResource renewalRequest: AVAssetResourceRenewalRequest) -> Bool @available(macOS 10.9, *) - optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel loadingRequest: AVAssetResourceLoadingRequest) + @asyncHandler optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel loadingRequest: AVAssetResourceLoadingRequest) @available(macOS 10.10, *) optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForResponseTo authenticationChallenge: URLAuthenticationChallenge) -> Bool @available(macOS 10.10, *) - optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel authenticationChallenge: URLAuthenticationChallenge) + @asyncHandler optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel authenticationChallenge: URLAuthenticationChallenge) } @available(macOS 10.14, *) class AVAssetResourceLoadingRequestor : NSObject { diff --git a/macOS/AVFoundation/AVAssetWriter.swift b/macOS/AVFoundation/AVAssetWriter.swift index 5502595..c805e6f 100644 --- a/macOS/AVFoundation/AVAssetWriter.swift +++ b/macOS/AVFoundation/AVAssetWriter.swift @@ -35,6 +35,8 @@ class AVAssetWriter : NSObject { func cancelWriting() @available(macOS 10.9, *) func finishWriting(completionHandler handler: @escaping () -> Void) + @available(macOS 10.9, *) + func finishWriting() async } extension AVAssetWriter { var movieFragmentInterval: CMTime @@ -74,6 +76,6 @@ extension AVAssetWriter { } @available(macOS 11.0, *) protocol AVAssetWriterDelegate : NSObjectProtocol { - optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType, segmentReport: AVAssetSegmentReport?) - optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType) + @asyncHandler optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType, segmentReport: AVAssetSegmentReport?) + @asyncHandler optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType) } diff --git a/macOS/AVFoundation/AVAsynchronousKeyValueLoading.swift b/macOS/AVFoundation/AVAsynchronousKeyValueLoading.swift index a340868..cd4a315 100644 --- a/macOS/AVFoundation/AVAsynchronousKeyValueLoading.swift +++ b/macOS/AVFoundation/AVAsynchronousKeyValueLoading.swift @@ -11,4 +11,5 @@ enum AVKeyValueStatus : Int { protocol AVAsynchronousKeyValueLoading { func statusOfValue(forKey key: String, error outError: NSErrorPointer) -> AVKeyValueStatus func loadValuesAsynchronously(forKeys keys: [String], completionHandler handler: (() -> Void)? = nil) + func loadValuesAsynchronously(forKeys keys: [String]) async } diff --git a/macOS/AVFoundation/AVCaptureAudioDataOutput.swift b/macOS/AVFoundation/AVCaptureAudioDataOutput.swift index 9337806..177c9f1 100644 --- a/macOS/AVFoundation/AVCaptureAudioDataOutput.swift +++ b/macOS/AVFoundation/AVCaptureAudioDataOutput.swift @@ -10,5 +10,5 @@ class AVCaptureAudioDataOutput : AVCaptureOutput { } @available(macOS 10.7, *) protocol AVCaptureAudioDataOutputSampleBufferDelegate : NSObjectProtocol { - optional func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) + @asyncHandler optional func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) } diff --git a/macOS/AVFoundation/AVCaptureDevice.swift b/macOS/AVFoundation/AVCaptureDevice.swift index 01b1bfe..3646514 100644 --- a/macOS/AVFoundation/AVCaptureDevice.swift +++ b/macOS/AVFoundation/AVCaptureDevice.swift @@ -206,6 +206,8 @@ extension AVCaptureDevice { class func authorizationStatus(for mediaType: AVMediaType) -> AVAuthorizationStatus @available(macOS 10.14, *) class func requestAccess(for mediaType: AVMediaType, completionHandler handler: @escaping (Bool) -> Void) + @available(macOS 10.14, *) + class func requestAccess(for mediaType: AVMediaType) async -> Bool } extension AVCaptureDevice { var transportControlsSupported: Bool { get } diff --git a/macOS/AVFoundation/AVCaptureFileOutput.swift b/macOS/AVFoundation/AVCaptureFileOutput.swift index e3699f0..5a45a7f 100644 --- a/macOS/AVFoundation/AVCaptureFileOutput.swift +++ b/macOS/AVFoundation/AVCaptureFileOutput.swift @@ -17,17 +17,17 @@ class AVCaptureFileOutput : AVCaptureOutput { } @available(macOS 10.7, *) protocol AVCaptureFileOutputRecordingDelegate : NSObjectProtocol { - optional func fileOutput(_ output: AVCaptureFileOutput, didStartRecordingTo fileURL: URL, from connections: [AVCaptureConnection]) - optional func fileOutput(_ output: AVCaptureFileOutput, didPauseRecordingTo fileURL: URL, from connections: [AVCaptureConnection]) - optional func fileOutput(_ output: AVCaptureFileOutput, didResumeRecordingTo fileURL: URL, from connections: [AVCaptureConnection]) + @asyncHandler optional func fileOutput(_ output: AVCaptureFileOutput, didStartRecordingTo fileURL: URL, from connections: [AVCaptureConnection]) + @asyncHandler optional func fileOutput(_ output: AVCaptureFileOutput, didPauseRecordingTo fileURL: URL, from connections: [AVCaptureConnection]) + @asyncHandler optional func fileOutput(_ output: AVCaptureFileOutput, didResumeRecordingTo fileURL: URL, from connections: [AVCaptureConnection]) optional func fileOutput(_ output: AVCaptureFileOutput, willFinishRecordingTo fileURL: URL, from connections: [AVCaptureConnection], error: Error?) - func fileOutput(_ output: AVCaptureFileOutput, didFinishRecordingTo outputFileURL: URL, from connections: [AVCaptureConnection], error: Error?) + @asyncHandler func fileOutput(_ output: AVCaptureFileOutput, didFinishRecordingTo outputFileURL: URL, from connections: [AVCaptureConnection], error: Error?) } @available(macOS 10.7, *) protocol AVCaptureFileOutputDelegate : NSObjectProtocol { @available(macOS 10.8, *) func fileOutputShouldProvideSampleAccurateRecordingStart(_ output: AVCaptureFileOutput) -> Bool - optional func fileOutput(_ output: AVCaptureFileOutput, didOutputSampleBuffer sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) + @asyncHandler optional func fileOutput(_ output: AVCaptureFileOutput, didOutputSampleBuffer sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) } @available(macOS 10.7, *) class AVCaptureMovieFileOutput : AVCaptureFileOutput { diff --git a/macOS/AVFoundation/AVCapturePhotoOutput.swift b/macOS/AVFoundation/AVCapturePhotoOutput.swift index 9219df1..6892225 100644 --- a/macOS/AVFoundation/AVCapturePhotoOutput.swift +++ b/macOS/AVFoundation/AVCapturePhotoOutput.swift @@ -23,9 +23,9 @@ extension AVCapturePhotoOutput { protocol AVCapturePhotoCaptureDelegate : NSObjectProtocol { optional func photoOutput(_ output: AVCapturePhotoOutput, willBeginCaptureFor resolvedSettings: AVCaptureResolvedPhotoSettings) optional func photoOutput(_ output: AVCapturePhotoOutput, willCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings) - optional func photoOutput(_ output: AVCapturePhotoOutput, didCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings) - optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) - optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishCaptureFor resolvedSettings: AVCaptureResolvedPhotoSettings, error: Error?) + @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings) + @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) + @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishCaptureFor resolvedSettings: AVCaptureResolvedPhotoSettings, error: Error?) } @available(macOS 10.15, *) class AVCapturePhotoSettings : NSObject, NSCopying { diff --git a/macOS/AVFoundation/AVCaptureStillImageOutput.swift b/macOS/AVFoundation/AVCaptureStillImageOutput.swift index df3244d..b94cffa 100644 --- a/macOS/AVFoundation/AVCaptureStillImageOutput.swift +++ b/macOS/AVFoundation/AVCaptureStillImageOutput.swift @@ -9,6 +9,7 @@ class AVCaptureStillImageOutput : AVCaptureOutput { @available(macOS 10.8, *) var isCapturingStillImage: Bool { get } func captureStillImageAsynchronously(from connection: AVCaptureConnection, completionHandler handler: @escaping (CMSampleBuffer?, Error?) -> Void) + func captureStillImageAsynchronously(from connection: AVCaptureConnection) async throws -> CMSampleBuffer? class func jpegStillImageNSDataRepresentation(_ jpegSampleBuffer: CMSampleBuffer) -> Data? } extension AVCaptureStillImageOutput { diff --git a/macOS/AVFoundation/AVCaptureVideoDataOutput.swift b/macOS/AVFoundation/AVCaptureVideoDataOutput.swift index a326660..b8ecd9b 100644 --- a/macOS/AVFoundation/AVCaptureVideoDataOutput.swift +++ b/macOS/AVFoundation/AVCaptureVideoDataOutput.swift @@ -22,6 +22,6 @@ extension AVCaptureVideoDataOutput { } @available(macOS 10.7, *) protocol AVCaptureVideoDataOutputSampleBufferDelegate : NSObjectProtocol { - optional func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) - optional func captureOutput(_ output: AVCaptureOutput, didDrop sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) + @asyncHandler optional func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) + @asyncHandler optional func captureOutput(_ output: AVCaptureOutput, didDrop sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) } diff --git a/macOS/AVFoundation/AVContentKeySession.swift b/macOS/AVFoundation/AVContentKeySession.swift index 0b760e3..2d3d432 100644 --- a/macOS/AVFoundation/AVContentKeySession.swift +++ b/macOS/AVFoundation/AVContentKeySession.swift @@ -30,9 +30,15 @@ class AVContentKeySession : NSObject { @available(macOS 10.15, *) func makeSecureTokenForExpirationDate(ofPersistableContentKey persistableContentKeyData: Data, completionHandler handler: @escaping (Data?, Error?) -> Void) @available(macOS 10.15, *) + func makeSecureTokenForExpirationDate(ofPersistableContentKey persistableContentKeyData: Data) async throws -> Data? + @available(macOS 10.15, *) func invalidatePersistableContentKey(_ persistableContentKeyData: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) @available(macOS 10.15, *) + func invalidatePersistableContentKey(_ persistableContentKeyData: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil) async throws -> Data? + @available(macOS 10.15, *) func invalidateAllPersistableContentKeys(forApp appIdentifier: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) + @available(macOS 10.15, *) + func invalidateAllPersistableContentKeys(forApp appIdentifier: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil) async throws -> Data? } struct AVContentKeySessionServerPlaybackContextOption : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable { init(rawValue: String) @@ -83,18 +89,18 @@ extension AVContentKeyRequest.RetryReason { } @available(macOS 10.12.4, *) protocol AVContentKeySessionDelegate : NSObjectProtocol { - func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest) - optional func contentKeySession(_ session: AVContentKeySession, didProvideRenewingContentKeyRequest keyRequest: AVContentKeyRequest) - optional func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVPersistableContentKeyRequest) + @asyncHandler func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest) + @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didProvideRenewingContentKeyRequest keyRequest: AVContentKeyRequest) + @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVPersistableContentKeyRequest) @available(macOS 10.15, *) - optional func contentKeySession(_ session: AVContentKeySession, didUpdatePersistableContentKey persistableContentKey: Data, forContentKeyIdentifier keyIdentifier: Any) - optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequest keyRequest: AVContentKeyRequest, didFailWithError err: Error) + @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didUpdatePersistableContentKey persistableContentKey: Data, forContentKeyIdentifier keyIdentifier: Any) + @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequest keyRequest: AVContentKeyRequest, didFailWithError err: Error) optional func contentKeySession(_ session: AVContentKeySession, shouldRetry keyRequest: AVContentKeyRequest, reason retryReason: AVContentKeyRequest.RetryReason) -> Bool @available(macOS 10.14, *) optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequestDidSucceed keyRequest: AVContentKeyRequest) - optional func contentKeySessionContentProtectionSessionIdentifierDidChange(_ session: AVContentKeySession) + @asyncHandler optional func contentKeySessionContentProtectionSessionIdentifierDidChange(_ session: AVContentKeySession) @available(macOS 10.14, *) - optional func contentKeySessionDidGenerateExpiredSessionReport(_ session: AVContentKeySession) + @asyncHandler optional func contentKeySessionDidGenerateExpiredSessionReport(_ session: AVContentKeySession) } @available(macOS 10.12.4, *) class AVContentKeyRequest : NSObject { @@ -106,6 +112,7 @@ class AVContentKeyRequest : NSObject { var options: [String : Any] { get } var canProvidePersistableContentKey: Bool { get } func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) + func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil) async throws -> Data? func processContentKeyResponse(_ keyResponse: AVContentKeyResponse) func processContentKeyResponseError(_ error: Error) @available(macOS 10.15, *) diff --git a/macOS/AVFoundation/AVPlayer.swift b/macOS/AVFoundation/AVPlayer.swift index 6f75389..c476504 100644 --- a/macOS/AVFoundation/AVPlayer.swift +++ b/macOS/AVFoundation/AVPlayer.swift @@ -66,12 +66,18 @@ extension AVPlayer { func seek(to date: Date) @available(macOS 10.7, *) func seek(to date: Date, completionHandler: @escaping (Bool) -> Void) + @available(macOS 10.7, *) + func seek(to date: Date) async -> Bool func seek(to time: CMTime) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) @available(macOS 10.7, *) func seek(to time: CMTime, completionHandler: @escaping (Bool) -> Void) @available(macOS 10.7, *) + func seek(to time: CMTime) async -> Bool + @available(macOS 10.7, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: @escaping (Bool) -> Void) + @available(macOS 10.7, *) + func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool } extension AVPlayer { @available(macOS 10.12, *) @@ -81,6 +87,8 @@ extension AVPlayer { @available(macOS 10.8, *) func preroll(atRate rate: Float, completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.8, *) + func preroll(atRate rate: Float) async -> Bool + @available(macOS 10.8, *) func cancelPendingPrerolls() @available(macOS 10.8, *) var masterClock: CMClock? diff --git a/macOS/AVFoundation/AVPlayerItem.swift b/macOS/AVFoundation/AVPlayerItem.swift index 470d6a9..cc18e2a 100644 --- a/macOS/AVFoundation/AVPlayerItem.swift +++ b/macOS/AVFoundation/AVPlayerItem.swift @@ -85,8 +85,12 @@ extension AVPlayerItem { @available(macOS 10.7, *) func seek(to time: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.7, *) + func seek(to time: CMTime) async -> Bool + @available(macOS 10.7, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.7, *) + func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + @available(macOS 10.7, *) func cancelPendingSeeks() func currentDate() -> Date? @available(macOS 10.9, *) diff --git a/macOS/AVFoundation/AVPlayerItemMediaDataCollector.swift b/macOS/AVFoundation/AVPlayerItemMediaDataCollector.swift index 51e6cb7..3733757 100644 --- a/macOS/AVFoundation/AVPlayerItemMediaDataCollector.swift +++ b/macOS/AVFoundation/AVPlayerItemMediaDataCollector.swift @@ -11,5 +11,5 @@ class AVPlayerItemMetadataCollector : AVPlayerItemMediaDataCollector { } protocol AVPlayerItemMetadataCollectorPushDelegate : NSObjectProtocol { @available(macOS 10.11.3, *) - func metadataCollector(_ metadataCollector: AVPlayerItemMetadataCollector, didCollect metadataGroups: [AVDateRangeMetadataGroup], indexesOfNewGroups: IndexSet, indexesOfModifiedGroups: IndexSet) + @asyncHandler func metadataCollector(_ metadataCollector: AVPlayerItemMetadataCollector, didCollect metadataGroups: [AVDateRangeMetadataGroup], indexesOfNewGroups: IndexSet, indexesOfModifiedGroups: IndexSet) } diff --git a/macOS/AVFoundation/AVPlayerItemOutput.swift b/macOS/AVFoundation/AVPlayerItemOutput.swift index 8a5fc85..b822a10 100644 --- a/macOS/AVFoundation/AVPlayerItemOutput.swift +++ b/macOS/AVFoundation/AVPlayerItemOutput.swift @@ -54,7 +54,7 @@ extension AVPlayerItemLegibleOutput.TextStylingResolution { } protocol AVPlayerItemLegibleOutputPushDelegate : AVPlayerItemOutputPushDelegate { @available(macOS 10.9, *) - optional func legibleOutput(_ output: AVPlayerItemLegibleOutput, didOutputAttributedStrings strings: [NSAttributedString], nativeSampleBuffers nativeSamples: [Any], forItemTime itemTime: CMTime) + @asyncHandler optional func legibleOutput(_ output: AVPlayerItemLegibleOutput, didOutputAttributedStrings strings: [NSAttributedString], nativeSampleBuffers nativeSamples: [Any], forItemTime itemTime: CMTime) } protocol AVPlayerItemOutputPushDelegate : NSObjectProtocol { @available(macOS 10.8, *) @@ -70,5 +70,5 @@ class AVPlayerItemMetadataOutput : AVPlayerItemOutput { } protocol AVPlayerItemMetadataOutputPushDelegate : AVPlayerItemOutputPushDelegate { @available(macOS 10.10, *) - optional func metadataOutput(_ output: AVPlayerItemMetadataOutput, didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup], from track: AVPlayerItemTrack?) + @asyncHandler optional func metadataOutput(_ output: AVPlayerItemMetadataOutput, didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup], from track: AVPlayerItemTrack?) } diff --git a/macOS/AVFoundation/AVPlayerItemProtectedContentAdditions.swift b/macOS/AVFoundation/AVPlayerItemProtectedContentAdditions.swift index 0f7e23b..feecf18 100644 --- a/macOS/AVFoundation/AVPlayerItemProtectedContentAdditions.swift +++ b/macOS/AVFoundation/AVPlayerItemProtectedContentAdditions.swift @@ -20,6 +20,8 @@ extension AVPlayerItem { @available(macOS 10.7, *) func requestContentAuthorizationAsynchronously(withTimeoutInterval timeoutInterval: TimeInterval, completionHandler handler: @escaping () -> Void) @available(macOS 10.7, *) + func requestContentAuthorizationAsynchronously(withTimeoutInterval timeoutInterval: TimeInterval) async + @available(macOS 10.7, *) func cancelContentAuthorizationRequest() @available(macOS 10.7, *) var contentAuthorizationRequestStatus: AVContentAuthorizationStatus { get } diff --git a/macOS/AVFoundation/AVSampleBufferAudioRenderer.swift b/macOS/AVFoundation/AVSampleBufferAudioRenderer.swift index dfe5c63..9af9401 100644 --- a/macOS/AVFoundation/AVSampleBufferAudioRenderer.swift +++ b/macOS/AVFoundation/AVSampleBufferAudioRenderer.swift @@ -13,6 +13,7 @@ extension AVSampleBufferAudioRenderer { } extension AVSampleBufferAudioRenderer { func flush(fromSourceTime time: CMTime, completionHandler: @escaping (Bool) -> Void) + func flush(fromSourceTime time: CMTime) async -> Bool } extension NSNotification.Name { @available(macOS 10.13, *) diff --git a/macOS/AVFoundation/AVSampleBufferGenerator.swift b/macOS/AVFoundation/AVSampleBufferGenerator.swift index 4f6d3ca..abb2756 100644 --- a/macOS/AVFoundation/AVSampleBufferGenerator.swift +++ b/macOS/AVFoundation/AVSampleBufferGenerator.swift @@ -4,6 +4,7 @@ class AVSampleBufferGenerator : NSObject { init(asset: AVAsset, timebase: CMTimebase?) func createSampleBuffer(for request: AVSampleBufferRequest) -> CMSampleBuffer? class func notifyOfDataReady(for sbuf: CMSampleBuffer, completionHandler: @escaping (Bool, Error) -> Void) + class func notifyOfDataReady(for sbuf: CMSampleBuffer) async -> (Bool, Error) } extension AVSampleBufferRequest { enum Direction : Int { diff --git a/macOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift b/macOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift index 7eb6884..27b6813 100644 --- a/macOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift +++ b/macOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift @@ -15,6 +15,7 @@ extension AVSampleBufferRenderSynchronizer { var renderers: [AVQueuedSampleBufferRendering] { get } func addRenderer(_ renderer: AVQueuedSampleBufferRendering) func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime, completionHandler: ((Bool) -> Void)? = nil) + func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool } extension AVSampleBufferRenderSynchronizer { func addPeriodicTimeObserver(forInterval interval: CMTime, queue: DispatchQueue?, using block: @escaping (CMTime) -> Void) -> Any diff --git a/macOS/AVKit/AVPictureInPictureController.swift b/macOS/AVKit/AVPictureInPictureController.swift index ca41f6a..590cacf 100644 --- a/macOS/AVKit/AVPictureInPictureController.swift +++ b/macOS/AVKit/AVPictureInPictureController.swift @@ -18,9 +18,10 @@ class AVPictureInPictureController : NSObject { @available(macOS 10.15, *) protocol AVPictureInPictureControllerDelegate : NSObjectProtocol { optional func pictureInPictureControllerWillStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) - optional func pictureInPictureControllerDidStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) + @asyncHandler optional func pictureInPictureControllerDidStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, failedToStartPictureInPictureWithError error: Error) optional func pictureInPictureControllerWillStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) - optional func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) + @asyncHandler optional func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void) + optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController) async -> Bool } diff --git a/macOS/AVKit/AVPlayerView.swift b/macOS/AVKit/AVPlayerView.swift index e11042e..213640a 100644 --- a/macOS/AVKit/AVPlayerView.swift +++ b/macOS/AVKit/AVPlayerView.swift @@ -35,6 +35,7 @@ extension AVPlayerView { extension AVPlayerView { var canBeginTrimming: Bool { get } func beginTrimming(completionHandler handler: ((AVPlayerViewTrimResult) -> Void)? = nil) + func beginTrimming() async -> AVPlayerViewTrimResult } @available(macOS 10.9, *) enum AVPlayerViewTrimResult : Int { @@ -55,10 +56,11 @@ extension AVPlayerView { @available(macOS 10.15, *) protocol AVPlayerViewPictureInPictureDelegate : NSObjectProtocol { optional func playerViewWillStartPicture(inPicture playerView: AVPlayerView) - optional func playerViewDidStartPicture(inPicture playerView: AVPlayerView) + @asyncHandler optional func playerViewDidStartPicture(inPicture playerView: AVPlayerView) optional func playerView(_ playerView: AVPlayerView, failedToStartPictureInPictureWithError error: Error) optional func playerViewWillStopPicture(inPicture playerView: AVPlayerView) - optional func playerViewDidStopPicture(inPicture playerView: AVPlayerView) + @asyncHandler optional func playerViewDidStopPicture(inPicture playerView: AVPlayerView) optional func playerView(_ playerView: AVPlayerView, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void) + optional func playerView(_ playerView: AVPlayerView) async -> Bool optional func playerViewShouldAutomaticallyDismissAtPicture(inPictureStart playerView: AVPlayerView) -> Bool } diff --git a/macOS/AVKit/AVRoutePickerView.swift b/macOS/AVKit/AVRoutePickerView.swift index 2ff665f..035ecf8 100644 --- a/macOS/AVKit/AVRoutePickerView.swift +++ b/macOS/AVKit/AVRoutePickerView.swift @@ -22,5 +22,5 @@ protocol AVRoutePickerViewDelegate : NSObjectProtocol { @available(macOS 10.15, *) optional func routePickerViewWillBeginPresentingRoutes(_ routePickerView: AVRoutePickerView) @available(macOS 10.15, *) - optional func routePickerViewDidEndPresentingRoutes(_ routePickerView: AVRoutePickerView) + @asyncHandler optional func routePickerViewDidEndPresentingRoutes(_ routePickerView: AVRoutePickerView) } diff --git a/macOS/Accounts/ACAccountStore.swift b/macOS/Accounts/ACAccountStore.swift index ad6fdad..b0c67e0 100644 --- a/macOS/Accounts/ACAccountStore.swift +++ b/macOS/Accounts/ACAccountStore.swift @@ -17,9 +17,13 @@ class ACAccountStore : NSObject { func accountType(withAccountTypeIdentifier typeIdentifier: String!) -> ACAccountType! func accounts(with accountType: ACAccountType!) -> [Any]! func saveAccount(_ account: ACAccount!, withCompletionHandler completionHandler: ACAccountStoreSaveCompletionHandler!) + func saveAccount(_ account: ACAccount!) async throws -> Bool func requestAccessToAccounts(with accountType: ACAccountType!, options: [AnyHashable : Any]! = [:], completion: ACAccountStoreRequestAccessCompletionHandler!) + func requestAccessToAccounts(with accountType: ACAccountType!, options: [AnyHashable : Any]! = [:]) async throws -> Bool func renewCredentials(for account: ACAccount!, completion completionHandler: ACAccountStoreCredentialRenewalHandler!) + func renewCredentials(for account: ACAccount!) async throws -> ACAccountCredentialRenewResult func removeAccount(_ account: ACAccount!, withCompletionHandler completionHandler: ACAccountStoreRemoveCompletionHandler!) + func removeAccount(_ account: ACAccount!) async throws -> Bool } extension NSNotification.Name { @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Public notification deprecated. Internal clients, see private header for replacement") diff --git a/macOS/AppKit/NSAlert.swift b/macOS/AppKit/NSAlert.swift index e382267..747c919 100644 --- a/macOS/AppKit/NSAlert.swift +++ b/macOS/AppKit/NSAlert.swift @@ -35,6 +35,8 @@ class NSAlert : NSObject { func runModal() -> NSApplication.ModalResponse @available(macOS 10.9, *) func beginSheetModal(for sheetWindow: NSWindow, completionHandler handler: ((NSApplication.ModalResponse) -> Void)? = nil) + @available(macOS 10.9, *) + func beginSheetModal(for sheetWindow: NSWindow) async -> NSApplication.ModalResponse var window: NSWindow { get } } protocol NSAlertDelegate : NSObjectProtocol { diff --git a/macOS/AppKit/NSAnimation.swift b/macOS/AppKit/NSAnimation.swift index 4d3005e..3922960 100644 --- a/macOS/AppKit/NSAnimation.swift +++ b/macOS/AppKit/NSAnimation.swift @@ -42,10 +42,10 @@ class NSAnimation : NSObject, NSCopying, NSCoding { } protocol NSAnimationDelegate : NSObjectProtocol { optional func animationShouldStart(_ animation: NSAnimation) -> Bool - optional func animationDidStop(_ animation: NSAnimation) - optional func animationDidEnd(_ animation: NSAnimation) + @asyncHandler optional func animationDidStop(_ animation: NSAnimation) + @asyncHandler optional func animationDidEnd(_ animation: NSAnimation) optional func animation(_ animation: NSAnimation, valueForProgress progress: NSAnimation.Progress) -> Float - optional func animation(_ animation: NSAnimation, didReachProgressMark progress: NSAnimation.Progress) + @asyncHandler optional func animation(_ animation: NSAnimation, didReachProgressMark progress: NSAnimation.Progress) } extension NSViewAnimation { struct Key : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable { diff --git a/macOS/AppKit/NSAnimationContext.swift b/macOS/AppKit/NSAnimationContext.swift index b9c3f05..4c91a48 100644 --- a/macOS/AppKit/NSAnimationContext.swift +++ b/macOS/AppKit/NSAnimationContext.swift @@ -3,6 +3,8 @@ class NSAnimationContext : NSObject { @available(macOS 10.7, *) class func runAnimationGroup(_ changes: (NSAnimationContext) -> Void, completionHandler: (() -> Void)? = nil) + @available(macOS 10.7, *) + class func runAnimationGroup(_ changes: (NSAnimationContext) -> Void) async @available(macOS 10.12, *) class func runAnimationGroup(_ changes: (NSAnimationContext) -> Void) class func beginGrouping() diff --git a/macOS/AppKit/NSApplication.swift b/macOS/AppKit/NSApplication.swift index 94a770b..001c4cb 100644 --- a/macOS/AppKit/NSApplication.swift +++ b/macOS/AppKit/NSApplication.swift @@ -285,42 +285,42 @@ protocol NSApplicationDelegate : NSObjectProtocol { optional func applicationDockMenu(_ sender: NSApplication) -> NSMenu? optional func application(_ application: NSApplication, willPresentError error: Error) -> Error @available(macOS 10.7, *) - optional func application(_ application: NSApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) + @asyncHandler optional func application(_ application: NSApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) @available(macOS 10.7, *) - optional func application(_ application: NSApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) + @asyncHandler optional func application(_ application: NSApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) @available(macOS 10.7, *) - optional func application(_ application: NSApplication, didReceiveRemoteNotification userInfo: [String : Any]) + @asyncHandler optional func application(_ application: NSApplication, didReceiveRemoteNotification userInfo: [String : Any]) @available(macOS 10.7, *) optional func application(_ app: NSApplication, willEncodeRestorableState coder: NSCoder) @available(macOS 10.7, *) - optional func application(_ app: NSApplication, didDecodeRestorableState coder: NSCoder) + @asyncHandler optional func application(_ app: NSApplication, didDecodeRestorableState coder: NSCoder) @available(macOS 10.10, *) optional func application(_ application: NSApplication, willContinueUserActivityWithType userActivityType: String) -> Bool @available(macOS 10.10, *) optional func application(_ application: NSApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([NSUserActivityRestoring]) -> Void) -> Bool @available(macOS 10.10, *) - optional func application(_ application: NSApplication, didFailToContinueUserActivityWithType userActivityType: String, error: Error) + @asyncHandler optional func application(_ application: NSApplication, didFailToContinueUserActivityWithType userActivityType: String, error: Error) @available(macOS 10.10, *) - optional func application(_ application: NSApplication, didUpdate userActivity: NSUserActivity) + @asyncHandler optional func application(_ application: NSApplication, didUpdate userActivity: NSUserActivity) @available(macOS 10.12, *) optional func application(_ application: NSApplication, userDidAcceptCloudKitShareWith metadata: CKShare.Metadata) optional func application(_ sender: NSApplication, delegateHandlesKey key: String) -> Bool optional func applicationWillFinishLaunching(_ notification: Notification) - optional func applicationDidFinishLaunching(_ notification: Notification) + @asyncHandler optional func applicationDidFinishLaunching(_ notification: Notification) optional func applicationWillHide(_ notification: Notification) - optional func applicationDidHide(_ notification: Notification) + @asyncHandler optional func applicationDidHide(_ notification: Notification) optional func applicationWillUnhide(_ notification: Notification) - optional func applicationDidUnhide(_ notification: Notification) + @asyncHandler optional func applicationDidUnhide(_ notification: Notification) optional func applicationWillBecomeActive(_ notification: Notification) - optional func applicationDidBecomeActive(_ notification: Notification) + @asyncHandler optional func applicationDidBecomeActive(_ notification: Notification) optional func applicationWillResignActive(_ notification: Notification) - optional func applicationDidResignActive(_ notification: Notification) + @asyncHandler optional func applicationDidResignActive(_ notification: Notification) optional func applicationWillUpdate(_ notification: Notification) - optional func applicationDidUpdate(_ notification: Notification) + @asyncHandler optional func applicationDidUpdate(_ notification: Notification) optional func applicationWillTerminate(_ notification: Notification) - optional func applicationDidChangeScreenParameters(_ notification: Notification) + @asyncHandler optional func applicationDidChangeScreenParameters(_ notification: Notification) @available(macOS 10.9, *) - optional func applicationDidChangeOcclusionState(_ notification: Notification) + @asyncHandler optional func applicationDidChangeOcclusionState(_ notification: Notification) } extension NSApplicationDelegate { diff --git a/macOS/AppKit/NSBrowser.swift b/macOS/AppKit/NSBrowser.swift index fd59370..259c891 100644 --- a/macOS/AppKit/NSBrowser.swift +++ b/macOS/AppKit/NSBrowser.swift @@ -154,10 +154,10 @@ protocol NSBrowserDelegate : NSObjectProtocol { optional func browser(_ sender: NSBrowser, selectRow row: Int, inColumn column: Int) -> Bool optional func browser(_ sender: NSBrowser, isColumnValid column: Int) -> Bool optional func browserWillScroll(_ sender: NSBrowser) - optional func browserDidScroll(_ sender: NSBrowser) + @asyncHandler optional func browserDidScroll(_ sender: NSBrowser) optional func browser(_ browser: NSBrowser, shouldSizeColumn columnIndex: Int, forUserResize: Bool, toWidth suggestedWidth: CGFloat) -> CGFloat optional func browser(_ browser: NSBrowser, sizeToFitWidthOfColumn columnIndex: Int) -> CGFloat - optional func browserColumnConfigurationDidChange(_ notification: Notification) + @asyncHandler optional func browserColumnConfigurationDidChange(_ notification: Notification) @available(macOS 10.5, *) optional func browser(_ browser: NSBrowser, shouldShowCellExpansionForRow row: Int, column: Int) -> Bool @available(macOS 10.5, *) @@ -182,7 +182,7 @@ protocol NSBrowserDelegate : NSObjectProtocol { optional func browser(_ browser: NSBrowser, previewViewControllerForLeafItem item: Any) -> NSViewController? @available(macOS 10.6, *) optional func browser(_ browser: NSBrowser, headerViewControllerForItem item: Any?) -> NSViewController? - optional func browser(_ browser: NSBrowser, didChangeLastColumn oldLastColumn: Int, toColumn column: Int) + @asyncHandler optional func browser(_ browser: NSBrowser, didChangeLastColumn oldLastColumn: Int, toColumn column: Int) @available(macOS 10.6, *) optional func browser(_ browser: NSBrowser, selectionIndexesForProposedSelection proposedSelectionIndexes: IndexSet, inColumn column: Int) -> IndexSet } diff --git a/macOS/AppKit/NSCollectionView.swift b/macOS/AppKit/NSCollectionView.swift index 6740e32..15646e2 100644 --- a/macOS/AppKit/NSCollectionView.swift +++ b/macOS/AppKit/NSCollectionView.swift @@ -42,7 +42,7 @@ protocol NSCollectionViewElement : NSUserInterfaceItemIdentification, NSObjectPr @available(macOS 10.11, *) optional func willTransition(from oldLayout: NSCollectionViewLayout, to newLayout: NSCollectionViewLayout) @available(macOS 10.11, *) - optional func didTransition(from oldLayout: NSCollectionViewLayout, to newLayout: NSCollectionViewLayout) + @asyncHandler optional func didTransition(from oldLayout: NSCollectionViewLayout, to newLayout: NSCollectionViewLayout) @available(macOS 10.11, *) optional func preferredLayoutAttributesFitting(_ layoutAttributes: NSCollectionViewLayoutAttributes) -> NSCollectionViewLayoutAttributes } @@ -153,6 +153,8 @@ class NSCollectionView : NSView, NSDraggingSource, NSDraggingDestination { func moveItem(at indexPath: IndexPath, to newIndexPath: IndexPath) @available(macOS 10.11, *) func performBatchUpdates(_ updates: (() -> Void)?, completionHandler: ((Bool) -> Void)? = nil) + @available(macOS 10.11, *) + func performBatchUpdates(_ updates: (() -> Void)?) async -> Bool @available(macOS 10.12, *) @IBAction func toggleSectionCollapse(_ sender: Any) @available(macOS 10.11, *) @@ -220,23 +222,23 @@ protocol NSCollectionViewDelegate : NSObjectProtocol { @available(macOS 10.11, *) optional func collectionView(_ collectionView: NSCollectionView, shouldChangeItemsAt indexPaths: Set, to highlightState: NSCollectionViewItem.HighlightState) -> Set @available(macOS 10.11, *) - optional func collectionView(_ collectionView: NSCollectionView, didChangeItemsAt indexPaths: Set, to highlightState: NSCollectionViewItem.HighlightState) + @asyncHandler optional func collectionView(_ collectionView: NSCollectionView, didChangeItemsAt indexPaths: Set, to highlightState: NSCollectionViewItem.HighlightState) @available(macOS 10.11, *) optional func collectionView(_ collectionView: NSCollectionView, shouldSelectItemsAt indexPaths: Set) -> Set @available(macOS 10.11, *) optional func collectionView(_ collectionView: NSCollectionView, shouldDeselectItemsAt indexPaths: Set) -> Set @available(macOS 10.11, *) - optional func collectionView(_ collectionView: NSCollectionView, didSelectItemsAt indexPaths: Set) + @asyncHandler optional func collectionView(_ collectionView: NSCollectionView, didSelectItemsAt indexPaths: Set) @available(macOS 10.11, *) - optional func collectionView(_ collectionView: NSCollectionView, didDeselectItemsAt indexPaths: Set) + @asyncHandler optional func collectionView(_ collectionView: NSCollectionView, didDeselectItemsAt indexPaths: Set) @available(macOS 10.11, *) optional func collectionView(_ collectionView: NSCollectionView, willDisplay item: NSCollectionViewItem, forRepresentedObjectAt indexPath: IndexPath) @available(macOS 10.11, *) optional func collectionView(_ collectionView: NSCollectionView, willDisplaySupplementaryView view: NSView, forElementKind elementKind: NSCollectionView.SupplementaryElementKind, at indexPath: IndexPath) @available(macOS 10.11, *) - optional func collectionView(_ collectionView: NSCollectionView, didEndDisplaying item: NSCollectionViewItem, forRepresentedObjectAt indexPath: IndexPath) + @asyncHandler optional func collectionView(_ collectionView: NSCollectionView, didEndDisplaying item: NSCollectionViewItem, forRepresentedObjectAt indexPath: IndexPath) @available(macOS 10.11, *) - optional func collectionView(_ collectionView: NSCollectionView, didEndDisplayingSupplementaryView view: NSView, forElementOfKind elementKind: NSCollectionView.SupplementaryElementKind, at indexPath: IndexPath) + @asyncHandler optional func collectionView(_ collectionView: NSCollectionView, didEndDisplayingSupplementaryView view: NSView, forElementOfKind elementKind: NSCollectionView.SupplementaryElementKind, at indexPath: IndexPath) @available(macOS 10.11, *) optional func collectionView(_ collectionView: NSCollectionView, transitionLayoutForOldLayout fromLayout: NSCollectionViewLayout, newLayout toLayout: NSCollectionViewLayout) -> NSCollectionViewTransitionLayout } diff --git a/macOS/AppKit/NSComboBox.swift b/macOS/AppKit/NSComboBox.swift index 134d92c..fdb9a02 100644 --- a/macOS/AppKit/NSComboBox.swift +++ b/macOS/AppKit/NSComboBox.swift @@ -14,7 +14,7 @@ protocol NSComboBoxDataSource : NSObjectProtocol { protocol NSComboBoxDelegate : NSTextFieldDelegate { optional func comboBoxWillPopUp(_ notification: Notification) optional func comboBoxWillDismiss(_ notification: Notification) - optional func comboBoxSelectionDidChange(_ notification: Notification) + @asyncHandler optional func comboBoxSelectionDidChange(_ notification: Notification) optional func comboBoxSelectionIsChanging(_ notification: Notification) } class NSComboBox : NSTextField { diff --git a/macOS/AppKit/NSControl.swift b/macOS/AppKit/NSControl.swift index cdafcd6..8cf8058 100644 --- a/macOS/AppKit/NSControl.swift +++ b/macOS/AppKit/NSControl.swift @@ -57,13 +57,13 @@ extension NSControl { func endEditing(_ textObj: NSText) } protocol NSControlTextEditingDelegate : NSObjectProtocol { - optional func controlTextDidBeginEditing(_ obj: Notification) - optional func controlTextDidEndEditing(_ obj: Notification) - optional func controlTextDidChange(_ obj: Notification) + @asyncHandler optional func controlTextDidBeginEditing(_ obj: Notification) + @asyncHandler optional func controlTextDidEndEditing(_ obj: Notification) + @asyncHandler optional func controlTextDidChange(_ obj: Notification) optional func control(_ control: NSControl, textShouldBeginEditing fieldEditor: NSText) -> Bool optional func control(_ control: NSControl, textShouldEndEditing fieldEditor: NSText) -> Bool optional func control(_ control: NSControl, didFailToFormatString string: String, errorDescription error: String?) -> Bool - optional func control(_ control: NSControl, didFailToValidatePartialString string: String, errorDescription error: String?) + @asyncHandler optional func control(_ control: NSControl, didFailToValidatePartialString string: String, errorDescription error: String?) optional func control(_ control: NSControl, isValidObject obj: Any?) -> Bool optional func control(_ control: NSControl, textView: NSTextView, doCommandBy commandSelector: Selector) -> Bool optional func control(_ control: NSControl, textView: NSTextView, completions words: [String], forPartialWordRange charRange: NSRange, indexOfSelectedItem index: UnsafeMutablePointer) -> [String] diff --git a/macOS/AppKit/NSDocument.swift b/macOS/AppKit/NSDocument.swift index 34d16d0..2423b14 100644 --- a/macOS/AppKit/NSDocument.swift +++ b/macOS/AppKit/NSDocument.swift @@ -81,6 +81,8 @@ class NSDocument : NSObject, NSEditorRegistration, NSFilePresenter, NSMenuItemVa @available(macOS 10.7, *) func save(to url: URL, ofType typeName: String, for saveOperation: NSDocument.SaveOperationType, completionHandler: @escaping (Error?) -> Void) @available(macOS 10.7, *) + func save(to url: URL, ofType typeName: String, for saveOperation: NSDocument.SaveOperationType) async throws + @available(macOS 10.7, *) func canAsynchronouslyWrite(to url: URL, ofType typeName: String, for saveOperation: NSDocument.SaveOperationType) -> Bool @available(macOS 10.7, *) func checkAutosavingSafety() throws @@ -91,6 +93,8 @@ class NSDocument : NSObject, NSEditorRegistration, NSFilePresenter, NSMenuItemVa @available(macOS 10.7, *) func autosave(withImplicitCancellability autosavingIsImplicitlyCancellable: Bool, completionHandler: @escaping (Error?) -> Void) @available(macOS 10.7, *) + func autosave(withImplicitCancellability autosavingIsImplicitlyCancellable: Bool) async throws + @available(macOS 10.7, *) class var autosavesInPlace: Bool { get } @available(macOS 10.7, *) class var preservesVersions: Bool { get } @@ -100,6 +104,8 @@ class NSDocument : NSObject, NSEditorRegistration, NSFilePresenter, NSMenuItemVa var isBrowsingVersions: Bool { get } @available(macOS 10.12, *) func stopBrowsingVersions(completionHandler: (() -> Void)? = nil) + @available(macOS 10.12, *) + func stopBrowsingVersions() async @available(macOS 10.8, *) class var autosavesDrafts: Bool { get } var autosavingFileType: String? { get } @@ -121,20 +127,32 @@ class NSDocument : NSObject, NSEditorRegistration, NSFilePresenter, NSMenuItemVa @available(macOS 10.8, *) func move(completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.8, *) + func move() async -> Bool + @available(macOS 10.8, *) func move(to url: URL, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) + func move(to url: URL) async throws + @available(macOS 10.8, *) @IBAction func lock(_ sender: Any?) @available(macOS 10.8, *) @IBAction func unlock(_ sender: Any?) @available(macOS 10.8, *) func lock(completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.8, *) + func lock() async -> Bool + @available(macOS 10.8, *) func lock(completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) + func lock() async throws + @available(macOS 10.8, *) func unlock(completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.8, *) + func unlock() async -> Bool + @available(macOS 10.8, *) func unlock(completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) + func unlock() async throws + @available(macOS 10.8, *) var isLocked: Bool { get } @IBAction func runPageLayout(_ sender: Any?) func runModalPageLayout(with printInfo: NSPrintInfo, delegate: Any?, didRun didRunSelector: Selector?, contextInfo: UnsafeMutableRawPointer?) @@ -154,6 +172,8 @@ class NSDocument : NSObject, NSEditorRegistration, NSFilePresenter, NSMenuItemVa @available(macOS 10.13, *) func share(with sharingService: NSSharingService, completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.13, *) + func share(with sharingService: NSSharingService) async -> Bool + @available(macOS 10.13, *) func prepare(_ sharingServicePicker: NSSharingServicePicker) var isDocumentEdited: Bool { get } @available(macOS 10.7, *) diff --git a/macOS/AppKit/NSDocumentController.swift b/macOS/AppKit/NSDocumentController.swift index 8d72bec..81253c4 100644 --- a/macOS/AppKit/NSDocumentController.swift +++ b/macOS/AppKit/NSDocumentController.swift @@ -17,12 +17,20 @@ class NSDocumentController : NSObject, NSCoding, NSMenuItemValidation, NSUserInt @available(macOS 10.8, *) func beginOpenPanel(completionHandler: @escaping ([URL]?) -> Void) @available(macOS 10.8, *) + func beginOpenPanel() async -> [URL]? + @available(macOS 10.8, *) func beginOpenPanel(_ openPanel: NSOpenPanel, forTypes inTypes: [String]?, completionHandler: @escaping (Int) -> Void) + @available(macOS 10.8, *) + func beginOpenPanel(_ openPanel: NSOpenPanel, forTypes inTypes: [String]?) async -> Int @available(macOS 10.7, *) func openDocument(withContentsOf url: URL, display displayDocument: Bool, completionHandler: @escaping (NSDocument?, Bool, Error?) -> Void) + @available(macOS 10.7, *) + func openDocument(withContentsOf url: URL, display displayDocument: Bool) async throws -> (NSDocument?, Bool) func makeDocument(withContentsOf url: URL, ofType typeName: String) throws -> NSDocument @available(macOS 10.7, *) func reopenDocument(for urlOrNil: URL?, withContentsOf contentsURL: URL, display displayDocument: Bool, completionHandler: @escaping (NSDocument?, Bool, Error?) -> Void) + @available(macOS 10.7, *) + func reopenDocument(for urlOrNil: URL?, withContentsOf contentsURL: URL, display displayDocument: Bool) async throws -> (NSDocument?, Bool) func makeDocument(for urlOrNil: URL?, withContentsOf contentsURL: URL, ofType typeName: String) throws -> NSDocument var autosavingDelay: TimeInterval @IBAction func saveAllDocuments(_ sender: Any?) diff --git a/macOS/AppKit/NSDrawer.swift b/macOS/AppKit/NSDrawer.swift index bf3fdb5..35f080f 100644 --- a/macOS/AppKit/NSDrawer.swift +++ b/macOS/AppKit/NSDrawer.swift @@ -34,11 +34,11 @@ protocol NSDrawerDelegate : NSObjectProtocol { @available(macOS, introduced: 10.0, deprecated: 10.13, message: "Drawers are deprecated; consider using NSSplitViewController") optional func drawerWillOpen(_ notification: Notification) @available(macOS, introduced: 10.0, deprecated: 10.13, message: "Drawers are deprecated; consider using NSSplitViewController") - optional func drawerDidOpen(_ notification: Notification) + @asyncHandler optional func drawerDidOpen(_ notification: Notification) @available(macOS, introduced: 10.0, deprecated: 10.13, message: "Drawers are deprecated; consider using NSSplitViewController") optional func drawerWillClose(_ notification: Notification) @available(macOS, introduced: 10.0, deprecated: 10.13, message: "Drawers are deprecated; consider using NSSplitViewController") - optional func drawerDidClose(_ notification: Notification) + @asyncHandler optional func drawerDidClose(_ notification: Notification) } extension NSDrawer { @available(macOS, introduced: 10.0, deprecated: 10.13, message: "Drawers are deprecated; consider using NSSplitViewController") diff --git a/macOS/AppKit/NSFilePromiseProvider.swift b/macOS/AppKit/NSFilePromiseProvider.swift index 4118ac9..91ec4b4 100644 --- a/macOS/AppKit/NSFilePromiseProvider.swift +++ b/macOS/AppKit/NSFilePromiseProvider.swift @@ -12,5 +12,7 @@ protocol NSFilePromiseProviderDelegate : NSObjectProtocol { @available(macOS 10.12, *) func filePromiseProvider(_ filePromiseProvider: NSFilePromiseProvider, writePromiseTo url: URL, completionHandler: @escaping (Error?) -> Void) @available(macOS 10.12, *) + func filePromiseProvider(_ filePromiseProvider: NSFilePromiseProvider, writePromiseTo url: URL) async throws + @available(macOS 10.12, *) optional func operationQueue(for filePromiseProvider: NSFilePromiseProvider) -> OperationQueue } diff --git a/macOS/AppKit/NSImage.swift b/macOS/AppKit/NSImage.swift index 9d31f43..731c0a0 100644 --- a/macOS/AppKit/NSImage.swift +++ b/macOS/AppKit/NSImage.swift @@ -93,9 +93,9 @@ extension NSImage : NSCopying, NSSecureCoding, NSPasteboardReading, NSPasteboard protocol NSImageDelegate : NSObjectProtocol { optional func imageDidNotDraw(_ sender: NSImage, in rect: NSRect) -> NSImage? optional func image(_ image: NSImage, willLoadRepresentation rep: NSImageRep) - optional func image(_ image: NSImage, didLoadRepresentationHeader rep: NSImageRep) - optional func image(_ image: NSImage, didLoadPartOfRepresentation rep: NSImageRep, withValidRows rows: Int) - optional func image(_ image: NSImage, didLoadRepresentation rep: NSImageRep, with status: NSImage.LoadStatus) + @asyncHandler optional func image(_ image: NSImage, didLoadRepresentationHeader rep: NSImageRep) + @asyncHandler optional func image(_ image: NSImage, didLoadPartOfRepresentation rep: NSImageRep, withValidRows rows: Int) + @asyncHandler optional func image(_ image: NSImage, didLoadRepresentation rep: NSImageRep, with status: NSImage.LoadStatus) } extension Bundle { @available(macOS 10.7, *) diff --git a/macOS/AppKit/NSKeyValueBinding.swift b/macOS/AppKit/NSKeyValueBinding.swift index 7c77358..a4d1f64 100644 --- a/macOS/AppKit/NSKeyValueBinding.swift +++ b/macOS/AppKit/NSKeyValueBinding.swift @@ -71,8 +71,8 @@ protocol NSEditor : NSObjectProtocol { func commitEditingWithoutPresentingError() throws } protocol NSEditorRegistration : NSObjectProtocol { - optional func objectDidBeginEditing(_ editor: NSEditor) - optional func objectDidEndEditing(_ editor: NSEditor) + @asyncHandler optional func objectDidBeginEditing(_ editor: NSEditor) + @asyncHandler optional func objectDidEndEditing(_ editor: NSEditor) } extension NSBindingName { static let alignment: NSBindingName diff --git a/macOS/AppKit/NSLayoutManager.swift b/macOS/AppKit/NSLayoutManager.swift index dd59db0..64abbe3 100644 --- a/macOS/AppKit/NSLayoutManager.swift +++ b/macOS/AppKit/NSLayoutManager.swift @@ -200,11 +200,11 @@ protocol NSLayoutManagerDelegate : NSObjectProtocol { @available(macOS 10.11, *) optional func layoutManager(_ layoutManager: NSLayoutManager, shouldSetLineFragmentRect lineFragmentRect: UnsafeMutablePointer, lineFragmentUsedRect: UnsafeMutablePointer, baselineOffset: UnsafeMutablePointer, in textContainer: NSTextContainer, forGlyphRange glyphRange: NSRange) -> Bool @available(macOS 10.0, *) - optional func layoutManagerDidInvalidateLayout(_ sender: NSLayoutManager) + @asyncHandler optional func layoutManagerDidInvalidateLayout(_ sender: NSLayoutManager) @available(macOS 10.0, *) - optional func layoutManager(_ layoutManager: NSLayoutManager, didCompleteLayoutFor textContainer: NSTextContainer?, atEnd layoutFinishedFlag: Bool) + @asyncHandler optional func layoutManager(_ layoutManager: NSLayoutManager, didCompleteLayoutFor textContainer: NSTextContainer?, atEnd layoutFinishedFlag: Bool) @available(macOS 10.11, *) - optional func layoutManager(_ layoutManager: NSLayoutManager, textContainer: NSTextContainer, didChangeGeometryFrom oldSize: NSSize) + @asyncHandler optional func layoutManager(_ layoutManager: NSLayoutManager, textContainer: NSTextContainer, didChangeGeometryFrom oldSize: NSSize) @available(macOS 10.5, *) optional func layoutManager(_ layoutManager: NSLayoutManager, shouldUseTemporaryAttributes attrs: [NSAttributedString.Key : Any] = [:], forDrawingToScreen toScreen: Bool, atCharacterIndex charIndex: Int, effectiveRange effectiveCharRange: NSRangePointer?) -> [NSAttributedString.Key : Any]? } diff --git a/macOS/AppKit/NSMenu.swift b/macOS/AppKit/NSMenu.swift index 62c522e..b79dcd4 100644 --- a/macOS/AppKit/NSMenu.swift +++ b/macOS/AppKit/NSMenu.swift @@ -69,7 +69,7 @@ protocol NSMenuDelegate : NSObjectProtocol { @available(macOS 10.5, *) optional func menuWillOpen(_ menu: NSMenu) @available(macOS 10.5, *) - optional func menuDidClose(_ menu: NSMenu) + @asyncHandler optional func menuDidClose(_ menu: NSMenu) @available(macOS 10.5, *) optional func menu(_ menu: NSMenu, willHighlight item: NSMenuItem?) @available(macOS 10.6, *) diff --git a/macOS/AppKit/NSOutlineView.swift b/macOS/AppKit/NSOutlineView.swift index 44d32dc..147519f 100644 --- a/macOS/AppKit/NSOutlineView.swift +++ b/macOS/AppKit/NSOutlineView.swift @@ -68,9 +68,9 @@ protocol NSOutlineViewDelegate : NSControlTextEditingDelegate { @available(macOS 10.7, *) optional func outlineView(_ outlineView: NSOutlineView, rowViewForItem item: Any) -> NSTableRowView? @available(macOS 10.7, *) - optional func outlineView(_ outlineView: NSOutlineView, didAdd rowView: NSTableRowView, forRow row: Int) + @asyncHandler optional func outlineView(_ outlineView: NSOutlineView, didAdd rowView: NSTableRowView, forRow row: Int) @available(macOS 10.7, *) - optional func outlineView(_ outlineView: NSOutlineView, didRemove rowView: NSTableRowView, forRow row: Int) + @asyncHandler optional func outlineView(_ outlineView: NSOutlineView, didRemove rowView: NSTableRowView, forRow row: Int) optional func outlineView(_ outlineView: NSOutlineView, willDisplayCell cell: Any, for tableColumn: NSTableColumn?, item: Any) optional func outlineView(_ outlineView: NSOutlineView, shouldEdit tableColumn: NSTableColumn?, item: Any) -> Bool optional func selectionShouldChange(in outlineView: NSOutlineView) -> Bool @@ -79,8 +79,8 @@ protocol NSOutlineViewDelegate : NSControlTextEditingDelegate { optional func outlineView(_ outlineView: NSOutlineView, selectionIndexesForProposedSelection proposedSelectionIndexes: IndexSet) -> IndexSet optional func outlineView(_ outlineView: NSOutlineView, shouldSelect tableColumn: NSTableColumn?) -> Bool optional func outlineView(_ outlineView: NSOutlineView, mouseDownInHeaderOf tableColumn: NSTableColumn) - optional func outlineView(_ outlineView: NSOutlineView, didClick tableColumn: NSTableColumn) - optional func outlineView(_ outlineView: NSOutlineView, didDrag tableColumn: NSTableColumn) + @asyncHandler optional func outlineView(_ outlineView: NSOutlineView, didClick tableColumn: NSTableColumn) + @asyncHandler optional func outlineView(_ outlineView: NSOutlineView, didDrag tableColumn: NSTableColumn) optional func outlineView(_ outlineView: NSOutlineView, toolTipFor cell: NSCell, rect: NSRectPointer, tableColumn: NSTableColumn?, item: Any, mouseLocation: NSPoint) -> String optional func outlineView(_ outlineView: NSOutlineView, heightOfRowByItem item: Any) -> CGFloat @available(macOS 11.0, *) @@ -108,14 +108,14 @@ protocol NSOutlineViewDelegate : NSControlTextEditingDelegate { optional func outlineView(_ outlineView: NSOutlineView, shouldReorderColumn columnIndex: Int, toColumn newColumnIndex: Int) -> Bool @available(macOS 10.6, *) optional func outlineView(_ outlineView: NSOutlineView, shouldShowOutlineCellForItem item: Any) -> Bool - optional func outlineViewSelectionDidChange(_ notification: Notification) - optional func outlineViewColumnDidMove(_ notification: Notification) - optional func outlineViewColumnDidResize(_ notification: Notification) + @asyncHandler optional func outlineViewSelectionDidChange(_ notification: Notification) + @asyncHandler optional func outlineViewColumnDidMove(_ notification: Notification) + @asyncHandler optional func outlineViewColumnDidResize(_ notification: Notification) optional func outlineViewSelectionIsChanging(_ notification: Notification) optional func outlineViewItemWillExpand(_ notification: Notification) - optional func outlineViewItemDidExpand(_ notification: Notification) + @asyncHandler optional func outlineViewItemDidExpand(_ notification: Notification) optional func outlineViewItemWillCollapse(_ notification: Notification) - optional func outlineViewItemDidCollapse(_ notification: Notification) + @asyncHandler optional func outlineViewItemDidCollapse(_ notification: Notification) } extension NSOutlineView { @available(macOS 10.9, *) diff --git a/macOS/AppKit/NSPDFPanel.swift b/macOS/AppKit/NSPDFPanel.swift index f9117ec..2fcf067 100644 --- a/macOS/AppKit/NSPDFPanel.swift +++ b/macOS/AppKit/NSPDFPanel.swift @@ -15,4 +15,5 @@ class NSPDFPanel : NSObject { var options: NSPDFPanel.Options var defaultFileName: String func beginSheet(with pdfInfo: NSPDFInfo, modalFor docWindow: NSWindow?, completionHandler: @escaping (Int) -> Void) + func beginSheet(with pdfInfo: NSPDFInfo, modalFor docWindow: NSWindow?) async -> Int } diff --git a/macOS/AppKit/NSPageController.swift b/macOS/AppKit/NSPageController.swift index 96e38ba..8b574df 100644 --- a/macOS/AppKit/NSPageController.swift +++ b/macOS/AppKit/NSPageController.swift @@ -33,9 +33,9 @@ protocol NSPageControllerDelegate : NSObjectProtocol { @available(macOS 10.8, *) optional func pageController(_ pageController: NSPageController, prepare viewController: NSViewController, with object: Any?) @available(macOS 10.8, *) - optional func pageController(_ pageController: NSPageController, didTransitionTo object: Any) + @asyncHandler optional func pageController(_ pageController: NSPageController, didTransitionTo object: Any) @available(macOS 10.8, *) optional func pageControllerWillStartLiveTransition(_ pageController: NSPageController) @available(macOS 10.8, *) - optional func pageControllerDidEndLiveTransition(_ pageController: NSPageController) + @asyncHandler optional func pageControllerDidEndLiveTransition(_ pageController: NSPageController) } diff --git a/macOS/AppKit/NSPopover.swift b/macOS/AppKit/NSPopover.swift index dc49b44..28d1d63 100644 --- a/macOS/AppKit/NSPopover.swift +++ b/macOS/AppKit/NSPopover.swift @@ -59,11 +59,11 @@ protocol NSPopoverDelegate : NSObjectProtocol { @available(macOS 10.10, *) optional func popoverShouldDetach(_ popover: NSPopover) -> Bool @available(macOS 10.10, *) - optional func popoverDidDetach(_ popover: NSPopover) + @asyncHandler optional func popoverDidDetach(_ popover: NSPopover) @available(macOS 10.7, *) optional func detachableWindow(for popover: NSPopover) -> NSWindow? optional func popoverWillShow(_ notification: Notification) - optional func popoverDidShow(_ notification: Notification) + @asyncHandler optional func popoverDidShow(_ notification: Notification) optional func popoverWillClose(_ notification: Notification) - optional func popoverDidClose(_ notification: Notification) + @asyncHandler optional func popoverDidClose(_ notification: Notification) } diff --git a/macOS/AppKit/NSRuleEditor.swift b/macOS/AppKit/NSRuleEditor.swift index af34d21..51078e1 100644 --- a/macOS/AppKit/NSRuleEditor.swift +++ b/macOS/AppKit/NSRuleEditor.swift @@ -45,7 +45,7 @@ protocol NSRuleEditorDelegate : NSObjectProtocol { func ruleEditor(_ editor: NSRuleEditor, child index: Int, forCriterion criterion: Any?, with rowType: NSRuleEditor.RowType) -> Any func ruleEditor(_ editor: NSRuleEditor, displayValueForCriterion criterion: Any, inRow row: Int) -> Any optional func ruleEditor(_ editor: NSRuleEditor, predicatePartsForCriterion criterion: Any, withDisplayValue value: Any, inRow row: Int) -> [NSRuleEditor.PredicatePartKey : Any]? - optional func ruleEditorRowsDidChange(_ notification: Notification) + @asyncHandler optional func ruleEditorRowsDidChange(_ notification: Notification) } extension NSRuleEditor { class let rowsDidChangeNotification: NSNotification.Name diff --git a/macOS/AppKit/NSSavePanel.swift b/macOS/AppKit/NSSavePanel.swift index 55bb5ff..df82f0b 100644 --- a/macOS/AppKit/NSSavePanel.swift +++ b/macOS/AppKit/NSSavePanel.swift @@ -30,7 +30,11 @@ class NSSavePanel : NSPanel { @available(macOS 10.6, *) func beginSheetModal(for window: NSWindow, completionHandler handler: @escaping (NSApplication.ModalResponse) -> Void) @available(macOS 10.6, *) + func beginSheetModal(for window: NSWindow) async -> NSApplication.ModalResponse + @available(macOS 10.6, *) func begin(completionHandler handler: @escaping (NSApplication.ModalResponse) -> Void) + @available(macOS 10.6, *) + func begin() async -> NSApplication.ModalResponse func runModal() -> NSApplication.ModalResponse } protocol NSOpenSavePanelDelegate : NSObjectProtocol { @@ -39,10 +43,10 @@ protocol NSOpenSavePanelDelegate : NSObjectProtocol { @available(macOS 10.6, *) optional func panel(_ sender: Any, validate url: URL) throws @available(macOS 10.6, *) - optional func panel(_ sender: Any, didChangeToDirectoryURL url: URL?) + @asyncHandler optional func panel(_ sender: Any, didChangeToDirectoryURL url: URL?) optional func panel(_ sender: Any, userEnteredFilename filename: String, confirmed okFlag: Bool) -> String? optional func panel(_ sender: Any, willExpand expanding: Bool) - optional func panelSelectionDidChange(_ sender: Any?) + @asyncHandler optional func panelSelectionDidChange(_ sender: Any?) } extension NSObject { } diff --git a/macOS/AppKit/NSScrubber.swift b/macOS/AppKit/NSScrubber.swift index cddcfdd..d01fa5e 100644 --- a/macOS/AppKit/NSScrubber.swift +++ b/macOS/AppKit/NSScrubber.swift @@ -7,17 +7,17 @@ protocol NSScrubberDataSource : NSObjectProtocol { } protocol NSScrubberDelegate : NSObjectProtocol { @available(macOS 10.12.2, *) - optional func scrubber(_ scrubber: NSScrubber, didSelectItemAt selectedIndex: Int) + @asyncHandler optional func scrubber(_ scrubber: NSScrubber, didSelectItemAt selectedIndex: Int) @available(macOS 10.12.2, *) - optional func scrubber(_ scrubber: NSScrubber, didHighlightItemAt highlightedIndex: Int) + @asyncHandler optional func scrubber(_ scrubber: NSScrubber, didHighlightItemAt highlightedIndex: Int) @available(macOS 10.12.2, *) - optional func scrubber(_ scrubber: NSScrubber, didChangeVisibleRange visibleRange: NSRange) + @asyncHandler optional func scrubber(_ scrubber: NSScrubber, didChangeVisibleRange visibleRange: NSRange) @available(macOS 10.12.2, *) - optional func didBeginInteracting(with scrubber: NSScrubber) + @asyncHandler optional func didBeginInteracting(with scrubber: NSScrubber) @available(macOS 10.12.2, *) - optional func didFinishInteracting(with scrubber: NSScrubber) + @asyncHandler optional func didFinishInteracting(with scrubber: NSScrubber) @available(macOS 10.12.2, *) - optional func didCancelInteracting(with scrubber: NSScrubber) + @asyncHandler optional func didCancelInteracting(with scrubber: NSScrubber) } extension NSScrubber { @available(macOS 10.12.2, *) diff --git a/macOS/AppKit/NSSearchField.swift b/macOS/AppKit/NSSearchField.swift index 28a51d3..86ecc17 100644 --- a/macOS/AppKit/NSSearchField.swift +++ b/macOS/AppKit/NSSearchField.swift @@ -4,9 +4,9 @@ extension NSSearchField { } protocol NSSearchFieldDelegate : NSTextFieldDelegate { @available(macOS 10.11, *) - optional func searchFieldDidStartSearching(_ sender: NSSearchField) + @asyncHandler optional func searchFieldDidStartSearching(_ sender: NSSearchField) @available(macOS 10.11, *) - optional func searchFieldDidEndSearching(_ sender: NSSearchField) + @asyncHandler optional func searchFieldDidEndSearching(_ sender: NSSearchField) } class NSSearchField : NSTextField { @available(macOS 11.0, *) diff --git a/macOS/AppKit/NSSharingService.swift b/macOS/AppKit/NSSharingService.swift index 6d9c39b..5677522 100644 --- a/macOS/AppKit/NSSharingService.swift +++ b/macOS/AppKit/NSSharingService.swift @@ -97,9 +97,9 @@ protocol NSSharingServiceDelegate : NSObjectProtocol { @available(macOS 10.8, *) optional func sharingService(_ sharingService: NSSharingService, willShareItems items: [Any]) @available(macOS 10.8, *) - optional func sharingService(_ sharingService: NSSharingService, didFailToShareItems items: [Any], error: Error) + @asyncHandler optional func sharingService(_ sharingService: NSSharingService, didFailToShareItems items: [Any], error: Error) @available(macOS 10.8, *) - optional func sharingService(_ sharingService: NSSharingService, didShareItems items: [Any]) + @asyncHandler optional func sharingService(_ sharingService: NSSharingService, didShareItems items: [Any]) @available(macOS 10.8, *) optional func sharingService(_ sharingService: NSSharingService, sourceFrameOnScreenForShareItem item: Any) -> NSRect @available(macOS 10.8, *) @@ -111,13 +111,13 @@ protocol NSSharingServiceDelegate : NSObjectProtocol { } protocol NSCloudSharingServiceDelegate : NSSharingServiceDelegate { @available(macOS 10.8, *) - optional func sharingService(_ sharingService: NSSharingService, didCompleteForItems items: [Any], error: Error?) + @asyncHandler optional func sharingService(_ sharingService: NSSharingService, didCompleteForItems items: [Any], error: Error?) @available(macOS 10.12, *) optional func options(for cloudKitSharingService: NSSharingService, share provider: NSItemProvider) -> NSSharingService.CloudKitOptions @available(macOS 10.12, *) - optional func sharingService(_ sharingService: NSSharingService, didSave share: CKShare) + @asyncHandler optional func sharingService(_ sharingService: NSSharingService, didSave share: CKShare) @available(macOS 10.12, *) - optional func sharingService(_ sharingService: NSSharingService, didStopSharing share: CKShare) + @asyncHandler optional func sharingService(_ sharingService: NSSharingService, didStopSharing share: CKShare) } extension NSItemProvider { @available(macOS 10.12, *) @@ -137,5 +137,5 @@ protocol NSSharingServicePickerDelegate : NSObjectProtocol { @available(macOS 10.8, *) optional func sharingServicePicker(_ sharingServicePicker: NSSharingServicePicker, delegateFor sharingService: NSSharingService) -> NSSharingServiceDelegate? @available(macOS 10.8, *) - optional func sharingServicePicker(_ sharingServicePicker: NSSharingServicePicker, didChoose service: NSSharingService?) + @asyncHandler optional func sharingServicePicker(_ sharingServicePicker: NSSharingServicePicker, didChoose service: NSSharingService?) } diff --git a/macOS/AppKit/NSSound.swift b/macOS/AppKit/NSSound.swift index 0d2e550..9ecea36 100644 --- a/macOS/AppKit/NSSound.swift +++ b/macOS/AppKit/NSSound.swift @@ -42,7 +42,7 @@ extension NSSound { extension NSSound { } protocol NSSoundDelegate : NSObjectProtocol { - optional func sound(_ sound: NSSound, didFinishPlaying flag: Bool) + @asyncHandler optional func sound(_ sound: NSSound, didFinishPlaying flag: Bool) } extension Bundle { func path(forSoundResource name: NSSound.Name) -> String? diff --git a/macOS/AppKit/NSSpeechRecognizer.swift b/macOS/AppKit/NSSpeechRecognizer.swift index 4a98976..f397697 100644 --- a/macOS/AppKit/NSSpeechRecognizer.swift +++ b/macOS/AppKit/NSSpeechRecognizer.swift @@ -9,5 +9,5 @@ class NSSpeechRecognizer : NSObject { var blocksOtherRecognizers: Bool } protocol NSSpeechRecognizerDelegate : NSObjectProtocol { - optional func speechRecognizer(_ sender: NSSpeechRecognizer, didRecognizeCommand command: String) + @asyncHandler optional func speechRecognizer(_ sender: NSSpeechRecognizer, didRecognizeCommand command: String) } diff --git a/macOS/AppKit/NSSpeechSynthesizer.swift b/macOS/AppKit/NSSpeechSynthesizer.swift index 94bdfe3..6b0aa57 100644 --- a/macOS/AppKit/NSSpeechSynthesizer.swift +++ b/macOS/AppKit/NSSpeechSynthesizer.swift @@ -164,13 +164,13 @@ class NSSpeechSynthesizer : NSObject { class func attributes(forVoice voice: NSSpeechSynthesizer.VoiceName) -> [NSSpeechSynthesizer.VoiceAttributeKey : Any] } protocol NSSpeechSynthesizerDelegate : NSObjectProtocol { - optional func speechSynthesizer(_ sender: NSSpeechSynthesizer, didFinishSpeaking finishedSpeaking: Bool) + @asyncHandler optional func speechSynthesizer(_ sender: NSSpeechSynthesizer, didFinishSpeaking finishedSpeaking: Bool) optional func speechSynthesizer(_ sender: NSSpeechSynthesizer, willSpeakWord characterRange: NSRange, of string: String) optional func speechSynthesizer(_ sender: NSSpeechSynthesizer, willSpeakPhoneme phonemeOpcode: Int16) @available(macOS 10.5, *) - optional func speechSynthesizer(_ sender: NSSpeechSynthesizer, didEncounterErrorAt characterIndex: Int, of string: String, message: String) + @asyncHandler optional func speechSynthesizer(_ sender: NSSpeechSynthesizer, didEncounterErrorAt characterIndex: Int, of string: String, message: String) @available(macOS 10.5, *) - optional func speechSynthesizer(_ sender: NSSpeechSynthesizer, didEncounterSyncMessage message: String) + @asyncHandler optional func speechSynthesizer(_ sender: NSSpeechSynthesizer, didEncounterSyncMessage message: String) } extension NSSpeechSynthesizer.SpeechPropertyKey.Mode { @available(macOS 10.5, *) diff --git a/macOS/AppKit/NSSpellChecker.swift b/macOS/AppKit/NSSpellChecker.swift index d5b74c7..15e3721 100644 --- a/macOS/AppKit/NSSpellChecker.swift +++ b/macOS/AppKit/NSSpellChecker.swift @@ -69,6 +69,8 @@ class NSSpellChecker : NSObject { @available(macOS 10.7, *) func showCorrectionIndicator(of type: NSSpellChecker.CorrectionIndicatorType, primaryString: String, alternativeStrings: [String], forStringIn rectOfTypedString: NSRect, view: NSView, completionHandler completionBlock: ((String?) -> Void)? = nil) @available(macOS 10.7, *) + func showCorrectionIndicator(of type: NSSpellChecker.CorrectionIndicatorType, primaryString: String, alternativeStrings: [String], forStringIn rectOfTypedString: NSRect, view: NSView) async -> String? + @available(macOS 10.7, *) func dismissCorrectionIndicator(for view: NSView) @available(macOS 10.12, *) func preventsAutocorrection(before string: String, language: String?) -> Bool diff --git a/macOS/AppKit/NSSplitView.swift b/macOS/AppKit/NSSplitView.swift index 346d4d6..eec54ea 100644 --- a/macOS/AppKit/NSSplitView.swift +++ b/macOS/AppKit/NSSplitView.swift @@ -52,7 +52,7 @@ protocol NSSplitViewDelegate : NSObjectProtocol { @available(macOS 10.5, *) optional func splitView(_ splitView: NSSplitView, additionalEffectiveRectOfDividerAt dividerIndex: Int) -> NSRect optional func splitViewWillResizeSubviews(_ notification: Notification) - optional func splitViewDidResizeSubviews(_ notification: Notification) + @asyncHandler optional func splitViewDidResizeSubviews(_ notification: Notification) } extension NSSplitView { class let willResizeSubviewsNotification: NSNotification.Name diff --git a/macOS/AppKit/NSStackView.swift b/macOS/AppKit/NSStackView.swift index a857073..07aad4b 100644 --- a/macOS/AppKit/NSStackView.swift +++ b/macOS/AppKit/NSStackView.swift @@ -72,7 +72,7 @@ protocol NSStackViewDelegate : NSObjectProtocol { @available(macOS 10.9, *) optional func stackView(_ stackView: NSStackView, willDetach views: [NSView]) @available(macOS 10.9, *) - optional func stackView(_ stackView: NSStackView, didReattach views: [NSView]) + @asyncHandler optional func stackView(_ stackView: NSStackView, didReattach views: [NSView]) } extension NSStackView { func addView(_ view: NSView, in gravity: NSStackView.Gravity) diff --git a/macOS/AppKit/NSTabView.swift b/macOS/AppKit/NSTabView.swift index 3d941ac..698a08a 100644 --- a/macOS/AppKit/NSTabView.swift +++ b/macOS/AppKit/NSTabView.swift @@ -69,6 +69,6 @@ class NSTabView : NSView { protocol NSTabViewDelegate : NSObjectProtocol { optional func tabView(_ tabView: NSTabView, shouldSelect tabViewItem: NSTabViewItem?) -> Bool optional func tabView(_ tabView: NSTabView, willSelect tabViewItem: NSTabViewItem?) - optional func tabView(_ tabView: NSTabView, didSelect tabViewItem: NSTabViewItem?) - optional func tabViewDidChangeNumberOfTabViewItems(_ tabView: NSTabView) + @asyncHandler optional func tabView(_ tabView: NSTabView, didSelect tabViewItem: NSTabViewItem?) + @asyncHandler optional func tabViewDidChangeNumberOfTabViewItems(_ tabView: NSTabView) } diff --git a/macOS/AppKit/NSTableView.swift b/macOS/AppKit/NSTableView.swift index e74fdce..8bb0f1c 100644 --- a/macOS/AppKit/NSTableView.swift +++ b/macOS/AppKit/NSTableView.swift @@ -230,9 +230,9 @@ protocol NSTableViewDelegate : NSControlTextEditingDelegate { @available(macOS 10.7, *) optional func tableView(_ tableView: NSTableView, rowViewForRow row: Int) -> NSTableRowView? @available(macOS 10.7, *) - optional func tableView(_ tableView: NSTableView, didAdd rowView: NSTableRowView, forRow row: Int) + @asyncHandler optional func tableView(_ tableView: NSTableView, didAdd rowView: NSTableRowView, forRow row: Int) @available(macOS 10.7, *) - optional func tableView(_ tableView: NSTableView, didRemove rowView: NSTableRowView, forRow row: Int) + @asyncHandler optional func tableView(_ tableView: NSTableView, didRemove rowView: NSTableRowView, forRow row: Int) optional func tableView(_ tableView: NSTableView, willDisplayCell cell: Any, for tableColumn: NSTableColumn?, row: Int) optional func tableView(_ tableView: NSTableView, shouldEdit tableColumn: NSTableColumn?, row: Int) -> Bool optional func tableView(_ tableView: NSTableView, toolTipFor cell: NSCell, rect: NSRectPointer, tableColumn: NSTableColumn?, row: Int, mouseLocation: NSPoint) -> String @@ -248,8 +248,8 @@ protocol NSTableViewDelegate : NSControlTextEditingDelegate { optional func tableView(_ tableView: NSTableView, selectionIndexesForProposedSelection proposedSelectionIndexes: IndexSet) -> IndexSet optional func tableView(_ tableView: NSTableView, shouldSelect tableColumn: NSTableColumn?) -> Bool optional func tableView(_ tableView: NSTableView, mouseDownInHeaderOf tableColumn: NSTableColumn) - optional func tableView(_ tableView: NSTableView, didClick tableColumn: NSTableColumn) - optional func tableView(_ tableView: NSTableView, didDrag tableColumn: NSTableColumn) + @asyncHandler optional func tableView(_ tableView: NSTableView, didClick tableColumn: NSTableColumn) + @asyncHandler optional func tableView(_ tableView: NSTableView, didDrag tableColumn: NSTableColumn) optional func tableView(_ tableView: NSTableView, heightOfRow row: Int) -> CGFloat @available(macOS 10.5, *) optional func tableView(_ tableView: NSTableView, typeSelectStringFor tableColumn: NSTableColumn?, row: Int) -> String? @@ -265,9 +265,9 @@ protocol NSTableViewDelegate : NSControlTextEditingDelegate { optional func tableView(_ tableView: NSTableView, shouldReorderColumn columnIndex: Int, toColumn newColumnIndex: Int) -> Bool @available(macOS 10.11, *) optional func tableView(_ tableView: NSTableView, rowActionsForRow row: Int, edge: NSTableView.RowActionEdge) -> [NSTableViewRowAction] - optional func tableViewSelectionDidChange(_ notification: Notification) - optional func tableViewColumnDidMove(_ notification: Notification) - optional func tableViewColumnDidResize(_ notification: Notification) + @asyncHandler optional func tableViewSelectionDidChange(_ notification: Notification) + @asyncHandler optional func tableViewColumnDidMove(_ notification: Notification) + @asyncHandler optional func tableViewColumnDidResize(_ notification: Notification) optional func tableViewSelectionIsChanging(_ notification: Notification) } protocol NSTableViewDataSource : NSObjectProtocol { diff --git a/macOS/AppKit/NSTableViewDiffableDataSource.swift b/macOS/AppKit/NSTableViewDiffableDataSource.swift index be871d0..86544b8 100644 --- a/macOS/AppKit/NSTableViewDiffableDataSource.swift +++ b/macOS/AppKit/NSTableViewDiffableDataSource.swift @@ -5,6 +5,7 @@ class NSTableViewDiffableDataSourceReference NSDiffableDataSourceSnapshotReference func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool, completion: (() -> Void)? = nil) + func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async func itemIdentifier(forRow row: Int) -> ItemIdentifierType? func row(forItemIdentifier identifier: ItemIdentifierType) -> Int func sectionIdentifier(forRow row: Int) -> SectionIdentifierType? diff --git a/macOS/AppKit/NSText.swift b/macOS/AppKit/NSText.swift index 2ce5479..6ce54ca 100644 --- a/macOS/AppKit/NSText.swift +++ b/macOS/AppKit/NSText.swift @@ -112,9 +112,9 @@ var NSOtherTextMovement: Int { get } protocol NSTextDelegate : NSObjectProtocol { optional func textShouldBeginEditing(_ textObject: NSText) -> Bool optional func textShouldEndEditing(_ textObject: NSText) -> Bool - optional func textDidBeginEditing(_ notification: Notification) - optional func textDidEndEditing(_ notification: Notification) - optional func textDidChange(_ notification: Notification) + @asyncHandler optional func textDidBeginEditing(_ notification: Notification) + @asyncHandler optional func textDidEndEditing(_ notification: Notification) + @asyncHandler optional func textDidChange(_ notification: Notification) } @available(macOS, introduced: 10.0, deprecated: 10.11, message: "Use NSWritingDirectionEmbedding instead") var NSTextWritingDirectionEmbedding: Int { get } diff --git a/macOS/AppKit/NSTextFinder.swift b/macOS/AppKit/NSTextFinder.swift index 9e4f56d..de5c53e 100644 --- a/macOS/AppKit/NSTextFinder.swift +++ b/macOS/AppKit/NSTextFinder.swift @@ -67,7 +67,7 @@ protocol NSTextFinderClient : NSObjectProtocol { optional func scrollRangeToVisible(_ range: NSRange) optional func shouldReplaceCharacters(inRanges ranges: [NSValue], with strings: [String]) -> Bool optional func replaceCharacters(in range: NSRange, with string: String) - optional func didReplaceCharacters() + @asyncHandler optional func didReplaceCharacters() optional func contentView(at index: Int, effectiveCharacterRange outRange: NSRangePointer) -> NSView optional func rects(forCharacterRange range: NSRange) -> [NSValue]? optional var visibleCharacterRanges: [NSValue] { get } @@ -76,6 +76,6 @@ protocol NSTextFinderClient : NSObjectProtocol { protocol NSTextFinderBarContainer : NSObjectProtocol { var findBarView: NSView? { get set } var isFindBarVisible: Bool { get set } - func findBarViewDidChangeHeight() + @asyncHandler func findBarViewDidChangeHeight() optional func contentView() -> NSView? } diff --git a/macOS/AppKit/NSTextStorage.swift b/macOS/AppKit/NSTextStorage.swift index c3573cd..a308e5e 100644 --- a/macOS/AppKit/NSTextStorage.swift +++ b/macOS/AppKit/NSTextStorage.swift @@ -27,7 +27,7 @@ protocol NSTextStorageDelegate : NSObjectProtocol { @available(macOS 10.11, *) optional func textStorage(_ textStorage: NSTextStorage, willProcessEditing editedMask: NSTextStorageEditActions, range editedRange: NSRange, changeInLength delta: Int) @available(macOS 10.11, *) - optional func textStorage(_ textStorage: NSTextStorage, didProcessEditing editedMask: NSTextStorageEditActions, range editedRange: NSRange, changeInLength delta: Int) + @asyncHandler optional func textStorage(_ textStorage: NSTextStorage, didProcessEditing editedMask: NSTextStorageEditActions, range editedRange: NSRange, changeInLength delta: Int) } extension NSTextStorage { @available(macOS 10.0, *) diff --git a/macOS/AppKit/NSTextView.swift b/macOS/AppKit/NSTextView.swift index 61c0573..f860ad7 100644 --- a/macOS/AppKit/NSTextView.swift +++ b/macOS/AppKit/NSTextView.swift @@ -242,8 +242,8 @@ protocol NSTextViewDelegate : NSTextDelegate { optional func textView(_ textView: NSTextView, shouldChangeTextInRanges affectedRanges: [NSValue], replacementStrings: [String]?) -> Bool @available(macOS 10.0, *) optional func textView(_ textView: NSTextView, shouldChangeTypingAttributes oldTypingAttributes: [String : Any] = [:], toAttributes newTypingAttributes: [NSAttributedString.Key : Any] = [:]) -> [NSAttributedString.Key : Any] - optional func textViewDidChangeSelection(_ notification: Notification) - optional func textViewDidChangeTypingAttributes(_ notification: Notification) + @asyncHandler optional func textViewDidChangeSelection(_ notification: Notification) + @asyncHandler optional func textViewDidChangeTypingAttributes(_ notification: Notification) optional func textView(_ textView: NSTextView, willDisplayToolTip tooltip: String, forCharacterAt characterIndex: Int) -> String? optional func textView(_ textView: NSTextView, completions words: [String], forPartialWordRange charRange: NSRange, indexOfSelectedItem index: UnsafeMutablePointer?) -> [String] optional func textView(_ textView: NSTextView, shouldChangeTextIn affectedCharRange: NSRange, replacementString: String?) -> Bool diff --git a/macOS/AppKit/NSToolbar.swift b/macOS/AppKit/NSToolbar.swift index 089c811..331403d 100644 --- a/macOS/AppKit/NSToolbar.swift +++ b/macOS/AppKit/NSToolbar.swift @@ -58,7 +58,7 @@ protocol NSToolbarDelegate : NSObjectProtocol { optional func toolbarAllowedItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] optional func toolbarSelectableItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] optional func toolbarWillAddItem(_ notification: Notification) - optional func toolbarDidRemoveItem(_ notification: Notification) + @asyncHandler optional func toolbarDidRemoveItem(_ notification: Notification) } extension NSToolbar { @available(macOS, introduced: 10.7, deprecated: 10.13, message: "Use NSTitlebarAccessoryViewController with NSWindow instead") diff --git a/macOS/AppKit/NSViewController.swift b/macOS/AppKit/NSViewController.swift index b5026df..e6d2f59 100644 --- a/macOS/AppKit/NSViewController.swift +++ b/macOS/AppKit/NSViewController.swift @@ -65,6 +65,8 @@ extension NSViewController { func present(_ viewController: NSViewController, asPopoverRelativeTo positioningRect: NSRect, of positioningView: NSView, preferredEdge: NSRectEdge, behavior: NSPopover.Behavior) @available(macOS 10.10, *) func transition(from fromViewController: NSViewController, to toViewController: NSViewController, options: NSViewController.TransitionOptions = [], completionHandler completion: (() -> Void)? = nil) + @available(macOS 10.10, *) + func transition(from fromViewController: NSViewController, to toViewController: NSViewController, options: NSViewController.TransitionOptions = []) async } extension NSViewController { @available(macOS 10.10, *) diff --git a/macOS/AppKit/NSWindow.swift b/macOS/AppKit/NSWindow.swift index 195d9ba..914d432 100644 --- a/macOS/AppKit/NSWindow.swift +++ b/macOS/AppKit/NSWindow.swift @@ -413,8 +413,12 @@ class NSWindow : NSResponder, NSAnimatablePropertyContainer, NSMenuItemValidatio @available(macOS 10.9, *) func beginSheet(_ sheetWindow: NSWindow, completionHandler handler: ((NSApplication.ModalResponse) -> Void)? = nil) @available(macOS 10.9, *) + func beginSheet(_ sheetWindow: NSWindow) async -> NSApplication.ModalResponse + @available(macOS 10.9, *) func beginCriticalSheet(_ sheetWindow: NSWindow, completionHandler handler: ((NSApplication.ModalResponse) -> Void)? = nil) @available(macOS 10.9, *) + func beginCriticalSheet(_ sheetWindow: NSWindow) async -> NSApplication.ModalResponse + @available(macOS 10.9, *) func endSheet(_ sheetWindow: NSWindow) @available(macOS 10.9, *) func endSheet(_ sheetWindow: NSWindow, returnCode: NSApplication.ModalResponse) @@ -548,7 +552,7 @@ protocol NSWindowDelegate : NSObjectProtocol { @available(macOS 10.7, *) optional func window(_ window: NSWindow, startCustomAnimationToEnterFullScreenWithDuration duration: TimeInterval) @available(macOS 10.7, *) - optional func windowDidFailToEnterFullScreen(_ window: NSWindow) + @asyncHandler optional func windowDidFailToEnterFullScreen(_ window: NSWindow) @available(macOS 10.7, *) optional func customWindowsToExitFullScreen(for window: NSWindow) -> [NSWindow]? @available(macOS 10.7, *) @@ -558,54 +562,54 @@ protocol NSWindowDelegate : NSObjectProtocol { @available(macOS 10.9, *) optional func window(_ window: NSWindow, startCustomAnimationToEnterFullScreenOn screen: NSScreen, withDuration duration: TimeInterval) @available(macOS 10.7, *) - optional func windowDidFailToExitFullScreen(_ window: NSWindow) + @asyncHandler optional func windowDidFailToExitFullScreen(_ window: NSWindow) @available(macOS 10.7, *) optional func window(_ window: NSWindow, willResizeForVersionBrowserWithMaxPreferredSize maxPreferredFrameSize: NSSize, maxAllowedSize maxAllowedFrameSize: NSSize) -> NSSize @available(macOS 10.7, *) optional func window(_ window: NSWindow, willEncodeRestorableState state: NSCoder) @available(macOS 10.7, *) - optional func window(_ window: NSWindow, didDecodeRestorableState state: NSCoder) - optional func windowDidResize(_ notification: Notification) - optional func windowDidExpose(_ notification: Notification) + @asyncHandler optional func window(_ window: NSWindow, didDecodeRestorableState state: NSCoder) + @asyncHandler optional func windowDidResize(_ notification: Notification) + @asyncHandler optional func windowDidExpose(_ notification: Notification) optional func windowWillMove(_ notification: Notification) - optional func windowDidMove(_ notification: Notification) - optional func windowDidBecomeKey(_ notification: Notification) - optional func windowDidResignKey(_ notification: Notification) - optional func windowDidBecomeMain(_ notification: Notification) - optional func windowDidResignMain(_ notification: Notification) + @asyncHandler optional func windowDidMove(_ notification: Notification) + @asyncHandler optional func windowDidBecomeKey(_ notification: Notification) + @asyncHandler optional func windowDidResignKey(_ notification: Notification) + @asyncHandler optional func windowDidBecomeMain(_ notification: Notification) + @asyncHandler optional func windowDidResignMain(_ notification: Notification) optional func windowWillClose(_ notification: Notification) optional func windowWillMiniaturize(_ notification: Notification) - optional func windowDidMiniaturize(_ notification: Notification) - optional func windowDidDeminiaturize(_ notification: Notification) - optional func windowDidUpdate(_ notification: Notification) - optional func windowDidChangeScreen(_ notification: Notification) - optional func windowDidChangeScreenProfile(_ notification: Notification) + @asyncHandler optional func windowDidMiniaturize(_ notification: Notification) + @asyncHandler optional func windowDidDeminiaturize(_ notification: Notification) + @asyncHandler optional func windowDidUpdate(_ notification: Notification) + @asyncHandler optional func windowDidChangeScreen(_ notification: Notification) + @asyncHandler optional func windowDidChangeScreenProfile(_ notification: Notification) @available(macOS 10.7, *) - optional func windowDidChangeBackingProperties(_ notification: Notification) + @asyncHandler optional func windowDidChangeBackingProperties(_ notification: Notification) optional func windowWillBeginSheet(_ notification: Notification) - optional func windowDidEndSheet(_ notification: Notification) + @asyncHandler optional func windowDidEndSheet(_ notification: Notification) @available(macOS 10.6, *) optional func windowWillStartLiveResize(_ notification: Notification) @available(macOS 10.6, *) - optional func windowDidEndLiveResize(_ notification: Notification) + @asyncHandler optional func windowDidEndLiveResize(_ notification: Notification) @available(macOS 10.7, *) optional func windowWillEnterFullScreen(_ notification: Notification) @available(macOS 10.7, *) - optional func windowDidEnterFullScreen(_ notification: Notification) + @asyncHandler optional func windowDidEnterFullScreen(_ notification: Notification) @available(macOS 10.7, *) optional func windowWillExitFullScreen(_ notification: Notification) @available(macOS 10.7, *) - optional func windowDidExitFullScreen(_ notification: Notification) + @asyncHandler optional func windowDidExitFullScreen(_ notification: Notification) @available(macOS 10.7, *) optional func windowWillEnterVersionBrowser(_ notification: Notification) @available(macOS 10.7, *) - optional func windowDidEnterVersionBrowser(_ notification: Notification) + @asyncHandler optional func windowDidEnterVersionBrowser(_ notification: Notification) @available(macOS 10.7, *) optional func windowWillExitVersionBrowser(_ notification: Notification) @available(macOS 10.7, *) - optional func windowDidExitVersionBrowser(_ notification: Notification) + @asyncHandler optional func windowDidExitVersionBrowser(_ notification: Notification) @available(macOS 10.9, *) - optional func windowDidChangeOcclusionState(_ notification: Notification) + @asyncHandler optional func windowDidChangeOcclusionState(_ notification: Notification) } extension NSWindow { @available(macOS, introduced: 10.0, deprecated: 10.13, message: "This method shouldn’t be used as it doesn’t work in all drawing situations; instead, a subview should be used that implements the desired drawing behavior") diff --git a/macOS/AppKit/NSWindowRestoration.swift b/macOS/AppKit/NSWindowRestoration.swift index be02b24..7d057bb 100644 --- a/macOS/AppKit/NSWindowRestoration.swift +++ b/macOS/AppKit/NSWindowRestoration.swift @@ -2,6 +2,8 @@ protocol NSWindowRestoration : NSObjectProtocol { @available(macOS 10.7, *) static func restoreWindow(withIdentifier identifier: NSUserInterfaceItemIdentifier, state: NSCoder, completionHandler: @escaping (NSWindow?, Error?) -> Void) + @available(macOS 10.7, *) + static func restoreWindow(withIdentifier identifier: NSUserInterfaceItemIdentifier, state: NSCoder) async throws -> NSWindow? } extension NSDocumentController : NSWindowRestoration { } @@ -43,6 +45,8 @@ extension NSDocument { @available(macOS 10.7, *) func restoreWindow(withIdentifier identifier: NSUserInterfaceItemIdentifier, state: NSCoder, completionHandler: @escaping (NSWindow?, Error?) -> Void) @available(macOS 10.7, *) + func restoreWindow(withIdentifier identifier: NSUserInterfaceItemIdentifier, state: NSCoder) async throws -> NSWindow? + @available(macOS 10.7, *) func encodeRestorableState(with coder: NSCoder) @available(macOS 10.13, *) func encodeRestorableState(with coder: NSCoder, backgroundQueue queue: OperationQueue) diff --git a/macOS/AppKit/NSWorkspace.swift b/macOS/AppKit/NSWorkspace.swift index 56adf0d..36acee2 100644 --- a/macOS/AppKit/NSWorkspace.swift +++ b/macOS/AppKit/NSWorkspace.swift @@ -6,9 +6,15 @@ class NSWorkspace : NSObject { @available(macOS 10.15, *) func open(_ url: URL, configuration: NSWorkspace.OpenConfiguration, completionHandler: ((NSRunningApplication?, Error?) -> Void)? = nil) @available(macOS 10.15, *) + func open(_ url: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication? + @available(macOS 10.15, *) func open(_ urls: [URL], withApplicationAt applicationURL: URL, configuration: NSWorkspace.OpenConfiguration, completionHandler: ((NSRunningApplication?, Error?) -> Void)? = nil) @available(macOS 10.15, *) + func open(_ urls: [URL], withApplicationAt applicationURL: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication? + @available(macOS 10.15, *) func openApplication(at applicationURL: URL, configuration: NSWorkspace.OpenConfiguration, completionHandler: ((NSRunningApplication?, Error?) -> Void)? = nil) + @available(macOS 10.15, *) + func openApplication(at applicationURL: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication? func selectFile(_ fullPath: String?, inFileViewerRootedAtPath rootFullPath: String) -> Bool @available(macOS 10.6, *) func activateFileViewerSelecting(_ fileURLs: [URL]) @@ -26,7 +32,11 @@ class NSWorkspace : NSObject { @available(macOS 10.6, *) func recycle(_ URLs: [URL], completionHandler handler: (([URL : URL], Error?) -> Void)? = nil) @available(macOS 10.6, *) + func recycle(_ URLs: [URL]) async throws -> [URL : URL] + @available(macOS 10.6, *) func duplicate(_ URLs: [URL], completionHandler handler: (([URL : URL], Error?) -> Void)? = nil) + @available(macOS 10.6, *) + func duplicate(_ URLs: [URL]) async throws -> [URL : URL] func getFileSystemInfo(forPath fullPath: String, isRemovable removableFlag: UnsafeMutablePointer?, isWritable writableFlag: UnsafeMutablePointer?, isUnmountable unmountableFlag: UnsafeMutablePointer?, description: AutoreleasingUnsafeMutablePointer?, type fileSystemType: AutoreleasingUnsafeMutablePointer?) -> Bool func unmountAndEjectDevice(atPath path: String) -> Bool @available(macOS 10.6, *) @@ -182,6 +192,8 @@ extension NSWorkspace { extension NSWorkspace { @available(macOS 10.14, *) func requestAuthorization(to type: NSWorkspace.AuthorizationType, completionHandler: @escaping (NSWorkspace.Authorization?, Error?) -> Void) + @available(macOS 10.14, *) + func requestAuthorization(to type: NSWorkspace.AuthorizationType) async throws -> NSWorkspace.Authorization? } extension FileManager { @available(macOS 10.14, *) diff --git a/macOS/AppTrackingTransparency/AppTrackingTransparency.swift b/macOS/AppTrackingTransparency/AppTrackingTransparency.swift index 77eeb83..001b32c 100644 --- a/macOS/AppTrackingTransparency/AppTrackingTransparency.swift +++ b/macOS/AppTrackingTransparency/AppTrackingTransparency.swift @@ -14,5 +14,6 @@ extension ATTrackingManager { class ATTrackingManager : NSObject { class var trackingAuthorizationStatus: ATTrackingManager.AuthorizationStatus { get } class func requestTrackingAuthorization(completionHandler completion: @escaping (ATTrackingManager.AuthorizationStatus) -> Void) + class func requestTrackingAuthorization() async -> ATTrackingManager.AuthorizationStatus } var AppTrackingTransparencyVersionNumber: Double diff --git a/macOS/AudioToolbox/AUAudioUnit.swift b/macOS/AudioToolbox/AUAudioUnit.swift index e53f655..0ce7d3e 100644 --- a/macOS/AudioToolbox/AUAudioUnit.swift +++ b/macOS/AudioToolbox/AUAudioUnit.swift @@ -33,6 +33,7 @@ class AUAudioUnit : NSObject { init(componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = []) throws convenience init(componentDescription: AudioComponentDescription) throws class func instantiate(with componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = [], completionHandler: @escaping (AUAudioUnit?, Error?) -> Void) + class func instantiate(with componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = []) async throws -> AUAudioUnit? var componentDescription: AudioComponentDescription { get } var component: AudioComponent { get } var componentName: String? { get } diff --git a/macOS/AudioVideoBridging/AudioVideoBridging.swift b/macOS/AudioVideoBridging/AudioVideoBridging.swift index ecb460e..1fe8b4e 100644 --- a/macOS/AudioVideoBridging/AudioVideoBridging.swift +++ b/macOS/AudioVideoBridging/AudioVideoBridging.swift @@ -427,21 +427,21 @@ struct AVB17221EntityPropertyChanged : OptionSet { } protocol AVB17221EntityDiscoveryDelegate { @available(macOS 10.8, *) - func didAddRemoteEntity(_ newEntity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) + @asyncHandler func didAddRemoteEntity(_ newEntity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) @available(macOS 10.8, *) - func didRemoveRemoteEntity(_ oldEntity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) + @asyncHandler func didRemoveRemoteEntity(_ oldEntity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) @available(macOS 10.8, *) - func didRediscoverRemoteEntity(_ entity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) + @asyncHandler func didRediscoverRemoteEntity(_ entity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) @available(macOS 10.8, *) - func didUpdateRemoteEntity(_ entity: AVB17221Entity, changedProperties: AVB17221EntityPropertyChanged, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) + @asyncHandler func didUpdateRemoteEntity(_ entity: AVB17221Entity, changedProperties: AVB17221EntityPropertyChanged, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) @available(macOS 10.8, *) - func didAddLocalEntity(_ newEntity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) + @asyncHandler func didAddLocalEntity(_ newEntity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) @available(macOS 10.8, *) - func didRemoveLocalEntity(_ oldEntity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) + @asyncHandler func didRemoveLocalEntity(_ oldEntity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) @available(macOS 10.8, *) - func didRediscoverLocalEntity(_ entity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) + @asyncHandler func didRediscoverLocalEntity(_ entity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) @available(macOS 10.8, *) - func didUpdateLocalEntity(_ entity: AVB17221Entity, changedProperties: AVB17221EntityPropertyChanged, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) + @asyncHandler func didUpdateLocalEntity(_ entity: AVB17221Entity, changedProperties: AVB17221EntityPropertyChanged, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) } @available(macOS 10.8, *) class AVB17221EntityDiscovery : NSObject { diff --git a/macOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift b/macOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift index 5f33d66..fe38207 100644 --- a/macOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift +++ b/macOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift @@ -16,4 +16,5 @@ extension ASAuthorizationAppleIDProvider { class ASAuthorizationAppleIDProvider : NSObject, ASAuthorizationProvider { func createRequest() -> ASAuthorizationAppleIDRequest func getCredentialState(forUserID userID: String, completion: @escaping (ASAuthorizationAppleIDProvider.CredentialState, Error?) -> Void) + func getCredentialState(forUserID userID: String) async throws -> ASAuthorizationAppleIDProvider.CredentialState } diff --git a/macOS/AuthenticationServices/ASAuthorizationController.swift b/macOS/AuthenticationServices/ASAuthorizationController.swift index df91b95..ca50cdc 100644 --- a/macOS/AuthenticationServices/ASAuthorizationController.swift +++ b/macOS/AuthenticationServices/ASAuthorizationController.swift @@ -1,8 +1,8 @@ @available(macOS 10.15, *) protocol ASAuthorizationControllerDelegate : NSObjectProtocol { - optional func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) - optional func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) + @asyncHandler optional func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) + @asyncHandler optional func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) } @available(macOS 10.15, *) protocol ASAuthorizationControllerPresentationContextProviding : NSObjectProtocol { diff --git a/macOS/AuthenticationServices/ASAuthorizationProviderExtensionAuthorizationRequest.swift b/macOS/AuthenticationServices/ASAuthorizationProviderExtensionAuthorizationRequest.swift index d1ea0b1..f8d7caf 100644 --- a/macOS/AuthenticationServices/ASAuthorizationProviderExtensionAuthorizationRequest.swift +++ b/macOS/AuthenticationServices/ASAuthorizationProviderExtensionAuthorizationRequest.swift @@ -24,6 +24,7 @@ class ASAuthorizationProviderExtensionAuthorizationRequest : NSObject { func complete(httpResponse: HTTPURLResponse, httpBody: Data?) func complete(error: Error) func presentAuthorizationViewController(completion: @escaping (Bool, Error?) -> Void) + func presentAuthorizationViewController() async throws -> Bool var url: URL { get } var requestedOperation: ASAuthorizationProviderAuthorizationOperation { get } var httpHeaders: [String : String] { get } diff --git a/macOS/AuthenticationServices/ASCredentialIdentityStore.swift b/macOS/AuthenticationServices/ASCredentialIdentityStore.swift index 2c67bd6..6097700 100644 --- a/macOS/AuthenticationServices/ASCredentialIdentityStore.swift +++ b/macOS/AuthenticationServices/ASCredentialIdentityStore.swift @@ -14,8 +14,13 @@ struct ASCredentialIdentityStoreError : _BridgedStoredNSError { class ASCredentialIdentityStore : NSObject { class var shared: ASCredentialIdentityStore { get } func getState(_ completion: @escaping (ASCredentialIdentityStoreState) -> Void) + func getState() async -> ASCredentialIdentityStoreState func saveCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity], completion: ((Bool, Error?) -> Void)? = nil) + func saveCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool func removeCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity], completion: ((Bool, Error?) -> Void)? = nil) + func removeCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool func removeAllCredentialIdentities(_ completion: ((Bool, Error?) -> Void)? = nil) + func removeAllCredentialIdentities() async throws -> Bool func replaceCredentialIdentities(with newCredentialIdentities: [ASPasswordCredentialIdentity], completion: ((Bool, Error?) -> Void)? = nil) + func replaceCredentialIdentities(with newCredentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool } diff --git a/macOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift b/macOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift index 825cf95..3f85764 100644 --- a/macOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift +++ b/macOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift @@ -2,5 +2,6 @@ @available(macOS 11.0, *) class ASCredentialProviderExtensionContext : NSExtensionContext { func completeRequest(withSelectedCredential credential: ASPasswordCredential, completionHandler: ((Bool) -> Void)? = nil) + func completeRequest(withSelectedCredential credential: ASPasswordCredential) async -> Bool func completeExtensionConfigurationRequest() } diff --git a/macOS/AuthenticationServices/ASWebAuthenticationSessionRequest.swift b/macOS/AuthenticationServices/ASWebAuthenticationSessionRequest.swift index 2a2e87e..9305598 100644 --- a/macOS/AuthenticationServices/ASWebAuthenticationSessionRequest.swift +++ b/macOS/AuthenticationServices/ASWebAuthenticationSessionRequest.swift @@ -1,8 +1,8 @@ @available(macOS 10.15, *) protocol ASWebAuthenticationSessionRequestDelegate : NSObjectProtocol { - optional func authenticationSessionRequest(_ authenticationSessionRequest: ASWebAuthenticationSessionRequest, didCompleteWithCallbackURL callbackURL: URL) - optional func authenticationSessionRequest(_ authenticationSessionRequest: ASWebAuthenticationSessionRequest, didCancelWithError error: Error) + @asyncHandler optional func authenticationSessionRequest(_ authenticationSessionRequest: ASWebAuthenticationSessionRequest, didCompleteWithCallbackURL callbackURL: URL) + @asyncHandler optional func authenticationSessionRequest(_ authenticationSessionRequest: ASWebAuthenticationSessionRequest, didCancelWithError error: Error) } @available(macOS 10.15, *) class ASWebAuthenticationSessionRequest : NSObject, NSSecureCoding, NSCopying { diff --git a/macOS/AutomaticAssessmentConfiguration/AutomaticAssessmentConfiguration.swift b/macOS/AutomaticAssessmentConfiguration/AutomaticAssessmentConfiguration.swift index f9b3065..8759ab2 100644 --- a/macOS/AutomaticAssessmentConfiguration/AutomaticAssessmentConfiguration.swift +++ b/macOS/AutomaticAssessmentConfiguration/AutomaticAssessmentConfiguration.swift @@ -14,10 +14,10 @@ class AEAssessmentSession : NSObject { } @available(macOS 10.15.4, *) protocol AEAssessmentSessionDelegate : NSObjectProtocol { - optional func assessmentSessionDidBegin(_ session: AEAssessmentSession) + @asyncHandler optional func assessmentSessionDidBegin(_ session: AEAssessmentSession) optional func assessmentSession(_ session: AEAssessmentSession, failedToBeginWithError error: Error) optional func assessmentSession(_ session: AEAssessmentSession, wasInterruptedWithError error: Error) - optional func assessmentSessionDidEnd(_ session: AEAssessmentSession) + @asyncHandler optional func assessmentSessionDidEnd(_ session: AEAssessmentSession) } @available(macOS 10.15.4, *) let AEAssessmentErrorDomain: String diff --git a/macOS/Automator/AMWorkflowController.swift b/macOS/Automator/AMWorkflowController.swift index 869fcf1..96541fe 100644 --- a/macOS/Automator/AMWorkflowController.swift +++ b/macOS/Automator/AMWorkflowController.swift @@ -45,13 +45,13 @@ struct __AMWorkflowControllerDelegateRespondTo { protocol AMWorkflowControllerDelegate : NSObjectProtocol { optional func workflowControllerWillRun(_ controller: AMWorkflowController) optional func workflowControllerWillStop(_ controller: AMWorkflowController) - optional func workflowControllerDidRun(_ controller: AMWorkflowController) - optional func workflowControllerDidStop(_ controller: AMWorkflowController) + @asyncHandler optional func workflowControllerDidRun(_ controller: AMWorkflowController) + @asyncHandler optional func workflowControllerDidStop(_ controller: AMWorkflowController) @available(macOS 10.4, *) optional func workflowController(_ controller: AMWorkflowController, willRun action: AMAction) @available(macOS 10.4, *) - optional func workflowController(_ controller: AMWorkflowController, didRun action: AMAction) - optional func workflowController(_ controller: AMWorkflowController, didError error: Error) + @asyncHandler optional func workflowController(_ controller: AMWorkflowController, didRun action: AMAction) + @asyncHandler optional func workflowController(_ controller: AMWorkflowController, didError error: Error) } extension NSObject { @available(macOS, introduced: 10.4, deprecated: 10.13, message: "Use AMWorkflowControllerDelegate protocol.") diff --git a/macOS/CallKit/CXCallController.swift b/macOS/CallKit/CXCallController.swift index ecea656..42f06a4 100644 --- a/macOS/CallKit/CXCallController.swift +++ b/macOS/CallKit/CXCallController.swift @@ -4,6 +4,9 @@ class CXCallController : NSObject { init(queue: DispatchQueue) var callObserver: CXCallObserver { get } func request(_ transaction: CXTransaction, completion: @escaping (Error?) -> Void) + func request(_ transaction: CXTransaction) async throws func requestTransaction(with actions: [CXAction], completion: @escaping (Error?) -> Void) + func requestTransaction(with actions: [CXAction]) async throws func requestTransaction(with action: CXAction, completion: @escaping (Error?) -> Void) + func requestTransaction(with action: CXAction) async throws } diff --git a/macOS/CallKit/CXProvider.swift b/macOS/CallKit/CXProvider.swift index 160fbf1..1150934 100644 --- a/macOS/CallKit/CXProvider.swift +++ b/macOS/CallKit/CXProvider.swift @@ -11,8 +11,8 @@ enum CXCallEndedReason : Int { } @available(macOS 11.0, *) protocol CXProviderDelegate : NSObjectProtocol { - func providerDidReset(_ provider: CXProvider) - optional func providerDidBegin(_ provider: CXProvider) + @asyncHandler func providerDidReset(_ provider: CXProvider) + @asyncHandler optional func providerDidBegin(_ provider: CXProvider) optional func provider(_ provider: CXProvider, execute transaction: CXTransaction) -> Bool optional func provider(_ provider: CXProvider, perform action: CXStartCallAction) optional func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) @@ -28,6 +28,7 @@ class CXProvider : NSObject { init(configuration: CXProviderConfiguration) func setDelegate(_ delegate: CXProviderDelegate?, queue: DispatchQueue?) func reportNewIncomingCall(with UUID: UUID, update: CXCallUpdate, completion: @escaping (Error?) -> Void) + func reportNewIncomingCall(with UUID: UUID, update: CXCallUpdate) async throws func reportCall(with UUID: UUID, updated update: CXCallUpdate) func reportCall(with UUID: UUID, endedAt dateEnded: Date?, reason endedReason: CXCallEndedReason) func reportOutgoingCall(with UUID: UUID, startedConnectingAt dateStartedConnecting: Date?) diff --git a/macOS/ClassKit/CLSContext.swift b/macOS/ClassKit/CLSContext.swift index 1456c9c..21aa93e 100644 --- a/macOS/ClassKit/CLSContext.swift +++ b/macOS/ClassKit/CLSContext.swift @@ -89,4 +89,5 @@ extension CLSContext { func removeFromParent() func addChildContext(_ child: CLSContext) func descendant(matchingIdentifierPath identifierPath: [String], completion: @escaping (CLSContext?, Error?) -> Void) + func descendant(matchingIdentifierPath identifierPath: [String]) async throws -> CLSContext? } diff --git a/macOS/ClassKit/CLSContextProvider.swift b/macOS/ClassKit/CLSContextProvider.swift index a9d7137..c50a927 100644 --- a/macOS/ClassKit/CLSContextProvider.swift +++ b/macOS/ClassKit/CLSContextProvider.swift @@ -2,4 +2,5 @@ @available(macOS 11.0, *) protocol CLSContextProvider { func updateDescendants(of context: CLSContext, completion: @escaping (Error?) -> Void) + func updateDescendants(of context: CLSContext) async throws } diff --git a/macOS/ClassKit/CLSDataStore.swift b/macOS/ClassKit/CLSDataStore.swift index cf9bec9..2b8e711 100644 --- a/macOS/ClassKit/CLSDataStore.swift +++ b/macOS/ClassKit/CLSDataStore.swift @@ -11,12 +11,15 @@ class CLSDataStore : NSObject { var runningActivity: CLSActivity? { get } weak var delegate: @sil_weak CLSDataStoreDelegate? func save(completion: ((Error?) -> Void)? = nil) + func save() async throws @available(macOS 11.0, *) func completeAllAssignedActivities(matching contextPath: [String]) } @available(macOS 11.0, *) extension CLSDataStore { func contexts(matching predicate: NSPredicate, completion: @escaping ([CLSContext], Error?) -> Void) + func contexts(matching predicate: NSPredicate) async throws -> [CLSContext] func contexts(matchingIdentifierPath identifierPath: [String], completion: @escaping ([CLSContext], Error?) -> Void) + func contexts(matchingIdentifierPath identifierPath: [String]) async throws -> [CLSContext] func remove(_ context: CLSContext) } diff --git a/macOS/CloudKit/CKContainer.swift b/macOS/CloudKit/CKContainer.swift index 76c41dd..02ff733 100644 --- a/macOS/CloudKit/CKContainer.swift +++ b/macOS/CloudKit/CKContainer.swift @@ -51,6 +51,7 @@ extension NSNotification.Name { } extension CKContainer { func accountStatus(completionHandler: @escaping (CKAccountStatus, Error?) -> Void) + func accountStatus() async throws -> CKAccountStatus } @available(macOS 10.10, *) struct CKContainer_Application_Permissions : OptionSet { @@ -70,34 +71,59 @@ enum CKContainer_Application_PermissionStatus : Int { typealias CKContainer_Application_PermissionBlock = (CKContainer_Application_PermissionStatus, Error?) -> Void extension CKContainer { func status(forApplicationPermission applicationPermission: CKContainer_Application_Permissions, completionHandler: @escaping CKContainer_Application_PermissionBlock) + func status(forApplicationPermission applicationPermission: CKContainer_Application_Permissions) async throws -> CKContainer_Application_PermissionStatus func requestApplicationPermission(_ applicationPermission: CKContainer_Application_Permissions, completionHandler: @escaping CKContainer_Application_PermissionBlock) + func requestApplicationPermission(_ applicationPermission: CKContainer_Application_Permissions) async throws -> CKContainer_Application_PermissionStatus } extension CKContainer { func fetchUserRecordID(completionHandler: @escaping (CKRecord.ID?, Error?) -> Void) + func fetchUserRecordID() async throws -> CKRecord.ID? @available(macOS 10.12, *) func discoverAllIdentities(completionHandler: @escaping ([CKUserIdentity]?, Error?) -> Void) @available(macOS 10.12, *) + func discoverAllIdentities() async throws -> [CKUserIdentity]? + @available(macOS 10.12, *) func discoverUserIdentity(withEmailAddress email: String, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(macOS 10.12, *) + func discoverUserIdentity(withEmailAddress email: String) async throws -> CKUserIdentity? + @available(macOS 10.12, *) func discoverUserIdentity(withPhoneNumber phoneNumber: String, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(macOS 10.12, *) + func discoverUserIdentity(withPhoneNumber phoneNumber: String) async throws -> CKUserIdentity? + @available(macOS 10.12, *) func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) + @available(macOS 10.12, *) + func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKUserIdentity? } extension CKContainer { @available(macOS 10.12, *) func fetchShareParticipant(withEmailAddress emailAddress: String, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(macOS 10.12, *) + func fetchShareParticipant(withEmailAddress emailAddress: String) async throws -> CKShare.Participant? + @available(macOS 10.12, *) func fetchShareParticipant(withPhoneNumber phoneNumber: String, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(macOS 10.12, *) + func fetchShareParticipant(withPhoneNumber phoneNumber: String) async throws -> CKShare.Participant? + @available(macOS 10.12, *) func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(macOS 10.12, *) + func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKShare.Participant? + @available(macOS 10.12, *) func fetchShareMetadata(with url: URL, completionHandler: @escaping (CKShare.Metadata?, Error?) -> Void) @available(macOS 10.12, *) + func fetchShareMetadata(with url: URL) async throws -> CKShare.Metadata? + @available(macOS 10.12, *) func accept(_ metadata: CKShare.Metadata, completionHandler: @escaping (CKShare?, Error?) -> Void) + @available(macOS 10.12, *) + func accept(_ metadata: CKShare.Metadata) async throws -> CKShare? } extension CKContainer { @available(macOS 10.12, *) func __fetchAllLongLivedOperationIDs(completionHandler: @escaping ([String]?, Error?) -> Void) @available(macOS 10.12, *) + func __fetchAllLongLivedOperationIDs() async throws -> [String]? + @available(macOS 10.12, *) func __fetchLongLivedOperation(withID operationID: String, completionHandler: @escaping (CKOperation?, Error?) -> Void) + @available(macOS 10.12, *) + func __fetchLongLivedOperation(withID operationID: String) async throws -> CKOperation? } diff --git a/macOS/CloudKit/CKDatabase.swift b/macOS/CloudKit/CKDatabase.swift index 19dabc3..f865784 100644 --- a/macOS/CloudKit/CKDatabase.swift +++ b/macOS/CloudKit/CKDatabase.swift @@ -25,19 +25,35 @@ class CKDatabase : NSObject { } extension CKDatabase { func fetch(withRecordID recordID: CKRecord.ID, completionHandler: @escaping (CKRecord?, Error?) -> Void) + func fetch(withRecordID recordID: CKRecord.ID) async throws -> CKRecord? func save(_ record: CKRecord, completionHandler: @escaping (CKRecord?, Error?) -> Void) + func save(_ record: CKRecord) async throws -> CKRecord? func delete(withRecordID recordID: CKRecord.ID, completionHandler: @escaping (CKRecord.ID?, Error?) -> Void) + func delete(withRecordID recordID: CKRecord.ID) async throws -> CKRecord.ID? func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?, completionHandler: @escaping ([CKRecord]?, Error?) -> Void) + func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?) async throws -> [CKRecord]? func fetchAllRecordZones(completionHandler: @escaping ([CKRecordZone]?, Error?) -> Void) + func fetchAllRecordZones() async throws -> [CKRecordZone]? func fetch(withRecordZoneID zoneID: CKRecordZone.ID, completionHandler: @escaping (CKRecordZone?, Error?) -> Void) + func fetch(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone? func save(_ zone: CKRecordZone, completionHandler: @escaping (CKRecordZone?, Error?) -> Void) + func save(_ zone: CKRecordZone) async throws -> CKRecordZone? func delete(withRecordZoneID zoneID: CKRecordZone.ID, completionHandler: @escaping (CKRecordZone.ID?, Error?) -> Void) + func delete(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone.ID? @available(macOS 10.10, *) func __fetch(withSubscriptionID subscriptionID: String, completionHandler: @escaping (CKSubscription?, Error?) -> Void) @available(macOS 10.10, *) + func __fetch(withSubscriptionID subscriptionID: String) async throws -> CKSubscription? + @available(macOS 10.10, *) func fetchAllSubscriptions(completionHandler: @escaping ([CKSubscription]?, Error?) -> Void) @available(macOS 10.10, *) + func fetchAllSubscriptions() async throws -> [CKSubscription]? + @available(macOS 10.10, *) func save(_ subscription: CKSubscription, completionHandler: @escaping (CKSubscription?, Error?) -> Void) @available(macOS 10.10, *) + func save(_ subscription: CKSubscription) async throws -> CKSubscription? + @available(macOS 10.10, *) func __delete(withSubscriptionID subscriptionID: String, completionHandler: @escaping (String?, Error?) -> Void) + @available(macOS 10.10, *) + func __delete(withSubscriptionID subscriptionID: String) async throws -> String? } diff --git a/macOS/Collaboration/CBIdentityPicker.swift b/macOS/Collaboration/CBIdentityPicker.swift index 7e5f534..3fc556b 100644 --- a/macOS/Collaboration/CBIdentityPicker.swift +++ b/macOS/Collaboration/CBIdentityPicker.swift @@ -7,5 +7,6 @@ class CBIdentityPicker : NSObject { @available(macOS, introduced: 10.5, deprecated: 10.11, message: "Use runModalForWindow:completionHandler: instead.") func runModal(for window: NSWindow, modalDelegate delegate: Any?, didEnd didEndSelector: Selector?, contextInfo: UnsafeMutableRawPointer?) func runModal(for window: NSWindow, completionHandler: ((NSApplication.ModalResponse) -> Void)? = nil) + func runModal(for window: NSWindow) async -> NSApplication.ModalResponse var identities: [CBIdentity] { get } } diff --git a/macOS/Contacts/CNContactStore.swift b/macOS/Contacts/CNContactStore.swift index 36b3f01..5769b82 100644 --- a/macOS/Contacts/CNContactStore.swift +++ b/macOS/Contacts/CNContactStore.swift @@ -18,6 +18,7 @@ enum CNAuthorizationStatus : Int { class CNContactStore : NSObject { class func authorizationStatus(for entityType: CNEntityType) -> CNAuthorizationStatus func requestAccess(for entityType: CNEntityType, completionHandler: @escaping (Bool, Error?) -> Void) + func requestAccess(for entityType: CNEntityType) async throws -> Bool func unifiedContacts(matching predicate: NSPredicate, keysToFetch keys: [CNKeyDescriptor]) throws -> [CNContact] func unifiedContact(withIdentifier identifier: String, keysToFetch keys: [CNKeyDescriptor]) throws -> CNContact @available(macOS 10.11, *) diff --git a/macOS/ContactsUI/CNContactPickerDelegate.swift b/macOS/ContactsUI/CNContactPickerDelegate.swift index 4f9adc3..aaec4d5 100644 --- a/macOS/ContactsUI/CNContactPickerDelegate.swift +++ b/macOS/ContactsUI/CNContactPickerDelegate.swift @@ -2,5 +2,5 @@ @available(macOS 10.11, *) protocol CNContactPickerDelegate : NSObjectProtocol { optional func contactPickerWillClose(_ picker: CNContactPicker) - optional func contactPickerDidClose(_ picker: CNContactPicker) + @asyncHandler optional func contactPickerDidClose(_ picker: CNContactPicker) } diff --git a/macOS/CoreAudioKit/AUViewController.swift b/macOS/CoreAudioKit/AUViewController.swift index ed44695..fca58d4 100644 --- a/macOS/CoreAudioKit/AUViewController.swift +++ b/macOS/CoreAudioKit/AUViewController.swift @@ -12,6 +12,7 @@ class AUAudioUnitViewConfiguration : NSObject, NSSecureCoding { @available(macOS 10.12, *) extension AUAudioUnit { func requestViewController(completionHandler: @escaping (NSViewController?) -> Void) + func requestViewController() async -> NSViewController? @available(macOS 10.13, *) func supportedViewConfigurations(_ availableViewConfigurations: [AUAudioUnitViewConfiguration]) -> IndexSet @available(macOS 10.13, *) diff --git a/macOS/CoreBluetooth/CBCentralManager.swift b/macOS/CoreBluetooth/CBCentralManager.swift index 967e01d..764c206 100644 --- a/macOS/CoreBluetooth/CBCentralManager.swift +++ b/macOS/CoreBluetooth/CBCentralManager.swift @@ -37,15 +37,15 @@ class CBCentralManager : CBManager { } protocol CBCentralManagerDelegate : NSObjectProtocol { @available(macOS 10.7, *) - func centralManagerDidUpdateState(_ central: CBCentralManager) + @asyncHandler func centralManagerDidUpdateState(_ central: CBCentralManager) @available(macOS 10.7, *) optional func centralManager(_ central: CBCentralManager, willRestoreState dict: [String : Any]) @available(macOS 10.7, *) - optional func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) + @asyncHandler optional func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) @available(macOS 10.7, *) - optional func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) + @asyncHandler optional func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) @available(macOS 10.7, *) - optional func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) + @asyncHandler optional func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) @available(macOS 10.7, *) - optional func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) + @asyncHandler optional func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) } diff --git a/macOS/CoreBluetooth/CBPeripheral.swift b/macOS/CoreBluetooth/CBPeripheral.swift index 8ef295b..a51eb7c 100644 --- a/macOS/CoreBluetooth/CBPeripheral.swift +++ b/macOS/CoreBluetooth/CBPeripheral.swift @@ -42,33 +42,33 @@ class CBPeripheral : CBPeer { } protocol CBPeripheralDelegate : NSObjectProtocol { @available(macOS 10.9, *) - optional func peripheralDidUpdateName(_ peripheral: CBPeripheral) + @asyncHandler optional func peripheralDidUpdateName(_ peripheral: CBPeripheral) @available(macOS 10.9, *) - optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]) @available(macOS, introduced: 10.7, deprecated: 10.13) - optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, error: Error?) + @asyncHandler optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, error: Error?) @available(macOS 10.13, *) - optional func peripheral(_ peripheral: CBPeripheral, didReadRSSI RSSI: NSNumber, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didReadRSSI RSSI: NSNumber, error: Error?) @available(macOS 10.7, *) - optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) @available(macOS 10.7, *) - optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesFor service: CBService, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesFor service: CBService, error: Error?) @available(macOS 10.7, *) - optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) @available(macOS 10.7, *) - optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) @available(macOS 10.7, *) - optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) @available(macOS 10.7, *) - optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: Error?) @available(macOS 10.7, *) - optional func peripheral(_ peripheral: CBPeripheral, didDiscoverDescriptorsFor characteristic: CBCharacteristic, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverDescriptorsFor characteristic: CBCharacteristic, error: Error?) @available(macOS 10.7, *) - optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor descriptor: CBDescriptor, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor descriptor: CBDescriptor, error: Error?) @available(macOS 10.7, *) - optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor descriptor: CBDescriptor, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor descriptor: CBDescriptor, error: Error?) @available(macOS 10.7, *) optional func peripheralIsReady(toSendWriteWithoutResponse peripheral: CBPeripheral) @available(macOS 10.13, *) - optional func peripheral(_ peripheral: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?) } diff --git a/macOS/CoreBluetooth/CBPeripheralManager.swift b/macOS/CoreBluetooth/CBPeripheralManager.swift index 51eba48..23afcef 100644 --- a/macOS/CoreBluetooth/CBPeripheralManager.swift +++ b/macOS/CoreBluetooth/CBPeripheralManager.swift @@ -51,27 +51,27 @@ class CBPeripheralManager : CBManager { } protocol CBPeripheralManagerDelegate : NSObjectProtocol { @available(macOS 10.9, *) - func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) + @asyncHandler func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) @available(macOS 10.9, *) optional func peripheralManager(_ peripheral: CBPeripheralManager, willRestoreState dict: [String : Any]) @available(macOS 10.9, *) - optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error: Error?) + @asyncHandler optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error: Error?) @available(macOS 10.9, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) @available(macOS 10.9, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didSubscribeTo characteristic: CBCharacteristic) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didSubscribeTo characteristic: CBCharacteristic) @available(macOS 10.9, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didUnsubscribeFrom characteristic: CBCharacteristic) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didUnsubscribeFrom characteristic: CBCharacteristic) @available(macOS 10.9, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveRead request: CBATTRequest) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveRead request: CBATTRequest) @available(macOS 10.9, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) @available(macOS 10.9, *) optional func peripheralManagerIsReady(toUpdateSubscribers peripheral: CBPeripheralManager) @available(macOS 10.9, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) @available(macOS 10.9, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didUnpublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didUnpublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) @available(macOS 10.13, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: Error?) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: Error?) } diff --git a/macOS/CoreData/NSFetchedResultsController.swift b/macOS/CoreData/NSFetchedResultsController.swift index 182258a..010f8be 100644 --- a/macOS/CoreData/NSFetchedResultsController.swift +++ b/macOS/CoreData/NSFetchedResultsController.swift @@ -34,15 +34,15 @@ enum NSFetchedResultsChangeType : UInt { } protocol NSFetchedResultsControllerDelegate : NSObjectProtocol { @available(macOS 10.15, *) - optional func controller(_ controller: NSFetchedResultsController, didChangeContentWith diff: CollectionDifference) + @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChangeContentWith diff: CollectionDifference) @available(macOS 10.12, *) - optional func controller(_ controller: NSFetchedResultsController, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) + @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) @available(macOS 10.12, *) - optional func controller(_ controller: NSFetchedResultsController, didChange sectionInfo: NSFetchedResultsSectionInfo, atSectionIndex sectionIndex: Int, for type: NSFetchedResultsChangeType) + @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChange sectionInfo: NSFetchedResultsSectionInfo, atSectionIndex sectionIndex: Int, for type: NSFetchedResultsChangeType) @available(macOS 10.12, *) optional func controllerWillChangeContent(_ controller: NSFetchedResultsController) @available(macOS 10.12, *) - optional func controllerDidChangeContent(_ controller: NSFetchedResultsController) + @asyncHandler optional func controllerDidChangeContent(_ controller: NSFetchedResultsController) @available(macOS 10.12, *) optional func controller(_ controller: NSFetchedResultsController, sectionIndexTitleForSectionName sectionName: String) -> String? } diff --git a/macOS/CoreData/NSPersistentContainer.swift b/macOS/CoreData/NSPersistentContainer.swift index 5f47ab2..4affc56 100644 --- a/macOS/CoreData/NSPersistentContainer.swift +++ b/macOS/CoreData/NSPersistentContainer.swift @@ -10,6 +10,7 @@ class NSPersistentContainer : NSObject { convenience init(name: String) init(name: String, managedObjectModel model: NSManagedObjectModel) func loadPersistentStores(completionHandler block: @escaping (NSPersistentStoreDescription, Error?) -> Void) + func loadPersistentStores() async throws -> NSPersistentStoreDescription func newBackgroundContext() -> NSManagedObjectContext func performBackgroundTask(_ block: @escaping (NSManagedObjectContext) -> Void) } diff --git a/macOS/CoreData/NSPersistentStoreCoordinator.swift b/macOS/CoreData/NSPersistentStoreCoordinator.swift index b3dd8c3..cad3010d 100644 --- a/macOS/CoreData/NSPersistentStoreCoordinator.swift +++ b/macOS/CoreData/NSPersistentStoreCoordinator.swift @@ -105,6 +105,8 @@ class NSPersistentStoreCoordinator : NSObject, NSLocking { func addPersistentStore(ofType storeType: String, configurationName configuration: String?, at storeURL: URL?, options: [AnyHashable : Any]? = nil) throws -> NSPersistentStore @available(macOS 10.12, *) func addPersistentStore(with storeDescription: NSPersistentStoreDescription, completionHandler block: @escaping (NSPersistentStoreDescription, Error?) -> Void) + @available(macOS 10.12, *) + func addPersistentStore(with storeDescription: NSPersistentStoreDescription) async throws -> NSPersistentStoreDescription func remove(_ store: NSPersistentStore) throws func setMetadata(_ metadata: [String : Any]?, for store: NSPersistentStore) func metadata(for store: NSPersistentStore) -> [String : Any] diff --git a/macOS/CoreHaptics/CHHapticEngine.swift b/macOS/CoreHaptics/CHHapticEngine.swift index 53c55cb..52f49b9 100644 --- a/macOS/CoreHaptics/CHHapticEngine.swift +++ b/macOS/CoreHaptics/CHHapticEngine.swift @@ -35,8 +35,10 @@ class CHHapticEngine : NSObject { var isAutoShutdownEnabled: Bool init() throws func start(completionHandler: CHHapticEngine.CompletionHandler? = nil) + func start() async throws func start() throws func stop(completionHandler: CHHapticEngine.CompletionHandler? = nil) + func stop() async throws func notifyWhenPlayersFinished(finishedHandler: @escaping CHHapticEngine.FinishedHandler) func makePlayer(with pattern: CHHapticPattern) throws -> CHHapticPatternPlayer func makeAdvancedPlayer(with pattern: CHHapticPattern) throws -> CHHapticAdvancedPatternPlayer diff --git a/macOS/CoreLocation/CLGeocoder.swift b/macOS/CoreLocation/CLGeocoder.swift index 2e0c2cc..36e4503 100644 --- a/macOS/CoreLocation/CLGeocoder.swift +++ b/macOS/CoreLocation/CLGeocoder.swift @@ -4,14 +4,23 @@ typealias CLGeocodeCompletionHandler = ([CLPlacemark]?, Error?) -> Void class CLGeocoder : NSObject { var isGeocoding: Bool { get } func reverseGeocodeLocation(_ location: CLLocation, completionHandler: @escaping CLGeocodeCompletionHandler) + func reverseGeocodeLocation(_ location: CLLocation) async throws -> [CLPlacemark]? @available(macOS 10.13, *) func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?, completionHandler: @escaping CLGeocodeCompletionHandler) + @available(macOS 10.13, *) + func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?) async throws -> [CLPlacemark]? @available(macOS, introduced: 10.8, deprecated: 10.13, message: "Use -geocodePostalAddress:completionHandler:") func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any], completionHandler: @escaping CLGeocodeCompletionHandler) + @available(macOS, introduced: 10.8, deprecated: 10.13, message: "Use -geocodePostalAddress:completionHandler:") + func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any]) async throws -> [CLPlacemark]? func geocodeAddressString(_ addressString: String, completionHandler: @escaping CLGeocodeCompletionHandler) + func geocodeAddressString(_ addressString: String) async throws -> [CLPlacemark]? func geocodeAddressString(_ addressString: String, in region: CLRegion?, completionHandler: @escaping CLGeocodeCompletionHandler) + func geocodeAddressString(_ addressString: String, in region: CLRegion?) async throws -> [CLPlacemark]? @available(macOS 10.13, *) func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?, completionHandler: @escaping CLGeocodeCompletionHandler) + @available(macOS 10.13, *) + func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?) async throws -> [CLPlacemark]? func cancelGeocode() } extension CLGeocoder { diff --git a/macOS/CoreLocation/CLLocationManager.swift b/macOS/CoreLocation/CLLocationManager.swift index 0b193bc..156334a 100644 --- a/macOS/CoreLocation/CLLocationManager.swift +++ b/macOS/CoreLocation/CLLocationManager.swift @@ -98,6 +98,8 @@ class CLLocationManager : NSObject { @available(macOS 11.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String, completion: ((Error?) -> Void)? = nil) @available(macOS 11.0, *) + func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) async throws + @available(macOS 11.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) func startUpdatingLocation() func stopUpdatingLocation() diff --git a/macOS/CoreLocation/CLLocationManagerDelegate.swift b/macOS/CoreLocation/CLLocationManagerDelegate.swift index f650ee6..8ba5612 100644 --- a/macOS/CoreLocation/CLLocationManagerDelegate.swift +++ b/macOS/CoreLocation/CLLocationManagerDelegate.swift @@ -1,43 +1,43 @@ protocol CLLocationManagerDelegate : NSObjectProtocol { @available(macOS 10.6, *) - optional func locationManager(_ manager: CLLocationManager, didUpdateTo newLocation: CLLocation, from oldLocation: CLLocation) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didUpdateTo newLocation: CLLocation, from oldLocation: CLLocation) @available(macOS 10.9, *) - optional func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) @available(macOS 10.15, *) - optional func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) @available(macOS 10.15, *) optional func locationManagerShouldDisplayHeadingCalibration(_ manager: CLLocationManager) -> Bool @available(macOS 10.10, *) - optional func locationManager(_ manager: CLLocationManager, didDetermineState state: CLRegionState, for region: CLRegion) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didDetermineState state: CLRegionState, for region: CLRegion) @available(macOS, introduced: 10.15, deprecated: 10.15) - optional func locationManager(_ manager: CLLocationManager, didRangeBeacons beacons: [CLBeacon], in region: CLBeaconRegion) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didRangeBeacons beacons: [CLBeacon], in region: CLBeaconRegion) @available(macOS, introduced: 10.15, deprecated: 10.15) optional func locationManager(_ manager: CLLocationManager, rangingBeaconsDidFailFor region: CLBeaconRegion, withError error: Error) @available(macOS 10.15, *) - optional func locationManager(_ manager: CLLocationManager, didRange beacons: [CLBeacon], satisfying beaconConstraint: CLBeaconIdentityConstraint) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didRange beacons: [CLBeacon], satisfying beaconConstraint: CLBeaconIdentityConstraint) @available(macOS 10.15, *) - optional func locationManager(_ manager: CLLocationManager, didFailRangingFor beaconConstraint: CLBeaconIdentityConstraint, error: Error) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didFailRangingFor beaconConstraint: CLBeaconIdentityConstraint, error: Error) @available(macOS 10.8, *) - optional func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) @available(macOS 10.8, *) - optional func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) @available(macOS 10.6, *) - optional func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) @available(macOS 10.8, *) optional func locationManager(_ manager: CLLocationManager, monitoringDidFailFor region: CLRegion?, withError error: Error) @available(macOS, introduced: 10.7, deprecated: 11.0) - optional func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) @available(macOS 11.0, *) - optional func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) + @asyncHandler optional func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) @available(macOS 10.8, *) - optional func locationManager(_ manager: CLLocationManager, didStartMonitoringFor region: CLRegion) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didStartMonitoringFor region: CLRegion) @available(macOS 10.15, *) - optional func locationManagerDidPauseLocationUpdates(_ manager: CLLocationManager) + @asyncHandler optional func locationManagerDidPauseLocationUpdates(_ manager: CLLocationManager) @available(macOS 10.15, *) - optional func locationManagerDidResumeLocationUpdates(_ manager: CLLocationManager) + @asyncHandler optional func locationManagerDidResumeLocationUpdates(_ manager: CLLocationManager) @available(macOS 10.9, *) - optional func locationManager(_ manager: CLLocationManager, didFinishDeferredUpdatesWithError error: Error?) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didFinishDeferredUpdatesWithError error: Error?) @available(macOS 10.15, *) - optional func locationManager(_ manager: CLLocationManager, didVisit visit: CLVisit) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didVisit visit: CLVisit) } diff --git a/macOS/CoreML/MLModel.swift b/macOS/CoreML/MLModel.swift index e729247..4aac8a9 100644 --- a/macOS/CoreML/MLModel.swift +++ b/macOS/CoreML/MLModel.swift @@ -9,6 +9,8 @@ class MLModel : NSObject { convenience init(contentsOf url: URL, configuration: MLModelConfiguration) throws @available(macOS 11.0, *) class func __loadContents(of url: URL, configuration: MLModelConfiguration, completionHandler handler: @escaping (MLModel?, Error?) -> Void) + @available(macOS 11.0, *) + class func __loadContents(of url: URL, configuration: MLModelConfiguration) async throws -> MLModel? func prediction(from input: MLFeatureProvider) throws -> MLFeatureProvider func prediction(from input: MLFeatureProvider, options: MLPredictionOptions) throws -> MLFeatureProvider @available(macOS 10.14, *) diff --git a/macOS/CoreML/MLModelCollection.swift b/macOS/CoreML/MLModelCollection.swift index c529d15..bbe58ec 100644 --- a/macOS/CoreML/MLModelCollection.swift +++ b/macOS/CoreML/MLModelCollection.swift @@ -6,6 +6,7 @@ class MLModelCollection : NSObject { var deploymentID: String { get } class func __beginAccessingModelCollection(withIdentifier identifier: String, completionHandler: @escaping (MLModelCollection?, Error?) -> Void) -> Progress class func __endAccessingModelCollection(withIdentifier identifier: String, completionHandler: @escaping (Bool, Error?) -> Void) + class func __endAccessingModelCollection(withIdentifier identifier: String) async throws -> Bool } @available(macOS 11.0, iOS 14.0, *) diff --git a/macOS/CoreSpotlight/CSSearchableIndex.swift b/macOS/CoreSpotlight/CSSearchableIndex.swift index d57a84d..8e9bf54 100644 --- a/macOS/CoreSpotlight/CSSearchableIndex.swift +++ b/macOS/CoreSpotlight/CSSearchableIndex.swift @@ -22,21 +22,27 @@ class CSSearchableIndex : NSObject { init(name: String) init(name: String, protectionClass: FileProtectionType?) func indexSearchableItems(_ items: [CSSearchableItem], completionHandler: ((Error?) -> Void)? = nil) + func indexSearchableItems(_ items: [CSSearchableItem]) async throws func deleteSearchableItems(withIdentifiers identifiers: [String], completionHandler: ((Error?) -> Void)? = nil) + func deleteSearchableItems(withIdentifiers identifiers: [String]) async throws func deleteSearchableItems(withDomainIdentifiers domainIdentifiers: [String], completionHandler: ((Error?) -> Void)? = nil) + func deleteSearchableItems(withDomainIdentifiers domainIdentifiers: [String]) async throws func deleteAllSearchableItems(completionHandler: ((Error?) -> Void)? = nil) + func deleteAllSearchableItems() async throws } extension CSSearchableIndex { func beginBatch() func endBatch(withClientState clientState: Data, completionHandler: ((Error?) -> Void)? = nil) + func endBatch(withClientState clientState: Data) async throws func fetchLastClientState(completionHandler: @escaping (Data?, Error?) -> Void) + func fetchLastClientState() async throws -> Data? } @available(macOS 10.11, *) protocol CSSearchableIndexDelegate : NSObjectProtocol { func searchableIndex(_ searchableIndex: CSSearchableIndex, reindexAllSearchableItemsWithAcknowledgementHandler acknowledgementHandler: @escaping () -> Void) func searchableIndex(_ searchableIndex: CSSearchableIndex, reindexSearchableItemsWithIdentifiers identifiers: [String], acknowledgementHandler: @escaping () -> Void) - optional func searchableIndexDidThrottle(_ searchableIndex: CSSearchableIndex) - optional func searchableIndexDidFinishThrottle(_ searchableIndex: CSSearchableIndex) + @asyncHandler optional func searchableIndexDidThrottle(_ searchableIndex: CSSearchableIndex) + @asyncHandler optional func searchableIndexDidFinishThrottle(_ searchableIndex: CSSearchableIndex) @available(macOS 10.11, *) optional func data(for searchableIndex: CSSearchableIndex, itemIdentifier: String, typeIdentifier: String) throws -> Data @available(macOS 10.11, *) diff --git a/macOS/CoreWLAN/CWWiFiClient.swift b/macOS/CoreWLAN/CWWiFiClient.swift index 413cad8..179f186 100644 --- a/macOS/CoreWLAN/CWWiFiClient.swift +++ b/macOS/CoreWLAN/CWWiFiClient.swift @@ -2,13 +2,13 @@ protocol CWEventDelegate { optional func clientConnectionInterrupted() optional func clientConnectionInvalidated() - optional func powerStateDidChangeForWiFiInterface(withName interfaceName: String) - optional func ssidDidChangeForWiFiInterface(withName interfaceName: String) - optional func bssidDidChangeForWiFiInterface(withName interfaceName: String) - optional func countryCodeDidChangeForWiFiInterface(withName interfaceName: String) - optional func linkDidChangeForWiFiInterface(withName interfaceName: String) - optional func linkQualityDidChangeForWiFiInterface(withName interfaceName: String, rssi: Int, transmitRate: Double) - optional func modeDidChangeForWiFiInterface(withName interfaceName: String) + @asyncHandler optional func powerStateDidChangeForWiFiInterface(withName interfaceName: String) + @asyncHandler optional func ssidDidChangeForWiFiInterface(withName interfaceName: String) + @asyncHandler optional func bssidDidChangeForWiFiInterface(withName interfaceName: String) + @asyncHandler optional func countryCodeDidChangeForWiFiInterface(withName interfaceName: String) + @asyncHandler optional func linkDidChangeForWiFiInterface(withName interfaceName: String) + @asyncHandler optional func linkQualityDidChangeForWiFiInterface(withName interfaceName: String, rssi: Int, transmitRate: Double) + @asyncHandler optional func modeDidChangeForWiFiInterface(withName interfaceName: String) optional func scanCacheUpdatedForWiFiInterface(withName interfaceName: String) } @available(macOS 10.10, *) diff --git a/macOS/DeviceCheck/DCDevice.swift b/macOS/DeviceCheck/DCDevice.swift index 861d6a6..74a6912 100644 --- a/macOS/DeviceCheck/DCDevice.swift +++ b/macOS/DeviceCheck/DCDevice.swift @@ -4,4 +4,5 @@ class DCDevice : NSObject { class var current: DCDevice { get } var isSupported: Bool { get } func generateToken(completionHandler completion: @escaping (Data?, Error?) -> Void) + func generateToken() async throws -> Data? } diff --git a/macOS/EventKit/EKEventStore.swift b/macOS/EventKit/EKEventStore.swift index a1fba95..ae124c0 100644 --- a/macOS/EventKit/EKEventStore.swift +++ b/macOS/EventKit/EKEventStore.swift @@ -14,6 +14,8 @@ class EKEventStore : NSObject { init(sources: [EKSource]) @available(macOS 10.9, *) func requestAccess(to entityType: EKEntityType, completion: @escaping EKEventStoreRequestAccessCompletionHandler) + @available(macOS 10.9, *) + func requestAccess(to entityType: EKEntityType) async throws -> Bool var eventStoreIdentifier: String { get } @available(macOS 10.11, *) var delegateSources: [EKSource] { get } diff --git a/macOS/ExecutionPolicy/EPDeveloperTool.swift b/macOS/ExecutionPolicy/EPDeveloperTool.swift index db275ca..498b20c 100644 --- a/macOS/ExecutionPolicy/EPDeveloperTool.swift +++ b/macOS/ExecutionPolicy/EPDeveloperTool.swift @@ -12,4 +12,5 @@ enum EPDeveloperToolStatus : Int { class EPDeveloperTool : NSObject { var authorizationStatus: EPDeveloperToolStatus { get } func requestAccess(completionHandler handler: @escaping (Bool) -> Void) + func requestAccess() async -> Bool } diff --git a/macOS/ExternalAccessory/EAAccessory.swift b/macOS/ExternalAccessory/EAAccessory.swift index 71387fc..7a29d9a 100644 --- a/macOS/ExternalAccessory/EAAccessory.swift +++ b/macOS/ExternalAccessory/EAAccessory.swift @@ -27,5 +27,5 @@ class EAAccessory : NSObject { } protocol EAAccessoryDelegate : NSObjectProtocol { @available(macOS 10.13, *) - optional func accessoryDidDisconnect(_ accessory: EAAccessory) + @asyncHandler optional func accessoryDidDisconnect(_ accessory: EAAccessory) } diff --git a/macOS/FileProvider/Extension.swift b/macOS/FileProvider/Extension.swift index 0850470..7c564e8 100644 --- a/macOS/FileProvider/Extension.swift +++ b/macOS/FileProvider/Extension.swift @@ -5,19 +5,31 @@ extension NSFileProviderExtension { class NSFileProviderManager : NSObject { convenience init?(for domain: NSFileProviderDomain) func signalEnumerator(for containerItemIdentifier: NSFileProviderItemIdentifier, completionHandler completion: @escaping (Error?) -> Void) + func signalEnumerator(for containerItemIdentifier: NSFileProviderItemIdentifier) async throws @available(macOS 11.0, *) func getUserVisibleURL(for itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (URL?, Error?) -> Void) @available(macOS 11.0, *) + func getUserVisibleURL(for itemIdentifier: NSFileProviderItemIdentifier) async throws -> URL? + @available(macOS 11.0, *) class func getIdentifierForUserVisibleFile(at url: URL, completionHandler: @escaping (NSFileProviderItemIdentifier?, NSFileProviderDomainIdentifier?, Error?) -> Void) + @available(macOS 11.0, *) + class func getIdentifierForUserVisibleFile(at url: URL) async throws -> (NSFileProviderItemIdentifier?, NSFileProviderDomainIdentifier?) func register(_ task: URLSessionTask, forItemWithIdentifier identifier: NSFileProviderItemIdentifier, completionHandler completion: @escaping (Error?) -> Void) + func register(_ task: URLSessionTask, forItemWithIdentifier identifier: NSFileProviderItemIdentifier) async throws @available(macOS 11.0, *) func temporaryDirectoryURL() throws -> URL class func add(_ domain: NSFileProviderDomain, completionHandler: @escaping (Error?) -> Void) + class func add(_ domain: NSFileProviderDomain) async throws class func remove(_ domain: NSFileProviderDomain, completionHandler: @escaping (Error?) -> Void) + class func remove(_ domain: NSFileProviderDomain) async throws class func getDomainsWithCompletionHandler(_ completionHandler: @escaping ([NSFileProviderDomain], Error?) -> Void) + class func getDomains() async throws -> [NSFileProviderDomain] class func removeAllDomains(completionHandler: @escaping (Error?) -> Void) + class func removeAllDomains() async throws @available(macOS 11.0, *) func signalErrorResolved(_ error: Error, completionHandler: @escaping (Error?) -> Void) + @available(macOS 11.0, *) + func signalErrorResolved(_ error: Error) async throws } extension NSFileProviderManager { @available(macOS 11.0, *) @@ -27,19 +39,29 @@ extension NSFileProviderManager { @available(macOS 11.0, *) class func `import`(_ domain: NSFileProviderDomain, fromDirectoryAt url: URL, completionHandler: @escaping (Error?) -> Void) @available(macOS 11.0, *) + class func `import`(_ domain: NSFileProviderDomain, fromDirectoryAt url: URL) async throws + @available(macOS 11.0, *) func reimportItems(below itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (Error?) -> Void) + @available(macOS 11.0, *) + func reimportItems(below itemIdentifier: NSFileProviderItemIdentifier) async throws } extension NSFileProviderManager { @available(macOS 11.0, *) func evictItem(identifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (Error?) -> Void) + @available(macOS 11.0, *) + func evictItem(identifier itemIdentifier: NSFileProviderItemIdentifier) async throws } extension NSFileProviderManager { @available(macOS 11.0, *) func waitForChanges(below itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (Error?) -> Void) + @available(macOS 11.0, *) + func waitForChanges(below itemIdentifier: NSFileProviderItemIdentifier) async throws } extension NSFileProviderManager { @available(macOS 11.0, *) func waitForStabilization(completionHandler: @escaping (Error?) -> Void) + @available(macOS 11.0, *) + func waitForStabilization() async throws } extension NSFileProviderManager { @available(macOS 11.0, *) @@ -53,5 +75,9 @@ extension NSFileProviderManager { @available(macOS 11.0, *) func disconnect(reason localizedReason: String, options: NSFileProviderManager.DisconnectionOptions = [], completionHandler: @escaping (Error?) -> Void) @available(macOS 11.0, *) + func disconnect(reason localizedReason: String, options: NSFileProviderManager.DisconnectionOptions = []) async throws + @available(macOS 11.0, *) func reconnect(completionHandler: @escaping (Error?) -> Void) + @available(macOS 11.0, *) + func reconnect() async throws } diff --git a/macOS/FileProvider/NSFileProviderActions.swift b/macOS/FileProvider/NSFileProviderActions.swift index ef5d73f..76598be 100644 --- a/macOS/FileProvider/NSFileProviderActions.swift +++ b/macOS/FileProvider/NSFileProviderActions.swift @@ -7,13 +7,23 @@ struct NSFileProviderExtensionActionIdentifier : _ObjectiveCBridgeable, Hashable } extension NSFileProviderExtension { func importDocument(at fileURL: URL, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) + func importDocument(at fileURL: URL, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? func createDirectory(withName directoryName: String, inParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) + func createDirectory(withName directoryName: String, inParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? func renameItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toName itemName: String, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) + func renameItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toName itemName: String) async throws -> NSFileProviderItem? func reparentItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemWithIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, newName: String?, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) + func reparentItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemWithIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, newName: String?) async throws -> NSFileProviderItem? func trashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) + func trashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? func untrashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier?, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) + func untrashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier?) async throws -> NSFileProviderItem? func deleteItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (Error?) -> Void) + func deleteItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws func setLastUsedDate(_ lastUsedDate: Date?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) + func setLastUsedDate(_ lastUsedDate: Date?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? func setTagData(_ tagData: Data?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) + func setTagData(_ tagData: Data?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? func setFavoriteRank(_ favoriteRank: NSNumber?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) + func setFavoriteRank(_ favoriteRank: NSNumber?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? } diff --git a/macOS/FileProvider/NSFileProviderEnumerating.swift b/macOS/FileProvider/NSFileProviderEnumerating.swift index 3a5db23..0e29097 100644 --- a/macOS/FileProvider/NSFileProviderEnumerating.swift +++ b/macOS/FileProvider/NSFileProviderEnumerating.swift @@ -18,15 +18,15 @@ extension NSFileProviderPage { static let initialPageSortedByName: NSData } protocol NSFileProviderEnumerationObserver : NSObjectProtocol { - func didEnumerate(_ updatedItems: [NSFileProviderItemProtocol]) + @asyncHandler func didEnumerate(_ updatedItems: [NSFileProviderItemProtocol]) func finishEnumerating(upTo nextPage: NSFileProviderPage?) func finishEnumeratingWithError(_ error: Error) @available(macOS 11.0, *) optional var suggestedPageSize: Int { get } } protocol NSFileProviderChangeObserver : NSObjectProtocol { - func didUpdate(_ updatedItems: [NSFileProviderItemProtocol]) - func didDeleteItems(withIdentifiers deletedItemIdentifiers: [NSFileProviderItemIdentifier]) + @asyncHandler func didUpdate(_ updatedItems: [NSFileProviderItemProtocol]) + @asyncHandler func didDeleteItems(withIdentifiers deletedItemIdentifiers: [NSFileProviderItemIdentifier]) func finishEnumeratingChanges(upTo anchor: NSFileProviderSyncAnchor, moreComing: Bool) func finishEnumeratingWithError(_ error: Error) @available(macOS 11.0, *) @@ -37,6 +37,7 @@ protocol NSFileProviderEnumerator : NSObjectProtocol { func enumerateItems(for observer: NSFileProviderEnumerationObserver, startingAt page: NSFileProviderPage) optional func enumerateChanges(for observer: NSFileProviderChangeObserver, from syncAnchor: NSFileProviderSyncAnchor) optional func currentSyncAnchor(completionHandler: @escaping (NSFileProviderSyncAnchor?) -> Void) + optional func currentSyncAnchor() async -> NSFileProviderSyncAnchor? } extension NSFileProviderExtension { func enumerator(for containerItemIdentifier: NSFileProviderItemIdentifier) throws -> NSFileProviderEnumerator diff --git a/macOS/FileProvider/NSFileProviderReplicatedExtension.swift b/macOS/FileProvider/NSFileProviderReplicatedExtension.swift index de053ad..89baacf 100644 --- a/macOS/FileProvider/NSFileProviderReplicatedExtension.swift +++ b/macOS/FileProvider/NSFileProviderReplicatedExtension.swift @@ -45,8 +45,10 @@ protocol NSFileProviderReplicatedExtension : NSFileProviderEnumerating { func createItem(basedOn itemTemplate: NSFileProviderItem, fields: NSFileProviderItemFields, contents url: URL?, options: NSFileProviderCreateItemOptions = [], request: NSFileProviderRequest, completionHandler: @escaping (NSFileProviderItem?, NSFileProviderItemFields, Bool, Error?) -> Void) -> Progress func modifyItem(_ item: NSFileProviderItem, baseVersion version: NSFileProviderItemVersion, changedFields: NSFileProviderItemFields, contents newContents: URL?, options: NSFileProviderModifyItemOptions = [], request: NSFileProviderRequest, completionHandler: @escaping (NSFileProviderItem?, NSFileProviderItemFields, Bool, Error?) -> Void) -> Progress func deleteItem(identifier: NSFileProviderItemIdentifier, baseVersion version: NSFileProviderItemVersion, options: NSFileProviderDeleteItemOptions = [], request: NSFileProviderRequest, completionHandler: @escaping (Error?) -> Void) -> Progress - optional func importDidFinish(completionHandler: @escaping () -> Void) - optional func materializedItemsDidChange(completionHandler: @escaping () -> Void) + @asyncHandler optional func importDidFinish(completionHandler: @escaping () -> Void) + optional func importDidFinish() async + @asyncHandler optional func materializedItemsDidChange(completionHandler: @escaping () -> Void) + optional func materializedItemsDidChange() async } @available(macOS 11.0, *) protocol NSFileProviderIncrementalContentFetching : NSObjectProtocol { diff --git a/macOS/FinderSync/FinderSync.swift b/macOS/FinderSync/FinderSync.swift index 8bf4e9e..fe360c3 100644 --- a/macOS/FinderSync/FinderSync.swift +++ b/macOS/FinderSync/FinderSync.swift @@ -8,8 +8,10 @@ class FIFinderSyncController : NSExtensionContext { func selectedItemURLs() -> [URL]? func lastUsedDateForItem(with itemURL: URL) -> Date? func setLastUsedDate(_ lastUsedDate: Date, forItemWith itemURL: URL, completion: @escaping (Error) -> Void) + func setLastUsedDate(_ lastUsedDate: Date, forItemWith itemURL: URL) async -> Error func tagDataForItem(with itemURL: URL) -> Data? func setTagData(_ tagData: Data?, forItemWith itemURL: URL, completion: @escaping (Error) -> Void) + func setTagData(_ tagData: Data?, forItemWith itemURL: URL) async -> Error @available(macOS 10.14, *) class var isExtensionEnabled: Bool { get } @available(macOS 10.14, *) @@ -35,6 +37,7 @@ protocol FIFinderSyncProtocol { @available(macOS 10.8, *) optional func makeListenerEndpoint(forServiceName serviceName: NSFileProviderServiceName, itemURL: URL) throws -> NSXPCListenerEndpoint optional func values(forAttributes attributes: [URLResourceKey], forItemWith itemURL: URL, completion: @escaping ([URLResourceKey : Any], Error?) -> Void) + optional func values(forAttributes attributes: [URLResourceKey], forItemWith itemURL: URL) async throws -> [URLResourceKey : Any] } class FIFinderSync : NSObject, FIFinderSyncProtocol, NSExtensionRequestHandling { } diff --git a/macOS/Foundation/NSExtensionContext.swift b/macOS/Foundation/NSExtensionContext.swift index e0bddfe..c8c8408 100644 --- a/macOS/Foundation/NSExtensionContext.swift +++ b/macOS/Foundation/NSExtensionContext.swift @@ -3,8 +3,10 @@ class NSExtensionContext : NSObject { var inputItems: [Any] { get } func completeRequest(returningItems items: [Any]?, completionHandler: ((Bool) -> Void)? = nil) + func completeRequest(returningItems items: [Any]?) async -> Bool func cancelRequest(withError error: Error) func open(_ URL: URL, completionHandler: ((Bool) -> Void)? = nil) + func open(_ URL: URL) async -> Bool } @available(macOS 10.10, *) let NSExtensionItemsAndErrorsKey: String diff --git a/macOS/Foundation/NSFileManager.swift b/macOS/Foundation/NSFileManager.swift index 01e2ad3..ea3d240 100644 --- a/macOS/Foundation/NSFileManager.swift +++ b/macOS/Foundation/NSFileManager.swift @@ -34,6 +34,8 @@ class FileManager : NSObject { func mountedVolumeURLs(includingResourceValuesForKeys propertyKeys: [URLResourceKey]?, options: FileManager.VolumeEnumerationOptions = []) -> [URL]? @available(macOS 10.11, *) func unmountVolume(at url: URL, options mask: FileManager.UnmountOptions = [], completionHandler: @escaping (Error?) -> Void) + @available(macOS 10.11, *) + func unmountVolume(at url: URL, options mask: FileManager.UnmountOptions = []) async throws @available(macOS 10.6, *) func contentsOfDirectory(at url: URL, includingPropertiesForKeys keys: [URLResourceKey]?, options mask: FileManager.DirectoryEnumerationOptions = []) throws -> [URL] @available(macOS 10.6, *) @@ -121,6 +123,8 @@ class FileManager : NSObject { @NSCopying var ubiquityIdentityToken: (NSCoding & NSCopying & NSObjectProtocol)? { get } @available(macOS 10.13, *) func getFileProviderServicesForItem(at url: URL, completionHandler: @escaping ([NSFileProviderServiceName : NSFileProviderService]?, Error?) -> Void) + @available(macOS 10.13, *) + func getFileProviderServicesForItem(at url: URL) async throws -> [NSFileProviderServiceName : NSFileProviderService]? @available(macOS 10.8, *) func containerURL(forSecurityApplicationGroupIdentifier groupIdentifier: String) -> URL? } @@ -227,6 +231,7 @@ extension FileManager { @available(macOS 10.13, *) class NSFileProviderService : NSObject { func getFileProviderConnection(completionHandler: @escaping (NSXPCConnection?, Error?) -> Void) + func getFileProviderConnection() async throws -> NSXPCConnection? var name: NSFileProviderServiceName { get } } extension FileAttributeKey { diff --git a/macOS/Foundation/NSFilePresenter.swift b/macOS/Foundation/NSFilePresenter.swift index 76854f0..33825c7 100644 --- a/macOS/Foundation/NSFilePresenter.swift +++ b/macOS/Foundation/NSFilePresenter.swift @@ -8,27 +8,30 @@ protocol NSFilePresenter : NSObjectProtocol { optional func relinquishPresentedItem(toReader reader: @escaping ((() -> Void)?) -> Void) optional func relinquishPresentedItem(toWriter writer: @escaping ((() -> Void)?) -> Void) optional func savePresentedItemChanges(completionHandler: @escaping (Error?) -> Void) + optional func savePresentedItemChanges() async throws optional func accommodatePresentedItemDeletion(completionHandler: @escaping (Error?) -> Void) - optional func presentedItemDidMove(to newURL: URL) - optional func presentedItemDidChange() + optional func accommodatePresentedItemDeletion() async throws + @asyncHandler optional func presentedItemDidMove(to newURL: URL) + @asyncHandler optional func presentedItemDidChange() @available(macOS 10.13, *) - optional func presentedItemDidChangeUbiquityAttributes(_ attributes: Set) + @asyncHandler optional func presentedItemDidChangeUbiquityAttributes(_ attributes: Set) @available(macOS 10.13, *) optional var observedPresentedItemUbiquityAttributes: Set { get } @available(macOS 10.7, *) - optional func presentedItemDidGain(_ version: NSFileVersion) + @asyncHandler optional func presentedItemDidGain(_ version: NSFileVersion) @available(macOS 10.7, *) - optional func presentedItemDidLose(_ version: NSFileVersion) + @asyncHandler optional func presentedItemDidLose(_ version: NSFileVersion) @available(macOS 10.7, *) - optional func presentedItemDidResolveConflict(_ version: NSFileVersion) + @asyncHandler optional func presentedItemDidResolveConflict(_ version: NSFileVersion) optional func accommodatePresentedSubitemDeletion(at url: URL, completionHandler: @escaping (Error?) -> Void) - optional func presentedSubitemDidAppear(at url: URL) - optional func presentedSubitem(at oldURL: URL, didMoveTo newURL: URL) - optional func presentedSubitemDidChange(at url: URL) + optional func accommodatePresentedSubitemDeletion(at url: URL) async throws + @asyncHandler optional func presentedSubitemDidAppear(at url: URL) + @asyncHandler optional func presentedSubitem(at oldURL: URL, didMoveTo newURL: URL) + @asyncHandler optional func presentedSubitemDidChange(at url: URL) @available(macOS 10.7, *) - optional func presentedSubitem(at url: URL, didGain version: NSFileVersion) + @asyncHandler optional func presentedSubitem(at url: URL, didGain version: NSFileVersion) @available(macOS 10.7, *) - optional func presentedSubitem(at url: URL, didLose version: NSFileVersion) + @asyncHandler optional func presentedSubitem(at url: URL, didLose version: NSFileVersion) @available(macOS 10.7, *) - optional func presentedSubitem(at url: URL, didResolve version: NSFileVersion) + @asyncHandler optional func presentedSubitem(at url: URL, didResolve version: NSFileVersion) } diff --git a/macOS/Foundation/NSFileVersion.swift b/macOS/Foundation/NSFileVersion.swift index 30b3229..ed03618 100644 --- a/macOS/Foundation/NSFileVersion.swift +++ b/macOS/Foundation/NSFileVersion.swift @@ -18,6 +18,8 @@ class NSFileVersion : NSObject { class func unresolvedConflictVersionsOfItem(at url: URL) -> [NSFileVersion]? @available(macOS 10.10, *) class func getNonlocalVersionsOfItem(at url: URL, completionHandler: @escaping ([NSFileVersion]?, Error?) -> Void) + @available(macOS 10.10, *) + class func getNonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion]? class func version(itemAt url: URL, forPersistentIdentifier persistentIdentifier: Any) -> NSFileVersion? @available(macOS 10.7, *) class func addOfItem(at url: URL, withContentsOf contentsURL: URL, options: NSFileVersion.AddingOptions = []) throws -> NSFileVersion diff --git a/macOS/Foundation/NSHTTPCookieStorage.swift b/macOS/Foundation/NSHTTPCookieStorage.swift index a21d975..c904797 100644 --- a/macOS/Foundation/NSHTTPCookieStorage.swift +++ b/macOS/Foundation/NSHTTPCookieStorage.swift @@ -29,6 +29,8 @@ extension HTTPCookieStorage { func storeCookies(_ cookies: [HTTPCookie], for task: URLSessionTask) @available(macOS 10.10, *) func getCookiesFor(_ task: URLSessionTask, completionHandler: @escaping ([HTTPCookie]?) -> Void) + @available(macOS 10.10, *) + func getCookiesFor(_ task: URLSessionTask) async -> [HTTPCookie]? } extension NSNotification.Name { @available(macOS 10.2, *) diff --git a/macOS/Foundation/NSItemProvider.swift b/macOS/Foundation/NSItemProvider.swift index cf6f510..53cf748 100644 --- a/macOS/Foundation/NSItemProvider.swift +++ b/macOS/Foundation/NSItemProvider.swift @@ -77,6 +77,7 @@ class NSItemProvider : NSObject, NSCopying { convenience init?(contentsOf fileURL: URL!) func registerItem(forTypeIdentifier typeIdentifier: String, loadHandler: @escaping NSItemProvider.LoadHandler) func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil, completionHandler: NSItemProvider.CompletionHandler? = nil) + func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding? } @available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) @@ -95,6 +96,8 @@ extension NSItemProvider { var previewImageHandler: NSItemProvider.LoadHandler? @available(macOS 10.10, *) func loadPreviewImage(options: [AnyHashable : Any]! = [:], completionHandler: NSItemProvider.CompletionHandler!) + @available(macOS 10.10, *) + func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding? } @available(macOS 10.10, *) let NSExtensionJavaScriptPreprocessingResultsKey: String diff --git a/macOS/Foundation/NSKeyedArchiver.swift b/macOS/Foundation/NSKeyedArchiver.swift index ab5c1f5..4f83d00 100644 --- a/macOS/Foundation/NSKeyedArchiver.swift +++ b/macOS/Foundation/NSKeyedArchiver.swift @@ -80,17 +80,17 @@ extension NSKeyedUnarchiver { } protocol NSKeyedArchiverDelegate : NSObjectProtocol { optional func archiver(_ archiver: NSKeyedArchiver, willEncode object: Any) -> Any? - optional func archiver(_ archiver: NSKeyedArchiver, didEncode object: Any?) + @asyncHandler optional func archiver(_ archiver: NSKeyedArchiver, didEncode object: Any?) optional func archiver(_ archiver: NSKeyedArchiver, willReplace object: Any?, with newObject: Any?) optional func archiverWillFinish(_ archiver: NSKeyedArchiver) - optional func archiverDidFinish(_ archiver: NSKeyedArchiver) + @asyncHandler optional func archiverDidFinish(_ archiver: NSKeyedArchiver) } protocol NSKeyedUnarchiverDelegate : NSObjectProtocol { optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, cannotDecodeObjectOfClassName name: String, originalClasses classNames: [String]) -> AnyClass? optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, didDecode object: Any?) -> Any? optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, willReplace object: Any, with newObject: Any) optional func unarchiverWillFinish(_ unarchiver: NSKeyedUnarchiver) - optional func unarchiverDidFinish(_ unarchiver: NSKeyedUnarchiver) + @asyncHandler optional func unarchiverDidFinish(_ unarchiver: NSKeyedUnarchiver) } extension NSObject { var classForKeyedArchiver: AnyClass? { get } diff --git a/macOS/Foundation/NSNetServices.swift b/macOS/Foundation/NSNetServices.swift index 83933b4..8bbe1f2 100644 --- a/macOS/Foundation/NSNetServices.swift +++ b/macOS/Foundation/NSNetServices.swift @@ -70,23 +70,23 @@ class NetServiceBrowser : NSObject { @available(macOS 10.2, *) protocol NetServiceDelegate : NSObjectProtocol { optional func netServiceWillPublish(_ sender: NetService) - optional func netServiceDidPublish(_ sender: NetService) - optional func netService(_ sender: NetService, didNotPublish errorDict: [String : NSNumber]) + @asyncHandler optional func netServiceDidPublish(_ sender: NetService) + @asyncHandler optional func netService(_ sender: NetService, didNotPublish errorDict: [String : NSNumber]) optional func netServiceWillResolve(_ sender: NetService) - optional func netServiceDidResolveAddress(_ sender: NetService) - optional func netService(_ sender: NetService, didNotResolve errorDict: [String : NSNumber]) - optional func netServiceDidStop(_ sender: NetService) - optional func netService(_ sender: NetService, didUpdateTXTRecord data: Data) + @asyncHandler optional func netServiceDidResolveAddress(_ sender: NetService) + @asyncHandler optional func netService(_ sender: NetService, didNotResolve errorDict: [String : NSNumber]) + @asyncHandler optional func netServiceDidStop(_ sender: NetService) + @asyncHandler optional func netService(_ sender: NetService, didUpdateTXTRecord data: Data) @available(macOS 10.9, *) - optional func netService(_ sender: NetService, didAcceptConnectionWith inputStream: InputStream, outputStream: OutputStream) + @asyncHandler optional func netService(_ sender: NetService, didAcceptConnectionWith inputStream: InputStream, outputStream: OutputStream) } @available(macOS 10.2, *) protocol NetServiceBrowserDelegate : NSObjectProtocol { optional func netServiceBrowserWillSearch(_ browser: NetServiceBrowser) - optional func netServiceBrowserDidStopSearch(_ browser: NetServiceBrowser) - optional func netServiceBrowser(_ browser: NetServiceBrowser, didNotSearch errorDict: [String : NSNumber]) - optional func netServiceBrowser(_ browser: NetServiceBrowser, didFindDomain domainString: String, moreComing: Bool) - optional func netServiceBrowser(_ browser: NetServiceBrowser, didFind service: NetService, moreComing: Bool) - optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemoveDomain domainString: String, moreComing: Bool) - optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemove service: NetService, moreComing: Bool) + @asyncHandler optional func netServiceBrowserDidStopSearch(_ browser: NetServiceBrowser) + @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didNotSearch errorDict: [String : NSNumber]) + @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didFindDomain domainString: String, moreComing: Bool) + @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didFind service: NetService, moreComing: Bool) + @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemoveDomain domainString: String, moreComing: Bool) + @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemove service: NetService, moreComing: Bool) } diff --git a/macOS/Foundation/NSSpellServer.swift b/macOS/Foundation/NSSpellServer.swift index cee62e3..db90af6 100644 --- a/macOS/Foundation/NSSpellServer.swift +++ b/macOS/Foundation/NSSpellServer.swift @@ -16,8 +16,8 @@ struct __ssFlags { protocol NSSpellServerDelegate : NSObjectProtocol { optional func spellServer(_ sender: NSSpellServer, findMisspelledWordIn stringToCheck: String, language: String, wordCount: UnsafeMutablePointer, countOnly: Bool) -> NSRange optional func spellServer(_ sender: NSSpellServer, suggestGuessesForWord word: String, inLanguage language: String) -> [String]? - optional func spellServer(_ sender: NSSpellServer, didLearnWord word: String, inLanguage language: String) - optional func spellServer(_ sender: NSSpellServer, didForgetWord word: String, inLanguage language: String) + @asyncHandler optional func spellServer(_ sender: NSSpellServer, didLearnWord word: String, inLanguage language: String) + @asyncHandler optional func spellServer(_ sender: NSSpellServer, didForgetWord word: String, inLanguage language: String) optional func spellServer(_ sender: NSSpellServer, suggestCompletionsForPartialWordRange range: NSRange, in string: String, language: String) -> [String]? @available(macOS 10.5, *) optional func spellServer(_ sender: NSSpellServer, checkGrammarIn stringToCheck: String, language: String?, details: AutoreleasingUnsafeMutablePointer?) -> NSRange diff --git a/macOS/Foundation/NSURLCache.swift b/macOS/Foundation/NSURLCache.swift index bfb2dda..dae8436 100644 --- a/macOS/Foundation/NSURLCache.swift +++ b/macOS/Foundation/NSURLCache.swift @@ -46,5 +46,7 @@ extension URLCache { @available(macOS 10.10, *) func getCachedResponse(for dataTask: URLSessionDataTask, completionHandler: @escaping (CachedURLResponse?) -> Void) @available(macOS 10.10, *) + func getCachedResponse(for dataTask: URLSessionDataTask) async -> CachedURLResponse? + @available(macOS 10.10, *) func removeCachedResponse(for dataTask: URLSessionDataTask) } diff --git a/macOS/Foundation/NSURLConnection.swift b/macOS/Foundation/NSURLConnection.swift index 8df5aee..cc36a1c 100644 --- a/macOS/Foundation/NSURLConnection.swift +++ b/macOS/Foundation/NSURLConnection.swift @@ -22,31 +22,31 @@ class NSURLConnection : NSObject { } @available(macOS 10.2, *) protocol NSURLConnectionDelegate : NSObjectProtocol { - optional func connection(_ connection: NSURLConnection, didFailWithError error: Error) + @asyncHandler optional func connection(_ connection: NSURLConnection, didFailWithError error: Error) optional func connectionShouldUseCredentialStorage(_ connection: NSURLConnection) -> Bool optional func connection(_ connection: NSURLConnection, willSendRequestFor challenge: URLAuthenticationChallenge) @available(macOS, introduced: 10.6, deprecated: 10.10, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") optional func connection(_ connection: NSURLConnection, canAuthenticateAgainstProtectionSpace protectionSpace: URLProtectionSpace) -> Bool @available(macOS, introduced: 10.2, deprecated: 10.10, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") - optional func connection(_ connection: NSURLConnection, didReceive challenge: URLAuthenticationChallenge) + @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive challenge: URLAuthenticationChallenge) @available(macOS, introduced: 10.2, deprecated: 10.10, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") - optional func connection(_ connection: NSURLConnection, didCancel challenge: URLAuthenticationChallenge) + @asyncHandler optional func connection(_ connection: NSURLConnection, didCancel challenge: URLAuthenticationChallenge) } @available(macOS 10.2, *) protocol NSURLConnectionDataDelegate : NSURLConnectionDelegate { optional func connection(_ connection: NSURLConnection, willSend request: URLRequest, redirectResponse response: URLResponse?) -> URLRequest? - optional func connection(_ connection: NSURLConnection, didReceive response: URLResponse) - optional func connection(_ connection: NSURLConnection, didReceive data: Data) + @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive response: URLResponse) + @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive data: Data) optional func connection(_ connection: NSURLConnection, needNewBodyStream request: URLRequest) -> InputStream? - optional func connection(_ connection: NSURLConnection, didSendBodyData bytesWritten: Int, totalBytesWritten: Int, totalBytesExpectedToWrite: Int) + @asyncHandler optional func connection(_ connection: NSURLConnection, didSendBodyData bytesWritten: Int, totalBytesWritten: Int, totalBytesExpectedToWrite: Int) optional func connection(_ connection: NSURLConnection, willCacheResponse cachedResponse: CachedURLResponse) -> CachedURLResponse? - optional func connectionDidFinishLoading(_ connection: NSURLConnection) + @asyncHandler optional func connectionDidFinishLoading(_ connection: NSURLConnection) } @available(macOS 10.2, *) protocol NSURLConnectionDownloadDelegate : NSURLConnectionDelegate { - optional func connection(_ connection: NSURLConnection, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, expectedTotalBytes: Int64) - optional func connectionDidResumeDownloading(_ connection: NSURLConnection, totalBytesWritten: Int64, expectedTotalBytes: Int64) - func connectionDidFinishDownloading(_ connection: NSURLConnection, destinationURL: URL) + @asyncHandler optional func connection(_ connection: NSURLConnection, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, expectedTotalBytes: Int64) + @asyncHandler optional func connectionDidResumeDownloading(_ connection: NSURLConnection, totalBytesWritten: Int64, expectedTotalBytes: Int64) + @asyncHandler func connectionDidFinishDownloading(_ connection: NSURLConnection, destinationURL: URL) } extension NSURLConnection { @available(macOS, introduced: 10.3, deprecated: 10.11, message: "Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h") @@ -55,4 +55,6 @@ extension NSURLConnection { extension NSURLConnection { @available(macOS, introduced: 10.7, deprecated: 10.11, message: "Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h") class func sendAsynchronousRequest(_ request: URLRequest, queue: OperationQueue, completionHandler handler: @escaping (URLResponse?, Data?, Error?) -> Void) + @available(macOS, introduced: 10.7, deprecated: 10.11, message: "Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h") + class func sendAsynchronousRequest(_ request: URLRequest, queue: OperationQueue) async throws -> (URLResponse?, Data?) } diff --git a/macOS/Foundation/NSURLCredentialStorage.swift b/macOS/Foundation/NSURLCredentialStorage.swift index 8d15410..618444c 100644 --- a/macOS/Foundation/NSURLCredentialStorage.swift +++ b/macOS/Foundation/NSURLCredentialStorage.swift @@ -15,12 +15,16 @@ extension URLCredentialStorage { @available(macOS 10.10, *) func getCredentials(for protectionSpace: URLProtectionSpace, task: URLSessionTask, completionHandler: @escaping ([String : URLCredential]?) -> Void) @available(macOS 10.10, *) + func getCredentials(for protectionSpace: URLProtectionSpace, task: URLSessionTask) async -> [String : URLCredential]? + @available(macOS 10.10, *) func set(_ credential: URLCredential, for protectionSpace: URLProtectionSpace, task: URLSessionTask) @available(macOS 10.10, *) func remove(_ credential: URLCredential, for protectionSpace: URLProtectionSpace, options: [String : Any]? = nil, task: URLSessionTask) @available(macOS 10.10, *) func getDefaultCredential(for space: URLProtectionSpace, task: URLSessionTask, completionHandler: @escaping (URLCredential?) -> Void) @available(macOS 10.10, *) + func getDefaultCredential(for space: URLProtectionSpace, task: URLSessionTask) async -> URLCredential? + @available(macOS 10.10, *) func setDefaultCredential(_ credential: URLCredential, for protectionSpace: URLProtectionSpace, task: URLSessionTask) } extension NSNotification.Name { diff --git a/macOS/Foundation/NSURLDownload.swift b/macOS/Foundation/NSURLDownload.swift index fcbc9fe..9a0ca47 100644 --- a/macOS/Foundation/NSURLDownload.swift +++ b/macOS/Foundation/NSURLDownload.swift @@ -14,18 +14,18 @@ class NSURLDownload : NSObject { } @available(macOS 10.2, *) protocol NSURLDownloadDelegate : NSObjectProtocol { - optional func downloadDidBegin(_ download: NSURLDownload) + @asyncHandler optional func downloadDidBegin(_ download: NSURLDownload) optional func download(_ download: NSURLDownload, willSend request: URLRequest, redirectResponse: URLResponse?) -> URLRequest? optional func download(_ connection: NSURLDownload, canAuthenticateAgainstProtectionSpace protectionSpace: URLProtectionSpace) -> Bool - optional func download(_ download: NSURLDownload, didReceive challenge: URLAuthenticationChallenge) - optional func download(_ download: NSURLDownload, didCancel challenge: URLAuthenticationChallenge) + @asyncHandler optional func download(_ download: NSURLDownload, didReceive challenge: URLAuthenticationChallenge) + @asyncHandler optional func download(_ download: NSURLDownload, didCancel challenge: URLAuthenticationChallenge) optional func downloadShouldUseCredentialStorage(_ download: NSURLDownload) -> Bool - optional func download(_ download: NSURLDownload, didReceive response: URLResponse) + @asyncHandler optional func download(_ download: NSURLDownload, didReceive response: URLResponse) optional func download(_ download: NSURLDownload, willResumeWith response: URLResponse, fromByte startingByte: Int64) - optional func download(_ download: NSURLDownload, didReceiveDataOfLength length: Int) + @asyncHandler optional func download(_ download: NSURLDownload, didReceiveDataOfLength length: Int) optional func download(_ download: NSURLDownload, shouldDecodeSourceDataOfMIMEType encodingType: String) -> Bool optional func download(_ download: NSURLDownload, decideDestinationWithSuggestedFilename filename: String) - optional func download(_ download: NSURLDownload, didCreateDestination path: String) - optional func downloadDidFinish(_ download: NSURLDownload) - optional func download(_ download: NSURLDownload, didFailWithError error: Error) + @asyncHandler optional func download(_ download: NSURLDownload, didCreateDestination path: String) + @asyncHandler optional func downloadDidFinish(_ download: NSURLDownload) + @asyncHandler optional func download(_ download: NSURLDownload, didFailWithError error: Error) } diff --git a/macOS/Foundation/NSURLProtocol.swift b/macOS/Foundation/NSURLProtocol.swift index caab35d..3bd27b6 100644 --- a/macOS/Foundation/NSURLProtocol.swift +++ b/macOS/Foundation/NSURLProtocol.swift @@ -3,12 +3,12 @@ protocol URLProtocolClient : NSObjectProtocol { func urlProtocol(_ protocol: URLProtocol, wasRedirectedTo request: URLRequest, redirectResponse: URLResponse) func urlProtocol(_ protocol: URLProtocol, cachedResponseIsValid cachedResponse: CachedURLResponse) - func urlProtocol(_ protocol: URLProtocol, didReceive response: URLResponse, cacheStoragePolicy policy: URLCache.StoragePolicy) - func urlProtocol(_ protocol: URLProtocol, didLoad data: Data) - func urlProtocolDidFinishLoading(_ protocol: URLProtocol) - func urlProtocol(_ protocol: URLProtocol, didFailWithError error: Error) - func urlProtocol(_ protocol: URLProtocol, didReceive challenge: URLAuthenticationChallenge) - func urlProtocol(_ protocol: URLProtocol, didCancel challenge: URLAuthenticationChallenge) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didReceive response: URLResponse, cacheStoragePolicy policy: URLCache.StoragePolicy) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didLoad data: Data) + @asyncHandler func urlProtocolDidFinishLoading(_ protocol: URLProtocol) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didFailWithError error: Error) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didReceive challenge: URLAuthenticationChallenge) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didCancel challenge: URLAuthenticationChallenge) } @available(macOS 10.2, *) class URLProtocol : NSObject { diff --git a/macOS/Foundation/NSURLSession.swift b/macOS/Foundation/NSURLSession.swift index 3ce6089..6fa5a37 100644 --- a/macOS/Foundation/NSURLSession.swift +++ b/macOS/Foundation/NSURLSession.swift @@ -13,10 +13,15 @@ class URLSession : NSObject { func finishTasksAndInvalidate() func invalidateAndCancel() func reset(completionHandler: @escaping () -> Void) + func reset() async func flush(completionHandler: @escaping () -> Void) + func flush() async func getTasksWithCompletionHandler(_ completionHandler: @escaping ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) -> Void) + func getTasks() async -> ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) @available(macOS 10.11, *) func getAllTasks(completionHandler: @escaping ([URLSessionTask]) -> Void) + @available(macOS 10.11, *) + func getAllTasks() async -> [URLSessionTask] func dataTask(with request: URLRequest) -> URLSessionDataTask func dataTask(with url: URL) -> URLSessionDataTask func uploadTask(with request: URLRequest, fromFile fileURL: URL) -> URLSessionUploadTask @@ -119,11 +124,14 @@ class URLSessionUploadTask : URLSessionDataTask { @available(macOS 10.9, *) class URLSessionDownloadTask : URLSessionTask { func cancel(byProducingResumeData completionHandler: @escaping (Data?) -> Void) + func cancelByProducingResumeData() async -> Data? } @available(macOS 10.11, *) class URLSessionStreamTask : URLSessionTask { func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval, completionHandler: @escaping (Data?, Bool, Error?) -> Void) + func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval) async throws -> (Data?, Bool) func write(_ data: Data, timeout: TimeInterval, completionHandler: @escaping (Error?) -> Void) + func write(_ data: Data, timeout: TimeInterval) async throws func captureStreams() func closeWrite() func closeRead() @@ -169,7 +177,9 @@ extension URLSessionWebSocketTask { @available(macOS 10.15, *) class URLSessionWebSocketTask : URLSessionTask { func __send(_ message: __NSURLSessionWebSocketMessage, completionHandler: @escaping (Error?) -> Void) + func __send(_ message: __NSURLSessionWebSocketMessage) async throws func __receiveMessage(completionHandler: @escaping (__NSURLSessionWebSocketMessage?, Error?) -> Void) + func __receiveMessage() async throws -> __NSURLSessionWebSocketMessage? func sendPing(pongReceiveHandler: @escaping (Error?) -> Void) func cancel(with closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) var maximumMessageSize: Int @@ -264,51 +274,59 @@ extension URLSession { } @available(macOS 10.9, *) protocol URLSessionDelegate : NSObjectProtocol { - optional func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) - optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + @asyncHandler optional func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) + @asyncHandler optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) @available(macOS 11.0, *) - optional func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) + @asyncHandler optional func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) } @available(macOS 10.9, *) protocol URLSessionTaskDelegate : URLSessionDelegate { @available(macOS 10.13, *) optional func urlSession(_ session: URLSession, task: URLSessionTask, willBeginDelayedRequest request: URLRequest, completionHandler: @escaping (URLSession.DelayedRequestDisposition, URLRequest?) -> Void) @available(macOS 10.13, *) + optional func urlSession(_ session: URLSession, task: URLSessionTask, willBeginDelayedRequest request: URLRequest) async -> (URLSession.DelayedRequestDisposition, URLRequest?) + @available(macOS 10.13, *) optional func urlSession(_ session: URLSession, taskIsWaitingForConnectivity task: URLSessionTask) optional func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest, completionHandler: @escaping (URLRequest?) -> Void) - optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest) async -> URLRequest? + @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) optional func urlSession(_ session: URLSession, task: URLSessionTask, needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) - optional func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) + optional func urlSession(_ session: URLSession, task: URLSessionTask) async -> InputStream? + @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) @available(macOS 10.12, *) - optional func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) - optional func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) + @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) + @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) } @available(macOS 10.9, *) protocol URLSessionDataDelegate : URLSessionTaskDelegate { - optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) - optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome downloadTask: URLSessionDownloadTask) + @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse) async -> URLSession.ResponseDisposition + @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome downloadTask: URLSessionDownloadTask) @available(macOS 10.11, *) - optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome streamTask: URLSessionStreamTask) - optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) + @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome streamTask: URLSessionStreamTask) + @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse, completionHandler: @escaping (CachedURLResponse?) -> Void) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse) async -> CachedURLResponse? } @available(macOS 10.9, *) protocol URLSessionDownloadDelegate : URLSessionTaskDelegate { - func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) - optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) - optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) + @asyncHandler func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) + @asyncHandler optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) + @asyncHandler optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) } @available(macOS 10.11, *) protocol URLSessionStreamDelegate : URLSessionTaskDelegate { optional func urlSession(_ session: URLSession, readClosedFor streamTask: URLSessionStreamTask) optional func urlSession(_ session: URLSession, writeClosedFor streamTask: URLSessionStreamTask) optional func urlSession(_ session: URLSession, betterRouteDiscoveredFor streamTask: URLSessionStreamTask) - optional func urlSession(_ session: URLSession, streamTask: URLSessionStreamTask, didBecome inputStream: InputStream, outputStream: OutputStream) + @asyncHandler optional func urlSession(_ session: URLSession, streamTask: URLSessionStreamTask, didBecome inputStream: InputStream, outputStream: OutputStream) } @available(macOS 10.15, *) protocol URLSessionWebSocketDelegate : URLSessionTaskDelegate { - optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) - optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) + @asyncHandler optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) + @asyncHandler optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) } @available(macOS 10.9, *) let NSURLSessionDownloadTaskResumeData: String diff --git a/macOS/Foundation/NSUserActivity.swift b/macOS/Foundation/NSUserActivity.swift index e4ef975..b6f0a8d 100644 --- a/macOS/Foundation/NSUserActivity.swift +++ b/macOS/Foundation/NSUserActivity.swift @@ -26,6 +26,7 @@ class NSUserActivity : NSObject { func resignCurrent() func invalidate() func getContinuationStreams(completionHandler: @escaping (InputStream?, OutputStream?, Error?) -> Void) + func getContinuationStreams() async throws -> (InputStream?, OutputStream?) @available(macOS 10.11, *) var isEligibleForHandoff: Bool @available(macOS 10.11, *) @@ -37,12 +38,16 @@ class NSUserActivity : NSObject { @available(macOS 10.15, *) class func deleteSavedUserActivities(withPersistentIdentifiers persistentIdentifiers: [NSUserActivityPersistentIdentifier], completionHandler handler: @escaping () -> Void) @available(macOS 10.15, *) + class func deleteSavedUserActivities(withPersistentIdentifiers persistentIdentifiers: [NSUserActivityPersistentIdentifier]) async + @available(macOS 10.15, *) class func deleteAllSavedUserActivities(completionHandler handler: @escaping () -> Void) + @available(macOS 10.15, *) + class func deleteAllSavedUserActivities() async } let NSUserActivityTypeBrowsingWeb: String @available(macOS 10.10, *) protocol NSUserActivityDelegate : NSObjectProtocol { optional func userActivityWillSave(_ userActivity: NSUserActivity) optional func userActivityWasContinued(_ userActivity: NSUserActivity) - optional func userActivity(_ userActivity: NSUserActivity, didReceive inputStream: InputStream, outputStream: OutputStream) + @asyncHandler optional func userActivity(_ userActivity: NSUserActivity, didReceive inputStream: InputStream, outputStream: OutputStream) } diff --git a/macOS/Foundation/NSUserNotification.swift b/macOS/Foundation/NSUserNotification.swift index 8c2f3a3..27fdcef 100644 --- a/macOS/Foundation/NSUserNotification.swift +++ b/macOS/Foundation/NSUserNotification.swift @@ -65,9 +65,9 @@ class NSUserNotificationCenter : NSObject { } protocol NSUserNotificationCenterDelegate : NSObjectProtocol { @available(macOS, introduced: 10.8, deprecated: 11.0, message: "All NSUserNotifications API should be replaced with UserNotifications.frameworks API") - optional func userNotificationCenter(_ center: NSUserNotificationCenter, didDeliver notification: NSUserNotification) + @asyncHandler optional func userNotificationCenter(_ center: NSUserNotificationCenter, didDeliver notification: NSUserNotification) @available(macOS, introduced: 10.8, deprecated: 11.0, message: "All NSUserNotifications API should be replaced with UserNotifications.frameworks API") - optional func userNotificationCenter(_ center: NSUserNotificationCenter, didActivate notification: NSUserNotification) + @asyncHandler optional func userNotificationCenter(_ center: NSUserNotificationCenter, didActivate notification: NSUserNotification) @available(macOS, introduced: 10.8, deprecated: 11.0, message: "All NSUserNotifications API should be replaced with UserNotifications.frameworks API") optional func userNotificationCenter(_ center: NSUserNotificationCenter, shouldPresent notification: NSUserNotification) -> Bool } diff --git a/macOS/Foundation/NSUserScriptTask.swift b/macOS/Foundation/NSUserScriptTask.swift index a5fb140..58edd54 100644 --- a/macOS/Foundation/NSUserScriptTask.swift +++ b/macOS/Foundation/NSUserScriptTask.swift @@ -4,6 +4,7 @@ class NSUserScriptTask : NSObject { init(url: URL) throws var scriptURL: URL { get } func execute(completionHandler handler: NSUserScriptTask.CompletionHandler? = nil) + func execute() async throws } extension NSUserScriptTask { typealias CompletionHandler = (Error?) -> Void @@ -14,6 +15,7 @@ class NSUserUnixTask : NSUserScriptTask { var standardOutput: FileHandle? var standardError: FileHandle? func execute(withArguments arguments: [String]?, completionHandler handler: NSUserUnixTask.CompletionHandler? = nil) + func execute(withArguments arguments: [String]?) async throws } extension NSUserUnixTask { typealias CompletionHandler = (Error?) -> Void @@ -21,6 +23,7 @@ extension NSUserUnixTask { @available(macOS 10.8, *) class NSUserAppleScriptTask : NSUserScriptTask { func execute(withAppleEvent event: NSAppleEventDescriptor?, completionHandler handler: NSUserAppleScriptTask.CompletionHandler? = nil) + func execute(withAppleEvent event: NSAppleEventDescriptor?) async throws -> NSAppleEventDescriptor? } extension NSUserAppleScriptTask { typealias CompletionHandler = (NSAppleEventDescriptor?, Error?) -> Void @@ -29,6 +32,7 @@ extension NSUserAppleScriptTask { class NSUserAutomatorTask : NSUserScriptTask { var variables: [String : Any]? func execute(withInput input: NSSecureCoding?, completionHandler handler: NSUserAutomatorTask.CompletionHandler? = nil) + func execute(withInput input: NSSecureCoding?) async throws -> Any? } extension NSUserAutomatorTask { typealias CompletionHandler = (Any?, Error?) -> Void diff --git a/macOS/Foundation/NSXMLParser.swift b/macOS/Foundation/NSXMLParser.swift index 09a76f5..298e92f 100644 --- a/macOS/Foundation/NSXMLParser.swift +++ b/macOS/Foundation/NSXMLParser.swift @@ -23,18 +23,18 @@ extension XMLParser { var columnNumber: Int { get } } protocol XMLParserDelegate : NSObjectProtocol { - optional func parserDidStartDocument(_ parser: XMLParser) - optional func parserDidEndDocument(_ parser: XMLParser) + @asyncHandler optional func parserDidStartDocument(_ parser: XMLParser) + @asyncHandler optional func parserDidEndDocument(_ parser: XMLParser) optional func parser(_ parser: XMLParser, foundNotationDeclarationWithName name: String, publicID: String?, systemID: String?) optional func parser(_ parser: XMLParser, foundUnparsedEntityDeclarationWithName name: String, publicID: String?, systemID: String?, notationName: String?) optional func parser(_ parser: XMLParser, foundAttributeDeclarationWithName attributeName: String, forElement elementName: String, type: String?, defaultValue: String?) optional func parser(_ parser: XMLParser, foundElementDeclarationWithName elementName: String, model: String) optional func parser(_ parser: XMLParser, foundInternalEntityDeclarationWithName name: String, value: String?) optional func parser(_ parser: XMLParser, foundExternalEntityDeclarationWithName name: String, publicID: String?, systemID: String?) - optional func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) - optional func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) - optional func parser(_ parser: XMLParser, didStartMappingPrefix prefix: String, toURI namespaceURI: String) - optional func parser(_ parser: XMLParser, didEndMappingPrefix prefix: String) + @asyncHandler optional func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) + @asyncHandler optional func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) + @asyncHandler optional func parser(_ parser: XMLParser, didStartMappingPrefix prefix: String, toURI namespaceURI: String) + @asyncHandler optional func parser(_ parser: XMLParser, didEndMappingPrefix prefix: String) optional func parser(_ parser: XMLParser, foundCharacters string: String) optional func parser(_ parser: XMLParser, foundIgnorableWhitespace whitespaceString: String) optional func parser(_ parser: XMLParser, foundProcessingInstructionWithTarget target: String, data: String?) diff --git a/macOS/GLKit/GLKTextureLoader.swift b/macOS/GLKit/GLKTextureLoader.swift index 1937755..ba44847 100644 --- a/macOS/GLKit/GLKTextureLoader.swift +++ b/macOS/GLKit/GLKTextureLoader.swift @@ -82,11 +82,19 @@ class GLKTextureLoader : NSObject { class func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil) throws -> GLKTextureInfo init(share context: NSOpenGLContext) func texture(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func texture(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func texture(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func texture(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func texture(withName name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func texture(withName name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func texture(withContentsOf data: Data, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func texture(withContentsOf data: Data, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func texture(with cgImage: CGImage, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func texture(with cgImage: CGImage, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func cubeMap(withContentsOfFiles paths: [Any], options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func cubeMap(withContentsOfFiles paths: [Any], options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func cubeMap(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func cubeMap(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? } diff --git a/macOS/GameController/GCController.swift b/macOS/GameController/GCController.swift index 4153998..e483be9 100644 --- a/macOS/GameController/GCController.swift +++ b/macOS/GameController/GCController.swift @@ -44,6 +44,7 @@ class GCController : NSObject, GCDevice { func capture() -> GCController class func controllers() -> [GCController] class func startWirelessControllerDiscovery(completionHandler: (() -> Void)? = nil) + class func startWirelessControllerDiscovery() async class func stopWirelessControllerDiscovery() @available(macOS 10.15, *) class func withMicroGamepad() -> GCController diff --git a/macOS/GameKit/GKAchievement.swift b/macOS/GameKit/GKAchievement.swift index d803f80..e19aeee 100644 --- a/macOS/GameKit/GKAchievement.swift +++ b/macOS/GameKit/GKAchievement.swift @@ -2,12 +2,16 @@ @available(macOS 10.8, *) class GKAchievement : NSObject, NSCoding, NSSecureCoding { class func loadAchievements(completionHandler: (([GKAchievement]?, Error?) -> Void)? = nil) + class func loadAchievements() async throws -> [GKAchievement]? class func resetAchievements(completionHandler: ((Error?) -> Void)? = nil) + class func resetAchievements() async throws init(identifier: String) @available(macOS 10.10, *) init(identifier: String, player: GKPlayer) @available(macOS 10.8, *) class func report(_ achievements: [GKAchievement], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + @available(macOS 10.8, *) + class func report(_ achievements: [GKAchievement]) async throws var identifier: String var percentComplete: Double var isCompleted: Bool { get } @@ -20,6 +24,8 @@ class GKAchievement : NSObject, NSCoding, NSSecureCoding { extension GKAchievement { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use +reportAchievements:withCompletionHandler:") func report(completionHandler: ((Error?) -> Void)? = nil) + @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use +reportAchievements:withCompletionHandler:") + func report() async throws @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use isHidden on the GKAchievementDescription class instead") var isHidden: Bool { get } } diff --git a/macOS/GameKit/GKAchievementDescription.swift b/macOS/GameKit/GKAchievementDescription.swift index 52b9249..3bb2c97 100644 --- a/macOS/GameKit/GKAchievementDescription.swift +++ b/macOS/GameKit/GKAchievementDescription.swift @@ -2,6 +2,7 @@ @available(macOS 10.8, *) class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { class func loadAchievementDescriptions(completionHandler: (([GKAchievementDescription]?, Error?) -> Void)? = nil) + class func loadAchievementDescriptions() async throws -> [GKAchievementDescription]? var identifier: String { get } @available(macOS 10.8, *) var groupIdentifier: String? { get } @@ -17,6 +18,7 @@ extension GKAchievementDescription { @available(macOS 10.8, *) var image: NSImage? { get } func loadImage(completionHandler: ((NSImage?, Error?) -> Void)? = nil) + func loadImage() async throws -> NSImage? class func incompleteAchievementImage() -> NSImage class func placeholderCompletedAchievementImage() -> NSImage } diff --git a/macOS/GameKit/GKAchievementViewController.swift b/macOS/GameKit/GKAchievementViewController.swift index 9001203..9c85361 100644 --- a/macOS/GameKit/GKAchievementViewController.swift +++ b/macOS/GameKit/GKAchievementViewController.swift @@ -5,5 +5,5 @@ class GKAchievementViewController : GKGameCenterViewController { } @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use GKGameCenterViewController instead") protocol GKAchievementViewControllerDelegate : NSObjectProtocol { - func achievementViewControllerDidFinish(_ viewController: GKAchievementViewController!) + @asyncHandler func achievementViewControllerDidFinish(_ viewController: GKAchievementViewController!) } diff --git a/macOS/GameKit/GKChallenge.swift b/macOS/GameKit/GKChallenge.swift index a457c78..a929588 100644 --- a/macOS/GameKit/GKChallenge.swift +++ b/macOS/GameKit/GKChallenge.swift @@ -10,6 +10,7 @@ enum GKChallengeState : Int { @available(macOS 10.8, *) class GKChallenge : NSObject, NSCoding, NSSecureCoding { class func loadReceivedChallenges(completionHandler: (([GKChallenge]?, Error?) -> Void)? = nil) + class func loadReceivedChallenges() async throws -> [GKChallenge]? func decline() @available(macOS 10.10, *) @NSCopying var issuingPlayer: GKPlayer? { get } @@ -37,14 +38,22 @@ class GKAchievementChallenge : GKChallenge { extension GKScore { @available(macOS, introduced: 10.10, deprecated: 11.0, message: "pass GKLeaderboardScore to reportLeaderboardScores:withEligibleChallenges:withCompletionHandler instead") class func report(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + @available(macOS, introduced: 10.10, deprecated: 11.0, message: "pass GKLeaderboardScore to reportLeaderboardScores:withEligibleChallenges:withCompletionHandler instead") + class func report(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge]) async throws @available(macOS 11.0, *) class func report(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + @available(macOS 11.0, *) + class func report(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge]) async throws } extension GKAchievement { @available(macOS 10.10, *) func selectChallengeablePlayers(_ players: [GKPlayer], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(macOS 10.10, *) + func selectChallengeablePlayers(_ players: [GKPlayer]) async throws -> [GKPlayer]? + @available(macOS 10.10, *) class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + @available(macOS 10.10, *) + class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge]) async throws } extension GKScore { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, pass GKPlayers to challengeComposeControllerWithMessage:players:completionHandler: and present the view controller instead") @@ -55,6 +64,8 @@ extension GKAchievement { func issueChallenge(toPlayers playerIDs: [String]?, message: String?) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, pass GKPlayers to selectChallengeablePlayers:") func selectChallengeablePlayerIDs(_ playerIDs: [String]?, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) + @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, pass GKPlayers to selectChallengeablePlayers:") + func selectChallengeablePlayerIDs(_ playerIDs: [String]?) async throws -> [String]? } typealias GKChallengeComposeCompletionBlock = (NSViewController, Bool, [String]?) -> Void extension GKScore { diff --git a/macOS/GameKit/GKChallengeEventHandler.swift b/macOS/GameKit/GKChallengeEventHandler.swift index 320eea8..48900c0 100644 --- a/macOS/GameKit/GKChallengeEventHandler.swift +++ b/macOS/GameKit/GKChallengeEventHandler.swift @@ -1,13 +1,13 @@ @available(macOS, introduced: 10.8, deprecated: 10.10, message: "You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer.") protocol GKChallengeEventHandlerDelegate : NSObjectProtocol { - optional func localPlayerDidSelect(_ challenge: GKChallenge!) + @asyncHandler optional func localPlayerDidSelect(_ challenge: GKChallenge!) optional func shouldShowBanner(forLocallyReceivedChallenge challenge: GKChallenge!) -> Bool - optional func localPlayerDidReceive(_ challenge: GKChallenge!) + @asyncHandler optional func localPlayerDidReceive(_ challenge: GKChallenge!) optional func shouldShowBanner(forLocallyCompletedChallenge challenge: GKChallenge!) -> Bool - optional func localPlayerDidComplete(_ challenge: GKChallenge!) + @asyncHandler optional func localPlayerDidComplete(_ challenge: GKChallenge!) optional func shouldShowBanner(forRemotelyCompletedChallenge challenge: GKChallenge!) -> Bool - optional func remotePlayerDidComplete(_ challenge: GKChallenge!) + @asyncHandler optional func remotePlayerDidComplete(_ challenge: GKChallenge!) } @available(macOS, introduced: 10.8, deprecated: 10.10, message: "You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer.") class GKChallengeEventHandler : NSObject { diff --git a/macOS/GameKit/GKChallengesViewController.swift b/macOS/GameKit/GKChallengesViewController.swift index 2348f12..a776eee 100644 --- a/macOS/GameKit/GKChallengesViewController.swift +++ b/macOS/GameKit/GKChallengesViewController.swift @@ -5,5 +5,5 @@ class GKChallengesViewController : NSViewController, GKViewController { } protocol GKChallengesViewControllerDelegate { @available(macOS 10.8, *) - func challengesViewControllerDidFinish(_ viewController: GKChallengesViewController!) + @asyncHandler func challengesViewControllerDidFinish(_ viewController: GKChallengesViewController!) } diff --git a/macOS/GameKit/GKCloudPlayer.swift b/macOS/GameKit/GKCloudPlayer.swift index b3dcf7e..048fbe5 100644 --- a/macOS/GameKit/GKCloudPlayer.swift +++ b/macOS/GameKit/GKCloudPlayer.swift @@ -2,4 +2,5 @@ @available(macOS, introduced: 10.12, deprecated: 10.14, message: "GKGameSession is deprecated. Use GKPlayer for both real-time and turn-based matchmaking APIs.") class GKCloudPlayer : GKBasePlayer { class func getCurrentSignedInPlayer(forContainer containerName: String?, completionHandler handler: @escaping (GKCloudPlayer?, Error?) -> Void) + class func getCurrentSignedInPlayer(forContainer containerName: String?) async throws -> GKCloudPlayer? } diff --git a/macOS/GameKit/GKEventListener.swift b/macOS/GameKit/GKEventListener.swift index 9adde5a..87a902c 100644 --- a/macOS/GameKit/GKEventListener.swift +++ b/macOS/GameKit/GKEventListener.swift @@ -3,9 +3,9 @@ protocol GKChallengeListener : NSObjectProtocol { @available(macOS 10.10, *) optional func player(_ player: GKPlayer, wantsToPlay challenge: GKChallenge) @available(macOS 10.10, *) - optional func player(_ player: GKPlayer, didReceive challenge: GKChallenge) + @asyncHandler optional func player(_ player: GKPlayer, didReceive challenge: GKChallenge) @available(macOS 10.10, *) - optional func player(_ player: GKPlayer, didComplete challenge: GKChallenge, issuedByFriend friendPlayer: GKPlayer) + @asyncHandler optional func player(_ player: GKPlayer, didComplete challenge: GKChallenge, issuedByFriend friendPlayer: GKPlayer) @available(macOS 10.10, *) optional func player(_ player: GKPlayer, issuedChallengeWasCompleted challenge: GKChallenge, byFriend friendPlayer: GKPlayer) } diff --git a/macOS/GameKit/GKFriendRequestComposeViewController.swift b/macOS/GameKit/GKFriendRequestComposeViewController.swift index 7a3be08..acee956 100644 --- a/macOS/GameKit/GKFriendRequestComposeViewController.swift +++ b/macOS/GameKit/GKFriendRequestComposeViewController.swift @@ -16,5 +16,5 @@ extension GKFriendRequestComposeViewController { @available(macOS, introduced: 10.8, deprecated: 10.12) protocol GKFriendRequestComposeViewControllerDelegate { @available(macOS, introduced: 10.8, deprecated: 10.12) - func friendRequestComposeViewControllerDidFinish(_ viewController: GKFriendRequestComposeViewController) + @asyncHandler func friendRequestComposeViewControllerDidFinish(_ viewController: GKFriendRequestComposeViewController) } diff --git a/macOS/GameKit/GKGameCenterViewController.swift b/macOS/GameKit/GKGameCenterViewController.swift index 0b4a38f..a8b2fbc 100644 --- a/macOS/GameKit/GKGameCenterViewController.swift +++ b/macOS/GameKit/GKGameCenterViewController.swift @@ -35,5 +35,5 @@ extension GKGameCenterViewController { } protocol GKGameCenterControllerDelegate : NSObjectProtocol { @available(macOS 10.9, *) - func gameCenterViewControllerDidFinish(_ gameCenterViewController: GKGameCenterViewController) + @asyncHandler func gameCenterViewControllerDidFinish(_ gameCenterViewController: GKGameCenterViewController) } diff --git a/macOS/GameKit/GKGameSession.swift b/macOS/GameKit/GKGameSession.swift index 59a73ba..fbe3022 100644 --- a/macOS/GameKit/GKGameSession.swift +++ b/macOS/GameKit/GKGameSession.swift @@ -22,15 +22,26 @@ class GKGameSession : NSObject { var maxNumberOfConnectedPlayers: Int { get } var badgedPlayers: [GKCloudPlayer] { get } class func createSession(inContainer containerName: String?, withTitle title: String, maxConnectedPlayers maxPlayers: Int, completionHandler: @escaping (GKGameSession?, Error?) -> Void) + class func createSession(inContainer containerName: String?, withTitle title: String, maxConnectedPlayers maxPlayers: Int) async throws -> GKGameSession? class func loadSessions(inContainer containerName: String?, completionHandler: @escaping ([GKGameSession]?, Error?) -> Void) + class func loadSessions(inContainer containerName: String?) async throws -> [GKGameSession]? class func load(withIdentifier identifier: String, completionHandler: @escaping (GKGameSession?, Error?) -> Void) + class func load(withIdentifier identifier: String) async throws -> GKGameSession? class func remove(withIdentifier identifier: String, completionHandler: @escaping (Error?) -> Void) + class func remove(withIdentifier identifier: String) async throws func getShareURL(completionHandler: @escaping (URL?, Error?) -> Void) + func getShareURL() async throws -> URL? func loadData(completionHandler: @escaping (Data?, Error?) -> Void) + func loadData() async throws -> Data? func save(_ data: Data, completionHandler: @escaping (Data?, Error?) -> Void) + func save(_ data: Data) async throws -> Data? func setConnectionState(_ state: GKConnectionState, completionHandler: @escaping (Error?) -> Void) + func setConnectionState(_ state: GKConnectionState) async throws func players(with state: GKConnectionState) -> [GKCloudPlayer] func send(_ data: Data, with transport: GKTransportType, completionHandler: @escaping (Error?) -> Void) + func send(_ data: Data, with transport: GKTransportType) async throws func sendMessage(withLocalizedFormatKey key: String, arguments: [String], data: Data?, to players: [GKCloudPlayer], badgePlayers: Bool, completionHandler: @escaping (Error?) -> Void) + func sendMessage(withLocalizedFormatKey key: String, arguments: [String], data: Data?, to players: [GKCloudPlayer], badgePlayers: Bool) async throws func clearBadge(for players: [GKCloudPlayer], completionHandler: @escaping (Error?) -> Void) + func clearBadge(for players: [GKCloudPlayer]) async throws } diff --git a/macOS/GameKit/GKGameSessionEventListener.swift b/macOS/GameKit/GKGameSessionEventListener.swift index e4a9887..74ed396 100644 --- a/macOS/GameKit/GKGameSessionEventListener.swift +++ b/macOS/GameKit/GKGameSessionEventListener.swift @@ -1,12 +1,12 @@ @available(macOS, introduced: 10.12, deprecated: 10.14, message: "Use GKLocalPlayerListener for multiplayer event notifications.") protocol GKGameSessionEventListener : NSObjectProtocol { - optional func session(_ session: GKGameSession, didAdd player: GKCloudPlayer) - optional func session(_ session: GKGameSession, didRemove player: GKCloudPlayer) - optional func session(_ session: GKGameSession, player: GKCloudPlayer, didChange newState: GKConnectionState) - optional func session(_ session: GKGameSession, player: GKCloudPlayer, didSave data: Data) - optional func session(_ session: GKGameSession, didReceive data: Data, from player: GKCloudPlayer) - optional func session(_ session: GKGameSession, didReceiveMessage message: String, with data: Data, from player: GKCloudPlayer) + @asyncHandler optional func session(_ session: GKGameSession, didAdd player: GKCloudPlayer) + @asyncHandler optional func session(_ session: GKGameSession, didRemove player: GKCloudPlayer) + @asyncHandler optional func session(_ session: GKGameSession, player: GKCloudPlayer, didChange newState: GKConnectionState) + @asyncHandler optional func session(_ session: GKGameSession, player: GKCloudPlayer, didSave data: Data) + @asyncHandler optional func session(_ session: GKGameSession, didReceive data: Data, from player: GKCloudPlayer) + @asyncHandler optional func session(_ session: GKGameSession, didReceiveMessage message: String, with data: Data, from player: GKCloudPlayer) } extension GKGameSession { @available(macOS, introduced: 10.12, deprecated: 10.14, message: "Use GKLocalPlayer's registerListener: to register for GKLocalPlayerListener event notifications.") diff --git a/macOS/GameKit/GKLeaderboard.swift b/macOS/GameKit/GKLeaderboard.swift index 0b63518..a547091 100644 --- a/macOS/GameKit/GKLeaderboard.swift +++ b/macOS/GameKit/GKLeaderboard.swift @@ -39,15 +39,27 @@ class GKLeaderboard : NSObject { @available(macOS 11.0, *) class func loadLeaderboards(IDs leaderboardIDs: [String]?, completionHandler: @escaping ([GKLeaderboard]?, Error?) -> Void) @available(macOS 11.0, *) + class func loadLeaderboards(IDs leaderboardIDs: [String]?) async throws -> [GKLeaderboard]? + @available(macOS 11.0, *) func loadPreviousOccurrence(completionHandler: @escaping (GKLeaderboard?, Error?) -> Void) @available(macOS 11.0, *) + func loadPreviousOccurrence() async throws -> GKLeaderboard? + @available(macOS 11.0, *) class func submitScore(_ score: Int, context: Int, player: GKPlayer, leaderboardIDs: [String], completionHandler: @escaping (Error?) -> Void) @available(macOS 11.0, *) + class func submitScore(_ score: Int, context: Int, player: GKPlayer, leaderboardIDs: [String]) async throws + @available(macOS 11.0, *) func submitScore(_ score: Int, context: Int, player: GKPlayer, completionHandler: @escaping (Error?) -> Void) @available(macOS 11.0, *) + func submitScore(_ score: Int, context: Int, player: GKPlayer) async throws + @available(macOS 11.0, *) func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange, completionHandler: @escaping (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Int, Error?) -> Void) @available(macOS 11.0, *) + func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange) async throws -> (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Int) + @available(macOS 11.0, *) func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope, completionHandler: @escaping (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Error?) -> Void) + @available(macOS 11.0, *) + func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope) async throws -> (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?) } extension GKLeaderboard { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use identifier instead") @@ -56,6 +68,8 @@ extension GKLeaderboard { init?(playerIDs: [String]?) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use setDefaultLeaderboardIdentifier:completionHandler: on GKLocalPlayer instead") class func setDefault(_ leaderboardIdentifier: String?, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use setDefaultLeaderboardIdentifier:completionHandler: on GKLocalPlayer instead") + class func setDefault(_ leaderboardIdentifier: String?) async throws @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler: instead.") var timeScope: GKLeaderboard.TimeScope @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler: instead.") @@ -76,10 +90,16 @@ extension GKLeaderboard { init(players: [GKPlayer]) @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") func loadScores(completionHandler: (([GKScore]?, Error?) -> Void)? = nil) + @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") + func loadScores() async throws -> [GKScore]? @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") class func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) + @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") + class func loadLeaderboards() async throws -> [GKLeaderboard]? } extension GKLeaderboard { @available(macOS 10.8, *) func loadImage(completionHandler: ((NSImage?, Error?) -> Void)? = nil) + @available(macOS 10.8, *) + func loadImage() async throws -> NSImage? } diff --git a/macOS/GameKit/GKLeaderboardSet.swift b/macOS/GameKit/GKLeaderboardSet.swift index 8f64b6b..5d54453 100644 --- a/macOS/GameKit/GKLeaderboardSet.swift +++ b/macOS/GameKit/GKLeaderboardSet.swift @@ -6,13 +6,18 @@ class GKLeaderboardSet : NSObject, NSCoding, NSSecureCoding { var identifier: String? @available(macOS 10.10, *) class func loadLeaderboardSets(completionHandler: (([GKLeaderboardSet]?, Error?) -> Void)? = nil) + @available(macOS 10.10, *) + class func loadLeaderboardSets() async throws -> [GKLeaderboardSet]? @available(macOS 11.0, *) func loadLeaderboards(handler: @escaping ([GKLeaderboard]?, Error?) -> Void) } extension GKLeaderboardSet { @available(macOS, introduced: 10.10, deprecated: 11.0, message: "Use loadLeaderboardsWithHandler: instead.") func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) + @available(macOS, introduced: 10.10, deprecated: 11.0, message: "Use loadLeaderboardsWithHandler: instead.") + func loadLeaderboards() async throws -> [GKLeaderboard]? } extension GKLeaderboardSet { func loadImage(completionHandler: ((NSImage?, Error?) -> Void)? = nil) + func loadImage() async throws -> NSImage? } diff --git a/macOS/GameKit/GKLeaderboardViewController.swift b/macOS/GameKit/GKLeaderboardViewController.swift index aea61cb..40c3882 100644 --- a/macOS/GameKit/GKLeaderboardViewController.swift +++ b/macOS/GameKit/GKLeaderboardViewController.swift @@ -9,5 +9,5 @@ extension GKLeaderboardViewController { } @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use GKGameCenterViewController instead") protocol GKLeaderboardViewControllerDelegate : NSObjectProtocol { - func leaderboardViewControllerDidFinish(_ viewController: GKLeaderboardViewController!) + @asyncHandler func leaderboardViewControllerDidFinish(_ viewController: GKLeaderboardViewController!) } diff --git a/macOS/GameKit/GKLocalPlayer.swift b/macOS/GameKit/GKLocalPlayer.swift index c38200b..eecba10 100644 --- a/macOS/GameKit/GKLocalPlayer.swift +++ b/macOS/GameKit/GKLocalPlayer.swift @@ -12,13 +12,22 @@ class GKLocalPlayer : GKPlayer { var isPersonalizedCommunicationRestricted: Bool { get } @available(macOS 10.11, *) func loadRecentPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + @available(macOS 10.11, *) + func loadRecentPlayers() async throws -> [GKPlayer]? func loadChallengableFriends(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + func loadChallengableFriends() async throws -> [GKPlayer]? @available(macOS 10.10, *) func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) + func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String) async throws + @available(macOS 10.10, *) func loadDefaultLeaderboardIdentifier(completionHandler: ((String?, Error?) -> Void)? = nil) + @available(macOS 10.10, *) + func loadDefaultLeaderboardIdentifier() async throws -> String? @available(macOS 10.15.5, *) func fetchItems(forIdentityVerificationSignature completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) + @available(macOS 10.15.5, *) + func fetchItemsForIdentityVerificationSignature() async throws -> (URL?, Data?, Data?, UInt64) } protocol GKLocalPlayerListener : GKChallengeListener, GKInviteEventListener, GKSavedGameListener, GKTurnBasedEventListener { } @@ -37,16 +46,26 @@ extension NSNotification.Name { extension GKLocalPlayer { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use setDefaultLeaderboardIdentifier:completionHandler: instead") func setDefaultLeaderboardCategoryID(_ categoryID: String?, completionHandler: ((Error?) -> Void)? = nil) + @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use setDefaultLeaderboardIdentifier:completionHandler: instead") + func setDefaultLeaderboardCategoryID(_ categoryID: String?) async throws @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use loadDefaultLeaderboardIdentifierWithCompletionHandler: instead") func loadDefaultLeaderboardCategoryID(completionHandler: ((String?, Error?) -> Void)? = nil) + @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use loadDefaultLeaderboardIdentifierWithCompletionHandler: instead") + func loadDefaultLeaderboardCategoryID() async throws -> String? @available(macOS, introduced: 10.10, deprecated: 10.11) func loadFriendPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + @available(macOS, introduced: 10.10, deprecated: 10.11) + func loadFriendPlayers() async throws -> [GKPlayer]? @available(macOS, introduced: 10.10, deprecated: 10.15.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") func generateIdentityVerificationSignature(completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) + @available(macOS, introduced: 10.10, deprecated: 10.15.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") + func generateIdentityVerificationSignature() async throws -> (URL?, Data?, Data?, UInt64) } extension GKLocalPlayer { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") func loadFriends(completionHandler: (([String]?, Error?) -> Void)? = nil) + @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") + func loadFriends() async throws -> [String]? @available(macOS, introduced: 10.8, deprecated: 10.10, message: " This property is obsolete, Use loadFriendPlayersWithCompletionHandler: instead") var friends: [String]? { get } } diff --git a/macOS/GameKit/GKMatch.swift b/macOS/GameKit/GKMatch.swift index f46119a..55bf16b 100644 --- a/macOS/GameKit/GKMatch.swift +++ b/macOS/GameKit/GKMatch.swift @@ -27,28 +27,34 @@ class GKMatch : NSObject { func voiceChat(withName name: String) -> GKVoiceChat? @available(macOS 10.10, *) func chooseBestHostingPlayer(completionHandler: @escaping (GKPlayer?) -> Void) + @available(macOS 10.10, *) + func chooseBestHostingPlayer() async -> GKPlayer? @available(macOS 10.9, *) func rematch(completionHandler: ((GKMatch?, Error?) -> Void)? = nil) + @available(macOS 10.9, *) + func rematch() async throws -> GKMatch? } protocol GKMatchDelegate : NSObjectProtocol { @available(macOS 10.10, *) - optional func match(_ match: GKMatch, didReceive data: Data, fromRemotePlayer player: GKPlayer) + @asyncHandler optional func match(_ match: GKMatch, didReceive data: Data, fromRemotePlayer player: GKPlayer) @available(macOS 10.11, *) - optional func match(_ match: GKMatch, didReceive data: Data, forRecipient recipient: GKPlayer, fromRemotePlayer player: GKPlayer) + @asyncHandler optional func match(_ match: GKMatch, didReceive data: Data, forRecipient recipient: GKPlayer, fromRemotePlayer player: GKPlayer) @available(macOS 10.8, *) - optional func match(_ match: GKMatch, player: GKPlayer, didChange state: GKPlayerConnectionState) + @asyncHandler optional func match(_ match: GKMatch, player: GKPlayer, didChange state: GKPlayerConnectionState) @available(macOS 10.8, *) - optional func match(_ match: GKMatch, didFailWithError error: Error?) + @asyncHandler optional func match(_ match: GKMatch, didFailWithError error: Error?) @available(macOS 10.10, *) optional func match(_ match: GKMatch, shouldReinviteDisconnectedPlayer player: GKPlayer) -> Bool @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use match:didReceiveData:fromRemotePlayer:") - optional func match(_ match: GKMatch, didReceive data: Data, fromPlayer playerID: String) + @asyncHandler optional func match(_ match: GKMatch, didReceive data: Data, fromPlayer playerID: String) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use shouldReinviteDisconnectedPlayer:") optional func match(_ match: GKMatch, shouldReinvitePlayer playerID: String) -> Bool } extension GKMatch { @available(macOS, introduced: 10.9, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use chooseBestHostingPlayerWithCompletionHandler:") func chooseBestHostPlayer(completionHandler: @escaping (String?) -> Void) + @available(macOS, introduced: 10.9, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use chooseBestHostingPlayerWithCompletionHandler:") + func chooseBestHostPlayer() async -> String? @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use sendData:toPlayers:dataMode:error:") func send(_ data: Data, toPlayers playerIDs: [String], with mode: GKMatch.SendDataMode) throws @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use players instead.") diff --git a/macOS/GameKit/GKMatchmaker.swift b/macOS/GameKit/GKMatchmaker.swift index 045c89a..215539a 100644 --- a/macOS/GameKit/GKMatchmaker.swift +++ b/macOS/GameKit/GKMatchmaker.swift @@ -60,26 +60,34 @@ class GKInvite : NSObject { } protocol GKInviteEventListener { @available(macOS 10.10, *) - optional func player(_ player: GKPlayer, didAccept invite: GKInvite) + @asyncHandler optional func player(_ player: GKPlayer, didAccept invite: GKInvite) @available(macOS 10.10, *) - optional func player(_ player: GKPlayer, didRequestMatchWithRecipients recipientPlayers: [GKPlayer]) + @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithRecipients recipientPlayers: [GKPlayer]) } @available(macOS 10.8, *) class GKMatchmaker : NSObject { class func shared() -> GKMatchmaker @available(macOS 10.9, *) func match(for invite: GKInvite, completionHandler: ((GKMatch?, Error?) -> Void)? = nil) + @available(macOS 10.9, *) + func match(for invite: GKInvite) async throws -> GKMatch? func findMatch(for request: GKMatchRequest, withCompletionHandler completionHandler: ((GKMatch?, Error?) -> Void)? = nil) + func findMatch(for request: GKMatchRequest) async throws -> GKMatch? @available(macOS 10.10, *) func findPlayers(forHostedRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + @available(macOS 10.10, *) + func findPlayers(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer]? func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest, completionHandler: ((Error?) -> Void)? = nil) + func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest) async throws func cancel() @available(macOS 10.10, *) func cancelPendingInvite(to player: GKPlayer) @available(macOS 10.9, *) func finishMatchmaking(for match: GKMatch) func queryPlayerGroupActivity(_ playerGroup: Int, withCompletionHandler completionHandler: ((Int, Error?) -> Void)? = nil) + func queryPlayerGroupActivity(_ playerGroup: Int) async throws -> Int func queryActivity(completionHandler: ((Int, Error?) -> Void)? = nil) + func queryActivity() async throws -> Int @available(macOS 10.10, *) func startBrowsingForNearbyPlayers(handler reachableHandler: ((GKPlayer, Bool) -> Void)? = nil) @available(macOS 10.9, *) @@ -96,4 +104,6 @@ extension GKMatchmaker { func cancelInvite(toPlayer playerID: String) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") func findPlayers(forHostedMatchRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) + @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") + func findPlayers(forHostedMatchRequest request: GKMatchRequest) async throws -> [String]? } diff --git a/macOS/GameKit/GKMatchmakerViewController.swift b/macOS/GameKit/GKMatchmakerViewController.swift index e8f0bb9..03e7fa8 100644 --- a/macOS/GameKit/GKMatchmakerViewController.swift +++ b/macOS/GameKit/GKMatchmakerViewController.swift @@ -29,15 +29,15 @@ protocol GKMatchmakerViewControllerDelegate : NSObjectProtocol { @available(macOS 10.8, *) func matchmakerViewControllerWasCancelled(_ viewController: GKMatchmakerViewController) @available(macOS 10.8, *) - func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFailWithError error: Error) + @asyncHandler func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFailWithError error: Error) @available(macOS 10.8, *) - optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFind match: GKMatch) + @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFind match: GKMatch) @available(macOS 10.10, *) - optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindHostedPlayers players: [GKPlayer]) + @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindHostedPlayers players: [GKPlayer]) @available(macOS 10.10, *) optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, hostedPlayerDidAccept player: GKPlayer) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use matchmakerViewController:didFindHostedPlayers:") - optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindPlayers playerIDs: [String]) + @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindPlayers playerIDs: [String]) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use matchmakerViewController:hostedPlayerDidAccept:") - optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didReceiveAcceptFromHostedPlayer playerID: String) + @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didReceiveAcceptFromHostedPlayer playerID: String) } diff --git a/macOS/GameKit/GKNotificationBanner.swift b/macOS/GameKit/GKNotificationBanner.swift index b96efe8..5372f83 100644 --- a/macOS/GameKit/GKNotificationBanner.swift +++ b/macOS/GameKit/GKNotificationBanner.swift @@ -4,5 +4,9 @@ class GKNotificationBanner : NSObject { @available(macOS 10.8, *) class func show(withTitle title: String?, message: String?, completionHandler: (() -> Void)? = nil) @available(macOS 10.8, *) + class func show(withTitle title: String?, message: String?) async + @available(macOS 10.8, *) class func show(withTitle title: String?, message: String?, duration: TimeInterval, completionHandler: (() -> Void)? = nil) + @available(macOS 10.8, *) + class func show(withTitle title: String?, message: String?, duration: TimeInterval) async } diff --git a/macOS/GameKit/GKPlayer.swift b/macOS/GameKit/GKPlayer.swift index 516b75f..514c3f9 100644 --- a/macOS/GameKit/GKPlayer.swift +++ b/macOS/GameKit/GKPlayer.swift @@ -4,6 +4,7 @@ let GKPlayerIDNoLongerAvailable: String @available(macOS 10.8, *) class GKPlayer : GKBasePlayer { class func loadPlayers(forIdentifiers identifiers: [String], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer]? @available(macOS 10.15, *) func scopedIDsArePersistent() -> Bool @available(macOS 10.14.6, *) @@ -21,6 +22,8 @@ class GKPlayer : GKBasePlayer { extension GKPlayer { @available(macOS 10.8, *) func loadPhoto(for size: GKPlayer.PhotoSize, withCompletionHandler completionHandler: ((NSImage?, Error?) -> Void)? = nil) + @available(macOS 10.8, *) + func loadPhoto(for size: GKPlayer.PhotoSize) async throws -> NSImage? } extension GKPlayer { enum PhotoSize : Int { diff --git a/macOS/GameKit/GKPublicProtocols.swift b/macOS/GameKit/GKPublicProtocols.swift index 19b2bd6..c55c95b 100644 --- a/macOS/GameKit/GKPublicProtocols.swift +++ b/macOS/GameKit/GKPublicProtocols.swift @@ -1,8 +1,8 @@ @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use MCSession in association with MCSessionDelegate from the MultipeerConnectivity framework instead") protocol GKSessionDelegate : NSObjectProtocol { - optional func session(_ session: GKSession, peer peerID: String, didChange state: GKPeerConnectionState) - optional func session(_ session: GKSession, didReceiveConnectionRequestFromPeer peerID: String) + @asyncHandler optional func session(_ session: GKSession, peer peerID: String, didChange state: GKPeerConnectionState) + @asyncHandler optional func session(_ session: GKSession, didReceiveConnectionRequestFromPeer peerID: String) optional func session(_ session: GKSession, connectionWithPeerFailed peerID: String, withError error: Error) - optional func session(_ session: GKSession, didFailWithError error: Error) + @asyncHandler optional func session(_ session: GKSession, didFailWithError error: Error) } diff --git a/macOS/GameKit/GKSavedGame.swift b/macOS/GameKit/GKSavedGame.swift index b3243a3..d9ec251 100644 --- a/macOS/GameKit/GKSavedGame.swift +++ b/macOS/GameKit/GKSavedGame.swift @@ -9,14 +9,24 @@ class GKSavedGame : NSObject, NSCopying { var modificationDate: Date? { get } @available(macOS 10.10, *) func loadData(completionHandler handler: ((Data?, Error?) -> Void)? = nil) + @available(macOS 10.10, *) + func loadData() async throws -> Data? } extension GKLocalPlayer : GKSavedGameListener { @available(macOS 10.10, *) func fetchSavedGames(completionHandler handler: (([GKSavedGame]?, Error?) -> Void)? = nil) @available(macOS 10.10, *) + func fetchSavedGames() async throws -> [GKSavedGame]? + @available(macOS 10.10, *) func saveGameData(_ data: Data, withName name: String, completionHandler handler: ((GKSavedGame?, Error?) -> Void)? = nil) @available(macOS 10.10, *) + func saveGameData(_ data: Data, withName name: String) async throws -> GKSavedGame? + @available(macOS 10.10, *) func deleteSavedGames(withName name: String, completionHandler handler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) + func deleteSavedGames(withName name: String) async throws + @available(macOS 10.10, *) func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data, completionHandler handler: (([GKSavedGame]?, Error?) -> Void)? = nil) + @available(macOS 10.10, *) + func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data) async throws -> [GKSavedGame]? } diff --git a/macOS/GameKit/GKSavedGameListener.swift b/macOS/GameKit/GKSavedGameListener.swift index 224ee0c..5ccbc5c 100644 --- a/macOS/GameKit/GKSavedGameListener.swift +++ b/macOS/GameKit/GKSavedGameListener.swift @@ -2,7 +2,7 @@ @available(macOS 10.10, *) protocol GKSavedGameListener : NSObjectProtocol { @available(macOS 10.10, *) - optional func player(_ player: GKPlayer, didModifySavedGame savedGame: GKSavedGame) + @asyncHandler optional func player(_ player: GKPlayer, didModifySavedGame savedGame: GKSavedGame) @available(macOS 10.10, *) optional func player(_ player: GKPlayer, hasConflictingSavedGames savedGames: [GKSavedGame]) } diff --git a/macOS/GameKit/GKScore.swift b/macOS/GameKit/GKScore.swift index 49bf53e..f39100b 100644 --- a/macOS/GameKit/GKScore.swift +++ b/macOS/GameKit/GKScore.swift @@ -18,10 +18,14 @@ class GKScore : NSObject, NSCoding, NSSecureCoding { var shouldSetDefaultLeaderboard: Bool @available(macOS 10.8, *) class func report(_ scores: [GKScore], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + @available(macOS 10.8, *) + class func report(_ scores: [GKScore]) async throws } extension GKScore { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use +reportScores:withCompletionhandler: instead") func report(completionHandler: ((Error?) -> Void)? = nil) + @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use +reportScores:withCompletionhandler: instead") + func report() async throws @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use initWithLeaderboardIdentifier: instead") init(category: String?) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use leaderboardIdentifier instead") diff --git a/macOS/GameKit/GKTurnBasedMatch.swift b/macOS/GameKit/GKTurnBasedMatch.swift index a11986f..9af52d6 100644 --- a/macOS/GameKit/GKTurnBasedMatch.swift +++ b/macOS/GameKit/GKTurnBasedMatch.swift @@ -52,9 +52,9 @@ extension GKTurnBasedParticipant { } protocol GKTurnBasedEventListener { @available(macOS 10.10, *) - optional func player(_ player: GKPlayer, didRequestMatchWithOtherPlayers playersToInvite: [GKPlayer]) + @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithOtherPlayers playersToInvite: [GKPlayer]) @available(macOS 10.10, *) - optional func player(_ player: GKPlayer, receivedTurnEventFor match: GKTurnBasedMatch, didBecomeActive: Bool) + @asyncHandler optional func player(_ player: GKPlayer, receivedTurnEventFor match: GKTurnBasedMatch, didBecomeActive: Bool) @available(macOS 10.8, *) optional func player(_ player: GKPlayer, matchEnded match: GKTurnBasedMatch) @available(macOS 10.10, *) @@ -94,35 +94,65 @@ class GKTurnBasedMatch : NSObject { @available(macOS 10.10, *) var exchangeMaxInitiatedExchangesPerPlayer: Int { get } class func find(for request: GKMatchRequest, withCompletionHandler completionHandler: @escaping (GKTurnBasedMatch?, Error?) -> Void) + class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch? class func loadMatches(completionHandler: (([GKTurnBasedMatch]?, Error?) -> Void)? = nil) + class func loadMatches() async throws -> [GKTurnBasedMatch]? @available(macOS 10.8, *) class func load(withID matchID: String, withCompletionHandler completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) + @available(macOS 10.8, *) + class func load(withID matchID: String) async throws -> GKTurnBasedMatch? @available(macOS 10.9, *) func rematch(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) + @available(macOS 10.9, *) + func rematch() async throws -> GKTurnBasedMatch? @available(macOS 10.8, *) func acceptInvite(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(macOS 10.8, *) + func acceptInvite() async throws -> GKTurnBasedMatch? + @available(macOS 10.8, *) func declineInvite(completionHandler: ((Error?) -> Void)? = nil) + @available(macOS 10.8, *) + func declineInvite() async throws func remove(completionHandler: ((Error?) -> Void)? = nil) + func remove() async throws func loadMatchData(completionHandler: ((Data?, Error?) -> Void)? = nil) + func loadMatchData() async throws -> Data? @available(macOS 10.9, *) func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.9, *) + func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + @available(macOS 10.9, *) func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) + @available(macOS 10.9, *) + func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome) async throws func endMatchInTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) + func endMatchInTurn(withMatch matchData: Data) async throws @available(macOS, introduced: 10.10, deprecated: 11.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?, completionHandler: ((Error?) -> Void)? = nil) + @available(macOS, introduced: 10.10, deprecated: 11.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") + func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws @available(macOS 11.0, *) func endMatchInTurn(withMatch matchData: Data, leaderboardScores scores: [GKLeaderboardScore], achievements: [Any], completionHandler: @escaping (Error?) -> Void) + @available(macOS 11.0, *) + func endMatchInTurn(withMatch matchData: Data, leaderboardScores scores: [GKLeaderboardScore], achievements: [Any]) async throws @available(macOS 10.8, *) func saveCurrentTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) + @available(macOS 10.8, *) + func saveCurrentTurn(withMatch matchData: Data) async throws @available(macOS 10.10, *) func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange], completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) + func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws + @available(macOS 10.10, *) func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval, completionHandler: ((GKTurnBasedExchange?, Error?) -> Void)? = nil) @available(macOS 10.10, *) + func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange? + @available(macOS 10.10, *) func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) + @available(macOS 10.10, *) + func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws } @available(macOS 10.10, *) enum GKTurnBasedExchangeStatus : Int8 { @@ -153,7 +183,11 @@ class GKTurnBasedExchange : NSObject { @available(macOS 10.10, *) func cancel(withLocalizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) + func cancel(withLocalizableMessageKey key: String, arguments: [String]) async throws + @available(macOS 10.10, *) func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data, completionHandler: ((Error?) -> Void)? = nil) + @available(macOS 10.10, *) + func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws } @available(macOS 10.10, *) class GKTurnBasedExchangeReply : NSObject { @@ -168,7 +202,7 @@ protocol GKTurnBasedEventHandlerDelegate { @available(macOS, introduced: 10.8, deprecated: 10.10) func handleInvite(fromGameCenter playersToInvite: [String]) @available(macOS, introduced: 10.9, deprecated: 10.10) - func handleTurnEvent(for match: GKTurnBasedMatch, didBecomeActive: Bool) + @asyncHandler func handleTurnEvent(for match: GKTurnBasedMatch, didBecomeActive: Bool) @available(macOS, introduced: 10.8, deprecated: 10.10) optional func handleMatchEnded(_ match: GKTurnBasedMatch) } diff --git a/macOS/GameKit/GKTurnBasedMatchmakerViewController.swift b/macOS/GameKit/GKTurnBasedMatchmakerViewController.swift index e4f6d01..670dafe 100644 --- a/macOS/GameKit/GKTurnBasedMatchmakerViewController.swift +++ b/macOS/GameKit/GKTurnBasedMatchmakerViewController.swift @@ -11,9 +11,9 @@ protocol GKTurnBasedMatchmakerViewControllerDelegate : NSObjectProtocol { @available(macOS 10.8, *) func turnBasedMatchmakerViewControllerWasCancelled(_ viewController: GKTurnBasedMatchmakerViewController) @available(macOS 10.8, *) - func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFailWithError error: Error) + @asyncHandler func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFailWithError error: Error) @available(macOS, introduced: 10.8, deprecated: 10.11, message: "use GKTurnBasedEventListener player:receivedTurnEventForMatch:didBecomeActive:") - optional func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFind match: GKTurnBasedMatch) + @asyncHandler optional func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFind match: GKTurnBasedMatch) @available(macOS, introduced: 10.8, deprecated: 10.11, message: "use GKTurnBasedEventListener player:wantsToQuitMatch:") optional func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, playerQuitFor match: GKTurnBasedMatch) } diff --git a/macOS/GameplayKit/GKAgent.swift b/macOS/GameplayKit/GKAgent.swift index e284afd..a0bf8ef 100644 --- a/macOS/GameplayKit/GKAgent.swift +++ b/macOS/GameplayKit/GKAgent.swift @@ -3,7 +3,7 @@ protocol GKAgentDelegate : NSObjectProtocol { @available(macOS 10.11, *) optional func agentWillUpdate(_ agent: GKAgent) @available(macOS 10.11, *) - optional func agentDidUpdate(_ agent: GKAgent) + @asyncHandler optional func agentDidUpdate(_ agent: GKAgent) } @available(macOS 10.11, *) class GKAgent : GKComponent, NSSecureCoding { diff --git a/macOS/IMServicePlugIn/IMServicePlugInChatRoomSupport.swift b/macOS/IMServicePlugIn/IMServicePlugInChatRoomSupport.swift index fe5331b..2e39da6 100644 --- a/macOS/IMServicePlugIn/IMServicePlugInChatRoomSupport.swift +++ b/macOS/IMServicePlugIn/IMServicePlugInChatRoomSupport.swift @@ -13,19 +13,19 @@ protocol IMServicePlugInChatRoomSupport { } protocol IMServiceApplicationChatRoomSupport : IMServiceApplication { @available(macOS, introduced: 10.7, deprecated: 10.13) - func plugInDidReceiveInvitation(_ invitation: IMServicePlugInMessage!, forChatRoom roomName: String!, fromHandle handle: String!) + @asyncHandler func plugInDidReceiveInvitation(_ invitation: IMServicePlugInMessage!, forChatRoom roomName: String!, fromHandle handle: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - func plugInDidReceive(_ message: IMServicePlugInMessage!, forChatRoom roomName: String!, fromHandle handle: String!) + @asyncHandler func plugInDidReceive(_ message: IMServicePlugInMessage!, forChatRoom roomName: String!, fromHandle handle: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - func plugInDidReceiveNotice(_ notice: String!, forChatRoom roomName: String!) + @asyncHandler func plugInDidReceiveNotice(_ notice: String!, forChatRoom roomName: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - func plugInDidSend(_ message: IMServicePlugInMessage!, toChatRoom roomName: String!, error: Error!) + @asyncHandler func plugInDidSend(_ message: IMServicePlugInMessage!, toChatRoom roomName: String!, error: Error!) @available(macOS, introduced: 10.7, deprecated: 10.13) - func plugInDidJoinChatRoom(_ roomName: String!) + @asyncHandler func plugInDidJoinChatRoom(_ roomName: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - func plugInDidLeaveChatRoom(_ roomName: String!, error: Error!) + @asyncHandler func plugInDidLeaveChatRoom(_ roomName: String!, error: Error!) @available(macOS, introduced: 10.7, deprecated: 10.13) - func handles(_ handles: [Any]!, didJoinChatRoom roomName: String!) + @asyncHandler func handles(_ handles: [Any]!, didJoinChatRoom roomName: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - func handles(_ handles: [Any]!, didLeaveChatRoom roomName: String!) + @asyncHandler func handles(_ handles: [Any]!, didLeaveChatRoom roomName: String!) } diff --git a/macOS/IMServicePlugIn/IMServicePlugInFileTransferSessionSupport.swift b/macOS/IMServicePlugIn/IMServicePlugInFileTransferSessionSupport.swift index 9c2bd57..030e648 100644 --- a/macOS/IMServicePlugIn/IMServicePlugInFileTransferSessionSupport.swift +++ b/macOS/IMServicePlugIn/IMServicePlugInFileTransferSessionSupport.swift @@ -9,9 +9,9 @@ protocol IMServicePlugInFileTransferSessionSupport { } protocol IMServiceApplicationFileTransferSessionSupport : IMServiceApplication { @available(macOS, introduced: 10.7, deprecated: 10.13) - func plugInDidReceive(_ session: IMServicePlugInIncomingFileTransferSession!, fromHandle handle: String!) + @asyncHandler func plugInDidReceive(_ session: IMServicePlugInIncomingFileTransferSession!, fromHandle handle: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - func plugInDidAccept(_ session: IMServicePlugInOutgoingFileTransferSession!) + @asyncHandler func plugInDidAccept(_ session: IMServicePlugInOutgoingFileTransferSession!) @available(macOS, introduced: 10.7, deprecated: 10.13) - func plugInDidFinish(_ session: IMServicePlugInFileTransferSession!, error: Error!) + @asyncHandler func plugInDidFinish(_ session: IMServicePlugInFileTransferSession!, error: Error!) } diff --git a/macOS/IMServicePlugIn/IMServicePlugInGroupListSupport.swift b/macOS/IMServicePlugIn/IMServicePlugInGroupListSupport.swift index ee58a69..bb3bb98 100644 --- a/macOS/IMServicePlugIn/IMServicePlugInGroupListSupport.swift +++ b/macOS/IMServicePlugIn/IMServicePlugInGroupListSupport.swift @@ -34,9 +34,9 @@ protocol IMServicePlugInGroupListHandlePictureSupport : NSObjectProtocol { } protocol IMServiceApplicationGroupListSupport : IMServiceApplication { @available(macOS, introduced: 10.7, deprecated: 10.13) - func plugInDidUpdateGroupList(_ groups: [Any]!, error: Error!) + @asyncHandler func plugInDidUpdateGroupList(_ groups: [Any]!, error: Error!) } protocol IMServiceApplicationGroupListAuthorizationSupport : IMServiceApplicationGroupListSupport { @available(macOS, introduced: 10.7, deprecated: 10.13) - func plugInDidReceiveAuthorizationRequest(fromHandle handle: String!) + @asyncHandler func plugInDidReceiveAuthorizationRequest(fromHandle handle: String!) } diff --git a/macOS/IMServicePlugIn/IMServicePlugInInstantMessageSupport.swift b/macOS/IMServicePlugIn/IMServicePlugInInstantMessageSupport.swift index 7237cea..05a1930 100644 --- a/macOS/IMServicePlugIn/IMServicePlugInInstantMessageSupport.swift +++ b/macOS/IMServicePlugIn/IMServicePlugInInstantMessageSupport.swift @@ -1,19 +1,19 @@ protocol IMServicePlugInInstantMessagingSupport { @available(macOS, introduced: 10.7, deprecated: 10.13) - func userDidStartTyping(toHandle handle: String!) + @asyncHandler func userDidStartTyping(toHandle handle: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - func userDidStopTyping(toHandle handle: String!) + @asyncHandler func userDidStopTyping(toHandle handle: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) func send(_ message: IMServicePlugInMessage!, toHandle handle: String!) } protocol IMServiceApplicationInstantMessagingSupport { @available(macOS, introduced: 10.7, deprecated: 10.13) - func handleDidStartTyping(_ handle: String!) + @asyncHandler func handleDidStartTyping(_ handle: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - func handleDidStopTyping(_ handle: String!) + @asyncHandler func handleDidStopTyping(_ handle: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - func plugInDidReceive(_ message: IMServicePlugInMessage!, fromHandle handle: String!) + @asyncHandler func plugInDidReceive(_ message: IMServicePlugInMessage!, fromHandle handle: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - func plugInDidSend(_ message: IMServicePlugInMessage!, toHandle handle: String!, error: Error!) + @asyncHandler func plugInDidSend(_ message: IMServicePlugInMessage!, toHandle handle: String!, error: Error!) } diff --git a/macOS/IMServicePlugIn/IMServicePlugInProtocols.swift b/macOS/IMServicePlugIn/IMServicePlugInProtocols.swift index b963b75..986442c 100644 --- a/macOS/IMServicePlugIn/IMServicePlugInProtocols.swift +++ b/macOS/IMServicePlugIn/IMServicePlugInProtocols.swift @@ -11,11 +11,11 @@ protocol IMServicePlugIn : NSObjectProtocol { } protocol IMServiceApplication : NSObjectProtocol { @available(macOS, introduced: 10.7, deprecated: 10.13) - func plugInDidLogIn() + @asyncHandler func plugInDidLogIn() @available(macOS, introduced: 10.7, deprecated: 10.13) - func plugInDidLogOutWithError(_ error: Error!, reconnect: Bool) + @asyncHandler func plugInDidLogOutWithError(_ error: Error!, reconnect: Bool) @available(macOS, introduced: 10.7, deprecated: 10.13) - func plugInDidFailToAuthenticate() + @asyncHandler func plugInDidFailToAuthenticate() @available(macOS, introduced: 10.7, deprecated: 10.13) - func plugInDidUpdateProperties(_ changes: [AnyHashable : Any]!, ofHandle handle: String!) + @asyncHandler func plugInDidUpdateProperties(_ changes: [AnyHashable : Any]!, ofHandle handle: String!) } diff --git a/macOS/IOUSBHost/IOUSBHostObject.swift b/macOS/IOUSBHost/IOUSBHostObject.swift index 4dc18be..e7e8338 100644 --- a/macOS/IOUSBHost/IOUSBHostObject.swift +++ b/macOS/IOUSBHost/IOUSBHostObject.swift @@ -6,6 +6,7 @@ class IOUSBHostObject : NSObject { var queue: DispatchQueue { get } func __send(_ request: IOUSBDeviceRequest, data: NSMutableData?, bytesTransferred: UnsafeMutablePointer?, completionTimeout: TimeInterval) throws func __enqueue(_ request: IOUSBDeviceRequest, data: NSMutableData?, completionTimeout: TimeInterval, completionHandler: IOUSBHostCompletionHandler? = nil) throws + func __enqueue(_ request: IOUSBDeviceRequest, data: NSMutableData?, completionTimeout: TimeInterval) async throws -> (IOReturn, Int) func __abortDeviceRequests(with option: IOUSBHostAbortOption) throws func __descriptor(with type: tIOUSBDescriptorType, length: UnsafeMutablePointer, index: Int, languageID: Int, requestType: tIOUSBDeviceRequestTypeValue, requestRecipient: tIOUSBDeviceRequestRecipientValue) throws -> UnsafePointer func __string(with index: Int, languageID: Int) throws -> String diff --git a/macOS/IOUSBHost/IOUSBHostPipe.swift b/macOS/IOUSBHost/IOUSBHostPipe.swift index e31cb75..3116484 100644 --- a/macOS/IOUSBHost/IOUSBHostPipe.swift +++ b/macOS/IOUSBHost/IOUSBHostPipe.swift @@ -8,11 +8,14 @@ class IOUSBHostPipe : IOUSBHostIOSource { func clearStall() throws func __sendControlRequest(_ request: IOUSBDeviceRequest, data: NSMutableData?, bytesTransferred: UnsafeMutablePointer?, completionTimeout: TimeInterval) throws func __enqueueControlRequest(_ request: IOUSBDeviceRequest, data: NSMutableData?, completionTimeout: TimeInterval, completionHandler: IOUSBHostCompletionHandler? = nil) throws + func __enqueueControlRequest(_ request: IOUSBDeviceRequest, data: NSMutableData?, completionTimeout: TimeInterval) async throws -> (IOReturn, Int) func __abort(with option: IOUSBHostAbortOption) throws func __sendIORequest(with data: NSMutableData?, bytesTransferred: UnsafeMutablePointer?, completionTimeout: TimeInterval) throws func enqueueIORequest(with data: NSMutableData?, completionTimeout: TimeInterval, completionHandler: IOUSBHostCompletionHandler? = nil) throws + func enqueueIORequest(with data: NSMutableData?, completionTimeout: TimeInterval) async throws -> (IOReturn, Int) func sendIORequest(with data: NSMutableData, frameList: UnsafeMutablePointer, frameListCount: Int, firstFrameNumber: UInt64) throws func enqueueIORequest(with data: NSMutableData, frameList: UnsafeMutablePointer, frameListCount: Int, firstFrameNumber: UInt64, completionHandler: IOUSBHostIsochronousCompletionHandler? = nil) throws + func enqueueIORequest(with data: NSMutableData, frameList: UnsafeMutablePointer, frameListCount: Int, firstFrameNumber: UInt64) async throws -> (IOReturn, UnsafeMutablePointer) func enableStreams() throws func disableStreams() throws func copyStream(withStreamID streamID: Int) throws -> IOUSBHostStream diff --git a/macOS/IOUSBHost/IOUSBHostStream.swift b/macOS/IOUSBHost/IOUSBHostStream.swift index 5284db4..2411f53 100644 --- a/macOS/IOUSBHost/IOUSBHostStream.swift +++ b/macOS/IOUSBHost/IOUSBHostStream.swift @@ -6,4 +6,5 @@ class IOUSBHostStream : IOUSBHostIOSource { func abort() throws func __sendIORequest(with data: NSMutableData?, bytesTransferred: UnsafeMutablePointer?) throws func enqueueIORequest(with data: NSMutableData?, completionHandler: IOUSBHostCompletionHandler? = nil) throws + func enqueueIORequest(with data: NSMutableData?) async throws -> (IOReturn, Int) } diff --git a/macOS/ImageCaptureCore/ICCameraDevice.swift b/macOS/ImageCaptureCore/ICCameraDevice.swift index 6820ac3..0e5d9cd 100644 --- a/macOS/ImageCaptureCore/ICCameraDevice.swift +++ b/macOS/ImageCaptureCore/ICCameraDevice.swift @@ -116,46 +116,48 @@ class ICCameraDevice : ICDevice { func requestSendPTPCommand(_ command: Data, outData data: Data?, sendCommandDelegate: Any, didSendCommand selector: Selector, contextInfo: UnsafeMutableRawPointer?) @available(macOS 10.15, *) func requestSendPTPCommand(_ ptpCommand: Data, outData ptpData: Data?, completion: @escaping (Data, Data, Error?) -> Void) + @available(macOS 10.15, *) + func requestSendPTPCommand(_ ptpCommand: Data, outData ptpData: Data?) async throws -> (Data, Data) } protocol ICCameraDeviceDelegate : ICDeviceDelegate { @available(macOS 10.4, *) - func cameraDevice(_ camera: ICCameraDevice, didAdd items: [ICCameraItem]) + @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didAdd items: [ICCameraItem]) @available(macOS 10.4, *) - func cameraDevice(_ camera: ICCameraDevice, didRemove items: [ICCameraItem]) + @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didRemove items: [ICCameraItem]) @available(macOS 10.15, *) - func cameraDevice(_ camera: ICCameraDevice, didReceiveThumbnail thumbnail: CGImage?, for item: ICCameraItem, error: Error?) + @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didReceiveThumbnail thumbnail: CGImage?, for item: ICCameraItem, error: Error?) @available(macOS 10.15, *) - func cameraDevice(_ camera: ICCameraDevice, didReceiveMetadata metadata: [AnyHashable : Any]?, for item: ICCameraItem, error: Error?) + @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didReceiveMetadata metadata: [AnyHashable : Any]?, for item: ICCameraItem, error: Error?) @available(macOS 10.4, *) - func cameraDevice(_ camera: ICCameraDevice, didRenameItems items: [ICCameraItem]) + @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didRenameItems items: [ICCameraItem]) @available(macOS 10.4, *) - func cameraDeviceDidChangeCapability(_ camera: ICCameraDevice) + @asyncHandler func cameraDeviceDidChangeCapability(_ camera: ICCameraDevice) @available(macOS 10.4, *) - func cameraDevice(_ camera: ICCameraDevice, didReceivePTPEvent eventData: Data) + @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didReceivePTPEvent eventData: Data) @available(macOS 10.4, *) - func deviceDidBecomeReady(withCompleteContentCatalog device: ICCameraDevice) + @asyncHandler func deviceDidBecomeReady(withCompleteContentCatalog device: ICCameraDevice) @available(macOS 10.4, *) - func cameraDeviceDidRemoveAccessRestriction(_ device: ICDevice) + @asyncHandler func cameraDeviceDidRemoveAccessRestriction(_ device: ICDevice) @available(macOS 10.4, *) - func cameraDeviceDidEnableAccessRestriction(_ device: ICDevice) + @asyncHandler func cameraDeviceDidEnableAccessRestriction(_ device: ICDevice) @available(macOS 10.4, *) optional func cameraDevice(_ cameraDevice: ICCameraDevice, shouldGetThumbnailOf item: ICCameraItem) -> Bool @available(macOS 10.4, *) optional func cameraDevice(_ cameraDevice: ICCameraDevice, shouldGetMetadataOf item: ICCameraItem) -> Bool @available(macOS 10.4, *) - optional func cameraDevice(_ camera: ICCameraDevice, didCompleteDeleteFilesWithError error: Error?) + @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didCompleteDeleteFilesWithError error: Error?) @available(macOS, introduced: 10.4, deprecated: 10.15) - optional func cameraDevice(_ camera: ICCameraDevice, didAdd item: ICCameraItem) + @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didAdd item: ICCameraItem) @available(macOS, introduced: 10.4, deprecated: 10.15) - optional func cameraDevice(_ camera: ICCameraDevice, didRemove item: ICCameraItem) + @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didRemove item: ICCameraItem) @available(macOS, introduced: 10.4, deprecated: 10.15) - optional func cameraDevice(_ camera: ICCameraDevice, didReceiveThumbnailFor item: ICCameraItem) + @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didReceiveThumbnailFor item: ICCameraItem) @available(macOS, introduced: 10.4, deprecated: 10.15) - optional func cameraDevice(_ camera: ICCameraDevice, didReceiveMetadataFor item: ICCameraItem) + @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didReceiveMetadataFor item: ICCameraItem) } protocol ICCameraDeviceDownloadDelegate : NSObjectProtocol { @available(macOS 10.4, *) optional func didDownloadFile(_ file: ICCameraFile, error: Error?, options: [String : Any] = [:], contextInfo: UnsafeMutableRawPointer?) @available(macOS 10.4, *) - optional func didReceiveDownloadProgress(for file: ICCameraFile, downloadedBytes: off_t, maxBytes: off_t) + @asyncHandler optional func didReceiveDownloadProgress(for file: ICCameraFile, downloadedBytes: off_t, maxBytes: off_t) } diff --git a/macOS/ImageCaptureCore/ICCameraFile.swift b/macOS/ImageCaptureCore/ICCameraFile.swift index 85dc5c3..e4a0324 100644 --- a/macOS/ImageCaptureCore/ICCameraFile.swift +++ b/macOS/ImageCaptureCore/ICCameraFile.swift @@ -50,9 +50,15 @@ class ICCameraFile : ICCameraItem { @available(macOS 10.15, *) func requestThumbnailData(options: [ICCameraItemThumbnailOption : Any]? = nil, completion: @escaping (Data?, Error?) -> Void) @available(macOS 10.15, *) + func requestThumbnailData(options: [ICCameraItemThumbnailOption : Any]? = nil) async throws -> Data? + @available(macOS 10.15, *) func requestMetadataDictionary(options: [ICCameraItemMetadataOption : Any]? = nil, completion: @escaping ([AnyHashable : Any]?, Error?) -> Void) @available(macOS 10.15, *) + func requestMetadataDictionary(options: [ICCameraItemMetadataOption : Any]? = nil) async throws -> [AnyHashable : Any]? + @available(macOS 10.15, *) func requestDownload(options: [ICDownloadOption : Any]? = nil, completion: @escaping (String?, Error?) -> Void) -> Progress? @available(macOS 10.15, *) func requestReadData(atOffset offset: off_t, length: off_t, completion: @escaping (Data?, Error?) -> Void) + @available(macOS 10.15, *) + func requestReadData(atOffset offset: off_t, length: off_t) async throws -> Data? } diff --git a/macOS/ImageCaptureCore/ICDevice.swift b/macOS/ImageCaptureCore/ICDevice.swift index 4713f7f..8b99ea2 100644 --- a/macOS/ImageCaptureCore/ICDevice.swift +++ b/macOS/ImageCaptureCore/ICDevice.swift @@ -144,9 +144,15 @@ class ICDevice : NSObject { @available(macOS 10.15, *) func requestOpenSession(options: [ICSessionOptions : Any]? = nil, completion: @escaping (Error?) -> Void) @available(macOS 10.15, *) + func requestOpenSession(options: [ICSessionOptions : Any]? = nil) async throws + @available(macOS 10.15, *) func requestCloseSession(options: [ICSessionOptions : Any]? = nil, completion: @escaping (Error?) -> Void) @available(macOS 10.15, *) + func requestCloseSession(options: [ICSessionOptions : Any]? = nil) async throws + @available(macOS 10.15, *) func requestEject(completion: @escaping (Error?) -> Void) + @available(macOS 10.15, *) + func requestEject() async throws @available(macOS 10.4, *) var autolaunchApplicationPath: String? @available(macOS 10.4, *) @@ -164,21 +170,21 @@ class ICDevice : NSObject { } protocol ICDeviceDelegate : NSObjectProtocol { @available(macOS 10.4, *) - func device(_ device: ICDevice, didCloseSessionWithError error: Error?) + @asyncHandler func device(_ device: ICDevice, didCloseSessionWithError error: Error?) @available(macOS 10.4, *) - func didRemove(_ device: ICDevice) + @asyncHandler func didRemove(_ device: ICDevice) @available(macOS 10.4, *) - func device(_ device: ICDevice, didOpenSessionWithError error: Error?) + @asyncHandler func device(_ device: ICDevice, didOpenSessionWithError error: Error?) @available(macOS 10.4, *) - optional func deviceDidBecomeReady(_ device: ICDevice) + @asyncHandler optional func deviceDidBecomeReady(_ device: ICDevice) @available(macOS 10.4, *) - optional func deviceDidChangeName(_ device: ICDevice) + @asyncHandler optional func deviceDidChangeName(_ device: ICDevice) @available(macOS 10.4, *) - optional func device(_ device: ICDevice, didReceiveStatusInformation status: [ICDeviceStatus : Any]) + @asyncHandler optional func device(_ device: ICDevice, didReceiveStatusInformation status: [ICDeviceStatus : Any]) @available(macOS 10.4, *) - optional func device(_ device: ICDevice, didEncounterError error: Error?) + @asyncHandler optional func device(_ device: ICDevice, didEncounterError error: Error?) @available(macOS 10.4, *) - optional func device(_ device: ICDevice, didEjectWithError error: Error?) + @asyncHandler optional func device(_ device: ICDevice, didEjectWithError error: Error?) @available(macOS, introduced: 10.4, deprecated: 10.15, message: "Device sharing is no longer available") - optional func deviceDidChangeSharingState(_ device: ICDevice) + @asyncHandler optional func deviceDidChangeSharingState(_ device: ICDevice) } diff --git a/macOS/ImageCaptureCore/ICDeviceBrowser.swift b/macOS/ImageCaptureCore/ICDeviceBrowser.swift index 98370e9..aa5016f 100644 --- a/macOS/ImageCaptureCore/ICDeviceBrowser.swift +++ b/macOS/ImageCaptureCore/ICDeviceBrowser.swift @@ -9,9 +9,9 @@ extension ICAuthorizationStatus { } protocol ICDeviceBrowserDelegate : NSObjectProtocol { @available(macOS 10.4, *) - func deviceBrowser(_ browser: ICDeviceBrowser, didAdd device: ICDevice, moreComing: Bool) + @asyncHandler func deviceBrowser(_ browser: ICDeviceBrowser, didAdd device: ICDevice, moreComing: Bool) @available(macOS 10.4, *) - func deviceBrowser(_ browser: ICDeviceBrowser, didRemove device: ICDevice, moreGoing: Bool) + @asyncHandler func deviceBrowser(_ browser: ICDeviceBrowser, didRemove device: ICDevice, moreGoing: Bool) @available(macOS 10.4, *) optional func deviceBrowser(_ browser: ICDeviceBrowser, deviceDidChangeName device: ICDevice) @available(macOS, introduced: 10.4, deprecated: 10.13, message: "deviceDidChangeSharingState will no longer be called") @@ -19,7 +19,7 @@ protocol ICDeviceBrowserDelegate : NSObjectProtocol { @available(macOS 10.4, *) optional func deviceBrowser(_ browser: ICDeviceBrowser, requestsSelect device: ICDevice) @available(macOS 10.4, *) - optional func deviceBrowserDidEnumerateLocalDevices(_ browser: ICDeviceBrowser) + @asyncHandler optional func deviceBrowserDidEnumerateLocalDevices(_ browser: ICDeviceBrowser) } @available(macOS 10.4, *) class ICDeviceBrowser : NSObject { diff --git a/macOS/ImageCaptureCore/ICScannerDevice.swift b/macOS/ImageCaptureCore/ICScannerDevice.swift index 67578f1..f5c1b72 100644 --- a/macOS/ImageCaptureCore/ICScannerDevice.swift +++ b/macOS/ImageCaptureCore/ICScannerDevice.swift @@ -27,17 +27,17 @@ enum ICScannerTransferMode : UInt { @available(macOS 10.4, *) protocol ICScannerDeviceDelegate : ICDeviceDelegate { @available(macOS 10.4, *) - optional func scannerDeviceDidBecomeAvailable(_ scanner: ICScannerDevice) + @asyncHandler optional func scannerDeviceDidBecomeAvailable(_ scanner: ICScannerDevice) @available(macOS 10.4, *) - optional func scannerDevice(_ scanner: ICScannerDevice, didSelect functionalUnit: ICScannerFunctionalUnit, error: Error?) + @asyncHandler optional func scannerDevice(_ scanner: ICScannerDevice, didSelect functionalUnit: ICScannerFunctionalUnit, error: Error?) @available(macOS 10.7, *) - optional func scannerDevice(_ scanner: ICScannerDevice, didScanTo url: URL) + @asyncHandler optional func scannerDevice(_ scanner: ICScannerDevice, didScanTo url: URL) @available(macOS 10.7, *) - optional func scannerDevice(_ scanner: ICScannerDevice, didScanTo data: ICScannerBandData) + @asyncHandler optional func scannerDevice(_ scanner: ICScannerDevice, didScanTo data: ICScannerBandData) @available(macOS 10.4, *) - optional func scannerDevice(_ scanner: ICScannerDevice, didCompleteOverviewScanWithError error: Error?) + @asyncHandler optional func scannerDevice(_ scanner: ICScannerDevice, didCompleteOverviewScanWithError error: Error?) @available(macOS 10.4, *) - optional func scannerDevice(_ scanner: ICScannerDevice, didCompleteScanWithError error: Error?) + @asyncHandler optional func scannerDevice(_ scanner: ICScannerDevice, didCompleteScanWithError error: Error?) } @available(macOS 10.4, *) class ICScannerDevice : ICDevice { diff --git a/macOS/Intents/INInteraction.swift b/macOS/Intents/INInteraction.swift index 6f575eb..49f996d 100644 --- a/macOS/Intents/INInteraction.swift +++ b/macOS/Intents/INInteraction.swift @@ -23,9 +23,13 @@ enum INInteractionDirection : Int { class INInteraction : NSObject, NSSecureCoding, NSCopying { init(intent: INIntent, response: INIntentResponse?) func donate(completion: ((Error?) -> Void)? = nil) + func donate() async throws class func deleteAll(completion: ((Error?) -> Void)? = nil) + class func deleteAll() async throws class func delete(with identifiers: [String], completion: ((Error?) -> Void)? = nil) + class func delete(with identifiers: [String]) async throws class func delete(with groupIdentifier: String, completion: ((Error?) -> Void)? = nil) + class func delete(with groupIdentifier: String) async throws @NSCopying var intent: INIntent { get } @NSCopying var intentResponse: INIntentResponse? { get } var intentHandlingStatus: INIntentHandlingStatus { get } diff --git a/macOS/LinkPresentation/LPMetadataProvider.swift b/macOS/LinkPresentation/LPMetadataProvider.swift index ef6738c..19e479b 100644 --- a/macOS/LinkPresentation/LPMetadataProvider.swift +++ b/macOS/LinkPresentation/LPMetadataProvider.swift @@ -2,6 +2,7 @@ @available(macOS 10.15, *) class LPMetadataProvider : NSObject { func startFetchingMetadata(for URL: URL, completionHandler: @escaping (LPLinkMetadata?, Error?) -> Void) + func startFetchingMetadata(for URL: URL) async throws -> LPLinkMetadata? func cancel() var shouldFetchSubresources: Bool var timeout: TimeInterval diff --git a/macOS/MapKit/MKDirections.swift b/macOS/MapKit/MKDirections.swift index 1425b2f..704d4b7 100644 --- a/macOS/MapKit/MKDirections.swift +++ b/macOS/MapKit/MKDirections.swift @@ -7,7 +7,9 @@ extension MKDirections { class MKDirections : NSObject { init(request: MKDirections.Request) func calculate(completionHandler: @escaping MKDirections.DirectionsHandler) + func calculate() async throws -> MKDirections.Response? func calculateETA(completionHandler: @escaping MKDirections.ETAHandler) + func calculateETA() async throws -> MKDirections.ETAResponse? func cancel() var isCalculating: Bool { get } } diff --git a/macOS/MapKit/MKLocalSearch.swift b/macOS/MapKit/MKLocalSearch.swift index 3143870..6af85a2 100644 --- a/macOS/MapKit/MKLocalSearch.swift +++ b/macOS/MapKit/MKLocalSearch.swift @@ -8,6 +8,7 @@ class MKLocalSearch : NSObject { @available(macOS 11.0, *) init(request: MKLocalPointsOfInterestRequest) func start(completionHandler: @escaping MKLocalSearch.CompletionHandler) + func start() async throws -> MKLocalSearch.Response? func cancel() var isSearching: Bool { get } } diff --git a/macOS/MapKit/MKLocalSearchCompleter.swift b/macOS/MapKit/MKLocalSearchCompleter.swift index 0b422e5..4e2997e 100644 --- a/macOS/MapKit/MKLocalSearchCompleter.swift +++ b/macOS/MapKit/MKLocalSearchCompleter.swift @@ -33,8 +33,8 @@ class MKLocalSearchCompleter : NSObject { } @available(macOS 10.11.4, *) protocol MKLocalSearchCompleterDelegate : NSObjectProtocol { - optional func completerDidUpdateResults(_ completer: MKLocalSearchCompleter) - optional func completer(_ completer: MKLocalSearchCompleter, didFailWithError error: Error) + @asyncHandler optional func completerDidUpdateResults(_ completer: MKLocalSearchCompleter) + @asyncHandler optional func completer(_ completer: MKLocalSearchCompleter, didFailWithError error: Error) } @available(macOS 10.11.4, *) class MKLocalSearchCompletion : NSObject { diff --git a/macOS/MapKit/MKMapSnapshotter.swift b/macOS/MapKit/MKMapSnapshotter.swift index a69adf0..f144d89 100644 --- a/macOS/MapKit/MKMapSnapshotter.swift +++ b/macOS/MapKit/MKMapSnapshotter.swift @@ -6,7 +6,9 @@ extension MKMapSnapshotter { class MKMapSnapshotter : NSObject { init(options: MKMapSnapshotter.Options) func start(completionHandler: @escaping MKMapSnapshotter.CompletionHandler) + func start() async throws -> MKMapSnapshotter.Snapshot? func start(with queue: DispatchQueue, completionHandler: @escaping MKMapSnapshotter.CompletionHandler) + func start(with queue: DispatchQueue) async throws -> MKMapSnapshotter.Snapshot? func cancel() var isLoading: Bool { get } } diff --git a/macOS/MapKit/MKMapView.swift b/macOS/MapKit/MKMapView.swift index e6e8079..7ceef78 100644 --- a/macOS/MapKit/MKMapView.swift +++ b/macOS/MapKit/MKMapView.swift @@ -134,41 +134,41 @@ protocol MKMapViewDelegate : NSObjectProtocol { @available(macOS 10.9, *) optional func mapView(_ mapView: MKMapView, regionDidChangeAnimated animated: Bool) @available(macOS 10.13, *) - optional func mapViewDidChangeVisibleRegion(_ mapView: MKMapView) + @asyncHandler optional func mapViewDidChangeVisibleRegion(_ mapView: MKMapView) @available(macOS 10.9, *) optional func mapViewWillStartLoadingMap(_ mapView: MKMapView) @available(macOS 10.9, *) - optional func mapViewDidFinishLoadingMap(_ mapView: MKMapView) + @asyncHandler optional func mapViewDidFinishLoadingMap(_ mapView: MKMapView) @available(macOS 10.9, *) - optional func mapViewDidFailLoadingMap(_ mapView: MKMapView, withError error: Error) + @asyncHandler optional func mapViewDidFailLoadingMap(_ mapView: MKMapView, withError error: Error) @available(macOS 10.9, *) optional func mapViewWillStartRenderingMap(_ mapView: MKMapView) @available(macOS 10.9, *) - optional func mapViewDidFinishRenderingMap(_ mapView: MKMapView, fullyRendered: Bool) + @asyncHandler optional func mapViewDidFinishRenderingMap(_ mapView: MKMapView, fullyRendered: Bool) @available(macOS 10.9, *) optional func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? @available(macOS 10.9, *) - optional func mapView(_ mapView: MKMapView, didAdd views: [MKAnnotationView]) + @asyncHandler optional func mapView(_ mapView: MKMapView, didAdd views: [MKAnnotationView]) @available(macOS 10.9, *) - optional func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) + @asyncHandler optional func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) @available(macOS 10.9, *) - optional func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView) + @asyncHandler optional func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView) @available(macOS 10.9, *) optional func mapViewWillStartLocatingUser(_ mapView: MKMapView) @available(macOS 10.9, *) - optional func mapViewDidStopLocatingUser(_ mapView: MKMapView) + @asyncHandler optional func mapViewDidStopLocatingUser(_ mapView: MKMapView) @available(macOS 10.9, *) - optional func mapView(_ mapView: MKMapView, didUpdate userLocation: MKUserLocation) + @asyncHandler optional func mapView(_ mapView: MKMapView, didUpdate userLocation: MKUserLocation) @available(macOS 10.9, *) - optional func mapView(_ mapView: MKMapView, didFailToLocateUserWithError error: Error) + @asyncHandler optional func mapView(_ mapView: MKMapView, didFailToLocateUserWithError error: Error) @available(macOS 10.9, *) - optional func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, didChange newState: MKAnnotationView.DragState, fromOldState oldState: MKAnnotationView.DragState) + @asyncHandler optional func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, didChange newState: MKAnnotationView.DragState, fromOldState oldState: MKAnnotationView.DragState) @available(macOS 11.0, *) - optional func mapView(_ mapView: MKMapView, didChange mode: MKUserTrackingMode, animated: Bool) + @asyncHandler optional func mapView(_ mapView: MKMapView, didChange mode: MKUserTrackingMode, animated: Bool) @available(macOS 10.9, *) optional func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer @available(macOS 10.9, *) - optional func mapView(_ mapView: MKMapView, didAdd renderers: [MKOverlayRenderer]) + @asyncHandler optional func mapView(_ mapView: MKMapView, didAdd renderers: [MKOverlayRenderer]) @available(macOS 10.13, *) optional func mapView(_ mapView: MKMapView, clusterAnnotationForMemberAnnotations memberAnnotations: [MKAnnotation]) -> MKClusterAnnotation } diff --git a/macOS/Metal/MTLBuffer.swift b/macOS/Metal/MTLBuffer.swift index bf67b08..3f40dfb 100644 --- a/macOS/Metal/MTLBuffer.swift +++ b/macOS/Metal/MTLBuffer.swift @@ -4,7 +4,7 @@ protocol MTLBuffer : MTLResource { var length: Int { get } func contents() -> UnsafeMutableRawPointer @available(macOS 10.11, *) - func __didModifyRange(_ range: NSRange) + @asyncHandler func __didModifyRange(_ range: NSRange) @available(macOS 10.13, *) func makeTexture(descriptor: MTLTextureDescriptor, offset: Int, bytesPerRow: Int) -> MTLTexture? @available(macOS 10.12, *) diff --git a/macOS/Metal/MTLDevice.swift b/macOS/Metal/MTLDevice.swift index 68c96a8..9576a78 100644 --- a/macOS/Metal/MTLDevice.swift +++ b/macOS/Metal/MTLDevice.swift @@ -219,18 +219,25 @@ protocol MTLDevice : NSObjectProtocol { func makeLibrary(data: __DispatchData) throws -> MTLLibrary func makeLibrary(source: String, options: MTLCompileOptions?) throws -> MTLLibrary func makeLibrary(source: String, options: MTLCompileOptions?, completionHandler: @escaping MTLNewLibraryCompletionHandler) + func makeLibrary(source: String, options: MTLCompileOptions?) async throws -> MTLLibrary? func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor) throws -> MTLRenderPipelineState func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer?) throws -> MTLRenderPipelineState func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, completionHandler: @escaping MTLNewRenderPipelineStateCompletionHandler) + func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor) async throws -> MTLRenderPipelineState? func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption, completionHandler: @escaping MTLNewRenderPipelineStateWithReflectionCompletionHandler) + func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLRenderPipelineState?, MTLRenderPipelineReflection?) func makeComputePipelineState(function computeFunction: MTLFunction) throws -> MTLComputePipelineState func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer?) throws -> MTLComputePipelineState func makeComputePipelineState(function computeFunction: MTLFunction, completionHandler: @escaping MTLNewComputePipelineStateCompletionHandler) + func makeComputePipelineState(function computeFunction: MTLFunction) async throws -> MTLComputePipelineState? func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption, completionHandler: @escaping MTLNewComputePipelineStateWithReflectionCompletionHandler) + func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption) async throws -> (MTLComputePipelineState?, MTLComputePipelineReflection?) @available(macOS 10.11, *) func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer?) throws -> MTLComputePipelineState @available(macOS 10.11, *) func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption, completionHandler: @escaping MTLNewComputePipelineStateWithReflectionCompletionHandler) + @available(macOS 10.11, *) + func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLComputePipelineState?, MTLComputePipelineReflection?) @available(macOS 10.13, *) func makeFence() -> MTLFence? func supportsFeatureSet(_ featureSet: MTLFeatureSet) -> Bool @@ -246,6 +253,8 @@ protocol MTLDevice : NSObjectProtocol { func makeRenderPipelineState(tileDescriptor descriptor: MTLTileRenderPipelineDescriptor, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer?) throws -> MTLRenderPipelineState @available(macOS 11.0, *) func makeRenderPipelineState(tileDescriptor descriptor: MTLTileRenderPipelineDescriptor, options: MTLPipelineOption, completionHandler: @escaping MTLNewRenderPipelineStateWithReflectionCompletionHandler) + @available(macOS 11.0, *) + func makeRenderPipelineState(tileDescriptor descriptor: MTLTileRenderPipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLRenderPipelineState?, MTLRenderPipelineReflection?) @available(macOS 10.13, *) var maxThreadgroupMemoryLength: Int { get } @available(macOS 10.14, *) diff --git a/macOS/Metal/MTLLibrary.swift b/macOS/Metal/MTLLibrary.swift index 43bdadf..f78427a 100644 --- a/macOS/Metal/MTLLibrary.swift +++ b/macOS/Metal/MTLLibrary.swift @@ -137,13 +137,19 @@ protocol MTLLibrary : NSObjectProtocol { func makeFunction(name: String, constantValues: MTLFunctionConstantValues) throws -> MTLFunction @available(macOS 10.12, *) func makeFunction(name: String, constantValues: MTLFunctionConstantValues, completionHandler: @escaping (MTLFunction?, Error?) -> Void) + @available(macOS 10.12, *) + func makeFunction(name: String, constantValues: MTLFunctionConstantValues) async throws -> MTLFunction? @available(macOS 11.0, *) func makeFunction(descriptor: MTLFunctionDescriptor, completionHandler: @escaping (MTLFunction?, Error?) -> Void) @available(macOS 11.0, *) + func makeFunction(descriptor: MTLFunctionDescriptor) async throws -> MTLFunction? + @available(macOS 11.0, *) func makeFunction(descriptor: MTLFunctionDescriptor) throws -> MTLFunction @available(macOS 11.0, *) func makeIntersectionFunction(descriptor: MTLIntersectionFunctionDescriptor, completionHandler: @escaping (MTLFunction?, Error?) -> Void) @available(macOS 11.0, *) + func makeIntersectionFunction(descriptor: MTLIntersectionFunctionDescriptor) async throws -> MTLFunction? + @available(macOS 11.0, *) func makeIntersectionFunction(descriptor: MTLIntersectionFunctionDescriptor) throws -> MTLFunction var functionNames: [String] { get } @available(macOS 11.0, *) diff --git a/macOS/MetalKit/MTKTextureLoader.swift b/macOS/MetalKit/MTKTextureLoader.swift index 4568098..d33200c 100644 --- a/macOS/MetalKit/MTKTextureLoader.swift +++ b/macOS/MetalKit/MTKTextureLoader.swift @@ -65,20 +65,35 @@ class MTKTextureLoader : NSObject { var device: MTLDevice { get } init(device: MTLDevice) func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) + func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? @available(macOS 10.12, *) func newTexture(name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) @available(macOS 10.12, *) + func newTexture(name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + @available(macOS 10.12, *) func newTexture(name: String, scaleFactor: CGFloat, displayGamut: NSDisplayGamut, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) @available(macOS 10.12, *) + func newTexture(name: String, scaleFactor: CGFloat, displayGamut: NSDisplayGamut, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + @available(macOS 10.12, *) func newTextures(URLs: [URL], options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.ArrayCallback) @available(macOS 10.12, *) + func newTextures(URLs: [URL], options: [MTKTextureLoader.Option : Any]? = nil) async throws -> [MTLTexture] + @available(macOS 10.12, *) func newTextures(names: [String], scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.ArrayCallback) @available(macOS 10.12, *) + func newTextures(names: [String], scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> [MTLTexture] + @available(macOS 10.12, *) func newTextures(names: [String], scaleFactor: CGFloat, displayGamut: NSDisplayGamut, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.ArrayCallback) + @available(macOS 10.12, *) + func newTextures(names: [String], scaleFactor: CGFloat, displayGamut: NSDisplayGamut, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> [MTLTexture] func newTexture(data: Data, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) + func newTexture(data: Data, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? func newTexture(cgImage: CGImage, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) + func newTexture(cgImage: CGImage, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? @available(macOS 10.12, *) func newTexture(texture: MDLTexture, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) + @available(macOS 10.12, *) + func newTexture(texture: MDLTexture, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil) throws -> MTLTexture @available(macOS 10.12, *) func newTextures(URLs: [URL], options: [MTKTextureLoader.Option : Any]? = nil, error: NSErrorPointer) -> [MTLTexture] diff --git a/macOS/MetalPerformanceShaders/MetalPerformanceShaders.swift b/macOS/MetalPerformanceShaders/MetalPerformanceShaders.swift index 7bbda86..721e70e 100644 --- a/macOS/MetalPerformanceShaders/MetalPerformanceShaders.swift +++ b/macOS/MetalPerformanceShaders/MetalPerformanceShaders.swift @@ -3732,6 +3732,7 @@ class MPSAccelerationStructure : MPSKernel, NSSecureCoding, NSCopying { init?(coder aDecoder: NSCoder, group: MPSAccelerationStructureGroup) func rebuild() func rebuild(completionHandler: @escaping MPSAccelerationStructureCompletionHandler) + func rebuild() async -> MPSAccelerationStructure? func encodeRefit(commandBuffer: MTLCommandBuffer) func copy(with zone: NSZone? = nil, group: MPSAccelerationStructureGroup) -> Self } diff --git a/macOS/MultipeerConnectivity/MCAdvertiserAssistant.swift b/macOS/MultipeerConnectivity/MCAdvertiserAssistant.swift index 7509b57..fd2de43 100644 --- a/macOS/MultipeerConnectivity/MCAdvertiserAssistant.swift +++ b/macOS/MultipeerConnectivity/MCAdvertiserAssistant.swift @@ -13,5 +13,5 @@ protocol MCAdvertiserAssistantDelegate : NSObjectProtocol { @available(macOS 10.10, *) optional func advertiserAssistantWillPresentInvitation(_ advertiserAssistant: MCAdvertiserAssistant) @available(macOS 10.10, *) - optional func advertiserAssistantDidDismissInvitation(_ advertiserAssistant: MCAdvertiserAssistant) + @asyncHandler optional func advertiserAssistantDidDismissInvitation(_ advertiserAssistant: MCAdvertiserAssistant) } diff --git a/macOS/MultipeerConnectivity/MCBrowserViewController.swift b/macOS/MultipeerConnectivity/MCBrowserViewController.swift index e8f4ab6..8dbfb3d 100644 --- a/macOS/MultipeerConnectivity/MCBrowserViewController.swift +++ b/macOS/MultipeerConnectivity/MCBrowserViewController.swift @@ -11,7 +11,7 @@ class MCBrowserViewController : NSViewController, MCNearbyServiceBrowserDelegate } protocol MCBrowserViewControllerDelegate : NSObjectProtocol { @available(macOS 10.10, *) - func browserViewControllerDidFinish(_ browserViewController: MCBrowserViewController) + @asyncHandler func browserViewControllerDidFinish(_ browserViewController: MCBrowserViewController) @available(macOS 10.10, *) func browserViewControllerWasCancelled(_ browserViewController: MCBrowserViewController) @available(macOS 10.10, *) diff --git a/macOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift b/macOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift index 096663c..200ac56 100644 --- a/macOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift +++ b/macOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift @@ -11,7 +11,7 @@ class MCNearbyServiceAdvertiser : NSObject { } protocol MCNearbyServiceAdvertiserDelegate : NSObjectProtocol { @available(macOS 10.10, *) - func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didReceiveInvitationFromPeer peerID: MCPeerID, withContext context: Data?, invitationHandler: @escaping (Bool, MCSession?) -> Void) + @asyncHandler func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didReceiveInvitationFromPeer peerID: MCPeerID, withContext context: Data?, invitationHandler: @escaping (Bool, MCSession?) -> Void) @available(macOS 10.10, *) - optional func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didNotStartAdvertisingPeer error: Error) + @asyncHandler optional func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didNotStartAdvertisingPeer error: Error) } diff --git a/macOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift b/macOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift index 2322166..630e720 100644 --- a/macOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift +++ b/macOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift @@ -15,5 +15,5 @@ protocol MCNearbyServiceBrowserDelegate : NSObjectProtocol { @available(macOS 10.10, *) func browser(_ browser: MCNearbyServiceBrowser, lostPeer peerID: MCPeerID) @available(macOS 10.10, *) - optional func browser(_ browser: MCNearbyServiceBrowser, didNotStartBrowsingForPeers error: Error) + @asyncHandler optional func browser(_ browser: MCNearbyServiceBrowser, didNotStartBrowsingForPeers error: Error) } diff --git a/macOS/MultipeerConnectivity/MCSession.swift b/macOS/MultipeerConnectivity/MCSession.swift index 8cff849..5f502b4 100644 --- a/macOS/MultipeerConnectivity/MCSession.swift +++ b/macOS/MultipeerConnectivity/MCSession.swift @@ -42,20 +42,21 @@ class MCSession : NSObject { } protocol MCSessionDelegate : NSObjectProtocol { @available(macOS 10.10, *) - func session(_ session: MCSession, peer peerID: MCPeerID, didChange state: MCSessionState) + @asyncHandler func session(_ session: MCSession, peer peerID: MCPeerID, didChange state: MCSessionState) @available(macOS 10.10, *) - func session(_ session: MCSession, didReceive data: Data, fromPeer peerID: MCPeerID) + @asyncHandler func session(_ session: MCSession, didReceive data: Data, fromPeer peerID: MCPeerID) @available(macOS 10.10, *) - func session(_ session: MCSession, didReceive stream: InputStream, withName streamName: String, fromPeer peerID: MCPeerID) + @asyncHandler func session(_ session: MCSession, didReceive stream: InputStream, withName streamName: String, fromPeer peerID: MCPeerID) @available(macOS 10.10, *) - func session(_ session: MCSession, didStartReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, with progress: Progress) + @asyncHandler func session(_ session: MCSession, didStartReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, with progress: Progress) @available(macOS 10.10, *) - func session(_ session: MCSession, didFinishReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, at localURL: URL?, withError error: Error?) + @asyncHandler func session(_ session: MCSession, didFinishReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, at localURL: URL?, withError error: Error?) @available(macOS 10.10, *) - optional func session(_ session: MCSession, didReceiveCertificate certificate: [Any]?, fromPeer peerID: MCPeerID, certificateHandler: @escaping (Bool) -> Void) + @asyncHandler optional func session(_ session: MCSession, didReceiveCertificate certificate: [Any]?, fromPeer peerID: MCPeerID, certificateHandler: @escaping (Bool) -> Void) } extension MCSession { func nearbyConnectionData(forPeer peerID: MCPeerID, withCompletionHandler completionHandler: @escaping (Data?, Error?) -> Void) + func nearbyConnectionData(forPeer peerID: MCPeerID) async throws -> Data? func connectPeer(_ peerID: MCPeerID, withNearbyConnectionData data: Data) func cancelConnectPeer(_ peerID: MCPeerID) } diff --git a/macOS/NaturalLanguage/NLTagger.swift b/macOS/NaturalLanguage/NLTagger.swift index 6c65ee1..423ede4 100644 --- a/macOS/NaturalLanguage/NLTagger.swift +++ b/macOS/NaturalLanguage/NLTagger.swift @@ -37,6 +37,8 @@ class NLTagger : NSObject { func gazetteers(for tagScheme: NLTagScheme) -> [NLGazetteer] @available(macOS 10.15, *) class func requestAssets(for language: NLLanguage, tagScheme: NLTagScheme, completionHandler: @escaping (NLTagger.AssetsResult, Error?) -> Void) + @available(macOS 10.15, *) + class func requestAssets(for language: NLLanguage, tagScheme: NLTagScheme) async throws -> NLTagger.AssetsResult } @available(macOS 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *) diff --git a/macOS/NetworkExtension/NetworkExtension.swift b/macOS/NetworkExtension/NetworkExtension.swift index c634de3..1b98cdc 100644 --- a/macOS/NetworkExtension/NetworkExtension.swift +++ b/macOS/NetworkExtension/NetworkExtension.swift @@ -24,6 +24,8 @@ class NEAppProxyFlow : NSObject { @available(macOS 10.11, *) func open(withLocalEndpoint localEndpoint: NWHostEndpoint?, completionHandler: @escaping (Error?) -> Void) @available(macOS 10.11, *) + func open(withLocalEndpoint localEndpoint: NWHostEndpoint?) async throws + @available(macOS 10.11, *) func closeReadWithError(_ error: Error?) @available(macOS 10.11, *) func closeWriteWithError(_ error: Error?) @@ -65,6 +67,8 @@ class NEProvider : NSObject { @available(macOS 10.11, *) func sleep(completionHandler: @escaping () -> Void) @available(macOS 10.11, *) + func sleep() async + @available(macOS 10.11, *) func wake() @available(macOS 10.11, *) func createTCPConnection(to remoteEndpoint: NWEndpoint, enableTLS: Bool, tlsParameters TLSParameters: NWTLSParameters?, delegate: Any?) -> NWTCPConnection @@ -72,6 +76,8 @@ class NEProvider : NSObject { func createUDPSession(to remoteEndpoint: NWEndpoint, from localEndpoint: NWHostEndpoint?) -> NWUDPSession @available(macOS, introduced: 10.12, deprecated: 10.14) func displayMessage(_ message: String, completionHandler: @escaping (Bool) -> Void) + @available(macOS, introduced: 10.12, deprecated: 10.14) + func displayMessage(_ message: String) async -> Bool @available(macOS 10.15, *) class func startSystemExtensionMode() @available(macOS 10.11, *) @@ -102,8 +108,12 @@ class NETunnelProvider : NEProvider { @available(macOS 10.11, *) func handleAppMessage(_ messageData: Data, completionHandler: ((Data?) -> Void)? = nil) @available(macOS 10.11, *) + func handleAppMessage(_ messageData: Data) async -> Data? + @available(macOS 10.11, *) func setTunnelNetworkSettings(_ tunnelNetworkSettings: NETunnelNetworkSettings?, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.11, *) + func setTunnelNetworkSettings(_ tunnelNetworkSettings: NETunnelNetworkSettings?) async throws + @available(macOS 10.11, *) var protocolConfiguration: NEVPNProtocol { get } @available(macOS 10.11, *) var appRules: [NEAppRule]? { get } @@ -117,8 +127,12 @@ class NEAppProxyProvider : NETunnelProvider { @available(macOS 10.11, *) func startProxy(options: [String : Any]? = nil, completionHandler: @escaping (Error?) -> Void) @available(macOS 10.11, *) + func startProxy(options: [String : Any]? = nil) async throws + @available(macOS 10.11, *) func stopProxy(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) @available(macOS 10.11, *) + func stopProxy(with reason: NEProviderStopReason) async + @available(macOS 10.11, *) func cancelProxyWithError(_ error: Error?) @available(macOS 10.11, *) func handleNewFlow(_ flow: NEAppProxyFlow) -> Bool @@ -158,10 +172,16 @@ class NEVPNManager : NSObject { @available(macOS 10.11, *) func loadFromPreferences(completionHandler: @escaping (Error?) -> Void) @available(macOS 10.11, *) + func loadFromPreferences() async throws + @available(macOS 10.11, *) func removeFromPreferences(completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.11, *) + func removeFromPreferences() async throws + @available(macOS 10.11, *) func saveToPreferences(completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.11, *) + func saveToPreferences() async throws + @available(macOS 10.11, *) func setAuthorization(_ authorization: AuthorizationRef) @available(macOS 10.11, *) var onDemandRules: [NEOnDemandRule]? @@ -182,6 +202,8 @@ class NEVPNManager : NSObject { class NETunnelProviderManager : NEVPNManager { @available(macOS 10.11, *) class func loadAllFromPreferences(completionHandler: @escaping ([NETunnelProviderManager]?, Error?) -> Void) + @available(macOS 10.11, *) + class func loadAllFromPreferences() async throws -> [NETunnelProviderManager]? @available(macOS 10.15.4, *) class func forPerAppVPN() -> Self @available(macOS 10.11, *) @@ -211,8 +233,12 @@ class NEAppProxyTCPFlow : NEAppProxyFlow { @available(macOS 10.11, *) func readData(completionHandler: @escaping (Data?, Error?) -> Void) @available(macOS 10.11, *) + func readData() async throws -> Data? + @available(macOS 10.11, *) func write(_ data: Data, withCompletionHandler completionHandler: @escaping (Error?) -> Void) @available(macOS 10.11, *) + func write(_ data: Data) async throws + @available(macOS 10.11, *) var remoteEndpoint: NWEndpoint { get } } @available(macOS 10.11, *) @@ -220,8 +246,12 @@ class NEAppProxyUDPFlow : NEAppProxyFlow { @available(macOS 10.11, *) func readDatagrams(completionHandler: @escaping ([Data]?, [NWEndpoint]?, Error?) -> Void) @available(macOS 10.11, *) + func readDatagrams() async throws -> ([Data]?, [NWEndpoint]?) + @available(macOS 10.11, *) func writeDatagrams(_ datagrams: [Data], sentBy remoteEndpoints: [NWEndpoint], completionHandler: @escaping (Error?) -> Void) @available(macOS 10.11, *) + func writeDatagrams(_ datagrams: [Data], sentBy remoteEndpoints: [NWEndpoint]) async throws + @available(macOS 10.11, *) var localEndpoint: NWEndpoint? { get } } @available(macOS 10.11, *) @@ -257,10 +287,16 @@ class NEDNSProxyManager : NSObject { @available(macOS 10.15, *) func loadFromPreferences(completionHandler: @escaping (Error?) -> Void) @available(macOS 10.15, *) + func loadFromPreferences() async throws + @available(macOS 10.15, *) func removeFromPreferences(completionHandler: @escaping (Error?) -> Void) @available(macOS 10.15, *) + func removeFromPreferences() async throws + @available(macOS 10.15, *) func saveToPreferences(completionHandler: @escaping (Error?) -> Void) @available(macOS 10.15, *) + func saveToPreferences() async throws + @available(macOS 10.15, *) var localizedDescription: String? @available(macOS 10.15, *) var providerProtocol: NEDNSProxyProviderProtocol? @@ -272,8 +308,12 @@ class NEDNSProxyProvider : NEProvider { @available(macOS 10.15, *) func startProxy(options: [String : Any]? = nil, completionHandler: @escaping (Error?) -> Void) @available(macOS 10.15, *) + func startProxy(options: [String : Any]? = nil) async throws + @available(macOS 10.15, *) func stopProxy(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) @available(macOS 10.15, *) + func stopProxy(with reason: NEProviderStopReason) async + @available(macOS 10.15, *) func cancelProxyWithError(_ error: Error?) @available(macOS 10.15, *) func handleNewFlow(_ flow: NEAppProxyFlow) -> Bool @@ -405,10 +445,16 @@ class NEDNSSettingsManager : NSObject { @available(macOS 11.0, *) func loadFromPreferences(completionHandler: @escaping (Error?) -> Void) @available(macOS 11.0, *) + func loadFromPreferences() async throws + @available(macOS 11.0, *) func removeFromPreferences(completionHandler: @escaping (Error?) -> Void) @available(macOS 11.0, *) + func removeFromPreferences() async throws + @available(macOS 11.0, *) func saveToPreferences(completionHandler: @escaping (Error?) -> Void) @available(macOS 11.0, *) + func saveToPreferences() async throws + @available(macOS 11.0, *) var localizedDescription: String? @available(macOS 11.0, *) var dnsSettings: NEDNSSettings? @@ -492,8 +538,12 @@ class NEFilterProvider : NEProvider { @available(macOS 10.15, *) func startFilter(completionHandler: @escaping (Error?) -> Void) @available(macOS 10.15, *) + func startFilter() async throws + @available(macOS 10.15, *) func stopFilter(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) @available(macOS 10.15, *) + func stopFilter(with reason: NEProviderStopReason) async + @available(macOS 10.15, *) var filterConfiguration: NEFilterProviderConfiguration { get } @available(macOS 10.15, *) func handle(_ report: NEFilterReport) @@ -585,6 +635,8 @@ class NEFilterDataProvider : NEFilterProvider { @available(macOS 10.15, *) func apply(_ settings: NEFilterSettings?, completionHandler: @escaping (Error?) -> Void) @available(macOS 10.15, *) + func apply(_ settings: NEFilterSettings?) async throws + @available(macOS 10.15, *) func resumeFlow(_ flow: NEFilterFlow, with verdict: NEFilterVerdict) @available(macOS 10.15.4, *) func update(_ flow: NEFilterSocketFlow, using verdict: NEFilterDataVerdict, for direction: NETrafficDirection) @@ -633,10 +685,16 @@ class NEFilterManager : NSObject { @available(macOS 10.11, *) func loadFromPreferences(completionHandler: @escaping (Error?) -> Void) @available(macOS 10.11, *) + func loadFromPreferences() async throws + @available(macOS 10.11, *) func removeFromPreferences(completionHandler: @escaping (Error?) -> Void) @available(macOS 10.11, *) + func removeFromPreferences() async throws + @available(macOS 10.11, *) func saveToPreferences(completionHandler: @escaping (Error?) -> Void) @available(macOS 10.11, *) + func saveToPreferences() async throws + @available(macOS 10.11, *) var localizedDescription: String? @available(macOS 10.11, *) var providerConfiguration: NEFilterProviderConfiguration? @@ -866,10 +924,14 @@ class NEPacketTunnelFlow : NSObject { @available(macOS 10.11, *) func readPackets(completionHandler: @escaping ([Data], [NSNumber]) -> Void) @available(macOS 10.11, *) + func readPackets() async -> ([Data], [NSNumber]) + @available(macOS 10.11, *) func writePackets(_ packets: [Data], withProtocols protocols: [NSNumber]) -> Bool @available(macOS 10.12, *) func readPacketObjects(completionHandler: @escaping ([NEPacket]) -> Void) @available(macOS 10.12, *) + func readPacketObjects() async -> [NEPacket] + @available(macOS 10.12, *) func writePacketObjects(_ packets: [NEPacket]) -> Bool } @available(macOS 10.11, *) @@ -899,8 +961,12 @@ class NEPacketTunnelProvider : NETunnelProvider { @available(macOS 10.11, *) func startTunnel(options: [String : NSObject]? = nil, completionHandler: @escaping (Error?) -> Void) @available(macOS 10.11, *) + func startTunnel(options: [String : NSObject]? = nil) async throws + @available(macOS 10.11, *) func stopTunnel(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) @available(macOS 10.11, *) + func stopTunnel(with reason: NEProviderStopReason) async + @available(macOS 10.11, *) func cancelTunnelWithError(_ error: Error?) @available(macOS 10.11, *) var packetFlow: NEPacketTunnelFlow { get } @@ -913,6 +979,8 @@ class NEPacketTunnelProvider : NETunnelProvider { class NETransparentProxyManager : NEVPNManager { @available(macOS 10.15, *) class func loadAllFromPreferences(completionHandler: @escaping ([NETransparentProxyManager]?, Error?) -> Void) + @available(macOS 10.15, *) + class func loadAllFromPreferences() async throws -> [NETransparentProxyManager]? } @available(macOS 10.15, *) class NETransparentProxyNetworkSettings : NETunnelNetworkSettings { @@ -1189,10 +1257,16 @@ class NWTCPConnection : NSObject { @available(macOS 10.11, *) func readLength(_ length: Int, completionHandler completion: @escaping (Data?, Error?) -> Void) @available(macOS 10.11, *) + func readLength(_ length: Int) async throws -> Data? + @available(macOS 10.11, *) func readMinimumLength(_ minimum: Int, maximumLength maximum: Int, completionHandler completion: @escaping (Data?, Error?) -> Void) @available(macOS 10.11, *) + func readMinimumLength(_ minimum: Int, maximumLength maximum: Int) async throws -> Data? + @available(macOS 10.11, *) func write(_ data: Data, completionHandler completion: @escaping (Error?) -> Void) @available(macOS 10.11, *) + func write(_ data: Data) async throws + @available(macOS 10.11, *) func writeClose() } @available(macOS 10.11, *) @@ -1202,9 +1276,13 @@ protocol NWTCPConnectionAuthenticationDelegate : NSObjectProtocol { @available(macOS 10.11, *) optional func provideIdentity(for connection: NWTCPConnection, completionHandler completion: @escaping (SecIdentity, [Any]) -> Void) @available(macOS 10.11, *) + optional func provideIdentity(for connection: NWTCPConnection) async -> (SecIdentity, [Any]) + @available(macOS 10.11, *) optional func shouldEvaluateTrust(for connection: NWTCPConnection) -> Bool @available(macOS 10.11, *) optional func evaluateTrust(for connection: NWTCPConnection, peerCertificateChain: [Any], completionHandler completion: @escaping (SecTrust) -> Void) + @available(macOS 10.11, *) + optional func evaluateTrust(for connection: NWTCPConnection, peerCertificateChain: [Any]) async -> SecTrust } @available(macOS 10.11, *) enum NWUDPSessionState : Int { @@ -1242,8 +1320,12 @@ class NWUDPSession : NSObject { @available(macOS 10.11, *) func writeMultipleDatagrams(_ datagramArray: [Data], completionHandler: @escaping (Error?) -> Void) @available(macOS 10.11, *) + func writeMultipleDatagrams(_ datagramArray: [Data]) async throws + @available(macOS 10.11, *) func writeDatagram(_ datagram: Data, completionHandler: @escaping (Error?) -> Void) @available(macOS 10.11, *) + func writeDatagram(_ datagram: Data) async throws + @available(macOS 10.11, *) func cancel() } class NWTLSParameters : NSObject { diff --git a/macOS/NotificationCenter/NCWidgetListViewController.swift b/macOS/NotificationCenter/NCWidgetListViewController.swift index 5efc4c1..393cc7e 100644 --- a/macOS/NotificationCenter/NCWidgetListViewController.swift +++ b/macOS/NotificationCenter/NCWidgetListViewController.swift @@ -15,7 +15,7 @@ protocol NCWidgetListViewDelegate : NSObjectProtocol { func widgetList(_ list: NCWidgetListViewController, viewControllerForRow row: Int) -> NSViewController optional func widgetListPerformAddAction(_ list: NCWidgetListViewController) optional func widgetList(_ list: NCWidgetListViewController, shouldReorderRow row: Int) -> Bool - optional func widgetList(_ list: NCWidgetListViewController, didReorderRow row: Int, toRow newIndex: Int) + @asyncHandler optional func widgetList(_ list: NCWidgetListViewController, didReorderRow row: Int, toRow newIndex: Int) optional func widgetList(_ list: NCWidgetListViewController, shouldRemoveRow row: Int) -> Bool - optional func widgetList(_ list: NCWidgetListViewController, didRemoveRow row: Int) + @asyncHandler optional func widgetList(_ list: NCWidgetListViewController, didRemoveRow row: Int) } diff --git a/macOS/NotificationCenter/NCWidgetProviding.swift b/macOS/NotificationCenter/NCWidgetProviding.swift index 545a161..985bdae 100644 --- a/macOS/NotificationCenter/NCWidgetProviding.swift +++ b/macOS/NotificationCenter/NCWidgetProviding.swift @@ -12,13 +12,15 @@ protocol NCWidgetProviding : NSExtensionRequestHandling { @available(macOS, introduced: 10.10, deprecated: 11.0, message: "Use WidgetKit instead. Today View extensions have been deprecated.") optional func widgetPerformUpdate(completionHandler: @escaping (NCUpdateResult) -> Void) @available(macOS, introduced: 10.10, deprecated: 11.0, message: "Use WidgetKit instead. Today View extensions have been deprecated.") + optional func widgetPerformUpdate() async -> NCUpdateResult + @available(macOS, introduced: 10.10, deprecated: 11.0, message: "Use WidgetKit instead. Today View extensions have been deprecated.") optional func widgetMarginInsets(forProposedMarginInsets defaultMarginInset: NSEdgeInsets) -> NSEdgeInsets @available(macOS, introduced: 10.10, deprecated: 11.0, message: "Use WidgetKit instead. Today View extensions have been deprecated.") optional var widgetAllowsEditing: Bool { get } @available(macOS, introduced: 10.10, deprecated: 11.0, message: "Use WidgetKit instead. Today View extensions have been deprecated.") - optional func widgetDidBeginEditing() + @asyncHandler optional func widgetDidBeginEditing() @available(macOS, introduced: 10.10, deprecated: 11.0, message: "Use WidgetKit instead. Today View extensions have been deprecated.") - optional func widgetDidEndEditing() + @asyncHandler optional func widgetDidEndEditing() } extension NSViewController { @available(macOS, introduced: 10.10, deprecated: 11.0, message: "Use WidgetKit instead. Today View extensions have been deprecated.") diff --git a/macOS/PDFKit/PDFDocument.swift b/macOS/PDFKit/PDFDocument.swift index f47a159..0195720 100644 --- a/macOS/PDFKit/PDFDocument.swift +++ b/macOS/PDFKit/PDFDocument.swift @@ -132,14 +132,14 @@ class PDFDocument : NSObject, NSCopying { func selection(from startPage: PDFPage, atCharacterIndex startCharacter: Int, to endPage: PDFPage, atCharacterIndex endCharacter: Int) -> PDFSelection? } protocol PDFDocumentDelegate : NSObjectProtocol { - optional func documentDidUnlock(_ notification: Notification) - optional func documentDidBeginDocumentFind(_ notification: Notification) - optional func documentDidEndDocumentFind(_ notification: Notification) - optional func documentDidBeginPageFind(_ notification: Notification) - optional func documentDidEndPageFind(_ notification: Notification) - optional func documentDidFindMatch(_ notification: Notification) - @available(macOS 10.4, *) - optional func didMatchString(_ instance: PDFSelection) + @asyncHandler optional func documentDidUnlock(_ notification: Notification) + @asyncHandler optional func documentDidBeginDocumentFind(_ notification: Notification) + @asyncHandler optional func documentDidEndDocumentFind(_ notification: Notification) + @asyncHandler optional func documentDidBeginPageFind(_ notification: Notification) + @asyncHandler optional func documentDidEndPageFind(_ notification: Notification) + @asyncHandler optional func documentDidFindMatch(_ notification: Notification) + @available(macOS 10.4, *) + @asyncHandler optional func didMatchString(_ instance: PDFSelection) @available(macOS 10.6, *) optional func classForPage() -> AnyClass @available(macOS 10.13, *) diff --git a/macOS/ParavirtualizedGraphics/PGDevice.swift b/macOS/ParavirtualizedGraphics/PGDevice.swift index 687d775..ec1b2aa 100644 --- a/macOS/ParavirtualizedGraphics/PGDevice.swift +++ b/macOS/ParavirtualizedGraphics/PGDevice.swift @@ -63,7 +63,7 @@ protocol PGDevice : NSObjectProtocol { @available(macOS 11.0, *) func willResume(withSuspendState suspendState: Data, error: NSErrorPointer) -> Bool @available(macOS 11.0, *) - func didResume() + @asyncHandler func didResume() } @available(macOS 11.0, *) func PGNewDeviceWithDescriptor(_ descriptor: PGDeviceDescriptor) -> PGDevice? diff --git a/macOS/PassKit/PKAddShareablePassConfiguration.swift b/macOS/PassKit/PKAddShareablePassConfiguration.swift index befbe1e..9dbabf8 100644 --- a/macOS/PassKit/PKAddShareablePassConfiguration.swift +++ b/macOS/PassKit/PKAddShareablePassConfiguration.swift @@ -16,6 +16,7 @@ enum PKAddShareablePassConfigurationPrimaryAction : UInt { } class PKAddShareablePassConfiguration : PKAddSecureElementPassConfiguration { class func forPassMetaData(_ passMetadata: [PKShareablePassMetadata], provisioningPolicyIdentifier: String, action: PKAddShareablePassConfigurationPrimaryAction, completion: @escaping (PKAddShareablePassConfiguration?, Error?) -> Void) + class func forPassMetaData(_ passMetadata: [PKShareablePassMetadata], provisioningPolicyIdentifier: String, action: PKAddShareablePassConfigurationPrimaryAction) async throws -> PKAddShareablePassConfiguration? var primaryAction: PKAddShareablePassConfigurationPrimaryAction { get } var credentialsMetadata: [PKShareablePassMetadata] { get } var provisioningPolicyIdentifier: String { get } diff --git a/macOS/PassKit/PKPassLibrary.swift b/macOS/PassKit/PKPassLibrary.swift index ff7ebd6..5709d1a 100644 --- a/macOS/PassKit/PKPassLibrary.swift +++ b/macOS/PassKit/PKPassLibrary.swift @@ -40,6 +40,8 @@ class PKPassLibrary : NSObject { @available(macOS 10.12, *) func addPasses(_ passes: [PKPass], withCompletionHandler completion: ((PKPassLibraryAddPassesStatus) -> Void)? = nil) @available(macOS 10.12, *) + func addPasses(_ passes: [PKPass]) async -> PKPassLibraryAddPassesStatus + @available(macOS 10.12, *) func openPaymentSetup() func present(_ pass: PKPaymentPass) func present(_ pass: PKSecureElementPass) @@ -47,9 +49,13 @@ class PKPassLibrary : NSObject { func canAddSecureElementPass(primaryAccountIdentifier: String) -> Bool func canAddFelicaPass() -> Bool func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data, completion: ((Bool, Error) -> Void)? = nil) + func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data) async -> (Bool, Error) func activate(_ paymentPass: PKPaymentPass, withActivationCode activationCode: String, completion: ((Bool, Error) -> Void)? = nil) + func activate(_ paymentPass: PKPaymentPass, withActivationCode activationCode: String) async -> (Bool, Error) func activate(_ secureElementPass: PKSecureElementPass, activationData: Data, completion: ((Bool, Error?) -> Void)? = nil) + func activate(_ secureElementPass: PKSecureElementPass, activationData: Data) async throws -> Bool func sign(_ signData: Data, using secureElementPass: PKSecureElementPass, completion: @escaping (Data?, Data?, Error?) -> Void) + func sign(_ signData: Data, using secureElementPass: PKSecureElementPass) async throws -> (Data?, Data?) } struct PKPassLibraryNotificationName : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable { init(_ rawValue: String) diff --git a/macOS/PassKit/PKPaymentAuthorizationController.swift b/macOS/PassKit/PKPaymentAuthorizationController.swift index 89ea575..53b4039 100644 --- a/macOS/PassKit/PKPaymentAuthorizationController.swift +++ b/macOS/PassKit/PKPaymentAuthorizationController.swift @@ -1,27 +1,43 @@ protocol PKPaymentAuthorizationControllerDelegate : NSObjectProtocol { @available(macOS 11.0, *) - func paymentAuthorizationControllerDidFinish(_ controller: PKPaymentAuthorizationController) + @asyncHandler func paymentAuthorizationControllerDidFinish(_ controller: PKPaymentAuthorizationController) @available(macOS 11.0, *) - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) @available(macOS 11.0, *) - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationResult + @available(macOS 11.0, *) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) + @available(macOS 11.0, *) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationStatus @available(macOS 11.0, *) optional func paymentAuthorizationControllerWillAuthorizePayment(_ controller: PKPaymentAuthorizationController) @available(macOS 11.0, *) - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) + @available(macOS 11.0, *) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) + @available(macOS 11.0, *) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod) async -> PKPaymentRequestShippingMethodUpdate + @available(macOS 11.0, *) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) + @available(macOS 11.0, *) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact) async -> PKPaymentRequestShippingContactUpdate + @available(macOS 11.0, *) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) + @available(macOS 11.0, *) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod) async -> PKPaymentRequestPaymentMethodUpdate @available(macOS 11.0, *) - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) @available(macOS 11.0, *) - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod) async -> (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) @available(macOS 11.0, *) - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) @available(macOS 11.0, *) - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact) async -> (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) @available(macOS 11.0, *) - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) @available(macOS 11.0, *) - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod) async -> [PKPaymentSummaryItem] @available(macOS 11.0, *) func presentationWindow(for controller: PKPaymentAuthorizationController) -> NSWindow? } @@ -33,5 +49,7 @@ class PKPaymentAuthorizationController : NSObject { weak var delegate: @sil_weak PKPaymentAuthorizationControllerDelegate? init(paymentRequest request: PKPaymentRequest) func present(completion: ((Bool) -> Void)? = nil) + func present() async -> Bool func dismiss(completion: (() -> Void)? = nil) + func dismiss() async } diff --git a/macOS/PassKit/PKPaymentAuthorizationViewControllerDelegate.swift b/macOS/PassKit/PKPaymentAuthorizationViewControllerDelegate.swift index fa629a8..fe6137d 100644 --- a/macOS/PassKit/PKPaymentAuthorizationViewControllerDelegate.swift +++ b/macOS/PassKit/PKPaymentAuthorizationViewControllerDelegate.swift @@ -1,25 +1,41 @@ protocol PKPaymentAuthorizationViewControllerDelegate : NSObjectProtocol { @available(macOS 11.0, *) - func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) + @asyncHandler func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) @available(macOS 11.0, *) - optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) + @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) + @available(macOS 11.0, *) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationResult @available(macOS 11.0, *) optional func paymentAuthorizationViewControllerWillAuthorizePayment(_ controller: PKPaymentAuthorizationViewController) @available(macOS 11.0, *) - optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) + @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) + @available(macOS 11.0, *) + @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) + @available(macOS 11.0, *) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod) async -> PKPaymentRequestShippingMethodUpdate + @available(macOS 11.0, *) + @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) + @available(macOS 11.0, *) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact) async -> PKPaymentRequestShippingContactUpdate + @available(macOS 11.0, *) + @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) + @available(macOS 11.0, *) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod) async -> PKPaymentRequestPaymentMethodUpdate + @available(macOS 11.0, *) + @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) @available(macOS 11.0, *) - optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationStatus @available(macOS 11.0, *) - optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) + @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) @available(macOS 11.0, *) - optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod) async -> (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) @available(macOS 11.0, *) - optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) + @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) @available(macOS 11.0, *) - optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact) async -> (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) @available(macOS 11.0, *) - optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) + @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) @available(macOS 11.0, *) - optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod) async -> [PKPaymentSummaryItem] } diff --git a/macOS/PassKit/PKPaymentInformationEventExtension.swift b/macOS/PassKit/PKPaymentInformationEventExtension.swift index d6891c7..c433e04 100644 --- a/macOS/PassKit/PKPaymentInformationEventExtension.swift +++ b/macOS/PassKit/PKPaymentInformationEventExtension.swift @@ -5,6 +5,9 @@ class PKPaymentInformationEventExtension : NSObject { } protocol PKPaymentInformationRequestHandling { func handleInformationRequest(_ infoRequest: PKBarcodeEventMetadataRequest, completion: @escaping PKInformationRequestCompletionBlock) + func handleInformationRequest(_ infoRequest: PKBarcodeEventMetadataRequest) async -> PKBarcodeEventMetadataResponse func handle(_ signatureRequest: PKBarcodeEventSignatureRequest, completion: @escaping PKSignatureRequestCompletionBlock) + func handle(_ signatureRequest: PKBarcodeEventSignatureRequest) async -> PKBarcodeEventSignatureResponse func handle(_ configurationRequest: PKBarcodeEventConfigurationRequest, completion: @escaping () -> Void) + func handle(_ configurationRequest: PKBarcodeEventConfigurationRequest) async } diff --git a/macOS/Photos/PHAssetResourceManager.swift b/macOS/Photos/PHAssetResourceManager.swift index 73956b5..6a850c3 100644 --- a/macOS/Photos/PHAssetResourceManager.swift +++ b/macOS/Photos/PHAssetResourceManager.swift @@ -21,5 +21,7 @@ class PHAssetResourceManager : NSObject { @available(macOS 10.15, *) func writeData(for resource: PHAssetResource, toFile fileURL: URL, options: PHAssetResourceRequestOptions?, completionHandler: @escaping (Error?) -> Void) @available(macOS 10.15, *) + func writeData(for resource: PHAssetResource, toFile fileURL: URL, options: PHAssetResourceRequestOptions?) async throws + @available(macOS 10.15, *) func cancelDataRequest(_ requestID: PHAssetResourceDataRequestID) } diff --git a/macOS/Photos/PHLivePhotoEditingContext.swift b/macOS/Photos/PHLivePhotoEditingContext.swift index e93ee8f..8f8fa04 100644 --- a/macOS/Photos/PHLivePhotoEditingContext.swift +++ b/macOS/Photos/PHLivePhotoEditingContext.swift @@ -26,8 +26,12 @@ class PHLivePhotoEditingContext : NSObject { @available(macOS 10.12, *) func prepareLivePhotoForPlayback(withTargetSize targetSize: CGSize, options: [String : Any]? = nil, completionHandler handler: @escaping (PHLivePhoto?, Error?) -> Void) @available(macOS 10.12, *) + func prepareLivePhotoForPlayback(withTargetSize targetSize: CGSize, options: [String : Any]? = nil) async throws -> PHLivePhoto? + @available(macOS 10.12, *) func saveLivePhoto(to output: PHContentEditingOutput, options: [String : Any]? = nil, completionHandler handler: @escaping (Bool, Error?) -> Void) @available(macOS 10.12, *) + func saveLivePhoto(to output: PHContentEditingOutput, options: [String : Any]? = nil) async throws -> Bool + @available(macOS 10.12, *) func cancel() } @available(macOS 10.12, macOS 10.12, *) diff --git a/macOS/Photos/PHPhotoLibrary.swift b/macOS/Photos/PHPhotoLibrary.swift index d8c76a5..209490f 100644 --- a/macOS/Photos/PHPhotoLibrary.swift +++ b/macOS/Photos/PHPhotoLibrary.swift @@ -26,12 +26,12 @@ enum PHAccessLevel : Int { @available(macOS 10.13, *) protocol PHPhotoLibraryChangeObserver : NSObjectProtocol { @available(macOS 10.13, *) - func photoLibraryDidChange(_ changeInstance: PHChange) + @asyncHandler func photoLibraryDidChange(_ changeInstance: PHChange) } @available(macOS 10.15, *) protocol PHPhotoLibraryAvailabilityObserver : NSObjectProtocol { @available(macOS 10.15, *) - func photoLibraryDidBecomeUnavailable(_ photoLibrary: PHPhotoLibrary) + @asyncHandler func photoLibraryDidBecomeUnavailable(_ photoLibrary: PHPhotoLibrary) } @available(macOS 10.13, *) class PHPhotoLibrary : NSObject { @@ -54,6 +54,8 @@ class PHPhotoLibrary : NSObject { @available(macOS 10.13, *) func performChanges(_ changeBlock: @escaping () -> Void, completionHandler: ((Bool, Error?) -> Void)? = nil) @available(macOS 10.13, *) + func performChanges(_ changeBlock: @escaping () -> Void) async throws -> Bool + @available(macOS 10.13, *) func performChangesAndWait(_ changeBlock: @escaping () -> Void) throws @available(macOS 10.13, *) func register(_ observer: PHPhotoLibraryChangeObserver) diff --git a/macOS/PhotosUI/PHContentEditingController.swift b/macOS/PhotosUI/PHContentEditingController.swift index 08b8e45..9c1a2b5 100644 --- a/macOS/PhotosUI/PHContentEditingController.swift +++ b/macOS/PhotosUI/PHContentEditingController.swift @@ -8,6 +8,8 @@ protocol PHContentEditingController : NSObjectProtocol { @available(macOS 10.11, *) func finishContentEditing(completionHandler: @escaping (PHContentEditingOutput?) -> Void) @available(macOS 10.11, *) + func finishContentEditing() async -> PHContentEditingOutput? + @available(macOS 10.11, *) func cancelContentEditing() @available(macOS 10.11, *) var shouldShowCancelConfirmation: Bool { get } diff --git a/macOS/PhotosUI/PHLivePhotoView.swift b/macOS/PhotosUI/PHLivePhotoView.swift index 2d62aa2..d3f445d 100644 --- a/macOS/PhotosUI/PHLivePhotoView.swift +++ b/macOS/PhotosUI/PHLivePhotoView.swift @@ -45,5 +45,5 @@ protocol PHLivePhotoViewDelegate : NSObjectProtocol { @available(macOS 10.12, *) optional func livePhotoView(_ livePhotoView: PHLivePhotoView, willBeginPlaybackWith playbackStyle: PHLivePhotoViewPlaybackStyle) @available(macOS 10.12, *) - optional func livePhotoView(_ livePhotoView: PHLivePhotoView, didEndPlaybackWith playbackStyle: PHLivePhotoViewPlaybackStyle) + @asyncHandler optional func livePhotoView(_ livePhotoView: PHLivePhotoView, didEndPlaybackWith playbackStyle: PHLivePhotoViewPlaybackStyle) } diff --git a/macOS/PhotosUI/PHProjectExtensionController.swift b/macOS/PhotosUI/PHProjectExtensionController.swift index addd7a1..65db9e8 100644 --- a/macOS/PhotosUI/PHProjectExtensionController.swift +++ b/macOS/PhotosUI/PHProjectExtensionController.swift @@ -8,7 +8,13 @@ protocol PHProjectExtensionController : NSObjectProtocol { @available(macOS 10.13, *) func beginProject(with extensionContext: PHProjectExtensionContext, projectInfo: PHProjectInfo, completion: @escaping (Error?) -> Void) @available(macOS 10.13, *) + func beginProject(with extensionContext: PHProjectExtensionContext, projectInfo: PHProjectInfo) async throws + @available(macOS 10.13, *) func resumeProject(with extensionContext: PHProjectExtensionContext, completion: @escaping (Error?) -> Void) @available(macOS 10.13, *) + func resumeProject(with extensionContext: PHProjectExtensionContext) async throws + @available(macOS 10.13, *) func finishProject(completionHandler completion: @escaping () -> Void) + @available(macOS 10.13, *) + func finishProject() async } diff --git a/macOS/PushKit/PKPushRegistry.swift b/macOS/PushKit/PKPushRegistry.swift index 66fca9c..5ab9533 100644 --- a/macOS/PushKit/PKPushRegistry.swift +++ b/macOS/PushKit/PKPushRegistry.swift @@ -12,9 +12,11 @@ class PKPushRegistry : NSObject { } protocol PKPushRegistryDelegate : NSObjectProtocol { @available(macOS 10.15, *) - func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) + @asyncHandler func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) @available(macOS 10.15, *) - optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) + @asyncHandler optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) @available(macOS 10.15, *) - optional func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType) + optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType) async + @available(macOS 10.15, *) + @asyncHandler optional func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType) } diff --git a/macOS/QuartzCore/CAAnimation.swift b/macOS/QuartzCore/CAAnimation.swift index d832aea..c37137c 100644 --- a/macOS/QuartzCore/CAAnimation.swift +++ b/macOS/QuartzCore/CAAnimation.swift @@ -29,9 +29,9 @@ class CAAnimation : NSObject, NSSecureCoding, NSCopying, CAMediaTiming, CAAction } protocol CAAnimationDelegate : NSObjectProtocol { @available(macOS 10.5, *) - optional func animationDidStart(_ anim: CAAnimation) + @asyncHandler optional func animationDidStart(_ anim: CAAnimation) @available(macOS 10.5, *) - optional func animationDidStop(_ anim: CAAnimation, finished flag: Bool) + @asyncHandler optional func animationDidStop(_ anim: CAAnimation, finished flag: Bool) } @available(macOS 10.5, *) class CAPropertyAnimation : CAAnimation { diff --git a/macOS/QuickLookThumbnailing/QLThumbnailGenerator.swift b/macOS/QuickLookThumbnailing/QLThumbnailGenerator.swift index c4395bf..cec5162 100644 --- a/macOS/QuickLookThumbnailing/QLThumbnailGenerator.swift +++ b/macOS/QuickLookThumbnailing/QLThumbnailGenerator.swift @@ -3,7 +3,9 @@ class QLThumbnailGenerator : NSObject { class var shared: QLThumbnailGenerator { get } func generateBestRepresentation(for request: QLThumbnailGenerator.Request, completion completionHandler: @escaping (QLThumbnailRepresentation?, Error?) -> Void) + func generateBestRepresentation(for request: QLThumbnailGenerator.Request) async throws -> QLThumbnailRepresentation? func generateRepresentations(for request: QLThumbnailGenerator.Request, update updateHandler: ((QLThumbnailRepresentation?, QLThumbnailRepresentation.RepresentationType, Error?) -> Void)? = nil) func cancel(_ request: QLThumbnailGenerator.Request) func saveBestRepresentation(for request: QLThumbnailGenerator.Request, to fileURL: URL, contentType: String, completion completionHandler: @escaping (Error?) -> Void) + func saveBestRepresentation(for request: QLThumbnailGenerator.Request, to fileURL: URL, contentType: String) async throws } diff --git a/macOS/ReplayKit/RPBroadcast.swift b/macOS/ReplayKit/RPBroadcast.swift index 46cfd86..02b3f0a 100644 --- a/macOS/ReplayKit/RPBroadcast.swift +++ b/macOS/ReplayKit/RPBroadcast.swift @@ -2,12 +2,14 @@ class RPBroadcastActivityController : NSObject { @available(macOS 11.0, *) class func showBroadcastPicker(at point: CGPoint, from window: NSWindow?, preferredExtensionIdentifier preferredExtension: String?, completionHandler handler: @escaping (RPBroadcastActivityController?, Error?) -> Void) + @available(macOS 11.0, *) + class func showBroadcastPicker(at point: CGPoint, from window: NSWindow?, preferredExtensionIdentifier preferredExtension: String?) async throws -> RPBroadcastActivityController? weak var delegate: @sil_weak RPBroadcastActivityControllerDelegate? } @available(macOS 11.0, *) protocol RPBroadcastActivityControllerDelegate : NSObjectProtocol { @available(macOS 11.0, *) - func broadcastActivityController(_ broadcastActivityController: RPBroadcastActivityController, didFinishWith broadcastController: RPBroadcastController?, error: Error?) + @asyncHandler func broadcastActivityController(_ broadcastActivityController: RPBroadcastActivityController, didFinishWith broadcastController: RPBroadcastController?, error: Error?) } @available(macOS 11.0, *) class RPBroadcastController : NSObject { @@ -23,7 +25,7 @@ class RPBroadcastController : NSObject { } @available(macOS 11.0, *) protocol RPBroadcastControllerDelegate : NSObjectProtocol { - optional func broadcastController(_ broadcastController: RPBroadcastController, didFinishWithError error: Error?) - optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateServiceInfo serviceInfo: [String : NSCoding & NSObjectProtocol]) - optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateBroadcast broadcastURL: URL) + @asyncHandler optional func broadcastController(_ broadcastController: RPBroadcastController, didFinishWithError error: Error?) + @asyncHandler optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateServiceInfo serviceInfo: [String : NSCoding & NSObjectProtocol]) + @asyncHandler optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateBroadcast broadcastURL: URL) } diff --git a/macOS/ReplayKit/RPBroadcastExtension.swift b/macOS/ReplayKit/RPBroadcastExtension.swift index 421de7b..c6bb237 100644 --- a/macOS/ReplayKit/RPBroadcastExtension.swift +++ b/macOS/ReplayKit/RPBroadcastExtension.swift @@ -3,6 +3,8 @@ extension NSExtensionContext { @available(macOS 11.0, *) func loadBroadcastingApplicationInfo(completion handler: @escaping (String, String, NSImage?) -> Void) @available(macOS 11.0, *) + func loadBroadcastingApplicationInfo() async -> (String, String, NSImage?) + @available(macOS 11.0, *) func completeRequest(withBroadcast broadcastURL: URL, setupInfo: [String : NSCoding & NSObjectProtocol]?) } @available(macOS 11.0, *) diff --git a/macOS/ReplayKit/RPPreviewViewController.swift b/macOS/ReplayKit/RPPreviewViewController.swift index a16efcc..5ac2c24 100644 --- a/macOS/ReplayKit/RPPreviewViewController.swift +++ b/macOS/ReplayKit/RPPreviewViewController.swift @@ -5,7 +5,7 @@ class RPPreviewViewController : NSViewController { } protocol RPPreviewViewControllerDelegate : NSObjectProtocol { @available(macOS 11.0, *) - optional func previewControllerDidFinish(_ previewController: RPPreviewViewController) + @asyncHandler optional func previewControllerDidFinish(_ previewController: RPPreviewViewController) @available(macOS 11.0, *) - optional func previewController(_ previewController: RPPreviewViewController, didFinishWithActivityTypes activityTypes: Set) + @asyncHandler optional func previewController(_ previewController: RPPreviewViewController, didFinishWithActivityTypes activityTypes: Set) } diff --git a/macOS/ReplayKit/RPScreenRecorder.swift b/macOS/ReplayKit/RPScreenRecorder.swift index 673a3d1..fa601ca 100644 --- a/macOS/ReplayKit/RPScreenRecorder.swift +++ b/macOS/ReplayKit/RPScreenRecorder.swift @@ -12,10 +12,14 @@ class RPScreenRecorder : NSObject { func stopRecording(handler: ((RPPreviewViewController?, Error?) -> Void)? = nil) @available(macOS 11.0, *) func stopRecording(withOutput url: URL, completionHandler: ((Error?) -> Void)? = nil) + @available(macOS 11.0, *) + func stopRecording(withOutput url: URL) async throws func discardRecording(handler: @escaping () -> Void) @available(macOS 11.0, *) func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 11.0, *) + func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?) async throws + @available(macOS 11.0, *) func stopCapture(handler: ((Error?) -> Void)? = nil) weak var delegate: @sil_weak RPScreenRecorderDelegate? var isAvailable: Bool { get } @@ -31,6 +35,6 @@ class RPScreenRecorder : NSObject { @available(macOS 11.0, *) protocol RPScreenRecorderDelegate : NSObjectProtocol { @available(macOS 11.0, *) - optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWith previewViewController: RPPreviewViewController?, error: Error?) - optional func screenRecorderDidChangeAvailability(_ screenRecorder: RPScreenRecorder) + @asyncHandler optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWith previewViewController: RPPreviewViewController?, error: Error?) + @asyncHandler optional func screenRecorderDidChangeAvailability(_ screenRecorder: RPScreenRecorder) } diff --git a/macOS/SafariServices/SFContentBlockerManager.swift b/macOS/SafariServices/SFContentBlockerManager.swift index 9a87562..28d5968 100644 --- a/macOS/SafariServices/SFContentBlockerManager.swift +++ b/macOS/SafariServices/SFContentBlockerManager.swift @@ -1,5 +1,7 @@ class SFContentBlockerManager : NSObject { class func reloadContentBlocker(withIdentifier identifier: String, completionHandler: ((Error?) -> Void)? = nil) + class func reloadContentBlocker(withIdentifier identifier: String) async throws class func getStateOfContentBlocker(withIdentifier identifier: String, completionHandler: @escaping (SFContentBlockerState?, Error?) -> Void) + class func getStateOfContentBlocker(withIdentifier identifier: String) async throws -> SFContentBlockerState? } diff --git a/macOS/SafariServices/SFSafariApplication.swift b/macOS/SafariServices/SFSafariApplication.swift index b77732a..e892264 100644 --- a/macOS/SafariServices/SFSafariApplication.swift +++ b/macOS/SafariServices/SFSafariApplication.swift @@ -2,10 +2,16 @@ let SFExtensionMessageKey: String class SFSafariApplication : NSObject { class func getActiveWindow(completionHandler: @escaping (SFSafariWindow?) -> Void) + class func getActiveWindow() async -> SFSafariWindow? class func getAllWindows(completionHandler: @escaping ([SFSafariWindow]) -> Void) + class func getAllWindows() async -> [SFSafariWindow] class func openWindow(with url: URL, completionHandler: ((SFSafariWindow?) -> Void)? = nil) + class func openWindow(with url: URL) async -> SFSafariWindow? class func setToolbarItemsNeedUpdate() class func getHostApplication(completionHandler: @escaping (NSRunningApplication) -> Void) + class func getHostApplication() async -> NSRunningApplication class func showPreferencesForExtension(withIdentifier identifier: String, completionHandler: ((Error?) -> Void)? = nil) + class func showPreferencesForExtension(withIdentifier identifier: String) async throws class func dispatchMessage(withName messageName: String, toExtensionWithIdentifier identifier: String, userInfo: [String : Any]? = nil, completionHandler: ((Error?) -> Void)? = nil) + class func dispatchMessage(withName messageName: String, toExtensionWithIdentifier identifier: String, userInfo: [String : Any]? = nil) async throws } diff --git a/macOS/SafariServices/SFSafariExtension.swift b/macOS/SafariServices/SFSafariExtension.swift index 1b5ad33..7ef696d 100644 --- a/macOS/SafariServices/SFSafariExtension.swift +++ b/macOS/SafariServices/SFSafariExtension.swift @@ -1,4 +1,5 @@ class SFSafariExtension : NSObject { class func getBaseURI(completionHandler: @escaping (URL?) -> Void) + class func getBaseURI() async -> URL? } diff --git a/macOS/SafariServices/SFSafariExtensionHandling.swift b/macOS/SafariServices/SFSafariExtensionHandling.swift index f881cd6..4c41135 100644 --- a/macOS/SafariServices/SFSafariExtensionHandling.swift +++ b/macOS/SafariServices/SFSafariExtensionHandling.swift @@ -7,9 +7,10 @@ protocol SFSafariExtensionHandling : NSObjectProtocol { optional func contextMenuItemSelected(withCommand command: String, in page: SFSafariPage, userInfo: [String : Any]? = nil) optional func validateContextMenuItem(withCommand command: String, in page: SFSafariPage, userInfo: [String : Any]? = nil, validationHandler: @escaping (Bool, String?) -> Void) optional func popoverWillShow(in window: SFSafariWindow) - optional func popoverDidClose(in window: SFSafariWindow) + @asyncHandler optional func popoverDidClose(in window: SFSafariWindow) optional func popoverViewController() -> SFSafariExtensionViewController optional func additionalRequestHeaders(for url: URL, completionHandler: @escaping ([String : String]?) -> Void) + optional func additionalRequestHeaders(for url: URL) async -> [String : String]? optional func contentBlocker(withIdentifier contentBlockerIdentifier: String, blockedResourcesWith urls: [URL], on page: SFSafariPage) optional func page(_ page: SFSafariPage, willNavigateTo url: URL?) } diff --git a/macOS/SafariServices/SFSafariExtensionManager.swift b/macOS/SafariServices/SFSafariExtensionManager.swift index 7fd3c2b..2db9c21 100644 --- a/macOS/SafariServices/SFSafariExtensionManager.swift +++ b/macOS/SafariServices/SFSafariExtensionManager.swift @@ -1,4 +1,5 @@ class SFSafariExtensionManager : NSObject { class func getStateOfSafariExtension(withIdentifier identifier: String, completionHandler: @escaping (SFSafariExtensionState?, Error?) -> Void) + class func getStateOfSafariExtension(withIdentifier identifier: String) async throws -> SFSafariExtensionState? } diff --git a/macOS/SafariServices/SFSafariPage.swift b/macOS/SafariServices/SFSafariPage.swift index 709c6a2..4352abe 100644 --- a/macOS/SafariServices/SFSafariPage.swift +++ b/macOS/SafariServices/SFSafariPage.swift @@ -3,6 +3,9 @@ class SFSafariPage : NSObject, NSCopying, NSSecureCoding { func dispatchMessageToScript(withName messageName: String, userInfo: [String : Any]? = nil) func reload() func getPropertiesWithCompletionHandler(_ completionHandler: @escaping (SFSafariPageProperties?) -> Void) + func getProperties() async -> SFSafariPageProperties? func getContainingTab(completionHandler: @escaping (SFSafariTab) -> Void) + func getContainingTab() async -> SFSafariTab func getScreenshotOfVisibleArea(completionHandler: @escaping (NSImage?) -> Void) + func getScreenshotOfVisibleArea() async -> NSImage? } diff --git a/macOS/SafariServices/SFSafariTab.swift b/macOS/SafariServices/SFSafariTab.swift index 7e7b6a5..d14484a 100644 --- a/macOS/SafariServices/SFSafariTab.swift +++ b/macOS/SafariServices/SFSafariTab.swift @@ -1,9 +1,13 @@ class SFSafariTab : NSObject, NSCopying, NSSecureCoding { func getActivePage(completionHandler: @escaping (SFSafariPage?) -> Void) + func getActivePage() async -> SFSafariPage? func getPagesWithCompletionHandler(_ completionHandler: @escaping ([SFSafariPage]?) -> Void) + func getPages() async -> [SFSafariPage]? func getContainingWindow(completionHandler: @escaping (SFSafariWindow?) -> Void) + func getContainingWindow() async -> SFSafariWindow? func activate(completionHandler: (() -> Void)? = nil) + func activate() async func navigate(to url: URL) func close() } diff --git a/macOS/SafariServices/SFSafariWindow.swift b/macOS/SafariServices/SFSafariWindow.swift index 87380de..dd9dae4 100644 --- a/macOS/SafariServices/SFSafariWindow.swift +++ b/macOS/SafariServices/SFSafariWindow.swift @@ -1,8 +1,12 @@ class SFSafariWindow : NSObject, NSCopying, NSSecureCoding { func getActiveTab(completionHandler: @escaping (SFSafariTab?) -> Void) + func getActiveTab() async -> SFSafariTab? func getAllTabs(completionHandler: @escaping ([SFSafariTab]) -> Void) + func getAllTabs() async -> [SFSafariTab] func openTab(with url: URL, makeActiveIfPossible activateTab: Bool, completionHandler: ((SFSafariTab?) -> Void)? = nil) + func openTab(with url: URL, makeActiveIfPossible activateTab: Bool) async -> SFSafariTab? func getToolbarItem(completionHandler: @escaping (SFSafariToolbarItem?) -> Void) + func getToolbarItem() async -> SFSafariToolbarItem? func close() } diff --git a/macOS/SceneKit/SCNAction.swift b/macOS/SceneKit/SCNAction.swift index 9486e5e..a9c068e 100644 --- a/macOS/SceneKit/SCNAction.swift +++ b/macOS/SceneKit/SCNAction.swift @@ -6,10 +6,14 @@ protocol SCNActionable : NSObjectProtocol { @available(macOS 10.10, *) func runAction(_ action: SCNAction, completionHandler block: (() -> Void)? = nil) @available(macOS 10.10, *) + func runAction(_ action: SCNAction) async + @available(macOS 10.10, *) func runAction(_ action: SCNAction, forKey key: String?) @available(macOS 10.10, *) func runAction(_ action: SCNAction, forKey key: String?, completionHandler block: (() -> Void)? = nil) @available(macOS 10.10, *) + func runAction(_ action: SCNAction, forKey key: String?) async + @available(macOS 10.10, *) var hasActions: Bool { get } @available(macOS 10.10, *) func action(forKey key: String) -> SCNAction? diff --git a/macOS/SceneKit/SCNCameraController.swift b/macOS/SceneKit/SCNCameraController.swift index ee00739..96fe41a 100644 --- a/macOS/SceneKit/SCNCameraController.swift +++ b/macOS/SceneKit/SCNCameraController.swift @@ -14,7 +14,7 @@ enum SCNInteractionMode : Int { @available(macOS 10.13, *) protocol SCNCameraControllerDelegate : NSObjectProtocol { optional func cameraInertiaWillStart(for cameraController: SCNCameraController) - optional func cameraInertiaDidEnd(for cameraController: SCNCameraController) + @asyncHandler optional func cameraInertiaDidEnd(for cameraController: SCNCameraController) } @available(macOS 10.13, *) class SCNCameraController : NSObject { diff --git a/macOS/SceneKit/SCNConstraint.swift b/macOS/SceneKit/SCNConstraint.swift index bc36e0f..b57c418 100644 --- a/macOS/SceneKit/SCNConstraint.swift +++ b/macOS/SceneKit/SCNConstraint.swift @@ -84,7 +84,7 @@ class SCNSliderConstraint : SCNConstraint { @available(macOS 10.13, *) protocol SCNAvoidOccluderConstraintDelegate : NSObjectProtocol { optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, shouldAvoidOccluder occluder: SCNNode, for node: SCNNode) -> Bool - optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, didAvoidOccluder occluder: SCNNode, for node: SCNNode) + @asyncHandler optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, didAvoidOccluder occluder: SCNNode, for node: SCNNode) } @available(macOS 10.13, *) class SCNAvoidOccluderConstraint : SCNConstraint { diff --git a/macOS/SceneKit/SCNPhysicsWorld.swift b/macOS/SceneKit/SCNPhysicsWorld.swift index 558a77d..eb3d159 100644 --- a/macOS/SceneKit/SCNPhysicsWorld.swift +++ b/macOS/SceneKit/SCNPhysicsWorld.swift @@ -29,9 +29,9 @@ extension SCNPhysicsWorld.TestSearchMode { } @available(macOS 10.10, *) protocol SCNPhysicsContactDelegate : NSObjectProtocol { - optional func physicsWorld(_ world: SCNPhysicsWorld, didBegin contact: SCNPhysicsContact) - optional func physicsWorld(_ world: SCNPhysicsWorld, didUpdate contact: SCNPhysicsContact) - optional func physicsWorld(_ world: SCNPhysicsWorld, didEnd contact: SCNPhysicsContact) + @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didBegin contact: SCNPhysicsContact) + @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didUpdate contact: SCNPhysicsContact) + @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didEnd contact: SCNPhysicsContact) } @available(macOS 10.10, *) class SCNPhysicsWorld : NSObject, NSSecureCoding { diff --git a/macOS/SceneKit/SCNSceneRenderer.swift b/macOS/SceneKit/SCNSceneRenderer.swift index 57b51a1..2b49386 100644 --- a/macOS/SceneKit/SCNSceneRenderer.swift +++ b/macOS/SceneKit/SCNSceneRenderer.swift @@ -64,6 +64,8 @@ protocol SCNSceneRenderer : NSObjectProtocol { func prepare(_ object: Any, shouldAbortBlock block: (() -> Bool)? = nil) -> Bool @available(macOS 10.10, *) func prepare(_ objects: [Any], completionHandler: ((Bool) -> Void)? = nil) + @available(macOS 10.10, *) + func prepare(_ objects: [Any]) async -> Bool @available(macOS 10.9, *) var showsStatistics: Bool { get set } @available(macOS 10.11, *) @@ -98,11 +100,11 @@ protocol SCNSceneRendererDelegate : NSObjectProtocol { @available(macOS 10.10, *) optional func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) @available(macOS 10.10, *) - optional func renderer(_ renderer: SCNSceneRenderer, didApplyAnimationsAtTime time: TimeInterval) + @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didApplyAnimationsAtTime time: TimeInterval) @available(macOS 10.10, *) - optional func renderer(_ renderer: SCNSceneRenderer, didSimulatePhysicsAtTime time: TimeInterval) + @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didSimulatePhysicsAtTime time: TimeInterval) @available(macOS 10.13, *) - optional func renderer(_ renderer: SCNSceneRenderer, didApplyConstraintsAtTime time: TimeInterval) + @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didApplyConstraintsAtTime time: TimeInterval) optional func renderer(_ renderer: SCNSceneRenderer, willRenderScene scene: SCNScene, atTime time: TimeInterval) - optional func renderer(_ renderer: SCNSceneRenderer, didRenderScene scene: SCNScene, atTime time: TimeInterval) + @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didRenderScene scene: SCNScene, atTime time: TimeInterval) } diff --git a/macOS/SoundAnalysis/SNAnalyzer.swift b/macOS/SoundAnalysis/SNAnalyzer.swift index 7cf7950..7a6bb6f 100644 --- a/macOS/SoundAnalysis/SNAnalyzer.swift +++ b/macOS/SoundAnalysis/SNAnalyzer.swift @@ -16,5 +16,6 @@ class SNAudioFileAnalyzer : NSObject { func removeAllRequests() func analyze() func analyze(completionHandler: @escaping (Bool) -> Void) + func analyze() async -> Bool func cancelAnalysis() } diff --git a/macOS/SoundAnalysis/SNResult.swift b/macOS/SoundAnalysis/SNResult.swift index 3e45c9b..b61b8b1 100644 --- a/macOS/SoundAnalysis/SNResult.swift +++ b/macOS/SoundAnalysis/SNResult.swift @@ -4,7 +4,7 @@ protocol SNResult : NSObjectProtocol { } @available(macOS 10.15, *) protocol SNResultsObserving : NSObjectProtocol { - func request(_ request: SNRequest, didProduce result: SNResult) - optional func request(_ request: SNRequest, didFailWithError error: Error) - optional func requestDidComplete(_ request: SNRequest) + @asyncHandler func request(_ request: SNRequest, didProduce result: SNResult) + @asyncHandler optional func request(_ request: SNRequest, didFailWithError error: Error) + @asyncHandler optional func requestDidComplete(_ request: SNRequest) } diff --git a/macOS/Speech/SFSpeechRecognitionTask.swift b/macOS/Speech/SFSpeechRecognitionTask.swift index 77f4c28..5e1c672 100644 --- a/macOS/Speech/SFSpeechRecognitionTask.swift +++ b/macOS/Speech/SFSpeechRecognitionTask.swift @@ -20,10 +20,10 @@ class SFSpeechRecognitionTask : NSObject { } @available(macOS 10.15, *) protocol SFSpeechRecognitionTaskDelegate : NSObjectProtocol { - optional func speechRecognitionDidDetectSpeech(_ task: SFSpeechRecognitionTask) - optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didHypothesizeTranscription transcription: SFTranscription) - optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishRecognition recognitionResult: SFSpeechRecognitionResult) + @asyncHandler optional func speechRecognitionDidDetectSpeech(_ task: SFSpeechRecognitionTask) + @asyncHandler optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didHypothesizeTranscription transcription: SFTranscription) + @asyncHandler optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishRecognition recognitionResult: SFSpeechRecognitionResult) optional func speechRecognitionTaskFinishedReadingAudio(_ task: SFSpeechRecognitionTask) optional func speechRecognitionTaskWasCancelled(_ task: SFSpeechRecognitionTask) - optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishSuccessfully successfully: Bool) + @asyncHandler optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishSuccessfully successfully: Bool) } diff --git a/macOS/SpriteKit/SKNode.swift b/macOS/SpriteKit/SKNode.swift index bf8f4da..f94255b 100644 --- a/macOS/SpriteKit/SKNode.swift +++ b/macOS/SpriteKit/SKNode.swift @@ -56,6 +56,7 @@ class SKNode : NSResponder, NSCopying, NSSecureCoding { func inParentHierarchy(_ parent: SKNode) -> Bool func run(_ action: SKAction) func run(_ action: SKAction, completion block: @escaping () -> Void) + func run(_ action: SKAction) async func run(_ action: SKAction, withKey key: String) func hasActions() -> Bool func action(forKey key: String) -> SKAction? diff --git a/macOS/SpriteKit/SKPhysicsWorld.swift b/macOS/SpriteKit/SKPhysicsWorld.swift index 7921b60..4c7d27b 100644 --- a/macOS/SpriteKit/SKPhysicsWorld.swift +++ b/macOS/SpriteKit/SKPhysicsWorld.swift @@ -1,7 +1,7 @@ protocol SKPhysicsContactDelegate : NSObjectProtocol { - optional func didBegin(_ contact: SKPhysicsContact) - optional func didEnd(_ contact: SKPhysicsContact) + @asyncHandler optional func didBegin(_ contact: SKPhysicsContact) + @asyncHandler optional func didEnd(_ contact: SKPhysicsContact) } class SKPhysicsWorld : NSObject, NSSecureCoding { var gravity: CGVector diff --git a/macOS/SpriteKit/SKScene.swift b/macOS/SpriteKit/SKScene.swift index 9faf218..ffa3c5f 100644 --- a/macOS/SpriteKit/SKScene.swift +++ b/macOS/SpriteKit/SKScene.swift @@ -11,10 +11,10 @@ enum SKSceneScaleMode : Int { @available(macOS 10.10, *) protocol SKSceneDelegate : NSObjectProtocol { optional func update(_ currentTime: TimeInterval, for scene: SKScene) - optional func didEvaluateActions(for scene: SKScene) - optional func didSimulatePhysics(for scene: SKScene) - optional func didApplyConstraints(for scene: SKScene) - optional func didFinishUpdate(for scene: SKScene) + @asyncHandler optional func didEvaluateActions(for scene: SKScene) + @asyncHandler optional func didSimulatePhysics(for scene: SKScene) + @asyncHandler optional func didApplyConstraints(for scene: SKScene) + @asyncHandler optional func didFinishUpdate(for scene: SKScene) } class SKScene : SKEffectNode { init(size: CGSize) diff --git a/macOS/SpriteKit/SKTexture.swift b/macOS/SpriteKit/SKTexture.swift index b3c325d..fe1a559 100644 --- a/macOS/SpriteKit/SKTexture.swift +++ b/macOS/SpriteKit/SKTexture.swift @@ -30,7 +30,9 @@ class SKTexture : NSObject, NSCopying, NSSecureCoding { @available(macOS 10.11, *) func cgImage() -> CGImage class func preload(_ textures: [SKTexture], withCompletionHandler completionHandler: @escaping () -> Void) + class func preload(_ textures: [SKTexture]) async func preload(completionHandler: @escaping () -> Void) + func preload() async } extension SKTexture : _CustomPlaygroundQuickLookable { diff --git a/macOS/SpriteKit/SKTextureAtlas.swift b/macOS/SpriteKit/SKTextureAtlas.swift index efe0953..9faca6d 100644 --- a/macOS/SpriteKit/SKTextureAtlas.swift +++ b/macOS/SpriteKit/SKTextureAtlas.swift @@ -5,9 +5,13 @@ class SKTextureAtlas : NSObject, NSSecureCoding { convenience init(dictionary properties: [String : Any]) func textureNamed(_ name: String) -> SKTexture class func preloadTextureAtlases(_ textureAtlases: [SKTextureAtlas], withCompletionHandler completionHandler: @escaping () -> Void) + class func preloadTextureAtlases(_ textureAtlases: [SKTextureAtlas]) async @available(macOS 10.11, *) class func preloadTextureAtlasesNamed(_ atlasNames: [String], withCompletionHandler completionHandler: @escaping (Error?, [SKTextureAtlas]) -> Void) + @available(macOS 10.11, *) + class func preloadTextureAtlasesNamed(_ atlasNames: [String]) async throws -> [SKTextureAtlas] func preload(completionHandler: @escaping () -> Void) + func preload() async var textureNames: [String] { get } } diff --git a/macOS/StoreKit/SKCloudServiceController.swift b/macOS/StoreKit/SKCloudServiceController.swift index 42a7a0c..7312150 100644 --- a/macOS/StoreKit/SKCloudServiceController.swift +++ b/macOS/StoreKit/SKCloudServiceController.swift @@ -25,11 +25,18 @@ class SKCloudServiceController : NSObject { class func requestAuthorization(_ handler: @escaping (SKCloudServiceAuthorizationStatus) -> Void) @available(macOS 11.0, *) func requestCapabilities(completionHandler: @escaping (SKCloudServiceCapability, Error?) -> Void) + @available(macOS 11.0, *) + func requestCapabilities() async throws -> SKCloudServiceCapability func requestStorefrontCountryCode(completionHandler: @escaping (String?, Error?) -> Void) + func requestStorefrontCountryCode() async throws -> String? @available(macOS 11.0, *) func requestStorefrontIdentifier(completionHandler: @escaping (String?, Error?) -> Void) @available(macOS 11.0, *) + func requestStorefrontIdentifier() async throws -> String? + @available(macOS 11.0, *) func requestUserToken(forDeveloperToken developerToken: String, completionHandler: @escaping (String?, Error?) -> Void) + @available(macOS 11.0, *) + func requestUserToken(forDeveloperToken developerToken: String) async throws -> String? } extension NSNotification.Name { @available(macOS 11.0, *) diff --git a/macOS/StoreKit/SKPaymentQueue.swift b/macOS/StoreKit/SKPaymentQueue.swift index c710bb4..422471e 100644 --- a/macOS/StoreKit/SKPaymentQueue.swift +++ b/macOS/StoreKit/SKPaymentQueue.swift @@ -52,7 +52,7 @@ protocol SKPaymentTransactionObserver : NSObjectProtocol { @available(macOS 11.0, *) optional func paymentQueue(_ queue: SKPaymentQueue, shouldAddStorePayment payment: SKPayment, for product: SKProduct) -> Bool @available(macOS 10.15, *) - optional func paymentQueueDidChangeStorefront(_ queue: SKPaymentQueue) + @asyncHandler optional func paymentQueueDidChangeStorefront(_ queue: SKPaymentQueue) @available(macOS 11.0, *) - optional func paymentQueue(_ queue: SKPaymentQueue, didRevokeEntitlementsForProductIdentifiers productIdentifiers: [String]) + @asyncHandler optional func paymentQueue(_ queue: SKPaymentQueue, didRevokeEntitlementsForProductIdentifiers productIdentifiers: [String]) } diff --git a/macOS/StoreKit/SKProductStorePromotionController.swift b/macOS/StoreKit/SKProductStorePromotionController.swift index 6208892..82ae6d9 100644 --- a/macOS/StoreKit/SKProductStorePromotionController.swift +++ b/macOS/StoreKit/SKProductStorePromotionController.swift @@ -14,9 +14,17 @@ class SKProductStorePromotionController : NSObject { @available(macOS 11.0, *) func fetchStorePromotionVisibility(for product: SKProduct, completionHandler: ((SKProductStorePromotionVisibility, Error?) -> Void)? = nil) @available(macOS 11.0, *) + func fetchStorePromotionVisibility(for product: SKProduct) async throws -> SKProductStorePromotionVisibility + @available(macOS 11.0, *) func update(storePromotionVisibility promotionVisibility: SKProductStorePromotionVisibility, for product: SKProduct, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 11.0, *) + func update(storePromotionVisibility promotionVisibility: SKProductStorePromotionVisibility, for product: SKProduct) async throws + @available(macOS 11.0, *) func fetchStorePromotionOrder(completionHandler: (([SKProduct], Error?) -> Void)? = nil) @available(macOS 11.0, *) + func fetchStorePromotionOrder() async throws -> [SKProduct] + @available(macOS 11.0, *) func update(storePromotionOrder: [SKProduct], completionHandler: ((Error?) -> Void)? = nil) + @available(macOS 11.0, *) + func update(storePromotionOrder: [SKProduct]) async throws } diff --git a/macOS/StoreKit/SKProductsRequest.swift b/macOS/StoreKit/SKProductsRequest.swift index 3663a1f..d3560fe 100644 --- a/macOS/StoreKit/SKProductsRequest.swift +++ b/macOS/StoreKit/SKProductsRequest.swift @@ -1,7 +1,7 @@ protocol SKProductsRequestDelegate : SKRequestDelegate { @available(macOS 10.7, *) - func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) + @asyncHandler func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) } @available(macOS 10.7, *) class SKProductsRequest : SKRequest { diff --git a/macOS/StoreKit/SKRequest.swift b/macOS/StoreKit/SKRequest.swift index f5859c8..f050289 100644 --- a/macOS/StoreKit/SKRequest.swift +++ b/macOS/StoreKit/SKRequest.swift @@ -10,7 +10,7 @@ class SKRequest : NSObject { } protocol SKRequestDelegate : NSObjectProtocol { @available(macOS 10.7, *) - optional func requestDidFinish(_ request: SKRequest) + @asyncHandler optional func requestDidFinish(_ request: SKRequest) @available(macOS 10.7, *) - optional func request(_ request: SKRequest, didFailWithError error: Error) + @asyncHandler optional func request(_ request: SKRequest, didFailWithError error: Error) } diff --git a/macOS/StoreKit/SKStoreProductViewController.swift b/macOS/StoreKit/SKStoreProductViewController.swift index 1fa5181..f5ee348 100644 --- a/macOS/StoreKit/SKStoreProductViewController.swift +++ b/macOS/StoreKit/SKStoreProductViewController.swift @@ -8,7 +8,7 @@ class SKStoreProductViewController : NSViewController { } protocol SKStoreProductViewControllerDelegate : NSObjectProtocol { @available(macOS 11.0, *) - optional func productViewControllerDidFinish(_ viewController: SKStoreProductViewController) + @asyncHandler optional func productViewControllerDidFinish(_ viewController: SKStoreProductViewController) } @available(macOS 11.0, *) let SKStoreProductParameterITunesItemIdentifier: String diff --git a/macOS/SystemExtensions/SystemExtensions.swift b/macOS/SystemExtensions/SystemExtensions.swift index d6472ad..9860892 100644 --- a/macOS/SystemExtensions/SystemExtensions.swift +++ b/macOS/SystemExtensions/SystemExtensions.swift @@ -69,9 +69,9 @@ protocol OSSystemExtensionRequestDelegate : NSObjectProtocol { @available(macOS 10.15, *) func requestNeedsUserApproval(_ request: OSSystemExtensionRequest) @available(macOS 10.15, *) - func request(_ request: OSSystemExtensionRequest, didFinishWithResult result: OSSystemExtensionRequest.Result) + @asyncHandler func request(_ request: OSSystemExtensionRequest, didFinishWithResult result: OSSystemExtensionRequest.Result) @available(macOS 10.15, *) - func request(_ request: OSSystemExtensionRequest, didFailWithError error: Error) + @asyncHandler func request(_ request: OSSystemExtensionRequest, didFailWithError error: Error) } @available(macOS 10.15, *) class OSSystemExtensionManager : NSObject { diff --git a/macOS/UserNotifications/UNUserNotificationCenter.swift b/macOS/UserNotifications/UNUserNotificationCenter.swift index 4e6f3e8..7970edd 100644 --- a/macOS/UserNotifications/UNUserNotificationCenter.swift +++ b/macOS/UserNotifications/UNUserNotificationCenter.swift @@ -20,14 +20,20 @@ class UNUserNotificationCenter : NSObject { var supportsContentExtensions: Bool { get } class func current() -> UNUserNotificationCenter func requestAuthorization(options: UNAuthorizationOptions = [], completionHandler: @escaping (Bool, Error?) -> Void) + func requestAuthorization(options: UNAuthorizationOptions = []) async throws -> Bool func setNotificationCategories(_ categories: Set) func getNotificationCategories(completionHandler: @escaping (Set) -> Void) + func getNotificationCategories() async -> Set func getNotificationSettings(completionHandler: @escaping (UNNotificationSettings) -> Void) + func getNotificationSettings() async -> UNNotificationSettings func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + func add(_ request: UNNotificationRequest) async throws func getPendingNotificationRequests(completionHandler: @escaping ([UNNotificationRequest]) -> Void) + func getPendingNotificationRequests() async -> [UNNotificationRequest] func removePendingNotificationRequests(withIdentifiers identifiers: [String]) func removeAllPendingNotificationRequests() func getDeliveredNotifications(completionHandler: @escaping ([UNNotification]) -> Void) + func getDeliveredNotifications() async -> [UNNotification] func removeDeliveredNotifications(withIdentifiers identifiers: [String]) func removeAllDeliveredNotifications() } @@ -49,7 +55,11 @@ protocol UNUserNotificationCenterDelegate : NSObjectProtocol { @available(macOS 10.14, *) optional func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) @available(macOS 10.14, *) - optional func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) + optional func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification) async -> UNNotificationPresentationOptions + @available(macOS 10.14, *) + @asyncHandler optional func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) + @available(macOS 10.14, *) + optional func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async @available(macOS 10.14, *) optional func userNotificationCenter(_ center: UNUserNotificationCenter, openSettingsFor notification: UNNotification?) } diff --git a/macOS/Virtualization/VZVirtioSocketDevice.swift b/macOS/Virtualization/VZVirtioSocketDevice.swift index bc3051b..96cf034 100644 --- a/macOS/Virtualization/VZVirtioSocketDevice.swift +++ b/macOS/Virtualization/VZVirtioSocketDevice.swift @@ -4,6 +4,7 @@ class VZVirtioSocketDevice : VZSocketDevice { func setSocketListener(_ listener: VZVirtioSocketListener, forPort port: UInt32) func removeSocketListener(forPort port: UInt32) func __connect(toPort port: UInt32, completionHandler: @escaping (VZVirtioSocketConnection?, Error?) -> Void) + func __connect(toPort port: UInt32) async throws -> VZVirtioSocketConnection? } extension VZVirtioSocketDevice { diff --git a/macOS/Virtualization/VZVirtualMachine.swift b/macOS/Virtualization/VZVirtualMachine.swift index bd1c6c4..5bbddb0 100644 --- a/macOS/Virtualization/VZVirtualMachine.swift +++ b/macOS/Virtualization/VZVirtualMachine.swift @@ -27,8 +27,11 @@ class VZVirtualMachine : NSObject { var memoryBalloonDevices: [VZMemoryBalloonDevice] { get } var socketDevices: [VZSocketDevice] { get } func __start(completionHandler: @escaping (Error?) -> Void) + func __start() async throws func __pause(completionHandler: @escaping (Error?) -> Void) + func __pause() async throws func __resume(completionHandler: @escaping (Error?) -> Void) + func __resume() async throws func requestStop() throws } diff --git a/macOS/Virtualization/VZVirtualMachineDelegate.swift b/macOS/Virtualization/VZVirtualMachineDelegate.swift index 6efc2fc..ffe8b7b 100644 --- a/macOS/Virtualization/VZVirtualMachineDelegate.swift +++ b/macOS/Virtualization/VZVirtualMachineDelegate.swift @@ -1,7 +1,7 @@ protocol VZVirtualMachineDelegate : NSObjectProtocol { @available(macOS 11.0, *) - optional func guestDidStop(_ virtualMachine: VZVirtualMachine) + @asyncHandler optional func guestDidStop(_ virtualMachine: VZVirtualMachine) @available(macOS 11.0, *) - optional func virtualMachine(_ virtualMachine: VZVirtualMachine, didStopWithError error: Error) + @asyncHandler optional func virtualMachine(_ virtualMachine: VZVirtualMachine, didStopWithError error: Error) } diff --git a/macOS/WebKit/NSAttributedString.swift b/macOS/WebKit/NSAttributedString.swift index 9fabb66..8163fab 100644 --- a/macOS/WebKit/NSAttributedString.swift +++ b/macOS/WebKit/NSAttributedString.swift @@ -11,9 +11,17 @@ extension NSAttributedString { @available(macOS 10.15, *) class func loadFromHTML(request: URLRequest, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], completionHandler: @escaping NSAttributedString.CompletionHandler) @available(macOS 10.15, *) + class func loadFromHTML(request: URLRequest, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString?, [NSAttributedString.DocumentAttributeKey : Any]?) + @available(macOS 10.15, *) class func loadFromHTML(fileURL: URL, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], completionHandler: @escaping NSAttributedString.CompletionHandler) @available(macOS 10.15, *) + class func loadFromHTML(fileURL: URL, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString?, [NSAttributedString.DocumentAttributeKey : Any]?) + @available(macOS 10.15, *) class func loadFromHTML(string: String, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], completionHandler: @escaping NSAttributedString.CompletionHandler) @available(macOS 10.15, *) + class func loadFromHTML(string: String, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString?, [NSAttributedString.DocumentAttributeKey : Any]?) + @available(macOS 10.15, *) class func loadFromHTML(data: Data, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], completionHandler: @escaping NSAttributedString.CompletionHandler) + @available(macOS 10.15, *) + class func loadFromHTML(data: Data, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString?, [NSAttributedString.DocumentAttributeKey : Any]?) } diff --git a/macOS/WebKit/WKContentRuleListStore.swift b/macOS/WebKit/WKContentRuleListStore.swift index 2886b3b..947f24e 100644 --- a/macOS/WebKit/WKContentRuleListStore.swift +++ b/macOS/WebKit/WKContentRuleListStore.swift @@ -4,7 +4,11 @@ class WKContentRuleListStore : NSObject { class func `default`() -> Self! convenience init!(url: URL!) func compileContentRuleList(forIdentifier identifier: String!, encodedContentRuleList: String!, completionHandler: ((WKContentRuleList?, Error?) -> Void)!) + func compileContentRuleList(forIdentifier identifier: String!, encodedContentRuleList: String!) async throws -> WKContentRuleList? func lookUpContentRuleList(forIdentifier identifier: String!, completionHandler: ((WKContentRuleList?, Error?) -> Void)!) + func lookUpContentRuleList(forIdentifier identifier: String!) async throws -> WKContentRuleList? func removeContentRuleList(forIdentifier identifier: String!, completionHandler: ((Error?) -> Void)!) + func removeContentRuleList(forIdentifier identifier: String!) async throws func getAvailableContentRuleListIdentifiers(_ completionHandler: (([String]?) -> Void)!) + func getAvailableContentRuleListIdentifiers() async -> [String]? } diff --git a/macOS/WebKit/WKHTTPCookieStore.swift b/macOS/WebKit/WKHTTPCookieStore.swift index 8118443..198bed5 100644 --- a/macOS/WebKit/WKHTTPCookieStore.swift +++ b/macOS/WebKit/WKHTTPCookieStore.swift @@ -1,13 +1,16 @@ @available(macOS 10.13, *) protocol WKHTTPCookieStoreObserver : NSObjectProtocol { - optional func cookiesDidChange(in cookieStore: WKHTTPCookieStore) + @asyncHandler optional func cookiesDidChange(in cookieStore: WKHTTPCookieStore) } @available(macOS 10.13, *) class WKHTTPCookieStore : NSObject { func getAllCookies(_ completionHandler: @escaping ([HTTPCookie]) -> Void) + func getAllCookies() async -> [HTTPCookie] func setCookie(_ cookie: HTTPCookie, completionHandler: (() -> Void)? = nil) + func setCookie(_ cookie: HTTPCookie) async func delete(_ cookie: HTTPCookie, completionHandler: (() -> Void)? = nil) + func delete(_ cookie: HTTPCookie) async func add(_ observer: WKHTTPCookieStoreObserver) func remove(_ observer: WKHTTPCookieStoreObserver) } diff --git a/macOS/WebKit/WKNavigationDelegate.swift b/macOS/WebKit/WKNavigationDelegate.swift index 3d45fbe..1b7fbf3 100644 --- a/macOS/WebKit/WKNavigationDelegate.swift +++ b/macOS/WebKit/WKNavigationDelegate.swift @@ -21,21 +21,23 @@ protocol WKNavigationDelegate : NSObjectProtocol { @available(macOS 10.10, *) optional func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void) @available(macOS 10.10, *) - optional func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) + @asyncHandler optional func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) @available(macOS 10.10, *) - optional func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) + @asyncHandler optional func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) @available(macOS 10.10, *) - optional func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) + @asyncHandler optional func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) @available(macOS 10.10, *) - optional func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) + @asyncHandler optional func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) @available(macOS 10.10, *) - optional func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) + @asyncHandler optional func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) @available(macOS 10.10, *) - optional func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) + @asyncHandler optional func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) @available(macOS 10.10, *) - optional func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + @asyncHandler optional func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + @available(macOS 10.10, *) + optional func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) @available(macOS 10.11, *) - optional func webViewWebContentProcessDidTerminate(_ webView: WKWebView) + @asyncHandler optional func webViewWebContentProcessDidTerminate(_ webView: WKWebView) @available(macOS 11.0, *) optional func webView(_ webView: WKWebView, authenticationChallenge challenge: URLAuthenticationChallenge, shouldAllowDeprecatedTLS decisionHandler: @escaping (Bool) -> Void) } diff --git a/macOS/WebKit/WKScriptMessageHandler.swift b/macOS/WebKit/WKScriptMessageHandler.swift index 23f978c..be900e1 100644 --- a/macOS/WebKit/WKScriptMessageHandler.swift +++ b/macOS/WebKit/WKScriptMessageHandler.swift @@ -1,5 +1,5 @@ protocol WKScriptMessageHandler : NSObjectProtocol { @available(macOS 10.10, *) - func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) + @asyncHandler func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) } diff --git a/macOS/WebKit/WKScriptMessageHandlerWithReply.swift b/macOS/WebKit/WKScriptMessageHandlerWithReply.swift index f4ba951..bd87703 100644 --- a/macOS/WebKit/WKScriptMessageHandlerWithReply.swift +++ b/macOS/WebKit/WKScriptMessageHandlerWithReply.swift @@ -1,5 +1,5 @@ protocol WKScriptMessageHandlerWithReply : NSObjectProtocol { @available(macOS 11.0, *) - func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage, replyHandler: @escaping (Any?, String?) -> Void) + @asyncHandler func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage, replyHandler: @escaping (Any?, String?) -> Void) } diff --git a/macOS/WebKit/WKUIDelegate.swift b/macOS/WebKit/WKUIDelegate.swift index bc919cc..bcd7c99 100644 --- a/macOS/WebKit/WKUIDelegate.swift +++ b/macOS/WebKit/WKUIDelegate.swift @@ -3,13 +3,21 @@ protocol WKUIDelegate : NSObjectProtocol { @available(macOS 10.10, *) optional func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? @available(macOS 10.11, *) - optional func webViewDidClose(_ webView: WKWebView) + @asyncHandler optional func webViewDidClose(_ webView: WKWebView) @available(macOS 10.10, *) optional func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -> Void) @available(macOS 10.10, *) + optional func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo) async + @available(macOS 10.10, *) optional func webView(_ webView: WKWebView, runJavaScriptConfirmPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping (Bool) -> Void) @available(macOS 10.10, *) + optional func webView(_ webView: WKWebView, runJavaScriptConfirmPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo) async -> Bool + @available(macOS 10.10, *) optional func webView(_ webView: WKWebView, runJavaScriptTextInputPanelWithPrompt prompt: String, defaultText: String?, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping (String?) -> Void) + @available(macOS 10.10, *) + optional func webView(_ webView: WKWebView, runJavaScriptTextInputPanelWithPrompt prompt: String, defaultText: String?, initiatedByFrame frame: WKFrameInfo) async -> String? @available(macOS 10.12, *) optional func webView(_ webView: WKWebView, runOpenPanelWith parameters: WKOpenPanelParameters, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping ([URL]?) -> Void) + @available(macOS 10.12, *) + optional func webView(_ webView: WKWebView, runOpenPanelWith parameters: WKOpenPanelParameters, initiatedByFrame frame: WKFrameInfo) async -> [URL]? } diff --git a/macOS/WebKit/WKURLSchemeTask.swift b/macOS/WebKit/WKURLSchemeTask.swift index 6b7c449..1ddd801 100644 --- a/macOS/WebKit/WKURLSchemeTask.swift +++ b/macOS/WebKit/WKURLSchemeTask.swift @@ -2,8 +2,8 @@ @available(macOS 10.13, *) protocol WKURLSchemeTask : NSObjectProtocol { var request: URLRequest { get } - func didReceive(_ response: URLResponse) - func didReceive(_ data: Data) - func didFinish() - func didFailWithError(_ error: Error) + @asyncHandler func didReceive(_ response: URLResponse) + @asyncHandler func didReceive(_ data: Data) + @asyncHandler func didFinish() + @asyncHandler func didFailWithError(_ error: Error) } diff --git a/macOS/WebKit/WKWebView.swift b/macOS/WebKit/WKWebView.swift index 935fad0..beec324 100644 --- a/macOS/WebKit/WKWebView.swift +++ b/macOS/WebKit/WKWebView.swift @@ -28,16 +28,27 @@ class WKWebView : NSView { func reloadFromOrigin() -> WKNavigation? func stopLoading() func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, Error?) -> Void)? = nil) + func evaluateJavaScript(_ javaScriptString: String) async throws -> Any? @available(macOS 11.0, *) func __evaluateJavaScript(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld, completionHandler: ((Any?, Error?) -> Void)? = nil) @available(macOS 11.0, *) + func __evaluateJavaScript(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any? + @available(macOS 11.0, *) func __callAsyncJavaScript(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld, completionHandler: ((Any?, Error?) -> Void)? = nil) + @available(macOS 11.0, *) + func __callAsyncJavaScript(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any? @available(macOS 10.13, *) func takeSnapshot(with snapshotConfiguration: WKSnapshotConfiguration?, completionHandler: @escaping (NSImage?, Error?) -> Void) + @available(macOS 10.13, *) + func takeSnapshot(with snapshotConfiguration: WKSnapshotConfiguration?) async throws -> NSImage? @available(macOS 11.0, *) func __createPDF(with pdfConfiguration: WKPDFConfiguration?, completionHandler: @escaping (Data?, Error?) -> Void) @available(macOS 11.0, *) + func __createPDF(with pdfConfiguration: WKPDFConfiguration?) async throws -> Data? + @available(macOS 11.0, *) func __createWebArchiveData(completionHandler: @escaping (Data, Error) -> Void) + @available(macOS 11.0, *) + func __createWebArchiveData() async -> (Data, Error) var allowsBackForwardNavigationGestures: Bool @available(macOS 10.11, *) var customUserAgent: String? @@ -50,6 +61,8 @@ class WKWebView : NSView { var pageZoom: CGFloat @available(macOS 11.0, *) func __find(_ string: String, with configuration: WKFindConfiguration?, completionHandler: @escaping (WKFindResult) -> Void) + @available(macOS 11.0, *) + func __find(_ string: String, with configuration: WKFindConfiguration?) async -> WKFindResult @available(macOS 10.13, *) class func handlesURLScheme(_ urlScheme: String) -> Bool @available(macOS 11.0, *) diff --git a/macOS/WebKit/WKWebsiteDataStore.swift b/macOS/WebKit/WKWebsiteDataStore.swift index 9e92d35..eb2ff6b 100644 --- a/macOS/WebKit/WKWebsiteDataStore.swift +++ b/macOS/WebKit/WKWebsiteDataStore.swift @@ -6,8 +6,11 @@ class WKWebsiteDataStore : NSObject, NSSecureCoding { var isPersistent: Bool { get } class func allWebsiteDataTypes() -> Set func fetchDataRecords(ofTypes dataTypes: Set, completionHandler: @escaping ([WKWebsiteDataRecord]) -> Void) + func fetchDataRecords(ofTypes dataTypes: Set) async -> [WKWebsiteDataRecord] func removeData(ofTypes dataTypes: Set, for dataRecords: [WKWebsiteDataRecord], completionHandler: @escaping () -> Void) + func removeData(ofTypes dataTypes: Set, for dataRecords: [WKWebsiteDataRecord]) async func removeData(ofTypes dataTypes: Set, modifiedSince date: Date, completionHandler: @escaping () -> Void) + func removeData(ofTypes dataTypes: Set, modifiedSince date: Date) async @available(macOS 10.13, *) var httpCookieStore: WKHTTPCookieStore { get } } diff --git a/macOS/WebKit/WebDocument.swift b/macOS/WebKit/WebDocument.swift index 67ffdb3..99f277b 100644 --- a/macOS/WebKit/WebDocument.swift +++ b/macOS/WebKit/WebDocument.swift @@ -6,7 +6,7 @@ protocol WebDocumentView : NSObjectProtocol { func setNeedsLayout(_ flag: Bool) func layout() func viewWillMove(toHostWindow hostWindow: NSWindow!) - func viewDidMoveToHostWindow() + @asyncHandler func viewDidMoveToHostWindow() } @available(macOS, introduced: 10.3, deprecated: 10.14) protocol WebDocumentSearching : NSObjectProtocol { diff --git a/macOS/WebKit/WebEditingDelegate.swift b/macOS/WebKit/WebEditingDelegate.swift index 4c48d0a..1edfddd 100644 --- a/macOS/WebKit/WebEditingDelegate.swift +++ b/macOS/WebKit/WebEditingDelegate.swift @@ -18,10 +18,10 @@ protocol WebEditingDelegate : NSObjectProtocol { optional func webView(_ webView: WebView!, shouldApplyStyle style: DOMCSSStyleDeclaration!, toElementsIn range: DOMRange!) -> Bool optional func webView(_ webView: WebView!, shouldChangeTypingStyle currentStyle: DOMCSSStyleDeclaration!, toStyle proposedStyle: DOMCSSStyleDeclaration!) -> Bool optional func webView(_ webView: WebView!, doCommandBy selector: Selector!) -> Bool - optional func webViewDidBeginEditing(_ notification: Notification!) - optional func webViewDidChange(_ notification: Notification!) - optional func webViewDidEndEditing(_ notification: Notification!) - optional func webViewDidChangeTypingStyle(_ notification: Notification!) - optional func webViewDidChangeSelection(_ notification: Notification!) + @asyncHandler optional func webViewDidBeginEditing(_ notification: Notification!) + @asyncHandler optional func webViewDidChange(_ notification: Notification!) + @asyncHandler optional func webViewDidEndEditing(_ notification: Notification!) + @asyncHandler optional func webViewDidChangeTypingStyle(_ notification: Notification!) + @asyncHandler optional func webViewDidChangeSelection(_ notification: Notification!) optional func undoManager(for webView: WebView!) -> UndoManager! } diff --git a/macOS/WebKit/WebFrameLoadDelegate.swift b/macOS/WebKit/WebFrameLoadDelegate.swift index aee1b63..369cd60 100644 --- a/macOS/WebKit/WebFrameLoadDelegate.swift +++ b/macOS/WebKit/WebFrameLoadDelegate.swift @@ -1,18 +1,18 @@ @available(macOS, introduced: 10.3, deprecated: 10.14) protocol WebFrameLoadDelegate : NSObjectProtocol { - optional func webView(_ sender: WebView!, didStartProvisionalLoadFor frame: WebFrame!) - optional func webView(_ sender: WebView!, didReceiveServerRedirectForProvisionalLoadFor frame: WebFrame!) - optional func webView(_ sender: WebView!, didFailProvisionalLoadWithError error: Error!, for frame: WebFrame!) - optional func webView(_ sender: WebView!, didCommitLoadFor frame: WebFrame!) - optional func webView(_ sender: WebView!, didReceiveTitle title: String!, for frame: WebFrame!) - optional func webView(_ sender: WebView!, didReceiveIcon image: NSImage!, for frame: WebFrame!) - optional func webView(_ sender: WebView!, didFinishLoadFor frame: WebFrame!) - optional func webView(_ sender: WebView!, didFailLoadWithError error: Error!, for frame: WebFrame!) - optional func webView(_ sender: WebView!, didChangeLocationWithinPageFor frame: WebFrame!) + @asyncHandler optional func webView(_ sender: WebView!, didStartProvisionalLoadFor frame: WebFrame!) + @asyncHandler optional func webView(_ sender: WebView!, didReceiveServerRedirectForProvisionalLoadFor frame: WebFrame!) + @asyncHandler optional func webView(_ sender: WebView!, didFailProvisionalLoadWithError error: Error!, for frame: WebFrame!) + @asyncHandler optional func webView(_ sender: WebView!, didCommitLoadFor frame: WebFrame!) + @asyncHandler optional func webView(_ sender: WebView!, didReceiveTitle title: String!, for frame: WebFrame!) + @asyncHandler optional func webView(_ sender: WebView!, didReceiveIcon image: NSImage!, for frame: WebFrame!) + @asyncHandler optional func webView(_ sender: WebView!, didFinishLoadFor frame: WebFrame!) + @asyncHandler optional func webView(_ sender: WebView!, didFailLoadWithError error: Error!, for frame: WebFrame!) + @asyncHandler optional func webView(_ sender: WebView!, didChangeLocationWithinPageFor frame: WebFrame!) optional func webView(_ sender: WebView!, willPerformClientRedirectTo URL: URL!, delay seconds: TimeInterval, fire date: Date!, for frame: WebFrame!) - optional func webView(_ sender: WebView!, didCancelClientRedirectFor frame: WebFrame!) + @asyncHandler optional func webView(_ sender: WebView!, didCancelClientRedirectFor frame: WebFrame!) optional func webView(_ sender: WebView!, willClose frame: WebFrame!) - optional func webView(_ webView: WebView!, didClearWindowObject windowObject: WebScriptObject!, for frame: WebFrame!) - optional func webView(_ webView: WebView!, didCreateJavaScriptContext context: JSContext!, for frame: WebFrame!) + @asyncHandler optional func webView(_ webView: WebView!, didClearWindowObject windowObject: WebScriptObject!, for frame: WebFrame!) + @asyncHandler optional func webView(_ webView: WebView!, didCreateJavaScriptContext context: JSContext!, for frame: WebFrame!) } diff --git a/macOS/WebKit/WebResourceLoadDelegate.swift b/macOS/WebKit/WebResourceLoadDelegate.swift index 23b71f4..0e5d498 100644 --- a/macOS/WebKit/WebResourceLoadDelegate.swift +++ b/macOS/WebKit/WebResourceLoadDelegate.swift @@ -3,11 +3,11 @@ protocol WebResourceLoadDelegate : NSObjectProtocol { optional func webView(_ sender: WebView!, identifierForInitialRequest request: URLRequest!, from dataSource: WebDataSource!) -> Any! optional func webView(_ sender: WebView!, resource identifier: Any!, willSend request: URLRequest!, redirectResponse: URLResponse!, from dataSource: WebDataSource!) -> URLRequest! - optional func webView(_ sender: WebView!, resource identifier: Any!, didReceive challenge: URLAuthenticationChallenge!, from dataSource: WebDataSource!) - optional func webView(_ sender: WebView!, resource identifier: Any!, didCancel challenge: URLAuthenticationChallenge!, from dataSource: WebDataSource!) - optional func webView(_ sender: WebView!, resource identifier: Any!, didReceive response: URLResponse!, from dataSource: WebDataSource!) - optional func webView(_ sender: WebView!, resource identifier: Any!, didReceiveContentLength length: Int, from dataSource: WebDataSource!) - optional func webView(_ sender: WebView!, resource identifier: Any!, didFinishLoadingFrom dataSource: WebDataSource!) - optional func webView(_ sender: WebView!, resource identifier: Any!, didFailLoadingWithError error: Error!, from dataSource: WebDataSource!) + @asyncHandler optional func webView(_ sender: WebView!, resource identifier: Any!, didReceive challenge: URLAuthenticationChallenge!, from dataSource: WebDataSource!) + @asyncHandler optional func webView(_ sender: WebView!, resource identifier: Any!, didCancel challenge: URLAuthenticationChallenge!, from dataSource: WebDataSource!) + @asyncHandler optional func webView(_ sender: WebView!, resource identifier: Any!, didReceive response: URLResponse!, from dataSource: WebDataSource!) + @asyncHandler optional func webView(_ sender: WebView!, resource identifier: Any!, didReceiveContentLength length: Int, from dataSource: WebDataSource!) + @asyncHandler optional func webView(_ sender: WebView!, resource identifier: Any!, didFinishLoadingFrom dataSource: WebDataSource!) + @asyncHandler optional func webView(_ sender: WebView!, resource identifier: Any!, didFailLoadingWithError error: Error!, from dataSource: WebDataSource!) optional func webView(_ sender: WebView!, plugInFailedWithError error: Error!, dataSource: WebDataSource!) } diff --git a/tvOS/AVFoundation/AVAssetExportSession.swift b/tvOS/AVFoundation/AVAssetExportSession.swift index 6a5cdac..581242e 100644 --- a/tvOS/AVFoundation/AVAssetExportSession.swift +++ b/tvOS/AVFoundation/AVAssetExportSession.swift @@ -55,6 +55,7 @@ class AVAssetExportSession : NSObject { var status: AVAssetExportSession.Status { get } var error: Error? { get } func exportAsynchronously(completionHandler handler: @escaping () -> Void) + func exportAsynchronously() async var progress: Float { get } func cancelExport() } @@ -63,11 +64,15 @@ extension AVAssetExportSession { class func exportPresets(compatibleWith asset: AVAsset) -> [String] @available(tvOS 9.0, *) class func determineCompatibility(ofExportPreset presetName: String, with asset: AVAsset, outputFileType: AVFileType?, completionHandler handler: @escaping (Bool) -> Void) + @available(tvOS 9.0, *) + class func determineCompatibility(ofExportPreset presetName: String, with asset: AVAsset, outputFileType: AVFileType?) async -> Bool } extension AVAssetExportSession { var supportedFileTypes: [AVFileType] { get } @available(tvOS 9.0, *) func determineCompatibleFileTypes(completionHandler handler: @escaping ([AVFileType]) -> Void) + @available(tvOS 9.0, *) + func determineCompatibleFileTypes() async -> [AVFileType] } extension AVAssetExportSession { var timeRange: CMTimeRange @@ -80,7 +85,11 @@ extension AVAssetExportSession { @available(tvOS 13.0, *) func estimateMaximumDuration(completionHandler handler: @escaping (CMTime, Error?) -> Void) @available(tvOS 13.0, *) + func estimateMaximumDuration() async throws -> CMTime + @available(tvOS 13.0, *) func estimateOutputFileLength(completionHandler handler: @escaping (Int64, Error?) -> Void) + @available(tvOS 13.0, *) + func estimateOutputFileLength() async throws -> Int64 } extension AVAssetExportSession { var metadata: [AVMetadataItem]? diff --git a/tvOS/AVFoundation/AVAssetImageGenerator.swift b/tvOS/AVFoundation/AVAssetImageGenerator.swift index 96fe2f0..1a25451 100644 --- a/tvOS/AVFoundation/AVAssetImageGenerator.swift +++ b/tvOS/AVFoundation/AVAssetImageGenerator.swift @@ -38,6 +38,7 @@ class AVAssetImageGenerator : NSObject { init(asset: AVAsset) func copyCGImage(at requestedTime: CMTime, actualTime: UnsafeMutablePointer?) throws -> CGImage func generateCGImagesAsynchronously(forTimes requestedTimes: [NSValue], completionHandler handler: @escaping AVAssetImageGeneratorCompletionHandler) + func generateCGImagesAsynchronously(forTimes requestedTimes: [NSValue]) async throws -> (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result) func cancelAllCGImageGeneration() } typealias AVAssetImageGeneratorCompletionHandler = (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result, Error?) -> Void diff --git a/tvOS/AVFoundation/AVAssetResourceLoader.swift b/tvOS/AVFoundation/AVAssetResourceLoader.swift index 83d2d2d..21100dd 100644 --- a/tvOS/AVFoundation/AVAssetResourceLoader.swift +++ b/tvOS/AVFoundation/AVAssetResourceLoader.swift @@ -11,11 +11,11 @@ protocol AVAssetResourceLoaderDelegate : NSObjectProtocol { @available(tvOS 9.0, *) optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForRenewalOfRequestedResource renewalRequest: AVAssetResourceRenewalRequest) -> Bool @available(tvOS 9.0, *) - optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel loadingRequest: AVAssetResourceLoadingRequest) + @asyncHandler optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel loadingRequest: AVAssetResourceLoadingRequest) @available(tvOS 9.0, *) optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForResponseTo authenticationChallenge: URLAuthenticationChallenge) -> Bool @available(tvOS 9.0, *) - optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel authenticationChallenge: URLAuthenticationChallenge) + @asyncHandler optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel authenticationChallenge: URLAuthenticationChallenge) } @available(tvOS 12.0, *) class AVAssetResourceLoadingRequestor : NSObject { diff --git a/tvOS/AVFoundation/AVAssetWriter.swift b/tvOS/AVFoundation/AVAssetWriter.swift index 072db39..2821f6a 100644 --- a/tvOS/AVFoundation/AVAssetWriter.swift +++ b/tvOS/AVFoundation/AVAssetWriter.swift @@ -37,6 +37,8 @@ class AVAssetWriter : NSObject { func finishWriting() -> Bool @available(tvOS 9.0, *) func finishWriting(completionHandler handler: @escaping () -> Void) + @available(tvOS 9.0, *) + func finishWriting() async } extension AVAssetWriter { var movieFragmentInterval: CMTime @@ -76,6 +78,6 @@ extension AVAssetWriter { } @available(tvOS 14.0, *) protocol AVAssetWriterDelegate : NSObjectProtocol { - optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType, segmentReport: AVAssetSegmentReport?) - optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType) + @asyncHandler optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType, segmentReport: AVAssetSegmentReport?) + @asyncHandler optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType) } diff --git a/tvOS/AVFoundation/AVAsynchronousKeyValueLoading.swift b/tvOS/AVFoundation/AVAsynchronousKeyValueLoading.swift index a340868..cd4a315 100644 --- a/tvOS/AVFoundation/AVAsynchronousKeyValueLoading.swift +++ b/tvOS/AVFoundation/AVAsynchronousKeyValueLoading.swift @@ -11,4 +11,5 @@ enum AVKeyValueStatus : Int { protocol AVAsynchronousKeyValueLoading { func statusOfValue(forKey key: String, error outError: NSErrorPointer) -> AVKeyValueStatus func loadValuesAsynchronously(forKeys keys: [String], completionHandler handler: (() -> Void)? = nil) + func loadValuesAsynchronously(forKeys keys: [String]) async } diff --git a/tvOS/AVFoundation/AVCaptureDevice.swift b/tvOS/AVFoundation/AVCaptureDevice.swift index d7ccb3b..e28fbff 100644 --- a/tvOS/AVFoundation/AVCaptureDevice.swift +++ b/tvOS/AVFoundation/AVCaptureDevice.swift @@ -64,6 +64,8 @@ extension AVCaptureDevice { var lensPosition: Float { get } @available(tvOS 8.0, *) func setFocusModeLocked(lensPosition: Float, completionHandler handler: ((CMTime) -> Void)? = nil) + @available(tvOS 8.0, *) + func setFocusModeLocked(lensPosition: Float) async -> CMTime } extension AVCaptureDevice { func isExposureModeSupported(_ exposureMode: AVCaptureDevice.ExposureMode) -> Bool @@ -80,6 +82,8 @@ extension AVCaptureDevice { @available(tvOS 8.0, *) func setExposureModeCustom(duration: CMTime, iso ISO: Float, completionHandler handler: ((CMTime) -> Void)? = nil) @available(tvOS 8.0, *) + func setExposureModeCustom(duration: CMTime, iso ISO: Float) async -> CMTime + @available(tvOS 8.0, *) var exposureTargetOffset: Float { get } @available(tvOS 8.0, *) var exposureTargetBias: Float { get } @@ -89,6 +93,8 @@ extension AVCaptureDevice { var maxExposureTargetBias: Float { get } @available(tvOS 8.0, *) func setExposureTargetBias(_ bias: Float, completionHandler handler: ((CMTime) -> Void)? = nil) + @available(tvOS 8.0, *) + func setExposureTargetBias(_ bias: Float) async -> CMTime } extension AVCaptureDevice { } @@ -107,6 +113,8 @@ extension AVCaptureDevice { @available(tvOS 8.0, *) func setWhiteBalanceModeLocked(with whiteBalanceGains: AVCaptureDevice.WhiteBalanceGains, completionHandler handler: ((CMTime) -> Void)? = nil) @available(tvOS 8.0, *) + func setWhiteBalanceModeLocked(with whiteBalanceGains: AVCaptureDevice.WhiteBalanceGains) async -> CMTime + @available(tvOS 8.0, *) func chromaticityValues(for whiteBalanceGains: AVCaptureDevice.WhiteBalanceGains) -> AVCaptureDevice.WhiteBalanceChromaticityValues @available(tvOS 8.0, *) func deviceWhiteBalanceGains(for chromaticityValues: AVCaptureDevice.WhiteBalanceChromaticityValues) -> AVCaptureDevice.WhiteBalanceGains @@ -144,6 +152,8 @@ extension AVCaptureDevice { class func authorizationStatus(for mediaType: AVMediaType) -> AVAuthorizationStatus @available(tvOS 7.0, *) class func requestAccess(for mediaType: AVMediaType, completionHandler handler: @escaping (Bool) -> Void) + @available(tvOS 7.0, *) + class func requestAccess(for mediaType: AVMediaType) async -> Bool } extension AVCaptureDevice { } diff --git a/tvOS/AVFoundation/AVCaptureStillImageOutput.swift b/tvOS/AVFoundation/AVCaptureStillImageOutput.swift index a83c61d..f49c4a2 100644 --- a/tvOS/AVFoundation/AVCaptureStillImageOutput.swift +++ b/tvOS/AVFoundation/AVCaptureStillImageOutput.swift @@ -8,6 +8,10 @@ extension AVCaptureStillImageOutput { var isLensStabilizationDuringBracketedCaptureEnabled: Bool @available(tvOS, introduced: 8.0, deprecated: 10.0, message: "Use AVCapturePhotoOutput setPreparedPhotoSettingsArray:completionHandler: instead.") func prepareToCaptureStillImageBracket(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings], completionHandler handler: @escaping (Bool, Error?) -> Void) + @available(tvOS, introduced: 8.0, deprecated: 10.0, message: "Use AVCapturePhotoOutput setPreparedPhotoSettingsArray:completionHandler: instead.") + func prepareToCaptureStillImageBracket(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings]) async throws -> Bool @available(tvOS, introduced: 8.0, deprecated: 10.0, message: "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead.") func captureStillImageBracketAsynchronously(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings], completionHandler handler: @escaping (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?, Error?) -> Void) + @available(tvOS, introduced: 8.0, deprecated: 10.0, message: "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead.") + func captureStillImageBracketAsynchronously(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings]) async throws -> (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?) } diff --git a/tvOS/AVFoundation/AVContentKeySession.swift b/tvOS/AVFoundation/AVContentKeySession.swift index 0d05b42..95074c0 100644 --- a/tvOS/AVFoundation/AVContentKeySession.swift +++ b/tvOS/AVFoundation/AVContentKeySession.swift @@ -73,16 +73,16 @@ extension AVContentKeyRequest.RetryReason { } @available(tvOS 10.2, *) protocol AVContentKeySessionDelegate : NSObjectProtocol { - func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest) - optional func contentKeySession(_ session: AVContentKeySession, didProvideRenewingContentKeyRequest keyRequest: AVContentKeyRequest) - optional func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVPersistableContentKeyRequest) - optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequest keyRequest: AVContentKeyRequest, didFailWithError err: Error) + @asyncHandler func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest) + @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didProvideRenewingContentKeyRequest keyRequest: AVContentKeyRequest) + @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVPersistableContentKeyRequest) + @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequest keyRequest: AVContentKeyRequest, didFailWithError err: Error) optional func contentKeySession(_ session: AVContentKeySession, shouldRetry keyRequest: AVContentKeyRequest, reason retryReason: AVContentKeyRequest.RetryReason) -> Bool @available(tvOS 12.0, *) optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequestDidSucceed keyRequest: AVContentKeyRequest) - optional func contentKeySessionContentProtectionSessionIdentifierDidChange(_ session: AVContentKeySession) + @asyncHandler optional func contentKeySessionContentProtectionSessionIdentifierDidChange(_ session: AVContentKeySession) @available(tvOS 12.0, *) - optional func contentKeySessionDidGenerateExpiredSessionReport(_ session: AVContentKeySession) + @asyncHandler optional func contentKeySessionDidGenerateExpiredSessionReport(_ session: AVContentKeySession) } @available(tvOS 10.2, *) class AVContentKeyRequest : NSObject { @@ -94,6 +94,7 @@ class AVContentKeyRequest : NSObject { var options: [String : Any] { get } var canProvidePersistableContentKey: Bool { get } func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) + func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil) async throws -> Data? func processContentKeyResponse(_ keyResponse: AVContentKeyResponse) func processContentKeyResponseError(_ error: Error) } diff --git a/tvOS/AVFoundation/AVPlayer.swift b/tvOS/AVFoundation/AVPlayer.swift index 99a62ed..f5504d1 100644 --- a/tvOS/AVFoundation/AVPlayer.swift +++ b/tvOS/AVFoundation/AVPlayer.swift @@ -74,12 +74,18 @@ extension AVPlayer { func seek(to date: Date) @available(tvOS 9.0, *) func seek(to date: Date, completionHandler: @escaping (Bool) -> Void) + @available(tvOS 9.0, *) + func seek(to date: Date) async -> Bool func seek(to time: CMTime) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) @available(tvOS 9.0, *) func seek(to time: CMTime, completionHandler: @escaping (Bool) -> Void) @available(tvOS 9.0, *) + func seek(to time: CMTime) async -> Bool + @available(tvOS 9.0, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: @escaping (Bool) -> Void) + @available(tvOS 9.0, *) + func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool } extension AVPlayer { @available(tvOS 10.0, *) @@ -89,6 +95,8 @@ extension AVPlayer { @available(tvOS 9.0, *) func preroll(atRate rate: Float, completionHandler: ((Bool) -> Void)? = nil) @available(tvOS 9.0, *) + func preroll(atRate rate: Float) async -> Bool + @available(tvOS 9.0, *) func cancelPendingPrerolls() @available(tvOS 9.0, *) var masterClock: CMClock? diff --git a/tvOS/AVFoundation/AVPlayerItem.swift b/tvOS/AVFoundation/AVPlayerItem.swift index 939c171..167c361 100644 --- a/tvOS/AVFoundation/AVPlayerItem.swift +++ b/tvOS/AVFoundation/AVPlayerItem.swift @@ -85,8 +85,12 @@ extension AVPlayerItem { @available(tvOS 9.0, *) func seek(to time: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(tvOS 9.0, *) + func seek(to time: CMTime) async -> Bool + @available(tvOS 9.0, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(tvOS 9.0, *) + func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + @available(tvOS 9.0, *) func cancelPendingSeeks() func currentDate() -> Date? @available(tvOS 9.0, *) diff --git a/tvOS/AVFoundation/AVPlayerItemMediaDataCollector.swift b/tvOS/AVFoundation/AVPlayerItemMediaDataCollector.swift index 4faf98c..ab74a75 100644 --- a/tvOS/AVFoundation/AVPlayerItemMediaDataCollector.swift +++ b/tvOS/AVFoundation/AVPlayerItemMediaDataCollector.swift @@ -11,5 +11,5 @@ class AVPlayerItemMetadataCollector : AVPlayerItemMediaDataCollector { } protocol AVPlayerItemMetadataCollectorPushDelegate : NSObjectProtocol { @available(tvOS 9.3, *) - func metadataCollector(_ metadataCollector: AVPlayerItemMetadataCollector, didCollect metadataGroups: [AVDateRangeMetadataGroup], indexesOfNewGroups: IndexSet, indexesOfModifiedGroups: IndexSet) + @asyncHandler func metadataCollector(_ metadataCollector: AVPlayerItemMetadataCollector, didCollect metadataGroups: [AVDateRangeMetadataGroup], indexesOfNewGroups: IndexSet, indexesOfModifiedGroups: IndexSet) } diff --git a/tvOS/AVFoundation/AVPlayerItemOutput.swift b/tvOS/AVFoundation/AVPlayerItemOutput.swift index 5685491..1d9a353 100644 --- a/tvOS/AVFoundation/AVPlayerItemOutput.swift +++ b/tvOS/AVFoundation/AVPlayerItemOutput.swift @@ -52,7 +52,7 @@ extension AVPlayerItemLegibleOutput.TextStylingResolution { } protocol AVPlayerItemLegibleOutputPushDelegate : AVPlayerItemOutputPushDelegate { @available(tvOS 9.0, *) - optional func legibleOutput(_ output: AVPlayerItemLegibleOutput, didOutputAttributedStrings strings: [NSAttributedString], nativeSampleBuffers nativeSamples: [Any], forItemTime itemTime: CMTime) + @asyncHandler optional func legibleOutput(_ output: AVPlayerItemLegibleOutput, didOutputAttributedStrings strings: [NSAttributedString], nativeSampleBuffers nativeSamples: [Any], forItemTime itemTime: CMTime) } protocol AVPlayerItemOutputPushDelegate : NSObjectProtocol { @available(tvOS 9.0, *) @@ -68,5 +68,5 @@ class AVPlayerItemMetadataOutput : AVPlayerItemOutput { } protocol AVPlayerItemMetadataOutputPushDelegate : AVPlayerItemOutputPushDelegate { @available(tvOS 9.0, *) - optional func metadataOutput(_ output: AVPlayerItemMetadataOutput, didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup], from track: AVPlayerItemTrack?) + @asyncHandler optional func metadataOutput(_ output: AVPlayerItemMetadataOutput, didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup], from track: AVPlayerItemTrack?) } diff --git a/tvOS/AVFoundation/AVSampleBufferAudioRenderer.swift b/tvOS/AVFoundation/AVSampleBufferAudioRenderer.swift index 5046523..23d35d6 100644 --- a/tvOS/AVFoundation/AVSampleBufferAudioRenderer.swift +++ b/tvOS/AVFoundation/AVSampleBufferAudioRenderer.swift @@ -11,6 +11,7 @@ extension AVSampleBufferAudioRenderer { } extension AVSampleBufferAudioRenderer { func flush(fromSourceTime time: CMTime, completionHandler: @escaping (Bool) -> Void) + func flush(fromSourceTime time: CMTime) async -> Bool } extension NSNotification.Name { @available(tvOS 11.0, *) diff --git a/tvOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift b/tvOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift index b0b32f2..e3aaaa7 100644 --- a/tvOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift +++ b/tvOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift @@ -15,6 +15,7 @@ extension AVSampleBufferRenderSynchronizer { var renderers: [AVQueuedSampleBufferRendering] { get } func addRenderer(_ renderer: AVQueuedSampleBufferRendering) func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime, completionHandler: ((Bool) -> Void)? = nil) + func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool } extension AVSampleBufferRenderSynchronizer { func addPeriodicTimeObserver(forInterval interval: CMTime, queue: DispatchQueue?, using block: @escaping (CMTime) -> Void) -> Any diff --git a/tvOS/AVKit/AVContentProposalViewController.swift b/tvOS/AVKit/AVContentProposalViewController.swift index 31d236b..77aa7fe 100644 --- a/tvOS/AVKit/AVContentProposalViewController.swift +++ b/tvOS/AVKit/AVContentProposalViewController.swift @@ -14,6 +14,7 @@ class AVContentProposalViewController : UIViewController { var playerLayoutGuide: UILayoutGuide { get } var dateOfAutomaticAcceptance: Date? func dismissContentProposal(for action: AVContentProposalAction, animated: Bool, completion block: (() -> Void)? = nil) + func dismissContentProposal(for action: AVContentProposalAction, animated: Bool) async } extension AVPlayerViewController { @available(tvOS 10.0, *) diff --git a/tvOS/AVKit/AVPictureInPictureController.swift b/tvOS/AVKit/AVPictureInPictureController.swift index 29a7350..e852c0d 100644 --- a/tvOS/AVKit/AVPictureInPictureController.swift +++ b/tvOS/AVKit/AVPictureInPictureController.swift @@ -24,9 +24,10 @@ class AVPictureInPictureController : NSObject { @available(tvOS 14.0, *) protocol AVPictureInPictureControllerDelegate : NSObjectProtocol { optional func pictureInPictureControllerWillStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) - optional func pictureInPictureControllerDidStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) + @asyncHandler optional func pictureInPictureControllerDidStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, failedToStartPictureInPictureWithError error: Error) optional func pictureInPictureControllerWillStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) - optional func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) + @asyncHandler optional func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void) + optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController) async -> Bool } diff --git a/tvOS/AVKit/AVPlayerItem.swift b/tvOS/AVKit/AVPlayerItem.swift index 593d02a..f2ff594 100644 --- a/tvOS/AVKit/AVPlayerItem.swift +++ b/tvOS/AVKit/AVPlayerItem.swift @@ -24,6 +24,8 @@ extension AVPlayerItem { @available(tvOS 13.0, *) func requestPlaybackRestrictionsAuthorization(_ completion: @escaping (Bool, Error?) -> Void) @available(tvOS 13.0, *) + func requestPlaybackRestrictionsAuthorization() async throws -> Bool + @available(tvOS 13.0, *) func cancelPlaybackRestrictionsAuthorizationRequest() } extension AVPlayerItem { diff --git a/tvOS/AVKit/AVPlayerViewController.swift b/tvOS/AVKit/AVPlayerViewController.swift index 978f47e..d775367 100644 --- a/tvOS/AVKit/AVPlayerViewController.swift +++ b/tvOS/AVKit/AVPlayerViewController.swift @@ -51,17 +51,17 @@ protocol AVPlayerViewControllerDelegate : NSObjectProtocol { @available(tvOS 11.0, *) optional func playerViewControllerWillBeginDismissalTransition(_ playerViewController: AVPlayerViewController) @available(tvOS 11.0, *) - optional func playerViewControllerDidEndDismissalTransition(_ playerViewController: AVPlayerViewController) + @asyncHandler optional func playerViewControllerDidEndDismissalTransition(_ playerViewController: AVPlayerViewController) @available(tvOS 9.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, willPresent interstitial: AVInterstitialTimeRange) @available(tvOS 9.0, *) - optional func playerViewController(_ playerViewController: AVPlayerViewController, didPresent interstitial: AVInterstitialTimeRange) + @asyncHandler optional func playerViewController(_ playerViewController: AVPlayerViewController, didPresent interstitial: AVInterstitialTimeRange) @available(tvOS 9.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, willResumePlaybackAfterUserNavigatedFrom oldTime: CMTime, to targetTime: CMTime) @available(tvOS 10.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, timeToSeekAfterUserNavigatedFrom oldTime: CMTime, to targetTime: CMTime) -> CMTime @available(tvOS 9.0, *) - optional func playerViewController(_ playerViewController: AVPlayerViewController, didSelect mediaSelectionOption: AVMediaSelectionOption?, in mediaSelectionGroup: AVMediaSelectionGroup) + @asyncHandler optional func playerViewController(_ playerViewController: AVPlayerViewController, didSelect mediaSelectionOption: AVMediaSelectionOption?, in mediaSelectionGroup: AVMediaSelectionGroup) @available(tvOS 10.0, *) optional func skipToNextItem(for playerViewController: AVPlayerViewController) @available(tvOS 10.0, *) @@ -69,35 +69,43 @@ protocol AVPlayerViewControllerDelegate : NSObjectProtocol { @available(tvOS 13.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, skipToNextChannel completion: @escaping (Bool) -> Void) @available(tvOS 13.0, *) + optional func playerViewController(_ playerViewController: AVPlayerViewController) async -> Bool + @available(tvOS 13.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, skipToPreviousChannel completion: @escaping (Bool) -> Void) @available(tvOS 13.0, *) + optional func playerViewController(_ playerViewController: AVPlayerViewController) async -> Bool + @available(tvOS 13.0, *) optional func nextChannelInterstitialViewController(for playerViewController: AVPlayerViewController) -> UIViewController @available(tvOS 13.0, *) optional func previousChannelInterstitialViewController(for playerViewController: AVPlayerViewController) -> UIViewController @available(tvOS 10.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, shouldPresent proposal: AVContentProposal) -> Bool @available(tvOS 10.0, *) - optional func playerViewController(_ playerViewController: AVPlayerViewController, didAccept proposal: AVContentProposal) + @asyncHandler optional func playerViewController(_ playerViewController: AVPlayerViewController, didAccept proposal: AVContentProposal) @available(tvOS 10.0, *) - optional func playerViewController(_ playerViewController: AVPlayerViewController, didReject proposal: AVContentProposal) + @asyncHandler optional func playerViewController(_ playerViewController: AVPlayerViewController, didReject proposal: AVContentProposal) @available(tvOS 11.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, willTransitionToVisibilityOfTransportBar visible: Bool, with coordinator: AVPlayerViewControllerAnimationCoordinator) @available(tvOS 9.0, *) optional func playerViewControllerWillStartPictureInPicture(_ playerViewController: AVPlayerViewController) @available(tvOS 9.0, *) - optional func playerViewControllerDidStartPictureInPicture(_ playerViewController: AVPlayerViewController) + @asyncHandler optional func playerViewControllerDidStartPictureInPicture(_ playerViewController: AVPlayerViewController) @available(tvOS 9.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, failedToStartPictureInPictureWithError error: Error) @available(tvOS 9.0, *) optional func playerViewControllerWillStopPictureInPicture(_ playerViewController: AVPlayerViewController) @available(tvOS 9.0, *) - optional func playerViewControllerDidStopPictureInPicture(_ playerViewController: AVPlayerViewController) + @asyncHandler optional func playerViewControllerDidStopPictureInPicture(_ playerViewController: AVPlayerViewController) @available(tvOS 9.0, *) optional func playerViewControllerShouldAutomaticallyDismissAtPictureInPictureStart(_ playerViewController: AVPlayerViewController) -> Bool @available(tvOS 9.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void) + @available(tvOS 9.0, *) + optional func playerViewController(_ playerViewController: AVPlayerViewController) async -> Bool } protocol AVPlayerViewControllerAnimationCoordinator : NSObjectProtocol { @available(tvOS 11.0, *) func addCoordinatedAnimations(_ animations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) + @available(tvOS 11.0, *) + func addCoordinatedAnimations(_ animations: (() -> Void)?) async -> Bool } diff --git a/tvOS/AVKit/AVRoutePickerView.swift b/tvOS/AVKit/AVRoutePickerView.swift index 3fad211..9ff0aee 100644 --- a/tvOS/AVKit/AVRoutePickerView.swift +++ b/tvOS/AVKit/AVRoutePickerView.swift @@ -20,5 +20,5 @@ protocol AVRoutePickerViewDelegate : NSObjectProtocol { @available(tvOS 11.0, *) optional func routePickerViewWillBeginPresentingRoutes(_ routePickerView: AVRoutePickerView) @available(tvOS 11.0, *) - optional func routePickerViewDidEndPresentingRoutes(_ routePickerView: AVRoutePickerView) + @asyncHandler optional func routePickerViewDidEndPresentingRoutes(_ routePickerView: AVRoutePickerView) } diff --git a/tvOS/AppTrackingTransparency/AppTrackingTransparency.swift b/tvOS/AppTrackingTransparency/AppTrackingTransparency.swift index bc371ce..48905eb 100644 --- a/tvOS/AppTrackingTransparency/AppTrackingTransparency.swift +++ b/tvOS/AppTrackingTransparency/AppTrackingTransparency.swift @@ -14,5 +14,6 @@ extension ATTrackingManager { class ATTrackingManager : NSObject { class var trackingAuthorizationStatus: ATTrackingManager.AuthorizationStatus { get } class func requestTrackingAuthorization(completionHandler completion: @escaping (ATTrackingManager.AuthorizationStatus) -> Void) + class func requestTrackingAuthorization() async -> ATTrackingManager.AuthorizationStatus } var AppTrackingTransparencyVersionNumber: Double diff --git a/tvOS/AudioToolbox/AUAudioUnit.swift b/tvOS/AudioToolbox/AUAudioUnit.swift index c2a2457..71ae155 100644 --- a/tvOS/AudioToolbox/AUAudioUnit.swift +++ b/tvOS/AudioToolbox/AUAudioUnit.swift @@ -32,6 +32,7 @@ class AUAudioUnit : NSObject { init(componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = []) throws convenience init(componentDescription: AudioComponentDescription) throws class func instantiate(with componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = [], completionHandler: @escaping (AUAudioUnit?, Error?) -> Void) + class func instantiate(with componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = []) async throws -> AUAudioUnit? var componentDescription: AudioComponentDescription { get } var component: AudioComponent { get } var componentName: String? { get } diff --git a/tvOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift b/tvOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift index a408cb7..44b7a55 100644 --- a/tvOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift +++ b/tvOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift @@ -16,4 +16,5 @@ extension ASAuthorizationAppleIDProvider { class ASAuthorizationAppleIDProvider : NSObject, ASAuthorizationProvider { func createRequest() -> ASAuthorizationAppleIDRequest func getCredentialState(forUserID userID: String, completion: @escaping (ASAuthorizationAppleIDProvider.CredentialState, Error?) -> Void) + func getCredentialState(forUserID userID: String) async throws -> ASAuthorizationAppleIDProvider.CredentialState } diff --git a/tvOS/AuthenticationServices/ASAuthorizationController.swift b/tvOS/AuthenticationServices/ASAuthorizationController.swift index 7696774..249979c 100644 --- a/tvOS/AuthenticationServices/ASAuthorizationController.swift +++ b/tvOS/AuthenticationServices/ASAuthorizationController.swift @@ -1,8 +1,8 @@ @available(tvOS 13.0, *) protocol ASAuthorizationControllerDelegate : NSObjectProtocol { - optional func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) - optional func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) + @asyncHandler optional func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) + @asyncHandler optional func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) } @available(tvOS 13.0, *) protocol ASAuthorizationControllerPresentationContextProviding : NSObjectProtocol { diff --git a/tvOS/BackgroundTasks/BGTaskScheduler.swift b/tvOS/BackgroundTasks/BGTaskScheduler.swift index bae7ae1..d7d9721 100644 --- a/tvOS/BackgroundTasks/BGTaskScheduler.swift +++ b/tvOS/BackgroundTasks/BGTaskScheduler.swift @@ -20,4 +20,5 @@ class BGTaskScheduler : NSObject { func cancel(taskRequestWithIdentifier identifier: String) func cancelAllTaskRequests() func getPendingTaskRequests(completionHandler: @escaping ([BGTaskRequest]) -> Void) + func getPendingTaskRequests() async -> [BGTaskRequest] } diff --git a/tvOS/CloudKit/CKContainer.swift b/tvOS/CloudKit/CKContainer.swift index 12852a7..0a71f0d 100644 --- a/tvOS/CloudKit/CKContainer.swift +++ b/tvOS/CloudKit/CKContainer.swift @@ -51,6 +51,7 @@ extension NSNotification.Name { } extension CKContainer { func accountStatus(completionHandler: @escaping (CKAccountStatus, Error?) -> Void) + func accountStatus() async throws -> CKAccountStatus } @available(tvOS 8.0, *) struct CKContainer_Application_Permissions : OptionSet { @@ -70,32 +71,55 @@ enum CKContainer_Application_PermissionStatus : Int { typealias CKContainer_Application_PermissionBlock = (CKContainer_Application_PermissionStatus, Error?) -> Void extension CKContainer { func status(forApplicationPermission applicationPermission: CKContainer_Application_Permissions, completionHandler: @escaping CKContainer_Application_PermissionBlock) + func status(forApplicationPermission applicationPermission: CKContainer_Application_Permissions) async throws -> CKContainer_Application_PermissionStatus func requestApplicationPermission(_ applicationPermission: CKContainer_Application_Permissions, completionHandler: @escaping CKContainer_Application_PermissionBlock) + func requestApplicationPermission(_ applicationPermission: CKContainer_Application_Permissions) async throws -> CKContainer_Application_PermissionStatus } extension CKContainer { func fetchUserRecordID(completionHandler: @escaping (CKRecord.ID?, Error?) -> Void) + func fetchUserRecordID() async throws -> CKRecord.ID? @available(tvOS 10.0, *) func discoverUserIdentity(withEmailAddress email: String, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(tvOS 10.0, *) + func discoverUserIdentity(withEmailAddress email: String) async throws -> CKUserIdentity? + @available(tvOS 10.0, *) func discoverUserIdentity(withPhoneNumber phoneNumber: String, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(tvOS 10.0, *) + func discoverUserIdentity(withPhoneNumber phoneNumber: String) async throws -> CKUserIdentity? + @available(tvOS 10.0, *) func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) + @available(tvOS 10.0, *) + func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKUserIdentity? } extension CKContainer { @available(tvOS 10.0, *) func fetchShareParticipant(withEmailAddress emailAddress: String, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(tvOS 10.0, *) + func fetchShareParticipant(withEmailAddress emailAddress: String) async throws -> CKShare.Participant? + @available(tvOS 10.0, *) func fetchShareParticipant(withPhoneNumber phoneNumber: String, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(tvOS 10.0, *) + func fetchShareParticipant(withPhoneNumber phoneNumber: String) async throws -> CKShare.Participant? + @available(tvOS 10.0, *) func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(tvOS 10.0, *) + func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKShare.Participant? + @available(tvOS 10.0, *) func fetchShareMetadata(with url: URL, completionHandler: @escaping (CKShare.Metadata?, Error?) -> Void) @available(tvOS 10.0, *) + func fetchShareMetadata(with url: URL) async throws -> CKShare.Metadata? + @available(tvOS 10.0, *) func accept(_ metadata: CKShare.Metadata, completionHandler: @escaping (CKShare?, Error?) -> Void) + @available(tvOS 10.0, *) + func accept(_ metadata: CKShare.Metadata) async throws -> CKShare? } extension CKContainer { @available(tvOS 9.2, *) func __fetchAllLongLivedOperationIDs(completionHandler: @escaping ([String]?, Error?) -> Void) @available(tvOS 9.2, *) + func __fetchAllLongLivedOperationIDs() async throws -> [String]? + @available(tvOS 9.2, *) func __fetchLongLivedOperation(withID operationID: String, completionHandler: @escaping (CKOperation?, Error?) -> Void) + @available(tvOS 9.2, *) + func __fetchLongLivedOperation(withID operationID: String) async throws -> CKOperation? } diff --git a/tvOS/CloudKit/CKDatabase.swift b/tvOS/CloudKit/CKDatabase.swift index 96873a5..77b2225 100644 --- a/tvOS/CloudKit/CKDatabase.swift +++ b/tvOS/CloudKit/CKDatabase.swift @@ -25,19 +25,35 @@ class CKDatabase : NSObject { } extension CKDatabase { func fetch(withRecordID recordID: CKRecord.ID, completionHandler: @escaping (CKRecord?, Error?) -> Void) + func fetch(withRecordID recordID: CKRecord.ID) async throws -> CKRecord? func save(_ record: CKRecord, completionHandler: @escaping (CKRecord?, Error?) -> Void) + func save(_ record: CKRecord) async throws -> CKRecord? func delete(withRecordID recordID: CKRecord.ID, completionHandler: @escaping (CKRecord.ID?, Error?) -> Void) + func delete(withRecordID recordID: CKRecord.ID) async throws -> CKRecord.ID? func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?, completionHandler: @escaping ([CKRecord]?, Error?) -> Void) + func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?) async throws -> [CKRecord]? func fetchAllRecordZones(completionHandler: @escaping ([CKRecordZone]?, Error?) -> Void) + func fetchAllRecordZones() async throws -> [CKRecordZone]? func fetch(withRecordZoneID zoneID: CKRecordZone.ID, completionHandler: @escaping (CKRecordZone?, Error?) -> Void) + func fetch(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone? func save(_ zone: CKRecordZone, completionHandler: @escaping (CKRecordZone?, Error?) -> Void) + func save(_ zone: CKRecordZone) async throws -> CKRecordZone? func delete(withRecordZoneID zoneID: CKRecordZone.ID, completionHandler: @escaping (CKRecordZone.ID?, Error?) -> Void) + func delete(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone.ID? @available(tvOS 9.0, *) func __fetch(withSubscriptionID subscriptionID: String, completionHandler: @escaping (CKSubscription?, Error?) -> Void) @available(tvOS 9.0, *) + func __fetch(withSubscriptionID subscriptionID: String) async throws -> CKSubscription? + @available(tvOS 9.0, *) func fetchAllSubscriptions(completionHandler: @escaping ([CKSubscription]?, Error?) -> Void) @available(tvOS 9.0, *) + func fetchAllSubscriptions() async throws -> [CKSubscription]? + @available(tvOS 9.0, *) func save(_ subscription: CKSubscription, completionHandler: @escaping (CKSubscription?, Error?) -> Void) @available(tvOS 9.0, *) + func save(_ subscription: CKSubscription) async throws -> CKSubscription? + @available(tvOS 9.0, *) func __delete(withSubscriptionID subscriptionID: String, completionHandler: @escaping (String?, Error?) -> Void) + @available(tvOS 9.0, *) + func __delete(withSubscriptionID subscriptionID: String) async throws -> String? } diff --git a/tvOS/CoreBluetooth/CBCentralManager.swift b/tvOS/CoreBluetooth/CBCentralManager.swift index 74a64d4..aa43f9f 100644 --- a/tvOS/CoreBluetooth/CBCentralManager.swift +++ b/tvOS/CoreBluetooth/CBCentralManager.swift @@ -47,19 +47,19 @@ class CBCentralManager : CBManager { } protocol CBCentralManagerDelegate : NSObjectProtocol { @available(tvOS 5.0, *) - func centralManagerDidUpdateState(_ central: CBCentralManager) + @asyncHandler func centralManagerDidUpdateState(_ central: CBCentralManager) @available(tvOS 5.0, *) optional func centralManager(_ central: CBCentralManager, willRestoreState dict: [String : Any]) @available(tvOS 5.0, *) - optional func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) + @asyncHandler optional func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) @available(tvOS 5.0, *) - optional func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) + @asyncHandler optional func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) @available(tvOS 5.0, *) - optional func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) + @asyncHandler optional func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) @available(tvOS 5.0, *) - optional func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) + @asyncHandler optional func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) @available(tvOS 13.0, *) optional func centralManager(_ central: CBCentralManager, connectionEventDidOccur event: CBConnectionEvent, for peripheral: CBPeripheral) @available(tvOS 13.0, *) - optional func centralManager(_ central: CBCentralManager, didUpdateANCSAuthorizationFor peripheral: CBPeripheral) + @asyncHandler optional func centralManager(_ central: CBCentralManager, didUpdateANCSAuthorizationFor peripheral: CBPeripheral) } diff --git a/tvOS/CoreBluetooth/CBPeripheral.swift b/tvOS/CoreBluetooth/CBPeripheral.swift index 3683a5d..9c2d6a6 100644 --- a/tvOS/CoreBluetooth/CBPeripheral.swift +++ b/tvOS/CoreBluetooth/CBPeripheral.swift @@ -44,33 +44,33 @@ class CBPeripheral : CBPeer { } protocol CBPeripheralDelegate : NSObjectProtocol { @available(tvOS 6.0, *) - optional func peripheralDidUpdateName(_ peripheral: CBPeripheral) + @asyncHandler optional func peripheralDidUpdateName(_ peripheral: CBPeripheral) @available(tvOS 7.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]) @available(tvOS, introduced: 5.0, deprecated: 8.0) - optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, error: Error?) + @asyncHandler optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, error: Error?) @available(tvOS 8.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didReadRSSI RSSI: NSNumber, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didReadRSSI RSSI: NSNumber, error: Error?) @available(tvOS 5.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) @available(tvOS 5.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesFor service: CBService, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesFor service: CBService, error: Error?) @available(tvOS 5.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) @available(tvOS 5.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) @available(tvOS 5.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) @available(tvOS 5.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: Error?) @available(tvOS 5.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didDiscoverDescriptorsFor characteristic: CBCharacteristic, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverDescriptorsFor characteristic: CBCharacteristic, error: Error?) @available(tvOS 5.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor descriptor: CBDescriptor, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor descriptor: CBDescriptor, error: Error?) @available(tvOS 5.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor descriptor: CBDescriptor, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor descriptor: CBDescriptor, error: Error?) @available(tvOS 5.0, *) optional func peripheralIsReady(toSendWriteWithoutResponse peripheral: CBPeripheral) @available(tvOS 11.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?) } diff --git a/tvOS/CoreBluetooth/CBPeripheralManager.swift b/tvOS/CoreBluetooth/CBPeripheralManager.swift index 97eb23c..c12b461 100644 --- a/tvOS/CoreBluetooth/CBPeripheralManager.swift +++ b/tvOS/CoreBluetooth/CBPeripheralManager.swift @@ -48,27 +48,27 @@ class CBPeripheralManager : CBManager { } protocol CBPeripheralManagerDelegate : NSObjectProtocol { @available(tvOS 6.0, *) - func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) + @asyncHandler func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) @available(tvOS 6.0, *) optional func peripheralManager(_ peripheral: CBPeripheralManager, willRestoreState dict: [String : Any]) @available(tvOS 6.0, *) - optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error: Error?) + @asyncHandler optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error: Error?) @available(tvOS 6.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) @available(tvOS 6.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didSubscribeTo characteristic: CBCharacteristic) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didSubscribeTo characteristic: CBCharacteristic) @available(tvOS 6.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didUnsubscribeFrom characteristic: CBCharacteristic) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didUnsubscribeFrom characteristic: CBCharacteristic) @available(tvOS 6.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveRead request: CBATTRequest) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveRead request: CBATTRequest) @available(tvOS 6.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) @available(tvOS 6.0, *) optional func peripheralManagerIsReady(toUpdateSubscribers peripheral: CBPeripheralManager) @available(tvOS 6.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) @available(tvOS 6.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didUnpublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didUnpublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) @available(tvOS 11.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: Error?) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: Error?) } diff --git a/tvOS/CoreData/NSFetchedResultsController.swift b/tvOS/CoreData/NSFetchedResultsController.swift index bf886f9..6bcdbdc 100644 --- a/tvOS/CoreData/NSFetchedResultsController.swift +++ b/tvOS/CoreData/NSFetchedResultsController.swift @@ -34,15 +34,15 @@ enum NSFetchedResultsChangeType : UInt { } protocol NSFetchedResultsControllerDelegate : NSObjectProtocol { @available(tvOS 13.0, *) - optional func controller(_ controller: NSFetchedResultsController, didChangeContentWith diff: CollectionDifference) + @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChangeContentWith diff: CollectionDifference) @available(tvOS 3.0, *) - optional func controller(_ controller: NSFetchedResultsController, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) + @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) @available(tvOS 3.0, *) - optional func controller(_ controller: NSFetchedResultsController, didChange sectionInfo: NSFetchedResultsSectionInfo, atSectionIndex sectionIndex: Int, for type: NSFetchedResultsChangeType) + @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChange sectionInfo: NSFetchedResultsSectionInfo, atSectionIndex sectionIndex: Int, for type: NSFetchedResultsChangeType) @available(tvOS 3.0, *) optional func controllerWillChangeContent(_ controller: NSFetchedResultsController) @available(tvOS 3.0, *) - optional func controllerDidChangeContent(_ controller: NSFetchedResultsController) + @asyncHandler optional func controllerDidChangeContent(_ controller: NSFetchedResultsController) @available(tvOS 4.0, *) optional func controller(_ controller: NSFetchedResultsController, sectionIndexTitleForSectionName sectionName: String) -> String? } diff --git a/tvOS/CoreData/NSPersistentContainer.swift b/tvOS/CoreData/NSPersistentContainer.swift index 1343e4e..f5c45a4 100644 --- a/tvOS/CoreData/NSPersistentContainer.swift +++ b/tvOS/CoreData/NSPersistentContainer.swift @@ -10,6 +10,7 @@ class NSPersistentContainer : NSObject { convenience init(name: String) init(name: String, managedObjectModel model: NSManagedObjectModel) func loadPersistentStores(completionHandler block: @escaping (NSPersistentStoreDescription, Error?) -> Void) + func loadPersistentStores() async throws -> NSPersistentStoreDescription func newBackgroundContext() -> NSManagedObjectContext func performBackgroundTask(_ block: @escaping (NSManagedObjectContext) -> Void) } diff --git a/tvOS/CoreData/NSPersistentStoreCoordinator.swift b/tvOS/CoreData/NSPersistentStoreCoordinator.swift index fa8dd96..2490ea3 100644 --- a/tvOS/CoreData/NSPersistentStoreCoordinator.swift +++ b/tvOS/CoreData/NSPersistentStoreCoordinator.swift @@ -79,6 +79,8 @@ class NSPersistentStoreCoordinator : NSObject { func addPersistentStore(ofType storeType: String, configurationName configuration: String?, at storeURL: URL?, options: [AnyHashable : Any]? = nil) throws -> NSPersistentStore @available(tvOS 10.0, *) func addPersistentStore(with storeDescription: NSPersistentStoreDescription, completionHandler block: @escaping (NSPersistentStoreDescription, Error?) -> Void) + @available(tvOS 10.0, *) + func addPersistentStore(with storeDescription: NSPersistentStoreDescription) async throws -> NSPersistentStoreDescription func remove(_ store: NSPersistentStore) throws func setMetadata(_ metadata: [String : Any]?, for store: NSPersistentStore) func metadata(for store: NSPersistentStore) -> [String : Any] diff --git a/tvOS/CoreHaptics/CHHapticEngine.swift b/tvOS/CoreHaptics/CHHapticEngine.swift index b553173..73ced75 100644 --- a/tvOS/CoreHaptics/CHHapticEngine.swift +++ b/tvOS/CoreHaptics/CHHapticEngine.swift @@ -35,8 +35,10 @@ class CHHapticEngine : NSObject { var isAutoShutdownEnabled: Bool init() throws func start(completionHandler: CHHapticEngine.CompletionHandler? = nil) + func start() async throws func start() throws func stop(completionHandler: CHHapticEngine.CompletionHandler? = nil) + func stop() async throws func notifyWhenPlayersFinished(finishedHandler: @escaping CHHapticEngine.FinishedHandler) func makePlayer(with pattern: CHHapticPattern) throws -> CHHapticPatternPlayer func makeAdvancedPlayer(with pattern: CHHapticPattern) throws -> CHHapticAdvancedPatternPlayer diff --git a/tvOS/CoreLocation/CLGeocoder.swift b/tvOS/CoreLocation/CLGeocoder.swift index f45b52e..e1c0502 100644 --- a/tvOS/CoreLocation/CLGeocoder.swift +++ b/tvOS/CoreLocation/CLGeocoder.swift @@ -4,14 +4,23 @@ typealias CLGeocodeCompletionHandler = ([CLPlacemark]?, Error?) -> Void class CLGeocoder : NSObject { var isGeocoding: Bool { get } func reverseGeocodeLocation(_ location: CLLocation, completionHandler: @escaping CLGeocodeCompletionHandler) + func reverseGeocodeLocation(_ location: CLLocation) async throws -> [CLPlacemark]? @available(tvOS 11.0, *) func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?, completionHandler: @escaping CLGeocodeCompletionHandler) + @available(tvOS 11.0, *) + func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?) async throws -> [CLPlacemark]? @available(tvOS, introduced: 5.0, deprecated: 11.0, message: "Use -geocodePostalAddress:completionHandler:") func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any], completionHandler: @escaping CLGeocodeCompletionHandler) + @available(tvOS, introduced: 5.0, deprecated: 11.0, message: "Use -geocodePostalAddress:completionHandler:") + func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any]) async throws -> [CLPlacemark]? func geocodeAddressString(_ addressString: String, completionHandler: @escaping CLGeocodeCompletionHandler) + func geocodeAddressString(_ addressString: String) async throws -> [CLPlacemark]? func geocodeAddressString(_ addressString: String, in region: CLRegion?, completionHandler: @escaping CLGeocodeCompletionHandler) + func geocodeAddressString(_ addressString: String, in region: CLRegion?) async throws -> [CLPlacemark]? @available(tvOS 11.0, *) func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?, completionHandler: @escaping CLGeocodeCompletionHandler) + @available(tvOS 11.0, *) + func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?) async throws -> [CLPlacemark]? func cancelGeocode() } extension CLGeocoder { diff --git a/tvOS/CoreLocation/CLLocationManager.swift b/tvOS/CoreLocation/CLLocationManager.swift index f5a1fcd..fcf098d 100644 --- a/tvOS/CoreLocation/CLLocationManager.swift +++ b/tvOS/CoreLocation/CLLocationManager.swift @@ -56,6 +56,8 @@ class CLLocationManager : NSObject { @available(tvOS 14.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String, completion: ((Error?) -> Void)? = nil) @available(tvOS 14.0, *) + func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) async throws + @available(tvOS 14.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) func stopUpdatingLocation() @available(tvOS 9.0, *) diff --git a/tvOS/CoreLocation/CLLocationManagerDelegate.swift b/tvOS/CoreLocation/CLLocationManagerDelegate.swift index db4e715..689be8b 100644 --- a/tvOS/CoreLocation/CLLocationManagerDelegate.swift +++ b/tvOS/CoreLocation/CLLocationManagerDelegate.swift @@ -1,11 +1,11 @@ protocol CLLocationManagerDelegate : NSObjectProtocol { @available(tvOS 6.0, *) - optional func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) @available(tvOS 2.0, *) - optional func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) @available(tvOS, introduced: 9.0, deprecated: 14.0) - optional func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) @available(tvOS 14.0, *) - optional func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) + @asyncHandler optional func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) } diff --git a/tvOS/CoreML/MLModel.swift b/tvOS/CoreML/MLModel.swift index 0909e8f..b34e079 100644 --- a/tvOS/CoreML/MLModel.swift +++ b/tvOS/CoreML/MLModel.swift @@ -9,6 +9,8 @@ class MLModel : NSObject { convenience init(contentsOf url: URL, configuration: MLModelConfiguration) throws @available(tvOS 14.0, *) class func __loadContents(of url: URL, configuration: MLModelConfiguration, completionHandler handler: @escaping (MLModel?, Error?) -> Void) + @available(tvOS 14.0, *) + class func __loadContents(of url: URL, configuration: MLModelConfiguration) async throws -> MLModel? func prediction(from input: MLFeatureProvider) throws -> MLFeatureProvider func prediction(from input: MLFeatureProvider, options: MLPredictionOptions) throws -> MLFeatureProvider @available(tvOS 12.0, *) diff --git a/tvOS/CoreSpotlight/CSSearchableIndex.swift b/tvOS/CoreSpotlight/CSSearchableIndex.swift index 9120f10..94533df 100644 --- a/tvOS/CoreSpotlight/CSSearchableIndex.swift +++ b/tvOS/CoreSpotlight/CSSearchableIndex.swift @@ -2,5 +2,7 @@ extension CSSearchableIndex { func beginBatch() func endBatch(withClientState clientState: Data, completionHandler: ((Error?) -> Void)? = nil) + func endBatch(withClientState clientState: Data) async throws func fetchLastClientState(completionHandler: @escaping (Data?, Error?) -> Void) + func fetchLastClientState() async throws -> Data? } diff --git a/tvOS/DeviceCheck/DCDevice.swift b/tvOS/DeviceCheck/DCDevice.swift index c051ad2..af4307b 100644 --- a/tvOS/DeviceCheck/DCDevice.swift +++ b/tvOS/DeviceCheck/DCDevice.swift @@ -4,4 +4,5 @@ class DCDevice : NSObject { class var current: DCDevice { get } var isSupported: Bool { get } func generateToken(completionHandler completion: @escaping (Data?, Error?) -> Void) + func generateToken() async throws -> Data? } diff --git a/tvOS/ExternalAccessory/EAAccessory.swift b/tvOS/ExternalAccessory/EAAccessory.swift index 1f4f241..31a6935 100644 --- a/tvOS/ExternalAccessory/EAAccessory.swift +++ b/tvOS/ExternalAccessory/EAAccessory.swift @@ -27,5 +27,5 @@ class EAAccessory : NSObject { } protocol EAAccessoryDelegate : NSObjectProtocol { @available(tvOS 10.0, *) - optional func accessoryDidDisconnect(_ accessory: EAAccessory) + @asyncHandler optional func accessoryDidDisconnect(_ accessory: EAAccessory) } diff --git a/tvOS/ExternalAccessory/EAAccessoryManager.swift b/tvOS/ExternalAccessory/EAAccessoryManager.swift index f06f2a2..d16a71d 100644 --- a/tvOS/ExternalAccessory/EAAccessoryManager.swift +++ b/tvOS/ExternalAccessory/EAAccessoryManager.swift @@ -26,6 +26,8 @@ class EAAccessoryManager : NSObject { class func shared() -> EAAccessoryManager @available(tvOS 6, *) func showBluetoothAccessoryPicker(withNameFilter predicate: NSPredicate?, completion: EABluetoothAccessoryPickerCompletion? = nil) + @available(tvOS 6, *) + func showBluetoothAccessoryPicker(withNameFilter predicate: NSPredicate?) async throws @available(tvOS 10.0, *) func registerForLocalNotifications() @available(tvOS 10.0, *) diff --git a/tvOS/Foundation/NSBundle.swift b/tvOS/Foundation/NSBundle.swift index 5a6fbe0..caee5f0 100644 --- a/tvOS/Foundation/NSBundle.swift +++ b/tvOS/Foundation/NSBundle.swift @@ -99,7 +99,9 @@ class NSBundleResourceRequest : NSObject, ProgressReporting { var tags: Set { get } var bundle: Bundle { get } func beginAccessingResources(completionHandler: @escaping (Error?) -> Void) + func beginAccessingResources() async throws func conditionallyBeginAccessingResources(completionHandler: @escaping (Bool) -> Void) + func conditionallyBeginAccessingResources() async -> Bool func endAccessingResources() } extension Bundle { diff --git a/tvOS/Foundation/NSExtensionContext.swift b/tvOS/Foundation/NSExtensionContext.swift index 1f2cc3b..cc7589c 100644 --- a/tvOS/Foundation/NSExtensionContext.swift +++ b/tvOS/Foundation/NSExtensionContext.swift @@ -3,8 +3,10 @@ class NSExtensionContext : NSObject { var inputItems: [Any] { get } func completeRequest(returningItems items: [Any]?, completionHandler: ((Bool) -> Void)? = nil) + func completeRequest(returningItems items: [Any]?) async -> Bool func cancelRequest(withError error: Error) func open(_ URL: URL, completionHandler: ((Bool) -> Void)? = nil) + func open(_ URL: URL) async -> Bool } @available(tvOS 9.0, *) let NSExtensionItemsAndErrorsKey: String diff --git a/tvOS/Foundation/NSFilePresenter.swift b/tvOS/Foundation/NSFilePresenter.swift index 0a0a77e..046e6ba 100644 --- a/tvOS/Foundation/NSFilePresenter.swift +++ b/tvOS/Foundation/NSFilePresenter.swift @@ -6,23 +6,26 @@ protocol NSFilePresenter : NSObjectProtocol { optional func relinquishPresentedItem(toReader reader: @escaping ((() -> Void)?) -> Void) optional func relinquishPresentedItem(toWriter writer: @escaping ((() -> Void)?) -> Void) optional func savePresentedItemChanges(completionHandler: @escaping (Error?) -> Void) + optional func savePresentedItemChanges() async throws optional func accommodatePresentedItemDeletion(completionHandler: @escaping (Error?) -> Void) - optional func presentedItemDidMove(to newURL: URL) - optional func presentedItemDidChange() + optional func accommodatePresentedItemDeletion() async throws + @asyncHandler optional func presentedItemDidMove(to newURL: URL) + @asyncHandler optional func presentedItemDidChange() @available(tvOS 9.0, *) - optional func presentedItemDidGain(_ version: NSFileVersion) + @asyncHandler optional func presentedItemDidGain(_ version: NSFileVersion) @available(tvOS 9.0, *) - optional func presentedItemDidLose(_ version: NSFileVersion) + @asyncHandler optional func presentedItemDidLose(_ version: NSFileVersion) @available(tvOS 9.0, *) - optional func presentedItemDidResolveConflict(_ version: NSFileVersion) + @asyncHandler optional func presentedItemDidResolveConflict(_ version: NSFileVersion) optional func accommodatePresentedSubitemDeletion(at url: URL, completionHandler: @escaping (Error?) -> Void) - optional func presentedSubitemDidAppear(at url: URL) - optional func presentedSubitem(at oldURL: URL, didMoveTo newURL: URL) - optional func presentedSubitemDidChange(at url: URL) + optional func accommodatePresentedSubitemDeletion(at url: URL) async throws + @asyncHandler optional func presentedSubitemDidAppear(at url: URL) + @asyncHandler optional func presentedSubitem(at oldURL: URL, didMoveTo newURL: URL) + @asyncHandler optional func presentedSubitemDidChange(at url: URL) @available(tvOS 9.0, *) - optional func presentedSubitem(at url: URL, didGain version: NSFileVersion) + @asyncHandler optional func presentedSubitem(at url: URL, didGain version: NSFileVersion) @available(tvOS 9.0, *) - optional func presentedSubitem(at url: URL, didLose version: NSFileVersion) + @asyncHandler optional func presentedSubitem(at url: URL, didLose version: NSFileVersion) @available(tvOS 9.0, *) - optional func presentedSubitem(at url: URL, didResolve version: NSFileVersion) + @asyncHandler optional func presentedSubitem(at url: URL, didResolve version: NSFileVersion) } diff --git a/tvOS/Foundation/NSFileVersion.swift b/tvOS/Foundation/NSFileVersion.swift index 6a04bd0..189d108 100644 --- a/tvOS/Foundation/NSFileVersion.swift +++ b/tvOS/Foundation/NSFileVersion.swift @@ -18,6 +18,8 @@ class NSFileVersion : NSObject { class func unresolvedConflictVersionsOfItem(at url: URL) -> [NSFileVersion]? @available(tvOS 9.0, *) class func getNonlocalVersionsOfItem(at url: URL, completionHandler: @escaping ([NSFileVersion]?, Error?) -> Void) + @available(tvOS 9.0, *) + class func getNonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion]? class func version(itemAt url: URL, forPersistentIdentifier persistentIdentifier: Any) -> NSFileVersion? var url: URL { get } var localizedName: String? { get } diff --git a/tvOS/Foundation/NSHTTPCookieStorage.swift b/tvOS/Foundation/NSHTTPCookieStorage.swift index 7ecdaed..72e231f 100644 --- a/tvOS/Foundation/NSHTTPCookieStorage.swift +++ b/tvOS/Foundation/NSHTTPCookieStorage.swift @@ -29,6 +29,8 @@ extension HTTPCookieStorage { func storeCookies(_ cookies: [HTTPCookie], for task: URLSessionTask) @available(tvOS 9.0, *) func getCookiesFor(_ task: URLSessionTask, completionHandler: @escaping ([HTTPCookie]?) -> Void) + @available(tvOS 9.0, *) + func getCookiesFor(_ task: URLSessionTask) async -> [HTTPCookie]? } extension NSNotification.Name { @available(tvOS 9.0, *) diff --git a/tvOS/Foundation/NSItemProvider.swift b/tvOS/Foundation/NSItemProvider.swift index fd9d22e..2991cdb 100644 --- a/tvOS/Foundation/NSItemProvider.swift +++ b/tvOS/Foundation/NSItemProvider.swift @@ -75,6 +75,7 @@ class NSItemProvider : NSObject, NSCopying { convenience init?(contentsOf fileURL: URL!) func registerItem(forTypeIdentifier typeIdentifier: String, loadHandler: @escaping NSItemProvider.LoadHandler) func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil, completionHandler: NSItemProvider.CompletionHandler? = nil) + func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding? } @available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) @@ -93,6 +94,8 @@ extension NSItemProvider { var previewImageHandler: NSItemProvider.LoadHandler? @available(tvOS 9.0, *) func loadPreviewImage(options: [AnyHashable : Any]! = [:], completionHandler: NSItemProvider.CompletionHandler!) + @available(tvOS 9.0, *) + func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding? } @available(tvOS 9.0, *) let NSExtensionJavaScriptPreprocessingResultsKey: String diff --git a/tvOS/Foundation/NSKeyedArchiver.swift b/tvOS/Foundation/NSKeyedArchiver.swift index f3e8ff0..68035b9 100644 --- a/tvOS/Foundation/NSKeyedArchiver.swift +++ b/tvOS/Foundation/NSKeyedArchiver.swift @@ -80,17 +80,17 @@ extension NSKeyedUnarchiver { } protocol NSKeyedArchiverDelegate : NSObjectProtocol { optional func archiver(_ archiver: NSKeyedArchiver, willEncode object: Any) -> Any? - optional func archiver(_ archiver: NSKeyedArchiver, didEncode object: Any?) + @asyncHandler optional func archiver(_ archiver: NSKeyedArchiver, didEncode object: Any?) optional func archiver(_ archiver: NSKeyedArchiver, willReplace object: Any?, with newObject: Any?) optional func archiverWillFinish(_ archiver: NSKeyedArchiver) - optional func archiverDidFinish(_ archiver: NSKeyedArchiver) + @asyncHandler optional func archiverDidFinish(_ archiver: NSKeyedArchiver) } protocol NSKeyedUnarchiverDelegate : NSObjectProtocol { optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, cannotDecodeObjectOfClassName name: String, originalClasses classNames: [String]) -> AnyClass? optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, didDecode object: Any?) -> Any? optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, willReplace object: Any, with newObject: Any) optional func unarchiverWillFinish(_ unarchiver: NSKeyedUnarchiver) - optional func unarchiverDidFinish(_ unarchiver: NSKeyedUnarchiver) + @asyncHandler optional func unarchiverDidFinish(_ unarchiver: NSKeyedUnarchiver) } extension NSObject { var classForKeyedArchiver: AnyClass? { get } diff --git a/tvOS/Foundation/NSNetServices.swift b/tvOS/Foundation/NSNetServices.swift index 5b6142e..c90ce47 100644 --- a/tvOS/Foundation/NSNetServices.swift +++ b/tvOS/Foundation/NSNetServices.swift @@ -72,23 +72,23 @@ class NetServiceBrowser : NSObject { @available(tvOS 9.0, *) protocol NetServiceDelegate : NSObjectProtocol { optional func netServiceWillPublish(_ sender: NetService) - optional func netServiceDidPublish(_ sender: NetService) - optional func netService(_ sender: NetService, didNotPublish errorDict: [String : NSNumber]) + @asyncHandler optional func netServiceDidPublish(_ sender: NetService) + @asyncHandler optional func netService(_ sender: NetService, didNotPublish errorDict: [String : NSNumber]) optional func netServiceWillResolve(_ sender: NetService) - optional func netServiceDidResolveAddress(_ sender: NetService) - optional func netService(_ sender: NetService, didNotResolve errorDict: [String : NSNumber]) - optional func netServiceDidStop(_ sender: NetService) - optional func netService(_ sender: NetService, didUpdateTXTRecord data: Data) + @asyncHandler optional func netServiceDidResolveAddress(_ sender: NetService) + @asyncHandler optional func netService(_ sender: NetService, didNotResolve errorDict: [String : NSNumber]) + @asyncHandler optional func netServiceDidStop(_ sender: NetService) + @asyncHandler optional func netService(_ sender: NetService, didUpdateTXTRecord data: Data) @available(tvOS 9.0, *) - optional func netService(_ sender: NetService, didAcceptConnectionWith inputStream: InputStream, outputStream: OutputStream) + @asyncHandler optional func netService(_ sender: NetService, didAcceptConnectionWith inputStream: InputStream, outputStream: OutputStream) } @available(tvOS 9.0, *) protocol NetServiceBrowserDelegate : NSObjectProtocol { optional func netServiceBrowserWillSearch(_ browser: NetServiceBrowser) - optional func netServiceBrowserDidStopSearch(_ browser: NetServiceBrowser) - optional func netServiceBrowser(_ browser: NetServiceBrowser, didNotSearch errorDict: [String : NSNumber]) - optional func netServiceBrowser(_ browser: NetServiceBrowser, didFindDomain domainString: String, moreComing: Bool) - optional func netServiceBrowser(_ browser: NetServiceBrowser, didFind service: NetService, moreComing: Bool) - optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemoveDomain domainString: String, moreComing: Bool) - optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemove service: NetService, moreComing: Bool) + @asyncHandler optional func netServiceBrowserDidStopSearch(_ browser: NetServiceBrowser) + @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didNotSearch errorDict: [String : NSNumber]) + @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didFindDomain domainString: String, moreComing: Bool) + @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didFind service: NetService, moreComing: Bool) + @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemoveDomain domainString: String, moreComing: Bool) + @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemove service: NetService, moreComing: Bool) } diff --git a/tvOS/Foundation/NSURLCache.swift b/tvOS/Foundation/NSURLCache.swift index d352fa7..b0f3363 100644 --- a/tvOS/Foundation/NSURLCache.swift +++ b/tvOS/Foundation/NSURLCache.swift @@ -46,5 +46,7 @@ extension URLCache { @available(tvOS 9.0, *) func getCachedResponse(for dataTask: URLSessionDataTask, completionHandler: @escaping (CachedURLResponse?) -> Void) @available(tvOS 9.0, *) + func getCachedResponse(for dataTask: URLSessionDataTask) async -> CachedURLResponse? + @available(tvOS 9.0, *) func removeCachedResponse(for dataTask: URLSessionDataTask) } diff --git a/tvOS/Foundation/NSURLConnection.swift b/tvOS/Foundation/NSURLConnection.swift index 79a2e76..66a69a4 100644 --- a/tvOS/Foundation/NSURLConnection.swift +++ b/tvOS/Foundation/NSURLConnection.swift @@ -22,31 +22,31 @@ class NSURLConnection : NSObject { } @available(tvOS 9.0, *) protocol NSURLConnectionDelegate : NSObjectProtocol { - optional func connection(_ connection: NSURLConnection, didFailWithError error: Error) + @asyncHandler optional func connection(_ connection: NSURLConnection, didFailWithError error: Error) optional func connectionShouldUseCredentialStorage(_ connection: NSURLConnection) -> Bool optional func connection(_ connection: NSURLConnection, willSendRequestFor challenge: URLAuthenticationChallenge) @available(tvOS, introduced: 9.0, deprecated: 9.0, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") optional func connection(_ connection: NSURLConnection, canAuthenticateAgainstProtectionSpace protectionSpace: URLProtectionSpace) -> Bool @available(tvOS, introduced: 9.0, deprecated: 9.0, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") - optional func connection(_ connection: NSURLConnection, didReceive challenge: URLAuthenticationChallenge) + @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive challenge: URLAuthenticationChallenge) @available(tvOS, introduced: 9.0, deprecated: 9.0, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") - optional func connection(_ connection: NSURLConnection, didCancel challenge: URLAuthenticationChallenge) + @asyncHandler optional func connection(_ connection: NSURLConnection, didCancel challenge: URLAuthenticationChallenge) } @available(tvOS 9.0, *) protocol NSURLConnectionDataDelegate : NSURLConnectionDelegate { optional func connection(_ connection: NSURLConnection, willSend request: URLRequest, redirectResponse response: URLResponse?) -> URLRequest? - optional func connection(_ connection: NSURLConnection, didReceive response: URLResponse) - optional func connection(_ connection: NSURLConnection, didReceive data: Data) + @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive response: URLResponse) + @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive data: Data) optional func connection(_ connection: NSURLConnection, needNewBodyStream request: URLRequest) -> InputStream? - optional func connection(_ connection: NSURLConnection, didSendBodyData bytesWritten: Int, totalBytesWritten: Int, totalBytesExpectedToWrite: Int) + @asyncHandler optional func connection(_ connection: NSURLConnection, didSendBodyData bytesWritten: Int, totalBytesWritten: Int, totalBytesExpectedToWrite: Int) optional func connection(_ connection: NSURLConnection, willCacheResponse cachedResponse: CachedURLResponse) -> CachedURLResponse? - optional func connectionDidFinishLoading(_ connection: NSURLConnection) + @asyncHandler optional func connectionDidFinishLoading(_ connection: NSURLConnection) } @available(tvOS 9.0, *) protocol NSURLConnectionDownloadDelegate : NSURLConnectionDelegate { - optional func connection(_ connection: NSURLConnection, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, expectedTotalBytes: Int64) - optional func connectionDidResumeDownloading(_ connection: NSURLConnection, totalBytesWritten: Int64, expectedTotalBytes: Int64) - func connectionDidFinishDownloading(_ connection: NSURLConnection, destinationURL: URL) + @asyncHandler optional func connection(_ connection: NSURLConnection, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, expectedTotalBytes: Int64) + @asyncHandler optional func connectionDidResumeDownloading(_ connection: NSURLConnection, totalBytesWritten: Int64, expectedTotalBytes: Int64) + @asyncHandler func connectionDidFinishDownloading(_ connection: NSURLConnection, destinationURL: URL) } extension NSURLConnection { @available(tvOS, introduced: 9.0, deprecated: 9.0, message: "Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h") @@ -55,4 +55,6 @@ extension NSURLConnection { extension NSURLConnection { @available(tvOS, introduced: 9.0, deprecated: 9.0, message: "Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h") class func sendAsynchronousRequest(_ request: URLRequest, queue: OperationQueue, completionHandler handler: @escaping (URLResponse?, Data?, Error?) -> Void) + @available(tvOS, introduced: 9.0, deprecated: 9.0, message: "Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h") + class func sendAsynchronousRequest(_ request: URLRequest, queue: OperationQueue) async throws -> (URLResponse?, Data?) } diff --git a/tvOS/Foundation/NSURLCredentialStorage.swift b/tvOS/Foundation/NSURLCredentialStorage.swift index 0bf89ea..9681e5c 100644 --- a/tvOS/Foundation/NSURLCredentialStorage.swift +++ b/tvOS/Foundation/NSURLCredentialStorage.swift @@ -15,12 +15,16 @@ extension URLCredentialStorage { @available(tvOS 9.0, *) func getCredentials(for protectionSpace: URLProtectionSpace, task: URLSessionTask, completionHandler: @escaping ([String : URLCredential]?) -> Void) @available(tvOS 9.0, *) + func getCredentials(for protectionSpace: URLProtectionSpace, task: URLSessionTask) async -> [String : URLCredential]? + @available(tvOS 9.0, *) func set(_ credential: URLCredential, for protectionSpace: URLProtectionSpace, task: URLSessionTask) @available(tvOS 9.0, *) func remove(_ credential: URLCredential, for protectionSpace: URLProtectionSpace, options: [String : Any]? = nil, task: URLSessionTask) @available(tvOS 9.0, *) func getDefaultCredential(for space: URLProtectionSpace, task: URLSessionTask, completionHandler: @escaping (URLCredential?) -> Void) @available(tvOS 9.0, *) + func getDefaultCredential(for space: URLProtectionSpace, task: URLSessionTask) async -> URLCredential? + @available(tvOS 9.0, *) func setDefaultCredential(_ credential: URLCredential, for protectionSpace: URLProtectionSpace, task: URLSessionTask) } extension NSNotification.Name { diff --git a/tvOS/Foundation/NSURLProtocol.swift b/tvOS/Foundation/NSURLProtocol.swift index deb3dfe..b8b7495 100644 --- a/tvOS/Foundation/NSURLProtocol.swift +++ b/tvOS/Foundation/NSURLProtocol.swift @@ -3,12 +3,12 @@ protocol URLProtocolClient : NSObjectProtocol { func urlProtocol(_ protocol: URLProtocol, wasRedirectedTo request: URLRequest, redirectResponse: URLResponse) func urlProtocol(_ protocol: URLProtocol, cachedResponseIsValid cachedResponse: CachedURLResponse) - func urlProtocol(_ protocol: URLProtocol, didReceive response: URLResponse, cacheStoragePolicy policy: URLCache.StoragePolicy) - func urlProtocol(_ protocol: URLProtocol, didLoad data: Data) - func urlProtocolDidFinishLoading(_ protocol: URLProtocol) - func urlProtocol(_ protocol: URLProtocol, didFailWithError error: Error) - func urlProtocol(_ protocol: URLProtocol, didReceive challenge: URLAuthenticationChallenge) - func urlProtocol(_ protocol: URLProtocol, didCancel challenge: URLAuthenticationChallenge) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didReceive response: URLResponse, cacheStoragePolicy policy: URLCache.StoragePolicy) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didLoad data: Data) + @asyncHandler func urlProtocolDidFinishLoading(_ protocol: URLProtocol) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didFailWithError error: Error) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didReceive challenge: URLAuthenticationChallenge) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didCancel challenge: URLAuthenticationChallenge) } @available(tvOS 9.0, *) class URLProtocol : NSObject { diff --git a/tvOS/Foundation/NSURLSession.swift b/tvOS/Foundation/NSURLSession.swift index 17487bb..d5a8d4e 100644 --- a/tvOS/Foundation/NSURLSession.swift +++ b/tvOS/Foundation/NSURLSession.swift @@ -13,10 +13,15 @@ class URLSession : NSObject { func finishTasksAndInvalidate() func invalidateAndCancel() func reset(completionHandler: @escaping () -> Void) + func reset() async func flush(completionHandler: @escaping () -> Void) + func flush() async func getTasksWithCompletionHandler(_ completionHandler: @escaping ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) -> Void) + func getTasks() async -> ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) @available(tvOS 9.0, *) func getAllTasks(completionHandler: @escaping ([URLSessionTask]) -> Void) + @available(tvOS 9.0, *) + func getAllTasks() async -> [URLSessionTask] func dataTask(with request: URLRequest) -> URLSessionDataTask func dataTask(with url: URL) -> URLSessionDataTask func uploadTask(with request: URLRequest, fromFile fileURL: URL) -> URLSessionUploadTask @@ -119,11 +124,14 @@ class URLSessionUploadTask : URLSessionDataTask { @available(tvOS 9.0, *) class URLSessionDownloadTask : URLSessionTask { func cancel(byProducingResumeData completionHandler: @escaping (Data?) -> Void) + func cancelByProducingResumeData() async -> Data? } @available(tvOS 9.0, *) class URLSessionStreamTask : URLSessionTask { func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval, completionHandler: @escaping (Data?, Bool, Error?) -> Void) + func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval) async throws -> (Data?, Bool) func write(_ data: Data, timeout: TimeInterval, completionHandler: @escaping (Error?) -> Void) + func write(_ data: Data, timeout: TimeInterval) async throws func captureStreams() func closeWrite() func closeRead() @@ -169,7 +177,9 @@ extension URLSessionWebSocketTask { @available(tvOS 13.0, *) class URLSessionWebSocketTask : URLSessionTask { func __send(_ message: __NSURLSessionWebSocketMessage, completionHandler: @escaping (Error?) -> Void) + func __send(_ message: __NSURLSessionWebSocketMessage) async throws func __receiveMessage(completionHandler: @escaping (__NSURLSessionWebSocketMessage?, Error?) -> Void) + func __receiveMessage() async throws -> __NSURLSessionWebSocketMessage? func sendPing(pongReceiveHandler: @escaping (Error?) -> Void) func cancel(with closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) var maximumMessageSize: Int @@ -264,51 +274,59 @@ extension URLSession { } @available(tvOS 9.0, *) protocol URLSessionDelegate : NSObjectProtocol { - optional func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) - optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + @asyncHandler optional func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) + @asyncHandler optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) @available(tvOS 9.0, *) - optional func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) + @asyncHandler optional func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) } @available(tvOS 9.0, *) protocol URLSessionTaskDelegate : URLSessionDelegate { @available(tvOS 11.0, *) optional func urlSession(_ session: URLSession, task: URLSessionTask, willBeginDelayedRequest request: URLRequest, completionHandler: @escaping (URLSession.DelayedRequestDisposition, URLRequest?) -> Void) @available(tvOS 11.0, *) + optional func urlSession(_ session: URLSession, task: URLSessionTask, willBeginDelayedRequest request: URLRequest) async -> (URLSession.DelayedRequestDisposition, URLRequest?) + @available(tvOS 11.0, *) optional func urlSession(_ session: URLSession, taskIsWaitingForConnectivity task: URLSessionTask) optional func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest, completionHandler: @escaping (URLRequest?) -> Void) - optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest) async -> URLRequest? + @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) optional func urlSession(_ session: URLSession, task: URLSessionTask, needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) - optional func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) + optional func urlSession(_ session: URLSession, task: URLSessionTask) async -> InputStream? + @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) @available(tvOS 10.0, *) - optional func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) - optional func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) + @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) + @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) } @available(tvOS 9.0, *) protocol URLSessionDataDelegate : URLSessionTaskDelegate { - optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) - optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome downloadTask: URLSessionDownloadTask) + @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse) async -> URLSession.ResponseDisposition + @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome downloadTask: URLSessionDownloadTask) @available(tvOS 9.0, *) - optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome streamTask: URLSessionStreamTask) - optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) + @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome streamTask: URLSessionStreamTask) + @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse, completionHandler: @escaping (CachedURLResponse?) -> Void) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse) async -> CachedURLResponse? } @available(tvOS 9.0, *) protocol URLSessionDownloadDelegate : URLSessionTaskDelegate { - func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) - optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) - optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) + @asyncHandler func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) + @asyncHandler optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) + @asyncHandler optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) } @available(tvOS 9.0, *) protocol URLSessionStreamDelegate : URLSessionTaskDelegate { optional func urlSession(_ session: URLSession, readClosedFor streamTask: URLSessionStreamTask) optional func urlSession(_ session: URLSession, writeClosedFor streamTask: URLSessionStreamTask) optional func urlSession(_ session: URLSession, betterRouteDiscoveredFor streamTask: URLSessionStreamTask) - optional func urlSession(_ session: URLSession, streamTask: URLSessionStreamTask, didBecome inputStream: InputStream, outputStream: OutputStream) + @asyncHandler optional func urlSession(_ session: URLSession, streamTask: URLSessionStreamTask, didBecome inputStream: InputStream, outputStream: OutputStream) } @available(tvOS 13.0, *) protocol URLSessionWebSocketDelegate : URLSessionTaskDelegate { - optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) - optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) + @asyncHandler optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) + @asyncHandler optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) } @available(tvOS 9.0, *) let NSURLSessionDownloadTaskResumeData: String diff --git a/tvOS/Foundation/NSUserActivity.swift b/tvOS/Foundation/NSUserActivity.swift index 6511687..965ef64 100644 --- a/tvOS/Foundation/NSUserActivity.swift +++ b/tvOS/Foundation/NSUserActivity.swift @@ -26,6 +26,7 @@ class NSUserActivity : NSObject { func resignCurrent() func invalidate() func getContinuationStreams(completionHandler: @escaping (InputStream?, OutputStream?, Error?) -> Void) + func getContinuationStreams() async throws -> (InputStream?, OutputStream?) @available(tvOS 10.0, *) var isEligibleForHandoff: Bool @available(tvOS 10.0, *) @@ -38,5 +39,5 @@ let NSUserActivityTypeBrowsingWeb: String protocol NSUserActivityDelegate : NSObjectProtocol { optional func userActivityWillSave(_ userActivity: NSUserActivity) optional func userActivityWasContinued(_ userActivity: NSUserActivity) - optional func userActivity(_ userActivity: NSUserActivity, didReceive inputStream: InputStream, outputStream: OutputStream) + @asyncHandler optional func userActivity(_ userActivity: NSUserActivity, didReceive inputStream: InputStream, outputStream: OutputStream) } diff --git a/tvOS/Foundation/NSXMLParser.swift b/tvOS/Foundation/NSXMLParser.swift index 007a50f..b9d92d2 100644 --- a/tvOS/Foundation/NSXMLParser.swift +++ b/tvOS/Foundation/NSXMLParser.swift @@ -23,18 +23,18 @@ extension XMLParser { var columnNumber: Int { get } } protocol XMLParserDelegate : NSObjectProtocol { - optional func parserDidStartDocument(_ parser: XMLParser) - optional func parserDidEndDocument(_ parser: XMLParser) + @asyncHandler optional func parserDidStartDocument(_ parser: XMLParser) + @asyncHandler optional func parserDidEndDocument(_ parser: XMLParser) optional func parser(_ parser: XMLParser, foundNotationDeclarationWithName name: String, publicID: String?, systemID: String?) optional func parser(_ parser: XMLParser, foundUnparsedEntityDeclarationWithName name: String, publicID: String?, systemID: String?, notationName: String?) optional func parser(_ parser: XMLParser, foundAttributeDeclarationWithName attributeName: String, forElement elementName: String, type: String?, defaultValue: String?) optional func parser(_ parser: XMLParser, foundElementDeclarationWithName elementName: String, model: String) optional func parser(_ parser: XMLParser, foundInternalEntityDeclarationWithName name: String, value: String?) optional func parser(_ parser: XMLParser, foundExternalEntityDeclarationWithName name: String, publicID: String?, systemID: String?) - optional func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) - optional func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) - optional func parser(_ parser: XMLParser, didStartMappingPrefix prefix: String, toURI namespaceURI: String) - optional func parser(_ parser: XMLParser, didEndMappingPrefix prefix: String) + @asyncHandler optional func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) + @asyncHandler optional func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) + @asyncHandler optional func parser(_ parser: XMLParser, didStartMappingPrefix prefix: String, toURI namespaceURI: String) + @asyncHandler optional func parser(_ parser: XMLParser, didEndMappingPrefix prefix: String) optional func parser(_ parser: XMLParser, foundCharacters string: String) optional func parser(_ parser: XMLParser, foundIgnorableWhitespace whitespaceString: String) optional func parser(_ parser: XMLParser, foundProcessingInstructionWithTarget target: String, data: String?) diff --git a/tvOS/GLKit/GLKTextureLoader.swift b/tvOS/GLKit/GLKTextureLoader.swift index 319700f..3e20546 100644 --- a/tvOS/GLKit/GLKTextureLoader.swift +++ b/tvOS/GLKit/GLKTextureLoader.swift @@ -82,11 +82,19 @@ class GLKTextureLoader : NSObject { class func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil) throws -> GLKTextureInfo init(sharegroup: EAGLSharegroup) func texture(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func texture(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func texture(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func texture(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func texture(withName name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func texture(withName name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func texture(withContentsOf data: Data, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func texture(withContentsOf data: Data, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func texture(with cgImage: CGImage, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func texture(with cgImage: CGImage, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func cubeMap(withContentsOfFiles paths: [Any], options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func cubeMap(withContentsOfFiles paths: [Any], options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func cubeMap(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func cubeMap(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) + func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? } diff --git a/tvOS/GameController/GCController.swift b/tvOS/GameController/GCController.swift index 7737978..ff9fee4 100644 --- a/tvOS/GameController/GCController.swift +++ b/tvOS/GameController/GCController.swift @@ -44,6 +44,7 @@ class GCController : NSObject, GCDevice { func capture() -> GCController class func controllers() -> [GCController] class func startWirelessControllerDiscovery(completionHandler: (() -> Void)? = nil) + class func startWirelessControllerDiscovery() async class func stopWirelessControllerDiscovery() @available(tvOS 13.0, *) class func withMicroGamepad() -> GCController diff --git a/tvOS/GameKit/GKAchievement.swift b/tvOS/GameKit/GKAchievement.swift index 320956a..2251390 100644 --- a/tvOS/GameKit/GKAchievement.swift +++ b/tvOS/GameKit/GKAchievement.swift @@ -2,12 +2,16 @@ @available(tvOS 4.1, *) class GKAchievement : NSObject, NSCoding, NSSecureCoding { class func loadAchievements(completionHandler: (([GKAchievement]?, Error?) -> Void)? = nil) + class func loadAchievements() async throws -> [GKAchievement]? class func resetAchievements(completionHandler: ((Error?) -> Void)? = nil) + class func resetAchievements() async throws init(identifier: String) @available(tvOS 8.0, *) init(identifier: String, player: GKPlayer) @available(tvOS 6.0, *) class func report(_ achievements: [GKAchievement], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + @available(tvOS 6.0, *) + class func report(_ achievements: [GKAchievement]) async throws var identifier: String var percentComplete: Double var isCompleted: Bool { get } diff --git a/tvOS/GameKit/GKAchievementDescription.swift b/tvOS/GameKit/GKAchievementDescription.swift index 304d807..d15362e 100644 --- a/tvOS/GameKit/GKAchievementDescription.swift +++ b/tvOS/GameKit/GKAchievementDescription.swift @@ -2,6 +2,7 @@ @available(tvOS 4.1, *) class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { class func loadAchievementDescriptions(completionHandler: (([GKAchievementDescription]?, Error?) -> Void)? = nil) + class func loadAchievementDescriptions() async throws -> [GKAchievementDescription]? var identifier: String { get } @available(tvOS 6.0, *) var groupIdentifier: String? { get } @@ -15,6 +16,7 @@ class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { } extension GKAchievementDescription { func loadImage(completionHandler: ((UIImage?, Error?) -> Void)? = nil) + func loadImage() async throws -> UIImage? class func incompleteAchievementImage() -> UIImage class func placeholderCompletedAchievementImage() -> UIImage } diff --git a/tvOS/GameKit/GKChallenge.swift b/tvOS/GameKit/GKChallenge.swift index 6665e94..dd4a655 100644 --- a/tvOS/GameKit/GKChallenge.swift +++ b/tvOS/GameKit/GKChallenge.swift @@ -10,6 +10,7 @@ enum GKChallengeState : Int { @available(tvOS 6.0, *) class GKChallenge : NSObject, NSCoding, NSSecureCoding { class func loadReceivedChallenges(completionHandler: (([GKChallenge]?, Error?) -> Void)? = nil) + class func loadReceivedChallenges() async throws -> [GKChallenge]? func decline() @available(tvOS 8.0, *) @NSCopying var issuingPlayer: GKPlayer? { get } @@ -33,14 +34,22 @@ class GKAchievementChallenge : GKChallenge { extension GKScore { @available(tvOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to reportLeaderboardScores:withEligibleChallenges:withCompletionHandler instead") class func report(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + @available(tvOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to reportLeaderboardScores:withEligibleChallenges:withCompletionHandler instead") + class func report(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge]) async throws @available(tvOS 14.0, *) class func report(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + @available(tvOS 14.0, *) + class func report(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge]) async throws } extension GKAchievement { @available(tvOS 8.0, *) func selectChallengeablePlayers(_ players: [GKPlayer], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + @available(tvOS 8.0, *) + func selectChallengeablePlayers(_ players: [GKPlayer]) async throws -> [GKPlayer]? @available(tvOS 7.0, *) class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + @available(tvOS 7.0, *) + class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge]) async throws } extension GKScore { } diff --git a/tvOS/GameKit/GKCloudPlayer.swift b/tvOS/GameKit/GKCloudPlayer.swift index 6dca1df..f630ee7 100644 --- a/tvOS/GameKit/GKCloudPlayer.swift +++ b/tvOS/GameKit/GKCloudPlayer.swift @@ -2,4 +2,5 @@ @available(tvOS, introduced: 10.0, deprecated: 12.0, message: "GKGameSession is deprecated. Use GKPlayer for both real-time and turn-based matchmaking APIs.") class GKCloudPlayer : GKBasePlayer { class func getCurrentSignedInPlayer(forContainer containerName: String?, completionHandler handler: @escaping (GKCloudPlayer?, Error?) -> Void) + class func getCurrentSignedInPlayer(forContainer containerName: String?) async throws -> GKCloudPlayer? } diff --git a/tvOS/GameKit/GKEventListener.swift b/tvOS/GameKit/GKEventListener.swift index 46015e1..ca159c2 100644 --- a/tvOS/GameKit/GKEventListener.swift +++ b/tvOS/GameKit/GKEventListener.swift @@ -3,9 +3,9 @@ protocol GKChallengeListener : NSObjectProtocol { @available(tvOS 7.0, *) optional func player(_ player: GKPlayer, wantsToPlay challenge: GKChallenge) @available(tvOS 7.0, *) - optional func player(_ player: GKPlayer, didReceive challenge: GKChallenge) + @asyncHandler optional func player(_ player: GKPlayer, didReceive challenge: GKChallenge) @available(tvOS 7.0, *) - optional func player(_ player: GKPlayer, didComplete challenge: GKChallenge, issuedByFriend friendPlayer: GKPlayer) + @asyncHandler optional func player(_ player: GKPlayer, didComplete challenge: GKChallenge, issuedByFriend friendPlayer: GKPlayer) @available(tvOS 7.0, *) optional func player(_ player: GKPlayer, issuedChallengeWasCompleted challenge: GKChallenge, byFriend friendPlayer: GKPlayer) } diff --git a/tvOS/GameKit/GKGameCenterViewController.swift b/tvOS/GameKit/GKGameCenterViewController.swift index 53e690e..30ba5c4 100644 --- a/tvOS/GameKit/GKGameCenterViewController.swift +++ b/tvOS/GameKit/GKGameCenterViewController.swift @@ -29,5 +29,5 @@ extension GKGameCenterViewController { } protocol GKGameCenterControllerDelegate : NSObjectProtocol { @available(tvOS 6.0, *) - func gameCenterViewControllerDidFinish(_ gameCenterViewController: GKGameCenterViewController) + @asyncHandler func gameCenterViewControllerDidFinish(_ gameCenterViewController: GKGameCenterViewController) } diff --git a/tvOS/GameKit/GKGameSession.swift b/tvOS/GameKit/GKGameSession.swift index f09ebb9..ce3a08b 100644 --- a/tvOS/GameKit/GKGameSession.swift +++ b/tvOS/GameKit/GKGameSession.swift @@ -22,15 +22,26 @@ class GKGameSession : NSObject { var maxNumberOfConnectedPlayers: Int { get } var badgedPlayers: [GKCloudPlayer] { get } class func createSession(inContainer containerName: String?, withTitle title: String, maxConnectedPlayers maxPlayers: Int, completionHandler: @escaping (GKGameSession?, Error?) -> Void) + class func createSession(inContainer containerName: String?, withTitle title: String, maxConnectedPlayers maxPlayers: Int) async throws -> GKGameSession? class func loadSessions(inContainer containerName: String?, completionHandler: @escaping ([GKGameSession]?, Error?) -> Void) + class func loadSessions(inContainer containerName: String?) async throws -> [GKGameSession]? class func load(withIdentifier identifier: String, completionHandler: @escaping (GKGameSession?, Error?) -> Void) + class func load(withIdentifier identifier: String) async throws -> GKGameSession? class func remove(withIdentifier identifier: String, completionHandler: @escaping (Error?) -> Void) + class func remove(withIdentifier identifier: String) async throws func getShareURL(completionHandler: @escaping (URL?, Error?) -> Void) + func getShareURL() async throws -> URL? func loadData(completionHandler: @escaping (Data?, Error?) -> Void) + func loadData() async throws -> Data? func save(_ data: Data, completionHandler: @escaping (Data?, Error?) -> Void) + func save(_ data: Data) async throws -> Data? func setConnectionState(_ state: GKConnectionState, completionHandler: @escaping (Error?) -> Void) + func setConnectionState(_ state: GKConnectionState) async throws func players(with state: GKConnectionState) -> [GKCloudPlayer] func send(_ data: Data, with transport: GKTransportType, completionHandler: @escaping (Error?) -> Void) + func send(_ data: Data, with transport: GKTransportType) async throws func sendMessage(withLocalizedFormatKey key: String, arguments: [String], data: Data?, to players: [GKCloudPlayer], badgePlayers: Bool, completionHandler: @escaping (Error?) -> Void) + func sendMessage(withLocalizedFormatKey key: String, arguments: [String], data: Data?, to players: [GKCloudPlayer], badgePlayers: Bool) async throws func clearBadge(for players: [GKCloudPlayer], completionHandler: @escaping (Error?) -> Void) + func clearBadge(for players: [GKCloudPlayer]) async throws } diff --git a/tvOS/GameKit/GKGameSessionEventListener.swift b/tvOS/GameKit/GKGameSessionEventListener.swift index a38d619..7730eb2 100644 --- a/tvOS/GameKit/GKGameSessionEventListener.swift +++ b/tvOS/GameKit/GKGameSessionEventListener.swift @@ -1,12 +1,12 @@ @available(tvOS, introduced: 10.0, deprecated: 12.0, message: "Use GKLocalPlayerListener for multiplayer event notifications.") protocol GKGameSessionEventListener : NSObjectProtocol { - optional func session(_ session: GKGameSession, didAdd player: GKCloudPlayer) - optional func session(_ session: GKGameSession, didRemove player: GKCloudPlayer) - optional func session(_ session: GKGameSession, player: GKCloudPlayer, didChange newState: GKConnectionState) - optional func session(_ session: GKGameSession, player: GKCloudPlayer, didSave data: Data) - optional func session(_ session: GKGameSession, didReceive data: Data, from player: GKCloudPlayer) - optional func session(_ session: GKGameSession, didReceiveMessage message: String, with data: Data, from player: GKCloudPlayer) + @asyncHandler optional func session(_ session: GKGameSession, didAdd player: GKCloudPlayer) + @asyncHandler optional func session(_ session: GKGameSession, didRemove player: GKCloudPlayer) + @asyncHandler optional func session(_ session: GKGameSession, player: GKCloudPlayer, didChange newState: GKConnectionState) + @asyncHandler optional func session(_ session: GKGameSession, player: GKCloudPlayer, didSave data: Data) + @asyncHandler optional func session(_ session: GKGameSession, didReceive data: Data, from player: GKCloudPlayer) + @asyncHandler optional func session(_ session: GKGameSession, didReceiveMessage message: String, with data: Data, from player: GKCloudPlayer) } extension GKGameSession { @available(tvOS, introduced: 10.0, deprecated: 12.0, message: "Use GKLocalPlayer's registerListener: to register for GKLocalPlayerListener event notifications.") diff --git a/tvOS/GameKit/GKGameSessionSharingViewController.swift b/tvOS/GameKit/GKGameSessionSharingViewController.swift index 152d696..42caf2e 100644 --- a/tvOS/GameKit/GKGameSessionSharingViewController.swift +++ b/tvOS/GameKit/GKGameSessionSharingViewController.swift @@ -7,5 +7,5 @@ class GKGameSessionSharingViewController : UIViewController { } @available(tvOS, introduced: 10.0, deprecated: 12.0, message: "For real-time matches, use GKMatchmakerViewControllerDelegate to receive notifications from the GKMatchmakerViewController. For turn-based matches, use GKTurnBasedMatchmakerViewControllerDelegate and GKLocalPlayerListener to receive notifications from the GKTurnBasedMatchmakerViewController.") protocol GKGameSessionSharingViewControllerDelegate : NSObjectProtocol { - func sharingViewController(_ viewController: GKGameSessionSharingViewController, didFinishWithError error: Error?) + @asyncHandler func sharingViewController(_ viewController: GKGameSessionSharingViewController, didFinishWithError error: Error?) } diff --git a/tvOS/GameKit/GKLeaderboard.swift b/tvOS/GameKit/GKLeaderboard.swift index cc12f79..4944d83 100644 --- a/tvOS/GameKit/GKLeaderboard.swift +++ b/tvOS/GameKit/GKLeaderboard.swift @@ -39,15 +39,27 @@ class GKLeaderboard : NSObject { @available(tvOS 14.0, *) class func loadLeaderboards(IDs leaderboardIDs: [String]?, completionHandler: @escaping ([GKLeaderboard]?, Error?) -> Void) @available(tvOS 14.0, *) + class func loadLeaderboards(IDs leaderboardIDs: [String]?) async throws -> [GKLeaderboard]? + @available(tvOS 14.0, *) func loadPreviousOccurrence(completionHandler: @escaping (GKLeaderboard?, Error?) -> Void) @available(tvOS 14.0, *) + func loadPreviousOccurrence() async throws -> GKLeaderboard? + @available(tvOS 14.0, *) class func submitScore(_ score: Int, context: Int, player: GKPlayer, leaderboardIDs: [String], completionHandler: @escaping (Error?) -> Void) @available(tvOS 14.0, *) + class func submitScore(_ score: Int, context: Int, player: GKPlayer, leaderboardIDs: [String]) async throws + @available(tvOS 14.0, *) func submitScore(_ score: Int, context: Int, player: GKPlayer, completionHandler: @escaping (Error?) -> Void) @available(tvOS 14.0, *) + func submitScore(_ score: Int, context: Int, player: GKPlayer) async throws + @available(tvOS 14.0, *) func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange, completionHandler: @escaping (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Int, Error?) -> Void) @available(tvOS 14.0, *) + func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange) async throws -> (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Int) + @available(tvOS 14.0, *) func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope, completionHandler: @escaping (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Error?) -> Void) + @available(tvOS 14.0, *) + func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope) async throws -> (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?) } extension GKLeaderboard { @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler: instead.") @@ -70,8 +82,12 @@ extension GKLeaderboard { init(players: [GKPlayer]) @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") func loadScores(completionHandler: (([GKScore]?, Error?) -> Void)? = nil) + @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") + func loadScores() async throws -> [GKScore]? @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") class func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) + @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") + class func loadLeaderboards() async throws -> [GKLeaderboard]? } extension GKLeaderboard { } diff --git a/tvOS/GameKit/GKLeaderboardSet.swift b/tvOS/GameKit/GKLeaderboardSet.swift index 79788af..263ff7a 100644 --- a/tvOS/GameKit/GKLeaderboardSet.swift +++ b/tvOS/GameKit/GKLeaderboardSet.swift @@ -6,12 +6,16 @@ class GKLeaderboardSet : NSObject, NSCoding, NSSecureCoding { var identifier: String? @available(tvOS 7.0, *) class func loadLeaderboardSets(completionHandler: (([GKLeaderboardSet]?, Error?) -> Void)? = nil) + @available(tvOS 7.0, *) + class func loadLeaderboardSets() async throws -> [GKLeaderboardSet]? @available(tvOS 14.0, *) func loadLeaderboards(handler: @escaping ([GKLeaderboard]?, Error?) -> Void) } extension GKLeaderboardSet { @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use loadLeaderboardsWithHandler: instead.") func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) + @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use loadLeaderboardsWithHandler: instead.") + func loadLeaderboards() async throws -> [GKLeaderboard]? } extension GKLeaderboardSet { } diff --git a/tvOS/GameKit/GKLocalPlayer.swift b/tvOS/GameKit/GKLocalPlayer.swift index b7d8894..359e0ef 100644 --- a/tvOS/GameKit/GKLocalPlayer.swift +++ b/tvOS/GameKit/GKLocalPlayer.swift @@ -12,13 +12,22 @@ class GKLocalPlayer : GKPlayer { var isPersonalizedCommunicationRestricted: Bool { get } @available(tvOS 10.0, *) func loadRecentPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + @available(tvOS 10.0, *) + func loadRecentPlayers() async throws -> [GKPlayer]? func loadChallengableFriends(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + func loadChallengableFriends() async throws -> [GKPlayer]? @available(tvOS 7.0, *) func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 7.0, *) + func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String) async throws + @available(tvOS 7.0, *) func loadDefaultLeaderboardIdentifier(completionHandler: ((String?, Error?) -> Void)? = nil) + @available(tvOS 7.0, *) + func loadDefaultLeaderboardIdentifier() async throws -> String? @available(tvOS 13.5, *) func fetchItems(forIdentityVerificationSignature completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) + @available(tvOS 13.5, *) + func fetchItemsForIdentityVerificationSignature() async throws -> (URL?, Data?, Data?, UInt64) } protocol GKLocalPlayerListener : GKChallengeListener, GKInviteEventListener, GKTurnBasedEventListener { } @@ -37,8 +46,12 @@ extension NSNotification.Name { extension GKLocalPlayer { @available(tvOS, introduced: 8.0, deprecated: 10.0) func loadFriendPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + @available(tvOS, introduced: 8.0, deprecated: 10.0) + func loadFriendPlayers() async throws -> [GKPlayer]? @available(tvOS, introduced: 9.0, deprecated: 13.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") func generateIdentityVerificationSignature(completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) + @available(tvOS, introduced: 9.0, deprecated: 13.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") + func generateIdentityVerificationSignature() async throws -> (URL?, Data?, Data?, UInt64) } extension GKLocalPlayer { } diff --git a/tvOS/GameKit/GKMatch.swift b/tvOS/GameKit/GKMatch.swift index 393c30b..a0df0f4 100644 --- a/tvOS/GameKit/GKMatch.swift +++ b/tvOS/GameKit/GKMatch.swift @@ -27,18 +27,22 @@ class GKMatch : NSObject { func voiceChat(withName name: String) -> GKVoiceChat? @available(tvOS 8.0, *) func chooseBestHostingPlayer(completionHandler: @escaping (GKPlayer?) -> Void) + @available(tvOS 8.0, *) + func chooseBestHostingPlayer() async -> GKPlayer? @available(tvOS 6.0, *) func rematch(completionHandler: ((GKMatch?, Error?) -> Void)? = nil) + @available(tvOS 6.0, *) + func rematch() async throws -> GKMatch? } protocol GKMatchDelegate : NSObjectProtocol { @available(tvOS 8.0, *) - optional func match(_ match: GKMatch, didReceive data: Data, fromRemotePlayer player: GKPlayer) + @asyncHandler optional func match(_ match: GKMatch, didReceive data: Data, fromRemotePlayer player: GKPlayer) @available(tvOS 9.0, *) - optional func match(_ match: GKMatch, didReceive data: Data, forRecipient recipient: GKPlayer, fromRemotePlayer player: GKPlayer) + @asyncHandler optional func match(_ match: GKMatch, didReceive data: Data, forRecipient recipient: GKPlayer, fromRemotePlayer player: GKPlayer) @available(tvOS 4.1, *) - optional func match(_ match: GKMatch, player: GKPlayer, didChange state: GKPlayerConnectionState) + @asyncHandler optional func match(_ match: GKMatch, player: GKPlayer, didChange state: GKPlayerConnectionState) @available(tvOS 4.1, *) - optional func match(_ match: GKMatch, didFailWithError error: Error?) + @asyncHandler optional func match(_ match: GKMatch, didFailWithError error: Error?) @available(tvOS 8.0, *) optional func match(_ match: GKMatch, shouldReinviteDisconnectedPlayer player: GKPlayer) -> Bool } diff --git a/tvOS/GameKit/GKMatchmaker.swift b/tvOS/GameKit/GKMatchmaker.swift index 330fd50..e1125f1 100644 --- a/tvOS/GameKit/GKMatchmaker.swift +++ b/tvOS/GameKit/GKMatchmaker.swift @@ -54,26 +54,34 @@ class GKInvite : NSObject { } protocol GKInviteEventListener { @available(tvOS 7.0, *) - optional func player(_ player: GKPlayer, didAccept invite: GKInvite) + @asyncHandler optional func player(_ player: GKPlayer, didAccept invite: GKInvite) @available(tvOS 8.0, *) - optional func player(_ player: GKPlayer, didRequestMatchWithRecipients recipientPlayers: [GKPlayer]) + @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithRecipients recipientPlayers: [GKPlayer]) } @available(tvOS 4.1, *) class GKMatchmaker : NSObject { class func shared() -> GKMatchmaker @available(tvOS 6.0, *) func match(for invite: GKInvite, completionHandler: ((GKMatch?, Error?) -> Void)? = nil) + @available(tvOS 6.0, *) + func match(for invite: GKInvite) async throws -> GKMatch? func findMatch(for request: GKMatchRequest, withCompletionHandler completionHandler: ((GKMatch?, Error?) -> Void)? = nil) + func findMatch(for request: GKMatchRequest) async throws -> GKMatch? @available(tvOS 8.0, *) func findPlayers(forHostedRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + @available(tvOS 8.0, *) + func findPlayers(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer]? func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest, completionHandler: ((Error?) -> Void)? = nil) + func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest) async throws func cancel() @available(tvOS 8.0, *) func cancelPendingInvite(to player: GKPlayer) @available(tvOS 6.0, *) func finishMatchmaking(for match: GKMatch) func queryPlayerGroupActivity(_ playerGroup: Int, withCompletionHandler completionHandler: ((Int, Error?) -> Void)? = nil) + func queryPlayerGroupActivity(_ playerGroup: Int) async throws -> Int func queryActivity(completionHandler: ((Int, Error?) -> Void)? = nil) + func queryActivity() async throws -> Int @available(tvOS 8.0, *) func startBrowsingForNearbyPlayers(handler reachableHandler: ((GKPlayer, Bool) -> Void)? = nil) @available(tvOS 6.0, *) diff --git a/tvOS/GameKit/GKMatchmakerViewController.swift b/tvOS/GameKit/GKMatchmakerViewController.swift index b7d675e..0a193b5 100644 --- a/tvOS/GameKit/GKMatchmakerViewController.swift +++ b/tvOS/GameKit/GKMatchmakerViewController.swift @@ -25,11 +25,11 @@ protocol GKMatchmakerViewControllerDelegate : NSObjectProtocol { @available(tvOS 4.1, *) func matchmakerViewControllerWasCancelled(_ viewController: GKMatchmakerViewController) @available(tvOS 4.1, *) - func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFailWithError error: Error) + @asyncHandler func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFailWithError error: Error) @available(tvOS 4.1, *) - optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFind match: GKMatch) + @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFind match: GKMatch) @available(tvOS 8.0, *) - optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindHostedPlayers players: [GKPlayer]) + @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindHostedPlayers players: [GKPlayer]) @available(tvOS 8.0, *) optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, hostedPlayerDidAccept player: GKPlayer) } diff --git a/tvOS/GameKit/GKNotificationBanner.swift b/tvOS/GameKit/GKNotificationBanner.swift index ff90efd..def9e97 100644 --- a/tvOS/GameKit/GKNotificationBanner.swift +++ b/tvOS/GameKit/GKNotificationBanner.swift @@ -3,6 +3,10 @@ class GKNotificationBanner : NSObject { @available(tvOS 5.0, *) class func show(withTitle title: String?, message: String?, completionHandler: (() -> Void)? = nil) + @available(tvOS 5.0, *) + class func show(withTitle title: String?, message: String?) async @available(tvOS 6.0, *) class func show(withTitle title: String?, message: String?, duration: TimeInterval, completionHandler: (() -> Void)? = nil) + @available(tvOS 6.0, *) + class func show(withTitle title: String?, message: String?, duration: TimeInterval) async } diff --git a/tvOS/GameKit/GKPlayer.swift b/tvOS/GameKit/GKPlayer.swift index 8ba34b8..9a59c31 100644 --- a/tvOS/GameKit/GKPlayer.swift +++ b/tvOS/GameKit/GKPlayer.swift @@ -4,6 +4,7 @@ let GKPlayerIDNoLongerAvailable: String @available(tvOS 4.1, *) class GKPlayer : GKBasePlayer { class func loadPlayers(forIdentifiers identifiers: [String], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer]? @available(tvOS 13.0, *) func scopedIDsArePersistent() -> Bool @available(tvOS 12.4, *) @@ -21,6 +22,8 @@ class GKPlayer : GKBasePlayer { extension GKPlayer { @available(tvOS 5.0, *) func loadPhoto(for size: GKPlayer.PhotoSize, withCompletionHandler completionHandler: ((UIImage?, Error?) -> Void)? = nil) + @available(tvOS 5.0, *) + func loadPhoto(for size: GKPlayer.PhotoSize) async throws -> UIImage? } extension GKPlayer { enum PhotoSize : Int { diff --git a/tvOS/GameKit/GKScore.swift b/tvOS/GameKit/GKScore.swift index 33326b5..aae4769 100644 --- a/tvOS/GameKit/GKScore.swift +++ b/tvOS/GameKit/GKScore.swift @@ -18,6 +18,8 @@ class GKScore : NSObject, NSCoding, NSSecureCoding { var shouldSetDefaultLeaderboard: Bool @available(tvOS 6.0, *) class func report(_ scores: [GKScore], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + @available(tvOS 6.0, *) + class func report(_ scores: [GKScore]) async throws } extension GKScore { } diff --git a/tvOS/GameKit/GKTurnBasedMatch.swift b/tvOS/GameKit/GKTurnBasedMatch.swift index 48c1a4d..c76acf4 100644 --- a/tvOS/GameKit/GKTurnBasedMatch.swift +++ b/tvOS/GameKit/GKTurnBasedMatch.swift @@ -50,9 +50,9 @@ extension GKTurnBasedParticipant { } protocol GKTurnBasedEventListener { @available(tvOS 8.0, *) - optional func player(_ player: GKPlayer, didRequestMatchWithOtherPlayers playersToInvite: [GKPlayer]) + @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithOtherPlayers playersToInvite: [GKPlayer]) @available(tvOS 7.0, *) - optional func player(_ player: GKPlayer, receivedTurnEventFor match: GKTurnBasedMatch, didBecomeActive: Bool) + @asyncHandler optional func player(_ player: GKPlayer, receivedTurnEventFor match: GKTurnBasedMatch, didBecomeActive: Bool) @available(tvOS 5.0, *) optional func player(_ player: GKPlayer, matchEnded match: GKTurnBasedMatch) @available(tvOS 7.0, *) @@ -92,35 +92,65 @@ class GKTurnBasedMatch : NSObject { @available(tvOS 7.0, *) var exchangeMaxInitiatedExchangesPerPlayer: Int { get } class func find(for request: GKMatchRequest, withCompletionHandler completionHandler: @escaping (GKTurnBasedMatch?, Error?) -> Void) + class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch? class func loadMatches(completionHandler: (([GKTurnBasedMatch]?, Error?) -> Void)? = nil) + class func loadMatches() async throws -> [GKTurnBasedMatch]? @available(tvOS 5.0, *) class func load(withID matchID: String, withCompletionHandler completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) + @available(tvOS 5.0, *) + class func load(withID matchID: String) async throws -> GKTurnBasedMatch? @available(tvOS 6.0, *) func rematch(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) + @available(tvOS 6.0, *) + func rematch() async throws -> GKTurnBasedMatch? @available(tvOS 5.0, *) func acceptInvite(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(tvOS 5.0, *) + func acceptInvite() async throws -> GKTurnBasedMatch? + @available(tvOS 5.0, *) func declineInvite(completionHandler: ((Error?) -> Void)? = nil) + @available(tvOS 5.0, *) + func declineInvite() async throws func remove(completionHandler: ((Error?) -> Void)? = nil) + func remove() async throws func loadMatchData(completionHandler: ((Data?, Error?) -> Void)? = nil) + func loadMatchData() async throws -> Data? @available(tvOS 6.0, *) func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 6.0, *) + func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + @available(tvOS 6.0, *) func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) + @available(tvOS 6.0, *) + func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome) async throws func endMatchInTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) + func endMatchInTurn(withMatch matchData: Data) async throws @available(tvOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?, completionHandler: ((Error?) -> Void)? = nil) + @available(tvOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") + func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws @available(tvOS 14.0, *) func endMatchInTurn(withMatch matchData: Data, leaderboardScores scores: [GKLeaderboardScore], achievements: [Any], completionHandler: @escaping (Error?) -> Void) + @available(tvOS 14.0, *) + func endMatchInTurn(withMatch matchData: Data, leaderboardScores scores: [GKLeaderboardScore], achievements: [Any]) async throws @available(tvOS 6.0, *) func saveCurrentTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) + @available(tvOS 6.0, *) + func saveCurrentTurn(withMatch matchData: Data) async throws @available(tvOS 7.0, *) func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange], completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 7.0, *) + func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws + @available(tvOS 7.0, *) func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval, completionHandler: ((GKTurnBasedExchange?, Error?) -> Void)? = nil) @available(tvOS 7.0, *) + func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange? + @available(tvOS 7.0, *) func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) + @available(tvOS 7.0, *) + func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws } @available(tvOS 7.0, *) enum GKTurnBasedExchangeStatus : Int8 { @@ -151,7 +181,11 @@ class GKTurnBasedExchange : NSObject { @available(tvOS 7.0, *) func cancel(withLocalizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 7.0, *) + func cancel(withLocalizableMessageKey key: String, arguments: [String]) async throws + @available(tvOS 7.0, *) func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data, completionHandler: ((Error?) -> Void)? = nil) + @available(tvOS 7.0, *) + func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws } @available(tvOS 7.0, *) class GKTurnBasedExchangeReply : NSObject { diff --git a/tvOS/GameKit/GKTurnBasedMatchmakerViewController.swift b/tvOS/GameKit/GKTurnBasedMatchmakerViewController.swift index 5019721..8bc6f59 100644 --- a/tvOS/GameKit/GKTurnBasedMatchmakerViewController.swift +++ b/tvOS/GameKit/GKTurnBasedMatchmakerViewController.swift @@ -11,5 +11,5 @@ protocol GKTurnBasedMatchmakerViewControllerDelegate : NSObjectProtocol { @available(tvOS 5.0, *) func turnBasedMatchmakerViewControllerWasCancelled(_ viewController: GKTurnBasedMatchmakerViewController) @available(tvOS 5.0, *) - func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFailWithError error: Error) + @asyncHandler func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFailWithError error: Error) } diff --git a/tvOS/GameplayKit/GKAgent.swift b/tvOS/GameplayKit/GKAgent.swift index f200241..4d621f3 100644 --- a/tvOS/GameplayKit/GKAgent.swift +++ b/tvOS/GameplayKit/GKAgent.swift @@ -3,7 +3,7 @@ protocol GKAgentDelegate : NSObjectProtocol { @available(tvOS 9.0, *) optional func agentWillUpdate(_ agent: GKAgent) @available(tvOS 9.0, *) - optional func agentDidUpdate(_ agent: GKAgent) + @asyncHandler optional func agentDidUpdate(_ agent: GKAgent) } @available(tvOS 9.0, *) class GKAgent : GKComponent, NSSecureCoding { diff --git a/tvOS/HomeKit/HMAccessory.swift b/tvOS/HomeKit/HMAccessory.swift index 6c486a9..9205a9a 100644 --- a/tvOS/HomeKit/HMAccessory.swift +++ b/tvOS/HomeKit/HMAccessory.swift @@ -25,19 +25,20 @@ class HMAccessory : NSObject { @available(tvOS 11.3, *) var supportsIdentify: Bool { get } func identify(completionHandler completion: @escaping (Error?) -> Void) + func identify() async throws } @available(tvOS 10.0, *) protocol HMAccessoryDelegate : NSObjectProtocol { - optional func accessoryDidUpdateName(_ accessory: HMAccessory) - optional func accessory(_ accessory: HMAccessory, didUpdateNameFor service: HMService) - optional func accessory(_ accessory: HMAccessory, didUpdateAssociatedServiceTypeFor service: HMService) - optional func accessoryDidUpdateServices(_ accessory: HMAccessory) + @asyncHandler optional func accessoryDidUpdateName(_ accessory: HMAccessory) + @asyncHandler optional func accessory(_ accessory: HMAccessory, didUpdateNameFor service: HMService) + @asyncHandler optional func accessory(_ accessory: HMAccessory, didUpdateAssociatedServiceTypeFor service: HMService) + @asyncHandler optional func accessoryDidUpdateServices(_ accessory: HMAccessory) @available(tvOS 11.0, *) - optional func accessory(_ accessory: HMAccessory, didAdd profile: HMAccessoryProfile) + @asyncHandler optional func accessory(_ accessory: HMAccessory, didAdd profile: HMAccessoryProfile) @available(tvOS 11.0, *) - optional func accessory(_ accessory: HMAccessory, didRemove profile: HMAccessoryProfile) - optional func accessoryDidUpdateReachability(_ accessory: HMAccessory) - optional func accessory(_ accessory: HMAccessory, service: HMService, didUpdateValueFor characteristic: HMCharacteristic) + @asyncHandler optional func accessory(_ accessory: HMAccessory, didRemove profile: HMAccessoryProfile) + @asyncHandler optional func accessoryDidUpdateReachability(_ accessory: HMAccessory) + @asyncHandler optional func accessory(_ accessory: HMAccessory, service: HMService, didUpdateValueFor characteristic: HMCharacteristic) @available(tvOS 11.0, *) - optional func accessory(_ accessory: HMAccessory, didUpdateFirmwareVersion firmwareVersion: String) + @asyncHandler optional func accessory(_ accessory: HMAccessory, didUpdateFirmwareVersion firmwareVersion: String) } diff --git a/tvOS/HomeKit/HMCameraSnapshotControl.swift b/tvOS/HomeKit/HMCameraSnapshotControl.swift index f5aac04..2f60f14 100644 --- a/tvOS/HomeKit/HMCameraSnapshotControl.swift +++ b/tvOS/HomeKit/HMCameraSnapshotControl.swift @@ -7,6 +7,6 @@ class HMCameraSnapshotControl : HMCameraControl { } @available(tvOS 10.0, *) protocol HMCameraSnapshotControlDelegate : NSObjectProtocol { - optional func cameraSnapshotControl(_ cameraSnapshotControl: HMCameraSnapshotControl, didTake snapshot: HMCameraSnapshot?, error: Error?) - optional func cameraSnapshotControlDidUpdateMostRecentSnapshot(_ cameraSnapshotControl: HMCameraSnapshotControl) + @asyncHandler optional func cameraSnapshotControl(_ cameraSnapshotControl: HMCameraSnapshotControl, didTake snapshot: HMCameraSnapshot?, error: Error?) + @asyncHandler optional func cameraSnapshotControlDidUpdateMostRecentSnapshot(_ cameraSnapshotControl: HMCameraSnapshotControl) } diff --git a/tvOS/HomeKit/HMCameraStreamControl.swift b/tvOS/HomeKit/HMCameraStreamControl.swift index eec53e3..76cf8e2 100644 --- a/tvOS/HomeKit/HMCameraStreamControl.swift +++ b/tvOS/HomeKit/HMCameraStreamControl.swift @@ -9,6 +9,6 @@ class HMCameraStreamControl : HMCameraControl { } @available(tvOS 10.0, *) protocol HMCameraStreamControlDelegate : NSObjectProtocol { - optional func cameraStreamControlDidStartStream(_ cameraStreamControl: HMCameraStreamControl) - optional func cameraStreamControl(_ cameraStreamControl: HMCameraStreamControl, didStopStreamWithError error: Error?) + @asyncHandler optional func cameraStreamControlDidStartStream(_ cameraStreamControl: HMCameraStreamControl) + @asyncHandler optional func cameraStreamControl(_ cameraStreamControl: HMCameraStreamControl, didStopStreamWithError error: Error?) } diff --git a/tvOS/HomeKit/HMCharacteristic.swift b/tvOS/HomeKit/HMCharacteristic.swift index 80f2d37..fd1a551 100644 --- a/tvOS/HomeKit/HMCharacteristic.swift +++ b/tvOS/HomeKit/HMCharacteristic.swift @@ -12,6 +12,9 @@ class HMCharacteristic : NSObject { @available(tvOS 9.0, *) var uniqueIdentifier: UUID { get } func writeValue(_ value: Any?, completionHandler completion: @escaping (Error?) -> Void) + func writeValue(_ value: Any?) async throws func readValue(completionHandler completion: @escaping (Error?) -> Void) + func readValue() async throws func enableNotification(_ enable: Bool, completionHandler completion: @escaping (Error?) -> Void) + func enableNotification(_ enable: Bool) async throws } diff --git a/tvOS/HomeKit/HMHome.swift b/tvOS/HomeKit/HMHome.swift index 66d531b..64eea36 100644 --- a/tvOS/HomeKit/HMHome.swift +++ b/tvOS/HomeKit/HMHome.swift @@ -42,6 +42,7 @@ extension HMHome { extension HMHome { var actionSets: [HMActionSet] { get } func executeActionSet(_ actionSet: HMActionSet, completionHandler completion: @escaping (Error?) -> Void) + func executeActionSet(_ actionSet: HMActionSet) async throws @available(tvOS 9.0, *) func builtinActionSet(ofType actionSetType: String) -> HMActionSet? } @@ -50,41 +51,41 @@ extension HMHome { } @available(tvOS 10.0, *) protocol HMHomeDelegate : NSObjectProtocol { - optional func homeDidUpdateName(_ home: HMHome) + @asyncHandler optional func homeDidUpdateName(_ home: HMHome) @available(tvOS 11.0, *) - optional func homeDidUpdateAccessControl(forCurrentUser home: HMHome) - optional func home(_ home: HMHome, didAdd accessory: HMAccessory) - optional func home(_ home: HMHome, didRemove accessory: HMAccessory) - optional func home(_ home: HMHome, didAdd user: HMUser) - optional func home(_ home: HMHome, didRemove user: HMUser) - optional func home(_ home: HMHome, didUpdate room: HMRoom, for accessory: HMAccessory) - optional func home(_ home: HMHome, didAdd room: HMRoom) - optional func home(_ home: HMHome, didRemove room: HMRoom) - optional func home(_ home: HMHome, didUpdateNameFor room: HMRoom) - optional func home(_ home: HMHome, didAdd zone: HMZone) - optional func home(_ home: HMHome, didRemove zone: HMZone) - optional func home(_ home: HMHome, didUpdateNameFor zone: HMZone) - optional func home(_ home: HMHome, didAdd room: HMRoom, to zone: HMZone) - optional func home(_ home: HMHome, didRemove room: HMRoom, from zone: HMZone) - optional func home(_ home: HMHome, didAdd group: HMServiceGroup) - optional func home(_ home: HMHome, didRemove group: HMServiceGroup) - optional func home(_ home: HMHome, didUpdateNameFor group: HMServiceGroup) - optional func home(_ home: HMHome, didAdd service: HMService, to group: HMServiceGroup) - optional func home(_ home: HMHome, didRemove service: HMService, from group: HMServiceGroup) - optional func home(_ home: HMHome, didAdd actionSet: HMActionSet) - optional func home(_ home: HMHome, didRemove actionSet: HMActionSet) - optional func home(_ home: HMHome, didUpdateNameFor actionSet: HMActionSet) - optional func home(_ home: HMHome, didUpdateActionsFor actionSet: HMActionSet) - optional func home(_ home: HMHome, didAdd trigger: HMTrigger) - optional func home(_ home: HMHome, didRemove trigger: HMTrigger) - optional func home(_ home: HMHome, didUpdateNameFor trigger: HMTrigger) - optional func home(_ home: HMHome, didUpdate trigger: HMTrigger) - optional func home(_ home: HMHome, didUnblockAccessory accessory: HMAccessory) - optional func home(_ home: HMHome, didEncounterError error: Error, for accessory: HMAccessory) + @asyncHandler optional func homeDidUpdateAccessControl(forCurrentUser home: HMHome) + @asyncHandler optional func home(_ home: HMHome, didAdd accessory: HMAccessory) + @asyncHandler optional func home(_ home: HMHome, didRemove accessory: HMAccessory) + @asyncHandler optional func home(_ home: HMHome, didAdd user: HMUser) + @asyncHandler optional func home(_ home: HMHome, didRemove user: HMUser) + @asyncHandler optional func home(_ home: HMHome, didUpdate room: HMRoom, for accessory: HMAccessory) + @asyncHandler optional func home(_ home: HMHome, didAdd room: HMRoom) + @asyncHandler optional func home(_ home: HMHome, didRemove room: HMRoom) + @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor room: HMRoom) + @asyncHandler optional func home(_ home: HMHome, didAdd zone: HMZone) + @asyncHandler optional func home(_ home: HMHome, didRemove zone: HMZone) + @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor zone: HMZone) + @asyncHandler optional func home(_ home: HMHome, didAdd room: HMRoom, to zone: HMZone) + @asyncHandler optional func home(_ home: HMHome, didRemove room: HMRoom, from zone: HMZone) + @asyncHandler optional func home(_ home: HMHome, didAdd group: HMServiceGroup) + @asyncHandler optional func home(_ home: HMHome, didRemove group: HMServiceGroup) + @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor group: HMServiceGroup) + @asyncHandler optional func home(_ home: HMHome, didAdd service: HMService, to group: HMServiceGroup) + @asyncHandler optional func home(_ home: HMHome, didRemove service: HMService, from group: HMServiceGroup) + @asyncHandler optional func home(_ home: HMHome, didAdd actionSet: HMActionSet) + @asyncHandler optional func home(_ home: HMHome, didRemove actionSet: HMActionSet) + @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor actionSet: HMActionSet) + @asyncHandler optional func home(_ home: HMHome, didUpdateActionsFor actionSet: HMActionSet) + @asyncHandler optional func home(_ home: HMHome, didAdd trigger: HMTrigger) + @asyncHandler optional func home(_ home: HMHome, didRemove trigger: HMTrigger) + @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor trigger: HMTrigger) + @asyncHandler optional func home(_ home: HMHome, didUpdate trigger: HMTrigger) + @asyncHandler optional func home(_ home: HMHome, didUnblockAccessory accessory: HMAccessory) + @asyncHandler optional func home(_ home: HMHome, didEncounterError error: Error, for accessory: HMAccessory) @available(tvOS 11.0, *) - optional func home(_ home: HMHome, didUpdate homeHubState: HMHomeHubState) + @asyncHandler optional func home(_ home: HMHome, didUpdate homeHubState: HMHomeHubState) @available(tvOS 13.2, *) - optional func homeDidUpdateSupportedFeatures(_ home: HMHome) + @asyncHandler optional func homeDidUpdateSupportedFeatures(_ home: HMHome) } @available(tvOS 10.0, *) let HMUserFailedAccessoriesKey: String diff --git a/tvOS/HomeKit/HMHomeManager.swift b/tvOS/HomeKit/HMHomeManager.swift index 0f66806..5ff954c 100644 --- a/tvOS/HomeKit/HMHomeManager.swift +++ b/tvOS/HomeKit/HMHomeManager.swift @@ -18,9 +18,9 @@ class HMHomeManager : NSObject { @available(tvOS 10.0, *) protocol HMHomeManagerDelegate : NSObjectProtocol { @available(tvOS 13.0, *) - optional func homeManager(_ manager: HMHomeManager, didUpdate status: HMHomeManagerAuthorizationStatus) - optional func homeManagerDidUpdateHomes(_ manager: HMHomeManager) - optional func homeManagerDidUpdatePrimaryHome(_ manager: HMHomeManager) - optional func homeManager(_ manager: HMHomeManager, didAdd home: HMHome) - optional func homeManager(_ manager: HMHomeManager, didRemove home: HMHome) + @asyncHandler optional func homeManager(_ manager: HMHomeManager, didUpdate status: HMHomeManagerAuthorizationStatus) + @asyncHandler optional func homeManagerDidUpdateHomes(_ manager: HMHomeManager) + @asyncHandler optional func homeManagerDidUpdatePrimaryHome(_ manager: HMHomeManager) + @asyncHandler optional func homeManager(_ manager: HMHomeManager, didAdd home: HMHome) + @asyncHandler optional func homeManager(_ manager: HMHomeManager, didRemove home: HMHome) } diff --git a/tvOS/HomeKit/HMNetworkConfigurationProfile.swift b/tvOS/HomeKit/HMNetworkConfigurationProfile.swift index 52ecf4a..16c2193 100644 --- a/tvOS/HomeKit/HMNetworkConfigurationProfile.swift +++ b/tvOS/HomeKit/HMNetworkConfigurationProfile.swift @@ -6,5 +6,5 @@ class HMNetworkConfigurationProfile : HMAccessoryProfile { } @available(tvOS 13.0, *) protocol HMNetworkConfigurationProfileDelegate : NSObjectProtocol { - optional func profileDidUpdateNetworkAccessMode(_ profile: HMNetworkConfigurationProfile) + @asyncHandler optional func profileDidUpdateNetworkAccessMode(_ profile: HMNetworkConfigurationProfile) } diff --git a/tvOS/Intents/INAddMediaIntent.swift b/tvOS/Intents/INAddMediaIntent.swift index 9c938a5..3a98a59 100644 --- a/tvOS/Intents/INAddMediaIntent.swift +++ b/tvOS/Intents/INAddMediaIntent.swift @@ -9,7 +9,11 @@ class INAddMediaIntent : INIntent { @available(tvOS 14.0, *) protocol INAddMediaIntentHandling : NSObjectProtocol { func handle(intent: INAddMediaIntent, completion: @escaping (INAddMediaIntentResponse) -> Void) + func handle(intent: INAddMediaIntent) async -> INAddMediaIntentResponse optional func confirm(intent: INAddMediaIntent, completion: @escaping (INAddMediaIntentResponse) -> Void) + optional func confirm(intent: INAddMediaIntent) async -> INAddMediaIntentResponse optional func resolveMediaItems(for intent: INAddMediaIntent, with completion: @escaping ([INAddMediaMediaItemResolutionResult]) -> Void) + optional func resolveMediaItems(for intent: INAddMediaIntent) async -> [INAddMediaMediaItemResolutionResult] optional func resolveMediaDestination(for intent: INAddMediaIntent, with completion: @escaping (INAddMediaMediaDestinationResolutionResult) -> Void) + optional func resolveMediaDestination(for intent: INAddMediaIntent) async -> INAddMediaMediaDestinationResolutionResult } diff --git a/tvOS/Intents/INInteraction.swift b/tvOS/Intents/INInteraction.swift index 12e5c48..c3ef1a1 100644 --- a/tvOS/Intents/INInteraction.swift +++ b/tvOS/Intents/INInteraction.swift @@ -24,9 +24,13 @@ enum INInteractionDirection : Int { class INInteraction : NSObject, NSSecureCoding, NSCopying { init(intent: INIntent, response: INIntentResponse?) func donate(completion: ((Error?) -> Void)? = nil) + func donate() async throws class func deleteAll(completion: ((Error?) -> Void)? = nil) + class func deleteAll() async throws class func delete(with identifiers: [String], completion: ((Error?) -> Void)? = nil) + class func delete(with identifiers: [String]) async throws class func delete(with groupIdentifier: String, completion: ((Error?) -> Void)? = nil) + class func delete(with groupIdentifier: String) async throws @NSCopying var intent: INIntent { get } @NSCopying var intentResponse: INIntentResponse? { get } var intentHandlingStatus: INIntentHandlingStatus { get } diff --git a/tvOS/Intents/INPlayMediaIntent.swift b/tvOS/Intents/INPlayMediaIntent.swift index dc2ca65..008f8f1 100644 --- a/tvOS/Intents/INPlayMediaIntent.swift +++ b/tvOS/Intents/INPlayMediaIntent.swift @@ -29,17 +29,31 @@ extension INPlayMediaIntent { @available(tvOS 14.0, *) protocol INPlayMediaIntentHandling : NSObjectProtocol { func handle(intent: INPlayMediaIntent, completion: @escaping (INPlayMediaIntentResponse) -> Void) + func handle(intent: INPlayMediaIntent) async -> INPlayMediaIntentResponse optional func confirm(intent: INPlayMediaIntent, completion: @escaping (INPlayMediaIntentResponse) -> Void) + optional func confirm(intent: INPlayMediaIntent) async -> INPlayMediaIntentResponse @available(tvOS 13.0, *) optional func resolveMediaItems(for intent: INPlayMediaIntent, with completion: @escaping ([INPlayMediaMediaItemResolutionResult]) -> Void) @available(tvOS 13.0, *) + optional func resolveMediaItems(for intent: INPlayMediaIntent) async -> [INPlayMediaMediaItemResolutionResult] + @available(tvOS 13.0, *) optional func resolvePlayShuffled(for intent: INPlayMediaIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) @available(tvOS 13.0, *) + optional func resolvePlayShuffled(for intent: INPlayMediaIntent) async -> INBooleanResolutionResult + @available(tvOS 13.0, *) optional func resolvePlaybackRepeatMode(for intent: INPlayMediaIntent, with completion: @escaping (INPlaybackRepeatModeResolutionResult) -> Void) @available(tvOS 13.0, *) + optional func resolvePlaybackRepeatMode(for intent: INPlayMediaIntent) async -> INPlaybackRepeatModeResolutionResult + @available(tvOS 13.0, *) optional func resolveResumePlayback(for intent: INPlayMediaIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) @available(tvOS 13.0, *) + optional func resolveResumePlayback(for intent: INPlayMediaIntent) async -> INBooleanResolutionResult + @available(tvOS 13.0, *) optional func resolvePlaybackQueueLocation(for intent: INPlayMediaIntent, with completion: @escaping (INPlaybackQueueLocationResolutionResult) -> Void) @available(tvOS 13.0, *) + optional func resolvePlaybackQueueLocation(for intent: INPlayMediaIntent) async -> INPlaybackQueueLocationResolutionResult + @available(tvOS 13.0, *) optional func resolvePlaybackSpeed(for intent: INPlayMediaIntent, with completion: @escaping (INPlayMediaPlaybackSpeedResolutionResult) -> Void) + @available(tvOS 13.0, *) + optional func resolvePlaybackSpeed(for intent: INPlayMediaIntent) async -> INPlayMediaPlaybackSpeedResolutionResult } diff --git a/tvOS/Intents/INSearchForMediaIntent.swift b/tvOS/Intents/INSearchForMediaIntent.swift index 3c82190..7167cc4 100644 --- a/tvOS/Intents/INSearchForMediaIntent.swift +++ b/tvOS/Intents/INSearchForMediaIntent.swift @@ -8,6 +8,9 @@ class INSearchForMediaIntent : INIntent { @available(tvOS 14.0, *) protocol INSearchForMediaIntentHandling : NSObjectProtocol { func handle(intent: INSearchForMediaIntent, completion: @escaping (INSearchForMediaIntentResponse) -> Void) + func handle(intent: INSearchForMediaIntent) async -> INSearchForMediaIntentResponse optional func confirm(intent: INSearchForMediaIntent, completion: @escaping (INSearchForMediaIntentResponse) -> Void) + optional func confirm(intent: INSearchForMediaIntent) async -> INSearchForMediaIntentResponse optional func resolveMediaItems(for intent: INSearchForMediaIntent, with completion: @escaping ([INSearchForMediaMediaItemResolutionResult]) -> Void) + optional func resolveMediaItems(for intent: INSearchForMediaIntent) async -> [INSearchForMediaMediaItemResolutionResult] } diff --git a/tvOS/Intents/INUpdateMediaAffinityIntent.swift b/tvOS/Intents/INUpdateMediaAffinityIntent.swift index 35e7bf0..6ef756d 100644 --- a/tvOS/Intents/INUpdateMediaAffinityIntent.swift +++ b/tvOS/Intents/INUpdateMediaAffinityIntent.swift @@ -9,7 +9,11 @@ class INUpdateMediaAffinityIntent : INIntent { @available(tvOS 14.0, *) protocol INUpdateMediaAffinityIntentHandling : NSObjectProtocol { func handle(intent: INUpdateMediaAffinityIntent, completion: @escaping (INUpdateMediaAffinityIntentResponse) -> Void) + func handle(intent: INUpdateMediaAffinityIntent) async -> INUpdateMediaAffinityIntentResponse optional func confirm(intent: INUpdateMediaAffinityIntent, completion: @escaping (INUpdateMediaAffinityIntentResponse) -> Void) + optional func confirm(intent: INUpdateMediaAffinityIntent) async -> INUpdateMediaAffinityIntentResponse optional func resolveMediaItems(for intent: INUpdateMediaAffinityIntent, with completion: @escaping ([INUpdateMediaAffinityMediaItemResolutionResult]) -> Void) + optional func resolveMediaItems(for intent: INUpdateMediaAffinityIntent) async -> [INUpdateMediaAffinityMediaItemResolutionResult] optional func resolveAffinityType(for intent: INUpdateMediaAffinityIntent, with completion: @escaping (INMediaAffinityTypeResolutionResult) -> Void) + optional func resolveAffinityType(for intent: INUpdateMediaAffinityIntent) async -> INMediaAffinityTypeResolutionResult } diff --git a/tvOS/IntentsUI/INImage_IntentsUI.swift b/tvOS/IntentsUI/INImage_IntentsUI.swift index 830651e..2d814ac 100644 --- a/tvOS/IntentsUI/INImage_IntentsUI.swift +++ b/tvOS/IntentsUI/INImage_IntentsUI.swift @@ -8,4 +8,6 @@ extension INImage { class func imageSize(for response: INIntentResponse) -> CGSize @available(tvOS 14.0, *) func fetchUIImage(completion: @escaping (UIImage?) -> Void) + @available(tvOS 14.0, *) + func fetchUIImage() async -> UIImage? } diff --git a/tvOS/MapKit/MKDirections.swift b/tvOS/MapKit/MKDirections.swift index 5060dca..a3bde9d 100644 --- a/tvOS/MapKit/MKDirections.swift +++ b/tvOS/MapKit/MKDirections.swift @@ -7,7 +7,9 @@ extension MKDirections { class MKDirections : NSObject { init(request: MKDirections.Request) func calculate(completionHandler: @escaping MKDirections.DirectionsHandler) + func calculate() async throws -> MKDirections.Response? func calculateETA(completionHandler: @escaping MKDirections.ETAHandler) + func calculateETA() async throws -> MKDirections.ETAResponse? func cancel() var isCalculating: Bool { get } } diff --git a/tvOS/MapKit/MKLocalSearch.swift b/tvOS/MapKit/MKLocalSearch.swift index ca8e7e4..d260516 100644 --- a/tvOS/MapKit/MKLocalSearch.swift +++ b/tvOS/MapKit/MKLocalSearch.swift @@ -8,6 +8,7 @@ class MKLocalSearch : NSObject { @available(tvOS 14.0, *) init(request: MKLocalPointsOfInterestRequest) func start(completionHandler: @escaping MKLocalSearch.CompletionHandler) + func start() async throws -> MKLocalSearch.Response? func cancel() var isSearching: Bool { get } } diff --git a/tvOS/MapKit/MKLocalSearchCompleter.swift b/tvOS/MapKit/MKLocalSearchCompleter.swift index e8ab3e6..be7d940 100644 --- a/tvOS/MapKit/MKLocalSearchCompleter.swift +++ b/tvOS/MapKit/MKLocalSearchCompleter.swift @@ -33,8 +33,8 @@ class MKLocalSearchCompleter : NSObject { } @available(tvOS 9.2, *) protocol MKLocalSearchCompleterDelegate : NSObjectProtocol { - optional func completerDidUpdateResults(_ completer: MKLocalSearchCompleter) - optional func completer(_ completer: MKLocalSearchCompleter, didFailWithError error: Error) + @asyncHandler optional func completerDidUpdateResults(_ completer: MKLocalSearchCompleter) + @asyncHandler optional func completer(_ completer: MKLocalSearchCompleter, didFailWithError error: Error) } @available(tvOS 9.2, *) class MKLocalSearchCompletion : NSObject { diff --git a/tvOS/MapKit/MKMapSnapshotter.swift b/tvOS/MapKit/MKMapSnapshotter.swift index 80a1b6a..98ae442 100644 --- a/tvOS/MapKit/MKMapSnapshotter.swift +++ b/tvOS/MapKit/MKMapSnapshotter.swift @@ -6,7 +6,9 @@ extension MKMapSnapshotter { class MKMapSnapshotter : NSObject { init(options: MKMapSnapshotter.Options) func start(completionHandler: @escaping MKMapSnapshotter.CompletionHandler) + func start() async throws -> MKMapSnapshotter.Snapshot? func start(with queue: DispatchQueue, completionHandler: @escaping MKMapSnapshotter.CompletionHandler) + func start(with queue: DispatchQueue) async throws -> MKMapSnapshotter.Snapshot? func cancel() var isLoading: Bool { get } } diff --git a/tvOS/MapKit/MKMapView.swift b/tvOS/MapKit/MKMapView.swift index 9414930..a4d0abd 100644 --- a/tvOS/MapKit/MKMapView.swift +++ b/tvOS/MapKit/MKMapView.swift @@ -124,39 +124,39 @@ protocol MKMapViewDelegate : NSObjectProtocol { @available(tvOS 9.2, *) optional func mapView(_ mapView: MKMapView, regionDidChangeAnimated animated: Bool) @available(tvOS 11, *) - optional func mapViewDidChangeVisibleRegion(_ mapView: MKMapView) + @asyncHandler optional func mapViewDidChangeVisibleRegion(_ mapView: MKMapView) @available(tvOS 9.2, *) optional func mapViewWillStartLoadingMap(_ mapView: MKMapView) @available(tvOS 9.2, *) - optional func mapViewDidFinishLoadingMap(_ mapView: MKMapView) + @asyncHandler optional func mapViewDidFinishLoadingMap(_ mapView: MKMapView) @available(tvOS 9.2, *) - optional func mapViewDidFailLoadingMap(_ mapView: MKMapView, withError error: Error) + @asyncHandler optional func mapViewDidFailLoadingMap(_ mapView: MKMapView, withError error: Error) @available(tvOS 7.0, *) optional func mapViewWillStartRenderingMap(_ mapView: MKMapView) @available(tvOS 7.0, *) - optional func mapViewDidFinishRenderingMap(_ mapView: MKMapView, fullyRendered: Bool) + @asyncHandler optional func mapViewDidFinishRenderingMap(_ mapView: MKMapView, fullyRendered: Bool) @available(tvOS 9.2, *) optional func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? @available(tvOS 9.2, *) - optional func mapView(_ mapView: MKMapView, didAdd views: [MKAnnotationView]) + @asyncHandler optional func mapView(_ mapView: MKMapView, didAdd views: [MKAnnotationView]) @available(tvOS 4.0, *) - optional func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) + @asyncHandler optional func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) @available(tvOS 4.0, *) - optional func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView) + @asyncHandler optional func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView) @available(tvOS 4.0, *) optional func mapViewWillStartLocatingUser(_ mapView: MKMapView) @available(tvOS 4.0, *) - optional func mapViewDidStopLocatingUser(_ mapView: MKMapView) + @asyncHandler optional func mapViewDidStopLocatingUser(_ mapView: MKMapView) @available(tvOS 4.0, *) - optional func mapView(_ mapView: MKMapView, didUpdate userLocation: MKUserLocation) + @asyncHandler optional func mapView(_ mapView: MKMapView, didUpdate userLocation: MKUserLocation) @available(tvOS 4.0, *) - optional func mapView(_ mapView: MKMapView, didFailToLocateUserWithError error: Error) + @asyncHandler optional func mapView(_ mapView: MKMapView, didFailToLocateUserWithError error: Error) @available(tvOS 9.2, *) - optional func mapView(_ mapView: MKMapView, didChange mode: MKUserTrackingMode, animated: Bool) + @asyncHandler optional func mapView(_ mapView: MKMapView, didChange mode: MKUserTrackingMode, animated: Bool) @available(tvOS 7.0, *) optional func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer @available(tvOS 7.0, *) - optional func mapView(_ mapView: MKMapView, didAdd renderers: [MKOverlayRenderer]) + @asyncHandler optional func mapView(_ mapView: MKMapView, didAdd renderers: [MKOverlayRenderer]) @available(tvOS 11.0, *) optional func mapView(_ mapView: MKMapView, clusterAnnotationForMemberAnnotations memberAnnotations: [MKAnnotation]) -> MKClusterAnnotation } diff --git a/tvOS/MediaPlayer/MPMusicPlayerApplicationController.swift b/tvOS/MediaPlayer/MPMusicPlayerApplicationController.swift index 6c83845..65bd778 100644 --- a/tvOS/MediaPlayer/MPMusicPlayerApplicationController.swift +++ b/tvOS/MediaPlayer/MPMusicPlayerApplicationController.swift @@ -11,6 +11,7 @@ class MPMusicPlayerControllerMutableQueue : MPMusicPlayerControllerQueue { @available(tvOS 14.0, *) class MPMusicPlayerApplicationController : MPMusicPlayerController { func perform(queueTransaction: @escaping (MPMusicPlayerControllerMutableQueue) -> Void, completionHandler: @escaping (MPMusicPlayerControllerQueue, Error?) -> Void) + func perform(queueTransaction: @escaping (MPMusicPlayerControllerMutableQueue) -> Void) async throws -> MPMusicPlayerControllerQueue } extension NSNotification.Name { @available(tvOS 14.0, *) diff --git a/tvOS/MediaPlayer/MPMusicPlayerController.swift b/tvOS/MediaPlayer/MPMusicPlayerController.swift index bc85ef5..34d91a8 100644 --- a/tvOS/MediaPlayer/MPMusicPlayerController.swift +++ b/tvOS/MediaPlayer/MPMusicPlayerController.swift @@ -54,6 +54,8 @@ class MPMusicPlayerController : NSObject, MPMediaPlayback { func append(_ descriptor: MPMusicPlayerQueueDescriptor) @available(tvOS 14.0, *) func prepareToPlay(completionHandler: @escaping (Error?) -> Void) + @available(tvOS 14.0, *) + func prepareToPlay() async throws func skipToNextItem() func skipToBeginning() func skipToPreviousItem() diff --git a/tvOS/MediaPlayer/MPNowPlayingSession.swift b/tvOS/MediaPlayer/MPNowPlayingSession.swift index 0dc0a12..c260131 100644 --- a/tvOS/MediaPlayer/MPNowPlayingSession.swift +++ b/tvOS/MediaPlayer/MPNowPlayingSession.swift @@ -9,11 +9,12 @@ class MPNowPlayingSession : NSObject { var canBecomeActive: Bool { get } var isActive: Bool { get } func becomeActiveIfPossible(completion: ((Bool) -> Void)? = nil) + func becomeActiveIfPossible() async -> Bool func addPlayer(_ player: AVPlayer) func removePlayer(_ player: AVPlayer) } @available(tvOS 14.0, *) protocol MPNowPlayingSessionDelegate : NSObjectProtocol { - optional func nowPlayingSessionDidChangeActive(_ nowPlayingSession: MPNowPlayingSession) - optional func nowPlayingSessionDidChangeCanBecomeActive(_ nowPlayingSession: MPNowPlayingSession) + @asyncHandler optional func nowPlayingSessionDidChangeActive(_ nowPlayingSession: MPNowPlayingSession) + @asyncHandler optional func nowPlayingSessionDidChangeCanBecomeActive(_ nowPlayingSession: MPNowPlayingSession) } diff --git a/tvOS/Metal/MTLDevice.swift b/tvOS/Metal/MTLDevice.swift index 0e47636..fa2f1c1 100644 --- a/tvOS/Metal/MTLDevice.swift +++ b/tvOS/Metal/MTLDevice.swift @@ -141,18 +141,25 @@ protocol MTLDevice : NSObjectProtocol { func makeLibrary(data: __DispatchData) throws -> MTLLibrary func makeLibrary(source: String, options: MTLCompileOptions?) throws -> MTLLibrary func makeLibrary(source: String, options: MTLCompileOptions?, completionHandler: @escaping MTLNewLibraryCompletionHandler) + func makeLibrary(source: String, options: MTLCompileOptions?) async throws -> MTLLibrary? func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor) throws -> MTLRenderPipelineState func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer?) throws -> MTLRenderPipelineState func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, completionHandler: @escaping MTLNewRenderPipelineStateCompletionHandler) + func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor) async throws -> MTLRenderPipelineState? func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption, completionHandler: @escaping MTLNewRenderPipelineStateWithReflectionCompletionHandler) + func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLRenderPipelineState?, MTLRenderPipelineReflection?) func makeComputePipelineState(function computeFunction: MTLFunction) throws -> MTLComputePipelineState func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer?) throws -> MTLComputePipelineState func makeComputePipelineState(function computeFunction: MTLFunction, completionHandler: @escaping MTLNewComputePipelineStateCompletionHandler) + func makeComputePipelineState(function computeFunction: MTLFunction) async throws -> MTLComputePipelineState? func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption, completionHandler: @escaping MTLNewComputePipelineStateWithReflectionCompletionHandler) + func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption) async throws -> (MTLComputePipelineState?, MTLComputePipelineReflection?) @available(tvOS 9.0, *) func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer?) throws -> MTLComputePipelineState @available(tvOS 9.0, *) func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption, completionHandler: @escaping MTLNewComputePipelineStateWithReflectionCompletionHandler) + @available(tvOS 9.0, *) + func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLComputePipelineState?, MTLComputePipelineReflection?) @available(tvOS 10.0, *) func makeFence() -> MTLFence? func supportsFeatureSet(_ featureSet: MTLFeatureSet) -> Bool diff --git a/tvOS/Metal/MTLLibrary.swift b/tvOS/Metal/MTLLibrary.swift index 2d49174..b1bc3ca 100644 --- a/tvOS/Metal/MTLLibrary.swift +++ b/tvOS/Metal/MTLLibrary.swift @@ -135,9 +135,13 @@ protocol MTLLibrary : NSObjectProtocol { func makeFunction(name: String, constantValues: MTLFunctionConstantValues) throws -> MTLFunction @available(tvOS 10.0, *) func makeFunction(name: String, constantValues: MTLFunctionConstantValues, completionHandler: @escaping (MTLFunction?, Error?) -> Void) + @available(tvOS 10.0, *) + func makeFunction(name: String, constantValues: MTLFunctionConstantValues) async throws -> MTLFunction? @available(tvOS 14.0, *) func makeFunction(descriptor: MTLFunctionDescriptor, completionHandler: @escaping (MTLFunction?, Error?) -> Void) @available(tvOS 14.0, *) + func makeFunction(descriptor: MTLFunctionDescriptor) async throws -> MTLFunction? + @available(tvOS 14.0, *) func makeFunction(descriptor: MTLFunctionDescriptor) throws -> MTLFunction var functionNames: [String] { get } @available(tvOS 14.0, *) diff --git a/tvOS/MetalKit/MTKTextureLoader.swift b/tvOS/MetalKit/MTKTextureLoader.swift index 7cc25a4..c1900a5 100644 --- a/tvOS/MetalKit/MTKTextureLoader.swift +++ b/tvOS/MetalKit/MTKTextureLoader.swift @@ -65,16 +65,27 @@ class MTKTextureLoader : NSObject { var device: MTLDevice { get } init(device: MTLDevice) func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) + func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? @available(tvOS 10.0, *) func newTexture(name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) @available(tvOS 10.0, *) + func newTexture(name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + @available(tvOS 10.0, *) func newTextures(URLs: [URL], options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.ArrayCallback) @available(tvOS 10.0, *) + func newTextures(URLs: [URL], options: [MTKTextureLoader.Option : Any]? = nil) async throws -> [MTLTexture] + @available(tvOS 10.0, *) func newTextures(names: [String], scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.ArrayCallback) + @available(tvOS 10.0, *) + func newTextures(names: [String], scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> [MTLTexture] func newTexture(data: Data, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) + func newTexture(data: Data, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? func newTexture(cgImage: CGImage, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) + func newTexture(cgImage: CGImage, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? @available(tvOS 10.0, *) func newTexture(texture: MDLTexture, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) + @available(tvOS 10.0, *) + func newTexture(texture: MDLTexture, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil) throws -> MTLTexture @available(tvOS 10.0, *) func newTextures(URLs: [URL], options: [MTKTextureLoader.Option : Any]? = nil, error: NSErrorPointer) -> [MTLTexture] diff --git a/tvOS/MetalPerformanceShaders/MetalPerformanceShaders.swift b/tvOS/MetalPerformanceShaders/MetalPerformanceShaders.swift index 197de0b..76ed380 100644 --- a/tvOS/MetalPerformanceShaders/MetalPerformanceShaders.swift +++ b/tvOS/MetalPerformanceShaders/MetalPerformanceShaders.swift @@ -3739,6 +3739,7 @@ class MPSAccelerationStructure : MPSKernel, NSSecureCoding, NSCopying { init?(coder aDecoder: NSCoder, group: MPSAccelerationStructureGroup) func rebuild() func rebuild(completionHandler: @escaping MPSAccelerationStructureCompletionHandler) + func rebuild() async -> MPSAccelerationStructure? func encodeRefit(commandBuffer: MTLCommandBuffer) func copy(with zone: NSZone? = nil, group: MPSAccelerationStructureGroup) -> Self } diff --git a/tvOS/MultipeerConnectivity/MCAdvertiserAssistant.swift b/tvOS/MultipeerConnectivity/MCAdvertiserAssistant.swift index 827c5e0..ba28a80 100644 --- a/tvOS/MultipeerConnectivity/MCAdvertiserAssistant.swift +++ b/tvOS/MultipeerConnectivity/MCAdvertiserAssistant.swift @@ -13,5 +13,5 @@ protocol MCAdvertiserAssistantDelegate : NSObjectProtocol { @available(tvOS 7.0, *) optional func advertiserAssistantWillPresentInvitation(_ advertiserAssistant: MCAdvertiserAssistant) @available(tvOS 7.0, *) - optional func advertiserAssistantDidDismissInvitation(_ advertiserAssistant: MCAdvertiserAssistant) + @asyncHandler optional func advertiserAssistantDidDismissInvitation(_ advertiserAssistant: MCAdvertiserAssistant) } diff --git a/tvOS/MultipeerConnectivity/MCBrowserViewController.swift b/tvOS/MultipeerConnectivity/MCBrowserViewController.swift index 4574259..16d9b94 100644 --- a/tvOS/MultipeerConnectivity/MCBrowserViewController.swift +++ b/tvOS/MultipeerConnectivity/MCBrowserViewController.swift @@ -11,7 +11,7 @@ class MCBrowserViewController : UIViewController, MCNearbyServiceBrowserDelegate } protocol MCBrowserViewControllerDelegate : NSObjectProtocol { @available(tvOS 7.0, *) - func browserViewControllerDidFinish(_ browserViewController: MCBrowserViewController) + @asyncHandler func browserViewControllerDidFinish(_ browserViewController: MCBrowserViewController) @available(tvOS 7.0, *) func browserViewControllerWasCancelled(_ browserViewController: MCBrowserViewController) @available(tvOS 7.0, *) diff --git a/tvOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift b/tvOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift index bd01b80..4fff340 100644 --- a/tvOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift +++ b/tvOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift @@ -11,7 +11,7 @@ class MCNearbyServiceAdvertiser : NSObject { } protocol MCNearbyServiceAdvertiserDelegate : NSObjectProtocol { @available(tvOS 7.0, *) - func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didReceiveInvitationFromPeer peerID: MCPeerID, withContext context: Data?, invitationHandler: @escaping (Bool, MCSession?) -> Void) + @asyncHandler func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didReceiveInvitationFromPeer peerID: MCPeerID, withContext context: Data?, invitationHandler: @escaping (Bool, MCSession?) -> Void) @available(tvOS 7.0, *) - optional func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didNotStartAdvertisingPeer error: Error) + @asyncHandler optional func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didNotStartAdvertisingPeer error: Error) } diff --git a/tvOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift b/tvOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift index c85021d..8617971 100644 --- a/tvOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift +++ b/tvOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift @@ -15,5 +15,5 @@ protocol MCNearbyServiceBrowserDelegate : NSObjectProtocol { @available(tvOS 7.0, *) func browser(_ browser: MCNearbyServiceBrowser, lostPeer peerID: MCPeerID) @available(tvOS 7.0, *) - optional func browser(_ browser: MCNearbyServiceBrowser, didNotStartBrowsingForPeers error: Error) + @asyncHandler optional func browser(_ browser: MCNearbyServiceBrowser, didNotStartBrowsingForPeers error: Error) } diff --git a/tvOS/MultipeerConnectivity/MCSession.swift b/tvOS/MultipeerConnectivity/MCSession.swift index fa50725..ba70f09 100644 --- a/tvOS/MultipeerConnectivity/MCSession.swift +++ b/tvOS/MultipeerConnectivity/MCSession.swift @@ -42,20 +42,21 @@ class MCSession : NSObject { } protocol MCSessionDelegate : NSObjectProtocol { @available(tvOS 7.0, *) - func session(_ session: MCSession, peer peerID: MCPeerID, didChange state: MCSessionState) + @asyncHandler func session(_ session: MCSession, peer peerID: MCPeerID, didChange state: MCSessionState) @available(tvOS 7.0, *) - func session(_ session: MCSession, didReceive data: Data, fromPeer peerID: MCPeerID) + @asyncHandler func session(_ session: MCSession, didReceive data: Data, fromPeer peerID: MCPeerID) @available(tvOS 7.0, *) - func session(_ session: MCSession, didReceive stream: InputStream, withName streamName: String, fromPeer peerID: MCPeerID) + @asyncHandler func session(_ session: MCSession, didReceive stream: InputStream, withName streamName: String, fromPeer peerID: MCPeerID) @available(tvOS 9.0, *) - func session(_ session: MCSession, didStartReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, with progress: Progress) + @asyncHandler func session(_ session: MCSession, didStartReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, with progress: Progress) @available(tvOS 7.0, *) - func session(_ session: MCSession, didFinishReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, at localURL: URL?, withError error: Error?) + @asyncHandler func session(_ session: MCSession, didFinishReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, at localURL: URL?, withError error: Error?) @available(tvOS 7.0, *) - optional func session(_ session: MCSession, didReceiveCertificate certificate: [Any]?, fromPeer peerID: MCPeerID, certificateHandler: @escaping (Bool) -> Void) + @asyncHandler optional func session(_ session: MCSession, didReceiveCertificate certificate: [Any]?, fromPeer peerID: MCPeerID, certificateHandler: @escaping (Bool) -> Void) } extension MCSession { func nearbyConnectionData(forPeer peerID: MCPeerID, withCompletionHandler completionHandler: @escaping (Data?, Error?) -> Void) + func nearbyConnectionData(forPeer peerID: MCPeerID) async throws -> Data? func connectPeer(_ peerID: MCPeerID, withNearbyConnectionData data: Data) func cancelConnectPeer(_ peerID: MCPeerID) } diff --git a/tvOS/NaturalLanguage/NLTagger.swift b/tvOS/NaturalLanguage/NLTagger.swift index 103c9b0..ab84ef0 100644 --- a/tvOS/NaturalLanguage/NLTagger.swift +++ b/tvOS/NaturalLanguage/NLTagger.swift @@ -37,6 +37,8 @@ class NLTagger : NSObject { func gazetteers(for tagScheme: NLTagScheme) -> [NLGazetteer] @available(tvOS 13.0, *) class func requestAssets(for language: NLLanguage, tagScheme: NLTagScheme, completionHandler: @escaping (NLTagger.AssetsResult, Error?) -> Void) + @available(tvOS 13.0, *) + class func requestAssets(for language: NLLanguage, tagScheme: NLTagScheme) async throws -> NLTagger.AssetsResult } @available(macOS 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *) diff --git a/tvOS/Photos/PHAssetResourceManager.swift b/tvOS/Photos/PHAssetResourceManager.swift index a4ee426..4fdc90f 100644 --- a/tvOS/Photos/PHAssetResourceManager.swift +++ b/tvOS/Photos/PHAssetResourceManager.swift @@ -21,5 +21,7 @@ class PHAssetResourceManager : NSObject { @available(tvOS 10, *) func writeData(for resource: PHAssetResource, toFile fileURL: URL, options: PHAssetResourceRequestOptions?, completionHandler: @escaping (Error?) -> Void) @available(tvOS 10, *) + func writeData(for resource: PHAssetResource, toFile fileURL: URL, options: PHAssetResourceRequestOptions?) async throws + @available(tvOS 10, *) func cancelDataRequest(_ requestID: PHAssetResourceDataRequestID) } diff --git a/tvOS/Photos/PHLivePhotoEditingContext.swift b/tvOS/Photos/PHLivePhotoEditingContext.swift index 5f28629..5b2040b 100644 --- a/tvOS/Photos/PHLivePhotoEditingContext.swift +++ b/tvOS/Photos/PHLivePhotoEditingContext.swift @@ -26,8 +26,12 @@ class PHLivePhotoEditingContext : NSObject { @available(tvOS 10, *) func prepareLivePhotoForPlayback(withTargetSize targetSize: CGSize, options: [String : Any]? = nil, completionHandler handler: @escaping (PHLivePhoto?, Error?) -> Void) @available(tvOS 10, *) + func prepareLivePhotoForPlayback(withTargetSize targetSize: CGSize, options: [String : Any]? = nil) async throws -> PHLivePhoto? + @available(tvOS 10, *) func saveLivePhoto(to output: PHContentEditingOutput, options: [String : Any]? = nil, completionHandler handler: @escaping (Bool, Error?) -> Void) @available(tvOS 10, *) + func saveLivePhoto(to output: PHContentEditingOutput, options: [String : Any]? = nil) async throws -> Bool + @available(tvOS 10, *) func cancel() } @available(tvOS 10, tvOS 10, *) diff --git a/tvOS/Photos/PHPhotoLibrary.swift b/tvOS/Photos/PHPhotoLibrary.swift index 63feddc..a179186 100644 --- a/tvOS/Photos/PHPhotoLibrary.swift +++ b/tvOS/Photos/PHPhotoLibrary.swift @@ -26,12 +26,12 @@ enum PHAccessLevel : Int { @available(tvOS 10, *) protocol PHPhotoLibraryChangeObserver : NSObjectProtocol { @available(tvOS 10, *) - func photoLibraryDidChange(_ changeInstance: PHChange) + @asyncHandler func photoLibraryDidChange(_ changeInstance: PHChange) } @available(tvOS 13, *) protocol PHPhotoLibraryAvailabilityObserver : NSObjectProtocol { @available(tvOS 13, *) - func photoLibraryDidBecomeUnavailable(_ photoLibrary: PHPhotoLibrary) + @asyncHandler func photoLibraryDidBecomeUnavailable(_ photoLibrary: PHPhotoLibrary) } @available(tvOS 10, *) class PHPhotoLibrary : NSObject { @@ -54,6 +54,8 @@ class PHPhotoLibrary : NSObject { @available(tvOS 10, *) func performChanges(_ changeBlock: @escaping () -> Void, completionHandler: ((Bool, Error?) -> Void)? = nil) @available(tvOS 10, *) + func performChanges(_ changeBlock: @escaping () -> Void) async throws -> Bool + @available(tvOS 10, *) func performChangesAndWait(_ changeBlock: @escaping () -> Void) throws @available(tvOS 10, *) func register(_ observer: PHPhotoLibraryChangeObserver) diff --git a/tvOS/PhotosUI/PHLivePhotoView.swift b/tvOS/PhotosUI/PHLivePhotoView.swift index 5a8899a..12c5e96 100644 --- a/tvOS/PhotosUI/PHLivePhotoView.swift +++ b/tvOS/PhotosUI/PHLivePhotoView.swift @@ -41,5 +41,5 @@ protocol PHLivePhotoViewDelegate : NSObjectProtocol { @available(tvOS 10, *) optional func livePhotoView(_ livePhotoView: PHLivePhotoView, willBeginPlaybackWith playbackStyle: PHLivePhotoViewPlaybackStyle) @available(tvOS 10, *) - optional func livePhotoView(_ livePhotoView: PHLivePhotoView, didEndPlaybackWith playbackStyle: PHLivePhotoViewPlaybackStyle) + @asyncHandler optional func livePhotoView(_ livePhotoView: PHLivePhotoView, didEndPlaybackWith playbackStyle: PHLivePhotoViewPlaybackStyle) } diff --git a/tvOS/QuartzCore/CAAnimation.swift b/tvOS/QuartzCore/CAAnimation.swift index 415b51b..25ff41f 100644 --- a/tvOS/QuartzCore/CAAnimation.swift +++ b/tvOS/QuartzCore/CAAnimation.swift @@ -29,9 +29,9 @@ class CAAnimation : NSObject, NSSecureCoding, NSCopying, CAMediaTiming, CAAction } protocol CAAnimationDelegate : NSObjectProtocol { @available(tvOS 9.0, *) - optional func animationDidStart(_ anim: CAAnimation) + @asyncHandler optional func animationDidStart(_ anim: CAAnimation) @available(tvOS 9.0, *) - optional func animationDidStop(_ anim: CAAnimation, finished flag: Bool) + @asyncHandler optional func animationDidStop(_ anim: CAAnimation, finished flag: Bool) } @available(tvOS 9.0, *) class CAPropertyAnimation : CAAnimation { diff --git a/tvOS/ReplayKit/RPBroadcast.swift b/tvOS/ReplayKit/RPBroadcast.swift index a064d1e..d74183e 100644 --- a/tvOS/ReplayKit/RPBroadcast.swift +++ b/tvOS/ReplayKit/RPBroadcast.swift @@ -7,7 +7,7 @@ class RPBroadcastActivityViewController : UIViewController { @available(tvOS 10.0, *) protocol RPBroadcastActivityViewControllerDelegate : NSObjectProtocol { @available(tvOS 10.0, *) - func broadcastActivityViewController(_ broadcastActivityViewController: RPBroadcastActivityViewController, didFinishWith broadcastController: RPBroadcastController?, error: Error?) + @asyncHandler func broadcastActivityViewController(_ broadcastActivityViewController: RPBroadcastActivityViewController, didFinishWith broadcastController: RPBroadcastController?, error: Error?) } @available(tvOS 10.0, *) class RPBroadcastController : NSObject { @@ -25,8 +25,8 @@ class RPBroadcastController : NSObject { } @available(tvOS 10.0, *) protocol RPBroadcastControllerDelegate : NSObjectProtocol { - optional func broadcastController(_ broadcastController: RPBroadcastController, didFinishWithError error: Error?) - optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateServiceInfo serviceInfo: [String : NSCoding & NSObjectProtocol]) + @asyncHandler optional func broadcastController(_ broadcastController: RPBroadcastController, didFinishWithError error: Error?) + @asyncHandler optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateServiceInfo serviceInfo: [String : NSCoding & NSObjectProtocol]) @available(tvOS 11.0, *) - optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateBroadcast broadcastURL: URL) + @asyncHandler optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateBroadcast broadcastURL: URL) } diff --git a/tvOS/ReplayKit/RPBroadcastExtension.swift b/tvOS/ReplayKit/RPBroadcastExtension.swift index f5b1fc1..8ab685a 100644 --- a/tvOS/ReplayKit/RPBroadcastExtension.swift +++ b/tvOS/ReplayKit/RPBroadcastExtension.swift @@ -1,6 +1,7 @@ extension NSExtensionContext { func loadBroadcastingApplicationInfo(completion handler: @escaping (String, String, UIImage?) -> Void) + func loadBroadcastingApplicationInfo() async -> (String, String, UIImage?) @available(tvOS, introduced: 10.0, deprecated: 11.0, message: "No longer supported") func completeRequest(withBroadcast broadcastURL: URL, broadcastConfiguration: RPBroadcastConfiguration, setupInfo: [String : NSCoding & NSObjectProtocol]?) @available(tvOS 11.0, *) diff --git a/tvOS/ReplayKit/RPPreviewViewController.swift b/tvOS/ReplayKit/RPPreviewViewController.swift index 09e0792..f274ad9 100644 --- a/tvOS/ReplayKit/RPPreviewViewController.swift +++ b/tvOS/ReplayKit/RPPreviewViewController.swift @@ -11,5 +11,5 @@ class RPPreviewViewController : UIViewController { var mode: RPPreviewViewControllerMode } protocol RPPreviewViewControllerDelegate : NSObjectProtocol { - optional func previewControllerDidFinish(_ previewController: RPPreviewViewController) + @asyncHandler optional func previewControllerDidFinish(_ previewController: RPPreviewViewController) } diff --git a/tvOS/ReplayKit/RPScreenRecorder.swift b/tvOS/ReplayKit/RPScreenRecorder.swift index 70f2463..4e5f0b7 100644 --- a/tvOS/ReplayKit/RPScreenRecorder.swift +++ b/tvOS/ReplayKit/RPScreenRecorder.swift @@ -8,10 +8,14 @@ class RPScreenRecorder : NSObject { func stopRecording(handler: ((RPPreviewViewController?, Error?) -> Void)? = nil) @available(tvOS 14.0, *) func stopRecording(withOutput url: URL, completionHandler: ((Error?) -> Void)? = nil) + @available(tvOS 14.0, *) + func stopRecording(withOutput url: URL) async throws func discardRecording(handler: @escaping () -> Void) @available(tvOS 11.0, *) func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 11.0, *) + func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?) async throws + @available(tvOS 11.0, *) func stopCapture(handler: ((Error?) -> Void)? = nil) weak var delegate: @sil_weak RPScreenRecorderDelegate? var isAvailable: Bool { get } @@ -20,8 +24,8 @@ class RPScreenRecorder : NSObject { @available(tvOS 10.0, *) protocol RPScreenRecorderDelegate : NSObjectProtocol { @available(tvOS, introduced: 10.0, deprecated: 10.0, message: "No longer supported") - optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWithError error: Error, previewViewController: RPPreviewViewController?) + @asyncHandler optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWithError error: Error, previewViewController: RPPreviewViewController?) @available(tvOS 11.0, *) - optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWith previewViewController: RPPreviewViewController?, error: Error?) - optional func screenRecorderDidChangeAvailability(_ screenRecorder: RPScreenRecorder) + @asyncHandler optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWith previewViewController: RPPreviewViewController?, error: Error?) + @asyncHandler optional func screenRecorderDidChangeAvailability(_ screenRecorder: RPScreenRecorder) } diff --git a/tvOS/SceneKit/SCNAction.swift b/tvOS/SceneKit/SCNAction.swift index cc6256d..8a89838 100644 --- a/tvOS/SceneKit/SCNAction.swift +++ b/tvOS/SceneKit/SCNAction.swift @@ -3,8 +3,10 @@ typealias SCNActionTimingFunction = (Float) -> Float protocol SCNActionable : NSObjectProtocol { func runAction(_ action: SCNAction) func runAction(_ action: SCNAction, completionHandler block: (() -> Void)? = nil) + func runAction(_ action: SCNAction) async func runAction(_ action: SCNAction, forKey key: String?) func runAction(_ action: SCNAction, forKey key: String?, completionHandler block: (() -> Void)? = nil) + func runAction(_ action: SCNAction, forKey key: String?) async var hasActions: Bool { get } func action(forKey key: String) -> SCNAction? func removeAction(forKey key: String) diff --git a/tvOS/SceneKit/SCNCameraController.swift b/tvOS/SceneKit/SCNCameraController.swift index 9fada80..12c7735 100644 --- a/tvOS/SceneKit/SCNCameraController.swift +++ b/tvOS/SceneKit/SCNCameraController.swift @@ -14,7 +14,7 @@ enum SCNInteractionMode : Int { @available(tvOS 11.0, *) protocol SCNCameraControllerDelegate : NSObjectProtocol { optional func cameraInertiaWillStart(for cameraController: SCNCameraController) - optional func cameraInertiaDidEnd(for cameraController: SCNCameraController) + @asyncHandler optional func cameraInertiaDidEnd(for cameraController: SCNCameraController) } @available(tvOS 11.0, *) class SCNCameraController : NSObject { diff --git a/tvOS/SceneKit/SCNConstraint.swift b/tvOS/SceneKit/SCNConstraint.swift index 664ef6b..e4f0ff7 100644 --- a/tvOS/SceneKit/SCNConstraint.swift +++ b/tvOS/SceneKit/SCNConstraint.swift @@ -78,7 +78,7 @@ class SCNSliderConstraint : SCNConstraint { @available(tvOS 11.0, *) protocol SCNAvoidOccluderConstraintDelegate : NSObjectProtocol { optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, shouldAvoidOccluder occluder: SCNNode, for node: SCNNode) -> Bool - optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, didAvoidOccluder occluder: SCNNode, for node: SCNNode) + @asyncHandler optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, didAvoidOccluder occluder: SCNNode, for node: SCNNode) } @available(tvOS 11.0, *) class SCNAvoidOccluderConstraint : SCNConstraint { diff --git a/tvOS/SceneKit/SCNPhysicsWorld.swift b/tvOS/SceneKit/SCNPhysicsWorld.swift index 74bf4d8..49f7d9b 100644 --- a/tvOS/SceneKit/SCNPhysicsWorld.swift +++ b/tvOS/SceneKit/SCNPhysicsWorld.swift @@ -22,9 +22,9 @@ extension SCNPhysicsWorld.TestSearchMode { static let all: SCNPhysicsWorld.TestSearchMode } protocol SCNPhysicsContactDelegate : NSObjectProtocol { - optional func physicsWorld(_ world: SCNPhysicsWorld, didBegin contact: SCNPhysicsContact) - optional func physicsWorld(_ world: SCNPhysicsWorld, didUpdate contact: SCNPhysicsContact) - optional func physicsWorld(_ world: SCNPhysicsWorld, didEnd contact: SCNPhysicsContact) + @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didBegin contact: SCNPhysicsContact) + @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didUpdate contact: SCNPhysicsContact) + @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didEnd contact: SCNPhysicsContact) } class SCNPhysicsWorld : NSObject, NSSecureCoding { var gravity: SCNVector3 diff --git a/tvOS/SceneKit/SCNSceneRenderer.swift b/tvOS/SceneKit/SCNSceneRenderer.swift index 37e5939..718b70b 100644 --- a/tvOS/SceneKit/SCNSceneRenderer.swift +++ b/tvOS/SceneKit/SCNSceneRenderer.swift @@ -53,6 +53,7 @@ protocol SCNSceneRenderer : NSObjectProtocol { var isTemporalAntialiasingEnabled: Bool { get set } func prepare(_ object: Any, shouldAbortBlock block: (() -> Bool)? = nil) -> Bool func prepare(_ objects: [Any], completionHandler: ((Bool) -> Void)? = nil) + func prepare(_ objects: [Any]) async -> Bool var showsStatistics: Bool { get set } @available(tvOS 9.0, *) var debugOptions: SCNDebugOptions { get set } @@ -82,10 +83,10 @@ protocol SCNSceneRenderer : NSObjectProtocol { } protocol SCNSceneRendererDelegate : NSObjectProtocol { optional func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) - optional func renderer(_ renderer: SCNSceneRenderer, didApplyAnimationsAtTime time: TimeInterval) - optional func renderer(_ renderer: SCNSceneRenderer, didSimulatePhysicsAtTime time: TimeInterval) + @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didApplyAnimationsAtTime time: TimeInterval) + @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didSimulatePhysicsAtTime time: TimeInterval) @available(tvOS 11.0, *) - optional func renderer(_ renderer: SCNSceneRenderer, didApplyConstraintsAtTime time: TimeInterval) + @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didApplyConstraintsAtTime time: TimeInterval) optional func renderer(_ renderer: SCNSceneRenderer, willRenderScene scene: SCNScene, atTime time: TimeInterval) - optional func renderer(_ renderer: SCNSceneRenderer, didRenderScene scene: SCNScene, atTime time: TimeInterval) + @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didRenderScene scene: SCNScene, atTime time: TimeInterval) } diff --git a/tvOS/SoundAnalysis/SNAnalyzer.swift b/tvOS/SoundAnalysis/SNAnalyzer.swift index add2d7c..db4f2c1 100644 --- a/tvOS/SoundAnalysis/SNAnalyzer.swift +++ b/tvOS/SoundAnalysis/SNAnalyzer.swift @@ -16,5 +16,6 @@ class SNAudioFileAnalyzer : NSObject { func removeAllRequests() func analyze() func analyze(completionHandler: @escaping (Bool) -> Void) + func analyze() async -> Bool func cancelAnalysis() } diff --git a/tvOS/SoundAnalysis/SNResult.swift b/tvOS/SoundAnalysis/SNResult.swift index c3b10b4..1a37ab3 100644 --- a/tvOS/SoundAnalysis/SNResult.swift +++ b/tvOS/SoundAnalysis/SNResult.swift @@ -4,7 +4,7 @@ protocol SNResult : NSObjectProtocol { } @available(tvOS 13.0, *) protocol SNResultsObserving : NSObjectProtocol { - func request(_ request: SNRequest, didProduce result: SNResult) - optional func request(_ request: SNRequest, didFailWithError error: Error) - optional func requestDidComplete(_ request: SNRequest) + @asyncHandler func request(_ request: SNRequest, didProduce result: SNResult) + @asyncHandler optional func request(_ request: SNRequest, didFailWithError error: Error) + @asyncHandler optional func requestDidComplete(_ request: SNRequest) } diff --git a/tvOS/SpriteKit/SKNode.swift b/tvOS/SpriteKit/SKNode.swift index 3999da0..f8699e8 100644 --- a/tvOS/SpriteKit/SKNode.swift +++ b/tvOS/SpriteKit/SKNode.swift @@ -65,6 +65,7 @@ class SKNode : UIResponder, NSCopying, NSSecureCoding, UIFocusItem { func inParentHierarchy(_ parent: SKNode) -> Bool func run(_ action: SKAction) func run(_ action: SKAction, completion block: @escaping () -> Void) + func run(_ action: SKAction) async func run(_ action: SKAction, withKey key: String) func hasActions() -> Bool func action(forKey key: String) -> SKAction? diff --git a/tvOS/SpriteKit/SKPhysicsWorld.swift b/tvOS/SpriteKit/SKPhysicsWorld.swift index 4437a64..1fb7de6 100644 --- a/tvOS/SpriteKit/SKPhysicsWorld.swift +++ b/tvOS/SpriteKit/SKPhysicsWorld.swift @@ -1,7 +1,7 @@ protocol SKPhysicsContactDelegate : NSObjectProtocol { - optional func didBegin(_ contact: SKPhysicsContact) - optional func didEnd(_ contact: SKPhysicsContact) + @asyncHandler optional func didBegin(_ contact: SKPhysicsContact) + @asyncHandler optional func didEnd(_ contact: SKPhysicsContact) } class SKPhysicsWorld : NSObject, NSSecureCoding { var gravity: CGVector diff --git a/tvOS/SpriteKit/SKScene.swift b/tvOS/SpriteKit/SKScene.swift index c6bc345..fb4db81 100644 --- a/tvOS/SpriteKit/SKScene.swift +++ b/tvOS/SpriteKit/SKScene.swift @@ -11,10 +11,10 @@ enum SKSceneScaleMode : Int { @available(tvOS 9.0, *) protocol SKSceneDelegate : NSObjectProtocol { optional func update(_ currentTime: TimeInterval, for scene: SKScene) - optional func didEvaluateActions(for scene: SKScene) - optional func didSimulatePhysics(for scene: SKScene) - optional func didApplyConstraints(for scene: SKScene) - optional func didFinishUpdate(for scene: SKScene) + @asyncHandler optional func didEvaluateActions(for scene: SKScene) + @asyncHandler optional func didSimulatePhysics(for scene: SKScene) + @asyncHandler optional func didApplyConstraints(for scene: SKScene) + @asyncHandler optional func didFinishUpdate(for scene: SKScene) } class SKScene : SKEffectNode { init(size: CGSize) diff --git a/tvOS/SpriteKit/SKTexture.swift b/tvOS/SpriteKit/SKTexture.swift index 665bd22..eb9bb3d 100644 --- a/tvOS/SpriteKit/SKTexture.swift +++ b/tvOS/SpriteKit/SKTexture.swift @@ -30,7 +30,9 @@ class SKTexture : NSObject, NSCopying, NSSecureCoding { @available(tvOS 9.0, *) func cgImage() -> CGImage class func preload(_ textures: [SKTexture], withCompletionHandler completionHandler: @escaping () -> Void) + class func preload(_ textures: [SKTexture]) async func preload(completionHandler: @escaping () -> Void) + func preload() async } extension SKTexture : _CustomPlaygroundQuickLookable { diff --git a/tvOS/SpriteKit/SKTextureAtlas.swift b/tvOS/SpriteKit/SKTextureAtlas.swift index 3cd5ae1..69b4d4e 100644 --- a/tvOS/SpriteKit/SKTextureAtlas.swift +++ b/tvOS/SpriteKit/SKTextureAtlas.swift @@ -5,9 +5,13 @@ class SKTextureAtlas : NSObject, NSSecureCoding { convenience init(dictionary properties: [String : Any]) func textureNamed(_ name: String) -> SKTexture class func preloadTextureAtlases(_ textureAtlases: [SKTextureAtlas], withCompletionHandler completionHandler: @escaping () -> Void) + class func preloadTextureAtlases(_ textureAtlases: [SKTextureAtlas]) async @available(tvOS 9.0, *) class func preloadTextureAtlasesNamed(_ atlasNames: [String], withCompletionHandler completionHandler: @escaping (Error?, [SKTextureAtlas]) -> Void) + @available(tvOS 9.0, *) + class func preloadTextureAtlasesNamed(_ atlasNames: [String]) async throws -> [SKTextureAtlas] func preload(completionHandler: @escaping () -> Void) + func preload() async var textureNames: [String] { get } } diff --git a/tvOS/StoreKit/SKCloudServiceController.swift b/tvOS/StoreKit/SKCloudServiceController.swift index c239454..ddd62d2 100644 --- a/tvOS/StoreKit/SKCloudServiceController.swift +++ b/tvOS/StoreKit/SKCloudServiceController.swift @@ -25,14 +25,24 @@ class SKCloudServiceController : NSObject { class func requestAuthorization(_ handler: @escaping (SKCloudServiceAuthorizationStatus) -> Void) @available(tvOS 9.3, *) func requestCapabilities(completionHandler: @escaping (SKCloudServiceCapability, Error?) -> Void) + @available(tvOS 9.3, *) + func requestCapabilities() async throws -> SKCloudServiceCapability @available(tvOS 11.0, *) func requestStorefrontCountryCode(completionHandler: @escaping (String?, Error?) -> Void) + @available(tvOS 11.0, *) + func requestStorefrontCountryCode() async throws -> String? @available(tvOS 9.3, *) func requestStorefrontIdentifier(completionHandler: @escaping (String?, Error?) -> Void) + @available(tvOS 9.3, *) + func requestStorefrontIdentifier() async throws -> String? @available(tvOS 11.0, *) func requestUserToken(forDeveloperToken developerToken: String, completionHandler: @escaping (String?, Error?) -> Void) + @available(tvOS 11.0, *) + func requestUserToken(forDeveloperToken developerToken: String) async throws -> String? @available(tvOS, introduced: 10.3, deprecated: 11.0) func requestPersonalizationToken(forClientToken clientToken: String, withCompletionHandler completionHandler: @escaping (String?, Error?) -> Void) + @available(tvOS, introduced: 10.3, deprecated: 11.0) + func requestPersonalizationToken(forClientToken clientToken: String) async throws -> String? } extension NSNotification.Name { @available(tvOS 9.3, *) diff --git a/tvOS/StoreKit/SKPaymentQueue.swift b/tvOS/StoreKit/SKPaymentQueue.swift index 8537174..76719c3 100644 --- a/tvOS/StoreKit/SKPaymentQueue.swift +++ b/tvOS/StoreKit/SKPaymentQueue.swift @@ -52,7 +52,7 @@ protocol SKPaymentTransactionObserver : NSObjectProtocol { @available(tvOS 11.0, *) optional func paymentQueue(_ queue: SKPaymentQueue, shouldAddStorePayment payment: SKPayment, for product: SKProduct) -> Bool @available(tvOS 13.0, *) - optional func paymentQueueDidChangeStorefront(_ queue: SKPaymentQueue) + @asyncHandler optional func paymentQueueDidChangeStorefront(_ queue: SKPaymentQueue) @available(tvOS 14.0, *) - optional func paymentQueue(_ queue: SKPaymentQueue, didRevokeEntitlementsForProductIdentifiers productIdentifiers: [String]) + @asyncHandler optional func paymentQueue(_ queue: SKPaymentQueue, didRevokeEntitlementsForProductIdentifiers productIdentifiers: [String]) } diff --git a/tvOS/StoreKit/SKProductStorePromotionController.swift b/tvOS/StoreKit/SKProductStorePromotionController.swift index be59fdb..2ab5183 100644 --- a/tvOS/StoreKit/SKProductStorePromotionController.swift +++ b/tvOS/StoreKit/SKProductStorePromotionController.swift @@ -14,9 +14,17 @@ class SKProductStorePromotionController : NSObject { @available(tvOS 11.0, *) func fetchStorePromotionVisibility(for product: SKProduct, completionHandler: ((SKProductStorePromotionVisibility, Error?) -> Void)? = nil) @available(tvOS 11.0, *) + func fetchStorePromotionVisibility(for product: SKProduct) async throws -> SKProductStorePromotionVisibility + @available(tvOS 11.0, *) func update(storePromotionVisibility promotionVisibility: SKProductStorePromotionVisibility, for product: SKProduct, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 11.0, *) + func update(storePromotionVisibility promotionVisibility: SKProductStorePromotionVisibility, for product: SKProduct) async throws + @available(tvOS 11.0, *) func fetchStorePromotionOrder(completionHandler: (([SKProduct], Error?) -> Void)? = nil) @available(tvOS 11.0, *) + func fetchStorePromotionOrder() async throws -> [SKProduct] + @available(tvOS 11.0, *) func update(storePromotionOrder: [SKProduct], completionHandler: ((Error?) -> Void)? = nil) + @available(tvOS 11.0, *) + func update(storePromotionOrder: [SKProduct]) async throws } diff --git a/tvOS/StoreKit/SKProductsRequest.swift b/tvOS/StoreKit/SKProductsRequest.swift index 1a3256d..479418d 100644 --- a/tvOS/StoreKit/SKProductsRequest.swift +++ b/tvOS/StoreKit/SKProductsRequest.swift @@ -1,7 +1,7 @@ protocol SKProductsRequestDelegate : SKRequestDelegate { @available(tvOS 3.0, *) - func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) + @asyncHandler func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) } @available(tvOS 3.0, *) class SKProductsRequest : SKRequest { diff --git a/tvOS/StoreKit/SKRequest.swift b/tvOS/StoreKit/SKRequest.swift index c5efc1f..b4c54d0 100644 --- a/tvOS/StoreKit/SKRequest.swift +++ b/tvOS/StoreKit/SKRequest.swift @@ -10,7 +10,7 @@ class SKRequest : NSObject { } protocol SKRequestDelegate : NSObjectProtocol { @available(tvOS 3.0, *) - optional func requestDidFinish(_ request: SKRequest) + @asyncHandler optional func requestDidFinish(_ request: SKRequest) @available(tvOS 3.0, *) - optional func request(_ request: SKRequest, didFailWithError error: Error) + @asyncHandler optional func request(_ request: SKRequest, didFailWithError error: Error) } diff --git a/tvOS/TVMLKit/TVApplicationController.swift b/tvOS/TVMLKit/TVApplicationController.swift index 6e61d1c..2650eb1 100644 --- a/tvOS/TVMLKit/TVApplicationController.swift +++ b/tvOS/TVMLKit/TVApplicationController.swift @@ -11,11 +11,11 @@ protocol TVApplicationControllerDelegate : NSObjectProtocol { @available(tvOS 9.0, *) optional func appController(_ appController: TVApplicationController, evaluateAppJavaScriptIn jsContext: JSContext) @available(tvOS 9.0, *) - optional func appController(_ appController: TVApplicationController, didFinishLaunching options: [String : Any]?) + @asyncHandler optional func appController(_ appController: TVApplicationController, didFinishLaunching options: [String : Any]?) @available(tvOS 9.0, *) - optional func appController(_ appController: TVApplicationController, didFail error: Error) + @asyncHandler optional func appController(_ appController: TVApplicationController, didFail error: Error) @available(tvOS 9.0, *) - optional func appController(_ appController: TVApplicationController, didStop options: [String : Any]?) + @asyncHandler optional func appController(_ appController: TVApplicationController, didStop options: [String : Any]?) @available(tvOS 12.0, *) optional func player(for appController: TVApplicationController) -> TVPlayer? } @@ -27,5 +27,6 @@ class TVApplicationController : NSObject { weak var delegate: @sil_weak TVApplicationControllerDelegate? { get } var navigationController: UINavigationController { get } func evaluate(inJavaScriptContext evaluation: @escaping (JSContext) -> Void, completion: ((Bool) -> Void)? = nil) + func evaluate(inJavaScriptContext evaluation: @escaping (JSContext) -> Void) async -> Bool func stop() } diff --git a/tvOS/TVMLKit/TVBrowserViewController.swift b/tvOS/TVMLKit/TVBrowserViewController.swift index 09f5650..f4daf08 100644 --- a/tvOS/TVMLKit/TVBrowserViewController.swift +++ b/tvOS/TVMLKit/TVBrowserViewController.swift @@ -9,7 +9,7 @@ protocol TVBrowserViewControllerDataSource : NSObjectProtocol { @available(tvOS 13.0, *) protocol TVBrowserViewControllerDelegate : NSObjectProtocol { optional func browserViewController(_ browserViewController: TVBrowserViewController, willCenterOn viewElement: TVViewElement) - optional func browserViewController(_ browserViewController: TVBrowserViewController, didCenterOn viewElement: TVViewElement) + @asyncHandler optional func browserViewController(_ browserViewController: TVBrowserViewController, didCenterOn viewElement: TVViewElement) } @available(tvOS 13.0, *) class TVBrowserViewController : UIViewController { diff --git a/tvOS/TVMLKit/TVDocumentViewController.swift b/tvOS/TVMLKit/TVDocumentViewController.swift index 30b3925..bfcd3b3 100644 --- a/tvOS/TVMLKit/TVDocumentViewController.swift +++ b/tvOS/TVMLKit/TVDocumentViewController.swift @@ -39,9 +39,9 @@ extension TVDocumentViewController.Event { @available(tvOS 13.0, *) protocol TVDocumentViewControllerDelegate : NSObjectProtocol { optional func documentViewControllerWillUpdate(_ documentViewController: TVDocumentViewController) - optional func documentViewControllerDidUpdate(_ documentViewController: TVDocumentViewController) - optional func documentViewController(_ documentViewController: TVDocumentViewController, didUpdateWithContext context: [String : Any]) - optional func documentViewController(_ documentViewController: TVDocumentViewController, didFailUpdateWithError error: Error) + @asyncHandler optional func documentViewControllerDidUpdate(_ documentViewController: TVDocumentViewController) + @asyncHandler optional func documentViewController(_ documentViewController: TVDocumentViewController, didUpdateWithContext context: [String : Any]) + @asyncHandler optional func documentViewController(_ documentViewController: TVDocumentViewController, didFailUpdateWithError error: Error) optional func documentViewController(_ documentViewController: TVDocumentViewController, handleEvent event: TVDocumentViewController.Event, with element: TVViewElement) -> Bool } @available(tvOS 13.0, *) diff --git a/tvOS/TVMLKit/TVPlayback.swift b/tvOS/TVMLKit/TVPlayback.swift index a8ef416..04a938e 100644 --- a/tvOS/TVMLKit/TVPlayback.swift +++ b/tvOS/TVMLKit/TVPlayback.swift @@ -134,6 +134,7 @@ class TVPlayer : NSObject { var nextMediaItem: TVMediaItem? { get } var previousMediaItem: TVMediaItem? { get } func dispatch(event: TVPlaybackEvent, userInfo: TVPlaybackEventMarshaling?, completion: ((Bool) -> Void)? = nil) + func dispatch(event: TVPlaybackEvent, userInfo: TVPlaybackEventMarshaling?) async -> Bool func pause() func next() func previous() diff --git a/tvOS/TVMLKit/TVViewElement.swift b/tvOS/TVMLKit/TVViewElement.swift index 18425ee..3b07e2e 100644 --- a/tvOS/TVMLKit/TVViewElement.swift +++ b/tvOS/TVMLKit/TVViewElement.swift @@ -43,5 +43,7 @@ class TVViewElement : NSObject, NSCopying { @available(tvOS 9.0, *) func resetProperty(_ resettableProperty: TVElementResettableProperty) func dispatchEvent(type: TVElementEventType, canBubble: Bool, cancellable isCancellable: Bool, extraInfo: [String : Any]?, completion: ((Bool, Bool) -> Void)? = nil) + func dispatchEvent(type: TVElementEventType, canBubble: Bool, cancellable isCancellable: Bool, extraInfo: [String : Any]?) async -> (Bool, Bool) func dispatchEvent(name eventName: String, canBubble: Bool, cancellable isCancellable: Bool, extraInfo: [String : Any]?, completion: ((Bool, Bool) -> Void)? = nil) + func dispatchEvent(name eventName: String, canBubble: Bool, cancellable isCancellable: Bool, extraInfo: [String : Any]?) async -> (Bool, Bool) } diff --git a/tvOS/TVServices/TVTopShelfContentProvider.swift b/tvOS/TVServices/TVTopShelfContentProvider.swift index 0509d92..d04c3b6 100644 --- a/tvOS/TVServices/TVTopShelfContentProvider.swift +++ b/tvOS/TVServices/TVTopShelfContentProvider.swift @@ -2,5 +2,6 @@ @available(tvOS 13.0, *) class TVTopShelfContentProvider : NSObject { func loadTopShelfContent(completionHandler: @escaping (TVTopShelfContent?) -> Void) + func loadTopShelfContent() async -> TVTopShelfContent? class func topShelfContentDidChange() } diff --git a/tvOS/TVServices/TVUserManager.swift b/tvOS/TVServices/TVUserManager.swift index 73bc4d0..1c01a83 100644 --- a/tvOS/TVServices/TVUserManager.swift +++ b/tvOS/TVServices/TVUserManager.swift @@ -5,7 +5,9 @@ class TVUserManager : NSObject { var currentUserIdentifier: TVUserIdentifier? { get } var userIdentifiersForCurrentProfile: [TVUserIdentifier] func presentProfilePreferencePanel(currentSettings: [TVUserIdentifier : TVAppProfileDescriptor], availableProfiles: [TVAppProfileDescriptor], completion: @escaping ([TVUserIdentifier : TVAppProfileDescriptor]) -> Void) + func presentProfilePreferencePanel(currentSettings: [TVUserIdentifier : TVAppProfileDescriptor], availableProfiles: [TVAppProfileDescriptor]) async -> [TVUserIdentifier : TVAppProfileDescriptor] func shouldStorePreferenceForCurrentUser(to profile: TVAppProfileDescriptor, completion: @escaping (Bool) -> Void) + func shouldStorePreferenceForCurrentUser(to profile: TVAppProfileDescriptor) async -> Bool } extension TVUserManager { class let currentUserIdentifierDidChangeNotification: NSNotification.Name diff --git a/tvOS/TVUIKit/TVCollectionViewFullScreenLayout.swift b/tvOS/TVUIKit/TVCollectionViewFullScreenLayout.swift index b357bf6..163213b 100644 --- a/tvOS/TVUIKit/TVCollectionViewFullScreenLayout.swift +++ b/tvOS/TVUIKit/TVCollectionViewFullScreenLayout.swift @@ -10,7 +10,7 @@ class TVCollectionViewFullScreenLayoutAttributes : UICollectionViewLayoutAttribu @available(tvOS 13.0, *) protocol TVCollectionViewDelegateFullScreenLayout : UICollectionViewDelegate { optional func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, willCenterCellAt indexPath: IndexPath) - optional func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, didCenterCellAt indexPath: IndexPath) + @asyncHandler optional func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, didCenterCellAt indexPath: IndexPath) } @available(tvOS 13.0, *) class TVCollectionViewFullScreenLayout : UICollectionViewLayout { diff --git a/tvOS/UIKit/NSLayoutManager.swift b/tvOS/UIKit/NSLayoutManager.swift index dfe47dc..41557f7 100644 --- a/tvOS/UIKit/NSLayoutManager.swift +++ b/tvOS/UIKit/NSLayoutManager.swift @@ -157,11 +157,11 @@ protocol NSLayoutManagerDelegate : NSObjectProtocol { @available(tvOS 9.0, *) optional func layoutManager(_ layoutManager: NSLayoutManager, shouldSetLineFragmentRect lineFragmentRect: UnsafeMutablePointer, lineFragmentUsedRect: UnsafeMutablePointer, baselineOffset: UnsafeMutablePointer, in textContainer: NSTextContainer, forGlyphRange glyphRange: NSRange) -> Bool @available(tvOS 7.0, *) - optional func layoutManagerDidInvalidateLayout(_ sender: NSLayoutManager) + @asyncHandler optional func layoutManagerDidInvalidateLayout(_ sender: NSLayoutManager) @available(tvOS 7.0, *) - optional func layoutManager(_ layoutManager: NSLayoutManager, didCompleteLayoutFor textContainer: NSTextContainer?, atEnd layoutFinishedFlag: Bool) + @asyncHandler optional func layoutManager(_ layoutManager: NSLayoutManager, didCompleteLayoutFor textContainer: NSTextContainer?, atEnd layoutFinishedFlag: Bool) @available(tvOS 7.0, *) - optional func layoutManager(_ layoutManager: NSLayoutManager, textContainer: NSTextContainer, didChangeGeometryFrom oldSize: CGSize) + @asyncHandler optional func layoutManager(_ layoutManager: NSLayoutManager, textContainer: NSTextContainer, didChangeGeometryFrom oldSize: CGSize) } @available(tvOS, introduced: 7.0, deprecated: 9.0, message: "Use NSControlCharacterActionZeroAdvancement instead") var NSControlCharacterZeroAdvancementAction: Int { get } diff --git a/tvOS/UIKit/NSTextStorage.swift b/tvOS/UIKit/NSTextStorage.swift index 9553f4b..7f7c96d 100644 --- a/tvOS/UIKit/NSTextStorage.swift +++ b/tvOS/UIKit/NSTextStorage.swift @@ -31,5 +31,5 @@ protocol NSTextStorageDelegate : NSObjectProtocol { @available(tvOS 7.0, *) optional func textStorage(_ textStorage: NSTextStorage, willProcessEditing editedMask: NSTextStorage.EditActions, range editedRange: NSRange, changeInLength delta: Int) @available(tvOS 7.0, *) - optional func textStorage(_ textStorage: NSTextStorage, didProcessEditing editedMask: NSTextStorage.EditActions, range editedRange: NSRange, changeInLength delta: Int) + @asyncHandler optional func textStorage(_ textStorage: NSTextStorage, didProcessEditing editedMask: NSTextStorage.EditActions, range editedRange: NSRange, changeInLength delta: Int) } diff --git a/tvOS/UIKit/UIApplication.swift b/tvOS/UIKit/UIApplication.swift index fe759ef..2a45ad9 100644 --- a/tvOS/UIKit/UIApplication.swift +++ b/tvOS/UIKit/UIApplication.swift @@ -44,6 +44,8 @@ class UIApplication : UIResponder { func canOpenURL(_ url: URL) -> Bool @available(tvOS 10.0, *) func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:], completionHandler completion: ((Bool) -> Void)? = nil) + @available(tvOS 10.0, *) + func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:]) async -> Bool func sendEvent(_ event: UIEvent) @available(tvOS, introduced: 2.0, deprecated: 13.0, message: "Should not be used for applications that support multiple scenes as it returns a key window across all connected scenes") var keyWindow: UIWindow? { get } @@ -111,6 +113,8 @@ extension UIApplication { @available(tvOS 10.2, *) func setAlternateIconName(_ alternateIconName: String?, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 10.2, *) + func setAlternateIconName(_ alternateIconName: String?) async throws + @available(tvOS 10.2, *) var alternateIconName: String? { get } } extension UIApplication { @@ -179,47 +183,53 @@ extension UIApplication { } protocol UIApplicationDelegate : NSObjectProtocol { @available(tvOS 2.0, *) - optional func applicationDidFinishLaunching(_ application: UIApplication) + @asyncHandler optional func applicationDidFinishLaunching(_ application: UIApplication) @available(tvOS 6.0, *) optional func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool @available(tvOS 3.0, *) optional func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool @available(tvOS 2.0, *) - optional func applicationDidBecomeActive(_ application: UIApplication) + @asyncHandler optional func applicationDidBecomeActive(_ application: UIApplication) @available(tvOS 2.0, *) optional func applicationWillResignActive(_ application: UIApplication) @available(tvOS 9.0, *) optional func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool @available(tvOS 2.0, *) - optional func applicationDidReceiveMemoryWarning(_ application: UIApplication) + @asyncHandler optional func applicationDidReceiveMemoryWarning(_ application: UIApplication) @available(tvOS 2.0, *) optional func applicationWillTerminate(_ application: UIApplication) @available(tvOS 2.0, *) optional func applicationSignificantTimeChange(_ application: UIApplication) @available(tvOS 3.0, *) - optional func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) + @asyncHandler optional func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) @available(tvOS 3.0, *) - optional func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) + @asyncHandler optional func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) @available(tvOS, introduced: 3.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate willPresentNotification:withCompletionHandler:] or -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:] for user visible notifications and -[UIApplicationDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:] for silent remote notifications") - optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) + @asyncHandler optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) + @available(tvOS 7.0, *) + @asyncHandler optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) @available(tvOS 7.0, *) - optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) + optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) async -> UIBackgroundFetchResult @available(tvOS, introduced: 11.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead") optional func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) + @available(tvOS, introduced: 11.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead") + optional func application(_ application: UIApplication) async -> UIBackgroundFetchResult @available(tvOS 7.0, *) optional func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) + @available(tvOS 7.0, *) + optional func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String) async @available(tvOS 8.2, *) optional func application(_ application: UIApplication, handleWatchKitExtensionRequest userInfo: [AnyHashable : Any]?, reply: @escaping ([AnyHashable : Any]?) -> Void) @available(tvOS 9.0, *) optional func applicationShouldRequestHealthAuthorization(_ application: UIApplication) @available(tvOS 4.0, *) - optional func applicationDidEnterBackground(_ application: UIApplication) + @asyncHandler optional func applicationDidEnterBackground(_ application: UIApplication) @available(tvOS 4.0, *) optional func applicationWillEnterForeground(_ application: UIApplication) @available(tvOS 4.0, *) optional func applicationProtectedDataWillBecomeUnavailable(_ application: UIApplication) @available(tvOS 4.0, *) - optional func applicationProtectedDataDidBecomeAvailable(_ application: UIApplication) + @asyncHandler optional func applicationProtectedDataDidBecomeAvailable(_ application: UIApplication) @available(tvOS 5.0, *) optional var window: UIWindow? { get set } @available(tvOS 8.0, *) @@ -233,7 +243,7 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(tvOS 6.0, *) optional func application(_ application: UIApplication, willEncodeRestorableStateWith coder: NSCoder) @available(tvOS 6.0, *) - optional func application(_ application: UIApplication, didDecodeRestorableStateWith coder: NSCoder) + @asyncHandler optional func application(_ application: UIApplication, didDecodeRestorableStateWith coder: NSCoder) @available(tvOS, introduced: 6.0, deprecated: 13.2, message: "Use application:shouldSaveSecureApplicationState: instead") optional func application(_ application: UIApplication, shouldSaveApplicationState coder: NSCoder) -> Bool @available(tvOS, introduced: 6.0, deprecated: 13.2, message: "Use application:shouldRestoreSecureApplicationState: instead") @@ -243,13 +253,13 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(tvOS 8.0, *) optional func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool @available(tvOS 8.0, *) - optional func application(_ application: UIApplication, didFailToContinueUserActivityWithType userActivityType: String, error: Error) + @asyncHandler optional func application(_ application: UIApplication, didFailToContinueUserActivityWithType userActivityType: String, error: Error) @available(tvOS 8.0, *) - optional func application(_ application: UIApplication, didUpdate userActivity: NSUserActivity) + @asyncHandler optional func application(_ application: UIApplication, didUpdate userActivity: NSUserActivity) @available(tvOS 13.0, *) optional func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration @available(tvOS 13.0, *) - optional func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) + @asyncHandler optional func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) } extension UIApplicationDelegate { diff --git a/tvOS/UIKit/UICollectionView.swift b/tvOS/UIKit/UICollectionView.swift index 928ba13..4180f7a 100644 --- a/tvOS/UIKit/UICollectionView.swift +++ b/tvOS/UIKit/UICollectionView.swift @@ -45,25 +45,25 @@ protocol UICollectionViewDelegate : UIScrollViewDelegate { @available(tvOS 6.0, *) optional func collectionView(_ collectionView: UICollectionView, shouldHighlightItemAt indexPath: IndexPath) -> Bool @available(tvOS 6.0, *) - optional func collectionView(_ collectionView: UICollectionView, didHighlightItemAt indexPath: IndexPath) + @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didHighlightItemAt indexPath: IndexPath) @available(tvOS 6.0, *) - optional func collectionView(_ collectionView: UICollectionView, didUnhighlightItemAt indexPath: IndexPath) + @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didUnhighlightItemAt indexPath: IndexPath) @available(tvOS 6.0, *) optional func collectionView(_ collectionView: UICollectionView, shouldSelectItemAt indexPath: IndexPath) -> Bool @available(tvOS 6.0, *) optional func collectionView(_ collectionView: UICollectionView, shouldDeselectItemAt indexPath: IndexPath) -> Bool @available(tvOS 6.0, *) - optional func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) + @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) @available(tvOS 6.0, *) - optional func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) + @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) @available(tvOS 8.0, *) optional func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) @available(tvOS 8.0, *) optional func collectionView(_ collectionView: UICollectionView, willDisplaySupplementaryView view: UICollectionReusableView, forElementKind elementKind: String, at indexPath: IndexPath) @available(tvOS 6.0, *) - optional func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) + @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) @available(tvOS 6.0, *) - optional func collectionView(_ collectionView: UICollectionView, didEndDisplayingSupplementaryView view: UICollectionReusableView, forElementOfKind elementKind: String, at indexPath: IndexPath) + @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didEndDisplayingSupplementaryView view: UICollectionReusableView, forElementOfKind elementKind: String, at indexPath: IndexPath) @available(tvOS, introduced: 6.0, deprecated: 13.0) optional func collectionView(_ collectionView: UICollectionView, shouldShowMenuForItemAt indexPath: IndexPath) -> Bool @available(tvOS, introduced: 6.0, deprecated: 13.0) @@ -77,7 +77,7 @@ protocol UICollectionViewDelegate : UIScrollViewDelegate { @available(tvOS 9.0, *) optional func collectionView(_ collectionView: UICollectionView, shouldUpdateFocusIn context: UICollectionViewFocusUpdateContext) -> Bool @available(tvOS 9.0, *) - optional func collectionView(_ collectionView: UICollectionView, didUpdateFocusIn context: UICollectionViewFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) + @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didUpdateFocusIn context: UICollectionViewFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) @available(tvOS 9.0, *) optional func indexPathForPreferredFocusedView(in collectionView: UICollectionView) -> IndexPath? @available(tvOS 9.0, *) @@ -119,6 +119,8 @@ class UICollectionView : UIScrollView, UIDataSourceTranslating { @available(tvOS 7.0, *) func setCollectionViewLayout(_ layout: UICollectionViewLayout, animated: Bool, completion: ((Bool) -> Void)? = nil) @available(tvOS 7.0, *) + func setCollectionViewLayout(_ layout: UICollectionViewLayout, animated: Bool) async -> Bool + @available(tvOS 7.0, *) func startInteractiveTransition(to layout: UICollectionViewLayout, completion: UICollectionView.LayoutInteractiveTransitionCompletion? = nil) -> UICollectionViewTransitionLayout @available(tvOS 7.0, *) func finishInteractiveTransition() @@ -149,6 +151,7 @@ class UICollectionView : UIScrollView, UIDataSourceTranslating { func reloadItems(at indexPaths: [IndexPath]) func moveItem(at indexPath: IndexPath, to newIndexPath: IndexPath) func performBatchUpdates(_ updates: (() -> Void)?, completion: ((Bool) -> Void)? = nil) + func performBatchUpdates(_ updates: (() -> Void)?) async -> Bool @available(tvOS 9.0, *) func beginInteractiveMovementForItem(at indexPath: IndexPath) -> Bool @available(tvOS 9.0, *) diff --git a/tvOS/UIKit/UIDiffableDataSource.swift b/tvOS/UIKit/UIDiffableDataSource.swift index 1131b06..3a7457e 100644 --- a/tvOS/UIKit/UIDiffableDataSource.swift +++ b/tvOS/UIKit/UIDiffableDataSource.swift @@ -64,6 +64,7 @@ class UICollectionViewDiffableDataSourceReference : NSObject, UICollectionViewDa func snapshot() -> NSDiffableDataSourceSnapshotReference func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool, completion: (() -> Void)? = nil) + func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async func itemIdentifier(for indexPath: IndexPath) -> Any? func indexPath(forItemIdentifier identifier: Any) -> IndexPath? @available(tvOS 14.0, *) @@ -73,6 +74,8 @@ class UICollectionViewDiffableDataSourceReference : NSObject, UICollectionViewDa @available(tvOS 14.0, *) func applySnapshot(_ snapshot: NSDiffableDataSourceSectionSnapshotReference, toSection sectionIdentifier: Any, animatingDifferences: Bool, completion: (() -> Void)? = nil) @available(tvOS 14.0, *) + func applySnapshot(_ snapshot: NSDiffableDataSourceSectionSnapshotReference, toSection sectionIdentifier: Any, animatingDifferences: Bool) async + @available(tvOS 14.0, *) func snapshot(forSection section: Any) -> NSDiffableDataSourceSectionSnapshotReference @available(tvOS 14.0, *) @NSCopying var sectionSnapshotHandlers: __UICollectionViewDiffableDataSourceSectionSnapshotHandlers @@ -84,6 +87,7 @@ class UITableViewDiffableDataSourceReference : NSObject, UITableViewDataSource { func snapshot() -> NSDiffableDataSourceSnapshotReference func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool, completion: (() -> Void)? = nil) + func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async func itemIdentifier(for indexPath: IndexPath) -> Any? func indexPath(forItemIdentifier identifier: Any) -> IndexPath? var defaultRowAnimation: UITableView.RowAnimation diff --git a/tvOS/UIKit/UIDynamicAnimator.swift b/tvOS/UIKit/UIDynamicAnimator.swift index 6566d74..04f36c8 100644 --- a/tvOS/UIKit/UIDynamicAnimator.swift +++ b/tvOS/UIKit/UIDynamicAnimator.swift @@ -3,7 +3,7 @@ protocol UIDynamicAnimatorDelegate : NSObjectProtocol { @available(tvOS 7.0, *) optional func dynamicAnimatorWillResume(_ animator: UIDynamicAnimator) @available(tvOS 7.0, *) - optional func dynamicAnimatorDidPause(_ animator: UIDynamicAnimator) + @asyncHandler optional func dynamicAnimatorDidPause(_ animator: UIDynamicAnimator) } @available(tvOS 7.0, *) class UIDynamicAnimator : NSObject { diff --git a/tvOS/UIKit/UIFocus.swift b/tvOS/UIKit/UIFocus.swift index c9db678..272a2de 100644 --- a/tvOS/UIKit/UIFocus.swift +++ b/tvOS/UIKit/UIFocus.swift @@ -26,7 +26,7 @@ protocol UIFocusEnvironment : NSObjectProtocol { func setNeedsFocusUpdate() func updateFocusIfNeeded() func shouldUpdateFocus(in context: UIFocusUpdateContext) -> Bool - func didUpdateFocus(in context: UIFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) + @asyncHandler func didUpdateFocus(in context: UIFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) @available(tvOS 11.0, *) optional func soundIdentifierForFocusUpdate(in context: UIFocusUpdateContext) -> UIFocusSoundIdentifier? @available(tvOS, introduced: 9.0, deprecated: 10.0) @@ -44,7 +44,7 @@ protocol UIFocusItem : UIFocusEnvironment { @available(tvOS 12.0, *) var frame: CGRect { get } @available(tvOS 12.0, *) - optional func didHintFocusMovement(_ hint: UIFocusMovementHint) + @asyncHandler optional func didHintFocusMovement(_ hint: UIFocusMovementHint) } @available(iOS 11.0, tvOS 11.0, *) diff --git a/tvOS/UIKit/UIFocusAnimationCoordinator.swift b/tvOS/UIKit/UIFocusAnimationCoordinator.swift index 3d2b16e..fe0b370 100644 --- a/tvOS/UIKit/UIFocusAnimationCoordinator.swift +++ b/tvOS/UIKit/UIFocusAnimationCoordinator.swift @@ -6,8 +6,13 @@ protocol UIFocusAnimationContext : NSObjectProtocol { @available(tvOS 9.0, *) class UIFocusAnimationCoordinator : NSObject { func addCoordinatedAnimations(_ animations: (() -> Void)?, completion: (() -> Void)? = nil) + func addCoordinatedAnimations(_ animations: (() -> Void)?) async @available(tvOS 11.0, *) func addCoordinatedFocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?, completion: (() -> Void)? = nil) @available(tvOS 11.0, *) + func addCoordinatedFocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?) async + @available(tvOS 11.0, *) func addCoordinatedUnfocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?, completion: (() -> Void)? = nil) + @available(tvOS 11.0, *) + func addCoordinatedUnfocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?) async } diff --git a/tvOS/UIKit/UIGuidedAccess.swift b/tvOS/UIKit/UIGuidedAccess.swift index 6738a08..d37ae5d 100644 --- a/tvOS/UIKit/UIGuidedAccess.swift +++ b/tvOS/UIKit/UIGuidedAccess.swift @@ -14,7 +14,7 @@ extension UIAccessibility { @available(tvOS 7.0, *) protocol UIGuidedAccessRestrictionDelegate : NSObjectProtocol { var guidedAccessRestrictionIdentifiers: [String]? { get } - func guidedAccessRestriction(withIdentifier restrictionIdentifier: String, didChange newRestrictionState: UIAccessibility.GuidedAccessRestrictionState) + @asyncHandler func guidedAccessRestriction(withIdentifier restrictionIdentifier: String, didChange newRestrictionState: UIAccessibility.GuidedAccessRestrictionState) func textForGuidedAccessRestriction(withIdentifier restrictionIdentifier: String) -> String? optional func detailTextForGuidedAccessRestriction(withIdentifier restrictionIdentifier: String) -> String? } diff --git a/tvOS/UIKit/UIInputViewController.swift b/tvOS/UIKit/UIInputViewController.swift index 23f4827..06b8e99 100644 --- a/tvOS/UIKit/UIInputViewController.swift +++ b/tvOS/UIKit/UIInputViewController.swift @@ -28,4 +28,5 @@ class UIInputViewController : UIViewController, UITextInputDelegate { @available(tvOS 10.0, *) func handleInputModeList(from view: UIView, with event: UIEvent) func requestSupplementaryLexicon(completion completionHandler: @escaping (UILexicon) -> Void) + func requestSupplementaryLexicon() async -> UILexicon } diff --git a/tvOS/UIKit/UIInteraction.swift b/tvOS/UIKit/UIInteraction.swift index e366cd0..3dd0aff 100644 --- a/tvOS/UIKit/UIInteraction.swift +++ b/tvOS/UIKit/UIInteraction.swift @@ -3,7 +3,7 @@ protocol UIInteraction : NSObjectProtocol { weak var view: @sil_weak UIView? { get } func willMove(to view: UIView?) - func didMove(to view: UIView?) + @asyncHandler func didMove(to view: UIView?) } extension UIView { @available(tvOS 13.0, *) diff --git a/tvOS/UIKit/UINavigationBar.swift b/tvOS/UIKit/UINavigationBar.swift index acde45b..bb55421 100644 --- a/tvOS/UIKit/UINavigationBar.swift +++ b/tvOS/UIKit/UINavigationBar.swift @@ -39,9 +39,9 @@ protocol UINavigationBarDelegate : UIBarPositioningDelegate { @available(tvOS 2.0, *) optional func navigationBar(_ navigationBar: UINavigationBar, shouldPush item: UINavigationItem) -> Bool @available(tvOS 2.0, *) - optional func navigationBar(_ navigationBar: UINavigationBar, didPush item: UINavigationItem) + @asyncHandler optional func navigationBar(_ navigationBar: UINavigationBar, didPush item: UINavigationItem) @available(tvOS 2.0, *) optional func navigationBar(_ navigationBar: UINavigationBar, shouldPop item: UINavigationItem) -> Bool @available(tvOS 2.0, *) - optional func navigationBar(_ navigationBar: UINavigationBar, didPop item: UINavigationItem) + @asyncHandler optional func navigationBar(_ navigationBar: UINavigationBar, didPop item: UINavigationItem) } diff --git a/tvOS/UIKit/UINavigationController.swift b/tvOS/UIKit/UINavigationController.swift index f7fc68b..4a45a5b 100644 --- a/tvOS/UIKit/UINavigationController.swift +++ b/tvOS/UIKit/UINavigationController.swift @@ -32,7 +32,7 @@ protocol UINavigationControllerDelegate : NSObjectProtocol { @available(tvOS 2.0, *) optional func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) @available(tvOS 2.0, *) - optional func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) + @asyncHandler optional func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) @available(tvOS 7.0, *) optional func navigationController(_ navigationController: UINavigationController, interactionControllerFor animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? @available(tvOS 7.0, *) diff --git a/tvOS/UIKit/UIPageViewController.swift b/tvOS/UIKit/UIPageViewController.swift index c349f6c..2e89ed5 100644 --- a/tvOS/UIKit/UIPageViewController.swift +++ b/tvOS/UIKit/UIPageViewController.swift @@ -49,12 +49,13 @@ class UIPageViewController : UIViewController { var gestureRecognizers: [UIGestureRecognizer] { get } var viewControllers: [UIViewController]? { get } func setViewControllers(_ viewControllers: [UIViewController]?, direction: UIPageViewController.NavigationDirection, animated: Bool, completion: ((Bool) -> Void)? = nil) + func setViewControllers(_ viewControllers: [UIViewController]?, direction: UIPageViewController.NavigationDirection, animated: Bool) async -> Bool } protocol UIPageViewControllerDelegate : NSObjectProtocol { @available(tvOS 6.0, *) optional func pageViewController(_ pageViewController: UIPageViewController, willTransitionTo pendingViewControllers: [UIViewController]) @available(tvOS 5.0, *) - optional func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) + @asyncHandler optional func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) } protocol UIPageViewControllerDataSource : NSObjectProtocol { @available(tvOS 5.0, *) diff --git a/tvOS/UIKit/UIPopoverController.swift b/tvOS/UIKit/UIPopoverController.swift index 1d4611c..c5e5dce 100644 --- a/tvOS/UIKit/UIPopoverController.swift +++ b/tvOS/UIKit/UIPopoverController.swift @@ -24,7 +24,7 @@ protocol UIPopoverControllerDelegate : NSObjectProtocol { @available(tvOS, introduced: 3.2, deprecated: 9.0) optional func popoverControllerShouldDismissPopover(_ popoverController: UIPopoverController) -> Bool @available(tvOS, introduced: 3.2, deprecated: 9.0) - optional func popoverControllerDidDismissPopover(_ popoverController: UIPopoverController) + @asyncHandler optional func popoverControllerDidDismissPopover(_ popoverController: UIPopoverController) @available(tvOS, introduced: 7.0, deprecated: 9.0) optional func popoverController(_ popoverController: UIPopoverController, willRepositionPopoverTo rect: UnsafeMutablePointer, in view: AutoreleasingUnsafeMutablePointer) } diff --git a/tvOS/UIKit/UIPresentationController.swift b/tvOS/UIKit/UIPresentationController.swift index ef049f4..eba4ed8 100644 --- a/tvOS/UIKit/UIPresentationController.swift +++ b/tvOS/UIKit/UIPresentationController.swift @@ -13,9 +13,9 @@ protocol UIAdaptivePresentationControllerDelegate : NSObjectProtocol { @available(tvOS 13.0, *) optional func presentationControllerWillDismiss(_ presentationController: UIPresentationController) @available(tvOS 13.0, *) - optional func presentationControllerDidDismiss(_ presentationController: UIPresentationController) + @asyncHandler optional func presentationControllerDidDismiss(_ presentationController: UIPresentationController) @available(tvOS 13.0, *) - optional func presentationControllerDidAttemptToDismiss(_ presentationController: UIPresentationController) + @asyncHandler optional func presentationControllerDidAttemptToDismiss(_ presentationController: UIPresentationController) } @available(tvOS 8.0, *) class UIPresentationController : NSObject, UIAppearanceContainer, UITraitEnvironment, UIContentContainer, UIFocusEnvironment { diff --git a/tvOS/UIKit/UIScene.swift b/tvOS/UIKit/UIScene.swift index e7e4b94..111a703 100644 --- a/tvOS/UIKit/UIScene.swift +++ b/tvOS/UIKit/UIScene.swift @@ -6,23 +6,24 @@ class UIScene : UIResponder { var delegate: UISceneDelegate? var activationState: UIScene.ActivationState { get } func open(_ url: URL, options: UIScene.OpenExternalURLOptions?, completionHandler completion: ((Bool) -> Void)? = nil) + func open(_ url: URL, options: UIScene.OpenExternalURLOptions?) async -> Bool var title: String! var activationConditions: UISceneActivationConditions } @available(tvOS 13.0, *) protocol UISceneDelegate : NSObjectProtocol { optional func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) - optional func sceneDidDisconnect(_ scene: UIScene) - optional func sceneDidBecomeActive(_ scene: UIScene) + @asyncHandler optional func sceneDidDisconnect(_ scene: UIScene) + @asyncHandler optional func sceneDidBecomeActive(_ scene: UIScene) optional func sceneWillResignActive(_ scene: UIScene) optional func sceneWillEnterForeground(_ scene: UIScene) - optional func sceneDidEnterBackground(_ scene: UIScene) + @asyncHandler optional func sceneDidEnterBackground(_ scene: UIScene) optional func scene(_ scene: UIScene, openURLContexts URLContexts: Set) optional func stateRestorationActivity(for scene: UIScene) -> NSUserActivity? optional func scene(_ scene: UIScene, willContinueUserActivityWithType userActivityType: String) optional func scene(_ scene: UIScene, continue userActivity: NSUserActivity) - optional func scene(_ scene: UIScene, didFailToContinueUserActivityWithType userActivityType: String, error: Error) - optional func scene(_ scene: UIScene, didUpdate userActivity: NSUserActivity) + @asyncHandler optional func scene(_ scene: UIScene, didFailToContinueUserActivityWithType userActivityType: String, error: Error) + @asyncHandler optional func scene(_ scene: UIScene, didUpdate userActivity: NSUserActivity) } extension UIScene { @available(tvOS 13.0, *) diff --git a/tvOS/UIKit/UIScreenshotService.swift b/tvOS/UIKit/UIScreenshotService.swift index 63a54c0..499b086 100644 --- a/tvOS/UIKit/UIScreenshotService.swift +++ b/tvOS/UIKit/UIScreenshotService.swift @@ -11,4 +11,6 @@ extension UIWindowScene { protocol UIScreenshotServiceDelegate : NSObjectProtocol { @available(tvOS 13.0, *) optional func screenshotService(_ screenshotService: UIScreenshotService, generatePDFRepresentationWithCompletion completionHandler: @escaping (Data?, Int, CGRect) -> Void) + @available(tvOS 13.0, *) + optional func screenshotService(_ screenshotService: UIScreenshotService) async -> (Data?, Int, CGRect) } diff --git a/tvOS/UIKit/UIScrollView.swift b/tvOS/UIKit/UIScrollView.swift index 9a14243..be25fc7 100644 --- a/tvOS/UIKit/UIScrollView.swift +++ b/tvOS/UIKit/UIScrollView.swift @@ -107,31 +107,31 @@ class UIScrollView : UIView, NSCoding, UIFocusItemScrollableContainer { } protocol UIScrollViewDelegate : NSObjectProtocol { @available(tvOS 2.0, *) - optional func scrollViewDidScroll(_ scrollView: UIScrollView) + @asyncHandler optional func scrollViewDidScroll(_ scrollView: UIScrollView) @available(tvOS 3.2, *) - optional func scrollViewDidZoom(_ scrollView: UIScrollView) + @asyncHandler optional func scrollViewDidZoom(_ scrollView: UIScrollView) @available(tvOS 2.0, *) optional func scrollViewWillBeginDragging(_ scrollView: UIScrollView) @available(tvOS 5.0, *) optional func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) @available(tvOS 2.0, *) - optional func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) + @asyncHandler optional func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) @available(tvOS 2.0, *) optional func scrollViewWillBeginDecelerating(_ scrollView: UIScrollView) @available(tvOS 2.0, *) - optional func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) + @asyncHandler optional func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) @available(tvOS 2.0, *) - optional func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) + @asyncHandler optional func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) @available(tvOS 2.0, *) optional func viewForZooming(in scrollView: UIScrollView) -> UIView? @available(tvOS 3.2, *) optional func scrollViewWillBeginZooming(_ scrollView: UIScrollView, with view: UIView?) @available(tvOS 2.0, *) - optional func scrollViewDidEndZooming(_ scrollView: UIScrollView, with view: UIView?, atScale scale: CGFloat) + @asyncHandler optional func scrollViewDidEndZooming(_ scrollView: UIScrollView, with view: UIView?, atScale scale: CGFloat) @available(tvOS 2.0, *) optional func scrollViewShouldScrollToTop(_ scrollView: UIScrollView) -> Bool @available(tvOS 2.0, *) - optional func scrollViewDidScrollToTop(_ scrollView: UIScrollView) + @asyncHandler optional func scrollViewDidScrollToTop(_ scrollView: UIScrollView) @available(tvOS 11.0, *) - optional func scrollViewDidChangeAdjustedContentInset(_ scrollView: UIScrollView) + @asyncHandler optional func scrollViewDidChangeAdjustedContentInset(_ scrollView: UIScrollView) } diff --git a/tvOS/UIKit/UISearchBar.swift b/tvOS/UIKit/UISearchBar.swift index b34f635..b251d52 100644 --- a/tvOS/UIKit/UISearchBar.swift +++ b/tvOS/UIKit/UISearchBar.swift @@ -75,11 +75,11 @@ protocol UISearchBarDelegate : UIBarPositioningDelegate { @available(tvOS 2.0, *) optional func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool @available(tvOS 2.0, *) - optional func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) + @asyncHandler optional func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) @available(tvOS 2.0, *) optional func searchBarShouldEndEditing(_ searchBar: UISearchBar) -> Bool @available(tvOS 2.0, *) - optional func searchBarTextDidEndEditing(_ searchBar: UISearchBar) + @asyncHandler optional func searchBarTextDidEndEditing(_ searchBar: UISearchBar) @available(tvOS 2.0, *) optional func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) @available(tvOS 3.0, *) diff --git a/tvOS/UIKit/UISearchController.swift b/tvOS/UIKit/UISearchController.swift index 8fe2890..fc3d8e7 100644 --- a/tvOS/UIKit/UISearchController.swift +++ b/tvOS/UIKit/UISearchController.swift @@ -3,11 +3,11 @@ protocol UISearchControllerDelegate : NSObjectProtocol { @available(tvOS 8.0, *) optional func willPresentSearchController(_ searchController: UISearchController) @available(tvOS 8.0, *) - optional func didPresentSearchController(_ searchController: UISearchController) + @asyncHandler optional func didPresentSearchController(_ searchController: UISearchController) @available(tvOS 8.0, *) optional func willDismissSearchController(_ searchController: UISearchController) @available(tvOS 8.0, *) - optional func didDismissSearchController(_ searchController: UISearchController) + @asyncHandler optional func didDismissSearchController(_ searchController: UISearchController) @available(tvOS 8.0, *) optional func presentSearchController(_ searchController: UISearchController) } diff --git a/tvOS/UIKit/UISplitViewController.swift b/tvOS/UIKit/UISplitViewController.swift index 203a4a6..d734eb0 100644 --- a/tvOS/UIKit/UISplitViewController.swift +++ b/tvOS/UIKit/UISplitViewController.swift @@ -134,9 +134,9 @@ protocol UISplitViewControllerDelegate { @available(tvOS 14.0, *) optional func splitViewController(_ svc: UISplitViewController, displayModeForExpandingToProposedDisplayMode proposedDisplayMode: UISplitViewController.DisplayMode) -> UISplitViewController.DisplayMode @available(tvOS 14.0, *) - optional func splitViewControllerDidCollapse(_ svc: UISplitViewController) + @asyncHandler optional func splitViewControllerDidCollapse(_ svc: UISplitViewController) @available(tvOS 14.0, *) - optional func splitViewControllerDidExpand(_ svc: UISplitViewController) + @asyncHandler optional func splitViewControllerDidExpand(_ svc: UISplitViewController) @available(tvOS 14.0, *) optional func splitViewController(_ svc: UISplitViewController, willShow column: UISplitViewController.Column) @available(tvOS 14.0, *) @@ -144,7 +144,7 @@ protocol UISplitViewControllerDelegate { @available(tvOS 14.0, *) optional func splitViewControllerInteractivePresentationGestureWillBegin(_ svc: UISplitViewController) @available(tvOS 14.0, *) - optional func splitViewControllerInteractivePresentationGestureDidEnd(_ svc: UISplitViewController) + @asyncHandler optional func splitViewControllerInteractivePresentationGestureDidEnd(_ svc: UISplitViewController) } extension UIViewController { var splitViewController: UISplitViewController? { get } diff --git a/tvOS/UIKit/UITabBar.swift b/tvOS/UIKit/UITabBar.swift index 68d1715..82c1c6e 100644 --- a/tvOS/UIKit/UITabBar.swift +++ b/tvOS/UIKit/UITabBar.swift @@ -40,5 +40,5 @@ class UITabBar : UIView { } protocol UITabBarDelegate : NSObjectProtocol { @available(tvOS 2.0, *) - optional func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) + @asyncHandler optional func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) } diff --git a/tvOS/UIKit/UITabBarController.swift b/tvOS/UIKit/UITabBarController.swift index 9feb81b..7b60c0f 100644 --- a/tvOS/UIKit/UITabBarController.swift +++ b/tvOS/UIKit/UITabBarController.swift @@ -13,7 +13,7 @@ protocol UITabBarControllerDelegate : NSObjectProtocol { @available(tvOS 3.0, *) optional func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool @available(tvOS 2.0, *) - optional func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) + @asyncHandler optional func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) @available(tvOS 7.0, *) optional func tabBarController(_ tabBarController: UITabBarController, interactionControllerFor animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? @available(tvOS 7.0, *) diff --git a/tvOS/UIKit/UITableView.swift b/tvOS/UIKit/UITableView.swift index 3958bd1..bf2dcfb 100644 --- a/tvOS/UIKit/UITableView.swift +++ b/tvOS/UIKit/UITableView.swift @@ -52,11 +52,11 @@ protocol UITableViewDelegate : UIScrollViewDelegate { @available(tvOS 6.0, *) optional func tableView(_ tableView: UITableView, willDisplayFooterView view: UIView, forSection section: Int) @available(tvOS 6.0, *) - optional func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) + @asyncHandler optional func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) @available(tvOS 6.0, *) - optional func tableView(_ tableView: UITableView, didEndDisplayingHeaderView view: UIView, forSection section: Int) + @asyncHandler optional func tableView(_ tableView: UITableView, didEndDisplayingHeaderView view: UIView, forSection section: Int) @available(tvOS 6.0, *) - optional func tableView(_ tableView: UITableView, didEndDisplayingFooterView view: UIView, forSection section: Int) + @asyncHandler optional func tableView(_ tableView: UITableView, didEndDisplayingFooterView view: UIView, forSection section: Int) @available(tvOS 2.0, *) optional func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat @available(tvOS 2.0, *) @@ -78,17 +78,17 @@ protocol UITableViewDelegate : UIScrollViewDelegate { @available(tvOS 6.0, *) optional func tableView(_ tableView: UITableView, shouldHighlightRowAt indexPath: IndexPath) -> Bool @available(tvOS 6.0, *) - optional func tableView(_ tableView: UITableView, didHighlightRowAt indexPath: IndexPath) + @asyncHandler optional func tableView(_ tableView: UITableView, didHighlightRowAt indexPath: IndexPath) @available(tvOS 6.0, *) - optional func tableView(_ tableView: UITableView, didUnhighlightRowAt indexPath: IndexPath) + @asyncHandler optional func tableView(_ tableView: UITableView, didUnhighlightRowAt indexPath: IndexPath) @available(tvOS 2.0, *) optional func tableView(_ tableView: UITableView, willSelectRowAt indexPath: IndexPath) -> IndexPath? @available(tvOS 3.0, *) optional func tableView(_ tableView: UITableView, willDeselectRowAt indexPath: IndexPath) -> IndexPath? @available(tvOS 2.0, *) - optional func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) + @asyncHandler optional func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) @available(tvOS 3.0, *) - optional func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) + @asyncHandler optional func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) @available(tvOS 2.0, *) optional func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCell.EditingStyle @available(tvOS 2.0, *) @@ -108,7 +108,7 @@ protocol UITableViewDelegate : UIScrollViewDelegate { @available(tvOS 9.0, *) optional func tableView(_ tableView: UITableView, shouldUpdateFocusIn context: UITableViewFocusUpdateContext) -> Bool @available(tvOS 9.0, *) - optional func tableView(_ tableView: UITableView, didUpdateFocusIn context: UITableViewFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) + @asyncHandler optional func tableView(_ tableView: UITableView, didUpdateFocusIn context: UITableViewFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) @available(tvOS 9.0, *) optional func indexPathForPreferredFocusedView(in tableView: UITableView) -> IndexPath? } @@ -154,6 +154,8 @@ class UITableView : UIScrollView, NSCoding, UIDataSourceTranslating { func scrollToNearestSelectedRow(at scrollPosition: UITableView.ScrollPosition, animated: Bool) @available(tvOS 11.0, *) func performBatchUpdates(_ updates: (() -> Void)?, completion: ((Bool) -> Void)? = nil) + @available(tvOS 11.0, *) + func performBatchUpdates(_ updates: (() -> Void)?) async -> Bool func beginUpdates() func endUpdates() func insertSections(_ sections: IndexSet, with animation: UITableView.RowAnimation) diff --git a/tvOS/UIKit/UITextField.swift b/tvOS/UIKit/UITextField.swift index 0f6eed3..eb9daf8 100644 --- a/tvOS/UIKit/UITextField.swift +++ b/tvOS/UIKit/UITextField.swift @@ -48,17 +48,17 @@ protocol UITextFieldDelegate : NSObjectProtocol { @available(tvOS 2.0, *) optional func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool @available(tvOS 2.0, *) - optional func textFieldDidBeginEditing(_ textField: UITextField) + @asyncHandler optional func textFieldDidBeginEditing(_ textField: UITextField) @available(tvOS 2.0, *) optional func textFieldShouldEndEditing(_ textField: UITextField) -> Bool @available(tvOS 2.0, *) - optional func textFieldDidEndEditing(_ textField: UITextField) + @asyncHandler optional func textFieldDidEndEditing(_ textField: UITextField) @available(tvOS 10.0, *) - optional func textFieldDidEndEditing(_ textField: UITextField, reason: UITextField.DidEndEditingReason) + @asyncHandler optional func textFieldDidEndEditing(_ textField: UITextField, reason: UITextField.DidEndEditingReason) @available(tvOS 2.0, *) optional func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool @available(tvOS 13.0, *) - optional func textFieldDidChangeSelection(_ textField: UITextField) + @asyncHandler optional func textFieldDidChangeSelection(_ textField: UITextField) @available(tvOS 2.0, *) optional func textFieldShouldClear(_ textField: UITextField) -> Bool @available(tvOS 2.0, *) diff --git a/tvOS/UIKit/UITextInput.swift b/tvOS/UIKit/UITextInput.swift index 462ba4c..967aa8e 100644 --- a/tvOS/UIKit/UITextInput.swift +++ b/tvOS/UIKit/UITextInput.swift @@ -114,7 +114,7 @@ protocol UITextInput : UIKeyInput { optional var selectionAffinity: UITextStorageDirection { get set } @available(tvOS 5.1, *) optional func insertDictationResult(_ dictationResult: [UIDictationPhrase]) - optional func dictationRecordingDidEnd() + @asyncHandler optional func dictationRecordingDidEnd() optional func dictationRecognitionFailed() optional var insertDictationResultPlaceholder: Any { get } optional func frame(forDictationResultPlaceholder placeholder: Any) -> CGRect @@ -152,9 +152,9 @@ class UITextSelectionRect : NSObject { } protocol UITextInputDelegate : NSObjectProtocol { func selectionWillChange(_ textInput: UITextInput?) - func selectionDidChange(_ textInput: UITextInput?) + @asyncHandler func selectionDidChange(_ textInput: UITextInput?) func textWillChange(_ textInput: UITextInput?) - func textDidChange(_ textInput: UITextInput?) + @asyncHandler func textDidChange(_ textInput: UITextInput?) } protocol UITextInputTokenizer : NSObjectProtocol { @available(tvOS 3.2, *) diff --git a/tvOS/UIKit/UITextInteraction.swift b/tvOS/UIKit/UITextInteraction.swift index c320235..babefaf 100644 --- a/tvOS/UIKit/UITextInteraction.swift +++ b/tvOS/UIKit/UITextInteraction.swift @@ -8,5 +8,5 @@ enum UITextInteractionMode : Int { protocol UITextInteractionDelegate : NSObjectProtocol { optional func interactionShouldBegin(_ interaction: UITextInteraction, at point: CGPoint) -> Bool optional func interactionWillBegin(_ interaction: UITextInteraction) - optional func interactionDidEnd(_ interaction: UITextInteraction) + @asyncHandler optional func interactionDidEnd(_ interaction: UITextInteraction) } diff --git a/tvOS/UIKit/UITextView.swift b/tvOS/UIKit/UITextView.swift index 5badf3d..7f31a3c 100644 --- a/tvOS/UIKit/UITextView.swift +++ b/tvOS/UIKit/UITextView.swift @@ -5,15 +5,15 @@ protocol UITextViewDelegate : UIScrollViewDelegate { @available(tvOS 2.0, *) optional func textViewShouldEndEditing(_ textView: UITextView) -> Bool @available(tvOS 2.0, *) - optional func textViewDidBeginEditing(_ textView: UITextView) + @asyncHandler optional func textViewDidBeginEditing(_ textView: UITextView) @available(tvOS 2.0, *) - optional func textViewDidEndEditing(_ textView: UITextView) + @asyncHandler optional func textViewDidEndEditing(_ textView: UITextView) @available(tvOS 2.0, *) optional func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool @available(tvOS 2.0, *) - optional func textViewDidChange(_ textView: UITextView) + @asyncHandler optional func textViewDidChange(_ textView: UITextView) @available(tvOS 2.0, *) - optional func textViewDidChangeSelection(_ textView: UITextView) + @asyncHandler optional func textViewDidChangeSelection(_ textView: UITextView) @available(tvOS 10.0, *) optional func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool @available(tvOS 10.0, *) diff --git a/tvOS/UIKit/UITraitCollection.swift b/tvOS/UIKit/UITraitCollection.swift index 034374d..4316ca1 100644 --- a/tvOS/UIKit/UITraitCollection.swift +++ b/tvOS/UIKit/UITraitCollection.swift @@ -48,7 +48,7 @@ protocol UITraitEnvironment : NSObjectProtocol { @available(tvOS 8.0, *) var traitCollection: UITraitCollection { get } @available(tvOS 8.0, *) - func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) + @asyncHandler func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) } extension UITraitCollection { @available(tvOS 13.0, *) diff --git a/tvOS/UIKit/UIView.swift b/tvOS/UIKit/UIView.swift index 8942c21..803d011 100644 --- a/tvOS/UIKit/UIView.swift +++ b/tvOS/UIKit/UIView.swift @@ -245,17 +245,29 @@ extension UIView { @available(tvOS 4.0, *) class func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions = [], animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(tvOS 4.0, *) + class func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool + @available(tvOS 4.0, *) class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(tvOS 4.0, *) + class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void) async -> Bool + @available(tvOS 4.0, *) class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void) @available(tvOS 7.0, *) class func animate(withDuration duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping dampingRatio: CGFloat, initialSpringVelocity velocity: CGFloat, options: UIView.AnimationOptions = [], animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) + @available(tvOS 7.0, *) + class func animate(withDuration duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping dampingRatio: CGFloat, initialSpringVelocity velocity: CGFloat, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool @available(tvOS 4.0, *) class func transition(with view: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(tvOS 4.0, *) + class func transition(with view: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool + @available(tvOS 4.0, *) class func transition(from fromView: UIView, to toView: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], completion: ((Bool) -> Void)? = nil) + @available(tvOS 4.0, *) + class func transition(from fromView: UIView, to toView: UIView, duration: TimeInterval, options: UIView.AnimationOptions = []) async -> Bool @available(tvOS 7.0, *) class func perform(_ animation: UIView.SystemAnimation, on views: [UIView], options: UIView.AnimationOptions = [], animations parallelAnimations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) + @available(tvOS 7.0, *) + class func perform(_ animation: UIView.SystemAnimation, on views: [UIView], options: UIView.AnimationOptions = [], animations parallelAnimations: (() -> Void)?) async -> Bool @available(tvOS 12.0, *) class func modifyAnimations(withRepeatCount count: CGFloat, autoreverses: Bool, animations: () -> Void) } @@ -263,6 +275,8 @@ extension UIView { @available(tvOS 7.0, *) class func animateKeyframes(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.KeyframeAnimationOptions = [], animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(tvOS 7.0, *) + class func animateKeyframes(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.KeyframeAnimationOptions = [], animations: @escaping () -> Void) async -> Bool + @available(tvOS 7.0, *) class func addKeyframe(withRelativeStartTime frameStartTime: Double, relativeDuration frameDuration: Double, animations: @escaping () -> Void) } extension UIView { diff --git a/tvOS/UIKit/UIViewAnimating.swift b/tvOS/UIKit/UIViewAnimating.swift index eeac151..16d3934 100644 --- a/tvOS/UIKit/UIViewAnimating.swift +++ b/tvOS/UIKit/UIViewAnimating.swift @@ -33,5 +33,7 @@ protocol UIViewImplicitlyAnimating : UIViewAnimating { optional func addAnimations(_ animation: @escaping () -> Void) @available(tvOS 10.0, *) optional func addCompletion(_ completion: @escaping (UIViewAnimatingPosition) -> Void) + @available(tvOS 10.0, *) + optional func addCompletion() async -> UIViewAnimatingPosition optional func continueAnimation(withTimingParameters parameters: UITimingCurveProvider?, durationFactor: CGFloat) } diff --git a/tvOS/UIKit/UIViewController.swift b/tvOS/UIKit/UIViewController.swift index a603f03..29886f8 100644 --- a/tvOS/UIKit/UIViewController.swift +++ b/tvOS/UIKit/UIViewController.swift @@ -28,9 +28,9 @@ protocol UIContentContainer : NSObjectProtocol { @available(tvOS 8.0, *) var preferredContentSize: CGSize { get } @available(tvOS 8.0, *) - func preferredContentSizeDidChange(forChildContentContainer container: UIContentContainer) + @asyncHandler func preferredContentSizeDidChange(forChildContentContainer container: UIContentContainer) @available(tvOS 8.0, *) - func systemLayoutFittingSizeDidChange(forChildContentContainer container: UIContentContainer) + @asyncHandler func systemLayoutFittingSizeDidChange(forChildContentContainer container: UIContentContainer) @available(tvOS 8.0, *) func size(forChildContentContainer container: UIContentContainer, withParentContainerSize parentSize: CGSize) -> CGSize @available(tvOS 8.0, *) @@ -112,7 +112,11 @@ class UIViewController : UIResponder, NSCoding, UIAppearanceContainer, UITraitEn @available(tvOS 5.0, *) func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) @available(tvOS 5.0, *) + func present(_ viewControllerToPresent: UIViewController, animated flag: Bool) async + @available(tvOS 5.0, *) func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) + @available(tvOS 5.0, *) + func dismiss(animated flag: Bool) async @available(tvOS 3.0, *) var modalTransitionStyle: UIModalTransitionStyle @available(tvOS 3.2, *) @@ -157,6 +161,8 @@ extension UIViewController { @available(tvOS 5.0, *) func transition(from fromViewController: UIViewController, to toViewController: UIViewController, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(tvOS 5.0, *) + func transition(from fromViewController: UIViewController, to toViewController: UIViewController, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool + @available(tvOS 5.0, *) func beginAppearanceTransition(_ isAppearing: Bool, animated: Bool) @available(tvOS 5.0, *) func endAppearanceTransition() diff --git a/tvOS/UserNotifications/UNUserNotificationCenter.swift b/tvOS/UserNotifications/UNUserNotificationCenter.swift index 73df3b8..e0ea336 100644 --- a/tvOS/UserNotifications/UNUserNotificationCenter.swift +++ b/tvOS/UserNotifications/UNUserNotificationCenter.swift @@ -20,9 +20,13 @@ class UNUserNotificationCenter : NSObject { var supportsContentExtensions: Bool { get } class func current() -> UNUserNotificationCenter func requestAuthorization(options: UNAuthorizationOptions = [], completionHandler: @escaping (Bool, Error?) -> Void) + func requestAuthorization(options: UNAuthorizationOptions = []) async throws -> Bool func getNotificationSettings(completionHandler: @escaping (UNNotificationSettings) -> Void) + func getNotificationSettings() async -> UNNotificationSettings func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + func add(_ request: UNNotificationRequest) async throws func getPendingNotificationRequests(completionHandler: @escaping ([UNNotificationRequest]) -> Void) + func getPendingNotificationRequests() async -> [UNNotificationRequest] func removePendingNotificationRequests(withIdentifiers identifiers: [String]) func removeAllPendingNotificationRequests() } @@ -43,4 +47,6 @@ struct UNNotificationPresentationOptions : OptionSet { protocol UNUserNotificationCenterDelegate : NSObjectProtocol { @available(tvOS 10.0, *) optional func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) + @available(tvOS 10.0, *) + optional func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification) async -> UNNotificationPresentationOptions } diff --git a/tvOS/VideoSubscriberAccount/VSAccountManager.swift b/tvOS/VideoSubscriberAccount/VSAccountManager.swift index 86f0875..cca32d3 100644 --- a/tvOS/VideoSubscriberAccount/VSAccountManager.swift +++ b/tvOS/VideoSubscriberAccount/VSAccountManager.swift @@ -24,6 +24,7 @@ extension VSCheckAccessOption { class VSAccountManager : NSObject { weak var delegate: @sil_weak VSAccountManagerDelegate? func checkAccessStatus(options: [VSCheckAccessOption : Any] = [:], completionHandler: @escaping (VSAccountAccessStatus, Error?) -> Void) + func checkAccessStatus(options: [VSCheckAccessOption : Any] = [:]) async throws -> VSAccountAccessStatus func enqueue(_ request: VSAccountMetadataRequest, completionHandler: @escaping (VSAccountMetadata?, Error?) -> Void) -> VSAccountManagerResult } @available(tvOS 10.0, *) diff --git a/watchOS/AVFoundation/AVAsynchronousKeyValueLoading.swift b/watchOS/AVFoundation/AVAsynchronousKeyValueLoading.swift index a340868..cd4a315 100644 --- a/watchOS/AVFoundation/AVAsynchronousKeyValueLoading.swift +++ b/watchOS/AVFoundation/AVAsynchronousKeyValueLoading.swift @@ -11,4 +11,5 @@ enum AVKeyValueStatus : Int { protocol AVAsynchronousKeyValueLoading { func statusOfValue(forKey key: String, error outError: NSErrorPointer) -> AVKeyValueStatus func loadValuesAsynchronously(forKeys keys: [String], completionHandler handler: (() -> Void)? = nil) + func loadValuesAsynchronously(forKeys keys: [String]) async } diff --git a/watchOS/AVFoundation/AVCaptureDevice.swift b/watchOS/AVFoundation/AVCaptureDevice.swift index 3b7bd8c..8287f9b 100644 --- a/watchOS/AVFoundation/AVCaptureDevice.swift +++ b/watchOS/AVFoundation/AVCaptureDevice.swift @@ -64,6 +64,8 @@ extension AVCaptureDevice { var lensPosition: Float { get } @available(watchOS 2.0, *) func setFocusModeLocked(lensPosition: Float, completionHandler handler: ((CMTime) -> Void)? = nil) + @available(watchOS 2.0, *) + func setFocusModeLocked(lensPosition: Float) async -> CMTime } extension AVCaptureDevice { func isExposureModeSupported(_ exposureMode: AVCaptureDevice.ExposureMode) -> Bool @@ -80,6 +82,8 @@ extension AVCaptureDevice { @available(watchOS 2.0, *) func setExposureModeCustom(duration: CMTime, iso ISO: Float, completionHandler handler: ((CMTime) -> Void)? = nil) @available(watchOS 2.0, *) + func setExposureModeCustom(duration: CMTime, iso ISO: Float) async -> CMTime + @available(watchOS 2.0, *) var exposureTargetOffset: Float { get } @available(watchOS 2.0, *) var exposureTargetBias: Float { get } @@ -89,6 +93,8 @@ extension AVCaptureDevice { var maxExposureTargetBias: Float { get } @available(watchOS 2.0, *) func setExposureTargetBias(_ bias: Float, completionHandler handler: ((CMTime) -> Void)? = nil) + @available(watchOS 2.0, *) + func setExposureTargetBias(_ bias: Float) async -> CMTime } extension AVCaptureDevice { } @@ -107,6 +113,8 @@ extension AVCaptureDevice { @available(watchOS 2.0, *) func setWhiteBalanceModeLocked(with whiteBalanceGains: AVCaptureDevice.WhiteBalanceGains, completionHandler handler: ((CMTime) -> Void)? = nil) @available(watchOS 2.0, *) + func setWhiteBalanceModeLocked(with whiteBalanceGains: AVCaptureDevice.WhiteBalanceGains) async -> CMTime + @available(watchOS 2.0, *) func chromaticityValues(for whiteBalanceGains: AVCaptureDevice.WhiteBalanceGains) -> AVCaptureDevice.WhiteBalanceChromaticityValues @available(watchOS 2.0, *) func deviceWhiteBalanceGains(for chromaticityValues: AVCaptureDevice.WhiteBalanceChromaticityValues) -> AVCaptureDevice.WhiteBalanceGains @@ -144,6 +152,8 @@ extension AVCaptureDevice { class func authorizationStatus(for mediaType: AVMediaType) -> AVAuthorizationStatus @available(watchOS 2.0, *) class func requestAccess(for mediaType: AVMediaType, completionHandler handler: @escaping (Bool) -> Void) + @available(watchOS 2.0, *) + class func requestAccess(for mediaType: AVMediaType) async -> Bool } extension AVCaptureDevice { } diff --git a/watchOS/AVFoundation/AVCaptureStillImageOutput.swift b/watchOS/AVFoundation/AVCaptureStillImageOutput.swift index 3f593ce..8d5f03f 100644 --- a/watchOS/AVFoundation/AVCaptureStillImageOutput.swift +++ b/watchOS/AVFoundation/AVCaptureStillImageOutput.swift @@ -8,6 +8,10 @@ extension AVCaptureStillImageOutput { var isLensStabilizationDuringBracketedCaptureEnabled: Bool @available(watchOS, introduced: 2.0, deprecated: 3.0, message: "Use AVCapturePhotoOutput setPreparedPhotoSettingsArray:completionHandler: instead.") func prepareToCaptureStillImageBracket(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings], completionHandler handler: @escaping (Bool, Error?) -> Void) + @available(watchOS, introduced: 2.0, deprecated: 3.0, message: "Use AVCapturePhotoOutput setPreparedPhotoSettingsArray:completionHandler: instead.") + func prepareToCaptureStillImageBracket(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings]) async throws -> Bool @available(watchOS, introduced: 2.0, deprecated: 3.0, message: "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead.") func captureStillImageBracketAsynchronously(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings], completionHandler handler: @escaping (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?, Error?) -> Void) + @available(watchOS, introduced: 2.0, deprecated: 3.0, message: "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead.") + func captureStillImageBracketAsynchronously(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings]) async throws -> (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?) } diff --git a/watchOS/AVFoundation/AVContentKeySession.swift b/watchOS/AVFoundation/AVContentKeySession.swift index 8a2670e..f73691a 100644 --- a/watchOS/AVFoundation/AVContentKeySession.swift +++ b/watchOS/AVFoundation/AVContentKeySession.swift @@ -30,9 +30,15 @@ class AVContentKeySession : NSObject { @available(watchOS 7.0, *) func makeSecureTokenForExpirationDate(ofPersistableContentKey persistableContentKeyData: Data, completionHandler handler: @escaping (Data?, Error?) -> Void) @available(watchOS 7.0, *) + func makeSecureTokenForExpirationDate(ofPersistableContentKey persistableContentKeyData: Data) async throws -> Data? + @available(watchOS 7.0, *) func invalidatePersistableContentKey(_ persistableContentKeyData: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) @available(watchOS 7.0, *) + func invalidatePersistableContentKey(_ persistableContentKeyData: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil) async throws -> Data? + @available(watchOS 7.0, *) func invalidateAllPersistableContentKeys(forApp appIdentifier: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) + @available(watchOS 7.0, *) + func invalidateAllPersistableContentKeys(forApp appIdentifier: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil) async throws -> Data? } struct AVContentKeySessionServerPlaybackContextOption : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable { init(rawValue: String) @@ -83,18 +89,18 @@ extension AVContentKeyRequest.RetryReason { } @available(watchOS 7.0, *) protocol AVContentKeySessionDelegate : NSObjectProtocol { - func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest) - optional func contentKeySession(_ session: AVContentKeySession, didProvideRenewingContentKeyRequest keyRequest: AVContentKeyRequest) - optional func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVPersistableContentKeyRequest) + @asyncHandler func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest) + @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didProvideRenewingContentKeyRequest keyRequest: AVContentKeyRequest) + @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVPersistableContentKeyRequest) @available(watchOS 7.0, *) - optional func contentKeySession(_ session: AVContentKeySession, didUpdatePersistableContentKey persistableContentKey: Data, forContentKeyIdentifier keyIdentifier: Any) - optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequest keyRequest: AVContentKeyRequest, didFailWithError err: Error) + @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didUpdatePersistableContentKey persistableContentKey: Data, forContentKeyIdentifier keyIdentifier: Any) + @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequest keyRequest: AVContentKeyRequest, didFailWithError err: Error) optional func contentKeySession(_ session: AVContentKeySession, shouldRetry keyRequest: AVContentKeyRequest, reason retryReason: AVContentKeyRequest.RetryReason) -> Bool @available(watchOS 7.0, *) optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequestDidSucceed keyRequest: AVContentKeyRequest) - optional func contentKeySessionContentProtectionSessionIdentifierDidChange(_ session: AVContentKeySession) + @asyncHandler optional func contentKeySessionContentProtectionSessionIdentifierDidChange(_ session: AVContentKeySession) @available(watchOS 7.0, *) - optional func contentKeySessionDidGenerateExpiredSessionReport(_ session: AVContentKeySession) + @asyncHandler optional func contentKeySessionDidGenerateExpiredSessionReport(_ session: AVContentKeySession) } @available(watchOS 7.0, *) class AVContentKeyRequest : NSObject { @@ -106,6 +112,7 @@ class AVContentKeyRequest : NSObject { var options: [String : Any] { get } var canProvidePersistableContentKey: Bool { get } func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) + func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil) async throws -> Data? func processContentKeyResponse(_ keyResponse: AVContentKeyResponse) func processContentKeyResponseError(_ error: Error) @available(watchOS 7.0, *) diff --git a/watchOS/AVFoundation/AVPlayer.swift b/watchOS/AVFoundation/AVPlayer.swift index d8a9082..c8669ca 100644 --- a/watchOS/AVFoundation/AVPlayer.swift +++ b/watchOS/AVFoundation/AVPlayer.swift @@ -64,12 +64,18 @@ extension AVPlayer { func seek(to date: Date) @available(watchOS 1.0, *) func seek(to date: Date, completionHandler: @escaping (Bool) -> Void) + @available(watchOS 1.0, *) + func seek(to date: Date) async -> Bool func seek(to time: CMTime) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) @available(watchOS 1.0, *) func seek(to time: CMTime, completionHandler: @escaping (Bool) -> Void) @available(watchOS 1.0, *) + func seek(to time: CMTime) async -> Bool + @available(watchOS 1.0, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: @escaping (Bool) -> Void) + @available(watchOS 1.0, *) + func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool } extension AVPlayer { @available(watchOS 3.0, *) @@ -79,6 +85,8 @@ extension AVPlayer { @available(watchOS 1.0, *) func preroll(atRate rate: Float, completionHandler: ((Bool) -> Void)? = nil) @available(watchOS 1.0, *) + func preroll(atRate rate: Float) async -> Bool + @available(watchOS 1.0, *) func cancelPendingPrerolls() @available(watchOS 1.0, *) var masterClock: CMClock? diff --git a/watchOS/AVFoundation/AVPlayerItem.swift b/watchOS/AVFoundation/AVPlayerItem.swift index 04a8cfe..27f3325 100644 --- a/watchOS/AVFoundation/AVPlayerItem.swift +++ b/watchOS/AVFoundation/AVPlayerItem.swift @@ -83,8 +83,12 @@ extension AVPlayerItem { @available(watchOS 1.0, *) func seek(to time: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(watchOS 1.0, *) + func seek(to time: CMTime) async -> Bool + @available(watchOS 1.0, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(watchOS 1.0, *) + func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + @available(watchOS 1.0, *) func cancelPendingSeeks() func currentDate() -> Date? @available(watchOS 1.0, *) diff --git a/watchOS/AVFoundation/AVPlayerItemMediaDataCollector.swift b/watchOS/AVFoundation/AVPlayerItemMediaDataCollector.swift index 1e35d8a..2bb8e69 100644 --- a/watchOS/AVFoundation/AVPlayerItemMediaDataCollector.swift +++ b/watchOS/AVFoundation/AVPlayerItemMediaDataCollector.swift @@ -11,5 +11,5 @@ class AVPlayerItemMetadataCollector : AVPlayerItemMediaDataCollector { } protocol AVPlayerItemMetadataCollectorPushDelegate : NSObjectProtocol { @available(watchOS 2.3, *) - func metadataCollector(_ metadataCollector: AVPlayerItemMetadataCollector, didCollect metadataGroups: [AVDateRangeMetadataGroup], indexesOfNewGroups: IndexSet, indexesOfModifiedGroups: IndexSet) + @asyncHandler func metadataCollector(_ metadataCollector: AVPlayerItemMetadataCollector, didCollect metadataGroups: [AVDateRangeMetadataGroup], indexesOfNewGroups: IndexSet, indexesOfModifiedGroups: IndexSet) } diff --git a/watchOS/AVFoundation/AVPlayerItemOutput.swift b/watchOS/AVFoundation/AVPlayerItemOutput.swift index f385ccc..7fd34ec 100644 --- a/watchOS/AVFoundation/AVPlayerItemOutput.swift +++ b/watchOS/AVFoundation/AVPlayerItemOutput.swift @@ -41,5 +41,5 @@ class AVPlayerItemMetadataOutput : AVPlayerItemOutput { } protocol AVPlayerItemMetadataOutputPushDelegate : AVPlayerItemOutputPushDelegate { @available(watchOS 1.0, *) - optional func metadataOutput(_ output: AVPlayerItemMetadataOutput, didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup], from track: AVPlayerItemTrack?) + @asyncHandler optional func metadataOutput(_ output: AVPlayerItemMetadataOutput, didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup], from track: AVPlayerItemTrack?) } diff --git a/watchOS/AVFoundation/AVSampleBufferAudioRenderer.swift b/watchOS/AVFoundation/AVSampleBufferAudioRenderer.swift index 622537b..3971811 100644 --- a/watchOS/AVFoundation/AVSampleBufferAudioRenderer.swift +++ b/watchOS/AVFoundation/AVSampleBufferAudioRenderer.swift @@ -11,6 +11,7 @@ extension AVSampleBufferAudioRenderer { } extension AVSampleBufferAudioRenderer { func flush(fromSourceTime time: CMTime, completionHandler: @escaping (Bool) -> Void) + func flush(fromSourceTime time: CMTime) async -> Bool } extension NSNotification.Name { @available(watchOS 4.0, *) diff --git a/watchOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift b/watchOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift index 588c127..3049774 100644 --- a/watchOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift +++ b/watchOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift @@ -15,6 +15,7 @@ extension AVSampleBufferRenderSynchronizer { var renderers: [AVQueuedSampleBufferRendering] { get } func addRenderer(_ renderer: AVQueuedSampleBufferRendering) func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime, completionHandler: ((Bool) -> Void)? = nil) + func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool } extension AVSampleBufferRenderSynchronizer { func addPeriodicTimeObserver(forInterval interval: CMTime, queue: DispatchQueue?, using block: @escaping (CMTime) -> Void) -> Any diff --git a/watchOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift b/watchOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift index 8bebc12..9d1622d 100644 --- a/watchOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift +++ b/watchOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift @@ -16,4 +16,5 @@ extension ASAuthorizationAppleIDProvider { class ASAuthorizationAppleIDProvider : NSObject, ASAuthorizationProvider { func createRequest() -> ASAuthorizationAppleIDRequest func getCredentialState(forUserID userID: String, completion: @escaping (ASAuthorizationAppleIDProvider.CredentialState, Error?) -> Void) + func getCredentialState(forUserID userID: String) async throws -> ASAuthorizationAppleIDProvider.CredentialState } diff --git a/watchOS/AuthenticationServices/ASAuthorizationController.swift b/watchOS/AuthenticationServices/ASAuthorizationController.swift index 3bc6954..dceedd6 100644 --- a/watchOS/AuthenticationServices/ASAuthorizationController.swift +++ b/watchOS/AuthenticationServices/ASAuthorizationController.swift @@ -1,8 +1,8 @@ @available(watchOS 6.0, *) protocol ASAuthorizationControllerDelegate : NSObjectProtocol { - optional func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) - optional func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) + @asyncHandler optional func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) + @asyncHandler optional func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) } @available(watchOS 6.0, *) class ASAuthorizationController : NSObject { diff --git a/watchOS/ClockKit/CLKComplicationDataSource.swift b/watchOS/ClockKit/CLKComplicationDataSource.swift index 2828ae6..abd3995 100644 --- a/watchOS/ClockKit/CLKComplicationDataSource.swift +++ b/watchOS/ClockKit/CLKComplicationDataSource.swift @@ -25,7 +25,7 @@ protocol CLKComplicationDataSource : NSObjectProtocol { @available(watchOS, introduced: 2.0, deprecated: 4.0, message: "Use WKRefreshBackgroundTask instead") optional func getNextRequestedUpdateDate(handler: @escaping (Date?) -> Void) @available(watchOS, introduced: 2.0, deprecated: 4.0, message: "Use WKRefreshBackgroundTask instead") - optional func requestedUpdateDidBegin() + @asyncHandler optional func requestedUpdateDidBegin() @available(watchOS, introduced: 2.0, deprecated: 4.0, message: "Use WKRefreshBackgroundTask instead") optional func requestedUpdateBudgetExhausted() } diff --git a/watchOS/ClockKit/CLKWatchFaceLibrary.swift b/watchOS/ClockKit/CLKWatchFaceLibrary.swift index 02683c1..ab43387 100644 --- a/watchOS/ClockKit/CLKWatchFaceLibrary.swift +++ b/watchOS/ClockKit/CLKWatchFaceLibrary.swift @@ -15,4 +15,5 @@ extension CLKWatchFaceLibrary { @available(watchOS 7.0, *) class CLKWatchFaceLibrary : NSObject { func addWatchFace(at fileURL: URL, completionHandler handler: @escaping (Error?) -> Void) + func addWatchFace(at fileURL: URL) async throws } diff --git a/watchOS/CloudKit/CKContainer.swift b/watchOS/CloudKit/CKContainer.swift index 1a4daea..91c0d06 100644 --- a/watchOS/CloudKit/CKContainer.swift +++ b/watchOS/CloudKit/CKContainer.swift @@ -51,6 +51,7 @@ extension NSNotification.Name { } extension CKContainer { func accountStatus(completionHandler: @escaping (CKAccountStatus, Error?) -> Void) + func accountStatus() async throws -> CKAccountStatus } @available(watchOS 3.0, *) struct CKContainer_Application_Permissions : OptionSet { @@ -70,34 +71,59 @@ enum CKContainer_Application_PermissionStatus : Int { typealias CKContainer_Application_PermissionBlock = (CKContainer_Application_PermissionStatus, Error?) -> Void extension CKContainer { func status(forApplicationPermission applicationPermission: CKContainer_Application_Permissions, completionHandler: @escaping CKContainer_Application_PermissionBlock) + func status(forApplicationPermission applicationPermission: CKContainer_Application_Permissions) async throws -> CKContainer_Application_PermissionStatus func requestApplicationPermission(_ applicationPermission: CKContainer_Application_Permissions, completionHandler: @escaping CKContainer_Application_PermissionBlock) + func requestApplicationPermission(_ applicationPermission: CKContainer_Application_Permissions) async throws -> CKContainer_Application_PermissionStatus } extension CKContainer { func fetchUserRecordID(completionHandler: @escaping (CKRecord.ID?, Error?) -> Void) + func fetchUserRecordID() async throws -> CKRecord.ID? @available(watchOS 3.0, *) func discoverAllIdentities(completionHandler: @escaping ([CKUserIdentity]?, Error?) -> Void) @available(watchOS 3.0, *) + func discoverAllIdentities() async throws -> [CKUserIdentity]? + @available(watchOS 3.0, *) func discoverUserIdentity(withEmailAddress email: String, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(watchOS 3.0, *) + func discoverUserIdentity(withEmailAddress email: String) async throws -> CKUserIdentity? + @available(watchOS 3.0, *) func discoverUserIdentity(withPhoneNumber phoneNumber: String, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(watchOS 3.0, *) + func discoverUserIdentity(withPhoneNumber phoneNumber: String) async throws -> CKUserIdentity? + @available(watchOS 3.0, *) func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) + @available(watchOS 3.0, *) + func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKUserIdentity? } extension CKContainer { @available(watchOS 3.0, *) func fetchShareParticipant(withEmailAddress emailAddress: String, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(watchOS 3.0, *) + func fetchShareParticipant(withEmailAddress emailAddress: String) async throws -> CKShare.Participant? + @available(watchOS 3.0, *) func fetchShareParticipant(withPhoneNumber phoneNumber: String, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(watchOS 3.0, *) + func fetchShareParticipant(withPhoneNumber phoneNumber: String) async throws -> CKShare.Participant? + @available(watchOS 3.0, *) func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(watchOS 3.0, *) + func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKShare.Participant? + @available(watchOS 3.0, *) func fetchShareMetadata(with url: URL, completionHandler: @escaping (CKShare.Metadata?, Error?) -> Void) @available(watchOS 3.0, *) + func fetchShareMetadata(with url: URL) async throws -> CKShare.Metadata? + @available(watchOS 3.0, *) func accept(_ metadata: CKShare.Metadata, completionHandler: @escaping (CKShare?, Error?) -> Void) + @available(watchOS 3.0, *) + func accept(_ metadata: CKShare.Metadata) async throws -> CKShare? } extension CKContainer { @available(watchOS 3.0, *) func __fetchAllLongLivedOperationIDs(completionHandler: @escaping ([String]?, Error?) -> Void) @available(watchOS 3.0, *) + func __fetchAllLongLivedOperationIDs() async throws -> [String]? + @available(watchOS 3.0, *) func __fetchLongLivedOperation(withID operationID: String, completionHandler: @escaping (CKOperation?, Error?) -> Void) + @available(watchOS 3.0, *) + func __fetchLongLivedOperation(withID operationID: String) async throws -> CKOperation? } diff --git a/watchOS/CloudKit/CKDatabase.swift b/watchOS/CloudKit/CKDatabase.swift index d905d68..59388a4 100644 --- a/watchOS/CloudKit/CKDatabase.swift +++ b/watchOS/CloudKit/CKDatabase.swift @@ -25,19 +25,35 @@ class CKDatabase : NSObject { } extension CKDatabase { func fetch(withRecordID recordID: CKRecord.ID, completionHandler: @escaping (CKRecord?, Error?) -> Void) + func fetch(withRecordID recordID: CKRecord.ID) async throws -> CKRecord? func save(_ record: CKRecord, completionHandler: @escaping (CKRecord?, Error?) -> Void) + func save(_ record: CKRecord) async throws -> CKRecord? func delete(withRecordID recordID: CKRecord.ID, completionHandler: @escaping (CKRecord.ID?, Error?) -> Void) + func delete(withRecordID recordID: CKRecord.ID) async throws -> CKRecord.ID? func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?, completionHandler: @escaping ([CKRecord]?, Error?) -> Void) + func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?) async throws -> [CKRecord]? func fetchAllRecordZones(completionHandler: @escaping ([CKRecordZone]?, Error?) -> Void) + func fetchAllRecordZones() async throws -> [CKRecordZone]? func fetch(withRecordZoneID zoneID: CKRecordZone.ID, completionHandler: @escaping (CKRecordZone?, Error?) -> Void) + func fetch(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone? func save(_ zone: CKRecordZone, completionHandler: @escaping (CKRecordZone?, Error?) -> Void) + func save(_ zone: CKRecordZone) async throws -> CKRecordZone? func delete(withRecordZoneID zoneID: CKRecordZone.ID, completionHandler: @escaping (CKRecordZone.ID?, Error?) -> Void) + func delete(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone.ID? @available(watchOS 6.0, *) func __fetch(withSubscriptionID subscriptionID: String, completionHandler: @escaping (CKSubscription?, Error?) -> Void) @available(watchOS 6.0, *) + func __fetch(withSubscriptionID subscriptionID: String) async throws -> CKSubscription? + @available(watchOS 6.0, *) func fetchAllSubscriptions(completionHandler: @escaping ([CKSubscription]?, Error?) -> Void) @available(watchOS 6.0, *) + func fetchAllSubscriptions() async throws -> [CKSubscription]? + @available(watchOS 6.0, *) func save(_ subscription: CKSubscription, completionHandler: @escaping (CKSubscription?, Error?) -> Void) @available(watchOS 6.0, *) + func save(_ subscription: CKSubscription) async throws -> CKSubscription? + @available(watchOS 6.0, *) func __delete(withSubscriptionID subscriptionID: String, completionHandler: @escaping (String?, Error?) -> Void) + @available(watchOS 6.0, *) + func __delete(withSubscriptionID subscriptionID: String) async throws -> String? } diff --git a/watchOS/Contacts/CNContactStore.swift b/watchOS/Contacts/CNContactStore.swift index c18c53f..6523af4 100644 --- a/watchOS/Contacts/CNContactStore.swift +++ b/watchOS/Contacts/CNContactStore.swift @@ -18,6 +18,7 @@ enum CNAuthorizationStatus : Int { class CNContactStore : NSObject { class func authorizationStatus(for entityType: CNEntityType) -> CNAuthorizationStatus func requestAccess(for entityType: CNEntityType, completionHandler: @escaping (Bool, Error?) -> Void) + func requestAccess(for entityType: CNEntityType) async throws -> Bool func unifiedContacts(matching predicate: NSPredicate, keysToFetch keys: [CNKeyDescriptor]) throws -> [CNContact] func unifiedContact(withIdentifier identifier: String, keysToFetch keys: [CNKeyDescriptor]) throws -> CNContact func enumerateContacts(with fetchRequest: CNContactFetchRequest, usingBlock block: @escaping (CNContact, UnsafeMutablePointer) -> Void) throws diff --git a/watchOS/CoreBluetooth/CBCentralManager.swift b/watchOS/CoreBluetooth/CBCentralManager.swift index 0006c89..974ac0b 100644 --- a/watchOS/CoreBluetooth/CBCentralManager.swift +++ b/watchOS/CoreBluetooth/CBCentralManager.swift @@ -47,19 +47,19 @@ class CBCentralManager : CBManager { } protocol CBCentralManagerDelegate : NSObjectProtocol { @available(watchOS 2.0, *) - func centralManagerDidUpdateState(_ central: CBCentralManager) + @asyncHandler func centralManagerDidUpdateState(_ central: CBCentralManager) @available(watchOS 2.0, *) optional func centralManager(_ central: CBCentralManager, willRestoreState dict: [String : Any]) @available(watchOS 2.0, *) - optional func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) + @asyncHandler optional func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) @available(watchOS 2.0, *) - optional func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) + @asyncHandler optional func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) @available(watchOS 2.0, *) - optional func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) + @asyncHandler optional func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) @available(watchOS 2.0, *) - optional func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) + @asyncHandler optional func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) @available(watchOS 6.0, *) optional func centralManager(_ central: CBCentralManager, connectionEventDidOccur event: CBConnectionEvent, for peripheral: CBPeripheral) @available(watchOS 6.0, *) - optional func centralManager(_ central: CBCentralManager, didUpdateANCSAuthorizationFor peripheral: CBPeripheral) + @asyncHandler optional func centralManager(_ central: CBCentralManager, didUpdateANCSAuthorizationFor peripheral: CBPeripheral) } diff --git a/watchOS/CoreBluetooth/CBPeripheral.swift b/watchOS/CoreBluetooth/CBPeripheral.swift index 538fd86..306db7b 100644 --- a/watchOS/CoreBluetooth/CBPeripheral.swift +++ b/watchOS/CoreBluetooth/CBPeripheral.swift @@ -44,33 +44,33 @@ class CBPeripheral : CBPeer { } protocol CBPeripheralDelegate : NSObjectProtocol { @available(watchOS 2.0, *) - optional func peripheralDidUpdateName(_ peripheral: CBPeripheral) + @asyncHandler optional func peripheralDidUpdateName(_ peripheral: CBPeripheral) @available(watchOS 2.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]) @available(watchOS, introduced: 2.0, deprecated: 2.0) - optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, error: Error?) + @asyncHandler optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, error: Error?) @available(watchOS 2.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didReadRSSI RSSI: NSNumber, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didReadRSSI RSSI: NSNumber, error: Error?) @available(watchOS 2.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) @available(watchOS 2.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesFor service: CBService, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesFor service: CBService, error: Error?) @available(watchOS 2.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) @available(watchOS 2.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) @available(watchOS 2.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) @available(watchOS 2.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: Error?) @available(watchOS 2.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didDiscoverDescriptorsFor characteristic: CBCharacteristic, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverDescriptorsFor characteristic: CBCharacteristic, error: Error?) @available(watchOS 2.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor descriptor: CBDescriptor, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor descriptor: CBDescriptor, error: Error?) @available(watchOS 2.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor descriptor: CBDescriptor, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor descriptor: CBDescriptor, error: Error?) @available(watchOS 2.0, *) optional func peripheralIsReady(toSendWriteWithoutResponse peripheral: CBPeripheral) @available(watchOS 4.0, *) - optional func peripheral(_ peripheral: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?) + @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?) } diff --git a/watchOS/CoreBluetooth/CBPeripheralManager.swift b/watchOS/CoreBluetooth/CBPeripheralManager.swift index 07df083..ee0d131 100644 --- a/watchOS/CoreBluetooth/CBPeripheralManager.swift +++ b/watchOS/CoreBluetooth/CBPeripheralManager.swift @@ -48,27 +48,27 @@ class CBPeripheralManager : CBManager { } protocol CBPeripheralManagerDelegate : NSObjectProtocol { @available(watchOS 2.0, *) - func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) + @asyncHandler func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) @available(watchOS 2.0, *) optional func peripheralManager(_ peripheral: CBPeripheralManager, willRestoreState dict: [String : Any]) @available(watchOS 2.0, *) - optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error: Error?) + @asyncHandler optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error: Error?) @available(watchOS 2.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) @available(watchOS 2.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didSubscribeTo characteristic: CBCharacteristic) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didSubscribeTo characteristic: CBCharacteristic) @available(watchOS 2.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didUnsubscribeFrom characteristic: CBCharacteristic) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didUnsubscribeFrom characteristic: CBCharacteristic) @available(watchOS 2.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveRead request: CBATTRequest) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveRead request: CBATTRequest) @available(watchOS 2.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) @available(watchOS 2.0, *) optional func peripheralManagerIsReady(toUpdateSubscribers peripheral: CBPeripheralManager) @available(watchOS 2.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) @available(watchOS 2.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didUnpublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didUnpublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) @available(watchOS 4.0, *) - optional func peripheralManager(_ peripheral: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: Error?) + @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: Error?) } diff --git a/watchOS/CoreData/NSFetchedResultsController.swift b/watchOS/CoreData/NSFetchedResultsController.swift index 6cc5853..b549bb7 100644 --- a/watchOS/CoreData/NSFetchedResultsController.swift +++ b/watchOS/CoreData/NSFetchedResultsController.swift @@ -34,15 +34,15 @@ enum NSFetchedResultsChangeType : UInt { } protocol NSFetchedResultsControllerDelegate : NSObjectProtocol { @available(watchOS 6.0, *) - optional func controller(_ controller: NSFetchedResultsController, didChangeContentWith diff: CollectionDifference) + @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChangeContentWith diff: CollectionDifference) @available(watchOS 2.0, *) - optional func controller(_ controller: NSFetchedResultsController, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) + @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) @available(watchOS 2.0, *) - optional func controller(_ controller: NSFetchedResultsController, didChange sectionInfo: NSFetchedResultsSectionInfo, atSectionIndex sectionIndex: Int, for type: NSFetchedResultsChangeType) + @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChange sectionInfo: NSFetchedResultsSectionInfo, atSectionIndex sectionIndex: Int, for type: NSFetchedResultsChangeType) @available(watchOS 2.0, *) optional func controllerWillChangeContent(_ controller: NSFetchedResultsController) @available(watchOS 2.0, *) - optional func controllerDidChangeContent(_ controller: NSFetchedResultsController) + @asyncHandler optional func controllerDidChangeContent(_ controller: NSFetchedResultsController) @available(watchOS 2.0, *) optional func controller(_ controller: NSFetchedResultsController, sectionIndexTitleForSectionName sectionName: String) -> String? } diff --git a/watchOS/CoreData/NSPersistentContainer.swift b/watchOS/CoreData/NSPersistentContainer.swift index d4475b7..accdbea 100644 --- a/watchOS/CoreData/NSPersistentContainer.swift +++ b/watchOS/CoreData/NSPersistentContainer.swift @@ -10,6 +10,7 @@ class NSPersistentContainer : NSObject { convenience init(name: String) init(name: String, managedObjectModel model: NSManagedObjectModel) func loadPersistentStores(completionHandler block: @escaping (NSPersistentStoreDescription, Error?) -> Void) + func loadPersistentStores() async throws -> NSPersistentStoreDescription func newBackgroundContext() -> NSManagedObjectContext func performBackgroundTask(_ block: @escaping (NSManagedObjectContext) -> Void) } diff --git a/watchOS/CoreData/NSPersistentStoreCoordinator.swift b/watchOS/CoreData/NSPersistentStoreCoordinator.swift index 85661e4..6335004 100644 --- a/watchOS/CoreData/NSPersistentStoreCoordinator.swift +++ b/watchOS/CoreData/NSPersistentStoreCoordinator.swift @@ -79,6 +79,8 @@ class NSPersistentStoreCoordinator : NSObject { func addPersistentStore(ofType storeType: String, configurationName configuration: String?, at storeURL: URL?, options: [AnyHashable : Any]? = nil) throws -> NSPersistentStore @available(watchOS 3.0, *) func addPersistentStore(with storeDescription: NSPersistentStoreDescription, completionHandler block: @escaping (NSPersistentStoreDescription, Error?) -> Void) + @available(watchOS 3.0, *) + func addPersistentStore(with storeDescription: NSPersistentStoreDescription) async throws -> NSPersistentStoreDescription func remove(_ store: NSPersistentStore) throws func setMetadata(_ metadata: [String : Any]?, for store: NSPersistentStore) func metadata(for store: NSPersistentStore) -> [String : Any] diff --git a/watchOS/CoreLocation/CLGeocoder.swift b/watchOS/CoreLocation/CLGeocoder.swift index e9cb1f2..f37a197 100644 --- a/watchOS/CoreLocation/CLGeocoder.swift +++ b/watchOS/CoreLocation/CLGeocoder.swift @@ -4,14 +4,23 @@ typealias CLGeocodeCompletionHandler = ([CLPlacemark]?, Error?) -> Void class CLGeocoder : NSObject { var isGeocoding: Bool { get } func reverseGeocodeLocation(_ location: CLLocation, completionHandler: @escaping CLGeocodeCompletionHandler) + func reverseGeocodeLocation(_ location: CLLocation) async throws -> [CLPlacemark]? @available(watchOS 4.0, *) func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?, completionHandler: @escaping CLGeocodeCompletionHandler) + @available(watchOS 4.0, *) + func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?) async throws -> [CLPlacemark]? @available(watchOS, introduced: 1.0, deprecated: 4.0, message: "Use -geocodePostalAddress:completionHandler:") func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any], completionHandler: @escaping CLGeocodeCompletionHandler) + @available(watchOS, introduced: 1.0, deprecated: 4.0, message: "Use -geocodePostalAddress:completionHandler:") + func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any]) async throws -> [CLPlacemark]? func geocodeAddressString(_ addressString: String, completionHandler: @escaping CLGeocodeCompletionHandler) + func geocodeAddressString(_ addressString: String) async throws -> [CLPlacemark]? func geocodeAddressString(_ addressString: String, in region: CLRegion?, completionHandler: @escaping CLGeocodeCompletionHandler) + func geocodeAddressString(_ addressString: String, in region: CLRegion?) async throws -> [CLPlacemark]? @available(watchOS 4.0, *) func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?, completionHandler: @escaping CLGeocodeCompletionHandler) + @available(watchOS 4.0, *) + func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?) async throws -> [CLPlacemark]? func cancelGeocode() } extension CLGeocoder { diff --git a/watchOS/CoreLocation/CLLocationManager.swift b/watchOS/CoreLocation/CLLocationManager.swift index 3ce8862..adddb42 100644 --- a/watchOS/CoreLocation/CLLocationManager.swift +++ b/watchOS/CoreLocation/CLLocationManager.swift @@ -70,6 +70,8 @@ class CLLocationManager : NSObject { @available(watchOS 7.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String, completion: ((Error?) -> Void)? = nil) @available(watchOS 7.0, *) + func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) async throws + @available(watchOS 7.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) @available(watchOS 3.0, *) func startUpdatingLocation() diff --git a/watchOS/CoreLocation/CLLocationManagerDelegate.swift b/watchOS/CoreLocation/CLLocationManagerDelegate.swift index 778cd88..5df2a28 100644 --- a/watchOS/CoreLocation/CLLocationManagerDelegate.swift +++ b/watchOS/CoreLocation/CLLocationManagerDelegate.swift @@ -1,15 +1,15 @@ protocol CLLocationManagerDelegate : NSObjectProtocol { @available(watchOS 2.0, *) - optional func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) @available(watchOS 2.0, *) - optional func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) @available(watchOS 2.0, *) optional func locationManagerShouldDisplayHeadingCalibration(_ manager: CLLocationManager) -> Bool @available(watchOS 2.0, *) - optional func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) @available(watchOS, introduced: 1.0, deprecated: 7.0) - optional func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) + @asyncHandler optional func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) @available(watchOS 7.0, *) - optional func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) + @asyncHandler optional func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) } diff --git a/watchOS/CoreML/MLModel.swift b/watchOS/CoreML/MLModel.swift index 2fc5286..f130ac4 100644 --- a/watchOS/CoreML/MLModel.swift +++ b/watchOS/CoreML/MLModel.swift @@ -9,6 +9,8 @@ class MLModel : NSObject { convenience init(contentsOf url: URL, configuration: MLModelConfiguration) throws @available(watchOS 7.0, *) class func __loadContents(of url: URL, configuration: MLModelConfiguration, completionHandler handler: @escaping (MLModel?, Error?) -> Void) + @available(watchOS 7.0, *) + class func __loadContents(of url: URL, configuration: MLModelConfiguration) async throws -> MLModel? func prediction(from input: MLFeatureProvider) throws -> MLFeatureProvider func prediction(from input: MLFeatureProvider, options: MLPredictionOptions) throws -> MLFeatureProvider @available(watchOS 5.0, *) diff --git a/watchOS/CoreMotion/CMHeadphoneMotionManagerDelegate.swift b/watchOS/CoreMotion/CMHeadphoneMotionManagerDelegate.swift index cf3c51a..60cab6f 100644 --- a/watchOS/CoreMotion/CMHeadphoneMotionManagerDelegate.swift +++ b/watchOS/CoreMotion/CMHeadphoneMotionManagerDelegate.swift @@ -1,6 +1,6 @@ @available(watchOS 7.0, *) protocol CMHeadphoneMotionManagerDelegate : NSObjectProtocol { - optional func headphoneMotionManagerDidConnect(_ manager: CMHeadphoneMotionManager) - optional func headphoneMotionManagerDidDisconnect(_ manager: CMHeadphoneMotionManager) + @asyncHandler optional func headphoneMotionManagerDidConnect(_ manager: CMHeadphoneMotionManager) + @asyncHandler optional func headphoneMotionManagerDidDisconnect(_ manager: CMHeadphoneMotionManager) } diff --git a/watchOS/EventKit/EKEventStore.swift b/watchOS/EventKit/EKEventStore.swift index 6cae6dc..6d39dec 100644 --- a/watchOS/EventKit/EKEventStore.swift +++ b/watchOS/EventKit/EKEventStore.swift @@ -12,6 +12,8 @@ class EKEventStore : NSObject { class func authorizationStatus(for entityType: EKEntityType) -> EKAuthorizationStatus @available(watchOS 2.0, *) func requestAccess(to entityType: EKEntityType, completion: @escaping EKEventStoreRequestAccessCompletionHandler) + @available(watchOS 2.0, *) + func requestAccess(to entityType: EKEntityType) async throws -> Bool var eventStoreIdentifier: String { get } @available(watchOS 5.0, *) var delegateSources: [EKSource] { get } diff --git a/watchOS/Foundation/NSBundle.swift b/watchOS/Foundation/NSBundle.swift index ce5ef34..11447c9 100644 --- a/watchOS/Foundation/NSBundle.swift +++ b/watchOS/Foundation/NSBundle.swift @@ -99,7 +99,9 @@ class NSBundleResourceRequest : NSObject, ProgressReporting { var tags: Set { get } var bundle: Bundle { get } func beginAccessingResources(completionHandler: @escaping (Error?) -> Void) + func beginAccessingResources() async throws func conditionallyBeginAccessingResources(completionHandler: @escaping (Bool) -> Void) + func conditionallyBeginAccessingResources() async -> Bool func endAccessingResources() } extension Bundle { diff --git a/watchOS/Foundation/NSExtensionContext.swift b/watchOS/Foundation/NSExtensionContext.swift index c1bf45f..fee646a 100644 --- a/watchOS/Foundation/NSExtensionContext.swift +++ b/watchOS/Foundation/NSExtensionContext.swift @@ -3,8 +3,10 @@ class NSExtensionContext : NSObject { var inputItems: [Any] { get } func completeRequest(returningItems items: [Any]?, completionHandler: ((Bool) -> Void)? = nil) + func completeRequest(returningItems items: [Any]?) async -> Bool func cancelRequest(withError error: Error) func open(_ URL: URL, completionHandler: ((Bool) -> Void)? = nil) + func open(_ URL: URL) async -> Bool } @available(watchOS 2.0, *) let NSExtensionItemsAndErrorsKey: String diff --git a/watchOS/Foundation/NSFilePresenter.swift b/watchOS/Foundation/NSFilePresenter.swift index a0e20af..8f74420 100644 --- a/watchOS/Foundation/NSFilePresenter.swift +++ b/watchOS/Foundation/NSFilePresenter.swift @@ -6,23 +6,26 @@ protocol NSFilePresenter : NSObjectProtocol { optional func relinquishPresentedItem(toReader reader: @escaping ((() -> Void)?) -> Void) optional func relinquishPresentedItem(toWriter writer: @escaping ((() -> Void)?) -> Void) optional func savePresentedItemChanges(completionHandler: @escaping (Error?) -> Void) + optional func savePresentedItemChanges() async throws optional func accommodatePresentedItemDeletion(completionHandler: @escaping (Error?) -> Void) - optional func presentedItemDidMove(to newURL: URL) - optional func presentedItemDidChange() + optional func accommodatePresentedItemDeletion() async throws + @asyncHandler optional func presentedItemDidMove(to newURL: URL) + @asyncHandler optional func presentedItemDidChange() @available(watchOS 2.0, *) - optional func presentedItemDidGain(_ version: NSFileVersion) + @asyncHandler optional func presentedItemDidGain(_ version: NSFileVersion) @available(watchOS 2.0, *) - optional func presentedItemDidLose(_ version: NSFileVersion) + @asyncHandler optional func presentedItemDidLose(_ version: NSFileVersion) @available(watchOS 2.0, *) - optional func presentedItemDidResolveConflict(_ version: NSFileVersion) + @asyncHandler optional func presentedItemDidResolveConflict(_ version: NSFileVersion) optional func accommodatePresentedSubitemDeletion(at url: URL, completionHandler: @escaping (Error?) -> Void) - optional func presentedSubitemDidAppear(at url: URL) - optional func presentedSubitem(at oldURL: URL, didMoveTo newURL: URL) - optional func presentedSubitemDidChange(at url: URL) + optional func accommodatePresentedSubitemDeletion(at url: URL) async throws + @asyncHandler optional func presentedSubitemDidAppear(at url: URL) + @asyncHandler optional func presentedSubitem(at oldURL: URL, didMoveTo newURL: URL) + @asyncHandler optional func presentedSubitemDidChange(at url: URL) @available(watchOS 2.0, *) - optional func presentedSubitem(at url: URL, didGain version: NSFileVersion) + @asyncHandler optional func presentedSubitem(at url: URL, didGain version: NSFileVersion) @available(watchOS 2.0, *) - optional func presentedSubitem(at url: URL, didLose version: NSFileVersion) + @asyncHandler optional func presentedSubitem(at url: URL, didLose version: NSFileVersion) @available(watchOS 2.0, *) - optional func presentedSubitem(at url: URL, didResolve version: NSFileVersion) + @asyncHandler optional func presentedSubitem(at url: URL, didResolve version: NSFileVersion) } diff --git a/watchOS/Foundation/NSFileVersion.swift b/watchOS/Foundation/NSFileVersion.swift index 1fbed8a..41d45a4 100644 --- a/watchOS/Foundation/NSFileVersion.swift +++ b/watchOS/Foundation/NSFileVersion.swift @@ -18,6 +18,8 @@ class NSFileVersion : NSObject { class func unresolvedConflictVersionsOfItem(at url: URL) -> [NSFileVersion]? @available(watchOS 2.0, *) class func getNonlocalVersionsOfItem(at url: URL, completionHandler: @escaping ([NSFileVersion]?, Error?) -> Void) + @available(watchOS 2.0, *) + class func getNonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion]? class func version(itemAt url: URL, forPersistentIdentifier persistentIdentifier: Any) -> NSFileVersion? var url: URL { get } var localizedName: String? { get } diff --git a/watchOS/Foundation/NSHTTPCookieStorage.swift b/watchOS/Foundation/NSHTTPCookieStorage.swift index f3846ea..0ff76f5 100644 --- a/watchOS/Foundation/NSHTTPCookieStorage.swift +++ b/watchOS/Foundation/NSHTTPCookieStorage.swift @@ -29,6 +29,8 @@ extension HTTPCookieStorage { func storeCookies(_ cookies: [HTTPCookie], for task: URLSessionTask) @available(watchOS 2.0, *) func getCookiesFor(_ task: URLSessionTask, completionHandler: @escaping ([HTTPCookie]?) -> Void) + @available(watchOS 2.0, *) + func getCookiesFor(_ task: URLSessionTask) async -> [HTTPCookie]? } extension NSNotification.Name { @available(watchOS 2.0, *) diff --git a/watchOS/Foundation/NSItemProvider.swift b/watchOS/Foundation/NSItemProvider.swift index 3267233..562fa67 100644 --- a/watchOS/Foundation/NSItemProvider.swift +++ b/watchOS/Foundation/NSItemProvider.swift @@ -75,6 +75,7 @@ class NSItemProvider : NSObject, NSCopying { convenience init?(contentsOf fileURL: URL!) func registerItem(forTypeIdentifier typeIdentifier: String, loadHandler: @escaping NSItemProvider.LoadHandler) func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil, completionHandler: NSItemProvider.CompletionHandler? = nil) + func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding? } @available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) @@ -93,6 +94,8 @@ extension NSItemProvider { var previewImageHandler: NSItemProvider.LoadHandler? @available(watchOS 2.0, *) func loadPreviewImage(options: [AnyHashable : Any]! = [:], completionHandler: NSItemProvider.CompletionHandler!) + @available(watchOS 2.0, *) + func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding? } @available(watchOS 2.0, *) let NSExtensionJavaScriptPreprocessingResultsKey: String diff --git a/watchOS/Foundation/NSKeyedArchiver.swift b/watchOS/Foundation/NSKeyedArchiver.swift index 0cf8f46..32403dd 100644 --- a/watchOS/Foundation/NSKeyedArchiver.swift +++ b/watchOS/Foundation/NSKeyedArchiver.swift @@ -80,17 +80,17 @@ extension NSKeyedUnarchiver { } protocol NSKeyedArchiverDelegate : NSObjectProtocol { optional func archiver(_ archiver: NSKeyedArchiver, willEncode object: Any) -> Any? - optional func archiver(_ archiver: NSKeyedArchiver, didEncode object: Any?) + @asyncHandler optional func archiver(_ archiver: NSKeyedArchiver, didEncode object: Any?) optional func archiver(_ archiver: NSKeyedArchiver, willReplace object: Any?, with newObject: Any?) optional func archiverWillFinish(_ archiver: NSKeyedArchiver) - optional func archiverDidFinish(_ archiver: NSKeyedArchiver) + @asyncHandler optional func archiverDidFinish(_ archiver: NSKeyedArchiver) } protocol NSKeyedUnarchiverDelegate : NSObjectProtocol { optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, cannotDecodeObjectOfClassName name: String, originalClasses classNames: [String]) -> AnyClass? optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, didDecode object: Any?) -> Any? optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, willReplace object: Any, with newObject: Any) optional func unarchiverWillFinish(_ unarchiver: NSKeyedUnarchiver) - optional func unarchiverDidFinish(_ unarchiver: NSKeyedUnarchiver) + @asyncHandler optional func unarchiverDidFinish(_ unarchiver: NSKeyedUnarchiver) } extension NSObject { var classForKeyedArchiver: AnyClass? { get } diff --git a/watchOS/Foundation/NSURLCache.swift b/watchOS/Foundation/NSURLCache.swift index 542e2e5..8e70caf 100644 --- a/watchOS/Foundation/NSURLCache.swift +++ b/watchOS/Foundation/NSURLCache.swift @@ -46,5 +46,7 @@ extension URLCache { @available(watchOS 2.0, *) func getCachedResponse(for dataTask: URLSessionDataTask, completionHandler: @escaping (CachedURLResponse?) -> Void) @available(watchOS 2.0, *) + func getCachedResponse(for dataTask: URLSessionDataTask) async -> CachedURLResponse? + @available(watchOS 2.0, *) func removeCachedResponse(for dataTask: URLSessionDataTask) } diff --git a/watchOS/Foundation/NSURLConnection.swift b/watchOS/Foundation/NSURLConnection.swift index 3c395f4..0e0d28c 100644 --- a/watchOS/Foundation/NSURLConnection.swift +++ b/watchOS/Foundation/NSURLConnection.swift @@ -18,31 +18,31 @@ class NSURLConnection : NSObject { } @available(watchOS 2.0, *) protocol NSURLConnectionDelegate : NSObjectProtocol { - optional func connection(_ connection: NSURLConnection, didFailWithError error: Error) + @asyncHandler optional func connection(_ connection: NSURLConnection, didFailWithError error: Error) optional func connectionShouldUseCredentialStorage(_ connection: NSURLConnection) -> Bool optional func connection(_ connection: NSURLConnection, willSendRequestFor challenge: URLAuthenticationChallenge) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") optional func connection(_ connection: NSURLConnection, canAuthenticateAgainstProtectionSpace protectionSpace: URLProtectionSpace) -> Bool @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") - optional func connection(_ connection: NSURLConnection, didReceive challenge: URLAuthenticationChallenge) + @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive challenge: URLAuthenticationChallenge) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") - optional func connection(_ connection: NSURLConnection, didCancel challenge: URLAuthenticationChallenge) + @asyncHandler optional func connection(_ connection: NSURLConnection, didCancel challenge: URLAuthenticationChallenge) } @available(watchOS 2.0, *) protocol NSURLConnectionDataDelegate : NSURLConnectionDelegate { optional func connection(_ connection: NSURLConnection, willSend request: URLRequest, redirectResponse response: URLResponse?) -> URLRequest? - optional func connection(_ connection: NSURLConnection, didReceive response: URLResponse) - optional func connection(_ connection: NSURLConnection, didReceive data: Data) + @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive response: URLResponse) + @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive data: Data) optional func connection(_ connection: NSURLConnection, needNewBodyStream request: URLRequest) -> InputStream? - optional func connection(_ connection: NSURLConnection, didSendBodyData bytesWritten: Int, totalBytesWritten: Int, totalBytesExpectedToWrite: Int) + @asyncHandler optional func connection(_ connection: NSURLConnection, didSendBodyData bytesWritten: Int, totalBytesWritten: Int, totalBytesExpectedToWrite: Int) optional func connection(_ connection: NSURLConnection, willCacheResponse cachedResponse: CachedURLResponse) -> CachedURLResponse? - optional func connectionDidFinishLoading(_ connection: NSURLConnection) + @asyncHandler optional func connectionDidFinishLoading(_ connection: NSURLConnection) } @available(watchOS 2.0, *) protocol NSURLConnectionDownloadDelegate : NSURLConnectionDelegate { - optional func connection(_ connection: NSURLConnection, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, expectedTotalBytes: Int64) - optional func connectionDidResumeDownloading(_ connection: NSURLConnection, totalBytesWritten: Int64, expectedTotalBytes: Int64) - func connectionDidFinishDownloading(_ connection: NSURLConnection, destinationURL: URL) + @asyncHandler optional func connection(_ connection: NSURLConnection, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, expectedTotalBytes: Int64) + @asyncHandler optional func connectionDidResumeDownloading(_ connection: NSURLConnection, totalBytesWritten: Int64, expectedTotalBytes: Int64) + @asyncHandler func connectionDidFinishDownloading(_ connection: NSURLConnection, destinationURL: URL) } extension NSURLConnection { } diff --git a/watchOS/Foundation/NSURLCredentialStorage.swift b/watchOS/Foundation/NSURLCredentialStorage.swift index a59b8db..38c6789 100644 --- a/watchOS/Foundation/NSURLCredentialStorage.swift +++ b/watchOS/Foundation/NSURLCredentialStorage.swift @@ -15,12 +15,16 @@ extension URLCredentialStorage { @available(watchOS 2.0, *) func getCredentials(for protectionSpace: URLProtectionSpace, task: URLSessionTask, completionHandler: @escaping ([String : URLCredential]?) -> Void) @available(watchOS 2.0, *) + func getCredentials(for protectionSpace: URLProtectionSpace, task: URLSessionTask) async -> [String : URLCredential]? + @available(watchOS 2.0, *) func set(_ credential: URLCredential, for protectionSpace: URLProtectionSpace, task: URLSessionTask) @available(watchOS 2.0, *) func remove(_ credential: URLCredential, for protectionSpace: URLProtectionSpace, options: [String : Any]? = nil, task: URLSessionTask) @available(watchOS 2.0, *) func getDefaultCredential(for space: URLProtectionSpace, task: URLSessionTask, completionHandler: @escaping (URLCredential?) -> Void) @available(watchOS 2.0, *) + func getDefaultCredential(for space: URLProtectionSpace, task: URLSessionTask) async -> URLCredential? + @available(watchOS 2.0, *) func setDefaultCredential(_ credential: URLCredential, for protectionSpace: URLProtectionSpace, task: URLSessionTask) } extension NSNotification.Name { diff --git a/watchOS/Foundation/NSURLProtocol.swift b/watchOS/Foundation/NSURLProtocol.swift index 90e7fbc..3def2f6 100644 --- a/watchOS/Foundation/NSURLProtocol.swift +++ b/watchOS/Foundation/NSURLProtocol.swift @@ -3,12 +3,12 @@ protocol URLProtocolClient : NSObjectProtocol { func urlProtocol(_ protocol: URLProtocol, wasRedirectedTo request: URLRequest, redirectResponse: URLResponse) func urlProtocol(_ protocol: URLProtocol, cachedResponseIsValid cachedResponse: CachedURLResponse) - func urlProtocol(_ protocol: URLProtocol, didReceive response: URLResponse, cacheStoragePolicy policy: URLCache.StoragePolicy) - func urlProtocol(_ protocol: URLProtocol, didLoad data: Data) - func urlProtocolDidFinishLoading(_ protocol: URLProtocol) - func urlProtocol(_ protocol: URLProtocol, didFailWithError error: Error) - func urlProtocol(_ protocol: URLProtocol, didReceive challenge: URLAuthenticationChallenge) - func urlProtocol(_ protocol: URLProtocol, didCancel challenge: URLAuthenticationChallenge) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didReceive response: URLResponse, cacheStoragePolicy policy: URLCache.StoragePolicy) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didLoad data: Data) + @asyncHandler func urlProtocolDidFinishLoading(_ protocol: URLProtocol) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didFailWithError error: Error) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didReceive challenge: URLAuthenticationChallenge) + @asyncHandler func urlProtocol(_ protocol: URLProtocol, didCancel challenge: URLAuthenticationChallenge) } @available(watchOS 2.0, *) class URLProtocol : NSObject { diff --git a/watchOS/Foundation/NSURLSession.swift b/watchOS/Foundation/NSURLSession.swift index 1439dde..4ce69ce 100644 --- a/watchOS/Foundation/NSURLSession.swift +++ b/watchOS/Foundation/NSURLSession.swift @@ -13,10 +13,15 @@ class URLSession : NSObject { func finishTasksAndInvalidate() func invalidateAndCancel() func reset(completionHandler: @escaping () -> Void) + func reset() async func flush(completionHandler: @escaping () -> Void) + func flush() async func getTasksWithCompletionHandler(_ completionHandler: @escaping ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) -> Void) + func getTasks() async -> ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) @available(watchOS 2.0, *) func getAllTasks(completionHandler: @escaping ([URLSessionTask]) -> Void) + @available(watchOS 2.0, *) + func getAllTasks() async -> [URLSessionTask] func dataTask(with request: URLRequest) -> URLSessionDataTask func dataTask(with url: URL) -> URLSessionDataTask func uploadTask(with request: URLRequest, fromFile fileURL: URL) -> URLSessionUploadTask @@ -117,11 +122,14 @@ class URLSessionUploadTask : URLSessionDataTask { @available(watchOS 2.0, *) class URLSessionDownloadTask : URLSessionTask { func cancel(byProducingResumeData completionHandler: @escaping (Data?) -> Void) + func cancelByProducingResumeData() async -> Data? } @available(watchOS 2.0, *) class URLSessionStreamTask : URLSessionTask { func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval, completionHandler: @escaping (Data?, Bool, Error?) -> Void) + func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval) async throws -> (Data?, Bool) func write(_ data: Data, timeout: TimeInterval, completionHandler: @escaping (Error?) -> Void) + func write(_ data: Data, timeout: TimeInterval) async throws func captureStreams() func closeWrite() func closeRead() @@ -167,7 +175,9 @@ extension URLSessionWebSocketTask { @available(watchOS 6.0, *) class URLSessionWebSocketTask : URLSessionTask { func __send(_ message: __NSURLSessionWebSocketMessage, completionHandler: @escaping (Error?) -> Void) + func __send(_ message: __NSURLSessionWebSocketMessage) async throws func __receiveMessage(completionHandler: @escaping (__NSURLSessionWebSocketMessage?, Error?) -> Void) + func __receiveMessage() async throws -> __NSURLSessionWebSocketMessage? func sendPing(pongReceiveHandler: @escaping (Error?) -> Void) func cancel(with closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) var maximumMessageSize: Int @@ -262,51 +272,59 @@ extension URLSession { } @available(watchOS 2.0, *) protocol URLSessionDelegate : NSObjectProtocol { - optional func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) - optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + @asyncHandler optional func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) + @asyncHandler optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) @available(watchOS 2.0, *) - optional func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) + @asyncHandler optional func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) } @available(watchOS 2.0, *) protocol URLSessionTaskDelegate : URLSessionDelegate { @available(watchOS 4.0, *) optional func urlSession(_ session: URLSession, task: URLSessionTask, willBeginDelayedRequest request: URLRequest, completionHandler: @escaping (URLSession.DelayedRequestDisposition, URLRequest?) -> Void) @available(watchOS 4.0, *) + optional func urlSession(_ session: URLSession, task: URLSessionTask, willBeginDelayedRequest request: URLRequest) async -> (URLSession.DelayedRequestDisposition, URLRequest?) + @available(watchOS 4.0, *) optional func urlSession(_ session: URLSession, taskIsWaitingForConnectivity task: URLSessionTask) optional func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest, completionHandler: @escaping (URLRequest?) -> Void) - optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest) async -> URLRequest? + @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) optional func urlSession(_ session: URLSession, task: URLSessionTask, needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) - optional func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) + optional func urlSession(_ session: URLSession, task: URLSessionTask) async -> InputStream? + @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) @available(watchOS 3.0, *) - optional func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) - optional func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) + @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) + @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) } @available(watchOS 2.0, *) protocol URLSessionDataDelegate : URLSessionTaskDelegate { - optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) - optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome downloadTask: URLSessionDownloadTask) + @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse) async -> URLSession.ResponseDisposition + @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome downloadTask: URLSessionDownloadTask) @available(watchOS 2.0, *) - optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome streamTask: URLSessionStreamTask) - optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) + @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome streamTask: URLSessionStreamTask) + @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse, completionHandler: @escaping (CachedURLResponse?) -> Void) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse) async -> CachedURLResponse? } @available(watchOS 2.0, *) protocol URLSessionDownloadDelegate : URLSessionTaskDelegate { - func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) - optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) - optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) + @asyncHandler func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) + @asyncHandler optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) + @asyncHandler optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) } @available(watchOS 2.0, *) protocol URLSessionStreamDelegate : URLSessionTaskDelegate { optional func urlSession(_ session: URLSession, readClosedFor streamTask: URLSessionStreamTask) optional func urlSession(_ session: URLSession, writeClosedFor streamTask: URLSessionStreamTask) optional func urlSession(_ session: URLSession, betterRouteDiscoveredFor streamTask: URLSessionStreamTask) - optional func urlSession(_ session: URLSession, streamTask: URLSessionStreamTask, didBecome inputStream: InputStream, outputStream: OutputStream) + @asyncHandler optional func urlSession(_ session: URLSession, streamTask: URLSessionStreamTask, didBecome inputStream: InputStream, outputStream: OutputStream) } @available(watchOS 6.0, *) protocol URLSessionWebSocketDelegate : URLSessionTaskDelegate { - optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) - optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) + @asyncHandler optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) + @asyncHandler optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) } @available(watchOS 2.0, *) let NSURLSessionDownloadTaskResumeData: String diff --git a/watchOS/Foundation/NSUserActivity.swift b/watchOS/Foundation/NSUserActivity.swift index a65ca72..9f548a0 100644 --- a/watchOS/Foundation/NSUserActivity.swift +++ b/watchOS/Foundation/NSUserActivity.swift @@ -26,6 +26,7 @@ class NSUserActivity : NSObject { func resignCurrent() func invalidate() func getContinuationStreams(completionHandler: @escaping (InputStream?, OutputStream?, Error?) -> Void) + func getContinuationStreams() async throws -> (InputStream?, OutputStream?) @available(watchOS 3.0, *) var isEligibleForHandoff: Bool @available(watchOS 3.0, *) @@ -39,12 +40,16 @@ class NSUserActivity : NSObject { @available(watchOS 5.0, *) class func deleteSavedUserActivities(withPersistentIdentifiers persistentIdentifiers: [NSUserActivityPersistentIdentifier], completionHandler handler: @escaping () -> Void) @available(watchOS 5.0, *) + class func deleteSavedUserActivities(withPersistentIdentifiers persistentIdentifiers: [NSUserActivityPersistentIdentifier]) async + @available(watchOS 5.0, *) class func deleteAllSavedUserActivities(completionHandler handler: @escaping () -> Void) + @available(watchOS 5.0, *) + class func deleteAllSavedUserActivities() async } let NSUserActivityTypeBrowsingWeb: String @available(watchOS 3.0, *) protocol NSUserActivityDelegate : NSObjectProtocol { optional func userActivityWillSave(_ userActivity: NSUserActivity) optional func userActivityWasContinued(_ userActivity: NSUserActivity) - optional func userActivity(_ userActivity: NSUserActivity, didReceive inputStream: InputStream, outputStream: OutputStream) + @asyncHandler optional func userActivity(_ userActivity: NSUserActivity, didReceive inputStream: InputStream, outputStream: OutputStream) } diff --git a/watchOS/Foundation/NSXMLParser.swift b/watchOS/Foundation/NSXMLParser.swift index cff8f83..c4dfafa 100644 --- a/watchOS/Foundation/NSXMLParser.swift +++ b/watchOS/Foundation/NSXMLParser.swift @@ -23,18 +23,18 @@ extension XMLParser { var columnNumber: Int { get } } protocol XMLParserDelegate : NSObjectProtocol { - optional func parserDidStartDocument(_ parser: XMLParser) - optional func parserDidEndDocument(_ parser: XMLParser) + @asyncHandler optional func parserDidStartDocument(_ parser: XMLParser) + @asyncHandler optional func parserDidEndDocument(_ parser: XMLParser) optional func parser(_ parser: XMLParser, foundNotationDeclarationWithName name: String, publicID: String?, systemID: String?) optional func parser(_ parser: XMLParser, foundUnparsedEntityDeclarationWithName name: String, publicID: String?, systemID: String?, notationName: String?) optional func parser(_ parser: XMLParser, foundAttributeDeclarationWithName attributeName: String, forElement elementName: String, type: String?, defaultValue: String?) optional func parser(_ parser: XMLParser, foundElementDeclarationWithName elementName: String, model: String) optional func parser(_ parser: XMLParser, foundInternalEntityDeclarationWithName name: String, value: String?) optional func parser(_ parser: XMLParser, foundExternalEntityDeclarationWithName name: String, publicID: String?, systemID: String?) - optional func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) - optional func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) - optional func parser(_ parser: XMLParser, didStartMappingPrefix prefix: String, toURI namespaceURI: String) - optional func parser(_ parser: XMLParser, didEndMappingPrefix prefix: String) + @asyncHandler optional func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) + @asyncHandler optional func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) + @asyncHandler optional func parser(_ parser: XMLParser, didStartMappingPrefix prefix: String, toURI namespaceURI: String) + @asyncHandler optional func parser(_ parser: XMLParser, didEndMappingPrefix prefix: String) optional func parser(_ parser: XMLParser, foundCharacters string: String) optional func parser(_ parser: XMLParser, foundIgnorableWhitespace whitespaceString: String) optional func parser(_ parser: XMLParser, foundProcessingInstructionWithTarget target: String, data: String?) diff --git a/watchOS/GameKit/GKAchievement.swift b/watchOS/GameKit/GKAchievement.swift index b844f9f..74df9b6 100644 --- a/watchOS/GameKit/GKAchievement.swift +++ b/watchOS/GameKit/GKAchievement.swift @@ -2,12 +2,16 @@ @available(watchOS 3.0, *) class GKAchievement : NSObject, NSCoding, NSSecureCoding { class func loadAchievements(completionHandler: (([GKAchievement]?, Error?) -> Void)? = nil) + class func loadAchievements() async throws -> [GKAchievement]? class func resetAchievements(completionHandler: ((Error?) -> Void)? = nil) + class func resetAchievements() async throws init(identifier: String) @available(watchOS 2.0, *) init(identifier: String, player: GKPlayer) @available(watchOS 2.0, *) class func report(_ achievements: [GKAchievement], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + @available(watchOS 2.0, *) + class func report(_ achievements: [GKAchievement]) async throws var identifier: String var percentComplete: Double var isCompleted: Bool { get } @@ -20,6 +24,8 @@ class GKAchievement : NSObject, NSCoding, NSSecureCoding { extension GKAchievement { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use +reportAchievements:withCompletionHandler:") func report(completionHandler: ((Error?) -> Void)? = nil) + @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use +reportAchievements:withCompletionHandler:") + func report() async throws @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use isHidden on the GKAchievementDescription class instead") var isHidden: Bool { get } } diff --git a/watchOS/GameKit/GKAchievementDescription.swift b/watchOS/GameKit/GKAchievementDescription.swift index 7c98756..649f041 100644 --- a/watchOS/GameKit/GKAchievementDescription.swift +++ b/watchOS/GameKit/GKAchievementDescription.swift @@ -2,6 +2,7 @@ @available(watchOS 3.0, *) class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { class func loadAchievementDescriptions(completionHandler: (([GKAchievementDescription]?, Error?) -> Void)? = nil) + class func loadAchievementDescriptions() async throws -> [GKAchievementDescription]? var identifier: String { get } @available(watchOS 2.0, *) var groupIdentifier: String? { get } diff --git a/watchOS/GameKit/GKLeaderboard.swift b/watchOS/GameKit/GKLeaderboard.swift index 745ed9b..12cdd2d 100644 --- a/watchOS/GameKit/GKLeaderboard.swift +++ b/watchOS/GameKit/GKLeaderboard.swift @@ -39,15 +39,27 @@ class GKLeaderboard : NSObject { @available(watchOS 7.0, *) class func loadLeaderboards(IDs leaderboardIDs: [String]?, completionHandler: @escaping ([GKLeaderboard]?, Error?) -> Void) @available(watchOS 7.0, *) + class func loadLeaderboards(IDs leaderboardIDs: [String]?) async throws -> [GKLeaderboard]? + @available(watchOS 7.0, *) func loadPreviousOccurrence(completionHandler: @escaping (GKLeaderboard?, Error?) -> Void) @available(watchOS 7.0, *) + func loadPreviousOccurrence() async throws -> GKLeaderboard? + @available(watchOS 7.0, *) class func submitScore(_ score: Int, context: Int, player: GKPlayer, leaderboardIDs: [String], completionHandler: @escaping (Error?) -> Void) @available(watchOS 7.0, *) + class func submitScore(_ score: Int, context: Int, player: GKPlayer, leaderboardIDs: [String]) async throws + @available(watchOS 7.0, *) func submitScore(_ score: Int, context: Int, player: GKPlayer, completionHandler: @escaping (Error?) -> Void) @available(watchOS 7.0, *) + func submitScore(_ score: Int, context: Int, player: GKPlayer) async throws + @available(watchOS 7.0, *) func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange, completionHandler: @escaping (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Int, Error?) -> Void) @available(watchOS 7.0, *) + func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange) async throws -> (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Int) + @available(watchOS 7.0, *) func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope, completionHandler: @escaping (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Error?) -> Void) + @available(watchOS 7.0, *) + func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope) async throws -> (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?) } extension GKLeaderboard { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use identifier instead") @@ -56,8 +68,12 @@ extension GKLeaderboard { init?(playerIDs: [String]?) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use loadLeaderboardsWithIDs:completionHandler: instead") class func loadCategories(completionHandler: (([String]?, [String]?, Error?) -> Void)? = nil) + @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use loadLeaderboardsWithIDs:completionHandler: instead") + class func loadCategories() async throws -> ([String]?, [String]?) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use setDefaultLeaderboardIdentifier:completionHandler: on GKLocalPlayer instead") class func setDefault(_ leaderboardIdentifier: String?, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use setDefaultLeaderboardIdentifier:completionHandler: on GKLocalPlayer instead") + class func setDefault(_ leaderboardIdentifier: String?) async throws @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler: instead.") var timeScope: GKLeaderboard.TimeScope @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler: instead.") @@ -78,6 +94,10 @@ extension GKLeaderboard { init(players: [GKPlayer]) @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") func loadScores(completionHandler: (([GKScore]?, Error?) -> Void)? = nil) + @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") + func loadScores() async throws -> [GKScore]? @available(watchOS, introduced: 2.0, deprecated: 7.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") class func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) + @available(watchOS, introduced: 2.0, deprecated: 7.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") + class func loadLeaderboards() async throws -> [GKLeaderboard]? } diff --git a/watchOS/GameKit/GKLeaderboardSet.swift b/watchOS/GameKit/GKLeaderboardSet.swift index 240dda3..9cb42e8 100644 --- a/watchOS/GameKit/GKLeaderboardSet.swift +++ b/watchOS/GameKit/GKLeaderboardSet.swift @@ -6,10 +6,14 @@ class GKLeaderboardSet : NSObject, NSCoding, NSSecureCoding { var identifier: String? @available(watchOS 2.0, *) class func loadLeaderboardSets(completionHandler: (([GKLeaderboardSet]?, Error?) -> Void)? = nil) + @available(watchOS 2.0, *) + class func loadLeaderboardSets() async throws -> [GKLeaderboardSet]? @available(watchOS 7.0, *) func loadLeaderboards(handler: @escaping ([GKLeaderboard]?, Error?) -> Void) } extension GKLeaderboardSet { @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadLeaderboardsWithHandler: instead.") func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) + @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadLeaderboardsWithHandler: instead.") + func loadLeaderboards() async throws -> [GKLeaderboard]? } diff --git a/watchOS/GameKit/GKLocalPlayer.swift b/watchOS/GameKit/GKLocalPlayer.swift index bf9d0f2..1b2b737 100644 --- a/watchOS/GameKit/GKLocalPlayer.swift +++ b/watchOS/GameKit/GKLocalPlayer.swift @@ -8,13 +8,22 @@ class GKLocalPlayer : GKPlayer { var authenticateHandler: ((Error?) -> Void)? @available(watchOS 3.0, *) func loadRecentPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + @available(watchOS 3.0, *) + func loadRecentPlayers() async throws -> [GKPlayer]? func loadChallengableFriends(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + func loadChallengableFriends() async throws -> [GKPlayer]? @available(watchOS 3.0, *) func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) + func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String) async throws + @available(watchOS 3.0, *) func loadDefaultLeaderboardIdentifier(completionHandler: ((String?, Error?) -> Void)? = nil) + @available(watchOS 3.0, *) + func loadDefaultLeaderboardIdentifier() async throws -> String? @available(watchOS 6.5, *) func fetchItems(forIdentityVerificationSignature completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) + @available(watchOS 6.5, *) + func fetchItemsForIdentityVerificationSignature() async throws -> (URL?, Data?, Data?, UInt64) } protocol GKLocalPlayerListener : GKChallengeListener, GKInviteEventListener, GKTurnBasedEventListener { } @@ -33,18 +42,30 @@ extension NSNotification.Name { extension GKLocalPlayer { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use setDefaultLeaderboardIdentifier:completionHandler: instead") func setDefaultLeaderboardCategoryID(_ categoryID: String?, completionHandler: ((Error?) -> Void)? = nil) + @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use setDefaultLeaderboardIdentifier:completionHandler: instead") + func setDefaultLeaderboardCategoryID(_ categoryID: String?) async throws @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use loadDefaultLeaderboardIdentifierWithCompletionHandler: instead") func loadDefaultLeaderboardCategoryID(completionHandler: ((String?, Error?) -> Void)? = nil) + @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use loadDefaultLeaderboardIdentifierWithCompletionHandler: instead") + func loadDefaultLeaderboardCategoryID() async throws -> String? @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Set the authenticateHandler instead") func authenticate(completionHandler: ((Error?) -> Void)? = nil) + @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Set the authenticateHandler instead") + func authenticate() async throws @available(watchOS, introduced: 2.0, deprecated: 3.0) func loadFriendPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + @available(watchOS, introduced: 2.0, deprecated: 3.0) + func loadFriendPlayers() async throws -> [GKPlayer]? @available(watchOS, introduced: 3.0, deprecated: 6.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") func generateIdentityVerificationSignature(completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) + @available(watchOS, introduced: 3.0, deprecated: 6.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") + func generateIdentityVerificationSignature() async throws -> (URL?, Data?, Data?, UInt64) } extension GKLocalPlayer { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") func loadFriends(completionHandler: (([String]?, Error?) -> Void)? = nil) + @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") + func loadFriends() async throws -> [String]? @available(watchOS, introduced: 2.0, deprecated: 2.0, message: " This property is obsolete, Use loadFriendPlayersWithCompletionHandler: instead") var friends: [String]? { get } } diff --git a/watchOS/GameKit/GKMatch.swift b/watchOS/GameKit/GKMatch.swift index 6505a2d..ad04ffd 100644 --- a/watchOS/GameKit/GKMatch.swift +++ b/watchOS/GameKit/GKMatch.swift @@ -17,6 +17,8 @@ enum GKPlayerConnectionState : Int { extension GKMatch { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use chooseBestHostingPlayerWithCompletionHandler:") func chooseBestHostPlayer(completionHandler: @escaping (String?) -> Void) + @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use chooseBestHostingPlayerWithCompletionHandler:") + func chooseBestHostPlayer() async -> String? @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use sendData:toPlayers:dataMode:error:") func send(_ data: Data, toPlayers playerIDs: [String], with mode: GKMatch.SendDataMode) throws @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use players instead.") diff --git a/watchOS/GameKit/GKMatchmaker.swift b/watchOS/GameKit/GKMatchmaker.swift index b8a2061..4f04d01 100644 --- a/watchOS/GameKit/GKMatchmaker.swift +++ b/watchOS/GameKit/GKMatchmaker.swift @@ -48,7 +48,7 @@ enum GKMatchType : UInt { } protocol GKInviteEventListener { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This method is obsolete. It will never be invoked its implementation does nothing, use player:didRequestMatchWithRecipients:") - optional func player(_ player: GKPlayer, didRequestMatchWithPlayers playerIDsToInvite: [String]) + @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithPlayers playerIDsToInvite: [String]) } extension GKMatchmaker { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use registerListener on GKLocalPlayer to register an object that implements the GKInviteEventListenerProtocol instead") @@ -61,4 +61,6 @@ extension GKMatchmaker { func cancelInvite(toPlayer playerID: String) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") func findPlayers(forHostedMatchRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) + @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") + func findPlayers(forHostedMatchRequest request: GKMatchRequest) async throws -> [String]? } diff --git a/watchOS/GameKit/GKPlayer.swift b/watchOS/GameKit/GKPlayer.swift index 2bd1a74..817be76 100644 --- a/watchOS/GameKit/GKPlayer.swift +++ b/watchOS/GameKit/GKPlayer.swift @@ -2,6 +2,7 @@ @available(watchOS 3.0, *) class GKPlayer : GKBasePlayer { class func loadPlayers(forIdentifiers identifiers: [String], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) + class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer]? var alias: String { get } } extension NSNotification.Name { diff --git a/watchOS/GameKit/GKPublicProtocols.swift b/watchOS/GameKit/GKPublicProtocols.swift index 53bf283..82b37fd 100644 --- a/watchOS/GameKit/GKPublicProtocols.swift +++ b/watchOS/GameKit/GKPublicProtocols.swift @@ -1,18 +1,18 @@ @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use MCSession in association with MCSessionDelegate from the MultipeerConnectivity framework instead") protocol GKSessionDelegate : NSObjectProtocol { - optional func session(_ session: GKSession, peer peerID: String, didChange state: GKPeerConnectionState) - optional func session(_ session: GKSession, didReceiveConnectionRequestFromPeer peerID: String) + @asyncHandler optional func session(_ session: GKSession, peer peerID: String, didChange state: GKPeerConnectionState) + @asyncHandler optional func session(_ session: GKSession, didReceiveConnectionRequestFromPeer peerID: String) optional func session(_ session: GKSession, connectionWithPeerFailed peerID: String, withError error: Error) - optional func session(_ session: GKSession, didFailWithError error: Error) + @asyncHandler optional func session(_ session: GKSession, didFailWithError error: Error) } @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use GKVoiceChat instead") protocol GKVoiceChatClient : NSObjectProtocol { func voiceChatService(_ voiceChatService: GKVoiceChatService, send data: Data, toParticipantID participantID: String) func participantID() -> String optional func voiceChatService(_ voiceChatService: GKVoiceChatService, sendRealTime data: Data, toParticipantID participantID: String) - optional func voiceChatService(_ voiceChatService: GKVoiceChatService, didStartWithParticipantID participantID: String) - optional func voiceChatService(_ voiceChatService: GKVoiceChatService, didNotStartWithParticipantID participantID: String, error: Error?) - optional func voiceChatService(_ voiceChatService: GKVoiceChatService, didStopWithParticipantID participantID: String, error: Error?) - optional func voiceChatService(_ voiceChatService: GKVoiceChatService, didReceiveInvitationFromParticipantID participantID: String, callID: Int) + @asyncHandler optional func voiceChatService(_ voiceChatService: GKVoiceChatService, didStartWithParticipantID participantID: String) + @asyncHandler optional func voiceChatService(_ voiceChatService: GKVoiceChatService, didNotStartWithParticipantID participantID: String, error: Error?) + @asyncHandler optional func voiceChatService(_ voiceChatService: GKVoiceChatService, didStopWithParticipantID participantID: String, error: Error?) + @asyncHandler optional func voiceChatService(_ voiceChatService: GKVoiceChatService, didReceiveInvitationFromParticipantID participantID: String, callID: Int) } diff --git a/watchOS/GameKit/GKScore.swift b/watchOS/GameKit/GKScore.swift index f62b43c..2bf6c6c 100644 --- a/watchOS/GameKit/GKScore.swift +++ b/watchOS/GameKit/GKScore.swift @@ -18,10 +18,14 @@ class GKScore : NSObject, NSCoding, NSSecureCoding { var shouldSetDefaultLeaderboard: Bool @available(watchOS 3.0, *) class func report(_ scores: [GKScore], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + @available(watchOS 3.0, *) + class func report(_ scores: [GKScore]) async throws } extension GKScore { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use +reportScores:withCompletionhandler: instead") func report(completionHandler: ((Error?) -> Void)? = nil) + @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use +reportScores:withCompletionhandler: instead") + func report() async throws @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use initWithLeaderboardIdentifier: instead") init(category: String?) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use leaderboardIdentifier instead") diff --git a/watchOS/GameKit/GKTurnBasedMatch.swift b/watchOS/GameKit/GKTurnBasedMatch.swift index bb8ffee..7a1454c 100644 --- a/watchOS/GameKit/GKTurnBasedMatch.swift +++ b/watchOS/GameKit/GKTurnBasedMatch.swift @@ -52,7 +52,7 @@ extension GKTurnBasedParticipant { } protocol GKTurnBasedEventListener { @available(watchOS 3.0, *) - optional func player(_ player: GKPlayer, receivedTurnEventFor match: GKTurnBasedMatch, didBecomeActive: Bool) + @asyncHandler optional func player(_ player: GKPlayer, receivedTurnEventFor match: GKTurnBasedMatch, didBecomeActive: Bool) @available(watchOS 3.0, *) optional func player(_ player: GKPlayer, matchEnded match: GKTurnBasedMatch) @available(watchOS 3.0, *) @@ -64,7 +64,7 @@ protocol GKTurnBasedEventListener { @available(watchOS 3.0, *) optional func player(_ player: GKPlayer, wantsToQuitMatch match: GKTurnBasedMatch) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "use didRequestMatchWithOtherPlayers") - optional func player(_ player: GKPlayer, didRequestMatchWithPlayers playerIDsToInvite: [String]) + @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithPlayers playerIDsToInvite: [String]) } @available(watchOS 3.0, *) var GKTurnTimeoutDefault: TimeInterval @@ -94,39 +94,73 @@ class GKTurnBasedMatch : NSObject { @available(watchOS 3.0, *) var exchangeMaxInitiatedExchangesPerPlayer: Int { get } class func find(for request: GKMatchRequest, withCompletionHandler completionHandler: @escaping (GKTurnBasedMatch?, Error?) -> Void) + class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch? class func loadMatches(completionHandler: (([GKTurnBasedMatch]?, Error?) -> Void)? = nil) + class func loadMatches() async throws -> [GKTurnBasedMatch]? @available(watchOS 3.0, *) class func load(withID matchID: String, withCompletionHandler completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) + class func load(withID matchID: String) async throws -> GKTurnBasedMatch? + @available(watchOS 3.0, *) func rematch(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) + func rematch() async throws -> GKTurnBasedMatch? + @available(watchOS 3.0, *) func acceptInvite(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) + func acceptInvite() async throws -> GKTurnBasedMatch? + @available(watchOS 3.0, *) func declineInvite(completionHandler: ((Error?) -> Void)? = nil) + @available(watchOS 3.0, *) + func declineInvite() async throws func remove(completionHandler: ((Error?) -> Void)? = nil) + func remove() async throws func loadMatchData(completionHandler: ((Data?, Error?) -> Void)? = nil) + func loadMatchData() async throws -> Data? @available(watchOS 3.0, *) func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) + func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + @available(watchOS 3.0, *) func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) + @available(watchOS 3.0, *) + func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome) async throws func endMatchInTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) + func endMatchInTurn(withMatch matchData: Data) async throws @available(watchOS, introduced: 2.0, deprecated: 7.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?, completionHandler: ((Error?) -> Void)? = nil) + @available(watchOS, introduced: 2.0, deprecated: 7.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") + func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws @available(watchOS 7.0, *) func endMatchInTurn(withMatch matchData: Data, leaderboardScores scores: [GKLeaderboardScore], achievements: [Any], completionHandler: @escaping (Error?) -> Void) + @available(watchOS 7.0, *) + func endMatchInTurn(withMatch matchData: Data, leaderboardScores scores: [GKLeaderboardScore], achievements: [Any]) async throws @available(watchOS 3.0, *) func saveCurrentTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) + func saveCurrentTurn(withMatch matchData: Data) async throws + @available(watchOS 3.0, *) func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange], completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) + func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws + @available(watchOS 3.0, *) func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval, completionHandler: ((GKTurnBasedExchange?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) + func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange? + @available(watchOS 3.0, *) func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) + @available(watchOS 3.0, *) + func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use endTurnWithNextParticipants:... instead") func endTurn(withNextParticipant nextParticipant: GKTurnBasedParticipant, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) + @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use endTurnWithNextParticipants:... instead") + func endTurn(withNextParticipant nextParticipant: GKTurnBasedParticipant, match matchData: Data) async throws @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use participantQuitInTurnWithOutcome:nextParticipants:turnTimeout:... instead") func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipant: GKTurnBasedParticipant, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) + @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use participantQuitInTurnWithOutcome:nextParticipants:turnTimeout:... instead") + func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipant: GKTurnBasedParticipant, match matchData: Data) async throws } @available(watchOS 3.0, *) enum GKTurnBasedExchangeStatus : Int8 { @@ -157,7 +191,11 @@ class GKTurnBasedExchange : NSObject { @available(watchOS 3.0, *) func cancel(withLocalizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) + func cancel(withLocalizableMessageKey key: String, arguments: [String]) async throws + @available(watchOS 3.0, *) func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data, completionHandler: ((Error?) -> Void)? = nil) + @available(watchOS 3.0, *) + func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws } @available(watchOS 3.0, *) class GKTurnBasedExchangeReply : NSObject { @@ -172,7 +210,7 @@ protocol GKTurnBasedEventHandlerDelegate { @available(watchOS, introduced: 2.0, deprecated: 2.0) func handleInvite(fromGameCenter playersToInvite: [String]) @available(watchOS, introduced: 2.0, deprecated: 2.0) - func handleTurnEvent(for match: GKTurnBasedMatch, didBecomeActive: Bool) + @asyncHandler func handleTurnEvent(for match: GKTurnBasedMatch, didBecomeActive: Bool) @available(watchOS, introduced: 2.0, deprecated: 2.0) optional func handleTurnEvent(for match: GKTurnBasedMatch) @available(watchOS, introduced: 2.0, deprecated: 2.0) diff --git a/watchOS/HealthKit/HKHealthStore.swift b/watchOS/HealthKit/HKHealthStore.swift index b64de8e..bd81104 100644 --- a/watchOS/HealthKit/HKHealthStore.swift +++ b/watchOS/HealthKit/HKHealthStore.swift @@ -4,17 +4,27 @@ class HKHealthStore : NSObject { class func isHealthDataAvailable() -> Bool func authorizationStatus(for type: HKObjectType) -> HKAuthorizationStatus func requestAuthorization(toShare typesToShare: Set?, read typesToRead: Set?, completion: @escaping (Bool, Error?) -> Void) + func requestAuthorization(toShare typesToShare: Set?, read typesToRead: Set?) async throws -> Bool @available(watchOS 5.0, *) func getRequestStatusForAuthorization(toShare typesToShare: Set, read typesToRead: Set, completion: @escaping (HKAuthorizationRequestStatus, Error?) -> Void) + @available(watchOS 5.0, *) + func getRequestStatusForAuthorization(toShare typesToShare: Set, read typesToRead: Set) async throws -> HKAuthorizationRequestStatus @available(watchOS 2.0, *) func earliestPermittedSampleDate() -> Date func save(_ object: HKObject, withCompletion completion: @escaping (Bool, Error?) -> Void) + func save(_ object: HKObject) async throws -> Bool func save(_ objects: [HKObject], withCompletion completion: @escaping (Bool, Error?) -> Void) + func save(_ objects: [HKObject]) async throws -> Bool func delete(_ object: HKObject, withCompletion completion: @escaping (Bool, Error?) -> Void) + func delete(_ object: HKObject) async throws -> Bool @available(watchOS 2.0, *) func delete(_ objects: [HKObject], withCompletion completion: @escaping (Bool, Error?) -> Void) @available(watchOS 2.0, *) + func delete(_ objects: [HKObject]) async throws -> Bool + @available(watchOS 2.0, *) func deleteObjects(of objectType: HKObjectType, predicate: NSPredicate, withCompletion completion: @escaping (Bool, Int, Error?) -> Void) + @available(watchOS 2.0, *) + func deleteObjects(of objectType: HKObjectType, predicate: NSPredicate) async throws -> (Bool, Int) func execute(_ query: HKQuery) func stop(_ query: HKQuery) @available(watchOS, introduced: 2.0, deprecated: 4.0, message: "No longer supported") @@ -34,6 +44,7 @@ class HKHealthStore : NSObject { } extension HKHealthStore { func add(_ samples: [HKSample], to workout: HKWorkout, completion: @escaping (Bool, Error?) -> Void) + func add(_ samples: [HKSample], to workout: HKWorkout) async throws -> Bool @available(watchOS, introduced: 2.0, deprecated: 5.0, message: "Use HKWorkoutSession's start method") func start(_ workoutSession: HKWorkoutSession) @available(watchOS, introduced: 2.0, deprecated: 5.0, message: "Use HKWorkoutSession's end method") @@ -44,6 +55,8 @@ extension HKHealthStore { func resumeWorkoutSession(_ workoutSession: HKWorkoutSession) @available(watchOS 5.0, *) func recoverActiveWorkoutSession(completion: @escaping (HKWorkoutSession?, Error?) -> Void) + @available(watchOS 5.0, *) + func recoverActiveWorkoutSession() async throws -> HKWorkoutSession? } extension HKHealthStore { } @@ -54,4 +67,6 @@ extension NSNotification.Name { extension HKHealthStore { @available(watchOS 2.0, *) func preferredUnits(for quantityTypes: Set, completion: @escaping ([HKQuantityType : HKUnit], Error?) -> Void) + @available(watchOS 2.0, *) + func preferredUnits(for quantityTypes: Set) async throws -> [HKQuantityType : HKUnit] } diff --git a/watchOS/HealthKit/HKHeartbeatSeriesBuilder.swift b/watchOS/HealthKit/HKHeartbeatSeriesBuilder.swift index a7c123b..5f66eab 100644 --- a/watchOS/HealthKit/HKHeartbeatSeriesBuilder.swift +++ b/watchOS/HealthKit/HKHeartbeatSeriesBuilder.swift @@ -4,6 +4,9 @@ class HKHeartbeatSeriesBuilder : HKSeriesBuilder { class var maximumCount: Int { get } init(healthStore: HKHealthStore, device: HKDevice?, start startDate: Date) func addHeartbeatWithTimeInterval(sinceSeriesStartDate timeInterval: TimeInterval, precededByGap: Bool, completion: @escaping (Bool, Error?) -> Void) + func addHeartbeatWithTimeInterval(sinceSeriesStartDate timeInterval: TimeInterval, precededByGap: Bool) async throws -> Bool func addMetadata(_ metadata: [String : Any], completion: @escaping (Bool, Error?) -> Void) + func addMetadata(_ metadata: [String : Any]) async throws -> Bool func finishSeries(completion: @escaping (HKHeartbeatSeriesSample?, Error?) -> Void) + func finishSeries() async throws -> HKHeartbeatSeriesSample? } diff --git a/watchOS/HealthKit/HKLiveWorkoutBuilder.swift b/watchOS/HealthKit/HKLiveWorkoutBuilder.swift index 1a22b20..b3a548b 100644 --- a/watchOS/HealthKit/HKLiveWorkoutBuilder.swift +++ b/watchOS/HealthKit/HKLiveWorkoutBuilder.swift @@ -1,8 +1,8 @@ @available(watchOS 5.0, *) protocol HKLiveWorkoutBuilderDelegate : NSObjectProtocol { - func workoutBuilder(_ workoutBuilder: HKLiveWorkoutBuilder, didCollectDataOf collectedTypes: Set) - func workoutBuilderDidCollectEvent(_ workoutBuilder: HKLiveWorkoutBuilder) + @asyncHandler func workoutBuilder(_ workoutBuilder: HKLiveWorkoutBuilder, didCollectDataOf collectedTypes: Set) + @asyncHandler func workoutBuilderDidCollectEvent(_ workoutBuilder: HKLiveWorkoutBuilder) } @available(watchOS 5.0, *) class HKLiveWorkoutBuilder : HKWorkoutBuilder { diff --git a/watchOS/HealthKit/HKQuantitySeriesSampleBuilder.swift b/watchOS/HealthKit/HKQuantitySeriesSampleBuilder.swift index 73975ab..defc7a6 100644 --- a/watchOS/HealthKit/HKQuantitySeriesSampleBuilder.swift +++ b/watchOS/HealthKit/HKQuantitySeriesSampleBuilder.swift @@ -9,6 +9,8 @@ class HKQuantitySeriesSampleBuilder : NSObject { func insert(_ quantity: HKQuantity, for dateInterval: DateInterval) throws func insert(_ quantity: HKQuantity, at date: Date) throws func finishSeries(metadata: [String : Any]?, endDate: Date?, completion: @escaping ([HKQuantitySample]?, Error?) -> Void) + func finishSeries(metadata: [String : Any]?, endDate: Date?) async throws -> [HKQuantitySample]? func finishSeries(metadata: [String : Any]?, completion: @escaping ([HKQuantitySample]?, Error?) -> Void) + func finishSeries(metadata: [String : Any]?) async throws -> [HKQuantitySample]? func discard() } diff --git a/watchOS/HealthKit/HKWorkoutBuilder.swift b/watchOS/HealthKit/HKWorkoutBuilder.swift index b3eb1e1..c2bfb5a 100644 --- a/watchOS/HealthKit/HKWorkoutBuilder.swift +++ b/watchOS/HealthKit/HKWorkoutBuilder.swift @@ -9,11 +9,17 @@ class HKWorkoutBuilder : NSObject { var workoutEvents: [HKWorkoutEvent] { get } init(healthStore: HKHealthStore, configuration: HKWorkoutConfiguration, device: HKDevice?) func beginCollection(withStart startDate: Date, completion: @escaping (Bool, Error?) -> Void) + func beginCollection(withStart startDate: Date) async throws -> Bool func add(_ samples: [HKSample], completion: @escaping (Bool, Error?) -> Void) + func add(_ samples: [HKSample]) async throws -> Bool func addWorkoutEvents(_ workoutEvents: [HKWorkoutEvent], completion: @escaping (Bool, Error?) -> Void) + func addWorkoutEvents(_ workoutEvents: [HKWorkoutEvent]) async throws -> Bool func addMetadata(_ metadata: [String : Any], completion: @escaping (Bool, Error?) -> Void) + func addMetadata(_ metadata: [String : Any]) async throws -> Bool func endCollection(withEnd endDate: Date, completion: @escaping (Bool, Error?) -> Void) + func endCollection(withEnd endDate: Date) async throws -> Bool func finishWorkout(completion: @escaping (HKWorkout?, Error?) -> Void) + func finishWorkout() async throws -> HKWorkout? func discardWorkout() func elapsedTime(at date: Date) -> TimeInterval func statistics(for quantityType: HKQuantityType) -> HKStatistics? diff --git a/watchOS/HealthKit/HKWorkoutRouteBuilder.swift b/watchOS/HealthKit/HKWorkoutRouteBuilder.swift index 866940c..348b874 100644 --- a/watchOS/HealthKit/HKWorkoutRouteBuilder.swift +++ b/watchOS/HealthKit/HKWorkoutRouteBuilder.swift @@ -3,5 +3,7 @@ class HKWorkoutRouteBuilder : HKSeriesBuilder { init(healthStore: HKHealthStore, device: HKDevice?) func addMetadata(_ metadata: [String : Any], completion: @escaping (Bool, Error?) -> Void) + func addMetadata(_ metadata: [String : Any]) async throws -> Bool func finishRoute(with workout: HKWorkout, metadata: [String : Any]?, completion: @escaping (HKWorkoutRoute?, Error?) -> Void) + func finishRoute(with workout: HKWorkout, metadata: [String : Any]?) async throws -> HKWorkoutRoute? } diff --git a/watchOS/HealthKit/HKWorkoutSession.swift b/watchOS/HealthKit/HKWorkoutSession.swift index eb99727..1f5b0d3 100644 --- a/watchOS/HealthKit/HKWorkoutSession.swift +++ b/watchOS/HealthKit/HKWorkoutSession.swift @@ -48,8 +48,8 @@ class HKWorkoutSession : NSObject, NSSecureCoding { } @available(watchOS 2.0, *) protocol HKWorkoutSessionDelegate : NSObjectProtocol { - func workoutSession(_ workoutSession: HKWorkoutSession, didChangeTo toState: HKWorkoutSessionState, from fromState: HKWorkoutSessionState, date: Date) - func workoutSession(_ workoutSession: HKWorkoutSession, didFailWithError error: Error) + @asyncHandler func workoutSession(_ workoutSession: HKWorkoutSession, didChangeTo toState: HKWorkoutSessionState, from fromState: HKWorkoutSessionState, date: Date) + @asyncHandler func workoutSession(_ workoutSession: HKWorkoutSession, didFailWithError error: Error) @available(watchOS 3.0, *) - optional func workoutSession(_ workoutSession: HKWorkoutSession, didGenerate event: HKWorkoutEvent) + @asyncHandler optional func workoutSession(_ workoutSession: HKWorkoutSession, didGenerate event: HKWorkoutEvent) } diff --git a/watchOS/HomeKit/HMAccessory.swift b/watchOS/HomeKit/HMAccessory.swift index 3a93cc2..e34f6a9 100644 --- a/watchOS/HomeKit/HMAccessory.swift +++ b/watchOS/HomeKit/HMAccessory.swift @@ -25,19 +25,20 @@ class HMAccessory : NSObject { @available(watchOS 4.3, *) var supportsIdentify: Bool { get } func identify(completionHandler completion: @escaping (Error?) -> Void) + func identify() async throws } @available(watchOS 2.0, *) protocol HMAccessoryDelegate : NSObjectProtocol { - optional func accessoryDidUpdateName(_ accessory: HMAccessory) - optional func accessory(_ accessory: HMAccessory, didUpdateNameFor service: HMService) - optional func accessory(_ accessory: HMAccessory, didUpdateAssociatedServiceTypeFor service: HMService) - optional func accessoryDidUpdateServices(_ accessory: HMAccessory) + @asyncHandler optional func accessoryDidUpdateName(_ accessory: HMAccessory) + @asyncHandler optional func accessory(_ accessory: HMAccessory, didUpdateNameFor service: HMService) + @asyncHandler optional func accessory(_ accessory: HMAccessory, didUpdateAssociatedServiceTypeFor service: HMService) + @asyncHandler optional func accessoryDidUpdateServices(_ accessory: HMAccessory) @available(watchOS 4.0, *) - optional func accessory(_ accessory: HMAccessory, didAdd profile: HMAccessoryProfile) + @asyncHandler optional func accessory(_ accessory: HMAccessory, didAdd profile: HMAccessoryProfile) @available(watchOS 4.0, *) - optional func accessory(_ accessory: HMAccessory, didRemove profile: HMAccessoryProfile) - optional func accessoryDidUpdateReachability(_ accessory: HMAccessory) - optional func accessory(_ accessory: HMAccessory, service: HMService, didUpdateValueFor characteristic: HMCharacteristic) + @asyncHandler optional func accessory(_ accessory: HMAccessory, didRemove profile: HMAccessoryProfile) + @asyncHandler optional func accessoryDidUpdateReachability(_ accessory: HMAccessory) + @asyncHandler optional func accessory(_ accessory: HMAccessory, service: HMService, didUpdateValueFor characteristic: HMCharacteristic) @available(watchOS 4.0, *) - optional func accessory(_ accessory: HMAccessory, didUpdateFirmwareVersion firmwareVersion: String) + @asyncHandler optional func accessory(_ accessory: HMAccessory, didUpdateFirmwareVersion firmwareVersion: String) } diff --git a/watchOS/HomeKit/HMCameraSnapshotControl.swift b/watchOS/HomeKit/HMCameraSnapshotControl.swift index 0744f19..4e5eebd 100644 --- a/watchOS/HomeKit/HMCameraSnapshotControl.swift +++ b/watchOS/HomeKit/HMCameraSnapshotControl.swift @@ -7,6 +7,6 @@ class HMCameraSnapshotControl : HMCameraControl { } @available(watchOS 3.0, *) protocol HMCameraSnapshotControlDelegate : NSObjectProtocol { - optional func cameraSnapshotControl(_ cameraSnapshotControl: HMCameraSnapshotControl, didTake snapshot: HMCameraSnapshot?, error: Error?) - optional func cameraSnapshotControlDidUpdateMostRecentSnapshot(_ cameraSnapshotControl: HMCameraSnapshotControl) + @asyncHandler optional func cameraSnapshotControl(_ cameraSnapshotControl: HMCameraSnapshotControl, didTake snapshot: HMCameraSnapshot?, error: Error?) + @asyncHandler optional func cameraSnapshotControlDidUpdateMostRecentSnapshot(_ cameraSnapshotControl: HMCameraSnapshotControl) } diff --git a/watchOS/HomeKit/HMCameraStream.swift b/watchOS/HomeKit/HMCameraStream.swift index d34852a..f6fec24 100644 --- a/watchOS/HomeKit/HMCameraStream.swift +++ b/watchOS/HomeKit/HMCameraStream.swift @@ -5,4 +5,5 @@ class HMCameraStream : HMCameraSource { @available(watchOS, introduced: 3.0, deprecated: 3.0) func setAudioStreamSetting(_ audioStreamSetting: HMCameraAudioStreamSetting) func updateAudioStreamSetting(_ audioStreamSetting: HMCameraAudioStreamSetting, completionHandler completion: @escaping (Error?) -> Void) + func updateAudioStreamSetting(_ audioStreamSetting: HMCameraAudioStreamSetting) async throws } diff --git a/watchOS/HomeKit/HMCameraStreamControl.swift b/watchOS/HomeKit/HMCameraStreamControl.swift index 2d296bb..f54301a 100644 --- a/watchOS/HomeKit/HMCameraStreamControl.swift +++ b/watchOS/HomeKit/HMCameraStreamControl.swift @@ -9,6 +9,6 @@ class HMCameraStreamControl : HMCameraControl { } @available(watchOS 3.0, *) protocol HMCameraStreamControlDelegate : NSObjectProtocol { - optional func cameraStreamControlDidStartStream(_ cameraStreamControl: HMCameraStreamControl) - optional func cameraStreamControl(_ cameraStreamControl: HMCameraStreamControl, didStopStreamWithError error: Error?) + @asyncHandler optional func cameraStreamControlDidStartStream(_ cameraStreamControl: HMCameraStreamControl) + @asyncHandler optional func cameraStreamControl(_ cameraStreamControl: HMCameraStreamControl, didStopStreamWithError error: Error?) } diff --git a/watchOS/HomeKit/HMCharacteristic.swift b/watchOS/HomeKit/HMCharacteristic.swift index e7c6268..1a11381 100644 --- a/watchOS/HomeKit/HMCharacteristic.swift +++ b/watchOS/HomeKit/HMCharacteristic.swift @@ -12,6 +12,9 @@ class HMCharacteristic : NSObject { @available(watchOS 2.0, *) var uniqueIdentifier: UUID { get } func writeValue(_ value: Any?, completionHandler completion: @escaping (Error?) -> Void) + func writeValue(_ value: Any?) async throws func readValue(completionHandler completion: @escaping (Error?) -> Void) + func readValue() async throws func enableNotification(_ enable: Bool, completionHandler completion: @escaping (Error?) -> Void) + func enableNotification(_ enable: Bool) async throws } diff --git a/watchOS/HomeKit/HMHome.swift b/watchOS/HomeKit/HMHome.swift index 461c0ce..eced495 100644 --- a/watchOS/HomeKit/HMHome.swift +++ b/watchOS/HomeKit/HMHome.swift @@ -42,6 +42,7 @@ extension HMHome { extension HMHome { var actionSets: [HMActionSet] { get } func executeActionSet(_ actionSet: HMActionSet, completionHandler completion: @escaping (Error?) -> Void) + func executeActionSet(_ actionSet: HMActionSet) async throws @available(watchOS 2.0, *) func builtinActionSet(ofType actionSetType: String) -> HMActionSet? } @@ -50,41 +51,41 @@ extension HMHome { } @available(watchOS 2.0, *) protocol HMHomeDelegate : NSObjectProtocol { - optional func homeDidUpdateName(_ home: HMHome) + @asyncHandler optional func homeDidUpdateName(_ home: HMHome) @available(watchOS 4.0, *) - optional func homeDidUpdateAccessControl(forCurrentUser home: HMHome) - optional func home(_ home: HMHome, didAdd accessory: HMAccessory) - optional func home(_ home: HMHome, didRemove accessory: HMAccessory) - optional func home(_ home: HMHome, didAdd user: HMUser) - optional func home(_ home: HMHome, didRemove user: HMUser) - optional func home(_ home: HMHome, didUpdate room: HMRoom, for accessory: HMAccessory) - optional func home(_ home: HMHome, didAdd room: HMRoom) - optional func home(_ home: HMHome, didRemove room: HMRoom) - optional func home(_ home: HMHome, didUpdateNameFor room: HMRoom) - optional func home(_ home: HMHome, didAdd zone: HMZone) - optional func home(_ home: HMHome, didRemove zone: HMZone) - optional func home(_ home: HMHome, didUpdateNameFor zone: HMZone) - optional func home(_ home: HMHome, didAdd room: HMRoom, to zone: HMZone) - optional func home(_ home: HMHome, didRemove room: HMRoom, from zone: HMZone) - optional func home(_ home: HMHome, didAdd group: HMServiceGroup) - optional func home(_ home: HMHome, didRemove group: HMServiceGroup) - optional func home(_ home: HMHome, didUpdateNameFor group: HMServiceGroup) - optional func home(_ home: HMHome, didAdd service: HMService, to group: HMServiceGroup) - optional func home(_ home: HMHome, didRemove service: HMService, from group: HMServiceGroup) - optional func home(_ home: HMHome, didAdd actionSet: HMActionSet) - optional func home(_ home: HMHome, didRemove actionSet: HMActionSet) - optional func home(_ home: HMHome, didUpdateNameFor actionSet: HMActionSet) - optional func home(_ home: HMHome, didUpdateActionsFor actionSet: HMActionSet) - optional func home(_ home: HMHome, didAdd trigger: HMTrigger) - optional func home(_ home: HMHome, didRemove trigger: HMTrigger) - optional func home(_ home: HMHome, didUpdateNameFor trigger: HMTrigger) - optional func home(_ home: HMHome, didUpdate trigger: HMTrigger) - optional func home(_ home: HMHome, didUnblockAccessory accessory: HMAccessory) - optional func home(_ home: HMHome, didEncounterError error: Error, for accessory: HMAccessory) + @asyncHandler optional func homeDidUpdateAccessControl(forCurrentUser home: HMHome) + @asyncHandler optional func home(_ home: HMHome, didAdd accessory: HMAccessory) + @asyncHandler optional func home(_ home: HMHome, didRemove accessory: HMAccessory) + @asyncHandler optional func home(_ home: HMHome, didAdd user: HMUser) + @asyncHandler optional func home(_ home: HMHome, didRemove user: HMUser) + @asyncHandler optional func home(_ home: HMHome, didUpdate room: HMRoom, for accessory: HMAccessory) + @asyncHandler optional func home(_ home: HMHome, didAdd room: HMRoom) + @asyncHandler optional func home(_ home: HMHome, didRemove room: HMRoom) + @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor room: HMRoom) + @asyncHandler optional func home(_ home: HMHome, didAdd zone: HMZone) + @asyncHandler optional func home(_ home: HMHome, didRemove zone: HMZone) + @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor zone: HMZone) + @asyncHandler optional func home(_ home: HMHome, didAdd room: HMRoom, to zone: HMZone) + @asyncHandler optional func home(_ home: HMHome, didRemove room: HMRoom, from zone: HMZone) + @asyncHandler optional func home(_ home: HMHome, didAdd group: HMServiceGroup) + @asyncHandler optional func home(_ home: HMHome, didRemove group: HMServiceGroup) + @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor group: HMServiceGroup) + @asyncHandler optional func home(_ home: HMHome, didAdd service: HMService, to group: HMServiceGroup) + @asyncHandler optional func home(_ home: HMHome, didRemove service: HMService, from group: HMServiceGroup) + @asyncHandler optional func home(_ home: HMHome, didAdd actionSet: HMActionSet) + @asyncHandler optional func home(_ home: HMHome, didRemove actionSet: HMActionSet) + @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor actionSet: HMActionSet) + @asyncHandler optional func home(_ home: HMHome, didUpdateActionsFor actionSet: HMActionSet) + @asyncHandler optional func home(_ home: HMHome, didAdd trigger: HMTrigger) + @asyncHandler optional func home(_ home: HMHome, didRemove trigger: HMTrigger) + @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor trigger: HMTrigger) + @asyncHandler optional func home(_ home: HMHome, didUpdate trigger: HMTrigger) + @asyncHandler optional func home(_ home: HMHome, didUnblockAccessory accessory: HMAccessory) + @asyncHandler optional func home(_ home: HMHome, didEncounterError error: Error, for accessory: HMAccessory) @available(watchOS 4.0, *) - optional func home(_ home: HMHome, didUpdate homeHubState: HMHomeHubState) + @asyncHandler optional func home(_ home: HMHome, didUpdate homeHubState: HMHomeHubState) @available(watchOS 6.1, *) - optional func homeDidUpdateSupportedFeatures(_ home: HMHome) + @asyncHandler optional func homeDidUpdateSupportedFeatures(_ home: HMHome) } @available(watchOS 2.0, *) let HMUserFailedAccessoriesKey: String diff --git a/watchOS/HomeKit/HMHomeManager.swift b/watchOS/HomeKit/HMHomeManager.swift index 8d276c8..de46a31 100644 --- a/watchOS/HomeKit/HMHomeManager.swift +++ b/watchOS/HomeKit/HMHomeManager.swift @@ -18,9 +18,9 @@ class HMHomeManager : NSObject { @available(watchOS 2.0, *) protocol HMHomeManagerDelegate : NSObjectProtocol { @available(watchOS 6.0, *) - optional func homeManager(_ manager: HMHomeManager, didUpdate status: HMHomeManagerAuthorizationStatus) - optional func homeManagerDidUpdateHomes(_ manager: HMHomeManager) - optional func homeManagerDidUpdatePrimaryHome(_ manager: HMHomeManager) - optional func homeManager(_ manager: HMHomeManager, didAdd home: HMHome) - optional func homeManager(_ manager: HMHomeManager, didRemove home: HMHome) + @asyncHandler optional func homeManager(_ manager: HMHomeManager, didUpdate status: HMHomeManagerAuthorizationStatus) + @asyncHandler optional func homeManagerDidUpdateHomes(_ manager: HMHomeManager) + @asyncHandler optional func homeManagerDidUpdatePrimaryHome(_ manager: HMHomeManager) + @asyncHandler optional func homeManager(_ manager: HMHomeManager, didAdd home: HMHome) + @asyncHandler optional func homeManager(_ manager: HMHomeManager, didRemove home: HMHome) } diff --git a/watchOS/HomeKit/HMNetworkConfigurationProfile.swift b/watchOS/HomeKit/HMNetworkConfigurationProfile.swift index 142d563..78e55ce 100644 --- a/watchOS/HomeKit/HMNetworkConfigurationProfile.swift +++ b/watchOS/HomeKit/HMNetworkConfigurationProfile.swift @@ -6,5 +6,5 @@ class HMNetworkConfigurationProfile : HMAccessoryProfile { } @available(watchOS 6.0, *) protocol HMNetworkConfigurationProfileDelegate : NSObjectProtocol { - optional func profileDidUpdateNetworkAccessMode(_ profile: HMNetworkConfigurationProfile) + @asyncHandler optional func profileDidUpdateNetworkAccessMode(_ profile: HMNetworkConfigurationProfile) } diff --git a/watchOS/Intents/INActivateCarSignalIntent.swift b/watchOS/Intents/INActivateCarSignalIntent.swift index c219ec9..452ce46 100644 --- a/watchOS/Intents/INActivateCarSignalIntent.swift +++ b/watchOS/Intents/INActivateCarSignalIntent.swift @@ -8,7 +8,11 @@ class INActivateCarSignalIntent : INIntent { @available(watchOS 3.2, *) protocol INActivateCarSignalIntentHandling : NSObjectProtocol { func handle(intent: INActivateCarSignalIntent, completion: @escaping (INActivateCarSignalIntentResponse) -> Void) + func handle(intent: INActivateCarSignalIntent) async -> INActivateCarSignalIntentResponse optional func confirm(intent: INActivateCarSignalIntent, completion: @escaping (INActivateCarSignalIntentResponse) -> Void) + optional func confirm(intent: INActivateCarSignalIntent) async -> INActivateCarSignalIntentResponse optional func resolveCarName(for intent: INActivateCarSignalIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveCarName(for intent: INActivateCarSignalIntent) async -> INSpeakableStringResolutionResult optional func resolveSignals(for intent: INActivateCarSignalIntent, with completion: @escaping (INCarSignalOptionsResolutionResult) -> Void) + optional func resolveSignals(for intent: INActivateCarSignalIntent) async -> INCarSignalOptionsResolutionResult } diff --git a/watchOS/Intents/INAddMediaIntent.swift b/watchOS/Intents/INAddMediaIntent.swift index 6f9126b..48557b3 100644 --- a/watchOS/Intents/INAddMediaIntent.swift +++ b/watchOS/Intents/INAddMediaIntent.swift @@ -9,7 +9,11 @@ class INAddMediaIntent : INIntent { @available(watchOS 6.0, *) protocol INAddMediaIntentHandling : NSObjectProtocol { func handle(intent: INAddMediaIntent, completion: @escaping (INAddMediaIntentResponse) -> Void) + func handle(intent: INAddMediaIntent) async -> INAddMediaIntentResponse optional func confirm(intent: INAddMediaIntent, completion: @escaping (INAddMediaIntentResponse) -> Void) + optional func confirm(intent: INAddMediaIntent) async -> INAddMediaIntentResponse optional func resolveMediaItems(for intent: INAddMediaIntent, with completion: @escaping ([INAddMediaMediaItemResolutionResult]) -> Void) + optional func resolveMediaItems(for intent: INAddMediaIntent) async -> [INAddMediaMediaItemResolutionResult] optional func resolveMediaDestination(for intent: INAddMediaIntent, with completion: @escaping (INAddMediaMediaDestinationResolutionResult) -> Void) + optional func resolveMediaDestination(for intent: INAddMediaIntent) async -> INAddMediaMediaDestinationResolutionResult } diff --git a/watchOS/Intents/INAddTasksIntent.swift b/watchOS/Intents/INAddTasksIntent.swift index bc8b8c5..40510e1 100644 --- a/watchOS/Intents/INAddTasksIntent.swift +++ b/watchOS/Intents/INAddTasksIntent.swift @@ -13,17 +13,31 @@ class INAddTasksIntent : INIntent { @available(watchOS 4.0, *) protocol INAddTasksIntentHandling : NSObjectProtocol { func handle(intent: INAddTasksIntent, completion: @escaping (INAddTasksIntentResponse) -> Void) + func handle(intent: INAddTasksIntent) async -> INAddTasksIntentResponse optional func confirm(intent: INAddTasksIntent, completion: @escaping (INAddTasksIntentResponse) -> Void) + optional func confirm(intent: INAddTasksIntent) async -> INAddTasksIntentResponse @available(watchOS, introduced: 4.0, deprecated: 6.0, message: "resolveTargetTaskListForAddTasks:withCompletion: is deprecated. Use resolveTargetTaskListForAddTasks:completion: instead") optional func resolveTargetTaskList(for intent: INAddTasksIntent, with completion: @escaping (INTaskListResolutionResult) -> Void) + @available(watchOS, introduced: 4.0, deprecated: 6.0, message: "resolveTargetTaskListForAddTasks:withCompletion: is deprecated. Use resolveTargetTaskListForAddTasks:completion: instead") + optional func resolveTargetTaskList(for intent: INAddTasksIntent) async -> INTaskListResolutionResult @available(watchOS 6.0, *) optional func resolveTargetTaskList(for intent: INAddTasksIntent, with completion: @escaping (INAddTasksTargetTaskListResolutionResult) -> Void) + @available(watchOS 6.0, *) + optional func resolveTargetTaskList(for intent: INAddTasksIntent) async -> INAddTasksTargetTaskListResolutionResult optional func resolveTaskTitles(for intent: INAddTasksIntent, with completion: @escaping ([INSpeakableStringResolutionResult]) -> Void) + optional func resolveTaskTitles(for intent: INAddTasksIntent) async -> [INSpeakableStringResolutionResult] optional func resolveSpatialEventTrigger(for intent: INAddTasksIntent, with completion: @escaping (INSpatialEventTriggerResolutionResult) -> Void) + optional func resolveSpatialEventTrigger(for intent: INAddTasksIntent) async -> INSpatialEventTriggerResolutionResult @available(watchOS, introduced: 4.0, deprecated: 6.0, message: "resolveTemporalEventTriggerForAddTasks:withCompletion: is deprecated. Use resolveTemporalEventTriggerForAddTasks:completion: instead") optional func resolveTemporalEventTrigger(for intent: INAddTasksIntent, with completion: @escaping (INTemporalEventTriggerResolutionResult) -> Void) + @available(watchOS, introduced: 4.0, deprecated: 6.0, message: "resolveTemporalEventTriggerForAddTasks:withCompletion: is deprecated. Use resolveTemporalEventTriggerForAddTasks:completion: instead") + optional func resolveTemporalEventTrigger(for intent: INAddTasksIntent) async -> INTemporalEventTriggerResolutionResult @available(watchOS 6.0, *) optional func resolveTemporalEventTrigger(for intent: INAddTasksIntent, with completion: @escaping (INAddTasksTemporalEventTriggerResolutionResult) -> Void) @available(watchOS 6.0, *) + optional func resolveTemporalEventTrigger(for intent: INAddTasksIntent) async -> INAddTasksTemporalEventTriggerResolutionResult + @available(watchOS 6.0, *) optional func resolvePriority(for intent: INAddTasksIntent, with completion: @escaping (INTaskPriorityResolutionResult) -> Void) + @available(watchOS 6.0, *) + optional func resolvePriority(for intent: INAddTasksIntent) async -> INTaskPriorityResolutionResult } diff --git a/watchOS/Intents/INAppendToNoteIntent.swift b/watchOS/Intents/INAppendToNoteIntent.swift index 6992eed..6b5c20f 100644 --- a/watchOS/Intents/INAppendToNoteIntent.swift +++ b/watchOS/Intents/INAppendToNoteIntent.swift @@ -8,7 +8,11 @@ class INAppendToNoteIntent : INIntent { @available(watchOS 4.0, *) protocol INAppendToNoteIntentHandling : NSObjectProtocol { func handle(intent: INAppendToNoteIntent, completion: @escaping (INAppendToNoteIntentResponse) -> Void) + func handle(intent: INAppendToNoteIntent) async -> INAppendToNoteIntentResponse optional func confirm(intent: INAppendToNoteIntent, completion: @escaping (INAppendToNoteIntentResponse) -> Void) + optional func confirm(intent: INAppendToNoteIntent) async -> INAppendToNoteIntentResponse optional func resolveTargetNote(for intent: INAppendToNoteIntent, with completion: @escaping (INNoteResolutionResult) -> Void) + optional func resolveTargetNote(for intent: INAppendToNoteIntent) async -> INNoteResolutionResult optional func resolveContent(for intent: INAppendToNoteIntent, with completion: @escaping (INNoteContentResolutionResult) -> Void) + optional func resolveContent(for intent: INAppendToNoteIntent) async -> INNoteContentResolutionResult } diff --git a/watchOS/Intents/INCancelWorkoutIntent.swift b/watchOS/Intents/INCancelWorkoutIntent.swift index c1f5a5c..ef32e1b 100644 --- a/watchOS/Intents/INCancelWorkoutIntent.swift +++ b/watchOS/Intents/INCancelWorkoutIntent.swift @@ -7,6 +7,9 @@ class INCancelWorkoutIntent : INIntent { @available(watchOS 3.2, *) protocol INCancelWorkoutIntentHandling : NSObjectProtocol { func handle(intent: INCancelWorkoutIntent, completion: @escaping (INCancelWorkoutIntentResponse) -> Void) + func handle(intent: INCancelWorkoutIntent) async -> INCancelWorkoutIntentResponse optional func confirm(intent: INCancelWorkoutIntent, completion: @escaping (INCancelWorkoutIntentResponse) -> Void) + optional func confirm(intent: INCancelWorkoutIntent) async -> INCancelWorkoutIntentResponse optional func resolveWorkoutName(for intent: INCancelWorkoutIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveWorkoutName(for intent: INCancelWorkoutIntent) async -> INSpeakableStringResolutionResult } diff --git a/watchOS/Intents/INCreateNoteIntent.swift b/watchOS/Intents/INCreateNoteIntent.swift index 5c1daf4..f1b099b 100644 --- a/watchOS/Intents/INCreateNoteIntent.swift +++ b/watchOS/Intents/INCreateNoteIntent.swift @@ -9,8 +9,13 @@ class INCreateNoteIntent : INIntent { @available(watchOS 4.0, *) protocol INCreateNoteIntentHandling : NSObjectProtocol { func handle(intent: INCreateNoteIntent, completion: @escaping (INCreateNoteIntentResponse) -> Void) + func handle(intent: INCreateNoteIntent) async -> INCreateNoteIntentResponse optional func confirm(intent: INCreateNoteIntent, completion: @escaping (INCreateNoteIntentResponse) -> Void) + optional func confirm(intent: INCreateNoteIntent) async -> INCreateNoteIntentResponse optional func resolveTitle(for intent: INCreateNoteIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveTitle(for intent: INCreateNoteIntent) async -> INSpeakableStringResolutionResult optional func resolveContent(for intent: INCreateNoteIntent, with completion: @escaping (INNoteContentResolutionResult) -> Void) + optional func resolveContent(for intent: INCreateNoteIntent) async -> INNoteContentResolutionResult optional func resolveGroupName(for intent: INCreateNoteIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveGroupName(for intent: INCreateNoteIntent) async -> INSpeakableStringResolutionResult } diff --git a/watchOS/Intents/INCreateTaskListIntent.swift b/watchOS/Intents/INCreateTaskListIntent.swift index ce9019e..cebaa46 100644 --- a/watchOS/Intents/INCreateTaskListIntent.swift +++ b/watchOS/Intents/INCreateTaskListIntent.swift @@ -9,8 +9,13 @@ class INCreateTaskListIntent : INIntent { @available(watchOS 4.0, *) protocol INCreateTaskListIntentHandling : NSObjectProtocol { func handle(intent: INCreateTaskListIntent, completion: @escaping (INCreateTaskListIntentResponse) -> Void) + func handle(intent: INCreateTaskListIntent) async -> INCreateTaskListIntentResponse optional func confirm(intent: INCreateTaskListIntent, completion: @escaping (INCreateTaskListIntentResponse) -> Void) + optional func confirm(intent: INCreateTaskListIntent) async -> INCreateTaskListIntentResponse optional func resolveTitle(for intent: INCreateTaskListIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveTitle(for intent: INCreateTaskListIntent) async -> INSpeakableStringResolutionResult optional func resolveTaskTitles(for intent: INCreateTaskListIntent, with completion: @escaping ([INSpeakableStringResolutionResult]) -> Void) + optional func resolveTaskTitles(for intent: INCreateTaskListIntent) async -> [INSpeakableStringResolutionResult] optional func resolveGroupName(for intent: INCreateTaskListIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveGroupName(for intent: INCreateTaskListIntent) async -> INSpeakableStringResolutionResult } diff --git a/watchOS/Intents/INDeleteTasksIntent.swift b/watchOS/Intents/INDeleteTasksIntent.swift index 1a018cb..0fc9571 100644 --- a/watchOS/Intents/INDeleteTasksIntent.swift +++ b/watchOS/Intents/INDeleteTasksIntent.swift @@ -17,7 +17,11 @@ extension INDeleteTasksIntent { @available(watchOS 6.0, *) protocol INDeleteTasksIntentHandling : NSObjectProtocol { func handle(intent: INDeleteTasksIntent, completion: @escaping (INDeleteTasksIntentResponse) -> Void) + func handle(intent: INDeleteTasksIntent) async -> INDeleteTasksIntentResponse optional func confirm(intent: INDeleteTasksIntent, completion: @escaping (INDeleteTasksIntentResponse) -> Void) + optional func confirm(intent: INDeleteTasksIntent) async -> INDeleteTasksIntentResponse optional func resolveTaskList(for intent: INDeleteTasksIntent, with completion: @escaping (INDeleteTasksTaskListResolutionResult) -> Void) + optional func resolveTaskList(for intent: INDeleteTasksIntent) async -> INDeleteTasksTaskListResolutionResult optional func resolveTasks(for intent: INDeleteTasksIntent, with completion: @escaping ([INDeleteTasksTaskResolutionResult]) -> Void) + optional func resolveTasks(for intent: INDeleteTasksIntent) async -> [INDeleteTasksTaskResolutionResult] } diff --git a/watchOS/Intents/INEndWorkoutIntent.swift b/watchOS/Intents/INEndWorkoutIntent.swift index decca14..885d5f7 100644 --- a/watchOS/Intents/INEndWorkoutIntent.swift +++ b/watchOS/Intents/INEndWorkoutIntent.swift @@ -7,6 +7,9 @@ class INEndWorkoutIntent : INIntent { @available(watchOS 3.2, *) protocol INEndWorkoutIntentHandling : NSObjectProtocol { func handle(intent: INEndWorkoutIntent, completion: @escaping (INEndWorkoutIntentResponse) -> Void) + func handle(intent: INEndWorkoutIntent) async -> INEndWorkoutIntentResponse optional func confirm(intent: INEndWorkoutIntent, completion: @escaping (INEndWorkoutIntentResponse) -> Void) + optional func confirm(intent: INEndWorkoutIntent) async -> INEndWorkoutIntentResponse optional func resolveWorkoutName(for intent: INEndWorkoutIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveWorkoutName(for intent: INEndWorkoutIntent) async -> INSpeakableStringResolutionResult } diff --git a/watchOS/Intents/INGetCarLockStatusIntent.swift b/watchOS/Intents/INGetCarLockStatusIntent.swift index 8b10e7b..e5324df 100644 --- a/watchOS/Intents/INGetCarLockStatusIntent.swift +++ b/watchOS/Intents/INGetCarLockStatusIntent.swift @@ -7,6 +7,9 @@ class INGetCarLockStatusIntent : INIntent { @available(watchOS 3.2, *) protocol INGetCarLockStatusIntentHandling : NSObjectProtocol { func handle(intent: INGetCarLockStatusIntent, completion: @escaping (INGetCarLockStatusIntentResponse) -> Void) + func handle(intent: INGetCarLockStatusIntent) async -> INGetCarLockStatusIntentResponse optional func confirm(intent: INGetCarLockStatusIntent, completion: @escaping (INGetCarLockStatusIntentResponse) -> Void) + optional func confirm(intent: INGetCarLockStatusIntent) async -> INGetCarLockStatusIntentResponse optional func resolveCarName(for intent: INGetCarLockStatusIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveCarName(for intent: INGetCarLockStatusIntent) async -> INSpeakableStringResolutionResult } diff --git a/watchOS/Intents/INGetCarPowerLevelStatusIntent.swift b/watchOS/Intents/INGetCarPowerLevelStatusIntent.swift index 5162a9e..d6d6dfe 100644 --- a/watchOS/Intents/INGetCarPowerLevelStatusIntent.swift +++ b/watchOS/Intents/INGetCarPowerLevelStatusIntent.swift @@ -7,6 +7,9 @@ class INGetCarPowerLevelStatusIntent : INIntent { @available(watchOS 3.2, *) protocol INGetCarPowerLevelStatusIntentHandling : NSObjectProtocol { func handle(intent: INGetCarPowerLevelStatusIntent, completion: @escaping (INGetCarPowerLevelStatusIntentResponse) -> Void) + func handle(intent: INGetCarPowerLevelStatusIntent) async -> INGetCarPowerLevelStatusIntentResponse optional func confirm(intent: INGetCarPowerLevelStatusIntent, completion: @escaping (INGetCarPowerLevelStatusIntentResponse) -> Void) + optional func confirm(intent: INGetCarPowerLevelStatusIntent) async -> INGetCarPowerLevelStatusIntentResponse optional func resolveCarName(for intent: INGetCarPowerLevelStatusIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveCarName(for intent: INGetCarPowerLevelStatusIntent) async -> INSpeakableStringResolutionResult } diff --git a/watchOS/Intents/INGetRideStatusIntent.swift b/watchOS/Intents/INGetRideStatusIntent.swift index 83e929d..2733c9d 100644 --- a/watchOS/Intents/INGetRideStatusIntent.swift +++ b/watchOS/Intents/INGetRideStatusIntent.swift @@ -5,11 +5,13 @@ class INGetRideStatusIntent : INIntent { @available(watchOS 3.2, *) protocol INGetRideStatusIntentHandling : NSObjectProtocol { func handle(intent: INGetRideStatusIntent, completion: @escaping (INGetRideStatusIntentResponse) -> Void) + func handle(intent: INGetRideStatusIntent) async -> INGetRideStatusIntentResponse func startSendingUpdates(for intent: INGetRideStatusIntent, to observer: INGetRideStatusIntentResponseObserver) func stopSendingUpdates(for intent: INGetRideStatusIntent) optional func confirm(intent: INGetRideStatusIntent, completion: @escaping (INGetRideStatusIntentResponse) -> Void) + optional func confirm(intent: INGetRideStatusIntent) async -> INGetRideStatusIntentResponse } @available(watchOS 3.2, *) protocol INGetRideStatusIntentResponseObserver : NSObjectProtocol { - func didUpdate(getRideStatus response: INGetRideStatusIntentResponse) + @asyncHandler func didUpdate(getRideStatus response: INGetRideStatusIntentResponse) } diff --git a/watchOS/Intents/INGetVisualCodeIntent.swift b/watchOS/Intents/INGetVisualCodeIntent.swift index 31f89fc..4221a0c 100644 --- a/watchOS/Intents/INGetVisualCodeIntent.swift +++ b/watchOS/Intents/INGetVisualCodeIntent.swift @@ -7,6 +7,9 @@ class INGetVisualCodeIntent : INIntent { @available(watchOS 4.0, *) protocol INGetVisualCodeIntentHandling : NSObjectProtocol { func handle(intent: INGetVisualCodeIntent, completion: @escaping (INGetVisualCodeIntentResponse) -> Void) + func handle(intent: INGetVisualCodeIntent) async -> INGetVisualCodeIntentResponse optional func confirm(intent: INGetVisualCodeIntent, completion: @escaping (INGetVisualCodeIntentResponse) -> Void) + optional func confirm(intent: INGetVisualCodeIntent) async -> INGetVisualCodeIntentResponse optional func resolveVisualCodeType(for intent: INGetVisualCodeIntent, with completion: @escaping (INVisualCodeTypeResolutionResult) -> Void) + optional func resolveVisualCodeType(for intent: INGetVisualCodeIntent) async -> INVisualCodeTypeResolutionResult } diff --git a/watchOS/Intents/INInteraction.swift b/watchOS/Intents/INInteraction.swift index 6e706b6..cd5aa4e 100644 --- a/watchOS/Intents/INInteraction.swift +++ b/watchOS/Intents/INInteraction.swift @@ -24,9 +24,13 @@ enum INInteractionDirection : Int { class INInteraction : NSObject, NSSecureCoding, NSCopying { init(intent: INIntent, response: INIntentResponse?) func donate(completion: ((Error?) -> Void)? = nil) + func donate() async throws class func deleteAll(completion: ((Error?) -> Void)? = nil) + class func deleteAll() async throws class func delete(with identifiers: [String], completion: ((Error?) -> Void)? = nil) + class func delete(with identifiers: [String]) async throws class func delete(with groupIdentifier: String, completion: ((Error?) -> Void)? = nil) + class func delete(with groupIdentifier: String) async throws @NSCopying var intent: INIntent { get } @NSCopying var intentResponse: INIntentResponse? { get } var intentHandlingStatus: INIntentHandlingStatus { get } diff --git a/watchOS/Intents/INListCarsIntent.swift b/watchOS/Intents/INListCarsIntent.swift index 89ad799..a71bedb 100644 --- a/watchOS/Intents/INListCarsIntent.swift +++ b/watchOS/Intents/INListCarsIntent.swift @@ -5,5 +5,7 @@ class INListCarsIntent : INIntent { @available(watchOS 7.0, *) protocol INListCarsIntentHandling : NSObjectProtocol { func handle(intent: INListCarsIntent, completion: @escaping (INListCarsIntentResponse) -> Void) + func handle(intent: INListCarsIntent) async -> INListCarsIntentResponse optional func confirm(intent: INListCarsIntent, completion: @escaping (INListCarsIntentResponse) -> Void) + optional func confirm(intent: INListCarsIntent) async -> INListCarsIntentResponse } diff --git a/watchOS/Intents/INListRideOptionsIntent.swift b/watchOS/Intents/INListRideOptionsIntent.swift index 4676d1f..e34034d 100644 --- a/watchOS/Intents/INListRideOptionsIntent.swift +++ b/watchOS/Intents/INListRideOptionsIntent.swift @@ -8,7 +8,11 @@ class INListRideOptionsIntent : INIntent { @available(watchOS 3.2, *) protocol INListRideOptionsIntentHandling : NSObjectProtocol { func handle(intent: INListRideOptionsIntent, completion: @escaping (INListRideOptionsIntentResponse) -> Void) + func handle(intent: INListRideOptionsIntent) async -> INListRideOptionsIntentResponse optional func confirm(intent: INListRideOptionsIntent, completion: @escaping (INListRideOptionsIntentResponse) -> Void) + optional func confirm(intent: INListRideOptionsIntent) async -> INListRideOptionsIntentResponse optional func resolvePickupLocation(for intent: INListRideOptionsIntent, with completion: @escaping (INPlacemarkResolutionResult) -> Void) + optional func resolvePickupLocation(for intent: INListRideOptionsIntent) async -> INPlacemarkResolutionResult optional func resolveDropOffLocation(for intent: INListRideOptionsIntent, with completion: @escaping (INPlacemarkResolutionResult) -> Void) + optional func resolveDropOffLocation(for intent: INListRideOptionsIntent) async -> INPlacemarkResolutionResult } diff --git a/watchOS/Intents/INPauseWorkoutIntent.swift b/watchOS/Intents/INPauseWorkoutIntent.swift index 04b443a..a8fcaa4 100644 --- a/watchOS/Intents/INPauseWorkoutIntent.swift +++ b/watchOS/Intents/INPauseWorkoutIntent.swift @@ -7,6 +7,9 @@ class INPauseWorkoutIntent : INIntent { @available(watchOS 3.2, *) protocol INPauseWorkoutIntentHandling : NSObjectProtocol { func handle(intent: INPauseWorkoutIntent, completion: @escaping (INPauseWorkoutIntentResponse) -> Void) + func handle(intent: INPauseWorkoutIntent) async -> INPauseWorkoutIntentResponse optional func confirm(intent: INPauseWorkoutIntent, completion: @escaping (INPauseWorkoutIntentResponse) -> Void) + optional func confirm(intent: INPauseWorkoutIntent) async -> INPauseWorkoutIntentResponse optional func resolveWorkoutName(for intent: INPauseWorkoutIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveWorkoutName(for intent: INPauseWorkoutIntent) async -> INSpeakableStringResolutionResult } diff --git a/watchOS/Intents/INPayBillIntent.swift b/watchOS/Intents/INPayBillIntent.swift index 5162e10..a0acfab 100644 --- a/watchOS/Intents/INPayBillIntent.swift +++ b/watchOS/Intents/INPayBillIntent.swift @@ -13,12 +13,21 @@ class INPayBillIntent : INIntent { @available(watchOS 3.2, *) protocol INPayBillIntentHandling : NSObjectProtocol { func handle(intent: INPayBillIntent, completion: @escaping (INPayBillIntentResponse) -> Void) + func handle(intent: INPayBillIntent) async -> INPayBillIntentResponse optional func confirm(intent: INPayBillIntent, completion: @escaping (INPayBillIntentResponse) -> Void) + optional func confirm(intent: INPayBillIntent) async -> INPayBillIntentResponse optional func resolveBillPayee(for intent: INPayBillIntent, with completion: @escaping (INBillPayeeResolutionResult) -> Void) + optional func resolveBillPayee(for intent: INPayBillIntent) async -> INBillPayeeResolutionResult optional func resolveFromAccount(for intent: INPayBillIntent, with completion: @escaping (INPaymentAccountResolutionResult) -> Void) + optional func resolveFromAccount(for intent: INPayBillIntent) async -> INPaymentAccountResolutionResult optional func resolveTransactionAmount(for intent: INPayBillIntent, with completion: @escaping (INPaymentAmountResolutionResult) -> Void) + optional func resolveTransactionAmount(for intent: INPayBillIntent) async -> INPaymentAmountResolutionResult optional func resolveTransactionScheduledDate(for intent: INPayBillIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveTransactionScheduledDate(for intent: INPayBillIntent) async -> INDateComponentsRangeResolutionResult optional func resolveTransactionNote(for intent: INPayBillIntent, with completion: @escaping (INStringResolutionResult) -> Void) + optional func resolveTransactionNote(for intent: INPayBillIntent) async -> INStringResolutionResult optional func resolveBillType(for intent: INPayBillIntent, with completion: @escaping (INBillTypeResolutionResult) -> Void) + optional func resolveBillType(for intent: INPayBillIntent) async -> INBillTypeResolutionResult optional func resolveDueDate(for intent: INPayBillIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveDueDate(for intent: INPayBillIntent) async -> INDateComponentsRangeResolutionResult } diff --git a/watchOS/Intents/INPlayMediaIntent.swift b/watchOS/Intents/INPlayMediaIntent.swift index 19de51c..36ec643 100644 --- a/watchOS/Intents/INPlayMediaIntent.swift +++ b/watchOS/Intents/INPlayMediaIntent.swift @@ -33,17 +33,31 @@ extension INPlayMediaIntent { @available(watchOS 5.0, *) protocol INPlayMediaIntentHandling : NSObjectProtocol { func handle(intent: INPlayMediaIntent, completion: @escaping (INPlayMediaIntentResponse) -> Void) + func handle(intent: INPlayMediaIntent) async -> INPlayMediaIntentResponse optional func confirm(intent: INPlayMediaIntent, completion: @escaping (INPlayMediaIntentResponse) -> Void) + optional func confirm(intent: INPlayMediaIntent) async -> INPlayMediaIntentResponse @available(watchOS 6.0, *) optional func resolveMediaItems(for intent: INPlayMediaIntent, with completion: @escaping ([INPlayMediaMediaItemResolutionResult]) -> Void) @available(watchOS 6.0, *) + optional func resolveMediaItems(for intent: INPlayMediaIntent) async -> [INPlayMediaMediaItemResolutionResult] + @available(watchOS 6.0, *) optional func resolvePlayShuffled(for intent: INPlayMediaIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) @available(watchOS 6.0, *) + optional func resolvePlayShuffled(for intent: INPlayMediaIntent) async -> INBooleanResolutionResult + @available(watchOS 6.0, *) optional func resolvePlaybackRepeatMode(for intent: INPlayMediaIntent, with completion: @escaping (INPlaybackRepeatModeResolutionResult) -> Void) @available(watchOS 6.0, *) + optional func resolvePlaybackRepeatMode(for intent: INPlayMediaIntent) async -> INPlaybackRepeatModeResolutionResult + @available(watchOS 6.0, *) optional func resolveResumePlayback(for intent: INPlayMediaIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) @available(watchOS 6.0, *) + optional func resolveResumePlayback(for intent: INPlayMediaIntent) async -> INBooleanResolutionResult + @available(watchOS 6.0, *) optional func resolvePlaybackQueueLocation(for intent: INPlayMediaIntent, with completion: @escaping (INPlaybackQueueLocationResolutionResult) -> Void) @available(watchOS 6.0, *) + optional func resolvePlaybackQueueLocation(for intent: INPlayMediaIntent) async -> INPlaybackQueueLocationResolutionResult + @available(watchOS 6.0, *) optional func resolvePlaybackSpeed(for intent: INPlayMediaIntent, with completion: @escaping (INPlayMediaPlaybackSpeedResolutionResult) -> Void) + @available(watchOS 6.0, *) + optional func resolvePlaybackSpeed(for intent: INPlayMediaIntent) async -> INPlayMediaPlaybackSpeedResolutionResult } diff --git a/watchOS/Intents/INRelevantShortcutStore.swift b/watchOS/Intents/INRelevantShortcutStore.swift index 1965126..fba5c9a 100644 --- a/watchOS/Intents/INRelevantShortcutStore.swift +++ b/watchOS/Intents/INRelevantShortcutStore.swift @@ -3,4 +3,5 @@ class INRelevantShortcutStore : NSObject { class var `default`: INRelevantShortcutStore { get } func setRelevantShortcuts(_ shortcuts: [INRelevantShortcut], completionHandler: ((Error?) -> Void)? = nil) + func setRelevantShortcuts(_ shortcuts: [INRelevantShortcut]) async throws } diff --git a/watchOS/Intents/INRequestPaymentIntent.swift b/watchOS/Intents/INRequestPaymentIntent.swift index 41961d5..acd068f 100644 --- a/watchOS/Intents/INRequestPaymentIntent.swift +++ b/watchOS/Intents/INRequestPaymentIntent.swift @@ -9,14 +9,25 @@ class INRequestPaymentIntent : INIntent { @available(watchOS 3.2, *) protocol INRequestPaymentIntentHandling : NSObjectProtocol { func handle(intent: INRequestPaymentIntent, completion: @escaping (INRequestPaymentIntentResponse) -> Void) + func handle(intent: INRequestPaymentIntent) async -> INRequestPaymentIntentResponse optional func confirm(intent: INRequestPaymentIntent, completion: @escaping (INRequestPaymentIntentResponse) -> Void) + optional func confirm(intent: INRequestPaymentIntent) async -> INRequestPaymentIntentResponse @available(watchOS, introduced: 3.2, deprecated: 4.0, message: "resolvePayerForRequestPayment:withCompletion: is deprecated. Use resolvePayerForRequestPayment:completion: instead") optional func resolvePayer(for intent: INRequestPaymentIntent, with completion: @escaping (INPersonResolutionResult) -> Void) + @available(watchOS, introduced: 3.2, deprecated: 4.0, message: "resolvePayerForRequestPayment:withCompletion: is deprecated. Use resolvePayerForRequestPayment:completion: instead") + optional func resolvePayer(for intent: INRequestPaymentIntent) async -> INPersonResolutionResult @available(watchOS 4.0, *) optional func resolvePayer(for intent: INRequestPaymentIntent, with completion: @escaping (INRequestPaymentPayerResolutionResult) -> Void) + @available(watchOS 4.0, *) + optional func resolvePayer(for intent: INRequestPaymentIntent) async -> INRequestPaymentPayerResolutionResult @available(watchOS, introduced: 3.2, deprecated: 4.0, message: "resolveCurrencyAmountForRequestPayment:withCompletion: is deprecated. Use resolveCurrencyAmountForRequestPayment:completion: instead") optional func resolveCurrencyAmount(for intent: INRequestPaymentIntent, with completion: @escaping (INCurrencyAmountResolutionResult) -> Void) + @available(watchOS, introduced: 3.2, deprecated: 4.0, message: "resolveCurrencyAmountForRequestPayment:withCompletion: is deprecated. Use resolveCurrencyAmountForRequestPayment:completion: instead") + optional func resolveCurrencyAmount(for intent: INRequestPaymentIntent) async -> INCurrencyAmountResolutionResult @available(watchOS 4.0, *) optional func resolveCurrencyAmount(for intent: INRequestPaymentIntent, with completion: @escaping (INRequestPaymentCurrencyAmountResolutionResult) -> Void) + @available(watchOS 4.0, *) + optional func resolveCurrencyAmount(for intent: INRequestPaymentIntent) async -> INRequestPaymentCurrencyAmountResolutionResult optional func resolveNote(for intent: INRequestPaymentIntent, with completion: @escaping (INStringResolutionResult) -> Void) + optional func resolveNote(for intent: INRequestPaymentIntent) async -> INStringResolutionResult } diff --git a/watchOS/Intents/INRequestRideIntent.swift b/watchOS/Intents/INRequestRideIntent.swift index 886eb31..4610bc0 100644 --- a/watchOS/Intents/INRequestRideIntent.swift +++ b/watchOS/Intents/INRequestRideIntent.swift @@ -22,11 +22,19 @@ extension INRequestRideIntent { @available(watchOS 3.2, *) protocol INRequestRideIntentHandling : NSObjectProtocol { func handle(intent: INRequestRideIntent, completion: @escaping (INRequestRideIntentResponse) -> Void) + func handle(intent: INRequestRideIntent) async -> INRequestRideIntentResponse optional func confirm(intent: INRequestRideIntent, completion: @escaping (INRequestRideIntentResponse) -> Void) + optional func confirm(intent: INRequestRideIntent) async -> INRequestRideIntentResponse optional func resolvePickupLocation(for intent: INRequestRideIntent, with completion: @escaping (INPlacemarkResolutionResult) -> Void) + optional func resolvePickupLocation(for intent: INRequestRideIntent) async -> INPlacemarkResolutionResult optional func resolveDropOffLocation(for intent: INRequestRideIntent, with completion: @escaping (INPlacemarkResolutionResult) -> Void) + optional func resolveDropOffLocation(for intent: INRequestRideIntent) async -> INPlacemarkResolutionResult optional func resolveRideOptionName(for intent: INRequestRideIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveRideOptionName(for intent: INRequestRideIntent) async -> INSpeakableStringResolutionResult optional func resolvePartySize(for intent: INRequestRideIntent, with completion: @escaping (INIntegerResolutionResult) -> Void) + optional func resolvePartySize(for intent: INRequestRideIntent) async -> INIntegerResolutionResult @available(watchOS 3.3, *) optional func resolveScheduledPickupTime(for intent: INRequestRideIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + @available(watchOS 3.3, *) + optional func resolveScheduledPickupTime(for intent: INRequestRideIntent) async -> INDateComponentsRangeResolutionResult } diff --git a/watchOS/Intents/INResumeWorkoutIntent.swift b/watchOS/Intents/INResumeWorkoutIntent.swift index 516c309..0f2c819 100644 --- a/watchOS/Intents/INResumeWorkoutIntent.swift +++ b/watchOS/Intents/INResumeWorkoutIntent.swift @@ -7,6 +7,9 @@ class INResumeWorkoutIntent : INIntent { @available(watchOS 3.2, *) protocol INResumeWorkoutIntentHandling : NSObjectProtocol { func handle(intent: INResumeWorkoutIntent, completion: @escaping (INResumeWorkoutIntentResponse) -> Void) + func handle(intent: INResumeWorkoutIntent) async -> INResumeWorkoutIntentResponse optional func confirm(intent: INResumeWorkoutIntent, completion: @escaping (INResumeWorkoutIntentResponse) -> Void) + optional func confirm(intent: INResumeWorkoutIntent) async -> INResumeWorkoutIntentResponse optional func resolveWorkoutName(for intent: INResumeWorkoutIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveWorkoutName(for intent: INResumeWorkoutIntent) async -> INSpeakableStringResolutionResult } diff --git a/watchOS/Intents/INSearchCallHistoryIntent.swift b/watchOS/Intents/INSearchCallHistoryIntent.swift index aa9a78c..f9d0c0a 100644 --- a/watchOS/Intents/INSearchCallHistoryIntent.swift +++ b/watchOS/Intents/INSearchCallHistoryIntent.swift @@ -24,13 +24,23 @@ extension INSearchCallHistoryIntent { @available(watchOS 3.2, *) protocol INSearchCallHistoryIntentHandling : NSObjectProtocol { func handle(intent: INSearchCallHistoryIntent, completion: @escaping (INSearchCallHistoryIntentResponse) -> Void) + func handle(intent: INSearchCallHistoryIntent) async -> INSearchCallHistoryIntentResponse optional func confirm(intent: INSearchCallHistoryIntent, completion: @escaping (INSearchCallHistoryIntentResponse) -> Void) + optional func confirm(intent: INSearchCallHistoryIntent) async -> INSearchCallHistoryIntentResponse @available(watchOS, introduced: 3.2, deprecated: 4.0, message: "resolveCallTypeForSearchCallHistory:withCompletion: is deprecated. Use resolveCallTypesForSearchCallHistory:withCompletion: instead") optional func resolveCallType(for intent: INSearchCallHistoryIntent, with completion: @escaping (INCallRecordTypeResolutionResult) -> Void) + @available(watchOS, introduced: 3.2, deprecated: 4.0, message: "resolveCallTypeForSearchCallHistory:withCompletion: is deprecated. Use resolveCallTypesForSearchCallHistory:withCompletion: instead") + optional func resolveCallType(for intent: INSearchCallHistoryIntent) async -> INCallRecordTypeResolutionResult optional func resolveDateCreated(for intent: INSearchCallHistoryIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveDateCreated(for intent: INSearchCallHistoryIntent) async -> INDateComponentsRangeResolutionResult optional func resolveRecipient(for intent: INSearchCallHistoryIntent, with completion: @escaping (INPersonResolutionResult) -> Void) + optional func resolveRecipient(for intent: INSearchCallHistoryIntent) async -> INPersonResolutionResult @available(watchOS 4.0, *) optional func resolveCallTypes(for intent: INSearchCallHistoryIntent, with completion: @escaping (INCallRecordTypeOptionsResolutionResult) -> Void) @available(watchOS 4.0, *) + optional func resolveCallTypes(for intent: INSearchCallHistoryIntent) async -> INCallRecordTypeOptionsResolutionResult + @available(watchOS 4.0, *) optional func resolveUnseen(for intent: INSearchCallHistoryIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) + @available(watchOS 4.0, *) + optional func resolveUnseen(for intent: INSearchCallHistoryIntent) async -> INBooleanResolutionResult } diff --git a/watchOS/Intents/INSearchForAccountsIntent.swift b/watchOS/Intents/INSearchForAccountsIntent.swift index e7d7bc2..c017f2e 100644 --- a/watchOS/Intents/INSearchForAccountsIntent.swift +++ b/watchOS/Intents/INSearchForAccountsIntent.swift @@ -10,9 +10,15 @@ class INSearchForAccountsIntent : INIntent { @available(watchOS 4.0, *) protocol INSearchForAccountsIntentHandling : NSObjectProtocol { func handle(intent: INSearchForAccountsIntent, completion: @escaping (INSearchForAccountsIntentResponse) -> Void) + func handle(intent: INSearchForAccountsIntent) async -> INSearchForAccountsIntentResponse optional func confirm(intent: INSearchForAccountsIntent, completion: @escaping (INSearchForAccountsIntentResponse) -> Void) + optional func confirm(intent: INSearchForAccountsIntent) async -> INSearchForAccountsIntentResponse optional func resolveAccountNickname(for intent: INSearchForAccountsIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveAccountNickname(for intent: INSearchForAccountsIntent) async -> INSpeakableStringResolutionResult optional func resolveAccountType(for intent: INSearchForAccountsIntent, with completion: @escaping (INAccountTypeResolutionResult) -> Void) + optional func resolveAccountType(for intent: INSearchForAccountsIntent) async -> INAccountTypeResolutionResult optional func resolveOrganizationName(for intent: INSearchForAccountsIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveOrganizationName(for intent: INSearchForAccountsIntent) async -> INSpeakableStringResolutionResult optional func resolveRequestedBalanceType(for intent: INSearchForAccountsIntent, with completion: @escaping (INBalanceTypeResolutionResult) -> Void) + optional func resolveRequestedBalanceType(for intent: INSearchForAccountsIntent) async -> INBalanceTypeResolutionResult } diff --git a/watchOS/Intents/INSearchForBillsIntent.swift b/watchOS/Intents/INSearchForBillsIntent.swift index aef1f1e..f87a1b7 100644 --- a/watchOS/Intents/INSearchForBillsIntent.swift +++ b/watchOS/Intents/INSearchForBillsIntent.swift @@ -11,10 +11,17 @@ class INSearchForBillsIntent : INIntent { @available(watchOS 3.2, *) protocol INSearchForBillsIntentHandling : NSObjectProtocol { func handle(intent: INSearchForBillsIntent, completion: @escaping (INSearchForBillsIntentResponse) -> Void) + func handle(intent: INSearchForBillsIntent) async -> INSearchForBillsIntentResponse optional func confirm(intent: INSearchForBillsIntent, completion: @escaping (INSearchForBillsIntentResponse) -> Void) + optional func confirm(intent: INSearchForBillsIntent) async -> INSearchForBillsIntentResponse optional func resolveBillPayee(for intent: INSearchForBillsIntent, with completion: @escaping (INBillPayeeResolutionResult) -> Void) + optional func resolveBillPayee(for intent: INSearchForBillsIntent) async -> INBillPayeeResolutionResult optional func resolvePaymentDateRange(for intent: INSearchForBillsIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolvePaymentDateRange(for intent: INSearchForBillsIntent) async -> INDateComponentsRangeResolutionResult optional func resolveBillType(for intent: INSearchForBillsIntent, with completion: @escaping (INBillTypeResolutionResult) -> Void) + optional func resolveBillType(for intent: INSearchForBillsIntent) async -> INBillTypeResolutionResult optional func resolveStatus(for intent: INSearchForBillsIntent, with completion: @escaping (INPaymentStatusResolutionResult) -> Void) + optional func resolveStatus(for intent: INSearchForBillsIntent) async -> INPaymentStatusResolutionResult optional func resolveDueDateRange(for intent: INSearchForBillsIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveDueDateRange(for intent: INSearchForBillsIntent) async -> INDateComponentsRangeResolutionResult } diff --git a/watchOS/Intents/INSearchForMediaIntent.swift b/watchOS/Intents/INSearchForMediaIntent.swift index d5b302a..ace89d2 100644 --- a/watchOS/Intents/INSearchForMediaIntent.swift +++ b/watchOS/Intents/INSearchForMediaIntent.swift @@ -8,6 +8,9 @@ class INSearchForMediaIntent : INIntent { @available(watchOS 6.0, *) protocol INSearchForMediaIntentHandling : NSObjectProtocol { func handle(intent: INSearchForMediaIntent, completion: @escaping (INSearchForMediaIntentResponse) -> Void) + func handle(intent: INSearchForMediaIntent) async -> INSearchForMediaIntentResponse optional func confirm(intent: INSearchForMediaIntent, completion: @escaping (INSearchForMediaIntentResponse) -> Void) + optional func confirm(intent: INSearchForMediaIntent) async -> INSearchForMediaIntentResponse optional func resolveMediaItems(for intent: INSearchForMediaIntent, with completion: @escaping ([INSearchForMediaMediaItemResolutionResult]) -> Void) + optional func resolveMediaItems(for intent: INSearchForMediaIntent) async -> [INSearchForMediaMediaItemResolutionResult] } diff --git a/watchOS/Intents/INSearchForMessagesIntent.swift b/watchOS/Intents/INSearchForMessagesIntent.swift index 752399a..c7bac37 100644 --- a/watchOS/Intents/INSearchForMessagesIntent.swift +++ b/watchOS/Intents/INSearchForMessagesIntent.swift @@ -27,13 +27,23 @@ class INSearchForMessagesIntent : INIntent { @available(watchOS 3.2, *) protocol INSearchForMessagesIntentHandling : NSObjectProtocol { func handle(intent: INSearchForMessagesIntent, completion: @escaping (INSearchForMessagesIntentResponse) -> Void) + func handle(intent: INSearchForMessagesIntent) async -> INSearchForMessagesIntentResponse optional func confirm(intent: INSearchForMessagesIntent, completion: @escaping (INSearchForMessagesIntentResponse) -> Void) + optional func confirm(intent: INSearchForMessagesIntent) async -> INSearchForMessagesIntentResponse optional func resolveRecipients(for intent: INSearchForMessagesIntent, with completion: @escaping ([INPersonResolutionResult]) -> Void) + optional func resolveRecipients(for intent: INSearchForMessagesIntent) async -> [INPersonResolutionResult] optional func resolveSenders(for intent: INSearchForMessagesIntent, with completion: @escaping ([INPersonResolutionResult]) -> Void) + optional func resolveSenders(for intent: INSearchForMessagesIntent) async -> [INPersonResolutionResult] optional func resolveAttributes(for intent: INSearchForMessagesIntent, with completion: @escaping (INMessageAttributeOptionsResolutionResult) -> Void) + optional func resolveAttributes(for intent: INSearchForMessagesIntent) async -> INMessageAttributeOptionsResolutionResult optional func resolveDateTimeRange(for intent: INSearchForMessagesIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveDateTimeRange(for intent: INSearchForMessagesIntent) async -> INDateComponentsRangeResolutionResult @available(watchOS, introduced: 3.2, deprecated: 4.0, message: "resolveGroupNamesForSearchForMessages:withCompletion: is deprecated. Use resolveSpeakableGroupNamesForSearchForMessages:withCompletion: instead") optional func resolveGroupNames(for intent: INSearchForMessagesIntent, with completion: @escaping ([INStringResolutionResult]) -> Void) + @available(watchOS, introduced: 3.2, deprecated: 4.0, message: "resolveGroupNamesForSearchForMessages:withCompletion: is deprecated. Use resolveSpeakableGroupNamesForSearchForMessages:withCompletion: instead") + optional func resolveGroupNames(for intent: INSearchForMessagesIntent) async -> [INStringResolutionResult] @available(watchOS 4.0, *) optional func resolveSpeakableGroupNames(for intent: INSearchForMessagesIntent, with completion: @escaping ([INSpeakableStringResolutionResult]) -> Void) + @available(watchOS 4.0, *) + optional func resolveSpeakableGroupNames(for intent: INSearchForMessagesIntent) async -> [INSpeakableStringResolutionResult] } diff --git a/watchOS/Intents/INSearchForNotebookItemsIntent.swift b/watchOS/Intents/INSearchForNotebookItemsIntent.swift index 72bd7ad..c30e433 100644 --- a/watchOS/Intents/INSearchForNotebookItemsIntent.swift +++ b/watchOS/Intents/INSearchForNotebookItemsIntent.swift @@ -21,17 +21,31 @@ class INSearchForNotebookItemsIntent : INIntent { @available(watchOS 4.0, *) protocol INSearchForNotebookItemsIntentHandling : NSObjectProtocol { func handle(intent: INSearchForNotebookItemsIntent, completion: @escaping (INSearchForNotebookItemsIntentResponse) -> Void) + func handle(intent: INSearchForNotebookItemsIntent) async -> INSearchForNotebookItemsIntentResponse optional func confirm(intent: INSearchForNotebookItemsIntent, completion: @escaping (INSearchForNotebookItemsIntentResponse) -> Void) + optional func confirm(intent: INSearchForNotebookItemsIntent) async -> INSearchForNotebookItemsIntentResponse optional func resolveTitle(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveTitle(for intent: INSearchForNotebookItemsIntent) async -> INSpeakableStringResolutionResult optional func resolveContent(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INStringResolutionResult) -> Void) + optional func resolveContent(for intent: INSearchForNotebookItemsIntent) async -> INStringResolutionResult optional func resolveItemType(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INNotebookItemTypeResolutionResult) -> Void) + optional func resolveItemType(for intent: INSearchForNotebookItemsIntent) async -> INNotebookItemTypeResolutionResult optional func resolveStatus(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INTaskStatusResolutionResult) -> Void) + optional func resolveStatus(for intent: INSearchForNotebookItemsIntent) async -> INTaskStatusResolutionResult optional func resolveLocation(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INPlacemarkResolutionResult) -> Void) + optional func resolveLocation(for intent: INSearchForNotebookItemsIntent) async -> INPlacemarkResolutionResult optional func resolveLocationSearchType(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INLocationSearchTypeResolutionResult) -> Void) + optional func resolveLocationSearchType(for intent: INSearchForNotebookItemsIntent) async -> INLocationSearchTypeResolutionResult optional func resolveDateTime(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveDateTime(for intent: INSearchForNotebookItemsIntent) async -> INDateComponentsRangeResolutionResult optional func resolveDateSearchType(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INDateSearchTypeResolutionResult) -> Void) + optional func resolveDateSearchType(for intent: INSearchForNotebookItemsIntent) async -> INDateSearchTypeResolutionResult @available(watchOS 6.0, *) optional func resolveTemporalEventTriggerTypes(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INTemporalEventTriggerTypeOptionsResolutionResult) -> Void) @available(watchOS 6.0, *) + optional func resolveTemporalEventTriggerTypes(for intent: INSearchForNotebookItemsIntent) async -> INTemporalEventTriggerTypeOptionsResolutionResult + @available(watchOS 6.0, *) optional func resolveTaskPriority(for intent: INSearchForNotebookItemsIntent, with completion: @escaping (INTaskPriorityResolutionResult) -> Void) + @available(watchOS 6.0, *) + optional func resolveTaskPriority(for intent: INSearchForNotebookItemsIntent) async -> INTaskPriorityResolutionResult } diff --git a/watchOS/Intents/INSearchForPhotosIntent.swift b/watchOS/Intents/INSearchForPhotosIntent.swift index f3acd67..0bd5ffe 100644 --- a/watchOS/Intents/INSearchForPhotosIntent.swift +++ b/watchOS/Intents/INSearchForPhotosIntent.swift @@ -15,11 +15,19 @@ class INSearchForPhotosIntent : INIntent { @available(watchOS 3.2, *) protocol INSearchForPhotosIntentHandling : NSObjectProtocol { func handle(intent: INSearchForPhotosIntent, completion: @escaping (INSearchForPhotosIntentResponse) -> Void) + func handle(intent: INSearchForPhotosIntent) async -> INSearchForPhotosIntentResponse optional func confirm(intent: INSearchForPhotosIntent, completion: @escaping (INSearchForPhotosIntentResponse) -> Void) + optional func confirm(intent: INSearchForPhotosIntent) async -> INSearchForPhotosIntentResponse optional func resolveDateCreated(for intent: INSearchForPhotosIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveDateCreated(for intent: INSearchForPhotosIntent) async -> INDateComponentsRangeResolutionResult optional func resolveLocationCreated(for intent: INSearchForPhotosIntent, with completion: @escaping (INPlacemarkResolutionResult) -> Void) + optional func resolveLocationCreated(for intent: INSearchForPhotosIntent) async -> INPlacemarkResolutionResult optional func resolveAlbumName(for intent: INSearchForPhotosIntent, with completion: @escaping (INStringResolutionResult) -> Void) + optional func resolveAlbumName(for intent: INSearchForPhotosIntent) async -> INStringResolutionResult @available(watchOS 4.0, *) optional func resolveSearchTerms(for intent: INSearchForPhotosIntent, with completion: @escaping ([INStringResolutionResult]) -> Void) + @available(watchOS 4.0, *) + optional func resolveSearchTerms(for intent: INSearchForPhotosIntent) async -> [INStringResolutionResult] optional func resolvePeopleInPhoto(for intent: INSearchForPhotosIntent, with completion: @escaping ([INPersonResolutionResult]) -> Void) + optional func resolvePeopleInPhoto(for intent: INSearchForPhotosIntent) async -> [INPersonResolutionResult] } diff --git a/watchOS/Intents/INSendMessageIntent.swift b/watchOS/Intents/INSendMessageIntent.swift index d7fdd01..f70ef0a 100644 --- a/watchOS/Intents/INSendMessageIntent.swift +++ b/watchOS/Intents/INSendMessageIntent.swift @@ -19,16 +19,29 @@ class INSendMessageIntent : INIntent { @available(watchOS 3.2, *) protocol INSendMessageIntentHandling : NSObjectProtocol { func handle(intent: INSendMessageIntent, completion: @escaping (INSendMessageIntentResponse) -> Void) + func handle(intent: INSendMessageIntent) async -> INSendMessageIntentResponse optional func confirm(intent: INSendMessageIntent, completion: @escaping (INSendMessageIntentResponse) -> Void) + optional func confirm(intent: INSendMessageIntent) async -> INSendMessageIntentResponse @available(watchOS, introduced: 3.2, deprecated: 4.0, message: "resolveRecipientsForSendMessage:withCompletion: is deprecated. Use resolveRecipientsForSendMessage:completion: instead") optional func resolveRecipients(for intent: INSendMessageIntent, with completion: @escaping ([INPersonResolutionResult]) -> Void) + @available(watchOS, introduced: 3.2, deprecated: 4.0, message: "resolveRecipientsForSendMessage:withCompletion: is deprecated. Use resolveRecipientsForSendMessage:completion: instead") + optional func resolveRecipients(for intent: INSendMessageIntent) async -> [INPersonResolutionResult] @available(watchOS 4.0, *) optional func resolveRecipients(for intent: INSendMessageIntent, with completion: @escaping ([INSendMessageRecipientResolutionResult]) -> Void) + @available(watchOS 4.0, *) + optional func resolveRecipients(for intent: INSendMessageIntent) async -> [INSendMessageRecipientResolutionResult] @available(watchOS, introduced: 3.2, deprecated: 4.0, message: "resolveGroupNameForSendMessage:withCompletion: is deprecated. Use resolveSpeakableGroupNameForSendMessage:withCompletion: instead") optional func resolveGroupName(for intent: INSendMessageIntent, with completion: @escaping (INStringResolutionResult) -> Void) + @available(watchOS, introduced: 3.2, deprecated: 4.0, message: "resolveGroupNameForSendMessage:withCompletion: is deprecated. Use resolveSpeakableGroupNameForSendMessage:withCompletion: instead") + optional func resolveGroupName(for intent: INSendMessageIntent) async -> INStringResolutionResult @available(watchOS 7.0, *) optional func resolveOutgoingMessageType(for intent: INSendMessageIntent, with completion: @escaping (INOutgoingMessageTypeResolutionResult) -> Void) + @available(watchOS 7.0, *) + optional func resolveOutgoingMessageType(for intent: INSendMessageIntent) async -> INOutgoingMessageTypeResolutionResult optional func resolveContent(for intent: INSendMessageIntent, with completion: @escaping (INStringResolutionResult) -> Void) + optional func resolveContent(for intent: INSendMessageIntent) async -> INStringResolutionResult @available(watchOS 4.0, *) optional func resolveSpeakableGroupName(for intent: INSendMessageIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + @available(watchOS 4.0, *) + optional func resolveSpeakableGroupName(for intent: INSendMessageIntent) async -> INSpeakableStringResolutionResult } diff --git a/watchOS/Intents/INSendPaymentIntent.swift b/watchOS/Intents/INSendPaymentIntent.swift index 1e56f51..6388aad 100644 --- a/watchOS/Intents/INSendPaymentIntent.swift +++ b/watchOS/Intents/INSendPaymentIntent.swift @@ -9,14 +9,25 @@ class INSendPaymentIntent : INIntent { @available(watchOS 3.2, *) protocol INSendPaymentIntentHandling : NSObjectProtocol { func handle(intent: INSendPaymentIntent, completion: @escaping (INSendPaymentIntentResponse) -> Void) + func handle(intent: INSendPaymentIntent) async -> INSendPaymentIntentResponse optional func confirm(intent: INSendPaymentIntent, completion: @escaping (INSendPaymentIntentResponse) -> Void) + optional func confirm(intent: INSendPaymentIntent) async -> INSendPaymentIntentResponse @available(watchOS, introduced: 3.2, deprecated: 4.0, message: "resolvePayeeForSendPayment:withCompletion: is deprecated. Use resolvePayeeForSendPayment:completion: instead") optional func resolvePayee(for intent: INSendPaymentIntent, with completion: @escaping (INPersonResolutionResult) -> Void) + @available(watchOS, introduced: 3.2, deprecated: 4.0, message: "resolvePayeeForSendPayment:withCompletion: is deprecated. Use resolvePayeeForSendPayment:completion: instead") + optional func resolvePayee(for intent: INSendPaymentIntent) async -> INPersonResolutionResult @available(watchOS 4.0, *) optional func resolvePayee(for intent: INSendPaymentIntent, with completion: @escaping (INSendPaymentPayeeResolutionResult) -> Void) + @available(watchOS 4.0, *) + optional func resolvePayee(for intent: INSendPaymentIntent) async -> INSendPaymentPayeeResolutionResult @available(watchOS, introduced: 3.2, deprecated: 4.0, message: "resolveCurrencyAmountForSendPayment:withCompletion: is deprecated. Use resolveCurrencyAmountForSendPayment:completion: instead") optional func resolveCurrencyAmount(for intent: INSendPaymentIntent, with completion: @escaping (INCurrencyAmountResolutionResult) -> Void) + @available(watchOS, introduced: 3.2, deprecated: 4.0, message: "resolveCurrencyAmountForSendPayment:withCompletion: is deprecated. Use resolveCurrencyAmountForSendPayment:completion: instead") + optional func resolveCurrencyAmount(for intent: INSendPaymentIntent) async -> INCurrencyAmountResolutionResult @available(watchOS 4.0, *) optional func resolveCurrencyAmount(for intent: INSendPaymentIntent, with completion: @escaping (INSendPaymentCurrencyAmountResolutionResult) -> Void) + @available(watchOS 4.0, *) + optional func resolveCurrencyAmount(for intent: INSendPaymentIntent) async -> INSendPaymentCurrencyAmountResolutionResult optional func resolveNote(for intent: INSendPaymentIntent, with completion: @escaping (INStringResolutionResult) -> Void) + optional func resolveNote(for intent: INSendPaymentIntent) async -> INStringResolutionResult } diff --git a/watchOS/Intents/INSetCarLockStatusIntent.swift b/watchOS/Intents/INSetCarLockStatusIntent.swift index b3f8ae2..981b450 100644 --- a/watchOS/Intents/INSetCarLockStatusIntent.swift +++ b/watchOS/Intents/INSetCarLockStatusIntent.swift @@ -16,7 +16,11 @@ extension INSetCarLockStatusIntent { @available(watchOS 3.2, *) protocol INSetCarLockStatusIntentHandling : NSObjectProtocol { func handle(intent: INSetCarLockStatusIntent, completion: @escaping (INSetCarLockStatusIntentResponse) -> Void) + func handle(intent: INSetCarLockStatusIntent) async -> INSetCarLockStatusIntentResponse optional func confirm(intent: INSetCarLockStatusIntent, completion: @escaping (INSetCarLockStatusIntentResponse) -> Void) + optional func confirm(intent: INSetCarLockStatusIntent) async -> INSetCarLockStatusIntentResponse optional func resolveLocked(for intent: INSetCarLockStatusIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) + optional func resolveLocked(for intent: INSetCarLockStatusIntent) async -> INBooleanResolutionResult optional func resolveCarName(for intent: INSetCarLockStatusIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveCarName(for intent: INSetCarLockStatusIntent) async -> INSpeakableStringResolutionResult } diff --git a/watchOS/Intents/INSetTaskAttributeIntent.swift b/watchOS/Intents/INSetTaskAttributeIntent.swift index 5673a81..b0e4845 100644 --- a/watchOS/Intents/INSetTaskAttributeIntent.swift +++ b/watchOS/Intents/INSetTaskAttributeIntent.swift @@ -15,16 +15,29 @@ class INSetTaskAttributeIntent : INIntent { @available(watchOS 4.0, *) protocol INSetTaskAttributeIntentHandling : NSObjectProtocol { func handle(intent: INSetTaskAttributeIntent, completion: @escaping (INSetTaskAttributeIntentResponse) -> Void) + func handle(intent: INSetTaskAttributeIntent) async -> INSetTaskAttributeIntentResponse optional func confirm(intent: INSetTaskAttributeIntent, completion: @escaping (INSetTaskAttributeIntentResponse) -> Void) + optional func confirm(intent: INSetTaskAttributeIntent) async -> INSetTaskAttributeIntentResponse optional func resolveTargetTask(for intent: INSetTaskAttributeIntent, with completion: @escaping (INTaskResolutionResult) -> Void) + optional func resolveTargetTask(for intent: INSetTaskAttributeIntent) async -> INTaskResolutionResult @available(watchOS 6.0, *) optional func resolveTaskTitle(for intent: INSetTaskAttributeIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + @available(watchOS 6.0, *) + optional func resolveTaskTitle(for intent: INSetTaskAttributeIntent) async -> INSpeakableStringResolutionResult optional func resolveStatus(for intent: INSetTaskAttributeIntent, with completion: @escaping (INTaskStatusResolutionResult) -> Void) + optional func resolveStatus(for intent: INSetTaskAttributeIntent) async -> INTaskStatusResolutionResult @available(watchOS 6.0, *) optional func resolvePriority(for intent: INSetTaskAttributeIntent, with completion: @escaping (INTaskPriorityResolutionResult) -> Void) + @available(watchOS 6.0, *) + optional func resolvePriority(for intent: INSetTaskAttributeIntent) async -> INTaskPriorityResolutionResult optional func resolveSpatialEventTrigger(for intent: INSetTaskAttributeIntent, with completion: @escaping (INSpatialEventTriggerResolutionResult) -> Void) + optional func resolveSpatialEventTrigger(for intent: INSetTaskAttributeIntent) async -> INSpatialEventTriggerResolutionResult @available(watchOS, introduced: 4.0, deprecated: 6.0, message: "resolveTemporalEventTriggerForSetTaskAttribute:withCompletion: is deprecated. Use resolveTemporalEventTriggerForSetTaskAttribute:completion: instead") optional func resolveTemporalEventTrigger(for intent: INSetTaskAttributeIntent, with completion: @escaping (INTemporalEventTriggerResolutionResult) -> Void) + @available(watchOS, introduced: 4.0, deprecated: 6.0, message: "resolveTemporalEventTriggerForSetTaskAttribute:withCompletion: is deprecated. Use resolveTemporalEventTriggerForSetTaskAttribute:completion: instead") + optional func resolveTemporalEventTrigger(for intent: INSetTaskAttributeIntent) async -> INTemporalEventTriggerResolutionResult @available(watchOS 6.0, *) optional func resolveTemporalEventTrigger(for intent: INSetTaskAttributeIntent, with completion: @escaping (INSetTaskAttributeTemporalEventTriggerResolutionResult) -> Void) + @available(watchOS 6.0, *) + optional func resolveTemporalEventTrigger(for intent: INSetTaskAttributeIntent) async -> INSetTaskAttributeTemporalEventTriggerResolutionResult } diff --git a/watchOS/Intents/INSnoozeTasksIntent.swift b/watchOS/Intents/INSnoozeTasksIntent.swift index 834e681..92b79d0 100644 --- a/watchOS/Intents/INSnoozeTasksIntent.swift +++ b/watchOS/Intents/INSnoozeTasksIntent.swift @@ -17,7 +17,11 @@ extension INSnoozeTasksIntent { @available(watchOS 6.0, *) protocol INSnoozeTasksIntentHandling : NSObjectProtocol { func handle(intent: INSnoozeTasksIntent, completion: @escaping (INSnoozeTasksIntentResponse) -> Void) + func handle(intent: INSnoozeTasksIntent) async -> INSnoozeTasksIntentResponse optional func confirm(intent: INSnoozeTasksIntent, completion: @escaping (INSnoozeTasksIntentResponse) -> Void) + optional func confirm(intent: INSnoozeTasksIntent) async -> INSnoozeTasksIntentResponse optional func resolveTasks(for intent: INSnoozeTasksIntent, with completion: @escaping ([INSnoozeTasksTaskResolutionResult]) -> Void) + optional func resolveTasks(for intent: INSnoozeTasksIntent) async -> [INSnoozeTasksTaskResolutionResult] optional func resolveNextTriggerTime(for intent: INSnoozeTasksIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveNextTriggerTime(for intent: INSnoozeTasksIntent) async -> INDateComponentsRangeResolutionResult } diff --git a/watchOS/Intents/INStartAudioCallIntent.swift b/watchOS/Intents/INStartAudioCallIntent.swift index cfd3852..0396ee7 100644 --- a/watchOS/Intents/INStartAudioCallIntent.swift +++ b/watchOS/Intents/INStartAudioCallIntent.swift @@ -10,8 +10,13 @@ class INStartAudioCallIntent : INIntent { @available(watchOS, introduced: 3.2, deprecated: 6.0, message: "INStartAudioCallIntent is deprecated. Please adopt INStartCallIntent instead") protocol INStartAudioCallIntentHandling : NSObjectProtocol { func handle(intent: INStartAudioCallIntent, completion: @escaping (INStartAudioCallIntentResponse) -> Void) + func handle(intent: INStartAudioCallIntent) async -> INStartAudioCallIntentResponse optional func confirm(intent: INStartAudioCallIntent, completion: @escaping (INStartAudioCallIntentResponse) -> Void) + optional func confirm(intent: INStartAudioCallIntent) async -> INStartAudioCallIntentResponse @available(watchOS 4.0, *) optional func resolveDestinationType(for intent: INStartAudioCallIntent, with completion: @escaping (INCallDestinationTypeResolutionResult) -> Void) + @available(watchOS 4.0, *) + optional func resolveDestinationType(for intent: INStartAudioCallIntent) async -> INCallDestinationTypeResolutionResult optional func resolveContacts(for intent: INStartAudioCallIntent, with completion: @escaping ([INPersonResolutionResult]) -> Void) + optional func resolveContacts(for intent: INStartAudioCallIntent) async -> [INPersonResolutionResult] } diff --git a/watchOS/Intents/INStartCallIntent.swift b/watchOS/Intents/INStartCallIntent.swift index 4c1c7d1..fff1fa1 100644 --- a/watchOS/Intents/INStartCallIntent.swift +++ b/watchOS/Intents/INStartCallIntent.swift @@ -15,10 +15,17 @@ class INStartCallIntent : INIntent { @available(watchOS 6.0, *) protocol INStartCallIntentHandling : NSObjectProtocol { func handle(intent: INStartCallIntent, completion: @escaping (INStartCallIntentResponse) -> Void) + func handle(intent: INStartCallIntent) async -> INStartCallIntentResponse optional func confirm(intent: INStartCallIntent, completion: @escaping (INStartCallIntentResponse) -> Void) + optional func confirm(intent: INStartCallIntent) async -> INStartCallIntentResponse @available(watchOS 7.0, *) optional func resolveCallRecordToCallBack(for intent: INStartCallIntent, with completion: @escaping (INCallRecordResolutionResult) -> Void) + @available(watchOS 7.0, *) + optional func resolveCallRecordToCallBack(for intent: INStartCallIntent) async -> INCallRecordResolutionResult optional func resolveDestinationType(for intent: INStartCallIntent, with completion: @escaping (INCallDestinationTypeResolutionResult) -> Void) + optional func resolveDestinationType(for intent: INStartCallIntent) async -> INCallDestinationTypeResolutionResult optional func resolveContacts(for intent: INStartCallIntent, with completion: @escaping ([INStartCallContactResolutionResult]) -> Void) + optional func resolveContacts(for intent: INStartCallIntent) async -> [INStartCallContactResolutionResult] optional func resolveCallCapability(for intent: INStartCallIntent, with completion: @escaping (INStartCallCallCapabilityResolutionResult) -> Void) + optional func resolveCallCapability(for intent: INStartCallIntent) async -> INStartCallCallCapabilityResolutionResult } diff --git a/watchOS/Intents/INStartPhotoPlaybackIntent.swift b/watchOS/Intents/INStartPhotoPlaybackIntent.swift index f63a641..348aa0e 100644 --- a/watchOS/Intents/INStartPhotoPlaybackIntent.swift +++ b/watchOS/Intents/INStartPhotoPlaybackIntent.swift @@ -15,9 +15,15 @@ class INStartPhotoPlaybackIntent : INIntent { @available(watchOS 3.2, *) protocol INStartPhotoPlaybackIntentHandling : NSObjectProtocol { func handle(intent: INStartPhotoPlaybackIntent, completion: @escaping (INStartPhotoPlaybackIntentResponse) -> Void) + func handle(intent: INStartPhotoPlaybackIntent) async -> INStartPhotoPlaybackIntentResponse optional func confirm(intent: INStartPhotoPlaybackIntent, completion: @escaping (INStartPhotoPlaybackIntentResponse) -> Void) + optional func confirm(intent: INStartPhotoPlaybackIntent) async -> INStartPhotoPlaybackIntentResponse optional func resolveDateCreated(for intent: INStartPhotoPlaybackIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveDateCreated(for intent: INStartPhotoPlaybackIntent) async -> INDateComponentsRangeResolutionResult optional func resolveLocationCreated(for intent: INStartPhotoPlaybackIntent, with completion: @escaping (INPlacemarkResolutionResult) -> Void) + optional func resolveLocationCreated(for intent: INStartPhotoPlaybackIntent) async -> INPlacemarkResolutionResult optional func resolveAlbumName(for intent: INStartPhotoPlaybackIntent, with completion: @escaping (INStringResolutionResult) -> Void) + optional func resolveAlbumName(for intent: INStartPhotoPlaybackIntent) async -> INStringResolutionResult optional func resolvePeopleInPhoto(for intent: INStartPhotoPlaybackIntent, with completion: @escaping ([INPersonResolutionResult]) -> Void) + optional func resolvePeopleInPhoto(for intent: INStartPhotoPlaybackIntent) async -> [INPersonResolutionResult] } diff --git a/watchOS/Intents/INStartWorkoutIntent.swift b/watchOS/Intents/INStartWorkoutIntent.swift index dce7959..8a5a280 100644 --- a/watchOS/Intents/INStartWorkoutIntent.swift +++ b/watchOS/Intents/INStartWorkoutIntent.swift @@ -20,10 +20,17 @@ extension INStartWorkoutIntent { @available(watchOS 3.2, *) protocol INStartWorkoutIntentHandling : NSObjectProtocol { func handle(intent: INStartWorkoutIntent, completion: @escaping (INStartWorkoutIntentResponse) -> Void) + func handle(intent: INStartWorkoutIntent) async -> INStartWorkoutIntentResponse optional func confirm(intent: INStartWorkoutIntent, completion: @escaping (INStartWorkoutIntentResponse) -> Void) + optional func confirm(intent: INStartWorkoutIntent) async -> INStartWorkoutIntentResponse optional func resolveWorkoutName(for intent: INStartWorkoutIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Void) + optional func resolveWorkoutName(for intent: INStartWorkoutIntent) async -> INSpeakableStringResolutionResult optional func resolveGoalValue(for intent: INStartWorkoutIntent, with completion: @escaping (INDoubleResolutionResult) -> Void) + optional func resolveGoalValue(for intent: INStartWorkoutIntent) async -> INDoubleResolutionResult optional func resolveWorkoutGoalUnitType(for intent: INStartWorkoutIntent, with completion: @escaping (INWorkoutGoalUnitTypeResolutionResult) -> Void) + optional func resolveWorkoutGoalUnitType(for intent: INStartWorkoutIntent) async -> INWorkoutGoalUnitTypeResolutionResult optional func resolveWorkoutLocationType(for intent: INStartWorkoutIntent, with completion: @escaping (INWorkoutLocationTypeResolutionResult) -> Void) + optional func resolveWorkoutLocationType(for intent: INStartWorkoutIntent) async -> INWorkoutLocationTypeResolutionResult optional func resolveIsOpenEnded(for intent: INStartWorkoutIntent, with completion: @escaping (INBooleanResolutionResult) -> Void) + optional func resolveIsOpenEnded(for intent: INStartWorkoutIntent) async -> INBooleanResolutionResult } diff --git a/watchOS/Intents/INTransferMoneyIntent.swift b/watchOS/Intents/INTransferMoneyIntent.swift index 3f5d7fa..ee8df21 100644 --- a/watchOS/Intents/INTransferMoneyIntent.swift +++ b/watchOS/Intents/INTransferMoneyIntent.swift @@ -11,10 +11,17 @@ class INTransferMoneyIntent : INIntent { @available(watchOS 4.0, *) protocol INTransferMoneyIntentHandling : NSObjectProtocol { func handle(intent: INTransferMoneyIntent, completion: @escaping (INTransferMoneyIntentResponse) -> Void) + func handle(intent: INTransferMoneyIntent) async -> INTransferMoneyIntentResponse optional func confirm(intent: INTransferMoneyIntent, completion: @escaping (INTransferMoneyIntentResponse) -> Void) + optional func confirm(intent: INTransferMoneyIntent) async -> INTransferMoneyIntentResponse optional func resolveFromAccount(for intent: INTransferMoneyIntent, with completion: @escaping (INPaymentAccountResolutionResult) -> Void) + optional func resolveFromAccount(for intent: INTransferMoneyIntent) async -> INPaymentAccountResolutionResult optional func resolveToAccount(for intent: INTransferMoneyIntent, with completion: @escaping (INPaymentAccountResolutionResult) -> Void) + optional func resolveToAccount(for intent: INTransferMoneyIntent) async -> INPaymentAccountResolutionResult optional func resolveTransactionAmount(for intent: INTransferMoneyIntent, with completion: @escaping (INPaymentAmountResolutionResult) -> Void) + optional func resolveTransactionAmount(for intent: INTransferMoneyIntent) async -> INPaymentAmountResolutionResult optional func resolveTransactionScheduledDate(for intent: INTransferMoneyIntent, with completion: @escaping (INDateComponentsRangeResolutionResult) -> Void) + optional func resolveTransactionScheduledDate(for intent: INTransferMoneyIntent) async -> INDateComponentsRangeResolutionResult optional func resolveTransactionNote(for intent: INTransferMoneyIntent, with completion: @escaping (INStringResolutionResult) -> Void) + optional func resolveTransactionNote(for intent: INTransferMoneyIntent) async -> INStringResolutionResult } diff --git a/watchOS/Intents/INUpdateMediaAffinityIntent.swift b/watchOS/Intents/INUpdateMediaAffinityIntent.swift index fdc8994..3099718 100644 --- a/watchOS/Intents/INUpdateMediaAffinityIntent.swift +++ b/watchOS/Intents/INUpdateMediaAffinityIntent.swift @@ -9,7 +9,11 @@ class INUpdateMediaAffinityIntent : INIntent { @available(watchOS 6.0, *) protocol INUpdateMediaAffinityIntentHandling : NSObjectProtocol { func handle(intent: INUpdateMediaAffinityIntent, completion: @escaping (INUpdateMediaAffinityIntentResponse) -> Void) + func handle(intent: INUpdateMediaAffinityIntent) async -> INUpdateMediaAffinityIntentResponse optional func confirm(intent: INUpdateMediaAffinityIntent, completion: @escaping (INUpdateMediaAffinityIntentResponse) -> Void) + optional func confirm(intent: INUpdateMediaAffinityIntent) async -> INUpdateMediaAffinityIntentResponse optional func resolveMediaItems(for intent: INUpdateMediaAffinityIntent, with completion: @escaping ([INUpdateMediaAffinityMediaItemResolutionResult]) -> Void) + optional func resolveMediaItems(for intent: INUpdateMediaAffinityIntent) async -> [INUpdateMediaAffinityMediaItemResolutionResult] optional func resolveAffinityType(for intent: INUpdateMediaAffinityIntent, with completion: @escaping (INMediaAffinityTypeResolutionResult) -> Void) + optional func resolveAffinityType(for intent: INUpdateMediaAffinityIntent) async -> INMediaAffinityTypeResolutionResult } diff --git a/watchOS/Intents/INVoiceShortcutCenter.swift b/watchOS/Intents/INVoiceShortcutCenter.swift index 2174e71..b898752 100644 --- a/watchOS/Intents/INVoiceShortcutCenter.swift +++ b/watchOS/Intents/INVoiceShortcutCenter.swift @@ -3,6 +3,8 @@ class INVoiceShortcutCenter : NSObject { class var shared: INVoiceShortcutCenter { get } func getAllVoiceShortcuts(completion completionHandler: @escaping ([INVoiceShortcut]?, Error?) -> Void) + func getAllVoiceShortcuts() async throws -> [INVoiceShortcut]? func getVoiceShortcut(with identifier: UUID, completion completionHandler: @escaping (INVoiceShortcut?, Error?) -> Void) + func getVoiceShortcut(with identifier: UUID) async throws -> INVoiceShortcut? func setShortcutSuggestions(_ suggestions: [INShortcut]) } diff --git a/watchOS/NaturalLanguage/NLTagger.swift b/watchOS/NaturalLanguage/NLTagger.swift index d0ed345..90e637b 100644 --- a/watchOS/NaturalLanguage/NLTagger.swift +++ b/watchOS/NaturalLanguage/NLTagger.swift @@ -37,6 +37,8 @@ class NLTagger : NSObject { func gazetteers(for tagScheme: NLTagScheme) -> [NLGazetteer] @available(watchOS 6.0, *) class func requestAssets(for language: NLLanguage, tagScheme: NLTagScheme, completionHandler: @escaping (NLTagger.AssetsResult, Error?) -> Void) + @available(watchOS 6.0, *) + class func requestAssets(for language: NLLanguage, tagScheme: NLTagScheme) async throws -> NLTagger.AssetsResult } @available(macOS 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *) diff --git a/watchOS/NetworkExtension/NetworkExtension.swift b/watchOS/NetworkExtension/NetworkExtension.swift index 05b08ec..11239cc 100644 --- a/watchOS/NetworkExtension/NetworkExtension.swift +++ b/watchOS/NetworkExtension/NetworkExtension.swift @@ -36,6 +36,8 @@ class NEHotspotNetwork : NSObject { var bssid: String { get } @available(watchOS 7.0, *) class func fetchCurrent(completionHandler: @escaping (NEHotspotNetwork?) -> Void) + @available(watchOS 7.0, *) + class func fetchCurrent() async -> NEHotspotNetwork? } extension NSMutableURLRequest { } @@ -91,9 +93,13 @@ class NEHotspotConfigurationManager : NSObject { @available(watchOS 7.0, *) func apply(_ configuration: NEHotspotConfiguration, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 7.0, *) + func apply(_ configuration: NEHotspotConfiguration) async throws + @available(watchOS 7.0, *) func removeConfiguration(forSSID SSID: String) @available(watchOS 7.0, *) func getConfiguredSSIDs(completionHandler: @escaping ([String]) -> Void) + @available(watchOS 7.0, *) + func getConfiguredSSIDs() async -> [String] } @available(watchOS 2.0, *) class NEIPv6Route : NSObject, NSSecureCoding, NSCopying { diff --git a/watchOS/PassKit/PKPassLibrary.swift b/watchOS/PassKit/PKPassLibrary.swift index 1066383..d6d5d01 100644 --- a/watchOS/PassKit/PKPassLibrary.swift +++ b/watchOS/PassKit/PKPassLibrary.swift @@ -31,6 +31,8 @@ class PKPassLibrary : NSObject { func replacePass(with pass: PKPass) -> Bool @available(watchOS 3.0, *) func addPasses(_ passes: [PKPass], withCompletionHandler completion: ((PKPassLibraryAddPassesStatus) -> Void)? = nil) + @available(watchOS 3.0, *) + func addPasses(_ passes: [PKPass]) async -> PKPassLibraryAddPassesStatus @available(watchOS, introduced: 2.0, deprecated: 99993, message: "Use -[PKPassLibrary canAddSecureElementPassWithPrimaryAccountIdentifier] instead") func canAddPaymentPass(withPrimaryAccountIdentifier primaryAccountIdentifier: String) -> Bool @available(watchOS 6.4, *) @@ -39,8 +41,12 @@ class PKPassLibrary : NSObject { func canAddFelicaPass() -> Bool @available(watchOS, introduced: 2.0, deprecated: 99993, message: "Use activateSecureElementPass:withActivationData:completion: instead") func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data, completion: ((Bool, Error) -> Void)? = nil) + @available(watchOS, introduced: 2.0, deprecated: 99993, message: "Use activateSecureElementPass:withActivationData:completion: instead") + func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data) async -> (Bool, Error) @available(watchOS 6.2, *) func sign(_ signData: Data, using secureElementPass: PKSecureElementPass, completion: @escaping (Data?, Data?, Error?) -> Void) + @available(watchOS 6.2, *) + func sign(_ signData: Data, using secureElementPass: PKSecureElementPass) async throws -> (Data?, Data?) } struct PKPassLibraryNotificationName : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable { init(_ rawValue: String) diff --git a/watchOS/PassKit/PKPaymentAuthorizationController.swift b/watchOS/PassKit/PKPaymentAuthorizationController.swift index 869a316..452fbfe 100644 --- a/watchOS/PassKit/PKPaymentAuthorizationController.swift +++ b/watchOS/PassKit/PKPaymentAuthorizationController.swift @@ -1,27 +1,43 @@ protocol PKPaymentAuthorizationControllerDelegate : NSObjectProtocol { @available(watchOS 3.0, *) - func paymentAuthorizationControllerDidFinish(_ controller: PKPaymentAuthorizationController) + @asyncHandler func paymentAuthorizationControllerDidFinish(_ controller: PKPaymentAuthorizationController) @available(watchOS 4.0, *) - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) + @available(watchOS 4.0, *) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationResult + @available(watchOS, introduced: 3.0, deprecated: 4.0, message: "Use paymentAuthorizationController:didAuthorizePayment:handler: instead to provide more granular errors") + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) @available(watchOS, introduced: 3.0, deprecated: 4.0, message: "Use paymentAuthorizationController:didAuthorizePayment:handler: instead to provide more granular errors") - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationStatus @available(watchOS 3.0, *) optional func paymentAuthorizationControllerWillAuthorizePayment(_ controller: PKPaymentAuthorizationController) @available(watchOS 7.0, *) - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) + @available(watchOS 4.0, *) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) + @available(watchOS 4.0, *) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod) async -> PKPaymentRequestShippingMethodUpdate @available(watchOS 4.0, *) - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) @available(watchOS 4.0, *) - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact) async -> PKPaymentRequestShippingContactUpdate @available(watchOS 4.0, *) - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) + @available(watchOS 4.0, *) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod) async -> PKPaymentRequestPaymentMethodUpdate + @available(watchOS, introduced: 3.0, deprecated: 4.0, message: "Use paymentAuthorizationController:didSelectShippingMethod:handler: instead to provide more granular errors") + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) @available(watchOS, introduced: 3.0, deprecated: 4.0, message: "Use paymentAuthorizationController:didSelectShippingMethod:handler: instead to provide more granular errors") - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod) async -> (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) @available(watchOS, introduced: 3.0, deprecated: 4.0, message: "Use paymentAuthorizationController:didSelectShippingContact:handler: instead to provide more granular errors") - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) + @available(watchOS, introduced: 3.0, deprecated: 4.0, message: "Use paymentAuthorizationController:didSelectShippingContact:handler: instead to provide more granular errors") + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact) async -> (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) + @available(watchOS, introduced: 3.0, deprecated: 4.0, message: "Use paymentAuthorizationController:didSelectPaymentMethod:handler: instead to provide more granular errors") + @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) @available(watchOS, introduced: 3.0, deprecated: 4.0, message: "Use paymentAuthorizationController:didSelectPaymentMethod:handler: instead to provide more granular errors") - optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod) async -> [PKPaymentSummaryItem] } @available(watchOS 3.0, *) class PKPaymentAuthorizationController : NSObject { @@ -31,5 +47,7 @@ class PKPaymentAuthorizationController : NSObject { weak var delegate: @sil_weak PKPaymentAuthorizationControllerDelegate? init(paymentRequest request: PKPaymentRequest) func present(completion: ((Bool) -> Void)? = nil) + func present() async -> Bool func dismiss(completion: (() -> Void)? = nil) + func dismiss() async } diff --git a/watchOS/PassKit/PKPaymentInformationEventExtension.swift b/watchOS/PassKit/PKPaymentInformationEventExtension.swift index 0afc22b..3eb3e36 100644 --- a/watchOS/PassKit/PKPaymentInformationEventExtension.swift +++ b/watchOS/PassKit/PKPaymentInformationEventExtension.swift @@ -8,7 +8,13 @@ protocol PKPaymentInformationRequestHandling { @available(watchOS 7.0, *) func handleInformationRequest(_ infoRequest: PKBarcodeEventMetadataRequest, completion: @escaping PKInformationRequestCompletionBlock) @available(watchOS 7.0, *) + func handleInformationRequest(_ infoRequest: PKBarcodeEventMetadataRequest) async -> PKBarcodeEventMetadataResponse + @available(watchOS 7.0, *) func handle(_ signatureRequest: PKBarcodeEventSignatureRequest, completion: @escaping PKSignatureRequestCompletionBlock) @available(watchOS 7.0, *) + func handle(_ signatureRequest: PKBarcodeEventSignatureRequest) async -> PKBarcodeEventSignatureResponse + @available(watchOS 7.0, *) func handle(_ configurationRequest: PKBarcodeEventConfigurationRequest, completion: @escaping () -> Void) + @available(watchOS 7.0, *) + func handle(_ configurationRequest: PKBarcodeEventConfigurationRequest) async } diff --git a/watchOS/PushKit/PKPushRegistry.swift b/watchOS/PushKit/PKPushRegistry.swift index b642cea..ab6aca5 100644 --- a/watchOS/PushKit/PKPushRegistry.swift +++ b/watchOS/PushKit/PKPushRegistry.swift @@ -12,9 +12,11 @@ class PKPushRegistry : NSObject { } protocol PKPushRegistryDelegate : NSObjectProtocol { @available(watchOS 6.0, *) - func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) + @asyncHandler func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) @available(watchOS 6.0, *) - optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) + @asyncHandler optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) @available(watchOS 6.0, *) - optional func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType) + optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType) async + @available(watchOS 6.0, *) + @asyncHandler optional func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType) } diff --git a/watchOS/SceneKit/SCNAction.swift b/watchOS/SceneKit/SCNAction.swift index 1420d82..a63ed1b 100644 --- a/watchOS/SceneKit/SCNAction.swift +++ b/watchOS/SceneKit/SCNAction.swift @@ -3,8 +3,10 @@ typealias SCNActionTimingFunction = (Float) -> Float protocol SCNActionable : NSObjectProtocol { func runAction(_ action: SCNAction) func runAction(_ action: SCNAction, completionHandler block: (() -> Void)? = nil) + func runAction(_ action: SCNAction) async func runAction(_ action: SCNAction, forKey key: String?) func runAction(_ action: SCNAction, forKey key: String?, completionHandler block: (() -> Void)? = nil) + func runAction(_ action: SCNAction, forKey key: String?) async var hasActions: Bool { get } func action(forKey key: String) -> SCNAction? func removeAction(forKey key: String) diff --git a/watchOS/SceneKit/SCNCameraController.swift b/watchOS/SceneKit/SCNCameraController.swift index 81c9a93..9675215 100644 --- a/watchOS/SceneKit/SCNCameraController.swift +++ b/watchOS/SceneKit/SCNCameraController.swift @@ -14,7 +14,7 @@ enum SCNInteractionMode : Int { @available(watchOS 4.0, *) protocol SCNCameraControllerDelegate : NSObjectProtocol { optional func cameraInertiaWillStart(for cameraController: SCNCameraController) - optional func cameraInertiaDidEnd(for cameraController: SCNCameraController) + @asyncHandler optional func cameraInertiaDidEnd(for cameraController: SCNCameraController) } @available(watchOS 4.0, *) class SCNCameraController : NSObject { diff --git a/watchOS/SceneKit/SCNConstraint.swift b/watchOS/SceneKit/SCNConstraint.swift index b66a20c..023fb4e 100644 --- a/watchOS/SceneKit/SCNConstraint.swift +++ b/watchOS/SceneKit/SCNConstraint.swift @@ -78,7 +78,7 @@ class SCNSliderConstraint : SCNConstraint { @available(watchOS 4.0, *) protocol SCNAvoidOccluderConstraintDelegate : NSObjectProtocol { optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, shouldAvoidOccluder occluder: SCNNode, for node: SCNNode) -> Bool - optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, didAvoidOccluder occluder: SCNNode, for node: SCNNode) + @asyncHandler optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, didAvoidOccluder occluder: SCNNode, for node: SCNNode) } @available(watchOS 4.0, *) class SCNAvoidOccluderConstraint : SCNConstraint { diff --git a/watchOS/SceneKit/SCNPhysicsWorld.swift b/watchOS/SceneKit/SCNPhysicsWorld.swift index 74bf4d8..49f7d9b 100644 --- a/watchOS/SceneKit/SCNPhysicsWorld.swift +++ b/watchOS/SceneKit/SCNPhysicsWorld.swift @@ -22,9 +22,9 @@ extension SCNPhysicsWorld.TestSearchMode { static let all: SCNPhysicsWorld.TestSearchMode } protocol SCNPhysicsContactDelegate : NSObjectProtocol { - optional func physicsWorld(_ world: SCNPhysicsWorld, didBegin contact: SCNPhysicsContact) - optional func physicsWorld(_ world: SCNPhysicsWorld, didUpdate contact: SCNPhysicsContact) - optional func physicsWorld(_ world: SCNPhysicsWorld, didEnd contact: SCNPhysicsContact) + @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didBegin contact: SCNPhysicsContact) + @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didUpdate contact: SCNPhysicsContact) + @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didEnd contact: SCNPhysicsContact) } class SCNPhysicsWorld : NSObject, NSSecureCoding { var gravity: SCNVector3 diff --git a/watchOS/SceneKit/SCNSceneRenderer.swift b/watchOS/SceneKit/SCNSceneRenderer.swift index 93e6a0f..f092225 100644 --- a/watchOS/SceneKit/SCNSceneRenderer.swift +++ b/watchOS/SceneKit/SCNSceneRenderer.swift @@ -53,6 +53,7 @@ protocol SCNSceneRenderer : NSObjectProtocol { var isTemporalAntialiasingEnabled: Bool { get set } func prepare(_ object: Any, shouldAbortBlock block: (() -> Bool)? = nil) -> Bool func prepare(_ objects: [Any], completionHandler: ((Bool) -> Void)? = nil) + func prepare(_ objects: [Any]) async -> Bool var showsStatistics: Bool { get set } @available(watchOS 2.0, *) var debugOptions: SCNDebugOptions { get set } @@ -67,10 +68,10 @@ protocol SCNSceneRenderer : NSObjectProtocol { } protocol SCNSceneRendererDelegate : NSObjectProtocol { optional func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) - optional func renderer(_ renderer: SCNSceneRenderer, didApplyAnimationsAtTime time: TimeInterval) - optional func renderer(_ renderer: SCNSceneRenderer, didSimulatePhysicsAtTime time: TimeInterval) + @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didApplyAnimationsAtTime time: TimeInterval) + @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didSimulatePhysicsAtTime time: TimeInterval) @available(watchOS 4.0, *) - optional func renderer(_ renderer: SCNSceneRenderer, didApplyConstraintsAtTime time: TimeInterval) + @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didApplyConstraintsAtTime time: TimeInterval) optional func renderer(_ renderer: SCNSceneRenderer, willRenderScene scene: SCNScene, atTime time: TimeInterval) - optional func renderer(_ renderer: SCNSceneRenderer, didRenderScene scene: SCNScene, atTime time: TimeInterval) + @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didRenderScene scene: SCNScene, atTime time: TimeInterval) } diff --git a/watchOS/SoundAnalysis/SNAnalyzer.swift b/watchOS/SoundAnalysis/SNAnalyzer.swift index 54ce701..919d21d 100644 --- a/watchOS/SoundAnalysis/SNAnalyzer.swift +++ b/watchOS/SoundAnalysis/SNAnalyzer.swift @@ -16,5 +16,6 @@ class SNAudioFileAnalyzer : NSObject { func removeAllRequests() func analyze() func analyze(completionHandler: @escaping (Bool) -> Void) + func analyze() async -> Bool func cancelAnalysis() } diff --git a/watchOS/SoundAnalysis/SNResult.swift b/watchOS/SoundAnalysis/SNResult.swift index 856fde1..e495d8a 100644 --- a/watchOS/SoundAnalysis/SNResult.swift +++ b/watchOS/SoundAnalysis/SNResult.swift @@ -4,7 +4,7 @@ protocol SNResult : NSObjectProtocol { } @available(watchOS 6.0, *) protocol SNResultsObserving : NSObjectProtocol { - func request(_ request: SNRequest, didProduce result: SNResult) - optional func request(_ request: SNRequest, didFailWithError error: Error) - optional func requestDidComplete(_ request: SNRequest) + @asyncHandler func request(_ request: SNRequest, didProduce result: SNResult) + @asyncHandler optional func request(_ request: SNRequest, didFailWithError error: Error) + @asyncHandler optional func requestDidComplete(_ request: SNRequest) } diff --git a/watchOS/SpriteKit/SKNode.swift b/watchOS/SpriteKit/SKNode.swift index 0076c55..66a4201 100644 --- a/watchOS/SpriteKit/SKNode.swift +++ b/watchOS/SpriteKit/SKNode.swift @@ -56,6 +56,7 @@ class SKNode : NSObject, NSCopying, NSSecureCoding { func inParentHierarchy(_ parent: SKNode) -> Bool func run(_ action: SKAction) func run(_ action: SKAction, completion block: @escaping () -> Void) + func run(_ action: SKAction) async func run(_ action: SKAction, withKey key: String) func hasActions() -> Bool func action(forKey key: String) -> SKAction? diff --git a/watchOS/SpriteKit/SKPhysicsWorld.swift b/watchOS/SpriteKit/SKPhysicsWorld.swift index 5f8199a..74c60fb 100644 --- a/watchOS/SpriteKit/SKPhysicsWorld.swift +++ b/watchOS/SpriteKit/SKPhysicsWorld.swift @@ -1,7 +1,7 @@ protocol SKPhysicsContactDelegate : NSObjectProtocol { - optional func didBegin(_ contact: SKPhysicsContact) - optional func didEnd(_ contact: SKPhysicsContact) + @asyncHandler optional func didBegin(_ contact: SKPhysicsContact) + @asyncHandler optional func didEnd(_ contact: SKPhysicsContact) } class SKPhysicsWorld : NSObject, NSSecureCoding { var gravity: CGVector diff --git a/watchOS/SpriteKit/SKScene.swift b/watchOS/SpriteKit/SKScene.swift index f571ce0..903b1c0 100644 --- a/watchOS/SpriteKit/SKScene.swift +++ b/watchOS/SpriteKit/SKScene.swift @@ -11,10 +11,10 @@ enum SKSceneScaleMode : Int { @available(watchOS 1.0, *) protocol SKSceneDelegate : NSObjectProtocol { optional func update(_ currentTime: TimeInterval, for scene: SKScene) - optional func didEvaluateActions(for scene: SKScene) - optional func didSimulatePhysics(for scene: SKScene) - optional func didApplyConstraints(for scene: SKScene) - optional func didFinishUpdate(for scene: SKScene) + @asyncHandler optional func didEvaluateActions(for scene: SKScene) + @asyncHandler optional func didSimulatePhysics(for scene: SKScene) + @asyncHandler optional func didApplyConstraints(for scene: SKScene) + @asyncHandler optional func didFinishUpdate(for scene: SKScene) } class SKScene : SKEffectNode { init(size: CGSize) diff --git a/watchOS/SpriteKit/SKTexture.swift b/watchOS/SpriteKit/SKTexture.swift index bfd8f7a..4e1524b 100644 --- a/watchOS/SpriteKit/SKTexture.swift +++ b/watchOS/SpriteKit/SKTexture.swift @@ -29,7 +29,9 @@ class SKTexture : NSObject, NSCopying, NSSecureCoding { @available(watchOS 2.0, *) func cgImage() -> CGImage class func preload(_ textures: [SKTexture], withCompletionHandler completionHandler: @escaping () -> Void) + class func preload(_ textures: [SKTexture]) async func preload(completionHandler: @escaping () -> Void) + func preload() async } extension SKTexture : _CustomPlaygroundQuickLookable { diff --git a/watchOS/SpriteKit/SKTextureAtlas.swift b/watchOS/SpriteKit/SKTextureAtlas.swift index b01e8df..04f1d6c 100644 --- a/watchOS/SpriteKit/SKTextureAtlas.swift +++ b/watchOS/SpriteKit/SKTextureAtlas.swift @@ -5,9 +5,13 @@ class SKTextureAtlas : NSObject, NSSecureCoding { convenience init(dictionary properties: [String : Any]) func textureNamed(_ name: String) -> SKTexture class func preloadTextureAtlases(_ textureAtlases: [SKTextureAtlas], withCompletionHandler completionHandler: @escaping () -> Void) + class func preloadTextureAtlases(_ textureAtlases: [SKTextureAtlas]) async @available(watchOS 2.0, *) class func preloadTextureAtlasesNamed(_ atlasNames: [String], withCompletionHandler completionHandler: @escaping (Error?, [SKTextureAtlas]) -> Void) + @available(watchOS 2.0, *) + class func preloadTextureAtlasesNamed(_ atlasNames: [String]) async throws -> [SKTextureAtlas] func preload(completionHandler: @escaping () -> Void) + func preload() async var textureNames: [String] { get } } diff --git a/watchOS/StoreKit/SKCloudServiceController.swift b/watchOS/StoreKit/SKCloudServiceController.swift index 8c537a2..d56f671 100644 --- a/watchOS/StoreKit/SKCloudServiceController.swift +++ b/watchOS/StoreKit/SKCloudServiceController.swift @@ -25,12 +25,20 @@ class SKCloudServiceController : NSObject { class func requestAuthorization(_ handler: @escaping (SKCloudServiceAuthorizationStatus) -> Void) @available(watchOS 7.0, *) func requestCapabilities(completionHandler: @escaping (SKCloudServiceCapability, Error?) -> Void) + @available(watchOS 7.0, *) + func requestCapabilities() async throws -> SKCloudServiceCapability @available(watchOS 4.0, *) func requestStorefrontCountryCode(completionHandler: @escaping (String?, Error?) -> Void) + @available(watchOS 4.0, *) + func requestStorefrontCountryCode() async throws -> String? @available(watchOS 7.0, *) func requestStorefrontIdentifier(completionHandler: @escaping (String?, Error?) -> Void) @available(watchOS 7.0, *) + func requestStorefrontIdentifier() async throws -> String? + @available(watchOS 7.0, *) func requestUserToken(forDeveloperToken developerToken: String, completionHandler: @escaping (String?, Error?) -> Void) + @available(watchOS 7.0, *) + func requestUserToken(forDeveloperToken developerToken: String) async throws -> String? } extension NSNotification.Name { @available(watchOS 7.0, *) diff --git a/watchOS/StoreKit/SKPaymentQueue.swift b/watchOS/StoreKit/SKPaymentQueue.swift index 775dbf4..740c3d2 100644 --- a/watchOS/StoreKit/SKPaymentQueue.swift +++ b/watchOS/StoreKit/SKPaymentQueue.swift @@ -50,7 +50,7 @@ protocol SKPaymentTransactionObserver : NSObjectProtocol { @available(watchOS 6.2, *) optional func paymentQueue(_ queue: SKPaymentQueue, updatedDownloads downloads: [SKDownload]) @available(watchOS 6.2, *) - optional func paymentQueueDidChangeStorefront(_ queue: SKPaymentQueue) + @asyncHandler optional func paymentQueueDidChangeStorefront(_ queue: SKPaymentQueue) @available(watchOS 7.0, *) - optional func paymentQueue(_ queue: SKPaymentQueue, didRevokeEntitlementsForProductIdentifiers productIdentifiers: [String]) + @asyncHandler optional func paymentQueue(_ queue: SKPaymentQueue, didRevokeEntitlementsForProductIdentifiers productIdentifiers: [String]) } diff --git a/watchOS/StoreKit/SKProductsRequest.swift b/watchOS/StoreKit/SKProductsRequest.swift index b936442..20a5854 100644 --- a/watchOS/StoreKit/SKProductsRequest.swift +++ b/watchOS/StoreKit/SKProductsRequest.swift @@ -1,7 +1,7 @@ protocol SKProductsRequestDelegate : SKRequestDelegate { @available(watchOS 6.2, *) - func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) + @asyncHandler func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) } @available(watchOS 6.2, *) class SKProductsRequest : SKRequest { diff --git a/watchOS/StoreKit/SKRequest.swift b/watchOS/StoreKit/SKRequest.swift index da14eb1..e3cc7b6 100644 --- a/watchOS/StoreKit/SKRequest.swift +++ b/watchOS/StoreKit/SKRequest.swift @@ -10,7 +10,7 @@ class SKRequest : NSObject { } protocol SKRequestDelegate : NSObjectProtocol { @available(watchOS 6.2, *) - optional func requestDidFinish(_ request: SKRequest) + @asyncHandler optional func requestDidFinish(_ request: SKRequest) @available(watchOS 6.2, *) - optional func request(_ request: SKRequest, didFailWithError error: Error) + @asyncHandler optional func request(_ request: SKRequest, didFailWithError error: Error) } diff --git a/watchOS/UserNotifications/UNUserNotificationCenter.swift b/watchOS/UserNotifications/UNUserNotificationCenter.swift index 047ebee..4ccb5c6 100644 --- a/watchOS/UserNotifications/UNUserNotificationCenter.swift +++ b/watchOS/UserNotifications/UNUserNotificationCenter.swift @@ -22,14 +22,20 @@ class UNUserNotificationCenter : NSObject { var supportsContentExtensions: Bool { get } class func current() -> UNUserNotificationCenter func requestAuthorization(options: UNAuthorizationOptions = [], completionHandler: @escaping (Bool, Error?) -> Void) + func requestAuthorization(options: UNAuthorizationOptions = []) async throws -> Bool func setNotificationCategories(_ categories: Set) func getNotificationCategories(completionHandler: @escaping (Set) -> Void) + func getNotificationCategories() async -> Set func getNotificationSettings(completionHandler: @escaping (UNNotificationSettings) -> Void) + func getNotificationSettings() async -> UNNotificationSettings func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) + func add(_ request: UNNotificationRequest) async throws func getPendingNotificationRequests(completionHandler: @escaping ([UNNotificationRequest]) -> Void) + func getPendingNotificationRequests() async -> [UNNotificationRequest] func removePendingNotificationRequests(withIdentifiers identifiers: [String]) func removeAllPendingNotificationRequests() func getDeliveredNotifications(completionHandler: @escaping ([UNNotification]) -> Void) + func getDeliveredNotifications() async -> [UNNotification] func removeDeliveredNotifications(withIdentifiers identifiers: [String]) func removeAllDeliveredNotifications() } @@ -51,5 +57,9 @@ protocol UNUserNotificationCenterDelegate : NSObjectProtocol { @available(watchOS 3.0, *) optional func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) @available(watchOS 3.0, *) - optional func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) + optional func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification) async -> UNNotificationPresentationOptions + @available(watchOS 3.0, *) + @asyncHandler optional func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) + @available(watchOS 3.0, *) + optional func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async } diff --git a/watchOS/WatchConnectivity/WCSession.swift b/watchOS/WatchConnectivity/WCSession.swift index e3a1436..2029b7c 100644 --- a/watchOS/WatchConnectivity/WCSession.swift +++ b/watchOS/WatchConnectivity/WCSession.swift @@ -36,25 +36,25 @@ protocol WCSessionDelegate : NSObjectProtocol { @available(watchOS 2.2, *) func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) @available(watchOS 6.0, *) - optional func sessionCompanionAppInstalledDidChange(_ session: WCSession) + @asyncHandler optional func sessionCompanionAppInstalledDidChange(_ session: WCSession) @available(watchOS 2.0, *) - optional func sessionReachabilityDidChange(_ session: WCSession) + @asyncHandler optional func sessionReachabilityDidChange(_ session: WCSession) @available(watchOS 2.0, *) - optional func session(_ session: WCSession, didReceiveMessage message: [String : Any]) + @asyncHandler optional func session(_ session: WCSession, didReceiveMessage message: [String : Any]) @available(watchOS 2.0, *) - optional func session(_ session: WCSession, didReceiveMessage message: [String : Any], replyHandler: @escaping ([String : Any]) -> Void) + @asyncHandler optional func session(_ session: WCSession, didReceiveMessage message: [String : Any], replyHandler: @escaping ([String : Any]) -> Void) @available(watchOS 2.0, *) - optional func session(_ session: WCSession, didReceiveMessageData messageData: Data) + @asyncHandler optional func session(_ session: WCSession, didReceiveMessageData messageData: Data) @available(watchOS 2.0, *) - optional func session(_ session: WCSession, didReceiveMessageData messageData: Data, replyHandler: @escaping (Data) -> Void) + @asyncHandler optional func session(_ session: WCSession, didReceiveMessageData messageData: Data, replyHandler: @escaping (Data) -> Void) @available(watchOS 2.0, *) - optional func session(_ session: WCSession, didReceiveApplicationContext applicationContext: [String : Any]) + @asyncHandler optional func session(_ session: WCSession, didReceiveApplicationContext applicationContext: [String : Any]) @available(watchOS 2.0, *) - optional func session(_ session: WCSession, didFinish userInfoTransfer: WCSessionUserInfoTransfer, error: Error?) + @asyncHandler optional func session(_ session: WCSession, didFinish userInfoTransfer: WCSessionUserInfoTransfer, error: Error?) @available(watchOS 2.0, *) - optional func session(_ session: WCSession, didReceiveUserInfo userInfo: [String : Any] = [:]) + @asyncHandler optional func session(_ session: WCSession, didReceiveUserInfo userInfo: [String : Any] = [:]) @available(watchOS 2.0, *) - optional func session(_ session: WCSession, didFinish fileTransfer: WCSessionFileTransfer, error: Error?) + @asyncHandler optional func session(_ session: WCSession, didFinish fileTransfer: WCSessionFileTransfer, error: Error?) @available(watchOS 2.0, *) - optional func session(_ session: WCSession, didReceive file: WCSessionFile) + @asyncHandler optional func session(_ session: WCSession, didReceive file: WCSessionFile) } diff --git a/watchOS/WatchKit/WKCrownSequencer.swift b/watchOS/WatchKit/WKCrownSequencer.swift index 363952b..7c5165b 100644 --- a/watchOS/WatchKit/WKCrownSequencer.swift +++ b/watchOS/WatchKit/WKCrownSequencer.swift @@ -11,6 +11,6 @@ class WKCrownSequencer : NSObject { } @available(watchOS 3.0, *) protocol WKCrownDelegate : NSObjectProtocol { - optional func crownDidRotate(_ crownSequencer: WKCrownSequencer?, rotationalDelta: Double) - optional func crownDidBecomeIdle(_ crownSequencer: WKCrownSequencer?) + @asyncHandler optional func crownDidRotate(_ crownSequencer: WKCrownSequencer?, rotationalDelta: Double) + @asyncHandler optional func crownDidBecomeIdle(_ crownSequencer: WKCrownSequencer?) } diff --git a/watchOS/WatchKit/WKExtendedRuntimeSession.swift b/watchOS/WatchKit/WKExtendedRuntimeSession.swift index 80d0cde..96550f1 100644 --- a/watchOS/WatchKit/WKExtendedRuntimeSession.swift +++ b/watchOS/WatchKit/WKExtendedRuntimeSession.swift @@ -46,7 +46,7 @@ class WKExtendedRuntimeSession : NSObject { } @available(watchOS 6.0, *) protocol WKExtendedRuntimeSessionDelegate : NSObjectProtocol { - func extendedRuntimeSession(_ extendedRuntimeSession: WKExtendedRuntimeSession, didInvalidateWith reason: WKExtendedRuntimeSessionInvalidationReason, error: Error?) - func extendedRuntimeSessionDidStart(_ extendedRuntimeSession: WKExtendedRuntimeSession) + @asyncHandler func extendedRuntimeSession(_ extendedRuntimeSession: WKExtendedRuntimeSession, didInvalidateWith reason: WKExtendedRuntimeSessionInvalidationReason, error: Error?) + @asyncHandler func extendedRuntimeSessionDidStart(_ extendedRuntimeSession: WKExtendedRuntimeSession) func extendedRuntimeSessionWillExpire(_ extendedRuntimeSession: WKExtendedRuntimeSession) } diff --git a/watchOS/WatchKit/WKExtension.swift b/watchOS/WatchKit/WKExtension.swift index f3458c1..3e3cc8b 100644 --- a/watchOS/WatchKit/WKExtension.swift +++ b/watchOS/WatchKit/WKExtension.swift @@ -46,11 +46,11 @@ enum WKBackgroundFetchResult : UInt { } @available(watchOS 2.0, *) protocol WKExtensionDelegate : NSObjectProtocol { - optional func applicationDidFinishLaunching() - optional func applicationDidBecomeActive() + @asyncHandler optional func applicationDidFinishLaunching() + @asyncHandler optional func applicationDidBecomeActive() optional func applicationWillResignActive() optional func applicationWillEnterForeground() - optional func applicationDidEnterBackground() + @asyncHandler optional func applicationDidEnterBackground() @available(watchOS 5.0, *) optional func handleActiveWorkoutRecovery() @available(watchOS 6.0, *) @@ -63,13 +63,15 @@ protocol WKExtensionDelegate : NSObjectProtocol { @available(watchOS 3.0, *) optional func handle(_ backgroundTasks: Set) @available(watchOS 4.0, *) - optional func deviceOrientationDidChange() + @asyncHandler optional func deviceOrientationDidChange() @available(watchOS 6.0, *) - optional func didRegisterForRemoteNotifications(withDeviceToken deviceToken: Data) + @asyncHandler optional func didRegisterForRemoteNotifications(withDeviceToken deviceToken: Data) @available(watchOS 6.0, *) - optional func didFailToRegisterForRemoteNotificationsWithError(_ error: Error) + @asyncHandler optional func didFailToRegisterForRemoteNotificationsWithError(_ error: Error) @available(watchOS 6.0, *) - optional func didReceiveRemoteNotification(_ userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (WKBackgroundFetchResult) -> Void) + @asyncHandler optional func didReceiveRemoteNotification(_ userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (WKBackgroundFetchResult) -> Void) + @available(watchOS 6.0, *) + optional func didReceiveRemoteNotification(_ userInfo: [AnyHashable : Any]) async -> WKBackgroundFetchResult @available(watchOS 2.0, *) @available(watchOS, deprecated: 3.0, message: "use UNUserNotificationCenterDelegate") optional func handleAction(withIdentifier identifier: String?, forRemoteNotification remoteNotification: [AnyHashable : Any]) @@ -84,10 +86,10 @@ protocol WKExtensionDelegate : NSObjectProtocol { optional func handleAction(withIdentifier identifier: String?, for localNotification: UILocalNotification, withResponseInfo responseInfo: [AnyHashable : Any]) @available(watchOS 2.0, *) @available(watchOS, deprecated: 3.0, message: "use UNUserNotificationCenterDelegate") - optional func didReceiveRemoteNotification(_ userInfo: [AnyHashable : Any]) + @asyncHandler optional func didReceiveRemoteNotification(_ userInfo: [AnyHashable : Any]) @available(watchOS 2.0, *) @available(watchOS, deprecated: 3.0, message: "use UNUserNotificationCenterDelegate") - optional func didReceive(_ notification: UILocalNotification) + @asyncHandler optional func didReceive(_ notification: UILocalNotification) } extension WKExtension { @available(watchOS 7.0, *) diff --git a/watchOS/WatchKit/WKInterfaceController.swift b/watchOS/WatchKit/WKInterfaceController.swift index 43d1593..a24ee1a 100644 --- a/watchOS/WatchKit/WKInterfaceController.swift +++ b/watchOS/WatchKit/WKInterfaceController.swift @@ -118,15 +118,21 @@ class WKInterfaceController : NSObject { func presentController(withNames names: [String], contexts: [Any]?) func dismiss() func presentTextInputController(withSuggestions suggestions: [String]?, allowedInputMode inputMode: WKTextInputMode, completion: @escaping ([Any]?) -> Void) + func presentTextInputController(withSuggestions suggestions: [String]?, allowedInputMode inputMode: WKTextInputMode) async -> [Any]? func presentTextInputControllerWithSuggestions(forLanguage suggestionsHandler: ((String) -> [Any]?)?, allowedInputMode inputMode: WKTextInputMode, completion: @escaping ([Any]?) -> Void) + func presentTextInputControllerWithSuggestions(forLanguage suggestionsHandler: ((String) -> [Any]?)?, allowedInputMode inputMode: WKTextInputMode) async -> [Any]? func dismissTextInputController() @available(watchOS 2.0, *) func presentMediaPlayerController(with URL: URL, options: [AnyHashable : Any]? = nil, completion: @escaping (Bool, TimeInterval, Error?) -> Void) @available(watchOS 2.0, *) + func presentMediaPlayerController(with URL: URL, options: [AnyHashable : Any]? = nil) async throws -> (Bool, TimeInterval) + @available(watchOS 2.0, *) func dismissMediaPlayerController() @available(watchOS 2.0, *) func presentAudioRecorderController(withOutputURL URL: URL, preset: WKAudioRecorderPreset, options: [AnyHashable : Any]? = nil, completion: @escaping (Bool, Error?) -> Void) @available(watchOS 2.0, *) + func presentAudioRecorderController(withOutputURL URL: URL, preset: WKAudioRecorderPreset, options: [AnyHashable : Any]? = nil) async throws -> Bool + @available(watchOS 2.0, *) func dismissAudioRecorderController() func contextForSegue(withIdentifier segueIdentifier: String) -> Any? func contextsForSegue(withIdentifier segueIdentifier: String) -> [Any]? From 0806bd6f91ff5925dfcc5b8c47418cf6067f0b1d Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Wed, 21 Oct 2020 13:06:48 -0700 Subject: [PATCH 2/9] [Concurrency] Drop "get" prefix when importing Objective-C methods as async. Implements rdar://70506634. --- iOS/ARKit/ARSession.swift | 4 ++-- .../ASAuthorizationAppleIDProvider.swift | 2 +- iOS/BackgroundTasks/BGTaskScheduler.swift | 2 +- iOS/CallKit/CXCallDirectoryManager.swift | 2 +- iOS/CoreNFC/CoreNFC.swift | 2 +- iOS/DeveloperToolsSupport/DeveloperToolsSupport.swift | 2 +- iOS/ExposureNotification/ENManager.swift | 6 +++--- iOS/FileProvider/Extension.swift | 2 +- iOS/Foundation/NSFileManager.swift | 4 ++-- iOS/Foundation/NSFileVersion.swift | 2 +- iOS/Foundation/NSHTTPCookieStorage.swift | 2 +- iOS/Foundation/NSURLCache.swift | 2 +- iOS/Foundation/NSURLCredentialStorage.swift | 2 +- iOS/Foundation/NSURLSession.swift | 4 ++-- iOS/Foundation/NSUserActivity.swift | 2 +- iOS/GameKit/GKCloudPlayer.swift | 2 +- iOS/GameKit/GKGameSession.swift | 2 +- iOS/HealthKit/HKHealthStore.swift | 2 +- iOS/Intents/INVoiceShortcutCenter.swift | 2 +- iOS/NetworkExtension/NetworkExtension.swift | 2 +- iOS/SafariServices/SFContentBlockerManager.swift | 2 +- iOS/SwiftUI/SwiftUI.swift | 10 +++++----- iOS/UserNotifications/UNUserNotificationCenter.swift | 8 ++++---- iOS/WebKit/WKContentRuleListStore.swift | 2 +- iOS/WebKit/WKHTTPCookieStore.swift | 2 +- .../ASAuthorizationAppleIDProvider.swift | 2 +- .../DeveloperToolsSupport/DeveloperToolsSupport.swift | 2 +- macOS/FileProvider/Extension.swift | 4 ++-- macOS/Foundation/NSFileManager.swift | 4 ++-- macOS/Foundation/NSFileVersion.swift | 2 +- macOS/Foundation/NSHTTPCookieStorage.swift | 2 +- macOS/Foundation/NSURLCache.swift | 2 +- macOS/Foundation/NSURLCredentialStorage.swift | 2 +- macOS/Foundation/NSURLSession.swift | 4 ++-- macOS/Foundation/NSUserActivity.swift | 2 +- macOS/GameKit/GKCloudPlayer.swift | 2 +- macOS/GameKit/GKGameSession.swift | 2 +- macOS/SafariServices/SFContentBlockerManager.swift | 2 +- macOS/SafariServices/SFSafariApplication.swift | 6 +++--- macOS/SafariServices/SFSafariExtension.swift | 2 +- macOS/SafariServices/SFSafariExtensionManager.swift | 2 +- macOS/SafariServices/SFSafariPage.swift | 6 +++--- macOS/SafariServices/SFSafariTab.swift | 6 +++--- macOS/SafariServices/SFSafariWindow.swift | 6 +++--- macOS/SwiftUI/SwiftUI.swift | 10 +++++----- macOS/UserNotifications/UNUserNotificationCenter.swift | 8 ++++---- macOS/WebKit/WKContentRuleListStore.swift | 2 +- macOS/WebKit/WKHTTPCookieStore.swift | 2 +- .../ASAuthorizationAppleIDProvider.swift | 2 +- tvOS/BackgroundTasks/BGTaskScheduler.swift | 2 +- tvOS/DeveloperToolsSupport/DeveloperToolsSupport.swift | 2 +- tvOS/Foundation/NSFileVersion.swift | 2 +- tvOS/Foundation/NSHTTPCookieStorage.swift | 2 +- tvOS/Foundation/NSURLCache.swift | 2 +- tvOS/Foundation/NSURLCredentialStorage.swift | 2 +- tvOS/Foundation/NSURLSession.swift | 4 ++-- tvOS/Foundation/NSUserActivity.swift | 2 +- tvOS/GameKit/GKCloudPlayer.swift | 2 +- tvOS/GameKit/GKGameSession.swift | 2 +- tvOS/SwiftUI/SwiftUI.swift | 6 +++--- tvOS/UserNotifications/UNUserNotificationCenter.swift | 4 ++-- .../ASAuthorizationAppleIDProvider.swift | 2 +- .../DeveloperToolsSupport/DeveloperToolsSupport.swift | 2 +- watchOS/Foundation/NSFileVersion.swift | 2 +- watchOS/Foundation/NSHTTPCookieStorage.swift | 2 +- watchOS/Foundation/NSURLCache.swift | 2 +- watchOS/Foundation/NSURLCredentialStorage.swift | 2 +- watchOS/Foundation/NSURLSession.swift | 4 ++-- watchOS/Foundation/NSUserActivity.swift | 2 +- watchOS/HealthKit/HKHealthStore.swift | 2 +- watchOS/Intents/INVoiceShortcutCenter.swift | 2 +- watchOS/NetworkExtension/NetworkExtension.swift | 2 +- watchOS/SwiftUI/SwiftUI.swift | 6 +++--- .../UserNotifications/UNUserNotificationCenter.swift | 8 ++++---- 74 files changed, 114 insertions(+), 114 deletions(-) diff --git a/iOS/ARKit/ARSession.swift b/iOS/ARKit/ARSession.swift index dad2452..9dcbc3d 100644 --- a/iOS/ARKit/ARSession.swift +++ b/iOS/ARKit/ARSession.swift @@ -27,7 +27,7 @@ class ARSession : NSObject { @available(iOS 12.0, *) func getCurrentWorldMap(completionHandler: @escaping (ARWorldMap?, Error?) -> Void) @available(iOS 12.0, *) - func getCurrentWorldMap() async throws -> ARWorldMap? + func currentWorldMap() async throws -> ARWorldMap? @available(iOS 12.0, *) func createReferenceObject(transform: simd_float4x4, center: simd_float3, extent: simd_float3, completionHandler: @escaping (ARReferenceObject?, Error?) -> Void) @available(iOS 12.0, *) @@ -41,7 +41,7 @@ class ARSession : NSObject { @available(iOS 14.0, *) func getGeoLocation(forPoint position: simd_float3, completionHandler: @escaping (CLLocationCoordinate2D, CLLocationDistance, Error?) -> Void) @available(iOS 14.0, *) - func getGeoLocation(forPoint position: simd_float3) async throws -> (CLLocationCoordinate2D, CLLocationDistance) + func geoLocation(forPoint position: simd_float3) async throws -> (CLLocationCoordinate2D, CLLocationDistance) } @available(iOS 11.0, *) protocol ARSessionObserver : NSObjectProtocol { diff --git a/iOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift b/iOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift index 2d144f9..2deb524 100644 --- a/iOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift +++ b/iOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift @@ -16,5 +16,5 @@ extension ASAuthorizationAppleIDProvider { class ASAuthorizationAppleIDProvider : NSObject, ASAuthorizationProvider { func createRequest() -> ASAuthorizationAppleIDRequest func getCredentialState(forUserID userID: String, completion: @escaping (ASAuthorizationAppleIDProvider.CredentialState, Error?) -> Void) - func getCredentialState(forUserID userID: String) async throws -> ASAuthorizationAppleIDProvider.CredentialState + func credentialState(forUserID userID: String) async throws -> ASAuthorizationAppleIDProvider.CredentialState } diff --git a/iOS/BackgroundTasks/BGTaskScheduler.swift b/iOS/BackgroundTasks/BGTaskScheduler.swift index 1129d30..fb350ff 100644 --- a/iOS/BackgroundTasks/BGTaskScheduler.swift +++ b/iOS/BackgroundTasks/BGTaskScheduler.swift @@ -20,5 +20,5 @@ class BGTaskScheduler : NSObject { func cancel(taskRequestWithIdentifier identifier: String) func cancelAllTaskRequests() func getPendingTaskRequests(completionHandler: @escaping ([BGTaskRequest]) -> Void) - func getPendingTaskRequests() async -> [BGTaskRequest] + func pendingTaskRequests() async -> [BGTaskRequest] } diff --git a/iOS/CallKit/CXCallDirectoryManager.swift b/iOS/CallKit/CXCallDirectoryManager.swift index 8bb17c1..4e26aca 100644 --- a/iOS/CallKit/CXCallDirectoryManager.swift +++ b/iOS/CallKit/CXCallDirectoryManager.swift @@ -15,7 +15,7 @@ class CXCallDirectoryManager : NSObject { func reloadExtension(withIdentifier identifier: String, completionHandler completion: ((Error?) -> Void)? = nil) func reloadExtension(withIdentifier identifier: String) async throws func getEnabledStatusForExtension(withIdentifier identifier: String, completionHandler completion: @escaping (CXCallDirectoryManager.EnabledStatus, Error?) -> Void) - func getEnabledStatusForExtension(withIdentifier identifier: String) async throws -> CXCallDirectoryManager.EnabledStatus + func enabledStatusForExtension(withIdentifier identifier: String) async throws -> CXCallDirectoryManager.EnabledStatus @available(iOS 13.4, *) func openSettings(completionHandler completion: ((Error?) -> Void)? = nil) @available(iOS 13.4, *) diff --git a/iOS/CoreNFC/CoreNFC.swift b/iOS/CoreNFC/CoreNFC.swift index 4d7adb7..e980075 100644 --- a/iOS/CoreNFC/CoreNFC.swift +++ b/iOS/CoreNFC/CoreNFC.swift @@ -344,7 +344,7 @@ protocol NFCISO15693Tag : NFCNDEFTag, __NFCTag { @available(iOS 14.0, *) func __getSystemInfoAndUID(with flags: NFCISO15693RequestFlag, completionHandler: @escaping (Data?, Int, Int, Int, Int, Int, Error?) -> Void) @available(iOS 14.0, *) - func __getSystemInfoAndUID(with flags: NFCISO15693RequestFlag) async throws -> (Data?, Int, Int, Int, Int, Int) + func __systemInfoAndUID(with flags: NFCISO15693RequestFlag) async throws -> (Data?, Int, Int, Int, Int, Int) @available(iOS 13.0, *) func getMultipleBlockSecurityStatus(requestFlags flags: NFCISO15693RequestFlag, blockRange: NSRange, completionHandler: @escaping ([NSNumber], Error?) -> Void) @available(iOS 13.0, *) diff --git a/iOS/DeveloperToolsSupport/DeveloperToolsSupport.swift b/iOS/DeveloperToolsSupport/DeveloperToolsSupport.swift index e434a46..83f4ea3 100644 --- a/iOS/DeveloperToolsSupport/DeveloperToolsSupport.swift +++ b/iOS/DeveloperToolsSupport/DeveloperToolsSupport.swift @@ -1,6 +1,6 @@ @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) -@_functionBuilder struct LibraryContentBuilder { +@resultBuilder struct LibraryContentBuilder { static func buildBlock(_ segments: [LibraryItem]...) -> [LibraryItem] static func buildExpression(_ item: LibraryItem) -> [LibraryItem] static func buildExpression(_ items: [LibraryItem]) -> [LibraryItem] diff --git a/iOS/ExposureNotification/ENManager.swift b/iOS/ExposureNotification/ENManager.swift index c11d587..8a563dd 100644 --- a/iOS/ExposureNotification/ENManager.swift +++ b/iOS/ExposureNotification/ENManager.swift @@ -32,7 +32,7 @@ class ENManager : NSObject { @available(iOS 13.7, *) func getUserTraveled(completionHandler: @escaping ENGetUserTraveledHandler) @available(iOS 13.7, *) - func getUserTraveled() async throws -> Bool + func userTraveled() async throws -> Bool class var authorizationStatus: ENAuthorizationStatus { get } var exposureNotificationEnabled: Bool { get } func setExposureNotificationEnabled(_ enabled: Bool, completionHandler: @escaping ENErrorHandler) @@ -45,7 +45,7 @@ class ENManager : NSObject { @available(iOS 13.7, *) func getExposureWindows(summary: ENExposureDetectionSummary, completionHandler: @escaping ENGetExposureWindowsHandler) -> Progress func getDiagnosisKeys(completionHandler: @escaping ENGetDiagnosisKeysHandler) - func getDiagnosisKeys() async throws -> [ENTemporaryExposureKey]? + func diagnosisKeys() async throws -> [ENTemporaryExposureKey]? func getTestDiagnosisKeys(completionHandler: @escaping ENGetDiagnosisKeysHandler) - func getTestDiagnosisKeys() async throws -> [ENTemporaryExposureKey]? + func testDiagnosisKeys() async throws -> [ENTemporaryExposureKey]? } diff --git a/iOS/FileProvider/Extension.swift b/iOS/FileProvider/Extension.swift index 61c0fd2..e00b955 100644 --- a/iOS/FileProvider/Extension.swift +++ b/iOS/FileProvider/Extension.swift @@ -39,7 +39,7 @@ class NSFileProviderManager : NSObject { class func remove(_ domain: NSFileProviderDomain, completionHandler: @escaping (Error?) -> Void) class func remove(_ domain: NSFileProviderDomain) async throws class func getDomainsWithCompletionHandler(_ completionHandler: @escaping ([NSFileProviderDomain], Error?) -> Void) - class func getDomains() async throws -> [NSFileProviderDomain] + class func domains() async throws -> [NSFileProviderDomain] class func removeAllDomains(completionHandler: @escaping (Error?) -> Void) class func removeAllDomains() async throws } diff --git a/iOS/Foundation/NSFileManager.swift b/iOS/Foundation/NSFileManager.swift index 58f485f..79b3487 100644 --- a/iOS/Foundation/NSFileManager.swift +++ b/iOS/Foundation/NSFileManager.swift @@ -118,7 +118,7 @@ class FileManager : NSObject { @available(iOS 11.0, *) func getFileProviderServicesForItem(at url: URL, completionHandler: @escaping ([NSFileProviderServiceName : NSFileProviderService]?, Error?) -> Void) @available(iOS 11.0, *) - func getFileProviderServicesForItem(at url: URL) async throws -> [NSFileProviderServiceName : NSFileProviderService]? + func fileProviderServicesForItem(at url: URL) async throws -> [NSFileProviderServiceName : NSFileProviderService]? @available(iOS 7.0, *) func containerURL(forSecurityApplicationGroupIdentifier groupIdentifier: String) -> URL? } @@ -214,7 +214,7 @@ extension FileManager { @available(iOS 11.0, *) class NSFileProviderService : NSObject { func getFileProviderConnection(completionHandler: @escaping (NSXPCConnection?, Error?) -> Void) - func getFileProviderConnection() async throws -> NSXPCConnection? + func fileProviderConnection() async throws -> NSXPCConnection? var name: NSFileProviderServiceName { get } } extension FileAttributeKey { diff --git a/iOS/Foundation/NSFileVersion.swift b/iOS/Foundation/NSFileVersion.swift index eedf01e..5ef5507 100644 --- a/iOS/Foundation/NSFileVersion.swift +++ b/iOS/Foundation/NSFileVersion.swift @@ -19,7 +19,7 @@ class NSFileVersion : NSObject { @available(iOS 8.0, *) class func getNonlocalVersionsOfItem(at url: URL, completionHandler: @escaping ([NSFileVersion]?, Error?) -> Void) @available(iOS 8.0, *) - class func getNonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion]? + class func nonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion]? class func version(itemAt url: URL, forPersistentIdentifier persistentIdentifier: Any) -> NSFileVersion? var url: URL { get } var localizedName: String? { get } diff --git a/iOS/Foundation/NSHTTPCookieStorage.swift b/iOS/Foundation/NSHTTPCookieStorage.swift index 7ff1993..7eb7022 100644 --- a/iOS/Foundation/NSHTTPCookieStorage.swift +++ b/iOS/Foundation/NSHTTPCookieStorage.swift @@ -30,7 +30,7 @@ extension HTTPCookieStorage { @available(iOS 8.0, *) func getCookiesFor(_ task: URLSessionTask, completionHandler: @escaping ([HTTPCookie]?) -> Void) @available(iOS 8.0, *) - func getCookiesFor(_ task: URLSessionTask) async -> [HTTPCookie]? + func cookies(for task: URLSessionTask) async -> [HTTPCookie]? } extension NSNotification.Name { @available(iOS 2.0, *) diff --git a/iOS/Foundation/NSURLCache.swift b/iOS/Foundation/NSURLCache.swift index 3b69788..75d7ebf 100644 --- a/iOS/Foundation/NSURLCache.swift +++ b/iOS/Foundation/NSURLCache.swift @@ -46,7 +46,7 @@ extension URLCache { @available(iOS 8.0, *) func getCachedResponse(for dataTask: URLSessionDataTask, completionHandler: @escaping (CachedURLResponse?) -> Void) @available(iOS 8.0, *) - func getCachedResponse(for dataTask: URLSessionDataTask) async -> CachedURLResponse? + func cachedResponse(for dataTask: URLSessionDataTask) async -> CachedURLResponse? @available(iOS 8.0, *) func removeCachedResponse(for dataTask: URLSessionDataTask) } diff --git a/iOS/Foundation/NSURLCredentialStorage.swift b/iOS/Foundation/NSURLCredentialStorage.swift index bafd134..be7d85e 100644 --- a/iOS/Foundation/NSURLCredentialStorage.swift +++ b/iOS/Foundation/NSURLCredentialStorage.swift @@ -23,7 +23,7 @@ extension URLCredentialStorage { @available(iOS 8.0, *) func getDefaultCredential(for space: URLProtectionSpace, task: URLSessionTask, completionHandler: @escaping (URLCredential?) -> Void) @available(iOS 8.0, *) - func getDefaultCredential(for space: URLProtectionSpace, task: URLSessionTask) async -> URLCredential? + func defaultCredential(for space: URLProtectionSpace, task: URLSessionTask) async -> URLCredential? @available(iOS 8.0, *) func setDefaultCredential(_ credential: URLCredential, for protectionSpace: URLProtectionSpace, task: URLSessionTask) } diff --git a/iOS/Foundation/NSURLSession.swift b/iOS/Foundation/NSURLSession.swift index a251220..ef1341b 100644 --- a/iOS/Foundation/NSURLSession.swift +++ b/iOS/Foundation/NSURLSession.swift @@ -17,11 +17,11 @@ class URLSession : NSObject { func flush(completionHandler: @escaping () -> Void) func flush() async func getTasksWithCompletionHandler(_ completionHandler: @escaping ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) -> Void) - func getTasks() async -> ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) + func tasks() async -> ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) @available(iOS 9.0, *) func getAllTasks(completionHandler: @escaping ([URLSessionTask]) -> Void) @available(iOS 9.0, *) - func getAllTasks() async -> [URLSessionTask] + func allTasks() async -> [URLSessionTask] func dataTask(with request: URLRequest) -> URLSessionDataTask func dataTask(with url: URL) -> URLSessionDataTask func uploadTask(with request: URLRequest, fromFile fileURL: URL) -> URLSessionUploadTask diff --git a/iOS/Foundation/NSUserActivity.swift b/iOS/Foundation/NSUserActivity.swift index 4ae2d3a..36abb90 100644 --- a/iOS/Foundation/NSUserActivity.swift +++ b/iOS/Foundation/NSUserActivity.swift @@ -26,7 +26,7 @@ class NSUserActivity : NSObject { func resignCurrent() func invalidate() func getContinuationStreams(completionHandler: @escaping (InputStream?, OutputStream?, Error?) -> Void) - func getContinuationStreams() async throws -> (InputStream?, OutputStream?) + func continuationStreams() async throws -> (InputStream?, OutputStream?) @available(iOS 9.0, *) var isEligibleForHandoff: Bool @available(iOS 9.0, *) diff --git a/iOS/GameKit/GKCloudPlayer.swift b/iOS/GameKit/GKCloudPlayer.swift index bcc8705..002d50f 100644 --- a/iOS/GameKit/GKCloudPlayer.swift +++ b/iOS/GameKit/GKCloudPlayer.swift @@ -2,5 +2,5 @@ @available(iOS, introduced: 10.0, deprecated: 12.0, message: "GKGameSession is deprecated. Use GKPlayer for both real-time and turn-based matchmaking APIs.") class GKCloudPlayer : GKBasePlayer { class func getCurrentSignedInPlayer(forContainer containerName: String?, completionHandler handler: @escaping (GKCloudPlayer?, Error?) -> Void) - class func getCurrentSignedInPlayer(forContainer containerName: String?) async throws -> GKCloudPlayer? + class func currentSignedInPlayer(forContainer containerName: String?) async throws -> GKCloudPlayer? } diff --git a/iOS/GameKit/GKGameSession.swift b/iOS/GameKit/GKGameSession.swift index bb427fd..4c7c1a3 100644 --- a/iOS/GameKit/GKGameSession.swift +++ b/iOS/GameKit/GKGameSession.swift @@ -30,7 +30,7 @@ class GKGameSession : NSObject { class func remove(withIdentifier identifier: String, completionHandler: @escaping (Error?) -> Void) class func remove(withIdentifier identifier: String) async throws func getShareURL(completionHandler: @escaping (URL?, Error?) -> Void) - func getShareURL() async throws -> URL? + func shareURL() async throws -> URL? func loadData(completionHandler: @escaping (Data?, Error?) -> Void) func loadData() async throws -> Data? func save(_ data: Data, completionHandler: @escaping (Data?, Error?) -> Void) diff --git a/iOS/HealthKit/HKHealthStore.swift b/iOS/HealthKit/HKHealthStore.swift index 5be040c..6128820 100644 --- a/iOS/HealthKit/HKHealthStore.swift +++ b/iOS/HealthKit/HKHealthStore.swift @@ -10,7 +10,7 @@ class HKHealthStore : NSObject { @available(iOS 12.0, *) func getRequestStatusForAuthorization(toShare typesToShare: Set, read typesToRead: Set, completion: @escaping (HKAuthorizationRequestStatus, Error?) -> Void) @available(iOS 12.0, *) - func getRequestStatusForAuthorization(toShare typesToShare: Set, read typesToRead: Set) async throws -> HKAuthorizationRequestStatus + func requestStatusForAuthorization(toShare typesToShare: Set, read typesToRead: Set) async throws -> HKAuthorizationRequestStatus @available(iOS 9.0, *) func handleAuthorizationForExtension(completion: @escaping (Bool, Error?) -> Void) @available(iOS 9.0, *) diff --git a/iOS/Intents/INVoiceShortcutCenter.swift b/iOS/Intents/INVoiceShortcutCenter.swift index 24e4105..c777c0c 100644 --- a/iOS/Intents/INVoiceShortcutCenter.swift +++ b/iOS/Intents/INVoiceShortcutCenter.swift @@ -3,7 +3,7 @@ class INVoiceShortcutCenter : NSObject { class var shared: INVoiceShortcutCenter { get } func getAllVoiceShortcuts(completion completionHandler: @escaping ([INVoiceShortcut]?, Error?) -> Void) - func getAllVoiceShortcuts() async throws -> [INVoiceShortcut]? + func allVoiceShortcuts() async throws -> [INVoiceShortcut]? func getVoiceShortcut(with identifier: UUID, completion completionHandler: @escaping (INVoiceShortcut?, Error?) -> Void) func getVoiceShortcut(with identifier: UUID) async throws -> INVoiceShortcut? func setShortcutSuggestions(_ suggestions: [INShortcut]) diff --git a/iOS/NetworkExtension/NetworkExtension.swift b/iOS/NetworkExtension/NetworkExtension.swift index 96b2b9b..6744929 100644 --- a/iOS/NetworkExtension/NetworkExtension.swift +++ b/iOS/NetworkExtension/NetworkExtension.swift @@ -929,7 +929,7 @@ class NEHotspotConfigurationManager : NSObject { @available(iOS 11.0, *) func getConfiguredSSIDs(completionHandler: @escaping ([String]) -> Void) @available(iOS 11.0, *) - func getConfiguredSSIDs() async -> [String] + func configuredSSIDs() async -> [String] } @available(iOS 9.0, *) class NEIPv4Settings : NSObject, NSSecureCoding, NSCopying { diff --git a/iOS/SafariServices/SFContentBlockerManager.swift b/iOS/SafariServices/SFContentBlockerManager.swift index 128be23..7242896 100644 --- a/iOS/SafariServices/SFContentBlockerManager.swift +++ b/iOS/SafariServices/SFContentBlockerManager.swift @@ -19,5 +19,5 @@ class SFContentBlockerManager : NSObject { @available(iOS 10.0, *) class func getStateOfContentBlocker(withIdentifier identifier: String, completionHandler: @escaping (SFContentBlockerState?, Error?) -> Void) @available(iOS 10.0, *) - class func getStateOfContentBlocker(withIdentifier identifier: String) async throws -> SFContentBlockerState? + class func stateOfContentBlocker(withIdentifier identifier: String) async throws -> SFContentBlockerState? } diff --git a/iOS/SwiftUI/SwiftUI.swift b/iOS/SwiftUI/SwiftUI.swift index 5bde524..9796d12 100644 --- a/iOS/SwiftUI/SwiftUI.swift +++ b/iOS/SwiftUI/SwiftUI.swift @@ -866,7 +866,7 @@ extension Commands { @available(iOS 14.0, macOS 11.0, *) @available(tvOS, unavailable) @available(watchOS, unavailable) -@_functionBuilder struct CommandsBuilder { +@resultBuilder struct CommandsBuilder { @_alwaysEmitIntoClient static func buildBlock() -> EmptyCommands @_alwaysEmitIntoClient static func buildBlock(_ content: Content) -> Content where Content : Commands } @@ -3779,7 +3779,7 @@ extension Scene { } @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) -@_functionBuilder struct SceneBuilder { +@resultBuilder struct SceneBuilder { static func buildBlock(_ content: Content) -> Content where Content : Scene } @@ -4494,7 +4494,7 @@ extension ToolbarContent { } @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) -@_functionBuilder struct ToolbarContentBuilder { +@resultBuilder struct ToolbarContentBuilder { static func buildBlock(_ content: Content) -> some ToolbarContent where Content : ToolbarContent static func buildBlock(_ content: Content) -> some CustomizableToolbarContent where Content : CustomizableToolbarContent @@ -6202,7 +6202,7 @@ extension View { } @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) -@_functionBuilder struct ViewBuilder { +@resultBuilder struct ViewBuilder { @_alwaysEmitIntoClient static func buildBlock() -> EmptyView @_alwaysEmitIntoClient static func buildBlock(_ content: Content) -> Content where Content : View } @@ -6361,7 +6361,7 @@ protocol WidgetBundle { @available(iOS 14.0, macOS 11.0, *) @available(tvOS, unavailable) @available(watchOS, unavailable) -@_functionBuilder struct WidgetBundleBuilder { +@resultBuilder struct WidgetBundleBuilder { static func buildBlock() -> some Widget static func buildBlock(_ content: Content) -> some Widget where Content : Widget diff --git a/iOS/UserNotifications/UNUserNotificationCenter.swift b/iOS/UserNotifications/UNUserNotificationCenter.swift index f85e288..7660c79 100644 --- a/iOS/UserNotifications/UNUserNotificationCenter.swift +++ b/iOS/UserNotifications/UNUserNotificationCenter.swift @@ -25,17 +25,17 @@ class UNUserNotificationCenter : NSObject { func requestAuthorization(options: UNAuthorizationOptions = []) async throws -> Bool func setNotificationCategories(_ categories: Set) func getNotificationCategories(completionHandler: @escaping (Set) -> Void) - func getNotificationCategories() async -> Set + func notificationCategories() async -> Set func getNotificationSettings(completionHandler: @escaping (UNNotificationSettings) -> Void) - func getNotificationSettings() async -> UNNotificationSettings + func notificationSettings() async -> UNNotificationSettings func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) func add(_ request: UNNotificationRequest) async throws func getPendingNotificationRequests(completionHandler: @escaping ([UNNotificationRequest]) -> Void) - func getPendingNotificationRequests() async -> [UNNotificationRequest] + func pendingNotificationRequests() async -> [UNNotificationRequest] func removePendingNotificationRequests(withIdentifiers identifiers: [String]) func removeAllPendingNotificationRequests() func getDeliveredNotifications(completionHandler: @escaping ([UNNotification]) -> Void) - func getDeliveredNotifications() async -> [UNNotification] + func deliveredNotifications() async -> [UNNotification] func removeDeliveredNotifications(withIdentifiers identifiers: [String]) func removeAllDeliveredNotifications() } diff --git a/iOS/WebKit/WKContentRuleListStore.swift b/iOS/WebKit/WKContentRuleListStore.swift index 78e6370..3df2b56 100644 --- a/iOS/WebKit/WKContentRuleListStore.swift +++ b/iOS/WebKit/WKContentRuleListStore.swift @@ -10,5 +10,5 @@ class WKContentRuleListStore : NSObject { func removeContentRuleList(forIdentifier identifier: String!, completionHandler: ((Error?) -> Void)!) func removeContentRuleList(forIdentifier identifier: String!) async throws func getAvailableContentRuleListIdentifiers(_ completionHandler: (([String]?) -> Void)!) - func getAvailableContentRuleListIdentifiers() async -> [String]? + func availableContentRuleListIdentifiers() async -> [String]? } diff --git a/iOS/WebKit/WKHTTPCookieStore.swift b/iOS/WebKit/WKHTTPCookieStore.swift index 0be1db5..62e6489 100644 --- a/iOS/WebKit/WKHTTPCookieStore.swift +++ b/iOS/WebKit/WKHTTPCookieStore.swift @@ -6,7 +6,7 @@ protocol WKHTTPCookieStoreObserver : NSObjectProtocol { @available(iOS 11.0, *) class WKHTTPCookieStore : NSObject { func getAllCookies(_ completionHandler: @escaping ([HTTPCookie]) -> Void) - func getAllCookies() async -> [HTTPCookie] + func allCookies() async -> [HTTPCookie] func setCookie(_ cookie: HTTPCookie, completionHandler: (() -> Void)? = nil) func setCookie(_ cookie: HTTPCookie) async func delete(_ cookie: HTTPCookie, completionHandler: (() -> Void)? = nil) diff --git a/macOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift b/macOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift index fe38207..1dca871 100644 --- a/macOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift +++ b/macOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift @@ -16,5 +16,5 @@ extension ASAuthorizationAppleIDProvider { class ASAuthorizationAppleIDProvider : NSObject, ASAuthorizationProvider { func createRequest() -> ASAuthorizationAppleIDRequest func getCredentialState(forUserID userID: String, completion: @escaping (ASAuthorizationAppleIDProvider.CredentialState, Error?) -> Void) - func getCredentialState(forUserID userID: String) async throws -> ASAuthorizationAppleIDProvider.CredentialState + func credentialState(forUserID userID: String) async throws -> ASAuthorizationAppleIDProvider.CredentialState } diff --git a/macOS/DeveloperToolsSupport/DeveloperToolsSupport.swift b/macOS/DeveloperToolsSupport/DeveloperToolsSupport.swift index e434a46..83f4ea3 100644 --- a/macOS/DeveloperToolsSupport/DeveloperToolsSupport.swift +++ b/macOS/DeveloperToolsSupport/DeveloperToolsSupport.swift @@ -1,6 +1,6 @@ @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) -@_functionBuilder struct LibraryContentBuilder { +@resultBuilder struct LibraryContentBuilder { static func buildBlock(_ segments: [LibraryItem]...) -> [LibraryItem] static func buildExpression(_ item: LibraryItem) -> [LibraryItem] static func buildExpression(_ items: [LibraryItem]) -> [LibraryItem] diff --git a/macOS/FileProvider/Extension.swift b/macOS/FileProvider/Extension.swift index 7c564e8..da00f52 100644 --- a/macOS/FileProvider/Extension.swift +++ b/macOS/FileProvider/Extension.swift @@ -13,7 +13,7 @@ class NSFileProviderManager : NSObject { @available(macOS 11.0, *) class func getIdentifierForUserVisibleFile(at url: URL, completionHandler: @escaping (NSFileProviderItemIdentifier?, NSFileProviderDomainIdentifier?, Error?) -> Void) @available(macOS 11.0, *) - class func getIdentifierForUserVisibleFile(at url: URL) async throws -> (NSFileProviderItemIdentifier?, NSFileProviderDomainIdentifier?) + class func identifierForUserVisibleFile(at url: URL) async throws -> (NSFileProviderItemIdentifier?, NSFileProviderDomainIdentifier?) func register(_ task: URLSessionTask, forItemWithIdentifier identifier: NSFileProviderItemIdentifier, completionHandler completion: @escaping (Error?) -> Void) func register(_ task: URLSessionTask, forItemWithIdentifier identifier: NSFileProviderItemIdentifier) async throws @available(macOS 11.0, *) @@ -23,7 +23,7 @@ class NSFileProviderManager : NSObject { class func remove(_ domain: NSFileProviderDomain, completionHandler: @escaping (Error?) -> Void) class func remove(_ domain: NSFileProviderDomain) async throws class func getDomainsWithCompletionHandler(_ completionHandler: @escaping ([NSFileProviderDomain], Error?) -> Void) - class func getDomains() async throws -> [NSFileProviderDomain] + class func domains() async throws -> [NSFileProviderDomain] class func removeAllDomains(completionHandler: @escaping (Error?) -> Void) class func removeAllDomains() async throws @available(macOS 11.0, *) diff --git a/macOS/Foundation/NSFileManager.swift b/macOS/Foundation/NSFileManager.swift index ea3d240..d33bf9a 100644 --- a/macOS/Foundation/NSFileManager.swift +++ b/macOS/Foundation/NSFileManager.swift @@ -124,7 +124,7 @@ class FileManager : NSObject { @available(macOS 10.13, *) func getFileProviderServicesForItem(at url: URL, completionHandler: @escaping ([NSFileProviderServiceName : NSFileProviderService]?, Error?) -> Void) @available(macOS 10.13, *) - func getFileProviderServicesForItem(at url: URL) async throws -> [NSFileProviderServiceName : NSFileProviderService]? + func fileProviderServicesForItem(at url: URL) async throws -> [NSFileProviderServiceName : NSFileProviderService]? @available(macOS 10.8, *) func containerURL(forSecurityApplicationGroupIdentifier groupIdentifier: String) -> URL? } @@ -231,7 +231,7 @@ extension FileManager { @available(macOS 10.13, *) class NSFileProviderService : NSObject { func getFileProviderConnection(completionHandler: @escaping (NSXPCConnection?, Error?) -> Void) - func getFileProviderConnection() async throws -> NSXPCConnection? + func fileProviderConnection() async throws -> NSXPCConnection? var name: NSFileProviderServiceName { get } } extension FileAttributeKey { diff --git a/macOS/Foundation/NSFileVersion.swift b/macOS/Foundation/NSFileVersion.swift index ed03618..979171a 100644 --- a/macOS/Foundation/NSFileVersion.swift +++ b/macOS/Foundation/NSFileVersion.swift @@ -19,7 +19,7 @@ class NSFileVersion : NSObject { @available(macOS 10.10, *) class func getNonlocalVersionsOfItem(at url: URL, completionHandler: @escaping ([NSFileVersion]?, Error?) -> Void) @available(macOS 10.10, *) - class func getNonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion]? + class func nonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion]? class func version(itemAt url: URL, forPersistentIdentifier persistentIdentifier: Any) -> NSFileVersion? @available(macOS 10.7, *) class func addOfItem(at url: URL, withContentsOf contentsURL: URL, options: NSFileVersion.AddingOptions = []) throws -> NSFileVersion diff --git a/macOS/Foundation/NSHTTPCookieStorage.swift b/macOS/Foundation/NSHTTPCookieStorage.swift index c904797..e5ca7c8 100644 --- a/macOS/Foundation/NSHTTPCookieStorage.swift +++ b/macOS/Foundation/NSHTTPCookieStorage.swift @@ -30,7 +30,7 @@ extension HTTPCookieStorage { @available(macOS 10.10, *) func getCookiesFor(_ task: URLSessionTask, completionHandler: @escaping ([HTTPCookie]?) -> Void) @available(macOS 10.10, *) - func getCookiesFor(_ task: URLSessionTask) async -> [HTTPCookie]? + func cookies(for task: URLSessionTask) async -> [HTTPCookie]? } extension NSNotification.Name { @available(macOS 10.2, *) diff --git a/macOS/Foundation/NSURLCache.swift b/macOS/Foundation/NSURLCache.swift index dae8436..cb86856 100644 --- a/macOS/Foundation/NSURLCache.swift +++ b/macOS/Foundation/NSURLCache.swift @@ -46,7 +46,7 @@ extension URLCache { @available(macOS 10.10, *) func getCachedResponse(for dataTask: URLSessionDataTask, completionHandler: @escaping (CachedURLResponse?) -> Void) @available(macOS 10.10, *) - func getCachedResponse(for dataTask: URLSessionDataTask) async -> CachedURLResponse? + func cachedResponse(for dataTask: URLSessionDataTask) async -> CachedURLResponse? @available(macOS 10.10, *) func removeCachedResponse(for dataTask: URLSessionDataTask) } diff --git a/macOS/Foundation/NSURLCredentialStorage.swift b/macOS/Foundation/NSURLCredentialStorage.swift index 618444c..5a8b4ee 100644 --- a/macOS/Foundation/NSURLCredentialStorage.swift +++ b/macOS/Foundation/NSURLCredentialStorage.swift @@ -23,7 +23,7 @@ extension URLCredentialStorage { @available(macOS 10.10, *) func getDefaultCredential(for space: URLProtectionSpace, task: URLSessionTask, completionHandler: @escaping (URLCredential?) -> Void) @available(macOS 10.10, *) - func getDefaultCredential(for space: URLProtectionSpace, task: URLSessionTask) async -> URLCredential? + func defaultCredential(for space: URLProtectionSpace, task: URLSessionTask) async -> URLCredential? @available(macOS 10.10, *) func setDefaultCredential(_ credential: URLCredential, for protectionSpace: URLProtectionSpace, task: URLSessionTask) } diff --git a/macOS/Foundation/NSURLSession.swift b/macOS/Foundation/NSURLSession.swift index 6fa5a37..2195fc9 100644 --- a/macOS/Foundation/NSURLSession.swift +++ b/macOS/Foundation/NSURLSession.swift @@ -17,11 +17,11 @@ class URLSession : NSObject { func flush(completionHandler: @escaping () -> Void) func flush() async func getTasksWithCompletionHandler(_ completionHandler: @escaping ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) -> Void) - func getTasks() async -> ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) + func tasks() async -> ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) @available(macOS 10.11, *) func getAllTasks(completionHandler: @escaping ([URLSessionTask]) -> Void) @available(macOS 10.11, *) - func getAllTasks() async -> [URLSessionTask] + func allTasks() async -> [URLSessionTask] func dataTask(with request: URLRequest) -> URLSessionDataTask func dataTask(with url: URL) -> URLSessionDataTask func uploadTask(with request: URLRequest, fromFile fileURL: URL) -> URLSessionUploadTask diff --git a/macOS/Foundation/NSUserActivity.swift b/macOS/Foundation/NSUserActivity.swift index b6f0a8d..4d9817f 100644 --- a/macOS/Foundation/NSUserActivity.swift +++ b/macOS/Foundation/NSUserActivity.swift @@ -26,7 +26,7 @@ class NSUserActivity : NSObject { func resignCurrent() func invalidate() func getContinuationStreams(completionHandler: @escaping (InputStream?, OutputStream?, Error?) -> Void) - func getContinuationStreams() async throws -> (InputStream?, OutputStream?) + func continuationStreams() async throws -> (InputStream?, OutputStream?) @available(macOS 10.11, *) var isEligibleForHandoff: Bool @available(macOS 10.11, *) diff --git a/macOS/GameKit/GKCloudPlayer.swift b/macOS/GameKit/GKCloudPlayer.swift index 048fbe5..3b57f51 100644 --- a/macOS/GameKit/GKCloudPlayer.swift +++ b/macOS/GameKit/GKCloudPlayer.swift @@ -2,5 +2,5 @@ @available(macOS, introduced: 10.12, deprecated: 10.14, message: "GKGameSession is deprecated. Use GKPlayer for both real-time and turn-based matchmaking APIs.") class GKCloudPlayer : GKBasePlayer { class func getCurrentSignedInPlayer(forContainer containerName: String?, completionHandler handler: @escaping (GKCloudPlayer?, Error?) -> Void) - class func getCurrentSignedInPlayer(forContainer containerName: String?) async throws -> GKCloudPlayer? + class func currentSignedInPlayer(forContainer containerName: String?) async throws -> GKCloudPlayer? } diff --git a/macOS/GameKit/GKGameSession.swift b/macOS/GameKit/GKGameSession.swift index fbe3022..08259c5 100644 --- a/macOS/GameKit/GKGameSession.swift +++ b/macOS/GameKit/GKGameSession.swift @@ -30,7 +30,7 @@ class GKGameSession : NSObject { class func remove(withIdentifier identifier: String, completionHandler: @escaping (Error?) -> Void) class func remove(withIdentifier identifier: String) async throws func getShareURL(completionHandler: @escaping (URL?, Error?) -> Void) - func getShareURL() async throws -> URL? + func shareURL() async throws -> URL? func loadData(completionHandler: @escaping (Data?, Error?) -> Void) func loadData() async throws -> Data? func save(_ data: Data, completionHandler: @escaping (Data?, Error?) -> Void) diff --git a/macOS/SafariServices/SFContentBlockerManager.swift b/macOS/SafariServices/SFContentBlockerManager.swift index 28d5968..114cd1d 100644 --- a/macOS/SafariServices/SFContentBlockerManager.swift +++ b/macOS/SafariServices/SFContentBlockerManager.swift @@ -3,5 +3,5 @@ class SFContentBlockerManager : NSObject { class func reloadContentBlocker(withIdentifier identifier: String, completionHandler: ((Error?) -> Void)? = nil) class func reloadContentBlocker(withIdentifier identifier: String) async throws class func getStateOfContentBlocker(withIdentifier identifier: String, completionHandler: @escaping (SFContentBlockerState?, Error?) -> Void) - class func getStateOfContentBlocker(withIdentifier identifier: String) async throws -> SFContentBlockerState? + class func stateOfContentBlocker(withIdentifier identifier: String) async throws -> SFContentBlockerState? } diff --git a/macOS/SafariServices/SFSafariApplication.swift b/macOS/SafariServices/SFSafariApplication.swift index e892264..ad6840a 100644 --- a/macOS/SafariServices/SFSafariApplication.swift +++ b/macOS/SafariServices/SFSafariApplication.swift @@ -2,14 +2,14 @@ let SFExtensionMessageKey: String class SFSafariApplication : NSObject { class func getActiveWindow(completionHandler: @escaping (SFSafariWindow?) -> Void) - class func getActiveWindow() async -> SFSafariWindow? + class func activeWindow() async -> SFSafariWindow? class func getAllWindows(completionHandler: @escaping ([SFSafariWindow]) -> Void) - class func getAllWindows() async -> [SFSafariWindow] + class func allWindows() async -> [SFSafariWindow] class func openWindow(with url: URL, completionHandler: ((SFSafariWindow?) -> Void)? = nil) class func openWindow(with url: URL) async -> SFSafariWindow? class func setToolbarItemsNeedUpdate() class func getHostApplication(completionHandler: @escaping (NSRunningApplication) -> Void) - class func getHostApplication() async -> NSRunningApplication + class func hostApplication() async -> NSRunningApplication class func showPreferencesForExtension(withIdentifier identifier: String, completionHandler: ((Error?) -> Void)? = nil) class func showPreferencesForExtension(withIdentifier identifier: String) async throws class func dispatchMessage(withName messageName: String, toExtensionWithIdentifier identifier: String, userInfo: [String : Any]? = nil, completionHandler: ((Error?) -> Void)? = nil) diff --git a/macOS/SafariServices/SFSafariExtension.swift b/macOS/SafariServices/SFSafariExtension.swift index 7ef696d..2d8f86c 100644 --- a/macOS/SafariServices/SFSafariExtension.swift +++ b/macOS/SafariServices/SFSafariExtension.swift @@ -1,5 +1,5 @@ class SFSafariExtension : NSObject { class func getBaseURI(completionHandler: @escaping (URL?) -> Void) - class func getBaseURI() async -> URL? + class func baseURI() async -> URL? } diff --git a/macOS/SafariServices/SFSafariExtensionManager.swift b/macOS/SafariServices/SFSafariExtensionManager.swift index 2db9c21..364ea07 100644 --- a/macOS/SafariServices/SFSafariExtensionManager.swift +++ b/macOS/SafariServices/SFSafariExtensionManager.swift @@ -1,5 +1,5 @@ class SFSafariExtensionManager : NSObject { class func getStateOfSafariExtension(withIdentifier identifier: String, completionHandler: @escaping (SFSafariExtensionState?, Error?) -> Void) - class func getStateOfSafariExtension(withIdentifier identifier: String) async throws -> SFSafariExtensionState? + class func stateOfSafariExtension(withIdentifier identifier: String) async throws -> SFSafariExtensionState? } diff --git a/macOS/SafariServices/SFSafariPage.swift b/macOS/SafariServices/SFSafariPage.swift index 4352abe..107fcb6 100644 --- a/macOS/SafariServices/SFSafariPage.swift +++ b/macOS/SafariServices/SFSafariPage.swift @@ -3,9 +3,9 @@ class SFSafariPage : NSObject, NSCopying, NSSecureCoding { func dispatchMessageToScript(withName messageName: String, userInfo: [String : Any]? = nil) func reload() func getPropertiesWithCompletionHandler(_ completionHandler: @escaping (SFSafariPageProperties?) -> Void) - func getProperties() async -> SFSafariPageProperties? + func pageProperties() async -> SFSafariPageProperties? func getContainingTab(completionHandler: @escaping (SFSafariTab) -> Void) - func getContainingTab() async -> SFSafariTab + func containingTab() async -> SFSafariTab func getScreenshotOfVisibleArea(completionHandler: @escaping (NSImage?) -> Void) - func getScreenshotOfVisibleArea() async -> NSImage? + func screenshotOfVisibleArea() async -> NSImage? } diff --git a/macOS/SafariServices/SFSafariTab.swift b/macOS/SafariServices/SFSafariTab.swift index d14484a..c280440 100644 --- a/macOS/SafariServices/SFSafariTab.swift +++ b/macOS/SafariServices/SFSafariTab.swift @@ -1,11 +1,11 @@ class SFSafariTab : NSObject, NSCopying, NSSecureCoding { func getActivePage(completionHandler: @escaping (SFSafariPage?) -> Void) - func getActivePage() async -> SFSafariPage? + func activePage() async -> SFSafariPage? func getPagesWithCompletionHandler(_ completionHandler: @escaping ([SFSafariPage]?) -> Void) - func getPages() async -> [SFSafariPage]? + func pages() async -> [SFSafariPage]? func getContainingWindow(completionHandler: @escaping (SFSafariWindow?) -> Void) - func getContainingWindow() async -> SFSafariWindow? + func containingWindow() async -> SFSafariWindow? func activate(completionHandler: (() -> Void)? = nil) func activate() async func navigate(to url: URL) diff --git a/macOS/SafariServices/SFSafariWindow.swift b/macOS/SafariServices/SFSafariWindow.swift index dd9dae4..f4a868a 100644 --- a/macOS/SafariServices/SFSafariWindow.swift +++ b/macOS/SafariServices/SFSafariWindow.swift @@ -1,12 +1,12 @@ class SFSafariWindow : NSObject, NSCopying, NSSecureCoding { func getActiveTab(completionHandler: @escaping (SFSafariTab?) -> Void) - func getActiveTab() async -> SFSafariTab? + func activeTab() async -> SFSafariTab? func getAllTabs(completionHandler: @escaping ([SFSafariTab]) -> Void) - func getAllTabs() async -> [SFSafariTab] + func allTabs() async -> [SFSafariTab] func openTab(with url: URL, makeActiveIfPossible activateTab: Bool, completionHandler: ((SFSafariTab?) -> Void)? = nil) func openTab(with url: URL, makeActiveIfPossible activateTab: Bool) async -> SFSafariTab? func getToolbarItem(completionHandler: @escaping (SFSafariToolbarItem?) -> Void) - func getToolbarItem() async -> SFSafariToolbarItem? + func toolbarItem() async -> SFSafariToolbarItem? func close() } diff --git a/macOS/SwiftUI/SwiftUI.swift b/macOS/SwiftUI/SwiftUI.swift index edbfe76..09d39bb 100644 --- a/macOS/SwiftUI/SwiftUI.swift +++ b/macOS/SwiftUI/SwiftUI.swift @@ -896,7 +896,7 @@ extension Commands { @available(iOS 14.0, macOS 11.0, *) @available(tvOS, unavailable) @available(watchOS, unavailable) -@_functionBuilder struct CommandsBuilder { +@resultBuilder struct CommandsBuilder { @_alwaysEmitIntoClient static func buildBlock() -> EmptyCommands @_alwaysEmitIntoClient static func buildBlock(_ content: Content) -> Content where Content : Commands } @@ -4077,7 +4077,7 @@ extension Scene { } @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) -@_functionBuilder struct SceneBuilder { +@resultBuilder struct SceneBuilder { static func buildBlock(_ content: Content) -> Content where Content : Scene } @@ -4848,7 +4848,7 @@ extension ToolbarContent { } @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) -@_functionBuilder struct ToolbarContentBuilder { +@resultBuilder struct ToolbarContentBuilder { static func buildBlock(_ content: Content) -> some ToolbarContent where Content : ToolbarContent static func buildBlock(_ content: Content) -> some CustomizableToolbarContent where Content : CustomizableToolbarContent @@ -6555,7 +6555,7 @@ extension View { } @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) -@_functionBuilder struct ViewBuilder { +@resultBuilder struct ViewBuilder { @_alwaysEmitIntoClient static func buildBlock() -> EmptyView @_alwaysEmitIntoClient static func buildBlock(_ content: Content) -> Content where Content : View } @@ -6699,7 +6699,7 @@ protocol WidgetBundle { @available(iOS 14.0, macOS 11.0, *) @available(tvOS, unavailable) @available(watchOS, unavailable) -@_functionBuilder struct WidgetBundleBuilder { +@resultBuilder struct WidgetBundleBuilder { static func buildBlock() -> some Widget static func buildBlock(_ content: Content) -> some Widget where Content : Widget diff --git a/macOS/UserNotifications/UNUserNotificationCenter.swift b/macOS/UserNotifications/UNUserNotificationCenter.swift index 7970edd..04fd6cd 100644 --- a/macOS/UserNotifications/UNUserNotificationCenter.swift +++ b/macOS/UserNotifications/UNUserNotificationCenter.swift @@ -23,17 +23,17 @@ class UNUserNotificationCenter : NSObject { func requestAuthorization(options: UNAuthorizationOptions = []) async throws -> Bool func setNotificationCategories(_ categories: Set) func getNotificationCategories(completionHandler: @escaping (Set) -> Void) - func getNotificationCategories() async -> Set + func notificationCategories() async -> Set func getNotificationSettings(completionHandler: @escaping (UNNotificationSettings) -> Void) - func getNotificationSettings() async -> UNNotificationSettings + func notificationSettings() async -> UNNotificationSettings func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) func add(_ request: UNNotificationRequest) async throws func getPendingNotificationRequests(completionHandler: @escaping ([UNNotificationRequest]) -> Void) - func getPendingNotificationRequests() async -> [UNNotificationRequest] + func pendingNotificationRequests() async -> [UNNotificationRequest] func removePendingNotificationRequests(withIdentifiers identifiers: [String]) func removeAllPendingNotificationRequests() func getDeliveredNotifications(completionHandler: @escaping ([UNNotification]) -> Void) - func getDeliveredNotifications() async -> [UNNotification] + func deliveredNotifications() async -> [UNNotification] func removeDeliveredNotifications(withIdentifiers identifiers: [String]) func removeAllDeliveredNotifications() } diff --git a/macOS/WebKit/WKContentRuleListStore.swift b/macOS/WebKit/WKContentRuleListStore.swift index 947f24e..a686971 100644 --- a/macOS/WebKit/WKContentRuleListStore.swift +++ b/macOS/WebKit/WKContentRuleListStore.swift @@ -10,5 +10,5 @@ class WKContentRuleListStore : NSObject { func removeContentRuleList(forIdentifier identifier: String!, completionHandler: ((Error?) -> Void)!) func removeContentRuleList(forIdentifier identifier: String!) async throws func getAvailableContentRuleListIdentifiers(_ completionHandler: (([String]?) -> Void)!) - func getAvailableContentRuleListIdentifiers() async -> [String]? + func availableContentRuleListIdentifiers() async -> [String]? } diff --git a/macOS/WebKit/WKHTTPCookieStore.swift b/macOS/WebKit/WKHTTPCookieStore.swift index 198bed5..a55bef9 100644 --- a/macOS/WebKit/WKHTTPCookieStore.swift +++ b/macOS/WebKit/WKHTTPCookieStore.swift @@ -6,7 +6,7 @@ protocol WKHTTPCookieStoreObserver : NSObjectProtocol { @available(macOS 10.13, *) class WKHTTPCookieStore : NSObject { func getAllCookies(_ completionHandler: @escaping ([HTTPCookie]) -> Void) - func getAllCookies() async -> [HTTPCookie] + func allCookies() async -> [HTTPCookie] func setCookie(_ cookie: HTTPCookie, completionHandler: (() -> Void)? = nil) func setCookie(_ cookie: HTTPCookie) async func delete(_ cookie: HTTPCookie, completionHandler: (() -> Void)? = nil) diff --git a/tvOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift b/tvOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift index 44b7a55..be3279c 100644 --- a/tvOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift +++ b/tvOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift @@ -16,5 +16,5 @@ extension ASAuthorizationAppleIDProvider { class ASAuthorizationAppleIDProvider : NSObject, ASAuthorizationProvider { func createRequest() -> ASAuthorizationAppleIDRequest func getCredentialState(forUserID userID: String, completion: @escaping (ASAuthorizationAppleIDProvider.CredentialState, Error?) -> Void) - func getCredentialState(forUserID userID: String) async throws -> ASAuthorizationAppleIDProvider.CredentialState + func credentialState(forUserID userID: String) async throws -> ASAuthorizationAppleIDProvider.CredentialState } diff --git a/tvOS/BackgroundTasks/BGTaskScheduler.swift b/tvOS/BackgroundTasks/BGTaskScheduler.swift index d7d9721..6396dd5 100644 --- a/tvOS/BackgroundTasks/BGTaskScheduler.swift +++ b/tvOS/BackgroundTasks/BGTaskScheduler.swift @@ -20,5 +20,5 @@ class BGTaskScheduler : NSObject { func cancel(taskRequestWithIdentifier identifier: String) func cancelAllTaskRequests() func getPendingTaskRequests(completionHandler: @escaping ([BGTaskRequest]) -> Void) - func getPendingTaskRequests() async -> [BGTaskRequest] + func pendingTaskRequests() async -> [BGTaskRequest] } diff --git a/tvOS/DeveloperToolsSupport/DeveloperToolsSupport.swift b/tvOS/DeveloperToolsSupport/DeveloperToolsSupport.swift index e434a46..83f4ea3 100644 --- a/tvOS/DeveloperToolsSupport/DeveloperToolsSupport.swift +++ b/tvOS/DeveloperToolsSupport/DeveloperToolsSupport.swift @@ -1,6 +1,6 @@ @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) -@_functionBuilder struct LibraryContentBuilder { +@resultBuilder struct LibraryContentBuilder { static func buildBlock(_ segments: [LibraryItem]...) -> [LibraryItem] static func buildExpression(_ item: LibraryItem) -> [LibraryItem] static func buildExpression(_ items: [LibraryItem]) -> [LibraryItem] diff --git a/tvOS/Foundation/NSFileVersion.swift b/tvOS/Foundation/NSFileVersion.swift index 189d108..2a9be32 100644 --- a/tvOS/Foundation/NSFileVersion.swift +++ b/tvOS/Foundation/NSFileVersion.swift @@ -19,7 +19,7 @@ class NSFileVersion : NSObject { @available(tvOS 9.0, *) class func getNonlocalVersionsOfItem(at url: URL, completionHandler: @escaping ([NSFileVersion]?, Error?) -> Void) @available(tvOS 9.0, *) - class func getNonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion]? + class func nonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion]? class func version(itemAt url: URL, forPersistentIdentifier persistentIdentifier: Any) -> NSFileVersion? var url: URL { get } var localizedName: String? { get } diff --git a/tvOS/Foundation/NSHTTPCookieStorage.swift b/tvOS/Foundation/NSHTTPCookieStorage.swift index 72e231f..cae4a9d 100644 --- a/tvOS/Foundation/NSHTTPCookieStorage.swift +++ b/tvOS/Foundation/NSHTTPCookieStorage.swift @@ -30,7 +30,7 @@ extension HTTPCookieStorage { @available(tvOS 9.0, *) func getCookiesFor(_ task: URLSessionTask, completionHandler: @escaping ([HTTPCookie]?) -> Void) @available(tvOS 9.0, *) - func getCookiesFor(_ task: URLSessionTask) async -> [HTTPCookie]? + func cookies(for task: URLSessionTask) async -> [HTTPCookie]? } extension NSNotification.Name { @available(tvOS 9.0, *) diff --git a/tvOS/Foundation/NSURLCache.swift b/tvOS/Foundation/NSURLCache.swift index b0f3363..46eee28 100644 --- a/tvOS/Foundation/NSURLCache.swift +++ b/tvOS/Foundation/NSURLCache.swift @@ -46,7 +46,7 @@ extension URLCache { @available(tvOS 9.0, *) func getCachedResponse(for dataTask: URLSessionDataTask, completionHandler: @escaping (CachedURLResponse?) -> Void) @available(tvOS 9.0, *) - func getCachedResponse(for dataTask: URLSessionDataTask) async -> CachedURLResponse? + func cachedResponse(for dataTask: URLSessionDataTask) async -> CachedURLResponse? @available(tvOS 9.0, *) func removeCachedResponse(for dataTask: URLSessionDataTask) } diff --git a/tvOS/Foundation/NSURLCredentialStorage.swift b/tvOS/Foundation/NSURLCredentialStorage.swift index 9681e5c..9bc8da7 100644 --- a/tvOS/Foundation/NSURLCredentialStorage.swift +++ b/tvOS/Foundation/NSURLCredentialStorage.swift @@ -23,7 +23,7 @@ extension URLCredentialStorage { @available(tvOS 9.0, *) func getDefaultCredential(for space: URLProtectionSpace, task: URLSessionTask, completionHandler: @escaping (URLCredential?) -> Void) @available(tvOS 9.0, *) - func getDefaultCredential(for space: URLProtectionSpace, task: URLSessionTask) async -> URLCredential? + func defaultCredential(for space: URLProtectionSpace, task: URLSessionTask) async -> URLCredential? @available(tvOS 9.0, *) func setDefaultCredential(_ credential: URLCredential, for protectionSpace: URLProtectionSpace, task: URLSessionTask) } diff --git a/tvOS/Foundation/NSURLSession.swift b/tvOS/Foundation/NSURLSession.swift index d5a8d4e..155b3cd 100644 --- a/tvOS/Foundation/NSURLSession.swift +++ b/tvOS/Foundation/NSURLSession.swift @@ -17,11 +17,11 @@ class URLSession : NSObject { func flush(completionHandler: @escaping () -> Void) func flush() async func getTasksWithCompletionHandler(_ completionHandler: @escaping ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) -> Void) - func getTasks() async -> ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) + func tasks() async -> ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) @available(tvOS 9.0, *) func getAllTasks(completionHandler: @escaping ([URLSessionTask]) -> Void) @available(tvOS 9.0, *) - func getAllTasks() async -> [URLSessionTask] + func allTasks() async -> [URLSessionTask] func dataTask(with request: URLRequest) -> URLSessionDataTask func dataTask(with url: URL) -> URLSessionDataTask func uploadTask(with request: URLRequest, fromFile fileURL: URL) -> URLSessionUploadTask diff --git a/tvOS/Foundation/NSUserActivity.swift b/tvOS/Foundation/NSUserActivity.swift index 965ef64..7743fae 100644 --- a/tvOS/Foundation/NSUserActivity.swift +++ b/tvOS/Foundation/NSUserActivity.swift @@ -26,7 +26,7 @@ class NSUserActivity : NSObject { func resignCurrent() func invalidate() func getContinuationStreams(completionHandler: @escaping (InputStream?, OutputStream?, Error?) -> Void) - func getContinuationStreams() async throws -> (InputStream?, OutputStream?) + func continuationStreams() async throws -> (InputStream?, OutputStream?) @available(tvOS 10.0, *) var isEligibleForHandoff: Bool @available(tvOS 10.0, *) diff --git a/tvOS/GameKit/GKCloudPlayer.swift b/tvOS/GameKit/GKCloudPlayer.swift index f630ee7..309ebb8 100644 --- a/tvOS/GameKit/GKCloudPlayer.swift +++ b/tvOS/GameKit/GKCloudPlayer.swift @@ -2,5 +2,5 @@ @available(tvOS, introduced: 10.0, deprecated: 12.0, message: "GKGameSession is deprecated. Use GKPlayer for both real-time and turn-based matchmaking APIs.") class GKCloudPlayer : GKBasePlayer { class func getCurrentSignedInPlayer(forContainer containerName: String?, completionHandler handler: @escaping (GKCloudPlayer?, Error?) -> Void) - class func getCurrentSignedInPlayer(forContainer containerName: String?) async throws -> GKCloudPlayer? + class func currentSignedInPlayer(forContainer containerName: String?) async throws -> GKCloudPlayer? } diff --git a/tvOS/GameKit/GKGameSession.swift b/tvOS/GameKit/GKGameSession.swift index ce3a08b..f557f5a 100644 --- a/tvOS/GameKit/GKGameSession.swift +++ b/tvOS/GameKit/GKGameSession.swift @@ -30,7 +30,7 @@ class GKGameSession : NSObject { class func remove(withIdentifier identifier: String, completionHandler: @escaping (Error?) -> Void) class func remove(withIdentifier identifier: String) async throws func getShareURL(completionHandler: @escaping (URL?, Error?) -> Void) - func getShareURL() async throws -> URL? + func shareURL() async throws -> URL? func loadData(completionHandler: @escaping (Data?, Error?) -> Void) func loadData() async throws -> Data? func save(_ data: Data, completionHandler: @escaping (Data?, Error?) -> Void) diff --git a/tvOS/SwiftUI/SwiftUI.swift b/tvOS/SwiftUI/SwiftUI.swift index 77a6cf7..286ce84 100644 --- a/tvOS/SwiftUI/SwiftUI.swift +++ b/tvOS/SwiftUI/SwiftUI.swift @@ -3031,7 +3031,7 @@ extension Scene { } @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) -@_functionBuilder struct SceneBuilder { +@resultBuilder struct SceneBuilder { static func buildBlock(_ content: Content) -> Content where Content : Scene } @@ -3614,7 +3614,7 @@ extension ToolbarContent { } @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) -@_functionBuilder struct ToolbarContentBuilder { +@resultBuilder struct ToolbarContentBuilder { static func buildBlock(_ content: Content) -> some ToolbarContent where Content : ToolbarContent static func buildBlock(_ content: Content) -> some CustomizableToolbarContent where Content : CustomizableToolbarContent @@ -5085,7 +5085,7 @@ extension View { } @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) -@_functionBuilder struct ViewBuilder { +@resultBuilder struct ViewBuilder { @_alwaysEmitIntoClient static func buildBlock() -> EmptyView @_alwaysEmitIntoClient static func buildBlock(_ content: Content) -> Content where Content : View } diff --git a/tvOS/UserNotifications/UNUserNotificationCenter.swift b/tvOS/UserNotifications/UNUserNotificationCenter.swift index e0ea336..7009d99 100644 --- a/tvOS/UserNotifications/UNUserNotificationCenter.swift +++ b/tvOS/UserNotifications/UNUserNotificationCenter.swift @@ -22,11 +22,11 @@ class UNUserNotificationCenter : NSObject { func requestAuthorization(options: UNAuthorizationOptions = [], completionHandler: @escaping (Bool, Error?) -> Void) func requestAuthorization(options: UNAuthorizationOptions = []) async throws -> Bool func getNotificationSettings(completionHandler: @escaping (UNNotificationSettings) -> Void) - func getNotificationSettings() async -> UNNotificationSettings + func notificationSettings() async -> UNNotificationSettings func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) func add(_ request: UNNotificationRequest) async throws func getPendingNotificationRequests(completionHandler: @escaping ([UNNotificationRequest]) -> Void) - func getPendingNotificationRequests() async -> [UNNotificationRequest] + func pendingNotificationRequests() async -> [UNNotificationRequest] func removePendingNotificationRequests(withIdentifiers identifiers: [String]) func removeAllPendingNotificationRequests() } diff --git a/watchOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift b/watchOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift index 9d1622d..2cc9c20 100644 --- a/watchOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift +++ b/watchOS/AuthenticationServices/ASAuthorizationAppleIDProvider.swift @@ -16,5 +16,5 @@ extension ASAuthorizationAppleIDProvider { class ASAuthorizationAppleIDProvider : NSObject, ASAuthorizationProvider { func createRequest() -> ASAuthorizationAppleIDRequest func getCredentialState(forUserID userID: String, completion: @escaping (ASAuthorizationAppleIDProvider.CredentialState, Error?) -> Void) - func getCredentialState(forUserID userID: String) async throws -> ASAuthorizationAppleIDProvider.CredentialState + func credentialState(forUserID userID: String) async throws -> ASAuthorizationAppleIDProvider.CredentialState } diff --git a/watchOS/DeveloperToolsSupport/DeveloperToolsSupport.swift b/watchOS/DeveloperToolsSupport/DeveloperToolsSupport.swift index e434a46..83f4ea3 100644 --- a/watchOS/DeveloperToolsSupport/DeveloperToolsSupport.swift +++ b/watchOS/DeveloperToolsSupport/DeveloperToolsSupport.swift @@ -1,6 +1,6 @@ @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) -@_functionBuilder struct LibraryContentBuilder { +@resultBuilder struct LibraryContentBuilder { static func buildBlock(_ segments: [LibraryItem]...) -> [LibraryItem] static func buildExpression(_ item: LibraryItem) -> [LibraryItem] static func buildExpression(_ items: [LibraryItem]) -> [LibraryItem] diff --git a/watchOS/Foundation/NSFileVersion.swift b/watchOS/Foundation/NSFileVersion.swift index 41d45a4..febcc22 100644 --- a/watchOS/Foundation/NSFileVersion.swift +++ b/watchOS/Foundation/NSFileVersion.swift @@ -19,7 +19,7 @@ class NSFileVersion : NSObject { @available(watchOS 2.0, *) class func getNonlocalVersionsOfItem(at url: URL, completionHandler: @escaping ([NSFileVersion]?, Error?) -> Void) @available(watchOS 2.0, *) - class func getNonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion]? + class func nonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion]? class func version(itemAt url: URL, forPersistentIdentifier persistentIdentifier: Any) -> NSFileVersion? var url: URL { get } var localizedName: String? { get } diff --git a/watchOS/Foundation/NSHTTPCookieStorage.swift b/watchOS/Foundation/NSHTTPCookieStorage.swift index 0ff76f5..af6dc12 100644 --- a/watchOS/Foundation/NSHTTPCookieStorage.swift +++ b/watchOS/Foundation/NSHTTPCookieStorage.swift @@ -30,7 +30,7 @@ extension HTTPCookieStorage { @available(watchOS 2.0, *) func getCookiesFor(_ task: URLSessionTask, completionHandler: @escaping ([HTTPCookie]?) -> Void) @available(watchOS 2.0, *) - func getCookiesFor(_ task: URLSessionTask) async -> [HTTPCookie]? + func cookies(for task: URLSessionTask) async -> [HTTPCookie]? } extension NSNotification.Name { @available(watchOS 2.0, *) diff --git a/watchOS/Foundation/NSURLCache.swift b/watchOS/Foundation/NSURLCache.swift index 8e70caf..65ae63c 100644 --- a/watchOS/Foundation/NSURLCache.swift +++ b/watchOS/Foundation/NSURLCache.swift @@ -46,7 +46,7 @@ extension URLCache { @available(watchOS 2.0, *) func getCachedResponse(for dataTask: URLSessionDataTask, completionHandler: @escaping (CachedURLResponse?) -> Void) @available(watchOS 2.0, *) - func getCachedResponse(for dataTask: URLSessionDataTask) async -> CachedURLResponse? + func cachedResponse(for dataTask: URLSessionDataTask) async -> CachedURLResponse? @available(watchOS 2.0, *) func removeCachedResponse(for dataTask: URLSessionDataTask) } diff --git a/watchOS/Foundation/NSURLCredentialStorage.swift b/watchOS/Foundation/NSURLCredentialStorage.swift index 38c6789..51fcef0 100644 --- a/watchOS/Foundation/NSURLCredentialStorage.swift +++ b/watchOS/Foundation/NSURLCredentialStorage.swift @@ -23,7 +23,7 @@ extension URLCredentialStorage { @available(watchOS 2.0, *) func getDefaultCredential(for space: URLProtectionSpace, task: URLSessionTask, completionHandler: @escaping (URLCredential?) -> Void) @available(watchOS 2.0, *) - func getDefaultCredential(for space: URLProtectionSpace, task: URLSessionTask) async -> URLCredential? + func defaultCredential(for space: URLProtectionSpace, task: URLSessionTask) async -> URLCredential? @available(watchOS 2.0, *) func setDefaultCredential(_ credential: URLCredential, for protectionSpace: URLProtectionSpace, task: URLSessionTask) } diff --git a/watchOS/Foundation/NSURLSession.swift b/watchOS/Foundation/NSURLSession.swift index 4ce69ce..24a2d5a 100644 --- a/watchOS/Foundation/NSURLSession.swift +++ b/watchOS/Foundation/NSURLSession.swift @@ -17,11 +17,11 @@ class URLSession : NSObject { func flush(completionHandler: @escaping () -> Void) func flush() async func getTasksWithCompletionHandler(_ completionHandler: @escaping ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) -> Void) - func getTasks() async -> ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) + func tasks() async -> ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) @available(watchOS 2.0, *) func getAllTasks(completionHandler: @escaping ([URLSessionTask]) -> Void) @available(watchOS 2.0, *) - func getAllTasks() async -> [URLSessionTask] + func allTasks() async -> [URLSessionTask] func dataTask(with request: URLRequest) -> URLSessionDataTask func dataTask(with url: URL) -> URLSessionDataTask func uploadTask(with request: URLRequest, fromFile fileURL: URL) -> URLSessionUploadTask diff --git a/watchOS/Foundation/NSUserActivity.swift b/watchOS/Foundation/NSUserActivity.swift index 9f548a0..277d1f7 100644 --- a/watchOS/Foundation/NSUserActivity.swift +++ b/watchOS/Foundation/NSUserActivity.swift @@ -26,7 +26,7 @@ class NSUserActivity : NSObject { func resignCurrent() func invalidate() func getContinuationStreams(completionHandler: @escaping (InputStream?, OutputStream?, Error?) -> Void) - func getContinuationStreams() async throws -> (InputStream?, OutputStream?) + func continuationStreams() async throws -> (InputStream?, OutputStream?) @available(watchOS 3.0, *) var isEligibleForHandoff: Bool @available(watchOS 3.0, *) diff --git a/watchOS/HealthKit/HKHealthStore.swift b/watchOS/HealthKit/HKHealthStore.swift index bd81104..2aaf023 100644 --- a/watchOS/HealthKit/HKHealthStore.swift +++ b/watchOS/HealthKit/HKHealthStore.swift @@ -8,7 +8,7 @@ class HKHealthStore : NSObject { @available(watchOS 5.0, *) func getRequestStatusForAuthorization(toShare typesToShare: Set, read typesToRead: Set, completion: @escaping (HKAuthorizationRequestStatus, Error?) -> Void) @available(watchOS 5.0, *) - func getRequestStatusForAuthorization(toShare typesToShare: Set, read typesToRead: Set) async throws -> HKAuthorizationRequestStatus + func requestStatusForAuthorization(toShare typesToShare: Set, read typesToRead: Set) async throws -> HKAuthorizationRequestStatus @available(watchOS 2.0, *) func earliestPermittedSampleDate() -> Date func save(_ object: HKObject, withCompletion completion: @escaping (Bool, Error?) -> Void) diff --git a/watchOS/Intents/INVoiceShortcutCenter.swift b/watchOS/Intents/INVoiceShortcutCenter.swift index b898752..b70f459 100644 --- a/watchOS/Intents/INVoiceShortcutCenter.swift +++ b/watchOS/Intents/INVoiceShortcutCenter.swift @@ -3,7 +3,7 @@ class INVoiceShortcutCenter : NSObject { class var shared: INVoiceShortcutCenter { get } func getAllVoiceShortcuts(completion completionHandler: @escaping ([INVoiceShortcut]?, Error?) -> Void) - func getAllVoiceShortcuts() async throws -> [INVoiceShortcut]? + func allVoiceShortcuts() async throws -> [INVoiceShortcut]? func getVoiceShortcut(with identifier: UUID, completion completionHandler: @escaping (INVoiceShortcut?, Error?) -> Void) func getVoiceShortcut(with identifier: UUID) async throws -> INVoiceShortcut? func setShortcutSuggestions(_ suggestions: [INShortcut]) diff --git a/watchOS/NetworkExtension/NetworkExtension.swift b/watchOS/NetworkExtension/NetworkExtension.swift index 11239cc..f0a7aa9 100644 --- a/watchOS/NetworkExtension/NetworkExtension.swift +++ b/watchOS/NetworkExtension/NetworkExtension.swift @@ -99,7 +99,7 @@ class NEHotspotConfigurationManager : NSObject { @available(watchOS 7.0, *) func getConfiguredSSIDs(completionHandler: @escaping ([String]) -> Void) @available(watchOS 7.0, *) - func getConfiguredSSIDs() async -> [String] + func configuredSSIDs() async -> [String] } @available(watchOS 2.0, *) class NEIPv6Route : NSObject, NSSecureCoding, NSCopying { diff --git a/watchOS/SwiftUI/SwiftUI.swift b/watchOS/SwiftUI/SwiftUI.swift index a3f610c..d1e222e 100644 --- a/watchOS/SwiftUI/SwiftUI.swift +++ b/watchOS/SwiftUI/SwiftUI.swift @@ -3091,7 +3091,7 @@ extension Scene { } @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) -@_functionBuilder struct SceneBuilder { +@resultBuilder struct SceneBuilder { static func buildBlock(_ content: Content) -> Content where Content : Scene } @@ -3715,7 +3715,7 @@ extension ToolbarContent { } @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) -@_functionBuilder struct ToolbarContentBuilder { +@resultBuilder struct ToolbarContentBuilder { static func buildBlock(_ content: Content) -> some ToolbarContent where Content : ToolbarContent static func buildBlock(_ content: Content) -> some CustomizableToolbarContent where Content : CustomizableToolbarContent @@ -5122,7 +5122,7 @@ extension View { } @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) -@_functionBuilder struct ViewBuilder { +@resultBuilder struct ViewBuilder { @_alwaysEmitIntoClient static func buildBlock() -> EmptyView @_alwaysEmitIntoClient static func buildBlock(_ content: Content) -> Content where Content : View } diff --git a/watchOS/UserNotifications/UNUserNotificationCenter.swift b/watchOS/UserNotifications/UNUserNotificationCenter.swift index 4ccb5c6..65f1088 100644 --- a/watchOS/UserNotifications/UNUserNotificationCenter.swift +++ b/watchOS/UserNotifications/UNUserNotificationCenter.swift @@ -25,17 +25,17 @@ class UNUserNotificationCenter : NSObject { func requestAuthorization(options: UNAuthorizationOptions = []) async throws -> Bool func setNotificationCategories(_ categories: Set) func getNotificationCategories(completionHandler: @escaping (Set) -> Void) - func getNotificationCategories() async -> Set + func notificationCategories() async -> Set func getNotificationSettings(completionHandler: @escaping (UNNotificationSettings) -> Void) - func getNotificationSettings() async -> UNNotificationSettings + func notificationSettings() async -> UNNotificationSettings func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) func add(_ request: UNNotificationRequest) async throws func getPendingNotificationRequests(completionHandler: @escaping ([UNNotificationRequest]) -> Void) - func getPendingNotificationRequests() async -> [UNNotificationRequest] + func pendingNotificationRequests() async -> [UNNotificationRequest] func removePendingNotificationRequests(withIdentifiers identifiers: [String]) func removeAllPendingNotificationRequests() func getDeliveredNotifications(completionHandler: @escaping ([UNNotification]) -> Void) - func getDeliveredNotifications() async -> [UNNotification] + func deliveredNotifications() async -> [UNNotification] func removeDeliveredNotifications(withIdentifiers identifiers: [String]) func removeAllDeliveredNotifications() } From 512537636291cd368c0ce859de0ed415d3dee7b0 Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Wed, 21 Oct 2020 22:19:32 -0700 Subject: [PATCH 3/9] [Concurrency] Drop "Asynchronously" suffix from imported 'async' methods. --- iOS/AVFoundation/AVAssetExportSession.swift | 2 +- iOS/AVFoundation/AVAssetImageGenerator.swift | 2 +- iOS/AVFoundation/AVAsynchronousKeyValueLoading.swift | 2 +- iOS/AVFoundation/AVCaptureStillImageOutput.swift | 4 ++-- macOS/AVFoundation/AVAssetExportSession.swift | 2 +- macOS/AVFoundation/AVAssetImageGenerator.swift | 2 +- macOS/AVFoundation/AVAsynchronousKeyValueLoading.swift | 2 +- macOS/AVFoundation/AVCaptureStillImageOutput.swift | 2 +- .../AVFoundation/AVPlayerItemProtectedContentAdditions.swift | 2 +- macOS/SafariServices/SFSafariPage.swift | 2 +- tvOS/AVFoundation/AVAssetExportSession.swift | 2 +- tvOS/AVFoundation/AVAssetImageGenerator.swift | 2 +- tvOS/AVFoundation/AVAsynchronousKeyValueLoading.swift | 2 +- tvOS/AVFoundation/AVCaptureStillImageOutput.swift | 2 +- watchOS/AVFoundation/AVAsynchronousKeyValueLoading.swift | 2 +- watchOS/AVFoundation/AVCaptureStillImageOutput.swift | 2 +- 16 files changed, 17 insertions(+), 17 deletions(-) diff --git a/iOS/AVFoundation/AVAssetExportSession.swift b/iOS/AVFoundation/AVAssetExportSession.swift index 9e685b7..f624b66 100644 --- a/iOS/AVFoundation/AVAssetExportSession.swift +++ b/iOS/AVFoundation/AVAssetExportSession.swift @@ -55,7 +55,7 @@ class AVAssetExportSession : NSObject { var status: AVAssetExportSession.Status { get } var error: Error? { get } func exportAsynchronously(completionHandler handler: @escaping () -> Void) - func exportAsynchronously() async + func export() async var progress: Float { get } func cancelExport() } diff --git a/iOS/AVFoundation/AVAssetImageGenerator.swift b/iOS/AVFoundation/AVAssetImageGenerator.swift index 300a83a..a7c39c5 100644 --- a/iOS/AVFoundation/AVAssetImageGenerator.swift +++ b/iOS/AVFoundation/AVAssetImageGenerator.swift @@ -38,7 +38,7 @@ class AVAssetImageGenerator : NSObject { init(asset: AVAsset) func copyCGImage(at requestedTime: CMTime, actualTime: UnsafeMutablePointer?) throws -> CGImage func generateCGImagesAsynchronously(forTimes requestedTimes: [NSValue], completionHandler handler: @escaping AVAssetImageGeneratorCompletionHandler) - func generateCGImagesAsynchronously(forTimes requestedTimes: [NSValue]) async throws -> (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result) + func generateCGImages(forTimes requestedTimes: [NSValue]) async throws -> (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result) func cancelAllCGImageGeneration() } typealias AVAssetImageGeneratorCompletionHandler = (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result, Error?) -> Void diff --git a/iOS/AVFoundation/AVAsynchronousKeyValueLoading.swift b/iOS/AVFoundation/AVAsynchronousKeyValueLoading.swift index cd4a315..22888c5 100644 --- a/iOS/AVFoundation/AVAsynchronousKeyValueLoading.swift +++ b/iOS/AVFoundation/AVAsynchronousKeyValueLoading.swift @@ -11,5 +11,5 @@ enum AVKeyValueStatus : Int { protocol AVAsynchronousKeyValueLoading { func statusOfValue(forKey key: String, error outError: NSErrorPointer) -> AVKeyValueStatus func loadValuesAsynchronously(forKeys keys: [String], completionHandler handler: (() -> Void)? = nil) - func loadValuesAsynchronously(forKeys keys: [String]) async + func loadValues(forKeys keys: [String]) async } diff --git a/iOS/AVFoundation/AVCaptureStillImageOutput.swift b/iOS/AVFoundation/AVCaptureStillImageOutput.swift index 794e92c..2cbb9e4 100644 --- a/iOS/AVFoundation/AVCaptureStillImageOutput.swift +++ b/iOS/AVFoundation/AVCaptureStillImageOutput.swift @@ -15,7 +15,7 @@ class AVCaptureStillImageOutput : AVCaptureOutput { @available(iOS 5.0, *) var isCapturingStillImage: Bool { get } func captureStillImageAsynchronously(from connection: AVCaptureConnection, completionHandler handler: @escaping (CMSampleBuffer?, Error?) -> Void) - func captureStillImageAsynchronously(from connection: AVCaptureConnection) async throws -> CMSampleBuffer? + func captureStillImage(from connection: AVCaptureConnection) async throws -> CMSampleBuffer? class func jpegStillImageNSDataRepresentation(_ jpegSampleBuffer: CMSampleBuffer) -> Data? } @available(iOS 8.0, *) @@ -46,5 +46,5 @@ extension AVCaptureStillImageOutput { @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead.") func captureStillImageBracketAsynchronously(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings], completionHandler handler: @escaping (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?, Error?) -> Void) @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead.") - func captureStillImageBracketAsynchronously(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings]) async throws -> (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?) + func captureStillImageBracket(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings]) async throws -> (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?) } diff --git a/macOS/AVFoundation/AVAssetExportSession.swift b/macOS/AVFoundation/AVAssetExportSession.swift index 214b325..a7a680c 100644 --- a/macOS/AVFoundation/AVAssetExportSession.swift +++ b/macOS/AVFoundation/AVAssetExportSession.swift @@ -73,7 +73,7 @@ class AVAssetExportSession : NSObject { var status: AVAssetExportSession.Status { get } var error: Error? { get } func exportAsynchronously(completionHandler handler: @escaping () -> Void) - func exportAsynchronously() async + func export() async var progress: Float { get } func cancelExport() } diff --git a/macOS/AVFoundation/AVAssetImageGenerator.swift b/macOS/AVFoundation/AVAssetImageGenerator.swift index 7febc78..4049fa1 100644 --- a/macOS/AVFoundation/AVAssetImageGenerator.swift +++ b/macOS/AVFoundation/AVAssetImageGenerator.swift @@ -38,7 +38,7 @@ class AVAssetImageGenerator : NSObject { init(asset: AVAsset) func copyCGImage(at requestedTime: CMTime, actualTime: UnsafeMutablePointer?) throws -> CGImage func generateCGImagesAsynchronously(forTimes requestedTimes: [NSValue], completionHandler handler: @escaping AVAssetImageGeneratorCompletionHandler) - func generateCGImagesAsynchronously(forTimes requestedTimes: [NSValue]) async throws -> (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result) + func generateCGImages(forTimes requestedTimes: [NSValue]) async throws -> (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result) func cancelAllCGImageGeneration() } typealias AVAssetImageGeneratorCompletionHandler = (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result, Error?) -> Void diff --git a/macOS/AVFoundation/AVAsynchronousKeyValueLoading.swift b/macOS/AVFoundation/AVAsynchronousKeyValueLoading.swift index cd4a315..22888c5 100644 --- a/macOS/AVFoundation/AVAsynchronousKeyValueLoading.swift +++ b/macOS/AVFoundation/AVAsynchronousKeyValueLoading.swift @@ -11,5 +11,5 @@ enum AVKeyValueStatus : Int { protocol AVAsynchronousKeyValueLoading { func statusOfValue(forKey key: String, error outError: NSErrorPointer) -> AVKeyValueStatus func loadValuesAsynchronously(forKeys keys: [String], completionHandler handler: (() -> Void)? = nil) - func loadValuesAsynchronously(forKeys keys: [String]) async + func loadValues(forKeys keys: [String]) async } diff --git a/macOS/AVFoundation/AVCaptureStillImageOutput.swift b/macOS/AVFoundation/AVCaptureStillImageOutput.swift index b94cffa..46d81e6 100644 --- a/macOS/AVFoundation/AVCaptureStillImageOutput.swift +++ b/macOS/AVFoundation/AVCaptureStillImageOutput.swift @@ -9,7 +9,7 @@ class AVCaptureStillImageOutput : AVCaptureOutput { @available(macOS 10.8, *) var isCapturingStillImage: Bool { get } func captureStillImageAsynchronously(from connection: AVCaptureConnection, completionHandler handler: @escaping (CMSampleBuffer?, Error?) -> Void) - func captureStillImageAsynchronously(from connection: AVCaptureConnection) async throws -> CMSampleBuffer? + func captureStillImage(from connection: AVCaptureConnection) async throws -> CMSampleBuffer? class func jpegStillImageNSDataRepresentation(_ jpegSampleBuffer: CMSampleBuffer) -> Data? } extension AVCaptureStillImageOutput { diff --git a/macOS/AVFoundation/AVPlayerItemProtectedContentAdditions.swift b/macOS/AVFoundation/AVPlayerItemProtectedContentAdditions.swift index feecf18..0742d13 100644 --- a/macOS/AVFoundation/AVPlayerItemProtectedContentAdditions.swift +++ b/macOS/AVFoundation/AVPlayerItemProtectedContentAdditions.swift @@ -20,7 +20,7 @@ extension AVPlayerItem { @available(macOS 10.7, *) func requestContentAuthorizationAsynchronously(withTimeoutInterval timeoutInterval: TimeInterval, completionHandler handler: @escaping () -> Void) @available(macOS 10.7, *) - func requestContentAuthorizationAsynchronously(withTimeoutInterval timeoutInterval: TimeInterval) async + func requestContentAuthorization(withTimeoutInterval timeoutInterval: TimeInterval) async @available(macOS 10.7, *) func cancelContentAuthorizationRequest() @available(macOS 10.7, *) diff --git a/macOS/SafariServices/SFSafariPage.swift b/macOS/SafariServices/SFSafariPage.swift index 107fcb6..c2a20b5 100644 --- a/macOS/SafariServices/SFSafariPage.swift +++ b/macOS/SafariServices/SFSafariPage.swift @@ -3,7 +3,7 @@ class SFSafariPage : NSObject, NSCopying, NSSecureCoding { func dispatchMessageToScript(withName messageName: String, userInfo: [String : Any]? = nil) func reload() func getPropertiesWithCompletionHandler(_ completionHandler: @escaping (SFSafariPageProperties?) -> Void) - func pageProperties() async -> SFSafariPageProperties? + func properties() async -> SFSafariPageProperties? func getContainingTab(completionHandler: @escaping (SFSafariTab) -> Void) func containingTab() async -> SFSafariTab func getScreenshotOfVisibleArea(completionHandler: @escaping (NSImage?) -> Void) diff --git a/tvOS/AVFoundation/AVAssetExportSession.swift b/tvOS/AVFoundation/AVAssetExportSession.swift index 581242e..0194957 100644 --- a/tvOS/AVFoundation/AVAssetExportSession.swift +++ b/tvOS/AVFoundation/AVAssetExportSession.swift @@ -55,7 +55,7 @@ class AVAssetExportSession : NSObject { var status: AVAssetExportSession.Status { get } var error: Error? { get } func exportAsynchronously(completionHandler handler: @escaping () -> Void) - func exportAsynchronously() async + func export() async var progress: Float { get } func cancelExport() } diff --git a/tvOS/AVFoundation/AVAssetImageGenerator.swift b/tvOS/AVFoundation/AVAssetImageGenerator.swift index 1a25451..e34af07 100644 --- a/tvOS/AVFoundation/AVAssetImageGenerator.swift +++ b/tvOS/AVFoundation/AVAssetImageGenerator.swift @@ -38,7 +38,7 @@ class AVAssetImageGenerator : NSObject { init(asset: AVAsset) func copyCGImage(at requestedTime: CMTime, actualTime: UnsafeMutablePointer?) throws -> CGImage func generateCGImagesAsynchronously(forTimes requestedTimes: [NSValue], completionHandler handler: @escaping AVAssetImageGeneratorCompletionHandler) - func generateCGImagesAsynchronously(forTimes requestedTimes: [NSValue]) async throws -> (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result) + func generateCGImages(forTimes requestedTimes: [NSValue]) async throws -> (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result) func cancelAllCGImageGeneration() } typealias AVAssetImageGeneratorCompletionHandler = (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result, Error?) -> Void diff --git a/tvOS/AVFoundation/AVAsynchronousKeyValueLoading.swift b/tvOS/AVFoundation/AVAsynchronousKeyValueLoading.swift index cd4a315..22888c5 100644 --- a/tvOS/AVFoundation/AVAsynchronousKeyValueLoading.swift +++ b/tvOS/AVFoundation/AVAsynchronousKeyValueLoading.swift @@ -11,5 +11,5 @@ enum AVKeyValueStatus : Int { protocol AVAsynchronousKeyValueLoading { func statusOfValue(forKey key: String, error outError: NSErrorPointer) -> AVKeyValueStatus func loadValuesAsynchronously(forKeys keys: [String], completionHandler handler: (() -> Void)? = nil) - func loadValuesAsynchronously(forKeys keys: [String]) async + func loadValues(forKeys keys: [String]) async } diff --git a/tvOS/AVFoundation/AVCaptureStillImageOutput.swift b/tvOS/AVFoundation/AVCaptureStillImageOutput.swift index f49c4a2..4956d0c 100644 --- a/tvOS/AVFoundation/AVCaptureStillImageOutput.swift +++ b/tvOS/AVFoundation/AVCaptureStillImageOutput.swift @@ -13,5 +13,5 @@ extension AVCaptureStillImageOutput { @available(tvOS, introduced: 8.0, deprecated: 10.0, message: "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead.") func captureStillImageBracketAsynchronously(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings], completionHandler handler: @escaping (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?, Error?) -> Void) @available(tvOS, introduced: 8.0, deprecated: 10.0, message: "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead.") - func captureStillImageBracketAsynchronously(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings]) async throws -> (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?) + func captureStillImageBracket(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings]) async throws -> (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?) } diff --git a/watchOS/AVFoundation/AVAsynchronousKeyValueLoading.swift b/watchOS/AVFoundation/AVAsynchronousKeyValueLoading.swift index cd4a315..22888c5 100644 --- a/watchOS/AVFoundation/AVAsynchronousKeyValueLoading.swift +++ b/watchOS/AVFoundation/AVAsynchronousKeyValueLoading.swift @@ -11,5 +11,5 @@ enum AVKeyValueStatus : Int { protocol AVAsynchronousKeyValueLoading { func statusOfValue(forKey key: String, error outError: NSErrorPointer) -> AVKeyValueStatus func loadValuesAsynchronously(forKeys keys: [String], completionHandler handler: (() -> Void)? = nil) - func loadValuesAsynchronously(forKeys keys: [String]) async + func loadValues(forKeys keys: [String]) async } diff --git a/watchOS/AVFoundation/AVCaptureStillImageOutput.swift b/watchOS/AVFoundation/AVCaptureStillImageOutput.swift index 8d5f03f..a117f65 100644 --- a/watchOS/AVFoundation/AVCaptureStillImageOutput.swift +++ b/watchOS/AVFoundation/AVCaptureStillImageOutput.swift @@ -13,5 +13,5 @@ extension AVCaptureStillImageOutput { @available(watchOS, introduced: 2.0, deprecated: 3.0, message: "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead.") func captureStillImageBracketAsynchronously(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings], completionHandler handler: @escaping (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?, Error?) -> Void) @available(watchOS, introduced: 2.0, deprecated: 3.0, message: "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead.") - func captureStillImageBracketAsynchronously(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings]) async throws -> (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?) + func captureStillImageBracket(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings]) async throws -> (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?) } From e8bef4a3917dc43b524d18cc0e643393297238a5 Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Fri, 23 Oct 2020 11:50:27 -0700 Subject: [PATCH 4/9] [Concurrency] Retain text from a completion-handler selector piece. --- iOS/AVKit/AVPlayerViewController.swift | 2 +- iOS/MediaPlayer/MPPlayableContentDelegate.swift | 2 +- iOS/UIKit/UIApplication.swift | 2 +- iOS/UIKit/UIScreenshotService.swift | 2 +- macOS/AVKit/AVPlayerView.swift | 2 +- tvOS/AVKit/AVPlayerViewController.swift | 2 +- tvOS/UIKit/UIApplication.swift | 2 +- tvOS/UIKit/UIScreenshotService.swift | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/iOS/AVKit/AVPlayerViewController.swift b/iOS/AVKit/AVPlayerViewController.swift index f609aba..12439ee 100644 --- a/iOS/AVKit/AVPlayerViewController.swift +++ b/iOS/AVKit/AVPlayerViewController.swift @@ -46,5 +46,5 @@ protocol AVPlayerViewControllerDelegate : NSObjectProtocol { @available(iOS 8.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void) @available(iOS 8.0, *) - optional func playerViewController(_ playerViewController: AVPlayerViewController) async -> Bool + optional func playerViewControllerRestoreUserInterfaceForPictureInPictureStop(_ playerViewController: AVPlayerViewController) async -> Bool } diff --git a/iOS/MediaPlayer/MPPlayableContentDelegate.swift b/iOS/MediaPlayer/MPPlayableContentDelegate.swift index dd266f1..c6b1bac 100644 --- a/iOS/MediaPlayer/MPPlayableContentDelegate.swift +++ b/iOS/MediaPlayer/MPPlayableContentDelegate.swift @@ -8,7 +8,7 @@ protocol MPPlayableContentDelegate : NSObjectProtocol { @available(iOS, introduced: 9.0, deprecated: 9.3, message: "Use Intents framework for initiating playback queues.") optional func playableContentManager(_ contentManager: MPPlayableContentManager, initializePlaybackQueueWithCompletionHandler completionHandler: @escaping (Error?) -> Void) @available(iOS, introduced: 9.0, deprecated: 9.3, message: "Use Intents framework for initiating playback queues.") - optional func playableContentManager(_ contentManager: MPPlayableContentManager) async throws + optional func playableContentManagerInitializePlaybackQueue(_ contentManager: MPPlayableContentManager) async throws @available(iOS, introduced: 9.3, deprecated: 12.0, message: "Use Intents framework for initiating playback queues.") optional func playableContentManager(_ contentManager: MPPlayableContentManager, initializePlaybackQueueWithContentItems contentItems: [Any]?, completionHandler: @escaping (Error?) -> Void) @available(iOS, introduced: 9.3, deprecated: 12.0, message: "Use Intents framework for initiating playback queues.") diff --git a/iOS/UIKit/UIApplication.swift b/iOS/UIKit/UIApplication.swift index 7a79fa8..765821f 100644 --- a/iOS/UIKit/UIApplication.swift +++ b/iOS/UIKit/UIApplication.swift @@ -346,7 +346,7 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(iOS, introduced: 7.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead") optional func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) @available(iOS, introduced: 7.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead") - optional func application(_ application: UIApplication) async -> UIBackgroundFetchResult + optional func applicationPerformFetch(_ application: UIApplication) async -> UIBackgroundFetchResult @available(iOS 9.0, *) optional func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) @available(iOS 9.0, *) diff --git a/iOS/UIKit/UIScreenshotService.swift b/iOS/UIKit/UIScreenshotService.swift index 6e1b3aa..6ef6b05 100644 --- a/iOS/UIKit/UIScreenshotService.swift +++ b/iOS/UIKit/UIScreenshotService.swift @@ -12,5 +12,5 @@ protocol UIScreenshotServiceDelegate : NSObjectProtocol { @available(iOS 13.0, *) optional func screenshotService(_ screenshotService: UIScreenshotService, generatePDFRepresentationWithCompletion completionHandler: @escaping (Data?, Int, CGRect) -> Void) @available(iOS 13.0, *) - optional func screenshotService(_ screenshotService: UIScreenshotService) async -> (Data?, Int, CGRect) + optional func screenshotServiceGeneratePDFRepresentation(_ screenshotService: UIScreenshotService) async -> (Data?, Int, CGRect) } diff --git a/macOS/AVKit/AVPlayerView.swift b/macOS/AVKit/AVPlayerView.swift index 213640a..eaa14be 100644 --- a/macOS/AVKit/AVPlayerView.swift +++ b/macOS/AVKit/AVPlayerView.swift @@ -61,6 +61,6 @@ protocol AVPlayerViewPictureInPictureDelegate : NSObjectProtocol { optional func playerViewWillStopPicture(inPicture playerView: AVPlayerView) @asyncHandler optional func playerViewDidStopPicture(inPicture playerView: AVPlayerView) optional func playerView(_ playerView: AVPlayerView, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void) - optional func playerView(_ playerView: AVPlayerView) async -> Bool + optional func playerViewRestoreUserInterfaceForPictureInPictureStop(_ playerView: AVPlayerView) async -> Bool optional func playerViewShouldAutomaticallyDismissAtPicture(inPictureStart playerView: AVPlayerView) -> Bool } diff --git a/tvOS/AVKit/AVPlayerViewController.swift b/tvOS/AVKit/AVPlayerViewController.swift index d775367..9b1ac21 100644 --- a/tvOS/AVKit/AVPlayerViewController.swift +++ b/tvOS/AVKit/AVPlayerViewController.swift @@ -101,7 +101,7 @@ protocol AVPlayerViewControllerDelegate : NSObjectProtocol { @available(tvOS 9.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void) @available(tvOS 9.0, *) - optional func playerViewController(_ playerViewController: AVPlayerViewController) async -> Bool + optional func playerViewControllerRestoreUserInterfaceForPictureInPictureStop(_ playerViewController: AVPlayerViewController) async -> Bool } protocol AVPlayerViewControllerAnimationCoordinator : NSObjectProtocol { @available(tvOS 11.0, *) diff --git a/tvOS/UIKit/UIApplication.swift b/tvOS/UIKit/UIApplication.swift index 2a45ad9..2d68041 100644 --- a/tvOS/UIKit/UIApplication.swift +++ b/tvOS/UIKit/UIApplication.swift @@ -213,7 +213,7 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(tvOS, introduced: 11.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead") optional func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) @available(tvOS, introduced: 11.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead") - optional func application(_ application: UIApplication) async -> UIBackgroundFetchResult + optional func applicationPerformFetch(_ application: UIApplication) async -> UIBackgroundFetchResult @available(tvOS 7.0, *) optional func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) @available(tvOS 7.0, *) diff --git a/tvOS/UIKit/UIScreenshotService.swift b/tvOS/UIKit/UIScreenshotService.swift index 499b086..27f3af8 100644 --- a/tvOS/UIKit/UIScreenshotService.swift +++ b/tvOS/UIKit/UIScreenshotService.swift @@ -12,5 +12,5 @@ protocol UIScreenshotServiceDelegate : NSObjectProtocol { @available(tvOS 13.0, *) optional func screenshotService(_ screenshotService: UIScreenshotService, generatePDFRepresentationWithCompletion completionHandler: @escaping (Data?, Int, CGRect) -> Void) @available(tvOS 13.0, *) - optional func screenshotService(_ screenshotService: UIScreenshotService) async -> (Data?, Int, CGRect) + optional func screenshotServiceGeneratePDFRepresentation(_ screenshotService: UIScreenshotService) async -> (Data?, Int, CGRect) } From d76d005053dfc709ef57b69f10c2d7ea851692bb Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Fri, 30 Oct 2020 00:04:27 -0700 Subject: [PATCH 5/9] Implicitly strip optionals for return type of translated "async throws". Review over a large number of APIs has found that most of the time, the result type of an Objective-C completion handler method that becomes "async throws" should be optional. --- iOS/ARKit/ARSession.swift | 4 ++-- iOS/AVFoundation/AVAssetImageGenerator.swift | 2 +- .../AVCaptureStillImageOutput.swift | 4 ++-- iOS/AVFoundation/AVContentKeySession.swift | 8 +++---- iOS/AudioToolbox/AUAudioUnit.swift | 2 +- ...ticationModificationExtensionContext.swift | 2 +- iOS/ClassKit/CLSContext.swift | 2 +- iOS/CloudKit/CKContainer.swift | 24 +++++++++---------- iOS/CloudKit/CKDatabase.swift | 24 +++++++++---------- iOS/CoreLocation/CLGeocoder.swift | 12 +++++----- iOS/CoreML/MLModel.swift | 2 +- iOS/CoreNFC/CoreNFC.swift | 6 ++--- iOS/CoreSpotlight/CSSearchableIndex.swift | 2 +- iOS/DeviceCheck/DCAppAttestService.swift | 6 ++--- iOS/DeviceCheck/DCDevice.swift | 2 +- iOS/ExposureNotification/ENManager.swift | 4 ++-- iOS/FileProvider/NSFileProviderActions.swift | 18 +++++++------- iOS/Foundation/NSFileManager.swift | 4 ++-- iOS/Foundation/NSFileVersion.swift | 2 +- iOS/Foundation/NSItemProvider.swift | 4 ++-- iOS/Foundation/NSURLConnection.swift | 2 +- iOS/Foundation/NSURLSession.swift | 4 ++-- iOS/Foundation/NSUserActivity.swift | 2 +- iOS/GLKit/GLKTextureLoader.swift | 16 ++++++------- iOS/GameKit/GKAchievement.swift | 2 +- iOS/GameKit/GKAchievementDescription.swift | 4 ++-- iOS/GameKit/GKChallenge.swift | 6 ++--- iOS/GameKit/GKCloudPlayer.swift | 2 +- iOS/GameKit/GKGameSession.swift | 12 +++++----- iOS/GameKit/GKLeaderboard.swift | 14 +++++------ iOS/GameKit/GKLeaderboardSet.swift | 6 ++--- iOS/GameKit/GKLocalPlayer.swift | 14 +++++------ iOS/GameKit/GKMatch.swift | 2 +- iOS/GameKit/GKMatchmaker.swift | 8 +++---- iOS/GameKit/GKPlayer.swift | 4 ++-- iOS/GameKit/GKSavedGame.swift | 8 +++---- iOS/GameKit/GKTurnBasedMatch.swift | 14 +++++------ iOS/HealthKit/HKHeartbeatSeriesBuilder.swift | 2 +- .../HKQuantitySeriesSampleBuilder.swift | 4 ++-- iOS/HealthKit/HKWorkoutBuilder.swift | 2 +- iOS/HealthKit/HKWorkoutRouteBuilder.swift | 2 +- iOS/HomeKit/HMHome.swift | 12 +++++----- iOS/HomeKit/HMHomeManager.swift | 2 +- .../ILMessageFilterExtensionContext.swift | 2 +- iOS/ImageCaptureCore/ICCameraFile.swift | 6 ++--- iOS/Intents/INVoiceShortcutCenter.swift | 4 ++-- iOS/LinkPresentation/LPMetadataProvider.swift | 2 +- iOS/MapKit/MKDirections.swift | 4 ++-- iOS/MapKit/MKLocalSearch.swift | 2 +- iOS/MapKit/MKMapSnapshotter.swift | 4 ++-- iOS/MediaPlayer/MPMediaLibrary.swift | 2 +- .../MPPlayableContentDataSource.swift | 2 +- iOS/Metal/MTLDevice.swift | 14 +++++------ iOS/Metal/MTLLibrary.swift | 6 ++--- iOS/MetalKit/MTKTextureLoader.swift | 10 ++++---- iOS/MultipeerConnectivity/MCSession.swift | 2 +- iOS/NetworkExtension/NetworkExtension.swift | 12 +++++----- .../PKAddShareablePassConfiguration.swift | 2 +- iOS/PassKit/PKPassLibrary.swift | 2 +- iOS/Photos/PHLivePhotoEditingContext.swift | 2 +- .../QLThumbnailGenerator.swift | 2 +- .../SFContentBlockerManager.swift | 2 +- iOS/StoreKit/SKCloudServiceController.swift | 8 +++---- .../UIDocumentBrowserViewController.swift | 4 ++-- iOS/UIKit/UIPasteboard.swift | 8 +++---- iOS/WebKit/NSAttributedString.swift | 8 +++---- iOS/WebKit/WKContentRuleListStore.swift | 4 ++-- iOS/WebKit/WKWebView.swift | 10 ++++---- iOS/iAd/ADClient.swift | 2 +- .../AVFoundation/AVAssetImageGenerator.swift | 2 +- .../AVCaptureStillImageOutput.swift | 2 +- macOS/AVFoundation/AVContentKeySession.swift | 8 +++---- macOS/AppKit/NSDocumentController.swift | 4 ++-- macOS/AppKit/NSWindowRestoration.swift | 4 ++-- macOS/AppKit/NSWorkspace.swift | 8 +++---- macOS/AudioToolbox/AUAudioUnit.swift | 2 +- macOS/ClassKit/CLSContext.swift | 2 +- macOS/CloudKit/CKContainer.swift | 24 +++++++++---------- macOS/CloudKit/CKDatabase.swift | 24 +++++++++---------- macOS/CoreLocation/CLGeocoder.swift | 12 +++++----- macOS/CoreML/MLModel.swift | 2 +- macOS/CoreSpotlight/CSSearchableIndex.swift | 2 +- macOS/DeviceCheck/DCDevice.swift | 2 +- macOS/FileProvider/Extension.swift | 4 ++-- .../FileProvider/NSFileProviderActions.swift | 18 +++++++------- macOS/Foundation/NSFileManager.swift | 4 ++-- macOS/Foundation/NSFileVersion.swift | 2 +- macOS/Foundation/NSItemProvider.swift | 4 ++-- macOS/Foundation/NSURLConnection.swift | 2 +- macOS/Foundation/NSURLSession.swift | 4 ++-- macOS/Foundation/NSUserActivity.swift | 2 +- macOS/Foundation/NSUserScriptTask.swift | 4 ++-- macOS/GLKit/GLKTextureLoader.swift | 16 ++++++------- macOS/GameKit/GKAchievement.swift | 2 +- macOS/GameKit/GKAchievementDescription.swift | 4 ++-- macOS/GameKit/GKChallenge.swift | 6 ++--- macOS/GameKit/GKCloudPlayer.swift | 2 +- macOS/GameKit/GKGameSession.swift | 12 +++++----- macOS/GameKit/GKLeaderboard.swift | 14 +++++------ macOS/GameKit/GKLeaderboardSet.swift | 6 ++--- macOS/GameKit/GKLocalPlayer.swift | 16 ++++++------- macOS/GameKit/GKMatch.swift | 2 +- macOS/GameKit/GKMatchmaker.swift | 8 +++---- macOS/GameKit/GKPlayer.swift | 4 ++-- macOS/GameKit/GKSavedGame.swift | 8 +++---- macOS/GameKit/GKTurnBasedMatch.swift | 14 +++++------ macOS/ImageCaptureCore/ICCameraFile.swift | 6 ++--- .../LinkPresentation/LPMetadataProvider.swift | 2 +- macOS/MapKit/MKDirections.swift | 4 ++-- macOS/MapKit/MKLocalSearch.swift | 2 +- macOS/MapKit/MKMapSnapshotter.swift | 4 ++-- macOS/Metal/MTLDevice.swift | 14 +++++------ macOS/Metal/MTLLibrary.swift | 6 ++--- macOS/MetalKit/MTKTextureLoader.swift | 12 +++++----- macOS/MultipeerConnectivity/MCSession.swift | 2 +- macOS/NetworkExtension/NetworkExtension.swift | 12 +++++----- .../PKAddShareablePassConfiguration.swift | 2 +- macOS/PassKit/PKPassLibrary.swift | 2 +- macOS/Photos/PHLivePhotoEditingContext.swift | 2 +- .../QLThumbnailGenerator.swift | 2 +- macOS/ReplayKit/RPBroadcast.swift | 2 +- .../SFContentBlockerManager.swift | 2 +- .../SFSafariExtensionManager.swift | 2 +- macOS/StoreKit/SKCloudServiceController.swift | 6 ++--- .../Virtualization/VZVirtioSocketDevice.swift | 2 +- macOS/WebKit/NSAttributedString.swift | 8 +++---- macOS/WebKit/WKContentRuleListStore.swift | 4 ++-- macOS/WebKit/WKWebView.swift | 10 ++++---- tvOS/AVFoundation/AVAssetImageGenerator.swift | 2 +- .../AVCaptureStillImageOutput.swift | 2 +- tvOS/AVFoundation/AVContentKeySession.swift | 2 +- tvOS/AudioToolbox/AUAudioUnit.swift | 2 +- tvOS/CloudKit/CKContainer.swift | 22 ++++++++--------- tvOS/CloudKit/CKDatabase.swift | 24 +++++++++---------- tvOS/CoreLocation/CLGeocoder.swift | 12 +++++----- tvOS/CoreML/MLModel.swift | 2 +- tvOS/CoreSpotlight/CSSearchableIndex.swift | 2 +- tvOS/DeviceCheck/DCDevice.swift | 2 +- tvOS/Foundation/NSFileVersion.swift | 2 +- tvOS/Foundation/NSItemProvider.swift | 4 ++-- tvOS/Foundation/NSURLConnection.swift | 2 +- tvOS/Foundation/NSURLSession.swift | 4 ++-- tvOS/Foundation/NSUserActivity.swift | 2 +- tvOS/GLKit/GLKTextureLoader.swift | 16 ++++++------- tvOS/GameKit/GKAchievement.swift | 2 +- tvOS/GameKit/GKAchievementDescription.swift | 4 ++-- tvOS/GameKit/GKChallenge.swift | 4 ++-- tvOS/GameKit/GKCloudPlayer.swift | 2 +- tvOS/GameKit/GKGameSession.swift | 12 +++++----- tvOS/GameKit/GKLeaderboard.swift | 12 +++++----- tvOS/GameKit/GKLeaderboardSet.swift | 4 ++-- tvOS/GameKit/GKLocalPlayer.swift | 12 +++++----- tvOS/GameKit/GKMatch.swift | 2 +- tvOS/GameKit/GKMatchmaker.swift | 6 ++--- tvOS/GameKit/GKPlayer.swift | 4 ++-- tvOS/GameKit/GKTurnBasedMatch.swift | 14 +++++------ tvOS/MapKit/MKDirections.swift | 4 ++-- tvOS/MapKit/MKLocalSearch.swift | 2 +- tvOS/MapKit/MKMapSnapshotter.swift | 4 ++-- tvOS/Metal/MTLDevice.swift | 12 +++++----- tvOS/Metal/MTLLibrary.swift | 4 ++-- tvOS/MetalKit/MTKTextureLoader.swift | 10 ++++---- tvOS/MultipeerConnectivity/MCSession.swift | 2 +- tvOS/Photos/PHLivePhotoEditingContext.swift | 2 +- tvOS/StoreKit/SKCloudServiceController.swift | 8 +++---- .../AVCaptureStillImageOutput.swift | 2 +- .../AVFoundation/AVContentKeySession.swift | 8 +++---- watchOS/CloudKit/CKContainer.swift | 24 +++++++++---------- watchOS/CloudKit/CKDatabase.swift | 24 +++++++++---------- watchOS/CoreLocation/CLGeocoder.swift | 12 +++++----- watchOS/CoreML/MLModel.swift | 2 +- watchOS/Foundation/NSFileVersion.swift | 2 +- watchOS/Foundation/NSItemProvider.swift | 4 ++-- watchOS/Foundation/NSURLSession.swift | 4 ++-- watchOS/Foundation/NSUserActivity.swift | 2 +- watchOS/GameKit/GKAchievement.swift | 2 +- .../GameKit/GKAchievementDescription.swift | 2 +- watchOS/GameKit/GKLeaderboard.swift | 14 +++++------ watchOS/GameKit/GKLeaderboardSet.swift | 4 ++-- watchOS/GameKit/GKLocalPlayer.swift | 16 ++++++------- watchOS/GameKit/GKMatchmaker.swift | 2 +- watchOS/GameKit/GKPlayer.swift | 2 +- watchOS/GameKit/GKTurnBasedMatch.swift | 14 +++++------ watchOS/HealthKit/HKHealthStore.swift | 2 +- .../HealthKit/HKHeartbeatSeriesBuilder.swift | 2 +- .../HKQuantitySeriesSampleBuilder.swift | 4 ++-- watchOS/HealthKit/HKWorkoutBuilder.swift | 2 +- watchOS/HealthKit/HKWorkoutRouteBuilder.swift | 2 +- watchOS/Intents/INVoiceShortcutCenter.swift | 4 ++-- watchOS/PassKit/PKPassLibrary.swift | 2 +- .../StoreKit/SKCloudServiceController.swift | 6 ++--- 191 files changed, 580 insertions(+), 580 deletions(-) diff --git a/iOS/ARKit/ARSession.swift b/iOS/ARKit/ARSession.swift index 9dcbc3d..b2a7b65 100644 --- a/iOS/ARKit/ARSession.swift +++ b/iOS/ARKit/ARSession.swift @@ -27,11 +27,11 @@ class ARSession : NSObject { @available(iOS 12.0, *) func getCurrentWorldMap(completionHandler: @escaping (ARWorldMap?, Error?) -> Void) @available(iOS 12.0, *) - func currentWorldMap() async throws -> ARWorldMap? + func currentWorldMap() async throws -> ARWorldMap @available(iOS 12.0, *) func createReferenceObject(transform: simd_float4x4, center: simd_float3, extent: simd_float3, completionHandler: @escaping (ARReferenceObject?, Error?) -> Void) @available(iOS 12.0, *) - func createReferenceObject(transform: simd_float4x4, center: simd_float3, extent: simd_float3) async throws -> ARReferenceObject? + func createReferenceObject(transform: simd_float4x4, center: simd_float3, extent: simd_float3) async throws -> ARReferenceObject @available(iOS 13.0, *) func raycast(_ query: ARRaycastQuery) -> [ARRaycastResult] @available(iOS 13.0, *) diff --git a/iOS/AVFoundation/AVAssetImageGenerator.swift b/iOS/AVFoundation/AVAssetImageGenerator.swift index a7c39c5..9072edb 100644 --- a/iOS/AVFoundation/AVAssetImageGenerator.swift +++ b/iOS/AVFoundation/AVAssetImageGenerator.swift @@ -38,7 +38,7 @@ class AVAssetImageGenerator : NSObject { init(asset: AVAsset) func copyCGImage(at requestedTime: CMTime, actualTime: UnsafeMutablePointer?) throws -> CGImage func generateCGImagesAsynchronously(forTimes requestedTimes: [NSValue], completionHandler handler: @escaping AVAssetImageGeneratorCompletionHandler) - func generateCGImages(forTimes requestedTimes: [NSValue]) async throws -> (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result) + func generateCGImages(forTimes requestedTimes: [NSValue]) async throws -> (CMTime, CGImage, CMTime, AVAssetImageGenerator.Result) func cancelAllCGImageGeneration() } typealias AVAssetImageGeneratorCompletionHandler = (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result, Error?) -> Void diff --git a/iOS/AVFoundation/AVCaptureStillImageOutput.swift b/iOS/AVFoundation/AVCaptureStillImageOutput.swift index 2cbb9e4..12a5ef7 100644 --- a/iOS/AVFoundation/AVCaptureStillImageOutput.swift +++ b/iOS/AVFoundation/AVCaptureStillImageOutput.swift @@ -15,7 +15,7 @@ class AVCaptureStillImageOutput : AVCaptureOutput { @available(iOS 5.0, *) var isCapturingStillImage: Bool { get } func captureStillImageAsynchronously(from connection: AVCaptureConnection, completionHandler handler: @escaping (CMSampleBuffer?, Error?) -> Void) - func captureStillImage(from connection: AVCaptureConnection) async throws -> CMSampleBuffer? + func captureStillImage(from connection: AVCaptureConnection) async throws -> CMSampleBuffer class func jpegStillImageNSDataRepresentation(_ jpegSampleBuffer: CMSampleBuffer) -> Data? } @available(iOS 8.0, *) @@ -46,5 +46,5 @@ extension AVCaptureStillImageOutput { @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead.") func captureStillImageBracketAsynchronously(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings], completionHandler handler: @escaping (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?, Error?) -> Void) @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead.") - func captureStillImageBracket(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings]) async throws -> (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?) + func captureStillImageBracket(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings]) async throws -> (CMSampleBuffer, AVCaptureBracketedStillImageSettings) } diff --git a/iOS/AVFoundation/AVContentKeySession.swift b/iOS/AVFoundation/AVContentKeySession.swift index ee3b7d0..3867a7c 100644 --- a/iOS/AVFoundation/AVContentKeySession.swift +++ b/iOS/AVFoundation/AVContentKeySession.swift @@ -30,15 +30,15 @@ class AVContentKeySession : NSObject { @available(iOS 11.0, *) func makeSecureTokenForExpirationDate(ofPersistableContentKey persistableContentKeyData: Data, completionHandler handler: @escaping (Data?, Error?) -> Void) @available(iOS 11.0, *) - func makeSecureTokenForExpirationDate(ofPersistableContentKey persistableContentKeyData: Data) async throws -> Data? + func makeSecureTokenForExpirationDate(ofPersistableContentKey persistableContentKeyData: Data) async throws -> Data @available(iOS 12.2, *) func invalidatePersistableContentKey(_ persistableContentKeyData: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) @available(iOS 12.2, *) - func invalidatePersistableContentKey(_ persistableContentKeyData: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil) async throws -> Data? + func invalidatePersistableContentKey(_ persistableContentKeyData: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil) async throws -> Data @available(iOS 12.2, *) func invalidateAllPersistableContentKeys(forApp appIdentifier: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) @available(iOS 12.2, *) - func invalidateAllPersistableContentKeys(forApp appIdentifier: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil) async throws -> Data? + func invalidateAllPersistableContentKeys(forApp appIdentifier: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil) async throws -> Data } struct AVContentKeySessionServerPlaybackContextOption : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable { init(rawValue: String) @@ -112,7 +112,7 @@ class AVContentKeyRequest : NSObject { var options: [String : Any] { get } var canProvidePersistableContentKey: Bool { get } func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) - func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil) async throws -> Data? + func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil) async throws -> Data func processContentKeyResponse(_ keyResponse: AVContentKeyResponse) func processContentKeyResponseError(_ error: Error) @available(iOS, introduced: 10.3, deprecated: 11.2, message: "Use respondByRequestingPersistableContentKeyRequestAndReturnError: instead.") diff --git a/iOS/AudioToolbox/AUAudioUnit.swift b/iOS/AudioToolbox/AUAudioUnit.swift index 6efc8d8..d57650b 100644 --- a/iOS/AudioToolbox/AUAudioUnit.swift +++ b/iOS/AudioToolbox/AUAudioUnit.swift @@ -32,7 +32,7 @@ class AUAudioUnit : NSObject { init(componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = []) throws convenience init(componentDescription: AudioComponentDescription) throws class func instantiate(with componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = [], completionHandler: @escaping (AUAudioUnit?, Error?) -> Void) - class func instantiate(with componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = []) async throws -> AUAudioUnit? + class func instantiate(with componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = []) async throws -> AUAudioUnit var componentDescription: AudioComponentDescription { get } var component: AudioComponent { get } var componentName: String? { get } diff --git a/iOS/AuthenticationServices/ASAccountAuthenticationModificationExtensionContext.swift b/iOS/AuthenticationServices/ASAccountAuthenticationModificationExtensionContext.swift index 31b50de..2e0de61 100644 --- a/iOS/AuthenticationServices/ASAccountAuthenticationModificationExtensionContext.swift +++ b/iOS/AuthenticationServices/ASAccountAuthenticationModificationExtensionContext.swift @@ -2,7 +2,7 @@ @available(iOS 14.0, *) class ASAccountAuthenticationModificationExtensionContext : NSExtensionContext { func getSignInWithAppleUpgradeAuthorization(state: String?, nonce: String?, completionHandler: @escaping (ASAuthorizationAppleIDCredential?, Error?) -> Void) - func getSignInWithAppleUpgradeAuthorization(state: String?, nonce: String?) async throws -> ASAuthorizationAppleIDCredential? + func getSignInWithAppleUpgradeAuthorization(state: String?, nonce: String?) async throws -> ASAuthorizationAppleIDCredential func completeUpgradeToSignInWithApple(userInfo: [AnyHashable : Any]? = nil) func completeChangePasswordRequest(updatedCredential: ASPasswordCredential, userInfo: [AnyHashable : Any]? = nil) } diff --git a/iOS/ClassKit/CLSContext.swift b/iOS/ClassKit/CLSContext.swift index ee3eaa4..85dac78 100644 --- a/iOS/ClassKit/CLSContext.swift +++ b/iOS/ClassKit/CLSContext.swift @@ -89,5 +89,5 @@ extension CLSContext { func removeFromParent() func addChildContext(_ child: CLSContext) func descendant(matchingIdentifierPath identifierPath: [String], completion: @escaping (CLSContext?, Error?) -> Void) - func descendant(matchingIdentifierPath identifierPath: [String]) async throws -> CLSContext? + func descendant(matchingIdentifierPath identifierPath: [String]) async throws -> CLSContext } diff --git a/iOS/CloudKit/CKContainer.swift b/iOS/CloudKit/CKContainer.swift index 476ae2d..aec6a00 100644 --- a/iOS/CloudKit/CKContainer.swift +++ b/iOS/CloudKit/CKContainer.swift @@ -77,53 +77,53 @@ extension CKContainer { } extension CKContainer { func fetchUserRecordID(completionHandler: @escaping (CKRecord.ID?, Error?) -> Void) - func fetchUserRecordID() async throws -> CKRecord.ID? + func fetchUserRecordID() async throws -> CKRecord.ID @available(iOS 10.0, *) func discoverAllIdentities(completionHandler: @escaping ([CKUserIdentity]?, Error?) -> Void) @available(iOS 10.0, *) - func discoverAllIdentities() async throws -> [CKUserIdentity]? + func discoverAllIdentities() async throws -> [CKUserIdentity] @available(iOS 10.0, *) func discoverUserIdentity(withEmailAddress email: String, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(iOS 10.0, *) - func discoverUserIdentity(withEmailAddress email: String) async throws -> CKUserIdentity? + func discoverUserIdentity(withEmailAddress email: String) async throws -> CKUserIdentity @available(iOS 10.0, *) func discoverUserIdentity(withPhoneNumber phoneNumber: String, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(iOS 10.0, *) - func discoverUserIdentity(withPhoneNumber phoneNumber: String) async throws -> CKUserIdentity? + func discoverUserIdentity(withPhoneNumber phoneNumber: String) async throws -> CKUserIdentity @available(iOS 10.0, *) func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(iOS 10.0, *) - func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKUserIdentity? + func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKUserIdentity } extension CKContainer { @available(iOS 10.0, *) func fetchShareParticipant(withEmailAddress emailAddress: String, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(iOS 10.0, *) - func fetchShareParticipant(withEmailAddress emailAddress: String) async throws -> CKShare.Participant? + func fetchShareParticipant(withEmailAddress emailAddress: String) async throws -> CKShare.Participant @available(iOS 10.0, *) func fetchShareParticipant(withPhoneNumber phoneNumber: String, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(iOS 10.0, *) - func fetchShareParticipant(withPhoneNumber phoneNumber: String) async throws -> CKShare.Participant? + func fetchShareParticipant(withPhoneNumber phoneNumber: String) async throws -> CKShare.Participant @available(iOS 10.0, *) func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(iOS 10.0, *) - func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKShare.Participant? + func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKShare.Participant @available(iOS 10.0, *) func fetchShareMetadata(with url: URL, completionHandler: @escaping (CKShare.Metadata?, Error?) -> Void) @available(iOS 10.0, *) - func fetchShareMetadata(with url: URL) async throws -> CKShare.Metadata? + func fetchShareMetadata(with url: URL) async throws -> CKShare.Metadata @available(iOS 10.0, *) func accept(_ metadata: CKShare.Metadata, completionHandler: @escaping (CKShare?, Error?) -> Void) @available(iOS 10.0, *) - func accept(_ metadata: CKShare.Metadata) async throws -> CKShare? + func accept(_ metadata: CKShare.Metadata) async throws -> CKShare } extension CKContainer { @available(iOS 9.3, *) func __fetchAllLongLivedOperationIDs(completionHandler: @escaping ([String]?, Error?) -> Void) @available(iOS 9.3, *) - func __fetchAllLongLivedOperationIDs() async throws -> [String]? + func __fetchAllLongLivedOperationIDs() async throws -> [String] @available(iOS 9.3, *) func __fetchLongLivedOperation(withID operationID: String, completionHandler: @escaping (CKOperation?, Error?) -> Void) @available(iOS 9.3, *) - func __fetchLongLivedOperation(withID operationID: String) async throws -> CKOperation? + func __fetchLongLivedOperation(withID operationID: String) async throws -> CKOperation } diff --git a/iOS/CloudKit/CKDatabase.swift b/iOS/CloudKit/CKDatabase.swift index 5d84ac0..811cadf 100644 --- a/iOS/CloudKit/CKDatabase.swift +++ b/iOS/CloudKit/CKDatabase.swift @@ -25,35 +25,35 @@ class CKDatabase : NSObject { } extension CKDatabase { func fetch(withRecordID recordID: CKRecord.ID, completionHandler: @escaping (CKRecord?, Error?) -> Void) - func fetch(withRecordID recordID: CKRecord.ID) async throws -> CKRecord? + func fetch(withRecordID recordID: CKRecord.ID) async throws -> CKRecord func save(_ record: CKRecord, completionHandler: @escaping (CKRecord?, Error?) -> Void) - func save(_ record: CKRecord) async throws -> CKRecord? + func save(_ record: CKRecord) async throws -> CKRecord func delete(withRecordID recordID: CKRecord.ID, completionHandler: @escaping (CKRecord.ID?, Error?) -> Void) - func delete(withRecordID recordID: CKRecord.ID) async throws -> CKRecord.ID? + func delete(withRecordID recordID: CKRecord.ID) async throws -> CKRecord.ID func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?, completionHandler: @escaping ([CKRecord]?, Error?) -> Void) - func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?) async throws -> [CKRecord]? + func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?) async throws -> [CKRecord] func fetchAllRecordZones(completionHandler: @escaping ([CKRecordZone]?, Error?) -> Void) - func fetchAllRecordZones() async throws -> [CKRecordZone]? + func fetchAllRecordZones() async throws -> [CKRecordZone] func fetch(withRecordZoneID zoneID: CKRecordZone.ID, completionHandler: @escaping (CKRecordZone?, Error?) -> Void) - func fetch(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone? + func fetch(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone func save(_ zone: CKRecordZone, completionHandler: @escaping (CKRecordZone?, Error?) -> Void) - func save(_ zone: CKRecordZone) async throws -> CKRecordZone? + func save(_ zone: CKRecordZone) async throws -> CKRecordZone func delete(withRecordZoneID zoneID: CKRecordZone.ID, completionHandler: @escaping (CKRecordZone.ID?, Error?) -> Void) - func delete(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone.ID? + func delete(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone.ID @available(iOS 8.0, *) func __fetch(withSubscriptionID subscriptionID: String, completionHandler: @escaping (CKSubscription?, Error?) -> Void) @available(iOS 8.0, *) - func __fetch(withSubscriptionID subscriptionID: String) async throws -> CKSubscription? + func __fetch(withSubscriptionID subscriptionID: String) async throws -> CKSubscription @available(iOS 8.0, *) func fetchAllSubscriptions(completionHandler: @escaping ([CKSubscription]?, Error?) -> Void) @available(iOS 8.0, *) - func fetchAllSubscriptions() async throws -> [CKSubscription]? + func fetchAllSubscriptions() async throws -> [CKSubscription] @available(iOS 8.0, *) func save(_ subscription: CKSubscription, completionHandler: @escaping (CKSubscription?, Error?) -> Void) @available(iOS 8.0, *) - func save(_ subscription: CKSubscription) async throws -> CKSubscription? + func save(_ subscription: CKSubscription) async throws -> CKSubscription @available(iOS 8.0, *) func __delete(withSubscriptionID subscriptionID: String, completionHandler: @escaping (String?, Error?) -> Void) @available(iOS 8.0, *) - func __delete(withSubscriptionID subscriptionID: String) async throws -> String? + func __delete(withSubscriptionID subscriptionID: String) async throws -> String } diff --git a/iOS/CoreLocation/CLGeocoder.swift b/iOS/CoreLocation/CLGeocoder.swift index 22bd97d..0e5f298 100644 --- a/iOS/CoreLocation/CLGeocoder.swift +++ b/iOS/CoreLocation/CLGeocoder.swift @@ -4,23 +4,23 @@ typealias CLGeocodeCompletionHandler = ([CLPlacemark]?, Error?) -> Void class CLGeocoder : NSObject { var isGeocoding: Bool { get } func reverseGeocodeLocation(_ location: CLLocation, completionHandler: @escaping CLGeocodeCompletionHandler) - func reverseGeocodeLocation(_ location: CLLocation) async throws -> [CLPlacemark]? + func reverseGeocodeLocation(_ location: CLLocation) async throws -> [CLPlacemark] @available(iOS 11.0, *) func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?, completionHandler: @escaping CLGeocodeCompletionHandler) @available(iOS 11.0, *) - func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?) async throws -> [CLPlacemark]? + func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?) async throws -> [CLPlacemark] @available(iOS, introduced: 5.0, deprecated: 11.0, message: "Use -geocodePostalAddress:completionHandler:") func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any], completionHandler: @escaping CLGeocodeCompletionHandler) @available(iOS, introduced: 5.0, deprecated: 11.0, message: "Use -geocodePostalAddress:completionHandler:") - func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any]) async throws -> [CLPlacemark]? + func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any]) async throws -> [CLPlacemark] func geocodeAddressString(_ addressString: String, completionHandler: @escaping CLGeocodeCompletionHandler) - func geocodeAddressString(_ addressString: String) async throws -> [CLPlacemark]? + func geocodeAddressString(_ addressString: String) async throws -> [CLPlacemark] func geocodeAddressString(_ addressString: String, in region: CLRegion?, completionHandler: @escaping CLGeocodeCompletionHandler) - func geocodeAddressString(_ addressString: String, in region: CLRegion?) async throws -> [CLPlacemark]? + func geocodeAddressString(_ addressString: String, in region: CLRegion?) async throws -> [CLPlacemark] @available(iOS 11.0, *) func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?, completionHandler: @escaping CLGeocodeCompletionHandler) @available(iOS 11.0, *) - func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?) async throws -> [CLPlacemark]? + func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?) async throws -> [CLPlacemark] func cancelGeocode() } extension CLGeocoder { diff --git a/iOS/CoreML/MLModel.swift b/iOS/CoreML/MLModel.swift index ff43ba8..50e2e6b 100644 --- a/iOS/CoreML/MLModel.swift +++ b/iOS/CoreML/MLModel.swift @@ -10,7 +10,7 @@ class MLModel : NSObject { @available(iOS 14.0, *) class func __loadContents(of url: URL, configuration: MLModelConfiguration, completionHandler handler: @escaping (MLModel?, Error?) -> Void) @available(iOS 14.0, *) - class func __loadContents(of url: URL, configuration: MLModelConfiguration) async throws -> MLModel? + class func __loadContents(of url: URL, configuration: MLModelConfiguration) async throws -> MLModel func prediction(from input: MLFeatureProvider) throws -> MLFeatureProvider func prediction(from input: MLFeatureProvider, options: MLPredictionOptions) throws -> MLFeatureProvider @available(iOS 12.0, *) diff --git a/iOS/CoreNFC/CoreNFC.swift b/iOS/CoreNFC/CoreNFC.swift index e980075..dd27ad0 100644 --- a/iOS/CoreNFC/CoreNFC.swift +++ b/iOS/CoreNFC/CoreNFC.swift @@ -344,7 +344,7 @@ protocol NFCISO15693Tag : NFCNDEFTag, __NFCTag { @available(iOS 14.0, *) func __getSystemInfoAndUID(with flags: NFCISO15693RequestFlag, completionHandler: @escaping (Data?, Int, Int, Int, Int, Int, Error?) -> Void) @available(iOS 14.0, *) - func __systemInfoAndUID(with flags: NFCISO15693RequestFlag) async throws -> (Data?, Int, Int, Int, Int, Int) + func __systemInfoAndUID(with flags: NFCISO15693RequestFlag) async throws -> (Data, Int, Int, Int, Int, Int) @available(iOS 13.0, *) func getMultipleBlockSecurityStatus(requestFlags flags: NFCISO15693RequestFlag, blockRange: NSRange, completionHandler: @escaping ([NSNumber], Error?) -> Void) @available(iOS 13.0, *) @@ -404,7 +404,7 @@ protocol NFCISO15693Tag : NFCNDEFTag, __NFCTag { @available(iOS 14.0, *) func __sendRequest(withFlag flags: Int, commandCode: Int, data: Data?, completionHandler: @escaping (NFCISO15693ResponseFlag, Data?, Error?) -> Void) @available(iOS 14.0, *) - func __sendRequest(withFlag flags: Int, commandCode: Int, data: Data?) async throws -> (NFCISO15693ResponseFlag, Data?) + func __sendRequest(withFlag flags: Int, commandCode: Int, data: Data?) async throws -> (NFCISO15693ResponseFlag, Data) } @available(iOS 11.0, *) @@ -465,7 +465,7 @@ protocol NFCNDEFTag : NSCopying, NSSecureCoding, NSObjectProtocol { @available(iOS 13.0, *) func readNDEF(completionHandler: @escaping (NFCNDEFMessage?, Error?) -> Void) @available(iOS 13.0, *) - func readNDEF() async throws -> NFCNDEFMessage? + func readNDEF() async throws -> NFCNDEFMessage @available(iOS 13.0, *) func writeNDEF(_ ndefMessage: NFCNDEFMessage, completionHandler: @escaping (Error?) -> Void) @available(iOS 13.0, *) diff --git a/iOS/CoreSpotlight/CSSearchableIndex.swift b/iOS/CoreSpotlight/CSSearchableIndex.swift index e41521e..981f9dd 100644 --- a/iOS/CoreSpotlight/CSSearchableIndex.swift +++ b/iOS/CoreSpotlight/CSSearchableIndex.swift @@ -35,7 +35,7 @@ extension CSSearchableIndex { func endBatch(withClientState clientState: Data, completionHandler: ((Error?) -> Void)? = nil) func endBatch(withClientState clientState: Data) async throws func fetchLastClientState(completionHandler: @escaping (Data?, Error?) -> Void) - func fetchLastClientState() async throws -> Data? + func fetchLastClientState() async throws -> Data } @available(iOS 9.0, *) protocol CSSearchableIndexDelegate : NSObjectProtocol { diff --git a/iOS/DeviceCheck/DCAppAttestService.swift b/iOS/DeviceCheck/DCAppAttestService.swift index e3a1805..83a7c64 100644 --- a/iOS/DeviceCheck/DCAppAttestService.swift +++ b/iOS/DeviceCheck/DCAppAttestService.swift @@ -4,9 +4,9 @@ class DCAppAttestService : NSObject { class var shared: DCAppAttestService { get } var isSupported: Bool { get } func generateKey(completionHandler: @escaping (String?, Error?) -> Void) - func generateKey() async throws -> String? + func generateKey() async throws -> String func attestKey(_ keyId: String, clientDataHash: Data, completionHandler: @escaping (Data?, Error?) -> Void) - func attestKey(_ keyId: String, clientDataHash: Data) async throws -> Data? + func attestKey(_ keyId: String, clientDataHash: Data) async throws -> Data func generateAssertion(_ keyId: String, clientDataHash: Data, completionHandler: @escaping (Data?, Error?) -> Void) - func generateAssertion(_ keyId: String, clientDataHash: Data) async throws -> Data? + func generateAssertion(_ keyId: String, clientDataHash: Data) async throws -> Data } diff --git a/iOS/DeviceCheck/DCDevice.swift b/iOS/DeviceCheck/DCDevice.swift index e3a484f..bf9cc1d 100644 --- a/iOS/DeviceCheck/DCDevice.swift +++ b/iOS/DeviceCheck/DCDevice.swift @@ -4,5 +4,5 @@ class DCDevice : NSObject { class var current: DCDevice { get } var isSupported: Bool { get } func generateToken(completionHandler completion: @escaping (Data?, Error?) -> Void) - func generateToken() async throws -> Data? + func generateToken() async throws -> Data } diff --git a/iOS/ExposureNotification/ENManager.swift b/iOS/ExposureNotification/ENManager.swift index 8a563dd..852e775 100644 --- a/iOS/ExposureNotification/ENManager.swift +++ b/iOS/ExposureNotification/ENManager.swift @@ -45,7 +45,7 @@ class ENManager : NSObject { @available(iOS 13.7, *) func getExposureWindows(summary: ENExposureDetectionSummary, completionHandler: @escaping ENGetExposureWindowsHandler) -> Progress func getDiagnosisKeys(completionHandler: @escaping ENGetDiagnosisKeysHandler) - func diagnosisKeys() async throws -> [ENTemporaryExposureKey]? + func diagnosisKeys() async throws -> [ENTemporaryExposureKey] func getTestDiagnosisKeys(completionHandler: @escaping ENGetDiagnosisKeysHandler) - func testDiagnosisKeys() async throws -> [ENTemporaryExposureKey]? + func testDiagnosisKeys() async throws -> [ENTemporaryExposureKey] } diff --git a/iOS/FileProvider/NSFileProviderActions.swift b/iOS/FileProvider/NSFileProviderActions.swift index f7cfdc9..acd031a 100644 --- a/iOS/FileProvider/NSFileProviderActions.swift +++ b/iOS/FileProvider/NSFileProviderActions.swift @@ -3,27 +3,27 @@ extension NSFileProviderExtension { @available(iOS 8.0, *) func importDocument(at fileURL: URL, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) @available(iOS 8.0, *) - func importDocument(at fileURL: URL, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? + func importDocument(at fileURL: URL, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem @available(iOS 8.0, *) func createDirectory(withName directoryName: String, inParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) @available(iOS 8.0, *) - func createDirectory(withName directoryName: String, inParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? + func createDirectory(withName directoryName: String, inParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem @available(iOS 8.0, *) func renameItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toName itemName: String, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) @available(iOS 8.0, *) - func renameItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toName itemName: String) async throws -> NSFileProviderItem? + func renameItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toName itemName: String) async throws -> NSFileProviderItem @available(iOS 8.0, *) func reparentItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemWithIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, newName: String?, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) @available(iOS 8.0, *) - func reparentItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemWithIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, newName: String?) async throws -> NSFileProviderItem? + func reparentItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemWithIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, newName: String?) async throws -> NSFileProviderItem @available(iOS 8.0, *) func trashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) @available(iOS 8.0, *) - func trashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? + func trashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem @available(iOS 8.0, *) func untrashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier?, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) @available(iOS 8.0, *) - func untrashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier?) async throws -> NSFileProviderItem? + func untrashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier?) async throws -> NSFileProviderItem @available(iOS 8.0, *) func deleteItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (Error?) -> Void) @available(iOS 8.0, *) @@ -31,13 +31,13 @@ extension NSFileProviderExtension { @available(iOS 8.0, *) func setLastUsedDate(_ lastUsedDate: Date?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) @available(iOS 8.0, *) - func setLastUsedDate(_ lastUsedDate: Date?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? + func setLastUsedDate(_ lastUsedDate: Date?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem @available(iOS 8.0, *) func setTagData(_ tagData: Data?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) @available(iOS 8.0, *) - func setTagData(_ tagData: Data?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? + func setTagData(_ tagData: Data?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem @available(iOS 8.0, *) func setFavoriteRank(_ favoriteRank: NSNumber?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) @available(iOS 8.0, *) - func setFavoriteRank(_ favoriteRank: NSNumber?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? + func setFavoriteRank(_ favoriteRank: NSNumber?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem } diff --git a/iOS/Foundation/NSFileManager.swift b/iOS/Foundation/NSFileManager.swift index 79b3487..d0164ff 100644 --- a/iOS/Foundation/NSFileManager.swift +++ b/iOS/Foundation/NSFileManager.swift @@ -118,7 +118,7 @@ class FileManager : NSObject { @available(iOS 11.0, *) func getFileProviderServicesForItem(at url: URL, completionHandler: @escaping ([NSFileProviderServiceName : NSFileProviderService]?, Error?) -> Void) @available(iOS 11.0, *) - func fileProviderServicesForItem(at url: URL) async throws -> [NSFileProviderServiceName : NSFileProviderService]? + func fileProviderServicesForItem(at url: URL) async throws -> [NSFileProviderServiceName : NSFileProviderService] @available(iOS 7.0, *) func containerURL(forSecurityApplicationGroupIdentifier groupIdentifier: String) -> URL? } @@ -214,7 +214,7 @@ extension FileManager { @available(iOS 11.0, *) class NSFileProviderService : NSObject { func getFileProviderConnection(completionHandler: @escaping (NSXPCConnection?, Error?) -> Void) - func fileProviderConnection() async throws -> NSXPCConnection? + func fileProviderConnection() async throws -> NSXPCConnection var name: NSFileProviderServiceName { get } } extension FileAttributeKey { diff --git a/iOS/Foundation/NSFileVersion.swift b/iOS/Foundation/NSFileVersion.swift index 5ef5507..379bcec 100644 --- a/iOS/Foundation/NSFileVersion.swift +++ b/iOS/Foundation/NSFileVersion.swift @@ -19,7 +19,7 @@ class NSFileVersion : NSObject { @available(iOS 8.0, *) class func getNonlocalVersionsOfItem(at url: URL, completionHandler: @escaping ([NSFileVersion]?, Error?) -> Void) @available(iOS 8.0, *) - class func nonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion]? + class func nonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion] class func version(itemAt url: URL, forPersistentIdentifier persistentIdentifier: Any) -> NSFileVersion? var url: URL { get } var localizedName: String? { get } diff --git a/iOS/Foundation/NSItemProvider.swift b/iOS/Foundation/NSItemProvider.swift index cf7c3fb..a4c2572 100644 --- a/iOS/Foundation/NSItemProvider.swift +++ b/iOS/Foundation/NSItemProvider.swift @@ -77,7 +77,7 @@ class NSItemProvider : NSObject, NSCopying { convenience init?(contentsOf fileURL: URL!) func registerItem(forTypeIdentifier typeIdentifier: String, loadHandler: @escaping NSItemProvider.LoadHandler) func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil, completionHandler: NSItemProvider.CompletionHandler? = nil) - func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding? + func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding } @available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) @@ -97,7 +97,7 @@ extension NSItemProvider { @available(iOS 8.0, *) func loadPreviewImage(options: [AnyHashable : Any]! = [:], completionHandler: NSItemProvider.CompletionHandler!) @available(iOS 8.0, *) - func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding? + func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding } @available(iOS 8.0, *) let NSExtensionJavaScriptPreprocessingResultsKey: String diff --git a/iOS/Foundation/NSURLConnection.swift b/iOS/Foundation/NSURLConnection.swift index 036f9b9..e0aec98 100644 --- a/iOS/Foundation/NSURLConnection.swift +++ b/iOS/Foundation/NSURLConnection.swift @@ -56,5 +56,5 @@ extension NSURLConnection { @available(iOS, introduced: 5.0, deprecated: 9.0, message: "Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h") class func sendAsynchronousRequest(_ request: URLRequest, queue: OperationQueue, completionHandler handler: @escaping (URLResponse?, Data?, Error?) -> Void) @available(iOS, introduced: 5.0, deprecated: 9.0, message: "Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h") - class func sendAsynchronousRequest(_ request: URLRequest, queue: OperationQueue) async throws -> (URLResponse?, Data?) + class func sendAsynchronousRequest(_ request: URLRequest, queue: OperationQueue) async throws -> (URLResponse, Data) } diff --git a/iOS/Foundation/NSURLSession.swift b/iOS/Foundation/NSURLSession.swift index ef1341b..bed17ef 100644 --- a/iOS/Foundation/NSURLSession.swift +++ b/iOS/Foundation/NSURLSession.swift @@ -129,7 +129,7 @@ class URLSessionDownloadTask : URLSessionTask { @available(iOS 9.0, *) class URLSessionStreamTask : URLSessionTask { func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval, completionHandler: @escaping (Data?, Bool, Error?) -> Void) - func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval) async throws -> (Data?, Bool) + func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval) async throws -> (Data, Bool) func write(_ data: Data, timeout: TimeInterval, completionHandler: @escaping (Error?) -> Void) func write(_ data: Data, timeout: TimeInterval) async throws func captureStreams() @@ -179,7 +179,7 @@ class URLSessionWebSocketTask : URLSessionTask { func __send(_ message: __NSURLSessionWebSocketMessage, completionHandler: @escaping (Error?) -> Void) func __send(_ message: __NSURLSessionWebSocketMessage) async throws func __receiveMessage(completionHandler: @escaping (__NSURLSessionWebSocketMessage?, Error?) -> Void) - func __receiveMessage() async throws -> __NSURLSessionWebSocketMessage? + func __receiveMessage() async throws -> __NSURLSessionWebSocketMessage func sendPing(pongReceiveHandler: @escaping (Error?) -> Void) func cancel(with closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) var maximumMessageSize: Int diff --git a/iOS/Foundation/NSUserActivity.swift b/iOS/Foundation/NSUserActivity.swift index 36abb90..b3d97ee 100644 --- a/iOS/Foundation/NSUserActivity.swift +++ b/iOS/Foundation/NSUserActivity.swift @@ -26,7 +26,7 @@ class NSUserActivity : NSObject { func resignCurrent() func invalidate() func getContinuationStreams(completionHandler: @escaping (InputStream?, OutputStream?, Error?) -> Void) - func continuationStreams() async throws -> (InputStream?, OutputStream?) + func continuationStreams() async throws -> (InputStream, OutputStream) @available(iOS 9.0, *) var isEligibleForHandoff: Bool @available(iOS 9.0, *) diff --git a/iOS/GLKit/GLKTextureLoader.swift b/iOS/GLKit/GLKTextureLoader.swift index 1fce2c9..25c0346 100644 --- a/iOS/GLKit/GLKTextureLoader.swift +++ b/iOS/GLKit/GLKTextureLoader.swift @@ -82,19 +82,19 @@ class GLKTextureLoader : NSObject { class func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil) throws -> GLKTextureInfo init(sharegroup: EAGLSharegroup) func texture(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func texture(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func texture(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func texture(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func texture(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func texture(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func texture(withName name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func texture(withName name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func texture(withName name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func texture(withContentsOf data: Data, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func texture(withContentsOf data: Data, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func texture(withContentsOf data: Data, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func texture(with cgImage: CGImage, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func texture(with cgImage: CGImage, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func texture(with cgImage: CGImage, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func cubeMap(withContentsOfFiles paths: [Any], options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func cubeMap(withContentsOfFiles paths: [Any], options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func cubeMap(withContentsOfFiles paths: [Any], options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func cubeMap(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func cubeMap(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func cubeMap(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo } diff --git a/iOS/GameKit/GKAchievement.swift b/iOS/GameKit/GKAchievement.swift index ac39b09..2f43c52 100644 --- a/iOS/GameKit/GKAchievement.swift +++ b/iOS/GameKit/GKAchievement.swift @@ -2,7 +2,7 @@ @available(iOS 4.1, *) class GKAchievement : NSObject, NSCoding, NSSecureCoding { class func loadAchievements(completionHandler: (([GKAchievement]?, Error?) -> Void)? = nil) - class func loadAchievements() async throws -> [GKAchievement]? + class func loadAchievements() async throws -> [GKAchievement] class func resetAchievements(completionHandler: ((Error?) -> Void)? = nil) class func resetAchievements() async throws init(identifier: String) diff --git a/iOS/GameKit/GKAchievementDescription.swift b/iOS/GameKit/GKAchievementDescription.swift index 1806936..fe8c020 100644 --- a/iOS/GameKit/GKAchievementDescription.swift +++ b/iOS/GameKit/GKAchievementDescription.swift @@ -2,7 +2,7 @@ @available(iOS 4.1, *) class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { class func loadAchievementDescriptions(completionHandler: (([GKAchievementDescription]?, Error?) -> Void)? = nil) - class func loadAchievementDescriptions() async throws -> [GKAchievementDescription]? + class func loadAchievementDescriptions() async throws -> [GKAchievementDescription] var identifier: String { get } @available(iOS 6.0, *) var groupIdentifier: String? { get } @@ -16,7 +16,7 @@ class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { } extension GKAchievementDescription { func loadImage(completionHandler: ((UIImage?, Error?) -> Void)? = nil) - func loadImage() async throws -> UIImage? + func loadImage() async throws -> UIImage class func incompleteAchievementImage() -> UIImage class func placeholderCompletedAchievementImage() -> UIImage } diff --git a/iOS/GameKit/GKChallenge.swift b/iOS/GameKit/GKChallenge.swift index ab8196b..473dfb9 100644 --- a/iOS/GameKit/GKChallenge.swift +++ b/iOS/GameKit/GKChallenge.swift @@ -10,7 +10,7 @@ enum GKChallengeState : Int { @available(iOS 6.0, *) class GKChallenge : NSObject, NSCoding, NSSecureCoding { class func loadReceivedChallenges(completionHandler: (([GKChallenge]?, Error?) -> Void)? = nil) - class func loadReceivedChallenges() async throws -> [GKChallenge]? + class func loadReceivedChallenges() async throws -> [GKChallenge] func decline() @available(iOS 8.0, *) @NSCopying var issuingPlayer: GKPlayer? { get } @@ -49,7 +49,7 @@ extension GKAchievement { @available(iOS 8.0, *) func selectChallengeablePlayers(_ players: [GKPlayer], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(iOS 8.0, *) - func selectChallengeablePlayers(_ players: [GKPlayer]) async throws -> [GKPlayer]? + func selectChallengeablePlayers(_ players: [GKPlayer]) async throws -> [GKPlayer] @available(iOS 7.0, *) class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(iOS 7.0, *) @@ -61,7 +61,7 @@ extension GKAchievement { @available(iOS, introduced: 6.0, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, pass GKPlayers to selectChallengeablePlayers:") func selectChallengeablePlayerIDs(_ playerIDs: [String]?, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) @available(iOS, introduced: 6.0, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, pass GKPlayers to selectChallengeablePlayers:") - func selectChallengeablePlayerIDs(_ playerIDs: [String]?) async throws -> [String]? + func selectChallengeablePlayerIDs(_ playerIDs: [String]?) async throws -> [String] } typealias GKChallengeComposeCompletionBlock = (UIViewController, Bool, [String]?) -> Void extension GKScore { diff --git a/iOS/GameKit/GKCloudPlayer.swift b/iOS/GameKit/GKCloudPlayer.swift index 002d50f..70eb880 100644 --- a/iOS/GameKit/GKCloudPlayer.swift +++ b/iOS/GameKit/GKCloudPlayer.swift @@ -2,5 +2,5 @@ @available(iOS, introduced: 10.0, deprecated: 12.0, message: "GKGameSession is deprecated. Use GKPlayer for both real-time and turn-based matchmaking APIs.") class GKCloudPlayer : GKBasePlayer { class func getCurrentSignedInPlayer(forContainer containerName: String?, completionHandler handler: @escaping (GKCloudPlayer?, Error?) -> Void) - class func currentSignedInPlayer(forContainer containerName: String?) async throws -> GKCloudPlayer? + class func currentSignedInPlayer(forContainer containerName: String?) async throws -> GKCloudPlayer } diff --git a/iOS/GameKit/GKGameSession.swift b/iOS/GameKit/GKGameSession.swift index 4c7c1a3..9a8b85d 100644 --- a/iOS/GameKit/GKGameSession.swift +++ b/iOS/GameKit/GKGameSession.swift @@ -22,19 +22,19 @@ class GKGameSession : NSObject { var maxNumberOfConnectedPlayers: Int { get } var badgedPlayers: [GKCloudPlayer] { get } class func createSession(inContainer containerName: String?, withTitle title: String, maxConnectedPlayers maxPlayers: Int, completionHandler: @escaping (GKGameSession?, Error?) -> Void) - class func createSession(inContainer containerName: String?, withTitle title: String, maxConnectedPlayers maxPlayers: Int) async throws -> GKGameSession? + class func createSession(inContainer containerName: String?, withTitle title: String, maxConnectedPlayers maxPlayers: Int) async throws -> GKGameSession class func loadSessions(inContainer containerName: String?, completionHandler: @escaping ([GKGameSession]?, Error?) -> Void) - class func loadSessions(inContainer containerName: String?) async throws -> [GKGameSession]? + class func loadSessions(inContainer containerName: String?) async throws -> [GKGameSession] class func load(withIdentifier identifier: String, completionHandler: @escaping (GKGameSession?, Error?) -> Void) - class func load(withIdentifier identifier: String) async throws -> GKGameSession? + class func load(withIdentifier identifier: String) async throws -> GKGameSession class func remove(withIdentifier identifier: String, completionHandler: @escaping (Error?) -> Void) class func remove(withIdentifier identifier: String) async throws func getShareURL(completionHandler: @escaping (URL?, Error?) -> Void) - func shareURL() async throws -> URL? + func shareURL() async throws -> URL func loadData(completionHandler: @escaping (Data?, Error?) -> Void) - func loadData() async throws -> Data? + func loadData() async throws -> Data func save(_ data: Data, completionHandler: @escaping (Data?, Error?) -> Void) - func save(_ data: Data) async throws -> Data? + func save(_ data: Data) async throws -> Data func setConnectionState(_ state: GKConnectionState, completionHandler: @escaping (Error?) -> Void) func setConnectionState(_ state: GKConnectionState) async throws func players(with state: GKConnectionState) -> [GKCloudPlayer] diff --git a/iOS/GameKit/GKLeaderboard.swift b/iOS/GameKit/GKLeaderboard.swift index 21b8ab0..2a5d7df 100644 --- a/iOS/GameKit/GKLeaderboard.swift +++ b/iOS/GameKit/GKLeaderboard.swift @@ -39,11 +39,11 @@ class GKLeaderboard : NSObject { @available(iOS 14.0, *) class func loadLeaderboards(IDs leaderboardIDs: [String]?, completionHandler: @escaping ([GKLeaderboard]?, Error?) -> Void) @available(iOS 14.0, *) - class func loadLeaderboards(IDs leaderboardIDs: [String]?) async throws -> [GKLeaderboard]? + class func loadLeaderboards(IDs leaderboardIDs: [String]?) async throws -> [GKLeaderboard] @available(iOS 14.0, *) func loadPreviousOccurrence(completionHandler: @escaping (GKLeaderboard?, Error?) -> Void) @available(iOS 14.0, *) - func loadPreviousOccurrence() async throws -> GKLeaderboard? + func loadPreviousOccurrence() async throws -> GKLeaderboard @available(iOS 14.0, *) class func submitScore(_ score: Int, context: Int, player: GKPlayer, leaderboardIDs: [String], completionHandler: @escaping (Error?) -> Void) @available(iOS 14.0, *) @@ -55,11 +55,11 @@ class GKLeaderboard : NSObject { @available(iOS 14.0, *) func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange, completionHandler: @escaping (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Int, Error?) -> Void) @available(iOS 14.0, *) - func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange) async throws -> (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Int) + func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange) async throws -> (GKLeaderboard.Entry, [GKLeaderboard.Entry], Int) @available(iOS 14.0, *) func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope, completionHandler: @escaping (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Error?) -> Void) @available(iOS 14.0, *) - func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope) async throws -> (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?) + func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope) async throws -> (GKLeaderboard.Entry, [GKLeaderboard.Entry]) } extension GKLeaderboard { @available(iOS, introduced: 4.1, deprecated: 8.0, message: "Use initWithPlayers: instead") @@ -85,15 +85,15 @@ extension GKLeaderboard { @available(iOS, introduced: 4.0, deprecated: 14.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") func loadScores(completionHandler: (([GKScore]?, Error?) -> Void)? = nil) @available(iOS, introduced: 4.0, deprecated: 14.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") - func loadScores() async throws -> [GKScore]? + func loadScores() async throws -> [GKScore] @available(iOS, introduced: 6.0, deprecated: 14.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") class func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(iOS, introduced: 6.0, deprecated: 14.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") - class func loadLeaderboards() async throws -> [GKLeaderboard]? + class func loadLeaderboards() async throws -> [GKLeaderboard] } extension GKLeaderboard { @available(iOS 7.0, *) func loadImage(completionHandler: ((UIImage?, Error?) -> Void)? = nil) @available(iOS 7.0, *) - func loadImage() async throws -> UIImage? + func loadImage() async throws -> UIImage } diff --git a/iOS/GameKit/GKLeaderboardSet.swift b/iOS/GameKit/GKLeaderboardSet.swift index 49c201b..7611939 100644 --- a/iOS/GameKit/GKLeaderboardSet.swift +++ b/iOS/GameKit/GKLeaderboardSet.swift @@ -7,7 +7,7 @@ class GKLeaderboardSet : NSObject, NSCoding, NSSecureCoding { @available(iOS 7.0, *) class func loadLeaderboardSets(completionHandler: (([GKLeaderboardSet]?, Error?) -> Void)? = nil) @available(iOS 7.0, *) - class func loadLeaderboardSets() async throws -> [GKLeaderboardSet]? + class func loadLeaderboardSets() async throws -> [GKLeaderboardSet] @available(iOS 14.0, *) func loadLeaderboards(handler: @escaping ([GKLeaderboard]?, Error?) -> Void) } @@ -15,9 +15,9 @@ extension GKLeaderboardSet { @available(iOS, introduced: 7.0, deprecated: 14.0, message: "Use loadLeaderboardsWithHandler: instead.") func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(iOS, introduced: 7.0, deprecated: 14.0, message: "Use loadLeaderboardsWithHandler: instead.") - func loadLeaderboards() async throws -> [GKLeaderboard]? + func loadLeaderboards() async throws -> [GKLeaderboard] } extension GKLeaderboardSet { func loadImage(completionHandler: ((UIImage?, Error?) -> Void)? = nil) - func loadImage() async throws -> UIImage? + func loadImage() async throws -> UIImage } diff --git a/iOS/GameKit/GKLocalPlayer.swift b/iOS/GameKit/GKLocalPlayer.swift index f5c4230..2b48189 100644 --- a/iOS/GameKit/GKLocalPlayer.swift +++ b/iOS/GameKit/GKLocalPlayer.swift @@ -13,9 +13,9 @@ class GKLocalPlayer : GKPlayer { @available(iOS 10.0, *) func loadRecentPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(iOS 10.0, *) - func loadRecentPlayers() async throws -> [GKPlayer]? + func loadRecentPlayers() async throws -> [GKPlayer] func loadChallengableFriends(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - func loadChallengableFriends() async throws -> [GKPlayer]? + func loadChallengableFriends() async throws -> [GKPlayer] @available(iOS 7.0, *) func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 7.0, *) @@ -23,11 +23,11 @@ class GKLocalPlayer : GKPlayer { @available(iOS 7.0, *) func loadDefaultLeaderboardIdentifier(completionHandler: ((String?, Error?) -> Void)? = nil) @available(iOS 7.0, *) - func loadDefaultLeaderboardIdentifier() async throws -> String? + func loadDefaultLeaderboardIdentifier() async throws -> String @available(iOS 13.5, *) func fetchItems(forIdentityVerificationSignature completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(iOS 13.5, *) - func fetchItemsForIdentityVerificationSignature() async throws -> (URL?, Data?, Data?, UInt64) + func fetchItemsForIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) } protocol GKLocalPlayerListener : GKChallengeListener, GKInviteEventListener, GKSavedGameListener, GKTurnBasedEventListener { } @@ -47,17 +47,17 @@ extension GKLocalPlayer { @available(iOS, introduced: 8.0, deprecated: 10.0) func loadFriendPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(iOS, introduced: 8.0, deprecated: 10.0) - func loadFriendPlayers() async throws -> [GKPlayer]? + func loadFriendPlayers() async throws -> [GKPlayer] @available(iOS, introduced: 7.0, deprecated: 13.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") func generateIdentityVerificationSignature(completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(iOS, introduced: 7.0, deprecated: 13.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") - func generateIdentityVerificationSignature() async throws -> (URL?, Data?, Data?, UInt64) + func generateIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) } extension GKLocalPlayer { @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") func loadFriends(completionHandler: (([String]?, Error?) -> Void)? = nil) @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") - func loadFriends() async throws -> [String]? + func loadFriends() async throws -> [String] @available(iOS, introduced: 4.1, deprecated: 8.0, message: " This property is obsolete, Use loadFriendPlayersWithCompletionHandler: instead") var friends: [String]? { get } } diff --git a/iOS/GameKit/GKMatch.swift b/iOS/GameKit/GKMatch.swift index 3ba64c6..5179948 100644 --- a/iOS/GameKit/GKMatch.swift +++ b/iOS/GameKit/GKMatch.swift @@ -32,7 +32,7 @@ class GKMatch : NSObject { @available(iOS 6.0, *) func rematch(completionHandler: ((GKMatch?, Error?) -> Void)? = nil) @available(iOS 6.0, *) - func rematch() async throws -> GKMatch? + func rematch() async throws -> GKMatch } protocol GKMatchDelegate : NSObjectProtocol { @available(iOS 8.0, *) diff --git a/iOS/GameKit/GKMatchmaker.swift b/iOS/GameKit/GKMatchmaker.swift index a2c4357..afeb012 100644 --- a/iOS/GameKit/GKMatchmaker.swift +++ b/iOS/GameKit/GKMatchmaker.swift @@ -72,13 +72,13 @@ class GKMatchmaker : NSObject { @available(iOS 6.0, *) func match(for invite: GKInvite, completionHandler: ((GKMatch?, Error?) -> Void)? = nil) @available(iOS 6.0, *) - func match(for invite: GKInvite) async throws -> GKMatch? + func match(for invite: GKInvite) async throws -> GKMatch func findMatch(for request: GKMatchRequest, withCompletionHandler completionHandler: ((GKMatch?, Error?) -> Void)? = nil) - func findMatch(for request: GKMatchRequest) async throws -> GKMatch? + func findMatch(for request: GKMatchRequest) async throws -> GKMatch @available(iOS 8.0, *) func findPlayers(forHostedRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(iOS 8.0, *) - func findPlayers(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer]? + func findPlayers(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer] func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest, completionHandler: ((Error?) -> Void)? = nil) func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest) async throws func cancel() @@ -105,5 +105,5 @@ extension GKMatchmaker { @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") func findPlayers(forHostedMatchRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") - func findPlayers(forHostedMatchRequest request: GKMatchRequest) async throws -> [String]? + func findPlayers(forHostedMatchRequest request: GKMatchRequest) async throws -> [String] } diff --git a/iOS/GameKit/GKPlayer.swift b/iOS/GameKit/GKPlayer.swift index 22b1494..1cead7f 100644 --- a/iOS/GameKit/GKPlayer.swift +++ b/iOS/GameKit/GKPlayer.swift @@ -4,7 +4,7 @@ let GKPlayerIDNoLongerAvailable: String @available(iOS 4.1, *) class GKPlayer : GKBasePlayer { class func loadPlayers(forIdentifiers identifiers: [String], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer]? + class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] @available(iOS 13.0, *) func scopedIDsArePersistent() -> Bool @available(iOS 12.4, *) @@ -23,7 +23,7 @@ extension GKPlayer { @available(iOS 5.0, *) func loadPhoto(for size: GKPlayer.PhotoSize, withCompletionHandler completionHandler: ((UIImage?, Error?) -> Void)? = nil) @available(iOS 5.0, *) - func loadPhoto(for size: GKPlayer.PhotoSize) async throws -> UIImage? + func loadPhoto(for size: GKPlayer.PhotoSize) async throws -> UIImage } extension GKPlayer { enum PhotoSize : Int { diff --git a/iOS/GameKit/GKSavedGame.swift b/iOS/GameKit/GKSavedGame.swift index 84b3f6c..9601795 100644 --- a/iOS/GameKit/GKSavedGame.swift +++ b/iOS/GameKit/GKSavedGame.swift @@ -10,17 +10,17 @@ class GKSavedGame : NSObject, NSCopying { @available(iOS 8.0, *) func loadData(completionHandler handler: ((Data?, Error?) -> Void)? = nil) @available(iOS 8.0, *) - func loadData() async throws -> Data? + func loadData() async throws -> Data } extension GKLocalPlayer : GKSavedGameListener { @available(iOS 8.0, *) func fetchSavedGames(completionHandler handler: (([GKSavedGame]?, Error?) -> Void)? = nil) @available(iOS 8.0, *) - func fetchSavedGames() async throws -> [GKSavedGame]? + func fetchSavedGames() async throws -> [GKSavedGame] @available(iOS 8.0, *) func saveGameData(_ data: Data, withName name: String, completionHandler handler: ((GKSavedGame?, Error?) -> Void)? = nil) @available(iOS 8.0, *) - func saveGameData(_ data: Data, withName name: String) async throws -> GKSavedGame? + func saveGameData(_ data: Data, withName name: String) async throws -> GKSavedGame @available(iOS 8.0, *) func deleteSavedGames(withName name: String, completionHandler handler: ((Error?) -> Void)? = nil) @available(iOS 8.0, *) @@ -28,5 +28,5 @@ extension GKLocalPlayer : GKSavedGameListener { @available(iOS 8.0, *) func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data, completionHandler handler: (([GKSavedGame]?, Error?) -> Void)? = nil) @available(iOS 8.0, *) - func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data) async throws -> [GKSavedGame]? + func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data) async throws -> [GKSavedGame] } diff --git a/iOS/GameKit/GKTurnBasedMatch.swift b/iOS/GameKit/GKTurnBasedMatch.swift index d7f6098..368e452 100644 --- a/iOS/GameKit/GKTurnBasedMatch.swift +++ b/iOS/GameKit/GKTurnBasedMatch.swift @@ -96,21 +96,21 @@ class GKTurnBasedMatch : NSObject { @available(iOS 7.0, *) var exchangeMaxInitiatedExchangesPerPlayer: Int { get } class func find(for request: GKMatchRequest, withCompletionHandler completionHandler: @escaping (GKTurnBasedMatch?, Error?) -> Void) - class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch? + class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch class func loadMatches(completionHandler: (([GKTurnBasedMatch]?, Error?) -> Void)? = nil) - class func loadMatches() async throws -> [GKTurnBasedMatch]? + class func loadMatches() async throws -> [GKTurnBasedMatch] @available(iOS 5.0, *) class func load(withID matchID: String, withCompletionHandler completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(iOS 5.0, *) - class func load(withID matchID: String) async throws -> GKTurnBasedMatch? + class func load(withID matchID: String) async throws -> GKTurnBasedMatch @available(iOS 6.0, *) func rematch(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(iOS 6.0, *) - func rematch() async throws -> GKTurnBasedMatch? + func rematch() async throws -> GKTurnBasedMatch @available(iOS 5.0, *) func acceptInvite(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(iOS 5.0, *) - func acceptInvite() async throws -> GKTurnBasedMatch? + func acceptInvite() async throws -> GKTurnBasedMatch @available(iOS 5.0, *) func declineInvite(completionHandler: ((Error?) -> Void)? = nil) @available(iOS 5.0, *) @@ -118,7 +118,7 @@ class GKTurnBasedMatch : NSObject { func remove(completionHandler: ((Error?) -> Void)? = nil) func remove() async throws func loadMatchData(completionHandler: ((Data?, Error?) -> Void)? = nil) - func loadMatchData() async throws -> Data? + func loadMatchData() async throws -> Data @available(iOS 6.0, *) func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 6.0, *) @@ -150,7 +150,7 @@ class GKTurnBasedMatch : NSObject { @available(iOS 7.0, *) func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval, completionHandler: ((GKTurnBasedExchange?, Error?) -> Void)? = nil) @available(iOS 7.0, *) - func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange? + func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange @available(iOS 7.0, *) func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(iOS 7.0, *) diff --git a/iOS/HealthKit/HKHeartbeatSeriesBuilder.swift b/iOS/HealthKit/HKHeartbeatSeriesBuilder.swift index e5bdfcf..673cd2b 100644 --- a/iOS/HealthKit/HKHeartbeatSeriesBuilder.swift +++ b/iOS/HealthKit/HKHeartbeatSeriesBuilder.swift @@ -8,5 +8,5 @@ class HKHeartbeatSeriesBuilder : HKSeriesBuilder { func addMetadata(_ metadata: [String : Any], completion: @escaping (Bool, Error?) -> Void) func addMetadata(_ metadata: [String : Any]) async throws -> Bool func finishSeries(completion: @escaping (HKHeartbeatSeriesSample?, Error?) -> Void) - func finishSeries() async throws -> HKHeartbeatSeriesSample? + func finishSeries() async throws -> HKHeartbeatSeriesSample } diff --git a/iOS/HealthKit/HKQuantitySeriesSampleBuilder.swift b/iOS/HealthKit/HKQuantitySeriesSampleBuilder.swift index 6f187a5..77598f0 100644 --- a/iOS/HealthKit/HKQuantitySeriesSampleBuilder.swift +++ b/iOS/HealthKit/HKQuantitySeriesSampleBuilder.swift @@ -9,8 +9,8 @@ class HKQuantitySeriesSampleBuilder : NSObject { func insert(_ quantity: HKQuantity, for dateInterval: DateInterval) throws func insert(_ quantity: HKQuantity, at date: Date) throws func finishSeries(metadata: [String : Any]?, endDate: Date?, completion: @escaping ([HKQuantitySample]?, Error?) -> Void) - func finishSeries(metadata: [String : Any]?, endDate: Date?) async throws -> [HKQuantitySample]? + func finishSeries(metadata: [String : Any]?, endDate: Date?) async throws -> [HKQuantitySample] func finishSeries(metadata: [String : Any]?, completion: @escaping ([HKQuantitySample]?, Error?) -> Void) - func finishSeries(metadata: [String : Any]?) async throws -> [HKQuantitySample]? + func finishSeries(metadata: [String : Any]?) async throws -> [HKQuantitySample] func discard() } diff --git a/iOS/HealthKit/HKWorkoutBuilder.swift b/iOS/HealthKit/HKWorkoutBuilder.swift index 08496a1..6bdedcf 100644 --- a/iOS/HealthKit/HKWorkoutBuilder.swift +++ b/iOS/HealthKit/HKWorkoutBuilder.swift @@ -19,7 +19,7 @@ class HKWorkoutBuilder : NSObject { func endCollection(withEnd endDate: Date, completion: @escaping (Bool, Error?) -> Void) func endCollection(withEnd endDate: Date) async throws -> Bool func finishWorkout(completion: @escaping (HKWorkout?, Error?) -> Void) - func finishWorkout() async throws -> HKWorkout? + func finishWorkout() async throws -> HKWorkout func discardWorkout() func elapsedTime(at date: Date) -> TimeInterval func statistics(for quantityType: HKQuantityType) -> HKStatistics? diff --git a/iOS/HealthKit/HKWorkoutRouteBuilder.swift b/iOS/HealthKit/HKWorkoutRouteBuilder.swift index 128e640..e5d8533 100644 --- a/iOS/HealthKit/HKWorkoutRouteBuilder.swift +++ b/iOS/HealthKit/HKWorkoutRouteBuilder.swift @@ -5,5 +5,5 @@ class HKWorkoutRouteBuilder : HKSeriesBuilder { func addMetadata(_ metadata: [String : Any], completion: @escaping (Bool, Error?) -> Void) func addMetadata(_ metadata: [String : Any]) async throws -> Bool func finishRoute(with workout: HKWorkout, metadata: [String : Any]?, completion: @escaping (HKWorkoutRoute?, Error?) -> Void) - func finishRoute(with workout: HKWorkout, metadata: [String : Any]?) async throws -> HKWorkoutRoute? + func finishRoute(with workout: HKWorkout, metadata: [String : Any]?) async throws -> HKWorkoutRoute } diff --git a/iOS/HomeKit/HMHome.swift b/iOS/HomeKit/HMHome.swift index 60de51b..9d1ffa3 100644 --- a/iOS/HomeKit/HMHome.swift +++ b/iOS/HomeKit/HMHome.swift @@ -37,7 +37,7 @@ extension HMHome { @available(iOS 11.3, *) func addAndSetupAccessories(with payload: HMAccessorySetupPayload, completionHandler completion: @escaping ([HMAccessory]?, Error?) -> Void) @available(iOS 11.3, *) - func addAndSetupAccessories(with payload: HMAccessorySetupPayload) async throws -> [HMAccessory]? + func addAndSetupAccessories(with payload: HMAccessorySetupPayload) async throws -> [HMAccessory] @available(iOS 13.2, *) var supportsAddingNetworkRouter: Bool { get } } @@ -53,7 +53,7 @@ extension HMHome { @available(iOS, introduced: 8.0, deprecated: 9.0) func addUser(completionHandler completion: @escaping (HMUser?, Error?) -> Void) @available(iOS, introduced: 8.0, deprecated: 9.0) - func addUser() async throws -> HMUser? + func addUser() async throws -> HMUser @available(iOS, introduced: 8.0, deprecated: 9.0) func removeUser(_ user: HMUser, completionHandler completion: @escaping (Error?) -> Void) @available(iOS, introduced: 8.0, deprecated: 9.0) @@ -64,7 +64,7 @@ extension HMHome { extension HMHome { var rooms: [HMRoom] { get } func addRoom(withName roomName: String, completionHandler completion: @escaping (HMRoom?, Error?) -> Void) - func addRoom(withName roomName: String) async throws -> HMRoom? + func addRoom(withName roomName: String) async throws -> HMRoom func removeRoom(_ room: HMRoom, completionHandler completion: @escaping (Error?) -> Void) func removeRoom(_ room: HMRoom) async throws func roomForEntireHome() -> HMRoom @@ -72,21 +72,21 @@ extension HMHome { extension HMHome { var zones: [HMZone] { get } func addZone(withName zoneName: String, completionHandler completion: @escaping (HMZone?, Error?) -> Void) - func addZone(withName zoneName: String) async throws -> HMZone? + func addZone(withName zoneName: String) async throws -> HMZone func removeZone(_ zone: HMZone, completionHandler completion: @escaping (Error?) -> Void) func removeZone(_ zone: HMZone) async throws } extension HMHome { var serviceGroups: [HMServiceGroup] { get } func addServiceGroup(withName serviceGroupName: String, completionHandler completion: @escaping (HMServiceGroup?, Error?) -> Void) - func addServiceGroup(withName serviceGroupName: String) async throws -> HMServiceGroup? + func addServiceGroup(withName serviceGroupName: String) async throws -> HMServiceGroup func removeServiceGroup(_ group: HMServiceGroup, completionHandler completion: @escaping (Error?) -> Void) func removeServiceGroup(_ group: HMServiceGroup) async throws } extension HMHome { var actionSets: [HMActionSet] { get } func addActionSet(withName actionSetName: String, completionHandler completion: @escaping (HMActionSet?, Error?) -> Void) - func addActionSet(withName actionSetName: String) async throws -> HMActionSet? + func addActionSet(withName actionSetName: String) async throws -> HMActionSet func removeActionSet(_ actionSet: HMActionSet, completionHandler completion: @escaping (Error?) -> Void) func removeActionSet(_ actionSet: HMActionSet) async throws func executeActionSet(_ actionSet: HMActionSet, completionHandler completion: @escaping (Error?) -> Void) diff --git a/iOS/HomeKit/HMHomeManager.swift b/iOS/HomeKit/HMHomeManager.swift index f9d5c1d..0daaba7 100644 --- a/iOS/HomeKit/HMHomeManager.swift +++ b/iOS/HomeKit/HMHomeManager.swift @@ -17,7 +17,7 @@ class HMHomeManager : NSObject { func updatePrimaryHome(_ home: HMHome, completionHandler completion: @escaping (Error?) -> Void) func updatePrimaryHome(_ home: HMHome) async throws func addHome(withName homeName: String, completionHandler completion: @escaping (HMHome?, Error?) -> Void) - func addHome(withName homeName: String) async throws -> HMHome? + func addHome(withName homeName: String) async throws -> HMHome func removeHome(_ home: HMHome, completionHandler completion: @escaping (Error?) -> Void) func removeHome(_ home: HMHome) async throws } diff --git a/iOS/IdentityLookup/ILMessageFilterExtensionContext.swift b/iOS/IdentityLookup/ILMessageFilterExtensionContext.swift index e5ee939..9a2fe7d 100644 --- a/iOS/IdentityLookup/ILMessageFilterExtensionContext.swift +++ b/iOS/IdentityLookup/ILMessageFilterExtensionContext.swift @@ -2,5 +2,5 @@ @available(iOS 11.0, *) class ILMessageFilterExtensionContext : NSExtensionContext { func deferQueryRequestToNetwork(completion: @escaping (ILNetworkResponse?, Error?) -> Void) - func deferQueryRequestToNetwork() async throws -> ILNetworkResponse? + func deferQueryRequestToNetwork() async throws -> ILNetworkResponse } diff --git a/iOS/ImageCaptureCore/ICCameraFile.swift b/iOS/ImageCaptureCore/ICCameraFile.swift index 2ef3746..74771a8 100644 --- a/iOS/ImageCaptureCore/ICCameraFile.swift +++ b/iOS/ImageCaptureCore/ICCameraFile.swift @@ -50,15 +50,15 @@ class ICCameraFile : ICCameraItem { @available(iOS 13.0, *) func requestThumbnailData(options: [ICCameraItemThumbnailOption : Any]? = nil, completion: @escaping (Data?, Error?) -> Void) @available(iOS 13.0, *) - func requestThumbnailData(options: [ICCameraItemThumbnailOption : Any]? = nil) async throws -> Data? + func requestThumbnailData(options: [ICCameraItemThumbnailOption : Any]? = nil) async throws -> Data @available(iOS 13.0, *) func requestMetadataDictionary(options: [ICCameraItemMetadataOption : Any]? = nil, completion: @escaping ([AnyHashable : Any]?, Error?) -> Void) @available(iOS 13.0, *) - func requestMetadataDictionary(options: [ICCameraItemMetadataOption : Any]? = nil) async throws -> [AnyHashable : Any]? + func requestMetadataDictionary(options: [ICCameraItemMetadataOption : Any]? = nil) async throws -> [AnyHashable : Any] @available(iOS 13.0, *) func requestDownload(options: [ICDownloadOption : Any]? = nil, completion: @escaping (String?, Error?) -> Void) -> Progress? @available(iOS 13.0, *) func requestReadData(atOffset offset: off_t, length: off_t, completion: @escaping (Data?, Error?) -> Void) @available(iOS 13.0, *) - func requestReadData(atOffset offset: off_t, length: off_t) async throws -> Data? + func requestReadData(atOffset offset: off_t, length: off_t) async throws -> Data } diff --git a/iOS/Intents/INVoiceShortcutCenter.swift b/iOS/Intents/INVoiceShortcutCenter.swift index c777c0c..a8b0f03 100644 --- a/iOS/Intents/INVoiceShortcutCenter.swift +++ b/iOS/Intents/INVoiceShortcutCenter.swift @@ -3,8 +3,8 @@ class INVoiceShortcutCenter : NSObject { class var shared: INVoiceShortcutCenter { get } func getAllVoiceShortcuts(completion completionHandler: @escaping ([INVoiceShortcut]?, Error?) -> Void) - func allVoiceShortcuts() async throws -> [INVoiceShortcut]? + func allVoiceShortcuts() async throws -> [INVoiceShortcut] func getVoiceShortcut(with identifier: UUID, completion completionHandler: @escaping (INVoiceShortcut?, Error?) -> Void) - func getVoiceShortcut(with identifier: UUID) async throws -> INVoiceShortcut? + func getVoiceShortcut(with identifier: UUID) async throws -> INVoiceShortcut func setShortcutSuggestions(_ suggestions: [INShortcut]) } diff --git a/iOS/LinkPresentation/LPMetadataProvider.swift b/iOS/LinkPresentation/LPMetadataProvider.swift index c5ca51f..0a5bdde 100644 --- a/iOS/LinkPresentation/LPMetadataProvider.swift +++ b/iOS/LinkPresentation/LPMetadataProvider.swift @@ -2,7 +2,7 @@ @available(iOS 13.0, *) class LPMetadataProvider : NSObject { func startFetchingMetadata(for URL: URL, completionHandler: @escaping (LPLinkMetadata?, Error?) -> Void) - func startFetchingMetadata(for URL: URL) async throws -> LPLinkMetadata? + func startFetchingMetadata(for URL: URL) async throws -> LPLinkMetadata func cancel() var shouldFetchSubresources: Bool var timeout: TimeInterval diff --git a/iOS/MapKit/MKDirections.swift b/iOS/MapKit/MKDirections.swift index 95c8c48..52a0d73 100644 --- a/iOS/MapKit/MKDirections.swift +++ b/iOS/MapKit/MKDirections.swift @@ -7,9 +7,9 @@ extension MKDirections { class MKDirections : NSObject { init(request: MKDirections.Request) func calculate(completionHandler: @escaping MKDirections.DirectionsHandler) - func calculate() async throws -> MKDirections.Response? + func calculate() async throws -> MKDirections.Response func calculateETA(completionHandler: @escaping MKDirections.ETAHandler) - func calculateETA() async throws -> MKDirections.ETAResponse? + func calculateETA() async throws -> MKDirections.ETAResponse func cancel() var isCalculating: Bool { get } } diff --git a/iOS/MapKit/MKLocalSearch.swift b/iOS/MapKit/MKLocalSearch.swift index 3c723dc..13b1139 100644 --- a/iOS/MapKit/MKLocalSearch.swift +++ b/iOS/MapKit/MKLocalSearch.swift @@ -8,7 +8,7 @@ class MKLocalSearch : NSObject { @available(iOS 14.0, *) init(request: MKLocalPointsOfInterestRequest) func start(completionHandler: @escaping MKLocalSearch.CompletionHandler) - func start() async throws -> MKLocalSearch.Response? + func start() async throws -> MKLocalSearch.Response func cancel() var isSearching: Bool { get } } diff --git a/iOS/MapKit/MKMapSnapshotter.swift b/iOS/MapKit/MKMapSnapshotter.swift index 0dd068b..cea245a 100644 --- a/iOS/MapKit/MKMapSnapshotter.swift +++ b/iOS/MapKit/MKMapSnapshotter.swift @@ -6,9 +6,9 @@ extension MKMapSnapshotter { class MKMapSnapshotter : NSObject { init(options: MKMapSnapshotter.Options) func start(completionHandler: @escaping MKMapSnapshotter.CompletionHandler) - func start() async throws -> MKMapSnapshotter.Snapshot? + func start() async throws -> MKMapSnapshotter.Snapshot func start(with queue: DispatchQueue, completionHandler: @escaping MKMapSnapshotter.CompletionHandler) - func start(with queue: DispatchQueue) async throws -> MKMapSnapshotter.Snapshot? + func start(with queue: DispatchQueue) async throws -> MKMapSnapshotter.Snapshot func cancel() var isLoading: Bool { get } } diff --git a/iOS/MediaPlayer/MPMediaLibrary.swift b/iOS/MediaPlayer/MPMediaLibrary.swift index 25c5a00..1dd7e3b 100644 --- a/iOS/MediaPlayer/MPMediaLibrary.swift +++ b/iOS/MediaPlayer/MPMediaLibrary.swift @@ -25,7 +25,7 @@ class MPMediaLibrary : NSObject, NSSecureCoding { @available(iOS 9.3, *) func getPlaylist(with uuid: UUID, creationMetadata: MPMediaPlaylistCreationMetadata?, completionHandler: @escaping (MPMediaPlaylist?, Error?) -> Void) @available(iOS 9.3, *) - func getPlaylist(with uuid: UUID, creationMetadata: MPMediaPlaylistCreationMetadata?) async throws -> MPMediaPlaylist? + func getPlaylist(with uuid: UUID, creationMetadata: MPMediaPlaylistCreationMetadata?) async throws -> MPMediaPlaylist } extension NSNotification.Name { static let MPMediaLibraryDidChange: NSNotification.Name diff --git a/iOS/MediaPlayer/MPPlayableContentDataSource.swift b/iOS/MediaPlayer/MPPlayableContentDataSource.swift index 3a29149..5c5a9ba 100644 --- a/iOS/MediaPlayer/MPPlayableContentDataSource.swift +++ b/iOS/MediaPlayer/MPPlayableContentDataSource.swift @@ -7,7 +7,7 @@ protocol MPPlayableContentDataSource : NSObjectProtocol { @available(iOS, introduced: 10.0, deprecated: 14.0, message: "Use CarPlay framework") optional func contentItem(forIdentifier identifier: String, completionHandler: @escaping (MPContentItem?, Error?) -> Void) @available(iOS, introduced: 10.0, deprecated: 14.0, message: "Use CarPlay framework") - optional func contentItem(forIdentifier identifier: String) async throws -> MPContentItem? + optional func contentItem(forIdentifier identifier: String) async throws -> MPContentItem func numberOfChildItems(at indexPath: IndexPath) -> Int func contentItem(at indexPath: IndexPath) -> MPContentItem? } diff --git a/iOS/Metal/MTLDevice.swift b/iOS/Metal/MTLDevice.swift index 45d4d62..e09577c 100644 --- a/iOS/Metal/MTLDevice.swift +++ b/iOS/Metal/MTLDevice.swift @@ -181,25 +181,25 @@ protocol MTLDevice : NSObjectProtocol { func makeLibrary(data: __DispatchData) throws -> MTLLibrary func makeLibrary(source: String, options: MTLCompileOptions?) throws -> MTLLibrary func makeLibrary(source: String, options: MTLCompileOptions?, completionHandler: @escaping MTLNewLibraryCompletionHandler) - func makeLibrary(source: String, options: MTLCompileOptions?) async throws -> MTLLibrary? + func makeLibrary(source: String, options: MTLCompileOptions?) async throws -> MTLLibrary func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor) throws -> MTLRenderPipelineState func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer?) throws -> MTLRenderPipelineState func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, completionHandler: @escaping MTLNewRenderPipelineStateCompletionHandler) - func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor) async throws -> MTLRenderPipelineState? + func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor) async throws -> MTLRenderPipelineState func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption, completionHandler: @escaping MTLNewRenderPipelineStateWithReflectionCompletionHandler) - func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLRenderPipelineState?, MTLRenderPipelineReflection?) + func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLRenderPipelineState, MTLRenderPipelineReflection) func makeComputePipelineState(function computeFunction: MTLFunction) throws -> MTLComputePipelineState func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer?) throws -> MTLComputePipelineState func makeComputePipelineState(function computeFunction: MTLFunction, completionHandler: @escaping MTLNewComputePipelineStateCompletionHandler) - func makeComputePipelineState(function computeFunction: MTLFunction) async throws -> MTLComputePipelineState? + func makeComputePipelineState(function computeFunction: MTLFunction) async throws -> MTLComputePipelineState func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption, completionHandler: @escaping MTLNewComputePipelineStateWithReflectionCompletionHandler) - func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption) async throws -> (MTLComputePipelineState?, MTLComputePipelineReflection?) + func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption) async throws -> (MTLComputePipelineState, MTLComputePipelineReflection) @available(iOS 9.0, *) func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer?) throws -> MTLComputePipelineState @available(iOS 9.0, *) func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption, completionHandler: @escaping MTLNewComputePipelineStateWithReflectionCompletionHandler) @available(iOS 9.0, *) - func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLComputePipelineState?, MTLComputePipelineReflection?) + func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLComputePipelineState, MTLComputePipelineReflection) @available(iOS 10.0, *) func makeFence() -> MTLFence? func supportsFeatureSet(_ featureSet: MTLFeatureSet) -> Bool @@ -216,7 +216,7 @@ protocol MTLDevice : NSObjectProtocol { @available(iOS 11.0, *) func makeRenderPipelineState(tileDescriptor descriptor: MTLTileRenderPipelineDescriptor, options: MTLPipelineOption, completionHandler: @escaping MTLNewRenderPipelineStateWithReflectionCompletionHandler) @available(iOS 11.0, *) - func makeRenderPipelineState(tileDescriptor descriptor: MTLTileRenderPipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLRenderPipelineState?, MTLRenderPipelineReflection?) + func makeRenderPipelineState(tileDescriptor descriptor: MTLTileRenderPipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLRenderPipelineState, MTLRenderPipelineReflection) @available(iOS 11.0, *) var maxThreadgroupMemoryLength: Int { get } @available(iOS 12.0, *) diff --git a/iOS/Metal/MTLLibrary.swift b/iOS/Metal/MTLLibrary.swift index b318683..0f04116 100644 --- a/iOS/Metal/MTLLibrary.swift +++ b/iOS/Metal/MTLLibrary.swift @@ -140,17 +140,17 @@ protocol MTLLibrary : NSObjectProtocol { @available(iOS 10.0, *) func makeFunction(name: String, constantValues: MTLFunctionConstantValues, completionHandler: @escaping (MTLFunction?, Error?) -> Void) @available(iOS 10.0, *) - func makeFunction(name: String, constantValues: MTLFunctionConstantValues) async throws -> MTLFunction? + func makeFunction(name: String, constantValues: MTLFunctionConstantValues) async throws -> MTLFunction @available(iOS 14.0, *) func makeFunction(descriptor: MTLFunctionDescriptor, completionHandler: @escaping (MTLFunction?, Error?) -> Void) @available(iOS 14.0, *) - func makeFunction(descriptor: MTLFunctionDescriptor) async throws -> MTLFunction? + func makeFunction(descriptor: MTLFunctionDescriptor) async throws -> MTLFunction @available(iOS 14.0, *) func makeFunction(descriptor: MTLFunctionDescriptor) throws -> MTLFunction @available(iOS 14.0, *) func makeIntersectionFunction(descriptor: MTLIntersectionFunctionDescriptor, completionHandler: @escaping (MTLFunction?, Error?) -> Void) @available(iOS 14.0, *) - func makeIntersectionFunction(descriptor: MTLIntersectionFunctionDescriptor) async throws -> MTLFunction? + func makeIntersectionFunction(descriptor: MTLIntersectionFunctionDescriptor) async throws -> MTLFunction @available(iOS 14.0, *) func makeIntersectionFunction(descriptor: MTLIntersectionFunctionDescriptor) throws -> MTLFunction var functionNames: [String] { get } diff --git a/iOS/MetalKit/MTKTextureLoader.swift b/iOS/MetalKit/MTKTextureLoader.swift index 263811a..fce4cb6 100644 --- a/iOS/MetalKit/MTKTextureLoader.swift +++ b/iOS/MetalKit/MTKTextureLoader.swift @@ -65,11 +65,11 @@ class MTKTextureLoader : NSObject { var device: MTLDevice { get } init(device: MTLDevice) func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) - func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture @available(iOS 10.0, *) func newTexture(name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) @available(iOS 10.0, *) - func newTexture(name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + func newTexture(name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture @available(iOS 10.0, *) func newTextures(URLs: [URL], options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.ArrayCallback) @available(iOS 10.0, *) @@ -79,13 +79,13 @@ class MTKTextureLoader : NSObject { @available(iOS 10.0, *) func newTextures(names: [String], scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> [MTLTexture] func newTexture(data: Data, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) - func newTexture(data: Data, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + func newTexture(data: Data, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture func newTexture(cgImage: CGImage, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) - func newTexture(cgImage: CGImage, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + func newTexture(cgImage: CGImage, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture @available(iOS 10.0, *) func newTexture(texture: MDLTexture, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) @available(iOS 10.0, *) - func newTexture(texture: MDLTexture, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + func newTexture(texture: MDLTexture, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil) throws -> MTLTexture @available(iOS 10.0, *) func newTextures(URLs: [URL], options: [MTKTextureLoader.Option : Any]? = nil, error: NSErrorPointer) -> [MTLTexture] diff --git a/iOS/MultipeerConnectivity/MCSession.swift b/iOS/MultipeerConnectivity/MCSession.swift index febb26f..09ebbd3 100644 --- a/iOS/MultipeerConnectivity/MCSession.swift +++ b/iOS/MultipeerConnectivity/MCSession.swift @@ -56,7 +56,7 @@ protocol MCSessionDelegate : NSObjectProtocol { } extension MCSession { func nearbyConnectionData(forPeer peerID: MCPeerID, withCompletionHandler completionHandler: @escaping (Data?, Error?) -> Void) - func nearbyConnectionData(forPeer peerID: MCPeerID) async throws -> Data? + func nearbyConnectionData(forPeer peerID: MCPeerID) async throws -> Data func connectPeer(_ peerID: MCPeerID, withNearbyConnectionData data: Data) func cancelConnectPeer(_ peerID: MCPeerID) } diff --git a/iOS/NetworkExtension/NetworkExtension.swift b/iOS/NetworkExtension/NetworkExtension.swift index 6744929..c09acf8 100644 --- a/iOS/NetworkExtension/NetworkExtension.swift +++ b/iOS/NetworkExtension/NetworkExtension.swift @@ -195,7 +195,7 @@ class NETunnelProviderManager : NEVPNManager { @available(iOS 9.0, *) class func loadAllFromPreferences(completionHandler: @escaping ([NETunnelProviderManager]?, Error?) -> Void) @available(iOS 9.0, *) - class func loadAllFromPreferences() async throws -> [NETunnelProviderManager]? + class func loadAllFromPreferences() async throws -> [NETunnelProviderManager] @available(iOS 9.0, *) func copyAppRules() -> [NEAppRule]? @available(iOS 9.0, *) @@ -209,7 +209,7 @@ class NEAppProxyTCPFlow : NEAppProxyFlow { @available(iOS 9.0, *) func readData(completionHandler: @escaping (Data?, Error?) -> Void) @available(iOS 9.0, *) - func readData() async throws -> Data? + func readData() async throws -> Data @available(iOS 9.0, *) func write(_ data: Data, withCompletionHandler completionHandler: @escaping (Error?) -> Void) @available(iOS 9.0, *) @@ -222,7 +222,7 @@ class NEAppProxyUDPFlow : NEAppProxyFlow { @available(iOS 9.0, *) func readDatagrams(completionHandler: @escaping ([Data]?, [NWEndpoint]?, Error?) -> Void) @available(iOS 9.0, *) - func readDatagrams() async throws -> ([Data]?, [NWEndpoint]?) + func readDatagrams() async throws -> ([Data], [NWEndpoint]) @available(iOS 9.0, *) func writeDatagrams(_ datagrams: [Data], sentBy remoteEndpoints: [NWEndpoint], completionHandler: @escaping (Error?) -> Void) @available(iOS 9.0, *) @@ -1329,7 +1329,7 @@ class NEAppPushManager : NSObject { @available(iOS 14.0, *) class func loadAllFromPreferences(completionHandler: @escaping ([NEAppPushManager]?, Error?) -> Void) @available(iOS 14.0, *) - class func loadAllFromPreferences() async throws -> [NEAppPushManager]? + class func loadAllFromPreferences() async throws -> [NEAppPushManager] @available(iOS 14.0, *) func loadFromPreferences(completionHandler: @escaping (Error?) -> Void) @available(iOS 14.0, *) @@ -1452,11 +1452,11 @@ class NWTCPConnection : NSObject { @available(iOS 9.0, *) func readLength(_ length: Int, completionHandler completion: @escaping (Data?, Error?) -> Void) @available(iOS 9.0, *) - func readLength(_ length: Int) async throws -> Data? + func readLength(_ length: Int) async throws -> Data @available(iOS 9.0, *) func readMinimumLength(_ minimum: Int, maximumLength maximum: Int, completionHandler completion: @escaping (Data?, Error?) -> Void) @available(iOS 9.0, *) - func readMinimumLength(_ minimum: Int, maximumLength maximum: Int) async throws -> Data? + func readMinimumLength(_ minimum: Int, maximumLength maximum: Int) async throws -> Data @available(iOS 9.0, *) func write(_ data: Data, completionHandler completion: @escaping (Error?) -> Void) @available(iOS 9.0, *) diff --git a/iOS/PassKit/PKAddShareablePassConfiguration.swift b/iOS/PassKit/PKAddShareablePassConfiguration.swift index b7c541c..0371af6 100644 --- a/iOS/PassKit/PKAddShareablePassConfiguration.swift +++ b/iOS/PassKit/PKAddShareablePassConfiguration.swift @@ -19,7 +19,7 @@ enum PKAddShareablePassConfigurationPrimaryAction : UInt { @available(iOS 14.0, *) class PKAddShareablePassConfiguration : PKAddSecureElementPassConfiguration { class func forPassMetaData(_ passMetadata: [PKShareablePassMetadata], provisioningPolicyIdentifier: String, action: PKAddShareablePassConfigurationPrimaryAction, completion: @escaping (PKAddShareablePassConfiguration?, Error?) -> Void) - class func forPassMetaData(_ passMetadata: [PKShareablePassMetadata], provisioningPolicyIdentifier: String, action: PKAddShareablePassConfigurationPrimaryAction) async throws -> PKAddShareablePassConfiguration? + class func forPassMetaData(_ passMetadata: [PKShareablePassMetadata], provisioningPolicyIdentifier: String, action: PKAddShareablePassConfigurationPrimaryAction) async throws -> PKAddShareablePassConfiguration var primaryAction: PKAddShareablePassConfigurationPrimaryAction { get } var credentialsMetadata: [PKShareablePassMetadata] { get } var provisioningPolicyIdentifier: String { get } diff --git a/iOS/PassKit/PKPassLibrary.swift b/iOS/PassKit/PKPassLibrary.swift index 5befd3b..e26aaf5 100644 --- a/iOS/PassKit/PKPassLibrary.swift +++ b/iOS/PassKit/PKPassLibrary.swift @@ -76,7 +76,7 @@ class PKPassLibrary : NSObject { @available(iOS 13.4, *) func sign(_ signData: Data, using secureElementPass: PKSecureElementPass, completion: @escaping (Data?, Data?, Error?) -> Void) @available(iOS 13.4, *) - func sign(_ signData: Data, using secureElementPass: PKSecureElementPass) async throws -> (Data?, Data?) + func sign(_ signData: Data, using secureElementPass: PKSecureElementPass) async throws -> (Data, Data) } struct PKPassLibraryNotificationName : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable { init(_ rawValue: String) diff --git a/iOS/Photos/PHLivePhotoEditingContext.swift b/iOS/Photos/PHLivePhotoEditingContext.swift index 5356720..0f9c6fd 100644 --- a/iOS/Photos/PHLivePhotoEditingContext.swift +++ b/iOS/Photos/PHLivePhotoEditingContext.swift @@ -26,7 +26,7 @@ class PHLivePhotoEditingContext : NSObject { @available(iOS 10, *) func prepareLivePhotoForPlayback(withTargetSize targetSize: CGSize, options: [String : Any]? = nil, completionHandler handler: @escaping (PHLivePhoto?, Error?) -> Void) @available(iOS 10, *) - func prepareLivePhotoForPlayback(withTargetSize targetSize: CGSize, options: [String : Any]? = nil) async throws -> PHLivePhoto? + func prepareLivePhotoForPlayback(withTargetSize targetSize: CGSize, options: [String : Any]? = nil) async throws -> PHLivePhoto @available(iOS 10, *) func saveLivePhoto(to output: PHContentEditingOutput, options: [String : Any]? = nil, completionHandler handler: @escaping (Bool, Error?) -> Void) @available(iOS 10, *) diff --git a/iOS/QuickLookThumbnailing/QLThumbnailGenerator.swift b/iOS/QuickLookThumbnailing/QLThumbnailGenerator.swift index 4696901..9347397 100644 --- a/iOS/QuickLookThumbnailing/QLThumbnailGenerator.swift +++ b/iOS/QuickLookThumbnailing/QLThumbnailGenerator.swift @@ -3,7 +3,7 @@ class QLThumbnailGenerator : NSObject { class var shared: QLThumbnailGenerator { get } func generateBestRepresentation(for request: QLThumbnailGenerator.Request, completion completionHandler: @escaping (QLThumbnailRepresentation?, Error?) -> Void) - func generateBestRepresentation(for request: QLThumbnailGenerator.Request) async throws -> QLThumbnailRepresentation? + func generateBestRepresentation(for request: QLThumbnailGenerator.Request) async throws -> QLThumbnailRepresentation func generateRepresentations(for request: QLThumbnailGenerator.Request, update updateHandler: ((QLThumbnailRepresentation?, QLThumbnailRepresentation.RepresentationType, Error?) -> Void)? = nil) func cancel(_ request: QLThumbnailGenerator.Request) func saveBestRepresentation(for request: QLThumbnailGenerator.Request, to fileURL: URL, contentType: String, completion completionHandler: @escaping (Error?) -> Void) diff --git a/iOS/SafariServices/SFContentBlockerManager.swift b/iOS/SafariServices/SFContentBlockerManager.swift index 7242896..df93e1c 100644 --- a/iOS/SafariServices/SFContentBlockerManager.swift +++ b/iOS/SafariServices/SFContentBlockerManager.swift @@ -19,5 +19,5 @@ class SFContentBlockerManager : NSObject { @available(iOS 10.0, *) class func getStateOfContentBlocker(withIdentifier identifier: String, completionHandler: @escaping (SFContentBlockerState?, Error?) -> Void) @available(iOS 10.0, *) - class func stateOfContentBlocker(withIdentifier identifier: String) async throws -> SFContentBlockerState? + class func stateOfContentBlocker(withIdentifier identifier: String) async throws -> SFContentBlockerState } diff --git a/iOS/StoreKit/SKCloudServiceController.swift b/iOS/StoreKit/SKCloudServiceController.swift index 29642de..dea1ad7 100644 --- a/iOS/StoreKit/SKCloudServiceController.swift +++ b/iOS/StoreKit/SKCloudServiceController.swift @@ -30,19 +30,19 @@ class SKCloudServiceController : NSObject { @available(iOS 11.0, *) func requestStorefrontCountryCode(completionHandler: @escaping (String?, Error?) -> Void) @available(iOS 11.0, *) - func requestStorefrontCountryCode() async throws -> String? + func requestStorefrontCountryCode() async throws -> String @available(iOS 9.3, *) func requestStorefrontIdentifier(completionHandler: @escaping (String?, Error?) -> Void) @available(iOS 9.3, *) - func requestStorefrontIdentifier() async throws -> String? + func requestStorefrontIdentifier() async throws -> String @available(iOS 11.0, *) func requestUserToken(forDeveloperToken developerToken: String, completionHandler: @escaping (String?, Error?) -> Void) @available(iOS 11.0, *) - func requestUserToken(forDeveloperToken developerToken: String) async throws -> String? + func requestUserToken(forDeveloperToken developerToken: String) async throws -> String @available(iOS, introduced: 10.3, deprecated: 11.0) func requestPersonalizationToken(forClientToken clientToken: String, withCompletionHandler completionHandler: @escaping (String?, Error?) -> Void) @available(iOS, introduced: 10.3, deprecated: 11.0) - func requestPersonalizationToken(forClientToken clientToken: String) async throws -> String? + func requestPersonalizationToken(forClientToken clientToken: String) async throws -> String } extension NSNotification.Name { @available(iOS 9.3, *) diff --git a/iOS/UIKit/UIDocumentBrowserViewController.swift b/iOS/UIKit/UIDocumentBrowserViewController.swift index 2d83782..3651f68 100644 --- a/iOS/UIKit/UIDocumentBrowserViewController.swift +++ b/iOS/UIKit/UIDocumentBrowserViewController.swift @@ -44,9 +44,9 @@ class UIDocumentBrowserViewController : UIViewController, NSCoding { var additionalLeadingNavigationBarButtonItems: [UIBarButtonItem] var additionalTrailingNavigationBarButtonItems: [UIBarButtonItem] func revealDocument(at url: URL, importIfNeeded: Bool, completion: ((URL?, Error?) -> Void)? = nil) - func revealDocument(at url: URL, importIfNeeded: Bool) async throws -> URL? + func revealDocument(at url: URL, importIfNeeded: Bool) async throws -> URL func importDocument(at documentURL: URL, nextToDocumentAt neighbourURL: URL, mode importMode: UIDocumentBrowserViewController.ImportMode, completionHandler completion: @escaping (URL?, Error?) -> Void) - func importDocument(at documentURL: URL, nextToDocumentAt neighbourURL: URL, mode importMode: UIDocumentBrowserViewController.ImportMode) async throws -> URL? + func importDocument(at documentURL: URL, nextToDocumentAt neighbourURL: URL, mode importMode: UIDocumentBrowserViewController.ImportMode) async throws -> URL @available(iOS 12.0, *) func transitionController(forDocumentAt documentURL: URL) -> UIDocumentBrowserTransitionController @available(iOS, introduced: 11.0, deprecated: 12.0) diff --git a/iOS/UIKit/UIPasteboard.swift b/iOS/UIKit/UIPasteboard.swift index 84f65e1..7c0b5b5 100644 --- a/iOS/UIKit/UIPasteboard.swift +++ b/iOS/UIKit/UIPasteboard.swift @@ -66,19 +66,19 @@ class UIPasteboard : NSObject { @available(iOS 14.0, *) func __detectPatterns(forPatterns patterns: Set, completionHandler: @escaping (Set?, Error?) -> Void) @available(iOS 14.0, *) - func __detectPatterns(forPatterns patterns: Set) async throws -> Set? + func __detectPatterns(forPatterns patterns: Set) async throws -> Set @available(iOS 14.0, *) func __detectPatterns(forPatterns patterns: Set, inItemSet itemSet: IndexSet?, completionHandler: @escaping ([Set]?, Error?) -> Void) @available(iOS 14.0, *) - func __detectPatterns(forPatterns patterns: Set, inItemSet itemSet: IndexSet?) async throws -> [Set]? + func __detectPatterns(forPatterns patterns: Set, inItemSet itemSet: IndexSet?) async throws -> [Set] @available(iOS 14.0, *) func __detectValues(forPatterns patterns: Set, completionHandler: @escaping ([UIPasteboard.DetectionPattern : Any]?, Error?) -> Void) @available(iOS 14.0, *) - func __detectValues(forPatterns patterns: Set) async throws -> [UIPasteboard.DetectionPattern : Any]? + func __detectValues(forPatterns patterns: Set) async throws -> [UIPasteboard.DetectionPattern : Any] @available(iOS 14.0, *) func __detectValues(forPatterns patterns: Set, inItemSet itemSet: IndexSet?, completionHandler: @escaping ([[UIPasteboard.DetectionPattern : Any]]?, Error?) -> Void) @available(iOS 14.0, *) - func __detectValues(forPatterns patterns: Set, inItemSet itemSet: IndexSet?) async throws -> [[UIPasteboard.DetectionPattern : Any]]? + func __detectValues(forPatterns patterns: Set, inItemSet itemSet: IndexSet?) async throws -> [[UIPasteboard.DetectionPattern : Any]] } extension UIPasteboard { diff --git a/iOS/WebKit/NSAttributedString.swift b/iOS/WebKit/NSAttributedString.swift index 1016e4e..3724ea2 100644 --- a/iOS/WebKit/NSAttributedString.swift +++ b/iOS/WebKit/NSAttributedString.swift @@ -11,17 +11,17 @@ extension NSAttributedString { @available(iOS 13.0, *) class func loadFromHTML(request: URLRequest, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], completionHandler: @escaping NSAttributedString.CompletionHandler) @available(iOS 13.0, *) - class func loadFromHTML(request: URLRequest, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString?, [NSAttributedString.DocumentAttributeKey : Any]?) + class func loadFromHTML(request: URLRequest, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString, [NSAttributedString.DocumentAttributeKey : Any]) @available(iOS 13.0, *) class func loadFromHTML(fileURL: URL, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], completionHandler: @escaping NSAttributedString.CompletionHandler) @available(iOS 13.0, *) - class func loadFromHTML(fileURL: URL, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString?, [NSAttributedString.DocumentAttributeKey : Any]?) + class func loadFromHTML(fileURL: URL, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString, [NSAttributedString.DocumentAttributeKey : Any]) @available(iOS 13.0, *) class func loadFromHTML(string: String, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], completionHandler: @escaping NSAttributedString.CompletionHandler) @available(iOS 13.0, *) - class func loadFromHTML(string: String, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString?, [NSAttributedString.DocumentAttributeKey : Any]?) + class func loadFromHTML(string: String, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString, [NSAttributedString.DocumentAttributeKey : Any]) @available(iOS 13.0, *) class func loadFromHTML(data: Data, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], completionHandler: @escaping NSAttributedString.CompletionHandler) @available(iOS 13.0, *) - class func loadFromHTML(data: Data, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString?, [NSAttributedString.DocumentAttributeKey : Any]?) + class func loadFromHTML(data: Data, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString, [NSAttributedString.DocumentAttributeKey : Any]) } diff --git a/iOS/WebKit/WKContentRuleListStore.swift b/iOS/WebKit/WKContentRuleListStore.swift index 3df2b56..84cc45f 100644 --- a/iOS/WebKit/WKContentRuleListStore.swift +++ b/iOS/WebKit/WKContentRuleListStore.swift @@ -4,9 +4,9 @@ class WKContentRuleListStore : NSObject { class func `default`() -> Self! convenience init!(url: URL!) func compileContentRuleList(forIdentifier identifier: String!, encodedContentRuleList: String!, completionHandler: ((WKContentRuleList?, Error?) -> Void)!) - func compileContentRuleList(forIdentifier identifier: String!, encodedContentRuleList: String!) async throws -> WKContentRuleList? + func compileContentRuleList(forIdentifier identifier: String!, encodedContentRuleList: String!) async throws -> WKContentRuleList func lookUpContentRuleList(forIdentifier identifier: String!, completionHandler: ((WKContentRuleList?, Error?) -> Void)!) - func lookUpContentRuleList(forIdentifier identifier: String!) async throws -> WKContentRuleList? + func lookUpContentRuleList(forIdentifier identifier: String!) async throws -> WKContentRuleList func removeContentRuleList(forIdentifier identifier: String!, completionHandler: ((Error?) -> Void)!) func removeContentRuleList(forIdentifier identifier: String!) async throws func getAvailableContentRuleListIdentifiers(_ completionHandler: (([String]?) -> Void)!) diff --git a/iOS/WebKit/WKWebView.swift b/iOS/WebKit/WKWebView.swift index 98a0276..da35286 100644 --- a/iOS/WebKit/WKWebView.swift +++ b/iOS/WebKit/WKWebView.swift @@ -28,23 +28,23 @@ class WKWebView : UIView { func reloadFromOrigin() -> WKNavigation? func stopLoading() func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, Error?) -> Void)? = nil) - func evaluateJavaScript(_ javaScriptString: String) async throws -> Any? + func evaluateJavaScript(_ javaScriptString: String) async throws -> Any @available(iOS 14.0, *) func __evaluateJavaScript(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld, completionHandler: ((Any?, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func __evaluateJavaScript(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any? + func __evaluateJavaScript(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any @available(iOS 14.0, *) func __callAsyncJavaScript(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld, completionHandler: ((Any?, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func __callAsyncJavaScript(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any? + func __callAsyncJavaScript(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any @available(iOS 11.0, *) func takeSnapshot(with snapshotConfiguration: WKSnapshotConfiguration?, completionHandler: @escaping (UIImage?, Error?) -> Void) @available(iOS 11.0, *) - func takeSnapshot(with snapshotConfiguration: WKSnapshotConfiguration?) async throws -> UIImage? + func takeSnapshot(with snapshotConfiguration: WKSnapshotConfiguration?) async throws -> UIImage @available(iOS 14.0, *) func __createPDF(with pdfConfiguration: WKPDFConfiguration?, completionHandler: @escaping (Data?, Error?) -> Void) @available(iOS 14.0, *) - func __createPDF(with pdfConfiguration: WKPDFConfiguration?) async throws -> Data? + func __createPDF(with pdfConfiguration: WKPDFConfiguration?) async throws -> Data @available(iOS 14.0, *) func __createWebArchiveData(completionHandler: @escaping (Data, Error) -> Void) @available(iOS 14.0, *) diff --git a/iOS/iAd/ADClient.swift b/iOS/iAd/ADClient.swift index 962852c..7cf78ca 100644 --- a/iOS/iAd/ADClient.swift +++ b/iOS/iAd/ADClient.swift @@ -33,7 +33,7 @@ class ADClient : NSObject { @available(iOS 9.0, *) func requestAttributionDetails(_ completionHandler: @escaping ([String : NSObject]?, Error?) -> Void) @available(iOS 9.0, *) - func requestAttributionDetailsWithBlock() async throws -> [String : NSObject]? + func requestAttributionDetailsWithBlock() async throws -> [String : NSObject] @available(iOS, introduced: 8.0, deprecated: 13.0) func add(toSegments segmentIdentifiers: [String], replaceExisting: Bool) } diff --git a/macOS/AVFoundation/AVAssetImageGenerator.swift b/macOS/AVFoundation/AVAssetImageGenerator.swift index 4049fa1..4b97542 100644 --- a/macOS/AVFoundation/AVAssetImageGenerator.swift +++ b/macOS/AVFoundation/AVAssetImageGenerator.swift @@ -38,7 +38,7 @@ class AVAssetImageGenerator : NSObject { init(asset: AVAsset) func copyCGImage(at requestedTime: CMTime, actualTime: UnsafeMutablePointer?) throws -> CGImage func generateCGImagesAsynchronously(forTimes requestedTimes: [NSValue], completionHandler handler: @escaping AVAssetImageGeneratorCompletionHandler) - func generateCGImages(forTimes requestedTimes: [NSValue]) async throws -> (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result) + func generateCGImages(forTimes requestedTimes: [NSValue]) async throws -> (CMTime, CGImage, CMTime, AVAssetImageGenerator.Result) func cancelAllCGImageGeneration() } typealias AVAssetImageGeneratorCompletionHandler = (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result, Error?) -> Void diff --git a/macOS/AVFoundation/AVCaptureStillImageOutput.swift b/macOS/AVFoundation/AVCaptureStillImageOutput.swift index 46d81e6..c5e82fa 100644 --- a/macOS/AVFoundation/AVCaptureStillImageOutput.swift +++ b/macOS/AVFoundation/AVCaptureStillImageOutput.swift @@ -9,7 +9,7 @@ class AVCaptureStillImageOutput : AVCaptureOutput { @available(macOS 10.8, *) var isCapturingStillImage: Bool { get } func captureStillImageAsynchronously(from connection: AVCaptureConnection, completionHandler handler: @escaping (CMSampleBuffer?, Error?) -> Void) - func captureStillImage(from connection: AVCaptureConnection) async throws -> CMSampleBuffer? + func captureStillImage(from connection: AVCaptureConnection) async throws -> CMSampleBuffer class func jpegStillImageNSDataRepresentation(_ jpegSampleBuffer: CMSampleBuffer) -> Data? } extension AVCaptureStillImageOutput { diff --git a/macOS/AVFoundation/AVContentKeySession.swift b/macOS/AVFoundation/AVContentKeySession.swift index 2d3d432..fb836c0 100644 --- a/macOS/AVFoundation/AVContentKeySession.swift +++ b/macOS/AVFoundation/AVContentKeySession.swift @@ -30,15 +30,15 @@ class AVContentKeySession : NSObject { @available(macOS 10.15, *) func makeSecureTokenForExpirationDate(ofPersistableContentKey persistableContentKeyData: Data, completionHandler handler: @escaping (Data?, Error?) -> Void) @available(macOS 10.15, *) - func makeSecureTokenForExpirationDate(ofPersistableContentKey persistableContentKeyData: Data) async throws -> Data? + func makeSecureTokenForExpirationDate(ofPersistableContentKey persistableContentKeyData: Data) async throws -> Data @available(macOS 10.15, *) func invalidatePersistableContentKey(_ persistableContentKeyData: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) @available(macOS 10.15, *) - func invalidatePersistableContentKey(_ persistableContentKeyData: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil) async throws -> Data? + func invalidatePersistableContentKey(_ persistableContentKeyData: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil) async throws -> Data @available(macOS 10.15, *) func invalidateAllPersistableContentKeys(forApp appIdentifier: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) @available(macOS 10.15, *) - func invalidateAllPersistableContentKeys(forApp appIdentifier: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil) async throws -> Data? + func invalidateAllPersistableContentKeys(forApp appIdentifier: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil) async throws -> Data } struct AVContentKeySessionServerPlaybackContextOption : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable { init(rawValue: String) @@ -112,7 +112,7 @@ class AVContentKeyRequest : NSObject { var options: [String : Any] { get } var canProvidePersistableContentKey: Bool { get } func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) - func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil) async throws -> Data? + func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil) async throws -> Data func processContentKeyResponse(_ keyResponse: AVContentKeyResponse) func processContentKeyResponseError(_ error: Error) @available(macOS 10.15, *) diff --git a/macOS/AppKit/NSDocumentController.swift b/macOS/AppKit/NSDocumentController.swift index 81253c4..8ee7874 100644 --- a/macOS/AppKit/NSDocumentController.swift +++ b/macOS/AppKit/NSDocumentController.swift @@ -25,12 +25,12 @@ class NSDocumentController : NSObject, NSCoding, NSMenuItemValidation, NSUserInt @available(macOS 10.7, *) func openDocument(withContentsOf url: URL, display displayDocument: Bool, completionHandler: @escaping (NSDocument?, Bool, Error?) -> Void) @available(macOS 10.7, *) - func openDocument(withContentsOf url: URL, display displayDocument: Bool) async throws -> (NSDocument?, Bool) + func openDocument(withContentsOf url: URL, display displayDocument: Bool) async throws -> (NSDocument, Bool) func makeDocument(withContentsOf url: URL, ofType typeName: String) throws -> NSDocument @available(macOS 10.7, *) func reopenDocument(for urlOrNil: URL?, withContentsOf contentsURL: URL, display displayDocument: Bool, completionHandler: @escaping (NSDocument?, Bool, Error?) -> Void) @available(macOS 10.7, *) - func reopenDocument(for urlOrNil: URL?, withContentsOf contentsURL: URL, display displayDocument: Bool) async throws -> (NSDocument?, Bool) + func reopenDocument(for urlOrNil: URL?, withContentsOf contentsURL: URL, display displayDocument: Bool) async throws -> (NSDocument, Bool) func makeDocument(for urlOrNil: URL?, withContentsOf contentsURL: URL, ofType typeName: String) throws -> NSDocument var autosavingDelay: TimeInterval @IBAction func saveAllDocuments(_ sender: Any?) diff --git a/macOS/AppKit/NSWindowRestoration.swift b/macOS/AppKit/NSWindowRestoration.swift index 7d057bb..4637f55 100644 --- a/macOS/AppKit/NSWindowRestoration.swift +++ b/macOS/AppKit/NSWindowRestoration.swift @@ -3,7 +3,7 @@ protocol NSWindowRestoration : NSObjectProtocol { @available(macOS 10.7, *) static func restoreWindow(withIdentifier identifier: NSUserInterfaceItemIdentifier, state: NSCoder, completionHandler: @escaping (NSWindow?, Error?) -> Void) @available(macOS 10.7, *) - static func restoreWindow(withIdentifier identifier: NSUserInterfaceItemIdentifier, state: NSCoder) async throws -> NSWindow? + static func restoreWindow(withIdentifier identifier: NSUserInterfaceItemIdentifier, state: NSCoder) async throws -> NSWindow } extension NSDocumentController : NSWindowRestoration { } @@ -45,7 +45,7 @@ extension NSDocument { @available(macOS 10.7, *) func restoreWindow(withIdentifier identifier: NSUserInterfaceItemIdentifier, state: NSCoder, completionHandler: @escaping (NSWindow?, Error?) -> Void) @available(macOS 10.7, *) - func restoreWindow(withIdentifier identifier: NSUserInterfaceItemIdentifier, state: NSCoder) async throws -> NSWindow? + func restoreWindow(withIdentifier identifier: NSUserInterfaceItemIdentifier, state: NSCoder) async throws -> NSWindow @available(macOS 10.7, *) func encodeRestorableState(with coder: NSCoder) @available(macOS 10.13, *) diff --git a/macOS/AppKit/NSWorkspace.swift b/macOS/AppKit/NSWorkspace.swift index 36acee2..fe04084 100644 --- a/macOS/AppKit/NSWorkspace.swift +++ b/macOS/AppKit/NSWorkspace.swift @@ -6,15 +6,15 @@ class NSWorkspace : NSObject { @available(macOS 10.15, *) func open(_ url: URL, configuration: NSWorkspace.OpenConfiguration, completionHandler: ((NSRunningApplication?, Error?) -> Void)? = nil) @available(macOS 10.15, *) - func open(_ url: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication? + func open(_ url: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication @available(macOS 10.15, *) func open(_ urls: [URL], withApplicationAt applicationURL: URL, configuration: NSWorkspace.OpenConfiguration, completionHandler: ((NSRunningApplication?, Error?) -> Void)? = nil) @available(macOS 10.15, *) - func open(_ urls: [URL], withApplicationAt applicationURL: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication? + func open(_ urls: [URL], withApplicationAt applicationURL: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication @available(macOS 10.15, *) func openApplication(at applicationURL: URL, configuration: NSWorkspace.OpenConfiguration, completionHandler: ((NSRunningApplication?, Error?) -> Void)? = nil) @available(macOS 10.15, *) - func openApplication(at applicationURL: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication? + func openApplication(at applicationURL: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication func selectFile(_ fullPath: String?, inFileViewerRootedAtPath rootFullPath: String) -> Bool @available(macOS 10.6, *) func activateFileViewerSelecting(_ fileURLs: [URL]) @@ -193,7 +193,7 @@ extension NSWorkspace { @available(macOS 10.14, *) func requestAuthorization(to type: NSWorkspace.AuthorizationType, completionHandler: @escaping (NSWorkspace.Authorization?, Error?) -> Void) @available(macOS 10.14, *) - func requestAuthorization(to type: NSWorkspace.AuthorizationType) async throws -> NSWorkspace.Authorization? + func requestAuthorization(to type: NSWorkspace.AuthorizationType) async throws -> NSWorkspace.Authorization } extension FileManager { @available(macOS 10.14, *) diff --git a/macOS/AudioToolbox/AUAudioUnit.swift b/macOS/AudioToolbox/AUAudioUnit.swift index 0ce7d3e..c2728fa 100644 --- a/macOS/AudioToolbox/AUAudioUnit.swift +++ b/macOS/AudioToolbox/AUAudioUnit.swift @@ -33,7 +33,7 @@ class AUAudioUnit : NSObject { init(componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = []) throws convenience init(componentDescription: AudioComponentDescription) throws class func instantiate(with componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = [], completionHandler: @escaping (AUAudioUnit?, Error?) -> Void) - class func instantiate(with componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = []) async throws -> AUAudioUnit? + class func instantiate(with componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = []) async throws -> AUAudioUnit var componentDescription: AudioComponentDescription { get } var component: AudioComponent { get } var componentName: String? { get } diff --git a/macOS/ClassKit/CLSContext.swift b/macOS/ClassKit/CLSContext.swift index 21aa93e..88ce6f6 100644 --- a/macOS/ClassKit/CLSContext.swift +++ b/macOS/ClassKit/CLSContext.swift @@ -89,5 +89,5 @@ extension CLSContext { func removeFromParent() func addChildContext(_ child: CLSContext) func descendant(matchingIdentifierPath identifierPath: [String], completion: @escaping (CLSContext?, Error?) -> Void) - func descendant(matchingIdentifierPath identifierPath: [String]) async throws -> CLSContext? + func descendant(matchingIdentifierPath identifierPath: [String]) async throws -> CLSContext } diff --git a/macOS/CloudKit/CKContainer.swift b/macOS/CloudKit/CKContainer.swift index 02ff733..832cee7 100644 --- a/macOS/CloudKit/CKContainer.swift +++ b/macOS/CloudKit/CKContainer.swift @@ -77,53 +77,53 @@ extension CKContainer { } extension CKContainer { func fetchUserRecordID(completionHandler: @escaping (CKRecord.ID?, Error?) -> Void) - func fetchUserRecordID() async throws -> CKRecord.ID? + func fetchUserRecordID() async throws -> CKRecord.ID @available(macOS 10.12, *) func discoverAllIdentities(completionHandler: @escaping ([CKUserIdentity]?, Error?) -> Void) @available(macOS 10.12, *) - func discoverAllIdentities() async throws -> [CKUserIdentity]? + func discoverAllIdentities() async throws -> [CKUserIdentity] @available(macOS 10.12, *) func discoverUserIdentity(withEmailAddress email: String, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(macOS 10.12, *) - func discoverUserIdentity(withEmailAddress email: String) async throws -> CKUserIdentity? + func discoverUserIdentity(withEmailAddress email: String) async throws -> CKUserIdentity @available(macOS 10.12, *) func discoverUserIdentity(withPhoneNumber phoneNumber: String, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(macOS 10.12, *) - func discoverUserIdentity(withPhoneNumber phoneNumber: String) async throws -> CKUserIdentity? + func discoverUserIdentity(withPhoneNumber phoneNumber: String) async throws -> CKUserIdentity @available(macOS 10.12, *) func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(macOS 10.12, *) - func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKUserIdentity? + func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKUserIdentity } extension CKContainer { @available(macOS 10.12, *) func fetchShareParticipant(withEmailAddress emailAddress: String, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(macOS 10.12, *) - func fetchShareParticipant(withEmailAddress emailAddress: String) async throws -> CKShare.Participant? + func fetchShareParticipant(withEmailAddress emailAddress: String) async throws -> CKShare.Participant @available(macOS 10.12, *) func fetchShareParticipant(withPhoneNumber phoneNumber: String, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(macOS 10.12, *) - func fetchShareParticipant(withPhoneNumber phoneNumber: String) async throws -> CKShare.Participant? + func fetchShareParticipant(withPhoneNumber phoneNumber: String) async throws -> CKShare.Participant @available(macOS 10.12, *) func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(macOS 10.12, *) - func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKShare.Participant? + func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKShare.Participant @available(macOS 10.12, *) func fetchShareMetadata(with url: URL, completionHandler: @escaping (CKShare.Metadata?, Error?) -> Void) @available(macOS 10.12, *) - func fetchShareMetadata(with url: URL) async throws -> CKShare.Metadata? + func fetchShareMetadata(with url: URL) async throws -> CKShare.Metadata @available(macOS 10.12, *) func accept(_ metadata: CKShare.Metadata, completionHandler: @escaping (CKShare?, Error?) -> Void) @available(macOS 10.12, *) - func accept(_ metadata: CKShare.Metadata) async throws -> CKShare? + func accept(_ metadata: CKShare.Metadata) async throws -> CKShare } extension CKContainer { @available(macOS 10.12, *) func __fetchAllLongLivedOperationIDs(completionHandler: @escaping ([String]?, Error?) -> Void) @available(macOS 10.12, *) - func __fetchAllLongLivedOperationIDs() async throws -> [String]? + func __fetchAllLongLivedOperationIDs() async throws -> [String] @available(macOS 10.12, *) func __fetchLongLivedOperation(withID operationID: String, completionHandler: @escaping (CKOperation?, Error?) -> Void) @available(macOS 10.12, *) - func __fetchLongLivedOperation(withID operationID: String) async throws -> CKOperation? + func __fetchLongLivedOperation(withID operationID: String) async throws -> CKOperation } diff --git a/macOS/CloudKit/CKDatabase.swift b/macOS/CloudKit/CKDatabase.swift index f865784..b0d5367 100644 --- a/macOS/CloudKit/CKDatabase.swift +++ b/macOS/CloudKit/CKDatabase.swift @@ -25,35 +25,35 @@ class CKDatabase : NSObject { } extension CKDatabase { func fetch(withRecordID recordID: CKRecord.ID, completionHandler: @escaping (CKRecord?, Error?) -> Void) - func fetch(withRecordID recordID: CKRecord.ID) async throws -> CKRecord? + func fetch(withRecordID recordID: CKRecord.ID) async throws -> CKRecord func save(_ record: CKRecord, completionHandler: @escaping (CKRecord?, Error?) -> Void) - func save(_ record: CKRecord) async throws -> CKRecord? + func save(_ record: CKRecord) async throws -> CKRecord func delete(withRecordID recordID: CKRecord.ID, completionHandler: @escaping (CKRecord.ID?, Error?) -> Void) - func delete(withRecordID recordID: CKRecord.ID) async throws -> CKRecord.ID? + func delete(withRecordID recordID: CKRecord.ID) async throws -> CKRecord.ID func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?, completionHandler: @escaping ([CKRecord]?, Error?) -> Void) - func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?) async throws -> [CKRecord]? + func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?) async throws -> [CKRecord] func fetchAllRecordZones(completionHandler: @escaping ([CKRecordZone]?, Error?) -> Void) - func fetchAllRecordZones() async throws -> [CKRecordZone]? + func fetchAllRecordZones() async throws -> [CKRecordZone] func fetch(withRecordZoneID zoneID: CKRecordZone.ID, completionHandler: @escaping (CKRecordZone?, Error?) -> Void) - func fetch(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone? + func fetch(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone func save(_ zone: CKRecordZone, completionHandler: @escaping (CKRecordZone?, Error?) -> Void) - func save(_ zone: CKRecordZone) async throws -> CKRecordZone? + func save(_ zone: CKRecordZone) async throws -> CKRecordZone func delete(withRecordZoneID zoneID: CKRecordZone.ID, completionHandler: @escaping (CKRecordZone.ID?, Error?) -> Void) - func delete(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone.ID? + func delete(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone.ID @available(macOS 10.10, *) func __fetch(withSubscriptionID subscriptionID: String, completionHandler: @escaping (CKSubscription?, Error?) -> Void) @available(macOS 10.10, *) - func __fetch(withSubscriptionID subscriptionID: String) async throws -> CKSubscription? + func __fetch(withSubscriptionID subscriptionID: String) async throws -> CKSubscription @available(macOS 10.10, *) func fetchAllSubscriptions(completionHandler: @escaping ([CKSubscription]?, Error?) -> Void) @available(macOS 10.10, *) - func fetchAllSubscriptions() async throws -> [CKSubscription]? + func fetchAllSubscriptions() async throws -> [CKSubscription] @available(macOS 10.10, *) func save(_ subscription: CKSubscription, completionHandler: @escaping (CKSubscription?, Error?) -> Void) @available(macOS 10.10, *) - func save(_ subscription: CKSubscription) async throws -> CKSubscription? + func save(_ subscription: CKSubscription) async throws -> CKSubscription @available(macOS 10.10, *) func __delete(withSubscriptionID subscriptionID: String, completionHandler: @escaping (String?, Error?) -> Void) @available(macOS 10.10, *) - func __delete(withSubscriptionID subscriptionID: String) async throws -> String? + func __delete(withSubscriptionID subscriptionID: String) async throws -> String } diff --git a/macOS/CoreLocation/CLGeocoder.swift b/macOS/CoreLocation/CLGeocoder.swift index 36e4503..49d6c34 100644 --- a/macOS/CoreLocation/CLGeocoder.swift +++ b/macOS/CoreLocation/CLGeocoder.swift @@ -4,23 +4,23 @@ typealias CLGeocodeCompletionHandler = ([CLPlacemark]?, Error?) -> Void class CLGeocoder : NSObject { var isGeocoding: Bool { get } func reverseGeocodeLocation(_ location: CLLocation, completionHandler: @escaping CLGeocodeCompletionHandler) - func reverseGeocodeLocation(_ location: CLLocation) async throws -> [CLPlacemark]? + func reverseGeocodeLocation(_ location: CLLocation) async throws -> [CLPlacemark] @available(macOS 10.13, *) func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?, completionHandler: @escaping CLGeocodeCompletionHandler) @available(macOS 10.13, *) - func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?) async throws -> [CLPlacemark]? + func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?) async throws -> [CLPlacemark] @available(macOS, introduced: 10.8, deprecated: 10.13, message: "Use -geocodePostalAddress:completionHandler:") func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any], completionHandler: @escaping CLGeocodeCompletionHandler) @available(macOS, introduced: 10.8, deprecated: 10.13, message: "Use -geocodePostalAddress:completionHandler:") - func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any]) async throws -> [CLPlacemark]? + func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any]) async throws -> [CLPlacemark] func geocodeAddressString(_ addressString: String, completionHandler: @escaping CLGeocodeCompletionHandler) - func geocodeAddressString(_ addressString: String) async throws -> [CLPlacemark]? + func geocodeAddressString(_ addressString: String) async throws -> [CLPlacemark] func geocodeAddressString(_ addressString: String, in region: CLRegion?, completionHandler: @escaping CLGeocodeCompletionHandler) - func geocodeAddressString(_ addressString: String, in region: CLRegion?) async throws -> [CLPlacemark]? + func geocodeAddressString(_ addressString: String, in region: CLRegion?) async throws -> [CLPlacemark] @available(macOS 10.13, *) func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?, completionHandler: @escaping CLGeocodeCompletionHandler) @available(macOS 10.13, *) - func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?) async throws -> [CLPlacemark]? + func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?) async throws -> [CLPlacemark] func cancelGeocode() } extension CLGeocoder { diff --git a/macOS/CoreML/MLModel.swift b/macOS/CoreML/MLModel.swift index 4aac8a9..cba63d5 100644 --- a/macOS/CoreML/MLModel.swift +++ b/macOS/CoreML/MLModel.swift @@ -10,7 +10,7 @@ class MLModel : NSObject { @available(macOS 11.0, *) class func __loadContents(of url: URL, configuration: MLModelConfiguration, completionHandler handler: @escaping (MLModel?, Error?) -> Void) @available(macOS 11.0, *) - class func __loadContents(of url: URL, configuration: MLModelConfiguration) async throws -> MLModel? + class func __loadContents(of url: URL, configuration: MLModelConfiguration) async throws -> MLModel func prediction(from input: MLFeatureProvider) throws -> MLFeatureProvider func prediction(from input: MLFeatureProvider, options: MLPredictionOptions) throws -> MLFeatureProvider @available(macOS 10.14, *) diff --git a/macOS/CoreSpotlight/CSSearchableIndex.swift b/macOS/CoreSpotlight/CSSearchableIndex.swift index 8e9bf54..84fef3b 100644 --- a/macOS/CoreSpotlight/CSSearchableIndex.swift +++ b/macOS/CoreSpotlight/CSSearchableIndex.swift @@ -35,7 +35,7 @@ extension CSSearchableIndex { func endBatch(withClientState clientState: Data, completionHandler: ((Error?) -> Void)? = nil) func endBatch(withClientState clientState: Data) async throws func fetchLastClientState(completionHandler: @escaping (Data?, Error?) -> Void) - func fetchLastClientState() async throws -> Data? + func fetchLastClientState() async throws -> Data } @available(macOS 10.11, *) protocol CSSearchableIndexDelegate : NSObjectProtocol { diff --git a/macOS/DeviceCheck/DCDevice.swift b/macOS/DeviceCheck/DCDevice.swift index 74a6912..4a49f47 100644 --- a/macOS/DeviceCheck/DCDevice.swift +++ b/macOS/DeviceCheck/DCDevice.swift @@ -4,5 +4,5 @@ class DCDevice : NSObject { class var current: DCDevice { get } var isSupported: Bool { get } func generateToken(completionHandler completion: @escaping (Data?, Error?) -> Void) - func generateToken() async throws -> Data? + func generateToken() async throws -> Data } diff --git a/macOS/FileProvider/Extension.swift b/macOS/FileProvider/Extension.swift index da00f52..f029b0c 100644 --- a/macOS/FileProvider/Extension.swift +++ b/macOS/FileProvider/Extension.swift @@ -9,11 +9,11 @@ class NSFileProviderManager : NSObject { @available(macOS 11.0, *) func getUserVisibleURL(for itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (URL?, Error?) -> Void) @available(macOS 11.0, *) - func getUserVisibleURL(for itemIdentifier: NSFileProviderItemIdentifier) async throws -> URL? + func getUserVisibleURL(for itemIdentifier: NSFileProviderItemIdentifier) async throws -> URL @available(macOS 11.0, *) class func getIdentifierForUserVisibleFile(at url: URL, completionHandler: @escaping (NSFileProviderItemIdentifier?, NSFileProviderDomainIdentifier?, Error?) -> Void) @available(macOS 11.0, *) - class func identifierForUserVisibleFile(at url: URL) async throws -> (NSFileProviderItemIdentifier?, NSFileProviderDomainIdentifier?) + class func identifierForUserVisibleFile(at url: URL) async throws -> (NSFileProviderItemIdentifier, NSFileProviderDomainIdentifier) func register(_ task: URLSessionTask, forItemWithIdentifier identifier: NSFileProviderItemIdentifier, completionHandler completion: @escaping (Error?) -> Void) func register(_ task: URLSessionTask, forItemWithIdentifier identifier: NSFileProviderItemIdentifier) async throws @available(macOS 11.0, *) diff --git a/macOS/FileProvider/NSFileProviderActions.swift b/macOS/FileProvider/NSFileProviderActions.swift index 76598be..8cfd09d 100644 --- a/macOS/FileProvider/NSFileProviderActions.swift +++ b/macOS/FileProvider/NSFileProviderActions.swift @@ -7,23 +7,23 @@ struct NSFileProviderExtensionActionIdentifier : _ObjectiveCBridgeable, Hashable } extension NSFileProviderExtension { func importDocument(at fileURL: URL, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) - func importDocument(at fileURL: URL, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? + func importDocument(at fileURL: URL, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem func createDirectory(withName directoryName: String, inParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) - func createDirectory(withName directoryName: String, inParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? + func createDirectory(withName directoryName: String, inParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem func renameItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toName itemName: String, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) - func renameItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toName itemName: String) async throws -> NSFileProviderItem? + func renameItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toName itemName: String) async throws -> NSFileProviderItem func reparentItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemWithIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, newName: String?, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) - func reparentItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemWithIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, newName: String?) async throws -> NSFileProviderItem? + func reparentItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemWithIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, newName: String?) async throws -> NSFileProviderItem func trashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) - func trashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? + func trashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem func untrashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier?, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) - func untrashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier?) async throws -> NSFileProviderItem? + func untrashItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier?) async throws -> NSFileProviderItem func deleteItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (Error?) -> Void) func deleteItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws func setLastUsedDate(_ lastUsedDate: Date?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) - func setLastUsedDate(_ lastUsedDate: Date?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? + func setLastUsedDate(_ lastUsedDate: Date?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem func setTagData(_ tagData: Data?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) - func setTagData(_ tagData: Data?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? + func setTagData(_ tagData: Data?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem func setFavoriteRank(_ favoriteRank: NSNumber?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) - func setFavoriteRank(_ favoriteRank: NSNumber?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem? + func setFavoriteRank(_ favoriteRank: NSNumber?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async throws -> NSFileProviderItem } diff --git a/macOS/Foundation/NSFileManager.swift b/macOS/Foundation/NSFileManager.swift index d33bf9a..f5b55c6 100644 --- a/macOS/Foundation/NSFileManager.swift +++ b/macOS/Foundation/NSFileManager.swift @@ -124,7 +124,7 @@ class FileManager : NSObject { @available(macOS 10.13, *) func getFileProviderServicesForItem(at url: URL, completionHandler: @escaping ([NSFileProviderServiceName : NSFileProviderService]?, Error?) -> Void) @available(macOS 10.13, *) - func fileProviderServicesForItem(at url: URL) async throws -> [NSFileProviderServiceName : NSFileProviderService]? + func fileProviderServicesForItem(at url: URL) async throws -> [NSFileProviderServiceName : NSFileProviderService] @available(macOS 10.8, *) func containerURL(forSecurityApplicationGroupIdentifier groupIdentifier: String) -> URL? } @@ -231,7 +231,7 @@ extension FileManager { @available(macOS 10.13, *) class NSFileProviderService : NSObject { func getFileProviderConnection(completionHandler: @escaping (NSXPCConnection?, Error?) -> Void) - func fileProviderConnection() async throws -> NSXPCConnection? + func fileProviderConnection() async throws -> NSXPCConnection var name: NSFileProviderServiceName { get } } extension FileAttributeKey { diff --git a/macOS/Foundation/NSFileVersion.swift b/macOS/Foundation/NSFileVersion.swift index 979171a..970284a 100644 --- a/macOS/Foundation/NSFileVersion.swift +++ b/macOS/Foundation/NSFileVersion.swift @@ -19,7 +19,7 @@ class NSFileVersion : NSObject { @available(macOS 10.10, *) class func getNonlocalVersionsOfItem(at url: URL, completionHandler: @escaping ([NSFileVersion]?, Error?) -> Void) @available(macOS 10.10, *) - class func nonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion]? + class func nonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion] class func version(itemAt url: URL, forPersistentIdentifier persistentIdentifier: Any) -> NSFileVersion? @available(macOS 10.7, *) class func addOfItem(at url: URL, withContentsOf contentsURL: URL, options: NSFileVersion.AddingOptions = []) throws -> NSFileVersion diff --git a/macOS/Foundation/NSItemProvider.swift b/macOS/Foundation/NSItemProvider.swift index 53cf748..5a4b910 100644 --- a/macOS/Foundation/NSItemProvider.swift +++ b/macOS/Foundation/NSItemProvider.swift @@ -77,7 +77,7 @@ class NSItemProvider : NSObject, NSCopying { convenience init?(contentsOf fileURL: URL!) func registerItem(forTypeIdentifier typeIdentifier: String, loadHandler: @escaping NSItemProvider.LoadHandler) func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil, completionHandler: NSItemProvider.CompletionHandler? = nil) - func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding? + func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding } @available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) @@ -97,7 +97,7 @@ extension NSItemProvider { @available(macOS 10.10, *) func loadPreviewImage(options: [AnyHashable : Any]! = [:], completionHandler: NSItemProvider.CompletionHandler!) @available(macOS 10.10, *) - func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding? + func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding } @available(macOS 10.10, *) let NSExtensionJavaScriptPreprocessingResultsKey: String diff --git a/macOS/Foundation/NSURLConnection.swift b/macOS/Foundation/NSURLConnection.swift index cc36a1c..4c8e877 100644 --- a/macOS/Foundation/NSURLConnection.swift +++ b/macOS/Foundation/NSURLConnection.swift @@ -56,5 +56,5 @@ extension NSURLConnection { @available(macOS, introduced: 10.7, deprecated: 10.11, message: "Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h") class func sendAsynchronousRequest(_ request: URLRequest, queue: OperationQueue, completionHandler handler: @escaping (URLResponse?, Data?, Error?) -> Void) @available(macOS, introduced: 10.7, deprecated: 10.11, message: "Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h") - class func sendAsynchronousRequest(_ request: URLRequest, queue: OperationQueue) async throws -> (URLResponse?, Data?) + class func sendAsynchronousRequest(_ request: URLRequest, queue: OperationQueue) async throws -> (URLResponse, Data) } diff --git a/macOS/Foundation/NSURLSession.swift b/macOS/Foundation/NSURLSession.swift index 2195fc9..bb2cadb 100644 --- a/macOS/Foundation/NSURLSession.swift +++ b/macOS/Foundation/NSURLSession.swift @@ -129,7 +129,7 @@ class URLSessionDownloadTask : URLSessionTask { @available(macOS 10.11, *) class URLSessionStreamTask : URLSessionTask { func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval, completionHandler: @escaping (Data?, Bool, Error?) -> Void) - func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval) async throws -> (Data?, Bool) + func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval) async throws -> (Data, Bool) func write(_ data: Data, timeout: TimeInterval, completionHandler: @escaping (Error?) -> Void) func write(_ data: Data, timeout: TimeInterval) async throws func captureStreams() @@ -179,7 +179,7 @@ class URLSessionWebSocketTask : URLSessionTask { func __send(_ message: __NSURLSessionWebSocketMessage, completionHandler: @escaping (Error?) -> Void) func __send(_ message: __NSURLSessionWebSocketMessage) async throws func __receiveMessage(completionHandler: @escaping (__NSURLSessionWebSocketMessage?, Error?) -> Void) - func __receiveMessage() async throws -> __NSURLSessionWebSocketMessage? + func __receiveMessage() async throws -> __NSURLSessionWebSocketMessage func sendPing(pongReceiveHandler: @escaping (Error?) -> Void) func cancel(with closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) var maximumMessageSize: Int diff --git a/macOS/Foundation/NSUserActivity.swift b/macOS/Foundation/NSUserActivity.swift index 4d9817f..e948b7c 100644 --- a/macOS/Foundation/NSUserActivity.swift +++ b/macOS/Foundation/NSUserActivity.swift @@ -26,7 +26,7 @@ class NSUserActivity : NSObject { func resignCurrent() func invalidate() func getContinuationStreams(completionHandler: @escaping (InputStream?, OutputStream?, Error?) -> Void) - func continuationStreams() async throws -> (InputStream?, OutputStream?) + func continuationStreams() async throws -> (InputStream, OutputStream) @available(macOS 10.11, *) var isEligibleForHandoff: Bool @available(macOS 10.11, *) diff --git a/macOS/Foundation/NSUserScriptTask.swift b/macOS/Foundation/NSUserScriptTask.swift index 58edd54..1486d8f 100644 --- a/macOS/Foundation/NSUserScriptTask.swift +++ b/macOS/Foundation/NSUserScriptTask.swift @@ -23,7 +23,7 @@ extension NSUserUnixTask { @available(macOS 10.8, *) class NSUserAppleScriptTask : NSUserScriptTask { func execute(withAppleEvent event: NSAppleEventDescriptor?, completionHandler handler: NSUserAppleScriptTask.CompletionHandler? = nil) - func execute(withAppleEvent event: NSAppleEventDescriptor?) async throws -> NSAppleEventDescriptor? + func execute(withAppleEvent event: NSAppleEventDescriptor?) async throws -> NSAppleEventDescriptor } extension NSUserAppleScriptTask { typealias CompletionHandler = (NSAppleEventDescriptor?, Error?) -> Void @@ -32,7 +32,7 @@ extension NSUserAppleScriptTask { class NSUserAutomatorTask : NSUserScriptTask { var variables: [String : Any]? func execute(withInput input: NSSecureCoding?, completionHandler handler: NSUserAutomatorTask.CompletionHandler? = nil) - func execute(withInput input: NSSecureCoding?) async throws -> Any? + func execute(withInput input: NSSecureCoding?) async throws -> Any } extension NSUserAutomatorTask { typealias CompletionHandler = (Any?, Error?) -> Void diff --git a/macOS/GLKit/GLKTextureLoader.swift b/macOS/GLKit/GLKTextureLoader.swift index ba44847..7c08fe9 100644 --- a/macOS/GLKit/GLKTextureLoader.swift +++ b/macOS/GLKit/GLKTextureLoader.swift @@ -82,19 +82,19 @@ class GLKTextureLoader : NSObject { class func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil) throws -> GLKTextureInfo init(share context: NSOpenGLContext) func texture(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func texture(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func texture(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func texture(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func texture(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func texture(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func texture(withName name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func texture(withName name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func texture(withName name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func texture(withContentsOf data: Data, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func texture(withContentsOf data: Data, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func texture(withContentsOf data: Data, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func texture(with cgImage: CGImage, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func texture(with cgImage: CGImage, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func texture(with cgImage: CGImage, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func cubeMap(withContentsOfFiles paths: [Any], options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func cubeMap(withContentsOfFiles paths: [Any], options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func cubeMap(withContentsOfFiles paths: [Any], options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func cubeMap(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func cubeMap(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func cubeMap(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo } diff --git a/macOS/GameKit/GKAchievement.swift b/macOS/GameKit/GKAchievement.swift index e19aeee..ad0ab2a 100644 --- a/macOS/GameKit/GKAchievement.swift +++ b/macOS/GameKit/GKAchievement.swift @@ -2,7 +2,7 @@ @available(macOS 10.8, *) class GKAchievement : NSObject, NSCoding, NSSecureCoding { class func loadAchievements(completionHandler: (([GKAchievement]?, Error?) -> Void)? = nil) - class func loadAchievements() async throws -> [GKAchievement]? + class func loadAchievements() async throws -> [GKAchievement] class func resetAchievements(completionHandler: ((Error?) -> Void)? = nil) class func resetAchievements() async throws init(identifier: String) diff --git a/macOS/GameKit/GKAchievementDescription.swift b/macOS/GameKit/GKAchievementDescription.swift index 3bb2c97..b4ddfd4 100644 --- a/macOS/GameKit/GKAchievementDescription.swift +++ b/macOS/GameKit/GKAchievementDescription.swift @@ -2,7 +2,7 @@ @available(macOS 10.8, *) class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { class func loadAchievementDescriptions(completionHandler: (([GKAchievementDescription]?, Error?) -> Void)? = nil) - class func loadAchievementDescriptions() async throws -> [GKAchievementDescription]? + class func loadAchievementDescriptions() async throws -> [GKAchievementDescription] var identifier: String { get } @available(macOS 10.8, *) var groupIdentifier: String? { get } @@ -18,7 +18,7 @@ extension GKAchievementDescription { @available(macOS 10.8, *) var image: NSImage? { get } func loadImage(completionHandler: ((NSImage?, Error?) -> Void)? = nil) - func loadImage() async throws -> NSImage? + func loadImage() async throws -> NSImage class func incompleteAchievementImage() -> NSImage class func placeholderCompletedAchievementImage() -> NSImage } diff --git a/macOS/GameKit/GKChallenge.swift b/macOS/GameKit/GKChallenge.swift index a929588..eab199e 100644 --- a/macOS/GameKit/GKChallenge.swift +++ b/macOS/GameKit/GKChallenge.swift @@ -10,7 +10,7 @@ enum GKChallengeState : Int { @available(macOS 10.8, *) class GKChallenge : NSObject, NSCoding, NSSecureCoding { class func loadReceivedChallenges(completionHandler: (([GKChallenge]?, Error?) -> Void)? = nil) - class func loadReceivedChallenges() async throws -> [GKChallenge]? + class func loadReceivedChallenges() async throws -> [GKChallenge] func decline() @available(macOS 10.10, *) @NSCopying var issuingPlayer: GKPlayer? { get } @@ -49,7 +49,7 @@ extension GKAchievement { @available(macOS 10.10, *) func selectChallengeablePlayers(_ players: [GKPlayer], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func selectChallengeablePlayers(_ players: [GKPlayer]) async throws -> [GKPlayer]? + func selectChallengeablePlayers(_ players: [GKPlayer]) async throws -> [GKPlayer] @available(macOS 10.10, *) class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) @@ -65,7 +65,7 @@ extension GKAchievement { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, pass GKPlayers to selectChallengeablePlayers:") func selectChallengeablePlayerIDs(_ playerIDs: [String]?, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, pass GKPlayers to selectChallengeablePlayers:") - func selectChallengeablePlayerIDs(_ playerIDs: [String]?) async throws -> [String]? + func selectChallengeablePlayerIDs(_ playerIDs: [String]?) async throws -> [String] } typealias GKChallengeComposeCompletionBlock = (NSViewController, Bool, [String]?) -> Void extension GKScore { diff --git a/macOS/GameKit/GKCloudPlayer.swift b/macOS/GameKit/GKCloudPlayer.swift index 3b57f51..6e33f74 100644 --- a/macOS/GameKit/GKCloudPlayer.swift +++ b/macOS/GameKit/GKCloudPlayer.swift @@ -2,5 +2,5 @@ @available(macOS, introduced: 10.12, deprecated: 10.14, message: "GKGameSession is deprecated. Use GKPlayer for both real-time and turn-based matchmaking APIs.") class GKCloudPlayer : GKBasePlayer { class func getCurrentSignedInPlayer(forContainer containerName: String?, completionHandler handler: @escaping (GKCloudPlayer?, Error?) -> Void) - class func currentSignedInPlayer(forContainer containerName: String?) async throws -> GKCloudPlayer? + class func currentSignedInPlayer(forContainer containerName: String?) async throws -> GKCloudPlayer } diff --git a/macOS/GameKit/GKGameSession.swift b/macOS/GameKit/GKGameSession.swift index 08259c5..10a9785 100644 --- a/macOS/GameKit/GKGameSession.swift +++ b/macOS/GameKit/GKGameSession.swift @@ -22,19 +22,19 @@ class GKGameSession : NSObject { var maxNumberOfConnectedPlayers: Int { get } var badgedPlayers: [GKCloudPlayer] { get } class func createSession(inContainer containerName: String?, withTitle title: String, maxConnectedPlayers maxPlayers: Int, completionHandler: @escaping (GKGameSession?, Error?) -> Void) - class func createSession(inContainer containerName: String?, withTitle title: String, maxConnectedPlayers maxPlayers: Int) async throws -> GKGameSession? + class func createSession(inContainer containerName: String?, withTitle title: String, maxConnectedPlayers maxPlayers: Int) async throws -> GKGameSession class func loadSessions(inContainer containerName: String?, completionHandler: @escaping ([GKGameSession]?, Error?) -> Void) - class func loadSessions(inContainer containerName: String?) async throws -> [GKGameSession]? + class func loadSessions(inContainer containerName: String?) async throws -> [GKGameSession] class func load(withIdentifier identifier: String, completionHandler: @escaping (GKGameSession?, Error?) -> Void) - class func load(withIdentifier identifier: String) async throws -> GKGameSession? + class func load(withIdentifier identifier: String) async throws -> GKGameSession class func remove(withIdentifier identifier: String, completionHandler: @escaping (Error?) -> Void) class func remove(withIdentifier identifier: String) async throws func getShareURL(completionHandler: @escaping (URL?, Error?) -> Void) - func shareURL() async throws -> URL? + func shareURL() async throws -> URL func loadData(completionHandler: @escaping (Data?, Error?) -> Void) - func loadData() async throws -> Data? + func loadData() async throws -> Data func save(_ data: Data, completionHandler: @escaping (Data?, Error?) -> Void) - func save(_ data: Data) async throws -> Data? + func save(_ data: Data) async throws -> Data func setConnectionState(_ state: GKConnectionState, completionHandler: @escaping (Error?) -> Void) func setConnectionState(_ state: GKConnectionState) async throws func players(with state: GKConnectionState) -> [GKCloudPlayer] diff --git a/macOS/GameKit/GKLeaderboard.swift b/macOS/GameKit/GKLeaderboard.swift index a547091..3715ae5 100644 --- a/macOS/GameKit/GKLeaderboard.swift +++ b/macOS/GameKit/GKLeaderboard.swift @@ -39,11 +39,11 @@ class GKLeaderboard : NSObject { @available(macOS 11.0, *) class func loadLeaderboards(IDs leaderboardIDs: [String]?, completionHandler: @escaping ([GKLeaderboard]?, Error?) -> Void) @available(macOS 11.0, *) - class func loadLeaderboards(IDs leaderboardIDs: [String]?) async throws -> [GKLeaderboard]? + class func loadLeaderboards(IDs leaderboardIDs: [String]?) async throws -> [GKLeaderboard] @available(macOS 11.0, *) func loadPreviousOccurrence(completionHandler: @escaping (GKLeaderboard?, Error?) -> Void) @available(macOS 11.0, *) - func loadPreviousOccurrence() async throws -> GKLeaderboard? + func loadPreviousOccurrence() async throws -> GKLeaderboard @available(macOS 11.0, *) class func submitScore(_ score: Int, context: Int, player: GKPlayer, leaderboardIDs: [String], completionHandler: @escaping (Error?) -> Void) @available(macOS 11.0, *) @@ -55,11 +55,11 @@ class GKLeaderboard : NSObject { @available(macOS 11.0, *) func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange, completionHandler: @escaping (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Int, Error?) -> Void) @available(macOS 11.0, *) - func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange) async throws -> (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Int) + func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange) async throws -> (GKLeaderboard.Entry, [GKLeaderboard.Entry], Int) @available(macOS 11.0, *) func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope, completionHandler: @escaping (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Error?) -> Void) @available(macOS 11.0, *) - func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope) async throws -> (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?) + func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope) async throws -> (GKLeaderboard.Entry, [GKLeaderboard.Entry]) } extension GKLeaderboard { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use identifier instead") @@ -91,15 +91,15 @@ extension GKLeaderboard { @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") func loadScores(completionHandler: (([GKScore]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") - func loadScores() async throws -> [GKScore]? + func loadScores() async throws -> [GKScore] @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") class func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") - class func loadLeaderboards() async throws -> [GKLeaderboard]? + class func loadLeaderboards() async throws -> [GKLeaderboard] } extension GKLeaderboard { @available(macOS 10.8, *) func loadImage(completionHandler: ((NSImage?, Error?) -> Void)? = nil) @available(macOS 10.8, *) - func loadImage() async throws -> NSImage? + func loadImage() async throws -> NSImage } diff --git a/macOS/GameKit/GKLeaderboardSet.swift b/macOS/GameKit/GKLeaderboardSet.swift index 5d54453..ab21acf 100644 --- a/macOS/GameKit/GKLeaderboardSet.swift +++ b/macOS/GameKit/GKLeaderboardSet.swift @@ -7,7 +7,7 @@ class GKLeaderboardSet : NSObject, NSCoding, NSSecureCoding { @available(macOS 10.10, *) class func loadLeaderboardSets(completionHandler: (([GKLeaderboardSet]?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - class func loadLeaderboardSets() async throws -> [GKLeaderboardSet]? + class func loadLeaderboardSets() async throws -> [GKLeaderboardSet] @available(macOS 11.0, *) func loadLeaderboards(handler: @escaping ([GKLeaderboard]?, Error?) -> Void) } @@ -15,9 +15,9 @@ extension GKLeaderboardSet { @available(macOS, introduced: 10.10, deprecated: 11.0, message: "Use loadLeaderboardsWithHandler: instead.") func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.10, deprecated: 11.0, message: "Use loadLeaderboardsWithHandler: instead.") - func loadLeaderboards() async throws -> [GKLeaderboard]? + func loadLeaderboards() async throws -> [GKLeaderboard] } extension GKLeaderboardSet { func loadImage(completionHandler: ((NSImage?, Error?) -> Void)? = nil) - func loadImage() async throws -> NSImage? + func loadImage() async throws -> NSImage } diff --git a/macOS/GameKit/GKLocalPlayer.swift b/macOS/GameKit/GKLocalPlayer.swift index eecba10..723bfde 100644 --- a/macOS/GameKit/GKLocalPlayer.swift +++ b/macOS/GameKit/GKLocalPlayer.swift @@ -13,9 +13,9 @@ class GKLocalPlayer : GKPlayer { @available(macOS 10.11, *) func loadRecentPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(macOS 10.11, *) - func loadRecentPlayers() async throws -> [GKPlayer]? + func loadRecentPlayers() async throws -> [GKPlayer] func loadChallengableFriends(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - func loadChallengableFriends() async throws -> [GKPlayer]? + func loadChallengableFriends() async throws -> [GKPlayer] @available(macOS 10.10, *) func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) @@ -23,11 +23,11 @@ class GKLocalPlayer : GKPlayer { @available(macOS 10.10, *) func loadDefaultLeaderboardIdentifier(completionHandler: ((String?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func loadDefaultLeaderboardIdentifier() async throws -> String? + func loadDefaultLeaderboardIdentifier() async throws -> String @available(macOS 10.15.5, *) func fetchItems(forIdentityVerificationSignature completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(macOS 10.15.5, *) - func fetchItemsForIdentityVerificationSignature() async throws -> (URL?, Data?, Data?, UInt64) + func fetchItemsForIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) } protocol GKLocalPlayerListener : GKChallengeListener, GKInviteEventListener, GKSavedGameListener, GKTurnBasedEventListener { } @@ -51,21 +51,21 @@ extension GKLocalPlayer { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use loadDefaultLeaderboardIdentifierWithCompletionHandler: instead") func loadDefaultLeaderboardCategoryID(completionHandler: ((String?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use loadDefaultLeaderboardIdentifierWithCompletionHandler: instead") - func loadDefaultLeaderboardCategoryID() async throws -> String? + func loadDefaultLeaderboardCategoryID() async throws -> String @available(macOS, introduced: 10.10, deprecated: 10.11) func loadFriendPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.10, deprecated: 10.11) - func loadFriendPlayers() async throws -> [GKPlayer]? + func loadFriendPlayers() async throws -> [GKPlayer] @available(macOS, introduced: 10.10, deprecated: 10.15.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") func generateIdentityVerificationSignature(completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(macOS, introduced: 10.10, deprecated: 10.15.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") - func generateIdentityVerificationSignature() async throws -> (URL?, Data?, Data?, UInt64) + func generateIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) } extension GKLocalPlayer { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") func loadFriends(completionHandler: (([String]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") - func loadFriends() async throws -> [String]? + func loadFriends() async throws -> [String] @available(macOS, introduced: 10.8, deprecated: 10.10, message: " This property is obsolete, Use loadFriendPlayersWithCompletionHandler: instead") var friends: [String]? { get } } diff --git a/macOS/GameKit/GKMatch.swift b/macOS/GameKit/GKMatch.swift index 55bf16b..cd60221 100644 --- a/macOS/GameKit/GKMatch.swift +++ b/macOS/GameKit/GKMatch.swift @@ -32,7 +32,7 @@ class GKMatch : NSObject { @available(macOS 10.9, *) func rematch(completionHandler: ((GKMatch?, Error?) -> Void)? = nil) @available(macOS 10.9, *) - func rematch() async throws -> GKMatch? + func rematch() async throws -> GKMatch } protocol GKMatchDelegate : NSObjectProtocol { @available(macOS 10.10, *) diff --git a/macOS/GameKit/GKMatchmaker.swift b/macOS/GameKit/GKMatchmaker.swift index 215539a..8657aa9 100644 --- a/macOS/GameKit/GKMatchmaker.swift +++ b/macOS/GameKit/GKMatchmaker.swift @@ -70,13 +70,13 @@ class GKMatchmaker : NSObject { @available(macOS 10.9, *) func match(for invite: GKInvite, completionHandler: ((GKMatch?, Error?) -> Void)? = nil) @available(macOS 10.9, *) - func match(for invite: GKInvite) async throws -> GKMatch? + func match(for invite: GKInvite) async throws -> GKMatch func findMatch(for request: GKMatchRequest, withCompletionHandler completionHandler: ((GKMatch?, Error?) -> Void)? = nil) - func findMatch(for request: GKMatchRequest) async throws -> GKMatch? + func findMatch(for request: GKMatchRequest) async throws -> GKMatch @available(macOS 10.10, *) func findPlayers(forHostedRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func findPlayers(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer]? + func findPlayers(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer] func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest, completionHandler: ((Error?) -> Void)? = nil) func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest) async throws func cancel() @@ -105,5 +105,5 @@ extension GKMatchmaker { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") func findPlayers(forHostedMatchRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") - func findPlayers(forHostedMatchRequest request: GKMatchRequest) async throws -> [String]? + func findPlayers(forHostedMatchRequest request: GKMatchRequest) async throws -> [String] } diff --git a/macOS/GameKit/GKPlayer.swift b/macOS/GameKit/GKPlayer.swift index 514c3f9..6aa9b2a 100644 --- a/macOS/GameKit/GKPlayer.swift +++ b/macOS/GameKit/GKPlayer.swift @@ -4,7 +4,7 @@ let GKPlayerIDNoLongerAvailable: String @available(macOS 10.8, *) class GKPlayer : GKBasePlayer { class func loadPlayers(forIdentifiers identifiers: [String], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer]? + class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] @available(macOS 10.15, *) func scopedIDsArePersistent() -> Bool @available(macOS 10.14.6, *) @@ -23,7 +23,7 @@ extension GKPlayer { @available(macOS 10.8, *) func loadPhoto(for size: GKPlayer.PhotoSize, withCompletionHandler completionHandler: ((NSImage?, Error?) -> Void)? = nil) @available(macOS 10.8, *) - func loadPhoto(for size: GKPlayer.PhotoSize) async throws -> NSImage? + func loadPhoto(for size: GKPlayer.PhotoSize) async throws -> NSImage } extension GKPlayer { enum PhotoSize : Int { diff --git a/macOS/GameKit/GKSavedGame.swift b/macOS/GameKit/GKSavedGame.swift index d9ec251..c8a723d 100644 --- a/macOS/GameKit/GKSavedGame.swift +++ b/macOS/GameKit/GKSavedGame.swift @@ -10,17 +10,17 @@ class GKSavedGame : NSObject, NSCopying { @available(macOS 10.10, *) func loadData(completionHandler handler: ((Data?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func loadData() async throws -> Data? + func loadData() async throws -> Data } extension GKLocalPlayer : GKSavedGameListener { @available(macOS 10.10, *) func fetchSavedGames(completionHandler handler: (([GKSavedGame]?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func fetchSavedGames() async throws -> [GKSavedGame]? + func fetchSavedGames() async throws -> [GKSavedGame] @available(macOS 10.10, *) func saveGameData(_ data: Data, withName name: String, completionHandler handler: ((GKSavedGame?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func saveGameData(_ data: Data, withName name: String) async throws -> GKSavedGame? + func saveGameData(_ data: Data, withName name: String) async throws -> GKSavedGame @available(macOS 10.10, *) func deleteSavedGames(withName name: String, completionHandler handler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) @@ -28,5 +28,5 @@ extension GKLocalPlayer : GKSavedGameListener { @available(macOS 10.10, *) func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data, completionHandler handler: (([GKSavedGame]?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data) async throws -> [GKSavedGame]? + func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data) async throws -> [GKSavedGame] } diff --git a/macOS/GameKit/GKTurnBasedMatch.swift b/macOS/GameKit/GKTurnBasedMatch.swift index 9af52d6..e0beb94 100644 --- a/macOS/GameKit/GKTurnBasedMatch.swift +++ b/macOS/GameKit/GKTurnBasedMatch.swift @@ -94,21 +94,21 @@ class GKTurnBasedMatch : NSObject { @available(macOS 10.10, *) var exchangeMaxInitiatedExchangesPerPlayer: Int { get } class func find(for request: GKMatchRequest, withCompletionHandler completionHandler: @escaping (GKTurnBasedMatch?, Error?) -> Void) - class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch? + class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch class func loadMatches(completionHandler: (([GKTurnBasedMatch]?, Error?) -> Void)? = nil) - class func loadMatches() async throws -> [GKTurnBasedMatch]? + class func loadMatches() async throws -> [GKTurnBasedMatch] @available(macOS 10.8, *) class func load(withID matchID: String, withCompletionHandler completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(macOS 10.8, *) - class func load(withID matchID: String) async throws -> GKTurnBasedMatch? + class func load(withID matchID: String) async throws -> GKTurnBasedMatch @available(macOS 10.9, *) func rematch(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(macOS 10.9, *) - func rematch() async throws -> GKTurnBasedMatch? + func rematch() async throws -> GKTurnBasedMatch @available(macOS 10.8, *) func acceptInvite(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(macOS 10.8, *) - func acceptInvite() async throws -> GKTurnBasedMatch? + func acceptInvite() async throws -> GKTurnBasedMatch @available(macOS 10.8, *) func declineInvite(completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) @@ -116,7 +116,7 @@ class GKTurnBasedMatch : NSObject { func remove(completionHandler: ((Error?) -> Void)? = nil) func remove() async throws func loadMatchData(completionHandler: ((Data?, Error?) -> Void)? = nil) - func loadMatchData() async throws -> Data? + func loadMatchData() async throws -> Data @available(macOS 10.9, *) func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.9, *) @@ -148,7 +148,7 @@ class GKTurnBasedMatch : NSObject { @available(macOS 10.10, *) func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval, completionHandler: ((GKTurnBasedExchange?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange? + func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange @available(macOS 10.10, *) func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) diff --git a/macOS/ImageCaptureCore/ICCameraFile.swift b/macOS/ImageCaptureCore/ICCameraFile.swift index e4a0324..8caf555 100644 --- a/macOS/ImageCaptureCore/ICCameraFile.swift +++ b/macOS/ImageCaptureCore/ICCameraFile.swift @@ -50,15 +50,15 @@ class ICCameraFile : ICCameraItem { @available(macOS 10.15, *) func requestThumbnailData(options: [ICCameraItemThumbnailOption : Any]? = nil, completion: @escaping (Data?, Error?) -> Void) @available(macOS 10.15, *) - func requestThumbnailData(options: [ICCameraItemThumbnailOption : Any]? = nil) async throws -> Data? + func requestThumbnailData(options: [ICCameraItemThumbnailOption : Any]? = nil) async throws -> Data @available(macOS 10.15, *) func requestMetadataDictionary(options: [ICCameraItemMetadataOption : Any]? = nil, completion: @escaping ([AnyHashable : Any]?, Error?) -> Void) @available(macOS 10.15, *) - func requestMetadataDictionary(options: [ICCameraItemMetadataOption : Any]? = nil) async throws -> [AnyHashable : Any]? + func requestMetadataDictionary(options: [ICCameraItemMetadataOption : Any]? = nil) async throws -> [AnyHashable : Any] @available(macOS 10.15, *) func requestDownload(options: [ICDownloadOption : Any]? = nil, completion: @escaping (String?, Error?) -> Void) -> Progress? @available(macOS 10.15, *) func requestReadData(atOffset offset: off_t, length: off_t, completion: @escaping (Data?, Error?) -> Void) @available(macOS 10.15, *) - func requestReadData(atOffset offset: off_t, length: off_t) async throws -> Data? + func requestReadData(atOffset offset: off_t, length: off_t) async throws -> Data } diff --git a/macOS/LinkPresentation/LPMetadataProvider.swift b/macOS/LinkPresentation/LPMetadataProvider.swift index 19e479b..44a9dd3 100644 --- a/macOS/LinkPresentation/LPMetadataProvider.swift +++ b/macOS/LinkPresentation/LPMetadataProvider.swift @@ -2,7 +2,7 @@ @available(macOS 10.15, *) class LPMetadataProvider : NSObject { func startFetchingMetadata(for URL: URL, completionHandler: @escaping (LPLinkMetadata?, Error?) -> Void) - func startFetchingMetadata(for URL: URL) async throws -> LPLinkMetadata? + func startFetchingMetadata(for URL: URL) async throws -> LPLinkMetadata func cancel() var shouldFetchSubresources: Bool var timeout: TimeInterval diff --git a/macOS/MapKit/MKDirections.swift b/macOS/MapKit/MKDirections.swift index 704d4b7..871d059 100644 --- a/macOS/MapKit/MKDirections.swift +++ b/macOS/MapKit/MKDirections.swift @@ -7,9 +7,9 @@ extension MKDirections { class MKDirections : NSObject { init(request: MKDirections.Request) func calculate(completionHandler: @escaping MKDirections.DirectionsHandler) - func calculate() async throws -> MKDirections.Response? + func calculate() async throws -> MKDirections.Response func calculateETA(completionHandler: @escaping MKDirections.ETAHandler) - func calculateETA() async throws -> MKDirections.ETAResponse? + func calculateETA() async throws -> MKDirections.ETAResponse func cancel() var isCalculating: Bool { get } } diff --git a/macOS/MapKit/MKLocalSearch.swift b/macOS/MapKit/MKLocalSearch.swift index 6af85a2..4ada9a0 100644 --- a/macOS/MapKit/MKLocalSearch.swift +++ b/macOS/MapKit/MKLocalSearch.swift @@ -8,7 +8,7 @@ class MKLocalSearch : NSObject { @available(macOS 11.0, *) init(request: MKLocalPointsOfInterestRequest) func start(completionHandler: @escaping MKLocalSearch.CompletionHandler) - func start() async throws -> MKLocalSearch.Response? + func start() async throws -> MKLocalSearch.Response func cancel() var isSearching: Bool { get } } diff --git a/macOS/MapKit/MKMapSnapshotter.swift b/macOS/MapKit/MKMapSnapshotter.swift index f144d89..0b96043 100644 --- a/macOS/MapKit/MKMapSnapshotter.swift +++ b/macOS/MapKit/MKMapSnapshotter.swift @@ -6,9 +6,9 @@ extension MKMapSnapshotter { class MKMapSnapshotter : NSObject { init(options: MKMapSnapshotter.Options) func start(completionHandler: @escaping MKMapSnapshotter.CompletionHandler) - func start() async throws -> MKMapSnapshotter.Snapshot? + func start() async throws -> MKMapSnapshotter.Snapshot func start(with queue: DispatchQueue, completionHandler: @escaping MKMapSnapshotter.CompletionHandler) - func start(with queue: DispatchQueue) async throws -> MKMapSnapshotter.Snapshot? + func start(with queue: DispatchQueue) async throws -> MKMapSnapshotter.Snapshot func cancel() var isLoading: Bool { get } } diff --git a/macOS/Metal/MTLDevice.swift b/macOS/Metal/MTLDevice.swift index 9576a78..69ec5bf 100644 --- a/macOS/Metal/MTLDevice.swift +++ b/macOS/Metal/MTLDevice.swift @@ -219,25 +219,25 @@ protocol MTLDevice : NSObjectProtocol { func makeLibrary(data: __DispatchData) throws -> MTLLibrary func makeLibrary(source: String, options: MTLCompileOptions?) throws -> MTLLibrary func makeLibrary(source: String, options: MTLCompileOptions?, completionHandler: @escaping MTLNewLibraryCompletionHandler) - func makeLibrary(source: String, options: MTLCompileOptions?) async throws -> MTLLibrary? + func makeLibrary(source: String, options: MTLCompileOptions?) async throws -> MTLLibrary func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor) throws -> MTLRenderPipelineState func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer?) throws -> MTLRenderPipelineState func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, completionHandler: @escaping MTLNewRenderPipelineStateCompletionHandler) - func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor) async throws -> MTLRenderPipelineState? + func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor) async throws -> MTLRenderPipelineState func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption, completionHandler: @escaping MTLNewRenderPipelineStateWithReflectionCompletionHandler) - func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLRenderPipelineState?, MTLRenderPipelineReflection?) + func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLRenderPipelineState, MTLRenderPipelineReflection) func makeComputePipelineState(function computeFunction: MTLFunction) throws -> MTLComputePipelineState func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer?) throws -> MTLComputePipelineState func makeComputePipelineState(function computeFunction: MTLFunction, completionHandler: @escaping MTLNewComputePipelineStateCompletionHandler) - func makeComputePipelineState(function computeFunction: MTLFunction) async throws -> MTLComputePipelineState? + func makeComputePipelineState(function computeFunction: MTLFunction) async throws -> MTLComputePipelineState func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption, completionHandler: @escaping MTLNewComputePipelineStateWithReflectionCompletionHandler) - func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption) async throws -> (MTLComputePipelineState?, MTLComputePipelineReflection?) + func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption) async throws -> (MTLComputePipelineState, MTLComputePipelineReflection) @available(macOS 10.11, *) func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer?) throws -> MTLComputePipelineState @available(macOS 10.11, *) func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption, completionHandler: @escaping MTLNewComputePipelineStateWithReflectionCompletionHandler) @available(macOS 10.11, *) - func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLComputePipelineState?, MTLComputePipelineReflection?) + func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLComputePipelineState, MTLComputePipelineReflection) @available(macOS 10.13, *) func makeFence() -> MTLFence? func supportsFeatureSet(_ featureSet: MTLFeatureSet) -> Bool @@ -254,7 +254,7 @@ protocol MTLDevice : NSObjectProtocol { @available(macOS 11.0, *) func makeRenderPipelineState(tileDescriptor descriptor: MTLTileRenderPipelineDescriptor, options: MTLPipelineOption, completionHandler: @escaping MTLNewRenderPipelineStateWithReflectionCompletionHandler) @available(macOS 11.0, *) - func makeRenderPipelineState(tileDescriptor descriptor: MTLTileRenderPipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLRenderPipelineState?, MTLRenderPipelineReflection?) + func makeRenderPipelineState(tileDescriptor descriptor: MTLTileRenderPipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLRenderPipelineState, MTLRenderPipelineReflection) @available(macOS 10.13, *) var maxThreadgroupMemoryLength: Int { get } @available(macOS 10.14, *) diff --git a/macOS/Metal/MTLLibrary.swift b/macOS/Metal/MTLLibrary.swift index f78427a..f9e71ad 100644 --- a/macOS/Metal/MTLLibrary.swift +++ b/macOS/Metal/MTLLibrary.swift @@ -138,17 +138,17 @@ protocol MTLLibrary : NSObjectProtocol { @available(macOS 10.12, *) func makeFunction(name: String, constantValues: MTLFunctionConstantValues, completionHandler: @escaping (MTLFunction?, Error?) -> Void) @available(macOS 10.12, *) - func makeFunction(name: String, constantValues: MTLFunctionConstantValues) async throws -> MTLFunction? + func makeFunction(name: String, constantValues: MTLFunctionConstantValues) async throws -> MTLFunction @available(macOS 11.0, *) func makeFunction(descriptor: MTLFunctionDescriptor, completionHandler: @escaping (MTLFunction?, Error?) -> Void) @available(macOS 11.0, *) - func makeFunction(descriptor: MTLFunctionDescriptor) async throws -> MTLFunction? + func makeFunction(descriptor: MTLFunctionDescriptor) async throws -> MTLFunction @available(macOS 11.0, *) func makeFunction(descriptor: MTLFunctionDescriptor) throws -> MTLFunction @available(macOS 11.0, *) func makeIntersectionFunction(descriptor: MTLIntersectionFunctionDescriptor, completionHandler: @escaping (MTLFunction?, Error?) -> Void) @available(macOS 11.0, *) - func makeIntersectionFunction(descriptor: MTLIntersectionFunctionDescriptor) async throws -> MTLFunction? + func makeIntersectionFunction(descriptor: MTLIntersectionFunctionDescriptor) async throws -> MTLFunction @available(macOS 11.0, *) func makeIntersectionFunction(descriptor: MTLIntersectionFunctionDescriptor) throws -> MTLFunction var functionNames: [String] { get } diff --git a/macOS/MetalKit/MTKTextureLoader.swift b/macOS/MetalKit/MTKTextureLoader.swift index d33200c..19044f5 100644 --- a/macOS/MetalKit/MTKTextureLoader.swift +++ b/macOS/MetalKit/MTKTextureLoader.swift @@ -65,15 +65,15 @@ class MTKTextureLoader : NSObject { var device: MTLDevice { get } init(device: MTLDevice) func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) - func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture @available(macOS 10.12, *) func newTexture(name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) @available(macOS 10.12, *) - func newTexture(name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + func newTexture(name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture @available(macOS 10.12, *) func newTexture(name: String, scaleFactor: CGFloat, displayGamut: NSDisplayGamut, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) @available(macOS 10.12, *) - func newTexture(name: String, scaleFactor: CGFloat, displayGamut: NSDisplayGamut, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + func newTexture(name: String, scaleFactor: CGFloat, displayGamut: NSDisplayGamut, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture @available(macOS 10.12, *) func newTextures(URLs: [URL], options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.ArrayCallback) @available(macOS 10.12, *) @@ -87,13 +87,13 @@ class MTKTextureLoader : NSObject { @available(macOS 10.12, *) func newTextures(names: [String], scaleFactor: CGFloat, displayGamut: NSDisplayGamut, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> [MTLTexture] func newTexture(data: Data, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) - func newTexture(data: Data, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + func newTexture(data: Data, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture func newTexture(cgImage: CGImage, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) - func newTexture(cgImage: CGImage, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + func newTexture(cgImage: CGImage, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture @available(macOS 10.12, *) func newTexture(texture: MDLTexture, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) @available(macOS 10.12, *) - func newTexture(texture: MDLTexture, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + func newTexture(texture: MDLTexture, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil) throws -> MTLTexture @available(macOS 10.12, *) func newTextures(URLs: [URL], options: [MTKTextureLoader.Option : Any]? = nil, error: NSErrorPointer) -> [MTLTexture] diff --git a/macOS/MultipeerConnectivity/MCSession.swift b/macOS/MultipeerConnectivity/MCSession.swift index 5f502b4..cfdeffd 100644 --- a/macOS/MultipeerConnectivity/MCSession.swift +++ b/macOS/MultipeerConnectivity/MCSession.swift @@ -56,7 +56,7 @@ protocol MCSessionDelegate : NSObjectProtocol { } extension MCSession { func nearbyConnectionData(forPeer peerID: MCPeerID, withCompletionHandler completionHandler: @escaping (Data?, Error?) -> Void) - func nearbyConnectionData(forPeer peerID: MCPeerID) async throws -> Data? + func nearbyConnectionData(forPeer peerID: MCPeerID) async throws -> Data func connectPeer(_ peerID: MCPeerID, withNearbyConnectionData data: Data) func cancelConnectPeer(_ peerID: MCPeerID) } diff --git a/macOS/NetworkExtension/NetworkExtension.swift b/macOS/NetworkExtension/NetworkExtension.swift index 1b98cdc..b1e8381 100644 --- a/macOS/NetworkExtension/NetworkExtension.swift +++ b/macOS/NetworkExtension/NetworkExtension.swift @@ -203,7 +203,7 @@ class NETunnelProviderManager : NEVPNManager { @available(macOS 10.11, *) class func loadAllFromPreferences(completionHandler: @escaping ([NETunnelProviderManager]?, Error?) -> Void) @available(macOS 10.11, *) - class func loadAllFromPreferences() async throws -> [NETunnelProviderManager]? + class func loadAllFromPreferences() async throws -> [NETunnelProviderManager] @available(macOS 10.15.4, *) class func forPerAppVPN() -> Self @available(macOS 10.11, *) @@ -233,7 +233,7 @@ class NEAppProxyTCPFlow : NEAppProxyFlow { @available(macOS 10.11, *) func readData(completionHandler: @escaping (Data?, Error?) -> Void) @available(macOS 10.11, *) - func readData() async throws -> Data? + func readData() async throws -> Data @available(macOS 10.11, *) func write(_ data: Data, withCompletionHandler completionHandler: @escaping (Error?) -> Void) @available(macOS 10.11, *) @@ -246,7 +246,7 @@ class NEAppProxyUDPFlow : NEAppProxyFlow { @available(macOS 10.11, *) func readDatagrams(completionHandler: @escaping ([Data]?, [NWEndpoint]?, Error?) -> Void) @available(macOS 10.11, *) - func readDatagrams() async throws -> ([Data]?, [NWEndpoint]?) + func readDatagrams() async throws -> ([Data], [NWEndpoint]) @available(macOS 10.11, *) func writeDatagrams(_ datagrams: [Data], sentBy remoteEndpoints: [NWEndpoint], completionHandler: @escaping (Error?) -> Void) @available(macOS 10.11, *) @@ -980,7 +980,7 @@ class NETransparentProxyManager : NEVPNManager { @available(macOS 10.15, *) class func loadAllFromPreferences(completionHandler: @escaping ([NETransparentProxyManager]?, Error?) -> Void) @available(macOS 10.15, *) - class func loadAllFromPreferences() async throws -> [NETransparentProxyManager]? + class func loadAllFromPreferences() async throws -> [NETransparentProxyManager] } @available(macOS 10.15, *) class NETransparentProxyNetworkSettings : NETunnelNetworkSettings { @@ -1257,11 +1257,11 @@ class NWTCPConnection : NSObject { @available(macOS 10.11, *) func readLength(_ length: Int, completionHandler completion: @escaping (Data?, Error?) -> Void) @available(macOS 10.11, *) - func readLength(_ length: Int) async throws -> Data? + func readLength(_ length: Int) async throws -> Data @available(macOS 10.11, *) func readMinimumLength(_ minimum: Int, maximumLength maximum: Int, completionHandler completion: @escaping (Data?, Error?) -> Void) @available(macOS 10.11, *) - func readMinimumLength(_ minimum: Int, maximumLength maximum: Int) async throws -> Data? + func readMinimumLength(_ minimum: Int, maximumLength maximum: Int) async throws -> Data @available(macOS 10.11, *) func write(_ data: Data, completionHandler completion: @escaping (Error?) -> Void) @available(macOS 10.11, *) diff --git a/macOS/PassKit/PKAddShareablePassConfiguration.swift b/macOS/PassKit/PKAddShareablePassConfiguration.swift index 9dbabf8..a14c7e8 100644 --- a/macOS/PassKit/PKAddShareablePassConfiguration.swift +++ b/macOS/PassKit/PKAddShareablePassConfiguration.swift @@ -16,7 +16,7 @@ enum PKAddShareablePassConfigurationPrimaryAction : UInt { } class PKAddShareablePassConfiguration : PKAddSecureElementPassConfiguration { class func forPassMetaData(_ passMetadata: [PKShareablePassMetadata], provisioningPolicyIdentifier: String, action: PKAddShareablePassConfigurationPrimaryAction, completion: @escaping (PKAddShareablePassConfiguration?, Error?) -> Void) - class func forPassMetaData(_ passMetadata: [PKShareablePassMetadata], provisioningPolicyIdentifier: String, action: PKAddShareablePassConfigurationPrimaryAction) async throws -> PKAddShareablePassConfiguration? + class func forPassMetaData(_ passMetadata: [PKShareablePassMetadata], provisioningPolicyIdentifier: String, action: PKAddShareablePassConfigurationPrimaryAction) async throws -> PKAddShareablePassConfiguration var primaryAction: PKAddShareablePassConfigurationPrimaryAction { get } var credentialsMetadata: [PKShareablePassMetadata] { get } var provisioningPolicyIdentifier: String { get } diff --git a/macOS/PassKit/PKPassLibrary.swift b/macOS/PassKit/PKPassLibrary.swift index 5709d1a..96f3d24 100644 --- a/macOS/PassKit/PKPassLibrary.swift +++ b/macOS/PassKit/PKPassLibrary.swift @@ -55,7 +55,7 @@ class PKPassLibrary : NSObject { func activate(_ secureElementPass: PKSecureElementPass, activationData: Data, completion: ((Bool, Error?) -> Void)? = nil) func activate(_ secureElementPass: PKSecureElementPass, activationData: Data) async throws -> Bool func sign(_ signData: Data, using secureElementPass: PKSecureElementPass, completion: @escaping (Data?, Data?, Error?) -> Void) - func sign(_ signData: Data, using secureElementPass: PKSecureElementPass) async throws -> (Data?, Data?) + func sign(_ signData: Data, using secureElementPass: PKSecureElementPass) async throws -> (Data, Data) } struct PKPassLibraryNotificationName : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable { init(_ rawValue: String) diff --git a/macOS/Photos/PHLivePhotoEditingContext.swift b/macOS/Photos/PHLivePhotoEditingContext.swift index 8f8fa04..00fe3a9 100644 --- a/macOS/Photos/PHLivePhotoEditingContext.swift +++ b/macOS/Photos/PHLivePhotoEditingContext.swift @@ -26,7 +26,7 @@ class PHLivePhotoEditingContext : NSObject { @available(macOS 10.12, *) func prepareLivePhotoForPlayback(withTargetSize targetSize: CGSize, options: [String : Any]? = nil, completionHandler handler: @escaping (PHLivePhoto?, Error?) -> Void) @available(macOS 10.12, *) - func prepareLivePhotoForPlayback(withTargetSize targetSize: CGSize, options: [String : Any]? = nil) async throws -> PHLivePhoto? + func prepareLivePhotoForPlayback(withTargetSize targetSize: CGSize, options: [String : Any]? = nil) async throws -> PHLivePhoto @available(macOS 10.12, *) func saveLivePhoto(to output: PHContentEditingOutput, options: [String : Any]? = nil, completionHandler handler: @escaping (Bool, Error?) -> Void) @available(macOS 10.12, *) diff --git a/macOS/QuickLookThumbnailing/QLThumbnailGenerator.swift b/macOS/QuickLookThumbnailing/QLThumbnailGenerator.swift index cec5162..feca539 100644 --- a/macOS/QuickLookThumbnailing/QLThumbnailGenerator.swift +++ b/macOS/QuickLookThumbnailing/QLThumbnailGenerator.swift @@ -3,7 +3,7 @@ class QLThumbnailGenerator : NSObject { class var shared: QLThumbnailGenerator { get } func generateBestRepresentation(for request: QLThumbnailGenerator.Request, completion completionHandler: @escaping (QLThumbnailRepresentation?, Error?) -> Void) - func generateBestRepresentation(for request: QLThumbnailGenerator.Request) async throws -> QLThumbnailRepresentation? + func generateBestRepresentation(for request: QLThumbnailGenerator.Request) async throws -> QLThumbnailRepresentation func generateRepresentations(for request: QLThumbnailGenerator.Request, update updateHandler: ((QLThumbnailRepresentation?, QLThumbnailRepresentation.RepresentationType, Error?) -> Void)? = nil) func cancel(_ request: QLThumbnailGenerator.Request) func saveBestRepresentation(for request: QLThumbnailGenerator.Request, to fileURL: URL, contentType: String, completion completionHandler: @escaping (Error?) -> Void) diff --git a/macOS/ReplayKit/RPBroadcast.swift b/macOS/ReplayKit/RPBroadcast.swift index 02b3f0a..818bb27 100644 --- a/macOS/ReplayKit/RPBroadcast.swift +++ b/macOS/ReplayKit/RPBroadcast.swift @@ -3,7 +3,7 @@ class RPBroadcastActivityController : NSObject { @available(macOS 11.0, *) class func showBroadcastPicker(at point: CGPoint, from window: NSWindow?, preferredExtensionIdentifier preferredExtension: String?, completionHandler handler: @escaping (RPBroadcastActivityController?, Error?) -> Void) @available(macOS 11.0, *) - class func showBroadcastPicker(at point: CGPoint, from window: NSWindow?, preferredExtensionIdentifier preferredExtension: String?) async throws -> RPBroadcastActivityController? + class func showBroadcastPicker(at point: CGPoint, from window: NSWindow?, preferredExtensionIdentifier preferredExtension: String?) async throws -> RPBroadcastActivityController weak var delegate: @sil_weak RPBroadcastActivityControllerDelegate? } @available(macOS 11.0, *) diff --git a/macOS/SafariServices/SFContentBlockerManager.swift b/macOS/SafariServices/SFContentBlockerManager.swift index 114cd1d..0bb2c87 100644 --- a/macOS/SafariServices/SFContentBlockerManager.swift +++ b/macOS/SafariServices/SFContentBlockerManager.swift @@ -3,5 +3,5 @@ class SFContentBlockerManager : NSObject { class func reloadContentBlocker(withIdentifier identifier: String, completionHandler: ((Error?) -> Void)? = nil) class func reloadContentBlocker(withIdentifier identifier: String) async throws class func getStateOfContentBlocker(withIdentifier identifier: String, completionHandler: @escaping (SFContentBlockerState?, Error?) -> Void) - class func stateOfContentBlocker(withIdentifier identifier: String) async throws -> SFContentBlockerState? + class func stateOfContentBlocker(withIdentifier identifier: String) async throws -> SFContentBlockerState } diff --git a/macOS/SafariServices/SFSafariExtensionManager.swift b/macOS/SafariServices/SFSafariExtensionManager.swift index 364ea07..cbc6c22 100644 --- a/macOS/SafariServices/SFSafariExtensionManager.swift +++ b/macOS/SafariServices/SFSafariExtensionManager.swift @@ -1,5 +1,5 @@ class SFSafariExtensionManager : NSObject { class func getStateOfSafariExtension(withIdentifier identifier: String, completionHandler: @escaping (SFSafariExtensionState?, Error?) -> Void) - class func stateOfSafariExtension(withIdentifier identifier: String) async throws -> SFSafariExtensionState? + class func stateOfSafariExtension(withIdentifier identifier: String) async throws -> SFSafariExtensionState } diff --git a/macOS/StoreKit/SKCloudServiceController.swift b/macOS/StoreKit/SKCloudServiceController.swift index 7312150..bbe3982 100644 --- a/macOS/StoreKit/SKCloudServiceController.swift +++ b/macOS/StoreKit/SKCloudServiceController.swift @@ -28,15 +28,15 @@ class SKCloudServiceController : NSObject { @available(macOS 11.0, *) func requestCapabilities() async throws -> SKCloudServiceCapability func requestStorefrontCountryCode(completionHandler: @escaping (String?, Error?) -> Void) - func requestStorefrontCountryCode() async throws -> String? + func requestStorefrontCountryCode() async throws -> String @available(macOS 11.0, *) func requestStorefrontIdentifier(completionHandler: @escaping (String?, Error?) -> Void) @available(macOS 11.0, *) - func requestStorefrontIdentifier() async throws -> String? + func requestStorefrontIdentifier() async throws -> String @available(macOS 11.0, *) func requestUserToken(forDeveloperToken developerToken: String, completionHandler: @escaping (String?, Error?) -> Void) @available(macOS 11.0, *) - func requestUserToken(forDeveloperToken developerToken: String) async throws -> String? + func requestUserToken(forDeveloperToken developerToken: String) async throws -> String } extension NSNotification.Name { @available(macOS 11.0, *) diff --git a/macOS/Virtualization/VZVirtioSocketDevice.swift b/macOS/Virtualization/VZVirtioSocketDevice.swift index 96cf034..a79ae29 100644 --- a/macOS/Virtualization/VZVirtioSocketDevice.swift +++ b/macOS/Virtualization/VZVirtioSocketDevice.swift @@ -4,7 +4,7 @@ class VZVirtioSocketDevice : VZSocketDevice { func setSocketListener(_ listener: VZVirtioSocketListener, forPort port: UInt32) func removeSocketListener(forPort port: UInt32) func __connect(toPort port: UInt32, completionHandler: @escaping (VZVirtioSocketConnection?, Error?) -> Void) - func __connect(toPort port: UInt32) async throws -> VZVirtioSocketConnection? + func __connect(toPort port: UInt32) async throws -> VZVirtioSocketConnection } extension VZVirtioSocketDevice { diff --git a/macOS/WebKit/NSAttributedString.swift b/macOS/WebKit/NSAttributedString.swift index 8163fab..bf0575b 100644 --- a/macOS/WebKit/NSAttributedString.swift +++ b/macOS/WebKit/NSAttributedString.swift @@ -11,17 +11,17 @@ extension NSAttributedString { @available(macOS 10.15, *) class func loadFromHTML(request: URLRequest, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], completionHandler: @escaping NSAttributedString.CompletionHandler) @available(macOS 10.15, *) - class func loadFromHTML(request: URLRequest, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString?, [NSAttributedString.DocumentAttributeKey : Any]?) + class func loadFromHTML(request: URLRequest, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString, [NSAttributedString.DocumentAttributeKey : Any]) @available(macOS 10.15, *) class func loadFromHTML(fileURL: URL, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], completionHandler: @escaping NSAttributedString.CompletionHandler) @available(macOS 10.15, *) - class func loadFromHTML(fileURL: URL, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString?, [NSAttributedString.DocumentAttributeKey : Any]?) + class func loadFromHTML(fileURL: URL, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString, [NSAttributedString.DocumentAttributeKey : Any]) @available(macOS 10.15, *) class func loadFromHTML(string: String, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], completionHandler: @escaping NSAttributedString.CompletionHandler) @available(macOS 10.15, *) - class func loadFromHTML(string: String, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString?, [NSAttributedString.DocumentAttributeKey : Any]?) + class func loadFromHTML(string: String, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString, [NSAttributedString.DocumentAttributeKey : Any]) @available(macOS 10.15, *) class func loadFromHTML(data: Data, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], completionHandler: @escaping NSAttributedString.CompletionHandler) @available(macOS 10.15, *) - class func loadFromHTML(data: Data, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString?, [NSAttributedString.DocumentAttributeKey : Any]?) + class func loadFromHTML(data: Data, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:]) async throws -> (NSAttributedString, [NSAttributedString.DocumentAttributeKey : Any]) } diff --git a/macOS/WebKit/WKContentRuleListStore.swift b/macOS/WebKit/WKContentRuleListStore.swift index a686971..e4519c6 100644 --- a/macOS/WebKit/WKContentRuleListStore.swift +++ b/macOS/WebKit/WKContentRuleListStore.swift @@ -4,9 +4,9 @@ class WKContentRuleListStore : NSObject { class func `default`() -> Self! convenience init!(url: URL!) func compileContentRuleList(forIdentifier identifier: String!, encodedContentRuleList: String!, completionHandler: ((WKContentRuleList?, Error?) -> Void)!) - func compileContentRuleList(forIdentifier identifier: String!, encodedContentRuleList: String!) async throws -> WKContentRuleList? + func compileContentRuleList(forIdentifier identifier: String!, encodedContentRuleList: String!) async throws -> WKContentRuleList func lookUpContentRuleList(forIdentifier identifier: String!, completionHandler: ((WKContentRuleList?, Error?) -> Void)!) - func lookUpContentRuleList(forIdentifier identifier: String!) async throws -> WKContentRuleList? + func lookUpContentRuleList(forIdentifier identifier: String!) async throws -> WKContentRuleList func removeContentRuleList(forIdentifier identifier: String!, completionHandler: ((Error?) -> Void)!) func removeContentRuleList(forIdentifier identifier: String!) async throws func getAvailableContentRuleListIdentifiers(_ completionHandler: (([String]?) -> Void)!) diff --git a/macOS/WebKit/WKWebView.swift b/macOS/WebKit/WKWebView.swift index beec324..a2e4039 100644 --- a/macOS/WebKit/WKWebView.swift +++ b/macOS/WebKit/WKWebView.swift @@ -28,23 +28,23 @@ class WKWebView : NSView { func reloadFromOrigin() -> WKNavigation? func stopLoading() func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, Error?) -> Void)? = nil) - func evaluateJavaScript(_ javaScriptString: String) async throws -> Any? + func evaluateJavaScript(_ javaScriptString: String) async throws -> Any @available(macOS 11.0, *) func __evaluateJavaScript(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld, completionHandler: ((Any?, Error?) -> Void)? = nil) @available(macOS 11.0, *) - func __evaluateJavaScript(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any? + func __evaluateJavaScript(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any @available(macOS 11.0, *) func __callAsyncJavaScript(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld, completionHandler: ((Any?, Error?) -> Void)? = nil) @available(macOS 11.0, *) - func __callAsyncJavaScript(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any? + func __callAsyncJavaScript(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any @available(macOS 10.13, *) func takeSnapshot(with snapshotConfiguration: WKSnapshotConfiguration?, completionHandler: @escaping (NSImage?, Error?) -> Void) @available(macOS 10.13, *) - func takeSnapshot(with snapshotConfiguration: WKSnapshotConfiguration?) async throws -> NSImage? + func takeSnapshot(with snapshotConfiguration: WKSnapshotConfiguration?) async throws -> NSImage @available(macOS 11.0, *) func __createPDF(with pdfConfiguration: WKPDFConfiguration?, completionHandler: @escaping (Data?, Error?) -> Void) @available(macOS 11.0, *) - func __createPDF(with pdfConfiguration: WKPDFConfiguration?) async throws -> Data? + func __createPDF(with pdfConfiguration: WKPDFConfiguration?) async throws -> Data @available(macOS 11.0, *) func __createWebArchiveData(completionHandler: @escaping (Data, Error) -> Void) @available(macOS 11.0, *) diff --git a/tvOS/AVFoundation/AVAssetImageGenerator.swift b/tvOS/AVFoundation/AVAssetImageGenerator.swift index e34af07..d72ca8a 100644 --- a/tvOS/AVFoundation/AVAssetImageGenerator.swift +++ b/tvOS/AVFoundation/AVAssetImageGenerator.swift @@ -38,7 +38,7 @@ class AVAssetImageGenerator : NSObject { init(asset: AVAsset) func copyCGImage(at requestedTime: CMTime, actualTime: UnsafeMutablePointer?) throws -> CGImage func generateCGImagesAsynchronously(forTimes requestedTimes: [NSValue], completionHandler handler: @escaping AVAssetImageGeneratorCompletionHandler) - func generateCGImages(forTimes requestedTimes: [NSValue]) async throws -> (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result) + func generateCGImages(forTimes requestedTimes: [NSValue]) async throws -> (CMTime, CGImage, CMTime, AVAssetImageGenerator.Result) func cancelAllCGImageGeneration() } typealias AVAssetImageGeneratorCompletionHandler = (CMTime, CGImage?, CMTime, AVAssetImageGenerator.Result, Error?) -> Void diff --git a/tvOS/AVFoundation/AVCaptureStillImageOutput.swift b/tvOS/AVFoundation/AVCaptureStillImageOutput.swift index 4956d0c..b377d49 100644 --- a/tvOS/AVFoundation/AVCaptureStillImageOutput.swift +++ b/tvOS/AVFoundation/AVCaptureStillImageOutput.swift @@ -13,5 +13,5 @@ extension AVCaptureStillImageOutput { @available(tvOS, introduced: 8.0, deprecated: 10.0, message: "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead.") func captureStillImageBracketAsynchronously(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings], completionHandler handler: @escaping (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?, Error?) -> Void) @available(tvOS, introduced: 8.0, deprecated: 10.0, message: "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead.") - func captureStillImageBracket(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings]) async throws -> (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?) + func captureStillImageBracket(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings]) async throws -> (CMSampleBuffer, AVCaptureBracketedStillImageSettings) } diff --git a/tvOS/AVFoundation/AVContentKeySession.swift b/tvOS/AVFoundation/AVContentKeySession.swift index 95074c0..b64cde0 100644 --- a/tvOS/AVFoundation/AVContentKeySession.swift +++ b/tvOS/AVFoundation/AVContentKeySession.swift @@ -94,7 +94,7 @@ class AVContentKeyRequest : NSObject { var options: [String : Any] { get } var canProvidePersistableContentKey: Bool { get } func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) - func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil) async throws -> Data? + func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil) async throws -> Data func processContentKeyResponse(_ keyResponse: AVContentKeyResponse) func processContentKeyResponseError(_ error: Error) } diff --git a/tvOS/AudioToolbox/AUAudioUnit.swift b/tvOS/AudioToolbox/AUAudioUnit.swift index 71ae155..9c4cb87 100644 --- a/tvOS/AudioToolbox/AUAudioUnit.swift +++ b/tvOS/AudioToolbox/AUAudioUnit.swift @@ -32,7 +32,7 @@ class AUAudioUnit : NSObject { init(componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = []) throws convenience init(componentDescription: AudioComponentDescription) throws class func instantiate(with componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = [], completionHandler: @escaping (AUAudioUnit?, Error?) -> Void) - class func instantiate(with componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = []) async throws -> AUAudioUnit? + class func instantiate(with componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = []) async throws -> AUAudioUnit var componentDescription: AudioComponentDescription { get } var component: AudioComponent { get } var componentName: String? { get } diff --git a/tvOS/CloudKit/CKContainer.swift b/tvOS/CloudKit/CKContainer.swift index 0a71f0d..38198ee 100644 --- a/tvOS/CloudKit/CKContainer.swift +++ b/tvOS/CloudKit/CKContainer.swift @@ -77,49 +77,49 @@ extension CKContainer { } extension CKContainer { func fetchUserRecordID(completionHandler: @escaping (CKRecord.ID?, Error?) -> Void) - func fetchUserRecordID() async throws -> CKRecord.ID? + func fetchUserRecordID() async throws -> CKRecord.ID @available(tvOS 10.0, *) func discoverUserIdentity(withEmailAddress email: String, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(tvOS 10.0, *) - func discoverUserIdentity(withEmailAddress email: String) async throws -> CKUserIdentity? + func discoverUserIdentity(withEmailAddress email: String) async throws -> CKUserIdentity @available(tvOS 10.0, *) func discoverUserIdentity(withPhoneNumber phoneNumber: String, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(tvOS 10.0, *) - func discoverUserIdentity(withPhoneNumber phoneNumber: String) async throws -> CKUserIdentity? + func discoverUserIdentity(withPhoneNumber phoneNumber: String) async throws -> CKUserIdentity @available(tvOS 10.0, *) func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(tvOS 10.0, *) - func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKUserIdentity? + func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKUserIdentity } extension CKContainer { @available(tvOS 10.0, *) func fetchShareParticipant(withEmailAddress emailAddress: String, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(tvOS 10.0, *) - func fetchShareParticipant(withEmailAddress emailAddress: String) async throws -> CKShare.Participant? + func fetchShareParticipant(withEmailAddress emailAddress: String) async throws -> CKShare.Participant @available(tvOS 10.0, *) func fetchShareParticipant(withPhoneNumber phoneNumber: String, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(tvOS 10.0, *) - func fetchShareParticipant(withPhoneNumber phoneNumber: String) async throws -> CKShare.Participant? + func fetchShareParticipant(withPhoneNumber phoneNumber: String) async throws -> CKShare.Participant @available(tvOS 10.0, *) func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(tvOS 10.0, *) - func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKShare.Participant? + func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKShare.Participant @available(tvOS 10.0, *) func fetchShareMetadata(with url: URL, completionHandler: @escaping (CKShare.Metadata?, Error?) -> Void) @available(tvOS 10.0, *) - func fetchShareMetadata(with url: URL) async throws -> CKShare.Metadata? + func fetchShareMetadata(with url: URL) async throws -> CKShare.Metadata @available(tvOS 10.0, *) func accept(_ metadata: CKShare.Metadata, completionHandler: @escaping (CKShare?, Error?) -> Void) @available(tvOS 10.0, *) - func accept(_ metadata: CKShare.Metadata) async throws -> CKShare? + func accept(_ metadata: CKShare.Metadata) async throws -> CKShare } extension CKContainer { @available(tvOS 9.2, *) func __fetchAllLongLivedOperationIDs(completionHandler: @escaping ([String]?, Error?) -> Void) @available(tvOS 9.2, *) - func __fetchAllLongLivedOperationIDs() async throws -> [String]? + func __fetchAllLongLivedOperationIDs() async throws -> [String] @available(tvOS 9.2, *) func __fetchLongLivedOperation(withID operationID: String, completionHandler: @escaping (CKOperation?, Error?) -> Void) @available(tvOS 9.2, *) - func __fetchLongLivedOperation(withID operationID: String) async throws -> CKOperation? + func __fetchLongLivedOperation(withID operationID: String) async throws -> CKOperation } diff --git a/tvOS/CloudKit/CKDatabase.swift b/tvOS/CloudKit/CKDatabase.swift index 77b2225..ceef649 100644 --- a/tvOS/CloudKit/CKDatabase.swift +++ b/tvOS/CloudKit/CKDatabase.swift @@ -25,35 +25,35 @@ class CKDatabase : NSObject { } extension CKDatabase { func fetch(withRecordID recordID: CKRecord.ID, completionHandler: @escaping (CKRecord?, Error?) -> Void) - func fetch(withRecordID recordID: CKRecord.ID) async throws -> CKRecord? + func fetch(withRecordID recordID: CKRecord.ID) async throws -> CKRecord func save(_ record: CKRecord, completionHandler: @escaping (CKRecord?, Error?) -> Void) - func save(_ record: CKRecord) async throws -> CKRecord? + func save(_ record: CKRecord) async throws -> CKRecord func delete(withRecordID recordID: CKRecord.ID, completionHandler: @escaping (CKRecord.ID?, Error?) -> Void) - func delete(withRecordID recordID: CKRecord.ID) async throws -> CKRecord.ID? + func delete(withRecordID recordID: CKRecord.ID) async throws -> CKRecord.ID func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?, completionHandler: @escaping ([CKRecord]?, Error?) -> Void) - func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?) async throws -> [CKRecord]? + func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?) async throws -> [CKRecord] func fetchAllRecordZones(completionHandler: @escaping ([CKRecordZone]?, Error?) -> Void) - func fetchAllRecordZones() async throws -> [CKRecordZone]? + func fetchAllRecordZones() async throws -> [CKRecordZone] func fetch(withRecordZoneID zoneID: CKRecordZone.ID, completionHandler: @escaping (CKRecordZone?, Error?) -> Void) - func fetch(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone? + func fetch(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone func save(_ zone: CKRecordZone, completionHandler: @escaping (CKRecordZone?, Error?) -> Void) - func save(_ zone: CKRecordZone) async throws -> CKRecordZone? + func save(_ zone: CKRecordZone) async throws -> CKRecordZone func delete(withRecordZoneID zoneID: CKRecordZone.ID, completionHandler: @escaping (CKRecordZone.ID?, Error?) -> Void) - func delete(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone.ID? + func delete(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone.ID @available(tvOS 9.0, *) func __fetch(withSubscriptionID subscriptionID: String, completionHandler: @escaping (CKSubscription?, Error?) -> Void) @available(tvOS 9.0, *) - func __fetch(withSubscriptionID subscriptionID: String) async throws -> CKSubscription? + func __fetch(withSubscriptionID subscriptionID: String) async throws -> CKSubscription @available(tvOS 9.0, *) func fetchAllSubscriptions(completionHandler: @escaping ([CKSubscription]?, Error?) -> Void) @available(tvOS 9.0, *) - func fetchAllSubscriptions() async throws -> [CKSubscription]? + func fetchAllSubscriptions() async throws -> [CKSubscription] @available(tvOS 9.0, *) func save(_ subscription: CKSubscription, completionHandler: @escaping (CKSubscription?, Error?) -> Void) @available(tvOS 9.0, *) - func save(_ subscription: CKSubscription) async throws -> CKSubscription? + func save(_ subscription: CKSubscription) async throws -> CKSubscription @available(tvOS 9.0, *) func __delete(withSubscriptionID subscriptionID: String, completionHandler: @escaping (String?, Error?) -> Void) @available(tvOS 9.0, *) - func __delete(withSubscriptionID subscriptionID: String) async throws -> String? + func __delete(withSubscriptionID subscriptionID: String) async throws -> String } diff --git a/tvOS/CoreLocation/CLGeocoder.swift b/tvOS/CoreLocation/CLGeocoder.swift index e1c0502..2e8e10b 100644 --- a/tvOS/CoreLocation/CLGeocoder.swift +++ b/tvOS/CoreLocation/CLGeocoder.swift @@ -4,23 +4,23 @@ typealias CLGeocodeCompletionHandler = ([CLPlacemark]?, Error?) -> Void class CLGeocoder : NSObject { var isGeocoding: Bool { get } func reverseGeocodeLocation(_ location: CLLocation, completionHandler: @escaping CLGeocodeCompletionHandler) - func reverseGeocodeLocation(_ location: CLLocation) async throws -> [CLPlacemark]? + func reverseGeocodeLocation(_ location: CLLocation) async throws -> [CLPlacemark] @available(tvOS 11.0, *) func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?, completionHandler: @escaping CLGeocodeCompletionHandler) @available(tvOS 11.0, *) - func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?) async throws -> [CLPlacemark]? + func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?) async throws -> [CLPlacemark] @available(tvOS, introduced: 5.0, deprecated: 11.0, message: "Use -geocodePostalAddress:completionHandler:") func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any], completionHandler: @escaping CLGeocodeCompletionHandler) @available(tvOS, introduced: 5.0, deprecated: 11.0, message: "Use -geocodePostalAddress:completionHandler:") - func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any]) async throws -> [CLPlacemark]? + func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any]) async throws -> [CLPlacemark] func geocodeAddressString(_ addressString: String, completionHandler: @escaping CLGeocodeCompletionHandler) - func geocodeAddressString(_ addressString: String) async throws -> [CLPlacemark]? + func geocodeAddressString(_ addressString: String) async throws -> [CLPlacemark] func geocodeAddressString(_ addressString: String, in region: CLRegion?, completionHandler: @escaping CLGeocodeCompletionHandler) - func geocodeAddressString(_ addressString: String, in region: CLRegion?) async throws -> [CLPlacemark]? + func geocodeAddressString(_ addressString: String, in region: CLRegion?) async throws -> [CLPlacemark] @available(tvOS 11.0, *) func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?, completionHandler: @escaping CLGeocodeCompletionHandler) @available(tvOS 11.0, *) - func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?) async throws -> [CLPlacemark]? + func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?) async throws -> [CLPlacemark] func cancelGeocode() } extension CLGeocoder { diff --git a/tvOS/CoreML/MLModel.swift b/tvOS/CoreML/MLModel.swift index b34e079..57d0bca 100644 --- a/tvOS/CoreML/MLModel.swift +++ b/tvOS/CoreML/MLModel.swift @@ -10,7 +10,7 @@ class MLModel : NSObject { @available(tvOS 14.0, *) class func __loadContents(of url: URL, configuration: MLModelConfiguration, completionHandler handler: @escaping (MLModel?, Error?) -> Void) @available(tvOS 14.0, *) - class func __loadContents(of url: URL, configuration: MLModelConfiguration) async throws -> MLModel? + class func __loadContents(of url: URL, configuration: MLModelConfiguration) async throws -> MLModel func prediction(from input: MLFeatureProvider) throws -> MLFeatureProvider func prediction(from input: MLFeatureProvider, options: MLPredictionOptions) throws -> MLFeatureProvider @available(tvOS 12.0, *) diff --git a/tvOS/CoreSpotlight/CSSearchableIndex.swift b/tvOS/CoreSpotlight/CSSearchableIndex.swift index 94533df..3e62db7 100644 --- a/tvOS/CoreSpotlight/CSSearchableIndex.swift +++ b/tvOS/CoreSpotlight/CSSearchableIndex.swift @@ -4,5 +4,5 @@ extension CSSearchableIndex { func endBatch(withClientState clientState: Data, completionHandler: ((Error?) -> Void)? = nil) func endBatch(withClientState clientState: Data) async throws func fetchLastClientState(completionHandler: @escaping (Data?, Error?) -> Void) - func fetchLastClientState() async throws -> Data? + func fetchLastClientState() async throws -> Data } diff --git a/tvOS/DeviceCheck/DCDevice.swift b/tvOS/DeviceCheck/DCDevice.swift index af4307b..ac51879 100644 --- a/tvOS/DeviceCheck/DCDevice.swift +++ b/tvOS/DeviceCheck/DCDevice.swift @@ -4,5 +4,5 @@ class DCDevice : NSObject { class var current: DCDevice { get } var isSupported: Bool { get } func generateToken(completionHandler completion: @escaping (Data?, Error?) -> Void) - func generateToken() async throws -> Data? + func generateToken() async throws -> Data } diff --git a/tvOS/Foundation/NSFileVersion.swift b/tvOS/Foundation/NSFileVersion.swift index 2a9be32..9f9624e 100644 --- a/tvOS/Foundation/NSFileVersion.swift +++ b/tvOS/Foundation/NSFileVersion.swift @@ -19,7 +19,7 @@ class NSFileVersion : NSObject { @available(tvOS 9.0, *) class func getNonlocalVersionsOfItem(at url: URL, completionHandler: @escaping ([NSFileVersion]?, Error?) -> Void) @available(tvOS 9.0, *) - class func nonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion]? + class func nonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion] class func version(itemAt url: URL, forPersistentIdentifier persistentIdentifier: Any) -> NSFileVersion? var url: URL { get } var localizedName: String? { get } diff --git a/tvOS/Foundation/NSItemProvider.swift b/tvOS/Foundation/NSItemProvider.swift index 2991cdb..477cad7 100644 --- a/tvOS/Foundation/NSItemProvider.swift +++ b/tvOS/Foundation/NSItemProvider.swift @@ -75,7 +75,7 @@ class NSItemProvider : NSObject, NSCopying { convenience init?(contentsOf fileURL: URL!) func registerItem(forTypeIdentifier typeIdentifier: String, loadHandler: @escaping NSItemProvider.LoadHandler) func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil, completionHandler: NSItemProvider.CompletionHandler? = nil) - func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding? + func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding } @available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) @@ -95,7 +95,7 @@ extension NSItemProvider { @available(tvOS 9.0, *) func loadPreviewImage(options: [AnyHashable : Any]! = [:], completionHandler: NSItemProvider.CompletionHandler!) @available(tvOS 9.0, *) - func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding? + func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding } @available(tvOS 9.0, *) let NSExtensionJavaScriptPreprocessingResultsKey: String diff --git a/tvOS/Foundation/NSURLConnection.swift b/tvOS/Foundation/NSURLConnection.swift index 66a69a4..836cc15 100644 --- a/tvOS/Foundation/NSURLConnection.swift +++ b/tvOS/Foundation/NSURLConnection.swift @@ -56,5 +56,5 @@ extension NSURLConnection { @available(tvOS, introduced: 9.0, deprecated: 9.0, message: "Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h") class func sendAsynchronousRequest(_ request: URLRequest, queue: OperationQueue, completionHandler handler: @escaping (URLResponse?, Data?, Error?) -> Void) @available(tvOS, introduced: 9.0, deprecated: 9.0, message: "Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h") - class func sendAsynchronousRequest(_ request: URLRequest, queue: OperationQueue) async throws -> (URLResponse?, Data?) + class func sendAsynchronousRequest(_ request: URLRequest, queue: OperationQueue) async throws -> (URLResponse, Data) } diff --git a/tvOS/Foundation/NSURLSession.swift b/tvOS/Foundation/NSURLSession.swift index 155b3cd..6d67a91 100644 --- a/tvOS/Foundation/NSURLSession.swift +++ b/tvOS/Foundation/NSURLSession.swift @@ -129,7 +129,7 @@ class URLSessionDownloadTask : URLSessionTask { @available(tvOS 9.0, *) class URLSessionStreamTask : URLSessionTask { func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval, completionHandler: @escaping (Data?, Bool, Error?) -> Void) - func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval) async throws -> (Data?, Bool) + func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval) async throws -> (Data, Bool) func write(_ data: Data, timeout: TimeInterval, completionHandler: @escaping (Error?) -> Void) func write(_ data: Data, timeout: TimeInterval) async throws func captureStreams() @@ -179,7 +179,7 @@ class URLSessionWebSocketTask : URLSessionTask { func __send(_ message: __NSURLSessionWebSocketMessage, completionHandler: @escaping (Error?) -> Void) func __send(_ message: __NSURLSessionWebSocketMessage) async throws func __receiveMessage(completionHandler: @escaping (__NSURLSessionWebSocketMessage?, Error?) -> Void) - func __receiveMessage() async throws -> __NSURLSessionWebSocketMessage? + func __receiveMessage() async throws -> __NSURLSessionWebSocketMessage func sendPing(pongReceiveHandler: @escaping (Error?) -> Void) func cancel(with closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) var maximumMessageSize: Int diff --git a/tvOS/Foundation/NSUserActivity.swift b/tvOS/Foundation/NSUserActivity.swift index 7743fae..8b1a8f6 100644 --- a/tvOS/Foundation/NSUserActivity.swift +++ b/tvOS/Foundation/NSUserActivity.swift @@ -26,7 +26,7 @@ class NSUserActivity : NSObject { func resignCurrent() func invalidate() func getContinuationStreams(completionHandler: @escaping (InputStream?, OutputStream?, Error?) -> Void) - func continuationStreams() async throws -> (InputStream?, OutputStream?) + func continuationStreams() async throws -> (InputStream, OutputStream) @available(tvOS 10.0, *) var isEligibleForHandoff: Bool @available(tvOS 10.0, *) diff --git a/tvOS/GLKit/GLKTextureLoader.swift b/tvOS/GLKit/GLKTextureLoader.swift index 3e20546..5ea13a7 100644 --- a/tvOS/GLKit/GLKTextureLoader.swift +++ b/tvOS/GLKit/GLKTextureLoader.swift @@ -82,19 +82,19 @@ class GLKTextureLoader : NSObject { class func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil) throws -> GLKTextureInfo init(sharegroup: EAGLSharegroup) func texture(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func texture(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func texture(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func texture(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func texture(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func texture(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func texture(withName name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func texture(withName name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func texture(withName name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func texture(withContentsOf data: Data, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func texture(withContentsOf data: Data, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func texture(withContentsOf data: Data, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func texture(with cgImage: CGImage, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func texture(with cgImage: CGImage, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func texture(with cgImage: CGImage, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func cubeMap(withContentsOfFiles paths: [Any], options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func cubeMap(withContentsOfFiles paths: [Any], options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func cubeMap(withContentsOfFiles paths: [Any], options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func cubeMap(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func cubeMap(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func cubeMap(withContentsOfFile path: String, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?, completionHandler block: @escaping GLKTextureLoaderCallback) - func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo? + func cubeMap(withContentsOf url: URL, options: [String : NSNumber]? = nil, queue: DispatchQueue?) async throws -> GLKTextureInfo } diff --git a/tvOS/GameKit/GKAchievement.swift b/tvOS/GameKit/GKAchievement.swift index 2251390..439b860 100644 --- a/tvOS/GameKit/GKAchievement.swift +++ b/tvOS/GameKit/GKAchievement.swift @@ -2,7 +2,7 @@ @available(tvOS 4.1, *) class GKAchievement : NSObject, NSCoding, NSSecureCoding { class func loadAchievements(completionHandler: (([GKAchievement]?, Error?) -> Void)? = nil) - class func loadAchievements() async throws -> [GKAchievement]? + class func loadAchievements() async throws -> [GKAchievement] class func resetAchievements(completionHandler: ((Error?) -> Void)? = nil) class func resetAchievements() async throws init(identifier: String) diff --git a/tvOS/GameKit/GKAchievementDescription.swift b/tvOS/GameKit/GKAchievementDescription.swift index d15362e..98703fe 100644 --- a/tvOS/GameKit/GKAchievementDescription.swift +++ b/tvOS/GameKit/GKAchievementDescription.swift @@ -2,7 +2,7 @@ @available(tvOS 4.1, *) class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { class func loadAchievementDescriptions(completionHandler: (([GKAchievementDescription]?, Error?) -> Void)? = nil) - class func loadAchievementDescriptions() async throws -> [GKAchievementDescription]? + class func loadAchievementDescriptions() async throws -> [GKAchievementDescription] var identifier: String { get } @available(tvOS 6.0, *) var groupIdentifier: String? { get } @@ -16,7 +16,7 @@ class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { } extension GKAchievementDescription { func loadImage(completionHandler: ((UIImage?, Error?) -> Void)? = nil) - func loadImage() async throws -> UIImage? + func loadImage() async throws -> UIImage class func incompleteAchievementImage() -> UIImage class func placeholderCompletedAchievementImage() -> UIImage } diff --git a/tvOS/GameKit/GKChallenge.swift b/tvOS/GameKit/GKChallenge.swift index dd4a655..2ab389c 100644 --- a/tvOS/GameKit/GKChallenge.swift +++ b/tvOS/GameKit/GKChallenge.swift @@ -10,7 +10,7 @@ enum GKChallengeState : Int { @available(tvOS 6.0, *) class GKChallenge : NSObject, NSCoding, NSSecureCoding { class func loadReceivedChallenges(completionHandler: (([GKChallenge]?, Error?) -> Void)? = nil) - class func loadReceivedChallenges() async throws -> [GKChallenge]? + class func loadReceivedChallenges() async throws -> [GKChallenge] func decline() @available(tvOS 8.0, *) @NSCopying var issuingPlayer: GKPlayer? { get } @@ -45,7 +45,7 @@ extension GKAchievement { @available(tvOS 8.0, *) func selectChallengeablePlayers(_ players: [GKPlayer], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(tvOS 8.0, *) - func selectChallengeablePlayers(_ players: [GKPlayer]) async throws -> [GKPlayer]? + func selectChallengeablePlayers(_ players: [GKPlayer]) async throws -> [GKPlayer] @available(tvOS 7.0, *) class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 7.0, *) diff --git a/tvOS/GameKit/GKCloudPlayer.swift b/tvOS/GameKit/GKCloudPlayer.swift index 309ebb8..496d511 100644 --- a/tvOS/GameKit/GKCloudPlayer.swift +++ b/tvOS/GameKit/GKCloudPlayer.swift @@ -2,5 +2,5 @@ @available(tvOS, introduced: 10.0, deprecated: 12.0, message: "GKGameSession is deprecated. Use GKPlayer for both real-time and turn-based matchmaking APIs.") class GKCloudPlayer : GKBasePlayer { class func getCurrentSignedInPlayer(forContainer containerName: String?, completionHandler handler: @escaping (GKCloudPlayer?, Error?) -> Void) - class func currentSignedInPlayer(forContainer containerName: String?) async throws -> GKCloudPlayer? + class func currentSignedInPlayer(forContainer containerName: String?) async throws -> GKCloudPlayer } diff --git a/tvOS/GameKit/GKGameSession.swift b/tvOS/GameKit/GKGameSession.swift index f557f5a..5459cae 100644 --- a/tvOS/GameKit/GKGameSession.swift +++ b/tvOS/GameKit/GKGameSession.swift @@ -22,19 +22,19 @@ class GKGameSession : NSObject { var maxNumberOfConnectedPlayers: Int { get } var badgedPlayers: [GKCloudPlayer] { get } class func createSession(inContainer containerName: String?, withTitle title: String, maxConnectedPlayers maxPlayers: Int, completionHandler: @escaping (GKGameSession?, Error?) -> Void) - class func createSession(inContainer containerName: String?, withTitle title: String, maxConnectedPlayers maxPlayers: Int) async throws -> GKGameSession? + class func createSession(inContainer containerName: String?, withTitle title: String, maxConnectedPlayers maxPlayers: Int) async throws -> GKGameSession class func loadSessions(inContainer containerName: String?, completionHandler: @escaping ([GKGameSession]?, Error?) -> Void) - class func loadSessions(inContainer containerName: String?) async throws -> [GKGameSession]? + class func loadSessions(inContainer containerName: String?) async throws -> [GKGameSession] class func load(withIdentifier identifier: String, completionHandler: @escaping (GKGameSession?, Error?) -> Void) - class func load(withIdentifier identifier: String) async throws -> GKGameSession? + class func load(withIdentifier identifier: String) async throws -> GKGameSession class func remove(withIdentifier identifier: String, completionHandler: @escaping (Error?) -> Void) class func remove(withIdentifier identifier: String) async throws func getShareURL(completionHandler: @escaping (URL?, Error?) -> Void) - func shareURL() async throws -> URL? + func shareURL() async throws -> URL func loadData(completionHandler: @escaping (Data?, Error?) -> Void) - func loadData() async throws -> Data? + func loadData() async throws -> Data func save(_ data: Data, completionHandler: @escaping (Data?, Error?) -> Void) - func save(_ data: Data) async throws -> Data? + func save(_ data: Data) async throws -> Data func setConnectionState(_ state: GKConnectionState, completionHandler: @escaping (Error?) -> Void) func setConnectionState(_ state: GKConnectionState) async throws func players(with state: GKConnectionState) -> [GKCloudPlayer] diff --git a/tvOS/GameKit/GKLeaderboard.swift b/tvOS/GameKit/GKLeaderboard.swift index 4944d83..f96e850 100644 --- a/tvOS/GameKit/GKLeaderboard.swift +++ b/tvOS/GameKit/GKLeaderboard.swift @@ -39,11 +39,11 @@ class GKLeaderboard : NSObject { @available(tvOS 14.0, *) class func loadLeaderboards(IDs leaderboardIDs: [String]?, completionHandler: @escaping ([GKLeaderboard]?, Error?) -> Void) @available(tvOS 14.0, *) - class func loadLeaderboards(IDs leaderboardIDs: [String]?) async throws -> [GKLeaderboard]? + class func loadLeaderboards(IDs leaderboardIDs: [String]?) async throws -> [GKLeaderboard] @available(tvOS 14.0, *) func loadPreviousOccurrence(completionHandler: @escaping (GKLeaderboard?, Error?) -> Void) @available(tvOS 14.0, *) - func loadPreviousOccurrence() async throws -> GKLeaderboard? + func loadPreviousOccurrence() async throws -> GKLeaderboard @available(tvOS 14.0, *) class func submitScore(_ score: Int, context: Int, player: GKPlayer, leaderboardIDs: [String], completionHandler: @escaping (Error?) -> Void) @available(tvOS 14.0, *) @@ -55,11 +55,11 @@ class GKLeaderboard : NSObject { @available(tvOS 14.0, *) func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange, completionHandler: @escaping (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Int, Error?) -> Void) @available(tvOS 14.0, *) - func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange) async throws -> (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Int) + func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange) async throws -> (GKLeaderboard.Entry, [GKLeaderboard.Entry], Int) @available(tvOS 14.0, *) func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope, completionHandler: @escaping (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Error?) -> Void) @available(tvOS 14.0, *) - func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope) async throws -> (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?) + func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope) async throws -> (GKLeaderboard.Entry, [GKLeaderboard.Entry]) } extension GKLeaderboard { @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler: instead.") @@ -83,11 +83,11 @@ extension GKLeaderboard { @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") func loadScores(completionHandler: (([GKScore]?, Error?) -> Void)? = nil) @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") - func loadScores() async throws -> [GKScore]? + func loadScores() async throws -> [GKScore] @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") class func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") - class func loadLeaderboards() async throws -> [GKLeaderboard]? + class func loadLeaderboards() async throws -> [GKLeaderboard] } extension GKLeaderboard { } diff --git a/tvOS/GameKit/GKLeaderboardSet.swift b/tvOS/GameKit/GKLeaderboardSet.swift index 263ff7a..69f265f 100644 --- a/tvOS/GameKit/GKLeaderboardSet.swift +++ b/tvOS/GameKit/GKLeaderboardSet.swift @@ -7,7 +7,7 @@ class GKLeaderboardSet : NSObject, NSCoding, NSSecureCoding { @available(tvOS 7.0, *) class func loadLeaderboardSets(completionHandler: (([GKLeaderboardSet]?, Error?) -> Void)? = nil) @available(tvOS 7.0, *) - class func loadLeaderboardSets() async throws -> [GKLeaderboardSet]? + class func loadLeaderboardSets() async throws -> [GKLeaderboardSet] @available(tvOS 14.0, *) func loadLeaderboards(handler: @escaping ([GKLeaderboard]?, Error?) -> Void) } @@ -15,7 +15,7 @@ extension GKLeaderboardSet { @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use loadLeaderboardsWithHandler: instead.") func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use loadLeaderboardsWithHandler: instead.") - func loadLeaderboards() async throws -> [GKLeaderboard]? + func loadLeaderboards() async throws -> [GKLeaderboard] } extension GKLeaderboardSet { } diff --git a/tvOS/GameKit/GKLocalPlayer.swift b/tvOS/GameKit/GKLocalPlayer.swift index 359e0ef..cabd8bc 100644 --- a/tvOS/GameKit/GKLocalPlayer.swift +++ b/tvOS/GameKit/GKLocalPlayer.swift @@ -13,9 +13,9 @@ class GKLocalPlayer : GKPlayer { @available(tvOS 10.0, *) func loadRecentPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(tvOS 10.0, *) - func loadRecentPlayers() async throws -> [GKPlayer]? + func loadRecentPlayers() async throws -> [GKPlayer] func loadChallengableFriends(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - func loadChallengableFriends() async throws -> [GKPlayer]? + func loadChallengableFriends() async throws -> [GKPlayer] @available(tvOS 7.0, *) func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 7.0, *) @@ -23,11 +23,11 @@ class GKLocalPlayer : GKPlayer { @available(tvOS 7.0, *) func loadDefaultLeaderboardIdentifier(completionHandler: ((String?, Error?) -> Void)? = nil) @available(tvOS 7.0, *) - func loadDefaultLeaderboardIdentifier() async throws -> String? + func loadDefaultLeaderboardIdentifier() async throws -> String @available(tvOS 13.5, *) func fetchItems(forIdentityVerificationSignature completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(tvOS 13.5, *) - func fetchItemsForIdentityVerificationSignature() async throws -> (URL?, Data?, Data?, UInt64) + func fetchItemsForIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) } protocol GKLocalPlayerListener : GKChallengeListener, GKInviteEventListener, GKTurnBasedEventListener { } @@ -47,11 +47,11 @@ extension GKLocalPlayer { @available(tvOS, introduced: 8.0, deprecated: 10.0) func loadFriendPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(tvOS, introduced: 8.0, deprecated: 10.0) - func loadFriendPlayers() async throws -> [GKPlayer]? + func loadFriendPlayers() async throws -> [GKPlayer] @available(tvOS, introduced: 9.0, deprecated: 13.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") func generateIdentityVerificationSignature(completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(tvOS, introduced: 9.0, deprecated: 13.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") - func generateIdentityVerificationSignature() async throws -> (URL?, Data?, Data?, UInt64) + func generateIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) } extension GKLocalPlayer { } diff --git a/tvOS/GameKit/GKMatch.swift b/tvOS/GameKit/GKMatch.swift index a0df0f4..9923a53 100644 --- a/tvOS/GameKit/GKMatch.swift +++ b/tvOS/GameKit/GKMatch.swift @@ -32,7 +32,7 @@ class GKMatch : NSObject { @available(tvOS 6.0, *) func rematch(completionHandler: ((GKMatch?, Error?) -> Void)? = nil) @available(tvOS 6.0, *) - func rematch() async throws -> GKMatch? + func rematch() async throws -> GKMatch } protocol GKMatchDelegate : NSObjectProtocol { @available(tvOS 8.0, *) diff --git a/tvOS/GameKit/GKMatchmaker.swift b/tvOS/GameKit/GKMatchmaker.swift index e1125f1..03dc961 100644 --- a/tvOS/GameKit/GKMatchmaker.swift +++ b/tvOS/GameKit/GKMatchmaker.swift @@ -64,13 +64,13 @@ class GKMatchmaker : NSObject { @available(tvOS 6.0, *) func match(for invite: GKInvite, completionHandler: ((GKMatch?, Error?) -> Void)? = nil) @available(tvOS 6.0, *) - func match(for invite: GKInvite) async throws -> GKMatch? + func match(for invite: GKInvite) async throws -> GKMatch func findMatch(for request: GKMatchRequest, withCompletionHandler completionHandler: ((GKMatch?, Error?) -> Void)? = nil) - func findMatch(for request: GKMatchRequest) async throws -> GKMatch? + func findMatch(for request: GKMatchRequest) async throws -> GKMatch @available(tvOS 8.0, *) func findPlayers(forHostedRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(tvOS 8.0, *) - func findPlayers(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer]? + func findPlayers(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer] func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest, completionHandler: ((Error?) -> Void)? = nil) func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest) async throws func cancel() diff --git a/tvOS/GameKit/GKPlayer.swift b/tvOS/GameKit/GKPlayer.swift index 9a59c31..00580e5 100644 --- a/tvOS/GameKit/GKPlayer.swift +++ b/tvOS/GameKit/GKPlayer.swift @@ -4,7 +4,7 @@ let GKPlayerIDNoLongerAvailable: String @available(tvOS 4.1, *) class GKPlayer : GKBasePlayer { class func loadPlayers(forIdentifiers identifiers: [String], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer]? + class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] @available(tvOS 13.0, *) func scopedIDsArePersistent() -> Bool @available(tvOS 12.4, *) @@ -23,7 +23,7 @@ extension GKPlayer { @available(tvOS 5.0, *) func loadPhoto(for size: GKPlayer.PhotoSize, withCompletionHandler completionHandler: ((UIImage?, Error?) -> Void)? = nil) @available(tvOS 5.0, *) - func loadPhoto(for size: GKPlayer.PhotoSize) async throws -> UIImage? + func loadPhoto(for size: GKPlayer.PhotoSize) async throws -> UIImage } extension GKPlayer { enum PhotoSize : Int { diff --git a/tvOS/GameKit/GKTurnBasedMatch.swift b/tvOS/GameKit/GKTurnBasedMatch.swift index c76acf4..ea8ffd2 100644 --- a/tvOS/GameKit/GKTurnBasedMatch.swift +++ b/tvOS/GameKit/GKTurnBasedMatch.swift @@ -92,21 +92,21 @@ class GKTurnBasedMatch : NSObject { @available(tvOS 7.0, *) var exchangeMaxInitiatedExchangesPerPlayer: Int { get } class func find(for request: GKMatchRequest, withCompletionHandler completionHandler: @escaping (GKTurnBasedMatch?, Error?) -> Void) - class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch? + class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch class func loadMatches(completionHandler: (([GKTurnBasedMatch]?, Error?) -> Void)? = nil) - class func loadMatches() async throws -> [GKTurnBasedMatch]? + class func loadMatches() async throws -> [GKTurnBasedMatch] @available(tvOS 5.0, *) class func load(withID matchID: String, withCompletionHandler completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(tvOS 5.0, *) - class func load(withID matchID: String) async throws -> GKTurnBasedMatch? + class func load(withID matchID: String) async throws -> GKTurnBasedMatch @available(tvOS 6.0, *) func rematch(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(tvOS 6.0, *) - func rematch() async throws -> GKTurnBasedMatch? + func rematch() async throws -> GKTurnBasedMatch @available(tvOS 5.0, *) func acceptInvite(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(tvOS 5.0, *) - func acceptInvite() async throws -> GKTurnBasedMatch? + func acceptInvite() async throws -> GKTurnBasedMatch @available(tvOS 5.0, *) func declineInvite(completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 5.0, *) @@ -114,7 +114,7 @@ class GKTurnBasedMatch : NSObject { func remove(completionHandler: ((Error?) -> Void)? = nil) func remove() async throws func loadMatchData(completionHandler: ((Data?, Error?) -> Void)? = nil) - func loadMatchData() async throws -> Data? + func loadMatchData() async throws -> Data @available(tvOS 6.0, *) func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 6.0, *) @@ -146,7 +146,7 @@ class GKTurnBasedMatch : NSObject { @available(tvOS 7.0, *) func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval, completionHandler: ((GKTurnBasedExchange?, Error?) -> Void)? = nil) @available(tvOS 7.0, *) - func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange? + func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange @available(tvOS 7.0, *) func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 7.0, *) diff --git a/tvOS/MapKit/MKDirections.swift b/tvOS/MapKit/MKDirections.swift index a3bde9d..3a2e03a 100644 --- a/tvOS/MapKit/MKDirections.swift +++ b/tvOS/MapKit/MKDirections.swift @@ -7,9 +7,9 @@ extension MKDirections { class MKDirections : NSObject { init(request: MKDirections.Request) func calculate(completionHandler: @escaping MKDirections.DirectionsHandler) - func calculate() async throws -> MKDirections.Response? + func calculate() async throws -> MKDirections.Response func calculateETA(completionHandler: @escaping MKDirections.ETAHandler) - func calculateETA() async throws -> MKDirections.ETAResponse? + func calculateETA() async throws -> MKDirections.ETAResponse func cancel() var isCalculating: Bool { get } } diff --git a/tvOS/MapKit/MKLocalSearch.swift b/tvOS/MapKit/MKLocalSearch.swift index d260516..be19e41 100644 --- a/tvOS/MapKit/MKLocalSearch.swift +++ b/tvOS/MapKit/MKLocalSearch.swift @@ -8,7 +8,7 @@ class MKLocalSearch : NSObject { @available(tvOS 14.0, *) init(request: MKLocalPointsOfInterestRequest) func start(completionHandler: @escaping MKLocalSearch.CompletionHandler) - func start() async throws -> MKLocalSearch.Response? + func start() async throws -> MKLocalSearch.Response func cancel() var isSearching: Bool { get } } diff --git a/tvOS/MapKit/MKMapSnapshotter.swift b/tvOS/MapKit/MKMapSnapshotter.swift index 98ae442..a6ac8a0 100644 --- a/tvOS/MapKit/MKMapSnapshotter.swift +++ b/tvOS/MapKit/MKMapSnapshotter.swift @@ -6,9 +6,9 @@ extension MKMapSnapshotter { class MKMapSnapshotter : NSObject { init(options: MKMapSnapshotter.Options) func start(completionHandler: @escaping MKMapSnapshotter.CompletionHandler) - func start() async throws -> MKMapSnapshotter.Snapshot? + func start() async throws -> MKMapSnapshotter.Snapshot func start(with queue: DispatchQueue, completionHandler: @escaping MKMapSnapshotter.CompletionHandler) - func start(with queue: DispatchQueue) async throws -> MKMapSnapshotter.Snapshot? + func start(with queue: DispatchQueue) async throws -> MKMapSnapshotter.Snapshot func cancel() var isLoading: Bool { get } } diff --git a/tvOS/Metal/MTLDevice.swift b/tvOS/Metal/MTLDevice.swift index fa2f1c1..49c5aed 100644 --- a/tvOS/Metal/MTLDevice.swift +++ b/tvOS/Metal/MTLDevice.swift @@ -141,25 +141,25 @@ protocol MTLDevice : NSObjectProtocol { func makeLibrary(data: __DispatchData) throws -> MTLLibrary func makeLibrary(source: String, options: MTLCompileOptions?) throws -> MTLLibrary func makeLibrary(source: String, options: MTLCompileOptions?, completionHandler: @escaping MTLNewLibraryCompletionHandler) - func makeLibrary(source: String, options: MTLCompileOptions?) async throws -> MTLLibrary? + func makeLibrary(source: String, options: MTLCompileOptions?) async throws -> MTLLibrary func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor) throws -> MTLRenderPipelineState func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer?) throws -> MTLRenderPipelineState func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, completionHandler: @escaping MTLNewRenderPipelineStateCompletionHandler) - func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor) async throws -> MTLRenderPipelineState? + func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor) async throws -> MTLRenderPipelineState func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption, completionHandler: @escaping MTLNewRenderPipelineStateWithReflectionCompletionHandler) - func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLRenderPipelineState?, MTLRenderPipelineReflection?) + func makeRenderPipelineState(descriptor: MTLRenderPipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLRenderPipelineState, MTLRenderPipelineReflection) func makeComputePipelineState(function computeFunction: MTLFunction) throws -> MTLComputePipelineState func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer?) throws -> MTLComputePipelineState func makeComputePipelineState(function computeFunction: MTLFunction, completionHandler: @escaping MTLNewComputePipelineStateCompletionHandler) - func makeComputePipelineState(function computeFunction: MTLFunction) async throws -> MTLComputePipelineState? + func makeComputePipelineState(function computeFunction: MTLFunction) async throws -> MTLComputePipelineState func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption, completionHandler: @escaping MTLNewComputePipelineStateWithReflectionCompletionHandler) - func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption) async throws -> (MTLComputePipelineState?, MTLComputePipelineReflection?) + func makeComputePipelineState(function computeFunction: MTLFunction, options: MTLPipelineOption) async throws -> (MTLComputePipelineState, MTLComputePipelineReflection) @available(tvOS 9.0, *) func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer?) throws -> MTLComputePipelineState @available(tvOS 9.0, *) func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption, completionHandler: @escaping MTLNewComputePipelineStateWithReflectionCompletionHandler) @available(tvOS 9.0, *) - func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLComputePipelineState?, MTLComputePipelineReflection?) + func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption) async throws -> (MTLComputePipelineState, MTLComputePipelineReflection) @available(tvOS 10.0, *) func makeFence() -> MTLFence? func supportsFeatureSet(_ featureSet: MTLFeatureSet) -> Bool diff --git a/tvOS/Metal/MTLLibrary.swift b/tvOS/Metal/MTLLibrary.swift index b1bc3ca..e685d0e 100644 --- a/tvOS/Metal/MTLLibrary.swift +++ b/tvOS/Metal/MTLLibrary.swift @@ -136,11 +136,11 @@ protocol MTLLibrary : NSObjectProtocol { @available(tvOS 10.0, *) func makeFunction(name: String, constantValues: MTLFunctionConstantValues, completionHandler: @escaping (MTLFunction?, Error?) -> Void) @available(tvOS 10.0, *) - func makeFunction(name: String, constantValues: MTLFunctionConstantValues) async throws -> MTLFunction? + func makeFunction(name: String, constantValues: MTLFunctionConstantValues) async throws -> MTLFunction @available(tvOS 14.0, *) func makeFunction(descriptor: MTLFunctionDescriptor, completionHandler: @escaping (MTLFunction?, Error?) -> Void) @available(tvOS 14.0, *) - func makeFunction(descriptor: MTLFunctionDescriptor) async throws -> MTLFunction? + func makeFunction(descriptor: MTLFunctionDescriptor) async throws -> MTLFunction @available(tvOS 14.0, *) func makeFunction(descriptor: MTLFunctionDescriptor) throws -> MTLFunction var functionNames: [String] { get } diff --git a/tvOS/MetalKit/MTKTextureLoader.swift b/tvOS/MetalKit/MTKTextureLoader.swift index c1900a5..4ce6bf3 100644 --- a/tvOS/MetalKit/MTKTextureLoader.swift +++ b/tvOS/MetalKit/MTKTextureLoader.swift @@ -65,11 +65,11 @@ class MTKTextureLoader : NSObject { var device: MTLDevice { get } init(device: MTLDevice) func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) - func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture @available(tvOS 10.0, *) func newTexture(name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) @available(tvOS 10.0, *) - func newTexture(name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + func newTexture(name: String, scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture @available(tvOS 10.0, *) func newTextures(URLs: [URL], options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.ArrayCallback) @available(tvOS 10.0, *) @@ -79,13 +79,13 @@ class MTKTextureLoader : NSObject { @available(tvOS 10.0, *) func newTextures(names: [String], scaleFactor: CGFloat, bundle: Bundle?, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> [MTLTexture] func newTexture(data: Data, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) - func newTexture(data: Data, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + func newTexture(data: Data, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture func newTexture(cgImage: CGImage, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) - func newTexture(cgImage: CGImage, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + func newTexture(cgImage: CGImage, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture @available(tvOS 10.0, *) func newTexture(texture: MDLTexture, options: [MTKTextureLoader.Option : Any]? = nil, completionHandler: @escaping MTKTextureLoader.Callback) @available(tvOS 10.0, *) - func newTexture(texture: MDLTexture, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture? + func newTexture(texture: MDLTexture, options: [MTKTextureLoader.Option : Any]? = nil) async throws -> MTLTexture func newTexture(URL: URL, options: [MTKTextureLoader.Option : Any]? = nil) throws -> MTLTexture @available(tvOS 10.0, *) func newTextures(URLs: [URL], options: [MTKTextureLoader.Option : Any]? = nil, error: NSErrorPointer) -> [MTLTexture] diff --git a/tvOS/MultipeerConnectivity/MCSession.swift b/tvOS/MultipeerConnectivity/MCSession.swift index ba70f09..ab46352 100644 --- a/tvOS/MultipeerConnectivity/MCSession.swift +++ b/tvOS/MultipeerConnectivity/MCSession.swift @@ -56,7 +56,7 @@ protocol MCSessionDelegate : NSObjectProtocol { } extension MCSession { func nearbyConnectionData(forPeer peerID: MCPeerID, withCompletionHandler completionHandler: @escaping (Data?, Error?) -> Void) - func nearbyConnectionData(forPeer peerID: MCPeerID) async throws -> Data? + func nearbyConnectionData(forPeer peerID: MCPeerID) async throws -> Data func connectPeer(_ peerID: MCPeerID, withNearbyConnectionData data: Data) func cancelConnectPeer(_ peerID: MCPeerID) } diff --git a/tvOS/Photos/PHLivePhotoEditingContext.swift b/tvOS/Photos/PHLivePhotoEditingContext.swift index 5b2040b..4b42ec3 100644 --- a/tvOS/Photos/PHLivePhotoEditingContext.swift +++ b/tvOS/Photos/PHLivePhotoEditingContext.swift @@ -26,7 +26,7 @@ class PHLivePhotoEditingContext : NSObject { @available(tvOS 10, *) func prepareLivePhotoForPlayback(withTargetSize targetSize: CGSize, options: [String : Any]? = nil, completionHandler handler: @escaping (PHLivePhoto?, Error?) -> Void) @available(tvOS 10, *) - func prepareLivePhotoForPlayback(withTargetSize targetSize: CGSize, options: [String : Any]? = nil) async throws -> PHLivePhoto? + func prepareLivePhotoForPlayback(withTargetSize targetSize: CGSize, options: [String : Any]? = nil) async throws -> PHLivePhoto @available(tvOS 10, *) func saveLivePhoto(to output: PHContentEditingOutput, options: [String : Any]? = nil, completionHandler handler: @escaping (Bool, Error?) -> Void) @available(tvOS 10, *) diff --git a/tvOS/StoreKit/SKCloudServiceController.swift b/tvOS/StoreKit/SKCloudServiceController.swift index ddd62d2..e61813c 100644 --- a/tvOS/StoreKit/SKCloudServiceController.swift +++ b/tvOS/StoreKit/SKCloudServiceController.swift @@ -30,19 +30,19 @@ class SKCloudServiceController : NSObject { @available(tvOS 11.0, *) func requestStorefrontCountryCode(completionHandler: @escaping (String?, Error?) -> Void) @available(tvOS 11.0, *) - func requestStorefrontCountryCode() async throws -> String? + func requestStorefrontCountryCode() async throws -> String @available(tvOS 9.3, *) func requestStorefrontIdentifier(completionHandler: @escaping (String?, Error?) -> Void) @available(tvOS 9.3, *) - func requestStorefrontIdentifier() async throws -> String? + func requestStorefrontIdentifier() async throws -> String @available(tvOS 11.0, *) func requestUserToken(forDeveloperToken developerToken: String, completionHandler: @escaping (String?, Error?) -> Void) @available(tvOS 11.0, *) - func requestUserToken(forDeveloperToken developerToken: String) async throws -> String? + func requestUserToken(forDeveloperToken developerToken: String) async throws -> String @available(tvOS, introduced: 10.3, deprecated: 11.0) func requestPersonalizationToken(forClientToken clientToken: String, withCompletionHandler completionHandler: @escaping (String?, Error?) -> Void) @available(tvOS, introduced: 10.3, deprecated: 11.0) - func requestPersonalizationToken(forClientToken clientToken: String) async throws -> String? + func requestPersonalizationToken(forClientToken clientToken: String) async throws -> String } extension NSNotification.Name { @available(tvOS 9.3, *) diff --git a/watchOS/AVFoundation/AVCaptureStillImageOutput.swift b/watchOS/AVFoundation/AVCaptureStillImageOutput.swift index a117f65..24d8790 100644 --- a/watchOS/AVFoundation/AVCaptureStillImageOutput.swift +++ b/watchOS/AVFoundation/AVCaptureStillImageOutput.swift @@ -13,5 +13,5 @@ extension AVCaptureStillImageOutput { @available(watchOS, introduced: 2.0, deprecated: 3.0, message: "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead.") func captureStillImageBracketAsynchronously(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings], completionHandler handler: @escaping (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?, Error?) -> Void) @available(watchOS, introduced: 2.0, deprecated: 3.0, message: "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead.") - func captureStillImageBracket(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings]) async throws -> (CMSampleBuffer?, AVCaptureBracketedStillImageSettings?) + func captureStillImageBracket(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings]) async throws -> (CMSampleBuffer, AVCaptureBracketedStillImageSettings) } diff --git a/watchOS/AVFoundation/AVContentKeySession.swift b/watchOS/AVFoundation/AVContentKeySession.swift index f73691a..8d6484d 100644 --- a/watchOS/AVFoundation/AVContentKeySession.swift +++ b/watchOS/AVFoundation/AVContentKeySession.swift @@ -30,15 +30,15 @@ class AVContentKeySession : NSObject { @available(watchOS 7.0, *) func makeSecureTokenForExpirationDate(ofPersistableContentKey persistableContentKeyData: Data, completionHandler handler: @escaping (Data?, Error?) -> Void) @available(watchOS 7.0, *) - func makeSecureTokenForExpirationDate(ofPersistableContentKey persistableContentKeyData: Data) async throws -> Data? + func makeSecureTokenForExpirationDate(ofPersistableContentKey persistableContentKeyData: Data) async throws -> Data @available(watchOS 7.0, *) func invalidatePersistableContentKey(_ persistableContentKeyData: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) @available(watchOS 7.0, *) - func invalidatePersistableContentKey(_ persistableContentKeyData: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil) async throws -> Data? + func invalidatePersistableContentKey(_ persistableContentKeyData: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil) async throws -> Data @available(watchOS 7.0, *) func invalidateAllPersistableContentKeys(forApp appIdentifier: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) @available(watchOS 7.0, *) - func invalidateAllPersistableContentKeys(forApp appIdentifier: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil) async throws -> Data? + func invalidateAllPersistableContentKeys(forApp appIdentifier: Data, options: [AVContentKeySessionServerPlaybackContextOption : Any]? = nil) async throws -> Data } struct AVContentKeySessionServerPlaybackContextOption : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable { init(rawValue: String) @@ -112,7 +112,7 @@ class AVContentKeyRequest : NSObject { var options: [String : Any] { get } var canProvidePersistableContentKey: Bool { get } func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil, completionHandler handler: @escaping (Data?, Error?) -> Void) - func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil) async throws -> Data? + func makeStreamingContentKeyRequestData(forApp appIdentifier: Data, contentIdentifier: Data?, options: [String : Any]? = nil) async throws -> Data func processContentKeyResponse(_ keyResponse: AVContentKeyResponse) func processContentKeyResponseError(_ error: Error) @available(watchOS 7.0, *) diff --git a/watchOS/CloudKit/CKContainer.swift b/watchOS/CloudKit/CKContainer.swift index 91c0d06..807f452 100644 --- a/watchOS/CloudKit/CKContainer.swift +++ b/watchOS/CloudKit/CKContainer.swift @@ -77,53 +77,53 @@ extension CKContainer { } extension CKContainer { func fetchUserRecordID(completionHandler: @escaping (CKRecord.ID?, Error?) -> Void) - func fetchUserRecordID() async throws -> CKRecord.ID? + func fetchUserRecordID() async throws -> CKRecord.ID @available(watchOS 3.0, *) func discoverAllIdentities(completionHandler: @escaping ([CKUserIdentity]?, Error?) -> Void) @available(watchOS 3.0, *) - func discoverAllIdentities() async throws -> [CKUserIdentity]? + func discoverAllIdentities() async throws -> [CKUserIdentity] @available(watchOS 3.0, *) func discoverUserIdentity(withEmailAddress email: String, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(watchOS 3.0, *) - func discoverUserIdentity(withEmailAddress email: String) async throws -> CKUserIdentity? + func discoverUserIdentity(withEmailAddress email: String) async throws -> CKUserIdentity @available(watchOS 3.0, *) func discoverUserIdentity(withPhoneNumber phoneNumber: String, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(watchOS 3.0, *) - func discoverUserIdentity(withPhoneNumber phoneNumber: String) async throws -> CKUserIdentity? + func discoverUserIdentity(withPhoneNumber phoneNumber: String) async throws -> CKUserIdentity @available(watchOS 3.0, *) func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) @available(watchOS 3.0, *) - func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKUserIdentity? + func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKUserIdentity } extension CKContainer { @available(watchOS 3.0, *) func fetchShareParticipant(withEmailAddress emailAddress: String, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(watchOS 3.0, *) - func fetchShareParticipant(withEmailAddress emailAddress: String) async throws -> CKShare.Participant? + func fetchShareParticipant(withEmailAddress emailAddress: String) async throws -> CKShare.Participant @available(watchOS 3.0, *) func fetchShareParticipant(withPhoneNumber phoneNumber: String, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(watchOS 3.0, *) - func fetchShareParticipant(withPhoneNumber phoneNumber: String) async throws -> CKShare.Participant? + func fetchShareParticipant(withPhoneNumber phoneNumber: String) async throws -> CKShare.Participant @available(watchOS 3.0, *) func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID, completionHandler: @escaping (CKShare.Participant?, Error?) -> Void) @available(watchOS 3.0, *) - func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKShare.Participant? + func fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID) async throws -> CKShare.Participant @available(watchOS 3.0, *) func fetchShareMetadata(with url: URL, completionHandler: @escaping (CKShare.Metadata?, Error?) -> Void) @available(watchOS 3.0, *) - func fetchShareMetadata(with url: URL) async throws -> CKShare.Metadata? + func fetchShareMetadata(with url: URL) async throws -> CKShare.Metadata @available(watchOS 3.0, *) func accept(_ metadata: CKShare.Metadata, completionHandler: @escaping (CKShare?, Error?) -> Void) @available(watchOS 3.0, *) - func accept(_ metadata: CKShare.Metadata) async throws -> CKShare? + func accept(_ metadata: CKShare.Metadata) async throws -> CKShare } extension CKContainer { @available(watchOS 3.0, *) func __fetchAllLongLivedOperationIDs(completionHandler: @escaping ([String]?, Error?) -> Void) @available(watchOS 3.0, *) - func __fetchAllLongLivedOperationIDs() async throws -> [String]? + func __fetchAllLongLivedOperationIDs() async throws -> [String] @available(watchOS 3.0, *) func __fetchLongLivedOperation(withID operationID: String, completionHandler: @escaping (CKOperation?, Error?) -> Void) @available(watchOS 3.0, *) - func __fetchLongLivedOperation(withID operationID: String) async throws -> CKOperation? + func __fetchLongLivedOperation(withID operationID: String) async throws -> CKOperation } diff --git a/watchOS/CloudKit/CKDatabase.swift b/watchOS/CloudKit/CKDatabase.swift index 59388a4..94ba438 100644 --- a/watchOS/CloudKit/CKDatabase.swift +++ b/watchOS/CloudKit/CKDatabase.swift @@ -25,35 +25,35 @@ class CKDatabase : NSObject { } extension CKDatabase { func fetch(withRecordID recordID: CKRecord.ID, completionHandler: @escaping (CKRecord?, Error?) -> Void) - func fetch(withRecordID recordID: CKRecord.ID) async throws -> CKRecord? + func fetch(withRecordID recordID: CKRecord.ID) async throws -> CKRecord func save(_ record: CKRecord, completionHandler: @escaping (CKRecord?, Error?) -> Void) - func save(_ record: CKRecord) async throws -> CKRecord? + func save(_ record: CKRecord) async throws -> CKRecord func delete(withRecordID recordID: CKRecord.ID, completionHandler: @escaping (CKRecord.ID?, Error?) -> Void) - func delete(withRecordID recordID: CKRecord.ID) async throws -> CKRecord.ID? + func delete(withRecordID recordID: CKRecord.ID) async throws -> CKRecord.ID func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?, completionHandler: @escaping ([CKRecord]?, Error?) -> Void) - func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?) async throws -> [CKRecord]? + func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?) async throws -> [CKRecord] func fetchAllRecordZones(completionHandler: @escaping ([CKRecordZone]?, Error?) -> Void) - func fetchAllRecordZones() async throws -> [CKRecordZone]? + func fetchAllRecordZones() async throws -> [CKRecordZone] func fetch(withRecordZoneID zoneID: CKRecordZone.ID, completionHandler: @escaping (CKRecordZone?, Error?) -> Void) - func fetch(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone? + func fetch(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone func save(_ zone: CKRecordZone, completionHandler: @escaping (CKRecordZone?, Error?) -> Void) - func save(_ zone: CKRecordZone) async throws -> CKRecordZone? + func save(_ zone: CKRecordZone) async throws -> CKRecordZone func delete(withRecordZoneID zoneID: CKRecordZone.ID, completionHandler: @escaping (CKRecordZone.ID?, Error?) -> Void) - func delete(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone.ID? + func delete(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone.ID @available(watchOS 6.0, *) func __fetch(withSubscriptionID subscriptionID: String, completionHandler: @escaping (CKSubscription?, Error?) -> Void) @available(watchOS 6.0, *) - func __fetch(withSubscriptionID subscriptionID: String) async throws -> CKSubscription? + func __fetch(withSubscriptionID subscriptionID: String) async throws -> CKSubscription @available(watchOS 6.0, *) func fetchAllSubscriptions(completionHandler: @escaping ([CKSubscription]?, Error?) -> Void) @available(watchOS 6.0, *) - func fetchAllSubscriptions() async throws -> [CKSubscription]? + func fetchAllSubscriptions() async throws -> [CKSubscription] @available(watchOS 6.0, *) func save(_ subscription: CKSubscription, completionHandler: @escaping (CKSubscription?, Error?) -> Void) @available(watchOS 6.0, *) - func save(_ subscription: CKSubscription) async throws -> CKSubscription? + func save(_ subscription: CKSubscription) async throws -> CKSubscription @available(watchOS 6.0, *) func __delete(withSubscriptionID subscriptionID: String, completionHandler: @escaping (String?, Error?) -> Void) @available(watchOS 6.0, *) - func __delete(withSubscriptionID subscriptionID: String) async throws -> String? + func __delete(withSubscriptionID subscriptionID: String) async throws -> String } diff --git a/watchOS/CoreLocation/CLGeocoder.swift b/watchOS/CoreLocation/CLGeocoder.swift index f37a197..5ae909e 100644 --- a/watchOS/CoreLocation/CLGeocoder.swift +++ b/watchOS/CoreLocation/CLGeocoder.swift @@ -4,23 +4,23 @@ typealias CLGeocodeCompletionHandler = ([CLPlacemark]?, Error?) -> Void class CLGeocoder : NSObject { var isGeocoding: Bool { get } func reverseGeocodeLocation(_ location: CLLocation, completionHandler: @escaping CLGeocodeCompletionHandler) - func reverseGeocodeLocation(_ location: CLLocation) async throws -> [CLPlacemark]? + func reverseGeocodeLocation(_ location: CLLocation) async throws -> [CLPlacemark] @available(watchOS 4.0, *) func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?, completionHandler: @escaping CLGeocodeCompletionHandler) @available(watchOS 4.0, *) - func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?) async throws -> [CLPlacemark]? + func reverseGeocodeLocation(_ location: CLLocation, preferredLocale locale: Locale?) async throws -> [CLPlacemark] @available(watchOS, introduced: 1.0, deprecated: 4.0, message: "Use -geocodePostalAddress:completionHandler:") func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any], completionHandler: @escaping CLGeocodeCompletionHandler) @available(watchOS, introduced: 1.0, deprecated: 4.0, message: "Use -geocodePostalAddress:completionHandler:") - func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any]) async throws -> [CLPlacemark]? + func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any]) async throws -> [CLPlacemark] func geocodeAddressString(_ addressString: String, completionHandler: @escaping CLGeocodeCompletionHandler) - func geocodeAddressString(_ addressString: String) async throws -> [CLPlacemark]? + func geocodeAddressString(_ addressString: String) async throws -> [CLPlacemark] func geocodeAddressString(_ addressString: String, in region: CLRegion?, completionHandler: @escaping CLGeocodeCompletionHandler) - func geocodeAddressString(_ addressString: String, in region: CLRegion?) async throws -> [CLPlacemark]? + func geocodeAddressString(_ addressString: String, in region: CLRegion?) async throws -> [CLPlacemark] @available(watchOS 4.0, *) func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?, completionHandler: @escaping CLGeocodeCompletionHandler) @available(watchOS 4.0, *) - func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?) async throws -> [CLPlacemark]? + func geocodeAddressString(_ addressString: String, in region: CLRegion?, preferredLocale locale: Locale?) async throws -> [CLPlacemark] func cancelGeocode() } extension CLGeocoder { diff --git a/watchOS/CoreML/MLModel.swift b/watchOS/CoreML/MLModel.swift index f130ac4..6d4a22e 100644 --- a/watchOS/CoreML/MLModel.swift +++ b/watchOS/CoreML/MLModel.swift @@ -10,7 +10,7 @@ class MLModel : NSObject { @available(watchOS 7.0, *) class func __loadContents(of url: URL, configuration: MLModelConfiguration, completionHandler handler: @escaping (MLModel?, Error?) -> Void) @available(watchOS 7.0, *) - class func __loadContents(of url: URL, configuration: MLModelConfiguration) async throws -> MLModel? + class func __loadContents(of url: URL, configuration: MLModelConfiguration) async throws -> MLModel func prediction(from input: MLFeatureProvider) throws -> MLFeatureProvider func prediction(from input: MLFeatureProvider, options: MLPredictionOptions) throws -> MLFeatureProvider @available(watchOS 5.0, *) diff --git a/watchOS/Foundation/NSFileVersion.swift b/watchOS/Foundation/NSFileVersion.swift index febcc22..3a03661 100644 --- a/watchOS/Foundation/NSFileVersion.swift +++ b/watchOS/Foundation/NSFileVersion.swift @@ -19,7 +19,7 @@ class NSFileVersion : NSObject { @available(watchOS 2.0, *) class func getNonlocalVersionsOfItem(at url: URL, completionHandler: @escaping ([NSFileVersion]?, Error?) -> Void) @available(watchOS 2.0, *) - class func nonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion]? + class func nonlocalVersionsOfItem(at url: URL) async throws -> [NSFileVersion] class func version(itemAt url: URL, forPersistentIdentifier persistentIdentifier: Any) -> NSFileVersion? var url: URL { get } var localizedName: String? { get } diff --git a/watchOS/Foundation/NSItemProvider.swift b/watchOS/Foundation/NSItemProvider.swift index 562fa67..87a3f38 100644 --- a/watchOS/Foundation/NSItemProvider.swift +++ b/watchOS/Foundation/NSItemProvider.swift @@ -75,7 +75,7 @@ class NSItemProvider : NSObject, NSCopying { convenience init?(contentsOf fileURL: URL!) func registerItem(forTypeIdentifier typeIdentifier: String, loadHandler: @escaping NSItemProvider.LoadHandler) func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil, completionHandler: NSItemProvider.CompletionHandler? = nil) - func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding? + func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding } @available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) @@ -95,7 +95,7 @@ extension NSItemProvider { @available(watchOS 2.0, *) func loadPreviewImage(options: [AnyHashable : Any]! = [:], completionHandler: NSItemProvider.CompletionHandler!) @available(watchOS 2.0, *) - func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding? + func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding } @available(watchOS 2.0, *) let NSExtensionJavaScriptPreprocessingResultsKey: String diff --git a/watchOS/Foundation/NSURLSession.swift b/watchOS/Foundation/NSURLSession.swift index 24a2d5a..04803b8 100644 --- a/watchOS/Foundation/NSURLSession.swift +++ b/watchOS/Foundation/NSURLSession.swift @@ -127,7 +127,7 @@ class URLSessionDownloadTask : URLSessionTask { @available(watchOS 2.0, *) class URLSessionStreamTask : URLSessionTask { func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval, completionHandler: @escaping (Data?, Bool, Error?) -> Void) - func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval) async throws -> (Data?, Bool) + func readData(ofMinLength minBytes: Int, maxLength maxBytes: Int, timeout: TimeInterval) async throws -> (Data, Bool) func write(_ data: Data, timeout: TimeInterval, completionHandler: @escaping (Error?) -> Void) func write(_ data: Data, timeout: TimeInterval) async throws func captureStreams() @@ -177,7 +177,7 @@ class URLSessionWebSocketTask : URLSessionTask { func __send(_ message: __NSURLSessionWebSocketMessage, completionHandler: @escaping (Error?) -> Void) func __send(_ message: __NSURLSessionWebSocketMessage) async throws func __receiveMessage(completionHandler: @escaping (__NSURLSessionWebSocketMessage?, Error?) -> Void) - func __receiveMessage() async throws -> __NSURLSessionWebSocketMessage? + func __receiveMessage() async throws -> __NSURLSessionWebSocketMessage func sendPing(pongReceiveHandler: @escaping (Error?) -> Void) func cancel(with closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) var maximumMessageSize: Int diff --git a/watchOS/Foundation/NSUserActivity.swift b/watchOS/Foundation/NSUserActivity.swift index 277d1f7..5ed659b 100644 --- a/watchOS/Foundation/NSUserActivity.swift +++ b/watchOS/Foundation/NSUserActivity.swift @@ -26,7 +26,7 @@ class NSUserActivity : NSObject { func resignCurrent() func invalidate() func getContinuationStreams(completionHandler: @escaping (InputStream?, OutputStream?, Error?) -> Void) - func continuationStreams() async throws -> (InputStream?, OutputStream?) + func continuationStreams() async throws -> (InputStream, OutputStream) @available(watchOS 3.0, *) var isEligibleForHandoff: Bool @available(watchOS 3.0, *) diff --git a/watchOS/GameKit/GKAchievement.swift b/watchOS/GameKit/GKAchievement.swift index 74df9b6..079ff96 100644 --- a/watchOS/GameKit/GKAchievement.swift +++ b/watchOS/GameKit/GKAchievement.swift @@ -2,7 +2,7 @@ @available(watchOS 3.0, *) class GKAchievement : NSObject, NSCoding, NSSecureCoding { class func loadAchievements(completionHandler: (([GKAchievement]?, Error?) -> Void)? = nil) - class func loadAchievements() async throws -> [GKAchievement]? + class func loadAchievements() async throws -> [GKAchievement] class func resetAchievements(completionHandler: ((Error?) -> Void)? = nil) class func resetAchievements() async throws init(identifier: String) diff --git a/watchOS/GameKit/GKAchievementDescription.swift b/watchOS/GameKit/GKAchievementDescription.swift index 649f041..0656a8e 100644 --- a/watchOS/GameKit/GKAchievementDescription.swift +++ b/watchOS/GameKit/GKAchievementDescription.swift @@ -2,7 +2,7 @@ @available(watchOS 3.0, *) class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { class func loadAchievementDescriptions(completionHandler: (([GKAchievementDescription]?, Error?) -> Void)? = nil) - class func loadAchievementDescriptions() async throws -> [GKAchievementDescription]? + class func loadAchievementDescriptions() async throws -> [GKAchievementDescription] var identifier: String { get } @available(watchOS 2.0, *) var groupIdentifier: String? { get } diff --git a/watchOS/GameKit/GKLeaderboard.swift b/watchOS/GameKit/GKLeaderboard.swift index 12cdd2d..d8a2095 100644 --- a/watchOS/GameKit/GKLeaderboard.swift +++ b/watchOS/GameKit/GKLeaderboard.swift @@ -39,11 +39,11 @@ class GKLeaderboard : NSObject { @available(watchOS 7.0, *) class func loadLeaderboards(IDs leaderboardIDs: [String]?, completionHandler: @escaping ([GKLeaderboard]?, Error?) -> Void) @available(watchOS 7.0, *) - class func loadLeaderboards(IDs leaderboardIDs: [String]?) async throws -> [GKLeaderboard]? + class func loadLeaderboards(IDs leaderboardIDs: [String]?) async throws -> [GKLeaderboard] @available(watchOS 7.0, *) func loadPreviousOccurrence(completionHandler: @escaping (GKLeaderboard?, Error?) -> Void) @available(watchOS 7.0, *) - func loadPreviousOccurrence() async throws -> GKLeaderboard? + func loadPreviousOccurrence() async throws -> GKLeaderboard @available(watchOS 7.0, *) class func submitScore(_ score: Int, context: Int, player: GKPlayer, leaderboardIDs: [String], completionHandler: @escaping (Error?) -> Void) @available(watchOS 7.0, *) @@ -55,11 +55,11 @@ class GKLeaderboard : NSObject { @available(watchOS 7.0, *) func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange, completionHandler: @escaping (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Int, Error?) -> Void) @available(watchOS 7.0, *) - func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange) async throws -> (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Int) + func loadEntries(for playerScope: GKLeaderboard.PlayerScope, timeScope: GKLeaderboard.TimeScope, range: NSRange) async throws -> (GKLeaderboard.Entry, [GKLeaderboard.Entry], Int) @available(watchOS 7.0, *) func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope, completionHandler: @escaping (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?, Error?) -> Void) @available(watchOS 7.0, *) - func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope) async throws -> (GKLeaderboard.Entry?, [GKLeaderboard.Entry]?) + func loadEntries(for players: [GKPlayer], timeScope: GKLeaderboard.TimeScope) async throws -> (GKLeaderboard.Entry, [GKLeaderboard.Entry]) } extension GKLeaderboard { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use identifier instead") @@ -69,7 +69,7 @@ extension GKLeaderboard { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use loadLeaderboardsWithIDs:completionHandler: instead") class func loadCategories(completionHandler: (([String]?, [String]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use loadLeaderboardsWithIDs:completionHandler: instead") - class func loadCategories() async throws -> ([String]?, [String]?) + class func loadCategories() async throws -> ([String], [String]) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use setDefaultLeaderboardIdentifier:completionHandler: on GKLocalPlayer instead") class func setDefault(_ leaderboardIdentifier: String?, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use setDefaultLeaderboardIdentifier:completionHandler: on GKLocalPlayer instead") @@ -95,9 +95,9 @@ extension GKLeaderboard { @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") func loadScores(completionHandler: (([GKScore]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") - func loadScores() async throws -> [GKScore]? + func loadScores() async throws -> [GKScore] @available(watchOS, introduced: 2.0, deprecated: 7.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") class func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 7.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") - class func loadLeaderboards() async throws -> [GKLeaderboard]? + class func loadLeaderboards() async throws -> [GKLeaderboard] } diff --git a/watchOS/GameKit/GKLeaderboardSet.swift b/watchOS/GameKit/GKLeaderboardSet.swift index 9cb42e8..2212e3b 100644 --- a/watchOS/GameKit/GKLeaderboardSet.swift +++ b/watchOS/GameKit/GKLeaderboardSet.swift @@ -7,7 +7,7 @@ class GKLeaderboardSet : NSObject, NSCoding, NSSecureCoding { @available(watchOS 2.0, *) class func loadLeaderboardSets(completionHandler: (([GKLeaderboardSet]?, Error?) -> Void)? = nil) @available(watchOS 2.0, *) - class func loadLeaderboardSets() async throws -> [GKLeaderboardSet]? + class func loadLeaderboardSets() async throws -> [GKLeaderboardSet] @available(watchOS 7.0, *) func loadLeaderboards(handler: @escaping ([GKLeaderboard]?, Error?) -> Void) } @@ -15,5 +15,5 @@ extension GKLeaderboardSet { @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadLeaderboardsWithHandler: instead.") func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadLeaderboardsWithHandler: instead.") - func loadLeaderboards() async throws -> [GKLeaderboard]? + func loadLeaderboards() async throws -> [GKLeaderboard] } diff --git a/watchOS/GameKit/GKLocalPlayer.swift b/watchOS/GameKit/GKLocalPlayer.swift index 1b2b737..115428e 100644 --- a/watchOS/GameKit/GKLocalPlayer.swift +++ b/watchOS/GameKit/GKLocalPlayer.swift @@ -9,9 +9,9 @@ class GKLocalPlayer : GKPlayer { @available(watchOS 3.0, *) func loadRecentPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func loadRecentPlayers() async throws -> [GKPlayer]? + func loadRecentPlayers() async throws -> [GKPlayer] func loadChallengableFriends(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - func loadChallengableFriends() async throws -> [GKPlayer]? + func loadChallengableFriends() async throws -> [GKPlayer] @available(watchOS 3.0, *) func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) @@ -19,11 +19,11 @@ class GKLocalPlayer : GKPlayer { @available(watchOS 3.0, *) func loadDefaultLeaderboardIdentifier(completionHandler: ((String?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func loadDefaultLeaderboardIdentifier() async throws -> String? + func loadDefaultLeaderboardIdentifier() async throws -> String @available(watchOS 6.5, *) func fetchItems(forIdentityVerificationSignature completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(watchOS 6.5, *) - func fetchItemsForIdentityVerificationSignature() async throws -> (URL?, Data?, Data?, UInt64) + func fetchItemsForIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) } protocol GKLocalPlayerListener : GKChallengeListener, GKInviteEventListener, GKTurnBasedEventListener { } @@ -47,7 +47,7 @@ extension GKLocalPlayer { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use loadDefaultLeaderboardIdentifierWithCompletionHandler: instead") func loadDefaultLeaderboardCategoryID(completionHandler: ((String?, Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use loadDefaultLeaderboardIdentifierWithCompletionHandler: instead") - func loadDefaultLeaderboardCategoryID() async throws -> String? + func loadDefaultLeaderboardCategoryID() async throws -> String @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Set the authenticateHandler instead") func authenticate(completionHandler: ((Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Set the authenticateHandler instead") @@ -55,17 +55,17 @@ extension GKLocalPlayer { @available(watchOS, introduced: 2.0, deprecated: 3.0) func loadFriendPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 3.0) - func loadFriendPlayers() async throws -> [GKPlayer]? + func loadFriendPlayers() async throws -> [GKPlayer] @available(watchOS, introduced: 3.0, deprecated: 6.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") func generateIdentityVerificationSignature(completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(watchOS, introduced: 3.0, deprecated: 6.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") - func generateIdentityVerificationSignature() async throws -> (URL?, Data?, Data?, UInt64) + func generateIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) } extension GKLocalPlayer { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") func loadFriends(completionHandler: (([String]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") - func loadFriends() async throws -> [String]? + func loadFriends() async throws -> [String] @available(watchOS, introduced: 2.0, deprecated: 2.0, message: " This property is obsolete, Use loadFriendPlayersWithCompletionHandler: instead") var friends: [String]? { get } } diff --git a/watchOS/GameKit/GKMatchmaker.swift b/watchOS/GameKit/GKMatchmaker.swift index 4f04d01..bcfb3ae 100644 --- a/watchOS/GameKit/GKMatchmaker.swift +++ b/watchOS/GameKit/GKMatchmaker.swift @@ -62,5 +62,5 @@ extension GKMatchmaker { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") func findPlayers(forHostedMatchRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") - func findPlayers(forHostedMatchRequest request: GKMatchRequest) async throws -> [String]? + func findPlayers(forHostedMatchRequest request: GKMatchRequest) async throws -> [String] } diff --git a/watchOS/GameKit/GKPlayer.swift b/watchOS/GameKit/GKPlayer.swift index 817be76..de94d16 100644 --- a/watchOS/GameKit/GKPlayer.swift +++ b/watchOS/GameKit/GKPlayer.swift @@ -2,7 +2,7 @@ @available(watchOS 3.0, *) class GKPlayer : GKBasePlayer { class func loadPlayers(forIdentifiers identifiers: [String], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer]? + class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] var alias: String { get } } extension NSNotification.Name { diff --git a/watchOS/GameKit/GKTurnBasedMatch.swift b/watchOS/GameKit/GKTurnBasedMatch.swift index 7a1454c..c254837 100644 --- a/watchOS/GameKit/GKTurnBasedMatch.swift +++ b/watchOS/GameKit/GKTurnBasedMatch.swift @@ -94,21 +94,21 @@ class GKTurnBasedMatch : NSObject { @available(watchOS 3.0, *) var exchangeMaxInitiatedExchangesPerPlayer: Int { get } class func find(for request: GKMatchRequest, withCompletionHandler completionHandler: @escaping (GKTurnBasedMatch?, Error?) -> Void) - class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch? + class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch class func loadMatches(completionHandler: (([GKTurnBasedMatch]?, Error?) -> Void)? = nil) - class func loadMatches() async throws -> [GKTurnBasedMatch]? + class func loadMatches() async throws -> [GKTurnBasedMatch] @available(watchOS 3.0, *) class func load(withID matchID: String, withCompletionHandler completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) - class func load(withID matchID: String) async throws -> GKTurnBasedMatch? + class func load(withID matchID: String) async throws -> GKTurnBasedMatch @available(watchOS 3.0, *) func rematch(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func rematch() async throws -> GKTurnBasedMatch? + func rematch() async throws -> GKTurnBasedMatch @available(watchOS 3.0, *) func acceptInvite(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func acceptInvite() async throws -> GKTurnBasedMatch? + func acceptInvite() async throws -> GKTurnBasedMatch @available(watchOS 3.0, *) func declineInvite(completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) @@ -116,7 +116,7 @@ class GKTurnBasedMatch : NSObject { func remove(completionHandler: ((Error?) -> Void)? = nil) func remove() async throws func loadMatchData(completionHandler: ((Data?, Error?) -> Void)? = nil) - func loadMatchData() async throws -> Data? + func loadMatchData() async throws -> Data @available(watchOS 3.0, *) func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) @@ -148,7 +148,7 @@ class GKTurnBasedMatch : NSObject { @available(watchOS 3.0, *) func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval, completionHandler: ((GKTurnBasedExchange?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange? + func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange @available(watchOS 3.0, *) func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) diff --git a/watchOS/HealthKit/HKHealthStore.swift b/watchOS/HealthKit/HKHealthStore.swift index 2aaf023..a18d5a5 100644 --- a/watchOS/HealthKit/HKHealthStore.swift +++ b/watchOS/HealthKit/HKHealthStore.swift @@ -56,7 +56,7 @@ extension HKHealthStore { @available(watchOS 5.0, *) func recoverActiveWorkoutSession(completion: @escaping (HKWorkoutSession?, Error?) -> Void) @available(watchOS 5.0, *) - func recoverActiveWorkoutSession() async throws -> HKWorkoutSession? + func recoverActiveWorkoutSession() async throws -> HKWorkoutSession } extension HKHealthStore { } diff --git a/watchOS/HealthKit/HKHeartbeatSeriesBuilder.swift b/watchOS/HealthKit/HKHeartbeatSeriesBuilder.swift index 5f66eab..34ea1d4 100644 --- a/watchOS/HealthKit/HKHeartbeatSeriesBuilder.swift +++ b/watchOS/HealthKit/HKHeartbeatSeriesBuilder.swift @@ -8,5 +8,5 @@ class HKHeartbeatSeriesBuilder : HKSeriesBuilder { func addMetadata(_ metadata: [String : Any], completion: @escaping (Bool, Error?) -> Void) func addMetadata(_ metadata: [String : Any]) async throws -> Bool func finishSeries(completion: @escaping (HKHeartbeatSeriesSample?, Error?) -> Void) - func finishSeries() async throws -> HKHeartbeatSeriesSample? + func finishSeries() async throws -> HKHeartbeatSeriesSample } diff --git a/watchOS/HealthKit/HKQuantitySeriesSampleBuilder.swift b/watchOS/HealthKit/HKQuantitySeriesSampleBuilder.swift index defc7a6..0bea888 100644 --- a/watchOS/HealthKit/HKQuantitySeriesSampleBuilder.swift +++ b/watchOS/HealthKit/HKQuantitySeriesSampleBuilder.swift @@ -9,8 +9,8 @@ class HKQuantitySeriesSampleBuilder : NSObject { func insert(_ quantity: HKQuantity, for dateInterval: DateInterval) throws func insert(_ quantity: HKQuantity, at date: Date) throws func finishSeries(metadata: [String : Any]?, endDate: Date?, completion: @escaping ([HKQuantitySample]?, Error?) -> Void) - func finishSeries(metadata: [String : Any]?, endDate: Date?) async throws -> [HKQuantitySample]? + func finishSeries(metadata: [String : Any]?, endDate: Date?) async throws -> [HKQuantitySample] func finishSeries(metadata: [String : Any]?, completion: @escaping ([HKQuantitySample]?, Error?) -> Void) - func finishSeries(metadata: [String : Any]?) async throws -> [HKQuantitySample]? + func finishSeries(metadata: [String : Any]?) async throws -> [HKQuantitySample] func discard() } diff --git a/watchOS/HealthKit/HKWorkoutBuilder.swift b/watchOS/HealthKit/HKWorkoutBuilder.swift index c2bfb5a..4ebc160 100644 --- a/watchOS/HealthKit/HKWorkoutBuilder.swift +++ b/watchOS/HealthKit/HKWorkoutBuilder.swift @@ -19,7 +19,7 @@ class HKWorkoutBuilder : NSObject { func endCollection(withEnd endDate: Date, completion: @escaping (Bool, Error?) -> Void) func endCollection(withEnd endDate: Date) async throws -> Bool func finishWorkout(completion: @escaping (HKWorkout?, Error?) -> Void) - func finishWorkout() async throws -> HKWorkout? + func finishWorkout() async throws -> HKWorkout func discardWorkout() func elapsedTime(at date: Date) -> TimeInterval func statistics(for quantityType: HKQuantityType) -> HKStatistics? diff --git a/watchOS/HealthKit/HKWorkoutRouteBuilder.swift b/watchOS/HealthKit/HKWorkoutRouteBuilder.swift index 348b874..a996238 100644 --- a/watchOS/HealthKit/HKWorkoutRouteBuilder.swift +++ b/watchOS/HealthKit/HKWorkoutRouteBuilder.swift @@ -5,5 +5,5 @@ class HKWorkoutRouteBuilder : HKSeriesBuilder { func addMetadata(_ metadata: [String : Any], completion: @escaping (Bool, Error?) -> Void) func addMetadata(_ metadata: [String : Any]) async throws -> Bool func finishRoute(with workout: HKWorkout, metadata: [String : Any]?, completion: @escaping (HKWorkoutRoute?, Error?) -> Void) - func finishRoute(with workout: HKWorkout, metadata: [String : Any]?) async throws -> HKWorkoutRoute? + func finishRoute(with workout: HKWorkout, metadata: [String : Any]?) async throws -> HKWorkoutRoute } diff --git a/watchOS/Intents/INVoiceShortcutCenter.swift b/watchOS/Intents/INVoiceShortcutCenter.swift index b70f459..4e3800b 100644 --- a/watchOS/Intents/INVoiceShortcutCenter.swift +++ b/watchOS/Intents/INVoiceShortcutCenter.swift @@ -3,8 +3,8 @@ class INVoiceShortcutCenter : NSObject { class var shared: INVoiceShortcutCenter { get } func getAllVoiceShortcuts(completion completionHandler: @escaping ([INVoiceShortcut]?, Error?) -> Void) - func allVoiceShortcuts() async throws -> [INVoiceShortcut]? + func allVoiceShortcuts() async throws -> [INVoiceShortcut] func getVoiceShortcut(with identifier: UUID, completion completionHandler: @escaping (INVoiceShortcut?, Error?) -> Void) - func getVoiceShortcut(with identifier: UUID) async throws -> INVoiceShortcut? + func getVoiceShortcut(with identifier: UUID) async throws -> INVoiceShortcut func setShortcutSuggestions(_ suggestions: [INShortcut]) } diff --git a/watchOS/PassKit/PKPassLibrary.swift b/watchOS/PassKit/PKPassLibrary.swift index d6d5d01..f74c3f6 100644 --- a/watchOS/PassKit/PKPassLibrary.swift +++ b/watchOS/PassKit/PKPassLibrary.swift @@ -46,7 +46,7 @@ class PKPassLibrary : NSObject { @available(watchOS 6.2, *) func sign(_ signData: Data, using secureElementPass: PKSecureElementPass, completion: @escaping (Data?, Data?, Error?) -> Void) @available(watchOS 6.2, *) - func sign(_ signData: Data, using secureElementPass: PKSecureElementPass) async throws -> (Data?, Data?) + func sign(_ signData: Data, using secureElementPass: PKSecureElementPass) async throws -> (Data, Data) } struct PKPassLibraryNotificationName : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable { init(_ rawValue: String) diff --git a/watchOS/StoreKit/SKCloudServiceController.swift b/watchOS/StoreKit/SKCloudServiceController.swift index d56f671..9da7adb 100644 --- a/watchOS/StoreKit/SKCloudServiceController.swift +++ b/watchOS/StoreKit/SKCloudServiceController.swift @@ -30,15 +30,15 @@ class SKCloudServiceController : NSObject { @available(watchOS 4.0, *) func requestStorefrontCountryCode(completionHandler: @escaping (String?, Error?) -> Void) @available(watchOS 4.0, *) - func requestStorefrontCountryCode() async throws -> String? + func requestStorefrontCountryCode() async throws -> String @available(watchOS 7.0, *) func requestStorefrontIdentifier(completionHandler: @escaping (String?, Error?) -> Void) @available(watchOS 7.0, *) - func requestStorefrontIdentifier() async throws -> String? + func requestStorefrontIdentifier() async throws -> String @available(watchOS 7.0, *) func requestUserToken(forDeveloperToken developerToken: String, completionHandler: @escaping (String?, Error?) -> Void) @available(watchOS 7.0, *) - func requestUserToken(forDeveloperToken developerToken: String) async throws -> String? + func requestUserToken(forDeveloperToken developerToken: String) async throws -> String } extension NSNotification.Name { @available(watchOS 7.0, *) From 3e8b9b6f90c05ba3403c0c2e64e55f3cf4400d3c Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Mon, 9 Nov 2020 23:48:55 -0800 Subject: [PATCH 6/9] [Concurrency] Avoid importing 'async' overloads. When importing a method as `async`, look whether it would overload a synchronous method. If so, append the `Async` suffix to the base name to keep it out of the way of the original function. --- iOS/AVFoundation/AVPlayer.swift | 6 +++--- iOS/AVFoundation/AVPlayerItem.swift | 4 ++-- iOS/CarPlay/CPEntity.swift | 4 ++++ iOS/CarPlay/CPInterfaceController.swift | 14 +++++++------- iOS/CoreFoundation/CFError.swift | 3 --- iOS/CoreGraphics/CGAffineTransform.swift | 3 --- iOS/CoreGraphics/CGGeometry.swift | 12 ------------ iOS/CoreGraphics/CoreGraphics.swift | 7 ------- iOS/CoreLocation/CLLocationManager.swift | 2 +- iOS/ImageCaptureCore/ICDevice.swift | 2 +- iOS/MediaPlayer/MPMusicPlayerController.swift | 2 +- .../MetalPerformanceShaders.swift | 2 +- iOS/SoundAnalysis/SNAnalyzer.swift | 2 +- iOS/SpriteKit/SKNode.swift | 2 +- iOS/UIKit/UIApplication.swift | 2 +- iOS/UIKit/UICollectionView.swift | 2 +- iOS/UIKit/UIDiffableDataSource.swift | 6 +++--- iOS/UIKit/UIView.swift | 2 +- macOS/AVFoundation/AVPlayer.swift | 6 +++--- macOS/AVFoundation/AVPlayerItem.swift | 4 ++-- macOS/AppKit/NSAnimationContext.swift | 2 +- macOS/AppKit/NSDocument.swift | 6 +++--- macOS/AppKit/NSTableViewDiffableDataSource.swift | 2 +- macOS/ClockKit/ClockKit.swift | 0 macOS/CoreFoundation/CFError.swift | 3 --- macOS/CoreGraphics/CGAffineTransform.swift | 3 --- macOS/CoreGraphics/CGGeometry.swift | 16 ---------------- macOS/CoreGraphics/CoreGraphics.swift | 7 ------- macOS/CoreLocation/CLLocationManager.swift | 2 +- macOS/IOUSBHost/IOUSBHostCIMessageHelpers.swift | 4 ++++ macOS/ImageCaptureCore/ICDevice.swift | 2 +- macOS/Intents/INColor.swift | 1 + .../MetalPerformanceShaders.swift | 2 +- macOS/SoundAnalysis/SNAnalyzer.swift | 2 +- macOS/SpriteKit/SKNode.swift | 2 +- .../VZVirtioConsoleDeviceConfiguration.swift | 4 ++++ tvOS/AVFoundation/AVAssetWriter.swift | 2 +- tvOS/AVFoundation/AVPlayer.swift | 6 +++--- tvOS/AVFoundation/AVPlayerItem.swift | 4 ++-- tvOS/CoreFoundation/CFError.swift | 3 --- tvOS/CoreGraphics/CGAffineTransform.swift | 3 --- tvOS/CoreGraphics/CGGeometry.swift | 12 ------------ tvOS/CoreGraphics/CoreGraphics.swift | 7 ------- tvOS/CoreLocation/CLLocationManager.swift | 2 +- tvOS/Intents/INColor.swift | 8 ++++++++ tvOS/MediaPlayer/MPMusicPlayerController.swift | 2 +- .../MetalPerformanceShaders.swift | 2 +- tvOS/SoundAnalysis/SNAnalyzer.swift | 2 +- tvOS/SpriteKit/SKNode.swift | 2 +- tvOS/UIKit/UIApplication.swift | 2 +- tvOS/UIKit/UICollectionView.swift | 2 +- tvOS/UIKit/UIDiffableDataSource.swift | 6 +++--- tvOS/UIKit/UIView.swift | 2 +- watchOS/AVFoundation/AVPlayer.swift | 6 +++--- watchOS/CoreFoundation/CFError.swift | 3 --- watchOS/CoreGraphics/CGAffineTransform.swift | 3 --- watchOS/CoreGraphics/CGGeometry.swift | 12 ------------ watchOS/CoreGraphics/CoreGraphics.swift | 7 ------- watchOS/CoreLocation/CLLocationManager.swift | 2 +- watchOS/Intents/INColor.swift | 8 ++++++++ watchOS/SoundAnalysis/SNAnalyzer.swift | 2 +- watchOS/SpriteKit/SKNode.swift | 2 +- watchOS/WatchKit/WKExtension.swift | 2 +- 63 files changed, 92 insertions(+), 167 deletions(-) create mode 100644 iOS/CarPlay/CPEntity.swift create mode 100644 macOS/ClockKit/ClockKit.swift create mode 100644 macOS/IOUSBHost/IOUSBHostCIMessageHelpers.swift create mode 100644 macOS/Intents/INColor.swift create mode 100644 macOS/Virtualization/VZVirtioConsoleDeviceConfiguration.swift create mode 100644 tvOS/Intents/INColor.swift create mode 100644 watchOS/Intents/INColor.swift diff --git a/iOS/AVFoundation/AVPlayer.swift b/iOS/AVFoundation/AVPlayer.swift index 0d713f4..fae378a 100644 --- a/iOS/AVFoundation/AVPlayer.swift +++ b/iOS/AVFoundation/AVPlayer.swift @@ -75,17 +75,17 @@ extension AVPlayer { @available(iOS 5.0, *) func seek(to date: Date, completionHandler: @escaping (Bool) -> Void) @available(iOS 5.0, *) - func seek(to date: Date) async -> Bool + func seekAsync(to date: Date) async -> Bool func seek(to time: CMTime) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) @available(iOS 5.0, *) func seek(to time: CMTime, completionHandler: @escaping (Bool) -> Void) @available(iOS 5.0, *) - func seek(to time: CMTime) async -> Bool + func seekAsync(to time: CMTime) async -> Bool @available(iOS 5.0, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: @escaping (Bool) -> Void) @available(iOS 5.0, *) - func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + func seekAsync(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool } extension AVPlayer { @available(iOS 10.0, *) diff --git a/iOS/AVFoundation/AVPlayerItem.swift b/iOS/AVFoundation/AVPlayerItem.swift index 177cd90..92757a6 100644 --- a/iOS/AVFoundation/AVPlayerItem.swift +++ b/iOS/AVFoundation/AVPlayerItem.swift @@ -85,11 +85,11 @@ extension AVPlayerItem { @available(iOS 5.0, *) func seek(to time: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(iOS 5.0, *) - func seek(to time: CMTime) async -> Bool + func seekAsync(to time: CMTime) async -> Bool @available(iOS 5.0, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(iOS 5.0, *) - func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + func seekAsync(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool @available(iOS 5.0, *) func cancelPendingSeeks() func currentDate() -> Date? diff --git a/iOS/CarPlay/CPEntity.swift b/iOS/CarPlay/CPEntity.swift new file mode 100644 index 0000000..c278921 --- /dev/null +++ b/iOS/CarPlay/CPEntity.swift @@ -0,0 +1,4 @@ + +@available(iOS 14.0, *) +class CPEntity : NSObject, NSSecureCoding { +} diff --git a/iOS/CarPlay/CPInterfaceController.swift b/iOS/CarPlay/CPInterfaceController.swift index 9b9dcbf..6acbfba 100644 --- a/iOS/CarPlay/CPInterfaceController.swift +++ b/iOS/CarPlay/CPInterfaceController.swift @@ -8,31 +8,31 @@ class CPInterfaceController : NSObject { @available(iOS 14.0, *) func setRootTemplate(_ rootTemplate: CPTemplate, animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func setRootTemplate(_ rootTemplate: CPTemplate, animated: Bool) async throws -> Bool + func setRootTemplateAsync(_ rootTemplate: CPTemplate, animated: Bool) async throws -> Bool @available(iOS 14.0, *) func pushTemplate(_ templateToPush: CPTemplate, animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func pushTemplate(_ templateToPush: CPTemplate, animated: Bool) async throws -> Bool + func pushTemplateAsync(_ templateToPush: CPTemplate, animated: Bool) async throws -> Bool @available(iOS 14.0, *) func popTemplate(animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func popTemplate(animated: Bool) async throws -> Bool + func popTemplateAsync(animated: Bool) async throws -> Bool @available(iOS 14.0, *) func popToRootTemplate(animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func popToRootTemplate(animated: Bool) async throws -> Bool + func popToRootTemplateAsync(animated: Bool) async throws -> Bool @available(iOS 14.0, *) func pop(to targetTemplate: CPTemplate, animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func pop(to targetTemplate: CPTemplate, animated: Bool) async throws -> Bool + func popAsync(to targetTemplate: CPTemplate, animated: Bool) async throws -> Bool @available(iOS 14.0, *) func presentTemplate(_ templateToPresent: CPTemplate, animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func presentTemplate(_ templateToPresent: CPTemplate, animated: Bool) async throws -> Bool + func presentTemplateAsync(_ templateToPresent: CPTemplate, animated: Bool) async throws -> Bool @available(iOS 14.0, *) func dismissTemplate(animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func dismissTemplate(animated: Bool) async throws -> Bool + func dismissTemplateAsync(animated: Bool) async throws -> Bool var presentedTemplate: CPTemplate? { get } var rootTemplate: CPTemplate { get } var topTemplate: CPTemplate? { get } diff --git a/iOS/CoreFoundation/CFError.swift b/iOS/CoreFoundation/CFError.swift index e47d0f9..2510dc8 100644 --- a/iOS/CoreFoundation/CFError.swift +++ b/iOS/CoreFoundation/CFError.swift @@ -2,9 +2,6 @@ typealias CFErrorDomain = CFString class CFError : _CFObject { } - -extension CFError : Error { -} @available(iOS 2.0, *) func CFErrorGetTypeID() -> CFTypeID @available(iOS 2.0, *) diff --git a/iOS/CoreGraphics/CGAffineTransform.swift b/iOS/CoreGraphics/CGAffineTransform.swift index 0cd7eee..55f8c69 100644 --- a/iOS/CoreGraphics/CGAffineTransform.swift +++ b/iOS/CoreGraphics/CGAffineTransform.swift @@ -19,9 +19,6 @@ extension CGAffineTransform { extension CGAffineTransform : Codable { } - -extension CGAffineTransform : _ObjectiveCBridgeable { -} extension CGAffineTransform { @available(iOS 2.0, *) /*not inherited*/ init(translationX tx: CGFloat, y ty: CGFloat) diff --git a/iOS/CoreGraphics/CGGeometry.swift b/iOS/CoreGraphics/CGGeometry.swift index 315e756..8c766c8 100644 --- a/iOS/CoreGraphics/CGGeometry.swift +++ b/iOS/CoreGraphics/CGGeometry.swift @@ -27,9 +27,6 @@ extension CGPoint : Equatable { extension CGPoint : Codable { } - -extension CGPoint : _ObjectiveCBridgeable { -} struct CGSize { var width: CGFloat var height: CGFloat @@ -58,9 +55,6 @@ extension CGSize : Equatable { extension CGSize : Codable { } - -extension CGSize : _ObjectiveCBridgeable { -} struct CGVector { var dx: CGFloat var dy: CGFloat @@ -82,9 +76,6 @@ extension CGVector : CustomDebugStringConvertible { extension CGVector : Codable { } - -extension CGVector : _ObjectiveCBridgeable { -} struct CGRect { var origin: CGPoint var size: CGSize @@ -115,9 +106,6 @@ extension CGRect : Equatable { extension CGRect : Codable { } - -extension CGRect : _ObjectiveCBridgeable { -} @frozen enum CGRectEdge : UInt32 { init?(rawValue: UInt32) var rawValue: UInt32 { get } diff --git a/iOS/CoreGraphics/CoreGraphics.swift b/iOS/CoreGraphics/CoreGraphics.swift index f7de2ee..46e021d 100644 --- a/iOS/CoreGraphics/CoreGraphics.swift +++ b/iOS/CoreGraphics/CoreGraphics.swift @@ -39,13 +39,6 @@ extension CGFloat : _CVarArgPassedAsDouble, _CVarArgAligned { extension CGFloat : Codable { } -extension CGFloat : _ObjectiveCBridgeable { - @available(swift, deprecated: 4, renamed: "init(truncating:)") - init(_ number: __shared NSNumber) - init(truncating number: __shared NSNumber) - init?(exactly number: __shared NSNumber) -} - enum CGPathFillRule : Int { case winding case evenOdd diff --git a/iOS/CoreLocation/CLLocationManager.swift b/iOS/CoreLocation/CLLocationManager.swift index 516d1a7..80e396e 100644 --- a/iOS/CoreLocation/CLLocationManager.swift +++ b/iOS/CoreLocation/CLLocationManager.swift @@ -92,7 +92,7 @@ class CLLocationManager : NSObject { @available(iOS 14.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String, completion: ((Error?) -> Void)? = nil) @available(iOS 14.0, *) - func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) async throws + func requestTemporaryFullAccuracyAuthorizationAsync(withPurposeKey purposeKey: String) async throws @available(iOS 14.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) func startUpdatingLocation() diff --git a/iOS/ImageCaptureCore/ICDevice.swift b/iOS/ImageCaptureCore/ICDevice.swift index 7df3027..8c47a69 100644 --- a/iOS/ImageCaptureCore/ICDevice.swift +++ b/iOS/ImageCaptureCore/ICDevice.swift @@ -102,7 +102,7 @@ class ICDevice : NSObject { @available(iOS 13.0, *) func requestEject(completion: @escaping (Error?) -> Void) @available(iOS 13.0, *) - func requestEject() async throws + func requestEjectAsync() async throws } protocol ICDeviceDelegate : NSObjectProtocol { @available(iOS 13.0, *) diff --git a/iOS/MediaPlayer/MPMusicPlayerController.swift b/iOS/MediaPlayer/MPMusicPlayerController.swift index e6e561c..bacd12b 100644 --- a/iOS/MediaPlayer/MPMusicPlayerController.swift +++ b/iOS/MediaPlayer/MPMusicPlayerController.swift @@ -57,7 +57,7 @@ class MPMusicPlayerController : NSObject, MPMediaPlayback { @available(iOS 10.1, *) func prepareToPlay(completionHandler: @escaping (Error?) -> Void) @available(iOS 10.1, *) - func prepareToPlay() async throws + func prepareToPlayAsync() async throws func skipToNextItem() func skipToBeginning() func skipToPreviousItem() diff --git a/iOS/MetalPerformanceShaders/MetalPerformanceShaders.swift b/iOS/MetalPerformanceShaders/MetalPerformanceShaders.swift index f3ff8bc..c8b523c 100644 --- a/iOS/MetalPerformanceShaders/MetalPerformanceShaders.swift +++ b/iOS/MetalPerformanceShaders/MetalPerformanceShaders.swift @@ -3739,7 +3739,7 @@ class MPSAccelerationStructure : MPSKernel, NSSecureCoding, NSCopying { init?(coder aDecoder: NSCoder, group: MPSAccelerationStructureGroup) func rebuild() func rebuild(completionHandler: @escaping MPSAccelerationStructureCompletionHandler) - func rebuild() async -> MPSAccelerationStructure? + func rebuildAsync() async -> MPSAccelerationStructure? func encodeRefit(commandBuffer: MTLCommandBuffer) func copy(with zone: NSZone? = nil, group: MPSAccelerationStructureGroup) -> Self } diff --git a/iOS/SoundAnalysis/SNAnalyzer.swift b/iOS/SoundAnalysis/SNAnalyzer.swift index 120a693..d99aee8 100644 --- a/iOS/SoundAnalysis/SNAnalyzer.swift +++ b/iOS/SoundAnalysis/SNAnalyzer.swift @@ -16,6 +16,6 @@ class SNAudioFileAnalyzer : NSObject { func removeAllRequests() func analyze() func analyze(completionHandler: @escaping (Bool) -> Void) - func analyze() async -> Bool + func analyzeAsync() async -> Bool func cancelAnalysis() } diff --git a/iOS/SpriteKit/SKNode.swift b/iOS/SpriteKit/SKNode.swift index ac24ee2..5e6a671 100644 --- a/iOS/SpriteKit/SKNode.swift +++ b/iOS/SpriteKit/SKNode.swift @@ -65,7 +65,7 @@ class SKNode : UIResponder, NSCopying, NSSecureCoding, UIFocusItem { func inParentHierarchy(_ parent: SKNode) -> Bool func run(_ action: SKAction) func run(_ action: SKAction, completion block: @escaping () -> Void) - func run(_ action: SKAction) async + func runActionAsync(_ action: SKAction) async func run(_ action: SKAction, withKey key: String) func hasActions() -> Bool func action(forKey key: String) -> SKAction? diff --git a/iOS/UIKit/UIApplication.swift b/iOS/UIKit/UIApplication.swift index 765821f..dd3a901 100644 --- a/iOS/UIKit/UIApplication.swift +++ b/iOS/UIKit/UIApplication.swift @@ -342,7 +342,7 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(iOS 7.0, *) @asyncHandler optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) @available(iOS 7.0, *) - optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) async -> UIBackgroundFetchResult + optional func applicationAsync(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) async -> UIBackgroundFetchResult @available(iOS, introduced: 7.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead") optional func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) @available(iOS, introduced: 7.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead") diff --git a/iOS/UIKit/UICollectionView.swift b/iOS/UIKit/UICollectionView.swift index c0047f0..00e61a0 100644 --- a/iOS/UIKit/UICollectionView.swift +++ b/iOS/UIKit/UICollectionView.swift @@ -155,7 +155,7 @@ class UICollectionView : UIScrollView, UIDataSourceTranslating { @available(iOS 7.0, *) func setCollectionViewLayout(_ layout: UICollectionViewLayout, animated: Bool, completion: ((Bool) -> Void)? = nil) @available(iOS 7.0, *) - func setCollectionViewLayout(_ layout: UICollectionViewLayout, animated: Bool) async -> Bool + func setCollectionViewLayoutAsync(_ layout: UICollectionViewLayout, animated: Bool) async -> Bool @available(iOS 7.0, *) func startInteractiveTransition(to layout: UICollectionViewLayout, completion: UICollectionView.LayoutInteractiveTransitionCompletion? = nil) -> UICollectionViewTransitionLayout @available(iOS 7.0, *) diff --git a/iOS/UIKit/UIDiffableDataSource.swift b/iOS/UIKit/UIDiffableDataSource.swift index c06eacf..879845a 100644 --- a/iOS/UIKit/UIDiffableDataSource.swift +++ b/iOS/UIKit/UIDiffableDataSource.swift @@ -64,7 +64,7 @@ class UICollectionViewDiffableDataSourceReference : NSObject, UICollectionViewDa func snapshot() -> NSDiffableDataSourceSnapshotReference func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool, completion: (() -> Void)? = nil) - func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async + func applySnapshotAsync(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async func itemIdentifier(for indexPath: IndexPath) -> Any? func indexPath(forItemIdentifier identifier: Any) -> IndexPath? @available(iOS 14.0, *) @@ -74,7 +74,7 @@ class UICollectionViewDiffableDataSourceReference : NSObject, UICollectionViewDa @available(iOS 14.0, *) func applySnapshot(_ snapshot: NSDiffableDataSourceSectionSnapshotReference, toSection sectionIdentifier: Any, animatingDifferences: Bool, completion: (() -> Void)? = nil) @available(iOS 14.0, *) - func applySnapshot(_ snapshot: NSDiffableDataSourceSectionSnapshotReference, toSection sectionIdentifier: Any, animatingDifferences: Bool) async + func applySnapshotAsync(_ snapshot: NSDiffableDataSourceSectionSnapshotReference, toSection sectionIdentifier: Any, animatingDifferences: Bool) async @available(iOS 14.0, *) func snapshot(forSection section: Any) -> NSDiffableDataSourceSectionSnapshotReference @available(iOS 14.0, *) @@ -87,7 +87,7 @@ class UITableViewDiffableDataSourceReference : NSObject, UITableViewDataSource { func snapshot() -> NSDiffableDataSourceSnapshotReference func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool, completion: (() -> Void)? = nil) - func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async + func applySnapshotAsync(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async func itemIdentifier(for indexPath: IndexPath) -> Any? func indexPath(forItemIdentifier identifier: Any) -> IndexPath? var defaultRowAnimation: UITableView.RowAnimation diff --git a/iOS/UIKit/UIView.swift b/iOS/UIKit/UIView.swift index c945d61..b42e359 100644 --- a/iOS/UIKit/UIView.swift +++ b/iOS/UIKit/UIView.swift @@ -251,7 +251,7 @@ extension UIView { @available(iOS 4.0, *) class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(iOS 4.0, *) - class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void) async -> Bool + class func animateAsync(withDuration duration: TimeInterval, animations: @escaping () -> Void) async -> Bool @available(iOS 4.0, *) class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void) @available(iOS 7.0, *) diff --git a/macOS/AVFoundation/AVPlayer.swift b/macOS/AVFoundation/AVPlayer.swift index c476504..7a494f9 100644 --- a/macOS/AVFoundation/AVPlayer.swift +++ b/macOS/AVFoundation/AVPlayer.swift @@ -67,17 +67,17 @@ extension AVPlayer { @available(macOS 10.7, *) func seek(to date: Date, completionHandler: @escaping (Bool) -> Void) @available(macOS 10.7, *) - func seek(to date: Date) async -> Bool + func seekAsync(to date: Date) async -> Bool func seek(to time: CMTime) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) @available(macOS 10.7, *) func seek(to time: CMTime, completionHandler: @escaping (Bool) -> Void) @available(macOS 10.7, *) - func seek(to time: CMTime) async -> Bool + func seekAsync(to time: CMTime) async -> Bool @available(macOS 10.7, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: @escaping (Bool) -> Void) @available(macOS 10.7, *) - func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + func seekAsync(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool } extension AVPlayer { @available(macOS 10.12, *) diff --git a/macOS/AVFoundation/AVPlayerItem.swift b/macOS/AVFoundation/AVPlayerItem.swift index cc18e2a..5a95e13 100644 --- a/macOS/AVFoundation/AVPlayerItem.swift +++ b/macOS/AVFoundation/AVPlayerItem.swift @@ -85,11 +85,11 @@ extension AVPlayerItem { @available(macOS 10.7, *) func seek(to time: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.7, *) - func seek(to time: CMTime) async -> Bool + func seekAsync(to time: CMTime) async -> Bool @available(macOS 10.7, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.7, *) - func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + func seekAsync(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool @available(macOS 10.7, *) func cancelPendingSeeks() func currentDate() -> Date? diff --git a/macOS/AppKit/NSAnimationContext.swift b/macOS/AppKit/NSAnimationContext.swift index 4c91a48..2bd8402 100644 --- a/macOS/AppKit/NSAnimationContext.swift +++ b/macOS/AppKit/NSAnimationContext.swift @@ -4,7 +4,7 @@ class NSAnimationContext : NSObject { @available(macOS 10.7, *) class func runAnimationGroup(_ changes: (NSAnimationContext) -> Void, completionHandler: (() -> Void)? = nil) @available(macOS 10.7, *) - class func runAnimationGroup(_ changes: (NSAnimationContext) -> Void) async + class func runAnimationGroupAsync(_ changes: (NSAnimationContext) -> Void) async @available(macOS 10.12, *) class func runAnimationGroup(_ changes: (NSAnimationContext) -> Void) class func beginGrouping() diff --git a/macOS/AppKit/NSDocument.swift b/macOS/AppKit/NSDocument.swift index 2423b14..3a68ca0 100644 --- a/macOS/AppKit/NSDocument.swift +++ b/macOS/AppKit/NSDocument.swift @@ -127,7 +127,7 @@ class NSDocument : NSObject, NSEditorRegistration, NSFilePresenter, NSMenuItemVa @available(macOS 10.8, *) func move(completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.8, *) - func move() async -> Bool + func moveAsync() async -> Bool @available(macOS 10.8, *) func move(to url: URL, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) @@ -139,7 +139,7 @@ class NSDocument : NSObject, NSEditorRegistration, NSFilePresenter, NSMenuItemVa @available(macOS 10.8, *) func lock(completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.8, *) - func lock() async -> Bool + func lockAsync() async -> Bool @available(macOS 10.8, *) func lock(completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) @@ -147,7 +147,7 @@ class NSDocument : NSObject, NSEditorRegistration, NSFilePresenter, NSMenuItemVa @available(macOS 10.8, *) func unlock(completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.8, *) - func unlock() async -> Bool + func unlockAsync() async -> Bool @available(macOS 10.8, *) func unlock(completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) diff --git a/macOS/AppKit/NSTableViewDiffableDataSource.swift b/macOS/AppKit/NSTableViewDiffableDataSource.swift index 86544b8..6eff199 100644 --- a/macOS/AppKit/NSTableViewDiffableDataSource.swift +++ b/macOS/AppKit/NSTableViewDiffableDataSource.swift @@ -5,7 +5,7 @@ class NSTableViewDiffableDataSourceReference NSDiffableDataSourceSnapshotReference func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool, completion: (() -> Void)? = nil) - func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async + func applySnapshotAsync(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async func itemIdentifier(forRow row: Int) -> ItemIdentifierType? func row(forItemIdentifier identifier: ItemIdentifierType) -> Int func sectionIdentifier(forRow row: Int) -> SectionIdentifierType? diff --git a/macOS/ClockKit/ClockKit.swift b/macOS/ClockKit/ClockKit.swift new file mode 100644 index 0000000..e69de29 diff --git a/macOS/CoreFoundation/CFError.swift b/macOS/CoreFoundation/CFError.swift index 379007c..23df644 100644 --- a/macOS/CoreFoundation/CFError.swift +++ b/macOS/CoreFoundation/CFError.swift @@ -2,9 +2,6 @@ typealias CFErrorDomain = CFString class CFError : _CFObject { } - -extension CFError : Error { -} @available(macOS 10.5, *) func CFErrorGetTypeID() -> CFTypeID @available(macOS 10.5, *) diff --git a/macOS/CoreGraphics/CGAffineTransform.swift b/macOS/CoreGraphics/CGAffineTransform.swift index 0f9b482..43175ef 100644 --- a/macOS/CoreGraphics/CGAffineTransform.swift +++ b/macOS/CoreGraphics/CGAffineTransform.swift @@ -19,9 +19,6 @@ extension CGAffineTransform { extension CGAffineTransform : Codable { } - -extension CGAffineTransform : _ObjectiveCBridgeable { -} extension CGAffineTransform { @available(macOS 10.0, *) /*not inherited*/ init(translationX tx: CGFloat, y ty: CGFloat) diff --git a/macOS/CoreGraphics/CGGeometry.swift b/macOS/CoreGraphics/CGGeometry.swift index c4ec132..19ce78e 100644 --- a/macOS/CoreGraphics/CGGeometry.swift +++ b/macOS/CoreGraphics/CGGeometry.swift @@ -27,9 +27,6 @@ extension CGPoint : Equatable { extension CGPoint : Codable { } - -extension CGPoint : _ObjectiveCBridgeable { -} struct CGSize { var width: CGFloat var height: CGFloat @@ -58,9 +55,6 @@ extension CGSize : Equatable { extension CGSize : Codable { } - -extension CGSize : _ObjectiveCBridgeable { -} struct CGVector { var dx: CGFloat var dy: CGFloat @@ -82,9 +76,6 @@ extension CGVector : CustomDebugStringConvertible { extension CGVector : Codable { } - -extension CGVector : _ObjectiveCBridgeable { -} struct CGRect { var origin: CGPoint var size: CGSize @@ -115,9 +106,6 @@ extension CGRect : Equatable { extension CGRect : Codable { } - -extension CGRect : _ObjectiveCBridgeable { -} @frozen enum CGRectEdge : UInt32 { init?(rawValue: UInt32) var rawValue: UInt32 { get } @@ -126,10 +114,6 @@ extension CGRect : _ObjectiveCBridgeable { case maxXEdge case maxYEdge } - -extension CGRectEdge { - @inlinable init(rectEdge: NSRectEdge) -} extension CGPoint { @available(macOS 10.0, *) func equalTo(_ point2: CGPoint) -> Bool diff --git a/macOS/CoreGraphics/CoreGraphics.swift b/macOS/CoreGraphics/CoreGraphics.swift index 359a694..6ae746b 100644 --- a/macOS/CoreGraphics/CoreGraphics.swift +++ b/macOS/CoreGraphics/CoreGraphics.swift @@ -39,13 +39,6 @@ extension CGFloat : _CVarArgPassedAsDouble, _CVarArgAligned { extension CGFloat : Codable { } -extension CGFloat : _ObjectiveCBridgeable { - @available(swift, deprecated: 4, renamed: "init(truncating:)") - init(_ number: __shared NSNumber) - init(truncating number: __shared NSNumber) - init?(exactly number: __shared NSNumber) -} - func CGGetLastMouseDelta() -> (x: Int32, y: Int32) enum CGPathFillRule : Int { diff --git a/macOS/CoreLocation/CLLocationManager.swift b/macOS/CoreLocation/CLLocationManager.swift index 156334a..41e0e77 100644 --- a/macOS/CoreLocation/CLLocationManager.swift +++ b/macOS/CoreLocation/CLLocationManager.swift @@ -98,7 +98,7 @@ class CLLocationManager : NSObject { @available(macOS 11.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String, completion: ((Error?) -> Void)? = nil) @available(macOS 11.0, *) - func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) async throws + func requestTemporaryFullAccuracyAuthorizationAsync(withPurposeKey purposeKey: String) async throws @available(macOS 11.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) func startUpdatingLocation() diff --git a/macOS/IOUSBHost/IOUSBHostCIMessageHelpers.swift b/macOS/IOUSBHost/IOUSBHostCIMessageHelpers.swift new file mode 100644 index 0000000..c6d2b50 --- /dev/null +++ b/macOS/IOUSBHost/IOUSBHostCIMessageHelpers.swift @@ -0,0 +1,4 @@ + +func IOUSBHostCIMessageStatusToIOReturn(_ status: IOUSBHostCIMessageStatus) -> IOReturn +func IOUSBHostCIMessageStatusFromIOReturn(_ status: IOReturn) -> IOUSBHostCIMessageStatus +func IOUSBHostCILinkStateEnabled(_ linkState: IOUSBHostCILinkState) -> Bool diff --git a/macOS/ImageCaptureCore/ICDevice.swift b/macOS/ImageCaptureCore/ICDevice.swift index 8b99ea2..c017035 100644 --- a/macOS/ImageCaptureCore/ICDevice.swift +++ b/macOS/ImageCaptureCore/ICDevice.swift @@ -152,7 +152,7 @@ class ICDevice : NSObject { @available(macOS 10.15, *) func requestEject(completion: @escaping (Error?) -> Void) @available(macOS 10.15, *) - func requestEject() async throws + func requestEjectAsync() async throws @available(macOS 10.4, *) var autolaunchApplicationPath: String? @available(macOS 10.4, *) diff --git a/macOS/Intents/INColor.swift b/macOS/Intents/INColor.swift new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/macOS/Intents/INColor.swift @@ -0,0 +1 @@ + diff --git a/macOS/MetalPerformanceShaders/MetalPerformanceShaders.swift b/macOS/MetalPerformanceShaders/MetalPerformanceShaders.swift index 721e70e..f3cbb12 100644 --- a/macOS/MetalPerformanceShaders/MetalPerformanceShaders.swift +++ b/macOS/MetalPerformanceShaders/MetalPerformanceShaders.swift @@ -3732,7 +3732,7 @@ class MPSAccelerationStructure : MPSKernel, NSSecureCoding, NSCopying { init?(coder aDecoder: NSCoder, group: MPSAccelerationStructureGroup) func rebuild() func rebuild(completionHandler: @escaping MPSAccelerationStructureCompletionHandler) - func rebuild() async -> MPSAccelerationStructure? + func rebuildAsync() async -> MPSAccelerationStructure? func encodeRefit(commandBuffer: MTLCommandBuffer) func copy(with zone: NSZone? = nil, group: MPSAccelerationStructureGroup) -> Self } diff --git a/macOS/SoundAnalysis/SNAnalyzer.swift b/macOS/SoundAnalysis/SNAnalyzer.swift index 7a6bb6f..82822c0 100644 --- a/macOS/SoundAnalysis/SNAnalyzer.swift +++ b/macOS/SoundAnalysis/SNAnalyzer.swift @@ -16,6 +16,6 @@ class SNAudioFileAnalyzer : NSObject { func removeAllRequests() func analyze() func analyze(completionHandler: @escaping (Bool) -> Void) - func analyze() async -> Bool + func analyzeAsync() async -> Bool func cancelAnalysis() } diff --git a/macOS/SpriteKit/SKNode.swift b/macOS/SpriteKit/SKNode.swift index f94255b..6259ab7 100644 --- a/macOS/SpriteKit/SKNode.swift +++ b/macOS/SpriteKit/SKNode.swift @@ -56,7 +56,7 @@ class SKNode : NSResponder, NSCopying, NSSecureCoding { func inParentHierarchy(_ parent: SKNode) -> Bool func run(_ action: SKAction) func run(_ action: SKAction, completion block: @escaping () -> Void) - func run(_ action: SKAction) async + func runActionAsync(_ action: SKAction) async func run(_ action: SKAction, withKey key: String) func hasActions() -> Bool func action(forKey key: String) -> SKAction? diff --git a/macOS/Virtualization/VZVirtioConsoleDeviceConfiguration.swift b/macOS/Virtualization/VZVirtioConsoleDeviceConfiguration.swift new file mode 100644 index 0000000..008c40a --- /dev/null +++ b/macOS/Virtualization/VZVirtioConsoleDeviceConfiguration.swift @@ -0,0 +1,4 @@ + +@available(macOS 11.0, *) +class VZVirtioConsoleDeviceConfiguration : VZSerialPortConfiguration { +} diff --git a/tvOS/AVFoundation/AVAssetWriter.swift b/tvOS/AVFoundation/AVAssetWriter.swift index 2821f6a..e46a1a3 100644 --- a/tvOS/AVFoundation/AVAssetWriter.swift +++ b/tvOS/AVFoundation/AVAssetWriter.swift @@ -38,7 +38,7 @@ class AVAssetWriter : NSObject { @available(tvOS 9.0, *) func finishWriting(completionHandler handler: @escaping () -> Void) @available(tvOS 9.0, *) - func finishWriting() async + func finishWritingAsync() async } extension AVAssetWriter { var movieFragmentInterval: CMTime diff --git a/tvOS/AVFoundation/AVPlayer.swift b/tvOS/AVFoundation/AVPlayer.swift index f5504d1..a920ea2 100644 --- a/tvOS/AVFoundation/AVPlayer.swift +++ b/tvOS/AVFoundation/AVPlayer.swift @@ -75,17 +75,17 @@ extension AVPlayer { @available(tvOS 9.0, *) func seek(to date: Date, completionHandler: @escaping (Bool) -> Void) @available(tvOS 9.0, *) - func seek(to date: Date) async -> Bool + func seekAsync(to date: Date) async -> Bool func seek(to time: CMTime) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) @available(tvOS 9.0, *) func seek(to time: CMTime, completionHandler: @escaping (Bool) -> Void) @available(tvOS 9.0, *) - func seek(to time: CMTime) async -> Bool + func seekAsync(to time: CMTime) async -> Bool @available(tvOS 9.0, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: @escaping (Bool) -> Void) @available(tvOS 9.0, *) - func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + func seekAsync(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool } extension AVPlayer { @available(tvOS 10.0, *) diff --git a/tvOS/AVFoundation/AVPlayerItem.swift b/tvOS/AVFoundation/AVPlayerItem.swift index 167c361..14d1e21 100644 --- a/tvOS/AVFoundation/AVPlayerItem.swift +++ b/tvOS/AVFoundation/AVPlayerItem.swift @@ -85,11 +85,11 @@ extension AVPlayerItem { @available(tvOS 9.0, *) func seek(to time: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(tvOS 9.0, *) - func seek(to time: CMTime) async -> Bool + func seekAsync(to time: CMTime) async -> Bool @available(tvOS 9.0, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(tvOS 9.0, *) - func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + func seekAsync(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool @available(tvOS 9.0, *) func cancelPendingSeeks() func currentDate() -> Date? diff --git a/tvOS/CoreFoundation/CFError.swift b/tvOS/CoreFoundation/CFError.swift index f80e436..2d2e3be 100644 --- a/tvOS/CoreFoundation/CFError.swift +++ b/tvOS/CoreFoundation/CFError.swift @@ -2,9 +2,6 @@ typealias CFErrorDomain = CFString class CFError : _CFObject { } - -extension CFError : Error { -} @available(tvOS 9.0, *) func CFErrorGetTypeID() -> CFTypeID @available(tvOS 9.0, *) diff --git a/tvOS/CoreGraphics/CGAffineTransform.swift b/tvOS/CoreGraphics/CGAffineTransform.swift index 5e9a917..585e09b 100644 --- a/tvOS/CoreGraphics/CGAffineTransform.swift +++ b/tvOS/CoreGraphics/CGAffineTransform.swift @@ -19,9 +19,6 @@ extension CGAffineTransform { extension CGAffineTransform : Codable { } - -extension CGAffineTransform : _ObjectiveCBridgeable { -} extension CGAffineTransform { @available(tvOS 2.0, *) /*not inherited*/ init(translationX tx: CGFloat, y ty: CGFloat) diff --git a/tvOS/CoreGraphics/CGGeometry.swift b/tvOS/CoreGraphics/CGGeometry.swift index 76c045f..e99e84c 100644 --- a/tvOS/CoreGraphics/CGGeometry.swift +++ b/tvOS/CoreGraphics/CGGeometry.swift @@ -27,9 +27,6 @@ extension CGPoint : Equatable { extension CGPoint : Codable { } - -extension CGPoint : _ObjectiveCBridgeable { -} struct CGSize { var width: CGFloat var height: CGFloat @@ -58,9 +55,6 @@ extension CGSize : Equatable { extension CGSize : Codable { } - -extension CGSize : _ObjectiveCBridgeable { -} struct CGVector { var dx: CGFloat var dy: CGFloat @@ -82,9 +76,6 @@ extension CGVector : CustomDebugStringConvertible { extension CGVector : Codable { } - -extension CGVector : _ObjectiveCBridgeable { -} struct CGRect { var origin: CGPoint var size: CGSize @@ -115,9 +106,6 @@ extension CGRect : Equatable { extension CGRect : Codable { } - -extension CGRect : _ObjectiveCBridgeable { -} @frozen enum CGRectEdge : UInt32 { init?(rawValue: UInt32) var rawValue: UInt32 { get } diff --git a/tvOS/CoreGraphics/CoreGraphics.swift b/tvOS/CoreGraphics/CoreGraphics.swift index f7de2ee..46e021d 100644 --- a/tvOS/CoreGraphics/CoreGraphics.swift +++ b/tvOS/CoreGraphics/CoreGraphics.swift @@ -39,13 +39,6 @@ extension CGFloat : _CVarArgPassedAsDouble, _CVarArgAligned { extension CGFloat : Codable { } -extension CGFloat : _ObjectiveCBridgeable { - @available(swift, deprecated: 4, renamed: "init(truncating:)") - init(_ number: __shared NSNumber) - init(truncating number: __shared NSNumber) - init?(exactly number: __shared NSNumber) -} - enum CGPathFillRule : Int { case winding case evenOdd diff --git a/tvOS/CoreLocation/CLLocationManager.swift b/tvOS/CoreLocation/CLLocationManager.swift index fcf098d..94ec76f 100644 --- a/tvOS/CoreLocation/CLLocationManager.swift +++ b/tvOS/CoreLocation/CLLocationManager.swift @@ -56,7 +56,7 @@ class CLLocationManager : NSObject { @available(tvOS 14.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String, completion: ((Error?) -> Void)? = nil) @available(tvOS 14.0, *) - func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) async throws + func requestTemporaryFullAccuracyAuthorizationAsync(withPurposeKey purposeKey: String) async throws @available(tvOS 14.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) func stopUpdatingLocation() diff --git a/tvOS/Intents/INColor.swift b/tvOS/Intents/INColor.swift new file mode 100644 index 0000000..41eb19e --- /dev/null +++ b/tvOS/Intents/INColor.swift @@ -0,0 +1,8 @@ + +@available(tvOS 14.0, *) +class INColor : NSObject, NSCopying, NSSecureCoding { + init(red: Double, green: Double, blue: Double) + var red: Double { get } + var green: Double { get } + var blue: Double { get } +} diff --git a/tvOS/MediaPlayer/MPMusicPlayerController.swift b/tvOS/MediaPlayer/MPMusicPlayerController.swift index 34d91a8..6c0057b 100644 --- a/tvOS/MediaPlayer/MPMusicPlayerController.swift +++ b/tvOS/MediaPlayer/MPMusicPlayerController.swift @@ -55,7 +55,7 @@ class MPMusicPlayerController : NSObject, MPMediaPlayback { @available(tvOS 14.0, *) func prepareToPlay(completionHandler: @escaping (Error?) -> Void) @available(tvOS 14.0, *) - func prepareToPlay() async throws + func prepareToPlayAsync() async throws func skipToNextItem() func skipToBeginning() func skipToPreviousItem() diff --git a/tvOS/MetalPerformanceShaders/MetalPerformanceShaders.swift b/tvOS/MetalPerformanceShaders/MetalPerformanceShaders.swift index 76ed380..a6c72a4 100644 --- a/tvOS/MetalPerformanceShaders/MetalPerformanceShaders.swift +++ b/tvOS/MetalPerformanceShaders/MetalPerformanceShaders.swift @@ -3739,7 +3739,7 @@ class MPSAccelerationStructure : MPSKernel, NSSecureCoding, NSCopying { init?(coder aDecoder: NSCoder, group: MPSAccelerationStructureGroup) func rebuild() func rebuild(completionHandler: @escaping MPSAccelerationStructureCompletionHandler) - func rebuild() async -> MPSAccelerationStructure? + func rebuildAsync() async -> MPSAccelerationStructure? func encodeRefit(commandBuffer: MTLCommandBuffer) func copy(with zone: NSZone? = nil, group: MPSAccelerationStructureGroup) -> Self } diff --git a/tvOS/SoundAnalysis/SNAnalyzer.swift b/tvOS/SoundAnalysis/SNAnalyzer.swift index db4f2c1..39c89ee 100644 --- a/tvOS/SoundAnalysis/SNAnalyzer.swift +++ b/tvOS/SoundAnalysis/SNAnalyzer.swift @@ -16,6 +16,6 @@ class SNAudioFileAnalyzer : NSObject { func removeAllRequests() func analyze() func analyze(completionHandler: @escaping (Bool) -> Void) - func analyze() async -> Bool + func analyzeAsync() async -> Bool func cancelAnalysis() } diff --git a/tvOS/SpriteKit/SKNode.swift b/tvOS/SpriteKit/SKNode.swift index f8699e8..9f9ec9e 100644 --- a/tvOS/SpriteKit/SKNode.swift +++ b/tvOS/SpriteKit/SKNode.swift @@ -65,7 +65,7 @@ class SKNode : UIResponder, NSCopying, NSSecureCoding, UIFocusItem { func inParentHierarchy(_ parent: SKNode) -> Bool func run(_ action: SKAction) func run(_ action: SKAction, completion block: @escaping () -> Void) - func run(_ action: SKAction) async + func runActionAsync(_ action: SKAction) async func run(_ action: SKAction, withKey key: String) func hasActions() -> Bool func action(forKey key: String) -> SKAction? diff --git a/tvOS/UIKit/UIApplication.swift b/tvOS/UIKit/UIApplication.swift index 2d68041..1c70501 100644 --- a/tvOS/UIKit/UIApplication.swift +++ b/tvOS/UIKit/UIApplication.swift @@ -209,7 +209,7 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(tvOS 7.0, *) @asyncHandler optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) @available(tvOS 7.0, *) - optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) async -> UIBackgroundFetchResult + optional func applicationAsync(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) async -> UIBackgroundFetchResult @available(tvOS, introduced: 11.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead") optional func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) @available(tvOS, introduced: 11.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead") diff --git a/tvOS/UIKit/UICollectionView.swift b/tvOS/UIKit/UICollectionView.swift index 4180f7a..09506f1 100644 --- a/tvOS/UIKit/UICollectionView.swift +++ b/tvOS/UIKit/UICollectionView.swift @@ -119,7 +119,7 @@ class UICollectionView : UIScrollView, UIDataSourceTranslating { @available(tvOS 7.0, *) func setCollectionViewLayout(_ layout: UICollectionViewLayout, animated: Bool, completion: ((Bool) -> Void)? = nil) @available(tvOS 7.0, *) - func setCollectionViewLayout(_ layout: UICollectionViewLayout, animated: Bool) async -> Bool + func setCollectionViewLayoutAsync(_ layout: UICollectionViewLayout, animated: Bool) async -> Bool @available(tvOS 7.0, *) func startInteractiveTransition(to layout: UICollectionViewLayout, completion: UICollectionView.LayoutInteractiveTransitionCompletion? = nil) -> UICollectionViewTransitionLayout @available(tvOS 7.0, *) diff --git a/tvOS/UIKit/UIDiffableDataSource.swift b/tvOS/UIKit/UIDiffableDataSource.swift index 3a7457e..9c07cb5 100644 --- a/tvOS/UIKit/UIDiffableDataSource.swift +++ b/tvOS/UIKit/UIDiffableDataSource.swift @@ -64,7 +64,7 @@ class UICollectionViewDiffableDataSourceReference : NSObject, UICollectionViewDa func snapshot() -> NSDiffableDataSourceSnapshotReference func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool, completion: (() -> Void)? = nil) - func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async + func applySnapshotAsync(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async func itemIdentifier(for indexPath: IndexPath) -> Any? func indexPath(forItemIdentifier identifier: Any) -> IndexPath? @available(tvOS 14.0, *) @@ -74,7 +74,7 @@ class UICollectionViewDiffableDataSourceReference : NSObject, UICollectionViewDa @available(tvOS 14.0, *) func applySnapshot(_ snapshot: NSDiffableDataSourceSectionSnapshotReference, toSection sectionIdentifier: Any, animatingDifferences: Bool, completion: (() -> Void)? = nil) @available(tvOS 14.0, *) - func applySnapshot(_ snapshot: NSDiffableDataSourceSectionSnapshotReference, toSection sectionIdentifier: Any, animatingDifferences: Bool) async + func applySnapshotAsync(_ snapshot: NSDiffableDataSourceSectionSnapshotReference, toSection sectionIdentifier: Any, animatingDifferences: Bool) async @available(tvOS 14.0, *) func snapshot(forSection section: Any) -> NSDiffableDataSourceSectionSnapshotReference @available(tvOS 14.0, *) @@ -87,7 +87,7 @@ class UITableViewDiffableDataSourceReference : NSObject, UITableViewDataSource { func snapshot() -> NSDiffableDataSourceSnapshotReference func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool, completion: (() -> Void)? = nil) - func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async + func applySnapshotAsync(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async func itemIdentifier(for indexPath: IndexPath) -> Any? func indexPath(forItemIdentifier identifier: Any) -> IndexPath? var defaultRowAnimation: UITableView.RowAnimation diff --git a/tvOS/UIKit/UIView.swift b/tvOS/UIKit/UIView.swift index 803d011..4a673b2 100644 --- a/tvOS/UIKit/UIView.swift +++ b/tvOS/UIKit/UIView.swift @@ -249,7 +249,7 @@ extension UIView { @available(tvOS 4.0, *) class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(tvOS 4.0, *) - class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void) async -> Bool + class func animateAsync(withDuration duration: TimeInterval, animations: @escaping () -> Void) async -> Bool @available(tvOS 4.0, *) class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void) @available(tvOS 7.0, *) diff --git a/watchOS/AVFoundation/AVPlayer.swift b/watchOS/AVFoundation/AVPlayer.swift index c8669ca..4ddb870 100644 --- a/watchOS/AVFoundation/AVPlayer.swift +++ b/watchOS/AVFoundation/AVPlayer.swift @@ -65,17 +65,17 @@ extension AVPlayer { @available(watchOS 1.0, *) func seek(to date: Date, completionHandler: @escaping (Bool) -> Void) @available(watchOS 1.0, *) - func seek(to date: Date) async -> Bool + func seekAsync(to date: Date) async -> Bool func seek(to time: CMTime) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) @available(watchOS 1.0, *) func seek(to time: CMTime, completionHandler: @escaping (Bool) -> Void) @available(watchOS 1.0, *) - func seek(to time: CMTime) async -> Bool + func seekAsync(to time: CMTime) async -> Bool @available(watchOS 1.0, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: @escaping (Bool) -> Void) @available(watchOS 1.0, *) - func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + func seekAsync(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool } extension AVPlayer { @available(watchOS 3.0, *) diff --git a/watchOS/CoreFoundation/CFError.swift b/watchOS/CoreFoundation/CFError.swift index 7ed783f..1ebf2cd 100644 --- a/watchOS/CoreFoundation/CFError.swift +++ b/watchOS/CoreFoundation/CFError.swift @@ -2,9 +2,6 @@ typealias CFErrorDomain = CFString class CFError : _CFObject { } - -extension CFError : Error { -} @available(watchOS 2.0, *) func CFErrorGetTypeID() -> CFTypeID @available(watchOS 2.0, *) diff --git a/watchOS/CoreGraphics/CGAffineTransform.swift b/watchOS/CoreGraphics/CGAffineTransform.swift index 361871f..8d43baa 100644 --- a/watchOS/CoreGraphics/CGAffineTransform.swift +++ b/watchOS/CoreGraphics/CGAffineTransform.swift @@ -19,9 +19,6 @@ extension CGAffineTransform { extension CGAffineTransform : Codable { } - -extension CGAffineTransform : _ObjectiveCBridgeable { -} extension CGAffineTransform { @available(watchOS 2.0, *) /*not inherited*/ init(translationX tx: CGFloat, y ty: CGFloat) diff --git a/watchOS/CoreGraphics/CGGeometry.swift b/watchOS/CoreGraphics/CGGeometry.swift index dc86118..3cf2bac 100644 --- a/watchOS/CoreGraphics/CGGeometry.swift +++ b/watchOS/CoreGraphics/CGGeometry.swift @@ -27,9 +27,6 @@ extension CGPoint : Equatable { extension CGPoint : Codable { } - -extension CGPoint : _ObjectiveCBridgeable { -} struct CGSize { var width: CGFloat var height: CGFloat @@ -58,9 +55,6 @@ extension CGSize : Equatable { extension CGSize : Codable { } - -extension CGSize : _ObjectiveCBridgeable { -} struct CGVector { var dx: CGFloat var dy: CGFloat @@ -82,9 +76,6 @@ extension CGVector : CustomDebugStringConvertible { extension CGVector : Codable { } - -extension CGVector : _ObjectiveCBridgeable { -} struct CGRect { var origin: CGPoint var size: CGSize @@ -115,9 +106,6 @@ extension CGRect : Equatable { extension CGRect : Codable { } - -extension CGRect : _ObjectiveCBridgeable { -} @frozen enum CGRectEdge : UInt32 { init?(rawValue: UInt32) var rawValue: UInt32 { get } diff --git a/watchOS/CoreGraphics/CoreGraphics.swift b/watchOS/CoreGraphics/CoreGraphics.swift index 2e9534a..e191279 100644 --- a/watchOS/CoreGraphics/CoreGraphics.swift +++ b/watchOS/CoreGraphics/CoreGraphics.swift @@ -39,13 +39,6 @@ extension CGFloat : _CVarArgPassedAsDouble, _CVarArgAligned { extension CGFloat : Codable { } -extension CGFloat : _ObjectiveCBridgeable { - @available(swift, deprecated: 4, renamed: "init(truncating:)") - init(_ number: __shared NSNumber) - init(truncating number: __shared NSNumber) - init?(exactly number: __shared NSNumber) -} - enum CGPathFillRule : Int { case winding case evenOdd diff --git a/watchOS/CoreLocation/CLLocationManager.swift b/watchOS/CoreLocation/CLLocationManager.swift index adddb42..fa1812a 100644 --- a/watchOS/CoreLocation/CLLocationManager.swift +++ b/watchOS/CoreLocation/CLLocationManager.swift @@ -70,7 +70,7 @@ class CLLocationManager : NSObject { @available(watchOS 7.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String, completion: ((Error?) -> Void)? = nil) @available(watchOS 7.0, *) - func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) async throws + func requestTemporaryFullAccuracyAuthorizationAsync(withPurposeKey purposeKey: String) async throws @available(watchOS 7.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) @available(watchOS 3.0, *) diff --git a/watchOS/Intents/INColor.swift b/watchOS/Intents/INColor.swift new file mode 100644 index 0000000..5a19839 --- /dev/null +++ b/watchOS/Intents/INColor.swift @@ -0,0 +1,8 @@ + +@available(watchOS 7.0, *) +class INColor : NSObject, NSCopying, NSSecureCoding { + init(red: Double, green: Double, blue: Double) + var red: Double { get } + var green: Double { get } + var blue: Double { get } +} diff --git a/watchOS/SoundAnalysis/SNAnalyzer.swift b/watchOS/SoundAnalysis/SNAnalyzer.swift index 919d21d..c06461e 100644 --- a/watchOS/SoundAnalysis/SNAnalyzer.swift +++ b/watchOS/SoundAnalysis/SNAnalyzer.swift @@ -16,6 +16,6 @@ class SNAudioFileAnalyzer : NSObject { func removeAllRequests() func analyze() func analyze(completionHandler: @escaping (Bool) -> Void) - func analyze() async -> Bool + func analyzeAsync() async -> Bool func cancelAnalysis() } diff --git a/watchOS/SpriteKit/SKNode.swift b/watchOS/SpriteKit/SKNode.swift index 66a4201..9f5db34 100644 --- a/watchOS/SpriteKit/SKNode.swift +++ b/watchOS/SpriteKit/SKNode.swift @@ -56,7 +56,7 @@ class SKNode : NSObject, NSCopying, NSSecureCoding { func inParentHierarchy(_ parent: SKNode) -> Bool func run(_ action: SKAction) func run(_ action: SKAction, completion block: @escaping () -> Void) - func run(_ action: SKAction) async + func runActionAsync(_ action: SKAction) async func run(_ action: SKAction, withKey key: String) func hasActions() -> Bool func action(forKey key: String) -> SKAction? diff --git a/watchOS/WatchKit/WKExtension.swift b/watchOS/WatchKit/WKExtension.swift index 3e3cc8b..2d9de0b 100644 --- a/watchOS/WatchKit/WKExtension.swift +++ b/watchOS/WatchKit/WKExtension.swift @@ -71,7 +71,7 @@ protocol WKExtensionDelegate : NSObjectProtocol { @available(watchOS 6.0, *) @asyncHandler optional func didReceiveRemoteNotification(_ userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (WKBackgroundFetchResult) -> Void) @available(watchOS 6.0, *) - optional func didReceiveRemoteNotification(_ userInfo: [AnyHashable : Any]) async -> WKBackgroundFetchResult + optional func didReceiveRemoteNotificationAsync(_ userInfo: [AnyHashable : Any]) async -> WKBackgroundFetchResult @available(watchOS 2.0, *) @available(watchOS, deprecated: 3.0, message: "use UNUserNotificationCenterDelegate") optional func handleAction(withIdentifier identifier: String?, forRemoteNotification remoteNotification: [AnyHashable : Any]) From 23da09ffef679e7df1b4f49ba8acff5f0f8821ac Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Tue, 10 Nov 2020 21:24:59 -0800 Subject: [PATCH 7/9] Append "Async" suffix to imported async methods with nullable completion handlers. --- .../AVAsynchronousKeyValueLoading.swift | 2 +- iOS/AVFoundation/AVCaptureDevice.swift | 2 +- iOS/AVFoundation/AVCapturePhotoOutput.swift | 2 +- iOS/AVFoundation/AVPlayer.swift | 2 +- .../AVSampleBufferRenderSynchronizer.swift | 2 +- .../ASCredentialIdentityStore.swift | 4 +- ...ASCredentialProviderExtensionContext.swift | 2 +- .../CXCallDirectoryExtensionContext.swift | 2 +- iOS/CallKit/CXCallDirectoryManager.swift | 4 +- iOS/ClassKit/CLSDataStore.swift | 2 +- iOS/CoreHaptics/CHHapticEngine.swift | 4 +- iOS/CoreSpotlight/CSSearchableIndex.swift | 10 ++--- .../EAAccessoryManager.swift | 2 +- iOS/Foundation/NSExtensionContext.swift | 2 +- iOS/Foundation/NSItemProvider.swift | 4 +- iOS/GameController/GCController.swift | 2 +- iOS/GameKit/GKAchievement.swift | 6 +-- iOS/GameKit/GKAchievementDescription.swift | 4 +- iOS/GameKit/GKChallenge.swift | 12 +++--- iOS/GameKit/GKLeaderboard.swift | 6 +-- iOS/GameKit/GKLeaderboardSet.swift | 6 +-- iOS/GameKit/GKLocalPlayer.swift | 16 ++++---- iOS/GameKit/GKMatch.swift | 2 +- iOS/GameKit/GKMatchmaker.swift | 14 +++---- iOS/GameKit/GKNotificationBanner.swift | 4 +- iOS/GameKit/GKPlayer.swift | 4 +- iOS/GameKit/GKSavedGame.swift | 10 ++--- iOS/GameKit/GKScore.swift | 2 +- iOS/GameKit/GKTurnBasedMatch.swift | 36 ++++++++--------- iOS/Intents/INRelevantShortcutStore.swift | 2 +- iOS/MapKit/MKMapItem.swift | 4 +- iOS/MediaPlayer/MPMediaLibrary.swift | 2 +- iOS/MediaPlayer/MPMediaPlaylist.swift | 4 +- iOS/Messages/MSConversation.swift | 16 ++++---- iOS/NetworkExtension/NetworkExtension.swift | 10 ++--- iOS/PassKit/PKPassLibrary.swift | 6 +-- .../PKPaymentAuthorizationController.swift | 4 +- iOS/Photos/PHPhotoLibrary.swift | 2 +- iOS/ReplayKit/RPScreenRecorder.swift | 2 +- .../SFContentBlockerManager.swift | 2 +- .../SKCloudServiceSetupViewController.swift | 2 +- .../SKProductStorePromotionController.swift | 4 +- iOS/UIKit/UIApplication.swift | 4 +- iOS/UIKit/UICollectionView.swift | 2 +- iOS/UIKit/UIDocument.swift | 10 ++--- .../UIDocumentBrowserViewController.swift | 2 +- iOS/UIKit/UIFocusAnimationCoordinator.swift | 6 +-- iOS/UIKit/UIPageViewController.swift | 2 +- iOS/UIKit/UIPrinter.swift | 2 +- iOS/UIKit/UIScene.swift | 2 +- iOS/UIKit/UITableView.swift | 2 +- iOS/UIKit/UIView.swift | 12 +++--- iOS/UIKit/UIViewController.swift | 6 +-- .../UNUserNotificationCenter.swift | 2 +- iOS/WebKit/WKHTTPCookieStore.swift | 4 +- iOS/WebKit/WKWebView.swift | 6 +-- .../AVAsynchronousKeyValueLoading.swift | 2 +- macOS/AVFoundation/AVPlayer.swift | 2 +- .../AVSampleBufferRenderSynchronizer.swift | 2 +- macOS/AVKit/AVPlayerView.swift | 2 +- macOS/AppKit/NSAlert.swift | 2 +- macOS/AppKit/NSCollectionView.swift | 2 +- macOS/AppKit/NSDocument.swift | 10 ++--- macOS/AppKit/NSSpellChecker.swift | 2 +- macOS/AppKit/NSViewController.swift | 2 +- macOS/AppKit/NSWindow.swift | 4 +- macOS/AppKit/NSWorkspace.swift | 10 ++--- .../ASCredentialIdentityStore.swift | 4 +- ...ASCredentialProviderExtensionContext.swift | 2 +- macOS/ClassKit/CLSDataStore.swift | 2 +- macOS/Collaboration/CBIdentityPicker.swift | 2 +- macOS/CoreHaptics/CHHapticEngine.swift | 4 +- macOS/CoreSpotlight/CSSearchableIndex.swift | 10 ++--- macOS/Foundation/NSExtensionContext.swift | 2 +- macOS/Foundation/NSItemProvider.swift | 4 +- macOS/Foundation/NSUserScriptTask.swift | 8 ++-- macOS/GameController/GCController.swift | 2 +- macOS/GameKit/GKAchievement.swift | 8 ++-- macOS/GameKit/GKAchievementDescription.swift | 4 +- macOS/GameKit/GKChallenge.swift | 12 +++--- macOS/GameKit/GKLeaderboard.swift | 8 ++-- macOS/GameKit/GKLeaderboardSet.swift | 6 +-- macOS/GameKit/GKLocalPlayer.swift | 20 +++++----- macOS/GameKit/GKMatch.swift | 2 +- macOS/GameKit/GKMatchmaker.swift | 14 +++---- macOS/GameKit/GKNotificationBanner.swift | 4 +- macOS/GameKit/GKPlayer.swift | 4 +- macOS/GameKit/GKSavedGame.swift | 10 ++--- macOS/GameKit/GKScore.swift | 4 +- macOS/GameKit/GKTurnBasedMatch.swift | 36 ++++++++--------- macOS/IOUSBHost/IOUSBHostObject.swift | 2 +- macOS/IOUSBHost/IOUSBHostPipe.swift | 6 +-- macOS/IOUSBHost/IOUSBHostStream.swift | 2 +- macOS/NetworkExtension/NetworkExtension.swift | 8 ++-- macOS/PassKit/PKPassLibrary.swift | 6 +-- .../PKPaymentAuthorizationController.swift | 4 +- macOS/Photos/PHPhotoLibrary.swift | 2 +- macOS/ReplayKit/RPScreenRecorder.swift | 2 +- .../SFContentBlockerManager.swift | 2 +- .../SafariServices/SFSafariApplication.swift | 6 +-- macOS/SafariServices/SFSafariTab.swift | 2 +- macOS/SafariServices/SFSafariWindow.swift | 2 +- .../SKProductStorePromotionController.swift | 4 +- .../UNUserNotificationCenter.swift | 2 +- macOS/WebKit/WKHTTPCookieStore.swift | 4 +- macOS/WebKit/WKWebView.swift | 6 +-- .../AVAsynchronousKeyValueLoading.swift | 2 +- tvOS/AVFoundation/AVCaptureDevice.swift | 2 +- tvOS/AVFoundation/AVPlayer.swift | 2 +- .../AVSampleBufferRenderSynchronizer.swift | 2 +- .../AVContentProposalViewController.swift | 2 +- tvOS/AVKit/AVPlayerViewController.swift | 2 +- tvOS/CoreHaptics/CHHapticEngine.swift | 4 +- tvOS/CoreSpotlight/CSSearchableIndex.swift | 2 +- .../EAAccessoryManager.swift | 2 +- tvOS/Foundation/NSExtensionContext.swift | 2 +- tvOS/Foundation/NSItemProvider.swift | 4 +- tvOS/GameController/GCController.swift | 2 +- tvOS/GameKit/GKAchievement.swift | 6 +-- tvOS/GameKit/GKAchievementDescription.swift | 4 +- tvOS/GameKit/GKChallenge.swift | 10 ++--- tvOS/GameKit/GKLeaderboard.swift | 4 +- tvOS/GameKit/GKLeaderboardSet.swift | 4 +- tvOS/GameKit/GKLocalPlayer.swift | 14 +++---- tvOS/GameKit/GKMatch.swift | 2 +- tvOS/GameKit/GKMatchmaker.swift | 12 +++--- tvOS/GameKit/GKNotificationBanner.swift | 4 +- tvOS/GameKit/GKPlayer.swift | 4 +- tvOS/GameKit/GKScore.swift | 2 +- tvOS/GameKit/GKTurnBasedMatch.swift | 36 ++++++++--------- tvOS/MediaPlayer/MPNowPlayingSession.swift | 2 +- tvOS/Photos/PHPhotoLibrary.swift | 2 +- tvOS/ReplayKit/RPScreenRecorder.swift | 2 +- .../SKProductStorePromotionController.swift | 4 +- tvOS/TVMLKit/TVApplicationController.swift | 2 +- tvOS/UIKit/UIApplication.swift | 4 +- tvOS/UIKit/UICollectionView.swift | 2 +- tvOS/UIKit/UIFocusAnimationCoordinator.swift | 6 +-- tvOS/UIKit/UIPageViewController.swift | 2 +- tvOS/UIKit/UIScene.swift | 2 +- tvOS/UIKit/UITableView.swift | 2 +- tvOS/UIKit/UIView.swift | 12 +++--- tvOS/UIKit/UIViewController.swift | 6 +-- .../UNUserNotificationCenter.swift | 2 +- .../AVAsynchronousKeyValueLoading.swift | 2 +- watchOS/AVFoundation/AVCaptureDevice.swift | 2 +- watchOS/AVFoundation/AVPlayer.swift | 2 +- watchOS/AVFoundation/AVPlayerItem.swift | 4 +- .../AVSampleBufferRenderSynchronizer.swift | 2 +- watchOS/Foundation/NSExtensionContext.swift | 2 +- watchOS/Foundation/NSItemProvider.swift | 4 +- watchOS/GameKit/GKAchievement.swift | 8 ++-- .../GameKit/GKAchievementDescription.swift | 2 +- watchOS/GameKit/GKLeaderboard.swift | 8 ++-- watchOS/GameKit/GKLeaderboardSet.swift | 4 +- watchOS/GameKit/GKLocalPlayer.swift | 22 +++++----- watchOS/GameKit/GKMatchmaker.swift | 2 +- watchOS/GameKit/GKPlayer.swift | 2 +- watchOS/GameKit/GKScore.swift | 4 +- watchOS/GameKit/GKTurnBasedMatch.swift | 40 +++++++++---------- watchOS/Intents/INRelevantShortcutStore.swift | 2 +- .../NetworkExtension/NetworkExtension.swift | 2 +- watchOS/PassKit/PKPassLibrary.swift | 4 +- .../PKPaymentAuthorizationController.swift | 4 +- .../UNUserNotificationCenter.swift | 2 +- 165 files changed, 434 insertions(+), 434 deletions(-) diff --git a/iOS/AVFoundation/AVAsynchronousKeyValueLoading.swift b/iOS/AVFoundation/AVAsynchronousKeyValueLoading.swift index 22888c5..d104d0f 100644 --- a/iOS/AVFoundation/AVAsynchronousKeyValueLoading.swift +++ b/iOS/AVFoundation/AVAsynchronousKeyValueLoading.swift @@ -11,5 +11,5 @@ enum AVKeyValueStatus : Int { protocol AVAsynchronousKeyValueLoading { func statusOfValue(forKey key: String, error outError: NSErrorPointer) -> AVKeyValueStatus func loadValuesAsynchronously(forKeys keys: [String], completionHandler handler: (() -> Void)? = nil) - func loadValues(forKeys keys: [String]) async + func loadValuesAsync(forKeys keys: [String]) async } diff --git a/iOS/AVFoundation/AVCaptureDevice.swift b/iOS/AVFoundation/AVCaptureDevice.swift index 2788a89..c0a6eaf 100644 --- a/iOS/AVFoundation/AVCaptureDevice.swift +++ b/iOS/AVFoundation/AVCaptureDevice.swift @@ -302,7 +302,7 @@ extension AVCaptureDevice { @available(iOS 8.0, *) func setExposureTargetBias(_ bias: Float, completionHandler handler: ((CMTime) -> Void)? = nil) @available(iOS 8.0, *) - func setExposureTargetBias(_ bias: Float) async -> CMTime + func setExposureTargetBiasAsync(_ bias: Float) async -> CMTime } extension AVCaptureDevice { @available(iOS 13.0, *) diff --git a/iOS/AVFoundation/AVCapturePhotoOutput.swift b/iOS/AVFoundation/AVCapturePhotoOutput.swift index 939da5a..bdad278 100644 --- a/iOS/AVFoundation/AVCapturePhotoOutput.swift +++ b/iOS/AVFoundation/AVCapturePhotoOutput.swift @@ -4,7 +4,7 @@ class AVCapturePhotoOutput : AVCaptureOutput { func capturePhoto(with settings: AVCapturePhotoSettings, delegate: AVCapturePhotoCaptureDelegate) var preparedPhotoSettingsArray: [AVCapturePhotoSettings] { get } func setPreparedPhotoSettingsArray(_ preparedPhotoSettingsArray: [AVCapturePhotoSettings], completionHandler: ((Bool, Error?) -> Void)? = nil) - func setPreparedPhotoSettingsArray(_ preparedPhotoSettingsArray: [AVCapturePhotoSettings]) async throws -> Bool + func setPreparedPhotoSettingsArrayAsync(_ preparedPhotoSettingsArray: [AVCapturePhotoSettings]) async throws -> Bool var __availablePhotoPixelFormatTypes: [NSNumber] { get } var availablePhotoCodecTypes: [AVVideoCodecType] { get } var __availableRawPhotoPixelFormatTypes: [NSNumber] { get } diff --git a/iOS/AVFoundation/AVPlayer.swift b/iOS/AVFoundation/AVPlayer.swift index fae378a..8f4577c 100644 --- a/iOS/AVFoundation/AVPlayer.swift +++ b/iOS/AVFoundation/AVPlayer.swift @@ -95,7 +95,7 @@ extension AVPlayer { @available(iOS 6.0, *) func preroll(atRate rate: Float, completionHandler: ((Bool) -> Void)? = nil) @available(iOS 6.0, *) - func preroll(atRate rate: Float) async -> Bool + func prerollAsync(atRate rate: Float) async -> Bool @available(iOS 6.0, *) func cancelPendingPrerolls() @available(iOS 6.0, *) diff --git a/iOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift b/iOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift index 275ce02..588de06 100644 --- a/iOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift +++ b/iOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift @@ -15,7 +15,7 @@ extension AVSampleBufferRenderSynchronizer { var renderers: [AVQueuedSampleBufferRendering] { get } func addRenderer(_ renderer: AVQueuedSampleBufferRendering) func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime, completionHandler: ((Bool) -> Void)? = nil) - func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool + func removeRendererAsync(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool } extension AVSampleBufferRenderSynchronizer { func addPeriodicTimeObserver(forInterval interval: CMTime, queue: DispatchQueue?, using block: @escaping (CMTime) -> Void) -> Any diff --git a/iOS/AuthenticationServices/ASCredentialIdentityStore.swift b/iOS/AuthenticationServices/ASCredentialIdentityStore.swift index 055ceca..2fb3798 100644 --- a/iOS/AuthenticationServices/ASCredentialIdentityStore.swift +++ b/iOS/AuthenticationServices/ASCredentialIdentityStore.swift @@ -16,9 +16,9 @@ class ASCredentialIdentityStore : NSObject { func getState(_ completion: @escaping (ASCredentialIdentityStoreState) -> Void) func getState() async -> ASCredentialIdentityStoreState func saveCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity], completion: ((Bool, Error?) -> Void)? = nil) - func saveCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool + func saveCredentialIdentitiesAsync(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool func removeCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity], completion: ((Bool, Error?) -> Void)? = nil) - func removeCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool + func removeCredentialIdentitiesAsync(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool func removeAllCredentialIdentities(_ completion: ((Bool, Error?) -> Void)? = nil) func removeAllCredentialIdentities() async throws -> Bool func replaceCredentialIdentities(with newCredentialIdentities: [ASPasswordCredentialIdentity], completion: ((Bool, Error?) -> Void)? = nil) diff --git a/iOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift b/iOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift index ac01301..b1944a0 100644 --- a/iOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift +++ b/iOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift @@ -2,6 +2,6 @@ @available(iOS 12.0, *) class ASCredentialProviderExtensionContext : NSExtensionContext { func completeRequest(withSelectedCredential credential: ASPasswordCredential, completionHandler: ((Bool) -> Void)? = nil) - func completeRequest(withSelectedCredential credential: ASPasswordCredential) async -> Bool + func completeRequestAsync(withSelectedCredential credential: ASPasswordCredential) async -> Bool func completeExtensionConfigurationRequest() } diff --git a/iOS/CallKit/CXCallDirectoryExtensionContext.swift b/iOS/CallKit/CXCallDirectoryExtensionContext.swift index 188ef16..4573d91 100644 --- a/iOS/CallKit/CXCallDirectoryExtensionContext.swift +++ b/iOS/CallKit/CXCallDirectoryExtensionContext.swift @@ -19,5 +19,5 @@ class CXCallDirectoryExtensionContext : NSExtensionContext { @available(iOS 11.0, *) func removeAllIdentificationEntries() func completeRequest(completionHandler completion: ((Bool) -> Void)? = nil) - func completeRequest() async -> Bool + func completeRequestAsync() async -> Bool } diff --git a/iOS/CallKit/CXCallDirectoryManager.swift b/iOS/CallKit/CXCallDirectoryManager.swift index 4e26aca..2ef1be0 100644 --- a/iOS/CallKit/CXCallDirectoryManager.swift +++ b/iOS/CallKit/CXCallDirectoryManager.swift @@ -13,11 +13,11 @@ extension CXCallDirectoryManager { class CXCallDirectoryManager : NSObject { class var sharedInstance: CXCallDirectoryManager { get } func reloadExtension(withIdentifier identifier: String, completionHandler completion: ((Error?) -> Void)? = nil) - func reloadExtension(withIdentifier identifier: String) async throws + func reloadExtensionAsync(withIdentifier identifier: String) async throws func getEnabledStatusForExtension(withIdentifier identifier: String, completionHandler completion: @escaping (CXCallDirectoryManager.EnabledStatus, Error?) -> Void) func enabledStatusForExtension(withIdentifier identifier: String) async throws -> CXCallDirectoryManager.EnabledStatus @available(iOS 13.4, *) func openSettings(completionHandler completion: ((Error?) -> Void)? = nil) @available(iOS 13.4, *) - func openSettings() async throws + func openSettingsAsync() async throws } diff --git a/iOS/ClassKit/CLSDataStore.swift b/iOS/ClassKit/CLSDataStore.swift index e626453..ebdfd39 100644 --- a/iOS/ClassKit/CLSDataStore.swift +++ b/iOS/ClassKit/CLSDataStore.swift @@ -11,7 +11,7 @@ class CLSDataStore : NSObject { var runningActivity: CLSActivity? { get } weak var delegate: @sil_weak CLSDataStoreDelegate? func save(completion: ((Error?) -> Void)? = nil) - func save() async throws + func saveAsync() async throws @available(iOS 12.2, *) func completeAllAssignedActivities(matching contextPath: [String]) } diff --git a/iOS/CoreHaptics/CHHapticEngine.swift b/iOS/CoreHaptics/CHHapticEngine.swift index 6d80bb7..30725f5 100644 --- a/iOS/CoreHaptics/CHHapticEngine.swift +++ b/iOS/CoreHaptics/CHHapticEngine.swift @@ -35,10 +35,10 @@ class CHHapticEngine : NSObject { var isAutoShutdownEnabled: Bool init() throws func start(completionHandler: CHHapticEngine.CompletionHandler? = nil) - func start() async throws + func startAsync() async throws func start() throws func stop(completionHandler: CHHapticEngine.CompletionHandler? = nil) - func stop() async throws + func stopAsync() async throws func notifyWhenPlayersFinished(finishedHandler: @escaping CHHapticEngine.FinishedHandler) func makePlayer(with pattern: CHHapticPattern) throws -> CHHapticPatternPlayer func makeAdvancedPlayer(with pattern: CHHapticPattern) throws -> CHHapticAdvancedPatternPlayer diff --git a/iOS/CoreSpotlight/CSSearchableIndex.swift b/iOS/CoreSpotlight/CSSearchableIndex.swift index 981f9dd..83b7a08 100644 --- a/iOS/CoreSpotlight/CSSearchableIndex.swift +++ b/iOS/CoreSpotlight/CSSearchableIndex.swift @@ -22,18 +22,18 @@ class CSSearchableIndex : NSObject { init(name: String) init(name: String, protectionClass: FileProtectionType?) func indexSearchableItems(_ items: [CSSearchableItem], completionHandler: ((Error?) -> Void)? = nil) - func indexSearchableItems(_ items: [CSSearchableItem]) async throws + func indexSearchableItemsAsync(_ items: [CSSearchableItem]) async throws func deleteSearchableItems(withIdentifiers identifiers: [String], completionHandler: ((Error?) -> Void)? = nil) - func deleteSearchableItems(withIdentifiers identifiers: [String]) async throws + func deleteSearchableItemsAsync(withIdentifiers identifiers: [String]) async throws func deleteSearchableItems(withDomainIdentifiers domainIdentifiers: [String], completionHandler: ((Error?) -> Void)? = nil) - func deleteSearchableItems(withDomainIdentifiers domainIdentifiers: [String]) async throws + func deleteSearchableItemsAsync(withDomainIdentifiers domainIdentifiers: [String]) async throws func deleteAllSearchableItems(completionHandler: ((Error?) -> Void)? = nil) - func deleteAllSearchableItems() async throws + func deleteAllSearchableItemsAsync() async throws } extension CSSearchableIndex { func beginBatch() func endBatch(withClientState clientState: Data, completionHandler: ((Error?) -> Void)? = nil) - func endBatch(withClientState clientState: Data) async throws + func endBatchAsync(withClientState clientState: Data) async throws func fetchLastClientState(completionHandler: @escaping (Data?, Error?) -> Void) func fetchLastClientState() async throws -> Data } diff --git a/iOS/ExternalAccessory/EAAccessoryManager.swift b/iOS/ExternalAccessory/EAAccessoryManager.swift index be889f2..f4e06ad 100644 --- a/iOS/ExternalAccessory/EAAccessoryManager.swift +++ b/iOS/ExternalAccessory/EAAccessoryManager.swift @@ -27,7 +27,7 @@ class EAAccessoryManager : NSObject { @available(iOS 6, *) func showBluetoothAccessoryPicker(withNameFilter predicate: NSPredicate?, completion: EABluetoothAccessoryPickerCompletion? = nil) @available(iOS 6, *) - func showBluetoothAccessoryPicker(withNameFilter predicate: NSPredicate?) async throws + func showBluetoothAccessoryPickerAsync(withNameFilter predicate: NSPredicate?) async throws @available(iOS 3.0, *) func registerForLocalNotifications() @available(iOS 3.0, *) diff --git a/iOS/Foundation/NSExtensionContext.swift b/iOS/Foundation/NSExtensionContext.swift index 4624399..8affdc2 100644 --- a/iOS/Foundation/NSExtensionContext.swift +++ b/iOS/Foundation/NSExtensionContext.swift @@ -6,7 +6,7 @@ class NSExtensionContext : NSObject { func completeRequest(returningItems items: [Any]?) async -> Bool func cancelRequest(withError error: Error) func open(_ URL: URL, completionHandler: ((Bool) -> Void)? = nil) - func open(_ URL: URL) async -> Bool + func openURLAsync(_ URL: URL) async -> Bool } @available(iOS 8.0, *) let NSExtensionItemsAndErrorsKey: String diff --git a/iOS/Foundation/NSItemProvider.swift b/iOS/Foundation/NSItemProvider.swift index a4c2572..b994003 100644 --- a/iOS/Foundation/NSItemProvider.swift +++ b/iOS/Foundation/NSItemProvider.swift @@ -77,7 +77,7 @@ class NSItemProvider : NSObject, NSCopying { convenience init?(contentsOf fileURL: URL!) func registerItem(forTypeIdentifier typeIdentifier: String, loadHandler: @escaping NSItemProvider.LoadHandler) func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil, completionHandler: NSItemProvider.CompletionHandler? = nil) - func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding + func loadItemAsync(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding } @available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) @@ -97,7 +97,7 @@ extension NSItemProvider { @available(iOS 8.0, *) func loadPreviewImage(options: [AnyHashable : Any]! = [:], completionHandler: NSItemProvider.CompletionHandler!) @available(iOS 8.0, *) - func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding + func loadPreviewImageAsync(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding } @available(iOS 8.0, *) let NSExtensionJavaScriptPreprocessingResultsKey: String diff --git a/iOS/GameController/GCController.swift b/iOS/GameController/GCController.swift index 330bc2a..79b2b6e 100644 --- a/iOS/GameController/GCController.swift +++ b/iOS/GameController/GCController.swift @@ -44,7 +44,7 @@ class GCController : NSObject, GCDevice { func capture() -> GCController class func controllers() -> [GCController] class func startWirelessControllerDiscovery(completionHandler: (() -> Void)? = nil) - class func startWirelessControllerDiscovery() async + class func startWirelessControllerDiscoveryAsync() async class func stopWirelessControllerDiscovery() @available(iOS 13.0, *) class func withMicroGamepad() -> GCController diff --git a/iOS/GameKit/GKAchievement.swift b/iOS/GameKit/GKAchievement.swift index 2f43c52..b8f8d80 100644 --- a/iOS/GameKit/GKAchievement.swift +++ b/iOS/GameKit/GKAchievement.swift @@ -2,16 +2,16 @@ @available(iOS 4.1, *) class GKAchievement : NSObject, NSCoding, NSSecureCoding { class func loadAchievements(completionHandler: (([GKAchievement]?, Error?) -> Void)? = nil) - class func loadAchievements() async throws -> [GKAchievement] + class func loadAchievementsAsync() async throws -> [GKAchievement] class func resetAchievements(completionHandler: ((Error?) -> Void)? = nil) - class func resetAchievements() async throws + class func resetAchievementsAsync() async throws init(identifier: String) @available(iOS 8.0, *) init(identifier: String, player: GKPlayer) @available(iOS 6.0, *) class func report(_ achievements: [GKAchievement], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(iOS 6.0, *) - class func report(_ achievements: [GKAchievement]) async throws + class func reportAchievementsAsync(_ achievements: [GKAchievement]) async throws var identifier: String var percentComplete: Double var isCompleted: Bool { get } diff --git a/iOS/GameKit/GKAchievementDescription.swift b/iOS/GameKit/GKAchievementDescription.swift index fe8c020..1aace71 100644 --- a/iOS/GameKit/GKAchievementDescription.swift +++ b/iOS/GameKit/GKAchievementDescription.swift @@ -2,7 +2,7 @@ @available(iOS 4.1, *) class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { class func loadAchievementDescriptions(completionHandler: (([GKAchievementDescription]?, Error?) -> Void)? = nil) - class func loadAchievementDescriptions() async throws -> [GKAchievementDescription] + class func loadAchievementDescriptionsAsync() async throws -> [GKAchievementDescription] var identifier: String { get } @available(iOS 6.0, *) var groupIdentifier: String? { get } @@ -16,7 +16,7 @@ class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { } extension GKAchievementDescription { func loadImage(completionHandler: ((UIImage?, Error?) -> Void)? = nil) - func loadImage() async throws -> UIImage + func loadImageAsync() async throws -> UIImage class func incompleteAchievementImage() -> UIImage class func placeholderCompletedAchievementImage() -> UIImage } diff --git a/iOS/GameKit/GKChallenge.swift b/iOS/GameKit/GKChallenge.swift index 473dfb9..46a3d29 100644 --- a/iOS/GameKit/GKChallenge.swift +++ b/iOS/GameKit/GKChallenge.swift @@ -10,7 +10,7 @@ enum GKChallengeState : Int { @available(iOS 6.0, *) class GKChallenge : NSObject, NSCoding, NSSecureCoding { class func loadReceivedChallenges(completionHandler: (([GKChallenge]?, Error?) -> Void)? = nil) - class func loadReceivedChallenges() async throws -> [GKChallenge] + class func loadReceivedChallengesAsync() async throws -> [GKChallenge] func decline() @available(iOS 8.0, *) @NSCopying var issuingPlayer: GKPlayer? { get } @@ -39,21 +39,21 @@ extension GKScore { @available(iOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to reportLeaderboardScores:withEligibleChallenges:withCompletionHandler instead") class func report(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(iOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to reportLeaderboardScores:withEligibleChallenges:withCompletionHandler instead") - class func report(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge]) async throws + class func reportScoresAsync(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge]) async throws @available(iOS 14.0, *) class func report(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(iOS 14.0, *) - class func report(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge]) async throws + class func reportLeaderboardScoresAsync(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge]) async throws } extension GKAchievement { @available(iOS 8.0, *) func selectChallengeablePlayers(_ players: [GKPlayer], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(iOS 8.0, *) - func selectChallengeablePlayers(_ players: [GKPlayer]) async throws -> [GKPlayer] + func selectChallengeablePlayersAsync(_ players: [GKPlayer]) async throws -> [GKPlayer] @available(iOS 7.0, *) class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(iOS 7.0, *) - class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge]) async throws + class func reportAchievementsAsync(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge]) async throws } extension GKScore { } @@ -61,7 +61,7 @@ extension GKAchievement { @available(iOS, introduced: 6.0, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, pass GKPlayers to selectChallengeablePlayers:") func selectChallengeablePlayerIDs(_ playerIDs: [String]?, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) @available(iOS, introduced: 6.0, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, pass GKPlayers to selectChallengeablePlayers:") - func selectChallengeablePlayerIDs(_ playerIDs: [String]?) async throws -> [String] + func selectChallengeablePlayerIDsAsync(_ playerIDs: [String]?) async throws -> [String] } typealias GKChallengeComposeCompletionBlock = (UIViewController, Bool, [String]?) -> Void extension GKScore { diff --git a/iOS/GameKit/GKLeaderboard.swift b/iOS/GameKit/GKLeaderboard.swift index 2a5d7df..1e3b6ab 100644 --- a/iOS/GameKit/GKLeaderboard.swift +++ b/iOS/GameKit/GKLeaderboard.swift @@ -85,15 +85,15 @@ extension GKLeaderboard { @available(iOS, introduced: 4.0, deprecated: 14.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") func loadScores(completionHandler: (([GKScore]?, Error?) -> Void)? = nil) @available(iOS, introduced: 4.0, deprecated: 14.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") - func loadScores() async throws -> [GKScore] + func loadScoresAsync() async throws -> [GKScore] @available(iOS, introduced: 6.0, deprecated: 14.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") class func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(iOS, introduced: 6.0, deprecated: 14.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") - class func loadLeaderboards() async throws -> [GKLeaderboard] + class func loadLeaderboardsAsync() async throws -> [GKLeaderboard] } extension GKLeaderboard { @available(iOS 7.0, *) func loadImage(completionHandler: ((UIImage?, Error?) -> Void)? = nil) @available(iOS 7.0, *) - func loadImage() async throws -> UIImage + func loadImageAsync() async throws -> UIImage } diff --git a/iOS/GameKit/GKLeaderboardSet.swift b/iOS/GameKit/GKLeaderboardSet.swift index 7611939..fa4755a 100644 --- a/iOS/GameKit/GKLeaderboardSet.swift +++ b/iOS/GameKit/GKLeaderboardSet.swift @@ -7,7 +7,7 @@ class GKLeaderboardSet : NSObject, NSCoding, NSSecureCoding { @available(iOS 7.0, *) class func loadLeaderboardSets(completionHandler: (([GKLeaderboardSet]?, Error?) -> Void)? = nil) @available(iOS 7.0, *) - class func loadLeaderboardSets() async throws -> [GKLeaderboardSet] + class func loadLeaderboardSetsAsync() async throws -> [GKLeaderboardSet] @available(iOS 14.0, *) func loadLeaderboards(handler: @escaping ([GKLeaderboard]?, Error?) -> Void) } @@ -15,9 +15,9 @@ extension GKLeaderboardSet { @available(iOS, introduced: 7.0, deprecated: 14.0, message: "Use loadLeaderboardsWithHandler: instead.") func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(iOS, introduced: 7.0, deprecated: 14.0, message: "Use loadLeaderboardsWithHandler: instead.") - func loadLeaderboards() async throws -> [GKLeaderboard] + func loadLeaderboardsAsync() async throws -> [GKLeaderboard] } extension GKLeaderboardSet { func loadImage(completionHandler: ((UIImage?, Error?) -> Void)? = nil) - func loadImage() async throws -> UIImage + func loadImageAsync() async throws -> UIImage } diff --git a/iOS/GameKit/GKLocalPlayer.swift b/iOS/GameKit/GKLocalPlayer.swift index 2b48189..2aea3b1 100644 --- a/iOS/GameKit/GKLocalPlayer.swift +++ b/iOS/GameKit/GKLocalPlayer.swift @@ -13,21 +13,21 @@ class GKLocalPlayer : GKPlayer { @available(iOS 10.0, *) func loadRecentPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(iOS 10.0, *) - func loadRecentPlayers() async throws -> [GKPlayer] + func loadRecentPlayersAsync() async throws -> [GKPlayer] func loadChallengableFriends(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - func loadChallengableFriends() async throws -> [GKPlayer] + func loadChallengableFriendsAsync() async throws -> [GKPlayer] @available(iOS 7.0, *) func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 7.0, *) - func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String) async throws + func setDefaultLeaderboardIdentifierAsync(_ leaderboardIdentifier: String) async throws @available(iOS 7.0, *) func loadDefaultLeaderboardIdentifier(completionHandler: ((String?, Error?) -> Void)? = nil) @available(iOS 7.0, *) - func loadDefaultLeaderboardIdentifier() async throws -> String + func loadDefaultLeaderboardIdentifierAsync() async throws -> String @available(iOS 13.5, *) func fetchItems(forIdentityVerificationSignature completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(iOS 13.5, *) - func fetchItemsForIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) + func fetchItemsForIdentityVerificationSignatureAsync() async throws -> (URL, Data, Data, UInt64) } protocol GKLocalPlayerListener : GKChallengeListener, GKInviteEventListener, GKSavedGameListener, GKTurnBasedEventListener { } @@ -47,17 +47,17 @@ extension GKLocalPlayer { @available(iOS, introduced: 8.0, deprecated: 10.0) func loadFriendPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(iOS, introduced: 8.0, deprecated: 10.0) - func loadFriendPlayers() async throws -> [GKPlayer] + func loadFriendPlayersAsync() async throws -> [GKPlayer] @available(iOS, introduced: 7.0, deprecated: 13.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") func generateIdentityVerificationSignature(completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(iOS, introduced: 7.0, deprecated: 13.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") - func generateIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) + func generateIdentityVerificationSignatureAsync() async throws -> (URL, Data, Data, UInt64) } extension GKLocalPlayer { @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") func loadFriends(completionHandler: (([String]?, Error?) -> Void)? = nil) @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") - func loadFriends() async throws -> [String] + func loadFriendsAsync() async throws -> [String] @available(iOS, introduced: 4.1, deprecated: 8.0, message: " This property is obsolete, Use loadFriendPlayersWithCompletionHandler: instead") var friends: [String]? { get } } diff --git a/iOS/GameKit/GKMatch.swift b/iOS/GameKit/GKMatch.swift index 5179948..1b049cb 100644 --- a/iOS/GameKit/GKMatch.swift +++ b/iOS/GameKit/GKMatch.swift @@ -32,7 +32,7 @@ class GKMatch : NSObject { @available(iOS 6.0, *) func rematch(completionHandler: ((GKMatch?, Error?) -> Void)? = nil) @available(iOS 6.0, *) - func rematch() async throws -> GKMatch + func rematchAsync() async throws -> GKMatch } protocol GKMatchDelegate : NSObjectProtocol { @available(iOS 8.0, *) diff --git a/iOS/GameKit/GKMatchmaker.swift b/iOS/GameKit/GKMatchmaker.swift index afeb012..b52fbe5 100644 --- a/iOS/GameKit/GKMatchmaker.swift +++ b/iOS/GameKit/GKMatchmaker.swift @@ -72,24 +72,24 @@ class GKMatchmaker : NSObject { @available(iOS 6.0, *) func match(for invite: GKInvite, completionHandler: ((GKMatch?, Error?) -> Void)? = nil) @available(iOS 6.0, *) - func match(for invite: GKInvite) async throws -> GKMatch + func matchAsync(for invite: GKInvite) async throws -> GKMatch func findMatch(for request: GKMatchRequest, withCompletionHandler completionHandler: ((GKMatch?, Error?) -> Void)? = nil) - func findMatch(for request: GKMatchRequest) async throws -> GKMatch + func findMatchAsync(for request: GKMatchRequest) async throws -> GKMatch @available(iOS 8.0, *) func findPlayers(forHostedRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(iOS 8.0, *) - func findPlayers(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer] + func findPlayersAsync(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer] func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest, completionHandler: ((Error?) -> Void)? = nil) - func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest) async throws + func addPlayersAsync(to match: GKMatch, matchRequest: GKMatchRequest) async throws func cancel() @available(iOS 8.0, *) func cancelPendingInvite(to player: GKPlayer) @available(iOS 6.0, *) func finishMatchmaking(for match: GKMatch) func queryPlayerGroupActivity(_ playerGroup: Int, withCompletionHandler completionHandler: ((Int, Error?) -> Void)? = nil) - func queryPlayerGroupActivity(_ playerGroup: Int) async throws -> Int + func queryPlayerGroupActivityAsync(_ playerGroup: Int) async throws -> Int func queryActivity(completionHandler: ((Int, Error?) -> Void)? = nil) - func queryActivity() async throws -> Int + func queryActivityAsync() async throws -> Int @available(iOS 8.0, *) func startBrowsingForNearbyPlayers(handler reachableHandler: ((GKPlayer, Bool) -> Void)? = nil) @available(iOS 6.0, *) @@ -105,5 +105,5 @@ extension GKMatchmaker { @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") func findPlayers(forHostedMatchRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") - func findPlayers(forHostedMatchRequest request: GKMatchRequest) async throws -> [String] + func findPlayersAsync(forHostedMatchRequest request: GKMatchRequest) async throws -> [String] } diff --git a/iOS/GameKit/GKNotificationBanner.swift b/iOS/GameKit/GKNotificationBanner.swift index 031db5e..de7a35e 100644 --- a/iOS/GameKit/GKNotificationBanner.swift +++ b/iOS/GameKit/GKNotificationBanner.swift @@ -4,9 +4,9 @@ class GKNotificationBanner : NSObject { @available(iOS 5.0, *) class func show(withTitle title: String?, message: String?, completionHandler: (() -> Void)? = nil) @available(iOS 5.0, *) - class func show(withTitle title: String?, message: String?) async + class func showAsync(withTitle title: String?, message: String?) async @available(iOS 6.0, *) class func show(withTitle title: String?, message: String?, duration: TimeInterval, completionHandler: (() -> Void)? = nil) @available(iOS 6.0, *) - class func show(withTitle title: String?, message: String?, duration: TimeInterval) async + class func showAsync(withTitle title: String?, message: String?, duration: TimeInterval) async } diff --git a/iOS/GameKit/GKPlayer.swift b/iOS/GameKit/GKPlayer.swift index 1cead7f..8cd7b1b 100644 --- a/iOS/GameKit/GKPlayer.swift +++ b/iOS/GameKit/GKPlayer.swift @@ -4,7 +4,7 @@ let GKPlayerIDNoLongerAvailable: String @available(iOS 4.1, *) class GKPlayer : GKBasePlayer { class func loadPlayers(forIdentifiers identifiers: [String], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] + class func loadPlayersAsync(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] @available(iOS 13.0, *) func scopedIDsArePersistent() -> Bool @available(iOS 12.4, *) @@ -23,7 +23,7 @@ extension GKPlayer { @available(iOS 5.0, *) func loadPhoto(for size: GKPlayer.PhotoSize, withCompletionHandler completionHandler: ((UIImage?, Error?) -> Void)? = nil) @available(iOS 5.0, *) - func loadPhoto(for size: GKPlayer.PhotoSize) async throws -> UIImage + func loadPhotoAsync(for size: GKPlayer.PhotoSize) async throws -> UIImage } extension GKPlayer { enum PhotoSize : Int { diff --git a/iOS/GameKit/GKSavedGame.swift b/iOS/GameKit/GKSavedGame.swift index 9601795..c6660eb 100644 --- a/iOS/GameKit/GKSavedGame.swift +++ b/iOS/GameKit/GKSavedGame.swift @@ -10,23 +10,23 @@ class GKSavedGame : NSObject, NSCopying { @available(iOS 8.0, *) func loadData(completionHandler handler: ((Data?, Error?) -> Void)? = nil) @available(iOS 8.0, *) - func loadData() async throws -> Data + func loadDataAsync() async throws -> Data } extension GKLocalPlayer : GKSavedGameListener { @available(iOS 8.0, *) func fetchSavedGames(completionHandler handler: (([GKSavedGame]?, Error?) -> Void)? = nil) @available(iOS 8.0, *) - func fetchSavedGames() async throws -> [GKSavedGame] + func fetchSavedGamesAsync() async throws -> [GKSavedGame] @available(iOS 8.0, *) func saveGameData(_ data: Data, withName name: String, completionHandler handler: ((GKSavedGame?, Error?) -> Void)? = nil) @available(iOS 8.0, *) - func saveGameData(_ data: Data, withName name: String) async throws -> GKSavedGame + func saveGameDataAsync(_ data: Data, withName name: String) async throws -> GKSavedGame @available(iOS 8.0, *) func deleteSavedGames(withName name: String, completionHandler handler: ((Error?) -> Void)? = nil) @available(iOS 8.0, *) - func deleteSavedGames(withName name: String) async throws + func deleteSavedGamesAsync(withName name: String) async throws @available(iOS 8.0, *) func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data, completionHandler handler: (([GKSavedGame]?, Error?) -> Void)? = nil) @available(iOS 8.0, *) - func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data) async throws -> [GKSavedGame] + func resolveConflictingSavedGamesAsync(_ conflictingSavedGames: [GKSavedGame], with data: Data) async throws -> [GKSavedGame] } diff --git a/iOS/GameKit/GKScore.swift b/iOS/GameKit/GKScore.swift index ce7464f..959d0f3 100644 --- a/iOS/GameKit/GKScore.swift +++ b/iOS/GameKit/GKScore.swift @@ -19,7 +19,7 @@ class GKScore : NSObject, NSCoding, NSSecureCoding { @available(iOS 6.0, *) class func report(_ scores: [GKScore], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(iOS 6.0, *) - class func report(_ scores: [GKScore]) async throws + class func reportScoresAsync(_ scores: [GKScore]) async throws } extension GKScore { } diff --git a/iOS/GameKit/GKTurnBasedMatch.swift b/iOS/GameKit/GKTurnBasedMatch.swift index 368e452..556683e 100644 --- a/iOS/GameKit/GKTurnBasedMatch.swift +++ b/iOS/GameKit/GKTurnBasedMatch.swift @@ -98,43 +98,43 @@ class GKTurnBasedMatch : NSObject { class func find(for request: GKMatchRequest, withCompletionHandler completionHandler: @escaping (GKTurnBasedMatch?, Error?) -> Void) class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch class func loadMatches(completionHandler: (([GKTurnBasedMatch]?, Error?) -> Void)? = nil) - class func loadMatches() async throws -> [GKTurnBasedMatch] + class func loadMatchesAsync() async throws -> [GKTurnBasedMatch] @available(iOS 5.0, *) class func load(withID matchID: String, withCompletionHandler completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(iOS 5.0, *) - class func load(withID matchID: String) async throws -> GKTurnBasedMatch + class func loadAsync(withID matchID: String) async throws -> GKTurnBasedMatch @available(iOS 6.0, *) func rematch(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(iOS 6.0, *) - func rematch() async throws -> GKTurnBasedMatch + func rematchAsync() async throws -> GKTurnBasedMatch @available(iOS 5.0, *) func acceptInvite(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(iOS 5.0, *) - func acceptInvite() async throws -> GKTurnBasedMatch + func acceptInviteAsync() async throws -> GKTurnBasedMatch @available(iOS 5.0, *) func declineInvite(completionHandler: ((Error?) -> Void)? = nil) @available(iOS 5.0, *) - func declineInvite() async throws + func declineInviteAsync() async throws func remove(completionHandler: ((Error?) -> Void)? = nil) - func remove() async throws + func removeAsync() async throws func loadMatchData(completionHandler: ((Data?, Error?) -> Void)? = nil) - func loadMatchData() async throws -> Data + func loadMatchDataAsync() async throws -> Data @available(iOS 6.0, *) func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 6.0, *) - func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + func endTurnAsync(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws @available(iOS 6.0, *) func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 6.0, *) - func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + func participantQuitInTurnAsync(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) - func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome) async throws + func participantQuitOutOfTurnAsync(with matchOutcome: GKTurnBasedMatch.Outcome) async throws func endMatchInTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) - func endMatchInTurn(withMatch matchData: Data) async throws + func endMatchInTurnAsync(withMatch matchData: Data) async throws @available(iOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?, completionHandler: ((Error?) -> Void)? = nil) @available(iOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") - func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws + func endMatchInTurnAsync(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws @available(iOS 14.0, *) func endMatchInTurn(withMatch matchData: Data, leaderboardScores scores: [GKLeaderboardScore], achievements: [Any], completionHandler: @escaping (Error?) -> Void) @available(iOS 14.0, *) @@ -142,19 +142,19 @@ class GKTurnBasedMatch : NSObject { @available(iOS 6.0, *) func saveCurrentTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 6.0, *) - func saveCurrentTurn(withMatch matchData: Data) async throws + func saveCurrentTurnAsync(withMatch matchData: Data) async throws @available(iOS 7.0, *) func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange], completionHandler: ((Error?) -> Void)? = nil) @available(iOS 7.0, *) - func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws + func saveMergedMatchDataAsync(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws @available(iOS 7.0, *) func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval, completionHandler: ((GKTurnBasedExchange?, Error?) -> Void)? = nil) @available(iOS 7.0, *) - func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange + func sendExchangeAsync(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange @available(iOS 7.0, *) func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(iOS 7.0, *) - func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws + func sendReminderAsync(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws } @available(iOS 7.0, *) enum GKTurnBasedExchangeStatus : Int8 { @@ -185,11 +185,11 @@ class GKTurnBasedExchange : NSObject { @available(iOS 7.0, *) func cancel(withLocalizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(iOS 7.0, *) - func cancel(withLocalizableMessageKey key: String, arguments: [String]) async throws + func cancelAsync(withLocalizableMessageKey key: String, arguments: [String]) async throws @available(iOS 7.0, *) func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 7.0, *) - func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws + func replyAsync(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws } @available(iOS 7.0, *) class GKTurnBasedExchangeReply : NSObject { diff --git a/iOS/Intents/INRelevantShortcutStore.swift b/iOS/Intents/INRelevantShortcutStore.swift index d12cded..fd42c9c 100644 --- a/iOS/Intents/INRelevantShortcutStore.swift +++ b/iOS/Intents/INRelevantShortcutStore.swift @@ -3,5 +3,5 @@ class INRelevantShortcutStore : NSObject { class var `default`: INRelevantShortcutStore { get } func setRelevantShortcuts(_ shortcuts: [INRelevantShortcut], completionHandler: ((Error?) -> Void)? = nil) - func setRelevantShortcuts(_ shortcuts: [INRelevantShortcut]) async throws + func setRelevantShortcutsAsync(_ shortcuts: [INRelevantShortcut]) async throws } diff --git a/iOS/MapKit/MKMapItem.swift b/iOS/MapKit/MKMapItem.swift index 0355c19..af9806a 100644 --- a/iOS/MapKit/MKMapItem.swift +++ b/iOS/MapKit/MKMapItem.swift @@ -17,11 +17,11 @@ class MKMapItem : NSObject { @available(iOS 13.2, *) func openInMaps(launchOptions: [String : Any]? = nil, from scene: UIScene?, completionHandler completion: ((Bool) -> Void)? = nil) @available(iOS 13.2, *) - func openInMaps(launchOptions: [String : Any]? = nil, from scene: UIScene?) async -> Bool + func openInMapsAsync(launchOptions: [String : Any]? = nil, from scene: UIScene?) async -> Bool @available(iOS 13.2, *) class func openMaps(with mapItems: [MKMapItem], launchOptions: [String : Any]? = nil, from scene: UIScene?, completionHandler completion: ((Bool) -> Void)? = nil) @available(iOS 13.2, *) - class func openMaps(with mapItems: [MKMapItem], launchOptions: [String : Any]? = nil, from scene: UIScene?) async -> Bool + class func openMapsAsync(with mapItems: [MKMapItem], launchOptions: [String : Any]? = nil, from scene: UIScene?) async -> Bool } @available(iOS 6.0, *) let MKLaunchOptionsDirectionsModeKey: String diff --git a/iOS/MediaPlayer/MPMediaLibrary.swift b/iOS/MediaPlayer/MPMediaLibrary.swift index 1dd7e3b..8c7a855 100644 --- a/iOS/MediaPlayer/MPMediaLibrary.swift +++ b/iOS/MediaPlayer/MPMediaLibrary.swift @@ -21,7 +21,7 @@ class MPMediaLibrary : NSObject, NSSecureCoding { @available(iOS 9.3, *) func addItem(withProductID productID: String, completionHandler: (([MPMediaEntity], Error?) -> Void)? = nil) @available(iOS 9.3, *) - func addItem(withProductID productID: String) async throws -> [MPMediaEntity] + func addItemAsync(withProductID productID: String) async throws -> [MPMediaEntity] @available(iOS 9.3, *) func getPlaylist(with uuid: UUID, creationMetadata: MPMediaPlaylistCreationMetadata?, completionHandler: @escaping (MPMediaPlaylist?, Error?) -> Void) @available(iOS 9.3, *) diff --git a/iOS/MediaPlayer/MPMediaPlaylist.swift b/iOS/MediaPlayer/MPMediaPlaylist.swift index a157e8d..5ea9150 100644 --- a/iOS/MediaPlayer/MPMediaPlaylist.swift +++ b/iOS/MediaPlayer/MPMediaPlaylist.swift @@ -24,11 +24,11 @@ class MPMediaPlaylist : MPMediaItemCollection { @available(iOS 9.3, *) func addItem(withProductID productID: String, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 9.3, *) - func addItem(withProductID productID: String) async throws + func addItemAsync(withProductID productID: String) async throws @available(iOS 9.3, *) func add(_ mediaItems: [MPMediaItem], completionHandler: ((Error?) -> Void)? = nil) @available(iOS 9.3, *) - func add(_ mediaItems: [MPMediaItem]) async throws + func addMediaItemsAsync(_ mediaItems: [MPMediaItem]) async throws } let MPMediaPlaylistPropertyPersistentID: String @available(iOS 9.0, *) diff --git a/iOS/Messages/MSConversation.swift b/iOS/Messages/MSConversation.swift index 12d1f10..4ee6a32 100644 --- a/iOS/Messages/MSConversation.swift +++ b/iOS/Messages/MSConversation.swift @@ -5,27 +5,27 @@ class MSConversation : NSObject { var remoteParticipantIdentifiers: [UUID] { get } var selectedMessage: MSMessage? { get } func insert(_ message: MSMessage, completionHandler: ((Error?) -> Void)? = nil) - func insert(_ message: MSMessage) async throws + func insertMessageAsync(_ message: MSMessage) async throws func insert(_ sticker: MSSticker, completionHandler: ((Error?) -> Void)? = nil) - func insert(_ sticker: MSSticker) async throws + func insertStickerAsync(_ sticker: MSSticker) async throws func insertText(_ text: String, completionHandler: ((Error?) -> Void)? = nil) - func insertText(_ text: String) async throws + func insertTextAsync(_ text: String) async throws func insertAttachment(_ URL: URL, withAlternateFilename filename: String?, completionHandler: ((Error?) -> Void)? = nil) - func insertAttachment(_ URL: URL, withAlternateFilename filename: String?) async throws + func insertAttachmentAsync(_ URL: URL, withAlternateFilename filename: String?) async throws @available(iOS 11.0, *) func send(_ message: MSMessage, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) - func send(_ message: MSMessage) async throws + func sendMessageAsync(_ message: MSMessage) async throws @available(iOS 11.0, *) func send(_ sticker: MSSticker, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) - func send(_ sticker: MSSticker) async throws + func sendStickerAsync(_ sticker: MSSticker) async throws @available(iOS 11.0, *) func sendText(_ text: String, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) - func sendText(_ text: String) async throws + func sendTextAsync(_ text: String) async throws @available(iOS 11.0, *) func sendAttachment(_ URL: URL, withAlternateFilename filename: String?, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) - func sendAttachment(_ URL: URL, withAlternateFilename filename: String?) async throws + func sendAttachmentAsync(_ URL: URL, withAlternateFilename filename: String?) async throws } diff --git a/iOS/NetworkExtension/NetworkExtension.swift b/iOS/NetworkExtension/NetworkExtension.swift index c09acf8..a9de956 100644 --- a/iOS/NetworkExtension/NetworkExtension.swift +++ b/iOS/NetworkExtension/NetworkExtension.swift @@ -102,11 +102,11 @@ class NETunnelProvider : NEProvider { @available(iOS 9.0, *) func handleAppMessage(_ messageData: Data, completionHandler: ((Data?) -> Void)? = nil) @available(iOS 9.0, *) - func handleAppMessage(_ messageData: Data) async -> Data? + func handleAppMessageAsync(_ messageData: Data) async -> Data? @available(iOS 9.0, *) func setTunnelNetworkSettings(_ tunnelNetworkSettings: NETunnelNetworkSettings?, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 9.0, *) - func setTunnelNetworkSettings(_ tunnelNetworkSettings: NETunnelNetworkSettings?) async throws + func setTunnelNetworkSettingsAsync(_ tunnelNetworkSettings: NETunnelNetworkSettings?) async throws @available(iOS 9.0, *) var protocolConfiguration: NEVPNProtocol { get } @available(iOS 9.0, *) @@ -170,11 +170,11 @@ class NEVPNManager : NSObject { @available(iOS 8.0, *) func removeFromPreferences(completionHandler: ((Error?) -> Void)? = nil) @available(iOS 8.0, *) - func removeFromPreferences() async throws + func removeFromPreferencesAsync() async throws @available(iOS 8.0, *) func saveToPreferences(completionHandler: ((Error?) -> Void)? = nil) @available(iOS 8.0, *) - func saveToPreferences() async throws + func saveToPreferencesAsync() async throws @available(iOS 8.0, *) var onDemandRules: [NEOnDemandRule]? @available(iOS 8.0, *) @@ -921,7 +921,7 @@ class NEHotspotConfigurationManager : NSObject { @available(iOS 11.0, *) func apply(_ configuration: NEHotspotConfiguration, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) - func apply(_ configuration: NEHotspotConfiguration) async throws + func applyConfigurationAsync(_ configuration: NEHotspotConfiguration) async throws @available(iOS 11.0, *) func removeConfiguration(forSSID SSID: String) @available(iOS 11.0, *) diff --git a/iOS/PassKit/PKPassLibrary.swift b/iOS/PassKit/PKPassLibrary.swift index e26aaf5..ee45f55 100644 --- a/iOS/PassKit/PKPassLibrary.swift +++ b/iOS/PassKit/PKPassLibrary.swift @@ -48,7 +48,7 @@ class PKPassLibrary : NSObject { @available(iOS 7.0, *) func addPasses(_ passes: [PKPass], withCompletionHandler completion: ((PKPassLibraryAddPassesStatus) -> Void)? = nil) @available(iOS 7.0, *) - func addPasses(_ passes: [PKPass]) async -> PKPassLibraryAddPassesStatus + func addPassesAsync(_ passes: [PKPass]) async -> PKPassLibraryAddPassesStatus @available(iOS 8.3, *) func openPaymentSetup() @available(iOS, introduced: 10.0, deprecated: 100000, message: "Use -[PKPassLibrary presentSecureElementPass:] instead") @@ -64,11 +64,11 @@ class PKPassLibrary : NSObject { @available(iOS, introduced: 8.0, deprecated: 100000, message: "Use activateSecureElementPass:withActivationData:completion: instead") func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data, completion: ((Bool, Error) -> Void)? = nil) @available(iOS, introduced: 8.0, deprecated: 100000, message: "Use activateSecureElementPass:withActivationData:completion: instead") - func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data) async -> (Bool, Error) + func activatePaymentPassAsync(_ paymentPass: PKPaymentPass, withActivationData activationData: Data) async -> (Bool, Error) @available(iOS, introduced: 8.0, deprecated: 9.0, message: "Use activatePaymentPass:withActivationData:completion: instead") func activate(_ paymentPass: PKPaymentPass, withActivationCode activationCode: String, completion: ((Bool, Error) -> Void)? = nil) @available(iOS, introduced: 8.0, deprecated: 9.0, message: "Use activatePaymentPass:withActivationData:completion: instead") - func activate(_ paymentPass: PKPaymentPass, withActivationCode activationCode: String) async -> (Bool, Error) + func activatePaymentPassAsync(_ paymentPass: PKPaymentPass, withActivationCode activationCode: String) async -> (Bool, Error) @available(iOS 13.4, *) func activate(_ secureElementPass: PKSecureElementPass, activationData: Data, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 13.4, *) diff --git a/iOS/PassKit/PKPaymentAuthorizationController.swift b/iOS/PassKit/PKPaymentAuthorizationController.swift index 97caba1..09c229a 100644 --- a/iOS/PassKit/PKPaymentAuthorizationController.swift +++ b/iOS/PassKit/PKPaymentAuthorizationController.swift @@ -49,7 +49,7 @@ class PKPaymentAuthorizationController : NSObject { weak var delegate: @sil_weak PKPaymentAuthorizationControllerDelegate? init(paymentRequest request: PKPaymentRequest) func present(completion: ((Bool) -> Void)? = nil) - func present() async -> Bool + func presentAsync() async -> Bool func dismiss(completion: (() -> Void)? = nil) - func dismiss() async + func dismissAsync() async } diff --git a/iOS/Photos/PHPhotoLibrary.swift b/iOS/Photos/PHPhotoLibrary.swift index 9eadd67..8593e5f 100644 --- a/iOS/Photos/PHPhotoLibrary.swift +++ b/iOS/Photos/PHPhotoLibrary.swift @@ -54,7 +54,7 @@ class PHPhotoLibrary : NSObject { @available(iOS 8, *) func performChanges(_ changeBlock: @escaping () -> Void, completionHandler: ((Bool, Error?) -> Void)? = nil) @available(iOS 8, *) - func performChanges(_ changeBlock: @escaping () -> Void) async throws -> Bool + func performChangesAsync(_ changeBlock: @escaping () -> Void) async throws -> Bool @available(iOS 8, *) func performChangesAndWait(_ changeBlock: @escaping () -> Void) throws @available(iOS 8, *) diff --git a/iOS/ReplayKit/RPScreenRecorder.swift b/iOS/ReplayKit/RPScreenRecorder.swift index d81fbf0..39526de 100644 --- a/iOS/ReplayKit/RPScreenRecorder.swift +++ b/iOS/ReplayKit/RPScreenRecorder.swift @@ -21,7 +21,7 @@ class RPScreenRecorder : NSObject { @available(iOS 11.0, *) func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) - func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?) async throws + func startCaptureAsync(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?) async throws @available(iOS 11.0, *) func stopCapture(handler: ((Error?) -> Void)? = nil) weak var delegate: @sil_weak RPScreenRecorderDelegate? diff --git a/iOS/SafariServices/SFContentBlockerManager.swift b/iOS/SafariServices/SFContentBlockerManager.swift index df93e1c..f526a31 100644 --- a/iOS/SafariServices/SFContentBlockerManager.swift +++ b/iOS/SafariServices/SFContentBlockerManager.swift @@ -15,7 +15,7 @@ enum SFContentBlockerErrorCode : Int { @available(iOS 9.0, *) class SFContentBlockerManager : NSObject { class func reloadContentBlocker(withIdentifier identifier: String, completionHandler: ((Error?) -> Void)? = nil) - class func reloadContentBlocker(withIdentifier identifier: String) async throws + class func reloadContentBlockerAsync(withIdentifier identifier: String) async throws @available(iOS 10.0, *) class func getStateOfContentBlocker(withIdentifier identifier: String, completionHandler: @escaping (SFContentBlockerState?, Error?) -> Void) @available(iOS 10.0, *) diff --git a/iOS/StoreKit/SKCloudServiceSetupViewController.swift b/iOS/StoreKit/SKCloudServiceSetupViewController.swift index 39f3fa3..806e46a 100644 --- a/iOS/StoreKit/SKCloudServiceSetupViewController.swift +++ b/iOS/StoreKit/SKCloudServiceSetupViewController.swift @@ -21,7 +21,7 @@ class SKCloudServiceSetupViewController : UIViewController { @available(iOS 10.1, *) func load(options: [SKCloudServiceSetupOptionsKey : Any] = [:], completionHandler: ((Bool, Error?) -> Void)? = nil) @available(iOS 10.1, *) - func load(options: [SKCloudServiceSetupOptionsKey : Any] = [:]) async throws -> Bool + func loadAsync(options: [SKCloudServiceSetupOptionsKey : Any] = [:]) async throws -> Bool } protocol SKCloudServiceSetupViewControllerDelegate : NSObjectProtocol { @available(iOS 10.1, *) diff --git a/iOS/StoreKit/SKProductStorePromotionController.swift b/iOS/StoreKit/SKProductStorePromotionController.swift index ca1e767..90cc792 100644 --- a/iOS/StoreKit/SKProductStorePromotionController.swift +++ b/iOS/StoreKit/SKProductStorePromotionController.swift @@ -14,7 +14,7 @@ class SKProductStorePromotionController : NSObject { @available(iOS 11.0, *) func fetchStorePromotionVisibility(for product: SKProduct, completionHandler: ((SKProductStorePromotionVisibility, Error?) -> Void)? = nil) @available(iOS 11.0, *) - func fetchStorePromotionVisibility(for product: SKProduct) async throws -> SKProductStorePromotionVisibility + func fetchStorePromotionVisibilityAsync(for product: SKProduct) async throws -> SKProductStorePromotionVisibility @available(iOS 11.0, *) func update(storePromotionVisibility promotionVisibility: SKProductStorePromotionVisibility, for product: SKProduct, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) @@ -22,7 +22,7 @@ class SKProductStorePromotionController : NSObject { @available(iOS 11.0, *) func fetchStorePromotionOrder(completionHandler: (([SKProduct], Error?) -> Void)? = nil) @available(iOS 11.0, *) - func fetchStorePromotionOrder() async throws -> [SKProduct] + func fetchStorePromotionOrderAsync() async throws -> [SKProduct] @available(iOS 11.0, *) func update(storePromotionOrder: [SKProduct], completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) diff --git a/iOS/UIKit/UIApplication.swift b/iOS/UIKit/UIApplication.swift index dd3a901..f7af38e 100644 --- a/iOS/UIKit/UIApplication.swift +++ b/iOS/UIKit/UIApplication.swift @@ -94,7 +94,7 @@ class UIApplication : UIResponder { @available(iOS 10.0, *) func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:], completionHandler completion: ((Bool) -> Void)? = nil) @available(iOS 10.0, *) - func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:]) async -> Bool + func openURLAsync(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:]) async -> Bool func sendEvent(_ event: UIEvent) @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Should not be used for applications that support multiple scenes as it returns a key window across all connected scenes") var keyWindow: UIWindow? { get } @@ -200,7 +200,7 @@ extension UIApplication { @available(iOS 10.3, *) func setAlternateIconName(_ alternateIconName: String?, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 10.3, *) - func setAlternateIconName(_ alternateIconName: String?) async throws + func setAlternateIconNameAsync(_ alternateIconName: String?) async throws @available(iOS 10.3, *) var alternateIconName: String? { get } } diff --git a/iOS/UIKit/UICollectionView.swift b/iOS/UIKit/UICollectionView.swift index 00e61a0..4d81d15 100644 --- a/iOS/UIKit/UICollectionView.swift +++ b/iOS/UIKit/UICollectionView.swift @@ -187,7 +187,7 @@ class UICollectionView : UIScrollView, UIDataSourceTranslating { func reloadItems(at indexPaths: [IndexPath]) func moveItem(at indexPath: IndexPath, to newIndexPath: IndexPath) func performBatchUpdates(_ updates: (() -> Void)?, completion: ((Bool) -> Void)? = nil) - func performBatchUpdates(_ updates: (() -> Void)?) async -> Bool + func performBatchUpdatesAsync(_ updates: (() -> Void)?) async -> Bool @available(iOS 9.0, *) func beginInteractiveMovementForItem(at indexPath: IndexPath) -> Bool @available(iOS 9.0, *) diff --git a/iOS/UIKit/UIDocument.swift b/iOS/UIKit/UIDocument.swift index 76c25e3..42bc883 100644 --- a/iOS/UIKit/UIDocument.swift +++ b/iOS/UIKit/UIDocument.swift @@ -8,9 +8,9 @@ class UIDocument : NSObject, NSFilePresenter, ProgressReporting { var fileModificationDate: Date? var documentState: UIDocument.State { get } func open(completionHandler: ((Bool) -> Void)? = nil) - func open() async -> Bool + func openAsync() async -> Bool func close(completionHandler: ((Bool) -> Void)? = nil) - func close() async -> Bool + func closeAsync() async -> Bool func load(fromContents contents: Any, ofType typeName: String?) throws func contents(forType typeName: String) throws -> Any func disableEditing() @@ -21,9 +21,9 @@ class UIDocument : NSObject, NSFilePresenter, ProgressReporting { func changeCountToken(for saveOperation: UIDocument.SaveOperation) -> Any func updateChangeCount(withToken changeCountToken: Any, for saveOperation: UIDocument.SaveOperation) func save(to url: URL, for saveOperation: UIDocument.SaveOperation, completionHandler: ((Bool) -> Void)? = nil) - func save(to url: URL, for saveOperation: UIDocument.SaveOperation) async -> Bool + func saveAsync(to url: URL, for saveOperation: UIDocument.SaveOperation) async -> Bool func autosave(completionHandler: ((Bool) -> Void)? = nil) - func autosave() async -> Bool + func autosaveAsync() async -> Bool var savingFileType: String? { get } func fileNameExtension(forType typeName: String?, saveOperation: UIDocument.SaveOperation) -> String func writeContents(_ contents: Any, andAttributes additionalFileAttributes: [AnyHashable : Any]? = nil, safelyTo url: URL, for saveOperation: UIDocument.SaveOperation) throws @@ -35,7 +35,7 @@ class UIDocument : NSObject, NSFilePresenter, ProgressReporting { func finishedHandlingError(_ error: Error, recovered: Bool) func userInteractionNoLongerPermitted(forError error: Error) func revert(toContentsOf url: URL, completionHandler: ((Bool) -> Void)? = nil) - func revert(toContentsOf url: URL) async -> Bool + func revertAsync(toContentsOf url: URL) async -> Bool } extension UIDocument { @available(iOS 8.0, *) diff --git a/iOS/UIKit/UIDocumentBrowserViewController.swift b/iOS/UIKit/UIDocumentBrowserViewController.swift index 3651f68..1feb88b 100644 --- a/iOS/UIKit/UIDocumentBrowserViewController.swift +++ b/iOS/UIKit/UIDocumentBrowserViewController.swift @@ -44,7 +44,7 @@ class UIDocumentBrowserViewController : UIViewController, NSCoding { var additionalLeadingNavigationBarButtonItems: [UIBarButtonItem] var additionalTrailingNavigationBarButtonItems: [UIBarButtonItem] func revealDocument(at url: URL, importIfNeeded: Bool, completion: ((URL?, Error?) -> Void)? = nil) - func revealDocument(at url: URL, importIfNeeded: Bool) async throws -> URL + func revealDocumentAsync(at url: URL, importIfNeeded: Bool) async throws -> URL func importDocument(at documentURL: URL, nextToDocumentAt neighbourURL: URL, mode importMode: UIDocumentBrowserViewController.ImportMode, completionHandler completion: @escaping (URL?, Error?) -> Void) func importDocument(at documentURL: URL, nextToDocumentAt neighbourURL: URL, mode importMode: UIDocumentBrowserViewController.ImportMode) async throws -> URL @available(iOS 12.0, *) diff --git a/iOS/UIKit/UIFocusAnimationCoordinator.swift b/iOS/UIKit/UIFocusAnimationCoordinator.swift index f81caf5..9ec914e 100644 --- a/iOS/UIKit/UIFocusAnimationCoordinator.swift +++ b/iOS/UIKit/UIFocusAnimationCoordinator.swift @@ -6,13 +6,13 @@ protocol UIFocusAnimationContext : NSObjectProtocol { @available(iOS 9.0, *) class UIFocusAnimationCoordinator : NSObject { func addCoordinatedAnimations(_ animations: (() -> Void)?, completion: (() -> Void)? = nil) - func addCoordinatedAnimations(_ animations: (() -> Void)?) async + func addCoordinatedAnimationsAsync(_ animations: (() -> Void)?) async @available(iOS 11.0, *) func addCoordinatedFocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?, completion: (() -> Void)? = nil) @available(iOS 11.0, *) - func addCoordinatedFocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?) async + func addCoordinatedFocusingAnimationsAsync(_ animations: ((UIFocusAnimationContext) -> Void)?) async @available(iOS 11.0, *) func addCoordinatedUnfocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?, completion: (() -> Void)? = nil) @available(iOS 11.0, *) - func addCoordinatedUnfocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?) async + func addCoordinatedUnfocusingAnimationsAsync(_ animations: ((UIFocusAnimationContext) -> Void)?) async } diff --git a/iOS/UIKit/UIPageViewController.swift b/iOS/UIKit/UIPageViewController.swift index d92413f..3d41d8d 100644 --- a/iOS/UIKit/UIPageViewController.swift +++ b/iOS/UIKit/UIPageViewController.swift @@ -49,7 +49,7 @@ class UIPageViewController : UIViewController { var gestureRecognizers: [UIGestureRecognizer] { get } var viewControllers: [UIViewController]? { get } func setViewControllers(_ viewControllers: [UIViewController]?, direction: UIPageViewController.NavigationDirection, animated: Bool, completion: ((Bool) -> Void)? = nil) - func setViewControllers(_ viewControllers: [UIViewController]?, direction: UIPageViewController.NavigationDirection, animated: Bool) async -> Bool + func setViewControllersAsync(_ viewControllers: [UIViewController]?, direction: UIPageViewController.NavigationDirection, animated: Bool) async -> Bool } protocol UIPageViewControllerDelegate : NSObjectProtocol { @available(iOS 6.0, *) diff --git a/iOS/UIKit/UIPrinter.swift b/iOS/UIKit/UIPrinter.swift index 0747864..5f97127 100644 --- a/iOS/UIKit/UIPrinter.swift +++ b/iOS/UIKit/UIPrinter.swift @@ -10,7 +10,7 @@ class UIPrinter : NSObject { var supportsColor: Bool { get } var supportsDuplex: Bool { get } func contactPrinter(_ completionHandler: ((Bool) -> Void)? = nil) - func contactPrinter() async -> Bool + func contactPrinterAsync() async -> Bool } extension UIPrinter { @available(iOS 8.0, *) diff --git a/iOS/UIKit/UIScene.swift b/iOS/UIKit/UIScene.swift index 297cecf..949a6a0 100644 --- a/iOS/UIKit/UIScene.swift +++ b/iOS/UIKit/UIScene.swift @@ -6,7 +6,7 @@ class UIScene : UIResponder { var delegate: UISceneDelegate? var activationState: UIScene.ActivationState { get } func open(_ url: URL, options: UIScene.OpenExternalURLOptions?, completionHandler completion: ((Bool) -> Void)? = nil) - func open(_ url: URL, options: UIScene.OpenExternalURLOptions?) async -> Bool + func openURLAsync(_ url: URL, options: UIScene.OpenExternalURLOptions?) async -> Bool var title: String! var activationConditions: UISceneActivationConditions } diff --git a/iOS/UIKit/UITableView.swift b/iOS/UIKit/UITableView.swift index ece0533..f4062b3 100644 --- a/iOS/UIKit/UITableView.swift +++ b/iOS/UIKit/UITableView.swift @@ -211,7 +211,7 @@ class UITableView : UIScrollView, NSCoding, UIDataSourceTranslating { @available(iOS 11.0, *) func performBatchUpdates(_ updates: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(iOS 11.0, *) - func performBatchUpdates(_ updates: (() -> Void)?) async -> Bool + func performBatchUpdatesAsync(_ updates: (() -> Void)?) async -> Bool func beginUpdates() func endUpdates() func insertSections(_ sections: IndexSet, with animation: UITableView.RowAnimation) diff --git a/iOS/UIKit/UIView.swift b/iOS/UIKit/UIView.swift index b42e359..491ba09 100644 --- a/iOS/UIKit/UIView.swift +++ b/iOS/UIKit/UIView.swift @@ -247,7 +247,7 @@ extension UIView { @available(iOS 4.0, *) class func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions = [], animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(iOS 4.0, *) - class func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool + class func animateAsync(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool @available(iOS 4.0, *) class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(iOS 4.0, *) @@ -257,19 +257,19 @@ extension UIView { @available(iOS 7.0, *) class func animate(withDuration duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping dampingRatio: CGFloat, initialSpringVelocity velocity: CGFloat, options: UIView.AnimationOptions = [], animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(iOS 7.0, *) - class func animate(withDuration duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping dampingRatio: CGFloat, initialSpringVelocity velocity: CGFloat, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool + class func animateAsync(withDuration duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping dampingRatio: CGFloat, initialSpringVelocity velocity: CGFloat, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool @available(iOS 4.0, *) class func transition(with view: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(iOS 4.0, *) - class func transition(with view: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool + class func transitionAsync(with view: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool @available(iOS 4.0, *) class func transition(from fromView: UIView, to toView: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], completion: ((Bool) -> Void)? = nil) @available(iOS 4.0, *) - class func transition(from fromView: UIView, to toView: UIView, duration: TimeInterval, options: UIView.AnimationOptions = []) async -> Bool + class func transitionAsync(from fromView: UIView, to toView: UIView, duration: TimeInterval, options: UIView.AnimationOptions = []) async -> Bool @available(iOS 7.0, *) class func perform(_ animation: UIView.SystemAnimation, on views: [UIView], options: UIView.AnimationOptions = [], animations parallelAnimations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(iOS 7.0, *) - class func perform(_ animation: UIView.SystemAnimation, on views: [UIView], options: UIView.AnimationOptions = [], animations parallelAnimations: (() -> Void)?) async -> Bool + class func performSystemAnimationAsync(_ animation: UIView.SystemAnimation, on views: [UIView], options: UIView.AnimationOptions = [], animations parallelAnimations: (() -> Void)?) async -> Bool @available(iOS 12.0, *) class func modifyAnimations(withRepeatCount count: CGFloat, autoreverses: Bool, animations: () -> Void) } @@ -277,7 +277,7 @@ extension UIView { @available(iOS 7.0, *) class func animateKeyframes(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.KeyframeAnimationOptions = [], animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(iOS 7.0, *) - class func animateKeyframes(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.KeyframeAnimationOptions = [], animations: @escaping () -> Void) async -> Bool + class func animateKeyframesAsync(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.KeyframeAnimationOptions = [], animations: @escaping () -> Void) async -> Bool @available(iOS 7.0, *) class func addKeyframe(withRelativeStartTime frameStartTime: Double, relativeDuration frameDuration: Double, animations: @escaping () -> Void) } diff --git a/iOS/UIKit/UIViewController.swift b/iOS/UIKit/UIViewController.swift index fb090d9..480b4d1 100644 --- a/iOS/UIKit/UIViewController.swift +++ b/iOS/UIKit/UIViewController.swift @@ -119,11 +119,11 @@ class UIViewController : UIResponder, NSCoding, UIAppearanceContainer, UITraitEn @available(iOS 5.0, *) func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) @available(iOS 5.0, *) - func present(_ viewControllerToPresent: UIViewController, animated flag: Bool) async + func presentAsync(_ viewControllerToPresent: UIViewController, animated flag: Bool) async @available(iOS 5.0, *) func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) @available(iOS 5.0, *) - func dismiss(animated flag: Bool) async + func dismissAsync(animated flag: Bool) async @available(iOS 3.0, *) var modalTransitionStyle: UIModalTransitionStyle @available(iOS 3.2, *) @@ -196,7 +196,7 @@ extension UIViewController { @available(iOS 5.0, *) func transition(from fromViewController: UIViewController, to toViewController: UIViewController, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(iOS 5.0, *) - func transition(from fromViewController: UIViewController, to toViewController: UIViewController, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool + func transitionAsync(from fromViewController: UIViewController, to toViewController: UIViewController, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool @available(iOS 5.0, *) func beginAppearanceTransition(_ isAppearing: Bool, animated: Bool) @available(iOS 5.0, *) diff --git a/iOS/UserNotifications/UNUserNotificationCenter.swift b/iOS/UserNotifications/UNUserNotificationCenter.swift index 7660c79..c9773c2 100644 --- a/iOS/UserNotifications/UNUserNotificationCenter.swift +++ b/iOS/UserNotifications/UNUserNotificationCenter.swift @@ -29,7 +29,7 @@ class UNUserNotificationCenter : NSObject { func getNotificationSettings(completionHandler: @escaping (UNNotificationSettings) -> Void) func notificationSettings() async -> UNNotificationSettings func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) - func add(_ request: UNNotificationRequest) async throws + func addNotificationRequestAsync(_ request: UNNotificationRequest) async throws func getPendingNotificationRequests(completionHandler: @escaping ([UNNotificationRequest]) -> Void) func pendingNotificationRequests() async -> [UNNotificationRequest] func removePendingNotificationRequests(withIdentifiers identifiers: [String]) diff --git a/iOS/WebKit/WKHTTPCookieStore.swift b/iOS/WebKit/WKHTTPCookieStore.swift index 62e6489..cc1bcc1 100644 --- a/iOS/WebKit/WKHTTPCookieStore.swift +++ b/iOS/WebKit/WKHTTPCookieStore.swift @@ -8,9 +8,9 @@ class WKHTTPCookieStore : NSObject { func getAllCookies(_ completionHandler: @escaping ([HTTPCookie]) -> Void) func allCookies() async -> [HTTPCookie] func setCookie(_ cookie: HTTPCookie, completionHandler: (() -> Void)? = nil) - func setCookie(_ cookie: HTTPCookie) async + func setCookieAsync(_ cookie: HTTPCookie) async func delete(_ cookie: HTTPCookie, completionHandler: (() -> Void)? = nil) - func delete(_ cookie: HTTPCookie) async + func deleteCookieAsync(_ cookie: HTTPCookie) async func add(_ observer: WKHTTPCookieStoreObserver) func remove(_ observer: WKHTTPCookieStoreObserver) } diff --git a/iOS/WebKit/WKWebView.swift b/iOS/WebKit/WKWebView.swift index da35286..b51e7ce 100644 --- a/iOS/WebKit/WKWebView.swift +++ b/iOS/WebKit/WKWebView.swift @@ -28,15 +28,15 @@ class WKWebView : UIView { func reloadFromOrigin() -> WKNavigation? func stopLoading() func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, Error?) -> Void)? = nil) - func evaluateJavaScript(_ javaScriptString: String) async throws -> Any + func evaluateJavaScriptAsync(_ javaScriptString: String) async throws -> Any @available(iOS 14.0, *) func __evaluateJavaScript(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld, completionHandler: ((Any?, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func __evaluateJavaScript(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any + func __evaluateJavaScriptAsync(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any @available(iOS 14.0, *) func __callAsyncJavaScript(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld, completionHandler: ((Any?, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func __callAsyncJavaScript(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any + func __callAsyncJavaScriptAsync(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any @available(iOS 11.0, *) func takeSnapshot(with snapshotConfiguration: WKSnapshotConfiguration?, completionHandler: @escaping (UIImage?, Error?) -> Void) @available(iOS 11.0, *) diff --git a/macOS/AVFoundation/AVAsynchronousKeyValueLoading.swift b/macOS/AVFoundation/AVAsynchronousKeyValueLoading.swift index 22888c5..d104d0f 100644 --- a/macOS/AVFoundation/AVAsynchronousKeyValueLoading.swift +++ b/macOS/AVFoundation/AVAsynchronousKeyValueLoading.swift @@ -11,5 +11,5 @@ enum AVKeyValueStatus : Int { protocol AVAsynchronousKeyValueLoading { func statusOfValue(forKey key: String, error outError: NSErrorPointer) -> AVKeyValueStatus func loadValuesAsynchronously(forKeys keys: [String], completionHandler handler: (() -> Void)? = nil) - func loadValues(forKeys keys: [String]) async + func loadValuesAsync(forKeys keys: [String]) async } diff --git a/macOS/AVFoundation/AVPlayer.swift b/macOS/AVFoundation/AVPlayer.swift index 7a494f9..6f0f9ef 100644 --- a/macOS/AVFoundation/AVPlayer.swift +++ b/macOS/AVFoundation/AVPlayer.swift @@ -87,7 +87,7 @@ extension AVPlayer { @available(macOS 10.8, *) func preroll(atRate rate: Float, completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.8, *) - func preroll(atRate rate: Float) async -> Bool + func prerollAsync(atRate rate: Float) async -> Bool @available(macOS 10.8, *) func cancelPendingPrerolls() @available(macOS 10.8, *) diff --git a/macOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift b/macOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift index 27b6813..9fa5217 100644 --- a/macOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift +++ b/macOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift @@ -15,7 +15,7 @@ extension AVSampleBufferRenderSynchronizer { var renderers: [AVQueuedSampleBufferRendering] { get } func addRenderer(_ renderer: AVQueuedSampleBufferRendering) func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime, completionHandler: ((Bool) -> Void)? = nil) - func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool + func removeRendererAsync(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool } extension AVSampleBufferRenderSynchronizer { func addPeriodicTimeObserver(forInterval interval: CMTime, queue: DispatchQueue?, using block: @escaping (CMTime) -> Void) -> Any diff --git a/macOS/AVKit/AVPlayerView.swift b/macOS/AVKit/AVPlayerView.swift index eaa14be..ff07aec 100644 --- a/macOS/AVKit/AVPlayerView.swift +++ b/macOS/AVKit/AVPlayerView.swift @@ -35,7 +35,7 @@ extension AVPlayerView { extension AVPlayerView { var canBeginTrimming: Bool { get } func beginTrimming(completionHandler handler: ((AVPlayerViewTrimResult) -> Void)? = nil) - func beginTrimming() async -> AVPlayerViewTrimResult + func beginTrimmingAsync() async -> AVPlayerViewTrimResult } @available(macOS 10.9, *) enum AVPlayerViewTrimResult : Int { diff --git a/macOS/AppKit/NSAlert.swift b/macOS/AppKit/NSAlert.swift index 747c919..29c6250 100644 --- a/macOS/AppKit/NSAlert.swift +++ b/macOS/AppKit/NSAlert.swift @@ -36,7 +36,7 @@ class NSAlert : NSObject { @available(macOS 10.9, *) func beginSheetModal(for sheetWindow: NSWindow, completionHandler handler: ((NSApplication.ModalResponse) -> Void)? = nil) @available(macOS 10.9, *) - func beginSheetModal(for sheetWindow: NSWindow) async -> NSApplication.ModalResponse + func beginSheetModalAsync(for sheetWindow: NSWindow) async -> NSApplication.ModalResponse var window: NSWindow { get } } protocol NSAlertDelegate : NSObjectProtocol { diff --git a/macOS/AppKit/NSCollectionView.swift b/macOS/AppKit/NSCollectionView.swift index 15646e2..e77cdef 100644 --- a/macOS/AppKit/NSCollectionView.swift +++ b/macOS/AppKit/NSCollectionView.swift @@ -154,7 +154,7 @@ class NSCollectionView : NSView, NSDraggingSource, NSDraggingDestination { @available(macOS 10.11, *) func performBatchUpdates(_ updates: (() -> Void)?, completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.11, *) - func performBatchUpdates(_ updates: (() -> Void)?) async -> Bool + func performBatchUpdatesAsync(_ updates: (() -> Void)?) async -> Bool @available(macOS 10.12, *) @IBAction func toggleSectionCollapse(_ sender: Any) @available(macOS 10.11, *) diff --git a/macOS/AppKit/NSDocument.swift b/macOS/AppKit/NSDocument.swift index 3a68ca0..446c2ef 100644 --- a/macOS/AppKit/NSDocument.swift +++ b/macOS/AppKit/NSDocument.swift @@ -105,7 +105,7 @@ class NSDocument : NSObject, NSEditorRegistration, NSFilePresenter, NSMenuItemVa @available(macOS 10.12, *) func stopBrowsingVersions(completionHandler: (() -> Void)? = nil) @available(macOS 10.12, *) - func stopBrowsingVersions() async + func stopBrowsingVersionsAsync() async @available(macOS 10.8, *) class var autosavesDrafts: Bool { get } var autosavingFileType: String? { get } @@ -131,7 +131,7 @@ class NSDocument : NSObject, NSEditorRegistration, NSFilePresenter, NSMenuItemVa @available(macOS 10.8, *) func move(to url: URL, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) - func move(to url: URL) async throws + func moveAsync(to url: URL) async throws @available(macOS 10.8, *) @IBAction func lock(_ sender: Any?) @available(macOS 10.8, *) @@ -143,7 +143,7 @@ class NSDocument : NSObject, NSEditorRegistration, NSFilePresenter, NSMenuItemVa @available(macOS 10.8, *) func lock(completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) - func lock() async throws + func lockAsync() async throws @available(macOS 10.8, *) func unlock(completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.8, *) @@ -151,7 +151,7 @@ class NSDocument : NSObject, NSEditorRegistration, NSFilePresenter, NSMenuItemVa @available(macOS 10.8, *) func unlock(completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) - func unlock() async throws + func unlockAsync() async throws @available(macOS 10.8, *) var isLocked: Bool { get } @IBAction func runPageLayout(_ sender: Any?) @@ -172,7 +172,7 @@ class NSDocument : NSObject, NSEditorRegistration, NSFilePresenter, NSMenuItemVa @available(macOS 10.13, *) func share(with sharingService: NSSharingService, completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.13, *) - func share(with sharingService: NSSharingService) async -> Bool + func shareAsync(with sharingService: NSSharingService) async -> Bool @available(macOS 10.13, *) func prepare(_ sharingServicePicker: NSSharingServicePicker) var isDocumentEdited: Bool { get } diff --git a/macOS/AppKit/NSSpellChecker.swift b/macOS/AppKit/NSSpellChecker.swift index 15e3721..9c8e0ca 100644 --- a/macOS/AppKit/NSSpellChecker.swift +++ b/macOS/AppKit/NSSpellChecker.swift @@ -69,7 +69,7 @@ class NSSpellChecker : NSObject { @available(macOS 10.7, *) func showCorrectionIndicator(of type: NSSpellChecker.CorrectionIndicatorType, primaryString: String, alternativeStrings: [String], forStringIn rectOfTypedString: NSRect, view: NSView, completionHandler completionBlock: ((String?) -> Void)? = nil) @available(macOS 10.7, *) - func showCorrectionIndicator(of type: NSSpellChecker.CorrectionIndicatorType, primaryString: String, alternativeStrings: [String], forStringIn rectOfTypedString: NSRect, view: NSView) async -> String? + func showCorrectionIndicatorAsync(of type: NSSpellChecker.CorrectionIndicatorType, primaryString: String, alternativeStrings: [String], forStringIn rectOfTypedString: NSRect, view: NSView) async -> String? @available(macOS 10.7, *) func dismissCorrectionIndicator(for view: NSView) @available(macOS 10.12, *) diff --git a/macOS/AppKit/NSViewController.swift b/macOS/AppKit/NSViewController.swift index e6d2f59..a447699 100644 --- a/macOS/AppKit/NSViewController.swift +++ b/macOS/AppKit/NSViewController.swift @@ -66,7 +66,7 @@ extension NSViewController { @available(macOS 10.10, *) func transition(from fromViewController: NSViewController, to toViewController: NSViewController, options: NSViewController.TransitionOptions = [], completionHandler completion: (() -> Void)? = nil) @available(macOS 10.10, *) - func transition(from fromViewController: NSViewController, to toViewController: NSViewController, options: NSViewController.TransitionOptions = []) async + func transitionAsync(from fromViewController: NSViewController, to toViewController: NSViewController, options: NSViewController.TransitionOptions = []) async } extension NSViewController { @available(macOS 10.10, *) diff --git a/macOS/AppKit/NSWindow.swift b/macOS/AppKit/NSWindow.swift index 914d432..89d2a22 100644 --- a/macOS/AppKit/NSWindow.swift +++ b/macOS/AppKit/NSWindow.swift @@ -413,11 +413,11 @@ class NSWindow : NSResponder, NSAnimatablePropertyContainer, NSMenuItemValidatio @available(macOS 10.9, *) func beginSheet(_ sheetWindow: NSWindow, completionHandler handler: ((NSApplication.ModalResponse) -> Void)? = nil) @available(macOS 10.9, *) - func beginSheet(_ sheetWindow: NSWindow) async -> NSApplication.ModalResponse + func beginSheetAsync(_ sheetWindow: NSWindow) async -> NSApplication.ModalResponse @available(macOS 10.9, *) func beginCriticalSheet(_ sheetWindow: NSWindow, completionHandler handler: ((NSApplication.ModalResponse) -> Void)? = nil) @available(macOS 10.9, *) - func beginCriticalSheet(_ sheetWindow: NSWindow) async -> NSApplication.ModalResponse + func beginCriticalSheetAsync(_ sheetWindow: NSWindow) async -> NSApplication.ModalResponse @available(macOS 10.9, *) func endSheet(_ sheetWindow: NSWindow) @available(macOS 10.9, *) diff --git a/macOS/AppKit/NSWorkspace.swift b/macOS/AppKit/NSWorkspace.swift index fe04084..f4fba87 100644 --- a/macOS/AppKit/NSWorkspace.swift +++ b/macOS/AppKit/NSWorkspace.swift @@ -6,15 +6,15 @@ class NSWorkspace : NSObject { @available(macOS 10.15, *) func open(_ url: URL, configuration: NSWorkspace.OpenConfiguration, completionHandler: ((NSRunningApplication?, Error?) -> Void)? = nil) @available(macOS 10.15, *) - func open(_ url: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication + func openURLAsync(_ url: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication @available(macOS 10.15, *) func open(_ urls: [URL], withApplicationAt applicationURL: URL, configuration: NSWorkspace.OpenConfiguration, completionHandler: ((NSRunningApplication?, Error?) -> Void)? = nil) @available(macOS 10.15, *) - func open(_ urls: [URL], withApplicationAt applicationURL: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication + func openURLsAsync(_ urls: [URL], withApplicationAt applicationURL: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication @available(macOS 10.15, *) func openApplication(at applicationURL: URL, configuration: NSWorkspace.OpenConfiguration, completionHandler: ((NSRunningApplication?, Error?) -> Void)? = nil) @available(macOS 10.15, *) - func openApplication(at applicationURL: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication + func openApplicationAsync(at applicationURL: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication func selectFile(_ fullPath: String?, inFileViewerRootedAtPath rootFullPath: String) -> Bool @available(macOS 10.6, *) func activateFileViewerSelecting(_ fileURLs: [URL]) @@ -32,11 +32,11 @@ class NSWorkspace : NSObject { @available(macOS 10.6, *) func recycle(_ URLs: [URL], completionHandler handler: (([URL : URL], Error?) -> Void)? = nil) @available(macOS 10.6, *) - func recycle(_ URLs: [URL]) async throws -> [URL : URL] + func recycleURLsAsync(_ URLs: [URL]) async throws -> [URL : URL] @available(macOS 10.6, *) func duplicate(_ URLs: [URL], completionHandler handler: (([URL : URL], Error?) -> Void)? = nil) @available(macOS 10.6, *) - func duplicate(_ URLs: [URL]) async throws -> [URL : URL] + func duplicateURLsAsync(_ URLs: [URL]) async throws -> [URL : URL] func getFileSystemInfo(forPath fullPath: String, isRemovable removableFlag: UnsafeMutablePointer?, isWritable writableFlag: UnsafeMutablePointer?, isUnmountable unmountableFlag: UnsafeMutablePointer?, description: AutoreleasingUnsafeMutablePointer?, type fileSystemType: AutoreleasingUnsafeMutablePointer?) -> Bool func unmountAndEjectDevice(atPath path: String) -> Bool @available(macOS 10.6, *) diff --git a/macOS/AuthenticationServices/ASCredentialIdentityStore.swift b/macOS/AuthenticationServices/ASCredentialIdentityStore.swift index 6097700..f3d10ab 100644 --- a/macOS/AuthenticationServices/ASCredentialIdentityStore.swift +++ b/macOS/AuthenticationServices/ASCredentialIdentityStore.swift @@ -16,9 +16,9 @@ class ASCredentialIdentityStore : NSObject { func getState(_ completion: @escaping (ASCredentialIdentityStoreState) -> Void) func getState() async -> ASCredentialIdentityStoreState func saveCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity], completion: ((Bool, Error?) -> Void)? = nil) - func saveCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool + func saveCredentialIdentitiesAsync(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool func removeCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity], completion: ((Bool, Error?) -> Void)? = nil) - func removeCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool + func removeCredentialIdentitiesAsync(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool func removeAllCredentialIdentities(_ completion: ((Bool, Error?) -> Void)? = nil) func removeAllCredentialIdentities() async throws -> Bool func replaceCredentialIdentities(with newCredentialIdentities: [ASPasswordCredentialIdentity], completion: ((Bool, Error?) -> Void)? = nil) diff --git a/macOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift b/macOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift index 3f85764..ea224dc 100644 --- a/macOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift +++ b/macOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift @@ -2,6 +2,6 @@ @available(macOS 11.0, *) class ASCredentialProviderExtensionContext : NSExtensionContext { func completeRequest(withSelectedCredential credential: ASPasswordCredential, completionHandler: ((Bool) -> Void)? = nil) - func completeRequest(withSelectedCredential credential: ASPasswordCredential) async -> Bool + func completeRequestAsync(withSelectedCredential credential: ASPasswordCredential) async -> Bool func completeExtensionConfigurationRequest() } diff --git a/macOS/ClassKit/CLSDataStore.swift b/macOS/ClassKit/CLSDataStore.swift index 2b8e711..b21b0a9 100644 --- a/macOS/ClassKit/CLSDataStore.swift +++ b/macOS/ClassKit/CLSDataStore.swift @@ -11,7 +11,7 @@ class CLSDataStore : NSObject { var runningActivity: CLSActivity? { get } weak var delegate: @sil_weak CLSDataStoreDelegate? func save(completion: ((Error?) -> Void)? = nil) - func save() async throws + func saveAsync() async throws @available(macOS 11.0, *) func completeAllAssignedActivities(matching contextPath: [String]) } diff --git a/macOS/Collaboration/CBIdentityPicker.swift b/macOS/Collaboration/CBIdentityPicker.swift index 3fc556b..7fab80e 100644 --- a/macOS/Collaboration/CBIdentityPicker.swift +++ b/macOS/Collaboration/CBIdentityPicker.swift @@ -7,6 +7,6 @@ class CBIdentityPicker : NSObject { @available(macOS, introduced: 10.5, deprecated: 10.11, message: "Use runModalForWindow:completionHandler: instead.") func runModal(for window: NSWindow, modalDelegate delegate: Any?, didEnd didEndSelector: Selector?, contextInfo: UnsafeMutableRawPointer?) func runModal(for window: NSWindow, completionHandler: ((NSApplication.ModalResponse) -> Void)? = nil) - func runModal(for window: NSWindow) async -> NSApplication.ModalResponse + func runModalAsync(for window: NSWindow) async -> NSApplication.ModalResponse var identities: [CBIdentity] { get } } diff --git a/macOS/CoreHaptics/CHHapticEngine.swift b/macOS/CoreHaptics/CHHapticEngine.swift index 52f49b9..ca65187 100644 --- a/macOS/CoreHaptics/CHHapticEngine.swift +++ b/macOS/CoreHaptics/CHHapticEngine.swift @@ -35,10 +35,10 @@ class CHHapticEngine : NSObject { var isAutoShutdownEnabled: Bool init() throws func start(completionHandler: CHHapticEngine.CompletionHandler? = nil) - func start() async throws + func startAsync() async throws func start() throws func stop(completionHandler: CHHapticEngine.CompletionHandler? = nil) - func stop() async throws + func stopAsync() async throws func notifyWhenPlayersFinished(finishedHandler: @escaping CHHapticEngine.FinishedHandler) func makePlayer(with pattern: CHHapticPattern) throws -> CHHapticPatternPlayer func makeAdvancedPlayer(with pattern: CHHapticPattern) throws -> CHHapticAdvancedPatternPlayer diff --git a/macOS/CoreSpotlight/CSSearchableIndex.swift b/macOS/CoreSpotlight/CSSearchableIndex.swift index 84fef3b..5680249 100644 --- a/macOS/CoreSpotlight/CSSearchableIndex.swift +++ b/macOS/CoreSpotlight/CSSearchableIndex.swift @@ -22,18 +22,18 @@ class CSSearchableIndex : NSObject { init(name: String) init(name: String, protectionClass: FileProtectionType?) func indexSearchableItems(_ items: [CSSearchableItem], completionHandler: ((Error?) -> Void)? = nil) - func indexSearchableItems(_ items: [CSSearchableItem]) async throws + func indexSearchableItemsAsync(_ items: [CSSearchableItem]) async throws func deleteSearchableItems(withIdentifiers identifiers: [String], completionHandler: ((Error?) -> Void)? = nil) - func deleteSearchableItems(withIdentifiers identifiers: [String]) async throws + func deleteSearchableItemsAsync(withIdentifiers identifiers: [String]) async throws func deleteSearchableItems(withDomainIdentifiers domainIdentifiers: [String], completionHandler: ((Error?) -> Void)? = nil) - func deleteSearchableItems(withDomainIdentifiers domainIdentifiers: [String]) async throws + func deleteSearchableItemsAsync(withDomainIdentifiers domainIdentifiers: [String]) async throws func deleteAllSearchableItems(completionHandler: ((Error?) -> Void)? = nil) - func deleteAllSearchableItems() async throws + func deleteAllSearchableItemsAsync() async throws } extension CSSearchableIndex { func beginBatch() func endBatch(withClientState clientState: Data, completionHandler: ((Error?) -> Void)? = nil) - func endBatch(withClientState clientState: Data) async throws + func endBatchAsync(withClientState clientState: Data) async throws func fetchLastClientState(completionHandler: @escaping (Data?, Error?) -> Void) func fetchLastClientState() async throws -> Data } diff --git a/macOS/Foundation/NSExtensionContext.swift b/macOS/Foundation/NSExtensionContext.swift index c8c8408..a0a8eb2 100644 --- a/macOS/Foundation/NSExtensionContext.swift +++ b/macOS/Foundation/NSExtensionContext.swift @@ -6,7 +6,7 @@ class NSExtensionContext : NSObject { func completeRequest(returningItems items: [Any]?) async -> Bool func cancelRequest(withError error: Error) func open(_ URL: URL, completionHandler: ((Bool) -> Void)? = nil) - func open(_ URL: URL) async -> Bool + func openURLAsync(_ URL: URL) async -> Bool } @available(macOS 10.10, *) let NSExtensionItemsAndErrorsKey: String diff --git a/macOS/Foundation/NSItemProvider.swift b/macOS/Foundation/NSItemProvider.swift index 5a4b910..e7fbba2 100644 --- a/macOS/Foundation/NSItemProvider.swift +++ b/macOS/Foundation/NSItemProvider.swift @@ -77,7 +77,7 @@ class NSItemProvider : NSObject, NSCopying { convenience init?(contentsOf fileURL: URL!) func registerItem(forTypeIdentifier typeIdentifier: String, loadHandler: @escaping NSItemProvider.LoadHandler) func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil, completionHandler: NSItemProvider.CompletionHandler? = nil) - func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding + func loadItemAsync(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding } @available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) @@ -97,7 +97,7 @@ extension NSItemProvider { @available(macOS 10.10, *) func loadPreviewImage(options: [AnyHashable : Any]! = [:], completionHandler: NSItemProvider.CompletionHandler!) @available(macOS 10.10, *) - func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding + func loadPreviewImageAsync(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding } @available(macOS 10.10, *) let NSExtensionJavaScriptPreprocessingResultsKey: String diff --git a/macOS/Foundation/NSUserScriptTask.swift b/macOS/Foundation/NSUserScriptTask.swift index 1486d8f..dea2d81 100644 --- a/macOS/Foundation/NSUserScriptTask.swift +++ b/macOS/Foundation/NSUserScriptTask.swift @@ -4,7 +4,7 @@ class NSUserScriptTask : NSObject { init(url: URL) throws var scriptURL: URL { get } func execute(completionHandler handler: NSUserScriptTask.CompletionHandler? = nil) - func execute() async throws + func executeAsync() async throws } extension NSUserScriptTask { typealias CompletionHandler = (Error?) -> Void @@ -15,7 +15,7 @@ class NSUserUnixTask : NSUserScriptTask { var standardOutput: FileHandle? var standardError: FileHandle? func execute(withArguments arguments: [String]?, completionHandler handler: NSUserUnixTask.CompletionHandler? = nil) - func execute(withArguments arguments: [String]?) async throws + func executeAsync(withArguments arguments: [String]?) async throws } extension NSUserUnixTask { typealias CompletionHandler = (Error?) -> Void @@ -23,7 +23,7 @@ extension NSUserUnixTask { @available(macOS 10.8, *) class NSUserAppleScriptTask : NSUserScriptTask { func execute(withAppleEvent event: NSAppleEventDescriptor?, completionHandler handler: NSUserAppleScriptTask.CompletionHandler? = nil) - func execute(withAppleEvent event: NSAppleEventDescriptor?) async throws -> NSAppleEventDescriptor + func executeAsync(withAppleEvent event: NSAppleEventDescriptor?) async throws -> NSAppleEventDescriptor } extension NSUserAppleScriptTask { typealias CompletionHandler = (NSAppleEventDescriptor?, Error?) -> Void @@ -32,7 +32,7 @@ extension NSUserAppleScriptTask { class NSUserAutomatorTask : NSUserScriptTask { var variables: [String : Any]? func execute(withInput input: NSSecureCoding?, completionHandler handler: NSUserAutomatorTask.CompletionHandler? = nil) - func execute(withInput input: NSSecureCoding?) async throws -> Any + func executeAsync(withInput input: NSSecureCoding?) async throws -> Any } extension NSUserAutomatorTask { typealias CompletionHandler = (Any?, Error?) -> Void diff --git a/macOS/GameController/GCController.swift b/macOS/GameController/GCController.swift index e483be9..adead4a 100644 --- a/macOS/GameController/GCController.swift +++ b/macOS/GameController/GCController.swift @@ -44,7 +44,7 @@ class GCController : NSObject, GCDevice { func capture() -> GCController class func controllers() -> [GCController] class func startWirelessControllerDiscovery(completionHandler: (() -> Void)? = nil) - class func startWirelessControllerDiscovery() async + class func startWirelessControllerDiscoveryAsync() async class func stopWirelessControllerDiscovery() @available(macOS 10.15, *) class func withMicroGamepad() -> GCController diff --git a/macOS/GameKit/GKAchievement.swift b/macOS/GameKit/GKAchievement.swift index ad0ab2a..b38c9a5 100644 --- a/macOS/GameKit/GKAchievement.swift +++ b/macOS/GameKit/GKAchievement.swift @@ -2,16 +2,16 @@ @available(macOS 10.8, *) class GKAchievement : NSObject, NSCoding, NSSecureCoding { class func loadAchievements(completionHandler: (([GKAchievement]?, Error?) -> Void)? = nil) - class func loadAchievements() async throws -> [GKAchievement] + class func loadAchievementsAsync() async throws -> [GKAchievement] class func resetAchievements(completionHandler: ((Error?) -> Void)? = nil) - class func resetAchievements() async throws + class func resetAchievementsAsync() async throws init(identifier: String) @available(macOS 10.10, *) init(identifier: String, player: GKPlayer) @available(macOS 10.8, *) class func report(_ achievements: [GKAchievement], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) - class func report(_ achievements: [GKAchievement]) async throws + class func reportAchievementsAsync(_ achievements: [GKAchievement]) async throws var identifier: String var percentComplete: Double var isCompleted: Bool { get } @@ -25,7 +25,7 @@ extension GKAchievement { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use +reportAchievements:withCompletionHandler:") func report(completionHandler: ((Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use +reportAchievements:withCompletionHandler:") - func report() async throws + func reportAsync() async throws @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use isHidden on the GKAchievementDescription class instead") var isHidden: Bool { get } } diff --git a/macOS/GameKit/GKAchievementDescription.swift b/macOS/GameKit/GKAchievementDescription.swift index b4ddfd4..4f7ca85 100644 --- a/macOS/GameKit/GKAchievementDescription.swift +++ b/macOS/GameKit/GKAchievementDescription.swift @@ -2,7 +2,7 @@ @available(macOS 10.8, *) class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { class func loadAchievementDescriptions(completionHandler: (([GKAchievementDescription]?, Error?) -> Void)? = nil) - class func loadAchievementDescriptions() async throws -> [GKAchievementDescription] + class func loadAchievementDescriptionsAsync() async throws -> [GKAchievementDescription] var identifier: String { get } @available(macOS 10.8, *) var groupIdentifier: String? { get } @@ -18,7 +18,7 @@ extension GKAchievementDescription { @available(macOS 10.8, *) var image: NSImage? { get } func loadImage(completionHandler: ((NSImage?, Error?) -> Void)? = nil) - func loadImage() async throws -> NSImage + func loadImageAsync() async throws -> NSImage class func incompleteAchievementImage() -> NSImage class func placeholderCompletedAchievementImage() -> NSImage } diff --git a/macOS/GameKit/GKChallenge.swift b/macOS/GameKit/GKChallenge.swift index eab199e..b6857af 100644 --- a/macOS/GameKit/GKChallenge.swift +++ b/macOS/GameKit/GKChallenge.swift @@ -10,7 +10,7 @@ enum GKChallengeState : Int { @available(macOS 10.8, *) class GKChallenge : NSObject, NSCoding, NSSecureCoding { class func loadReceivedChallenges(completionHandler: (([GKChallenge]?, Error?) -> Void)? = nil) - class func loadReceivedChallenges() async throws -> [GKChallenge] + class func loadReceivedChallengesAsync() async throws -> [GKChallenge] func decline() @available(macOS 10.10, *) @NSCopying var issuingPlayer: GKPlayer? { get } @@ -39,21 +39,21 @@ extension GKScore { @available(macOS, introduced: 10.10, deprecated: 11.0, message: "pass GKLeaderboardScore to reportLeaderboardScores:withEligibleChallenges:withCompletionHandler instead") class func report(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(macOS, introduced: 10.10, deprecated: 11.0, message: "pass GKLeaderboardScore to reportLeaderboardScores:withEligibleChallenges:withCompletionHandler instead") - class func report(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge]) async throws + class func reportScoresAsync(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge]) async throws @available(macOS 11.0, *) class func report(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(macOS 11.0, *) - class func report(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge]) async throws + class func reportLeaderboardScoresAsync(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge]) async throws } extension GKAchievement { @available(macOS 10.10, *) func selectChallengeablePlayers(_ players: [GKPlayer], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func selectChallengeablePlayers(_ players: [GKPlayer]) async throws -> [GKPlayer] + func selectChallengeablePlayersAsync(_ players: [GKPlayer]) async throws -> [GKPlayer] @available(macOS 10.10, *) class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) - class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge]) async throws + class func reportAchievementsAsync(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge]) async throws } extension GKScore { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, pass GKPlayers to challengeComposeControllerWithMessage:players:completionHandler: and present the view controller instead") @@ -65,7 +65,7 @@ extension GKAchievement { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, pass GKPlayers to selectChallengeablePlayers:") func selectChallengeablePlayerIDs(_ playerIDs: [String]?, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, pass GKPlayers to selectChallengeablePlayers:") - func selectChallengeablePlayerIDs(_ playerIDs: [String]?) async throws -> [String] + func selectChallengeablePlayerIDsAsync(_ playerIDs: [String]?) async throws -> [String] } typealias GKChallengeComposeCompletionBlock = (NSViewController, Bool, [String]?) -> Void extension GKScore { diff --git a/macOS/GameKit/GKLeaderboard.swift b/macOS/GameKit/GKLeaderboard.swift index 3715ae5..c8edc9a 100644 --- a/macOS/GameKit/GKLeaderboard.swift +++ b/macOS/GameKit/GKLeaderboard.swift @@ -69,7 +69,7 @@ extension GKLeaderboard { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use setDefaultLeaderboardIdentifier:completionHandler: on GKLocalPlayer instead") class func setDefault(_ leaderboardIdentifier: String?, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use setDefaultLeaderboardIdentifier:completionHandler: on GKLocalPlayer instead") - class func setDefault(_ leaderboardIdentifier: String?) async throws + class func setDefaultAsync(_ leaderboardIdentifier: String?) async throws @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler: instead.") var timeScope: GKLeaderboard.TimeScope @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler: instead.") @@ -91,15 +91,15 @@ extension GKLeaderboard { @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") func loadScores(completionHandler: (([GKScore]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") - func loadScores() async throws -> [GKScore] + func loadScoresAsync() async throws -> [GKScore] @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") class func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") - class func loadLeaderboards() async throws -> [GKLeaderboard] + class func loadLeaderboardsAsync() async throws -> [GKLeaderboard] } extension GKLeaderboard { @available(macOS 10.8, *) func loadImage(completionHandler: ((NSImage?, Error?) -> Void)? = nil) @available(macOS 10.8, *) - func loadImage() async throws -> NSImage + func loadImageAsync() async throws -> NSImage } diff --git a/macOS/GameKit/GKLeaderboardSet.swift b/macOS/GameKit/GKLeaderboardSet.swift index ab21acf..cfeca99 100644 --- a/macOS/GameKit/GKLeaderboardSet.swift +++ b/macOS/GameKit/GKLeaderboardSet.swift @@ -7,7 +7,7 @@ class GKLeaderboardSet : NSObject, NSCoding, NSSecureCoding { @available(macOS 10.10, *) class func loadLeaderboardSets(completionHandler: (([GKLeaderboardSet]?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - class func loadLeaderboardSets() async throws -> [GKLeaderboardSet] + class func loadLeaderboardSetsAsync() async throws -> [GKLeaderboardSet] @available(macOS 11.0, *) func loadLeaderboards(handler: @escaping ([GKLeaderboard]?, Error?) -> Void) } @@ -15,9 +15,9 @@ extension GKLeaderboardSet { @available(macOS, introduced: 10.10, deprecated: 11.0, message: "Use loadLeaderboardsWithHandler: instead.") func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.10, deprecated: 11.0, message: "Use loadLeaderboardsWithHandler: instead.") - func loadLeaderboards() async throws -> [GKLeaderboard] + func loadLeaderboardsAsync() async throws -> [GKLeaderboard] } extension GKLeaderboardSet { func loadImage(completionHandler: ((NSImage?, Error?) -> Void)? = nil) - func loadImage() async throws -> NSImage + func loadImageAsync() async throws -> NSImage } diff --git a/macOS/GameKit/GKLocalPlayer.swift b/macOS/GameKit/GKLocalPlayer.swift index 723bfde..4145cc9 100644 --- a/macOS/GameKit/GKLocalPlayer.swift +++ b/macOS/GameKit/GKLocalPlayer.swift @@ -13,21 +13,21 @@ class GKLocalPlayer : GKPlayer { @available(macOS 10.11, *) func loadRecentPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(macOS 10.11, *) - func loadRecentPlayers() async throws -> [GKPlayer] + func loadRecentPlayersAsync() async throws -> [GKPlayer] func loadChallengableFriends(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - func loadChallengableFriends() async throws -> [GKPlayer] + func loadChallengableFriendsAsync() async throws -> [GKPlayer] @available(macOS 10.10, *) func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) - func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String) async throws + func setDefaultLeaderboardIdentifierAsync(_ leaderboardIdentifier: String) async throws @available(macOS 10.10, *) func loadDefaultLeaderboardIdentifier(completionHandler: ((String?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func loadDefaultLeaderboardIdentifier() async throws -> String + func loadDefaultLeaderboardIdentifierAsync() async throws -> String @available(macOS 10.15.5, *) func fetchItems(forIdentityVerificationSignature completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(macOS 10.15.5, *) - func fetchItemsForIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) + func fetchItemsForIdentityVerificationSignatureAsync() async throws -> (URL, Data, Data, UInt64) } protocol GKLocalPlayerListener : GKChallengeListener, GKInviteEventListener, GKSavedGameListener, GKTurnBasedEventListener { } @@ -47,25 +47,25 @@ extension GKLocalPlayer { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use setDefaultLeaderboardIdentifier:completionHandler: instead") func setDefaultLeaderboardCategoryID(_ categoryID: String?, completionHandler: ((Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use setDefaultLeaderboardIdentifier:completionHandler: instead") - func setDefaultLeaderboardCategoryID(_ categoryID: String?) async throws + func setDefaultLeaderboardCategoryIDAsync(_ categoryID: String?) async throws @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use loadDefaultLeaderboardIdentifierWithCompletionHandler: instead") func loadDefaultLeaderboardCategoryID(completionHandler: ((String?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use loadDefaultLeaderboardIdentifierWithCompletionHandler: instead") - func loadDefaultLeaderboardCategoryID() async throws -> String + func loadDefaultLeaderboardCategoryIDAsync() async throws -> String @available(macOS, introduced: 10.10, deprecated: 10.11) func loadFriendPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.10, deprecated: 10.11) - func loadFriendPlayers() async throws -> [GKPlayer] + func loadFriendPlayersAsync() async throws -> [GKPlayer] @available(macOS, introduced: 10.10, deprecated: 10.15.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") func generateIdentityVerificationSignature(completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(macOS, introduced: 10.10, deprecated: 10.15.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") - func generateIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) + func generateIdentityVerificationSignatureAsync() async throws -> (URL, Data, Data, UInt64) } extension GKLocalPlayer { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") func loadFriends(completionHandler: (([String]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") - func loadFriends() async throws -> [String] + func loadFriendsAsync() async throws -> [String] @available(macOS, introduced: 10.8, deprecated: 10.10, message: " This property is obsolete, Use loadFriendPlayersWithCompletionHandler: instead") var friends: [String]? { get } } diff --git a/macOS/GameKit/GKMatch.swift b/macOS/GameKit/GKMatch.swift index cd60221..c4d40e5 100644 --- a/macOS/GameKit/GKMatch.swift +++ b/macOS/GameKit/GKMatch.swift @@ -32,7 +32,7 @@ class GKMatch : NSObject { @available(macOS 10.9, *) func rematch(completionHandler: ((GKMatch?, Error?) -> Void)? = nil) @available(macOS 10.9, *) - func rematch() async throws -> GKMatch + func rematchAsync() async throws -> GKMatch } protocol GKMatchDelegate : NSObjectProtocol { @available(macOS 10.10, *) diff --git a/macOS/GameKit/GKMatchmaker.swift b/macOS/GameKit/GKMatchmaker.swift index 8657aa9..5c1b376 100644 --- a/macOS/GameKit/GKMatchmaker.swift +++ b/macOS/GameKit/GKMatchmaker.swift @@ -70,24 +70,24 @@ class GKMatchmaker : NSObject { @available(macOS 10.9, *) func match(for invite: GKInvite, completionHandler: ((GKMatch?, Error?) -> Void)? = nil) @available(macOS 10.9, *) - func match(for invite: GKInvite) async throws -> GKMatch + func matchAsync(for invite: GKInvite) async throws -> GKMatch func findMatch(for request: GKMatchRequest, withCompletionHandler completionHandler: ((GKMatch?, Error?) -> Void)? = nil) - func findMatch(for request: GKMatchRequest) async throws -> GKMatch + func findMatchAsync(for request: GKMatchRequest) async throws -> GKMatch @available(macOS 10.10, *) func findPlayers(forHostedRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func findPlayers(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer] + func findPlayersAsync(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer] func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest, completionHandler: ((Error?) -> Void)? = nil) - func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest) async throws + func addPlayersAsync(to match: GKMatch, matchRequest: GKMatchRequest) async throws func cancel() @available(macOS 10.10, *) func cancelPendingInvite(to player: GKPlayer) @available(macOS 10.9, *) func finishMatchmaking(for match: GKMatch) func queryPlayerGroupActivity(_ playerGroup: Int, withCompletionHandler completionHandler: ((Int, Error?) -> Void)? = nil) - func queryPlayerGroupActivity(_ playerGroup: Int) async throws -> Int + func queryPlayerGroupActivityAsync(_ playerGroup: Int) async throws -> Int func queryActivity(completionHandler: ((Int, Error?) -> Void)? = nil) - func queryActivity() async throws -> Int + func queryActivityAsync() async throws -> Int @available(macOS 10.10, *) func startBrowsingForNearbyPlayers(handler reachableHandler: ((GKPlayer, Bool) -> Void)? = nil) @available(macOS 10.9, *) @@ -105,5 +105,5 @@ extension GKMatchmaker { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") func findPlayers(forHostedMatchRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") - func findPlayers(forHostedMatchRequest request: GKMatchRequest) async throws -> [String] + func findPlayersAsync(forHostedMatchRequest request: GKMatchRequest) async throws -> [String] } diff --git a/macOS/GameKit/GKNotificationBanner.swift b/macOS/GameKit/GKNotificationBanner.swift index 5372f83..c050717 100644 --- a/macOS/GameKit/GKNotificationBanner.swift +++ b/macOS/GameKit/GKNotificationBanner.swift @@ -4,9 +4,9 @@ class GKNotificationBanner : NSObject { @available(macOS 10.8, *) class func show(withTitle title: String?, message: String?, completionHandler: (() -> Void)? = nil) @available(macOS 10.8, *) - class func show(withTitle title: String?, message: String?) async + class func showAsync(withTitle title: String?, message: String?) async @available(macOS 10.8, *) class func show(withTitle title: String?, message: String?, duration: TimeInterval, completionHandler: (() -> Void)? = nil) @available(macOS 10.8, *) - class func show(withTitle title: String?, message: String?, duration: TimeInterval) async + class func showAsync(withTitle title: String?, message: String?, duration: TimeInterval) async } diff --git a/macOS/GameKit/GKPlayer.swift b/macOS/GameKit/GKPlayer.swift index 6aa9b2a..792f5e3 100644 --- a/macOS/GameKit/GKPlayer.swift +++ b/macOS/GameKit/GKPlayer.swift @@ -4,7 +4,7 @@ let GKPlayerIDNoLongerAvailable: String @available(macOS 10.8, *) class GKPlayer : GKBasePlayer { class func loadPlayers(forIdentifiers identifiers: [String], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] + class func loadPlayersAsync(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] @available(macOS 10.15, *) func scopedIDsArePersistent() -> Bool @available(macOS 10.14.6, *) @@ -23,7 +23,7 @@ extension GKPlayer { @available(macOS 10.8, *) func loadPhoto(for size: GKPlayer.PhotoSize, withCompletionHandler completionHandler: ((NSImage?, Error?) -> Void)? = nil) @available(macOS 10.8, *) - func loadPhoto(for size: GKPlayer.PhotoSize) async throws -> NSImage + func loadPhotoAsync(for size: GKPlayer.PhotoSize) async throws -> NSImage } extension GKPlayer { enum PhotoSize : Int { diff --git a/macOS/GameKit/GKSavedGame.swift b/macOS/GameKit/GKSavedGame.swift index c8a723d..430b9f4 100644 --- a/macOS/GameKit/GKSavedGame.swift +++ b/macOS/GameKit/GKSavedGame.swift @@ -10,23 +10,23 @@ class GKSavedGame : NSObject, NSCopying { @available(macOS 10.10, *) func loadData(completionHandler handler: ((Data?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func loadData() async throws -> Data + func loadDataAsync() async throws -> Data } extension GKLocalPlayer : GKSavedGameListener { @available(macOS 10.10, *) func fetchSavedGames(completionHandler handler: (([GKSavedGame]?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func fetchSavedGames() async throws -> [GKSavedGame] + func fetchSavedGamesAsync() async throws -> [GKSavedGame] @available(macOS 10.10, *) func saveGameData(_ data: Data, withName name: String, completionHandler handler: ((GKSavedGame?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func saveGameData(_ data: Data, withName name: String) async throws -> GKSavedGame + func saveGameDataAsync(_ data: Data, withName name: String) async throws -> GKSavedGame @available(macOS 10.10, *) func deleteSavedGames(withName name: String, completionHandler handler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) - func deleteSavedGames(withName name: String) async throws + func deleteSavedGamesAsync(withName name: String) async throws @available(macOS 10.10, *) func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data, completionHandler handler: (([GKSavedGame]?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data) async throws -> [GKSavedGame] + func resolveConflictingSavedGamesAsync(_ conflictingSavedGames: [GKSavedGame], with data: Data) async throws -> [GKSavedGame] } diff --git a/macOS/GameKit/GKScore.swift b/macOS/GameKit/GKScore.swift index f39100b..18af49e 100644 --- a/macOS/GameKit/GKScore.swift +++ b/macOS/GameKit/GKScore.swift @@ -19,13 +19,13 @@ class GKScore : NSObject, NSCoding, NSSecureCoding { @available(macOS 10.8, *) class func report(_ scores: [GKScore], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) - class func report(_ scores: [GKScore]) async throws + class func reportScoresAsync(_ scores: [GKScore]) async throws } extension GKScore { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use +reportScores:withCompletionhandler: instead") func report(completionHandler: ((Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use +reportScores:withCompletionhandler: instead") - func report() async throws + func reportAsync() async throws @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use initWithLeaderboardIdentifier: instead") init(category: String?) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use leaderboardIdentifier instead") diff --git a/macOS/GameKit/GKTurnBasedMatch.swift b/macOS/GameKit/GKTurnBasedMatch.swift index e0beb94..ac932c7 100644 --- a/macOS/GameKit/GKTurnBasedMatch.swift +++ b/macOS/GameKit/GKTurnBasedMatch.swift @@ -96,43 +96,43 @@ class GKTurnBasedMatch : NSObject { class func find(for request: GKMatchRequest, withCompletionHandler completionHandler: @escaping (GKTurnBasedMatch?, Error?) -> Void) class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch class func loadMatches(completionHandler: (([GKTurnBasedMatch]?, Error?) -> Void)? = nil) - class func loadMatches() async throws -> [GKTurnBasedMatch] + class func loadMatchesAsync() async throws -> [GKTurnBasedMatch] @available(macOS 10.8, *) class func load(withID matchID: String, withCompletionHandler completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(macOS 10.8, *) - class func load(withID matchID: String) async throws -> GKTurnBasedMatch + class func loadAsync(withID matchID: String) async throws -> GKTurnBasedMatch @available(macOS 10.9, *) func rematch(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(macOS 10.9, *) - func rematch() async throws -> GKTurnBasedMatch + func rematchAsync() async throws -> GKTurnBasedMatch @available(macOS 10.8, *) func acceptInvite(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(macOS 10.8, *) - func acceptInvite() async throws -> GKTurnBasedMatch + func acceptInviteAsync() async throws -> GKTurnBasedMatch @available(macOS 10.8, *) func declineInvite(completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) - func declineInvite() async throws + func declineInviteAsync() async throws func remove(completionHandler: ((Error?) -> Void)? = nil) - func remove() async throws + func removeAsync() async throws func loadMatchData(completionHandler: ((Data?, Error?) -> Void)? = nil) - func loadMatchData() async throws -> Data + func loadMatchDataAsync() async throws -> Data @available(macOS 10.9, *) func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.9, *) - func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + func endTurnAsync(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws @available(macOS 10.9, *) func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.9, *) - func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + func participantQuitInTurnAsync(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) - func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome) async throws + func participantQuitOutOfTurnAsync(with matchOutcome: GKTurnBasedMatch.Outcome) async throws func endMatchInTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) - func endMatchInTurn(withMatch matchData: Data) async throws + func endMatchInTurnAsync(withMatch matchData: Data) async throws @available(macOS, introduced: 10.10, deprecated: 11.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?, completionHandler: ((Error?) -> Void)? = nil) @available(macOS, introduced: 10.10, deprecated: 11.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") - func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws + func endMatchInTurnAsync(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws @available(macOS 11.0, *) func endMatchInTurn(withMatch matchData: Data, leaderboardScores scores: [GKLeaderboardScore], achievements: [Any], completionHandler: @escaping (Error?) -> Void) @available(macOS 11.0, *) @@ -140,19 +140,19 @@ class GKTurnBasedMatch : NSObject { @available(macOS 10.8, *) func saveCurrentTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) - func saveCurrentTurn(withMatch matchData: Data) async throws + func saveCurrentTurnAsync(withMatch matchData: Data) async throws @available(macOS 10.10, *) func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange], completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) - func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws + func saveMergedMatchDataAsync(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws @available(macOS 10.10, *) func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval, completionHandler: ((GKTurnBasedExchange?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange + func sendExchangeAsync(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange @available(macOS 10.10, *) func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) - func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws + func sendReminderAsync(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws } @available(macOS 10.10, *) enum GKTurnBasedExchangeStatus : Int8 { @@ -183,11 +183,11 @@ class GKTurnBasedExchange : NSObject { @available(macOS 10.10, *) func cancel(withLocalizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) - func cancel(withLocalizableMessageKey key: String, arguments: [String]) async throws + func cancelAsync(withLocalizableMessageKey key: String, arguments: [String]) async throws @available(macOS 10.10, *) func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) - func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws + func replyAsync(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws } @available(macOS 10.10, *) class GKTurnBasedExchangeReply : NSObject { diff --git a/macOS/IOUSBHost/IOUSBHostObject.swift b/macOS/IOUSBHost/IOUSBHostObject.swift index e7e8338..c186b6c 100644 --- a/macOS/IOUSBHost/IOUSBHostObject.swift +++ b/macOS/IOUSBHost/IOUSBHostObject.swift @@ -6,7 +6,7 @@ class IOUSBHostObject : NSObject { var queue: DispatchQueue { get } func __send(_ request: IOUSBDeviceRequest, data: NSMutableData?, bytesTransferred: UnsafeMutablePointer?, completionTimeout: TimeInterval) throws func __enqueue(_ request: IOUSBDeviceRequest, data: NSMutableData?, completionTimeout: TimeInterval, completionHandler: IOUSBHostCompletionHandler? = nil) throws - func __enqueue(_ request: IOUSBDeviceRequest, data: NSMutableData?, completionTimeout: TimeInterval) async throws -> (IOReturn, Int) + func __enqueueDeviceRequestAsync(_ request: IOUSBDeviceRequest, data: NSMutableData?, completionTimeout: TimeInterval) async throws -> (IOReturn, Int) func __abortDeviceRequests(with option: IOUSBHostAbortOption) throws func __descriptor(with type: tIOUSBDescriptorType, length: UnsafeMutablePointer, index: Int, languageID: Int, requestType: tIOUSBDeviceRequestTypeValue, requestRecipient: tIOUSBDeviceRequestRecipientValue) throws -> UnsafePointer func __string(with index: Int, languageID: Int) throws -> String diff --git a/macOS/IOUSBHost/IOUSBHostPipe.swift b/macOS/IOUSBHost/IOUSBHostPipe.swift index 3116484..dc52f61 100644 --- a/macOS/IOUSBHost/IOUSBHostPipe.swift +++ b/macOS/IOUSBHost/IOUSBHostPipe.swift @@ -8,14 +8,14 @@ class IOUSBHostPipe : IOUSBHostIOSource { func clearStall() throws func __sendControlRequest(_ request: IOUSBDeviceRequest, data: NSMutableData?, bytesTransferred: UnsafeMutablePointer?, completionTimeout: TimeInterval) throws func __enqueueControlRequest(_ request: IOUSBDeviceRequest, data: NSMutableData?, completionTimeout: TimeInterval, completionHandler: IOUSBHostCompletionHandler? = nil) throws - func __enqueueControlRequest(_ request: IOUSBDeviceRequest, data: NSMutableData?, completionTimeout: TimeInterval) async throws -> (IOReturn, Int) + func __enqueueControlRequestAsync(_ request: IOUSBDeviceRequest, data: NSMutableData?, completionTimeout: TimeInterval) async throws -> (IOReturn, Int) func __abort(with option: IOUSBHostAbortOption) throws func __sendIORequest(with data: NSMutableData?, bytesTransferred: UnsafeMutablePointer?, completionTimeout: TimeInterval) throws func enqueueIORequest(with data: NSMutableData?, completionTimeout: TimeInterval, completionHandler: IOUSBHostCompletionHandler? = nil) throws - func enqueueIORequest(with data: NSMutableData?, completionTimeout: TimeInterval) async throws -> (IOReturn, Int) + func enqueueIORequestAsync(with data: NSMutableData?, completionTimeout: TimeInterval) async throws -> (IOReturn, Int) func sendIORequest(with data: NSMutableData, frameList: UnsafeMutablePointer, frameListCount: Int, firstFrameNumber: UInt64) throws func enqueueIORequest(with data: NSMutableData, frameList: UnsafeMutablePointer, frameListCount: Int, firstFrameNumber: UInt64, completionHandler: IOUSBHostIsochronousCompletionHandler? = nil) throws - func enqueueIORequest(with data: NSMutableData, frameList: UnsafeMutablePointer, frameListCount: Int, firstFrameNumber: UInt64) async throws -> (IOReturn, UnsafeMutablePointer) + func enqueueIORequestAsync(with data: NSMutableData, frameList: UnsafeMutablePointer, frameListCount: Int, firstFrameNumber: UInt64) async throws -> (IOReturn, UnsafeMutablePointer) func enableStreams() throws func disableStreams() throws func copyStream(withStreamID streamID: Int) throws -> IOUSBHostStream diff --git a/macOS/IOUSBHost/IOUSBHostStream.swift b/macOS/IOUSBHost/IOUSBHostStream.swift index 2411f53..8f82276 100644 --- a/macOS/IOUSBHost/IOUSBHostStream.swift +++ b/macOS/IOUSBHost/IOUSBHostStream.swift @@ -6,5 +6,5 @@ class IOUSBHostStream : IOUSBHostIOSource { func abort() throws func __sendIORequest(with data: NSMutableData?, bytesTransferred: UnsafeMutablePointer?) throws func enqueueIORequest(with data: NSMutableData?, completionHandler: IOUSBHostCompletionHandler? = nil) throws - func enqueueIORequest(with data: NSMutableData?) async throws -> (IOReturn, Int) + func enqueueIORequestAsync(with data: NSMutableData?) async throws -> (IOReturn, Int) } diff --git a/macOS/NetworkExtension/NetworkExtension.swift b/macOS/NetworkExtension/NetworkExtension.swift index b1e8381..3da8375 100644 --- a/macOS/NetworkExtension/NetworkExtension.swift +++ b/macOS/NetworkExtension/NetworkExtension.swift @@ -108,11 +108,11 @@ class NETunnelProvider : NEProvider { @available(macOS 10.11, *) func handleAppMessage(_ messageData: Data, completionHandler: ((Data?) -> Void)? = nil) @available(macOS 10.11, *) - func handleAppMessage(_ messageData: Data) async -> Data? + func handleAppMessageAsync(_ messageData: Data) async -> Data? @available(macOS 10.11, *) func setTunnelNetworkSettings(_ tunnelNetworkSettings: NETunnelNetworkSettings?, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.11, *) - func setTunnelNetworkSettings(_ tunnelNetworkSettings: NETunnelNetworkSettings?) async throws + func setTunnelNetworkSettingsAsync(_ tunnelNetworkSettings: NETunnelNetworkSettings?) async throws @available(macOS 10.11, *) var protocolConfiguration: NEVPNProtocol { get } @available(macOS 10.11, *) @@ -176,11 +176,11 @@ class NEVPNManager : NSObject { @available(macOS 10.11, *) func removeFromPreferences(completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.11, *) - func removeFromPreferences() async throws + func removeFromPreferencesAsync() async throws @available(macOS 10.11, *) func saveToPreferences(completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.11, *) - func saveToPreferences() async throws + func saveToPreferencesAsync() async throws @available(macOS 10.11, *) func setAuthorization(_ authorization: AuthorizationRef) @available(macOS 10.11, *) diff --git a/macOS/PassKit/PKPassLibrary.swift b/macOS/PassKit/PKPassLibrary.swift index 96f3d24..0f11764 100644 --- a/macOS/PassKit/PKPassLibrary.swift +++ b/macOS/PassKit/PKPassLibrary.swift @@ -40,7 +40,7 @@ class PKPassLibrary : NSObject { @available(macOS 10.12, *) func addPasses(_ passes: [PKPass], withCompletionHandler completion: ((PKPassLibraryAddPassesStatus) -> Void)? = nil) @available(macOS 10.12, *) - func addPasses(_ passes: [PKPass]) async -> PKPassLibraryAddPassesStatus + func addPassesAsync(_ passes: [PKPass]) async -> PKPassLibraryAddPassesStatus @available(macOS 10.12, *) func openPaymentSetup() func present(_ pass: PKPaymentPass) @@ -49,9 +49,9 @@ class PKPassLibrary : NSObject { func canAddSecureElementPass(primaryAccountIdentifier: String) -> Bool func canAddFelicaPass() -> Bool func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data, completion: ((Bool, Error) -> Void)? = nil) - func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data) async -> (Bool, Error) + func activatePaymentPassAsync(_ paymentPass: PKPaymentPass, withActivationData activationData: Data) async -> (Bool, Error) func activate(_ paymentPass: PKPaymentPass, withActivationCode activationCode: String, completion: ((Bool, Error) -> Void)? = nil) - func activate(_ paymentPass: PKPaymentPass, withActivationCode activationCode: String) async -> (Bool, Error) + func activatePaymentPassAsync(_ paymentPass: PKPaymentPass, withActivationCode activationCode: String) async -> (Bool, Error) func activate(_ secureElementPass: PKSecureElementPass, activationData: Data, completion: ((Bool, Error?) -> Void)? = nil) func activate(_ secureElementPass: PKSecureElementPass, activationData: Data) async throws -> Bool func sign(_ signData: Data, using secureElementPass: PKSecureElementPass, completion: @escaping (Data?, Data?, Error?) -> Void) diff --git a/macOS/PassKit/PKPaymentAuthorizationController.swift b/macOS/PassKit/PKPaymentAuthorizationController.swift index 53b4039..f204385 100644 --- a/macOS/PassKit/PKPaymentAuthorizationController.swift +++ b/macOS/PassKit/PKPaymentAuthorizationController.swift @@ -49,7 +49,7 @@ class PKPaymentAuthorizationController : NSObject { weak var delegate: @sil_weak PKPaymentAuthorizationControllerDelegate? init(paymentRequest request: PKPaymentRequest) func present(completion: ((Bool) -> Void)? = nil) - func present() async -> Bool + func presentAsync() async -> Bool func dismiss(completion: (() -> Void)? = nil) - func dismiss() async + func dismissAsync() async } diff --git a/macOS/Photos/PHPhotoLibrary.swift b/macOS/Photos/PHPhotoLibrary.swift index 209490f..af6351d 100644 --- a/macOS/Photos/PHPhotoLibrary.swift +++ b/macOS/Photos/PHPhotoLibrary.swift @@ -54,7 +54,7 @@ class PHPhotoLibrary : NSObject { @available(macOS 10.13, *) func performChanges(_ changeBlock: @escaping () -> Void, completionHandler: ((Bool, Error?) -> Void)? = nil) @available(macOS 10.13, *) - func performChanges(_ changeBlock: @escaping () -> Void) async throws -> Bool + func performChangesAsync(_ changeBlock: @escaping () -> Void) async throws -> Bool @available(macOS 10.13, *) func performChangesAndWait(_ changeBlock: @escaping () -> Void) throws @available(macOS 10.13, *) diff --git a/macOS/ReplayKit/RPScreenRecorder.swift b/macOS/ReplayKit/RPScreenRecorder.swift index fa601ca..f6f9070 100644 --- a/macOS/ReplayKit/RPScreenRecorder.swift +++ b/macOS/ReplayKit/RPScreenRecorder.swift @@ -18,7 +18,7 @@ class RPScreenRecorder : NSObject { @available(macOS 11.0, *) func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 11.0, *) - func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?) async throws + func startCaptureAsync(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?) async throws @available(macOS 11.0, *) func stopCapture(handler: ((Error?) -> Void)? = nil) weak var delegate: @sil_weak RPScreenRecorderDelegate? diff --git a/macOS/SafariServices/SFContentBlockerManager.swift b/macOS/SafariServices/SFContentBlockerManager.swift index 0bb2c87..924e302 100644 --- a/macOS/SafariServices/SFContentBlockerManager.swift +++ b/macOS/SafariServices/SFContentBlockerManager.swift @@ -1,7 +1,7 @@ class SFContentBlockerManager : NSObject { class func reloadContentBlocker(withIdentifier identifier: String, completionHandler: ((Error?) -> Void)? = nil) - class func reloadContentBlocker(withIdentifier identifier: String) async throws + class func reloadContentBlockerAsync(withIdentifier identifier: String) async throws class func getStateOfContentBlocker(withIdentifier identifier: String, completionHandler: @escaping (SFContentBlockerState?, Error?) -> Void) class func stateOfContentBlocker(withIdentifier identifier: String) async throws -> SFContentBlockerState } diff --git a/macOS/SafariServices/SFSafariApplication.swift b/macOS/SafariServices/SFSafariApplication.swift index ad6840a..a66046d 100644 --- a/macOS/SafariServices/SFSafariApplication.swift +++ b/macOS/SafariServices/SFSafariApplication.swift @@ -6,12 +6,12 @@ class SFSafariApplication : NSObject { class func getAllWindows(completionHandler: @escaping ([SFSafariWindow]) -> Void) class func allWindows() async -> [SFSafariWindow] class func openWindow(with url: URL, completionHandler: ((SFSafariWindow?) -> Void)? = nil) - class func openWindow(with url: URL) async -> SFSafariWindow? + class func openWindowAsync(with url: URL) async -> SFSafariWindow? class func setToolbarItemsNeedUpdate() class func getHostApplication(completionHandler: @escaping (NSRunningApplication) -> Void) class func hostApplication() async -> NSRunningApplication class func showPreferencesForExtension(withIdentifier identifier: String, completionHandler: ((Error?) -> Void)? = nil) - class func showPreferencesForExtension(withIdentifier identifier: String) async throws + class func showPreferencesForExtensionAsync(withIdentifier identifier: String) async throws class func dispatchMessage(withName messageName: String, toExtensionWithIdentifier identifier: String, userInfo: [String : Any]? = nil, completionHandler: ((Error?) -> Void)? = nil) - class func dispatchMessage(withName messageName: String, toExtensionWithIdentifier identifier: String, userInfo: [String : Any]? = nil) async throws + class func dispatchMessageAsync(withName messageName: String, toExtensionWithIdentifier identifier: String, userInfo: [String : Any]? = nil) async throws } diff --git a/macOS/SafariServices/SFSafariTab.swift b/macOS/SafariServices/SFSafariTab.swift index c280440..4555549 100644 --- a/macOS/SafariServices/SFSafariTab.swift +++ b/macOS/SafariServices/SFSafariTab.swift @@ -7,7 +7,7 @@ class SFSafariTab : NSObject, NSCopying, NSSecureCoding { func getContainingWindow(completionHandler: @escaping (SFSafariWindow?) -> Void) func containingWindow() async -> SFSafariWindow? func activate(completionHandler: (() -> Void)? = nil) - func activate() async + func activateAsync() async func navigate(to url: URL) func close() } diff --git a/macOS/SafariServices/SFSafariWindow.swift b/macOS/SafariServices/SFSafariWindow.swift index f4a868a..e3aedc9 100644 --- a/macOS/SafariServices/SFSafariWindow.swift +++ b/macOS/SafariServices/SFSafariWindow.swift @@ -5,7 +5,7 @@ class SFSafariWindow : NSObject, NSCopying, NSSecureCoding { func getAllTabs(completionHandler: @escaping ([SFSafariTab]) -> Void) func allTabs() async -> [SFSafariTab] func openTab(with url: URL, makeActiveIfPossible activateTab: Bool, completionHandler: ((SFSafariTab?) -> Void)? = nil) - func openTab(with url: URL, makeActiveIfPossible activateTab: Bool) async -> SFSafariTab? + func openTabAsync(with url: URL, makeActiveIfPossible activateTab: Bool) async -> SFSafariTab? func getToolbarItem(completionHandler: @escaping (SFSafariToolbarItem?) -> Void) func toolbarItem() async -> SFSafariToolbarItem? func close() diff --git a/macOS/StoreKit/SKProductStorePromotionController.swift b/macOS/StoreKit/SKProductStorePromotionController.swift index 82ae6d9..b46342e 100644 --- a/macOS/StoreKit/SKProductStorePromotionController.swift +++ b/macOS/StoreKit/SKProductStorePromotionController.swift @@ -14,7 +14,7 @@ class SKProductStorePromotionController : NSObject { @available(macOS 11.0, *) func fetchStorePromotionVisibility(for product: SKProduct, completionHandler: ((SKProductStorePromotionVisibility, Error?) -> Void)? = nil) @available(macOS 11.0, *) - func fetchStorePromotionVisibility(for product: SKProduct) async throws -> SKProductStorePromotionVisibility + func fetchStorePromotionVisibilityAsync(for product: SKProduct) async throws -> SKProductStorePromotionVisibility @available(macOS 11.0, *) func update(storePromotionVisibility promotionVisibility: SKProductStorePromotionVisibility, for product: SKProduct, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 11.0, *) @@ -22,7 +22,7 @@ class SKProductStorePromotionController : NSObject { @available(macOS 11.0, *) func fetchStorePromotionOrder(completionHandler: (([SKProduct], Error?) -> Void)? = nil) @available(macOS 11.0, *) - func fetchStorePromotionOrder() async throws -> [SKProduct] + func fetchStorePromotionOrderAsync() async throws -> [SKProduct] @available(macOS 11.0, *) func update(storePromotionOrder: [SKProduct], completionHandler: ((Error?) -> Void)? = nil) @available(macOS 11.0, *) diff --git a/macOS/UserNotifications/UNUserNotificationCenter.swift b/macOS/UserNotifications/UNUserNotificationCenter.swift index 04fd6cd..00b5ed9 100644 --- a/macOS/UserNotifications/UNUserNotificationCenter.swift +++ b/macOS/UserNotifications/UNUserNotificationCenter.swift @@ -27,7 +27,7 @@ class UNUserNotificationCenter : NSObject { func getNotificationSettings(completionHandler: @escaping (UNNotificationSettings) -> Void) func notificationSettings() async -> UNNotificationSettings func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) - func add(_ request: UNNotificationRequest) async throws + func addNotificationRequestAsync(_ request: UNNotificationRequest) async throws func getPendingNotificationRequests(completionHandler: @escaping ([UNNotificationRequest]) -> Void) func pendingNotificationRequests() async -> [UNNotificationRequest] func removePendingNotificationRequests(withIdentifiers identifiers: [String]) diff --git a/macOS/WebKit/WKHTTPCookieStore.swift b/macOS/WebKit/WKHTTPCookieStore.swift index a55bef9..5b0ab64 100644 --- a/macOS/WebKit/WKHTTPCookieStore.swift +++ b/macOS/WebKit/WKHTTPCookieStore.swift @@ -8,9 +8,9 @@ class WKHTTPCookieStore : NSObject { func getAllCookies(_ completionHandler: @escaping ([HTTPCookie]) -> Void) func allCookies() async -> [HTTPCookie] func setCookie(_ cookie: HTTPCookie, completionHandler: (() -> Void)? = nil) - func setCookie(_ cookie: HTTPCookie) async + func setCookieAsync(_ cookie: HTTPCookie) async func delete(_ cookie: HTTPCookie, completionHandler: (() -> Void)? = nil) - func delete(_ cookie: HTTPCookie) async + func deleteCookieAsync(_ cookie: HTTPCookie) async func add(_ observer: WKHTTPCookieStoreObserver) func remove(_ observer: WKHTTPCookieStoreObserver) } diff --git a/macOS/WebKit/WKWebView.swift b/macOS/WebKit/WKWebView.swift index a2e4039..03610ff 100644 --- a/macOS/WebKit/WKWebView.swift +++ b/macOS/WebKit/WKWebView.swift @@ -28,15 +28,15 @@ class WKWebView : NSView { func reloadFromOrigin() -> WKNavigation? func stopLoading() func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, Error?) -> Void)? = nil) - func evaluateJavaScript(_ javaScriptString: String) async throws -> Any + func evaluateJavaScriptAsync(_ javaScriptString: String) async throws -> Any @available(macOS 11.0, *) func __evaluateJavaScript(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld, completionHandler: ((Any?, Error?) -> Void)? = nil) @available(macOS 11.0, *) - func __evaluateJavaScript(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any + func __evaluateJavaScriptAsync(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any @available(macOS 11.0, *) func __callAsyncJavaScript(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld, completionHandler: ((Any?, Error?) -> Void)? = nil) @available(macOS 11.0, *) - func __callAsyncJavaScript(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any + func __callAsyncJavaScriptAsync(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any @available(macOS 10.13, *) func takeSnapshot(with snapshotConfiguration: WKSnapshotConfiguration?, completionHandler: @escaping (NSImage?, Error?) -> Void) @available(macOS 10.13, *) diff --git a/tvOS/AVFoundation/AVAsynchronousKeyValueLoading.swift b/tvOS/AVFoundation/AVAsynchronousKeyValueLoading.swift index 22888c5..d104d0f 100644 --- a/tvOS/AVFoundation/AVAsynchronousKeyValueLoading.swift +++ b/tvOS/AVFoundation/AVAsynchronousKeyValueLoading.swift @@ -11,5 +11,5 @@ enum AVKeyValueStatus : Int { protocol AVAsynchronousKeyValueLoading { func statusOfValue(forKey key: String, error outError: NSErrorPointer) -> AVKeyValueStatus func loadValuesAsynchronously(forKeys keys: [String], completionHandler handler: (() -> Void)? = nil) - func loadValues(forKeys keys: [String]) async + func loadValuesAsync(forKeys keys: [String]) async } diff --git a/tvOS/AVFoundation/AVCaptureDevice.swift b/tvOS/AVFoundation/AVCaptureDevice.swift index e28fbff..53f27e6 100644 --- a/tvOS/AVFoundation/AVCaptureDevice.swift +++ b/tvOS/AVFoundation/AVCaptureDevice.swift @@ -94,7 +94,7 @@ extension AVCaptureDevice { @available(tvOS 8.0, *) func setExposureTargetBias(_ bias: Float, completionHandler handler: ((CMTime) -> Void)? = nil) @available(tvOS 8.0, *) - func setExposureTargetBias(_ bias: Float) async -> CMTime + func setExposureTargetBiasAsync(_ bias: Float) async -> CMTime } extension AVCaptureDevice { } diff --git a/tvOS/AVFoundation/AVPlayer.swift b/tvOS/AVFoundation/AVPlayer.swift index a920ea2..19aa3d5 100644 --- a/tvOS/AVFoundation/AVPlayer.swift +++ b/tvOS/AVFoundation/AVPlayer.swift @@ -95,7 +95,7 @@ extension AVPlayer { @available(tvOS 9.0, *) func preroll(atRate rate: Float, completionHandler: ((Bool) -> Void)? = nil) @available(tvOS 9.0, *) - func preroll(atRate rate: Float) async -> Bool + func prerollAsync(atRate rate: Float) async -> Bool @available(tvOS 9.0, *) func cancelPendingPrerolls() @available(tvOS 9.0, *) diff --git a/tvOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift b/tvOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift index e3aaaa7..cb45b48 100644 --- a/tvOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift +++ b/tvOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift @@ -15,7 +15,7 @@ extension AVSampleBufferRenderSynchronizer { var renderers: [AVQueuedSampleBufferRendering] { get } func addRenderer(_ renderer: AVQueuedSampleBufferRendering) func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime, completionHandler: ((Bool) -> Void)? = nil) - func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool + func removeRendererAsync(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool } extension AVSampleBufferRenderSynchronizer { func addPeriodicTimeObserver(forInterval interval: CMTime, queue: DispatchQueue?, using block: @escaping (CMTime) -> Void) -> Any diff --git a/tvOS/AVKit/AVContentProposalViewController.swift b/tvOS/AVKit/AVContentProposalViewController.swift index 77aa7fe..91d8bfe 100644 --- a/tvOS/AVKit/AVContentProposalViewController.swift +++ b/tvOS/AVKit/AVContentProposalViewController.swift @@ -14,7 +14,7 @@ class AVContentProposalViewController : UIViewController { var playerLayoutGuide: UILayoutGuide { get } var dateOfAutomaticAcceptance: Date? func dismissContentProposal(for action: AVContentProposalAction, animated: Bool, completion block: (() -> Void)? = nil) - func dismissContentProposal(for action: AVContentProposalAction, animated: Bool) async + func dismissContentProposalAsync(for action: AVContentProposalAction, animated: Bool) async } extension AVPlayerViewController { @available(tvOS 10.0, *) diff --git a/tvOS/AVKit/AVPlayerViewController.swift b/tvOS/AVKit/AVPlayerViewController.swift index 9b1ac21..bd658b0 100644 --- a/tvOS/AVKit/AVPlayerViewController.swift +++ b/tvOS/AVKit/AVPlayerViewController.swift @@ -107,5 +107,5 @@ protocol AVPlayerViewControllerAnimationCoordinator : NSObjectProtocol { @available(tvOS 11.0, *) func addCoordinatedAnimations(_ animations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(tvOS 11.0, *) - func addCoordinatedAnimations(_ animations: (() -> Void)?) async -> Bool + func addCoordinatedAnimationsAsync(_ animations: (() -> Void)?) async -> Bool } diff --git a/tvOS/CoreHaptics/CHHapticEngine.swift b/tvOS/CoreHaptics/CHHapticEngine.swift index 73ced75..3512fc2 100644 --- a/tvOS/CoreHaptics/CHHapticEngine.swift +++ b/tvOS/CoreHaptics/CHHapticEngine.swift @@ -35,10 +35,10 @@ class CHHapticEngine : NSObject { var isAutoShutdownEnabled: Bool init() throws func start(completionHandler: CHHapticEngine.CompletionHandler? = nil) - func start() async throws + func startAsync() async throws func start() throws func stop(completionHandler: CHHapticEngine.CompletionHandler? = nil) - func stop() async throws + func stopAsync() async throws func notifyWhenPlayersFinished(finishedHandler: @escaping CHHapticEngine.FinishedHandler) func makePlayer(with pattern: CHHapticPattern) throws -> CHHapticPatternPlayer func makeAdvancedPlayer(with pattern: CHHapticPattern) throws -> CHHapticAdvancedPatternPlayer diff --git a/tvOS/CoreSpotlight/CSSearchableIndex.swift b/tvOS/CoreSpotlight/CSSearchableIndex.swift index 3e62db7..fb19712 100644 --- a/tvOS/CoreSpotlight/CSSearchableIndex.swift +++ b/tvOS/CoreSpotlight/CSSearchableIndex.swift @@ -2,7 +2,7 @@ extension CSSearchableIndex { func beginBatch() func endBatch(withClientState clientState: Data, completionHandler: ((Error?) -> Void)? = nil) - func endBatch(withClientState clientState: Data) async throws + func endBatchAsync(withClientState clientState: Data) async throws func fetchLastClientState(completionHandler: @escaping (Data?, Error?) -> Void) func fetchLastClientState() async throws -> Data } diff --git a/tvOS/ExternalAccessory/EAAccessoryManager.swift b/tvOS/ExternalAccessory/EAAccessoryManager.swift index d16a71d..9ed3245 100644 --- a/tvOS/ExternalAccessory/EAAccessoryManager.swift +++ b/tvOS/ExternalAccessory/EAAccessoryManager.swift @@ -27,7 +27,7 @@ class EAAccessoryManager : NSObject { @available(tvOS 6, *) func showBluetoothAccessoryPicker(withNameFilter predicate: NSPredicate?, completion: EABluetoothAccessoryPickerCompletion? = nil) @available(tvOS 6, *) - func showBluetoothAccessoryPicker(withNameFilter predicate: NSPredicate?) async throws + func showBluetoothAccessoryPickerAsync(withNameFilter predicate: NSPredicate?) async throws @available(tvOS 10.0, *) func registerForLocalNotifications() @available(tvOS 10.0, *) diff --git a/tvOS/Foundation/NSExtensionContext.swift b/tvOS/Foundation/NSExtensionContext.swift index cc7589c..90d74a5 100644 --- a/tvOS/Foundation/NSExtensionContext.swift +++ b/tvOS/Foundation/NSExtensionContext.swift @@ -6,7 +6,7 @@ class NSExtensionContext : NSObject { func completeRequest(returningItems items: [Any]?) async -> Bool func cancelRequest(withError error: Error) func open(_ URL: URL, completionHandler: ((Bool) -> Void)? = nil) - func open(_ URL: URL) async -> Bool + func openURLAsync(_ URL: URL) async -> Bool } @available(tvOS 9.0, *) let NSExtensionItemsAndErrorsKey: String diff --git a/tvOS/Foundation/NSItemProvider.swift b/tvOS/Foundation/NSItemProvider.swift index 477cad7..b41b8ee 100644 --- a/tvOS/Foundation/NSItemProvider.swift +++ b/tvOS/Foundation/NSItemProvider.swift @@ -75,7 +75,7 @@ class NSItemProvider : NSObject, NSCopying { convenience init?(contentsOf fileURL: URL!) func registerItem(forTypeIdentifier typeIdentifier: String, loadHandler: @escaping NSItemProvider.LoadHandler) func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil, completionHandler: NSItemProvider.CompletionHandler? = nil) - func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding + func loadItemAsync(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding } @available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) @@ -95,7 +95,7 @@ extension NSItemProvider { @available(tvOS 9.0, *) func loadPreviewImage(options: [AnyHashable : Any]! = [:], completionHandler: NSItemProvider.CompletionHandler!) @available(tvOS 9.0, *) - func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding + func loadPreviewImageAsync(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding } @available(tvOS 9.0, *) let NSExtensionJavaScriptPreprocessingResultsKey: String diff --git a/tvOS/GameController/GCController.swift b/tvOS/GameController/GCController.swift index ff9fee4..878aa34 100644 --- a/tvOS/GameController/GCController.swift +++ b/tvOS/GameController/GCController.swift @@ -44,7 +44,7 @@ class GCController : NSObject, GCDevice { func capture() -> GCController class func controllers() -> [GCController] class func startWirelessControllerDiscovery(completionHandler: (() -> Void)? = nil) - class func startWirelessControllerDiscovery() async + class func startWirelessControllerDiscoveryAsync() async class func stopWirelessControllerDiscovery() @available(tvOS 13.0, *) class func withMicroGamepad() -> GCController diff --git a/tvOS/GameKit/GKAchievement.swift b/tvOS/GameKit/GKAchievement.swift index 439b860..2a6b9f0 100644 --- a/tvOS/GameKit/GKAchievement.swift +++ b/tvOS/GameKit/GKAchievement.swift @@ -2,16 +2,16 @@ @available(tvOS 4.1, *) class GKAchievement : NSObject, NSCoding, NSSecureCoding { class func loadAchievements(completionHandler: (([GKAchievement]?, Error?) -> Void)? = nil) - class func loadAchievements() async throws -> [GKAchievement] + class func loadAchievementsAsync() async throws -> [GKAchievement] class func resetAchievements(completionHandler: ((Error?) -> Void)? = nil) - class func resetAchievements() async throws + class func resetAchievementsAsync() async throws init(identifier: String) @available(tvOS 8.0, *) init(identifier: String, player: GKPlayer) @available(tvOS 6.0, *) class func report(_ achievements: [GKAchievement], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 6.0, *) - class func report(_ achievements: [GKAchievement]) async throws + class func reportAchievementsAsync(_ achievements: [GKAchievement]) async throws var identifier: String var percentComplete: Double var isCompleted: Bool { get } diff --git a/tvOS/GameKit/GKAchievementDescription.swift b/tvOS/GameKit/GKAchievementDescription.swift index 98703fe..955ca3c 100644 --- a/tvOS/GameKit/GKAchievementDescription.swift +++ b/tvOS/GameKit/GKAchievementDescription.swift @@ -2,7 +2,7 @@ @available(tvOS 4.1, *) class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { class func loadAchievementDescriptions(completionHandler: (([GKAchievementDescription]?, Error?) -> Void)? = nil) - class func loadAchievementDescriptions() async throws -> [GKAchievementDescription] + class func loadAchievementDescriptionsAsync() async throws -> [GKAchievementDescription] var identifier: String { get } @available(tvOS 6.0, *) var groupIdentifier: String? { get } @@ -16,7 +16,7 @@ class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { } extension GKAchievementDescription { func loadImage(completionHandler: ((UIImage?, Error?) -> Void)? = nil) - func loadImage() async throws -> UIImage + func loadImageAsync() async throws -> UIImage class func incompleteAchievementImage() -> UIImage class func placeholderCompletedAchievementImage() -> UIImage } diff --git a/tvOS/GameKit/GKChallenge.swift b/tvOS/GameKit/GKChallenge.swift index 2ab389c..57ac2f4 100644 --- a/tvOS/GameKit/GKChallenge.swift +++ b/tvOS/GameKit/GKChallenge.swift @@ -10,7 +10,7 @@ enum GKChallengeState : Int { @available(tvOS 6.0, *) class GKChallenge : NSObject, NSCoding, NSSecureCoding { class func loadReceivedChallenges(completionHandler: (([GKChallenge]?, Error?) -> Void)? = nil) - class func loadReceivedChallenges() async throws -> [GKChallenge] + class func loadReceivedChallengesAsync() async throws -> [GKChallenge] func decline() @available(tvOS 8.0, *) @NSCopying var issuingPlayer: GKPlayer? { get } @@ -35,21 +35,21 @@ extension GKScore { @available(tvOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to reportLeaderboardScores:withEligibleChallenges:withCompletionHandler instead") class func report(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(tvOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to reportLeaderboardScores:withEligibleChallenges:withCompletionHandler instead") - class func report(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge]) async throws + class func reportScoresAsync(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge]) async throws @available(tvOS 14.0, *) class func report(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 14.0, *) - class func report(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge]) async throws + class func reportLeaderboardScoresAsync(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge]) async throws } extension GKAchievement { @available(tvOS 8.0, *) func selectChallengeablePlayers(_ players: [GKPlayer], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(tvOS 8.0, *) - func selectChallengeablePlayers(_ players: [GKPlayer]) async throws -> [GKPlayer] + func selectChallengeablePlayersAsync(_ players: [GKPlayer]) async throws -> [GKPlayer] @available(tvOS 7.0, *) class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 7.0, *) - class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge]) async throws + class func reportAchievementsAsync(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge]) async throws } extension GKScore { } diff --git a/tvOS/GameKit/GKLeaderboard.swift b/tvOS/GameKit/GKLeaderboard.swift index f96e850..d5bcc5f 100644 --- a/tvOS/GameKit/GKLeaderboard.swift +++ b/tvOS/GameKit/GKLeaderboard.swift @@ -83,11 +83,11 @@ extension GKLeaderboard { @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") func loadScores(completionHandler: (([GKScore]?, Error?) -> Void)? = nil) @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") - func loadScores() async throws -> [GKScore] + func loadScoresAsync() async throws -> [GKScore] @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") class func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") - class func loadLeaderboards() async throws -> [GKLeaderboard] + class func loadLeaderboardsAsync() async throws -> [GKLeaderboard] } extension GKLeaderboard { } diff --git a/tvOS/GameKit/GKLeaderboardSet.swift b/tvOS/GameKit/GKLeaderboardSet.swift index 69f265f..747fdbe 100644 --- a/tvOS/GameKit/GKLeaderboardSet.swift +++ b/tvOS/GameKit/GKLeaderboardSet.swift @@ -7,7 +7,7 @@ class GKLeaderboardSet : NSObject, NSCoding, NSSecureCoding { @available(tvOS 7.0, *) class func loadLeaderboardSets(completionHandler: (([GKLeaderboardSet]?, Error?) -> Void)? = nil) @available(tvOS 7.0, *) - class func loadLeaderboardSets() async throws -> [GKLeaderboardSet] + class func loadLeaderboardSetsAsync() async throws -> [GKLeaderboardSet] @available(tvOS 14.0, *) func loadLeaderboards(handler: @escaping ([GKLeaderboard]?, Error?) -> Void) } @@ -15,7 +15,7 @@ extension GKLeaderboardSet { @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use loadLeaderboardsWithHandler: instead.") func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use loadLeaderboardsWithHandler: instead.") - func loadLeaderboards() async throws -> [GKLeaderboard] + func loadLeaderboardsAsync() async throws -> [GKLeaderboard] } extension GKLeaderboardSet { } diff --git a/tvOS/GameKit/GKLocalPlayer.swift b/tvOS/GameKit/GKLocalPlayer.swift index cabd8bc..19d1215 100644 --- a/tvOS/GameKit/GKLocalPlayer.swift +++ b/tvOS/GameKit/GKLocalPlayer.swift @@ -13,21 +13,21 @@ class GKLocalPlayer : GKPlayer { @available(tvOS 10.0, *) func loadRecentPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(tvOS 10.0, *) - func loadRecentPlayers() async throws -> [GKPlayer] + func loadRecentPlayersAsync() async throws -> [GKPlayer] func loadChallengableFriends(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - func loadChallengableFriends() async throws -> [GKPlayer] + func loadChallengableFriendsAsync() async throws -> [GKPlayer] @available(tvOS 7.0, *) func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 7.0, *) - func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String) async throws + func setDefaultLeaderboardIdentifierAsync(_ leaderboardIdentifier: String) async throws @available(tvOS 7.0, *) func loadDefaultLeaderboardIdentifier(completionHandler: ((String?, Error?) -> Void)? = nil) @available(tvOS 7.0, *) - func loadDefaultLeaderboardIdentifier() async throws -> String + func loadDefaultLeaderboardIdentifierAsync() async throws -> String @available(tvOS 13.5, *) func fetchItems(forIdentityVerificationSignature completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(tvOS 13.5, *) - func fetchItemsForIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) + func fetchItemsForIdentityVerificationSignatureAsync() async throws -> (URL, Data, Data, UInt64) } protocol GKLocalPlayerListener : GKChallengeListener, GKInviteEventListener, GKTurnBasedEventListener { } @@ -47,11 +47,11 @@ extension GKLocalPlayer { @available(tvOS, introduced: 8.0, deprecated: 10.0) func loadFriendPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(tvOS, introduced: 8.0, deprecated: 10.0) - func loadFriendPlayers() async throws -> [GKPlayer] + func loadFriendPlayersAsync() async throws -> [GKPlayer] @available(tvOS, introduced: 9.0, deprecated: 13.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") func generateIdentityVerificationSignature(completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(tvOS, introduced: 9.0, deprecated: 13.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") - func generateIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) + func generateIdentityVerificationSignatureAsync() async throws -> (URL, Data, Data, UInt64) } extension GKLocalPlayer { } diff --git a/tvOS/GameKit/GKMatch.swift b/tvOS/GameKit/GKMatch.swift index 9923a53..fb8ce79 100644 --- a/tvOS/GameKit/GKMatch.swift +++ b/tvOS/GameKit/GKMatch.swift @@ -32,7 +32,7 @@ class GKMatch : NSObject { @available(tvOS 6.0, *) func rematch(completionHandler: ((GKMatch?, Error?) -> Void)? = nil) @available(tvOS 6.0, *) - func rematch() async throws -> GKMatch + func rematchAsync() async throws -> GKMatch } protocol GKMatchDelegate : NSObjectProtocol { @available(tvOS 8.0, *) diff --git a/tvOS/GameKit/GKMatchmaker.swift b/tvOS/GameKit/GKMatchmaker.swift index 03dc961..c9c1e78 100644 --- a/tvOS/GameKit/GKMatchmaker.swift +++ b/tvOS/GameKit/GKMatchmaker.swift @@ -64,24 +64,24 @@ class GKMatchmaker : NSObject { @available(tvOS 6.0, *) func match(for invite: GKInvite, completionHandler: ((GKMatch?, Error?) -> Void)? = nil) @available(tvOS 6.0, *) - func match(for invite: GKInvite) async throws -> GKMatch + func matchAsync(for invite: GKInvite) async throws -> GKMatch func findMatch(for request: GKMatchRequest, withCompletionHandler completionHandler: ((GKMatch?, Error?) -> Void)? = nil) - func findMatch(for request: GKMatchRequest) async throws -> GKMatch + func findMatchAsync(for request: GKMatchRequest) async throws -> GKMatch @available(tvOS 8.0, *) func findPlayers(forHostedRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(tvOS 8.0, *) - func findPlayers(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer] + func findPlayersAsync(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer] func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest, completionHandler: ((Error?) -> Void)? = nil) - func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest) async throws + func addPlayersAsync(to match: GKMatch, matchRequest: GKMatchRequest) async throws func cancel() @available(tvOS 8.0, *) func cancelPendingInvite(to player: GKPlayer) @available(tvOS 6.0, *) func finishMatchmaking(for match: GKMatch) func queryPlayerGroupActivity(_ playerGroup: Int, withCompletionHandler completionHandler: ((Int, Error?) -> Void)? = nil) - func queryPlayerGroupActivity(_ playerGroup: Int) async throws -> Int + func queryPlayerGroupActivityAsync(_ playerGroup: Int) async throws -> Int func queryActivity(completionHandler: ((Int, Error?) -> Void)? = nil) - func queryActivity() async throws -> Int + func queryActivityAsync() async throws -> Int @available(tvOS 8.0, *) func startBrowsingForNearbyPlayers(handler reachableHandler: ((GKPlayer, Bool) -> Void)? = nil) @available(tvOS 6.0, *) diff --git a/tvOS/GameKit/GKNotificationBanner.swift b/tvOS/GameKit/GKNotificationBanner.swift index def9e97..0e7709e 100644 --- a/tvOS/GameKit/GKNotificationBanner.swift +++ b/tvOS/GameKit/GKNotificationBanner.swift @@ -4,9 +4,9 @@ class GKNotificationBanner : NSObject { @available(tvOS 5.0, *) class func show(withTitle title: String?, message: String?, completionHandler: (() -> Void)? = nil) @available(tvOS 5.0, *) - class func show(withTitle title: String?, message: String?) async + class func showAsync(withTitle title: String?, message: String?) async @available(tvOS 6.0, *) class func show(withTitle title: String?, message: String?, duration: TimeInterval, completionHandler: (() -> Void)? = nil) @available(tvOS 6.0, *) - class func show(withTitle title: String?, message: String?, duration: TimeInterval) async + class func showAsync(withTitle title: String?, message: String?, duration: TimeInterval) async } diff --git a/tvOS/GameKit/GKPlayer.swift b/tvOS/GameKit/GKPlayer.swift index 00580e5..fc5b0fc 100644 --- a/tvOS/GameKit/GKPlayer.swift +++ b/tvOS/GameKit/GKPlayer.swift @@ -4,7 +4,7 @@ let GKPlayerIDNoLongerAvailable: String @available(tvOS 4.1, *) class GKPlayer : GKBasePlayer { class func loadPlayers(forIdentifiers identifiers: [String], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] + class func loadPlayersAsync(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] @available(tvOS 13.0, *) func scopedIDsArePersistent() -> Bool @available(tvOS 12.4, *) @@ -23,7 +23,7 @@ extension GKPlayer { @available(tvOS 5.0, *) func loadPhoto(for size: GKPlayer.PhotoSize, withCompletionHandler completionHandler: ((UIImage?, Error?) -> Void)? = nil) @available(tvOS 5.0, *) - func loadPhoto(for size: GKPlayer.PhotoSize) async throws -> UIImage + func loadPhotoAsync(for size: GKPlayer.PhotoSize) async throws -> UIImage } extension GKPlayer { enum PhotoSize : Int { diff --git a/tvOS/GameKit/GKScore.swift b/tvOS/GameKit/GKScore.swift index aae4769..f6f3e6e 100644 --- a/tvOS/GameKit/GKScore.swift +++ b/tvOS/GameKit/GKScore.swift @@ -19,7 +19,7 @@ class GKScore : NSObject, NSCoding, NSSecureCoding { @available(tvOS 6.0, *) class func report(_ scores: [GKScore], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 6.0, *) - class func report(_ scores: [GKScore]) async throws + class func reportScoresAsync(_ scores: [GKScore]) async throws } extension GKScore { } diff --git a/tvOS/GameKit/GKTurnBasedMatch.swift b/tvOS/GameKit/GKTurnBasedMatch.swift index ea8ffd2..a00616f 100644 --- a/tvOS/GameKit/GKTurnBasedMatch.swift +++ b/tvOS/GameKit/GKTurnBasedMatch.swift @@ -94,43 +94,43 @@ class GKTurnBasedMatch : NSObject { class func find(for request: GKMatchRequest, withCompletionHandler completionHandler: @escaping (GKTurnBasedMatch?, Error?) -> Void) class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch class func loadMatches(completionHandler: (([GKTurnBasedMatch]?, Error?) -> Void)? = nil) - class func loadMatches() async throws -> [GKTurnBasedMatch] + class func loadMatchesAsync() async throws -> [GKTurnBasedMatch] @available(tvOS 5.0, *) class func load(withID matchID: String, withCompletionHandler completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(tvOS 5.0, *) - class func load(withID matchID: String) async throws -> GKTurnBasedMatch + class func loadAsync(withID matchID: String) async throws -> GKTurnBasedMatch @available(tvOS 6.0, *) func rematch(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(tvOS 6.0, *) - func rematch() async throws -> GKTurnBasedMatch + func rematchAsync() async throws -> GKTurnBasedMatch @available(tvOS 5.0, *) func acceptInvite(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(tvOS 5.0, *) - func acceptInvite() async throws -> GKTurnBasedMatch + func acceptInviteAsync() async throws -> GKTurnBasedMatch @available(tvOS 5.0, *) func declineInvite(completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 5.0, *) - func declineInvite() async throws + func declineInviteAsync() async throws func remove(completionHandler: ((Error?) -> Void)? = nil) - func remove() async throws + func removeAsync() async throws func loadMatchData(completionHandler: ((Data?, Error?) -> Void)? = nil) - func loadMatchData() async throws -> Data + func loadMatchDataAsync() async throws -> Data @available(tvOS 6.0, *) func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 6.0, *) - func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + func endTurnAsync(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws @available(tvOS 6.0, *) func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 6.0, *) - func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + func participantQuitInTurnAsync(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) - func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome) async throws + func participantQuitOutOfTurnAsync(with matchOutcome: GKTurnBasedMatch.Outcome) async throws func endMatchInTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) - func endMatchInTurn(withMatch matchData: Data) async throws + func endMatchInTurnAsync(withMatch matchData: Data) async throws @available(tvOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") - func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws + func endMatchInTurnAsync(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws @available(tvOS 14.0, *) func endMatchInTurn(withMatch matchData: Data, leaderboardScores scores: [GKLeaderboardScore], achievements: [Any], completionHandler: @escaping (Error?) -> Void) @available(tvOS 14.0, *) @@ -138,19 +138,19 @@ class GKTurnBasedMatch : NSObject { @available(tvOS 6.0, *) func saveCurrentTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 6.0, *) - func saveCurrentTurn(withMatch matchData: Data) async throws + func saveCurrentTurnAsync(withMatch matchData: Data) async throws @available(tvOS 7.0, *) func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange], completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 7.0, *) - func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws + func saveMergedMatchDataAsync(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws @available(tvOS 7.0, *) func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval, completionHandler: ((GKTurnBasedExchange?, Error?) -> Void)? = nil) @available(tvOS 7.0, *) - func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange + func sendExchangeAsync(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange @available(tvOS 7.0, *) func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 7.0, *) - func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws + func sendReminderAsync(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws } @available(tvOS 7.0, *) enum GKTurnBasedExchangeStatus : Int8 { @@ -181,11 +181,11 @@ class GKTurnBasedExchange : NSObject { @available(tvOS 7.0, *) func cancel(withLocalizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 7.0, *) - func cancel(withLocalizableMessageKey key: String, arguments: [String]) async throws + func cancelAsync(withLocalizableMessageKey key: String, arguments: [String]) async throws @available(tvOS 7.0, *) func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 7.0, *) - func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws + func replyAsync(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws } @available(tvOS 7.0, *) class GKTurnBasedExchangeReply : NSObject { diff --git a/tvOS/MediaPlayer/MPNowPlayingSession.swift b/tvOS/MediaPlayer/MPNowPlayingSession.swift index c260131..a70943a 100644 --- a/tvOS/MediaPlayer/MPNowPlayingSession.swift +++ b/tvOS/MediaPlayer/MPNowPlayingSession.swift @@ -9,7 +9,7 @@ class MPNowPlayingSession : NSObject { var canBecomeActive: Bool { get } var isActive: Bool { get } func becomeActiveIfPossible(completion: ((Bool) -> Void)? = nil) - func becomeActiveIfPossible() async -> Bool + func becomeActiveIfPossibleAsync() async -> Bool func addPlayer(_ player: AVPlayer) func removePlayer(_ player: AVPlayer) } diff --git a/tvOS/Photos/PHPhotoLibrary.swift b/tvOS/Photos/PHPhotoLibrary.swift index a179186..f7e28aa 100644 --- a/tvOS/Photos/PHPhotoLibrary.swift +++ b/tvOS/Photos/PHPhotoLibrary.swift @@ -54,7 +54,7 @@ class PHPhotoLibrary : NSObject { @available(tvOS 10, *) func performChanges(_ changeBlock: @escaping () -> Void, completionHandler: ((Bool, Error?) -> Void)? = nil) @available(tvOS 10, *) - func performChanges(_ changeBlock: @escaping () -> Void) async throws -> Bool + func performChangesAsync(_ changeBlock: @escaping () -> Void) async throws -> Bool @available(tvOS 10, *) func performChangesAndWait(_ changeBlock: @escaping () -> Void) throws @available(tvOS 10, *) diff --git a/tvOS/ReplayKit/RPScreenRecorder.swift b/tvOS/ReplayKit/RPScreenRecorder.swift index 4e5f0b7..ea3d0fd 100644 --- a/tvOS/ReplayKit/RPScreenRecorder.swift +++ b/tvOS/ReplayKit/RPScreenRecorder.swift @@ -14,7 +14,7 @@ class RPScreenRecorder : NSObject { @available(tvOS 11.0, *) func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 11.0, *) - func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?) async throws + func startCaptureAsync(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?) async throws @available(tvOS 11.0, *) func stopCapture(handler: ((Error?) -> Void)? = nil) weak var delegate: @sil_weak RPScreenRecorderDelegate? diff --git a/tvOS/StoreKit/SKProductStorePromotionController.swift b/tvOS/StoreKit/SKProductStorePromotionController.swift index 2ab5183..52bc2e3 100644 --- a/tvOS/StoreKit/SKProductStorePromotionController.swift +++ b/tvOS/StoreKit/SKProductStorePromotionController.swift @@ -14,7 +14,7 @@ class SKProductStorePromotionController : NSObject { @available(tvOS 11.0, *) func fetchStorePromotionVisibility(for product: SKProduct, completionHandler: ((SKProductStorePromotionVisibility, Error?) -> Void)? = nil) @available(tvOS 11.0, *) - func fetchStorePromotionVisibility(for product: SKProduct) async throws -> SKProductStorePromotionVisibility + func fetchStorePromotionVisibilityAsync(for product: SKProduct) async throws -> SKProductStorePromotionVisibility @available(tvOS 11.0, *) func update(storePromotionVisibility promotionVisibility: SKProductStorePromotionVisibility, for product: SKProduct, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 11.0, *) @@ -22,7 +22,7 @@ class SKProductStorePromotionController : NSObject { @available(tvOS 11.0, *) func fetchStorePromotionOrder(completionHandler: (([SKProduct], Error?) -> Void)? = nil) @available(tvOS 11.0, *) - func fetchStorePromotionOrder() async throws -> [SKProduct] + func fetchStorePromotionOrderAsync() async throws -> [SKProduct] @available(tvOS 11.0, *) func update(storePromotionOrder: [SKProduct], completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 11.0, *) diff --git a/tvOS/TVMLKit/TVApplicationController.swift b/tvOS/TVMLKit/TVApplicationController.swift index 2650eb1..139a6cc 100644 --- a/tvOS/TVMLKit/TVApplicationController.swift +++ b/tvOS/TVMLKit/TVApplicationController.swift @@ -27,6 +27,6 @@ class TVApplicationController : NSObject { weak var delegate: @sil_weak TVApplicationControllerDelegate? { get } var navigationController: UINavigationController { get } func evaluate(inJavaScriptContext evaluation: @escaping (JSContext) -> Void, completion: ((Bool) -> Void)? = nil) - func evaluate(inJavaScriptContext evaluation: @escaping (JSContext) -> Void) async -> Bool + func evaluateAsync(inJavaScriptContext evaluation: @escaping (JSContext) -> Void) async -> Bool func stop() } diff --git a/tvOS/UIKit/UIApplication.swift b/tvOS/UIKit/UIApplication.swift index 1c70501..53e14ff 100644 --- a/tvOS/UIKit/UIApplication.swift +++ b/tvOS/UIKit/UIApplication.swift @@ -45,7 +45,7 @@ class UIApplication : UIResponder { @available(tvOS 10.0, *) func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:], completionHandler completion: ((Bool) -> Void)? = nil) @available(tvOS 10.0, *) - func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:]) async -> Bool + func openURLAsync(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:]) async -> Bool func sendEvent(_ event: UIEvent) @available(tvOS, introduced: 2.0, deprecated: 13.0, message: "Should not be used for applications that support multiple scenes as it returns a key window across all connected scenes") var keyWindow: UIWindow? { get } @@ -113,7 +113,7 @@ extension UIApplication { @available(tvOS 10.2, *) func setAlternateIconName(_ alternateIconName: String?, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 10.2, *) - func setAlternateIconName(_ alternateIconName: String?) async throws + func setAlternateIconNameAsync(_ alternateIconName: String?) async throws @available(tvOS 10.2, *) var alternateIconName: String? { get } } diff --git a/tvOS/UIKit/UICollectionView.swift b/tvOS/UIKit/UICollectionView.swift index 09506f1..e7e4265 100644 --- a/tvOS/UIKit/UICollectionView.swift +++ b/tvOS/UIKit/UICollectionView.swift @@ -151,7 +151,7 @@ class UICollectionView : UIScrollView, UIDataSourceTranslating { func reloadItems(at indexPaths: [IndexPath]) func moveItem(at indexPath: IndexPath, to newIndexPath: IndexPath) func performBatchUpdates(_ updates: (() -> Void)?, completion: ((Bool) -> Void)? = nil) - func performBatchUpdates(_ updates: (() -> Void)?) async -> Bool + func performBatchUpdatesAsync(_ updates: (() -> Void)?) async -> Bool @available(tvOS 9.0, *) func beginInteractiveMovementForItem(at indexPath: IndexPath) -> Bool @available(tvOS 9.0, *) diff --git a/tvOS/UIKit/UIFocusAnimationCoordinator.swift b/tvOS/UIKit/UIFocusAnimationCoordinator.swift index fe0b370..3ed275a 100644 --- a/tvOS/UIKit/UIFocusAnimationCoordinator.swift +++ b/tvOS/UIKit/UIFocusAnimationCoordinator.swift @@ -6,13 +6,13 @@ protocol UIFocusAnimationContext : NSObjectProtocol { @available(tvOS 9.0, *) class UIFocusAnimationCoordinator : NSObject { func addCoordinatedAnimations(_ animations: (() -> Void)?, completion: (() -> Void)? = nil) - func addCoordinatedAnimations(_ animations: (() -> Void)?) async + func addCoordinatedAnimationsAsync(_ animations: (() -> Void)?) async @available(tvOS 11.0, *) func addCoordinatedFocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?, completion: (() -> Void)? = nil) @available(tvOS 11.0, *) - func addCoordinatedFocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?) async + func addCoordinatedFocusingAnimationsAsync(_ animations: ((UIFocusAnimationContext) -> Void)?) async @available(tvOS 11.0, *) func addCoordinatedUnfocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?, completion: (() -> Void)? = nil) @available(tvOS 11.0, *) - func addCoordinatedUnfocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?) async + func addCoordinatedUnfocusingAnimationsAsync(_ animations: ((UIFocusAnimationContext) -> Void)?) async } diff --git a/tvOS/UIKit/UIPageViewController.swift b/tvOS/UIKit/UIPageViewController.swift index 2e89ed5..e50a443 100644 --- a/tvOS/UIKit/UIPageViewController.swift +++ b/tvOS/UIKit/UIPageViewController.swift @@ -49,7 +49,7 @@ class UIPageViewController : UIViewController { var gestureRecognizers: [UIGestureRecognizer] { get } var viewControllers: [UIViewController]? { get } func setViewControllers(_ viewControllers: [UIViewController]?, direction: UIPageViewController.NavigationDirection, animated: Bool, completion: ((Bool) -> Void)? = nil) - func setViewControllers(_ viewControllers: [UIViewController]?, direction: UIPageViewController.NavigationDirection, animated: Bool) async -> Bool + func setViewControllersAsync(_ viewControllers: [UIViewController]?, direction: UIPageViewController.NavigationDirection, animated: Bool) async -> Bool } protocol UIPageViewControllerDelegate : NSObjectProtocol { @available(tvOS 6.0, *) diff --git a/tvOS/UIKit/UIScene.swift b/tvOS/UIKit/UIScene.swift index 111a703..b5b07a6 100644 --- a/tvOS/UIKit/UIScene.swift +++ b/tvOS/UIKit/UIScene.swift @@ -6,7 +6,7 @@ class UIScene : UIResponder { var delegate: UISceneDelegate? var activationState: UIScene.ActivationState { get } func open(_ url: URL, options: UIScene.OpenExternalURLOptions?, completionHandler completion: ((Bool) -> Void)? = nil) - func open(_ url: URL, options: UIScene.OpenExternalURLOptions?) async -> Bool + func openURLAsync(_ url: URL, options: UIScene.OpenExternalURLOptions?) async -> Bool var title: String! var activationConditions: UISceneActivationConditions } diff --git a/tvOS/UIKit/UITableView.swift b/tvOS/UIKit/UITableView.swift index bf2dcfb..17e8f52 100644 --- a/tvOS/UIKit/UITableView.swift +++ b/tvOS/UIKit/UITableView.swift @@ -155,7 +155,7 @@ class UITableView : UIScrollView, NSCoding, UIDataSourceTranslating { @available(tvOS 11.0, *) func performBatchUpdates(_ updates: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(tvOS 11.0, *) - func performBatchUpdates(_ updates: (() -> Void)?) async -> Bool + func performBatchUpdatesAsync(_ updates: (() -> Void)?) async -> Bool func beginUpdates() func endUpdates() func insertSections(_ sections: IndexSet, with animation: UITableView.RowAnimation) diff --git a/tvOS/UIKit/UIView.swift b/tvOS/UIKit/UIView.swift index 4a673b2..44b21fa 100644 --- a/tvOS/UIKit/UIView.swift +++ b/tvOS/UIKit/UIView.swift @@ -245,7 +245,7 @@ extension UIView { @available(tvOS 4.0, *) class func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions = [], animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(tvOS 4.0, *) - class func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool + class func animateAsync(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool @available(tvOS 4.0, *) class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(tvOS 4.0, *) @@ -255,19 +255,19 @@ extension UIView { @available(tvOS 7.0, *) class func animate(withDuration duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping dampingRatio: CGFloat, initialSpringVelocity velocity: CGFloat, options: UIView.AnimationOptions = [], animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(tvOS 7.0, *) - class func animate(withDuration duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping dampingRatio: CGFloat, initialSpringVelocity velocity: CGFloat, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool + class func animateAsync(withDuration duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping dampingRatio: CGFloat, initialSpringVelocity velocity: CGFloat, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool @available(tvOS 4.0, *) class func transition(with view: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(tvOS 4.0, *) - class func transition(with view: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool + class func transitionAsync(with view: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool @available(tvOS 4.0, *) class func transition(from fromView: UIView, to toView: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], completion: ((Bool) -> Void)? = nil) @available(tvOS 4.0, *) - class func transition(from fromView: UIView, to toView: UIView, duration: TimeInterval, options: UIView.AnimationOptions = []) async -> Bool + class func transitionAsync(from fromView: UIView, to toView: UIView, duration: TimeInterval, options: UIView.AnimationOptions = []) async -> Bool @available(tvOS 7.0, *) class func perform(_ animation: UIView.SystemAnimation, on views: [UIView], options: UIView.AnimationOptions = [], animations parallelAnimations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(tvOS 7.0, *) - class func perform(_ animation: UIView.SystemAnimation, on views: [UIView], options: UIView.AnimationOptions = [], animations parallelAnimations: (() -> Void)?) async -> Bool + class func performSystemAnimationAsync(_ animation: UIView.SystemAnimation, on views: [UIView], options: UIView.AnimationOptions = [], animations parallelAnimations: (() -> Void)?) async -> Bool @available(tvOS 12.0, *) class func modifyAnimations(withRepeatCount count: CGFloat, autoreverses: Bool, animations: () -> Void) } @@ -275,7 +275,7 @@ extension UIView { @available(tvOS 7.0, *) class func animateKeyframes(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.KeyframeAnimationOptions = [], animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(tvOS 7.0, *) - class func animateKeyframes(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.KeyframeAnimationOptions = [], animations: @escaping () -> Void) async -> Bool + class func animateKeyframesAsync(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.KeyframeAnimationOptions = [], animations: @escaping () -> Void) async -> Bool @available(tvOS 7.0, *) class func addKeyframe(withRelativeStartTime frameStartTime: Double, relativeDuration frameDuration: Double, animations: @escaping () -> Void) } diff --git a/tvOS/UIKit/UIViewController.swift b/tvOS/UIKit/UIViewController.swift index 29886f8..458c21b 100644 --- a/tvOS/UIKit/UIViewController.swift +++ b/tvOS/UIKit/UIViewController.swift @@ -112,11 +112,11 @@ class UIViewController : UIResponder, NSCoding, UIAppearanceContainer, UITraitEn @available(tvOS 5.0, *) func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) @available(tvOS 5.0, *) - func present(_ viewControllerToPresent: UIViewController, animated flag: Bool) async + func presentAsync(_ viewControllerToPresent: UIViewController, animated flag: Bool) async @available(tvOS 5.0, *) func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) @available(tvOS 5.0, *) - func dismiss(animated flag: Bool) async + func dismissAsync(animated flag: Bool) async @available(tvOS 3.0, *) var modalTransitionStyle: UIModalTransitionStyle @available(tvOS 3.2, *) @@ -161,7 +161,7 @@ extension UIViewController { @available(tvOS 5.0, *) func transition(from fromViewController: UIViewController, to toViewController: UIViewController, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(tvOS 5.0, *) - func transition(from fromViewController: UIViewController, to toViewController: UIViewController, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool + func transitionAsync(from fromViewController: UIViewController, to toViewController: UIViewController, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool @available(tvOS 5.0, *) func beginAppearanceTransition(_ isAppearing: Bool, animated: Bool) @available(tvOS 5.0, *) diff --git a/tvOS/UserNotifications/UNUserNotificationCenter.swift b/tvOS/UserNotifications/UNUserNotificationCenter.swift index 7009d99..e80cb31 100644 --- a/tvOS/UserNotifications/UNUserNotificationCenter.swift +++ b/tvOS/UserNotifications/UNUserNotificationCenter.swift @@ -24,7 +24,7 @@ class UNUserNotificationCenter : NSObject { func getNotificationSettings(completionHandler: @escaping (UNNotificationSettings) -> Void) func notificationSettings() async -> UNNotificationSettings func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) - func add(_ request: UNNotificationRequest) async throws + func addNotificationRequestAsync(_ request: UNNotificationRequest) async throws func getPendingNotificationRequests(completionHandler: @escaping ([UNNotificationRequest]) -> Void) func pendingNotificationRequests() async -> [UNNotificationRequest] func removePendingNotificationRequests(withIdentifiers identifiers: [String]) diff --git a/watchOS/AVFoundation/AVAsynchronousKeyValueLoading.swift b/watchOS/AVFoundation/AVAsynchronousKeyValueLoading.swift index 22888c5..d104d0f 100644 --- a/watchOS/AVFoundation/AVAsynchronousKeyValueLoading.swift +++ b/watchOS/AVFoundation/AVAsynchronousKeyValueLoading.swift @@ -11,5 +11,5 @@ enum AVKeyValueStatus : Int { protocol AVAsynchronousKeyValueLoading { func statusOfValue(forKey key: String, error outError: NSErrorPointer) -> AVKeyValueStatus func loadValuesAsynchronously(forKeys keys: [String], completionHandler handler: (() -> Void)? = nil) - func loadValues(forKeys keys: [String]) async + func loadValuesAsync(forKeys keys: [String]) async } diff --git a/watchOS/AVFoundation/AVCaptureDevice.swift b/watchOS/AVFoundation/AVCaptureDevice.swift index 8287f9b..d273904 100644 --- a/watchOS/AVFoundation/AVCaptureDevice.swift +++ b/watchOS/AVFoundation/AVCaptureDevice.swift @@ -94,7 +94,7 @@ extension AVCaptureDevice { @available(watchOS 2.0, *) func setExposureTargetBias(_ bias: Float, completionHandler handler: ((CMTime) -> Void)? = nil) @available(watchOS 2.0, *) - func setExposureTargetBias(_ bias: Float) async -> CMTime + func setExposureTargetBiasAsync(_ bias: Float) async -> CMTime } extension AVCaptureDevice { } diff --git a/watchOS/AVFoundation/AVPlayer.swift b/watchOS/AVFoundation/AVPlayer.swift index 4ddb870..73c3307 100644 --- a/watchOS/AVFoundation/AVPlayer.swift +++ b/watchOS/AVFoundation/AVPlayer.swift @@ -85,7 +85,7 @@ extension AVPlayer { @available(watchOS 1.0, *) func preroll(atRate rate: Float, completionHandler: ((Bool) -> Void)? = nil) @available(watchOS 1.0, *) - func preroll(atRate rate: Float) async -> Bool + func prerollAsync(atRate rate: Float) async -> Bool @available(watchOS 1.0, *) func cancelPendingPrerolls() @available(watchOS 1.0, *) diff --git a/watchOS/AVFoundation/AVPlayerItem.swift b/watchOS/AVFoundation/AVPlayerItem.swift index 27f3325..53738fd 100644 --- a/watchOS/AVFoundation/AVPlayerItem.swift +++ b/watchOS/AVFoundation/AVPlayerItem.swift @@ -83,11 +83,11 @@ extension AVPlayerItem { @available(watchOS 1.0, *) func seek(to time: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(watchOS 1.0, *) - func seek(to time: CMTime) async -> Bool + func seekAsync(to time: CMTime) async -> Bool @available(watchOS 1.0, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(watchOS 1.0, *) - func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + func seekAsync(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool @available(watchOS 1.0, *) func cancelPendingSeeks() func currentDate() -> Date? diff --git a/watchOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift b/watchOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift index 3049774..318ae5b 100644 --- a/watchOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift +++ b/watchOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift @@ -15,7 +15,7 @@ extension AVSampleBufferRenderSynchronizer { var renderers: [AVQueuedSampleBufferRendering] { get } func addRenderer(_ renderer: AVQueuedSampleBufferRendering) func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime, completionHandler: ((Bool) -> Void)? = nil) - func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool + func removeRendererAsync(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool } extension AVSampleBufferRenderSynchronizer { func addPeriodicTimeObserver(forInterval interval: CMTime, queue: DispatchQueue?, using block: @escaping (CMTime) -> Void) -> Any diff --git a/watchOS/Foundation/NSExtensionContext.swift b/watchOS/Foundation/NSExtensionContext.swift index fee646a..b3d9da3 100644 --- a/watchOS/Foundation/NSExtensionContext.swift +++ b/watchOS/Foundation/NSExtensionContext.swift @@ -6,7 +6,7 @@ class NSExtensionContext : NSObject { func completeRequest(returningItems items: [Any]?) async -> Bool func cancelRequest(withError error: Error) func open(_ URL: URL, completionHandler: ((Bool) -> Void)? = nil) - func open(_ URL: URL) async -> Bool + func openURLAsync(_ URL: URL) async -> Bool } @available(watchOS 2.0, *) let NSExtensionItemsAndErrorsKey: String diff --git a/watchOS/Foundation/NSItemProvider.swift b/watchOS/Foundation/NSItemProvider.swift index 87a3f38..c81a4ec 100644 --- a/watchOS/Foundation/NSItemProvider.swift +++ b/watchOS/Foundation/NSItemProvider.swift @@ -75,7 +75,7 @@ class NSItemProvider : NSObject, NSCopying { convenience init?(contentsOf fileURL: URL!) func registerItem(forTypeIdentifier typeIdentifier: String, loadHandler: @escaping NSItemProvider.LoadHandler) func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil, completionHandler: NSItemProvider.CompletionHandler? = nil) - func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding + func loadItemAsync(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding } @available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) @@ -95,7 +95,7 @@ extension NSItemProvider { @available(watchOS 2.0, *) func loadPreviewImage(options: [AnyHashable : Any]! = [:], completionHandler: NSItemProvider.CompletionHandler!) @available(watchOS 2.0, *) - func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding + func loadPreviewImageAsync(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding } @available(watchOS 2.0, *) let NSExtensionJavaScriptPreprocessingResultsKey: String diff --git a/watchOS/GameKit/GKAchievement.swift b/watchOS/GameKit/GKAchievement.swift index 079ff96..97812d8 100644 --- a/watchOS/GameKit/GKAchievement.swift +++ b/watchOS/GameKit/GKAchievement.swift @@ -2,16 +2,16 @@ @available(watchOS 3.0, *) class GKAchievement : NSObject, NSCoding, NSSecureCoding { class func loadAchievements(completionHandler: (([GKAchievement]?, Error?) -> Void)? = nil) - class func loadAchievements() async throws -> [GKAchievement] + class func loadAchievementsAsync() async throws -> [GKAchievement] class func resetAchievements(completionHandler: ((Error?) -> Void)? = nil) - class func resetAchievements() async throws + class func resetAchievementsAsync() async throws init(identifier: String) @available(watchOS 2.0, *) init(identifier: String, player: GKPlayer) @available(watchOS 2.0, *) class func report(_ achievements: [GKAchievement], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 2.0, *) - class func report(_ achievements: [GKAchievement]) async throws + class func reportAchievementsAsync(_ achievements: [GKAchievement]) async throws var identifier: String var percentComplete: Double var isCompleted: Bool { get } @@ -25,7 +25,7 @@ extension GKAchievement { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use +reportAchievements:withCompletionHandler:") func report(completionHandler: ((Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use +reportAchievements:withCompletionHandler:") - func report() async throws + func reportAsync() async throws @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use isHidden on the GKAchievementDescription class instead") var isHidden: Bool { get } } diff --git a/watchOS/GameKit/GKAchievementDescription.swift b/watchOS/GameKit/GKAchievementDescription.swift index 0656a8e..d062b16 100644 --- a/watchOS/GameKit/GKAchievementDescription.swift +++ b/watchOS/GameKit/GKAchievementDescription.swift @@ -2,7 +2,7 @@ @available(watchOS 3.0, *) class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { class func loadAchievementDescriptions(completionHandler: (([GKAchievementDescription]?, Error?) -> Void)? = nil) - class func loadAchievementDescriptions() async throws -> [GKAchievementDescription] + class func loadAchievementDescriptionsAsync() async throws -> [GKAchievementDescription] var identifier: String { get } @available(watchOS 2.0, *) var groupIdentifier: String? { get } diff --git a/watchOS/GameKit/GKLeaderboard.swift b/watchOS/GameKit/GKLeaderboard.swift index d8a2095..1bdb505 100644 --- a/watchOS/GameKit/GKLeaderboard.swift +++ b/watchOS/GameKit/GKLeaderboard.swift @@ -69,11 +69,11 @@ extension GKLeaderboard { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use loadLeaderboardsWithIDs:completionHandler: instead") class func loadCategories(completionHandler: (([String]?, [String]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use loadLeaderboardsWithIDs:completionHandler: instead") - class func loadCategories() async throws -> ([String], [String]) + class func loadCategoriesAsync() async throws -> ([String], [String]) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use setDefaultLeaderboardIdentifier:completionHandler: on GKLocalPlayer instead") class func setDefault(_ leaderboardIdentifier: String?, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use setDefaultLeaderboardIdentifier:completionHandler: on GKLocalPlayer instead") - class func setDefault(_ leaderboardIdentifier: String?) async throws + class func setDefaultAsync(_ leaderboardIdentifier: String?) async throws @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler: instead.") var timeScope: GKLeaderboard.TimeScope @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler: instead.") @@ -95,9 +95,9 @@ extension GKLeaderboard { @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") func loadScores(completionHandler: (([GKScore]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") - func loadScores() async throws -> [GKScore] + func loadScoresAsync() async throws -> [GKScore] @available(watchOS, introduced: 2.0, deprecated: 7.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") class func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 7.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") - class func loadLeaderboards() async throws -> [GKLeaderboard] + class func loadLeaderboardsAsync() async throws -> [GKLeaderboard] } diff --git a/watchOS/GameKit/GKLeaderboardSet.swift b/watchOS/GameKit/GKLeaderboardSet.swift index 2212e3b..58671d2 100644 --- a/watchOS/GameKit/GKLeaderboardSet.swift +++ b/watchOS/GameKit/GKLeaderboardSet.swift @@ -7,7 +7,7 @@ class GKLeaderboardSet : NSObject, NSCoding, NSSecureCoding { @available(watchOS 2.0, *) class func loadLeaderboardSets(completionHandler: (([GKLeaderboardSet]?, Error?) -> Void)? = nil) @available(watchOS 2.0, *) - class func loadLeaderboardSets() async throws -> [GKLeaderboardSet] + class func loadLeaderboardSetsAsync() async throws -> [GKLeaderboardSet] @available(watchOS 7.0, *) func loadLeaderboards(handler: @escaping ([GKLeaderboard]?, Error?) -> Void) } @@ -15,5 +15,5 @@ extension GKLeaderboardSet { @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadLeaderboardsWithHandler: instead.") func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadLeaderboardsWithHandler: instead.") - func loadLeaderboards() async throws -> [GKLeaderboard] + func loadLeaderboardsAsync() async throws -> [GKLeaderboard] } diff --git a/watchOS/GameKit/GKLocalPlayer.swift b/watchOS/GameKit/GKLocalPlayer.swift index 115428e..04f1c53 100644 --- a/watchOS/GameKit/GKLocalPlayer.swift +++ b/watchOS/GameKit/GKLocalPlayer.swift @@ -9,21 +9,21 @@ class GKLocalPlayer : GKPlayer { @available(watchOS 3.0, *) func loadRecentPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func loadRecentPlayers() async throws -> [GKPlayer] + func loadRecentPlayersAsync() async throws -> [GKPlayer] func loadChallengableFriends(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - func loadChallengableFriends() async throws -> [GKPlayer] + func loadChallengableFriendsAsync() async throws -> [GKPlayer] @available(watchOS 3.0, *) func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String) async throws + func setDefaultLeaderboardIdentifierAsync(_ leaderboardIdentifier: String) async throws @available(watchOS 3.0, *) func loadDefaultLeaderboardIdentifier(completionHandler: ((String?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func loadDefaultLeaderboardIdentifier() async throws -> String + func loadDefaultLeaderboardIdentifierAsync() async throws -> String @available(watchOS 6.5, *) func fetchItems(forIdentityVerificationSignature completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(watchOS 6.5, *) - func fetchItemsForIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) + func fetchItemsForIdentityVerificationSignatureAsync() async throws -> (URL, Data, Data, UInt64) } protocol GKLocalPlayerListener : GKChallengeListener, GKInviteEventListener, GKTurnBasedEventListener { } @@ -43,29 +43,29 @@ extension GKLocalPlayer { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use setDefaultLeaderboardIdentifier:completionHandler: instead") func setDefaultLeaderboardCategoryID(_ categoryID: String?, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use setDefaultLeaderboardIdentifier:completionHandler: instead") - func setDefaultLeaderboardCategoryID(_ categoryID: String?) async throws + func setDefaultLeaderboardCategoryIDAsync(_ categoryID: String?) async throws @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use loadDefaultLeaderboardIdentifierWithCompletionHandler: instead") func loadDefaultLeaderboardCategoryID(completionHandler: ((String?, Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use loadDefaultLeaderboardIdentifierWithCompletionHandler: instead") - func loadDefaultLeaderboardCategoryID() async throws -> String + func loadDefaultLeaderboardCategoryIDAsync() async throws -> String @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Set the authenticateHandler instead") func authenticate(completionHandler: ((Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Set the authenticateHandler instead") - func authenticate() async throws + func authenticateAsync() async throws @available(watchOS, introduced: 2.0, deprecated: 3.0) func loadFriendPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 3.0) - func loadFriendPlayers() async throws -> [GKPlayer] + func loadFriendPlayersAsync() async throws -> [GKPlayer] @available(watchOS, introduced: 3.0, deprecated: 6.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") func generateIdentityVerificationSignature(completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(watchOS, introduced: 3.0, deprecated: 6.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") - func generateIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) + func generateIdentityVerificationSignatureAsync() async throws -> (URL, Data, Data, UInt64) } extension GKLocalPlayer { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") func loadFriends(completionHandler: (([String]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") - func loadFriends() async throws -> [String] + func loadFriendsAsync() async throws -> [String] @available(watchOS, introduced: 2.0, deprecated: 2.0, message: " This property is obsolete, Use loadFriendPlayersWithCompletionHandler: instead") var friends: [String]? { get } } diff --git a/watchOS/GameKit/GKMatchmaker.swift b/watchOS/GameKit/GKMatchmaker.swift index bcfb3ae..c41451e 100644 --- a/watchOS/GameKit/GKMatchmaker.swift +++ b/watchOS/GameKit/GKMatchmaker.swift @@ -62,5 +62,5 @@ extension GKMatchmaker { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") func findPlayers(forHostedMatchRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") - func findPlayers(forHostedMatchRequest request: GKMatchRequest) async throws -> [String] + func findPlayersAsync(forHostedMatchRequest request: GKMatchRequest) async throws -> [String] } diff --git a/watchOS/GameKit/GKPlayer.swift b/watchOS/GameKit/GKPlayer.swift index de94d16..e5cac0c 100644 --- a/watchOS/GameKit/GKPlayer.swift +++ b/watchOS/GameKit/GKPlayer.swift @@ -2,7 +2,7 @@ @available(watchOS 3.0, *) class GKPlayer : GKBasePlayer { class func loadPlayers(forIdentifiers identifiers: [String], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] + class func loadPlayersAsync(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] var alias: String { get } } extension NSNotification.Name { diff --git a/watchOS/GameKit/GKScore.swift b/watchOS/GameKit/GKScore.swift index 2bf6c6c..fbc191e 100644 --- a/watchOS/GameKit/GKScore.swift +++ b/watchOS/GameKit/GKScore.swift @@ -19,13 +19,13 @@ class GKScore : NSObject, NSCoding, NSSecureCoding { @available(watchOS 3.0, *) class func report(_ scores: [GKScore], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - class func report(_ scores: [GKScore]) async throws + class func reportScoresAsync(_ scores: [GKScore]) async throws } extension GKScore { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use +reportScores:withCompletionhandler: instead") func report(completionHandler: ((Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use +reportScores:withCompletionhandler: instead") - func report() async throws + func reportAsync() async throws @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use initWithLeaderboardIdentifier: instead") init(category: String?) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use leaderboardIdentifier instead") diff --git a/watchOS/GameKit/GKTurnBasedMatch.swift b/watchOS/GameKit/GKTurnBasedMatch.swift index c254837..a432f7f 100644 --- a/watchOS/GameKit/GKTurnBasedMatch.swift +++ b/watchOS/GameKit/GKTurnBasedMatch.swift @@ -96,43 +96,43 @@ class GKTurnBasedMatch : NSObject { class func find(for request: GKMatchRequest, withCompletionHandler completionHandler: @escaping (GKTurnBasedMatch?, Error?) -> Void) class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch class func loadMatches(completionHandler: (([GKTurnBasedMatch]?, Error?) -> Void)? = nil) - class func loadMatches() async throws -> [GKTurnBasedMatch] + class func loadMatchesAsync() async throws -> [GKTurnBasedMatch] @available(watchOS 3.0, *) class func load(withID matchID: String, withCompletionHandler completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) - class func load(withID matchID: String) async throws -> GKTurnBasedMatch + class func loadAsync(withID matchID: String) async throws -> GKTurnBasedMatch @available(watchOS 3.0, *) func rematch(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func rematch() async throws -> GKTurnBasedMatch + func rematchAsync() async throws -> GKTurnBasedMatch @available(watchOS 3.0, *) func acceptInvite(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func acceptInvite() async throws -> GKTurnBasedMatch + func acceptInviteAsync() async throws -> GKTurnBasedMatch @available(watchOS 3.0, *) func declineInvite(completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func declineInvite() async throws + func declineInviteAsync() async throws func remove(completionHandler: ((Error?) -> Void)? = nil) - func remove() async throws + func removeAsync() async throws func loadMatchData(completionHandler: ((Data?, Error?) -> Void)? = nil) - func loadMatchData() async throws -> Data + func loadMatchDataAsync() async throws -> Data @available(watchOS 3.0, *) func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + func endTurnAsync(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws @available(watchOS 3.0, *) func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + func participantQuitInTurnAsync(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) - func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome) async throws + func participantQuitOutOfTurnAsync(with matchOutcome: GKTurnBasedMatch.Outcome) async throws func endMatchInTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) - func endMatchInTurn(withMatch matchData: Data) async throws + func endMatchInTurnAsync(withMatch matchData: Data) async throws @available(watchOS, introduced: 2.0, deprecated: 7.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 7.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") - func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws + func endMatchInTurnAsync(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws @available(watchOS 7.0, *) func endMatchInTurn(withMatch matchData: Data, leaderboardScores scores: [GKLeaderboardScore], achievements: [Any], completionHandler: @escaping (Error?) -> Void) @available(watchOS 7.0, *) @@ -140,27 +140,27 @@ class GKTurnBasedMatch : NSObject { @available(watchOS 3.0, *) func saveCurrentTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func saveCurrentTurn(withMatch matchData: Data) async throws + func saveCurrentTurnAsync(withMatch matchData: Data) async throws @available(watchOS 3.0, *) func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange], completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws + func saveMergedMatchDataAsync(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws @available(watchOS 3.0, *) func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval, completionHandler: ((GKTurnBasedExchange?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange + func sendExchangeAsync(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange @available(watchOS 3.0, *) func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws + func sendReminderAsync(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use endTurnWithNextParticipants:... instead") func endTurn(withNextParticipant nextParticipant: GKTurnBasedParticipant, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use endTurnWithNextParticipants:... instead") - func endTurn(withNextParticipant nextParticipant: GKTurnBasedParticipant, match matchData: Data) async throws + func endTurnAsync(withNextParticipant nextParticipant: GKTurnBasedParticipant, match matchData: Data) async throws @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use participantQuitInTurnWithOutcome:nextParticipants:turnTimeout:... instead") func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipant: GKTurnBasedParticipant, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use participantQuitInTurnWithOutcome:nextParticipants:turnTimeout:... instead") - func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipant: GKTurnBasedParticipant, match matchData: Data) async throws + func participantQuitInTurnAsync(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipant: GKTurnBasedParticipant, match matchData: Data) async throws } @available(watchOS 3.0, *) enum GKTurnBasedExchangeStatus : Int8 { @@ -191,11 +191,11 @@ class GKTurnBasedExchange : NSObject { @available(watchOS 3.0, *) func cancel(withLocalizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func cancel(withLocalizableMessageKey key: String, arguments: [String]) async throws + func cancelAsync(withLocalizableMessageKey key: String, arguments: [String]) async throws @available(watchOS 3.0, *) func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws + func replyAsync(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws } @available(watchOS 3.0, *) class GKTurnBasedExchangeReply : NSObject { diff --git a/watchOS/Intents/INRelevantShortcutStore.swift b/watchOS/Intents/INRelevantShortcutStore.swift index fba5c9a..aeb81e4 100644 --- a/watchOS/Intents/INRelevantShortcutStore.swift +++ b/watchOS/Intents/INRelevantShortcutStore.swift @@ -3,5 +3,5 @@ class INRelevantShortcutStore : NSObject { class var `default`: INRelevantShortcutStore { get } func setRelevantShortcuts(_ shortcuts: [INRelevantShortcut], completionHandler: ((Error?) -> Void)? = nil) - func setRelevantShortcuts(_ shortcuts: [INRelevantShortcut]) async throws + func setRelevantShortcutsAsync(_ shortcuts: [INRelevantShortcut]) async throws } diff --git a/watchOS/NetworkExtension/NetworkExtension.swift b/watchOS/NetworkExtension/NetworkExtension.swift index f0a7aa9..edefa5f 100644 --- a/watchOS/NetworkExtension/NetworkExtension.swift +++ b/watchOS/NetworkExtension/NetworkExtension.swift @@ -93,7 +93,7 @@ class NEHotspotConfigurationManager : NSObject { @available(watchOS 7.0, *) func apply(_ configuration: NEHotspotConfiguration, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 7.0, *) - func apply(_ configuration: NEHotspotConfiguration) async throws + func applyConfigurationAsync(_ configuration: NEHotspotConfiguration) async throws @available(watchOS 7.0, *) func removeConfiguration(forSSID SSID: String) @available(watchOS 7.0, *) diff --git a/watchOS/PassKit/PKPassLibrary.swift b/watchOS/PassKit/PKPassLibrary.swift index f74c3f6..b98fda7 100644 --- a/watchOS/PassKit/PKPassLibrary.swift +++ b/watchOS/PassKit/PKPassLibrary.swift @@ -32,7 +32,7 @@ class PKPassLibrary : NSObject { @available(watchOS 3.0, *) func addPasses(_ passes: [PKPass], withCompletionHandler completion: ((PKPassLibraryAddPassesStatus) -> Void)? = nil) @available(watchOS 3.0, *) - func addPasses(_ passes: [PKPass]) async -> PKPassLibraryAddPassesStatus + func addPassesAsync(_ passes: [PKPass]) async -> PKPassLibraryAddPassesStatus @available(watchOS, introduced: 2.0, deprecated: 99993, message: "Use -[PKPassLibrary canAddSecureElementPassWithPrimaryAccountIdentifier] instead") func canAddPaymentPass(withPrimaryAccountIdentifier primaryAccountIdentifier: String) -> Bool @available(watchOS 6.4, *) @@ -42,7 +42,7 @@ class PKPassLibrary : NSObject { @available(watchOS, introduced: 2.0, deprecated: 99993, message: "Use activateSecureElementPass:withActivationData:completion: instead") func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data, completion: ((Bool, Error) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 99993, message: "Use activateSecureElementPass:withActivationData:completion: instead") - func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data) async -> (Bool, Error) + func activatePaymentPassAsync(_ paymentPass: PKPaymentPass, withActivationData activationData: Data) async -> (Bool, Error) @available(watchOS 6.2, *) func sign(_ signData: Data, using secureElementPass: PKSecureElementPass, completion: @escaping (Data?, Data?, Error?) -> Void) @available(watchOS 6.2, *) diff --git a/watchOS/PassKit/PKPaymentAuthorizationController.swift b/watchOS/PassKit/PKPaymentAuthorizationController.swift index 452fbfe..3f83b2d 100644 --- a/watchOS/PassKit/PKPaymentAuthorizationController.swift +++ b/watchOS/PassKit/PKPaymentAuthorizationController.swift @@ -47,7 +47,7 @@ class PKPaymentAuthorizationController : NSObject { weak var delegate: @sil_weak PKPaymentAuthorizationControllerDelegate? init(paymentRequest request: PKPaymentRequest) func present(completion: ((Bool) -> Void)? = nil) - func present() async -> Bool + func presentAsync() async -> Bool func dismiss(completion: (() -> Void)? = nil) - func dismiss() async + func dismissAsync() async } diff --git a/watchOS/UserNotifications/UNUserNotificationCenter.swift b/watchOS/UserNotifications/UNUserNotificationCenter.swift index 65f1088..02f8d56 100644 --- a/watchOS/UserNotifications/UNUserNotificationCenter.swift +++ b/watchOS/UserNotifications/UNUserNotificationCenter.swift @@ -29,7 +29,7 @@ class UNUserNotificationCenter : NSObject { func getNotificationSettings(completionHandler: @escaping (UNNotificationSettings) -> Void) func notificationSettings() async -> UNNotificationSettings func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) - func add(_ request: UNNotificationRequest) async throws + func addNotificationRequestAsync(_ request: UNNotificationRequest) async throws func getPendingNotificationRequests(completionHandler: @escaping ([UNNotificationRequest]) -> Void) func pendingNotificationRequests() async -> [UNNotificationRequest] func removePendingNotificationRequests(withIdentifiers identifiers: [String]) From a4457b16e421d5f1ace27842e03466c6627caa77 Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Tue, 8 Dec 2020 14:42:12 -0800 Subject: [PATCH 8/9] Update translation for recent heuristic tweaks --- .../AVAsynchronousKeyValueLoading.swift | 2 +- iOS/AVFoundation/AVCaptureDevice.swift | 2 +- iOS/AVFoundation/AVCapturePhotoOutput.swift | 2 +- iOS/AVFoundation/AVPlayer.swift | 8 ++-- iOS/AVFoundation/AVPlayerItem.swift | 4 +- .../AVSampleBufferRenderSynchronizer.swift | 2 +- iOS/AssetsLibrary/ALAsset.swift | 8 ++++ iOS/AssetsLibrary/ALAssetsLibrary.swift | 8 ++++ .../ASCredentialIdentityStore.swift | 4 +- ...ASCredentialProviderExtensionContext.swift | 2 +- .../CXCallDirectoryExtensionContext.swift | 2 +- iOS/CallKit/CXCallDirectoryManager.swift | 4 +- iOS/CarPlay/CPInterfaceController.swift | 14 +++---- iOS/ClassKit/CLSDataStore.swift | 2 +- iOS/CoreHaptics/CHHapticEngine.swift | 4 +- iOS/CoreLocation/CLLocationManager.swift | 2 +- iOS/CoreSpotlight/CSSearchableIndex.swift | 10 ++--- iOS/CryptoTokenKit/TKSmartCard.swift | 5 +++ .../EAAccessoryManager.swift | 2 +- iOS/Foundation/NSExtensionContext.swift | 2 +- iOS/Foundation/NSItemProvider.swift | 4 +- iOS/GameController/GCController.swift | 2 +- iOS/GameKit/GKAchievement.swift | 6 +-- iOS/GameKit/GKAchievementDescription.swift | 4 +- iOS/GameKit/GKChallenge.swift | 12 +++--- iOS/GameKit/GKLeaderboard.swift | 6 +-- iOS/GameKit/GKLeaderboardSet.swift | 6 +-- iOS/GameKit/GKLocalPlayer.swift | 16 ++++---- iOS/GameKit/GKMatch.swift | 2 +- iOS/GameKit/GKMatchmaker.swift | 14 +++---- iOS/GameKit/GKNotificationBanner.swift | 4 +- iOS/GameKit/GKPlayer.swift | 4 +- iOS/GameKit/GKSavedGame.swift | 10 ++--- iOS/GameKit/GKScore.swift | 2 +- iOS/GameKit/GKTurnBasedMatch.swift | 36 ++++++++--------- iOS/ImageCaptureCore/ICDevice.swift | 2 +- iOS/Intents/INRelevantShortcutStore.swift | 2 +- iOS/LocalAuthentication/LAContext.swift | 4 ++ iOS/MapKit/MKMapItem.swift | 4 +- iOS/MediaPlayer/MPMediaLibrary.swift | 2 +- iOS/MediaPlayer/MPMediaPlaylist.swift | 4 +- iOS/MediaPlayer/MPMusicPlayerController.swift | 2 +- iOS/Messages/MSConversation.swift | 16 ++++---- .../MetalPerformanceShaders.swift | 2 +- iOS/NetworkExtension/NetworkExtension.swift | 10 ++--- iOS/PassKit/PKPassLibrary.swift | 6 +-- .../PKPaymentAuthorizationController.swift | 4 +- iOS/Photos/PHPhotoLibrary.swift | 2 +- iOS/ReplayKit/RPScreenRecorder.swift | 2 +- .../SFContentBlockerManager.swift | 2 +- iOS/SoundAnalysis/SNAnalyzer.swift | 2 +- iOS/SpriteKit/SKNode.swift | 2 +- .../SKCloudServiceSetupViewController.swift | 2 +- .../SKProductStorePromotionController.swift | 4 +- .../SKStoreProductViewController.swift | 2 + iOS/UIKit/UIApplication.swift | 8 ++-- iOS/UIKit/UICollectionView.swift | 4 +- iOS/UIKit/UIDiffableDataSource.swift | 6 +-- iOS/UIKit/UIDocument.swift | 10 ++--- .../UIDocumentBrowserViewController.swift | 2 +- iOS/UIKit/UIFocusAnimationCoordinator.swift | 6 +-- iOS/UIKit/UIPageViewController.swift | 2 +- iOS/UIKit/UIPrinter.swift | 2 +- iOS/UIKit/UIScene.swift | 2 +- iOS/UIKit/UITableView.swift | 2 +- iOS/UIKit/UIView.swift | 14 +++---- iOS/UIKit/UIViewController.swift | 6 +-- .../UNUserNotificationCenter.swift | 2 +- iOS/WebKit/WKContentRuleListStore.swift | 4 +- iOS/WebKit/WKHTTPCookieStore.swift | 4 +- iOS/WebKit/WKWebView.swift | 6 +-- .../AVAsynchronousKeyValueLoading.swift | 2 +- macOS/AVFoundation/AVPlayer.swift | 8 ++-- macOS/AVFoundation/AVPlayerItem.swift | 4 +- .../AVSampleBufferRenderSynchronizer.swift | 2 +- macOS/AVKit/AVPlayerView.swift | 2 +- macOS/AppKit/NSAlert.swift | 2 +- macOS/AppKit/NSAnimationContext.swift | 2 +- macOS/AppKit/NSCollectionView.swift | 2 +- macOS/AppKit/NSDocument.swift | 16 ++++---- macOS/AppKit/NSSpellChecker.swift | 2 +- .../NSTableViewDiffableDataSource.swift | 2 +- macOS/AppKit/NSViewController.swift | 2 +- macOS/AppKit/NSWindow.swift | 4 +- macOS/AppKit/NSWorkspace.swift | 10 ++--- .../ASCredentialIdentityStore.swift | 4 +- ...ASCredentialProviderExtensionContext.swift | 2 +- macOS/ClassKit/CLSDataStore.swift | 2 +- macOS/Collaboration/CBIdentityPicker.swift | 2 +- macOS/CoreHaptics/CHHapticEngine.swift | 4 +- macOS/CoreLocation/CLLocationManager.swift | 2 +- macOS/CoreSpotlight/CSSearchableIndex.swift | 10 ++--- macOS/CryptoTokenKit/TKSmartCard.swift | 6 +++ macOS/Foundation/NSExtensionContext.swift | 2 +- macOS/Foundation/NSItemProvider.swift | 4 +- macOS/Foundation/NSUserScriptTask.swift | 8 ++-- macOS/GameController/GCController.swift | 2 +- macOS/GameKit/GKAchievement.swift | 8 ++-- macOS/GameKit/GKAchievementDescription.swift | 4 +- macOS/GameKit/GKChallenge.swift | 12 +++--- macOS/GameKit/GKLeaderboard.swift | 8 ++-- macOS/GameKit/GKLeaderboardSet.swift | 6 +-- macOS/GameKit/GKLocalPlayer.swift | 20 +++++----- macOS/GameKit/GKMatch.swift | 2 +- macOS/GameKit/GKMatchmaker.swift | 14 +++---- macOS/GameKit/GKNotificationBanner.swift | 4 +- macOS/GameKit/GKPlayer.swift | 4 +- macOS/GameKit/GKSavedGame.swift | 10 ++--- macOS/GameKit/GKScore.swift | 4 +- macOS/GameKit/GKTurnBasedMatch.swift | 36 ++++++++--------- macOS/IOUSBHost/IOUSBHostObject.swift | 2 +- macOS/IOUSBHost/IOUSBHostPipe.swift | 6 +-- macOS/IOUSBHost/IOUSBHostStream.swift | 2 +- macOS/ImageCaptureCore/ICDevice.swift | 2 +- macOS/LocalAuthentication/LAContext.swift | 4 ++ .../MetalPerformanceShaders.swift | 2 +- macOS/NetworkExtension/NetworkExtension.swift | 8 ++-- macOS/PassKit/PKPassLibrary.swift | 6 +-- .../PKPaymentAuthorizationController.swift | 4 +- macOS/Photos/PHPhotoLibrary.swift | 2 +- macOS/ReplayKit/RPScreenRecorder.swift | 2 +- .../SFContentBlockerManager.swift | 2 +- .../SafariServices/SFSafariApplication.swift | 6 +-- macOS/SafariServices/SFSafariTab.swift | 2 +- macOS/SafariServices/SFSafariWindow.swift | 2 +- macOS/SoundAnalysis/SNAnalyzer.swift | 2 +- macOS/SpriteKit/SKNode.swift | 2 +- .../SKProductStorePromotionController.swift | 4 +- .../SKStoreProductViewController.swift | 2 + .../UNUserNotificationCenter.swift | 2 +- macOS/WebKit/WKContentRuleListStore.swift | 4 +- macOS/WebKit/WKHTTPCookieStore.swift | 4 +- macOS/WebKit/WKWebView.swift | 6 +-- tvOS/AVFoundation/AVAssetWriter.swift | 2 +- .../AVAsynchronousKeyValueLoading.swift | 2 +- tvOS/AVFoundation/AVCaptureDevice.swift | 2 +- tvOS/AVFoundation/AVPlayer.swift | 8 ++-- tvOS/AVFoundation/AVPlayerItem.swift | 4 +- .../AVSampleBufferRenderSynchronizer.swift | 2 +- .../AVContentProposalViewController.swift | 2 +- tvOS/AVKit/AVPlayerViewController.swift | 2 +- tvOS/CoreHaptics/CHHapticEngine.swift | 4 +- tvOS/CoreLocation/CLLocationManager.swift | 2 +- tvOS/CoreSpotlight/CSSearchableIndex.swift | 2 +- tvOS/CryptoTokenKit/TKSmartCard.swift | 5 +++ .../EAAccessoryManager.swift | 2 +- tvOS/Foundation/NSExtensionContext.swift | 2 +- tvOS/Foundation/NSItemProvider.swift | 4 +- tvOS/GameController/GCController.swift | 2 +- tvOS/GameKit/GKAchievement.swift | 6 +-- tvOS/GameKit/GKAchievementDescription.swift | 4 +- tvOS/GameKit/GKChallenge.swift | 10 ++--- tvOS/GameKit/GKLeaderboard.swift | 4 +- tvOS/GameKit/GKLeaderboardSet.swift | 4 +- tvOS/GameKit/GKLocalPlayer.swift | 14 +++---- tvOS/GameKit/GKMatch.swift | 2 +- tvOS/GameKit/GKMatchmaker.swift | 12 +++--- tvOS/GameKit/GKNotificationBanner.swift | 4 +- tvOS/GameKit/GKPlayer.swift | 4 +- tvOS/GameKit/GKScore.swift | 2 +- tvOS/GameKit/GKTurnBasedMatch.swift | 36 ++++++++--------- .../MediaPlayer/MPMusicPlayerController.swift | 2 +- tvOS/MediaPlayer/MPNowPlayingSession.swift | 2 +- .../MetalPerformanceShaders.swift | 2 +- tvOS/Photos/PHPhotoLibrary.swift | 2 +- tvOS/ReplayKit/RPScreenRecorder.swift | 2 +- tvOS/SoundAnalysis/SNAnalyzer.swift | 2 +- tvOS/SpriteKit/SKNode.swift | 2 +- .../SKProductStorePromotionController.swift | 4 +- tvOS/TVMLKit/TVApplicationController.swift | 2 +- tvOS/UIKit/UIApplication.swift | 8 ++-- tvOS/UIKit/UICollectionView.swift | 4 +- tvOS/UIKit/UIDiffableDataSource.swift | 6 +-- tvOS/UIKit/UIFocusAnimationCoordinator.swift | 6 +-- tvOS/UIKit/UIPageViewController.swift | 2 +- tvOS/UIKit/UIScene.swift | 2 +- tvOS/UIKit/UITableView.swift | 2 +- tvOS/UIKit/UIView.swift | 14 +++---- tvOS/UIKit/UIViewController.swift | 6 +-- .../UNUserNotificationCenter.swift | 2 +- .../AVAsynchronousKeyValueLoading.swift | 2 +- watchOS/AVFoundation/AVCaptureDevice.swift | 2 +- watchOS/AVFoundation/AVPlayer.swift | 8 ++-- watchOS/AVFoundation/AVPlayerItem.swift | 4 +- .../AVSampleBufferRenderSynchronizer.swift | 2 +- watchOS/CoreLocation/CLLocationManager.swift | 2 +- watchOS/Foundation/NSExtensionContext.swift | 2 +- watchOS/Foundation/NSItemProvider.swift | 4 +- watchOS/GameKit/GKAchievement.swift | 8 ++-- .../GameKit/GKAchievementDescription.swift | 2 +- watchOS/GameKit/GKLeaderboard.swift | 8 ++-- watchOS/GameKit/GKLeaderboardSet.swift | 4 +- watchOS/GameKit/GKLocalPlayer.swift | 22 +++++----- watchOS/GameKit/GKMatchmaker.swift | 2 +- watchOS/GameKit/GKPlayer.swift | 2 +- watchOS/GameKit/GKScore.swift | 4 +- watchOS/GameKit/GKTurnBasedMatch.swift | 40 +++++++++---------- watchOS/Intents/INRelevantShortcutStore.swift | 2 +- .../NetworkExtension/NetworkExtension.swift | 2 +- watchOS/PassKit/PKPassLibrary.swift | 4 +- .../PKPaymentAuthorizationController.swift | 4 +- watchOS/SoundAnalysis/SNAnalyzer.swift | 2 +- watchOS/SpriteKit/SKNode.swift | 2 +- .../UNUserNotificationCenter.swift | 2 +- watchOS/WatchKit/WKExtension.swift | 2 +- 205 files changed, 549 insertions(+), 501 deletions(-) diff --git a/iOS/AVFoundation/AVAsynchronousKeyValueLoading.swift b/iOS/AVFoundation/AVAsynchronousKeyValueLoading.swift index d104d0f..22888c5 100644 --- a/iOS/AVFoundation/AVAsynchronousKeyValueLoading.swift +++ b/iOS/AVFoundation/AVAsynchronousKeyValueLoading.swift @@ -11,5 +11,5 @@ enum AVKeyValueStatus : Int { protocol AVAsynchronousKeyValueLoading { func statusOfValue(forKey key: String, error outError: NSErrorPointer) -> AVKeyValueStatus func loadValuesAsynchronously(forKeys keys: [String], completionHandler handler: (() -> Void)? = nil) - func loadValuesAsync(forKeys keys: [String]) async + func loadValues(forKeys keys: [String]) async } diff --git a/iOS/AVFoundation/AVCaptureDevice.swift b/iOS/AVFoundation/AVCaptureDevice.swift index c0a6eaf..2788a89 100644 --- a/iOS/AVFoundation/AVCaptureDevice.swift +++ b/iOS/AVFoundation/AVCaptureDevice.swift @@ -302,7 +302,7 @@ extension AVCaptureDevice { @available(iOS 8.0, *) func setExposureTargetBias(_ bias: Float, completionHandler handler: ((CMTime) -> Void)? = nil) @available(iOS 8.0, *) - func setExposureTargetBiasAsync(_ bias: Float) async -> CMTime + func setExposureTargetBias(_ bias: Float) async -> CMTime } extension AVCaptureDevice { @available(iOS 13.0, *) diff --git a/iOS/AVFoundation/AVCapturePhotoOutput.swift b/iOS/AVFoundation/AVCapturePhotoOutput.swift index bdad278..939da5a 100644 --- a/iOS/AVFoundation/AVCapturePhotoOutput.swift +++ b/iOS/AVFoundation/AVCapturePhotoOutput.swift @@ -4,7 +4,7 @@ class AVCapturePhotoOutput : AVCaptureOutput { func capturePhoto(with settings: AVCapturePhotoSettings, delegate: AVCapturePhotoCaptureDelegate) var preparedPhotoSettingsArray: [AVCapturePhotoSettings] { get } func setPreparedPhotoSettingsArray(_ preparedPhotoSettingsArray: [AVCapturePhotoSettings], completionHandler: ((Bool, Error?) -> Void)? = nil) - func setPreparedPhotoSettingsArrayAsync(_ preparedPhotoSettingsArray: [AVCapturePhotoSettings]) async throws -> Bool + func setPreparedPhotoSettingsArray(_ preparedPhotoSettingsArray: [AVCapturePhotoSettings]) async throws -> Bool var __availablePhotoPixelFormatTypes: [NSNumber] { get } var availablePhotoCodecTypes: [AVVideoCodecType] { get } var __availableRawPhotoPixelFormatTypes: [NSNumber] { get } diff --git a/iOS/AVFoundation/AVPlayer.swift b/iOS/AVFoundation/AVPlayer.swift index 8f4577c..0d713f4 100644 --- a/iOS/AVFoundation/AVPlayer.swift +++ b/iOS/AVFoundation/AVPlayer.swift @@ -75,17 +75,17 @@ extension AVPlayer { @available(iOS 5.0, *) func seek(to date: Date, completionHandler: @escaping (Bool) -> Void) @available(iOS 5.0, *) - func seekAsync(to date: Date) async -> Bool + func seek(to date: Date) async -> Bool func seek(to time: CMTime) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) @available(iOS 5.0, *) func seek(to time: CMTime, completionHandler: @escaping (Bool) -> Void) @available(iOS 5.0, *) - func seekAsync(to time: CMTime) async -> Bool + func seek(to time: CMTime) async -> Bool @available(iOS 5.0, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: @escaping (Bool) -> Void) @available(iOS 5.0, *) - func seekAsync(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool } extension AVPlayer { @available(iOS 10.0, *) @@ -95,7 +95,7 @@ extension AVPlayer { @available(iOS 6.0, *) func preroll(atRate rate: Float, completionHandler: ((Bool) -> Void)? = nil) @available(iOS 6.0, *) - func prerollAsync(atRate rate: Float) async -> Bool + func preroll(atRate rate: Float) async -> Bool @available(iOS 6.0, *) func cancelPendingPrerolls() @available(iOS 6.0, *) diff --git a/iOS/AVFoundation/AVPlayerItem.swift b/iOS/AVFoundation/AVPlayerItem.swift index 92757a6..177cd90 100644 --- a/iOS/AVFoundation/AVPlayerItem.swift +++ b/iOS/AVFoundation/AVPlayerItem.swift @@ -85,11 +85,11 @@ extension AVPlayerItem { @available(iOS 5.0, *) func seek(to time: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(iOS 5.0, *) - func seekAsync(to time: CMTime) async -> Bool + func seek(to time: CMTime) async -> Bool @available(iOS 5.0, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(iOS 5.0, *) - func seekAsync(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool @available(iOS 5.0, *) func cancelPendingSeeks() func currentDate() -> Date? diff --git a/iOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift b/iOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift index 588de06..275ce02 100644 --- a/iOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift +++ b/iOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift @@ -15,7 +15,7 @@ extension AVSampleBufferRenderSynchronizer { var renderers: [AVQueuedSampleBufferRendering] { get } func addRenderer(_ renderer: AVQueuedSampleBufferRendering) func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime, completionHandler: ((Bool) -> Void)? = nil) - func removeRendererAsync(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool + func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool } extension AVSampleBufferRenderSynchronizer { func addPeriodicTimeObserver(forInterval interval: CMTime, queue: DispatchQueue?, using block: @escaping (CMTime) -> Void) -> Any diff --git a/iOS/AssetsLibrary/ALAsset.swift b/iOS/AssetsLibrary/ALAsset.swift index 62426e4..1172495 100644 --- a/iOS/AssetsLibrary/ALAsset.swift +++ b/iOS/AssetsLibrary/ALAsset.swift @@ -37,8 +37,12 @@ class ALAsset : NSObject { func aspectRatioThumbnail() -> Unmanaged! @available(iOS, introduced: 5, deprecated: 9, message: "Use creationRequestForAssetFromImage: on PHAssetChangeRequest from the Photos framework to create a new asset instead") func writeModifiedImageData(toSavedPhotosAlbum imageData: Data!, metadata: [AnyHashable : Any]!, completionBlock: ALAssetsLibraryWriteImageCompletionBlock!) + @available(iOS, introduced: 5, deprecated: 9, message: "Use creationRequestForAssetFromImage: on PHAssetChangeRequest from the Photos framework to create a new asset instead") + func writeModifiedImageData(toSavedPhotosAlbum imageData: Data!, metadata: [AnyHashable : Any]!) async throws -> URL? @available(iOS, introduced: 5, deprecated: 9, message: "Use creationRequestForAssetFromVideoAtFileURL: on PHAssetChangeRequest from the Photos framework to create a new asset instead") func writeModifiedVideoAtPath(toSavedPhotosAlbum videoPathURL: URL!, completionBlock: ALAssetsLibraryWriteVideoCompletionBlock!) + @available(iOS, introduced: 5, deprecated: 9, message: "Use creationRequestForAssetFromVideoAtFileURL: on PHAssetChangeRequest from the Photos framework to create a new asset instead") + func writeModifiedVideoAtPath(toSavedPhotosAlbum videoPathURL: URL!) async throws -> URL? @available(iOS, introduced: 5, deprecated: 9, message: "Use the PHImageRequestOptionsVersionOriginal or PHImageRequestOptionsVersionUnadjusted option in PHImageRequestOptions with the PHImageManager from the Photos framework instead") var original: ALAsset! { get } @available(iOS, introduced: 5, deprecated: 9, message: "Use canPerformEditOperation: on a PHAsset from the Photos framework instead") @@ -46,5 +50,9 @@ class ALAsset : NSObject { @available(iOS, introduced: 5, deprecated: 9, message: "Use contentEditingOutput on a PHAssetChangeRequest from the Photos framework instead") func setImageData(_ imageData: Data!, metadata: [AnyHashable : Any]!, completionBlock: ALAssetsLibraryWriteImageCompletionBlock!) @available(iOS, introduced: 5, deprecated: 9, message: "Use contentEditingOutput on a PHAssetChangeRequest from the Photos framework instead") + func setImageData(_ imageData: Data!, metadata: [AnyHashable : Any]!) async throws -> URL? + @available(iOS, introduced: 5, deprecated: 9, message: "Use contentEditingOutput on a PHAssetChangeRequest from the Photos framework instead") func setVideoAtPath(_ videoPathURL: URL!, completionBlock: ALAssetsLibraryWriteVideoCompletionBlock!) + @available(iOS, introduced: 5, deprecated: 9, message: "Use contentEditingOutput on a PHAssetChangeRequest from the Photos framework instead") + func setVideoAtPath(_ videoPathURL: URL!) async throws -> URL? } diff --git a/iOS/AssetsLibrary/ALAssetsLibrary.swift b/iOS/AssetsLibrary/ALAssetsLibrary.swift index c26da9b..59dd456 100644 --- a/iOS/AssetsLibrary/ALAssetsLibrary.swift +++ b/iOS/AssetsLibrary/ALAssetsLibrary.swift @@ -73,12 +73,20 @@ class ALAssetsLibrary : NSObject { func addAssetsGroupAlbum(withName name: String!, resultBlock: ALAssetsLibraryGroupResultBlock!, failureBlock: ALAssetsLibraryAccessFailureBlock!) @available(iOS, introduced: 4, deprecated: 9, message: "Use creationRequestForAssetFromImage: on PHAssetChangeRequest from the Photos framework to create a new asset instead") func writeImage(toSavedPhotosAlbum imageRef: CGImage!, orientation: ALAssetOrientation, completionBlock: ALAssetsLibraryWriteImageCompletionBlock!) + @available(iOS, introduced: 4, deprecated: 9, message: "Use creationRequestForAssetFromImage: on PHAssetChangeRequest from the Photos framework to create a new asset instead") + func writeImage(toSavedPhotosAlbum imageRef: CGImage!, orientation: ALAssetOrientation) async throws -> URL? @available(iOS, introduced: 4.1, deprecated: 9, message: "Use creationRequestForAssetFromImage: on PHAssetChangeRequest from the Photos framework to create a new asset instead") func writeImage(toSavedPhotosAlbum imageRef: CGImage!, metadata: [AnyHashable : Any]!, completionBlock: ALAssetsLibraryWriteImageCompletionBlock!) + @available(iOS, introduced: 4.1, deprecated: 9, message: "Use creationRequestForAssetFromImage: on PHAssetChangeRequest from the Photos framework to create a new asset instead") + func writeImage(toSavedPhotosAlbum imageRef: CGImage!, metadata: [AnyHashable : Any]!) async throws -> URL? @available(iOS, introduced: 4.1, deprecated: 9, message: "Use creationRequestForAssetFromImageData: on PHAssetChangeRequest from the Photos framework to create a new asset instead") func writeImageData(toSavedPhotosAlbum imageData: Data!, metadata: [AnyHashable : Any]!, completionBlock: ALAssetsLibraryWriteImageCompletionBlock!) + @available(iOS, introduced: 4.1, deprecated: 9, message: "Use creationRequestForAssetFromImageData: on PHAssetChangeRequest from the Photos framework to create a new asset instead") + func writeImageData(toSavedPhotosAlbum imageData: Data!, metadata: [AnyHashable : Any]!) async throws -> URL? @available(iOS, introduced: 4, deprecated: 9, message: "Use creationRequestForAssetFromVideoAtFilePath: on PHAssetChangeRequest from the Photos framework to create a new asset instead") func writeVideoAtPath(toSavedPhotosAlbum videoPathURL: URL!, completionBlock: ALAssetsLibraryWriteVideoCompletionBlock!) + @available(iOS, introduced: 4, deprecated: 9, message: "Use creationRequestForAssetFromVideoAtFilePath: on PHAssetChangeRequest from the Photos framework to create a new asset instead") + func writeVideoAtPath(toSavedPhotosAlbum videoPathURL: URL!) async throws -> URL? @available(iOS, introduced: 5, deprecated: 9, message: "Use isCompatibleWithSavedPhotosAlbum on AVAsset instead") func videoAtPathIs(compatibleWithSavedPhotosAlbum videoPathURL: URL!) -> Bool @available(iOS, introduced: 6, deprecated: 9, message: "Use authorizationStatus on the shared PHPhotoLibrary from the Photos framework instead") diff --git a/iOS/AuthenticationServices/ASCredentialIdentityStore.swift b/iOS/AuthenticationServices/ASCredentialIdentityStore.swift index 2fb3798..055ceca 100644 --- a/iOS/AuthenticationServices/ASCredentialIdentityStore.swift +++ b/iOS/AuthenticationServices/ASCredentialIdentityStore.swift @@ -16,9 +16,9 @@ class ASCredentialIdentityStore : NSObject { func getState(_ completion: @escaping (ASCredentialIdentityStoreState) -> Void) func getState() async -> ASCredentialIdentityStoreState func saveCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity], completion: ((Bool, Error?) -> Void)? = nil) - func saveCredentialIdentitiesAsync(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool + func saveCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool func removeCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity], completion: ((Bool, Error?) -> Void)? = nil) - func removeCredentialIdentitiesAsync(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool + func removeCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool func removeAllCredentialIdentities(_ completion: ((Bool, Error?) -> Void)? = nil) func removeAllCredentialIdentities() async throws -> Bool func replaceCredentialIdentities(with newCredentialIdentities: [ASPasswordCredentialIdentity], completion: ((Bool, Error?) -> Void)? = nil) diff --git a/iOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift b/iOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift index b1944a0..ac01301 100644 --- a/iOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift +++ b/iOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift @@ -2,6 +2,6 @@ @available(iOS 12.0, *) class ASCredentialProviderExtensionContext : NSExtensionContext { func completeRequest(withSelectedCredential credential: ASPasswordCredential, completionHandler: ((Bool) -> Void)? = nil) - func completeRequestAsync(withSelectedCredential credential: ASPasswordCredential) async -> Bool + func completeRequest(withSelectedCredential credential: ASPasswordCredential) async -> Bool func completeExtensionConfigurationRequest() } diff --git a/iOS/CallKit/CXCallDirectoryExtensionContext.swift b/iOS/CallKit/CXCallDirectoryExtensionContext.swift index 4573d91..188ef16 100644 --- a/iOS/CallKit/CXCallDirectoryExtensionContext.swift +++ b/iOS/CallKit/CXCallDirectoryExtensionContext.swift @@ -19,5 +19,5 @@ class CXCallDirectoryExtensionContext : NSExtensionContext { @available(iOS 11.0, *) func removeAllIdentificationEntries() func completeRequest(completionHandler completion: ((Bool) -> Void)? = nil) - func completeRequestAsync() async -> Bool + func completeRequest() async -> Bool } diff --git a/iOS/CallKit/CXCallDirectoryManager.swift b/iOS/CallKit/CXCallDirectoryManager.swift index 2ef1be0..4e26aca 100644 --- a/iOS/CallKit/CXCallDirectoryManager.swift +++ b/iOS/CallKit/CXCallDirectoryManager.swift @@ -13,11 +13,11 @@ extension CXCallDirectoryManager { class CXCallDirectoryManager : NSObject { class var sharedInstance: CXCallDirectoryManager { get } func reloadExtension(withIdentifier identifier: String, completionHandler completion: ((Error?) -> Void)? = nil) - func reloadExtensionAsync(withIdentifier identifier: String) async throws + func reloadExtension(withIdentifier identifier: String) async throws func getEnabledStatusForExtension(withIdentifier identifier: String, completionHandler completion: @escaping (CXCallDirectoryManager.EnabledStatus, Error?) -> Void) func enabledStatusForExtension(withIdentifier identifier: String) async throws -> CXCallDirectoryManager.EnabledStatus @available(iOS 13.4, *) func openSettings(completionHandler completion: ((Error?) -> Void)? = nil) @available(iOS 13.4, *) - func openSettingsAsync() async throws + func openSettings() async throws } diff --git a/iOS/CarPlay/CPInterfaceController.swift b/iOS/CarPlay/CPInterfaceController.swift index 6acbfba..9b9dcbf 100644 --- a/iOS/CarPlay/CPInterfaceController.swift +++ b/iOS/CarPlay/CPInterfaceController.swift @@ -8,31 +8,31 @@ class CPInterfaceController : NSObject { @available(iOS 14.0, *) func setRootTemplate(_ rootTemplate: CPTemplate, animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func setRootTemplateAsync(_ rootTemplate: CPTemplate, animated: Bool) async throws -> Bool + func setRootTemplate(_ rootTemplate: CPTemplate, animated: Bool) async throws -> Bool @available(iOS 14.0, *) func pushTemplate(_ templateToPush: CPTemplate, animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func pushTemplateAsync(_ templateToPush: CPTemplate, animated: Bool) async throws -> Bool + func pushTemplate(_ templateToPush: CPTemplate, animated: Bool) async throws -> Bool @available(iOS 14.0, *) func popTemplate(animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func popTemplateAsync(animated: Bool) async throws -> Bool + func popTemplate(animated: Bool) async throws -> Bool @available(iOS 14.0, *) func popToRootTemplate(animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func popToRootTemplateAsync(animated: Bool) async throws -> Bool + func popToRootTemplate(animated: Bool) async throws -> Bool @available(iOS 14.0, *) func pop(to targetTemplate: CPTemplate, animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func popAsync(to targetTemplate: CPTemplate, animated: Bool) async throws -> Bool + func pop(to targetTemplate: CPTemplate, animated: Bool) async throws -> Bool @available(iOS 14.0, *) func presentTemplate(_ templateToPresent: CPTemplate, animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func presentTemplateAsync(_ templateToPresent: CPTemplate, animated: Bool) async throws -> Bool + func presentTemplate(_ templateToPresent: CPTemplate, animated: Bool) async throws -> Bool @available(iOS 14.0, *) func dismissTemplate(animated: Bool, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func dismissTemplateAsync(animated: Bool) async throws -> Bool + func dismissTemplate(animated: Bool) async throws -> Bool var presentedTemplate: CPTemplate? { get } var rootTemplate: CPTemplate { get } var topTemplate: CPTemplate? { get } diff --git a/iOS/ClassKit/CLSDataStore.swift b/iOS/ClassKit/CLSDataStore.swift index ebdfd39..e626453 100644 --- a/iOS/ClassKit/CLSDataStore.swift +++ b/iOS/ClassKit/CLSDataStore.swift @@ -11,7 +11,7 @@ class CLSDataStore : NSObject { var runningActivity: CLSActivity? { get } weak var delegate: @sil_weak CLSDataStoreDelegate? func save(completion: ((Error?) -> Void)? = nil) - func saveAsync() async throws + func save() async throws @available(iOS 12.2, *) func completeAllAssignedActivities(matching contextPath: [String]) } diff --git a/iOS/CoreHaptics/CHHapticEngine.swift b/iOS/CoreHaptics/CHHapticEngine.swift index 30725f5..6d80bb7 100644 --- a/iOS/CoreHaptics/CHHapticEngine.swift +++ b/iOS/CoreHaptics/CHHapticEngine.swift @@ -35,10 +35,10 @@ class CHHapticEngine : NSObject { var isAutoShutdownEnabled: Bool init() throws func start(completionHandler: CHHapticEngine.CompletionHandler? = nil) - func startAsync() async throws + func start() async throws func start() throws func stop(completionHandler: CHHapticEngine.CompletionHandler? = nil) - func stopAsync() async throws + func stop() async throws func notifyWhenPlayersFinished(finishedHandler: @escaping CHHapticEngine.FinishedHandler) func makePlayer(with pattern: CHHapticPattern) throws -> CHHapticPatternPlayer func makeAdvancedPlayer(with pattern: CHHapticPattern) throws -> CHHapticAdvancedPatternPlayer diff --git a/iOS/CoreLocation/CLLocationManager.swift b/iOS/CoreLocation/CLLocationManager.swift index 80e396e..516d1a7 100644 --- a/iOS/CoreLocation/CLLocationManager.swift +++ b/iOS/CoreLocation/CLLocationManager.swift @@ -92,7 +92,7 @@ class CLLocationManager : NSObject { @available(iOS 14.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String, completion: ((Error?) -> Void)? = nil) @available(iOS 14.0, *) - func requestTemporaryFullAccuracyAuthorizationAsync(withPurposeKey purposeKey: String) async throws + func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) async throws @available(iOS 14.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) func startUpdatingLocation() diff --git a/iOS/CoreSpotlight/CSSearchableIndex.swift b/iOS/CoreSpotlight/CSSearchableIndex.swift index 83b7a08..981f9dd 100644 --- a/iOS/CoreSpotlight/CSSearchableIndex.swift +++ b/iOS/CoreSpotlight/CSSearchableIndex.swift @@ -22,18 +22,18 @@ class CSSearchableIndex : NSObject { init(name: String) init(name: String, protectionClass: FileProtectionType?) func indexSearchableItems(_ items: [CSSearchableItem], completionHandler: ((Error?) -> Void)? = nil) - func indexSearchableItemsAsync(_ items: [CSSearchableItem]) async throws + func indexSearchableItems(_ items: [CSSearchableItem]) async throws func deleteSearchableItems(withIdentifiers identifiers: [String], completionHandler: ((Error?) -> Void)? = nil) - func deleteSearchableItemsAsync(withIdentifiers identifiers: [String]) async throws + func deleteSearchableItems(withIdentifiers identifiers: [String]) async throws func deleteSearchableItems(withDomainIdentifiers domainIdentifiers: [String], completionHandler: ((Error?) -> Void)? = nil) - func deleteSearchableItemsAsync(withDomainIdentifiers domainIdentifiers: [String]) async throws + func deleteSearchableItems(withDomainIdentifiers domainIdentifiers: [String]) async throws func deleteAllSearchableItems(completionHandler: ((Error?) -> Void)? = nil) - func deleteAllSearchableItemsAsync() async throws + func deleteAllSearchableItems() async throws } extension CSSearchableIndex { func beginBatch() func endBatch(withClientState clientState: Data, completionHandler: ((Error?) -> Void)? = nil) - func endBatchAsync(withClientState clientState: Data) async throws + func endBatch(withClientState clientState: Data) async throws func fetchLastClientState(completionHandler: @escaping (Data?, Error?) -> Void) func fetchLastClientState() async throws -> Data } diff --git a/iOS/CryptoTokenKit/TKSmartCard.swift b/iOS/CryptoTokenKit/TKSmartCard.swift index 1195782..8ef9e1b 100644 --- a/iOS/CryptoTokenKit/TKSmartCard.swift +++ b/iOS/CryptoTokenKit/TKSmartCard.swift @@ -3,6 +3,7 @@ class TKSmartCardSlotManager : NSObject { class var `default`: TKSmartCardSlotManager? { get } var slotNames: [String] { get } func getSlot(withName name: String, reply: @escaping (TKSmartCardSlot?) -> Void) + func getSlot(withName name: String) async -> TKSmartCardSlot? func slotNamed(_ name: String) -> TKSmartCardSlot? } extension TKSmartCardSlot { @@ -80,6 +81,7 @@ class TKSmartCardUserInteraction : NSObject { var initialTimeout: TimeInterval var interactionTimeout: TimeInterval func run(reply: @escaping (Bool, Error?) -> Void) + func run() async throws -> Bool func cancel() -> Bool } class TKSmartCardUserInteractionForPINOperation : TKSmartCardUserInteraction { @@ -110,7 +112,9 @@ class TKSmartCard : NSObject { var isSensitive: Bool var context: Any? func beginSession(reply: @escaping (Bool, Error?) -> Void) + func beginSession() async throws -> Bool func transmit(_ request: Data, reply: @escaping (Data?, Error?) -> Void) + func transmit(_ request: Data) async throws -> Data func endSession() @available(iOS 9.0, *) func userInteractionForSecurePINVerification(_ PINFormat: TKSmartCardPINFormat, apdu APDU: Data, pinByteOffset PINByteOffset: Int) -> TKSmartCardUserInteractionForSecurePINVerification? @@ -131,6 +135,7 @@ extension TKSmartCard { var useExtendedLength: Bool var useCommandChaining: Bool func __sendIns(_ ins: UInt8, p1: UInt8, p2: UInt8, data requestData: Data?, le: NSNumber?, reply: @escaping (Data?, UInt16, Error?) -> Void) + func __sendIns(_ ins: UInt8, p1: UInt8, p2: UInt8, data requestData: Data?, le: NSNumber?) async throws -> (Data, UInt16) func __inSession(executeBlock block: @escaping (NSErrorPointer) -> Bool) throws func __sendIns(_ ins: UInt8, p1: UInt8, p2: UInt8, data requestData: Data?, le: NSNumber?, sw: UnsafeMutablePointer) throws -> Data } diff --git a/iOS/ExternalAccessory/EAAccessoryManager.swift b/iOS/ExternalAccessory/EAAccessoryManager.swift index f4e06ad..be889f2 100644 --- a/iOS/ExternalAccessory/EAAccessoryManager.swift +++ b/iOS/ExternalAccessory/EAAccessoryManager.swift @@ -27,7 +27,7 @@ class EAAccessoryManager : NSObject { @available(iOS 6, *) func showBluetoothAccessoryPicker(withNameFilter predicate: NSPredicate?, completion: EABluetoothAccessoryPickerCompletion? = nil) @available(iOS 6, *) - func showBluetoothAccessoryPickerAsync(withNameFilter predicate: NSPredicate?) async throws + func showBluetoothAccessoryPicker(withNameFilter predicate: NSPredicate?) async throws @available(iOS 3.0, *) func registerForLocalNotifications() @available(iOS 3.0, *) diff --git a/iOS/Foundation/NSExtensionContext.swift b/iOS/Foundation/NSExtensionContext.swift index 8affdc2..4624399 100644 --- a/iOS/Foundation/NSExtensionContext.swift +++ b/iOS/Foundation/NSExtensionContext.swift @@ -6,7 +6,7 @@ class NSExtensionContext : NSObject { func completeRequest(returningItems items: [Any]?) async -> Bool func cancelRequest(withError error: Error) func open(_ URL: URL, completionHandler: ((Bool) -> Void)? = nil) - func openURLAsync(_ URL: URL) async -> Bool + func open(_ URL: URL) async -> Bool } @available(iOS 8.0, *) let NSExtensionItemsAndErrorsKey: String diff --git a/iOS/Foundation/NSItemProvider.swift b/iOS/Foundation/NSItemProvider.swift index b994003..a4c2572 100644 --- a/iOS/Foundation/NSItemProvider.swift +++ b/iOS/Foundation/NSItemProvider.swift @@ -77,7 +77,7 @@ class NSItemProvider : NSObject, NSCopying { convenience init?(contentsOf fileURL: URL!) func registerItem(forTypeIdentifier typeIdentifier: String, loadHandler: @escaping NSItemProvider.LoadHandler) func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil, completionHandler: NSItemProvider.CompletionHandler? = nil) - func loadItemAsync(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding + func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding } @available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) @@ -97,7 +97,7 @@ extension NSItemProvider { @available(iOS 8.0, *) func loadPreviewImage(options: [AnyHashable : Any]! = [:], completionHandler: NSItemProvider.CompletionHandler!) @available(iOS 8.0, *) - func loadPreviewImageAsync(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding + func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding } @available(iOS 8.0, *) let NSExtensionJavaScriptPreprocessingResultsKey: String diff --git a/iOS/GameController/GCController.swift b/iOS/GameController/GCController.swift index 79b2b6e..330bc2a 100644 --- a/iOS/GameController/GCController.swift +++ b/iOS/GameController/GCController.swift @@ -44,7 +44,7 @@ class GCController : NSObject, GCDevice { func capture() -> GCController class func controllers() -> [GCController] class func startWirelessControllerDiscovery(completionHandler: (() -> Void)? = nil) - class func startWirelessControllerDiscoveryAsync() async + class func startWirelessControllerDiscovery() async class func stopWirelessControllerDiscovery() @available(iOS 13.0, *) class func withMicroGamepad() -> GCController diff --git a/iOS/GameKit/GKAchievement.swift b/iOS/GameKit/GKAchievement.swift index b8f8d80..2f43c52 100644 --- a/iOS/GameKit/GKAchievement.swift +++ b/iOS/GameKit/GKAchievement.swift @@ -2,16 +2,16 @@ @available(iOS 4.1, *) class GKAchievement : NSObject, NSCoding, NSSecureCoding { class func loadAchievements(completionHandler: (([GKAchievement]?, Error?) -> Void)? = nil) - class func loadAchievementsAsync() async throws -> [GKAchievement] + class func loadAchievements() async throws -> [GKAchievement] class func resetAchievements(completionHandler: ((Error?) -> Void)? = nil) - class func resetAchievementsAsync() async throws + class func resetAchievements() async throws init(identifier: String) @available(iOS 8.0, *) init(identifier: String, player: GKPlayer) @available(iOS 6.0, *) class func report(_ achievements: [GKAchievement], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(iOS 6.0, *) - class func reportAchievementsAsync(_ achievements: [GKAchievement]) async throws + class func report(_ achievements: [GKAchievement]) async throws var identifier: String var percentComplete: Double var isCompleted: Bool { get } diff --git a/iOS/GameKit/GKAchievementDescription.swift b/iOS/GameKit/GKAchievementDescription.swift index 1aace71..fe8c020 100644 --- a/iOS/GameKit/GKAchievementDescription.swift +++ b/iOS/GameKit/GKAchievementDescription.swift @@ -2,7 +2,7 @@ @available(iOS 4.1, *) class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { class func loadAchievementDescriptions(completionHandler: (([GKAchievementDescription]?, Error?) -> Void)? = nil) - class func loadAchievementDescriptionsAsync() async throws -> [GKAchievementDescription] + class func loadAchievementDescriptions() async throws -> [GKAchievementDescription] var identifier: String { get } @available(iOS 6.0, *) var groupIdentifier: String? { get } @@ -16,7 +16,7 @@ class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { } extension GKAchievementDescription { func loadImage(completionHandler: ((UIImage?, Error?) -> Void)? = nil) - func loadImageAsync() async throws -> UIImage + func loadImage() async throws -> UIImage class func incompleteAchievementImage() -> UIImage class func placeholderCompletedAchievementImage() -> UIImage } diff --git a/iOS/GameKit/GKChallenge.swift b/iOS/GameKit/GKChallenge.swift index 46a3d29..473dfb9 100644 --- a/iOS/GameKit/GKChallenge.swift +++ b/iOS/GameKit/GKChallenge.swift @@ -10,7 +10,7 @@ enum GKChallengeState : Int { @available(iOS 6.0, *) class GKChallenge : NSObject, NSCoding, NSSecureCoding { class func loadReceivedChallenges(completionHandler: (([GKChallenge]?, Error?) -> Void)? = nil) - class func loadReceivedChallengesAsync() async throws -> [GKChallenge] + class func loadReceivedChallenges() async throws -> [GKChallenge] func decline() @available(iOS 8.0, *) @NSCopying var issuingPlayer: GKPlayer? { get } @@ -39,21 +39,21 @@ extension GKScore { @available(iOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to reportLeaderboardScores:withEligibleChallenges:withCompletionHandler instead") class func report(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(iOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to reportLeaderboardScores:withEligibleChallenges:withCompletionHandler instead") - class func reportScoresAsync(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge]) async throws + class func report(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge]) async throws @available(iOS 14.0, *) class func report(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(iOS 14.0, *) - class func reportLeaderboardScoresAsync(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge]) async throws + class func report(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge]) async throws } extension GKAchievement { @available(iOS 8.0, *) func selectChallengeablePlayers(_ players: [GKPlayer], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(iOS 8.0, *) - func selectChallengeablePlayersAsync(_ players: [GKPlayer]) async throws -> [GKPlayer] + func selectChallengeablePlayers(_ players: [GKPlayer]) async throws -> [GKPlayer] @available(iOS 7.0, *) class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(iOS 7.0, *) - class func reportAchievementsAsync(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge]) async throws + class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge]) async throws } extension GKScore { } @@ -61,7 +61,7 @@ extension GKAchievement { @available(iOS, introduced: 6.0, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, pass GKPlayers to selectChallengeablePlayers:") func selectChallengeablePlayerIDs(_ playerIDs: [String]?, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) @available(iOS, introduced: 6.0, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, pass GKPlayers to selectChallengeablePlayers:") - func selectChallengeablePlayerIDsAsync(_ playerIDs: [String]?) async throws -> [String] + func selectChallengeablePlayerIDs(_ playerIDs: [String]?) async throws -> [String] } typealias GKChallengeComposeCompletionBlock = (UIViewController, Bool, [String]?) -> Void extension GKScore { diff --git a/iOS/GameKit/GKLeaderboard.swift b/iOS/GameKit/GKLeaderboard.swift index 1e3b6ab..2a5d7df 100644 --- a/iOS/GameKit/GKLeaderboard.swift +++ b/iOS/GameKit/GKLeaderboard.swift @@ -85,15 +85,15 @@ extension GKLeaderboard { @available(iOS, introduced: 4.0, deprecated: 14.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") func loadScores(completionHandler: (([GKScore]?, Error?) -> Void)? = nil) @available(iOS, introduced: 4.0, deprecated: 14.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") - func loadScoresAsync() async throws -> [GKScore] + func loadScores() async throws -> [GKScore] @available(iOS, introduced: 6.0, deprecated: 14.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") class func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(iOS, introduced: 6.0, deprecated: 14.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") - class func loadLeaderboardsAsync() async throws -> [GKLeaderboard] + class func loadLeaderboards() async throws -> [GKLeaderboard] } extension GKLeaderboard { @available(iOS 7.0, *) func loadImage(completionHandler: ((UIImage?, Error?) -> Void)? = nil) @available(iOS 7.0, *) - func loadImageAsync() async throws -> UIImage + func loadImage() async throws -> UIImage } diff --git a/iOS/GameKit/GKLeaderboardSet.swift b/iOS/GameKit/GKLeaderboardSet.swift index fa4755a..7611939 100644 --- a/iOS/GameKit/GKLeaderboardSet.swift +++ b/iOS/GameKit/GKLeaderboardSet.swift @@ -7,7 +7,7 @@ class GKLeaderboardSet : NSObject, NSCoding, NSSecureCoding { @available(iOS 7.0, *) class func loadLeaderboardSets(completionHandler: (([GKLeaderboardSet]?, Error?) -> Void)? = nil) @available(iOS 7.0, *) - class func loadLeaderboardSetsAsync() async throws -> [GKLeaderboardSet] + class func loadLeaderboardSets() async throws -> [GKLeaderboardSet] @available(iOS 14.0, *) func loadLeaderboards(handler: @escaping ([GKLeaderboard]?, Error?) -> Void) } @@ -15,9 +15,9 @@ extension GKLeaderboardSet { @available(iOS, introduced: 7.0, deprecated: 14.0, message: "Use loadLeaderboardsWithHandler: instead.") func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(iOS, introduced: 7.0, deprecated: 14.0, message: "Use loadLeaderboardsWithHandler: instead.") - func loadLeaderboardsAsync() async throws -> [GKLeaderboard] + func loadLeaderboards() async throws -> [GKLeaderboard] } extension GKLeaderboardSet { func loadImage(completionHandler: ((UIImage?, Error?) -> Void)? = nil) - func loadImageAsync() async throws -> UIImage + func loadImage() async throws -> UIImage } diff --git a/iOS/GameKit/GKLocalPlayer.swift b/iOS/GameKit/GKLocalPlayer.swift index 2aea3b1..2b48189 100644 --- a/iOS/GameKit/GKLocalPlayer.swift +++ b/iOS/GameKit/GKLocalPlayer.swift @@ -13,21 +13,21 @@ class GKLocalPlayer : GKPlayer { @available(iOS 10.0, *) func loadRecentPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(iOS 10.0, *) - func loadRecentPlayersAsync() async throws -> [GKPlayer] + func loadRecentPlayers() async throws -> [GKPlayer] func loadChallengableFriends(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - func loadChallengableFriendsAsync() async throws -> [GKPlayer] + func loadChallengableFriends() async throws -> [GKPlayer] @available(iOS 7.0, *) func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 7.0, *) - func setDefaultLeaderboardIdentifierAsync(_ leaderboardIdentifier: String) async throws + func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String) async throws @available(iOS 7.0, *) func loadDefaultLeaderboardIdentifier(completionHandler: ((String?, Error?) -> Void)? = nil) @available(iOS 7.0, *) - func loadDefaultLeaderboardIdentifierAsync() async throws -> String + func loadDefaultLeaderboardIdentifier() async throws -> String @available(iOS 13.5, *) func fetchItems(forIdentityVerificationSignature completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(iOS 13.5, *) - func fetchItemsForIdentityVerificationSignatureAsync() async throws -> (URL, Data, Data, UInt64) + func fetchItemsForIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) } protocol GKLocalPlayerListener : GKChallengeListener, GKInviteEventListener, GKSavedGameListener, GKTurnBasedEventListener { } @@ -47,17 +47,17 @@ extension GKLocalPlayer { @available(iOS, introduced: 8.0, deprecated: 10.0) func loadFriendPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(iOS, introduced: 8.0, deprecated: 10.0) - func loadFriendPlayersAsync() async throws -> [GKPlayer] + func loadFriendPlayers() async throws -> [GKPlayer] @available(iOS, introduced: 7.0, deprecated: 13.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") func generateIdentityVerificationSignature(completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(iOS, introduced: 7.0, deprecated: 13.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") - func generateIdentityVerificationSignatureAsync() async throws -> (URL, Data, Data, UInt64) + func generateIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) } extension GKLocalPlayer { @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") func loadFriends(completionHandler: (([String]?, Error?) -> Void)? = nil) @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") - func loadFriendsAsync() async throws -> [String] + func loadFriends() async throws -> [String] @available(iOS, introduced: 4.1, deprecated: 8.0, message: " This property is obsolete, Use loadFriendPlayersWithCompletionHandler: instead") var friends: [String]? { get } } diff --git a/iOS/GameKit/GKMatch.swift b/iOS/GameKit/GKMatch.swift index 1b049cb..5179948 100644 --- a/iOS/GameKit/GKMatch.swift +++ b/iOS/GameKit/GKMatch.swift @@ -32,7 +32,7 @@ class GKMatch : NSObject { @available(iOS 6.0, *) func rematch(completionHandler: ((GKMatch?, Error?) -> Void)? = nil) @available(iOS 6.0, *) - func rematchAsync() async throws -> GKMatch + func rematch() async throws -> GKMatch } protocol GKMatchDelegate : NSObjectProtocol { @available(iOS 8.0, *) diff --git a/iOS/GameKit/GKMatchmaker.swift b/iOS/GameKit/GKMatchmaker.swift index b52fbe5..afeb012 100644 --- a/iOS/GameKit/GKMatchmaker.swift +++ b/iOS/GameKit/GKMatchmaker.swift @@ -72,24 +72,24 @@ class GKMatchmaker : NSObject { @available(iOS 6.0, *) func match(for invite: GKInvite, completionHandler: ((GKMatch?, Error?) -> Void)? = nil) @available(iOS 6.0, *) - func matchAsync(for invite: GKInvite) async throws -> GKMatch + func match(for invite: GKInvite) async throws -> GKMatch func findMatch(for request: GKMatchRequest, withCompletionHandler completionHandler: ((GKMatch?, Error?) -> Void)? = nil) - func findMatchAsync(for request: GKMatchRequest) async throws -> GKMatch + func findMatch(for request: GKMatchRequest) async throws -> GKMatch @available(iOS 8.0, *) func findPlayers(forHostedRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(iOS 8.0, *) - func findPlayersAsync(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer] + func findPlayers(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer] func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest, completionHandler: ((Error?) -> Void)? = nil) - func addPlayersAsync(to match: GKMatch, matchRequest: GKMatchRequest) async throws + func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest) async throws func cancel() @available(iOS 8.0, *) func cancelPendingInvite(to player: GKPlayer) @available(iOS 6.0, *) func finishMatchmaking(for match: GKMatch) func queryPlayerGroupActivity(_ playerGroup: Int, withCompletionHandler completionHandler: ((Int, Error?) -> Void)? = nil) - func queryPlayerGroupActivityAsync(_ playerGroup: Int) async throws -> Int + func queryPlayerGroupActivity(_ playerGroup: Int) async throws -> Int func queryActivity(completionHandler: ((Int, Error?) -> Void)? = nil) - func queryActivityAsync() async throws -> Int + func queryActivity() async throws -> Int @available(iOS 8.0, *) func startBrowsingForNearbyPlayers(handler reachableHandler: ((GKPlayer, Bool) -> Void)? = nil) @available(iOS 6.0, *) @@ -105,5 +105,5 @@ extension GKMatchmaker { @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") func findPlayers(forHostedMatchRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") - func findPlayersAsync(forHostedMatchRequest request: GKMatchRequest) async throws -> [String] + func findPlayers(forHostedMatchRequest request: GKMatchRequest) async throws -> [String] } diff --git a/iOS/GameKit/GKNotificationBanner.swift b/iOS/GameKit/GKNotificationBanner.swift index de7a35e..031db5e 100644 --- a/iOS/GameKit/GKNotificationBanner.swift +++ b/iOS/GameKit/GKNotificationBanner.swift @@ -4,9 +4,9 @@ class GKNotificationBanner : NSObject { @available(iOS 5.0, *) class func show(withTitle title: String?, message: String?, completionHandler: (() -> Void)? = nil) @available(iOS 5.0, *) - class func showAsync(withTitle title: String?, message: String?) async + class func show(withTitle title: String?, message: String?) async @available(iOS 6.0, *) class func show(withTitle title: String?, message: String?, duration: TimeInterval, completionHandler: (() -> Void)? = nil) @available(iOS 6.0, *) - class func showAsync(withTitle title: String?, message: String?, duration: TimeInterval) async + class func show(withTitle title: String?, message: String?, duration: TimeInterval) async } diff --git a/iOS/GameKit/GKPlayer.swift b/iOS/GameKit/GKPlayer.swift index 8cd7b1b..1cead7f 100644 --- a/iOS/GameKit/GKPlayer.swift +++ b/iOS/GameKit/GKPlayer.swift @@ -4,7 +4,7 @@ let GKPlayerIDNoLongerAvailable: String @available(iOS 4.1, *) class GKPlayer : GKBasePlayer { class func loadPlayers(forIdentifiers identifiers: [String], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - class func loadPlayersAsync(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] + class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] @available(iOS 13.0, *) func scopedIDsArePersistent() -> Bool @available(iOS 12.4, *) @@ -23,7 +23,7 @@ extension GKPlayer { @available(iOS 5.0, *) func loadPhoto(for size: GKPlayer.PhotoSize, withCompletionHandler completionHandler: ((UIImage?, Error?) -> Void)? = nil) @available(iOS 5.0, *) - func loadPhotoAsync(for size: GKPlayer.PhotoSize) async throws -> UIImage + func loadPhoto(for size: GKPlayer.PhotoSize) async throws -> UIImage } extension GKPlayer { enum PhotoSize : Int { diff --git a/iOS/GameKit/GKSavedGame.swift b/iOS/GameKit/GKSavedGame.swift index c6660eb..9601795 100644 --- a/iOS/GameKit/GKSavedGame.swift +++ b/iOS/GameKit/GKSavedGame.swift @@ -10,23 +10,23 @@ class GKSavedGame : NSObject, NSCopying { @available(iOS 8.0, *) func loadData(completionHandler handler: ((Data?, Error?) -> Void)? = nil) @available(iOS 8.0, *) - func loadDataAsync() async throws -> Data + func loadData() async throws -> Data } extension GKLocalPlayer : GKSavedGameListener { @available(iOS 8.0, *) func fetchSavedGames(completionHandler handler: (([GKSavedGame]?, Error?) -> Void)? = nil) @available(iOS 8.0, *) - func fetchSavedGamesAsync() async throws -> [GKSavedGame] + func fetchSavedGames() async throws -> [GKSavedGame] @available(iOS 8.0, *) func saveGameData(_ data: Data, withName name: String, completionHandler handler: ((GKSavedGame?, Error?) -> Void)? = nil) @available(iOS 8.0, *) - func saveGameDataAsync(_ data: Data, withName name: String) async throws -> GKSavedGame + func saveGameData(_ data: Data, withName name: String) async throws -> GKSavedGame @available(iOS 8.0, *) func deleteSavedGames(withName name: String, completionHandler handler: ((Error?) -> Void)? = nil) @available(iOS 8.0, *) - func deleteSavedGamesAsync(withName name: String) async throws + func deleteSavedGames(withName name: String) async throws @available(iOS 8.0, *) func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data, completionHandler handler: (([GKSavedGame]?, Error?) -> Void)? = nil) @available(iOS 8.0, *) - func resolveConflictingSavedGamesAsync(_ conflictingSavedGames: [GKSavedGame], with data: Data) async throws -> [GKSavedGame] + func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data) async throws -> [GKSavedGame] } diff --git a/iOS/GameKit/GKScore.swift b/iOS/GameKit/GKScore.swift index 959d0f3..ce7464f 100644 --- a/iOS/GameKit/GKScore.swift +++ b/iOS/GameKit/GKScore.swift @@ -19,7 +19,7 @@ class GKScore : NSObject, NSCoding, NSSecureCoding { @available(iOS 6.0, *) class func report(_ scores: [GKScore], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(iOS 6.0, *) - class func reportScoresAsync(_ scores: [GKScore]) async throws + class func report(_ scores: [GKScore]) async throws } extension GKScore { } diff --git a/iOS/GameKit/GKTurnBasedMatch.swift b/iOS/GameKit/GKTurnBasedMatch.swift index 556683e..368e452 100644 --- a/iOS/GameKit/GKTurnBasedMatch.swift +++ b/iOS/GameKit/GKTurnBasedMatch.swift @@ -98,43 +98,43 @@ class GKTurnBasedMatch : NSObject { class func find(for request: GKMatchRequest, withCompletionHandler completionHandler: @escaping (GKTurnBasedMatch?, Error?) -> Void) class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch class func loadMatches(completionHandler: (([GKTurnBasedMatch]?, Error?) -> Void)? = nil) - class func loadMatchesAsync() async throws -> [GKTurnBasedMatch] + class func loadMatches() async throws -> [GKTurnBasedMatch] @available(iOS 5.0, *) class func load(withID matchID: String, withCompletionHandler completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(iOS 5.0, *) - class func loadAsync(withID matchID: String) async throws -> GKTurnBasedMatch + class func load(withID matchID: String) async throws -> GKTurnBasedMatch @available(iOS 6.0, *) func rematch(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(iOS 6.0, *) - func rematchAsync() async throws -> GKTurnBasedMatch + func rematch() async throws -> GKTurnBasedMatch @available(iOS 5.0, *) func acceptInvite(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(iOS 5.0, *) - func acceptInviteAsync() async throws -> GKTurnBasedMatch + func acceptInvite() async throws -> GKTurnBasedMatch @available(iOS 5.0, *) func declineInvite(completionHandler: ((Error?) -> Void)? = nil) @available(iOS 5.0, *) - func declineInviteAsync() async throws + func declineInvite() async throws func remove(completionHandler: ((Error?) -> Void)? = nil) - func removeAsync() async throws + func remove() async throws func loadMatchData(completionHandler: ((Data?, Error?) -> Void)? = nil) - func loadMatchDataAsync() async throws -> Data + func loadMatchData() async throws -> Data @available(iOS 6.0, *) func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 6.0, *) - func endTurnAsync(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws @available(iOS 6.0, *) func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 6.0, *) - func participantQuitInTurnAsync(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) - func participantQuitOutOfTurnAsync(with matchOutcome: GKTurnBasedMatch.Outcome) async throws + func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome) async throws func endMatchInTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) - func endMatchInTurnAsync(withMatch matchData: Data) async throws + func endMatchInTurn(withMatch matchData: Data) async throws @available(iOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?, completionHandler: ((Error?) -> Void)? = nil) @available(iOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") - func endMatchInTurnAsync(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws + func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws @available(iOS 14.0, *) func endMatchInTurn(withMatch matchData: Data, leaderboardScores scores: [GKLeaderboardScore], achievements: [Any], completionHandler: @escaping (Error?) -> Void) @available(iOS 14.0, *) @@ -142,19 +142,19 @@ class GKTurnBasedMatch : NSObject { @available(iOS 6.0, *) func saveCurrentTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 6.0, *) - func saveCurrentTurnAsync(withMatch matchData: Data) async throws + func saveCurrentTurn(withMatch matchData: Data) async throws @available(iOS 7.0, *) func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange], completionHandler: ((Error?) -> Void)? = nil) @available(iOS 7.0, *) - func saveMergedMatchDataAsync(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws + func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws @available(iOS 7.0, *) func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval, completionHandler: ((GKTurnBasedExchange?, Error?) -> Void)? = nil) @available(iOS 7.0, *) - func sendExchangeAsync(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange + func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange @available(iOS 7.0, *) func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(iOS 7.0, *) - func sendReminderAsync(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws + func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws } @available(iOS 7.0, *) enum GKTurnBasedExchangeStatus : Int8 { @@ -185,11 +185,11 @@ class GKTurnBasedExchange : NSObject { @available(iOS 7.0, *) func cancel(withLocalizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(iOS 7.0, *) - func cancelAsync(withLocalizableMessageKey key: String, arguments: [String]) async throws + func cancel(withLocalizableMessageKey key: String, arguments: [String]) async throws @available(iOS 7.0, *) func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 7.0, *) - func replyAsync(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws + func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws } @available(iOS 7.0, *) class GKTurnBasedExchangeReply : NSObject { diff --git a/iOS/ImageCaptureCore/ICDevice.swift b/iOS/ImageCaptureCore/ICDevice.swift index 8c47a69..7df3027 100644 --- a/iOS/ImageCaptureCore/ICDevice.swift +++ b/iOS/ImageCaptureCore/ICDevice.swift @@ -102,7 +102,7 @@ class ICDevice : NSObject { @available(iOS 13.0, *) func requestEject(completion: @escaping (Error?) -> Void) @available(iOS 13.0, *) - func requestEjectAsync() async throws + func requestEject() async throws } protocol ICDeviceDelegate : NSObjectProtocol { @available(iOS 13.0, *) diff --git a/iOS/Intents/INRelevantShortcutStore.swift b/iOS/Intents/INRelevantShortcutStore.swift index fd42c9c..d12cded 100644 --- a/iOS/Intents/INRelevantShortcutStore.swift +++ b/iOS/Intents/INRelevantShortcutStore.swift @@ -3,5 +3,5 @@ class INRelevantShortcutStore : NSObject { class var `default`: INRelevantShortcutStore { get } func setRelevantShortcuts(_ shortcuts: [INRelevantShortcut], completionHandler: ((Error?) -> Void)? = nil) - func setRelevantShortcutsAsync(_ shortcuts: [INRelevantShortcut]) async throws + func setRelevantShortcuts(_ shortcuts: [INRelevantShortcut]) async throws } diff --git a/iOS/LocalAuthentication/LAContext.swift b/iOS/LocalAuthentication/LAContext.swift index 2d653dc..4d4cd88 100644 --- a/iOS/LocalAuthentication/LAContext.swift +++ b/iOS/LocalAuthentication/LAContext.swift @@ -16,6 +16,8 @@ class LAContext : NSObject { func canEvaluatePolicy(_ policy: LAPolicy, error: NSErrorPointer) -> Bool @available(iOS 8.0, *) func evaluatePolicy(_ policy: LAPolicy, localizedReason: String, reply: @escaping (Bool, Error?) -> Void) + @available(iOS 8.0, *) + func evaluatePolicy(_ policy: LAPolicy, localizedReason: String) async throws -> Bool @available(iOS 9.0, *) func invalidate() @available(iOS 9.0, *) @@ -24,6 +26,8 @@ class LAContext : NSObject { func isCredentialSet(_ type: LACredentialType) -> Bool @available(iOS 9.0, *) func evaluateAccessControl(_ accessControl: SecAccessControl, operation: LAAccessControlOperation, localizedReason: String, reply: @escaping (Bool, Error?) -> Void) + @available(iOS 9.0, *) + func evaluateAccessControl(_ accessControl: SecAccessControl, operation: LAAccessControlOperation, localizedReason: String) async throws -> Bool @available(iOS 8.0, *) var localizedFallbackTitle: String? @available(iOS, introduced: 8.3, deprecated: 9.0) diff --git a/iOS/MapKit/MKMapItem.swift b/iOS/MapKit/MKMapItem.swift index af9806a..0355c19 100644 --- a/iOS/MapKit/MKMapItem.swift +++ b/iOS/MapKit/MKMapItem.swift @@ -17,11 +17,11 @@ class MKMapItem : NSObject { @available(iOS 13.2, *) func openInMaps(launchOptions: [String : Any]? = nil, from scene: UIScene?, completionHandler completion: ((Bool) -> Void)? = nil) @available(iOS 13.2, *) - func openInMapsAsync(launchOptions: [String : Any]? = nil, from scene: UIScene?) async -> Bool + func openInMaps(launchOptions: [String : Any]? = nil, from scene: UIScene?) async -> Bool @available(iOS 13.2, *) class func openMaps(with mapItems: [MKMapItem], launchOptions: [String : Any]? = nil, from scene: UIScene?, completionHandler completion: ((Bool) -> Void)? = nil) @available(iOS 13.2, *) - class func openMapsAsync(with mapItems: [MKMapItem], launchOptions: [String : Any]? = nil, from scene: UIScene?) async -> Bool + class func openMaps(with mapItems: [MKMapItem], launchOptions: [String : Any]? = nil, from scene: UIScene?) async -> Bool } @available(iOS 6.0, *) let MKLaunchOptionsDirectionsModeKey: String diff --git a/iOS/MediaPlayer/MPMediaLibrary.swift b/iOS/MediaPlayer/MPMediaLibrary.swift index 8c7a855..1dd7e3b 100644 --- a/iOS/MediaPlayer/MPMediaLibrary.swift +++ b/iOS/MediaPlayer/MPMediaLibrary.swift @@ -21,7 +21,7 @@ class MPMediaLibrary : NSObject, NSSecureCoding { @available(iOS 9.3, *) func addItem(withProductID productID: String, completionHandler: (([MPMediaEntity], Error?) -> Void)? = nil) @available(iOS 9.3, *) - func addItemAsync(withProductID productID: String) async throws -> [MPMediaEntity] + func addItem(withProductID productID: String) async throws -> [MPMediaEntity] @available(iOS 9.3, *) func getPlaylist(with uuid: UUID, creationMetadata: MPMediaPlaylistCreationMetadata?, completionHandler: @escaping (MPMediaPlaylist?, Error?) -> Void) @available(iOS 9.3, *) diff --git a/iOS/MediaPlayer/MPMediaPlaylist.swift b/iOS/MediaPlayer/MPMediaPlaylist.swift index 5ea9150..a157e8d 100644 --- a/iOS/MediaPlayer/MPMediaPlaylist.swift +++ b/iOS/MediaPlayer/MPMediaPlaylist.swift @@ -24,11 +24,11 @@ class MPMediaPlaylist : MPMediaItemCollection { @available(iOS 9.3, *) func addItem(withProductID productID: String, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 9.3, *) - func addItemAsync(withProductID productID: String) async throws + func addItem(withProductID productID: String) async throws @available(iOS 9.3, *) func add(_ mediaItems: [MPMediaItem], completionHandler: ((Error?) -> Void)? = nil) @available(iOS 9.3, *) - func addMediaItemsAsync(_ mediaItems: [MPMediaItem]) async throws + func add(_ mediaItems: [MPMediaItem]) async throws } let MPMediaPlaylistPropertyPersistentID: String @available(iOS 9.0, *) diff --git a/iOS/MediaPlayer/MPMusicPlayerController.swift b/iOS/MediaPlayer/MPMusicPlayerController.swift index bacd12b..e6e561c 100644 --- a/iOS/MediaPlayer/MPMusicPlayerController.swift +++ b/iOS/MediaPlayer/MPMusicPlayerController.swift @@ -57,7 +57,7 @@ class MPMusicPlayerController : NSObject, MPMediaPlayback { @available(iOS 10.1, *) func prepareToPlay(completionHandler: @escaping (Error?) -> Void) @available(iOS 10.1, *) - func prepareToPlayAsync() async throws + func prepareToPlay() async throws func skipToNextItem() func skipToBeginning() func skipToPreviousItem() diff --git a/iOS/Messages/MSConversation.swift b/iOS/Messages/MSConversation.swift index 4ee6a32..12d1f10 100644 --- a/iOS/Messages/MSConversation.swift +++ b/iOS/Messages/MSConversation.swift @@ -5,27 +5,27 @@ class MSConversation : NSObject { var remoteParticipantIdentifiers: [UUID] { get } var selectedMessage: MSMessage? { get } func insert(_ message: MSMessage, completionHandler: ((Error?) -> Void)? = nil) - func insertMessageAsync(_ message: MSMessage) async throws + func insert(_ message: MSMessage) async throws func insert(_ sticker: MSSticker, completionHandler: ((Error?) -> Void)? = nil) - func insertStickerAsync(_ sticker: MSSticker) async throws + func insert(_ sticker: MSSticker) async throws func insertText(_ text: String, completionHandler: ((Error?) -> Void)? = nil) - func insertTextAsync(_ text: String) async throws + func insertText(_ text: String) async throws func insertAttachment(_ URL: URL, withAlternateFilename filename: String?, completionHandler: ((Error?) -> Void)? = nil) - func insertAttachmentAsync(_ URL: URL, withAlternateFilename filename: String?) async throws + func insertAttachment(_ URL: URL, withAlternateFilename filename: String?) async throws @available(iOS 11.0, *) func send(_ message: MSMessage, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) - func sendMessageAsync(_ message: MSMessage) async throws + func send(_ message: MSMessage) async throws @available(iOS 11.0, *) func send(_ sticker: MSSticker, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) - func sendStickerAsync(_ sticker: MSSticker) async throws + func send(_ sticker: MSSticker) async throws @available(iOS 11.0, *) func sendText(_ text: String, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) - func sendTextAsync(_ text: String) async throws + func sendText(_ text: String) async throws @available(iOS 11.0, *) func sendAttachment(_ URL: URL, withAlternateFilename filename: String?, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) - func sendAttachmentAsync(_ URL: URL, withAlternateFilename filename: String?) async throws + func sendAttachment(_ URL: URL, withAlternateFilename filename: String?) async throws } diff --git a/iOS/MetalPerformanceShaders/MetalPerformanceShaders.swift b/iOS/MetalPerformanceShaders/MetalPerformanceShaders.swift index c8b523c..f3ff8bc 100644 --- a/iOS/MetalPerformanceShaders/MetalPerformanceShaders.swift +++ b/iOS/MetalPerformanceShaders/MetalPerformanceShaders.swift @@ -3739,7 +3739,7 @@ class MPSAccelerationStructure : MPSKernel, NSSecureCoding, NSCopying { init?(coder aDecoder: NSCoder, group: MPSAccelerationStructureGroup) func rebuild() func rebuild(completionHandler: @escaping MPSAccelerationStructureCompletionHandler) - func rebuildAsync() async -> MPSAccelerationStructure? + func rebuild() async -> MPSAccelerationStructure? func encodeRefit(commandBuffer: MTLCommandBuffer) func copy(with zone: NSZone? = nil, group: MPSAccelerationStructureGroup) -> Self } diff --git a/iOS/NetworkExtension/NetworkExtension.swift b/iOS/NetworkExtension/NetworkExtension.swift index a9de956..c09acf8 100644 --- a/iOS/NetworkExtension/NetworkExtension.swift +++ b/iOS/NetworkExtension/NetworkExtension.swift @@ -102,11 +102,11 @@ class NETunnelProvider : NEProvider { @available(iOS 9.0, *) func handleAppMessage(_ messageData: Data, completionHandler: ((Data?) -> Void)? = nil) @available(iOS 9.0, *) - func handleAppMessageAsync(_ messageData: Data) async -> Data? + func handleAppMessage(_ messageData: Data) async -> Data? @available(iOS 9.0, *) func setTunnelNetworkSettings(_ tunnelNetworkSettings: NETunnelNetworkSettings?, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 9.0, *) - func setTunnelNetworkSettingsAsync(_ tunnelNetworkSettings: NETunnelNetworkSettings?) async throws + func setTunnelNetworkSettings(_ tunnelNetworkSettings: NETunnelNetworkSettings?) async throws @available(iOS 9.0, *) var protocolConfiguration: NEVPNProtocol { get } @available(iOS 9.0, *) @@ -170,11 +170,11 @@ class NEVPNManager : NSObject { @available(iOS 8.0, *) func removeFromPreferences(completionHandler: ((Error?) -> Void)? = nil) @available(iOS 8.0, *) - func removeFromPreferencesAsync() async throws + func removeFromPreferences() async throws @available(iOS 8.0, *) func saveToPreferences(completionHandler: ((Error?) -> Void)? = nil) @available(iOS 8.0, *) - func saveToPreferencesAsync() async throws + func saveToPreferences() async throws @available(iOS 8.0, *) var onDemandRules: [NEOnDemandRule]? @available(iOS 8.0, *) @@ -921,7 +921,7 @@ class NEHotspotConfigurationManager : NSObject { @available(iOS 11.0, *) func apply(_ configuration: NEHotspotConfiguration, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) - func applyConfigurationAsync(_ configuration: NEHotspotConfiguration) async throws + func apply(_ configuration: NEHotspotConfiguration) async throws @available(iOS 11.0, *) func removeConfiguration(forSSID SSID: String) @available(iOS 11.0, *) diff --git a/iOS/PassKit/PKPassLibrary.swift b/iOS/PassKit/PKPassLibrary.swift index ee45f55..e26aaf5 100644 --- a/iOS/PassKit/PKPassLibrary.swift +++ b/iOS/PassKit/PKPassLibrary.swift @@ -48,7 +48,7 @@ class PKPassLibrary : NSObject { @available(iOS 7.0, *) func addPasses(_ passes: [PKPass], withCompletionHandler completion: ((PKPassLibraryAddPassesStatus) -> Void)? = nil) @available(iOS 7.0, *) - func addPassesAsync(_ passes: [PKPass]) async -> PKPassLibraryAddPassesStatus + func addPasses(_ passes: [PKPass]) async -> PKPassLibraryAddPassesStatus @available(iOS 8.3, *) func openPaymentSetup() @available(iOS, introduced: 10.0, deprecated: 100000, message: "Use -[PKPassLibrary presentSecureElementPass:] instead") @@ -64,11 +64,11 @@ class PKPassLibrary : NSObject { @available(iOS, introduced: 8.0, deprecated: 100000, message: "Use activateSecureElementPass:withActivationData:completion: instead") func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data, completion: ((Bool, Error) -> Void)? = nil) @available(iOS, introduced: 8.0, deprecated: 100000, message: "Use activateSecureElementPass:withActivationData:completion: instead") - func activatePaymentPassAsync(_ paymentPass: PKPaymentPass, withActivationData activationData: Data) async -> (Bool, Error) + func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data) async -> (Bool, Error) @available(iOS, introduced: 8.0, deprecated: 9.0, message: "Use activatePaymentPass:withActivationData:completion: instead") func activate(_ paymentPass: PKPaymentPass, withActivationCode activationCode: String, completion: ((Bool, Error) -> Void)? = nil) @available(iOS, introduced: 8.0, deprecated: 9.0, message: "Use activatePaymentPass:withActivationData:completion: instead") - func activatePaymentPassAsync(_ paymentPass: PKPaymentPass, withActivationCode activationCode: String) async -> (Bool, Error) + func activate(_ paymentPass: PKPaymentPass, withActivationCode activationCode: String) async -> (Bool, Error) @available(iOS 13.4, *) func activate(_ secureElementPass: PKSecureElementPass, activationData: Data, completion: ((Bool, Error?) -> Void)? = nil) @available(iOS 13.4, *) diff --git a/iOS/PassKit/PKPaymentAuthorizationController.swift b/iOS/PassKit/PKPaymentAuthorizationController.swift index 09c229a..97caba1 100644 --- a/iOS/PassKit/PKPaymentAuthorizationController.swift +++ b/iOS/PassKit/PKPaymentAuthorizationController.swift @@ -49,7 +49,7 @@ class PKPaymentAuthorizationController : NSObject { weak var delegate: @sil_weak PKPaymentAuthorizationControllerDelegate? init(paymentRequest request: PKPaymentRequest) func present(completion: ((Bool) -> Void)? = nil) - func presentAsync() async -> Bool + func present() async -> Bool func dismiss(completion: (() -> Void)? = nil) - func dismissAsync() async + func dismiss() async } diff --git a/iOS/Photos/PHPhotoLibrary.swift b/iOS/Photos/PHPhotoLibrary.swift index 8593e5f..9eadd67 100644 --- a/iOS/Photos/PHPhotoLibrary.swift +++ b/iOS/Photos/PHPhotoLibrary.swift @@ -54,7 +54,7 @@ class PHPhotoLibrary : NSObject { @available(iOS 8, *) func performChanges(_ changeBlock: @escaping () -> Void, completionHandler: ((Bool, Error?) -> Void)? = nil) @available(iOS 8, *) - func performChangesAsync(_ changeBlock: @escaping () -> Void) async throws -> Bool + func performChanges(_ changeBlock: @escaping () -> Void) async throws -> Bool @available(iOS 8, *) func performChangesAndWait(_ changeBlock: @escaping () -> Void) throws @available(iOS 8, *) diff --git a/iOS/ReplayKit/RPScreenRecorder.swift b/iOS/ReplayKit/RPScreenRecorder.swift index 39526de..d81fbf0 100644 --- a/iOS/ReplayKit/RPScreenRecorder.swift +++ b/iOS/ReplayKit/RPScreenRecorder.swift @@ -21,7 +21,7 @@ class RPScreenRecorder : NSObject { @available(iOS 11.0, *) func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) - func startCaptureAsync(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?) async throws + func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?) async throws @available(iOS 11.0, *) func stopCapture(handler: ((Error?) -> Void)? = nil) weak var delegate: @sil_weak RPScreenRecorderDelegate? diff --git a/iOS/SafariServices/SFContentBlockerManager.swift b/iOS/SafariServices/SFContentBlockerManager.swift index f526a31..df93e1c 100644 --- a/iOS/SafariServices/SFContentBlockerManager.swift +++ b/iOS/SafariServices/SFContentBlockerManager.swift @@ -15,7 +15,7 @@ enum SFContentBlockerErrorCode : Int { @available(iOS 9.0, *) class SFContentBlockerManager : NSObject { class func reloadContentBlocker(withIdentifier identifier: String, completionHandler: ((Error?) -> Void)? = nil) - class func reloadContentBlockerAsync(withIdentifier identifier: String) async throws + class func reloadContentBlocker(withIdentifier identifier: String) async throws @available(iOS 10.0, *) class func getStateOfContentBlocker(withIdentifier identifier: String, completionHandler: @escaping (SFContentBlockerState?, Error?) -> Void) @available(iOS 10.0, *) diff --git a/iOS/SoundAnalysis/SNAnalyzer.swift b/iOS/SoundAnalysis/SNAnalyzer.swift index d99aee8..120a693 100644 --- a/iOS/SoundAnalysis/SNAnalyzer.swift +++ b/iOS/SoundAnalysis/SNAnalyzer.swift @@ -16,6 +16,6 @@ class SNAudioFileAnalyzer : NSObject { func removeAllRequests() func analyze() func analyze(completionHandler: @escaping (Bool) -> Void) - func analyzeAsync() async -> Bool + func analyze() async -> Bool func cancelAnalysis() } diff --git a/iOS/SpriteKit/SKNode.swift b/iOS/SpriteKit/SKNode.swift index 5e6a671..ac24ee2 100644 --- a/iOS/SpriteKit/SKNode.swift +++ b/iOS/SpriteKit/SKNode.swift @@ -65,7 +65,7 @@ class SKNode : UIResponder, NSCopying, NSSecureCoding, UIFocusItem { func inParentHierarchy(_ parent: SKNode) -> Bool func run(_ action: SKAction) func run(_ action: SKAction, completion block: @escaping () -> Void) - func runActionAsync(_ action: SKAction) async + func run(_ action: SKAction) async func run(_ action: SKAction, withKey key: String) func hasActions() -> Bool func action(forKey key: String) -> SKAction? diff --git a/iOS/StoreKit/SKCloudServiceSetupViewController.swift b/iOS/StoreKit/SKCloudServiceSetupViewController.swift index 806e46a..39f3fa3 100644 --- a/iOS/StoreKit/SKCloudServiceSetupViewController.swift +++ b/iOS/StoreKit/SKCloudServiceSetupViewController.swift @@ -21,7 +21,7 @@ class SKCloudServiceSetupViewController : UIViewController { @available(iOS 10.1, *) func load(options: [SKCloudServiceSetupOptionsKey : Any] = [:], completionHandler: ((Bool, Error?) -> Void)? = nil) @available(iOS 10.1, *) - func loadAsync(options: [SKCloudServiceSetupOptionsKey : Any] = [:]) async throws -> Bool + func load(options: [SKCloudServiceSetupOptionsKey : Any] = [:]) async throws -> Bool } protocol SKCloudServiceSetupViewControllerDelegate : NSObjectProtocol { @available(iOS 10.1, *) diff --git a/iOS/StoreKit/SKProductStorePromotionController.swift b/iOS/StoreKit/SKProductStorePromotionController.swift index 90cc792..ca1e767 100644 --- a/iOS/StoreKit/SKProductStorePromotionController.swift +++ b/iOS/StoreKit/SKProductStorePromotionController.swift @@ -14,7 +14,7 @@ class SKProductStorePromotionController : NSObject { @available(iOS 11.0, *) func fetchStorePromotionVisibility(for product: SKProduct, completionHandler: ((SKProductStorePromotionVisibility, Error?) -> Void)? = nil) @available(iOS 11.0, *) - func fetchStorePromotionVisibilityAsync(for product: SKProduct) async throws -> SKProductStorePromotionVisibility + func fetchStorePromotionVisibility(for product: SKProduct) async throws -> SKProductStorePromotionVisibility @available(iOS 11.0, *) func update(storePromotionVisibility promotionVisibility: SKProductStorePromotionVisibility, for product: SKProduct, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) @@ -22,7 +22,7 @@ class SKProductStorePromotionController : NSObject { @available(iOS 11.0, *) func fetchStorePromotionOrder(completionHandler: (([SKProduct], Error?) -> Void)? = nil) @available(iOS 11.0, *) - func fetchStorePromotionOrderAsync() async throws -> [SKProduct] + func fetchStorePromotionOrder() async throws -> [SKProduct] @available(iOS 11.0, *) func update(storePromotionOrder: [SKProduct], completionHandler: ((Error?) -> Void)? = nil) @available(iOS 11.0, *) diff --git a/iOS/StoreKit/SKStoreProductViewController.swift b/iOS/StoreKit/SKStoreProductViewController.swift index e61c013..1fcaa92 100644 --- a/iOS/StoreKit/SKStoreProductViewController.swift +++ b/iOS/StoreKit/SKStoreProductViewController.swift @@ -5,6 +5,8 @@ class SKStoreProductViewController : UIViewController { weak var delegate: @sil_weak SKStoreProductViewControllerDelegate? @available(iOS 6.0, *) func loadProduct(withParameters parameters: [String : Any], completionBlock block: ((Bool, Error?) -> Void)? = nil) + @available(iOS 6.0, *) + func loadProduct(withParameters parameters: [String : Any]) async throws -> Bool } protocol SKStoreProductViewControllerDelegate : NSObjectProtocol { @available(iOS 6.0, *) diff --git a/iOS/UIKit/UIApplication.swift b/iOS/UIKit/UIApplication.swift index f7af38e..b8ea4ec 100644 --- a/iOS/UIKit/UIApplication.swift +++ b/iOS/UIKit/UIApplication.swift @@ -94,7 +94,7 @@ class UIApplication : UIResponder { @available(iOS 10.0, *) func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:], completionHandler completion: ((Bool) -> Void)? = nil) @available(iOS 10.0, *) - func openURLAsync(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:]) async -> Bool + func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:]) async -> Bool func sendEvent(_ event: UIEvent) @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Should not be used for applications that support multiple scenes as it returns a key window across all connected scenes") var keyWindow: UIWindow? { get } @@ -200,7 +200,7 @@ extension UIApplication { @available(iOS 10.3, *) func setAlternateIconName(_ alternateIconName: String?, completionHandler: ((Error?) -> Void)? = nil) @available(iOS 10.3, *) - func setAlternateIconNameAsync(_ alternateIconName: String?) async throws + func setAlternateIconName(_ alternateIconName: String?) async throws @available(iOS 10.3, *) var alternateIconName: String? { get } } @@ -342,7 +342,7 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(iOS 7.0, *) @asyncHandler optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) @available(iOS 7.0, *) - optional func applicationAsync(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) async -> UIBackgroundFetchResult + optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) async -> UIBackgroundFetchResult @available(iOS, introduced: 7.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead") optional func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) @available(iOS, introduced: 7.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead") @@ -357,6 +357,8 @@ protocol UIApplicationDelegate : NSObjectProtocol { optional func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String) async @available(iOS 8.2, *) optional func application(_ application: UIApplication, handleWatchKitExtensionRequest userInfo: [AnyHashable : Any]?, reply: @escaping ([AnyHashable : Any]?) -> Void) + @available(iOS 8.2, *) + optional func application(_ application: UIApplication, handleWatchKitExtensionRequest userInfo: [AnyHashable : Any]?) async -> [AnyHashable : Any]? @available(iOS 9.0, *) optional func applicationShouldRequestHealthAuthorization(_ application: UIApplication) @available(iOS 4.0, *) diff --git a/iOS/UIKit/UICollectionView.swift b/iOS/UIKit/UICollectionView.swift index 4d81d15..c0047f0 100644 --- a/iOS/UIKit/UICollectionView.swift +++ b/iOS/UIKit/UICollectionView.swift @@ -155,7 +155,7 @@ class UICollectionView : UIScrollView, UIDataSourceTranslating { @available(iOS 7.0, *) func setCollectionViewLayout(_ layout: UICollectionViewLayout, animated: Bool, completion: ((Bool) -> Void)? = nil) @available(iOS 7.0, *) - func setCollectionViewLayoutAsync(_ layout: UICollectionViewLayout, animated: Bool) async -> Bool + func setCollectionViewLayout(_ layout: UICollectionViewLayout, animated: Bool) async -> Bool @available(iOS 7.0, *) func startInteractiveTransition(to layout: UICollectionViewLayout, completion: UICollectionView.LayoutInteractiveTransitionCompletion? = nil) -> UICollectionViewTransitionLayout @available(iOS 7.0, *) @@ -187,7 +187,7 @@ class UICollectionView : UIScrollView, UIDataSourceTranslating { func reloadItems(at indexPaths: [IndexPath]) func moveItem(at indexPath: IndexPath, to newIndexPath: IndexPath) func performBatchUpdates(_ updates: (() -> Void)?, completion: ((Bool) -> Void)? = nil) - func performBatchUpdatesAsync(_ updates: (() -> Void)?) async -> Bool + func performBatchUpdates(_ updates: (() -> Void)?) async -> Bool @available(iOS 9.0, *) func beginInteractiveMovementForItem(at indexPath: IndexPath) -> Bool @available(iOS 9.0, *) diff --git a/iOS/UIKit/UIDiffableDataSource.swift b/iOS/UIKit/UIDiffableDataSource.swift index 879845a..c06eacf 100644 --- a/iOS/UIKit/UIDiffableDataSource.swift +++ b/iOS/UIKit/UIDiffableDataSource.swift @@ -64,7 +64,7 @@ class UICollectionViewDiffableDataSourceReference : NSObject, UICollectionViewDa func snapshot() -> NSDiffableDataSourceSnapshotReference func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool, completion: (() -> Void)? = nil) - func applySnapshotAsync(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async + func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async func itemIdentifier(for indexPath: IndexPath) -> Any? func indexPath(forItemIdentifier identifier: Any) -> IndexPath? @available(iOS 14.0, *) @@ -74,7 +74,7 @@ class UICollectionViewDiffableDataSourceReference : NSObject, UICollectionViewDa @available(iOS 14.0, *) func applySnapshot(_ snapshot: NSDiffableDataSourceSectionSnapshotReference, toSection sectionIdentifier: Any, animatingDifferences: Bool, completion: (() -> Void)? = nil) @available(iOS 14.0, *) - func applySnapshotAsync(_ snapshot: NSDiffableDataSourceSectionSnapshotReference, toSection sectionIdentifier: Any, animatingDifferences: Bool) async + func applySnapshot(_ snapshot: NSDiffableDataSourceSectionSnapshotReference, toSection sectionIdentifier: Any, animatingDifferences: Bool) async @available(iOS 14.0, *) func snapshot(forSection section: Any) -> NSDiffableDataSourceSectionSnapshotReference @available(iOS 14.0, *) @@ -87,7 +87,7 @@ class UITableViewDiffableDataSourceReference : NSObject, UITableViewDataSource { func snapshot() -> NSDiffableDataSourceSnapshotReference func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool, completion: (() -> Void)? = nil) - func applySnapshotAsync(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async + func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async func itemIdentifier(for indexPath: IndexPath) -> Any? func indexPath(forItemIdentifier identifier: Any) -> IndexPath? var defaultRowAnimation: UITableView.RowAnimation diff --git a/iOS/UIKit/UIDocument.swift b/iOS/UIKit/UIDocument.swift index 42bc883..76c25e3 100644 --- a/iOS/UIKit/UIDocument.swift +++ b/iOS/UIKit/UIDocument.swift @@ -8,9 +8,9 @@ class UIDocument : NSObject, NSFilePresenter, ProgressReporting { var fileModificationDate: Date? var documentState: UIDocument.State { get } func open(completionHandler: ((Bool) -> Void)? = nil) - func openAsync() async -> Bool + func open() async -> Bool func close(completionHandler: ((Bool) -> Void)? = nil) - func closeAsync() async -> Bool + func close() async -> Bool func load(fromContents contents: Any, ofType typeName: String?) throws func contents(forType typeName: String) throws -> Any func disableEditing() @@ -21,9 +21,9 @@ class UIDocument : NSObject, NSFilePresenter, ProgressReporting { func changeCountToken(for saveOperation: UIDocument.SaveOperation) -> Any func updateChangeCount(withToken changeCountToken: Any, for saveOperation: UIDocument.SaveOperation) func save(to url: URL, for saveOperation: UIDocument.SaveOperation, completionHandler: ((Bool) -> Void)? = nil) - func saveAsync(to url: URL, for saveOperation: UIDocument.SaveOperation) async -> Bool + func save(to url: URL, for saveOperation: UIDocument.SaveOperation) async -> Bool func autosave(completionHandler: ((Bool) -> Void)? = nil) - func autosaveAsync() async -> Bool + func autosave() async -> Bool var savingFileType: String? { get } func fileNameExtension(forType typeName: String?, saveOperation: UIDocument.SaveOperation) -> String func writeContents(_ contents: Any, andAttributes additionalFileAttributes: [AnyHashable : Any]? = nil, safelyTo url: URL, for saveOperation: UIDocument.SaveOperation) throws @@ -35,7 +35,7 @@ class UIDocument : NSObject, NSFilePresenter, ProgressReporting { func finishedHandlingError(_ error: Error, recovered: Bool) func userInteractionNoLongerPermitted(forError error: Error) func revert(toContentsOf url: URL, completionHandler: ((Bool) -> Void)? = nil) - func revertAsync(toContentsOf url: URL) async -> Bool + func revert(toContentsOf url: URL) async -> Bool } extension UIDocument { @available(iOS 8.0, *) diff --git a/iOS/UIKit/UIDocumentBrowserViewController.swift b/iOS/UIKit/UIDocumentBrowserViewController.swift index 1feb88b..3651f68 100644 --- a/iOS/UIKit/UIDocumentBrowserViewController.swift +++ b/iOS/UIKit/UIDocumentBrowserViewController.swift @@ -44,7 +44,7 @@ class UIDocumentBrowserViewController : UIViewController, NSCoding { var additionalLeadingNavigationBarButtonItems: [UIBarButtonItem] var additionalTrailingNavigationBarButtonItems: [UIBarButtonItem] func revealDocument(at url: URL, importIfNeeded: Bool, completion: ((URL?, Error?) -> Void)? = nil) - func revealDocumentAsync(at url: URL, importIfNeeded: Bool) async throws -> URL + func revealDocument(at url: URL, importIfNeeded: Bool) async throws -> URL func importDocument(at documentURL: URL, nextToDocumentAt neighbourURL: URL, mode importMode: UIDocumentBrowserViewController.ImportMode, completionHandler completion: @escaping (URL?, Error?) -> Void) func importDocument(at documentURL: URL, nextToDocumentAt neighbourURL: URL, mode importMode: UIDocumentBrowserViewController.ImportMode) async throws -> URL @available(iOS 12.0, *) diff --git a/iOS/UIKit/UIFocusAnimationCoordinator.swift b/iOS/UIKit/UIFocusAnimationCoordinator.swift index 9ec914e..f81caf5 100644 --- a/iOS/UIKit/UIFocusAnimationCoordinator.swift +++ b/iOS/UIKit/UIFocusAnimationCoordinator.swift @@ -6,13 +6,13 @@ protocol UIFocusAnimationContext : NSObjectProtocol { @available(iOS 9.0, *) class UIFocusAnimationCoordinator : NSObject { func addCoordinatedAnimations(_ animations: (() -> Void)?, completion: (() -> Void)? = nil) - func addCoordinatedAnimationsAsync(_ animations: (() -> Void)?) async + func addCoordinatedAnimations(_ animations: (() -> Void)?) async @available(iOS 11.0, *) func addCoordinatedFocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?, completion: (() -> Void)? = nil) @available(iOS 11.0, *) - func addCoordinatedFocusingAnimationsAsync(_ animations: ((UIFocusAnimationContext) -> Void)?) async + func addCoordinatedFocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?) async @available(iOS 11.0, *) func addCoordinatedUnfocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?, completion: (() -> Void)? = nil) @available(iOS 11.0, *) - func addCoordinatedUnfocusingAnimationsAsync(_ animations: ((UIFocusAnimationContext) -> Void)?) async + func addCoordinatedUnfocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?) async } diff --git a/iOS/UIKit/UIPageViewController.swift b/iOS/UIKit/UIPageViewController.swift index 3d41d8d..d92413f 100644 --- a/iOS/UIKit/UIPageViewController.swift +++ b/iOS/UIKit/UIPageViewController.swift @@ -49,7 +49,7 @@ class UIPageViewController : UIViewController { var gestureRecognizers: [UIGestureRecognizer] { get } var viewControllers: [UIViewController]? { get } func setViewControllers(_ viewControllers: [UIViewController]?, direction: UIPageViewController.NavigationDirection, animated: Bool, completion: ((Bool) -> Void)? = nil) - func setViewControllersAsync(_ viewControllers: [UIViewController]?, direction: UIPageViewController.NavigationDirection, animated: Bool) async -> Bool + func setViewControllers(_ viewControllers: [UIViewController]?, direction: UIPageViewController.NavigationDirection, animated: Bool) async -> Bool } protocol UIPageViewControllerDelegate : NSObjectProtocol { @available(iOS 6.0, *) diff --git a/iOS/UIKit/UIPrinter.swift b/iOS/UIKit/UIPrinter.swift index 5f97127..0747864 100644 --- a/iOS/UIKit/UIPrinter.swift +++ b/iOS/UIKit/UIPrinter.swift @@ -10,7 +10,7 @@ class UIPrinter : NSObject { var supportsColor: Bool { get } var supportsDuplex: Bool { get } func contactPrinter(_ completionHandler: ((Bool) -> Void)? = nil) - func contactPrinterAsync() async -> Bool + func contactPrinter() async -> Bool } extension UIPrinter { @available(iOS 8.0, *) diff --git a/iOS/UIKit/UIScene.swift b/iOS/UIKit/UIScene.swift index 949a6a0..297cecf 100644 --- a/iOS/UIKit/UIScene.swift +++ b/iOS/UIKit/UIScene.swift @@ -6,7 +6,7 @@ class UIScene : UIResponder { var delegate: UISceneDelegate? var activationState: UIScene.ActivationState { get } func open(_ url: URL, options: UIScene.OpenExternalURLOptions?, completionHandler completion: ((Bool) -> Void)? = nil) - func openURLAsync(_ url: URL, options: UIScene.OpenExternalURLOptions?) async -> Bool + func open(_ url: URL, options: UIScene.OpenExternalURLOptions?) async -> Bool var title: String! var activationConditions: UISceneActivationConditions } diff --git a/iOS/UIKit/UITableView.swift b/iOS/UIKit/UITableView.swift index f4062b3..ece0533 100644 --- a/iOS/UIKit/UITableView.swift +++ b/iOS/UIKit/UITableView.swift @@ -211,7 +211,7 @@ class UITableView : UIScrollView, NSCoding, UIDataSourceTranslating { @available(iOS 11.0, *) func performBatchUpdates(_ updates: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(iOS 11.0, *) - func performBatchUpdatesAsync(_ updates: (() -> Void)?) async -> Bool + func performBatchUpdates(_ updates: (() -> Void)?) async -> Bool func beginUpdates() func endUpdates() func insertSections(_ sections: IndexSet, with animation: UITableView.RowAnimation) diff --git a/iOS/UIKit/UIView.swift b/iOS/UIKit/UIView.swift index 491ba09..c945d61 100644 --- a/iOS/UIKit/UIView.swift +++ b/iOS/UIKit/UIView.swift @@ -247,29 +247,29 @@ extension UIView { @available(iOS 4.0, *) class func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions = [], animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(iOS 4.0, *) - class func animateAsync(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool + class func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool @available(iOS 4.0, *) class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(iOS 4.0, *) - class func animateAsync(withDuration duration: TimeInterval, animations: @escaping () -> Void) async -> Bool + class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void) async -> Bool @available(iOS 4.0, *) class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void) @available(iOS 7.0, *) class func animate(withDuration duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping dampingRatio: CGFloat, initialSpringVelocity velocity: CGFloat, options: UIView.AnimationOptions = [], animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(iOS 7.0, *) - class func animateAsync(withDuration duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping dampingRatio: CGFloat, initialSpringVelocity velocity: CGFloat, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool + class func animate(withDuration duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping dampingRatio: CGFloat, initialSpringVelocity velocity: CGFloat, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool @available(iOS 4.0, *) class func transition(with view: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(iOS 4.0, *) - class func transitionAsync(with view: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool + class func transition(with view: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool @available(iOS 4.0, *) class func transition(from fromView: UIView, to toView: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], completion: ((Bool) -> Void)? = nil) @available(iOS 4.0, *) - class func transitionAsync(from fromView: UIView, to toView: UIView, duration: TimeInterval, options: UIView.AnimationOptions = []) async -> Bool + class func transition(from fromView: UIView, to toView: UIView, duration: TimeInterval, options: UIView.AnimationOptions = []) async -> Bool @available(iOS 7.0, *) class func perform(_ animation: UIView.SystemAnimation, on views: [UIView], options: UIView.AnimationOptions = [], animations parallelAnimations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(iOS 7.0, *) - class func performSystemAnimationAsync(_ animation: UIView.SystemAnimation, on views: [UIView], options: UIView.AnimationOptions = [], animations parallelAnimations: (() -> Void)?) async -> Bool + class func perform(_ animation: UIView.SystemAnimation, on views: [UIView], options: UIView.AnimationOptions = [], animations parallelAnimations: (() -> Void)?) async -> Bool @available(iOS 12.0, *) class func modifyAnimations(withRepeatCount count: CGFloat, autoreverses: Bool, animations: () -> Void) } @@ -277,7 +277,7 @@ extension UIView { @available(iOS 7.0, *) class func animateKeyframes(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.KeyframeAnimationOptions = [], animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(iOS 7.0, *) - class func animateKeyframesAsync(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.KeyframeAnimationOptions = [], animations: @escaping () -> Void) async -> Bool + class func animateKeyframes(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.KeyframeAnimationOptions = [], animations: @escaping () -> Void) async -> Bool @available(iOS 7.0, *) class func addKeyframe(withRelativeStartTime frameStartTime: Double, relativeDuration frameDuration: Double, animations: @escaping () -> Void) } diff --git a/iOS/UIKit/UIViewController.swift b/iOS/UIKit/UIViewController.swift index 480b4d1..fb090d9 100644 --- a/iOS/UIKit/UIViewController.swift +++ b/iOS/UIKit/UIViewController.swift @@ -119,11 +119,11 @@ class UIViewController : UIResponder, NSCoding, UIAppearanceContainer, UITraitEn @available(iOS 5.0, *) func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) @available(iOS 5.0, *) - func presentAsync(_ viewControllerToPresent: UIViewController, animated flag: Bool) async + func present(_ viewControllerToPresent: UIViewController, animated flag: Bool) async @available(iOS 5.0, *) func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) @available(iOS 5.0, *) - func dismissAsync(animated flag: Bool) async + func dismiss(animated flag: Bool) async @available(iOS 3.0, *) var modalTransitionStyle: UIModalTransitionStyle @available(iOS 3.2, *) @@ -196,7 +196,7 @@ extension UIViewController { @available(iOS 5.0, *) func transition(from fromViewController: UIViewController, to toViewController: UIViewController, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(iOS 5.0, *) - func transitionAsync(from fromViewController: UIViewController, to toViewController: UIViewController, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool + func transition(from fromViewController: UIViewController, to toViewController: UIViewController, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool @available(iOS 5.0, *) func beginAppearanceTransition(_ isAppearing: Bool, animated: Bool) @available(iOS 5.0, *) diff --git a/iOS/UserNotifications/UNUserNotificationCenter.swift b/iOS/UserNotifications/UNUserNotificationCenter.swift index c9773c2..7660c79 100644 --- a/iOS/UserNotifications/UNUserNotificationCenter.swift +++ b/iOS/UserNotifications/UNUserNotificationCenter.swift @@ -29,7 +29,7 @@ class UNUserNotificationCenter : NSObject { func getNotificationSettings(completionHandler: @escaping (UNNotificationSettings) -> Void) func notificationSettings() async -> UNNotificationSettings func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) - func addNotificationRequestAsync(_ request: UNNotificationRequest) async throws + func add(_ request: UNNotificationRequest) async throws func getPendingNotificationRequests(completionHandler: @escaping ([UNNotificationRequest]) -> Void) func pendingNotificationRequests() async -> [UNNotificationRequest] func removePendingNotificationRequests(withIdentifiers identifiers: [String]) diff --git a/iOS/WebKit/WKContentRuleListStore.swift b/iOS/WebKit/WKContentRuleListStore.swift index 84cc45f..3df2b56 100644 --- a/iOS/WebKit/WKContentRuleListStore.swift +++ b/iOS/WebKit/WKContentRuleListStore.swift @@ -4,9 +4,9 @@ class WKContentRuleListStore : NSObject { class func `default`() -> Self! convenience init!(url: URL!) func compileContentRuleList(forIdentifier identifier: String!, encodedContentRuleList: String!, completionHandler: ((WKContentRuleList?, Error?) -> Void)!) - func compileContentRuleList(forIdentifier identifier: String!, encodedContentRuleList: String!) async throws -> WKContentRuleList + func compileContentRuleList(forIdentifier identifier: String!, encodedContentRuleList: String!) async throws -> WKContentRuleList? func lookUpContentRuleList(forIdentifier identifier: String!, completionHandler: ((WKContentRuleList?, Error?) -> Void)!) - func lookUpContentRuleList(forIdentifier identifier: String!) async throws -> WKContentRuleList + func lookUpContentRuleList(forIdentifier identifier: String!) async throws -> WKContentRuleList? func removeContentRuleList(forIdentifier identifier: String!, completionHandler: ((Error?) -> Void)!) func removeContentRuleList(forIdentifier identifier: String!) async throws func getAvailableContentRuleListIdentifiers(_ completionHandler: (([String]?) -> Void)!) diff --git a/iOS/WebKit/WKHTTPCookieStore.swift b/iOS/WebKit/WKHTTPCookieStore.swift index cc1bcc1..62e6489 100644 --- a/iOS/WebKit/WKHTTPCookieStore.swift +++ b/iOS/WebKit/WKHTTPCookieStore.swift @@ -8,9 +8,9 @@ class WKHTTPCookieStore : NSObject { func getAllCookies(_ completionHandler: @escaping ([HTTPCookie]) -> Void) func allCookies() async -> [HTTPCookie] func setCookie(_ cookie: HTTPCookie, completionHandler: (() -> Void)? = nil) - func setCookieAsync(_ cookie: HTTPCookie) async + func setCookie(_ cookie: HTTPCookie) async func delete(_ cookie: HTTPCookie, completionHandler: (() -> Void)? = nil) - func deleteCookieAsync(_ cookie: HTTPCookie) async + func delete(_ cookie: HTTPCookie) async func add(_ observer: WKHTTPCookieStoreObserver) func remove(_ observer: WKHTTPCookieStoreObserver) } diff --git a/iOS/WebKit/WKWebView.swift b/iOS/WebKit/WKWebView.swift index b51e7ce..da35286 100644 --- a/iOS/WebKit/WKWebView.swift +++ b/iOS/WebKit/WKWebView.swift @@ -28,15 +28,15 @@ class WKWebView : UIView { func reloadFromOrigin() -> WKNavigation? func stopLoading() func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, Error?) -> Void)? = nil) - func evaluateJavaScriptAsync(_ javaScriptString: String) async throws -> Any + func evaluateJavaScript(_ javaScriptString: String) async throws -> Any @available(iOS 14.0, *) func __evaluateJavaScript(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld, completionHandler: ((Any?, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func __evaluateJavaScriptAsync(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any + func __evaluateJavaScript(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any @available(iOS 14.0, *) func __callAsyncJavaScript(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld, completionHandler: ((Any?, Error?) -> Void)? = nil) @available(iOS 14.0, *) - func __callAsyncJavaScriptAsync(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any + func __callAsyncJavaScript(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any @available(iOS 11.0, *) func takeSnapshot(with snapshotConfiguration: WKSnapshotConfiguration?, completionHandler: @escaping (UIImage?, Error?) -> Void) @available(iOS 11.0, *) diff --git a/macOS/AVFoundation/AVAsynchronousKeyValueLoading.swift b/macOS/AVFoundation/AVAsynchronousKeyValueLoading.swift index d104d0f..22888c5 100644 --- a/macOS/AVFoundation/AVAsynchronousKeyValueLoading.swift +++ b/macOS/AVFoundation/AVAsynchronousKeyValueLoading.swift @@ -11,5 +11,5 @@ enum AVKeyValueStatus : Int { protocol AVAsynchronousKeyValueLoading { func statusOfValue(forKey key: String, error outError: NSErrorPointer) -> AVKeyValueStatus func loadValuesAsynchronously(forKeys keys: [String], completionHandler handler: (() -> Void)? = nil) - func loadValuesAsync(forKeys keys: [String]) async + func loadValues(forKeys keys: [String]) async } diff --git a/macOS/AVFoundation/AVPlayer.swift b/macOS/AVFoundation/AVPlayer.swift index 6f0f9ef..c476504 100644 --- a/macOS/AVFoundation/AVPlayer.swift +++ b/macOS/AVFoundation/AVPlayer.swift @@ -67,17 +67,17 @@ extension AVPlayer { @available(macOS 10.7, *) func seek(to date: Date, completionHandler: @escaping (Bool) -> Void) @available(macOS 10.7, *) - func seekAsync(to date: Date) async -> Bool + func seek(to date: Date) async -> Bool func seek(to time: CMTime) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) @available(macOS 10.7, *) func seek(to time: CMTime, completionHandler: @escaping (Bool) -> Void) @available(macOS 10.7, *) - func seekAsync(to time: CMTime) async -> Bool + func seek(to time: CMTime) async -> Bool @available(macOS 10.7, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: @escaping (Bool) -> Void) @available(macOS 10.7, *) - func seekAsync(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool } extension AVPlayer { @available(macOS 10.12, *) @@ -87,7 +87,7 @@ extension AVPlayer { @available(macOS 10.8, *) func preroll(atRate rate: Float, completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.8, *) - func prerollAsync(atRate rate: Float) async -> Bool + func preroll(atRate rate: Float) async -> Bool @available(macOS 10.8, *) func cancelPendingPrerolls() @available(macOS 10.8, *) diff --git a/macOS/AVFoundation/AVPlayerItem.swift b/macOS/AVFoundation/AVPlayerItem.swift index 5a95e13..cc18e2a 100644 --- a/macOS/AVFoundation/AVPlayerItem.swift +++ b/macOS/AVFoundation/AVPlayerItem.swift @@ -85,11 +85,11 @@ extension AVPlayerItem { @available(macOS 10.7, *) func seek(to time: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.7, *) - func seekAsync(to time: CMTime) async -> Bool + func seek(to time: CMTime) async -> Bool @available(macOS 10.7, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.7, *) - func seekAsync(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool @available(macOS 10.7, *) func cancelPendingSeeks() func currentDate() -> Date? diff --git a/macOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift b/macOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift index 9fa5217..27b6813 100644 --- a/macOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift +++ b/macOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift @@ -15,7 +15,7 @@ extension AVSampleBufferRenderSynchronizer { var renderers: [AVQueuedSampleBufferRendering] { get } func addRenderer(_ renderer: AVQueuedSampleBufferRendering) func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime, completionHandler: ((Bool) -> Void)? = nil) - func removeRendererAsync(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool + func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool } extension AVSampleBufferRenderSynchronizer { func addPeriodicTimeObserver(forInterval interval: CMTime, queue: DispatchQueue?, using block: @escaping (CMTime) -> Void) -> Any diff --git a/macOS/AVKit/AVPlayerView.swift b/macOS/AVKit/AVPlayerView.swift index ff07aec..eaa14be 100644 --- a/macOS/AVKit/AVPlayerView.swift +++ b/macOS/AVKit/AVPlayerView.swift @@ -35,7 +35,7 @@ extension AVPlayerView { extension AVPlayerView { var canBeginTrimming: Bool { get } func beginTrimming(completionHandler handler: ((AVPlayerViewTrimResult) -> Void)? = nil) - func beginTrimmingAsync() async -> AVPlayerViewTrimResult + func beginTrimming() async -> AVPlayerViewTrimResult } @available(macOS 10.9, *) enum AVPlayerViewTrimResult : Int { diff --git a/macOS/AppKit/NSAlert.swift b/macOS/AppKit/NSAlert.swift index 29c6250..747c919 100644 --- a/macOS/AppKit/NSAlert.swift +++ b/macOS/AppKit/NSAlert.swift @@ -36,7 +36,7 @@ class NSAlert : NSObject { @available(macOS 10.9, *) func beginSheetModal(for sheetWindow: NSWindow, completionHandler handler: ((NSApplication.ModalResponse) -> Void)? = nil) @available(macOS 10.9, *) - func beginSheetModalAsync(for sheetWindow: NSWindow) async -> NSApplication.ModalResponse + func beginSheetModal(for sheetWindow: NSWindow) async -> NSApplication.ModalResponse var window: NSWindow { get } } protocol NSAlertDelegate : NSObjectProtocol { diff --git a/macOS/AppKit/NSAnimationContext.swift b/macOS/AppKit/NSAnimationContext.swift index 2bd8402..4c91a48 100644 --- a/macOS/AppKit/NSAnimationContext.swift +++ b/macOS/AppKit/NSAnimationContext.swift @@ -4,7 +4,7 @@ class NSAnimationContext : NSObject { @available(macOS 10.7, *) class func runAnimationGroup(_ changes: (NSAnimationContext) -> Void, completionHandler: (() -> Void)? = nil) @available(macOS 10.7, *) - class func runAnimationGroupAsync(_ changes: (NSAnimationContext) -> Void) async + class func runAnimationGroup(_ changes: (NSAnimationContext) -> Void) async @available(macOS 10.12, *) class func runAnimationGroup(_ changes: (NSAnimationContext) -> Void) class func beginGrouping() diff --git a/macOS/AppKit/NSCollectionView.swift b/macOS/AppKit/NSCollectionView.swift index e77cdef..15646e2 100644 --- a/macOS/AppKit/NSCollectionView.swift +++ b/macOS/AppKit/NSCollectionView.swift @@ -154,7 +154,7 @@ class NSCollectionView : NSView, NSDraggingSource, NSDraggingDestination { @available(macOS 10.11, *) func performBatchUpdates(_ updates: (() -> Void)?, completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.11, *) - func performBatchUpdatesAsync(_ updates: (() -> Void)?) async -> Bool + func performBatchUpdates(_ updates: (() -> Void)?) async -> Bool @available(macOS 10.12, *) @IBAction func toggleSectionCollapse(_ sender: Any) @available(macOS 10.11, *) diff --git a/macOS/AppKit/NSDocument.swift b/macOS/AppKit/NSDocument.swift index 446c2ef..2423b14 100644 --- a/macOS/AppKit/NSDocument.swift +++ b/macOS/AppKit/NSDocument.swift @@ -105,7 +105,7 @@ class NSDocument : NSObject, NSEditorRegistration, NSFilePresenter, NSMenuItemVa @available(macOS 10.12, *) func stopBrowsingVersions(completionHandler: (() -> Void)? = nil) @available(macOS 10.12, *) - func stopBrowsingVersionsAsync() async + func stopBrowsingVersions() async @available(macOS 10.8, *) class var autosavesDrafts: Bool { get } var autosavingFileType: String? { get } @@ -127,11 +127,11 @@ class NSDocument : NSObject, NSEditorRegistration, NSFilePresenter, NSMenuItemVa @available(macOS 10.8, *) func move(completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.8, *) - func moveAsync() async -> Bool + func move() async -> Bool @available(macOS 10.8, *) func move(to url: URL, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) - func moveAsync(to url: URL) async throws + func move(to url: URL) async throws @available(macOS 10.8, *) @IBAction func lock(_ sender: Any?) @available(macOS 10.8, *) @@ -139,19 +139,19 @@ class NSDocument : NSObject, NSEditorRegistration, NSFilePresenter, NSMenuItemVa @available(macOS 10.8, *) func lock(completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.8, *) - func lockAsync() async -> Bool + func lock() async -> Bool @available(macOS 10.8, *) func lock(completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) - func lockAsync() async throws + func lock() async throws @available(macOS 10.8, *) func unlock(completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.8, *) - func unlockAsync() async -> Bool + func unlock() async -> Bool @available(macOS 10.8, *) func unlock(completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) - func unlockAsync() async throws + func unlock() async throws @available(macOS 10.8, *) var isLocked: Bool { get } @IBAction func runPageLayout(_ sender: Any?) @@ -172,7 +172,7 @@ class NSDocument : NSObject, NSEditorRegistration, NSFilePresenter, NSMenuItemVa @available(macOS 10.13, *) func share(with sharingService: NSSharingService, completionHandler: ((Bool) -> Void)? = nil) @available(macOS 10.13, *) - func shareAsync(with sharingService: NSSharingService) async -> Bool + func share(with sharingService: NSSharingService) async -> Bool @available(macOS 10.13, *) func prepare(_ sharingServicePicker: NSSharingServicePicker) var isDocumentEdited: Bool { get } diff --git a/macOS/AppKit/NSSpellChecker.swift b/macOS/AppKit/NSSpellChecker.swift index 9c8e0ca..15e3721 100644 --- a/macOS/AppKit/NSSpellChecker.swift +++ b/macOS/AppKit/NSSpellChecker.swift @@ -69,7 +69,7 @@ class NSSpellChecker : NSObject { @available(macOS 10.7, *) func showCorrectionIndicator(of type: NSSpellChecker.CorrectionIndicatorType, primaryString: String, alternativeStrings: [String], forStringIn rectOfTypedString: NSRect, view: NSView, completionHandler completionBlock: ((String?) -> Void)? = nil) @available(macOS 10.7, *) - func showCorrectionIndicatorAsync(of type: NSSpellChecker.CorrectionIndicatorType, primaryString: String, alternativeStrings: [String], forStringIn rectOfTypedString: NSRect, view: NSView) async -> String? + func showCorrectionIndicator(of type: NSSpellChecker.CorrectionIndicatorType, primaryString: String, alternativeStrings: [String], forStringIn rectOfTypedString: NSRect, view: NSView) async -> String? @available(macOS 10.7, *) func dismissCorrectionIndicator(for view: NSView) @available(macOS 10.12, *) diff --git a/macOS/AppKit/NSTableViewDiffableDataSource.swift b/macOS/AppKit/NSTableViewDiffableDataSource.swift index 6eff199..86544b8 100644 --- a/macOS/AppKit/NSTableViewDiffableDataSource.swift +++ b/macOS/AppKit/NSTableViewDiffableDataSource.swift @@ -5,7 +5,7 @@ class NSTableViewDiffableDataSourceReference NSDiffableDataSourceSnapshotReference func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool, completion: (() -> Void)? = nil) - func applySnapshotAsync(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async + func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async func itemIdentifier(forRow row: Int) -> ItemIdentifierType? func row(forItemIdentifier identifier: ItemIdentifierType) -> Int func sectionIdentifier(forRow row: Int) -> SectionIdentifierType? diff --git a/macOS/AppKit/NSViewController.swift b/macOS/AppKit/NSViewController.swift index a447699..e6d2f59 100644 --- a/macOS/AppKit/NSViewController.swift +++ b/macOS/AppKit/NSViewController.swift @@ -66,7 +66,7 @@ extension NSViewController { @available(macOS 10.10, *) func transition(from fromViewController: NSViewController, to toViewController: NSViewController, options: NSViewController.TransitionOptions = [], completionHandler completion: (() -> Void)? = nil) @available(macOS 10.10, *) - func transitionAsync(from fromViewController: NSViewController, to toViewController: NSViewController, options: NSViewController.TransitionOptions = []) async + func transition(from fromViewController: NSViewController, to toViewController: NSViewController, options: NSViewController.TransitionOptions = []) async } extension NSViewController { @available(macOS 10.10, *) diff --git a/macOS/AppKit/NSWindow.swift b/macOS/AppKit/NSWindow.swift index 89d2a22..914d432 100644 --- a/macOS/AppKit/NSWindow.swift +++ b/macOS/AppKit/NSWindow.swift @@ -413,11 +413,11 @@ class NSWindow : NSResponder, NSAnimatablePropertyContainer, NSMenuItemValidatio @available(macOS 10.9, *) func beginSheet(_ sheetWindow: NSWindow, completionHandler handler: ((NSApplication.ModalResponse) -> Void)? = nil) @available(macOS 10.9, *) - func beginSheetAsync(_ sheetWindow: NSWindow) async -> NSApplication.ModalResponse + func beginSheet(_ sheetWindow: NSWindow) async -> NSApplication.ModalResponse @available(macOS 10.9, *) func beginCriticalSheet(_ sheetWindow: NSWindow, completionHandler handler: ((NSApplication.ModalResponse) -> Void)? = nil) @available(macOS 10.9, *) - func beginCriticalSheetAsync(_ sheetWindow: NSWindow) async -> NSApplication.ModalResponse + func beginCriticalSheet(_ sheetWindow: NSWindow) async -> NSApplication.ModalResponse @available(macOS 10.9, *) func endSheet(_ sheetWindow: NSWindow) @available(macOS 10.9, *) diff --git a/macOS/AppKit/NSWorkspace.swift b/macOS/AppKit/NSWorkspace.swift index f4fba87..fe04084 100644 --- a/macOS/AppKit/NSWorkspace.swift +++ b/macOS/AppKit/NSWorkspace.swift @@ -6,15 +6,15 @@ class NSWorkspace : NSObject { @available(macOS 10.15, *) func open(_ url: URL, configuration: NSWorkspace.OpenConfiguration, completionHandler: ((NSRunningApplication?, Error?) -> Void)? = nil) @available(macOS 10.15, *) - func openURLAsync(_ url: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication + func open(_ url: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication @available(macOS 10.15, *) func open(_ urls: [URL], withApplicationAt applicationURL: URL, configuration: NSWorkspace.OpenConfiguration, completionHandler: ((NSRunningApplication?, Error?) -> Void)? = nil) @available(macOS 10.15, *) - func openURLsAsync(_ urls: [URL], withApplicationAt applicationURL: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication + func open(_ urls: [URL], withApplicationAt applicationURL: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication @available(macOS 10.15, *) func openApplication(at applicationURL: URL, configuration: NSWorkspace.OpenConfiguration, completionHandler: ((NSRunningApplication?, Error?) -> Void)? = nil) @available(macOS 10.15, *) - func openApplicationAsync(at applicationURL: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication + func openApplication(at applicationURL: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication func selectFile(_ fullPath: String?, inFileViewerRootedAtPath rootFullPath: String) -> Bool @available(macOS 10.6, *) func activateFileViewerSelecting(_ fileURLs: [URL]) @@ -32,11 +32,11 @@ class NSWorkspace : NSObject { @available(macOS 10.6, *) func recycle(_ URLs: [URL], completionHandler handler: (([URL : URL], Error?) -> Void)? = nil) @available(macOS 10.6, *) - func recycleURLsAsync(_ URLs: [URL]) async throws -> [URL : URL] + func recycle(_ URLs: [URL]) async throws -> [URL : URL] @available(macOS 10.6, *) func duplicate(_ URLs: [URL], completionHandler handler: (([URL : URL], Error?) -> Void)? = nil) @available(macOS 10.6, *) - func duplicateURLsAsync(_ URLs: [URL]) async throws -> [URL : URL] + func duplicate(_ URLs: [URL]) async throws -> [URL : URL] func getFileSystemInfo(forPath fullPath: String, isRemovable removableFlag: UnsafeMutablePointer?, isWritable writableFlag: UnsafeMutablePointer?, isUnmountable unmountableFlag: UnsafeMutablePointer?, description: AutoreleasingUnsafeMutablePointer?, type fileSystemType: AutoreleasingUnsafeMutablePointer?) -> Bool func unmountAndEjectDevice(atPath path: String) -> Bool @available(macOS 10.6, *) diff --git a/macOS/AuthenticationServices/ASCredentialIdentityStore.swift b/macOS/AuthenticationServices/ASCredentialIdentityStore.swift index f3d10ab..6097700 100644 --- a/macOS/AuthenticationServices/ASCredentialIdentityStore.swift +++ b/macOS/AuthenticationServices/ASCredentialIdentityStore.swift @@ -16,9 +16,9 @@ class ASCredentialIdentityStore : NSObject { func getState(_ completion: @escaping (ASCredentialIdentityStoreState) -> Void) func getState() async -> ASCredentialIdentityStoreState func saveCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity], completion: ((Bool, Error?) -> Void)? = nil) - func saveCredentialIdentitiesAsync(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool + func saveCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool func removeCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity], completion: ((Bool, Error?) -> Void)? = nil) - func removeCredentialIdentitiesAsync(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool + func removeCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity]) async throws -> Bool func removeAllCredentialIdentities(_ completion: ((Bool, Error?) -> Void)? = nil) func removeAllCredentialIdentities() async throws -> Bool func replaceCredentialIdentities(with newCredentialIdentities: [ASPasswordCredentialIdentity], completion: ((Bool, Error?) -> Void)? = nil) diff --git a/macOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift b/macOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift index ea224dc..3f85764 100644 --- a/macOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift +++ b/macOS/AuthenticationServices/ASCredentialProviderExtensionContext.swift @@ -2,6 +2,6 @@ @available(macOS 11.0, *) class ASCredentialProviderExtensionContext : NSExtensionContext { func completeRequest(withSelectedCredential credential: ASPasswordCredential, completionHandler: ((Bool) -> Void)? = nil) - func completeRequestAsync(withSelectedCredential credential: ASPasswordCredential) async -> Bool + func completeRequest(withSelectedCredential credential: ASPasswordCredential) async -> Bool func completeExtensionConfigurationRequest() } diff --git a/macOS/ClassKit/CLSDataStore.swift b/macOS/ClassKit/CLSDataStore.swift index b21b0a9..2b8e711 100644 --- a/macOS/ClassKit/CLSDataStore.swift +++ b/macOS/ClassKit/CLSDataStore.swift @@ -11,7 +11,7 @@ class CLSDataStore : NSObject { var runningActivity: CLSActivity? { get } weak var delegate: @sil_weak CLSDataStoreDelegate? func save(completion: ((Error?) -> Void)? = nil) - func saveAsync() async throws + func save() async throws @available(macOS 11.0, *) func completeAllAssignedActivities(matching contextPath: [String]) } diff --git a/macOS/Collaboration/CBIdentityPicker.swift b/macOS/Collaboration/CBIdentityPicker.swift index 7fab80e..3fc556b 100644 --- a/macOS/Collaboration/CBIdentityPicker.swift +++ b/macOS/Collaboration/CBIdentityPicker.swift @@ -7,6 +7,6 @@ class CBIdentityPicker : NSObject { @available(macOS, introduced: 10.5, deprecated: 10.11, message: "Use runModalForWindow:completionHandler: instead.") func runModal(for window: NSWindow, modalDelegate delegate: Any?, didEnd didEndSelector: Selector?, contextInfo: UnsafeMutableRawPointer?) func runModal(for window: NSWindow, completionHandler: ((NSApplication.ModalResponse) -> Void)? = nil) - func runModalAsync(for window: NSWindow) async -> NSApplication.ModalResponse + func runModal(for window: NSWindow) async -> NSApplication.ModalResponse var identities: [CBIdentity] { get } } diff --git a/macOS/CoreHaptics/CHHapticEngine.swift b/macOS/CoreHaptics/CHHapticEngine.swift index ca65187..52f49b9 100644 --- a/macOS/CoreHaptics/CHHapticEngine.swift +++ b/macOS/CoreHaptics/CHHapticEngine.swift @@ -35,10 +35,10 @@ class CHHapticEngine : NSObject { var isAutoShutdownEnabled: Bool init() throws func start(completionHandler: CHHapticEngine.CompletionHandler? = nil) - func startAsync() async throws + func start() async throws func start() throws func stop(completionHandler: CHHapticEngine.CompletionHandler? = nil) - func stopAsync() async throws + func stop() async throws func notifyWhenPlayersFinished(finishedHandler: @escaping CHHapticEngine.FinishedHandler) func makePlayer(with pattern: CHHapticPattern) throws -> CHHapticPatternPlayer func makeAdvancedPlayer(with pattern: CHHapticPattern) throws -> CHHapticAdvancedPatternPlayer diff --git a/macOS/CoreLocation/CLLocationManager.swift b/macOS/CoreLocation/CLLocationManager.swift index 41e0e77..156334a 100644 --- a/macOS/CoreLocation/CLLocationManager.swift +++ b/macOS/CoreLocation/CLLocationManager.swift @@ -98,7 +98,7 @@ class CLLocationManager : NSObject { @available(macOS 11.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String, completion: ((Error?) -> Void)? = nil) @available(macOS 11.0, *) - func requestTemporaryFullAccuracyAuthorizationAsync(withPurposeKey purposeKey: String) async throws + func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) async throws @available(macOS 11.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) func startUpdatingLocation() diff --git a/macOS/CoreSpotlight/CSSearchableIndex.swift b/macOS/CoreSpotlight/CSSearchableIndex.swift index 5680249..84fef3b 100644 --- a/macOS/CoreSpotlight/CSSearchableIndex.swift +++ b/macOS/CoreSpotlight/CSSearchableIndex.swift @@ -22,18 +22,18 @@ class CSSearchableIndex : NSObject { init(name: String) init(name: String, protectionClass: FileProtectionType?) func indexSearchableItems(_ items: [CSSearchableItem], completionHandler: ((Error?) -> Void)? = nil) - func indexSearchableItemsAsync(_ items: [CSSearchableItem]) async throws + func indexSearchableItems(_ items: [CSSearchableItem]) async throws func deleteSearchableItems(withIdentifiers identifiers: [String], completionHandler: ((Error?) -> Void)? = nil) - func deleteSearchableItemsAsync(withIdentifiers identifiers: [String]) async throws + func deleteSearchableItems(withIdentifiers identifiers: [String]) async throws func deleteSearchableItems(withDomainIdentifiers domainIdentifiers: [String], completionHandler: ((Error?) -> Void)? = nil) - func deleteSearchableItemsAsync(withDomainIdentifiers domainIdentifiers: [String]) async throws + func deleteSearchableItems(withDomainIdentifiers domainIdentifiers: [String]) async throws func deleteAllSearchableItems(completionHandler: ((Error?) -> Void)? = nil) - func deleteAllSearchableItemsAsync() async throws + func deleteAllSearchableItems() async throws } extension CSSearchableIndex { func beginBatch() func endBatch(withClientState clientState: Data, completionHandler: ((Error?) -> Void)? = nil) - func endBatchAsync(withClientState clientState: Data) async throws + func endBatch(withClientState clientState: Data) async throws func fetchLastClientState(completionHandler: @escaping (Data?, Error?) -> Void) func fetchLastClientState() async throws -> Data } diff --git a/macOS/CryptoTokenKit/TKSmartCard.swift b/macOS/CryptoTokenKit/TKSmartCard.swift index ab63f8e..cddabde 100644 --- a/macOS/CryptoTokenKit/TKSmartCard.swift +++ b/macOS/CryptoTokenKit/TKSmartCard.swift @@ -4,6 +4,7 @@ class TKSmartCardSlotManager : NSObject { class var `default`: TKSmartCardSlotManager? { get } var slotNames: [String] { get } func getSlot(withName name: String, reply: @escaping (TKSmartCardSlot?) -> Void) + func getSlot(withName name: String) async -> TKSmartCardSlot? @available(macOS 10.13, *) func slotNamed(_ name: String) -> TKSmartCardSlot? } @@ -91,6 +92,7 @@ class TKSmartCardUserInteraction : NSObject { var initialTimeout: TimeInterval var interactionTimeout: TimeInterval func run(reply: @escaping (Bool, Error?) -> Void) + func run() async throws -> Bool func cancel() -> Bool } @available(macOS 10.11, *) @@ -126,7 +128,9 @@ class TKSmartCard : NSObject { var isSensitive: Bool var context: Any? func beginSession(reply: @escaping (Bool, Error?) -> Void) + func beginSession() async throws -> Bool func transmit(_ request: Data, reply: @escaping (Data?, Error?) -> Void) + func transmit(_ request: Data) async throws -> Data func endSession() @available(macOS 10.11, *) func userInteractionForSecurePINVerification(_ PINFormat: TKSmartCardPINFormat, apdu APDU: Data, pinByteOffset PINByteOffset: Int) -> TKSmartCardUserInteractionForSecurePINVerification? @@ -151,6 +155,8 @@ extension TKSmartCard { var useCommandChaining: Bool @available(macOS 10.10, *) func __sendIns(_ ins: UInt8, p1: UInt8, p2: UInt8, data requestData: Data?, le: NSNumber?, reply: @escaping (Data?, UInt16, Error?) -> Void) + @available(macOS 10.10, *) + func __sendIns(_ ins: UInt8, p1: UInt8, p2: UInt8, data requestData: Data?, le: NSNumber?) async throws -> (Data, UInt16) @available(macOS 10.12, *) func __inSession(executeBlock block: @escaping (NSErrorPointer) -> Bool) throws @available(macOS 10.12, *) diff --git a/macOS/Foundation/NSExtensionContext.swift b/macOS/Foundation/NSExtensionContext.swift index a0a8eb2..c8c8408 100644 --- a/macOS/Foundation/NSExtensionContext.swift +++ b/macOS/Foundation/NSExtensionContext.swift @@ -6,7 +6,7 @@ class NSExtensionContext : NSObject { func completeRequest(returningItems items: [Any]?) async -> Bool func cancelRequest(withError error: Error) func open(_ URL: URL, completionHandler: ((Bool) -> Void)? = nil) - func openURLAsync(_ URL: URL) async -> Bool + func open(_ URL: URL) async -> Bool } @available(macOS 10.10, *) let NSExtensionItemsAndErrorsKey: String diff --git a/macOS/Foundation/NSItemProvider.swift b/macOS/Foundation/NSItemProvider.swift index e7fbba2..5a4b910 100644 --- a/macOS/Foundation/NSItemProvider.swift +++ b/macOS/Foundation/NSItemProvider.swift @@ -77,7 +77,7 @@ class NSItemProvider : NSObject, NSCopying { convenience init?(contentsOf fileURL: URL!) func registerItem(forTypeIdentifier typeIdentifier: String, loadHandler: @escaping NSItemProvider.LoadHandler) func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil, completionHandler: NSItemProvider.CompletionHandler? = nil) - func loadItemAsync(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding + func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding } @available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) @@ -97,7 +97,7 @@ extension NSItemProvider { @available(macOS 10.10, *) func loadPreviewImage(options: [AnyHashable : Any]! = [:], completionHandler: NSItemProvider.CompletionHandler!) @available(macOS 10.10, *) - func loadPreviewImageAsync(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding + func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding } @available(macOS 10.10, *) let NSExtensionJavaScriptPreprocessingResultsKey: String diff --git a/macOS/Foundation/NSUserScriptTask.swift b/macOS/Foundation/NSUserScriptTask.swift index dea2d81..1486d8f 100644 --- a/macOS/Foundation/NSUserScriptTask.swift +++ b/macOS/Foundation/NSUserScriptTask.swift @@ -4,7 +4,7 @@ class NSUserScriptTask : NSObject { init(url: URL) throws var scriptURL: URL { get } func execute(completionHandler handler: NSUserScriptTask.CompletionHandler? = nil) - func executeAsync() async throws + func execute() async throws } extension NSUserScriptTask { typealias CompletionHandler = (Error?) -> Void @@ -15,7 +15,7 @@ class NSUserUnixTask : NSUserScriptTask { var standardOutput: FileHandle? var standardError: FileHandle? func execute(withArguments arguments: [String]?, completionHandler handler: NSUserUnixTask.CompletionHandler? = nil) - func executeAsync(withArguments arguments: [String]?) async throws + func execute(withArguments arguments: [String]?) async throws } extension NSUserUnixTask { typealias CompletionHandler = (Error?) -> Void @@ -23,7 +23,7 @@ extension NSUserUnixTask { @available(macOS 10.8, *) class NSUserAppleScriptTask : NSUserScriptTask { func execute(withAppleEvent event: NSAppleEventDescriptor?, completionHandler handler: NSUserAppleScriptTask.CompletionHandler? = nil) - func executeAsync(withAppleEvent event: NSAppleEventDescriptor?) async throws -> NSAppleEventDescriptor + func execute(withAppleEvent event: NSAppleEventDescriptor?) async throws -> NSAppleEventDescriptor } extension NSUserAppleScriptTask { typealias CompletionHandler = (NSAppleEventDescriptor?, Error?) -> Void @@ -32,7 +32,7 @@ extension NSUserAppleScriptTask { class NSUserAutomatorTask : NSUserScriptTask { var variables: [String : Any]? func execute(withInput input: NSSecureCoding?, completionHandler handler: NSUserAutomatorTask.CompletionHandler? = nil) - func executeAsync(withInput input: NSSecureCoding?) async throws -> Any + func execute(withInput input: NSSecureCoding?) async throws -> Any } extension NSUserAutomatorTask { typealias CompletionHandler = (Any?, Error?) -> Void diff --git a/macOS/GameController/GCController.swift b/macOS/GameController/GCController.swift index adead4a..e483be9 100644 --- a/macOS/GameController/GCController.swift +++ b/macOS/GameController/GCController.swift @@ -44,7 +44,7 @@ class GCController : NSObject, GCDevice { func capture() -> GCController class func controllers() -> [GCController] class func startWirelessControllerDiscovery(completionHandler: (() -> Void)? = nil) - class func startWirelessControllerDiscoveryAsync() async + class func startWirelessControllerDiscovery() async class func stopWirelessControllerDiscovery() @available(macOS 10.15, *) class func withMicroGamepad() -> GCController diff --git a/macOS/GameKit/GKAchievement.swift b/macOS/GameKit/GKAchievement.swift index b38c9a5..ad0ab2a 100644 --- a/macOS/GameKit/GKAchievement.swift +++ b/macOS/GameKit/GKAchievement.swift @@ -2,16 +2,16 @@ @available(macOS 10.8, *) class GKAchievement : NSObject, NSCoding, NSSecureCoding { class func loadAchievements(completionHandler: (([GKAchievement]?, Error?) -> Void)? = nil) - class func loadAchievementsAsync() async throws -> [GKAchievement] + class func loadAchievements() async throws -> [GKAchievement] class func resetAchievements(completionHandler: ((Error?) -> Void)? = nil) - class func resetAchievementsAsync() async throws + class func resetAchievements() async throws init(identifier: String) @available(macOS 10.10, *) init(identifier: String, player: GKPlayer) @available(macOS 10.8, *) class func report(_ achievements: [GKAchievement], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) - class func reportAchievementsAsync(_ achievements: [GKAchievement]) async throws + class func report(_ achievements: [GKAchievement]) async throws var identifier: String var percentComplete: Double var isCompleted: Bool { get } @@ -25,7 +25,7 @@ extension GKAchievement { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use +reportAchievements:withCompletionHandler:") func report(completionHandler: ((Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use +reportAchievements:withCompletionHandler:") - func reportAsync() async throws + func report() async throws @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use isHidden on the GKAchievementDescription class instead") var isHidden: Bool { get } } diff --git a/macOS/GameKit/GKAchievementDescription.swift b/macOS/GameKit/GKAchievementDescription.swift index 4f7ca85..b4ddfd4 100644 --- a/macOS/GameKit/GKAchievementDescription.swift +++ b/macOS/GameKit/GKAchievementDescription.swift @@ -2,7 +2,7 @@ @available(macOS 10.8, *) class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { class func loadAchievementDescriptions(completionHandler: (([GKAchievementDescription]?, Error?) -> Void)? = nil) - class func loadAchievementDescriptionsAsync() async throws -> [GKAchievementDescription] + class func loadAchievementDescriptions() async throws -> [GKAchievementDescription] var identifier: String { get } @available(macOS 10.8, *) var groupIdentifier: String? { get } @@ -18,7 +18,7 @@ extension GKAchievementDescription { @available(macOS 10.8, *) var image: NSImage? { get } func loadImage(completionHandler: ((NSImage?, Error?) -> Void)? = nil) - func loadImageAsync() async throws -> NSImage + func loadImage() async throws -> NSImage class func incompleteAchievementImage() -> NSImage class func placeholderCompletedAchievementImage() -> NSImage } diff --git a/macOS/GameKit/GKChallenge.swift b/macOS/GameKit/GKChallenge.swift index b6857af..eab199e 100644 --- a/macOS/GameKit/GKChallenge.swift +++ b/macOS/GameKit/GKChallenge.swift @@ -10,7 +10,7 @@ enum GKChallengeState : Int { @available(macOS 10.8, *) class GKChallenge : NSObject, NSCoding, NSSecureCoding { class func loadReceivedChallenges(completionHandler: (([GKChallenge]?, Error?) -> Void)? = nil) - class func loadReceivedChallengesAsync() async throws -> [GKChallenge] + class func loadReceivedChallenges() async throws -> [GKChallenge] func decline() @available(macOS 10.10, *) @NSCopying var issuingPlayer: GKPlayer? { get } @@ -39,21 +39,21 @@ extension GKScore { @available(macOS, introduced: 10.10, deprecated: 11.0, message: "pass GKLeaderboardScore to reportLeaderboardScores:withEligibleChallenges:withCompletionHandler instead") class func report(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(macOS, introduced: 10.10, deprecated: 11.0, message: "pass GKLeaderboardScore to reportLeaderboardScores:withEligibleChallenges:withCompletionHandler instead") - class func reportScoresAsync(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge]) async throws + class func report(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge]) async throws @available(macOS 11.0, *) class func report(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(macOS 11.0, *) - class func reportLeaderboardScoresAsync(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge]) async throws + class func report(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge]) async throws } extension GKAchievement { @available(macOS 10.10, *) func selectChallengeablePlayers(_ players: [GKPlayer], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func selectChallengeablePlayersAsync(_ players: [GKPlayer]) async throws -> [GKPlayer] + func selectChallengeablePlayers(_ players: [GKPlayer]) async throws -> [GKPlayer] @available(macOS 10.10, *) class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) - class func reportAchievementsAsync(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge]) async throws + class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge]) async throws } extension GKScore { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, pass GKPlayers to challengeComposeControllerWithMessage:players:completionHandler: and present the view controller instead") @@ -65,7 +65,7 @@ extension GKAchievement { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, pass GKPlayers to selectChallengeablePlayers:") func selectChallengeablePlayerIDs(_ playerIDs: [String]?, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, pass GKPlayers to selectChallengeablePlayers:") - func selectChallengeablePlayerIDsAsync(_ playerIDs: [String]?) async throws -> [String] + func selectChallengeablePlayerIDs(_ playerIDs: [String]?) async throws -> [String] } typealias GKChallengeComposeCompletionBlock = (NSViewController, Bool, [String]?) -> Void extension GKScore { diff --git a/macOS/GameKit/GKLeaderboard.swift b/macOS/GameKit/GKLeaderboard.swift index c8edc9a..3715ae5 100644 --- a/macOS/GameKit/GKLeaderboard.swift +++ b/macOS/GameKit/GKLeaderboard.swift @@ -69,7 +69,7 @@ extension GKLeaderboard { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use setDefaultLeaderboardIdentifier:completionHandler: on GKLocalPlayer instead") class func setDefault(_ leaderboardIdentifier: String?, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use setDefaultLeaderboardIdentifier:completionHandler: on GKLocalPlayer instead") - class func setDefaultAsync(_ leaderboardIdentifier: String?) async throws + class func setDefault(_ leaderboardIdentifier: String?) async throws @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler: instead.") var timeScope: GKLeaderboard.TimeScope @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler: instead.") @@ -91,15 +91,15 @@ extension GKLeaderboard { @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") func loadScores(completionHandler: (([GKScore]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") - func loadScoresAsync() async throws -> [GKScore] + func loadScores() async throws -> [GKScore] @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") class func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 11.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") - class func loadLeaderboardsAsync() async throws -> [GKLeaderboard] + class func loadLeaderboards() async throws -> [GKLeaderboard] } extension GKLeaderboard { @available(macOS 10.8, *) func loadImage(completionHandler: ((NSImage?, Error?) -> Void)? = nil) @available(macOS 10.8, *) - func loadImageAsync() async throws -> NSImage + func loadImage() async throws -> NSImage } diff --git a/macOS/GameKit/GKLeaderboardSet.swift b/macOS/GameKit/GKLeaderboardSet.swift index cfeca99..ab21acf 100644 --- a/macOS/GameKit/GKLeaderboardSet.swift +++ b/macOS/GameKit/GKLeaderboardSet.swift @@ -7,7 +7,7 @@ class GKLeaderboardSet : NSObject, NSCoding, NSSecureCoding { @available(macOS 10.10, *) class func loadLeaderboardSets(completionHandler: (([GKLeaderboardSet]?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - class func loadLeaderboardSetsAsync() async throws -> [GKLeaderboardSet] + class func loadLeaderboardSets() async throws -> [GKLeaderboardSet] @available(macOS 11.0, *) func loadLeaderboards(handler: @escaping ([GKLeaderboard]?, Error?) -> Void) } @@ -15,9 +15,9 @@ extension GKLeaderboardSet { @available(macOS, introduced: 10.10, deprecated: 11.0, message: "Use loadLeaderboardsWithHandler: instead.") func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.10, deprecated: 11.0, message: "Use loadLeaderboardsWithHandler: instead.") - func loadLeaderboardsAsync() async throws -> [GKLeaderboard] + func loadLeaderboards() async throws -> [GKLeaderboard] } extension GKLeaderboardSet { func loadImage(completionHandler: ((NSImage?, Error?) -> Void)? = nil) - func loadImageAsync() async throws -> NSImage + func loadImage() async throws -> NSImage } diff --git a/macOS/GameKit/GKLocalPlayer.swift b/macOS/GameKit/GKLocalPlayer.swift index 4145cc9..723bfde 100644 --- a/macOS/GameKit/GKLocalPlayer.swift +++ b/macOS/GameKit/GKLocalPlayer.swift @@ -13,21 +13,21 @@ class GKLocalPlayer : GKPlayer { @available(macOS 10.11, *) func loadRecentPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(macOS 10.11, *) - func loadRecentPlayersAsync() async throws -> [GKPlayer] + func loadRecentPlayers() async throws -> [GKPlayer] func loadChallengableFriends(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - func loadChallengableFriendsAsync() async throws -> [GKPlayer] + func loadChallengableFriends() async throws -> [GKPlayer] @available(macOS 10.10, *) func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) - func setDefaultLeaderboardIdentifierAsync(_ leaderboardIdentifier: String) async throws + func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String) async throws @available(macOS 10.10, *) func loadDefaultLeaderboardIdentifier(completionHandler: ((String?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func loadDefaultLeaderboardIdentifierAsync() async throws -> String + func loadDefaultLeaderboardIdentifier() async throws -> String @available(macOS 10.15.5, *) func fetchItems(forIdentityVerificationSignature completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(macOS 10.15.5, *) - func fetchItemsForIdentityVerificationSignatureAsync() async throws -> (URL, Data, Data, UInt64) + func fetchItemsForIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) } protocol GKLocalPlayerListener : GKChallengeListener, GKInviteEventListener, GKSavedGameListener, GKTurnBasedEventListener { } @@ -47,25 +47,25 @@ extension GKLocalPlayer { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use setDefaultLeaderboardIdentifier:completionHandler: instead") func setDefaultLeaderboardCategoryID(_ categoryID: String?, completionHandler: ((Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use setDefaultLeaderboardIdentifier:completionHandler: instead") - func setDefaultLeaderboardCategoryIDAsync(_ categoryID: String?) async throws + func setDefaultLeaderboardCategoryID(_ categoryID: String?) async throws @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use loadDefaultLeaderboardIdentifierWithCompletionHandler: instead") func loadDefaultLeaderboardCategoryID(completionHandler: ((String?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use loadDefaultLeaderboardIdentifierWithCompletionHandler: instead") - func loadDefaultLeaderboardCategoryIDAsync() async throws -> String + func loadDefaultLeaderboardCategoryID() async throws -> String @available(macOS, introduced: 10.10, deprecated: 10.11) func loadFriendPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.10, deprecated: 10.11) - func loadFriendPlayersAsync() async throws -> [GKPlayer] + func loadFriendPlayers() async throws -> [GKPlayer] @available(macOS, introduced: 10.10, deprecated: 10.15.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") func generateIdentityVerificationSignature(completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(macOS, introduced: 10.10, deprecated: 10.15.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") - func generateIdentityVerificationSignatureAsync() async throws -> (URL, Data, Data, UInt64) + func generateIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) } extension GKLocalPlayer { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") func loadFriends(completionHandler: (([String]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") - func loadFriendsAsync() async throws -> [String] + func loadFriends() async throws -> [String] @available(macOS, introduced: 10.8, deprecated: 10.10, message: " This property is obsolete, Use loadFriendPlayersWithCompletionHandler: instead") var friends: [String]? { get } } diff --git a/macOS/GameKit/GKMatch.swift b/macOS/GameKit/GKMatch.swift index c4d40e5..cd60221 100644 --- a/macOS/GameKit/GKMatch.swift +++ b/macOS/GameKit/GKMatch.swift @@ -32,7 +32,7 @@ class GKMatch : NSObject { @available(macOS 10.9, *) func rematch(completionHandler: ((GKMatch?, Error?) -> Void)? = nil) @available(macOS 10.9, *) - func rematchAsync() async throws -> GKMatch + func rematch() async throws -> GKMatch } protocol GKMatchDelegate : NSObjectProtocol { @available(macOS 10.10, *) diff --git a/macOS/GameKit/GKMatchmaker.swift b/macOS/GameKit/GKMatchmaker.swift index 5c1b376..8657aa9 100644 --- a/macOS/GameKit/GKMatchmaker.swift +++ b/macOS/GameKit/GKMatchmaker.swift @@ -70,24 +70,24 @@ class GKMatchmaker : NSObject { @available(macOS 10.9, *) func match(for invite: GKInvite, completionHandler: ((GKMatch?, Error?) -> Void)? = nil) @available(macOS 10.9, *) - func matchAsync(for invite: GKInvite) async throws -> GKMatch + func match(for invite: GKInvite) async throws -> GKMatch func findMatch(for request: GKMatchRequest, withCompletionHandler completionHandler: ((GKMatch?, Error?) -> Void)? = nil) - func findMatchAsync(for request: GKMatchRequest) async throws -> GKMatch + func findMatch(for request: GKMatchRequest) async throws -> GKMatch @available(macOS 10.10, *) func findPlayers(forHostedRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func findPlayersAsync(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer] + func findPlayers(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer] func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest, completionHandler: ((Error?) -> Void)? = nil) - func addPlayersAsync(to match: GKMatch, matchRequest: GKMatchRequest) async throws + func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest) async throws func cancel() @available(macOS 10.10, *) func cancelPendingInvite(to player: GKPlayer) @available(macOS 10.9, *) func finishMatchmaking(for match: GKMatch) func queryPlayerGroupActivity(_ playerGroup: Int, withCompletionHandler completionHandler: ((Int, Error?) -> Void)? = nil) - func queryPlayerGroupActivityAsync(_ playerGroup: Int) async throws -> Int + func queryPlayerGroupActivity(_ playerGroup: Int) async throws -> Int func queryActivity(completionHandler: ((Int, Error?) -> Void)? = nil) - func queryActivityAsync() async throws -> Int + func queryActivity() async throws -> Int @available(macOS 10.10, *) func startBrowsingForNearbyPlayers(handler reachableHandler: ((GKPlayer, Bool) -> Void)? = nil) @available(macOS 10.9, *) @@ -105,5 +105,5 @@ extension GKMatchmaker { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") func findPlayers(forHostedMatchRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") - func findPlayersAsync(forHostedMatchRequest request: GKMatchRequest) async throws -> [String] + func findPlayers(forHostedMatchRequest request: GKMatchRequest) async throws -> [String] } diff --git a/macOS/GameKit/GKNotificationBanner.swift b/macOS/GameKit/GKNotificationBanner.swift index c050717..5372f83 100644 --- a/macOS/GameKit/GKNotificationBanner.swift +++ b/macOS/GameKit/GKNotificationBanner.swift @@ -4,9 +4,9 @@ class GKNotificationBanner : NSObject { @available(macOS 10.8, *) class func show(withTitle title: String?, message: String?, completionHandler: (() -> Void)? = nil) @available(macOS 10.8, *) - class func showAsync(withTitle title: String?, message: String?) async + class func show(withTitle title: String?, message: String?) async @available(macOS 10.8, *) class func show(withTitle title: String?, message: String?, duration: TimeInterval, completionHandler: (() -> Void)? = nil) @available(macOS 10.8, *) - class func showAsync(withTitle title: String?, message: String?, duration: TimeInterval) async + class func show(withTitle title: String?, message: String?, duration: TimeInterval) async } diff --git a/macOS/GameKit/GKPlayer.swift b/macOS/GameKit/GKPlayer.swift index 792f5e3..6aa9b2a 100644 --- a/macOS/GameKit/GKPlayer.swift +++ b/macOS/GameKit/GKPlayer.swift @@ -4,7 +4,7 @@ let GKPlayerIDNoLongerAvailable: String @available(macOS 10.8, *) class GKPlayer : GKBasePlayer { class func loadPlayers(forIdentifiers identifiers: [String], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - class func loadPlayersAsync(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] + class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] @available(macOS 10.15, *) func scopedIDsArePersistent() -> Bool @available(macOS 10.14.6, *) @@ -23,7 +23,7 @@ extension GKPlayer { @available(macOS 10.8, *) func loadPhoto(for size: GKPlayer.PhotoSize, withCompletionHandler completionHandler: ((NSImage?, Error?) -> Void)? = nil) @available(macOS 10.8, *) - func loadPhotoAsync(for size: GKPlayer.PhotoSize) async throws -> NSImage + func loadPhoto(for size: GKPlayer.PhotoSize) async throws -> NSImage } extension GKPlayer { enum PhotoSize : Int { diff --git a/macOS/GameKit/GKSavedGame.swift b/macOS/GameKit/GKSavedGame.swift index 430b9f4..c8a723d 100644 --- a/macOS/GameKit/GKSavedGame.swift +++ b/macOS/GameKit/GKSavedGame.swift @@ -10,23 +10,23 @@ class GKSavedGame : NSObject, NSCopying { @available(macOS 10.10, *) func loadData(completionHandler handler: ((Data?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func loadDataAsync() async throws -> Data + func loadData() async throws -> Data } extension GKLocalPlayer : GKSavedGameListener { @available(macOS 10.10, *) func fetchSavedGames(completionHandler handler: (([GKSavedGame]?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func fetchSavedGamesAsync() async throws -> [GKSavedGame] + func fetchSavedGames() async throws -> [GKSavedGame] @available(macOS 10.10, *) func saveGameData(_ data: Data, withName name: String, completionHandler handler: ((GKSavedGame?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func saveGameDataAsync(_ data: Data, withName name: String) async throws -> GKSavedGame + func saveGameData(_ data: Data, withName name: String) async throws -> GKSavedGame @available(macOS 10.10, *) func deleteSavedGames(withName name: String, completionHandler handler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) - func deleteSavedGamesAsync(withName name: String) async throws + func deleteSavedGames(withName name: String) async throws @available(macOS 10.10, *) func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data, completionHandler handler: (([GKSavedGame]?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func resolveConflictingSavedGamesAsync(_ conflictingSavedGames: [GKSavedGame], with data: Data) async throws -> [GKSavedGame] + func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data) async throws -> [GKSavedGame] } diff --git a/macOS/GameKit/GKScore.swift b/macOS/GameKit/GKScore.swift index 18af49e..f39100b 100644 --- a/macOS/GameKit/GKScore.swift +++ b/macOS/GameKit/GKScore.swift @@ -19,13 +19,13 @@ class GKScore : NSObject, NSCoding, NSSecureCoding { @available(macOS 10.8, *) class func report(_ scores: [GKScore], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) - class func reportScoresAsync(_ scores: [GKScore]) async throws + class func report(_ scores: [GKScore]) async throws } extension GKScore { @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use +reportScores:withCompletionhandler: instead") func report(completionHandler: ((Error?) -> Void)? = nil) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use +reportScores:withCompletionhandler: instead") - func reportAsync() async throws + func report() async throws @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use initWithLeaderboardIdentifier: instead") init(category: String?) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use leaderboardIdentifier instead") diff --git a/macOS/GameKit/GKTurnBasedMatch.swift b/macOS/GameKit/GKTurnBasedMatch.swift index ac932c7..e0beb94 100644 --- a/macOS/GameKit/GKTurnBasedMatch.swift +++ b/macOS/GameKit/GKTurnBasedMatch.swift @@ -96,43 +96,43 @@ class GKTurnBasedMatch : NSObject { class func find(for request: GKMatchRequest, withCompletionHandler completionHandler: @escaping (GKTurnBasedMatch?, Error?) -> Void) class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch class func loadMatches(completionHandler: (([GKTurnBasedMatch]?, Error?) -> Void)? = nil) - class func loadMatchesAsync() async throws -> [GKTurnBasedMatch] + class func loadMatches() async throws -> [GKTurnBasedMatch] @available(macOS 10.8, *) class func load(withID matchID: String, withCompletionHandler completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(macOS 10.8, *) - class func loadAsync(withID matchID: String) async throws -> GKTurnBasedMatch + class func load(withID matchID: String) async throws -> GKTurnBasedMatch @available(macOS 10.9, *) func rematch(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(macOS 10.9, *) - func rematchAsync() async throws -> GKTurnBasedMatch + func rematch() async throws -> GKTurnBasedMatch @available(macOS 10.8, *) func acceptInvite(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(macOS 10.8, *) - func acceptInviteAsync() async throws -> GKTurnBasedMatch + func acceptInvite() async throws -> GKTurnBasedMatch @available(macOS 10.8, *) func declineInvite(completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) - func declineInviteAsync() async throws + func declineInvite() async throws func remove(completionHandler: ((Error?) -> Void)? = nil) - func removeAsync() async throws + func remove() async throws func loadMatchData(completionHandler: ((Data?, Error?) -> Void)? = nil) - func loadMatchDataAsync() async throws -> Data + func loadMatchData() async throws -> Data @available(macOS 10.9, *) func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.9, *) - func endTurnAsync(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws @available(macOS 10.9, *) func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.9, *) - func participantQuitInTurnAsync(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) - func participantQuitOutOfTurnAsync(with matchOutcome: GKTurnBasedMatch.Outcome) async throws + func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome) async throws func endMatchInTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) - func endMatchInTurnAsync(withMatch matchData: Data) async throws + func endMatchInTurn(withMatch matchData: Data) async throws @available(macOS, introduced: 10.10, deprecated: 11.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?, completionHandler: ((Error?) -> Void)? = nil) @available(macOS, introduced: 10.10, deprecated: 11.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") - func endMatchInTurnAsync(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws + func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws @available(macOS 11.0, *) func endMatchInTurn(withMatch matchData: Data, leaderboardScores scores: [GKLeaderboardScore], achievements: [Any], completionHandler: @escaping (Error?) -> Void) @available(macOS 11.0, *) @@ -140,19 +140,19 @@ class GKTurnBasedMatch : NSObject { @available(macOS 10.8, *) func saveCurrentTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.8, *) - func saveCurrentTurnAsync(withMatch matchData: Data) async throws + func saveCurrentTurn(withMatch matchData: Data) async throws @available(macOS 10.10, *) func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange], completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) - func saveMergedMatchDataAsync(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws + func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws @available(macOS 10.10, *) func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval, completionHandler: ((GKTurnBasedExchange?, Error?) -> Void)? = nil) @available(macOS 10.10, *) - func sendExchangeAsync(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange + func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange @available(macOS 10.10, *) func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) - func sendReminderAsync(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws + func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws } @available(macOS 10.10, *) enum GKTurnBasedExchangeStatus : Int8 { @@ -183,11 +183,11 @@ class GKTurnBasedExchange : NSObject { @available(macOS 10.10, *) func cancel(withLocalizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) - func cancelAsync(withLocalizableMessageKey key: String, arguments: [String]) async throws + func cancel(withLocalizableMessageKey key: String, arguments: [String]) async throws @available(macOS 10.10, *) func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.10, *) - func replyAsync(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws + func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws } @available(macOS 10.10, *) class GKTurnBasedExchangeReply : NSObject { diff --git a/macOS/IOUSBHost/IOUSBHostObject.swift b/macOS/IOUSBHost/IOUSBHostObject.swift index c186b6c..e7e8338 100644 --- a/macOS/IOUSBHost/IOUSBHostObject.swift +++ b/macOS/IOUSBHost/IOUSBHostObject.swift @@ -6,7 +6,7 @@ class IOUSBHostObject : NSObject { var queue: DispatchQueue { get } func __send(_ request: IOUSBDeviceRequest, data: NSMutableData?, bytesTransferred: UnsafeMutablePointer?, completionTimeout: TimeInterval) throws func __enqueue(_ request: IOUSBDeviceRequest, data: NSMutableData?, completionTimeout: TimeInterval, completionHandler: IOUSBHostCompletionHandler? = nil) throws - func __enqueueDeviceRequestAsync(_ request: IOUSBDeviceRequest, data: NSMutableData?, completionTimeout: TimeInterval) async throws -> (IOReturn, Int) + func __enqueue(_ request: IOUSBDeviceRequest, data: NSMutableData?, completionTimeout: TimeInterval) async throws -> (IOReturn, Int) func __abortDeviceRequests(with option: IOUSBHostAbortOption) throws func __descriptor(with type: tIOUSBDescriptorType, length: UnsafeMutablePointer, index: Int, languageID: Int, requestType: tIOUSBDeviceRequestTypeValue, requestRecipient: tIOUSBDeviceRequestRecipientValue) throws -> UnsafePointer func __string(with index: Int, languageID: Int) throws -> String diff --git a/macOS/IOUSBHost/IOUSBHostPipe.swift b/macOS/IOUSBHost/IOUSBHostPipe.swift index dc52f61..3116484 100644 --- a/macOS/IOUSBHost/IOUSBHostPipe.swift +++ b/macOS/IOUSBHost/IOUSBHostPipe.swift @@ -8,14 +8,14 @@ class IOUSBHostPipe : IOUSBHostIOSource { func clearStall() throws func __sendControlRequest(_ request: IOUSBDeviceRequest, data: NSMutableData?, bytesTransferred: UnsafeMutablePointer?, completionTimeout: TimeInterval) throws func __enqueueControlRequest(_ request: IOUSBDeviceRequest, data: NSMutableData?, completionTimeout: TimeInterval, completionHandler: IOUSBHostCompletionHandler? = nil) throws - func __enqueueControlRequestAsync(_ request: IOUSBDeviceRequest, data: NSMutableData?, completionTimeout: TimeInterval) async throws -> (IOReturn, Int) + func __enqueueControlRequest(_ request: IOUSBDeviceRequest, data: NSMutableData?, completionTimeout: TimeInterval) async throws -> (IOReturn, Int) func __abort(with option: IOUSBHostAbortOption) throws func __sendIORequest(with data: NSMutableData?, bytesTransferred: UnsafeMutablePointer?, completionTimeout: TimeInterval) throws func enqueueIORequest(with data: NSMutableData?, completionTimeout: TimeInterval, completionHandler: IOUSBHostCompletionHandler? = nil) throws - func enqueueIORequestAsync(with data: NSMutableData?, completionTimeout: TimeInterval) async throws -> (IOReturn, Int) + func enqueueIORequest(with data: NSMutableData?, completionTimeout: TimeInterval) async throws -> (IOReturn, Int) func sendIORequest(with data: NSMutableData, frameList: UnsafeMutablePointer, frameListCount: Int, firstFrameNumber: UInt64) throws func enqueueIORequest(with data: NSMutableData, frameList: UnsafeMutablePointer, frameListCount: Int, firstFrameNumber: UInt64, completionHandler: IOUSBHostIsochronousCompletionHandler? = nil) throws - func enqueueIORequestAsync(with data: NSMutableData, frameList: UnsafeMutablePointer, frameListCount: Int, firstFrameNumber: UInt64) async throws -> (IOReturn, UnsafeMutablePointer) + func enqueueIORequest(with data: NSMutableData, frameList: UnsafeMutablePointer, frameListCount: Int, firstFrameNumber: UInt64) async throws -> (IOReturn, UnsafeMutablePointer) func enableStreams() throws func disableStreams() throws func copyStream(withStreamID streamID: Int) throws -> IOUSBHostStream diff --git a/macOS/IOUSBHost/IOUSBHostStream.swift b/macOS/IOUSBHost/IOUSBHostStream.swift index 8f82276..2411f53 100644 --- a/macOS/IOUSBHost/IOUSBHostStream.swift +++ b/macOS/IOUSBHost/IOUSBHostStream.swift @@ -6,5 +6,5 @@ class IOUSBHostStream : IOUSBHostIOSource { func abort() throws func __sendIORequest(with data: NSMutableData?, bytesTransferred: UnsafeMutablePointer?) throws func enqueueIORequest(with data: NSMutableData?, completionHandler: IOUSBHostCompletionHandler? = nil) throws - func enqueueIORequestAsync(with data: NSMutableData?) async throws -> (IOReturn, Int) + func enqueueIORequest(with data: NSMutableData?) async throws -> (IOReturn, Int) } diff --git a/macOS/ImageCaptureCore/ICDevice.swift b/macOS/ImageCaptureCore/ICDevice.swift index c017035..8b99ea2 100644 --- a/macOS/ImageCaptureCore/ICDevice.swift +++ b/macOS/ImageCaptureCore/ICDevice.swift @@ -152,7 +152,7 @@ class ICDevice : NSObject { @available(macOS 10.15, *) func requestEject(completion: @escaping (Error?) -> Void) @available(macOS 10.15, *) - func requestEjectAsync() async throws + func requestEject() async throws @available(macOS 10.4, *) var autolaunchApplicationPath: String? @available(macOS 10.4, *) diff --git a/macOS/LocalAuthentication/LAContext.swift b/macOS/LocalAuthentication/LAContext.swift index 2360c75..2b92467 100644 --- a/macOS/LocalAuthentication/LAContext.swift +++ b/macOS/LocalAuthentication/LAContext.swift @@ -20,6 +20,8 @@ class LAContext : NSObject { func canEvaluatePolicy(_ policy: LAPolicy, error: NSErrorPointer) -> Bool @available(macOS 10.10, *) func evaluatePolicy(_ policy: LAPolicy, localizedReason: String, reply: @escaping (Bool, Error?) -> Void) + @available(macOS 10.10, *) + func evaluatePolicy(_ policy: LAPolicy, localizedReason: String) async throws -> Bool @available(macOS 10.11, *) func invalidate() @available(macOS 10.11, *) @@ -28,6 +30,8 @@ class LAContext : NSObject { func isCredentialSet(_ type: LACredentialType) -> Bool @available(macOS 10.11, *) func evaluateAccessControl(_ accessControl: SecAccessControl, operation: LAAccessControlOperation, localizedReason: String, reply: @escaping (Bool, Error?) -> Void) + @available(macOS 10.11, *) + func evaluateAccessControl(_ accessControl: SecAccessControl, operation: LAAccessControlOperation, localizedReason: String) async throws -> Bool @available(macOS 10.10, *) var localizedFallbackTitle: String? @available(macOS 10.12, *) diff --git a/macOS/MetalPerformanceShaders/MetalPerformanceShaders.swift b/macOS/MetalPerformanceShaders/MetalPerformanceShaders.swift index f3cbb12..721e70e 100644 --- a/macOS/MetalPerformanceShaders/MetalPerformanceShaders.swift +++ b/macOS/MetalPerformanceShaders/MetalPerformanceShaders.swift @@ -3732,7 +3732,7 @@ class MPSAccelerationStructure : MPSKernel, NSSecureCoding, NSCopying { init?(coder aDecoder: NSCoder, group: MPSAccelerationStructureGroup) func rebuild() func rebuild(completionHandler: @escaping MPSAccelerationStructureCompletionHandler) - func rebuildAsync() async -> MPSAccelerationStructure? + func rebuild() async -> MPSAccelerationStructure? func encodeRefit(commandBuffer: MTLCommandBuffer) func copy(with zone: NSZone? = nil, group: MPSAccelerationStructureGroup) -> Self } diff --git a/macOS/NetworkExtension/NetworkExtension.swift b/macOS/NetworkExtension/NetworkExtension.swift index 3da8375..b1e8381 100644 --- a/macOS/NetworkExtension/NetworkExtension.swift +++ b/macOS/NetworkExtension/NetworkExtension.swift @@ -108,11 +108,11 @@ class NETunnelProvider : NEProvider { @available(macOS 10.11, *) func handleAppMessage(_ messageData: Data, completionHandler: ((Data?) -> Void)? = nil) @available(macOS 10.11, *) - func handleAppMessageAsync(_ messageData: Data) async -> Data? + func handleAppMessage(_ messageData: Data) async -> Data? @available(macOS 10.11, *) func setTunnelNetworkSettings(_ tunnelNetworkSettings: NETunnelNetworkSettings?, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.11, *) - func setTunnelNetworkSettingsAsync(_ tunnelNetworkSettings: NETunnelNetworkSettings?) async throws + func setTunnelNetworkSettings(_ tunnelNetworkSettings: NETunnelNetworkSettings?) async throws @available(macOS 10.11, *) var protocolConfiguration: NEVPNProtocol { get } @available(macOS 10.11, *) @@ -176,11 +176,11 @@ class NEVPNManager : NSObject { @available(macOS 10.11, *) func removeFromPreferences(completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.11, *) - func removeFromPreferencesAsync() async throws + func removeFromPreferences() async throws @available(macOS 10.11, *) func saveToPreferences(completionHandler: ((Error?) -> Void)? = nil) @available(macOS 10.11, *) - func saveToPreferencesAsync() async throws + func saveToPreferences() async throws @available(macOS 10.11, *) func setAuthorization(_ authorization: AuthorizationRef) @available(macOS 10.11, *) diff --git a/macOS/PassKit/PKPassLibrary.swift b/macOS/PassKit/PKPassLibrary.swift index 0f11764..96f3d24 100644 --- a/macOS/PassKit/PKPassLibrary.swift +++ b/macOS/PassKit/PKPassLibrary.swift @@ -40,7 +40,7 @@ class PKPassLibrary : NSObject { @available(macOS 10.12, *) func addPasses(_ passes: [PKPass], withCompletionHandler completion: ((PKPassLibraryAddPassesStatus) -> Void)? = nil) @available(macOS 10.12, *) - func addPassesAsync(_ passes: [PKPass]) async -> PKPassLibraryAddPassesStatus + func addPasses(_ passes: [PKPass]) async -> PKPassLibraryAddPassesStatus @available(macOS 10.12, *) func openPaymentSetup() func present(_ pass: PKPaymentPass) @@ -49,9 +49,9 @@ class PKPassLibrary : NSObject { func canAddSecureElementPass(primaryAccountIdentifier: String) -> Bool func canAddFelicaPass() -> Bool func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data, completion: ((Bool, Error) -> Void)? = nil) - func activatePaymentPassAsync(_ paymentPass: PKPaymentPass, withActivationData activationData: Data) async -> (Bool, Error) + func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data) async -> (Bool, Error) func activate(_ paymentPass: PKPaymentPass, withActivationCode activationCode: String, completion: ((Bool, Error) -> Void)? = nil) - func activatePaymentPassAsync(_ paymentPass: PKPaymentPass, withActivationCode activationCode: String) async -> (Bool, Error) + func activate(_ paymentPass: PKPaymentPass, withActivationCode activationCode: String) async -> (Bool, Error) func activate(_ secureElementPass: PKSecureElementPass, activationData: Data, completion: ((Bool, Error?) -> Void)? = nil) func activate(_ secureElementPass: PKSecureElementPass, activationData: Data) async throws -> Bool func sign(_ signData: Data, using secureElementPass: PKSecureElementPass, completion: @escaping (Data?, Data?, Error?) -> Void) diff --git a/macOS/PassKit/PKPaymentAuthorizationController.swift b/macOS/PassKit/PKPaymentAuthorizationController.swift index f204385..53b4039 100644 --- a/macOS/PassKit/PKPaymentAuthorizationController.swift +++ b/macOS/PassKit/PKPaymentAuthorizationController.swift @@ -49,7 +49,7 @@ class PKPaymentAuthorizationController : NSObject { weak var delegate: @sil_weak PKPaymentAuthorizationControllerDelegate? init(paymentRequest request: PKPaymentRequest) func present(completion: ((Bool) -> Void)? = nil) - func presentAsync() async -> Bool + func present() async -> Bool func dismiss(completion: (() -> Void)? = nil) - func dismissAsync() async + func dismiss() async } diff --git a/macOS/Photos/PHPhotoLibrary.swift b/macOS/Photos/PHPhotoLibrary.swift index af6351d..209490f 100644 --- a/macOS/Photos/PHPhotoLibrary.swift +++ b/macOS/Photos/PHPhotoLibrary.swift @@ -54,7 +54,7 @@ class PHPhotoLibrary : NSObject { @available(macOS 10.13, *) func performChanges(_ changeBlock: @escaping () -> Void, completionHandler: ((Bool, Error?) -> Void)? = nil) @available(macOS 10.13, *) - func performChangesAsync(_ changeBlock: @escaping () -> Void) async throws -> Bool + func performChanges(_ changeBlock: @escaping () -> Void) async throws -> Bool @available(macOS 10.13, *) func performChangesAndWait(_ changeBlock: @escaping () -> Void) throws @available(macOS 10.13, *) diff --git a/macOS/ReplayKit/RPScreenRecorder.swift b/macOS/ReplayKit/RPScreenRecorder.swift index f6f9070..fa601ca 100644 --- a/macOS/ReplayKit/RPScreenRecorder.swift +++ b/macOS/ReplayKit/RPScreenRecorder.swift @@ -18,7 +18,7 @@ class RPScreenRecorder : NSObject { @available(macOS 11.0, *) func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 11.0, *) - func startCaptureAsync(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?) async throws + func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?) async throws @available(macOS 11.0, *) func stopCapture(handler: ((Error?) -> Void)? = nil) weak var delegate: @sil_weak RPScreenRecorderDelegate? diff --git a/macOS/SafariServices/SFContentBlockerManager.swift b/macOS/SafariServices/SFContentBlockerManager.swift index 924e302..0bb2c87 100644 --- a/macOS/SafariServices/SFContentBlockerManager.swift +++ b/macOS/SafariServices/SFContentBlockerManager.swift @@ -1,7 +1,7 @@ class SFContentBlockerManager : NSObject { class func reloadContentBlocker(withIdentifier identifier: String, completionHandler: ((Error?) -> Void)? = nil) - class func reloadContentBlockerAsync(withIdentifier identifier: String) async throws + class func reloadContentBlocker(withIdentifier identifier: String) async throws class func getStateOfContentBlocker(withIdentifier identifier: String, completionHandler: @escaping (SFContentBlockerState?, Error?) -> Void) class func stateOfContentBlocker(withIdentifier identifier: String) async throws -> SFContentBlockerState } diff --git a/macOS/SafariServices/SFSafariApplication.swift b/macOS/SafariServices/SFSafariApplication.swift index a66046d..ad6840a 100644 --- a/macOS/SafariServices/SFSafariApplication.swift +++ b/macOS/SafariServices/SFSafariApplication.swift @@ -6,12 +6,12 @@ class SFSafariApplication : NSObject { class func getAllWindows(completionHandler: @escaping ([SFSafariWindow]) -> Void) class func allWindows() async -> [SFSafariWindow] class func openWindow(with url: URL, completionHandler: ((SFSafariWindow?) -> Void)? = nil) - class func openWindowAsync(with url: URL) async -> SFSafariWindow? + class func openWindow(with url: URL) async -> SFSafariWindow? class func setToolbarItemsNeedUpdate() class func getHostApplication(completionHandler: @escaping (NSRunningApplication) -> Void) class func hostApplication() async -> NSRunningApplication class func showPreferencesForExtension(withIdentifier identifier: String, completionHandler: ((Error?) -> Void)? = nil) - class func showPreferencesForExtensionAsync(withIdentifier identifier: String) async throws + class func showPreferencesForExtension(withIdentifier identifier: String) async throws class func dispatchMessage(withName messageName: String, toExtensionWithIdentifier identifier: String, userInfo: [String : Any]? = nil, completionHandler: ((Error?) -> Void)? = nil) - class func dispatchMessageAsync(withName messageName: String, toExtensionWithIdentifier identifier: String, userInfo: [String : Any]? = nil) async throws + class func dispatchMessage(withName messageName: String, toExtensionWithIdentifier identifier: String, userInfo: [String : Any]? = nil) async throws } diff --git a/macOS/SafariServices/SFSafariTab.swift b/macOS/SafariServices/SFSafariTab.swift index 4555549..c280440 100644 --- a/macOS/SafariServices/SFSafariTab.swift +++ b/macOS/SafariServices/SFSafariTab.swift @@ -7,7 +7,7 @@ class SFSafariTab : NSObject, NSCopying, NSSecureCoding { func getContainingWindow(completionHandler: @escaping (SFSafariWindow?) -> Void) func containingWindow() async -> SFSafariWindow? func activate(completionHandler: (() -> Void)? = nil) - func activateAsync() async + func activate() async func navigate(to url: URL) func close() } diff --git a/macOS/SafariServices/SFSafariWindow.swift b/macOS/SafariServices/SFSafariWindow.swift index e3aedc9..f4a868a 100644 --- a/macOS/SafariServices/SFSafariWindow.swift +++ b/macOS/SafariServices/SFSafariWindow.swift @@ -5,7 +5,7 @@ class SFSafariWindow : NSObject, NSCopying, NSSecureCoding { func getAllTabs(completionHandler: @escaping ([SFSafariTab]) -> Void) func allTabs() async -> [SFSafariTab] func openTab(with url: URL, makeActiveIfPossible activateTab: Bool, completionHandler: ((SFSafariTab?) -> Void)? = nil) - func openTabAsync(with url: URL, makeActiveIfPossible activateTab: Bool) async -> SFSafariTab? + func openTab(with url: URL, makeActiveIfPossible activateTab: Bool) async -> SFSafariTab? func getToolbarItem(completionHandler: @escaping (SFSafariToolbarItem?) -> Void) func toolbarItem() async -> SFSafariToolbarItem? func close() diff --git a/macOS/SoundAnalysis/SNAnalyzer.swift b/macOS/SoundAnalysis/SNAnalyzer.swift index 82822c0..7a6bb6f 100644 --- a/macOS/SoundAnalysis/SNAnalyzer.swift +++ b/macOS/SoundAnalysis/SNAnalyzer.swift @@ -16,6 +16,6 @@ class SNAudioFileAnalyzer : NSObject { func removeAllRequests() func analyze() func analyze(completionHandler: @escaping (Bool) -> Void) - func analyzeAsync() async -> Bool + func analyze() async -> Bool func cancelAnalysis() } diff --git a/macOS/SpriteKit/SKNode.swift b/macOS/SpriteKit/SKNode.swift index 6259ab7..f94255b 100644 --- a/macOS/SpriteKit/SKNode.swift +++ b/macOS/SpriteKit/SKNode.swift @@ -56,7 +56,7 @@ class SKNode : NSResponder, NSCopying, NSSecureCoding { func inParentHierarchy(_ parent: SKNode) -> Bool func run(_ action: SKAction) func run(_ action: SKAction, completion block: @escaping () -> Void) - func runActionAsync(_ action: SKAction) async + func run(_ action: SKAction) async func run(_ action: SKAction, withKey key: String) func hasActions() -> Bool func action(forKey key: String) -> SKAction? diff --git a/macOS/StoreKit/SKProductStorePromotionController.swift b/macOS/StoreKit/SKProductStorePromotionController.swift index b46342e..82ae6d9 100644 --- a/macOS/StoreKit/SKProductStorePromotionController.swift +++ b/macOS/StoreKit/SKProductStorePromotionController.swift @@ -14,7 +14,7 @@ class SKProductStorePromotionController : NSObject { @available(macOS 11.0, *) func fetchStorePromotionVisibility(for product: SKProduct, completionHandler: ((SKProductStorePromotionVisibility, Error?) -> Void)? = nil) @available(macOS 11.0, *) - func fetchStorePromotionVisibilityAsync(for product: SKProduct) async throws -> SKProductStorePromotionVisibility + func fetchStorePromotionVisibility(for product: SKProduct) async throws -> SKProductStorePromotionVisibility @available(macOS 11.0, *) func update(storePromotionVisibility promotionVisibility: SKProductStorePromotionVisibility, for product: SKProduct, completionHandler: ((Error?) -> Void)? = nil) @available(macOS 11.0, *) @@ -22,7 +22,7 @@ class SKProductStorePromotionController : NSObject { @available(macOS 11.0, *) func fetchStorePromotionOrder(completionHandler: (([SKProduct], Error?) -> Void)? = nil) @available(macOS 11.0, *) - func fetchStorePromotionOrderAsync() async throws -> [SKProduct] + func fetchStorePromotionOrder() async throws -> [SKProduct] @available(macOS 11.0, *) func update(storePromotionOrder: [SKProduct], completionHandler: ((Error?) -> Void)? = nil) @available(macOS 11.0, *) diff --git a/macOS/StoreKit/SKStoreProductViewController.swift b/macOS/StoreKit/SKStoreProductViewController.swift index f5ee348..b35b777 100644 --- a/macOS/StoreKit/SKStoreProductViewController.swift +++ b/macOS/StoreKit/SKStoreProductViewController.swift @@ -5,6 +5,8 @@ class SKStoreProductViewController : NSViewController { weak var delegate: @sil_weak SKStoreProductViewControllerDelegate? @available(macOS 11.0, *) func loadProduct(withParameters parameters: [String : Any], completionBlock block: ((Bool, Error?) -> Void)? = nil) + @available(macOS 11.0, *) + func loadProduct(withParameters parameters: [String : Any]) async throws -> Bool } protocol SKStoreProductViewControllerDelegate : NSObjectProtocol { @available(macOS 11.0, *) diff --git a/macOS/UserNotifications/UNUserNotificationCenter.swift b/macOS/UserNotifications/UNUserNotificationCenter.swift index 00b5ed9..04fd6cd 100644 --- a/macOS/UserNotifications/UNUserNotificationCenter.swift +++ b/macOS/UserNotifications/UNUserNotificationCenter.swift @@ -27,7 +27,7 @@ class UNUserNotificationCenter : NSObject { func getNotificationSettings(completionHandler: @escaping (UNNotificationSettings) -> Void) func notificationSettings() async -> UNNotificationSettings func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) - func addNotificationRequestAsync(_ request: UNNotificationRequest) async throws + func add(_ request: UNNotificationRequest) async throws func getPendingNotificationRequests(completionHandler: @escaping ([UNNotificationRequest]) -> Void) func pendingNotificationRequests() async -> [UNNotificationRequest] func removePendingNotificationRequests(withIdentifiers identifiers: [String]) diff --git a/macOS/WebKit/WKContentRuleListStore.swift b/macOS/WebKit/WKContentRuleListStore.swift index e4519c6..a686971 100644 --- a/macOS/WebKit/WKContentRuleListStore.swift +++ b/macOS/WebKit/WKContentRuleListStore.swift @@ -4,9 +4,9 @@ class WKContentRuleListStore : NSObject { class func `default`() -> Self! convenience init!(url: URL!) func compileContentRuleList(forIdentifier identifier: String!, encodedContentRuleList: String!, completionHandler: ((WKContentRuleList?, Error?) -> Void)!) - func compileContentRuleList(forIdentifier identifier: String!, encodedContentRuleList: String!) async throws -> WKContentRuleList + func compileContentRuleList(forIdentifier identifier: String!, encodedContentRuleList: String!) async throws -> WKContentRuleList? func lookUpContentRuleList(forIdentifier identifier: String!, completionHandler: ((WKContentRuleList?, Error?) -> Void)!) - func lookUpContentRuleList(forIdentifier identifier: String!) async throws -> WKContentRuleList + func lookUpContentRuleList(forIdentifier identifier: String!) async throws -> WKContentRuleList? func removeContentRuleList(forIdentifier identifier: String!, completionHandler: ((Error?) -> Void)!) func removeContentRuleList(forIdentifier identifier: String!) async throws func getAvailableContentRuleListIdentifiers(_ completionHandler: (([String]?) -> Void)!) diff --git a/macOS/WebKit/WKHTTPCookieStore.swift b/macOS/WebKit/WKHTTPCookieStore.swift index 5b0ab64..a55bef9 100644 --- a/macOS/WebKit/WKHTTPCookieStore.swift +++ b/macOS/WebKit/WKHTTPCookieStore.swift @@ -8,9 +8,9 @@ class WKHTTPCookieStore : NSObject { func getAllCookies(_ completionHandler: @escaping ([HTTPCookie]) -> Void) func allCookies() async -> [HTTPCookie] func setCookie(_ cookie: HTTPCookie, completionHandler: (() -> Void)? = nil) - func setCookieAsync(_ cookie: HTTPCookie) async + func setCookie(_ cookie: HTTPCookie) async func delete(_ cookie: HTTPCookie, completionHandler: (() -> Void)? = nil) - func deleteCookieAsync(_ cookie: HTTPCookie) async + func delete(_ cookie: HTTPCookie) async func add(_ observer: WKHTTPCookieStoreObserver) func remove(_ observer: WKHTTPCookieStoreObserver) } diff --git a/macOS/WebKit/WKWebView.swift b/macOS/WebKit/WKWebView.swift index 03610ff..a2e4039 100644 --- a/macOS/WebKit/WKWebView.swift +++ b/macOS/WebKit/WKWebView.swift @@ -28,15 +28,15 @@ class WKWebView : NSView { func reloadFromOrigin() -> WKNavigation? func stopLoading() func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, Error?) -> Void)? = nil) - func evaluateJavaScriptAsync(_ javaScriptString: String) async throws -> Any + func evaluateJavaScript(_ javaScriptString: String) async throws -> Any @available(macOS 11.0, *) func __evaluateJavaScript(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld, completionHandler: ((Any?, Error?) -> Void)? = nil) @available(macOS 11.0, *) - func __evaluateJavaScriptAsync(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any + func __evaluateJavaScript(_ javaScriptString: String, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any @available(macOS 11.0, *) func __callAsyncJavaScript(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld, completionHandler: ((Any?, Error?) -> Void)? = nil) @available(macOS 11.0, *) - func __callAsyncJavaScriptAsync(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any + func __callAsyncJavaScript(_ functionBody: String, arguments: [String : Any]?, inFrame frame: WKFrameInfo?, in contentWorld: WKContentWorld) async throws -> Any @available(macOS 10.13, *) func takeSnapshot(with snapshotConfiguration: WKSnapshotConfiguration?, completionHandler: @escaping (NSImage?, Error?) -> Void) @available(macOS 10.13, *) diff --git a/tvOS/AVFoundation/AVAssetWriter.swift b/tvOS/AVFoundation/AVAssetWriter.swift index e46a1a3..2821f6a 100644 --- a/tvOS/AVFoundation/AVAssetWriter.swift +++ b/tvOS/AVFoundation/AVAssetWriter.swift @@ -38,7 +38,7 @@ class AVAssetWriter : NSObject { @available(tvOS 9.0, *) func finishWriting(completionHandler handler: @escaping () -> Void) @available(tvOS 9.0, *) - func finishWritingAsync() async + func finishWriting() async } extension AVAssetWriter { var movieFragmentInterval: CMTime diff --git a/tvOS/AVFoundation/AVAsynchronousKeyValueLoading.swift b/tvOS/AVFoundation/AVAsynchronousKeyValueLoading.swift index d104d0f..22888c5 100644 --- a/tvOS/AVFoundation/AVAsynchronousKeyValueLoading.swift +++ b/tvOS/AVFoundation/AVAsynchronousKeyValueLoading.swift @@ -11,5 +11,5 @@ enum AVKeyValueStatus : Int { protocol AVAsynchronousKeyValueLoading { func statusOfValue(forKey key: String, error outError: NSErrorPointer) -> AVKeyValueStatus func loadValuesAsynchronously(forKeys keys: [String], completionHandler handler: (() -> Void)? = nil) - func loadValuesAsync(forKeys keys: [String]) async + func loadValues(forKeys keys: [String]) async } diff --git a/tvOS/AVFoundation/AVCaptureDevice.swift b/tvOS/AVFoundation/AVCaptureDevice.swift index 53f27e6..e28fbff 100644 --- a/tvOS/AVFoundation/AVCaptureDevice.swift +++ b/tvOS/AVFoundation/AVCaptureDevice.swift @@ -94,7 +94,7 @@ extension AVCaptureDevice { @available(tvOS 8.0, *) func setExposureTargetBias(_ bias: Float, completionHandler handler: ((CMTime) -> Void)? = nil) @available(tvOS 8.0, *) - func setExposureTargetBiasAsync(_ bias: Float) async -> CMTime + func setExposureTargetBias(_ bias: Float) async -> CMTime } extension AVCaptureDevice { } diff --git a/tvOS/AVFoundation/AVPlayer.swift b/tvOS/AVFoundation/AVPlayer.swift index 19aa3d5..f5504d1 100644 --- a/tvOS/AVFoundation/AVPlayer.swift +++ b/tvOS/AVFoundation/AVPlayer.swift @@ -75,17 +75,17 @@ extension AVPlayer { @available(tvOS 9.0, *) func seek(to date: Date, completionHandler: @escaping (Bool) -> Void) @available(tvOS 9.0, *) - func seekAsync(to date: Date) async -> Bool + func seek(to date: Date) async -> Bool func seek(to time: CMTime) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) @available(tvOS 9.0, *) func seek(to time: CMTime, completionHandler: @escaping (Bool) -> Void) @available(tvOS 9.0, *) - func seekAsync(to time: CMTime) async -> Bool + func seek(to time: CMTime) async -> Bool @available(tvOS 9.0, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: @escaping (Bool) -> Void) @available(tvOS 9.0, *) - func seekAsync(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool } extension AVPlayer { @available(tvOS 10.0, *) @@ -95,7 +95,7 @@ extension AVPlayer { @available(tvOS 9.0, *) func preroll(atRate rate: Float, completionHandler: ((Bool) -> Void)? = nil) @available(tvOS 9.0, *) - func prerollAsync(atRate rate: Float) async -> Bool + func preroll(atRate rate: Float) async -> Bool @available(tvOS 9.0, *) func cancelPendingPrerolls() @available(tvOS 9.0, *) diff --git a/tvOS/AVFoundation/AVPlayerItem.swift b/tvOS/AVFoundation/AVPlayerItem.swift index 14d1e21..167c361 100644 --- a/tvOS/AVFoundation/AVPlayerItem.swift +++ b/tvOS/AVFoundation/AVPlayerItem.swift @@ -85,11 +85,11 @@ extension AVPlayerItem { @available(tvOS 9.0, *) func seek(to time: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(tvOS 9.0, *) - func seekAsync(to time: CMTime) async -> Bool + func seek(to time: CMTime) async -> Bool @available(tvOS 9.0, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(tvOS 9.0, *) - func seekAsync(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool @available(tvOS 9.0, *) func cancelPendingSeeks() func currentDate() -> Date? diff --git a/tvOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift b/tvOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift index cb45b48..e3aaaa7 100644 --- a/tvOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift +++ b/tvOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift @@ -15,7 +15,7 @@ extension AVSampleBufferRenderSynchronizer { var renderers: [AVQueuedSampleBufferRendering] { get } func addRenderer(_ renderer: AVQueuedSampleBufferRendering) func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime, completionHandler: ((Bool) -> Void)? = nil) - func removeRendererAsync(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool + func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool } extension AVSampleBufferRenderSynchronizer { func addPeriodicTimeObserver(forInterval interval: CMTime, queue: DispatchQueue?, using block: @escaping (CMTime) -> Void) -> Any diff --git a/tvOS/AVKit/AVContentProposalViewController.swift b/tvOS/AVKit/AVContentProposalViewController.swift index 91d8bfe..77aa7fe 100644 --- a/tvOS/AVKit/AVContentProposalViewController.swift +++ b/tvOS/AVKit/AVContentProposalViewController.swift @@ -14,7 +14,7 @@ class AVContentProposalViewController : UIViewController { var playerLayoutGuide: UILayoutGuide { get } var dateOfAutomaticAcceptance: Date? func dismissContentProposal(for action: AVContentProposalAction, animated: Bool, completion block: (() -> Void)? = nil) - func dismissContentProposalAsync(for action: AVContentProposalAction, animated: Bool) async + func dismissContentProposal(for action: AVContentProposalAction, animated: Bool) async } extension AVPlayerViewController { @available(tvOS 10.0, *) diff --git a/tvOS/AVKit/AVPlayerViewController.swift b/tvOS/AVKit/AVPlayerViewController.swift index bd658b0..9b1ac21 100644 --- a/tvOS/AVKit/AVPlayerViewController.swift +++ b/tvOS/AVKit/AVPlayerViewController.swift @@ -107,5 +107,5 @@ protocol AVPlayerViewControllerAnimationCoordinator : NSObjectProtocol { @available(tvOS 11.0, *) func addCoordinatedAnimations(_ animations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(tvOS 11.0, *) - func addCoordinatedAnimationsAsync(_ animations: (() -> Void)?) async -> Bool + func addCoordinatedAnimations(_ animations: (() -> Void)?) async -> Bool } diff --git a/tvOS/CoreHaptics/CHHapticEngine.swift b/tvOS/CoreHaptics/CHHapticEngine.swift index 3512fc2..73ced75 100644 --- a/tvOS/CoreHaptics/CHHapticEngine.swift +++ b/tvOS/CoreHaptics/CHHapticEngine.swift @@ -35,10 +35,10 @@ class CHHapticEngine : NSObject { var isAutoShutdownEnabled: Bool init() throws func start(completionHandler: CHHapticEngine.CompletionHandler? = nil) - func startAsync() async throws + func start() async throws func start() throws func stop(completionHandler: CHHapticEngine.CompletionHandler? = nil) - func stopAsync() async throws + func stop() async throws func notifyWhenPlayersFinished(finishedHandler: @escaping CHHapticEngine.FinishedHandler) func makePlayer(with pattern: CHHapticPattern) throws -> CHHapticPatternPlayer func makeAdvancedPlayer(with pattern: CHHapticPattern) throws -> CHHapticAdvancedPatternPlayer diff --git a/tvOS/CoreLocation/CLLocationManager.swift b/tvOS/CoreLocation/CLLocationManager.swift index 94ec76f..fcf098d 100644 --- a/tvOS/CoreLocation/CLLocationManager.swift +++ b/tvOS/CoreLocation/CLLocationManager.swift @@ -56,7 +56,7 @@ class CLLocationManager : NSObject { @available(tvOS 14.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String, completion: ((Error?) -> Void)? = nil) @available(tvOS 14.0, *) - func requestTemporaryFullAccuracyAuthorizationAsync(withPurposeKey purposeKey: String) async throws + func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) async throws @available(tvOS 14.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) func stopUpdatingLocation() diff --git a/tvOS/CoreSpotlight/CSSearchableIndex.swift b/tvOS/CoreSpotlight/CSSearchableIndex.swift index fb19712..3e62db7 100644 --- a/tvOS/CoreSpotlight/CSSearchableIndex.swift +++ b/tvOS/CoreSpotlight/CSSearchableIndex.swift @@ -2,7 +2,7 @@ extension CSSearchableIndex { func beginBatch() func endBatch(withClientState clientState: Data, completionHandler: ((Error?) -> Void)? = nil) - func endBatchAsync(withClientState clientState: Data) async throws + func endBatch(withClientState clientState: Data) async throws func fetchLastClientState(completionHandler: @escaping (Data?, Error?) -> Void) func fetchLastClientState() async throws -> Data } diff --git a/tvOS/CryptoTokenKit/TKSmartCard.swift b/tvOS/CryptoTokenKit/TKSmartCard.swift index 3aee1ce..b281719 100644 --- a/tvOS/CryptoTokenKit/TKSmartCard.swift +++ b/tvOS/CryptoTokenKit/TKSmartCard.swift @@ -3,6 +3,7 @@ class TKSmartCardSlotManager : NSObject { class var `default`: TKSmartCardSlotManager? { get } var slotNames: [String] { get } func getSlot(withName name: String, reply: @escaping (TKSmartCardSlot?) -> Void) + func getSlot(withName name: String) async -> TKSmartCardSlot? func slotNamed(_ name: String) -> TKSmartCardSlot? } extension TKSmartCardSlot { @@ -80,6 +81,7 @@ class TKSmartCardUserInteraction : NSObject { var initialTimeout: TimeInterval var interactionTimeout: TimeInterval func run(reply: @escaping (Bool, Error?) -> Void) + func run() async throws -> Bool func cancel() -> Bool } class TKSmartCardUserInteractionForPINOperation : TKSmartCardUserInteraction { @@ -110,7 +112,9 @@ class TKSmartCard : NSObject { var isSensitive: Bool var context: Any? func beginSession(reply: @escaping (Bool, Error?) -> Void) + func beginSession() async throws -> Bool func transmit(_ request: Data, reply: @escaping (Data?, Error?) -> Void) + func transmit(_ request: Data) async throws -> Data func endSession() @available(tvOS 9.0, *) func userInteractionForSecurePINVerification(_ PINFormat: TKSmartCardPINFormat, apdu APDU: Data, pinByteOffset PINByteOffset: Int) -> TKSmartCardUserInteractionForSecurePINVerification? @@ -131,6 +135,7 @@ extension TKSmartCard { var useExtendedLength: Bool var useCommandChaining: Bool func __sendIns(_ ins: UInt8, p1: UInt8, p2: UInt8, data requestData: Data?, le: NSNumber?, reply: @escaping (Data?, UInt16, Error?) -> Void) + func __sendIns(_ ins: UInt8, p1: UInt8, p2: UInt8, data requestData: Data?, le: NSNumber?) async throws -> (Data, UInt16) func __inSession(executeBlock block: @escaping (NSErrorPointer) -> Bool) throws func __sendIns(_ ins: UInt8, p1: UInt8, p2: UInt8, data requestData: Data?, le: NSNumber?, sw: UnsafeMutablePointer) throws -> Data } diff --git a/tvOS/ExternalAccessory/EAAccessoryManager.swift b/tvOS/ExternalAccessory/EAAccessoryManager.swift index 9ed3245..d16a71d 100644 --- a/tvOS/ExternalAccessory/EAAccessoryManager.swift +++ b/tvOS/ExternalAccessory/EAAccessoryManager.swift @@ -27,7 +27,7 @@ class EAAccessoryManager : NSObject { @available(tvOS 6, *) func showBluetoothAccessoryPicker(withNameFilter predicate: NSPredicate?, completion: EABluetoothAccessoryPickerCompletion? = nil) @available(tvOS 6, *) - func showBluetoothAccessoryPickerAsync(withNameFilter predicate: NSPredicate?) async throws + func showBluetoothAccessoryPicker(withNameFilter predicate: NSPredicate?) async throws @available(tvOS 10.0, *) func registerForLocalNotifications() @available(tvOS 10.0, *) diff --git a/tvOS/Foundation/NSExtensionContext.swift b/tvOS/Foundation/NSExtensionContext.swift index 90d74a5..cc7589c 100644 --- a/tvOS/Foundation/NSExtensionContext.swift +++ b/tvOS/Foundation/NSExtensionContext.swift @@ -6,7 +6,7 @@ class NSExtensionContext : NSObject { func completeRequest(returningItems items: [Any]?) async -> Bool func cancelRequest(withError error: Error) func open(_ URL: URL, completionHandler: ((Bool) -> Void)? = nil) - func openURLAsync(_ URL: URL) async -> Bool + func open(_ URL: URL) async -> Bool } @available(tvOS 9.0, *) let NSExtensionItemsAndErrorsKey: String diff --git a/tvOS/Foundation/NSItemProvider.swift b/tvOS/Foundation/NSItemProvider.swift index b41b8ee..477cad7 100644 --- a/tvOS/Foundation/NSItemProvider.swift +++ b/tvOS/Foundation/NSItemProvider.swift @@ -75,7 +75,7 @@ class NSItemProvider : NSObject, NSCopying { convenience init?(contentsOf fileURL: URL!) func registerItem(forTypeIdentifier typeIdentifier: String, loadHandler: @escaping NSItemProvider.LoadHandler) func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil, completionHandler: NSItemProvider.CompletionHandler? = nil) - func loadItemAsync(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding + func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding } @available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) @@ -95,7 +95,7 @@ extension NSItemProvider { @available(tvOS 9.0, *) func loadPreviewImage(options: [AnyHashable : Any]! = [:], completionHandler: NSItemProvider.CompletionHandler!) @available(tvOS 9.0, *) - func loadPreviewImageAsync(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding + func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding } @available(tvOS 9.0, *) let NSExtensionJavaScriptPreprocessingResultsKey: String diff --git a/tvOS/GameController/GCController.swift b/tvOS/GameController/GCController.swift index 878aa34..ff9fee4 100644 --- a/tvOS/GameController/GCController.swift +++ b/tvOS/GameController/GCController.swift @@ -44,7 +44,7 @@ class GCController : NSObject, GCDevice { func capture() -> GCController class func controllers() -> [GCController] class func startWirelessControllerDiscovery(completionHandler: (() -> Void)? = nil) - class func startWirelessControllerDiscoveryAsync() async + class func startWirelessControllerDiscovery() async class func stopWirelessControllerDiscovery() @available(tvOS 13.0, *) class func withMicroGamepad() -> GCController diff --git a/tvOS/GameKit/GKAchievement.swift b/tvOS/GameKit/GKAchievement.swift index 2a6b9f0..439b860 100644 --- a/tvOS/GameKit/GKAchievement.swift +++ b/tvOS/GameKit/GKAchievement.swift @@ -2,16 +2,16 @@ @available(tvOS 4.1, *) class GKAchievement : NSObject, NSCoding, NSSecureCoding { class func loadAchievements(completionHandler: (([GKAchievement]?, Error?) -> Void)? = nil) - class func loadAchievementsAsync() async throws -> [GKAchievement] + class func loadAchievements() async throws -> [GKAchievement] class func resetAchievements(completionHandler: ((Error?) -> Void)? = nil) - class func resetAchievementsAsync() async throws + class func resetAchievements() async throws init(identifier: String) @available(tvOS 8.0, *) init(identifier: String, player: GKPlayer) @available(tvOS 6.0, *) class func report(_ achievements: [GKAchievement], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 6.0, *) - class func reportAchievementsAsync(_ achievements: [GKAchievement]) async throws + class func report(_ achievements: [GKAchievement]) async throws var identifier: String var percentComplete: Double var isCompleted: Bool { get } diff --git a/tvOS/GameKit/GKAchievementDescription.swift b/tvOS/GameKit/GKAchievementDescription.swift index 955ca3c..98703fe 100644 --- a/tvOS/GameKit/GKAchievementDescription.swift +++ b/tvOS/GameKit/GKAchievementDescription.swift @@ -2,7 +2,7 @@ @available(tvOS 4.1, *) class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { class func loadAchievementDescriptions(completionHandler: (([GKAchievementDescription]?, Error?) -> Void)? = nil) - class func loadAchievementDescriptionsAsync() async throws -> [GKAchievementDescription] + class func loadAchievementDescriptions() async throws -> [GKAchievementDescription] var identifier: String { get } @available(tvOS 6.0, *) var groupIdentifier: String? { get } @@ -16,7 +16,7 @@ class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { } extension GKAchievementDescription { func loadImage(completionHandler: ((UIImage?, Error?) -> Void)? = nil) - func loadImageAsync() async throws -> UIImage + func loadImage() async throws -> UIImage class func incompleteAchievementImage() -> UIImage class func placeholderCompletedAchievementImage() -> UIImage } diff --git a/tvOS/GameKit/GKChallenge.swift b/tvOS/GameKit/GKChallenge.swift index 57ac2f4..2ab389c 100644 --- a/tvOS/GameKit/GKChallenge.swift +++ b/tvOS/GameKit/GKChallenge.swift @@ -10,7 +10,7 @@ enum GKChallengeState : Int { @available(tvOS 6.0, *) class GKChallenge : NSObject, NSCoding, NSSecureCoding { class func loadReceivedChallenges(completionHandler: (([GKChallenge]?, Error?) -> Void)? = nil) - class func loadReceivedChallengesAsync() async throws -> [GKChallenge] + class func loadReceivedChallenges() async throws -> [GKChallenge] func decline() @available(tvOS 8.0, *) @NSCopying var issuingPlayer: GKPlayer? { get } @@ -35,21 +35,21 @@ extension GKScore { @available(tvOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to reportLeaderboardScores:withEligibleChallenges:withCompletionHandler instead") class func report(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(tvOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to reportLeaderboardScores:withEligibleChallenges:withCompletionHandler instead") - class func reportScoresAsync(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge]) async throws + class func report(_ scores: [GKScore], withEligibleChallenges challenges: [GKChallenge]) async throws @available(tvOS 14.0, *) class func report(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 14.0, *) - class func reportLeaderboardScoresAsync(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge]) async throws + class func report(_ scores: [GKLeaderboardScore], withEligibleChallenges challenges: [GKChallenge]) async throws } extension GKAchievement { @available(tvOS 8.0, *) func selectChallengeablePlayers(_ players: [GKPlayer], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(tvOS 8.0, *) - func selectChallengeablePlayersAsync(_ players: [GKPlayer]) async throws -> [GKPlayer] + func selectChallengeablePlayers(_ players: [GKPlayer]) async throws -> [GKPlayer] @available(tvOS 7.0, *) class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 7.0, *) - class func reportAchievementsAsync(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge]) async throws + class func report(_ achievements: [GKAchievement], withEligibleChallenges challenges: [GKChallenge]) async throws } extension GKScore { } diff --git a/tvOS/GameKit/GKLeaderboard.swift b/tvOS/GameKit/GKLeaderboard.swift index d5bcc5f..f96e850 100644 --- a/tvOS/GameKit/GKLeaderboard.swift +++ b/tvOS/GameKit/GKLeaderboard.swift @@ -83,11 +83,11 @@ extension GKLeaderboard { @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") func loadScores(completionHandler: (([GKScore]?, Error?) -> Void)? = nil) @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") - func loadScoresAsync() async throws -> [GKScore] + func loadScores() async throws -> [GKScore] @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") class func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") - class func loadLeaderboardsAsync() async throws -> [GKLeaderboard] + class func loadLeaderboards() async throws -> [GKLeaderboard] } extension GKLeaderboard { } diff --git a/tvOS/GameKit/GKLeaderboardSet.swift b/tvOS/GameKit/GKLeaderboardSet.swift index 747fdbe..69f265f 100644 --- a/tvOS/GameKit/GKLeaderboardSet.swift +++ b/tvOS/GameKit/GKLeaderboardSet.swift @@ -7,7 +7,7 @@ class GKLeaderboardSet : NSObject, NSCoding, NSSecureCoding { @available(tvOS 7.0, *) class func loadLeaderboardSets(completionHandler: (([GKLeaderboardSet]?, Error?) -> Void)? = nil) @available(tvOS 7.0, *) - class func loadLeaderboardSetsAsync() async throws -> [GKLeaderboardSet] + class func loadLeaderboardSets() async throws -> [GKLeaderboardSet] @available(tvOS 14.0, *) func loadLeaderboards(handler: @escaping ([GKLeaderboard]?, Error?) -> Void) } @@ -15,7 +15,7 @@ extension GKLeaderboardSet { @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use loadLeaderboardsWithHandler: instead.") func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(tvOS, introduced: 9.0, deprecated: 14.0, message: "Use loadLeaderboardsWithHandler: instead.") - func loadLeaderboardsAsync() async throws -> [GKLeaderboard] + func loadLeaderboards() async throws -> [GKLeaderboard] } extension GKLeaderboardSet { } diff --git a/tvOS/GameKit/GKLocalPlayer.swift b/tvOS/GameKit/GKLocalPlayer.swift index 19d1215..cabd8bc 100644 --- a/tvOS/GameKit/GKLocalPlayer.swift +++ b/tvOS/GameKit/GKLocalPlayer.swift @@ -13,21 +13,21 @@ class GKLocalPlayer : GKPlayer { @available(tvOS 10.0, *) func loadRecentPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(tvOS 10.0, *) - func loadRecentPlayersAsync() async throws -> [GKPlayer] + func loadRecentPlayers() async throws -> [GKPlayer] func loadChallengableFriends(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - func loadChallengableFriendsAsync() async throws -> [GKPlayer] + func loadChallengableFriends() async throws -> [GKPlayer] @available(tvOS 7.0, *) func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 7.0, *) - func setDefaultLeaderboardIdentifierAsync(_ leaderboardIdentifier: String) async throws + func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String) async throws @available(tvOS 7.0, *) func loadDefaultLeaderboardIdentifier(completionHandler: ((String?, Error?) -> Void)? = nil) @available(tvOS 7.0, *) - func loadDefaultLeaderboardIdentifierAsync() async throws -> String + func loadDefaultLeaderboardIdentifier() async throws -> String @available(tvOS 13.5, *) func fetchItems(forIdentityVerificationSignature completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(tvOS 13.5, *) - func fetchItemsForIdentityVerificationSignatureAsync() async throws -> (URL, Data, Data, UInt64) + func fetchItemsForIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) } protocol GKLocalPlayerListener : GKChallengeListener, GKInviteEventListener, GKTurnBasedEventListener { } @@ -47,11 +47,11 @@ extension GKLocalPlayer { @available(tvOS, introduced: 8.0, deprecated: 10.0) func loadFriendPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(tvOS, introduced: 8.0, deprecated: 10.0) - func loadFriendPlayersAsync() async throws -> [GKPlayer] + func loadFriendPlayers() async throws -> [GKPlayer] @available(tvOS, introduced: 9.0, deprecated: 13.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") func generateIdentityVerificationSignature(completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(tvOS, introduced: 9.0, deprecated: 13.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") - func generateIdentityVerificationSignatureAsync() async throws -> (URL, Data, Data, UInt64) + func generateIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) } extension GKLocalPlayer { } diff --git a/tvOS/GameKit/GKMatch.swift b/tvOS/GameKit/GKMatch.swift index fb8ce79..9923a53 100644 --- a/tvOS/GameKit/GKMatch.swift +++ b/tvOS/GameKit/GKMatch.swift @@ -32,7 +32,7 @@ class GKMatch : NSObject { @available(tvOS 6.0, *) func rematch(completionHandler: ((GKMatch?, Error?) -> Void)? = nil) @available(tvOS 6.0, *) - func rematchAsync() async throws -> GKMatch + func rematch() async throws -> GKMatch } protocol GKMatchDelegate : NSObjectProtocol { @available(tvOS 8.0, *) diff --git a/tvOS/GameKit/GKMatchmaker.swift b/tvOS/GameKit/GKMatchmaker.swift index c9c1e78..03dc961 100644 --- a/tvOS/GameKit/GKMatchmaker.swift +++ b/tvOS/GameKit/GKMatchmaker.swift @@ -64,24 +64,24 @@ class GKMatchmaker : NSObject { @available(tvOS 6.0, *) func match(for invite: GKInvite, completionHandler: ((GKMatch?, Error?) -> Void)? = nil) @available(tvOS 6.0, *) - func matchAsync(for invite: GKInvite) async throws -> GKMatch + func match(for invite: GKInvite) async throws -> GKMatch func findMatch(for request: GKMatchRequest, withCompletionHandler completionHandler: ((GKMatch?, Error?) -> Void)? = nil) - func findMatchAsync(for request: GKMatchRequest) async throws -> GKMatch + func findMatch(for request: GKMatchRequest) async throws -> GKMatch @available(tvOS 8.0, *) func findPlayers(forHostedRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(tvOS 8.0, *) - func findPlayersAsync(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer] + func findPlayers(forHostedRequest request: GKMatchRequest) async throws -> [GKPlayer] func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest, completionHandler: ((Error?) -> Void)? = nil) - func addPlayersAsync(to match: GKMatch, matchRequest: GKMatchRequest) async throws + func addPlayers(to match: GKMatch, matchRequest: GKMatchRequest) async throws func cancel() @available(tvOS 8.0, *) func cancelPendingInvite(to player: GKPlayer) @available(tvOS 6.0, *) func finishMatchmaking(for match: GKMatch) func queryPlayerGroupActivity(_ playerGroup: Int, withCompletionHandler completionHandler: ((Int, Error?) -> Void)? = nil) - func queryPlayerGroupActivityAsync(_ playerGroup: Int) async throws -> Int + func queryPlayerGroupActivity(_ playerGroup: Int) async throws -> Int func queryActivity(completionHandler: ((Int, Error?) -> Void)? = nil) - func queryActivityAsync() async throws -> Int + func queryActivity() async throws -> Int @available(tvOS 8.0, *) func startBrowsingForNearbyPlayers(handler reachableHandler: ((GKPlayer, Bool) -> Void)? = nil) @available(tvOS 6.0, *) diff --git a/tvOS/GameKit/GKNotificationBanner.swift b/tvOS/GameKit/GKNotificationBanner.swift index 0e7709e..def9e97 100644 --- a/tvOS/GameKit/GKNotificationBanner.swift +++ b/tvOS/GameKit/GKNotificationBanner.swift @@ -4,9 +4,9 @@ class GKNotificationBanner : NSObject { @available(tvOS 5.0, *) class func show(withTitle title: String?, message: String?, completionHandler: (() -> Void)? = nil) @available(tvOS 5.0, *) - class func showAsync(withTitle title: String?, message: String?) async + class func show(withTitle title: String?, message: String?) async @available(tvOS 6.0, *) class func show(withTitle title: String?, message: String?, duration: TimeInterval, completionHandler: (() -> Void)? = nil) @available(tvOS 6.0, *) - class func showAsync(withTitle title: String?, message: String?, duration: TimeInterval) async + class func show(withTitle title: String?, message: String?, duration: TimeInterval) async } diff --git a/tvOS/GameKit/GKPlayer.swift b/tvOS/GameKit/GKPlayer.swift index fc5b0fc..00580e5 100644 --- a/tvOS/GameKit/GKPlayer.swift +++ b/tvOS/GameKit/GKPlayer.swift @@ -4,7 +4,7 @@ let GKPlayerIDNoLongerAvailable: String @available(tvOS 4.1, *) class GKPlayer : GKBasePlayer { class func loadPlayers(forIdentifiers identifiers: [String], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - class func loadPlayersAsync(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] + class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] @available(tvOS 13.0, *) func scopedIDsArePersistent() -> Bool @available(tvOS 12.4, *) @@ -23,7 +23,7 @@ extension GKPlayer { @available(tvOS 5.0, *) func loadPhoto(for size: GKPlayer.PhotoSize, withCompletionHandler completionHandler: ((UIImage?, Error?) -> Void)? = nil) @available(tvOS 5.0, *) - func loadPhotoAsync(for size: GKPlayer.PhotoSize) async throws -> UIImage + func loadPhoto(for size: GKPlayer.PhotoSize) async throws -> UIImage } extension GKPlayer { enum PhotoSize : Int { diff --git a/tvOS/GameKit/GKScore.swift b/tvOS/GameKit/GKScore.swift index f6f3e6e..aae4769 100644 --- a/tvOS/GameKit/GKScore.swift +++ b/tvOS/GameKit/GKScore.swift @@ -19,7 +19,7 @@ class GKScore : NSObject, NSCoding, NSSecureCoding { @available(tvOS 6.0, *) class func report(_ scores: [GKScore], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 6.0, *) - class func reportScoresAsync(_ scores: [GKScore]) async throws + class func report(_ scores: [GKScore]) async throws } extension GKScore { } diff --git a/tvOS/GameKit/GKTurnBasedMatch.swift b/tvOS/GameKit/GKTurnBasedMatch.swift index a00616f..ea8ffd2 100644 --- a/tvOS/GameKit/GKTurnBasedMatch.swift +++ b/tvOS/GameKit/GKTurnBasedMatch.swift @@ -94,43 +94,43 @@ class GKTurnBasedMatch : NSObject { class func find(for request: GKMatchRequest, withCompletionHandler completionHandler: @escaping (GKTurnBasedMatch?, Error?) -> Void) class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch class func loadMatches(completionHandler: (([GKTurnBasedMatch]?, Error?) -> Void)? = nil) - class func loadMatchesAsync() async throws -> [GKTurnBasedMatch] + class func loadMatches() async throws -> [GKTurnBasedMatch] @available(tvOS 5.0, *) class func load(withID matchID: String, withCompletionHandler completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(tvOS 5.0, *) - class func loadAsync(withID matchID: String) async throws -> GKTurnBasedMatch + class func load(withID matchID: String) async throws -> GKTurnBasedMatch @available(tvOS 6.0, *) func rematch(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(tvOS 6.0, *) - func rematchAsync() async throws -> GKTurnBasedMatch + func rematch() async throws -> GKTurnBasedMatch @available(tvOS 5.0, *) func acceptInvite(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(tvOS 5.0, *) - func acceptInviteAsync() async throws -> GKTurnBasedMatch + func acceptInvite() async throws -> GKTurnBasedMatch @available(tvOS 5.0, *) func declineInvite(completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 5.0, *) - func declineInviteAsync() async throws + func declineInvite() async throws func remove(completionHandler: ((Error?) -> Void)? = nil) - func removeAsync() async throws + func remove() async throws func loadMatchData(completionHandler: ((Data?, Error?) -> Void)? = nil) - func loadMatchDataAsync() async throws -> Data + func loadMatchData() async throws -> Data @available(tvOS 6.0, *) func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 6.0, *) - func endTurnAsync(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws @available(tvOS 6.0, *) func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 6.0, *) - func participantQuitInTurnAsync(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) - func participantQuitOutOfTurnAsync(with matchOutcome: GKTurnBasedMatch.Outcome) async throws + func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome) async throws func endMatchInTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) - func endMatchInTurnAsync(withMatch matchData: Data) async throws + func endMatchInTurn(withMatch matchData: Data) async throws @available(tvOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS, introduced: 6.0, deprecated: 14.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") - func endMatchInTurnAsync(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws + func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws @available(tvOS 14.0, *) func endMatchInTurn(withMatch matchData: Data, leaderboardScores scores: [GKLeaderboardScore], achievements: [Any], completionHandler: @escaping (Error?) -> Void) @available(tvOS 14.0, *) @@ -138,19 +138,19 @@ class GKTurnBasedMatch : NSObject { @available(tvOS 6.0, *) func saveCurrentTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 6.0, *) - func saveCurrentTurnAsync(withMatch matchData: Data) async throws + func saveCurrentTurn(withMatch matchData: Data) async throws @available(tvOS 7.0, *) func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange], completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 7.0, *) - func saveMergedMatchDataAsync(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws + func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws @available(tvOS 7.0, *) func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval, completionHandler: ((GKTurnBasedExchange?, Error?) -> Void)? = nil) @available(tvOS 7.0, *) - func sendExchangeAsync(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange + func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange @available(tvOS 7.0, *) func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 7.0, *) - func sendReminderAsync(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws + func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws } @available(tvOS 7.0, *) enum GKTurnBasedExchangeStatus : Int8 { @@ -181,11 +181,11 @@ class GKTurnBasedExchange : NSObject { @available(tvOS 7.0, *) func cancel(withLocalizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 7.0, *) - func cancelAsync(withLocalizableMessageKey key: String, arguments: [String]) async throws + func cancel(withLocalizableMessageKey key: String, arguments: [String]) async throws @available(tvOS 7.0, *) func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 7.0, *) - func replyAsync(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws + func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws } @available(tvOS 7.0, *) class GKTurnBasedExchangeReply : NSObject { diff --git a/tvOS/MediaPlayer/MPMusicPlayerController.swift b/tvOS/MediaPlayer/MPMusicPlayerController.swift index 6c0057b..34d91a8 100644 --- a/tvOS/MediaPlayer/MPMusicPlayerController.swift +++ b/tvOS/MediaPlayer/MPMusicPlayerController.swift @@ -55,7 +55,7 @@ class MPMusicPlayerController : NSObject, MPMediaPlayback { @available(tvOS 14.0, *) func prepareToPlay(completionHandler: @escaping (Error?) -> Void) @available(tvOS 14.0, *) - func prepareToPlayAsync() async throws + func prepareToPlay() async throws func skipToNextItem() func skipToBeginning() func skipToPreviousItem() diff --git a/tvOS/MediaPlayer/MPNowPlayingSession.swift b/tvOS/MediaPlayer/MPNowPlayingSession.swift index a70943a..c260131 100644 --- a/tvOS/MediaPlayer/MPNowPlayingSession.swift +++ b/tvOS/MediaPlayer/MPNowPlayingSession.swift @@ -9,7 +9,7 @@ class MPNowPlayingSession : NSObject { var canBecomeActive: Bool { get } var isActive: Bool { get } func becomeActiveIfPossible(completion: ((Bool) -> Void)? = nil) - func becomeActiveIfPossibleAsync() async -> Bool + func becomeActiveIfPossible() async -> Bool func addPlayer(_ player: AVPlayer) func removePlayer(_ player: AVPlayer) } diff --git a/tvOS/MetalPerformanceShaders/MetalPerformanceShaders.swift b/tvOS/MetalPerformanceShaders/MetalPerformanceShaders.swift index a6c72a4..76ed380 100644 --- a/tvOS/MetalPerformanceShaders/MetalPerformanceShaders.swift +++ b/tvOS/MetalPerformanceShaders/MetalPerformanceShaders.swift @@ -3739,7 +3739,7 @@ class MPSAccelerationStructure : MPSKernel, NSSecureCoding, NSCopying { init?(coder aDecoder: NSCoder, group: MPSAccelerationStructureGroup) func rebuild() func rebuild(completionHandler: @escaping MPSAccelerationStructureCompletionHandler) - func rebuildAsync() async -> MPSAccelerationStructure? + func rebuild() async -> MPSAccelerationStructure? func encodeRefit(commandBuffer: MTLCommandBuffer) func copy(with zone: NSZone? = nil, group: MPSAccelerationStructureGroup) -> Self } diff --git a/tvOS/Photos/PHPhotoLibrary.swift b/tvOS/Photos/PHPhotoLibrary.swift index f7e28aa..a179186 100644 --- a/tvOS/Photos/PHPhotoLibrary.swift +++ b/tvOS/Photos/PHPhotoLibrary.swift @@ -54,7 +54,7 @@ class PHPhotoLibrary : NSObject { @available(tvOS 10, *) func performChanges(_ changeBlock: @escaping () -> Void, completionHandler: ((Bool, Error?) -> Void)? = nil) @available(tvOS 10, *) - func performChangesAsync(_ changeBlock: @escaping () -> Void) async throws -> Bool + func performChanges(_ changeBlock: @escaping () -> Void) async throws -> Bool @available(tvOS 10, *) func performChangesAndWait(_ changeBlock: @escaping () -> Void) throws @available(tvOS 10, *) diff --git a/tvOS/ReplayKit/RPScreenRecorder.swift b/tvOS/ReplayKit/RPScreenRecorder.swift index ea3d0fd..4e5f0b7 100644 --- a/tvOS/ReplayKit/RPScreenRecorder.swift +++ b/tvOS/ReplayKit/RPScreenRecorder.swift @@ -14,7 +14,7 @@ class RPScreenRecorder : NSObject { @available(tvOS 11.0, *) func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 11.0, *) - func startCaptureAsync(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?) async throws + func startCapture(handler captureHandler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?) async throws @available(tvOS 11.0, *) func stopCapture(handler: ((Error?) -> Void)? = nil) weak var delegate: @sil_weak RPScreenRecorderDelegate? diff --git a/tvOS/SoundAnalysis/SNAnalyzer.swift b/tvOS/SoundAnalysis/SNAnalyzer.swift index 39c89ee..db4f2c1 100644 --- a/tvOS/SoundAnalysis/SNAnalyzer.swift +++ b/tvOS/SoundAnalysis/SNAnalyzer.swift @@ -16,6 +16,6 @@ class SNAudioFileAnalyzer : NSObject { func removeAllRequests() func analyze() func analyze(completionHandler: @escaping (Bool) -> Void) - func analyzeAsync() async -> Bool + func analyze() async -> Bool func cancelAnalysis() } diff --git a/tvOS/SpriteKit/SKNode.swift b/tvOS/SpriteKit/SKNode.swift index 9f9ec9e..f8699e8 100644 --- a/tvOS/SpriteKit/SKNode.swift +++ b/tvOS/SpriteKit/SKNode.swift @@ -65,7 +65,7 @@ class SKNode : UIResponder, NSCopying, NSSecureCoding, UIFocusItem { func inParentHierarchy(_ parent: SKNode) -> Bool func run(_ action: SKAction) func run(_ action: SKAction, completion block: @escaping () -> Void) - func runActionAsync(_ action: SKAction) async + func run(_ action: SKAction) async func run(_ action: SKAction, withKey key: String) func hasActions() -> Bool func action(forKey key: String) -> SKAction? diff --git a/tvOS/StoreKit/SKProductStorePromotionController.swift b/tvOS/StoreKit/SKProductStorePromotionController.swift index 52bc2e3..2ab5183 100644 --- a/tvOS/StoreKit/SKProductStorePromotionController.swift +++ b/tvOS/StoreKit/SKProductStorePromotionController.swift @@ -14,7 +14,7 @@ class SKProductStorePromotionController : NSObject { @available(tvOS 11.0, *) func fetchStorePromotionVisibility(for product: SKProduct, completionHandler: ((SKProductStorePromotionVisibility, Error?) -> Void)? = nil) @available(tvOS 11.0, *) - func fetchStorePromotionVisibilityAsync(for product: SKProduct) async throws -> SKProductStorePromotionVisibility + func fetchStorePromotionVisibility(for product: SKProduct) async throws -> SKProductStorePromotionVisibility @available(tvOS 11.0, *) func update(storePromotionVisibility promotionVisibility: SKProductStorePromotionVisibility, for product: SKProduct, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 11.0, *) @@ -22,7 +22,7 @@ class SKProductStorePromotionController : NSObject { @available(tvOS 11.0, *) func fetchStorePromotionOrder(completionHandler: (([SKProduct], Error?) -> Void)? = nil) @available(tvOS 11.0, *) - func fetchStorePromotionOrderAsync() async throws -> [SKProduct] + func fetchStorePromotionOrder() async throws -> [SKProduct] @available(tvOS 11.0, *) func update(storePromotionOrder: [SKProduct], completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 11.0, *) diff --git a/tvOS/TVMLKit/TVApplicationController.swift b/tvOS/TVMLKit/TVApplicationController.swift index 139a6cc..2650eb1 100644 --- a/tvOS/TVMLKit/TVApplicationController.swift +++ b/tvOS/TVMLKit/TVApplicationController.swift @@ -27,6 +27,6 @@ class TVApplicationController : NSObject { weak var delegate: @sil_weak TVApplicationControllerDelegate? { get } var navigationController: UINavigationController { get } func evaluate(inJavaScriptContext evaluation: @escaping (JSContext) -> Void, completion: ((Bool) -> Void)? = nil) - func evaluateAsync(inJavaScriptContext evaluation: @escaping (JSContext) -> Void) async -> Bool + func evaluate(inJavaScriptContext evaluation: @escaping (JSContext) -> Void) async -> Bool func stop() } diff --git a/tvOS/UIKit/UIApplication.swift b/tvOS/UIKit/UIApplication.swift index 53e14ff..d386b62 100644 --- a/tvOS/UIKit/UIApplication.swift +++ b/tvOS/UIKit/UIApplication.swift @@ -45,7 +45,7 @@ class UIApplication : UIResponder { @available(tvOS 10.0, *) func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:], completionHandler completion: ((Bool) -> Void)? = nil) @available(tvOS 10.0, *) - func openURLAsync(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:]) async -> Bool + func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:]) async -> Bool func sendEvent(_ event: UIEvent) @available(tvOS, introduced: 2.0, deprecated: 13.0, message: "Should not be used for applications that support multiple scenes as it returns a key window across all connected scenes") var keyWindow: UIWindow? { get } @@ -113,7 +113,7 @@ extension UIApplication { @available(tvOS 10.2, *) func setAlternateIconName(_ alternateIconName: String?, completionHandler: ((Error?) -> Void)? = nil) @available(tvOS 10.2, *) - func setAlternateIconNameAsync(_ alternateIconName: String?) async throws + func setAlternateIconName(_ alternateIconName: String?) async throws @available(tvOS 10.2, *) var alternateIconName: String? { get } } @@ -209,7 +209,7 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(tvOS 7.0, *) @asyncHandler optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) @available(tvOS 7.0, *) - optional func applicationAsync(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) async -> UIBackgroundFetchResult + optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) async -> UIBackgroundFetchResult @available(tvOS, introduced: 11.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead") optional func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) @available(tvOS, introduced: 11.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead") @@ -220,6 +220,8 @@ protocol UIApplicationDelegate : NSObjectProtocol { optional func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String) async @available(tvOS 8.2, *) optional func application(_ application: UIApplication, handleWatchKitExtensionRequest userInfo: [AnyHashable : Any]?, reply: @escaping ([AnyHashable : Any]?) -> Void) + @available(tvOS 8.2, *) + optional func application(_ application: UIApplication, handleWatchKitExtensionRequest userInfo: [AnyHashable : Any]?) async -> [AnyHashable : Any]? @available(tvOS 9.0, *) optional func applicationShouldRequestHealthAuthorization(_ application: UIApplication) @available(tvOS 4.0, *) diff --git a/tvOS/UIKit/UICollectionView.swift b/tvOS/UIKit/UICollectionView.swift index e7e4265..4180f7a 100644 --- a/tvOS/UIKit/UICollectionView.swift +++ b/tvOS/UIKit/UICollectionView.swift @@ -119,7 +119,7 @@ class UICollectionView : UIScrollView, UIDataSourceTranslating { @available(tvOS 7.0, *) func setCollectionViewLayout(_ layout: UICollectionViewLayout, animated: Bool, completion: ((Bool) -> Void)? = nil) @available(tvOS 7.0, *) - func setCollectionViewLayoutAsync(_ layout: UICollectionViewLayout, animated: Bool) async -> Bool + func setCollectionViewLayout(_ layout: UICollectionViewLayout, animated: Bool) async -> Bool @available(tvOS 7.0, *) func startInteractiveTransition(to layout: UICollectionViewLayout, completion: UICollectionView.LayoutInteractiveTransitionCompletion? = nil) -> UICollectionViewTransitionLayout @available(tvOS 7.0, *) @@ -151,7 +151,7 @@ class UICollectionView : UIScrollView, UIDataSourceTranslating { func reloadItems(at indexPaths: [IndexPath]) func moveItem(at indexPath: IndexPath, to newIndexPath: IndexPath) func performBatchUpdates(_ updates: (() -> Void)?, completion: ((Bool) -> Void)? = nil) - func performBatchUpdatesAsync(_ updates: (() -> Void)?) async -> Bool + func performBatchUpdates(_ updates: (() -> Void)?) async -> Bool @available(tvOS 9.0, *) func beginInteractiveMovementForItem(at indexPath: IndexPath) -> Bool @available(tvOS 9.0, *) diff --git a/tvOS/UIKit/UIDiffableDataSource.swift b/tvOS/UIKit/UIDiffableDataSource.swift index 9c07cb5..3a7457e 100644 --- a/tvOS/UIKit/UIDiffableDataSource.swift +++ b/tvOS/UIKit/UIDiffableDataSource.swift @@ -64,7 +64,7 @@ class UICollectionViewDiffableDataSourceReference : NSObject, UICollectionViewDa func snapshot() -> NSDiffableDataSourceSnapshotReference func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool, completion: (() -> Void)? = nil) - func applySnapshotAsync(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async + func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async func itemIdentifier(for indexPath: IndexPath) -> Any? func indexPath(forItemIdentifier identifier: Any) -> IndexPath? @available(tvOS 14.0, *) @@ -74,7 +74,7 @@ class UICollectionViewDiffableDataSourceReference : NSObject, UICollectionViewDa @available(tvOS 14.0, *) func applySnapshot(_ snapshot: NSDiffableDataSourceSectionSnapshotReference, toSection sectionIdentifier: Any, animatingDifferences: Bool, completion: (() -> Void)? = nil) @available(tvOS 14.0, *) - func applySnapshotAsync(_ snapshot: NSDiffableDataSourceSectionSnapshotReference, toSection sectionIdentifier: Any, animatingDifferences: Bool) async + func applySnapshot(_ snapshot: NSDiffableDataSourceSectionSnapshotReference, toSection sectionIdentifier: Any, animatingDifferences: Bool) async @available(tvOS 14.0, *) func snapshot(forSection section: Any) -> NSDiffableDataSourceSectionSnapshotReference @available(tvOS 14.0, *) @@ -87,7 +87,7 @@ class UITableViewDiffableDataSourceReference : NSObject, UITableViewDataSource { func snapshot() -> NSDiffableDataSourceSnapshotReference func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool, completion: (() -> Void)? = nil) - func applySnapshotAsync(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async + func applySnapshot(_ snapshot: NSDiffableDataSourceSnapshotReference, animatingDifferences: Bool) async func itemIdentifier(for indexPath: IndexPath) -> Any? func indexPath(forItemIdentifier identifier: Any) -> IndexPath? var defaultRowAnimation: UITableView.RowAnimation diff --git a/tvOS/UIKit/UIFocusAnimationCoordinator.swift b/tvOS/UIKit/UIFocusAnimationCoordinator.swift index 3ed275a..fe0b370 100644 --- a/tvOS/UIKit/UIFocusAnimationCoordinator.swift +++ b/tvOS/UIKit/UIFocusAnimationCoordinator.swift @@ -6,13 +6,13 @@ protocol UIFocusAnimationContext : NSObjectProtocol { @available(tvOS 9.0, *) class UIFocusAnimationCoordinator : NSObject { func addCoordinatedAnimations(_ animations: (() -> Void)?, completion: (() -> Void)? = nil) - func addCoordinatedAnimationsAsync(_ animations: (() -> Void)?) async + func addCoordinatedAnimations(_ animations: (() -> Void)?) async @available(tvOS 11.0, *) func addCoordinatedFocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?, completion: (() -> Void)? = nil) @available(tvOS 11.0, *) - func addCoordinatedFocusingAnimationsAsync(_ animations: ((UIFocusAnimationContext) -> Void)?) async + func addCoordinatedFocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?) async @available(tvOS 11.0, *) func addCoordinatedUnfocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?, completion: (() -> Void)? = nil) @available(tvOS 11.0, *) - func addCoordinatedUnfocusingAnimationsAsync(_ animations: ((UIFocusAnimationContext) -> Void)?) async + func addCoordinatedUnfocusingAnimations(_ animations: ((UIFocusAnimationContext) -> Void)?) async } diff --git a/tvOS/UIKit/UIPageViewController.swift b/tvOS/UIKit/UIPageViewController.swift index e50a443..2e89ed5 100644 --- a/tvOS/UIKit/UIPageViewController.swift +++ b/tvOS/UIKit/UIPageViewController.swift @@ -49,7 +49,7 @@ class UIPageViewController : UIViewController { var gestureRecognizers: [UIGestureRecognizer] { get } var viewControllers: [UIViewController]? { get } func setViewControllers(_ viewControllers: [UIViewController]?, direction: UIPageViewController.NavigationDirection, animated: Bool, completion: ((Bool) -> Void)? = nil) - func setViewControllersAsync(_ viewControllers: [UIViewController]?, direction: UIPageViewController.NavigationDirection, animated: Bool) async -> Bool + func setViewControllers(_ viewControllers: [UIViewController]?, direction: UIPageViewController.NavigationDirection, animated: Bool) async -> Bool } protocol UIPageViewControllerDelegate : NSObjectProtocol { @available(tvOS 6.0, *) diff --git a/tvOS/UIKit/UIScene.swift b/tvOS/UIKit/UIScene.swift index b5b07a6..111a703 100644 --- a/tvOS/UIKit/UIScene.swift +++ b/tvOS/UIKit/UIScene.swift @@ -6,7 +6,7 @@ class UIScene : UIResponder { var delegate: UISceneDelegate? var activationState: UIScene.ActivationState { get } func open(_ url: URL, options: UIScene.OpenExternalURLOptions?, completionHandler completion: ((Bool) -> Void)? = nil) - func openURLAsync(_ url: URL, options: UIScene.OpenExternalURLOptions?) async -> Bool + func open(_ url: URL, options: UIScene.OpenExternalURLOptions?) async -> Bool var title: String! var activationConditions: UISceneActivationConditions } diff --git a/tvOS/UIKit/UITableView.swift b/tvOS/UIKit/UITableView.swift index 17e8f52..bf2dcfb 100644 --- a/tvOS/UIKit/UITableView.swift +++ b/tvOS/UIKit/UITableView.swift @@ -155,7 +155,7 @@ class UITableView : UIScrollView, NSCoding, UIDataSourceTranslating { @available(tvOS 11.0, *) func performBatchUpdates(_ updates: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(tvOS 11.0, *) - func performBatchUpdatesAsync(_ updates: (() -> Void)?) async -> Bool + func performBatchUpdates(_ updates: (() -> Void)?) async -> Bool func beginUpdates() func endUpdates() func insertSections(_ sections: IndexSet, with animation: UITableView.RowAnimation) diff --git a/tvOS/UIKit/UIView.swift b/tvOS/UIKit/UIView.swift index 44b21fa..803d011 100644 --- a/tvOS/UIKit/UIView.swift +++ b/tvOS/UIKit/UIView.swift @@ -245,29 +245,29 @@ extension UIView { @available(tvOS 4.0, *) class func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions = [], animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(tvOS 4.0, *) - class func animateAsync(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool + class func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool @available(tvOS 4.0, *) class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(tvOS 4.0, *) - class func animateAsync(withDuration duration: TimeInterval, animations: @escaping () -> Void) async -> Bool + class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void) async -> Bool @available(tvOS 4.0, *) class func animate(withDuration duration: TimeInterval, animations: @escaping () -> Void) @available(tvOS 7.0, *) class func animate(withDuration duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping dampingRatio: CGFloat, initialSpringVelocity velocity: CGFloat, options: UIView.AnimationOptions = [], animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(tvOS 7.0, *) - class func animateAsync(withDuration duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping dampingRatio: CGFloat, initialSpringVelocity velocity: CGFloat, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool + class func animate(withDuration duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping dampingRatio: CGFloat, initialSpringVelocity velocity: CGFloat, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) async -> Bool @available(tvOS 4.0, *) class func transition(with view: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(tvOS 4.0, *) - class func transitionAsync(with view: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool + class func transition(with view: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool @available(tvOS 4.0, *) class func transition(from fromView: UIView, to toView: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], completion: ((Bool) -> Void)? = nil) @available(tvOS 4.0, *) - class func transitionAsync(from fromView: UIView, to toView: UIView, duration: TimeInterval, options: UIView.AnimationOptions = []) async -> Bool + class func transition(from fromView: UIView, to toView: UIView, duration: TimeInterval, options: UIView.AnimationOptions = []) async -> Bool @available(tvOS 7.0, *) class func perform(_ animation: UIView.SystemAnimation, on views: [UIView], options: UIView.AnimationOptions = [], animations parallelAnimations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(tvOS 7.0, *) - class func performSystemAnimationAsync(_ animation: UIView.SystemAnimation, on views: [UIView], options: UIView.AnimationOptions = [], animations parallelAnimations: (() -> Void)?) async -> Bool + class func perform(_ animation: UIView.SystemAnimation, on views: [UIView], options: UIView.AnimationOptions = [], animations parallelAnimations: (() -> Void)?) async -> Bool @available(tvOS 12.0, *) class func modifyAnimations(withRepeatCount count: CGFloat, autoreverses: Bool, animations: () -> Void) } @@ -275,7 +275,7 @@ extension UIView { @available(tvOS 7.0, *) class func animateKeyframes(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.KeyframeAnimationOptions = [], animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) @available(tvOS 7.0, *) - class func animateKeyframesAsync(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.KeyframeAnimationOptions = [], animations: @escaping () -> Void) async -> Bool + class func animateKeyframes(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.KeyframeAnimationOptions = [], animations: @escaping () -> Void) async -> Bool @available(tvOS 7.0, *) class func addKeyframe(withRelativeStartTime frameStartTime: Double, relativeDuration frameDuration: Double, animations: @escaping () -> Void) } diff --git a/tvOS/UIKit/UIViewController.swift b/tvOS/UIKit/UIViewController.swift index 458c21b..29886f8 100644 --- a/tvOS/UIKit/UIViewController.swift +++ b/tvOS/UIKit/UIViewController.swift @@ -112,11 +112,11 @@ class UIViewController : UIResponder, NSCoding, UIAppearanceContainer, UITraitEn @available(tvOS 5.0, *) func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) @available(tvOS 5.0, *) - func presentAsync(_ viewControllerToPresent: UIViewController, animated flag: Bool) async + func present(_ viewControllerToPresent: UIViewController, animated flag: Bool) async @available(tvOS 5.0, *) func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) @available(tvOS 5.0, *) - func dismissAsync(animated flag: Bool) async + func dismiss(animated flag: Bool) async @available(tvOS 3.0, *) var modalTransitionStyle: UIModalTransitionStyle @available(tvOS 3.2, *) @@ -161,7 +161,7 @@ extension UIViewController { @available(tvOS 5.0, *) func transition(from fromViewController: UIViewController, to toViewController: UIViewController, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?, completion: ((Bool) -> Void)? = nil) @available(tvOS 5.0, *) - func transitionAsync(from fromViewController: UIViewController, to toViewController: UIViewController, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool + func transition(from fromViewController: UIViewController, to toViewController: UIViewController, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) async -> Bool @available(tvOS 5.0, *) func beginAppearanceTransition(_ isAppearing: Bool, animated: Bool) @available(tvOS 5.0, *) diff --git a/tvOS/UserNotifications/UNUserNotificationCenter.swift b/tvOS/UserNotifications/UNUserNotificationCenter.swift index e80cb31..7009d99 100644 --- a/tvOS/UserNotifications/UNUserNotificationCenter.swift +++ b/tvOS/UserNotifications/UNUserNotificationCenter.swift @@ -24,7 +24,7 @@ class UNUserNotificationCenter : NSObject { func getNotificationSettings(completionHandler: @escaping (UNNotificationSettings) -> Void) func notificationSettings() async -> UNNotificationSettings func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) - func addNotificationRequestAsync(_ request: UNNotificationRequest) async throws + func add(_ request: UNNotificationRequest) async throws func getPendingNotificationRequests(completionHandler: @escaping ([UNNotificationRequest]) -> Void) func pendingNotificationRequests() async -> [UNNotificationRequest] func removePendingNotificationRequests(withIdentifiers identifiers: [String]) diff --git a/watchOS/AVFoundation/AVAsynchronousKeyValueLoading.swift b/watchOS/AVFoundation/AVAsynchronousKeyValueLoading.swift index d104d0f..22888c5 100644 --- a/watchOS/AVFoundation/AVAsynchronousKeyValueLoading.swift +++ b/watchOS/AVFoundation/AVAsynchronousKeyValueLoading.swift @@ -11,5 +11,5 @@ enum AVKeyValueStatus : Int { protocol AVAsynchronousKeyValueLoading { func statusOfValue(forKey key: String, error outError: NSErrorPointer) -> AVKeyValueStatus func loadValuesAsynchronously(forKeys keys: [String], completionHandler handler: (() -> Void)? = nil) - func loadValuesAsync(forKeys keys: [String]) async + func loadValues(forKeys keys: [String]) async } diff --git a/watchOS/AVFoundation/AVCaptureDevice.swift b/watchOS/AVFoundation/AVCaptureDevice.swift index d273904..8287f9b 100644 --- a/watchOS/AVFoundation/AVCaptureDevice.swift +++ b/watchOS/AVFoundation/AVCaptureDevice.swift @@ -94,7 +94,7 @@ extension AVCaptureDevice { @available(watchOS 2.0, *) func setExposureTargetBias(_ bias: Float, completionHandler handler: ((CMTime) -> Void)? = nil) @available(watchOS 2.0, *) - func setExposureTargetBiasAsync(_ bias: Float) async -> CMTime + func setExposureTargetBias(_ bias: Float) async -> CMTime } extension AVCaptureDevice { } diff --git a/watchOS/AVFoundation/AVPlayer.swift b/watchOS/AVFoundation/AVPlayer.swift index 73c3307..c8669ca 100644 --- a/watchOS/AVFoundation/AVPlayer.swift +++ b/watchOS/AVFoundation/AVPlayer.swift @@ -65,17 +65,17 @@ extension AVPlayer { @available(watchOS 1.0, *) func seek(to date: Date, completionHandler: @escaping (Bool) -> Void) @available(watchOS 1.0, *) - func seekAsync(to date: Date) async -> Bool + func seek(to date: Date) async -> Bool func seek(to time: CMTime) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) @available(watchOS 1.0, *) func seek(to time: CMTime, completionHandler: @escaping (Bool) -> Void) @available(watchOS 1.0, *) - func seekAsync(to time: CMTime) async -> Bool + func seek(to time: CMTime) async -> Bool @available(watchOS 1.0, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: @escaping (Bool) -> Void) @available(watchOS 1.0, *) - func seekAsync(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool } extension AVPlayer { @available(watchOS 3.0, *) @@ -85,7 +85,7 @@ extension AVPlayer { @available(watchOS 1.0, *) func preroll(atRate rate: Float, completionHandler: ((Bool) -> Void)? = nil) @available(watchOS 1.0, *) - func prerollAsync(atRate rate: Float) async -> Bool + func preroll(atRate rate: Float) async -> Bool @available(watchOS 1.0, *) func cancelPendingPrerolls() @available(watchOS 1.0, *) diff --git a/watchOS/AVFoundation/AVPlayerItem.swift b/watchOS/AVFoundation/AVPlayerItem.swift index 53738fd..27f3325 100644 --- a/watchOS/AVFoundation/AVPlayerItem.swift +++ b/watchOS/AVFoundation/AVPlayerItem.swift @@ -83,11 +83,11 @@ extension AVPlayerItem { @available(watchOS 1.0, *) func seek(to time: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(watchOS 1.0, *) - func seekAsync(to time: CMTime) async -> Bool + func seek(to time: CMTime) async -> Bool @available(watchOS 1.0, *) func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime, completionHandler: ((Bool) -> Void)? = nil) @available(watchOS 1.0, *) - func seekAsync(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool + func seek(to time: CMTime, toleranceBefore: CMTime, toleranceAfter: CMTime) async -> Bool @available(watchOS 1.0, *) func cancelPendingSeeks() func currentDate() -> Date? diff --git a/watchOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift b/watchOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift index 318ae5b..3049774 100644 --- a/watchOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift +++ b/watchOS/AVFoundation/AVSampleBufferRenderSynchronizer.swift @@ -15,7 +15,7 @@ extension AVSampleBufferRenderSynchronizer { var renderers: [AVQueuedSampleBufferRendering] { get } func addRenderer(_ renderer: AVQueuedSampleBufferRendering) func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime, completionHandler: ((Bool) -> Void)? = nil) - func removeRendererAsync(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool + func removeRenderer(_ renderer: AVQueuedSampleBufferRendering, at time: CMTime) async -> Bool } extension AVSampleBufferRenderSynchronizer { func addPeriodicTimeObserver(forInterval interval: CMTime, queue: DispatchQueue?, using block: @escaping (CMTime) -> Void) -> Any diff --git a/watchOS/CoreLocation/CLLocationManager.swift b/watchOS/CoreLocation/CLLocationManager.swift index fa1812a..adddb42 100644 --- a/watchOS/CoreLocation/CLLocationManager.swift +++ b/watchOS/CoreLocation/CLLocationManager.swift @@ -70,7 +70,7 @@ class CLLocationManager : NSObject { @available(watchOS 7.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String, completion: ((Error?) -> Void)? = nil) @available(watchOS 7.0, *) - func requestTemporaryFullAccuracyAuthorizationAsync(withPurposeKey purposeKey: String) async throws + func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) async throws @available(watchOS 7.0, *) func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String) @available(watchOS 3.0, *) diff --git a/watchOS/Foundation/NSExtensionContext.swift b/watchOS/Foundation/NSExtensionContext.swift index b3d9da3..fee646a 100644 --- a/watchOS/Foundation/NSExtensionContext.swift +++ b/watchOS/Foundation/NSExtensionContext.swift @@ -6,7 +6,7 @@ class NSExtensionContext : NSObject { func completeRequest(returningItems items: [Any]?) async -> Bool func cancelRequest(withError error: Error) func open(_ URL: URL, completionHandler: ((Bool) -> Void)? = nil) - func openURLAsync(_ URL: URL) async -> Bool + func open(_ URL: URL) async -> Bool } @available(watchOS 2.0, *) let NSExtensionItemsAndErrorsKey: String diff --git a/watchOS/Foundation/NSItemProvider.swift b/watchOS/Foundation/NSItemProvider.swift index c81a4ec..87a3f38 100644 --- a/watchOS/Foundation/NSItemProvider.swift +++ b/watchOS/Foundation/NSItemProvider.swift @@ -75,7 +75,7 @@ class NSItemProvider : NSObject, NSCopying { convenience init?(contentsOf fileURL: URL!) func registerItem(forTypeIdentifier typeIdentifier: String, loadHandler: @escaping NSItemProvider.LoadHandler) func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil, completionHandler: NSItemProvider.CompletionHandler? = nil) - func loadItemAsync(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding + func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> NSSecureCoding } @available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) @@ -95,7 +95,7 @@ extension NSItemProvider { @available(watchOS 2.0, *) func loadPreviewImage(options: [AnyHashable : Any]! = [:], completionHandler: NSItemProvider.CompletionHandler!) @available(watchOS 2.0, *) - func loadPreviewImageAsync(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding + func loadPreviewImage(options: [AnyHashable : Any]! = [:]) async throws -> NSSecureCoding } @available(watchOS 2.0, *) let NSExtensionJavaScriptPreprocessingResultsKey: String diff --git a/watchOS/GameKit/GKAchievement.swift b/watchOS/GameKit/GKAchievement.swift index 97812d8..079ff96 100644 --- a/watchOS/GameKit/GKAchievement.swift +++ b/watchOS/GameKit/GKAchievement.swift @@ -2,16 +2,16 @@ @available(watchOS 3.0, *) class GKAchievement : NSObject, NSCoding, NSSecureCoding { class func loadAchievements(completionHandler: (([GKAchievement]?, Error?) -> Void)? = nil) - class func loadAchievementsAsync() async throws -> [GKAchievement] + class func loadAchievements() async throws -> [GKAchievement] class func resetAchievements(completionHandler: ((Error?) -> Void)? = nil) - class func resetAchievementsAsync() async throws + class func resetAchievements() async throws init(identifier: String) @available(watchOS 2.0, *) init(identifier: String, player: GKPlayer) @available(watchOS 2.0, *) class func report(_ achievements: [GKAchievement], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 2.0, *) - class func reportAchievementsAsync(_ achievements: [GKAchievement]) async throws + class func report(_ achievements: [GKAchievement]) async throws var identifier: String var percentComplete: Double var isCompleted: Bool { get } @@ -25,7 +25,7 @@ extension GKAchievement { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use +reportAchievements:withCompletionHandler:") func report(completionHandler: ((Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use +reportAchievements:withCompletionHandler:") - func reportAsync() async throws + func report() async throws @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use isHidden on the GKAchievementDescription class instead") var isHidden: Bool { get } } diff --git a/watchOS/GameKit/GKAchievementDescription.swift b/watchOS/GameKit/GKAchievementDescription.swift index d062b16..0656a8e 100644 --- a/watchOS/GameKit/GKAchievementDescription.swift +++ b/watchOS/GameKit/GKAchievementDescription.swift @@ -2,7 +2,7 @@ @available(watchOS 3.0, *) class GKAchievementDescription : NSObject, NSCoding, NSSecureCoding { class func loadAchievementDescriptions(completionHandler: (([GKAchievementDescription]?, Error?) -> Void)? = nil) - class func loadAchievementDescriptionsAsync() async throws -> [GKAchievementDescription] + class func loadAchievementDescriptions() async throws -> [GKAchievementDescription] var identifier: String { get } @available(watchOS 2.0, *) var groupIdentifier: String? { get } diff --git a/watchOS/GameKit/GKLeaderboard.swift b/watchOS/GameKit/GKLeaderboard.swift index 1bdb505..d8a2095 100644 --- a/watchOS/GameKit/GKLeaderboard.swift +++ b/watchOS/GameKit/GKLeaderboard.swift @@ -69,11 +69,11 @@ extension GKLeaderboard { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use loadLeaderboardsWithIDs:completionHandler: instead") class func loadCategories(completionHandler: (([String]?, [String]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use loadLeaderboardsWithIDs:completionHandler: instead") - class func loadCategoriesAsync() async throws -> ([String], [String]) + class func loadCategories() async throws -> ([String], [String]) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use setDefaultLeaderboardIdentifier:completionHandler: on GKLocalPlayer instead") class func setDefault(_ leaderboardIdentifier: String?, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use setDefaultLeaderboardIdentifier:completionHandler: on GKLocalPlayer instead") - class func setDefaultAsync(_ leaderboardIdentifier: String?) async throws + class func setDefault(_ leaderboardIdentifier: String?) async throws @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler: instead.") var timeScope: GKLeaderboard.TimeScope @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler: instead.") @@ -95,9 +95,9 @@ extension GKLeaderboard { @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") func loadScores(completionHandler: (([GKScore]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadEntriesForPlayerScope:timeScope:range:completionHandler:.") - func loadScoresAsync() async throws -> [GKScore] + func loadScores() async throws -> [GKScore] @available(watchOS, introduced: 2.0, deprecated: 7.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") class func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 7.0, message: "Use class method loadLeaderboardsWithIDs:completionHandler:") - class func loadLeaderboardsAsync() async throws -> [GKLeaderboard] + class func loadLeaderboards() async throws -> [GKLeaderboard] } diff --git a/watchOS/GameKit/GKLeaderboardSet.swift b/watchOS/GameKit/GKLeaderboardSet.swift index 58671d2..2212e3b 100644 --- a/watchOS/GameKit/GKLeaderboardSet.swift +++ b/watchOS/GameKit/GKLeaderboardSet.swift @@ -7,7 +7,7 @@ class GKLeaderboardSet : NSObject, NSCoding, NSSecureCoding { @available(watchOS 2.0, *) class func loadLeaderboardSets(completionHandler: (([GKLeaderboardSet]?, Error?) -> Void)? = nil) @available(watchOS 2.0, *) - class func loadLeaderboardSetsAsync() async throws -> [GKLeaderboardSet] + class func loadLeaderboardSets() async throws -> [GKLeaderboardSet] @available(watchOS 7.0, *) func loadLeaderboards(handler: @escaping ([GKLeaderboard]?, Error?) -> Void) } @@ -15,5 +15,5 @@ extension GKLeaderboardSet { @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadLeaderboardsWithHandler: instead.") func loadLeaderboards(completionHandler: (([GKLeaderboard]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 3.0, deprecated: 7.0, message: "Use loadLeaderboardsWithHandler: instead.") - func loadLeaderboardsAsync() async throws -> [GKLeaderboard] + func loadLeaderboards() async throws -> [GKLeaderboard] } diff --git a/watchOS/GameKit/GKLocalPlayer.swift b/watchOS/GameKit/GKLocalPlayer.swift index 04f1c53..115428e 100644 --- a/watchOS/GameKit/GKLocalPlayer.swift +++ b/watchOS/GameKit/GKLocalPlayer.swift @@ -9,21 +9,21 @@ class GKLocalPlayer : GKPlayer { @available(watchOS 3.0, *) func loadRecentPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func loadRecentPlayersAsync() async throws -> [GKPlayer] + func loadRecentPlayers() async throws -> [GKPlayer] func loadChallengableFriends(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - func loadChallengableFriendsAsync() async throws -> [GKPlayer] + func loadChallengableFriends() async throws -> [GKPlayer] @available(watchOS 3.0, *) func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func setDefaultLeaderboardIdentifierAsync(_ leaderboardIdentifier: String) async throws + func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String) async throws @available(watchOS 3.0, *) func loadDefaultLeaderboardIdentifier(completionHandler: ((String?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func loadDefaultLeaderboardIdentifierAsync() async throws -> String + func loadDefaultLeaderboardIdentifier() async throws -> String @available(watchOS 6.5, *) func fetchItems(forIdentityVerificationSignature completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(watchOS 6.5, *) - func fetchItemsForIdentityVerificationSignatureAsync() async throws -> (URL, Data, Data, UInt64) + func fetchItemsForIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) } protocol GKLocalPlayerListener : GKChallengeListener, GKInviteEventListener, GKTurnBasedEventListener { } @@ -43,29 +43,29 @@ extension GKLocalPlayer { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use setDefaultLeaderboardIdentifier:completionHandler: instead") func setDefaultLeaderboardCategoryID(_ categoryID: String?, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use setDefaultLeaderboardIdentifier:completionHandler: instead") - func setDefaultLeaderboardCategoryIDAsync(_ categoryID: String?) async throws + func setDefaultLeaderboardCategoryID(_ categoryID: String?) async throws @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use loadDefaultLeaderboardIdentifierWithCompletionHandler: instead") func loadDefaultLeaderboardCategoryID(completionHandler: ((String?, Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use loadDefaultLeaderboardIdentifierWithCompletionHandler: instead") - func loadDefaultLeaderboardCategoryIDAsync() async throws -> String + func loadDefaultLeaderboardCategoryID() async throws -> String @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Set the authenticateHandler instead") func authenticate(completionHandler: ((Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Set the authenticateHandler instead") - func authenticateAsync() async throws + func authenticate() async throws @available(watchOS, introduced: 2.0, deprecated: 3.0) func loadFriendPlayers(completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 3.0) - func loadFriendPlayersAsync() async throws -> [GKPlayer] + func loadFriendPlayers() async throws -> [GKPlayer] @available(watchOS, introduced: 3.0, deprecated: 6.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") func generateIdentityVerificationSignature(completionHandler: ((URL?, Data?, Data?, UInt64, Error?) -> Void)? = nil) @available(watchOS, introduced: 3.0, deprecated: 6.5, message: "API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.") - func generateIdentityVerificationSignatureAsync() async throws -> (URL, Data, Data, UInt64) + func generateIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64) } extension GKLocalPlayer { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") func loadFriends(completionHandler: (([String]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use loadRecentPlayersWithCompletionHandler: instead") - func loadFriendsAsync() async throws -> [String] + func loadFriends() async throws -> [String] @available(watchOS, introduced: 2.0, deprecated: 2.0, message: " This property is obsolete, Use loadFriendPlayersWithCompletionHandler: instead") var friends: [String]? { get } } diff --git a/watchOS/GameKit/GKMatchmaker.swift b/watchOS/GameKit/GKMatchmaker.swift index c41451e..bcfb3ae 100644 --- a/watchOS/GameKit/GKMatchmaker.swift +++ b/watchOS/GameKit/GKMatchmaker.swift @@ -62,5 +62,5 @@ extension GKMatchmaker { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") func findPlayers(forHostedMatchRequest request: GKMatchRequest, withCompletionHandler completionHandler: (([String]?, Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This is never invoked and its implementation does nothing, use findPlayersForHostedRequest:") - func findPlayersAsync(forHostedMatchRequest request: GKMatchRequest) async throws -> [String] + func findPlayers(forHostedMatchRequest request: GKMatchRequest) async throws -> [String] } diff --git a/watchOS/GameKit/GKPlayer.swift b/watchOS/GameKit/GKPlayer.swift index e5cac0c..de94d16 100644 --- a/watchOS/GameKit/GKPlayer.swift +++ b/watchOS/GameKit/GKPlayer.swift @@ -2,7 +2,7 @@ @available(watchOS 3.0, *) class GKPlayer : GKBasePlayer { class func loadPlayers(forIdentifiers identifiers: [String], withCompletionHandler completionHandler: (([GKPlayer]?, Error?) -> Void)? = nil) - class func loadPlayersAsync(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] + class func loadPlayers(forIdentifiers identifiers: [String]) async throws -> [GKPlayer] var alias: String { get } } extension NSNotification.Name { diff --git a/watchOS/GameKit/GKScore.swift b/watchOS/GameKit/GKScore.swift index fbc191e..2bf6c6c 100644 --- a/watchOS/GameKit/GKScore.swift +++ b/watchOS/GameKit/GKScore.swift @@ -19,13 +19,13 @@ class GKScore : NSObject, NSCoding, NSSecureCoding { @available(watchOS 3.0, *) class func report(_ scores: [GKScore], withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - class func reportScoresAsync(_ scores: [GKScore]) async throws + class func report(_ scores: [GKScore]) async throws } extension GKScore { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use +reportScores:withCompletionhandler: instead") func report(completionHandler: ((Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use +reportScores:withCompletionhandler: instead") - func reportAsync() async throws + func report() async throws @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use initWithLeaderboardIdentifier: instead") init(category: String?) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use leaderboardIdentifier instead") diff --git a/watchOS/GameKit/GKTurnBasedMatch.swift b/watchOS/GameKit/GKTurnBasedMatch.swift index a432f7f..c254837 100644 --- a/watchOS/GameKit/GKTurnBasedMatch.swift +++ b/watchOS/GameKit/GKTurnBasedMatch.swift @@ -96,43 +96,43 @@ class GKTurnBasedMatch : NSObject { class func find(for request: GKMatchRequest, withCompletionHandler completionHandler: @escaping (GKTurnBasedMatch?, Error?) -> Void) class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch class func loadMatches(completionHandler: (([GKTurnBasedMatch]?, Error?) -> Void)? = nil) - class func loadMatchesAsync() async throws -> [GKTurnBasedMatch] + class func loadMatches() async throws -> [GKTurnBasedMatch] @available(watchOS 3.0, *) class func load(withID matchID: String, withCompletionHandler completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) - class func loadAsync(withID matchID: String) async throws -> GKTurnBasedMatch + class func load(withID matchID: String) async throws -> GKTurnBasedMatch @available(watchOS 3.0, *) func rematch(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func rematchAsync() async throws -> GKTurnBasedMatch + func rematch() async throws -> GKTurnBasedMatch @available(watchOS 3.0, *) func acceptInvite(completionHandler: ((GKTurnBasedMatch?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func acceptInviteAsync() async throws -> GKTurnBasedMatch + func acceptInvite() async throws -> GKTurnBasedMatch @available(watchOS 3.0, *) func declineInvite(completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func declineInviteAsync() async throws + func declineInvite() async throws func remove(completionHandler: ((Error?) -> Void)? = nil) - func removeAsync() async throws + func remove() async throws func loadMatchData(completionHandler: ((Data?, Error?) -> Void)? = nil) - func loadMatchDataAsync() async throws -> Data + func loadMatchData() async throws -> Data @available(watchOS 3.0, *) func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func endTurnAsync(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + func endTurn(withNextParticipants nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws @available(watchOS 3.0, *) func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func participantQuitInTurnAsync(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws + func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipants: [GKTurnBasedParticipant], turnTimeout timeout: TimeInterval, match matchData: Data) async throws func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) - func participantQuitOutOfTurnAsync(with matchOutcome: GKTurnBasedMatch.Outcome) async throws + func participantQuitOutOfTurn(with matchOutcome: GKTurnBasedMatch.Outcome) async throws func endMatchInTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) - func endMatchInTurnAsync(withMatch matchData: Data) async throws + func endMatchInTurn(withMatch matchData: Data) async throws @available(watchOS, introduced: 2.0, deprecated: 7.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 7.0, message: "pass GKLeaderboardScore to endMatchInTurnWithMatchData:scores:completionHandler instead") - func endMatchInTurnAsync(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws + func endMatchInTurn(withMatch matchData: Data, scores: [GKScore]?, achievements: [GKAchievement]?) async throws @available(watchOS 7.0, *) func endMatchInTurn(withMatch matchData: Data, leaderboardScores scores: [GKLeaderboardScore], achievements: [Any], completionHandler: @escaping (Error?) -> Void) @available(watchOS 7.0, *) @@ -140,27 +140,27 @@ class GKTurnBasedMatch : NSObject { @available(watchOS 3.0, *) func saveCurrentTurn(withMatch matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func saveCurrentTurnAsync(withMatch matchData: Data) async throws + func saveCurrentTurn(withMatch matchData: Data) async throws @available(watchOS 3.0, *) func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange], completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func saveMergedMatchDataAsync(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws + func saveMergedMatch(_ matchData: Data, withResolvedExchanges exchanges: [GKTurnBasedExchange]) async throws @available(watchOS 3.0, *) func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval, completionHandler: ((GKTurnBasedExchange?, Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func sendExchangeAsync(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange + func sendExchange(to participants: [GKTurnBasedParticipant], data: Data, localizableMessageKey key: String, arguments: [String], timeout: TimeInterval) async throws -> GKTurnBasedExchange @available(watchOS 3.0, *) func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func sendReminderAsync(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws + func sendReminder(to participants: [GKTurnBasedParticipant], localizableMessageKey key: String, arguments: [String]) async throws @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use endTurnWithNextParticipants:... instead") func endTurn(withNextParticipant nextParticipant: GKTurnBasedParticipant, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use endTurnWithNextParticipants:... instead") - func endTurnAsync(withNextParticipant nextParticipant: GKTurnBasedParticipant, match matchData: Data) async throws + func endTurn(withNextParticipant nextParticipant: GKTurnBasedParticipant, match matchData: Data) async throws @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use participantQuitInTurnWithOutcome:nextParticipants:turnTimeout:... instead") func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipant: GKTurnBasedParticipant, match matchData: Data, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use participantQuitInTurnWithOutcome:nextParticipants:turnTimeout:... instead") - func participantQuitInTurnAsync(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipant: GKTurnBasedParticipant, match matchData: Data) async throws + func participantQuitInTurn(with matchOutcome: GKTurnBasedMatch.Outcome, nextParticipant: GKTurnBasedParticipant, match matchData: Data) async throws } @available(watchOS 3.0, *) enum GKTurnBasedExchangeStatus : Int8 { @@ -191,11 +191,11 @@ class GKTurnBasedExchange : NSObject { @available(watchOS 3.0, *) func cancel(withLocalizableMessageKey key: String, arguments: [String], completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func cancelAsync(withLocalizableMessageKey key: String, arguments: [String]) async throws + func cancel(withLocalizableMessageKey key: String, arguments: [String]) async throws @available(watchOS 3.0, *) func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 3.0, *) - func replyAsync(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws + func reply(withLocalizableMessageKey key: String, arguments: [String], data: Data) async throws } @available(watchOS 3.0, *) class GKTurnBasedExchangeReply : NSObject { diff --git a/watchOS/Intents/INRelevantShortcutStore.swift b/watchOS/Intents/INRelevantShortcutStore.swift index aeb81e4..fba5c9a 100644 --- a/watchOS/Intents/INRelevantShortcutStore.swift +++ b/watchOS/Intents/INRelevantShortcutStore.swift @@ -3,5 +3,5 @@ class INRelevantShortcutStore : NSObject { class var `default`: INRelevantShortcutStore { get } func setRelevantShortcuts(_ shortcuts: [INRelevantShortcut], completionHandler: ((Error?) -> Void)? = nil) - func setRelevantShortcutsAsync(_ shortcuts: [INRelevantShortcut]) async throws + func setRelevantShortcuts(_ shortcuts: [INRelevantShortcut]) async throws } diff --git a/watchOS/NetworkExtension/NetworkExtension.swift b/watchOS/NetworkExtension/NetworkExtension.swift index edefa5f..f0a7aa9 100644 --- a/watchOS/NetworkExtension/NetworkExtension.swift +++ b/watchOS/NetworkExtension/NetworkExtension.swift @@ -93,7 +93,7 @@ class NEHotspotConfigurationManager : NSObject { @available(watchOS 7.0, *) func apply(_ configuration: NEHotspotConfiguration, completionHandler: ((Error?) -> Void)? = nil) @available(watchOS 7.0, *) - func applyConfigurationAsync(_ configuration: NEHotspotConfiguration) async throws + func apply(_ configuration: NEHotspotConfiguration) async throws @available(watchOS 7.0, *) func removeConfiguration(forSSID SSID: String) @available(watchOS 7.0, *) diff --git a/watchOS/PassKit/PKPassLibrary.swift b/watchOS/PassKit/PKPassLibrary.swift index b98fda7..f74c3f6 100644 --- a/watchOS/PassKit/PKPassLibrary.swift +++ b/watchOS/PassKit/PKPassLibrary.swift @@ -32,7 +32,7 @@ class PKPassLibrary : NSObject { @available(watchOS 3.0, *) func addPasses(_ passes: [PKPass], withCompletionHandler completion: ((PKPassLibraryAddPassesStatus) -> Void)? = nil) @available(watchOS 3.0, *) - func addPassesAsync(_ passes: [PKPass]) async -> PKPassLibraryAddPassesStatus + func addPasses(_ passes: [PKPass]) async -> PKPassLibraryAddPassesStatus @available(watchOS, introduced: 2.0, deprecated: 99993, message: "Use -[PKPassLibrary canAddSecureElementPassWithPrimaryAccountIdentifier] instead") func canAddPaymentPass(withPrimaryAccountIdentifier primaryAccountIdentifier: String) -> Bool @available(watchOS 6.4, *) @@ -42,7 +42,7 @@ class PKPassLibrary : NSObject { @available(watchOS, introduced: 2.0, deprecated: 99993, message: "Use activateSecureElementPass:withActivationData:completion: instead") func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data, completion: ((Bool, Error) -> Void)? = nil) @available(watchOS, introduced: 2.0, deprecated: 99993, message: "Use activateSecureElementPass:withActivationData:completion: instead") - func activatePaymentPassAsync(_ paymentPass: PKPaymentPass, withActivationData activationData: Data) async -> (Bool, Error) + func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data) async -> (Bool, Error) @available(watchOS 6.2, *) func sign(_ signData: Data, using secureElementPass: PKSecureElementPass, completion: @escaping (Data?, Data?, Error?) -> Void) @available(watchOS 6.2, *) diff --git a/watchOS/PassKit/PKPaymentAuthorizationController.swift b/watchOS/PassKit/PKPaymentAuthorizationController.swift index 3f83b2d..452fbfe 100644 --- a/watchOS/PassKit/PKPaymentAuthorizationController.swift +++ b/watchOS/PassKit/PKPaymentAuthorizationController.swift @@ -47,7 +47,7 @@ class PKPaymentAuthorizationController : NSObject { weak var delegate: @sil_weak PKPaymentAuthorizationControllerDelegate? init(paymentRequest request: PKPaymentRequest) func present(completion: ((Bool) -> Void)? = nil) - func presentAsync() async -> Bool + func present() async -> Bool func dismiss(completion: (() -> Void)? = nil) - func dismissAsync() async + func dismiss() async } diff --git a/watchOS/SoundAnalysis/SNAnalyzer.swift b/watchOS/SoundAnalysis/SNAnalyzer.swift index c06461e..919d21d 100644 --- a/watchOS/SoundAnalysis/SNAnalyzer.swift +++ b/watchOS/SoundAnalysis/SNAnalyzer.swift @@ -16,6 +16,6 @@ class SNAudioFileAnalyzer : NSObject { func removeAllRequests() func analyze() func analyze(completionHandler: @escaping (Bool) -> Void) - func analyzeAsync() async -> Bool + func analyze() async -> Bool func cancelAnalysis() } diff --git a/watchOS/SpriteKit/SKNode.swift b/watchOS/SpriteKit/SKNode.swift index 9f5db34..66a4201 100644 --- a/watchOS/SpriteKit/SKNode.swift +++ b/watchOS/SpriteKit/SKNode.swift @@ -56,7 +56,7 @@ class SKNode : NSObject, NSCopying, NSSecureCoding { func inParentHierarchy(_ parent: SKNode) -> Bool func run(_ action: SKAction) func run(_ action: SKAction, completion block: @escaping () -> Void) - func runActionAsync(_ action: SKAction) async + func run(_ action: SKAction) async func run(_ action: SKAction, withKey key: String) func hasActions() -> Bool func action(forKey key: String) -> SKAction? diff --git a/watchOS/UserNotifications/UNUserNotificationCenter.swift b/watchOS/UserNotifications/UNUserNotificationCenter.swift index 02f8d56..65f1088 100644 --- a/watchOS/UserNotifications/UNUserNotificationCenter.swift +++ b/watchOS/UserNotifications/UNUserNotificationCenter.swift @@ -29,7 +29,7 @@ class UNUserNotificationCenter : NSObject { func getNotificationSettings(completionHandler: @escaping (UNNotificationSettings) -> Void) func notificationSettings() async -> UNNotificationSettings func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Void)? = nil) - func addNotificationRequestAsync(_ request: UNNotificationRequest) async throws + func add(_ request: UNNotificationRequest) async throws func getPendingNotificationRequests(completionHandler: @escaping ([UNNotificationRequest]) -> Void) func pendingNotificationRequests() async -> [UNNotificationRequest] func removePendingNotificationRequests(withIdentifiers identifiers: [String]) diff --git a/watchOS/WatchKit/WKExtension.swift b/watchOS/WatchKit/WKExtension.swift index 2d9de0b..3e3cc8b 100644 --- a/watchOS/WatchKit/WKExtension.swift +++ b/watchOS/WatchKit/WKExtension.swift @@ -71,7 +71,7 @@ protocol WKExtensionDelegate : NSObjectProtocol { @available(watchOS 6.0, *) @asyncHandler optional func didReceiveRemoteNotification(_ userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (WKBackgroundFetchResult) -> Void) @available(watchOS 6.0, *) - optional func didReceiveRemoteNotificationAsync(_ userInfo: [AnyHashable : Any]) async -> WKBackgroundFetchResult + optional func didReceiveRemoteNotification(_ userInfo: [AnyHashable : Any]) async -> WKBackgroundFetchResult @available(watchOS 2.0, *) @available(watchOS, deprecated: 3.0, message: "use UNUserNotificationCenterDelegate") optional func handleAction(withIdentifier identifier: String?, forRemoteNotification remoteNotification: [AnyHashable : Any]) From 5b4aafae84e302db9a60146093595b5c73ea3e9b Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Thu, 10 Dec 2020 16:12:53 -0800 Subject: [PATCH 9/9] Remove all of the @asyncHandlers. --- iOS/ARKit/ARCoachingOverlayView.swift | 4 +- iOS/ARKit/ARSCNView.swift | 6 +- iOS/ARKit/ARSKView.swift | 6 +- iOS/ARKit/ARSession.swift | 16 ++--- iOS/AVFoundation/AVAssetDownloadTask.swift | 10 +-- iOS/AVFoundation/AVAssetResourceLoader.swift | 4 +- iOS/AVFoundation/AVAssetWriter.swift | 4 +- .../AVCaptureAudioDataOutput.swift | 2 +- .../AVCaptureDataOutputSynchronizer.swift | 2 +- .../AVCaptureDepthDataOutput.swift | 4 +- iOS/AVFoundation/AVCaptureFileOutput.swift | 4 +- .../AVCaptureMetadataOutput.swift | 2 +- iOS/AVFoundation/AVCapturePhotoOutput.swift | 14 ++-- .../AVCaptureVideoDataOutput.swift | 4 +- iOS/AVFoundation/AVContentKeySession.swift | 14 ++-- .../AVPlayerItemMediaDataCollector.swift | 2 +- iOS/AVFoundation/AVPlayerItemOutput.swift | 4 +- iOS/AVKit/AVPictureInPictureController.swift | 4 +- iOS/AVKit/AVPlayerViewController.swift | 4 +- iOS/AVKit/AVRoutePickerView.swift | 2 +- .../ABNewPersonViewController.swift | 2 +- .../ABPeoplePickerNavigationController.swift | 6 +- .../ABUnknownPersonViewController.swift | 2 +- ...AuthenticationModificationController.swift | 4 +- .../ASAuthorizationController.swift | 4 +- .../AutomaticAssessmentConfiguration.swift | 4 +- iOS/CallKit/CXProvider.swift | 4 +- iOS/CarPlay/CPInterfaceController.swift | 12 ++-- iOS/CarPlay/CPListTemplate.swift | 2 +- iOS/CarPlay/CPMapTemplate.swift | 16 ++--- iOS/CarPlay/CPPointOfInterestTemplate.swift | 4 +- iOS/CarPlay/CPTabBarTemplate.swift | 2 +- .../CPTemplateApplicationDashboardScene.swift | 4 +- iOS/CarPlay/CPTemplateApplicationScene.swift | 12 ++-- .../CNContactPickerViewController.swift | 10 +-- iOS/ContactsUI/CNContactViewController.swift | 2 +- iOS/CoreBluetooth/CBCentralManager.swift | 12 ++-- iOS/CoreBluetooth/CBPeripheral.swift | 28 ++++---- iOS/CoreBluetooth/CBPeripheralManager.swift | 20 +++--- iOS/CoreData/NSFetchedResultsController.swift | 8 +-- .../CLLocationManagerDelegate.swift | 32 +++++----- .../CMHeadphoneMotionManagerDelegate.swift | 4 +- iOS/CoreNFC/CoreNFC.swift | 26 ++++---- iOS/CoreSpotlight/CSSearchableIndex.swift | 4 +- .../CTTelephonyNetworkInfo.swift | 2 +- iOS/EventKitUI/EKCalendarChooser.swift | 6 +- .../EKEventEditViewController.swift | 2 +- iOS/EventKitUI/EKEventViewController.swift | 2 +- iOS/ExternalAccessory/EAAccessory.swift | 2 +- .../EAWiFiUnconfiguredAccessoryBrowser.swift | 8 +-- .../NSFileProviderEnumerating.swift | 6 +- iOS/Foundation/NSFilePresenter.swift | 24 +++---- iOS/Foundation/NSKeyedArchiver.swift | 6 +- iOS/Foundation/NSNetServices.swift | 26 ++++---- iOS/Foundation/NSURLConnection.swift | 20 +++--- iOS/Foundation/NSURLProtocol.swift | 12 ++-- iOS/Foundation/NSURLSession.swift | 34 +++++----- iOS/Foundation/NSUserActivity.swift | 2 +- iOS/Foundation/NSXMLParser.swift | 12 ++-- iOS/GameKit/GKEventListener.swift | 4 +- ...GKFriendRequestComposeViewController.swift | 2 +- iOS/GameKit/GKGameCenterViewController.swift | 2 +- iOS/GameKit/GKGameSessionEventListener.swift | 12 ++-- iOS/GameKit/GKMatch.swift | 12 ++-- iOS/GameKit/GKMatchmaker.swift | 6 +- iOS/GameKit/GKMatchmakerViewController.swift | 10 +-- iOS/GameKit/GKSavedGameListener.swift | 2 +- iOS/GameKit/GKTurnBasedMatch.swift | 6 +- .../GKTurnBasedMatchmakerViewController.swift | 4 +- iOS/GameplayKit/GKAgent.swift | 2 +- iOS/HomeKit/HMAccessory.swift | 18 +++--- iOS/HomeKit/HMAccessoryBrowser.swift | 4 +- iOS/HomeKit/HMCameraSnapshotControl.swift | 4 +- iOS/HomeKit/HMCameraStreamControl.swift | 4 +- iOS/HomeKit/HMHome.swift | 64 +++++++++---------- iOS/HomeKit/HMHomeManager.swift | 12 ++-- .../HMNetworkConfigurationProfile.swift | 2 +- iOS/ImageCaptureCore/ICCameraDevice.swift | 32 +++++----- iOS/ImageCaptureCore/ICDevice.swift | 14 ++-- iOS/ImageCaptureCore/ICDeviceBrowser.swift | 10 +-- .../INGetCarPowerLevelStatusIntent.swift | 2 +- iOS/Intents/INGetRideStatusIntent.swift | 2 +- .../INUIAddVoiceShortcutViewController.swift | 4 +- .../INUIEditVoiceShortcutViewController.swift | 6 +- iOS/MapKit/MKLocalSearchCompleter.swift | 4 +- iOS/MapKit/MKMapView.swift | 28 ++++---- iOS/MediaPlayer/MPMediaPickerController.swift | 4 +- .../MPPlayableContentDelegate.swift | 2 +- .../MFMailComposeViewController.swift | 2 +- .../MFMessageComposeViewController.swift | 2 +- iOS/MetricKit/MXMetricManager.swift | 4 +- .../MCAdvertiserAssistant.swift | 2 +- .../MCBrowserViewController.swift | 2 +- .../MCNearbyServiceAdvertiser.swift | 4 +- .../MCNearbyServiceBrowser.swift | 2 +- iOS/MultipeerConnectivity/MCSession.swift | 12 ++-- iOS/NearbyInteraction/NISession.swift | 6 +- iOS/NetworkExtension/NetworkExtension.swift | 2 +- .../NCWidgetProviding.swift | 2 +- iOS/PDFKit/PDFDocument.swift | 16 ++--- iOS/PassKit/PKAddPassesViewController.swift | 2 +- .../PKAddPaymentPassViewController.swift | 2 +- ...PKAddSecureElementPassViewController.swift | 4 +- ...KDisbursementAuthorizationController.swift | 4 +- .../PKPaymentAuthorizationController.swift | 20 +++--- ...tAuthorizationViewControllerDelegate.swift | 22 +++---- iOS/PencilKit/PKCanvasView.swift | 8 +-- iOS/PencilKit/PKToolPicker.swift | 8 +-- iOS/Photos/PHPhotoLibrary.swift | 4 +- iOS/PhotosUI/PHLivePhotoView.swift | 2 +- iOS/PhotosUI/PHPicker.swift | 2 +- iOS/PushKit/PKPushRegistry.swift | 8 +-- iOS/QuartzCore/CAAnimation.swift | 4 +- iOS/QuickLook/QLPreviewController.swift | 6 +- iOS/ReplayKit/RPBroadcast.swift | 8 +-- iOS/ReplayKit/RPPreviewViewController.swift | 4 +- iOS/ReplayKit/RPScreenRecorder.swift | 6 +- .../SFSafariViewController.swift | 4 +- iOS/SceneKit/SCNCameraController.swift | 2 +- iOS/SceneKit/SCNConstraint.swift | 2 +- iOS/SceneKit/SCNPhysicsWorld.swift | 6 +- iOS/SceneKit/SCNSceneRenderer.swift | 8 +-- iOS/SensorKit/SensorKit.swift | 8 +-- iOS/SoundAnalysis/SNResult.swift | 6 +- iOS/Speech/SFSpeechRecognitionTask.swift | 8 +-- iOS/SpriteKit/SKPhysicsWorld.swift | 4 +- iOS/SpriteKit/SKScene.swift | 8 +-- .../SKCloudServiceSetupViewController.swift | 2 +- iOS/StoreKit/SKOverlay.swift | 6 +- iOS/StoreKit/SKPaymentQueue.swift | 4 +- iOS/StoreKit/SKProductsRequest.swift | 2 +- iOS/StoreKit/SKRequest.swift | 4 +- .../SKStoreProductViewController.swift | 2 +- iOS/UIKit/NSLayoutManager.swift | 6 +- iOS/UIKit/NSTextStorage.swift | 2 +- iOS/UIKit/UIActionSheet.swift | 4 +- iOS/UIKit/UIAlertView.swift | 4 +- iOS/UIKit/UIApplication.swift | 34 +++++----- iOS/UIKit/UICloudSharingController.swift | 4 +- iOS/UIKit/UICollectionView.swift | 18 +++--- iOS/UIKit/UIColorPickerViewController.swift | 4 +- .../UIDocumentBrowserViewController.swift | 8 +-- .../UIDocumentInteractionController.swift | 8 +-- iOS/UIKit/UIDocumentMenuViewController.swift | 2 +- .../UIDocumentPickerViewController.swift | 4 +- iOS/UIKit/UIDragInteraction.swift | 2 +- iOS/UIKit/UIDynamicAnimator.swift | 2 +- iOS/UIKit/UIFocus.swift | 4 +- iOS/UIKit/UIFontPickerViewController.swift | 4 +- iOS/UIKit/UIGuidedAccess.swift | 2 +- iOS/UIKit/UIImagePickerController.swift | 4 +- iOS/UIKit/UIIndirectScribbleInteraction.swift | 2 +- iOS/UIKit/UIInteraction.swift | 2 +- iOS/UIKit/UILargeContentViewer.swift | 2 +- iOS/UIKit/UINavigationBar.swift | 4 +- iOS/UIKit/UINavigationController.swift | 2 +- iOS/UIKit/UIPageViewController.swift | 2 +- iOS/UIKit/UIPencilInteraction.swift | 2 +- iOS/UIKit/UIPickerView.swift | 2 +- iOS/UIKit/UIPopoverController.swift | 2 +- .../UIPopoverPresentationController.swift | 2 +- iOS/UIKit/UIPresentationController.swift | 4 +- iOS/UIKit/UIPreviewInteraction.swift | 6 +- iOS/UIKit/UIPrintInteractionController.swift | 6 +- iOS/UIKit/UIPrinterPickerController.swift | 6 +- iOS/UIKit/UIScene.swift | 10 +-- iOS/UIKit/UIScribbleInteraction.swift | 2 +- iOS/UIKit/UIScrollView.swift | 16 ++--- iOS/UIKit/UISearchBar.swift | 4 +- iOS/UIKit/UISearchController.swift | 4 +- iOS/UIKit/UISearchDisplayController.swift | 10 +-- iOS/UIKit/UISplitViewController.swift | 6 +- iOS/UIKit/UISpringLoadedInteraction.swift | 4 +- iOS/UIKit/UITabBar.swift | 6 +- iOS/UIKit/UITabBarController.swift | 4 +- iOS/UIKit/UITableView.swift | 22 +++---- iOS/UIKit/UITextField.swift | 8 +-- iOS/UIKit/UITextInput.swift | 6 +- iOS/UIKit/UITextInteraction.swift | 2 +- iOS/UIKit/UITextView.swift | 8 +-- iOS/UIKit/UITraitCollection.swift | 2 +- iOS/UIKit/UIVideoEditorController.swift | 6 +- iOS/UIKit/UIViewController.swift | 4 +- iOS/UIKit/UIWebView.swift | 6 +- iOS/UIKit/UIWindowScene.swift | 2 +- .../UNUserNotificationCenter.swift | 2 +- .../UNNotificationContentExtension.swift | 4 +- .../VNDocumentCameraViewController.swift | 6 +- iOS/WatchConnectivity/WCSession.swift | 26 ++++---- iOS/WebKit/WKHTTPCookieStore.swift | 2 +- iOS/WebKit/WKNavigationDelegate.swift | 16 ++--- iOS/WebKit/WKScriptMessageHandler.swift | 2 +- .../WKScriptMessageHandlerWithReply.swift | 2 +- iOS/WebKit/WKUIDelegate.swift | 2 +- iOS/WebKit/WKURLSchemeTask.swift | 8 +-- iOS/iAd/ADBannerView.swift | 6 +- iOS/iAd/ADInterstitialAd.swift | 8 +-- .../AVFoundation/AVAssetResourceLoader.swift | 4 +- macOS/AVFoundation/AVAssetWriter.swift | 4 +- .../AVCaptureAudioDataOutput.swift | 2 +- macOS/AVFoundation/AVCaptureFileOutput.swift | 10 +-- macOS/AVFoundation/AVCapturePhotoOutput.swift | 6 +- .../AVCaptureVideoDataOutput.swift | 4 +- macOS/AVFoundation/AVContentKeySession.swift | 14 ++-- .../AVPlayerItemMediaDataCollector.swift | 2 +- macOS/AVFoundation/AVPlayerItemOutput.swift | 4 +- .../AVKit/AVPictureInPictureController.swift | 4 +- macOS/AVKit/AVPlayerView.swift | 4 +- macOS/AVKit/AVRoutePickerView.swift | 2 +- macOS/AppKit/NSAnimation.swift | 6 +- macOS/AppKit/NSApplication.swift | 28 ++++---- macOS/AppKit/NSBrowser.swift | 6 +- macOS/AppKit/NSCollectionView.swift | 12 ++-- macOS/AppKit/NSComboBox.swift | 2 +- macOS/AppKit/NSControl.swift | 8 +-- macOS/AppKit/NSDrawer.swift | 4 +- macOS/AppKit/NSImage.swift | 6 +- macOS/AppKit/NSKeyValueBinding.swift | 4 +- macOS/AppKit/NSLayoutManager.swift | 6 +- macOS/AppKit/NSMenu.swift | 2 +- macOS/AppKit/NSOutlineView.swift | 18 +++--- macOS/AppKit/NSPageController.swift | 4 +- macOS/AppKit/NSPopover.swift | 6 +- macOS/AppKit/NSRuleEditor.swift | 2 +- macOS/AppKit/NSSavePanel.swift | 4 +- macOS/AppKit/NSScrubber.swift | 12 ++-- macOS/AppKit/NSSearchField.swift | 4 +- macOS/AppKit/NSSharingService.swift | 12 ++-- macOS/AppKit/NSSound.swift | 2 +- macOS/AppKit/NSSpeechRecognizer.swift | 2 +- macOS/AppKit/NSSpeechSynthesizer.swift | 6 +- macOS/AppKit/NSSplitView.swift | 2 +- macOS/AppKit/NSStackView.swift | 2 +- macOS/AppKit/NSTabView.swift | 4 +- macOS/AppKit/NSTableView.swift | 14 ++-- macOS/AppKit/NSText.swift | 6 +- macOS/AppKit/NSTextFinder.swift | 4 +- macOS/AppKit/NSTextStorage.swift | 2 +- macOS/AppKit/NSTextView.swift | 4 +- macOS/AppKit/NSToolbar.swift | 2 +- macOS/AppKit/NSWindow.swift | 46 ++++++------- .../AudioVideoBridging.swift | 16 ++--- .../ASAuthorizationController.swift | 4 +- .../ASWebAuthenticationSessionRequest.swift | 4 +- .../AutomaticAssessmentConfiguration.swift | 4 +- macOS/Automator/AMWorkflowController.swift | 8 +-- macOS/CallKit/CXProvider.swift | 4 +- .../ContactsUI/CNContactPickerDelegate.swift | 2 +- macOS/CoreBluetooth/CBCentralManager.swift | 10 +-- macOS/CoreBluetooth/CBPeripheral.swift | 28 ++++---- macOS/CoreBluetooth/CBPeripheralManager.swift | 20 +++--- .../CoreData/NSFetchedResultsController.swift | 8 +-- .../CLLocationManagerDelegate.swift | 34 +++++----- macOS/CoreSpotlight/CSSearchableIndex.swift | 4 +- macOS/CoreWLAN/CWWiFiClient.swift | 14 ++-- macOS/ExternalAccessory/EAAccessory.swift | 2 +- .../NSFileProviderEnumerating.swift | 6 +- .../NSFileProviderReplicatedExtension.swift | 4 +- macOS/Foundation/NSFilePresenter.swift | 24 +++---- macOS/Foundation/NSKeyedArchiver.swift | 6 +- macOS/Foundation/NSNetServices.swift | 26 ++++---- macOS/Foundation/NSSpellServer.swift | 4 +- macOS/Foundation/NSURLConnection.swift | 20 +++--- macOS/Foundation/NSURLDownload.swift | 16 ++--- macOS/Foundation/NSURLProtocol.swift | 12 ++-- macOS/Foundation/NSURLSession.swift | 34 +++++----- macOS/Foundation/NSUserActivity.swift | 2 +- macOS/Foundation/NSUserNotification.swift | 4 +- macOS/Foundation/NSXMLParser.swift | 12 ++-- .../GameKit/GKAchievementViewController.swift | 2 +- macOS/GameKit/GKChallengeEventHandler.swift | 8 +-- .../GameKit/GKChallengesViewController.swift | 2 +- macOS/GameKit/GKEventListener.swift | 4 +- ...GKFriendRequestComposeViewController.swift | 2 +- .../GameKit/GKGameCenterViewController.swift | 2 +- .../GameKit/GKGameSessionEventListener.swift | 12 ++-- .../GameKit/GKLeaderboardViewController.swift | 2 +- macOS/GameKit/GKMatch.swift | 10 +-- macOS/GameKit/GKMatchmaker.swift | 4 +- .../GameKit/GKMatchmakerViewController.swift | 10 +-- macOS/GameKit/GKPublicProtocols.swift | 6 +- macOS/GameKit/GKSavedGameListener.swift | 2 +- macOS/GameKit/GKTurnBasedMatch.swift | 6 +- .../GKTurnBasedMatchmakerViewController.swift | 4 +- macOS/GameplayKit/GKAgent.swift | 2 +- .../IMServicePlugInChatRoomSupport.swift | 16 ++--- ...vicePlugInFileTransferSessionSupport.swift | 6 +- .../IMServicePlugInGroupListSupport.swift | 4 +- ...IMServicePlugInInstantMessageSupport.swift | 12 ++-- .../IMServicePlugInProtocols.swift | 8 +-- macOS/ImageCaptureCore/ICCameraDevice.swift | 32 +++++----- macOS/ImageCaptureCore/ICDevice.swift | 18 +++--- macOS/ImageCaptureCore/ICDeviceBrowser.swift | 6 +- macOS/ImageCaptureCore/ICScannerDevice.swift | 12 ++-- macOS/MapKit/MKLocalSearchCompleter.swift | 4 +- macOS/MapKit/MKMapView.swift | 26 ++++---- macOS/Metal/MTLBuffer.swift | 2 +- .../MCAdvertiserAssistant.swift | 2 +- .../MCBrowserViewController.swift | 2 +- .../MCNearbyServiceAdvertiser.swift | 4 +- .../MCNearbyServiceBrowser.swift | 2 +- macOS/MultipeerConnectivity/MCSession.swift | 12 ++-- .../NCWidgetListViewController.swift | 4 +- .../NCWidgetProviding.swift | 4 +- macOS/PDFKit/PDFDocument.swift | 16 ++--- macOS/ParavirtualizedGraphics/PGDevice.swift | 2 +- .../PKPaymentAuthorizationController.swift | 20 +++--- ...tAuthorizationViewControllerDelegate.swift | 20 +++--- macOS/Photos/PHPhotoLibrary.swift | 4 +- macOS/PhotosUI/PHLivePhotoView.swift | 2 +- macOS/PushKit/PKPushRegistry.swift | 6 +- macOS/QuartzCore/CAAnimation.swift | 4 +- macOS/ReplayKit/RPBroadcast.swift | 8 +-- macOS/ReplayKit/RPPreviewViewController.swift | 4 +- macOS/ReplayKit/RPScreenRecorder.swift | 4 +- .../SFSafariExtensionHandling.swift | 2 +- macOS/SceneKit/SCNCameraController.swift | 2 +- macOS/SceneKit/SCNConstraint.swift | 2 +- macOS/SceneKit/SCNPhysicsWorld.swift | 6 +- macOS/SceneKit/SCNSceneRenderer.swift | 8 +-- macOS/SoundAnalysis/SNResult.swift | 6 +- macOS/Speech/SFSpeechRecognitionTask.swift | 8 +-- macOS/SpriteKit/SKPhysicsWorld.swift | 4 +- macOS/SpriteKit/SKScene.swift | 8 +-- macOS/StoreKit/SKPaymentQueue.swift | 4 +- macOS/StoreKit/SKProductsRequest.swift | 2 +- macOS/StoreKit/SKRequest.swift | 4 +- .../SKStoreProductViewController.swift | 2 +- macOS/SystemExtensions/SystemExtensions.swift | 4 +- .../UNUserNotificationCenter.swift | 2 +- .../VZVirtualMachineDelegate.swift | 4 +- macOS/WebKit/WKHTTPCookieStore.swift | 2 +- macOS/WebKit/WKNavigationDelegate.swift | 16 ++--- macOS/WebKit/WKScriptMessageHandler.swift | 2 +- .../WKScriptMessageHandlerWithReply.swift | 2 +- macOS/WebKit/WKUIDelegate.swift | 2 +- macOS/WebKit/WKURLSchemeTask.swift | 8 +-- macOS/WebKit/WebDocument.swift | 2 +- macOS/WebKit/WebEditingDelegate.swift | 10 +-- macOS/WebKit/WebFrameLoadDelegate.swift | 24 +++---- macOS/WebKit/WebResourceLoadDelegate.swift | 12 ++-- tvOS/AVFoundation/AVAssetResourceLoader.swift | 4 +- tvOS/AVFoundation/AVAssetWriter.swift | 4 +- tvOS/AVFoundation/AVContentKeySession.swift | 12 ++-- .../AVPlayerItemMediaDataCollector.swift | 2 +- tvOS/AVFoundation/AVPlayerItemOutput.swift | 4 +- tvOS/AVKit/AVPictureInPictureController.swift | 4 +- tvOS/AVKit/AVPlayerViewController.swift | 14 ++-- tvOS/AVKit/AVRoutePickerView.swift | 2 +- .../ASAuthorizationController.swift | 4 +- tvOS/CoreBluetooth/CBCentralManager.swift | 12 ++-- tvOS/CoreBluetooth/CBPeripheral.swift | 28 ++++---- tvOS/CoreBluetooth/CBPeripheralManager.swift | 20 +++--- .../CoreData/NSFetchedResultsController.swift | 8 +-- .../CLLocationManagerDelegate.swift | 8 +-- tvOS/ExternalAccessory/EAAccessory.swift | 2 +- tvOS/Foundation/NSFilePresenter.swift | 22 +++---- tvOS/Foundation/NSKeyedArchiver.swift | 6 +- tvOS/Foundation/NSNetServices.swift | 26 ++++---- tvOS/Foundation/NSURLConnection.swift | 20 +++--- tvOS/Foundation/NSURLProtocol.swift | 12 ++-- tvOS/Foundation/NSURLSession.swift | 34 +++++----- tvOS/Foundation/NSUserActivity.swift | 2 +- tvOS/Foundation/NSXMLParser.swift | 12 ++-- tvOS/GameKit/GKEventListener.swift | 4 +- tvOS/GameKit/GKGameCenterViewController.swift | 2 +- tvOS/GameKit/GKGameSessionEventListener.swift | 12 ++-- .../GKGameSessionSharingViewController.swift | 2 +- tvOS/GameKit/GKMatch.swift | 8 +-- tvOS/GameKit/GKMatchmaker.swift | 4 +- tvOS/GameKit/GKMatchmakerViewController.swift | 6 +- tvOS/GameKit/GKTurnBasedMatch.swift | 4 +- .../GKTurnBasedMatchmakerViewController.swift | 2 +- tvOS/GameplayKit/GKAgent.swift | 2 +- tvOS/HomeKit/HMAccessory.swift | 18 +++--- tvOS/HomeKit/HMCameraSnapshotControl.swift | 4 +- tvOS/HomeKit/HMCameraStreamControl.swift | 4 +- tvOS/HomeKit/HMHome.swift | 64 +++++++++---------- tvOS/HomeKit/HMHomeManager.swift | 10 +-- .../HMNetworkConfigurationProfile.swift | 2 +- tvOS/MapKit/MKLocalSearchCompleter.swift | 4 +- tvOS/MapKit/MKMapView.swift | 24 +++---- tvOS/MediaPlayer/MPNowPlayingSession.swift | 4 +- .../MCAdvertiserAssistant.swift | 2 +- .../MCBrowserViewController.swift | 2 +- .../MCNearbyServiceAdvertiser.swift | 4 +- .../MCNearbyServiceBrowser.swift | 2 +- tvOS/MultipeerConnectivity/MCSession.swift | 12 ++-- tvOS/Photos/PHPhotoLibrary.swift | 4 +- tvOS/PhotosUI/PHLivePhotoView.swift | 2 +- tvOS/QuartzCore/CAAnimation.swift | 4 +- tvOS/ReplayKit/RPBroadcast.swift | 8 +-- tvOS/ReplayKit/RPPreviewViewController.swift | 2 +- tvOS/ReplayKit/RPScreenRecorder.swift | 6 +- tvOS/SceneKit/SCNCameraController.swift | 2 +- tvOS/SceneKit/SCNConstraint.swift | 2 +- tvOS/SceneKit/SCNPhysicsWorld.swift | 6 +- tvOS/SceneKit/SCNSceneRenderer.swift | 8 +-- tvOS/SoundAnalysis/SNResult.swift | 6 +- tvOS/SpriteKit/SKPhysicsWorld.swift | 4 +- tvOS/SpriteKit/SKScene.swift | 8 +-- tvOS/StoreKit/SKPaymentQueue.swift | 4 +- tvOS/StoreKit/SKProductsRequest.swift | 2 +- tvOS/StoreKit/SKRequest.swift | 4 +- tvOS/TVMLKit/TVApplicationController.swift | 6 +- tvOS/TVMLKit/TVBrowserViewController.swift | 2 +- tvOS/TVMLKit/TVDocumentViewController.swift | 6 +- .../TVCollectionViewFullScreenLayout.swift | 2 +- tvOS/UIKit/NSLayoutManager.swift | 6 +- tvOS/UIKit/NSTextStorage.swift | 2 +- tvOS/UIKit/UIApplication.swift | 26 ++++---- tvOS/UIKit/UICollectionView.swift | 14 ++-- tvOS/UIKit/UIDynamicAnimator.swift | 2 +- tvOS/UIKit/UIFocus.swift | 4 +- tvOS/UIKit/UIGuidedAccess.swift | 2 +- tvOS/UIKit/UIInteraction.swift | 2 +- tvOS/UIKit/UINavigationBar.swift | 4 +- tvOS/UIKit/UINavigationController.swift | 2 +- tvOS/UIKit/UIPageViewController.swift | 2 +- tvOS/UIKit/UIPopoverController.swift | 2 +- tvOS/UIKit/UIPresentationController.swift | 4 +- tvOS/UIKit/UIScene.swift | 10 +-- tvOS/UIKit/UIScrollView.swift | 16 ++--- tvOS/UIKit/UISearchBar.swift | 4 +- tvOS/UIKit/UISearchController.swift | 4 +- tvOS/UIKit/UISplitViewController.swift | 6 +- tvOS/UIKit/UITabBar.swift | 2 +- tvOS/UIKit/UITabBarController.swift | 2 +- tvOS/UIKit/UITableView.swift | 16 ++--- tvOS/UIKit/UITextField.swift | 8 +-- tvOS/UIKit/UITextInput.swift | 6 +- tvOS/UIKit/UITextInteraction.swift | 2 +- tvOS/UIKit/UITextView.swift | 8 +-- tvOS/UIKit/UITraitCollection.swift | 2 +- tvOS/UIKit/UIViewController.swift | 4 +- .../AVFoundation/AVContentKeySession.swift | 14 ++-- .../AVPlayerItemMediaDataCollector.swift | 2 +- watchOS/AVFoundation/AVPlayerItemOutput.swift | 2 +- .../ASAuthorizationController.swift | 4 +- .../ClockKit/CLKComplicationDataSource.swift | 2 +- watchOS/CoreBluetooth/CBCentralManager.swift | 12 ++-- watchOS/CoreBluetooth/CBPeripheral.swift | 28 ++++---- .../CoreBluetooth/CBPeripheralManager.swift | 20 +++--- .../CoreData/NSFetchedResultsController.swift | 8 +-- .../CLLocationManagerDelegate.swift | 10 +-- .../CMHeadphoneMotionManagerDelegate.swift | 4 +- watchOS/Foundation/NSFilePresenter.swift | 22 +++---- watchOS/Foundation/NSKeyedArchiver.swift | 6 +- watchOS/Foundation/NSURLConnection.swift | 20 +++--- watchOS/Foundation/NSURLProtocol.swift | 12 ++-- watchOS/Foundation/NSURLSession.swift | 34 +++++----- watchOS/Foundation/NSUserActivity.swift | 2 +- watchOS/Foundation/NSXMLParser.swift | 12 ++-- watchOS/GameKit/GKMatchmaker.swift | 2 +- watchOS/GameKit/GKPublicProtocols.swift | 14 ++-- watchOS/GameKit/GKTurnBasedMatch.swift | 6 +- watchOS/HealthKit/HKLiveWorkoutBuilder.swift | 4 +- watchOS/HealthKit/HKWorkoutSession.swift | 6 +- watchOS/HomeKit/HMAccessory.swift | 18 +++--- watchOS/HomeKit/HMCameraSnapshotControl.swift | 4 +- watchOS/HomeKit/HMCameraStreamControl.swift | 4 +- watchOS/HomeKit/HMHome.swift | 64 +++++++++---------- watchOS/HomeKit/HMHomeManager.swift | 10 +-- .../HMNetworkConfigurationProfile.swift | 2 +- watchOS/Intents/INGetRideStatusIntent.swift | 2 +- .../PKPaymentAuthorizationController.swift | 20 +++--- watchOS/PushKit/PKPushRegistry.swift | 6 +- watchOS/SceneKit/SCNCameraController.swift | 2 +- watchOS/SceneKit/SCNConstraint.swift | 2 +- watchOS/SceneKit/SCNPhysicsWorld.swift | 6 +- watchOS/SceneKit/SCNSceneRenderer.swift | 8 +-- watchOS/SoundAnalysis/SNResult.swift | 6 +- watchOS/SpriteKit/SKPhysicsWorld.swift | 4 +- watchOS/SpriteKit/SKScene.swift | 8 +-- watchOS/StoreKit/SKPaymentQueue.swift | 4 +- watchOS/StoreKit/SKProductsRequest.swift | 2 +- watchOS/StoreKit/SKRequest.swift | 4 +- .../UNUserNotificationCenter.swift | 2 +- watchOS/WatchConnectivity/WCSession.swift | 22 +++---- watchOS/WatchKit/WKCrownSequencer.swift | 4 +- .../WatchKit/WKExtendedRuntimeSession.swift | 4 +- watchOS/WatchKit/WKExtension.swift | 18 +++--- 482 files changed, 1856 insertions(+), 1856 deletions(-) diff --git a/iOS/ARKit/ARCoachingOverlayView.swift b/iOS/ARKit/ARCoachingOverlayView.swift index 368a95b..332191c 100644 --- a/iOS/ARKit/ARCoachingOverlayView.swift +++ b/iOS/ARKit/ARCoachingOverlayView.swift @@ -22,7 +22,7 @@ class ARCoachingOverlayView : UIView { } @available(iOS 13.0, *) protocol ARCoachingOverlayViewDelegate : NSObjectProtocol { - @asyncHandler optional func coachingOverlayViewDidRequestSessionReset(_ coachingOverlayView: ARCoachingOverlayView) + optional func coachingOverlayViewDidRequestSessionReset(_ coachingOverlayView: ARCoachingOverlayView) optional func coachingOverlayViewWillActivate(_ coachingOverlayView: ARCoachingOverlayView) - @asyncHandler optional func coachingOverlayViewDidDeactivate(_ coachingOverlayView: ARCoachingOverlayView) + optional func coachingOverlayViewDidDeactivate(_ coachingOverlayView: ARCoachingOverlayView) } diff --git a/iOS/ARKit/ARSCNView.swift b/iOS/ARKit/ARSCNView.swift index c73909e..05125af 100644 --- a/iOS/ARKit/ARSCNView.swift +++ b/iOS/ARKit/ARSCNView.swift @@ -23,10 +23,10 @@ extension ARSCNView { @available(iOS 11.0, *) protocol ARSCNViewDelegate : ARSessionObserver, SCNSceneRendererDelegate { optional func renderer(_ renderer: SCNSceneRenderer, nodeFor anchor: ARAnchor) -> SCNNode? - @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) + optional func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) optional func renderer(_ renderer: SCNSceneRenderer, willUpdate node: SCNNode, for anchor: ARAnchor) - @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didUpdate node: SCNNode, for anchor: ARAnchor) - @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didRemove node: SCNNode, for anchor: ARAnchor) + optional func renderer(_ renderer: SCNSceneRenderer, didUpdate node: SCNNode, for anchor: ARAnchor) + optional func renderer(_ renderer: SCNSceneRenderer, didRemove node: SCNNode, for anchor: ARAnchor) } @available(iOS 11.0, *) typealias ARSCNDebugOptions = SCNDebugOptions diff --git a/iOS/ARKit/ARSKView.swift b/iOS/ARKit/ARSKView.swift index c595337..6522f92 100644 --- a/iOS/ARKit/ARSKView.swift +++ b/iOS/ARKit/ARSKView.swift @@ -2,10 +2,10 @@ @available(iOS 11.0, *) protocol ARSKViewDelegate : ARSessionObserver, SKViewDelegate { optional func view(_ view: ARSKView, nodeFor anchor: ARAnchor) -> SKNode? - @asyncHandler optional func view(_ view: ARSKView, didAdd node: SKNode, for anchor: ARAnchor) + optional func view(_ view: ARSKView, didAdd node: SKNode, for anchor: ARAnchor) optional func view(_ view: ARSKView, willUpdate node: SKNode, for anchor: ARAnchor) - @asyncHandler optional func view(_ view: ARSKView, didUpdate node: SKNode, for anchor: ARAnchor) - @asyncHandler optional func view(_ view: ARSKView, didRemove node: SKNode, for anchor: ARAnchor) + optional func view(_ view: ARSKView, didUpdate node: SKNode, for anchor: ARAnchor) + optional func view(_ view: ARSKView, didRemove node: SKNode, for anchor: ARAnchor) } @available(iOS 11.0, *) class ARSKView : SKView, ARSessionProviding { diff --git a/iOS/ARKit/ARSession.swift b/iOS/ARKit/ARSession.swift index b2a7b65..aeda4c9 100644 --- a/iOS/ARKit/ARSession.swift +++ b/iOS/ARKit/ARSession.swift @@ -45,24 +45,24 @@ class ARSession : NSObject { } @available(iOS 11.0, *) protocol ARSessionObserver : NSObjectProtocol { - @asyncHandler optional func session(_ session: ARSession, didFailWithError error: Error) + optional func session(_ session: ARSession, didFailWithError error: Error) optional func session(_ session: ARSession, cameraDidChangeTrackingState camera: ARCamera) optional func sessionWasInterrupted(_ session: ARSession) optional func sessionInterruptionEnded(_ session: ARSession) @available(iOS 11.3, *) optional func sessionShouldAttemptRelocalization(_ session: ARSession) -> Bool - @asyncHandler optional func session(_ session: ARSession, didOutputAudioSampleBuffer audioSampleBuffer: CMSampleBuffer) + optional func session(_ session: ARSession, didOutputAudioSampleBuffer audioSampleBuffer: CMSampleBuffer) @available(iOS 13.0, *) - @asyncHandler optional func session(_ session: ARSession, didOutputCollaborationData data: ARSession.CollaborationData) + optional func session(_ session: ARSession, didOutputCollaborationData data: ARSession.CollaborationData) @available(iOS 14.0, *) - @asyncHandler optional func session(_ session: ARSession, didChange geoTrackingStatus: ARGeoTrackingStatus) + optional func session(_ session: ARSession, didChange geoTrackingStatus: ARGeoTrackingStatus) } @available(iOS 11.0, *) protocol ARSessionDelegate : ARSessionObserver { - @asyncHandler optional func session(_ session: ARSession, didUpdate frame: ARFrame) - @asyncHandler optional func session(_ session: ARSession, didAdd anchors: [ARAnchor]) - @asyncHandler optional func session(_ session: ARSession, didUpdate anchors: [ARAnchor]) - @asyncHandler optional func session(_ session: ARSession, didRemove anchors: [ARAnchor]) + optional func session(_ session: ARSession, didUpdate frame: ARFrame) + optional func session(_ session: ARSession, didAdd anchors: [ARAnchor]) + optional func session(_ session: ARSession, didUpdate anchors: [ARAnchor]) + optional func session(_ session: ARSession, didRemove anchors: [ARAnchor]) } protocol ARSessionProviding : NSObjectProtocol { @available(iOS 11.0, *) diff --git a/iOS/AVFoundation/AVAssetDownloadTask.swift b/iOS/AVFoundation/AVAssetDownloadTask.swift index ccdcf65..b8cb04d 100644 --- a/iOS/AVFoundation/AVAssetDownloadTask.swift +++ b/iOS/AVFoundation/AVAssetDownloadTask.swift @@ -24,17 +24,17 @@ class AVAggregateAssetDownloadTask : URLSessionTask { @available(iOS 9.0, *) protocol AVAssetDownloadDelegate : URLSessionTaskDelegate { @available(iOS 10.0, *) - @asyncHandler optional func urlSession(_ session: URLSession, assetDownloadTask: AVAssetDownloadTask, didFinishDownloadingTo location: URL) + optional func urlSession(_ session: URLSession, assetDownloadTask: AVAssetDownloadTask, didFinishDownloadingTo location: URL) @available(iOS 9.0, *) - @asyncHandler optional func urlSession(_ session: URLSession, assetDownloadTask: AVAssetDownloadTask, didLoad timeRange: CMTimeRange, totalTimeRangesLoaded loadedTimeRanges: [NSValue], timeRangeExpectedToLoad: CMTimeRange) + optional func urlSession(_ session: URLSession, assetDownloadTask: AVAssetDownloadTask, didLoad timeRange: CMTimeRange, totalTimeRangesLoaded loadedTimeRanges: [NSValue], timeRangeExpectedToLoad: CMTimeRange) @available(iOS 9.0, *) - @asyncHandler optional func urlSession(_ session: URLSession, assetDownloadTask: AVAssetDownloadTask, didResolve resolvedMediaSelection: AVMediaSelection) + optional func urlSession(_ session: URLSession, assetDownloadTask: AVAssetDownloadTask, didResolve resolvedMediaSelection: AVMediaSelection) @available(iOS 11.0, *) optional func urlSession(_ session: URLSession, aggregateAssetDownloadTask: AVAggregateAssetDownloadTask, willDownloadTo location: URL) @available(iOS 11.0, *) - @asyncHandler optional func urlSession(_ session: URLSession, aggregateAssetDownloadTask: AVAggregateAssetDownloadTask, didCompleteFor mediaSelection: AVMediaSelection) + optional func urlSession(_ session: URLSession, aggregateAssetDownloadTask: AVAggregateAssetDownloadTask, didCompleteFor mediaSelection: AVMediaSelection) @available(iOS 11.0, *) - @asyncHandler optional func urlSession(_ session: URLSession, aggregateAssetDownloadTask: AVAggregateAssetDownloadTask, didLoad timeRange: CMTimeRange, totalTimeRangesLoaded loadedTimeRanges: [NSValue], timeRangeExpectedToLoad: CMTimeRange, for mediaSelection: AVMediaSelection) + optional func urlSession(_ session: URLSession, aggregateAssetDownloadTask: AVAggregateAssetDownloadTask, didLoad timeRange: CMTimeRange, totalTimeRangesLoaded loadedTimeRanges: [NSValue], timeRangeExpectedToLoad: CMTimeRange, for mediaSelection: AVMediaSelection) } @available(iOS 9.0, *) class AVAssetDownloadURLSession : URLSession { diff --git a/iOS/AVFoundation/AVAssetResourceLoader.swift b/iOS/AVFoundation/AVAssetResourceLoader.swift index 95d3d57..4fc318e 100644 --- a/iOS/AVFoundation/AVAssetResourceLoader.swift +++ b/iOS/AVFoundation/AVAssetResourceLoader.swift @@ -11,11 +11,11 @@ protocol AVAssetResourceLoaderDelegate : NSObjectProtocol { @available(iOS 8.0, *) optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForRenewalOfRequestedResource renewalRequest: AVAssetResourceRenewalRequest) -> Bool @available(iOS 7.0, *) - @asyncHandler optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel loadingRequest: AVAssetResourceLoadingRequest) + optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel loadingRequest: AVAssetResourceLoadingRequest) @available(iOS 8.0, *) optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForResponseTo authenticationChallenge: URLAuthenticationChallenge) -> Bool @available(iOS 8.0, *) - @asyncHandler optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel authenticationChallenge: URLAuthenticationChallenge) + optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel authenticationChallenge: URLAuthenticationChallenge) } @available(iOS 12.0, *) class AVAssetResourceLoadingRequestor : NSObject { diff --git a/iOS/AVFoundation/AVAssetWriter.swift b/iOS/AVFoundation/AVAssetWriter.swift index aa9053a..062e26c 100644 --- a/iOS/AVFoundation/AVAssetWriter.swift +++ b/iOS/AVFoundation/AVAssetWriter.swift @@ -76,6 +76,6 @@ extension AVAssetWriter { } @available(iOS 14.0, *) protocol AVAssetWriterDelegate : NSObjectProtocol { - @asyncHandler optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType, segmentReport: AVAssetSegmentReport?) - @asyncHandler optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType) + optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType, segmentReport: AVAssetSegmentReport?) + optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType) } diff --git a/iOS/AVFoundation/AVCaptureAudioDataOutput.swift b/iOS/AVFoundation/AVCaptureAudioDataOutput.swift index 30256c0..6615cf4 100644 --- a/iOS/AVFoundation/AVCaptureAudioDataOutput.swift +++ b/iOS/AVFoundation/AVCaptureAudioDataOutput.swift @@ -9,5 +9,5 @@ class AVCaptureAudioDataOutput : AVCaptureOutput { } @available(iOS 4.0, *) protocol AVCaptureAudioDataOutputSampleBufferDelegate : NSObjectProtocol { - @asyncHandler optional func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) + optional func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) } diff --git a/iOS/AVFoundation/AVCaptureDataOutputSynchronizer.swift b/iOS/AVFoundation/AVCaptureDataOutputSynchronizer.swift index 383c1c9..5c23bb2 100644 --- a/iOS/AVFoundation/AVCaptureDataOutputSynchronizer.swift +++ b/iOS/AVFoundation/AVCaptureDataOutputSynchronizer.swift @@ -9,7 +9,7 @@ class AVCaptureDataOutputSynchronizer : NSObject { } @available(iOS 11.0, *) protocol AVCaptureDataOutputSynchronizerDelegate : NSObjectProtocol { - @asyncHandler func dataOutputSynchronizer(_ synchronizer: AVCaptureDataOutputSynchronizer, didOutput synchronizedDataCollection: AVCaptureSynchronizedDataCollection) + func dataOutputSynchronizer(_ synchronizer: AVCaptureDataOutputSynchronizer, didOutput synchronizedDataCollection: AVCaptureSynchronizedDataCollection) } @available(iOS 11.0, *) class AVCaptureSynchronizedDataCollection : NSObject, NSFastEnumeration { diff --git a/iOS/AVFoundation/AVCaptureDepthDataOutput.swift b/iOS/AVFoundation/AVCaptureDepthDataOutput.swift index 55d0505..89f1bed 100644 --- a/iOS/AVFoundation/AVCaptureDepthDataOutput.swift +++ b/iOS/AVFoundation/AVCaptureDepthDataOutput.swift @@ -9,6 +9,6 @@ class AVCaptureDepthDataOutput : AVCaptureOutput { } @available(iOS 11.0, *) protocol AVCaptureDepthDataOutputDelegate : NSObjectProtocol { - @asyncHandler optional func depthDataOutput(_ output: AVCaptureDepthDataOutput, didOutput depthData: AVDepthData, timestamp: CMTime, connection: AVCaptureConnection) - @asyncHandler optional func depthDataOutput(_ output: AVCaptureDepthDataOutput, didDrop depthData: AVDepthData, timestamp: CMTime, connection: AVCaptureConnection, reason: AVCaptureOutput.DataDroppedReason) + optional func depthDataOutput(_ output: AVCaptureDepthDataOutput, didOutput depthData: AVDepthData, timestamp: CMTime, connection: AVCaptureConnection) + optional func depthDataOutput(_ output: AVCaptureDepthDataOutput, didDrop depthData: AVDepthData, timestamp: CMTime, connection: AVCaptureConnection, reason: AVCaptureOutput.DataDroppedReason) } diff --git a/iOS/AVFoundation/AVCaptureFileOutput.swift b/iOS/AVFoundation/AVCaptureFileOutput.swift index 9f10548..b55e785 100644 --- a/iOS/AVFoundation/AVCaptureFileOutput.swift +++ b/iOS/AVFoundation/AVCaptureFileOutput.swift @@ -13,8 +13,8 @@ class AVCaptureFileOutput : AVCaptureOutput { } @available(iOS 4.0, *) protocol AVCaptureFileOutputRecordingDelegate : NSObjectProtocol { - @asyncHandler optional func fileOutput(_ output: AVCaptureFileOutput, didStartRecordingTo fileURL: URL, from connections: [AVCaptureConnection]) - @asyncHandler func fileOutput(_ output: AVCaptureFileOutput, didFinishRecordingTo outputFileURL: URL, from connections: [AVCaptureConnection], error: Error?) + optional func fileOutput(_ output: AVCaptureFileOutput, didStartRecordingTo fileURL: URL, from connections: [AVCaptureConnection]) + func fileOutput(_ output: AVCaptureFileOutput, didFinishRecordingTo outputFileURL: URL, from connections: [AVCaptureConnection], error: Error?) } @available(iOS 4.0, *) class AVCaptureMovieFileOutput : AVCaptureFileOutput { diff --git a/iOS/AVFoundation/AVCaptureMetadataOutput.swift b/iOS/AVFoundation/AVCaptureMetadataOutput.swift index b07320f..4482bab 100644 --- a/iOS/AVFoundation/AVCaptureMetadataOutput.swift +++ b/iOS/AVFoundation/AVCaptureMetadataOutput.swift @@ -11,5 +11,5 @@ class AVCaptureMetadataOutput : AVCaptureOutput { } @available(iOS 6.0, *) protocol AVCaptureMetadataOutputObjectsDelegate : NSObjectProtocol { - @asyncHandler optional func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection) + optional func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection) } diff --git a/iOS/AVFoundation/AVCapturePhotoOutput.swift b/iOS/AVFoundation/AVCapturePhotoOutput.swift index 939da5a..33f467a 100644 --- a/iOS/AVFoundation/AVCapturePhotoOutput.swift +++ b/iOS/AVFoundation/AVCapturePhotoOutput.swift @@ -96,16 +96,16 @@ extension AVCapturePhotoOutput { protocol AVCapturePhotoCaptureDelegate : NSObjectProtocol { optional func photoOutput(_ output: AVCapturePhotoOutput, willBeginCaptureFor resolvedSettings: AVCaptureResolvedPhotoSettings) optional func photoOutput(_ output: AVCapturePhotoOutput, willCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings) - @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings) + optional func photoOutput(_ output: AVCapturePhotoOutput, didCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings) @available(iOS 11.0, *) - @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) + optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) @available(iOS, introduced: 10.0, deprecated: 11.0) - @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photoSampleBuffer: CMSampleBuffer?, previewPhoto previewPhotoSampleBuffer: CMSampleBuffer?, resolvedSettings: AVCaptureResolvedPhotoSettings, bracketSettings: AVCaptureBracketedStillImageSettings?, error: Error?) + optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photoSampleBuffer: CMSampleBuffer?, previewPhoto previewPhotoSampleBuffer: CMSampleBuffer?, resolvedSettings: AVCaptureResolvedPhotoSettings, bracketSettings: AVCaptureBracketedStillImageSettings?, error: Error?) @available(iOS, introduced: 10.0, deprecated: 11.0) - @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingRawPhoto rawSampleBuffer: CMSampleBuffer?, previewPhoto previewPhotoSampleBuffer: CMSampleBuffer?, resolvedSettings: AVCaptureResolvedPhotoSettings, bracketSettings: AVCaptureBracketedStillImageSettings?, error: Error?) - @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishRecordingLivePhotoMovieForEventualFileAt outputFileURL: URL, resolvedSettings: AVCaptureResolvedPhotoSettings) - @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingLivePhotoToMovieFileAt outputFileURL: URL, duration: CMTime, photoDisplayTime: CMTime, resolvedSettings: AVCaptureResolvedPhotoSettings, error: Error?) - @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishCaptureFor resolvedSettings: AVCaptureResolvedPhotoSettings, error: Error?) + optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingRawPhoto rawSampleBuffer: CMSampleBuffer?, previewPhoto previewPhotoSampleBuffer: CMSampleBuffer?, resolvedSettings: AVCaptureResolvedPhotoSettings, bracketSettings: AVCaptureBracketedStillImageSettings?, error: Error?) + optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishRecordingLivePhotoMovieForEventualFileAt outputFileURL: URL, resolvedSettings: AVCaptureResolvedPhotoSettings) + optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingLivePhotoToMovieFileAt outputFileURL: URL, duration: CMTime, photoDisplayTime: CMTime, resolvedSettings: AVCaptureResolvedPhotoSettings, error: Error?) + optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishCaptureFor resolvedSettings: AVCaptureResolvedPhotoSettings, error: Error?) } @available(iOS 10.0, *) class AVCapturePhotoSettings : NSObject, NSCopying { diff --git a/iOS/AVFoundation/AVCaptureVideoDataOutput.swift b/iOS/AVFoundation/AVCaptureVideoDataOutput.swift index ec5db38..27099a9 100644 --- a/iOS/AVFoundation/AVCaptureVideoDataOutput.swift +++ b/iOS/AVFoundation/AVCaptureVideoDataOutput.swift @@ -28,7 +28,7 @@ extension AVCaptureVideoDataOutput { } @available(iOS 4.0, *) protocol AVCaptureVideoDataOutputSampleBufferDelegate : NSObjectProtocol { - @asyncHandler optional func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) + optional func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) @available(iOS 6.0, *) - @asyncHandler optional func captureOutput(_ output: AVCaptureOutput, didDrop sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) + optional func captureOutput(_ output: AVCaptureOutput, didDrop sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) } diff --git a/iOS/AVFoundation/AVContentKeySession.swift b/iOS/AVFoundation/AVContentKeySession.swift index 3867a7c..457f413 100644 --- a/iOS/AVFoundation/AVContentKeySession.swift +++ b/iOS/AVFoundation/AVContentKeySession.swift @@ -89,18 +89,18 @@ extension AVContentKeyRequest.RetryReason { } @available(iOS 10.3, *) protocol AVContentKeySessionDelegate : NSObjectProtocol { - @asyncHandler func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest) - @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didProvideRenewingContentKeyRequest keyRequest: AVContentKeyRequest) - @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVPersistableContentKeyRequest) + func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest) + optional func contentKeySession(_ session: AVContentKeySession, didProvideRenewingContentKeyRequest keyRequest: AVContentKeyRequest) + optional func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVPersistableContentKeyRequest) @available(iOS 11.0, *) - @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didUpdatePersistableContentKey persistableContentKey: Data, forContentKeyIdentifier keyIdentifier: Any) - @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequest keyRequest: AVContentKeyRequest, didFailWithError err: Error) + optional func contentKeySession(_ session: AVContentKeySession, didUpdatePersistableContentKey persistableContentKey: Data, forContentKeyIdentifier keyIdentifier: Any) + optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequest keyRequest: AVContentKeyRequest, didFailWithError err: Error) optional func contentKeySession(_ session: AVContentKeySession, shouldRetry keyRequest: AVContentKeyRequest, reason retryReason: AVContentKeyRequest.RetryReason) -> Bool @available(iOS 12.0, *) optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequestDidSucceed keyRequest: AVContentKeyRequest) - @asyncHandler optional func contentKeySessionContentProtectionSessionIdentifierDidChange(_ session: AVContentKeySession) + optional func contentKeySessionContentProtectionSessionIdentifierDidChange(_ session: AVContentKeySession) @available(iOS 12.0, *) - @asyncHandler optional func contentKeySessionDidGenerateExpiredSessionReport(_ session: AVContentKeySession) + optional func contentKeySessionDidGenerateExpiredSessionReport(_ session: AVContentKeySession) } @available(iOS 10.3, *) class AVContentKeyRequest : NSObject { diff --git a/iOS/AVFoundation/AVPlayerItemMediaDataCollector.swift b/iOS/AVFoundation/AVPlayerItemMediaDataCollector.swift index 7f30fe1..3cb5c44 100644 --- a/iOS/AVFoundation/AVPlayerItemMediaDataCollector.swift +++ b/iOS/AVFoundation/AVPlayerItemMediaDataCollector.swift @@ -11,5 +11,5 @@ class AVPlayerItemMetadataCollector : AVPlayerItemMediaDataCollector { } protocol AVPlayerItemMetadataCollectorPushDelegate : NSObjectProtocol { @available(iOS 9.3, *) - @asyncHandler func metadataCollector(_ metadataCollector: AVPlayerItemMetadataCollector, didCollect metadataGroups: [AVDateRangeMetadataGroup], indexesOfNewGroups: IndexSet, indexesOfModifiedGroups: IndexSet) + func metadataCollector(_ metadataCollector: AVPlayerItemMetadataCollector, didCollect metadataGroups: [AVDateRangeMetadataGroup], indexesOfNewGroups: IndexSet, indexesOfModifiedGroups: IndexSet) } diff --git a/iOS/AVFoundation/AVPlayerItemOutput.swift b/iOS/AVFoundation/AVPlayerItemOutput.swift index 365f9dd..edc4d88 100644 --- a/iOS/AVFoundation/AVPlayerItemOutput.swift +++ b/iOS/AVFoundation/AVPlayerItemOutput.swift @@ -52,7 +52,7 @@ extension AVPlayerItemLegibleOutput.TextStylingResolution { } protocol AVPlayerItemLegibleOutputPushDelegate : AVPlayerItemOutputPushDelegate { @available(iOS 7.0, *) - @asyncHandler optional func legibleOutput(_ output: AVPlayerItemLegibleOutput, didOutputAttributedStrings strings: [NSAttributedString], nativeSampleBuffers nativeSamples: [Any], forItemTime itemTime: CMTime) + optional func legibleOutput(_ output: AVPlayerItemLegibleOutput, didOutputAttributedStrings strings: [NSAttributedString], nativeSampleBuffers nativeSamples: [Any], forItemTime itemTime: CMTime) } protocol AVPlayerItemOutputPushDelegate : NSObjectProtocol { @available(iOS 6.0, *) @@ -68,5 +68,5 @@ class AVPlayerItemMetadataOutput : AVPlayerItemOutput { } protocol AVPlayerItemMetadataOutputPushDelegate : AVPlayerItemOutputPushDelegate { @available(iOS 8.0, *) - @asyncHandler optional func metadataOutput(_ output: AVPlayerItemMetadataOutput, didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup], from track: AVPlayerItemTrack?) + optional func metadataOutput(_ output: AVPlayerItemMetadataOutput, didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup], from track: AVPlayerItemTrack?) } diff --git a/iOS/AVKit/AVPictureInPictureController.swift b/iOS/AVKit/AVPictureInPictureController.swift index 9632826..817ff41 100644 --- a/iOS/AVKit/AVPictureInPictureController.swift +++ b/iOS/AVKit/AVPictureInPictureController.swift @@ -24,10 +24,10 @@ class AVPictureInPictureController : NSObject { @available(iOS 9.0, *) protocol AVPictureInPictureControllerDelegate : NSObjectProtocol { optional func pictureInPictureControllerWillStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) - @asyncHandler optional func pictureInPictureControllerDidStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) + optional func pictureInPictureControllerDidStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, failedToStartPictureInPictureWithError error: Error) optional func pictureInPictureControllerWillStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) - @asyncHandler optional func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) + optional func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void) optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController) async -> Bool } diff --git a/iOS/AVKit/AVPlayerViewController.swift b/iOS/AVKit/AVPlayerViewController.swift index 12439ee..f212d5d 100644 --- a/iOS/AVKit/AVPlayerViewController.swift +++ b/iOS/AVKit/AVPlayerViewController.swift @@ -34,13 +34,13 @@ protocol AVPlayerViewControllerDelegate : NSObjectProtocol { @available(iOS 8.0, *) optional func playerViewControllerWillStartPictureInPicture(_ playerViewController: AVPlayerViewController) @available(iOS 8.0, *) - @asyncHandler optional func playerViewControllerDidStartPictureInPicture(_ playerViewController: AVPlayerViewController) + optional func playerViewControllerDidStartPictureInPicture(_ playerViewController: AVPlayerViewController) @available(iOS 8.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, failedToStartPictureInPictureWithError error: Error) @available(iOS 8.0, *) optional func playerViewControllerWillStopPictureInPicture(_ playerViewController: AVPlayerViewController) @available(iOS 8.0, *) - @asyncHandler optional func playerViewControllerDidStopPictureInPicture(_ playerViewController: AVPlayerViewController) + optional func playerViewControllerDidStopPictureInPicture(_ playerViewController: AVPlayerViewController) @available(iOS 8.0, *) optional func playerViewControllerShouldAutomaticallyDismissAtPictureInPictureStart(_ playerViewController: AVPlayerViewController) -> Bool @available(iOS 8.0, *) diff --git a/iOS/AVKit/AVRoutePickerView.swift b/iOS/AVKit/AVRoutePickerView.swift index 3c1fae8..529b7f9 100644 --- a/iOS/AVKit/AVRoutePickerView.swift +++ b/iOS/AVKit/AVRoutePickerView.swift @@ -10,5 +10,5 @@ protocol AVRoutePickerViewDelegate : NSObjectProtocol { @available(iOS 11.0, *) optional func routePickerViewWillBeginPresentingRoutes(_ routePickerView: AVRoutePickerView) @available(iOS 11.0, *) - @asyncHandler optional func routePickerViewDidEndPresentingRoutes(_ routePickerView: AVRoutePickerView) + optional func routePickerViewDidEndPresentingRoutes(_ routePickerView: AVRoutePickerView) } diff --git a/iOS/AddressBookUI/ABNewPersonViewController.swift b/iOS/AddressBookUI/ABNewPersonViewController.swift index f47edde..35f972b 100644 --- a/iOS/AddressBookUI/ABNewPersonViewController.swift +++ b/iOS/AddressBookUI/ABNewPersonViewController.swift @@ -8,5 +8,5 @@ class ABNewPersonViewController : UIViewController { } protocol ABNewPersonViewControllerDelegate : NSObjectProtocol { @available(iOS 2.0, *) - @asyncHandler func newPersonViewController(_ newPersonView: ABNewPersonViewController, didCompleteWithNewPerson person: ABRecord?) + func newPersonViewController(_ newPersonView: ABNewPersonViewController, didCompleteWithNewPerson person: ABRecord?) } diff --git a/iOS/AddressBookUI/ABPeoplePickerNavigationController.swift b/iOS/AddressBookUI/ABPeoplePickerNavigationController.swift index 88e4b19..d65367f 100644 --- a/iOS/AddressBookUI/ABPeoplePickerNavigationController.swift +++ b/iOS/AddressBookUI/ABPeoplePickerNavigationController.swift @@ -59,11 +59,11 @@ let ABPersonSocialProfilesProperty: String let ABPersonPostalAddressesProperty: String protocol ABPeoplePickerNavigationControllerDelegate : NSObjectProtocol { @available(iOS 8.0, *) - @asyncHandler optional func peoplePickerNavigationController(_ peoplePicker: ABPeoplePickerNavigationController, didSelectPerson person: ABRecord) + optional func peoplePickerNavigationController(_ peoplePicker: ABPeoplePickerNavigationController, didSelectPerson person: ABRecord) @available(iOS 8.0, *) - @asyncHandler optional func peoplePickerNavigationController(_ peoplePicker: ABPeoplePickerNavigationController, didSelectPerson person: ABRecord, property: ABPropertyID, identifier: ABMultiValueIdentifier) + optional func peoplePickerNavigationController(_ peoplePicker: ABPeoplePickerNavigationController, didSelectPerson person: ABRecord, property: ABPropertyID, identifier: ABMultiValueIdentifier) @available(iOS 2.0, *) - @asyncHandler optional func peoplePickerNavigationControllerDidCancel(_ peoplePicker: ABPeoplePickerNavigationController) + optional func peoplePickerNavigationControllerDidCancel(_ peoplePicker: ABPeoplePickerNavigationController) @available(iOS, introduced: 2.0, deprecated: 8.0) optional func peoplePickerNavigationController(_ peoplePicker: ABPeoplePickerNavigationController, shouldContinueAfterSelectingPerson person: ABRecord) -> Bool @available(iOS, introduced: 2.0, deprecated: 8.0) diff --git a/iOS/AddressBookUI/ABUnknownPersonViewController.swift b/iOS/AddressBookUI/ABUnknownPersonViewController.swift index 4e64e88..94a8fd1 100644 --- a/iOS/AddressBookUI/ABUnknownPersonViewController.swift +++ b/iOS/AddressBookUI/ABUnknownPersonViewController.swift @@ -11,7 +11,7 @@ class ABUnknownPersonViewController : UIViewController { } protocol ABUnknownPersonViewControllerDelegate : NSObjectProtocol { @available(iOS 2.0, *) - @asyncHandler func unknownPersonViewController(_ unknownCardViewController: ABUnknownPersonViewController, didResolveToPerson person: ABRecord?) + func unknownPersonViewController(_ unknownCardViewController: ABUnknownPersonViewController, didResolveToPerson person: ABRecord?) @available(iOS 3.0, *) optional func unknownPersonViewController(_ personViewController: ABUnknownPersonViewController, shouldPerformDefaultActionForPerson person: ABRecord, property: ABPropertyID, identifier: ABMultiValueIdentifier) -> Bool } diff --git a/iOS/AuthenticationServices/ASAccountAuthenticationModificationController.swift b/iOS/AuthenticationServices/ASAccountAuthenticationModificationController.swift index 0b54d90..00ddcf6 100644 --- a/iOS/AuthenticationServices/ASAccountAuthenticationModificationController.swift +++ b/iOS/AuthenticationServices/ASAccountAuthenticationModificationController.swift @@ -1,8 +1,8 @@ @available(iOS 14.0, *) protocol ASAccountAuthenticationModificationControllerDelegate : NSObjectProtocol { - @asyncHandler optional func accountAuthenticationModificationController(_ controller: ASAccountAuthenticationModificationController, didSuccessfullyComplete request: ASAccountAuthenticationModificationRequest, userInfo: [AnyHashable : Any]? = nil) - @asyncHandler optional func accountAuthenticationModificationController(_ controller: ASAccountAuthenticationModificationController, didFail request: ASAccountAuthenticationModificationRequest, error: Error) + optional func accountAuthenticationModificationController(_ controller: ASAccountAuthenticationModificationController, didSuccessfullyComplete request: ASAccountAuthenticationModificationRequest, userInfo: [AnyHashable : Any]? = nil) + optional func accountAuthenticationModificationController(_ controller: ASAccountAuthenticationModificationController, didFail request: ASAccountAuthenticationModificationRequest, error: Error) } @available(iOS 14.0, *) protocol ASAccountAuthenticationModificationControllerPresentationContextProviding : NSObjectProtocol { diff --git a/iOS/AuthenticationServices/ASAuthorizationController.swift b/iOS/AuthenticationServices/ASAuthorizationController.swift index 027a7a6..9246547 100644 --- a/iOS/AuthenticationServices/ASAuthorizationController.swift +++ b/iOS/AuthenticationServices/ASAuthorizationController.swift @@ -1,8 +1,8 @@ @available(iOS 13.0, *) protocol ASAuthorizationControllerDelegate : NSObjectProtocol { - @asyncHandler optional func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) - @asyncHandler optional func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) + optional func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) + optional func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) } @available(iOS 13.0, *) protocol ASAuthorizationControllerPresentationContextProviding : NSObjectProtocol { diff --git a/iOS/AutomaticAssessmentConfiguration/AutomaticAssessmentConfiguration.swift b/iOS/AutomaticAssessmentConfiguration/AutomaticAssessmentConfiguration.swift index ebe31b6..507d64e 100644 --- a/iOS/AutomaticAssessmentConfiguration/AutomaticAssessmentConfiguration.swift +++ b/iOS/AutomaticAssessmentConfiguration/AutomaticAssessmentConfiguration.swift @@ -39,10 +39,10 @@ class AEAssessmentSession : NSObject { } @available(iOS 13.4, *) protocol AEAssessmentSessionDelegate : NSObjectProtocol { - @asyncHandler optional func assessmentSessionDidBegin(_ session: AEAssessmentSession) + optional func assessmentSessionDidBegin(_ session: AEAssessmentSession) optional func assessmentSession(_ session: AEAssessmentSession, failedToBeginWithError error: Error) optional func assessmentSession(_ session: AEAssessmentSession, wasInterruptedWithError error: Error) - @asyncHandler optional func assessmentSessionDidEnd(_ session: AEAssessmentSession) + optional func assessmentSessionDidEnd(_ session: AEAssessmentSession) } @available(iOS 13.4, *) let AEAssessmentErrorDomain: String diff --git a/iOS/CallKit/CXProvider.swift b/iOS/CallKit/CXProvider.swift index aee0802..361f93d 100644 --- a/iOS/CallKit/CXProvider.swift +++ b/iOS/CallKit/CXProvider.swift @@ -11,8 +11,8 @@ enum CXCallEndedReason : Int { } @available(iOS 10.0, *) protocol CXProviderDelegate : NSObjectProtocol { - @asyncHandler func providerDidReset(_ provider: CXProvider) - @asyncHandler optional func providerDidBegin(_ provider: CXProvider) + func providerDidReset(_ provider: CXProvider) + optional func providerDidBegin(_ provider: CXProvider) optional func provider(_ provider: CXProvider, execute transaction: CXTransaction) -> Bool optional func provider(_ provider: CXProvider, perform action: CXStartCallAction) optional func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) diff --git a/iOS/CarPlay/CPInterfaceController.swift b/iOS/CarPlay/CPInterfaceController.swift index 9b9dcbf..f968ad0 100644 --- a/iOS/CarPlay/CPInterfaceController.swift +++ b/iOS/CarPlay/CPInterfaceController.swift @@ -57,14 +57,14 @@ class CPInterfaceController : NSObject { @available(iOS 12.0, *) protocol CPInterfaceControllerDelegate : NSObjectProtocol { optional func templateWillAppear(_ aTemplate: CPTemplate, animated: Bool) - @asyncHandler optional func templateDidAppear(_ aTemplate: CPTemplate, animated: Bool) + optional func templateDidAppear(_ aTemplate: CPTemplate, animated: Bool) optional func templateWillDisappear(_ aTemplate: CPTemplate, animated: Bool) - @asyncHandler optional func templateDidDisappear(_ aTemplate: CPTemplate, animated: Bool) + optional func templateDidDisappear(_ aTemplate: CPTemplate, animated: Bool) } @available(iOS, introduced: 12.0, deprecated: 13.0) protocol CPApplicationDelegate : UIApplicationDelegate { - @asyncHandler func application(_ application: UIApplication, didConnectCarInterfaceController interfaceController: CPInterfaceController, to window: CPWindow) - @asyncHandler func application(_ application: UIApplication, didDisconnectCarInterfaceController interfaceController: CPInterfaceController, from window: CPWindow) - @asyncHandler optional func application(_ application: UIApplication, didSelect navigationAlert: CPNavigationAlert) - @asyncHandler optional func application(_ application: UIApplication, didSelect maneuver: CPManeuver) + func application(_ application: UIApplication, didConnectCarInterfaceController interfaceController: CPInterfaceController, to window: CPWindow) + func application(_ application: UIApplication, didDisconnectCarInterfaceController interfaceController: CPInterfaceController, from window: CPWindow) + optional func application(_ application: UIApplication, didSelect navigationAlert: CPNavigationAlert) + optional func application(_ application: UIApplication, didSelect maneuver: CPManeuver) } diff --git a/iOS/CarPlay/CPListTemplate.swift b/iOS/CarPlay/CPListTemplate.swift index fe015f4..3283785 100644 --- a/iOS/CarPlay/CPListTemplate.swift +++ b/iOS/CarPlay/CPListTemplate.swift @@ -25,7 +25,7 @@ class CPListTemplate : CPTemplate, CPBarButtonProviding { @available(iOS, introduced: 12.0, deprecated: 14.0) protocol CPListTemplateDelegate : NSObjectProtocol { @available(iOS, introduced: 12.0, deprecated: 14.0) - @asyncHandler func listTemplate(_ listTemplate: CPListTemplate, didSelect item: CPListItem, completionHandler: @escaping () -> Void) + func listTemplate(_ listTemplate: CPListTemplate, didSelect item: CPListItem, completionHandler: @escaping () -> Void) @available(iOS, introduced: 12.0, deprecated: 14.0) func listTemplate(_ listTemplate: CPListTemplate, didSelect item: CPListItem) async } diff --git a/iOS/CarPlay/CPMapTemplate.swift b/iOS/CarPlay/CPMapTemplate.swift index 29e3e14..ee62a61 100644 --- a/iOS/CarPlay/CPMapTemplate.swift +++ b/iOS/CarPlay/CPMapTemplate.swift @@ -64,21 +64,21 @@ protocol CPMapTemplateDelegate : NSObjectProtocol { optional func mapTemplate(_ mapTemplate: CPMapTemplate, shouldShowNotificationFor maneuver: CPManeuver) -> Bool optional func mapTemplate(_ mapTemplate: CPMapTemplate, shouldUpdateNotificationFor maneuver: CPManeuver, with travelEstimates: CPTravelEstimates) -> Bool optional func mapTemplate(_ mapTemplate: CPMapTemplate, shouldShowNotificationFor navigationAlert: CPNavigationAlert) -> Bool - @asyncHandler optional func mapTemplateDidShowPanningInterface(_ mapTemplate: CPMapTemplate) + optional func mapTemplateDidShowPanningInterface(_ mapTemplate: CPMapTemplate) optional func mapTemplateWillDismissPanningInterface(_ mapTemplate: CPMapTemplate) - @asyncHandler optional func mapTemplateDidDismissPanningInterface(_ mapTemplate: CPMapTemplate) + optional func mapTemplateDidDismissPanningInterface(_ mapTemplate: CPMapTemplate) optional func mapTemplate(_ mapTemplate: CPMapTemplate, panBeganWith direction: CPMapTemplate.PanDirection) optional func mapTemplate(_ mapTemplate: CPMapTemplate, panEndedWith direction: CPMapTemplate.PanDirection) optional func mapTemplate(_ mapTemplate: CPMapTemplate, panWith direction: CPMapTemplate.PanDirection) - @asyncHandler optional func mapTemplateDidBeginPanGesture(_ mapTemplate: CPMapTemplate) - @asyncHandler optional func mapTemplate(_ mapTemplate: CPMapTemplate, didUpdatePanGestureWithTranslation translation: CGPoint, velocity: CGPoint) - @asyncHandler optional func mapTemplate(_ mapTemplate: CPMapTemplate, didEndPanGestureWithVelocity velocity: CGPoint) + optional func mapTemplateDidBeginPanGesture(_ mapTemplate: CPMapTemplate) + optional func mapTemplate(_ mapTemplate: CPMapTemplate, didUpdatePanGestureWithTranslation translation: CGPoint, velocity: CGPoint) + optional func mapTemplate(_ mapTemplate: CPMapTemplate, didEndPanGestureWithVelocity velocity: CGPoint) optional func mapTemplate(_ mapTemplate: CPMapTemplate, willShow navigationAlert: CPNavigationAlert) - @asyncHandler optional func mapTemplate(_ mapTemplate: CPMapTemplate, didShow navigationAlert: CPNavigationAlert) + optional func mapTemplate(_ mapTemplate: CPMapTemplate, didShow navigationAlert: CPNavigationAlert) optional func mapTemplate(_ mapTemplate: CPMapTemplate, willDismiss navigationAlert: CPNavigationAlert, dismissalContext: CPNavigationAlert.DismissalContext) - @asyncHandler optional func mapTemplate(_ mapTemplate: CPMapTemplate, didDismiss navigationAlert: CPNavigationAlert, dismissalContext: CPNavigationAlert.DismissalContext) + optional func mapTemplate(_ mapTemplate: CPMapTemplate, didDismiss navigationAlert: CPNavigationAlert, dismissalContext: CPNavigationAlert.DismissalContext) optional func mapTemplate(_ mapTemplate: CPMapTemplate, selectedPreviewFor trip: CPTrip, using routeChoice: CPRouteChoice) optional func mapTemplate(_ mapTemplate: CPMapTemplate, startedTrip trip: CPTrip, using routeChoice: CPRouteChoice) - @asyncHandler optional func mapTemplateDidCancelNavigation(_ mapTemplate: CPMapTemplate) + optional func mapTemplateDidCancelNavigation(_ mapTemplate: CPMapTemplate) optional func mapTemplate(_ mapTemplate: CPMapTemplate, displayStyleFor maneuver: CPManeuver) -> CPManeuverDisplayStyle } diff --git a/iOS/CarPlay/CPPointOfInterestTemplate.swift b/iOS/CarPlay/CPPointOfInterestTemplate.swift index 3d4cd88..a116eaa 100644 --- a/iOS/CarPlay/CPPointOfInterestTemplate.swift +++ b/iOS/CarPlay/CPPointOfInterestTemplate.swift @@ -1,8 +1,8 @@ @available(iOS 14.0, *) protocol CPPointOfInterestTemplateDelegate : NSObjectProtocol { - @asyncHandler func pointOfInterestTemplate(_ pointOfInterestTemplate: CPPointOfInterestTemplate, didChangeMapRegion region: MKCoordinateRegion) - @asyncHandler optional func pointOfInterestTemplate(_ pointOfInterestTemplate: CPPointOfInterestTemplate, didSelectPointOfInterest pointOfInterest: CPPointOfInterest) + func pointOfInterestTemplate(_ pointOfInterestTemplate: CPPointOfInterestTemplate, didChangeMapRegion region: MKCoordinateRegion) + optional func pointOfInterestTemplate(_ pointOfInterestTemplate: CPPointOfInterestTemplate, didSelectPointOfInterest pointOfInterest: CPPointOfInterest) } @available(iOS 14.0, *) class CPPointOfInterestTemplate : CPTemplate { diff --git a/iOS/CarPlay/CPTabBarTemplate.swift b/iOS/CarPlay/CPTabBarTemplate.swift index 296216f..d46656e 100644 --- a/iOS/CarPlay/CPTabBarTemplate.swift +++ b/iOS/CarPlay/CPTabBarTemplate.swift @@ -10,5 +10,5 @@ class CPTabBarTemplate : CPTemplate { } @available(iOS 14.0, *) protocol CPTabBarTemplateDelegate : NSObjectProtocol { - @asyncHandler func tabBarTemplate(_ tabBarTemplate: CPTabBarTemplate, didSelect selectedTemplate: CPTemplate) + func tabBarTemplate(_ tabBarTemplate: CPTabBarTemplate, didSelect selectedTemplate: CPTemplate) } diff --git a/iOS/CarPlay/CPTemplateApplicationDashboardScene.swift b/iOS/CarPlay/CPTemplateApplicationDashboardScene.swift index cff8229..4c492b0 100644 --- a/iOS/CarPlay/CPTemplateApplicationDashboardScene.swift +++ b/iOS/CarPlay/CPTemplateApplicationDashboardScene.swift @@ -1,8 +1,8 @@ @available(iOS 13.4, *) protocol CPTemplateApplicationDashboardSceneDelegate : UISceneDelegate { - @asyncHandler optional func templateApplicationDashboardScene(_ templateApplicationDashboardScene: CPTemplateApplicationDashboardScene, didConnect dashboardController: CPDashboardController, to window: UIWindow) - @asyncHandler optional func templateApplicationDashboardScene(_ templateApplicationDashboardScene: CPTemplateApplicationDashboardScene, didDisconnect dashboardController: CPDashboardController, from window: UIWindow) + optional func templateApplicationDashboardScene(_ templateApplicationDashboardScene: CPTemplateApplicationDashboardScene, didConnect dashboardController: CPDashboardController, to window: UIWindow) + optional func templateApplicationDashboardScene(_ templateApplicationDashboardScene: CPTemplateApplicationDashboardScene, didDisconnect dashboardController: CPDashboardController, from window: UIWindow) } @available(iOS 13.4, *) class CPTemplateApplicationDashboardScene : UIScene { diff --git a/iOS/CarPlay/CPTemplateApplicationScene.swift b/iOS/CarPlay/CPTemplateApplicationScene.swift index c67ef89..3bf1b14 100644 --- a/iOS/CarPlay/CPTemplateApplicationScene.swift +++ b/iOS/CarPlay/CPTemplateApplicationScene.swift @@ -1,14 +1,14 @@ @available(iOS 13.0, *) protocol CPTemplateApplicationSceneDelegate : UISceneDelegate { - @asyncHandler optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didConnect interfaceController: CPInterfaceController, to window: CPWindow) + optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didConnect interfaceController: CPInterfaceController, to window: CPWindow) @available(iOS 14.0, *) - @asyncHandler optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didConnect interfaceController: CPInterfaceController) - @asyncHandler optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didDisconnect interfaceController: CPInterfaceController, from window: CPWindow) + optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didConnect interfaceController: CPInterfaceController) + optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didDisconnect interfaceController: CPInterfaceController, from window: CPWindow) @available(iOS 14.0, *) - @asyncHandler optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didDisconnectInterfaceController interfaceController: CPInterfaceController) - @asyncHandler optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didSelect navigationAlert: CPNavigationAlert) - @asyncHandler optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didSelect maneuver: CPManeuver) + optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didDisconnectInterfaceController interfaceController: CPInterfaceController) + optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didSelect navigationAlert: CPNavigationAlert) + optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didSelect maneuver: CPManeuver) } @available(iOS 13.0, *) class CPTemplateApplicationScene : UIScene { diff --git a/iOS/ContactsUI/CNContactPickerViewController.swift b/iOS/ContactsUI/CNContactPickerViewController.swift index f82d1d3..4dcc7d9 100644 --- a/iOS/ContactsUI/CNContactPickerViewController.swift +++ b/iOS/ContactsUI/CNContactPickerViewController.swift @@ -9,9 +9,9 @@ class CNContactPickerViewController : UIViewController { } @available(iOS 9.0, *) protocol CNContactPickerDelegate : NSObjectProtocol { - @asyncHandler optional func contactPickerDidCancel(_ picker: CNContactPickerViewController) - @asyncHandler optional func contactPicker(_ picker: CNContactPickerViewController, didSelect contact: CNContact) - @asyncHandler optional func contactPicker(_ picker: CNContactPickerViewController, didSelect contactProperty: CNContactProperty) - @asyncHandler optional func contactPicker(_ picker: CNContactPickerViewController, didSelect contacts: [CNContact]) - @asyncHandler optional func contactPicker(_ picker: CNContactPickerViewController, didSelectContactProperties contactProperties: [CNContactProperty]) + optional func contactPickerDidCancel(_ picker: CNContactPickerViewController) + optional func contactPicker(_ picker: CNContactPickerViewController, didSelect contact: CNContact) + optional func contactPicker(_ picker: CNContactPickerViewController, didSelect contactProperty: CNContactProperty) + optional func contactPicker(_ picker: CNContactPickerViewController, didSelect contacts: [CNContact]) + optional func contactPicker(_ picker: CNContactPickerViewController, didSelectContactProperties contactProperties: [CNContactProperty]) } diff --git a/iOS/ContactsUI/CNContactViewController.swift b/iOS/ContactsUI/CNContactViewController.swift index dbc4bdc..edef8b8 100644 --- a/iOS/ContactsUI/CNContactViewController.swift +++ b/iOS/ContactsUI/CNContactViewController.swift @@ -21,5 +21,5 @@ class CNContactViewController : UIViewController { @available(iOS 9.0, *) protocol CNContactViewControllerDelegate : NSObjectProtocol { optional func contactViewController(_ viewController: CNContactViewController, shouldPerformDefaultActionFor property: CNContactProperty) -> Bool - @asyncHandler optional func contactViewController(_ viewController: CNContactViewController, didCompleteWith contact: CNContact?) + optional func contactViewController(_ viewController: CNContactViewController, didCompleteWith contact: CNContact?) } diff --git a/iOS/CoreBluetooth/CBCentralManager.swift b/iOS/CoreBluetooth/CBCentralManager.swift index d4187f5..73465bd 100644 --- a/iOS/CoreBluetooth/CBCentralManager.swift +++ b/iOS/CoreBluetooth/CBCentralManager.swift @@ -47,19 +47,19 @@ class CBCentralManager : CBManager { } protocol CBCentralManagerDelegate : NSObjectProtocol { @available(iOS 5.0, *) - @asyncHandler func centralManagerDidUpdateState(_ central: CBCentralManager) + func centralManagerDidUpdateState(_ central: CBCentralManager) @available(iOS 5.0, *) optional func centralManager(_ central: CBCentralManager, willRestoreState dict: [String : Any]) @available(iOS 5.0, *) - @asyncHandler optional func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) + optional func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) @available(iOS 5.0, *) - @asyncHandler optional func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) + optional func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) @available(iOS 5.0, *) - @asyncHandler optional func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) + optional func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) @available(iOS 5.0, *) - @asyncHandler optional func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) + optional func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) @available(iOS 13.0, *) optional func centralManager(_ central: CBCentralManager, connectionEventDidOccur event: CBConnectionEvent, for peripheral: CBPeripheral) @available(iOS 13.0, *) - @asyncHandler optional func centralManager(_ central: CBCentralManager, didUpdateANCSAuthorizationFor peripheral: CBPeripheral) + optional func centralManager(_ central: CBCentralManager, didUpdateANCSAuthorizationFor peripheral: CBPeripheral) } diff --git a/iOS/CoreBluetooth/CBPeripheral.swift b/iOS/CoreBluetooth/CBPeripheral.swift index c04b173..63f424b 100644 --- a/iOS/CoreBluetooth/CBPeripheral.swift +++ b/iOS/CoreBluetooth/CBPeripheral.swift @@ -44,33 +44,33 @@ class CBPeripheral : CBPeer { } protocol CBPeripheralDelegate : NSObjectProtocol { @available(iOS 6.0, *) - @asyncHandler optional func peripheralDidUpdateName(_ peripheral: CBPeripheral) + optional func peripheralDidUpdateName(_ peripheral: CBPeripheral) @available(iOS 7.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]) + optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]) @available(iOS, introduced: 5.0, deprecated: 8.0) - @asyncHandler optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, error: Error?) + optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, error: Error?) @available(iOS 8.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didReadRSSI RSSI: NSNumber, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didReadRSSI RSSI: NSNumber, error: Error?) @available(iOS 5.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) @available(iOS 5.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesFor service: CBService, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesFor service: CBService, error: Error?) @available(iOS 5.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) @available(iOS 5.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) @available(iOS 5.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) @available(iOS 5.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: Error?) @available(iOS 5.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverDescriptorsFor characteristic: CBCharacteristic, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didDiscoverDescriptorsFor characteristic: CBCharacteristic, error: Error?) @available(iOS 5.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor descriptor: CBDescriptor, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor descriptor: CBDescriptor, error: Error?) @available(iOS 5.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor descriptor: CBDescriptor, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor descriptor: CBDescriptor, error: Error?) @available(iOS 5.0, *) optional func peripheralIsReady(toSendWriteWithoutResponse peripheral: CBPeripheral) @available(iOS 11.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?) } diff --git a/iOS/CoreBluetooth/CBPeripheralManager.swift b/iOS/CoreBluetooth/CBPeripheralManager.swift index 888603a..512462f 100644 --- a/iOS/CoreBluetooth/CBPeripheralManager.swift +++ b/iOS/CoreBluetooth/CBPeripheralManager.swift @@ -51,27 +51,27 @@ class CBPeripheralManager : CBManager { } protocol CBPeripheralManagerDelegate : NSObjectProtocol { @available(iOS 6.0, *) - @asyncHandler func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) + func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) @available(iOS 6.0, *) optional func peripheralManager(_ peripheral: CBPeripheralManager, willRestoreState dict: [String : Any]) @available(iOS 6.0, *) - @asyncHandler optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error: Error?) + optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error: Error?) @available(iOS 6.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) @available(iOS 6.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didSubscribeTo characteristic: CBCharacteristic) + optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didSubscribeTo characteristic: CBCharacteristic) @available(iOS 6.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didUnsubscribeFrom characteristic: CBCharacteristic) + optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didUnsubscribeFrom characteristic: CBCharacteristic) @available(iOS 6.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveRead request: CBATTRequest) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveRead request: CBATTRequest) @available(iOS 6.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) @available(iOS 6.0, *) optional func peripheralManagerIsReady(toUpdateSubscribers peripheral: CBPeripheralManager) @available(iOS 6.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) @available(iOS 6.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didUnpublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didUnpublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) @available(iOS 11.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: Error?) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: Error?) } diff --git a/iOS/CoreData/NSFetchedResultsController.swift b/iOS/CoreData/NSFetchedResultsController.swift index 742ff8a..18c5899 100644 --- a/iOS/CoreData/NSFetchedResultsController.swift +++ b/iOS/CoreData/NSFetchedResultsController.swift @@ -34,15 +34,15 @@ enum NSFetchedResultsChangeType : UInt { } protocol NSFetchedResultsControllerDelegate : NSObjectProtocol { @available(iOS 13.0, *) - @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChangeContentWith diff: CollectionDifference) + optional func controller(_ controller: NSFetchedResultsController, didChangeContentWith diff: CollectionDifference) @available(iOS 3.0, *) - @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) + optional func controller(_ controller: NSFetchedResultsController, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) @available(iOS 3.0, *) - @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChange sectionInfo: NSFetchedResultsSectionInfo, atSectionIndex sectionIndex: Int, for type: NSFetchedResultsChangeType) + optional func controller(_ controller: NSFetchedResultsController, didChange sectionInfo: NSFetchedResultsSectionInfo, atSectionIndex sectionIndex: Int, for type: NSFetchedResultsChangeType) @available(iOS 3.0, *) optional func controllerWillChangeContent(_ controller: NSFetchedResultsController) @available(iOS 3.0, *) - @asyncHandler optional func controllerDidChangeContent(_ controller: NSFetchedResultsController) + optional func controllerDidChangeContent(_ controller: NSFetchedResultsController) @available(iOS 4.0, *) optional func controller(_ controller: NSFetchedResultsController, sectionIndexTitleForSectionName sectionName: String) -> String? } diff --git a/iOS/CoreLocation/CLLocationManagerDelegate.swift b/iOS/CoreLocation/CLLocationManagerDelegate.swift index d00ffe2..2505a6f 100644 --- a/iOS/CoreLocation/CLLocationManagerDelegate.swift +++ b/iOS/CoreLocation/CLLocationManagerDelegate.swift @@ -1,41 +1,41 @@ protocol CLLocationManagerDelegate : NSObjectProtocol { @available(iOS 6.0, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) + optional func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) @available(iOS 3.0, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) + optional func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) @available(iOS 3.0, *) optional func locationManagerShouldDisplayHeadingCalibration(_ manager: CLLocationManager) -> Bool @available(iOS 7.0, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didDetermineState state: CLRegionState, for region: CLRegion) + optional func locationManager(_ manager: CLLocationManager, didDetermineState state: CLRegionState, for region: CLRegion) @available(iOS, introduced: 7.0, deprecated: 13.0) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didRangeBeacons beacons: [CLBeacon], in region: CLBeaconRegion) + optional func locationManager(_ manager: CLLocationManager, didRangeBeacons beacons: [CLBeacon], in region: CLBeaconRegion) @available(iOS, introduced: 7.0, deprecated: 13.0) optional func locationManager(_ manager: CLLocationManager, rangingBeaconsDidFailFor region: CLBeaconRegion, withError error: Error) @available(iOS 13.0, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didRange beacons: [CLBeacon], satisfying beaconConstraint: CLBeaconIdentityConstraint) + optional func locationManager(_ manager: CLLocationManager, didRange beacons: [CLBeacon], satisfying beaconConstraint: CLBeaconIdentityConstraint) @available(iOS 13.0, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didFailRangingFor beaconConstraint: CLBeaconIdentityConstraint, error: Error) + optional func locationManager(_ manager: CLLocationManager, didFailRangingFor beaconConstraint: CLBeaconIdentityConstraint, error: Error) @available(iOS 4.0, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) + optional func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) @available(iOS 4.0, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) + optional func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) @available(iOS 2.0, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) + optional func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) @available(iOS 4.0, *) optional func locationManager(_ manager: CLLocationManager, monitoringDidFailFor region: CLRegion?, withError error: Error) @available(iOS, introduced: 4.2, deprecated: 14.0) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) + optional func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) @available(iOS 14.0, *) - @asyncHandler optional func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) + optional func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) @available(iOS 5.0, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didStartMonitoringFor region: CLRegion) + optional func locationManager(_ manager: CLLocationManager, didStartMonitoringFor region: CLRegion) @available(iOS 6.0, *) - @asyncHandler optional func locationManagerDidPauseLocationUpdates(_ manager: CLLocationManager) + optional func locationManagerDidPauseLocationUpdates(_ manager: CLLocationManager) @available(iOS 6.0, *) - @asyncHandler optional func locationManagerDidResumeLocationUpdates(_ manager: CLLocationManager) + optional func locationManagerDidResumeLocationUpdates(_ manager: CLLocationManager) @available(iOS 6.0, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didFinishDeferredUpdatesWithError error: Error?) + optional func locationManager(_ manager: CLLocationManager, didFinishDeferredUpdatesWithError error: Error?) @available(iOS 8.0, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didVisit visit: CLVisit) + optional func locationManager(_ manager: CLLocationManager, didVisit visit: CLVisit) } diff --git a/iOS/CoreMotion/CMHeadphoneMotionManagerDelegate.swift b/iOS/CoreMotion/CMHeadphoneMotionManagerDelegate.swift index 001e518..242a5a8 100644 --- a/iOS/CoreMotion/CMHeadphoneMotionManagerDelegate.swift +++ b/iOS/CoreMotion/CMHeadphoneMotionManagerDelegate.swift @@ -1,6 +1,6 @@ @available(iOS 14.0, *) protocol CMHeadphoneMotionManagerDelegate : NSObjectProtocol { - @asyncHandler optional func headphoneMotionManagerDidConnect(_ manager: CMHeadphoneMotionManager) - @asyncHandler optional func headphoneMotionManagerDidDisconnect(_ manager: CMHeadphoneMotionManager) + optional func headphoneMotionManagerDidConnect(_ manager: CMHeadphoneMotionManager) + optional func headphoneMotionManagerDidDisconnect(_ manager: CMHeadphoneMotionManager) } diff --git a/iOS/CoreNFC/CoreNFC.swift b/iOS/CoreNFC/CoreNFC.swift index dd27ad0..d052e75 100644 --- a/iOS/CoreNFC/CoreNFC.swift +++ b/iOS/CoreNFC/CoreNFC.swift @@ -71,11 +71,11 @@ protocol NFCReaderSessionProtocol : NSObjectProtocol { @available(iOS 11.0, *) protocol __NFCReaderSessionDelegate : NSObjectProtocol { @available(iOS 11.0, *) - @asyncHandler func readerSessionDidBecomeActive(_ session: NFCReaderSession) + func readerSessionDidBecomeActive(_ session: NFCReaderSession) @available(iOS 11.0, *) - @asyncHandler func readerSession(_ session: NFCReaderSession, didInvalidateWithError error: Error) + func readerSession(_ session: NFCReaderSession, didInvalidateWithError error: Error) @available(iOS 11.0, *) - @asyncHandler optional func readerSession(_ session: NFCReaderSession, didDetect tags: [__NFCTag]) + optional func readerSession(_ session: NFCReaderSession, didDetect tags: [__NFCTag]) } @available(iOS 11.0, *) class NFCReaderSession : NSObject, NFCReaderSessionProtocol { @@ -126,11 +126,11 @@ class NFCTagCommandConfiguration : NSObject, NSCopying { @available(iOS 13.0, *) protocol __NFCTagReaderSessionDelegate : NSObjectProtocol { @available(iOS 13.0, *) - @asyncHandler func tagReaderSession(_ session: NFCTagReaderSession, didInvalidateWithError error: Error) + func tagReaderSession(_ session: NFCTagReaderSession, didInvalidateWithError error: Error) @available(iOS 13.0, *) - @asyncHandler optional func tagReaderSessionDidBecomeActive(_ session: NFCTagReaderSession) + optional func tagReaderSessionDidBecomeActive(_ session: NFCTagReaderSession) @available(iOS 13.0, *) - @asyncHandler optional func tagReaderSession(_ session: NFCTagReaderSession, didDetect tags: [__NFCTag]) + optional func tagReaderSession(_ session: NFCTagReaderSession, didDetect tags: [__NFCTag]) } @available(iOS 13.0, *) class NFCTagReaderSession : NFCReaderSession { @@ -170,13 +170,13 @@ extension NFCTagReaderSession { @available(iOS 11.0, *) protocol NFCNDEFReaderSessionDelegate : NSObjectProtocol { @available(iOS 11.0, *) - @asyncHandler func readerSession(_ session: NFCNDEFReaderSession, didInvalidateWithError error: Error) + func readerSession(_ session: NFCNDEFReaderSession, didInvalidateWithError error: Error) @available(iOS 11.0, *) - @asyncHandler func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage]) + func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage]) @available(iOS 13.0, *) - @asyncHandler optional func readerSession(_ session: NFCNDEFReaderSession, didDetect tags: [NFCNDEFTag]) + optional func readerSession(_ session: NFCNDEFReaderSession, didDetect tags: [NFCNDEFTag]) @available(iOS 13.0, *) - @asyncHandler optional func readerSessionDidBecomeActive(_ session: NFCNDEFReaderSession) + optional func readerSessionDidBecomeActive(_ session: NFCNDEFReaderSession) } @available(iOS 11.0, *) class NFCNDEFReaderSession : NFCReaderSession { @@ -830,11 +830,11 @@ class NFCVASResponse : NSObject, NSCopying { @available(iOS 13.0, *) protocol NFCVASReaderSessionDelegate : NSObjectProtocol { @available(iOS 13.0, *) - @asyncHandler optional func readerSessionDidBecomeActive(_ session: NFCVASReaderSession) + optional func readerSessionDidBecomeActive(_ session: NFCVASReaderSession) @available(iOS 13.0, *) - @asyncHandler func readerSession(_ session: NFCVASReaderSession, didInvalidateWithError error: Error) + func readerSession(_ session: NFCVASReaderSession, didInvalidateWithError error: Error) @available(iOS 13.0, *) - @asyncHandler func readerSession(_ session: NFCVASReaderSession, didReceive responses: [NFCVASResponse]) + func readerSession(_ session: NFCVASReaderSession, didReceive responses: [NFCVASResponse]) } @available(iOS 13.0, *) class NFCVASReaderSession : NFCReaderSession { diff --git a/iOS/CoreSpotlight/CSSearchableIndex.swift b/iOS/CoreSpotlight/CSSearchableIndex.swift index 981f9dd..ff5ec6a 100644 --- a/iOS/CoreSpotlight/CSSearchableIndex.swift +++ b/iOS/CoreSpotlight/CSSearchableIndex.swift @@ -41,8 +41,8 @@ extension CSSearchableIndex { protocol CSSearchableIndexDelegate : NSObjectProtocol { func searchableIndex(_ searchableIndex: CSSearchableIndex, reindexAllSearchableItemsWithAcknowledgementHandler acknowledgementHandler: @escaping () -> Void) func searchableIndex(_ searchableIndex: CSSearchableIndex, reindexSearchableItemsWithIdentifiers identifiers: [String], acknowledgementHandler: @escaping () -> Void) - @asyncHandler optional func searchableIndexDidThrottle(_ searchableIndex: CSSearchableIndex) - @asyncHandler optional func searchableIndexDidFinishThrottle(_ searchableIndex: CSSearchableIndex) + optional func searchableIndexDidThrottle(_ searchableIndex: CSSearchableIndex) + optional func searchableIndexDidFinishThrottle(_ searchableIndex: CSSearchableIndex) @available(iOS 11.0, *) optional func data(for searchableIndex: CSSearchableIndex, itemIdentifier: String, typeIdentifier: String) throws -> Data @available(iOS 11.0, *) diff --git a/iOS/CoreTelephony/CTTelephonyNetworkInfo.swift b/iOS/CoreTelephony/CTTelephonyNetworkInfo.swift index f8fea20..0428bf5 100644 --- a/iOS/CoreTelephony/CTTelephonyNetworkInfo.swift +++ b/iOS/CoreTelephony/CTTelephonyNetworkInfo.swift @@ -33,7 +33,7 @@ let CTRadioAccessTechnologyNRNSA: String let CTRadioAccessTechnologyNR: String @available(iOS 13.0, *) protocol CTTelephonyNetworkInfoDelegate : NSObjectProtocol { - @asyncHandler optional func dataServiceIdentifierDidChange(_ identifier: String) + optional func dataServiceIdentifierDidChange(_ identifier: String) } @available(iOS 4.0, *) class CTTelephonyNetworkInfo : NSObject { diff --git a/iOS/EventKitUI/EKCalendarChooser.swift b/iOS/EventKitUI/EKCalendarChooser.swift index 4e032ce..245c798 100644 --- a/iOS/EventKitUI/EKCalendarChooser.swift +++ b/iOS/EventKitUI/EKCalendarChooser.swift @@ -21,7 +21,7 @@ class EKCalendarChooser : UIViewController { var selectedCalendars: Set } protocol EKCalendarChooserDelegate : NSObjectProtocol { - @asyncHandler optional func calendarChooserSelectionDidChange(_ calendarChooser: EKCalendarChooser) - @asyncHandler optional func calendarChooserDidFinish(_ calendarChooser: EKCalendarChooser) - @asyncHandler optional func calendarChooserDidCancel(_ calendarChooser: EKCalendarChooser) + optional func calendarChooserSelectionDidChange(_ calendarChooser: EKCalendarChooser) + optional func calendarChooserDidFinish(_ calendarChooser: EKCalendarChooser) + optional func calendarChooserDidCancel(_ calendarChooser: EKCalendarChooser) } diff --git a/iOS/EventKitUI/EKEventEditViewController.swift b/iOS/EventKitUI/EKEventEditViewController.swift index 82c718a..9777f65 100644 --- a/iOS/EventKitUI/EKEventEditViewController.swift +++ b/iOS/EventKitUI/EKEventEditViewController.swift @@ -16,7 +16,7 @@ class EKEventEditViewController : UINavigationController { } protocol EKEventEditViewDelegate : NSObjectProtocol { @available(iOS 4.0, *) - @asyncHandler func eventEditViewController(_ controller: EKEventEditViewController, didCompleteWith action: EKEventEditViewAction) + func eventEditViewController(_ controller: EKEventEditViewController, didCompleteWith action: EKEventEditViewAction) @available(iOS 4.0, *) optional func eventEditViewControllerDefaultCalendar(forNewEvents controller: EKEventEditViewController) -> EKCalendar } diff --git a/iOS/EventKitUI/EKEventViewController.swift b/iOS/EventKitUI/EKEventViewController.swift index c83f8b2..b458ce8 100644 --- a/iOS/EventKitUI/EKEventViewController.swift +++ b/iOS/EventKitUI/EKEventViewController.swift @@ -16,5 +16,5 @@ class EKEventViewController : UIViewController { } protocol EKEventViewDelegate : NSObjectProtocol { @available(iOS 4.2, *) - @asyncHandler func eventViewController(_ controller: EKEventViewController, didCompleteWith action: EKEventViewAction) + func eventViewController(_ controller: EKEventViewController, didCompleteWith action: EKEventViewAction) } diff --git a/iOS/ExternalAccessory/EAAccessory.swift b/iOS/ExternalAccessory/EAAccessory.swift index 935eaf6..ddaa549 100644 --- a/iOS/ExternalAccessory/EAAccessory.swift +++ b/iOS/ExternalAccessory/EAAccessory.swift @@ -27,5 +27,5 @@ class EAAccessory : NSObject { } protocol EAAccessoryDelegate : NSObjectProtocol { @available(iOS 3.0, *) - @asyncHandler optional func accessoryDidDisconnect(_ accessory: EAAccessory) + optional func accessoryDidDisconnect(_ accessory: EAAccessory) } diff --git a/iOS/ExternalAccessory/EAWiFiUnconfiguredAccessoryBrowser.swift b/iOS/ExternalAccessory/EAWiFiUnconfiguredAccessoryBrowser.swift index b494ca3..f24431e 100644 --- a/iOS/ExternalAccessory/EAWiFiUnconfiguredAccessoryBrowser.swift +++ b/iOS/ExternalAccessory/EAWiFiUnconfiguredAccessoryBrowser.swift @@ -27,11 +27,11 @@ class EAWiFiUnconfiguredAccessoryBrowser : NSObject { } protocol EAWiFiUnconfiguredAccessoryBrowserDelegate : NSObjectProtocol { @available(iOS 8.0, *) - @asyncHandler func accessoryBrowser(_ browser: EAWiFiUnconfiguredAccessoryBrowser, didUpdate state: EAWiFiUnconfiguredAccessoryBrowserState) + func accessoryBrowser(_ browser: EAWiFiUnconfiguredAccessoryBrowser, didUpdate state: EAWiFiUnconfiguredAccessoryBrowserState) @available(iOS 8.0, *) - @asyncHandler func accessoryBrowser(_ browser: EAWiFiUnconfiguredAccessoryBrowser, didFindUnconfiguredAccessories accessories: Set) + func accessoryBrowser(_ browser: EAWiFiUnconfiguredAccessoryBrowser, didFindUnconfiguredAccessories accessories: Set) @available(iOS 8.0, *) - @asyncHandler func accessoryBrowser(_ browser: EAWiFiUnconfiguredAccessoryBrowser, didRemoveUnconfiguredAccessories accessories: Set) + func accessoryBrowser(_ browser: EAWiFiUnconfiguredAccessoryBrowser, didRemoveUnconfiguredAccessories accessories: Set) @available(iOS 8.0, *) - @asyncHandler func accessoryBrowser(_ browser: EAWiFiUnconfiguredAccessoryBrowser, didFinishConfiguringAccessory accessory: EAWiFiUnconfiguredAccessory, with status: EAWiFiUnconfiguredAccessoryConfigurationStatus) + func accessoryBrowser(_ browser: EAWiFiUnconfiguredAccessoryBrowser, didFinishConfiguringAccessory accessory: EAWiFiUnconfiguredAccessory, with status: EAWiFiUnconfiguredAccessoryConfigurationStatus) } diff --git a/iOS/FileProvider/NSFileProviderEnumerating.swift b/iOS/FileProvider/NSFileProviderEnumerating.swift index 3f2f440..eac15f9 100644 --- a/iOS/FileProvider/NSFileProviderEnumerating.swift +++ b/iOS/FileProvider/NSFileProviderEnumerating.swift @@ -18,13 +18,13 @@ extension NSFileProviderPage { static let initialPageSortedByName: NSData } protocol NSFileProviderEnumerationObserver : NSObjectProtocol { - @asyncHandler func didEnumerate(_ updatedItems: [NSFileProviderItemProtocol]) + func didEnumerate(_ updatedItems: [NSFileProviderItemProtocol]) func finishEnumerating(upTo nextPage: NSFileProviderPage?) func finishEnumeratingWithError(_ error: Error) } protocol NSFileProviderChangeObserver : NSObjectProtocol { - @asyncHandler func didUpdate(_ updatedItems: [NSFileProviderItemProtocol]) - @asyncHandler func didDeleteItems(withIdentifiers deletedItemIdentifiers: [NSFileProviderItemIdentifier]) + func didUpdate(_ updatedItems: [NSFileProviderItemProtocol]) + func didDeleteItems(withIdentifiers deletedItemIdentifiers: [NSFileProviderItemIdentifier]) func finishEnumeratingChanges(upTo anchor: NSFileProviderSyncAnchor, moreComing: Bool) func finishEnumeratingWithError(_ error: Error) } diff --git a/iOS/Foundation/NSFilePresenter.swift b/iOS/Foundation/NSFilePresenter.swift index 4256b55..9d26ab2 100644 --- a/iOS/Foundation/NSFilePresenter.swift +++ b/iOS/Foundation/NSFilePresenter.swift @@ -9,27 +9,27 @@ protocol NSFilePresenter : NSObjectProtocol { optional func savePresentedItemChanges() async throws optional func accommodatePresentedItemDeletion(completionHandler: @escaping (Error?) -> Void) optional func accommodatePresentedItemDeletion() async throws - @asyncHandler optional func presentedItemDidMove(to newURL: URL) - @asyncHandler optional func presentedItemDidChange() + optional func presentedItemDidMove(to newURL: URL) + optional func presentedItemDidChange() @available(iOS 11.0, *) - @asyncHandler optional func presentedItemDidChangeUbiquityAttributes(_ attributes: Set) + optional func presentedItemDidChangeUbiquityAttributes(_ attributes: Set) @available(iOS 11.0, *) optional var observedPresentedItemUbiquityAttributes: Set { get } @available(iOS 5.0, *) - @asyncHandler optional func presentedItemDidGain(_ version: NSFileVersion) + optional func presentedItemDidGain(_ version: NSFileVersion) @available(iOS 5.0, *) - @asyncHandler optional func presentedItemDidLose(_ version: NSFileVersion) + optional func presentedItemDidLose(_ version: NSFileVersion) @available(iOS 5.0, *) - @asyncHandler optional func presentedItemDidResolveConflict(_ version: NSFileVersion) + optional func presentedItemDidResolveConflict(_ version: NSFileVersion) optional func accommodatePresentedSubitemDeletion(at url: URL, completionHandler: @escaping (Error?) -> Void) optional func accommodatePresentedSubitemDeletion(at url: URL) async throws - @asyncHandler optional func presentedSubitemDidAppear(at url: URL) - @asyncHandler optional func presentedSubitem(at oldURL: URL, didMoveTo newURL: URL) - @asyncHandler optional func presentedSubitemDidChange(at url: URL) + optional func presentedSubitemDidAppear(at url: URL) + optional func presentedSubitem(at oldURL: URL, didMoveTo newURL: URL) + optional func presentedSubitemDidChange(at url: URL) @available(iOS 5.0, *) - @asyncHandler optional func presentedSubitem(at url: URL, didGain version: NSFileVersion) + optional func presentedSubitem(at url: URL, didGain version: NSFileVersion) @available(iOS 5.0, *) - @asyncHandler optional func presentedSubitem(at url: URL, didLose version: NSFileVersion) + optional func presentedSubitem(at url: URL, didLose version: NSFileVersion) @available(iOS 5.0, *) - @asyncHandler optional func presentedSubitem(at url: URL, didResolve version: NSFileVersion) + optional func presentedSubitem(at url: URL, didResolve version: NSFileVersion) } diff --git a/iOS/Foundation/NSKeyedArchiver.swift b/iOS/Foundation/NSKeyedArchiver.swift index ca5125a..c307c6e 100644 --- a/iOS/Foundation/NSKeyedArchiver.swift +++ b/iOS/Foundation/NSKeyedArchiver.swift @@ -80,17 +80,17 @@ extension NSKeyedUnarchiver { } protocol NSKeyedArchiverDelegate : NSObjectProtocol { optional func archiver(_ archiver: NSKeyedArchiver, willEncode object: Any) -> Any? - @asyncHandler optional func archiver(_ archiver: NSKeyedArchiver, didEncode object: Any?) + optional func archiver(_ archiver: NSKeyedArchiver, didEncode object: Any?) optional func archiver(_ archiver: NSKeyedArchiver, willReplace object: Any?, with newObject: Any?) optional func archiverWillFinish(_ archiver: NSKeyedArchiver) - @asyncHandler optional func archiverDidFinish(_ archiver: NSKeyedArchiver) + optional func archiverDidFinish(_ archiver: NSKeyedArchiver) } protocol NSKeyedUnarchiverDelegate : NSObjectProtocol { optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, cannotDecodeObjectOfClassName name: String, originalClasses classNames: [String]) -> AnyClass? optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, didDecode object: Any?) -> Any? optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, willReplace object: Any, with newObject: Any) optional func unarchiverWillFinish(_ unarchiver: NSKeyedUnarchiver) - @asyncHandler optional func unarchiverDidFinish(_ unarchiver: NSKeyedUnarchiver) + optional func unarchiverDidFinish(_ unarchiver: NSKeyedUnarchiver) } extension NSObject { var classForKeyedArchiver: AnyClass? { get } diff --git a/iOS/Foundation/NSNetServices.swift b/iOS/Foundation/NSNetServices.swift index e711800..5a93c79 100644 --- a/iOS/Foundation/NSNetServices.swift +++ b/iOS/Foundation/NSNetServices.swift @@ -70,23 +70,23 @@ class NetServiceBrowser : NSObject { @available(iOS 2.0, *) protocol NetServiceDelegate : NSObjectProtocol { optional func netServiceWillPublish(_ sender: NetService) - @asyncHandler optional func netServiceDidPublish(_ sender: NetService) - @asyncHandler optional func netService(_ sender: NetService, didNotPublish errorDict: [String : NSNumber]) + optional func netServiceDidPublish(_ sender: NetService) + optional func netService(_ sender: NetService, didNotPublish errorDict: [String : NSNumber]) optional func netServiceWillResolve(_ sender: NetService) - @asyncHandler optional func netServiceDidResolveAddress(_ sender: NetService) - @asyncHandler optional func netService(_ sender: NetService, didNotResolve errorDict: [String : NSNumber]) - @asyncHandler optional func netServiceDidStop(_ sender: NetService) - @asyncHandler optional func netService(_ sender: NetService, didUpdateTXTRecord data: Data) + optional func netServiceDidResolveAddress(_ sender: NetService) + optional func netService(_ sender: NetService, didNotResolve errorDict: [String : NSNumber]) + optional func netServiceDidStop(_ sender: NetService) + optional func netService(_ sender: NetService, didUpdateTXTRecord data: Data) @available(iOS 7.0, *) - @asyncHandler optional func netService(_ sender: NetService, didAcceptConnectionWith inputStream: InputStream, outputStream: OutputStream) + optional func netService(_ sender: NetService, didAcceptConnectionWith inputStream: InputStream, outputStream: OutputStream) } @available(iOS 2.0, *) protocol NetServiceBrowserDelegate : NSObjectProtocol { optional func netServiceBrowserWillSearch(_ browser: NetServiceBrowser) - @asyncHandler optional func netServiceBrowserDidStopSearch(_ browser: NetServiceBrowser) - @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didNotSearch errorDict: [String : NSNumber]) - @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didFindDomain domainString: String, moreComing: Bool) - @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didFind service: NetService, moreComing: Bool) - @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemoveDomain domainString: String, moreComing: Bool) - @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemove service: NetService, moreComing: Bool) + optional func netServiceBrowserDidStopSearch(_ browser: NetServiceBrowser) + optional func netServiceBrowser(_ browser: NetServiceBrowser, didNotSearch errorDict: [String : NSNumber]) + optional func netServiceBrowser(_ browser: NetServiceBrowser, didFindDomain domainString: String, moreComing: Bool) + optional func netServiceBrowser(_ browser: NetServiceBrowser, didFind service: NetService, moreComing: Bool) + optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemoveDomain domainString: String, moreComing: Bool) + optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemove service: NetService, moreComing: Bool) } diff --git a/iOS/Foundation/NSURLConnection.swift b/iOS/Foundation/NSURLConnection.swift index e0aec98..626841a 100644 --- a/iOS/Foundation/NSURLConnection.swift +++ b/iOS/Foundation/NSURLConnection.swift @@ -22,31 +22,31 @@ class NSURLConnection : NSObject { } @available(iOS 2.0, *) protocol NSURLConnectionDelegate : NSObjectProtocol { - @asyncHandler optional func connection(_ connection: NSURLConnection, didFailWithError error: Error) + optional func connection(_ connection: NSURLConnection, didFailWithError error: Error) optional func connectionShouldUseCredentialStorage(_ connection: NSURLConnection) -> Bool optional func connection(_ connection: NSURLConnection, willSendRequestFor challenge: URLAuthenticationChallenge) @available(iOS, introduced: 3.0, deprecated: 8.0, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") optional func connection(_ connection: NSURLConnection, canAuthenticateAgainstProtectionSpace protectionSpace: URLProtectionSpace) -> Bool @available(iOS, introduced: 2.0, deprecated: 8.0, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") - @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive challenge: URLAuthenticationChallenge) + optional func connection(_ connection: NSURLConnection, didReceive challenge: URLAuthenticationChallenge) @available(iOS, introduced: 2.0, deprecated: 8.0, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") - @asyncHandler optional func connection(_ connection: NSURLConnection, didCancel challenge: URLAuthenticationChallenge) + optional func connection(_ connection: NSURLConnection, didCancel challenge: URLAuthenticationChallenge) } @available(iOS 2.0, *) protocol NSURLConnectionDataDelegate : NSURLConnectionDelegate { optional func connection(_ connection: NSURLConnection, willSend request: URLRequest, redirectResponse response: URLResponse?) -> URLRequest? - @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive response: URLResponse) - @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive data: Data) + optional func connection(_ connection: NSURLConnection, didReceive response: URLResponse) + optional func connection(_ connection: NSURLConnection, didReceive data: Data) optional func connection(_ connection: NSURLConnection, needNewBodyStream request: URLRequest) -> InputStream? - @asyncHandler optional func connection(_ connection: NSURLConnection, didSendBodyData bytesWritten: Int, totalBytesWritten: Int, totalBytesExpectedToWrite: Int) + optional func connection(_ connection: NSURLConnection, didSendBodyData bytesWritten: Int, totalBytesWritten: Int, totalBytesExpectedToWrite: Int) optional func connection(_ connection: NSURLConnection, willCacheResponse cachedResponse: CachedURLResponse) -> CachedURLResponse? - @asyncHandler optional func connectionDidFinishLoading(_ connection: NSURLConnection) + optional func connectionDidFinishLoading(_ connection: NSURLConnection) } @available(iOS 2.0, *) protocol NSURLConnectionDownloadDelegate : NSURLConnectionDelegate { - @asyncHandler optional func connection(_ connection: NSURLConnection, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, expectedTotalBytes: Int64) - @asyncHandler optional func connectionDidResumeDownloading(_ connection: NSURLConnection, totalBytesWritten: Int64, expectedTotalBytes: Int64) - @asyncHandler func connectionDidFinishDownloading(_ connection: NSURLConnection, destinationURL: URL) + optional func connection(_ connection: NSURLConnection, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, expectedTotalBytes: Int64) + optional func connectionDidResumeDownloading(_ connection: NSURLConnection, totalBytesWritten: Int64, expectedTotalBytes: Int64) + func connectionDidFinishDownloading(_ connection: NSURLConnection, destinationURL: URL) } extension NSURLConnection { @available(iOS, introduced: 2.0, deprecated: 9.0, message: "Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h") diff --git a/iOS/Foundation/NSURLProtocol.swift b/iOS/Foundation/NSURLProtocol.swift index 69d1a15..2e177ef 100644 --- a/iOS/Foundation/NSURLProtocol.swift +++ b/iOS/Foundation/NSURLProtocol.swift @@ -3,12 +3,12 @@ protocol URLProtocolClient : NSObjectProtocol { func urlProtocol(_ protocol: URLProtocol, wasRedirectedTo request: URLRequest, redirectResponse: URLResponse) func urlProtocol(_ protocol: URLProtocol, cachedResponseIsValid cachedResponse: CachedURLResponse) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didReceive response: URLResponse, cacheStoragePolicy policy: URLCache.StoragePolicy) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didLoad data: Data) - @asyncHandler func urlProtocolDidFinishLoading(_ protocol: URLProtocol) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didFailWithError error: Error) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didReceive challenge: URLAuthenticationChallenge) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didCancel challenge: URLAuthenticationChallenge) + func urlProtocol(_ protocol: URLProtocol, didReceive response: URLResponse, cacheStoragePolicy policy: URLCache.StoragePolicy) + func urlProtocol(_ protocol: URLProtocol, didLoad data: Data) + func urlProtocolDidFinishLoading(_ protocol: URLProtocol) + func urlProtocol(_ protocol: URLProtocol, didFailWithError error: Error) + func urlProtocol(_ protocol: URLProtocol, didReceive challenge: URLAuthenticationChallenge) + func urlProtocol(_ protocol: URLProtocol, didCancel challenge: URLAuthenticationChallenge) } @available(iOS 2.0, *) class URLProtocol : NSObject { diff --git a/iOS/Foundation/NSURLSession.swift b/iOS/Foundation/NSURLSession.swift index bed17ef..b71dfd5 100644 --- a/iOS/Foundation/NSURLSession.swift +++ b/iOS/Foundation/NSURLSession.swift @@ -285,11 +285,11 @@ extension URLSession { } @available(iOS 7.0, *) protocol URLSessionDelegate : NSObjectProtocol { - @asyncHandler optional func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) - @asyncHandler optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) + optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) @available(iOS 7.0, *) - @asyncHandler optional func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) + optional func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) } @available(iOS 7.0, *) protocol URLSessionTaskDelegate : URLSessionDelegate { @@ -301,43 +301,43 @@ protocol URLSessionTaskDelegate : URLSessionDelegate { optional func urlSession(_ session: URLSession, taskIsWaitingForConnectivity task: URLSessionTask) optional func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest, completionHandler: @escaping (URLRequest?) -> Void) optional func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest) async -> URLRequest? - @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) optional func urlSession(_ session: URLSession, task: URLSessionTask, needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) optional func urlSession(_ session: URLSession, task: URLSessionTask) async -> InputStream? - @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) @available(iOS 10.0, *) - @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) - @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) } @available(iOS 7.0, *) protocol URLSessionDataDelegate : URLSessionTaskDelegate { - @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse) async -> URLSession.ResponseDisposition - @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome downloadTask: URLSessionDownloadTask) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome downloadTask: URLSessionDownloadTask) @available(iOS 9.0, *) - @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome streamTask: URLSessionStreamTask) - @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome streamTask: URLSessionStreamTask) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse, completionHandler: @escaping (CachedURLResponse?) -> Void) optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse) async -> CachedURLResponse? } @available(iOS 7.0, *) protocol URLSessionDownloadDelegate : URLSessionTaskDelegate { - @asyncHandler func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) - @asyncHandler optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) - @asyncHandler optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) + func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) + optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) + optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) } @available(iOS 9.0, *) protocol URLSessionStreamDelegate : URLSessionTaskDelegate { optional func urlSession(_ session: URLSession, readClosedFor streamTask: URLSessionStreamTask) optional func urlSession(_ session: URLSession, writeClosedFor streamTask: URLSessionStreamTask) optional func urlSession(_ session: URLSession, betterRouteDiscoveredFor streamTask: URLSessionStreamTask) - @asyncHandler optional func urlSession(_ session: URLSession, streamTask: URLSessionStreamTask, didBecome inputStream: InputStream, outputStream: OutputStream) + optional func urlSession(_ session: URLSession, streamTask: URLSessionStreamTask, didBecome inputStream: InputStream, outputStream: OutputStream) } @available(iOS 13.0, *) protocol URLSessionWebSocketDelegate : URLSessionTaskDelegate { - @asyncHandler optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) - @asyncHandler optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) + optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) + optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) } @available(iOS 7.0, *) let NSURLSessionDownloadTaskResumeData: String diff --git a/iOS/Foundation/NSUserActivity.swift b/iOS/Foundation/NSUserActivity.swift index b3d97ee..7a9de26 100644 --- a/iOS/Foundation/NSUserActivity.swift +++ b/iOS/Foundation/NSUserActivity.swift @@ -51,5 +51,5 @@ let NSUserActivityTypeBrowsingWeb: String protocol NSUserActivityDelegate : NSObjectProtocol { optional func userActivityWillSave(_ userActivity: NSUserActivity) optional func userActivityWasContinued(_ userActivity: NSUserActivity) - @asyncHandler optional func userActivity(_ userActivity: NSUserActivity, didReceive inputStream: InputStream, outputStream: OutputStream) + optional func userActivity(_ userActivity: NSUserActivity, didReceive inputStream: InputStream, outputStream: OutputStream) } diff --git a/iOS/Foundation/NSXMLParser.swift b/iOS/Foundation/NSXMLParser.swift index 36213c0..bb29a90 100644 --- a/iOS/Foundation/NSXMLParser.swift +++ b/iOS/Foundation/NSXMLParser.swift @@ -23,18 +23,18 @@ extension XMLParser { var columnNumber: Int { get } } protocol XMLParserDelegate : NSObjectProtocol { - @asyncHandler optional func parserDidStartDocument(_ parser: XMLParser) - @asyncHandler optional func parserDidEndDocument(_ parser: XMLParser) + optional func parserDidStartDocument(_ parser: XMLParser) + optional func parserDidEndDocument(_ parser: XMLParser) optional func parser(_ parser: XMLParser, foundNotationDeclarationWithName name: String, publicID: String?, systemID: String?) optional func parser(_ parser: XMLParser, foundUnparsedEntityDeclarationWithName name: String, publicID: String?, systemID: String?, notationName: String?) optional func parser(_ parser: XMLParser, foundAttributeDeclarationWithName attributeName: String, forElement elementName: String, type: String?, defaultValue: String?) optional func parser(_ parser: XMLParser, foundElementDeclarationWithName elementName: String, model: String) optional func parser(_ parser: XMLParser, foundInternalEntityDeclarationWithName name: String, value: String?) optional func parser(_ parser: XMLParser, foundExternalEntityDeclarationWithName name: String, publicID: String?, systemID: String?) - @asyncHandler optional func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) - @asyncHandler optional func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) - @asyncHandler optional func parser(_ parser: XMLParser, didStartMappingPrefix prefix: String, toURI namespaceURI: String) - @asyncHandler optional func parser(_ parser: XMLParser, didEndMappingPrefix prefix: String) + optional func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) + optional func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) + optional func parser(_ parser: XMLParser, didStartMappingPrefix prefix: String, toURI namespaceURI: String) + optional func parser(_ parser: XMLParser, didEndMappingPrefix prefix: String) optional func parser(_ parser: XMLParser, foundCharacters string: String) optional func parser(_ parser: XMLParser, foundIgnorableWhitespace whitespaceString: String) optional func parser(_ parser: XMLParser, foundProcessingInstructionWithTarget target: String, data: String?) diff --git a/iOS/GameKit/GKEventListener.swift b/iOS/GameKit/GKEventListener.swift index c4240ae..dffdcab 100644 --- a/iOS/GameKit/GKEventListener.swift +++ b/iOS/GameKit/GKEventListener.swift @@ -3,9 +3,9 @@ protocol GKChallengeListener : NSObjectProtocol { @available(iOS 7.0, *) optional func player(_ player: GKPlayer, wantsToPlay challenge: GKChallenge) @available(iOS 7.0, *) - @asyncHandler optional func player(_ player: GKPlayer, didReceive challenge: GKChallenge) + optional func player(_ player: GKPlayer, didReceive challenge: GKChallenge) @available(iOS 7.0, *) - @asyncHandler optional func player(_ player: GKPlayer, didComplete challenge: GKChallenge, issuedByFriend friendPlayer: GKPlayer) + optional func player(_ player: GKPlayer, didComplete challenge: GKChallenge, issuedByFriend friendPlayer: GKPlayer) @available(iOS 7.0, *) optional func player(_ player: GKPlayer, issuedChallengeWasCompleted challenge: GKChallenge, byFriend friendPlayer: GKPlayer) } diff --git a/iOS/GameKit/GKFriendRequestComposeViewController.swift b/iOS/GameKit/GKFriendRequestComposeViewController.swift index 6b22b61..1743ad5 100644 --- a/iOS/GameKit/GKFriendRequestComposeViewController.swift +++ b/iOS/GameKit/GKFriendRequestComposeViewController.swift @@ -16,5 +16,5 @@ extension GKFriendRequestComposeViewController { @available(iOS, introduced: 4.2, deprecated: 10.0) protocol GKFriendRequestComposeViewControllerDelegate { @available(iOS, introduced: 4.2, deprecated: 10.0) - @asyncHandler func friendRequestComposeViewControllerDidFinish(_ viewController: GKFriendRequestComposeViewController) + func friendRequestComposeViewControllerDidFinish(_ viewController: GKFriendRequestComposeViewController) } diff --git a/iOS/GameKit/GKGameCenterViewController.swift b/iOS/GameKit/GKGameCenterViewController.swift index c4e5b49..66bdc3f 100644 --- a/iOS/GameKit/GKGameCenterViewController.swift +++ b/iOS/GameKit/GKGameCenterViewController.swift @@ -33,5 +33,5 @@ extension GKGameCenterViewController { } protocol GKGameCenterControllerDelegate : NSObjectProtocol { @available(iOS 6.0, *) - @asyncHandler func gameCenterViewControllerDidFinish(_ gameCenterViewController: GKGameCenterViewController) + func gameCenterViewControllerDidFinish(_ gameCenterViewController: GKGameCenterViewController) } diff --git a/iOS/GameKit/GKGameSessionEventListener.swift b/iOS/GameKit/GKGameSessionEventListener.swift index a91acf7..9beb7b7 100644 --- a/iOS/GameKit/GKGameSessionEventListener.swift +++ b/iOS/GameKit/GKGameSessionEventListener.swift @@ -1,12 +1,12 @@ @available(iOS, introduced: 10.0, deprecated: 12.0, message: "Use GKLocalPlayerListener for multiplayer event notifications.") protocol GKGameSessionEventListener : NSObjectProtocol { - @asyncHandler optional func session(_ session: GKGameSession, didAdd player: GKCloudPlayer) - @asyncHandler optional func session(_ session: GKGameSession, didRemove player: GKCloudPlayer) - @asyncHandler optional func session(_ session: GKGameSession, player: GKCloudPlayer, didChange newState: GKConnectionState) - @asyncHandler optional func session(_ session: GKGameSession, player: GKCloudPlayer, didSave data: Data) - @asyncHandler optional func session(_ session: GKGameSession, didReceive data: Data, from player: GKCloudPlayer) - @asyncHandler optional func session(_ session: GKGameSession, didReceiveMessage message: String, with data: Data, from player: GKCloudPlayer) + optional func session(_ session: GKGameSession, didAdd player: GKCloudPlayer) + optional func session(_ session: GKGameSession, didRemove player: GKCloudPlayer) + optional func session(_ session: GKGameSession, player: GKCloudPlayer, didChange newState: GKConnectionState) + optional func session(_ session: GKGameSession, player: GKCloudPlayer, didSave data: Data) + optional func session(_ session: GKGameSession, didReceive data: Data, from player: GKCloudPlayer) + optional func session(_ session: GKGameSession, didReceiveMessage message: String, with data: Data, from player: GKCloudPlayer) } extension GKGameSession { @available(iOS, introduced: 10.0, deprecated: 12.0, message: "Use GKLocalPlayer's registerListener: to register for GKLocalPlayerListener event notifications.") diff --git a/iOS/GameKit/GKMatch.swift b/iOS/GameKit/GKMatch.swift index 5179948..e1d3312 100644 --- a/iOS/GameKit/GKMatch.swift +++ b/iOS/GameKit/GKMatch.swift @@ -36,19 +36,19 @@ class GKMatch : NSObject { } protocol GKMatchDelegate : NSObjectProtocol { @available(iOS 8.0, *) - @asyncHandler optional func match(_ match: GKMatch, didReceive data: Data, fromRemotePlayer player: GKPlayer) + optional func match(_ match: GKMatch, didReceive data: Data, fromRemotePlayer player: GKPlayer) @available(iOS 9.0, *) - @asyncHandler optional func match(_ match: GKMatch, didReceive data: Data, forRecipient recipient: GKPlayer, fromRemotePlayer player: GKPlayer) + optional func match(_ match: GKMatch, didReceive data: Data, forRecipient recipient: GKPlayer, fromRemotePlayer player: GKPlayer) @available(iOS 4.1, *) - @asyncHandler optional func match(_ match: GKMatch, player: GKPlayer, didChange state: GKPlayerConnectionState) + optional func match(_ match: GKMatch, player: GKPlayer, didChange state: GKPlayerConnectionState) @available(iOS 4.1, *) - @asyncHandler optional func match(_ match: GKMatch, didFailWithError error: Error?) + optional func match(_ match: GKMatch, didFailWithError error: Error?) @available(iOS 8.0, *) optional func match(_ match: GKMatch, shouldReinviteDisconnectedPlayer player: GKPlayer) -> Bool @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use match:didReceiveData:fromRemotePlayer:") - @asyncHandler optional func match(_ match: GKMatch, didReceive data: Data, fromPlayer playerID: String) + optional func match(_ match: GKMatch, didReceive data: Data, fromPlayer playerID: String) @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use match:player:didChangeConnectionState:") - @asyncHandler optional func match(_ match: GKMatch, player playerID: String, didChange state: GKPlayerConnectionState) + optional func match(_ match: GKMatch, player playerID: String, didChange state: GKPlayerConnectionState) @available(iOS, introduced: 5.0, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use shouldReinviteDisconnectedPlayer:") optional func match(_ match: GKMatch, shouldReinvitePlayer playerID: String) -> Bool } diff --git a/iOS/GameKit/GKMatchmaker.swift b/iOS/GameKit/GKMatchmaker.swift index afeb012..c0c4e35 100644 --- a/iOS/GameKit/GKMatchmaker.swift +++ b/iOS/GameKit/GKMatchmaker.swift @@ -60,11 +60,11 @@ class GKInvite : NSObject { } protocol GKInviteEventListener { @available(iOS 7.0, *) - @asyncHandler optional func player(_ player: GKPlayer, didAccept invite: GKInvite) + optional func player(_ player: GKPlayer, didAccept invite: GKInvite) @available(iOS 8.0, *) - @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithRecipients recipientPlayers: [GKPlayer]) + optional func player(_ player: GKPlayer, didRequestMatchWithRecipients recipientPlayers: [GKPlayer]) @available(iOS, introduced: 7.0, deprecated: 8.0, message: "This method is obsolete. It will never be invoked its implementation does nothing, use player:didRequestMatchWithRecipients:") - @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithPlayers playerIDsToInvite: [String]) + optional func player(_ player: GKPlayer, didRequestMatchWithPlayers playerIDsToInvite: [String]) } @available(iOS 4.1, *) class GKMatchmaker : NSObject { diff --git a/iOS/GameKit/GKMatchmakerViewController.swift b/iOS/GameKit/GKMatchmakerViewController.swift index f49d6dc..dd5389b 100644 --- a/iOS/GameKit/GKMatchmakerViewController.swift +++ b/iOS/GameKit/GKMatchmakerViewController.swift @@ -27,15 +27,15 @@ protocol GKMatchmakerViewControllerDelegate : NSObjectProtocol { @available(iOS 4.1, *) func matchmakerViewControllerWasCancelled(_ viewController: GKMatchmakerViewController) @available(iOS 4.1, *) - @asyncHandler func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFailWithError error: Error) + func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFailWithError error: Error) @available(iOS 4.1, *) - @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFind match: GKMatch) + optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFind match: GKMatch) @available(iOS 8.0, *) - @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindHostedPlayers players: [GKPlayer]) + optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindHostedPlayers players: [GKPlayer]) @available(iOS 8.0, *) optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, hostedPlayerDidAccept player: GKPlayer) @available(iOS, introduced: 4.1, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use matchmakerViewController:didFindHostedPlayers:") - @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindPlayers playerIDs: [String]) + optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindPlayers playerIDs: [String]) @available(iOS, introduced: 5.0, deprecated: 8.0, message: "This is never invoked and its implementation does nothing, use matchmakerViewController:hostedPlayerDidAccept:") - @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didReceiveAcceptFromHostedPlayer playerID: String) + optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didReceiveAcceptFromHostedPlayer playerID: String) } diff --git a/iOS/GameKit/GKSavedGameListener.swift b/iOS/GameKit/GKSavedGameListener.swift index 77f043a..3d5e21b 100644 --- a/iOS/GameKit/GKSavedGameListener.swift +++ b/iOS/GameKit/GKSavedGameListener.swift @@ -2,7 +2,7 @@ @available(iOS 8.0, *) protocol GKSavedGameListener : NSObjectProtocol { @available(iOS 8.0, *) - @asyncHandler optional func player(_ player: GKPlayer, didModifySavedGame savedGame: GKSavedGame) + optional func player(_ player: GKPlayer, didModifySavedGame savedGame: GKSavedGame) @available(iOS 8.0, *) optional func player(_ player: GKPlayer, hasConflictingSavedGames savedGames: [GKSavedGame]) } diff --git a/iOS/GameKit/GKTurnBasedMatch.swift b/iOS/GameKit/GKTurnBasedMatch.swift index 368e452..c5d36bb 100644 --- a/iOS/GameKit/GKTurnBasedMatch.swift +++ b/iOS/GameKit/GKTurnBasedMatch.swift @@ -52,9 +52,9 @@ extension GKTurnBasedParticipant { } protocol GKTurnBasedEventListener { @available(iOS 8.0, *) - @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithOtherPlayers playersToInvite: [GKPlayer]) + optional func player(_ player: GKPlayer, didRequestMatchWithOtherPlayers playersToInvite: [GKPlayer]) @available(iOS 7.0, *) - @asyncHandler optional func player(_ player: GKPlayer, receivedTurnEventFor match: GKTurnBasedMatch, didBecomeActive: Bool) + optional func player(_ player: GKPlayer, receivedTurnEventFor match: GKTurnBasedMatch, didBecomeActive: Bool) @available(iOS 5.0, *) optional func player(_ player: GKPlayer, matchEnded match: GKTurnBasedMatch) @available(iOS 7.0, *) @@ -66,7 +66,7 @@ protocol GKTurnBasedEventListener { @available(iOS 9.0, *) optional func player(_ player: GKPlayer, wantsToQuitMatch match: GKTurnBasedMatch) @available(iOS, introduced: 7.0, deprecated: 8.0, message: "use didRequestMatchWithOtherPlayers") - @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithPlayers playerIDsToInvite: [String]) + optional func player(_ player: GKPlayer, didRequestMatchWithPlayers playerIDsToInvite: [String]) } @available(iOS 6.0, *) var GKTurnTimeoutDefault: TimeInterval diff --git a/iOS/GameKit/GKTurnBasedMatchmakerViewController.swift b/iOS/GameKit/GKTurnBasedMatchmakerViewController.swift index d2c63f2..b9c09f4 100644 --- a/iOS/GameKit/GKTurnBasedMatchmakerViewController.swift +++ b/iOS/GameKit/GKTurnBasedMatchmakerViewController.swift @@ -11,9 +11,9 @@ protocol GKTurnBasedMatchmakerViewControllerDelegate : NSObjectProtocol { @available(iOS 5.0, *) func turnBasedMatchmakerViewControllerWasCancelled(_ viewController: GKTurnBasedMatchmakerViewController) @available(iOS 5.0, *) - @asyncHandler func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFailWithError error: Error) + func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFailWithError error: Error) @available(iOS, introduced: 5.0, deprecated: 9.0, message: "use GKTurnBasedEventListener player:receivedTurnEventForMatch:didBecomeActive:") - @asyncHandler optional func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFind match: GKTurnBasedMatch) + optional func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFind match: GKTurnBasedMatch) @available(iOS, introduced: 5.0, deprecated: 9.0, message: "use GKTurnBasedEventListener player:wantsToQuitMatch:") optional func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, playerQuitFor match: GKTurnBasedMatch) } diff --git a/iOS/GameplayKit/GKAgent.swift b/iOS/GameplayKit/GKAgent.swift index f0fd956..e7296f2 100644 --- a/iOS/GameplayKit/GKAgent.swift +++ b/iOS/GameplayKit/GKAgent.swift @@ -3,7 +3,7 @@ protocol GKAgentDelegate : NSObjectProtocol { @available(iOS 9.0, *) optional func agentWillUpdate(_ agent: GKAgent) @available(iOS 9.0, *) - @asyncHandler optional func agentDidUpdate(_ agent: GKAgent) + optional func agentDidUpdate(_ agent: GKAgent) } @available(iOS 9.0, *) class GKAgent : GKComponent, NSSecureCoding { diff --git a/iOS/HomeKit/HMAccessory.swift b/iOS/HomeKit/HMAccessory.swift index 391886b..220e4ec 100644 --- a/iOS/HomeKit/HMAccessory.swift +++ b/iOS/HomeKit/HMAccessory.swift @@ -35,16 +35,16 @@ class HMAccessory : NSObject { } @available(iOS 8.0, *) protocol HMAccessoryDelegate : NSObjectProtocol { - @asyncHandler optional func accessoryDidUpdateName(_ accessory: HMAccessory) - @asyncHandler optional func accessory(_ accessory: HMAccessory, didUpdateNameFor service: HMService) - @asyncHandler optional func accessory(_ accessory: HMAccessory, didUpdateAssociatedServiceTypeFor service: HMService) - @asyncHandler optional func accessoryDidUpdateServices(_ accessory: HMAccessory) + optional func accessoryDidUpdateName(_ accessory: HMAccessory) + optional func accessory(_ accessory: HMAccessory, didUpdateNameFor service: HMService) + optional func accessory(_ accessory: HMAccessory, didUpdateAssociatedServiceTypeFor service: HMService) + optional func accessoryDidUpdateServices(_ accessory: HMAccessory) @available(iOS 11.0, *) - @asyncHandler optional func accessory(_ accessory: HMAccessory, didAdd profile: HMAccessoryProfile) + optional func accessory(_ accessory: HMAccessory, didAdd profile: HMAccessoryProfile) @available(iOS 11.0, *) - @asyncHandler optional func accessory(_ accessory: HMAccessory, didRemove profile: HMAccessoryProfile) - @asyncHandler optional func accessoryDidUpdateReachability(_ accessory: HMAccessory) - @asyncHandler optional func accessory(_ accessory: HMAccessory, service: HMService, didUpdateValueFor characteristic: HMCharacteristic) + optional func accessory(_ accessory: HMAccessory, didRemove profile: HMAccessoryProfile) + optional func accessoryDidUpdateReachability(_ accessory: HMAccessory) + optional func accessory(_ accessory: HMAccessory, service: HMService, didUpdateValueFor characteristic: HMCharacteristic) @available(iOS 11.0, *) - @asyncHandler optional func accessory(_ accessory: HMAccessory, didUpdateFirmwareVersion firmwareVersion: String) + optional func accessory(_ accessory: HMAccessory, didUpdateFirmwareVersion firmwareVersion: String) } diff --git a/iOS/HomeKit/HMAccessoryBrowser.swift b/iOS/HomeKit/HMAccessoryBrowser.swift index 6f6145f..d4fed39 100644 --- a/iOS/HomeKit/HMAccessoryBrowser.swift +++ b/iOS/HomeKit/HMAccessoryBrowser.swift @@ -8,6 +8,6 @@ class HMAccessoryBrowser : NSObject { } @available(iOS 8.0, *) protocol HMAccessoryBrowserDelegate : NSObjectProtocol { - @asyncHandler optional func accessoryBrowser(_ browser: HMAccessoryBrowser, didFindNewAccessory accessory: HMAccessory) - @asyncHandler optional func accessoryBrowser(_ browser: HMAccessoryBrowser, didRemoveNewAccessory accessory: HMAccessory) + optional func accessoryBrowser(_ browser: HMAccessoryBrowser, didFindNewAccessory accessory: HMAccessory) + optional func accessoryBrowser(_ browser: HMAccessoryBrowser, didRemoveNewAccessory accessory: HMAccessory) } diff --git a/iOS/HomeKit/HMCameraSnapshotControl.swift b/iOS/HomeKit/HMCameraSnapshotControl.swift index a3491a4..d030c44 100644 --- a/iOS/HomeKit/HMCameraSnapshotControl.swift +++ b/iOS/HomeKit/HMCameraSnapshotControl.swift @@ -7,6 +7,6 @@ class HMCameraSnapshotControl : HMCameraControl { } @available(iOS 10.0, *) protocol HMCameraSnapshotControlDelegate : NSObjectProtocol { - @asyncHandler optional func cameraSnapshotControl(_ cameraSnapshotControl: HMCameraSnapshotControl, didTake snapshot: HMCameraSnapshot?, error: Error?) - @asyncHandler optional func cameraSnapshotControlDidUpdateMostRecentSnapshot(_ cameraSnapshotControl: HMCameraSnapshotControl) + optional func cameraSnapshotControl(_ cameraSnapshotControl: HMCameraSnapshotControl, didTake snapshot: HMCameraSnapshot?, error: Error?) + optional func cameraSnapshotControlDidUpdateMostRecentSnapshot(_ cameraSnapshotControl: HMCameraSnapshotControl) } diff --git a/iOS/HomeKit/HMCameraStreamControl.swift b/iOS/HomeKit/HMCameraStreamControl.swift index 488cd0e..076d602 100644 --- a/iOS/HomeKit/HMCameraStreamControl.swift +++ b/iOS/HomeKit/HMCameraStreamControl.swift @@ -9,6 +9,6 @@ class HMCameraStreamControl : HMCameraControl { } @available(iOS 10.0, *) protocol HMCameraStreamControlDelegate : NSObjectProtocol { - @asyncHandler optional func cameraStreamControlDidStartStream(_ cameraStreamControl: HMCameraStreamControl) - @asyncHandler optional func cameraStreamControl(_ cameraStreamControl: HMCameraStreamControl, didStopStreamWithError error: Error?) + optional func cameraStreamControlDidStartStream(_ cameraStreamControl: HMCameraStreamControl) + optional func cameraStreamControl(_ cameraStreamControl: HMCameraStreamControl, didStopStreamWithError error: Error?) } diff --git a/iOS/HomeKit/HMHome.swift b/iOS/HomeKit/HMHome.swift index 9d1ffa3..7a98897 100644 --- a/iOS/HomeKit/HMHome.swift +++ b/iOS/HomeKit/HMHome.swift @@ -103,41 +103,41 @@ extension HMHome { } @available(iOS 8.0, *) protocol HMHomeDelegate : NSObjectProtocol { - @asyncHandler optional func homeDidUpdateName(_ home: HMHome) + optional func homeDidUpdateName(_ home: HMHome) @available(iOS 11.0, *) - @asyncHandler optional func homeDidUpdateAccessControl(forCurrentUser home: HMHome) - @asyncHandler optional func home(_ home: HMHome, didAdd accessory: HMAccessory) - @asyncHandler optional func home(_ home: HMHome, didRemove accessory: HMAccessory) - @asyncHandler optional func home(_ home: HMHome, didAdd user: HMUser) - @asyncHandler optional func home(_ home: HMHome, didRemove user: HMUser) - @asyncHandler optional func home(_ home: HMHome, didUpdate room: HMRoom, for accessory: HMAccessory) - @asyncHandler optional func home(_ home: HMHome, didAdd room: HMRoom) - @asyncHandler optional func home(_ home: HMHome, didRemove room: HMRoom) - @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor room: HMRoom) - @asyncHandler optional func home(_ home: HMHome, didAdd zone: HMZone) - @asyncHandler optional func home(_ home: HMHome, didRemove zone: HMZone) - @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor zone: HMZone) - @asyncHandler optional func home(_ home: HMHome, didAdd room: HMRoom, to zone: HMZone) - @asyncHandler optional func home(_ home: HMHome, didRemove room: HMRoom, from zone: HMZone) - @asyncHandler optional func home(_ home: HMHome, didAdd group: HMServiceGroup) - @asyncHandler optional func home(_ home: HMHome, didRemove group: HMServiceGroup) - @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor group: HMServiceGroup) - @asyncHandler optional func home(_ home: HMHome, didAdd service: HMService, to group: HMServiceGroup) - @asyncHandler optional func home(_ home: HMHome, didRemove service: HMService, from group: HMServiceGroup) - @asyncHandler optional func home(_ home: HMHome, didAdd actionSet: HMActionSet) - @asyncHandler optional func home(_ home: HMHome, didRemove actionSet: HMActionSet) - @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor actionSet: HMActionSet) - @asyncHandler optional func home(_ home: HMHome, didUpdateActionsFor actionSet: HMActionSet) - @asyncHandler optional func home(_ home: HMHome, didAdd trigger: HMTrigger) - @asyncHandler optional func home(_ home: HMHome, didRemove trigger: HMTrigger) - @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor trigger: HMTrigger) - @asyncHandler optional func home(_ home: HMHome, didUpdate trigger: HMTrigger) - @asyncHandler optional func home(_ home: HMHome, didUnblockAccessory accessory: HMAccessory) - @asyncHandler optional func home(_ home: HMHome, didEncounterError error: Error, for accessory: HMAccessory) + optional func homeDidUpdateAccessControl(forCurrentUser home: HMHome) + optional func home(_ home: HMHome, didAdd accessory: HMAccessory) + optional func home(_ home: HMHome, didRemove accessory: HMAccessory) + optional func home(_ home: HMHome, didAdd user: HMUser) + optional func home(_ home: HMHome, didRemove user: HMUser) + optional func home(_ home: HMHome, didUpdate room: HMRoom, for accessory: HMAccessory) + optional func home(_ home: HMHome, didAdd room: HMRoom) + optional func home(_ home: HMHome, didRemove room: HMRoom) + optional func home(_ home: HMHome, didUpdateNameFor room: HMRoom) + optional func home(_ home: HMHome, didAdd zone: HMZone) + optional func home(_ home: HMHome, didRemove zone: HMZone) + optional func home(_ home: HMHome, didUpdateNameFor zone: HMZone) + optional func home(_ home: HMHome, didAdd room: HMRoom, to zone: HMZone) + optional func home(_ home: HMHome, didRemove room: HMRoom, from zone: HMZone) + optional func home(_ home: HMHome, didAdd group: HMServiceGroup) + optional func home(_ home: HMHome, didRemove group: HMServiceGroup) + optional func home(_ home: HMHome, didUpdateNameFor group: HMServiceGroup) + optional func home(_ home: HMHome, didAdd service: HMService, to group: HMServiceGroup) + optional func home(_ home: HMHome, didRemove service: HMService, from group: HMServiceGroup) + optional func home(_ home: HMHome, didAdd actionSet: HMActionSet) + optional func home(_ home: HMHome, didRemove actionSet: HMActionSet) + optional func home(_ home: HMHome, didUpdateNameFor actionSet: HMActionSet) + optional func home(_ home: HMHome, didUpdateActionsFor actionSet: HMActionSet) + optional func home(_ home: HMHome, didAdd trigger: HMTrigger) + optional func home(_ home: HMHome, didRemove trigger: HMTrigger) + optional func home(_ home: HMHome, didUpdateNameFor trigger: HMTrigger) + optional func home(_ home: HMHome, didUpdate trigger: HMTrigger) + optional func home(_ home: HMHome, didUnblockAccessory accessory: HMAccessory) + optional func home(_ home: HMHome, didEncounterError error: Error, for accessory: HMAccessory) @available(iOS 11.0, *) - @asyncHandler optional func home(_ home: HMHome, didUpdate homeHubState: HMHomeHubState) + optional func home(_ home: HMHome, didUpdate homeHubState: HMHomeHubState) @available(iOS 13.2, *) - @asyncHandler optional func homeDidUpdateSupportedFeatures(_ home: HMHome) + optional func homeDidUpdateSupportedFeatures(_ home: HMHome) } @available(iOS 8.0, *) let HMUserFailedAccessoriesKey: String diff --git a/iOS/HomeKit/HMHomeManager.swift b/iOS/HomeKit/HMHomeManager.swift index 0daaba7..c610bcf 100644 --- a/iOS/HomeKit/HMHomeManager.swift +++ b/iOS/HomeKit/HMHomeManager.swift @@ -24,11 +24,11 @@ class HMHomeManager : NSObject { @available(iOS 8.0, *) protocol HMHomeManagerDelegate : NSObjectProtocol { @available(iOS 13.0, *) - @asyncHandler optional func homeManager(_ manager: HMHomeManager, didUpdate status: HMHomeManagerAuthorizationStatus) - @asyncHandler optional func homeManagerDidUpdateHomes(_ manager: HMHomeManager) - @asyncHandler optional func homeManagerDidUpdatePrimaryHome(_ manager: HMHomeManager) - @asyncHandler optional func homeManager(_ manager: HMHomeManager, didAdd home: HMHome) - @asyncHandler optional func homeManager(_ manager: HMHomeManager, didRemove home: HMHome) + optional func homeManager(_ manager: HMHomeManager, didUpdate status: HMHomeManagerAuthorizationStatus) + optional func homeManagerDidUpdateHomes(_ manager: HMHomeManager) + optional func homeManagerDidUpdatePrimaryHome(_ manager: HMHomeManager) + optional func homeManager(_ manager: HMHomeManager, didAdd home: HMHome) + optional func homeManager(_ manager: HMHomeManager, didRemove home: HMHome) @available(iOS 13.0, *) - @asyncHandler optional func homeManager(_ manager: HMHomeManager, didReceiveAddAccessoryRequest request: HMAddAccessoryRequest) + optional func homeManager(_ manager: HMHomeManager, didReceiveAddAccessoryRequest request: HMAddAccessoryRequest) } diff --git a/iOS/HomeKit/HMNetworkConfigurationProfile.swift b/iOS/HomeKit/HMNetworkConfigurationProfile.swift index 2c0741c..374077d 100644 --- a/iOS/HomeKit/HMNetworkConfigurationProfile.swift +++ b/iOS/HomeKit/HMNetworkConfigurationProfile.swift @@ -6,5 +6,5 @@ class HMNetworkConfigurationProfile : HMAccessoryProfile { } @available(iOS 13.0, *) protocol HMNetworkConfigurationProfileDelegate : NSObjectProtocol { - @asyncHandler optional func profileDidUpdateNetworkAccessMode(_ profile: HMNetworkConfigurationProfile) + optional func profileDidUpdateNetworkAccessMode(_ profile: HMNetworkConfigurationProfile) } diff --git a/iOS/ImageCaptureCore/ICCameraDevice.swift b/iOS/ImageCaptureCore/ICCameraDevice.swift index f01c510..3c4dd69 100644 --- a/iOS/ImageCaptureCore/ICCameraDevice.swift +++ b/iOS/ImageCaptureCore/ICCameraDevice.swift @@ -99,43 +99,43 @@ class ICCameraDevice : ICDevice { } protocol ICCameraDeviceDelegate : ICDeviceDelegate { @available(iOS 13.0, *) - @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didAdd items: [ICCameraItem]) + func cameraDevice(_ camera: ICCameraDevice, didAdd items: [ICCameraItem]) @available(iOS 13.0, *) - @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didRemove items: [ICCameraItem]) + func cameraDevice(_ camera: ICCameraDevice, didRemove items: [ICCameraItem]) @available(iOS 13.0, *) - @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didReceiveThumbnail thumbnail: CGImage?, for item: ICCameraItem, error: Error?) + func cameraDevice(_ camera: ICCameraDevice, didReceiveThumbnail thumbnail: CGImage?, for item: ICCameraItem, error: Error?) @available(iOS 13.0, *) - @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didReceiveMetadata metadata: [AnyHashable : Any]?, for item: ICCameraItem, error: Error?) + func cameraDevice(_ camera: ICCameraDevice, didReceiveMetadata metadata: [AnyHashable : Any]?, for item: ICCameraItem, error: Error?) @available(iOS 13.0, *) - @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didRenameItems items: [ICCameraItem]) + func cameraDevice(_ camera: ICCameraDevice, didRenameItems items: [ICCameraItem]) @available(iOS 13.0, *) - @asyncHandler func cameraDeviceDidChangeCapability(_ camera: ICCameraDevice) + func cameraDeviceDidChangeCapability(_ camera: ICCameraDevice) @available(iOS 13.0, *) - @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didReceivePTPEvent eventData: Data) + func cameraDevice(_ camera: ICCameraDevice, didReceivePTPEvent eventData: Data) @available(iOS 13.0, *) - @asyncHandler func deviceDidBecomeReady(withCompleteContentCatalog device: ICCameraDevice) + func deviceDidBecomeReady(withCompleteContentCatalog device: ICCameraDevice) @available(iOS 13.0, *) - @asyncHandler func cameraDeviceDidRemoveAccessRestriction(_ device: ICDevice) + func cameraDeviceDidRemoveAccessRestriction(_ device: ICDevice) @available(iOS 13.0, *) - @asyncHandler func cameraDeviceDidEnableAccessRestriction(_ device: ICDevice) + func cameraDeviceDidEnableAccessRestriction(_ device: ICDevice) @available(iOS 13.0, *) optional func cameraDevice(_ cameraDevice: ICCameraDevice, shouldGetThumbnailOf item: ICCameraItem) -> Bool @available(iOS 13.0, *) optional func cameraDevice(_ cameraDevice: ICCameraDevice, shouldGetMetadataOf item: ICCameraItem) -> Bool @available(iOS 13.0, *) - @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didCompleteDeleteFilesWithError error: Error?) + optional func cameraDevice(_ camera: ICCameraDevice, didCompleteDeleteFilesWithError error: Error?) @available(iOS 13.0, *) - @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didAdd item: ICCameraItem) + optional func cameraDevice(_ camera: ICCameraDevice, didAdd item: ICCameraItem) @available(iOS 13.0, *) - @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didRemove item: ICCameraItem) + optional func cameraDevice(_ camera: ICCameraDevice, didRemove item: ICCameraItem) @available(iOS 13.0, *) - @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didReceiveThumbnailFor item: ICCameraItem) + optional func cameraDevice(_ camera: ICCameraDevice, didReceiveThumbnailFor item: ICCameraItem) @available(iOS 13.0, *) - @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didReceiveMetadataFor item: ICCameraItem) + optional func cameraDevice(_ camera: ICCameraDevice, didReceiveMetadataFor item: ICCameraItem) } protocol ICCameraDeviceDownloadDelegate : NSObjectProtocol { @available(iOS 13.0, *) optional func didDownloadFile(_ file: ICCameraFile, error: Error?, options: [String : Any] = [:], contextInfo: UnsafeMutableRawPointer?) @available(iOS 13.0, *) - @asyncHandler optional func didReceiveDownloadProgress(for file: ICCameraFile, downloadedBytes: off_t, maxBytes: off_t) + optional func didReceiveDownloadProgress(for file: ICCameraFile, downloadedBytes: off_t, maxBytes: off_t) } diff --git a/iOS/ImageCaptureCore/ICDevice.swift b/iOS/ImageCaptureCore/ICDevice.swift index 7df3027..9615fbd 100644 --- a/iOS/ImageCaptureCore/ICDevice.swift +++ b/iOS/ImageCaptureCore/ICDevice.swift @@ -106,17 +106,17 @@ class ICDevice : NSObject { } protocol ICDeviceDelegate : NSObjectProtocol { @available(iOS 13.0, *) - @asyncHandler func device(_ device: ICDevice, didCloseSessionWithError error: Error?) + func device(_ device: ICDevice, didCloseSessionWithError error: Error?) @available(iOS 13.0, *) - @asyncHandler func didRemove(_ device: ICDevice) + func didRemove(_ device: ICDevice) @available(iOS 13.0, *) - @asyncHandler func device(_ device: ICDevice, didOpenSessionWithError error: Error?) + func device(_ device: ICDevice, didOpenSessionWithError error: Error?) @available(iOS 13.0, *) - @asyncHandler optional func deviceDidBecomeReady(_ device: ICDevice) + optional func deviceDidBecomeReady(_ device: ICDevice) @available(iOS 13.0, *) - @asyncHandler optional func device(_ device: ICDevice, didReceiveStatusInformation status: [ICDeviceStatus : Any]) + optional func device(_ device: ICDevice, didReceiveStatusInformation status: [ICDeviceStatus : Any]) @available(iOS 13.0, *) - @asyncHandler optional func device(_ device: ICDevice, didEncounterError error: Error?) + optional func device(_ device: ICDevice, didEncounterError error: Error?) @available(iOS 13.0, *) - @asyncHandler optional func device(_ device: ICDevice, didEjectWithError error: Error?) + optional func device(_ device: ICDevice, didEjectWithError error: Error?) } diff --git a/iOS/ImageCaptureCore/ICDeviceBrowser.swift b/iOS/ImageCaptureCore/ICDeviceBrowser.swift index cf90561..535068c 100644 --- a/iOS/ImageCaptureCore/ICDeviceBrowser.swift +++ b/iOS/ImageCaptureCore/ICDeviceBrowser.swift @@ -17,9 +17,9 @@ extension ICAuthorizationStatus { } protocol ICDeviceBrowserDelegate : NSObjectProtocol { @available(iOS 13.0, *) - @asyncHandler func deviceBrowser(_ browser: ICDeviceBrowser, didAdd device: ICDevice, moreComing: Bool) + func deviceBrowser(_ browser: ICDeviceBrowser, didAdd device: ICDevice, moreComing: Bool) @available(iOS 13.0, *) - @asyncHandler func deviceBrowser(_ browser: ICDeviceBrowser, didRemove device: ICDevice, moreGoing: Bool) + func deviceBrowser(_ browser: ICDeviceBrowser, didRemove device: ICDevice, moreGoing: Bool) @available(iOS 13.0, *) optional func deviceBrowser(_ browser: ICDeviceBrowser, deviceDidChangeName device: ICDevice) @available(iOS 13.0, *) @@ -27,11 +27,11 @@ protocol ICDeviceBrowserDelegate : NSObjectProtocol { @available(iOS 14.0, *) optional func deviceBrowserWillSuspendOperations(_ browser: ICDeviceBrowser) @available(iOS 14.0, *) - @asyncHandler optional func deviceBrowserDidSuspendOperations(_ browser: ICDeviceBrowser) + optional func deviceBrowserDidSuspendOperations(_ browser: ICDeviceBrowser) @available(iOS 14.0, *) - @asyncHandler optional func deviceBrowserDidCancelSuspendOperations(_ browser: ICDeviceBrowser) + optional func deviceBrowserDidCancelSuspendOperations(_ browser: ICDeviceBrowser) @available(iOS 14.0, *) - @asyncHandler optional func deviceBrowserDidResumeOperations(_ browser: ICDeviceBrowser) + optional func deviceBrowserDidResumeOperations(_ browser: ICDeviceBrowser) } @available(iOS 13.0, *) class ICDeviceBrowser : NSObject { diff --git a/iOS/Intents/INGetCarPowerLevelStatusIntent.swift b/iOS/Intents/INGetCarPowerLevelStatusIntent.swift index f9035f7..2523e95 100644 --- a/iOS/Intents/INGetCarPowerLevelStatusIntent.swift +++ b/iOS/Intents/INGetCarPowerLevelStatusIntent.swift @@ -19,5 +19,5 @@ protocol INGetCarPowerLevelStatusIntentHandling : NSObjectProtocol { } @available(iOS 14.0, *) protocol INGetCarPowerLevelStatusIntentResponseObserver : NSObjectProtocol { - @asyncHandler func didUpdate(getCarPowerLevelStatus response: INGetCarPowerLevelStatusIntentResponse) + func didUpdate(getCarPowerLevelStatus response: INGetCarPowerLevelStatusIntentResponse) } diff --git a/iOS/Intents/INGetRideStatusIntent.swift b/iOS/Intents/INGetRideStatusIntent.swift index 82e4da3..e7acd37 100644 --- a/iOS/Intents/INGetRideStatusIntent.swift +++ b/iOS/Intents/INGetRideStatusIntent.swift @@ -13,5 +13,5 @@ protocol INGetRideStatusIntentHandling : NSObjectProtocol { } @available(iOS 10.0, *) protocol INGetRideStatusIntentResponseObserver : NSObjectProtocol { - @asyncHandler func didUpdate(getRideStatus response: INGetRideStatusIntentResponse) + func didUpdate(getRideStatus response: INGetRideStatusIntentResponse) } diff --git a/iOS/IntentsUI/INUIAddVoiceShortcutViewController.swift b/iOS/IntentsUI/INUIAddVoiceShortcutViewController.swift index 37b61d5..d45f619 100644 --- a/iOS/IntentsUI/INUIAddVoiceShortcutViewController.swift +++ b/iOS/IntentsUI/INUIAddVoiceShortcutViewController.swift @@ -6,6 +6,6 @@ class INUIAddVoiceShortcutViewController : UIViewController { } @available(iOS 12.0, *) protocol INUIAddVoiceShortcutViewControllerDelegate : NSObjectProtocol { - @asyncHandler func addVoiceShortcutViewController(_ controller: INUIAddVoiceShortcutViewController, didFinishWith voiceShortcut: INVoiceShortcut?, error: Error?) - @asyncHandler func addVoiceShortcutViewControllerDidCancel(_ controller: INUIAddVoiceShortcutViewController) + func addVoiceShortcutViewController(_ controller: INUIAddVoiceShortcutViewController, didFinishWith voiceShortcut: INVoiceShortcut?, error: Error?) + func addVoiceShortcutViewControllerDidCancel(_ controller: INUIAddVoiceShortcutViewController) } diff --git a/iOS/IntentsUI/INUIEditVoiceShortcutViewController.swift b/iOS/IntentsUI/INUIEditVoiceShortcutViewController.swift index fb2a8fd..2c63123 100644 --- a/iOS/IntentsUI/INUIEditVoiceShortcutViewController.swift +++ b/iOS/IntentsUI/INUIEditVoiceShortcutViewController.swift @@ -6,7 +6,7 @@ class INUIEditVoiceShortcutViewController : UIViewController { } @available(iOS 12.0, *) protocol INUIEditVoiceShortcutViewControllerDelegate : NSObjectProtocol { - @asyncHandler func editVoiceShortcutViewController(_ controller: INUIEditVoiceShortcutViewController, didUpdate voiceShortcut: INVoiceShortcut?, error: Error?) - @asyncHandler func editVoiceShortcutViewController(_ controller: INUIEditVoiceShortcutViewController, didDeleteVoiceShortcutWithIdentifier deletedVoiceShortcutIdentifier: UUID) - @asyncHandler func editVoiceShortcutViewControllerDidCancel(_ controller: INUIEditVoiceShortcutViewController) + func editVoiceShortcutViewController(_ controller: INUIEditVoiceShortcutViewController, didUpdate voiceShortcut: INVoiceShortcut?, error: Error?) + func editVoiceShortcutViewController(_ controller: INUIEditVoiceShortcutViewController, didDeleteVoiceShortcutWithIdentifier deletedVoiceShortcutIdentifier: UUID) + func editVoiceShortcutViewControllerDidCancel(_ controller: INUIEditVoiceShortcutViewController) } diff --git a/iOS/MapKit/MKLocalSearchCompleter.swift b/iOS/MapKit/MKLocalSearchCompleter.swift index 39cc6ac..0e4e56f 100644 --- a/iOS/MapKit/MKLocalSearchCompleter.swift +++ b/iOS/MapKit/MKLocalSearchCompleter.swift @@ -33,8 +33,8 @@ class MKLocalSearchCompleter : NSObject { } @available(iOS 9.3, *) protocol MKLocalSearchCompleterDelegate : NSObjectProtocol { - @asyncHandler optional func completerDidUpdateResults(_ completer: MKLocalSearchCompleter) - @asyncHandler optional func completer(_ completer: MKLocalSearchCompleter, didFailWithError error: Error) + optional func completerDidUpdateResults(_ completer: MKLocalSearchCompleter) + optional func completer(_ completer: MKLocalSearchCompleter, didFailWithError error: Error) } @available(iOS 9.3, *) class MKLocalSearchCompletion : NSObject { diff --git a/iOS/MapKit/MKMapView.swift b/iOS/MapKit/MKMapView.swift index 5d3ed13..9b67c02 100644 --- a/iOS/MapKit/MKMapView.swift +++ b/iOS/MapKit/MKMapView.swift @@ -133,47 +133,47 @@ protocol MKMapViewDelegate : NSObjectProtocol { @available(iOS 3.0, *) optional func mapView(_ mapView: MKMapView, regionDidChangeAnimated animated: Bool) @available(iOS 11, *) - @asyncHandler optional func mapViewDidChangeVisibleRegion(_ mapView: MKMapView) + optional func mapViewDidChangeVisibleRegion(_ mapView: MKMapView) @available(iOS 3.0, *) optional func mapViewWillStartLoadingMap(_ mapView: MKMapView) @available(iOS 3.0, *) - @asyncHandler optional func mapViewDidFinishLoadingMap(_ mapView: MKMapView) + optional func mapViewDidFinishLoadingMap(_ mapView: MKMapView) @available(iOS 3.0, *) - @asyncHandler optional func mapViewDidFailLoadingMap(_ mapView: MKMapView, withError error: Error) + optional func mapViewDidFailLoadingMap(_ mapView: MKMapView, withError error: Error) @available(iOS 7.0, *) optional func mapViewWillStartRenderingMap(_ mapView: MKMapView) @available(iOS 7.0, *) - @asyncHandler optional func mapViewDidFinishRenderingMap(_ mapView: MKMapView, fullyRendered: Bool) + optional func mapViewDidFinishRenderingMap(_ mapView: MKMapView, fullyRendered: Bool) @available(iOS 3.0, *) optional func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? @available(iOS 3.0, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didAdd views: [MKAnnotationView]) + optional func mapView(_ mapView: MKMapView, didAdd views: [MKAnnotationView]) @available(iOS 3.0, *) optional func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, calloutAccessoryControlTapped control: UIControl) @available(iOS 4.0, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) + optional func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) @available(iOS 4.0, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView) + optional func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView) @available(iOS 4.0, *) optional func mapViewWillStartLocatingUser(_ mapView: MKMapView) @available(iOS 4.0, *) - @asyncHandler optional func mapViewDidStopLocatingUser(_ mapView: MKMapView) + optional func mapViewDidStopLocatingUser(_ mapView: MKMapView) @available(iOS 4.0, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didUpdate userLocation: MKUserLocation) + optional func mapView(_ mapView: MKMapView, didUpdate userLocation: MKUserLocation) @available(iOS 4.0, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didFailToLocateUserWithError error: Error) + optional func mapView(_ mapView: MKMapView, didFailToLocateUserWithError error: Error) @available(iOS 4.0, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, didChange newState: MKAnnotationView.DragState, fromOldState oldState: MKAnnotationView.DragState) + optional func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, didChange newState: MKAnnotationView.DragState, fromOldState oldState: MKAnnotationView.DragState) @available(iOS 5.0, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didChange mode: MKUserTrackingMode, animated: Bool) + optional func mapView(_ mapView: MKMapView, didChange mode: MKUserTrackingMode, animated: Bool) @available(iOS 7.0, *) optional func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer @available(iOS 7.0, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didAdd renderers: [MKOverlayRenderer]) + optional func mapView(_ mapView: MKMapView, didAdd renderers: [MKOverlayRenderer]) @available(iOS, introduced: 4.0, deprecated: 13.0) optional func mapView(_ mapView: MKMapView, viewFor overlay: MKOverlay) -> MKOverlayView @available(iOS, introduced: 4.0, deprecated: 13.0) - @asyncHandler optional func mapView(_ mapView: MKMapView, didAddOverlayViews overlayViews: [Any]) + optional func mapView(_ mapView: MKMapView, didAddOverlayViews overlayViews: [Any]) @available(iOS 11.0, *) optional func mapView(_ mapView: MKMapView, clusterAnnotationForMemberAnnotations memberAnnotations: [MKAnnotation]) -> MKClusterAnnotation } diff --git a/iOS/MediaPlayer/MPMediaPickerController.swift b/iOS/MediaPlayer/MPMediaPickerController.swift index 47acfc1..101ae73 100644 --- a/iOS/MediaPlayer/MPMediaPickerController.swift +++ b/iOS/MediaPlayer/MPMediaPickerController.swift @@ -13,7 +13,7 @@ class MPMediaPickerController : UIViewController { } protocol MPMediaPickerControllerDelegate : NSObjectProtocol { @available(iOS 3.0, *) - @asyncHandler optional func mediaPicker(_ mediaPicker: MPMediaPickerController, didPickMediaItems mediaItemCollection: MPMediaItemCollection) + optional func mediaPicker(_ mediaPicker: MPMediaPickerController, didPickMediaItems mediaItemCollection: MPMediaItemCollection) @available(iOS 3.0, *) - @asyncHandler optional func mediaPickerDidCancel(_ mediaPicker: MPMediaPickerController) + optional func mediaPickerDidCancel(_ mediaPicker: MPMediaPickerController) } diff --git a/iOS/MediaPlayer/MPPlayableContentDelegate.swift b/iOS/MediaPlayer/MPPlayableContentDelegate.swift index c6b1bac..38f8225 100644 --- a/iOS/MediaPlayer/MPPlayableContentDelegate.swift +++ b/iOS/MediaPlayer/MPPlayableContentDelegate.swift @@ -14,5 +14,5 @@ protocol MPPlayableContentDelegate : NSObjectProtocol { @available(iOS, introduced: 9.3, deprecated: 12.0, message: "Use Intents framework for initiating playback queues.") optional func playableContentManager(_ contentManager: MPPlayableContentManager, initializePlaybackQueueWithContentItems contentItems: [Any]?) async throws @available(iOS, introduced: 8.4, deprecated: 14.0, message: "Use CarPlay framework") - @asyncHandler optional func playableContentManager(_ contentManager: MPPlayableContentManager, didUpdate context: MPPlayableContentManagerContext) + optional func playableContentManager(_ contentManager: MPPlayableContentManager, didUpdate context: MPPlayableContentManagerContext) } diff --git a/iOS/MessageUI/MFMailComposeViewController.swift b/iOS/MessageUI/MFMailComposeViewController.swift index 7d928e0..258a987 100644 --- a/iOS/MessageUI/MFMailComposeViewController.swift +++ b/iOS/MessageUI/MFMailComposeViewController.swift @@ -33,5 +33,5 @@ class MFMailComposeViewController : UINavigationController { } protocol MFMailComposeViewControllerDelegate : NSObjectProtocol { @available(iOS 3.0, *) - @asyncHandler optional func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) + optional func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) } diff --git a/iOS/MessageUI/MFMessageComposeViewController.swift b/iOS/MessageUI/MFMessageComposeViewController.swift index 6f3a22d..a7d4e5c 100644 --- a/iOS/MessageUI/MFMessageComposeViewController.swift +++ b/iOS/MessageUI/MFMessageComposeViewController.swift @@ -40,5 +40,5 @@ class MFMessageComposeViewController : UINavigationController { } protocol MFMessageComposeViewControllerDelegate : NSObjectProtocol { @available(iOS 4.0, *) - @asyncHandler func messageComposeViewController(_ controller: MFMessageComposeViewController, didFinishWith result: MessageComposeResult) + func messageComposeViewController(_ controller: MFMessageComposeViewController, didFinishWith result: MessageComposeResult) } diff --git a/iOS/MetricKit/MXMetricManager.swift b/iOS/MetricKit/MXMetricManager.swift index e3370f2..59c7153 100644 --- a/iOS/MetricKit/MXMetricManager.swift +++ b/iOS/MetricKit/MXMetricManager.swift @@ -11,7 +11,7 @@ class MXMetricManager : NSObject { } @available(iOS 13.0, *) protocol MXMetricManagerSubscriber : NSObjectProtocol { - @asyncHandler func didReceive(_ payloads: [MXMetricPayload]) + func didReceive(_ payloads: [MXMetricPayload]) @available(iOS 14.0, *) - @asyncHandler optional func didReceive(_ payloads: [MXDiagnosticPayload]) + optional func didReceive(_ payloads: [MXDiagnosticPayload]) } diff --git a/iOS/MultipeerConnectivity/MCAdvertiserAssistant.swift b/iOS/MultipeerConnectivity/MCAdvertiserAssistant.swift index c7127ae..7b07c22 100644 --- a/iOS/MultipeerConnectivity/MCAdvertiserAssistant.swift +++ b/iOS/MultipeerConnectivity/MCAdvertiserAssistant.swift @@ -13,5 +13,5 @@ protocol MCAdvertiserAssistantDelegate : NSObjectProtocol { @available(iOS 7.0, *) optional func advertiserAssistantWillPresentInvitation(_ advertiserAssistant: MCAdvertiserAssistant) @available(iOS 7.0, *) - @asyncHandler optional func advertiserAssistantDidDismissInvitation(_ advertiserAssistant: MCAdvertiserAssistant) + optional func advertiserAssistantDidDismissInvitation(_ advertiserAssistant: MCAdvertiserAssistant) } diff --git a/iOS/MultipeerConnectivity/MCBrowserViewController.swift b/iOS/MultipeerConnectivity/MCBrowserViewController.swift index 0146dc8..1bb6f11 100644 --- a/iOS/MultipeerConnectivity/MCBrowserViewController.swift +++ b/iOS/MultipeerConnectivity/MCBrowserViewController.swift @@ -11,7 +11,7 @@ class MCBrowserViewController : UIViewController, MCNearbyServiceBrowserDelegate } protocol MCBrowserViewControllerDelegate : NSObjectProtocol { @available(iOS 7.0, *) - @asyncHandler func browserViewControllerDidFinish(_ browserViewController: MCBrowserViewController) + func browserViewControllerDidFinish(_ browserViewController: MCBrowserViewController) @available(iOS 7.0, *) func browserViewControllerWasCancelled(_ browserViewController: MCBrowserViewController) @available(iOS 7.0, *) diff --git a/iOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift b/iOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift index 7fe5bb7..3eeeeb3 100644 --- a/iOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift +++ b/iOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift @@ -11,7 +11,7 @@ class MCNearbyServiceAdvertiser : NSObject { } protocol MCNearbyServiceAdvertiserDelegate : NSObjectProtocol { @available(iOS 7.0, *) - @asyncHandler func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didReceiveInvitationFromPeer peerID: MCPeerID, withContext context: Data?, invitationHandler: @escaping (Bool, MCSession?) -> Void) + func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didReceiveInvitationFromPeer peerID: MCPeerID, withContext context: Data?, invitationHandler: @escaping (Bool, MCSession?) -> Void) @available(iOS 7.0, *) - @asyncHandler optional func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didNotStartAdvertisingPeer error: Error) + optional func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didNotStartAdvertisingPeer error: Error) } diff --git a/iOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift b/iOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift index bed3ee3..cd83037 100644 --- a/iOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift +++ b/iOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift @@ -15,5 +15,5 @@ protocol MCNearbyServiceBrowserDelegate : NSObjectProtocol { @available(iOS 7.0, *) func browser(_ browser: MCNearbyServiceBrowser, lostPeer peerID: MCPeerID) @available(iOS 7.0, *) - @asyncHandler optional func browser(_ browser: MCNearbyServiceBrowser, didNotStartBrowsingForPeers error: Error) + optional func browser(_ browser: MCNearbyServiceBrowser, didNotStartBrowsingForPeers error: Error) } diff --git a/iOS/MultipeerConnectivity/MCSession.swift b/iOS/MultipeerConnectivity/MCSession.swift index 09ebbd3..5787bf0 100644 --- a/iOS/MultipeerConnectivity/MCSession.swift +++ b/iOS/MultipeerConnectivity/MCSession.swift @@ -42,17 +42,17 @@ class MCSession : NSObject { } protocol MCSessionDelegate : NSObjectProtocol { @available(iOS 7.0, *) - @asyncHandler func session(_ session: MCSession, peer peerID: MCPeerID, didChange state: MCSessionState) + func session(_ session: MCSession, peer peerID: MCPeerID, didChange state: MCSessionState) @available(iOS 7.0, *) - @asyncHandler func session(_ session: MCSession, didReceive data: Data, fromPeer peerID: MCPeerID) + func session(_ session: MCSession, didReceive data: Data, fromPeer peerID: MCPeerID) @available(iOS 7.0, *) - @asyncHandler func session(_ session: MCSession, didReceive stream: InputStream, withName streamName: String, fromPeer peerID: MCPeerID) + func session(_ session: MCSession, didReceive stream: InputStream, withName streamName: String, fromPeer peerID: MCPeerID) @available(iOS 7.0, *) - @asyncHandler func session(_ session: MCSession, didStartReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, with progress: Progress) + func session(_ session: MCSession, didStartReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, with progress: Progress) @available(iOS 7.0, *) - @asyncHandler func session(_ session: MCSession, didFinishReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, at localURL: URL?, withError error: Error?) + func session(_ session: MCSession, didFinishReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, at localURL: URL?, withError error: Error?) @available(iOS 7.0, *) - @asyncHandler optional func session(_ session: MCSession, didReceiveCertificate certificate: [Any]?, fromPeer peerID: MCPeerID, certificateHandler: @escaping (Bool) -> Void) + optional func session(_ session: MCSession, didReceiveCertificate certificate: [Any]?, fromPeer peerID: MCPeerID, certificateHandler: @escaping (Bool) -> Void) } extension MCSession { func nearbyConnectionData(forPeer peerID: MCPeerID, withCompletionHandler completionHandler: @escaping (Data?, Error?) -> Void) diff --git a/iOS/NearbyInteraction/NISession.swift b/iOS/NearbyInteraction/NISession.swift index fc44c6f..d705b7c 100644 --- a/iOS/NearbyInteraction/NISession.swift +++ b/iOS/NearbyInteraction/NISession.swift @@ -21,9 +21,9 @@ extension NINearbyObject { } @available(iOS 14.0, *) protocol NISessionDelegate : NSObjectProtocol { - @asyncHandler optional func session(_ session: NISession, didUpdate nearbyObjects: [NINearbyObject]) - @asyncHandler optional func session(_ session: NISession, didRemove nearbyObjects: [NINearbyObject], reason: NINearbyObject.RemovalReason) + optional func session(_ session: NISession, didUpdate nearbyObjects: [NINearbyObject]) + optional func session(_ session: NISession, didRemove nearbyObjects: [NINearbyObject], reason: NINearbyObject.RemovalReason) optional func sessionWasSuspended(_ session: NISession) optional func sessionSuspensionEnded(_ session: NISession) - @asyncHandler optional func session(_ session: NISession, didInvalidateWith error: Error) + optional func session(_ session: NISession, didInvalidateWith error: Error) } diff --git a/iOS/NetworkExtension/NetworkExtension.swift b/iOS/NetworkExtension/NetworkExtension.swift index c09acf8..32e0bc4 100644 --- a/iOS/NetworkExtension/NetworkExtension.swift +++ b/iOS/NetworkExtension/NetworkExtension.swift @@ -1352,7 +1352,7 @@ class NEAppPushManager : NSObject { @available(iOS 14.0, *) protocol NEAppPushDelegate : NSObjectProtocol { @available(iOS 14.0, *) - @asyncHandler func appPushManager(_ manager: NEAppPushManager, didReceiveIncomingCallWithUserInfo userInfo: [AnyHashable : Any] = [:]) + func appPushManager(_ manager: NEAppPushManager, didReceiveIncomingCallWithUserInfo userInfo: [AnyHashable : Any] = [:]) } @available(iOS 14.0, *) class NEAppPushProvider : NEProvider { diff --git a/iOS/NotificationCenter/NCWidgetProviding.swift b/iOS/NotificationCenter/NCWidgetProviding.swift index 96f4587..be9ede0 100644 --- a/iOS/NotificationCenter/NCWidgetProviding.swift +++ b/iOS/NotificationCenter/NCWidgetProviding.swift @@ -14,7 +14,7 @@ protocol NCWidgetProviding : NSObjectProtocol { @available(iOS, introduced: 8.0, deprecated: 14.0, message: "Use WidgetKit instead. Today View extensions have been deprecated.") optional func widgetPerformUpdate() async -> NCUpdateResult @available(iOS, introduced: 10.0, deprecated: 14.0, message: "Use WidgetKit instead. Today View extensions have been deprecated.") - @asyncHandler optional func widgetActiveDisplayModeDidChange(_ activeDisplayMode: NCWidgetDisplayMode, withMaximumSize maxSize: CGSize) + optional func widgetActiveDisplayModeDidChange(_ activeDisplayMode: NCWidgetDisplayMode, withMaximumSize maxSize: CGSize) @available(iOS, introduced: 8.0, deprecated: 10.0, message: "This method will not be called on widgets linked against iOS versions 10.0 and later.") optional func widgetMarginInsets(forProposedMarginInsets defaultMarginInsets: UIEdgeInsets) -> UIEdgeInsets } diff --git a/iOS/PDFKit/PDFDocument.swift b/iOS/PDFKit/PDFDocument.swift index 8897d7e..5288bae 100644 --- a/iOS/PDFKit/PDFDocument.swift +++ b/iOS/PDFKit/PDFDocument.swift @@ -122,14 +122,14 @@ class PDFDocument : NSObject, NSCopying { func selection(from startPage: PDFPage, atCharacterIndex startCharacter: Int, to endPage: PDFPage, atCharacterIndex endCharacter: Int) -> PDFSelection? } protocol PDFDocumentDelegate : NSObjectProtocol { - @asyncHandler optional func documentDidUnlock(_ notification: Notification) - @asyncHandler optional func documentDidBeginDocumentFind(_ notification: Notification) - @asyncHandler optional func documentDidEndDocumentFind(_ notification: Notification) - @asyncHandler optional func documentDidBeginPageFind(_ notification: Notification) - @asyncHandler optional func documentDidEndPageFind(_ notification: Notification) - @asyncHandler optional func documentDidFindMatch(_ notification: Notification) - @available(iOS 11.0, *) - @asyncHandler optional func didMatchString(_ instance: PDFSelection) + optional func documentDidUnlock(_ notification: Notification) + optional func documentDidBeginDocumentFind(_ notification: Notification) + optional func documentDidEndDocumentFind(_ notification: Notification) + optional func documentDidBeginPageFind(_ notification: Notification) + optional func documentDidEndPageFind(_ notification: Notification) + optional func documentDidFindMatch(_ notification: Notification) + @available(iOS 11.0, *) + optional func didMatchString(_ instance: PDFSelection) @available(iOS 11.0, *) optional func classForPage() -> AnyClass @available(iOS 11.0, *) diff --git a/iOS/PassKit/PKAddPassesViewController.swift b/iOS/PassKit/PKAddPassesViewController.swift index 38a7ddb..0692b3b 100644 --- a/iOS/PassKit/PKAddPassesViewController.swift +++ b/iOS/PassKit/PKAddPassesViewController.swift @@ -1,7 +1,7 @@ protocol PKAddPassesViewControllerDelegate : NSObjectProtocol { @available(iOS 6.0, *) - @asyncHandler optional func addPassesViewControllerDidFinish(_ controller: PKAddPassesViewController) + optional func addPassesViewControllerDidFinish(_ controller: PKAddPassesViewController) } @available(iOS 6.0, *) class PKAddPassesViewController : UIViewController { diff --git a/iOS/PassKit/PKAddPaymentPassViewController.swift b/iOS/PassKit/PKAddPaymentPassViewController.swift index 4f6beb8..195c67e 100644 --- a/iOS/PassKit/PKAddPaymentPassViewController.swift +++ b/iOS/PassKit/PKAddPaymentPassViewController.swift @@ -3,7 +3,7 @@ protocol PKAddPaymentPassViewControllerDelegate : NSObjectProtocol { func addPaymentPassViewController(_ controller: PKAddPaymentPassViewController, generateRequestWithCertificateChain certificates: [Data], nonce: Data, nonceSignature: Data, completionHandler handler: @escaping (PKAddPaymentPassRequest) -> Void) func addPaymentPassViewController(_ controller: PKAddPaymentPassViewController, generateRequestWithCertificateChain certificates: [Data], nonce: Data, nonceSignature: Data) async -> PKAddPaymentPassRequest - @asyncHandler func addPaymentPassViewController(_ controller: PKAddPaymentPassViewController, didFinishAdding pass: PKPaymentPass?, error: Error?) + func addPaymentPassViewController(_ controller: PKAddPaymentPassViewController, didFinishAdding pass: PKPaymentPass?, error: Error?) } @available(iOS 9.0, *) class PKAddPaymentPassViewController : UIViewController { diff --git a/iOS/PassKit/PKAddSecureElementPassViewController.swift b/iOS/PassKit/PKAddSecureElementPassViewController.swift index 1903d99..25e541f 100644 --- a/iOS/PassKit/PKAddSecureElementPassViewController.swift +++ b/iOS/PassKit/PKAddSecureElementPassViewController.swift @@ -2,8 +2,8 @@ @available(iOS 13.4, *) protocol PKAddSecureElementPassViewControllerDelegate : NSObjectProtocol { @available(iOS, introduced: 13.4, deprecated: 14.0, message: "Use addSecureElementPassViewController:didFinishAddingSecureElementPasses:error: instead") - @asyncHandler func addSecureElementPassViewController(_ controller: PKAddSecureElementPassViewController, didFinishAdding pass: PKSecureElementPass?, error: Error?) - @asyncHandler func addSecureElementPassViewController(_ controller: PKAddSecureElementPassViewController, didFinishAddingSecureElementPasses passes: [PKSecureElementPass]?, error: Error?) + func addSecureElementPassViewController(_ controller: PKAddSecureElementPassViewController, didFinishAdding pass: PKSecureElementPass?, error: Error?) + func addSecureElementPassViewController(_ controller: PKAddSecureElementPassViewController, didFinishAddingSecureElementPasses passes: [PKSecureElementPass]?, error: Error?) } @available(iOS 13.4, *) class PKAddSecureElementPassViewController : UIViewController { diff --git a/iOS/PassKit/PKDisbursementAuthorizationController.swift b/iOS/PassKit/PKDisbursementAuthorizationController.swift index 7b91c86..d94447a 100644 --- a/iOS/PassKit/PKDisbursementAuthorizationController.swift +++ b/iOS/PassKit/PKDisbursementAuthorizationController.swift @@ -1,9 +1,9 @@ protocol PKDisbursementAuthorizationControllerDelegate : NSObjectProtocol { @available(iOS 12.2, *) - @asyncHandler func disbursementAuthorizationController(_ controller: PKDisbursementAuthorizationController, didAuthorizeWith disbursementVoucher: PKDisbursementVoucher) + func disbursementAuthorizationController(_ controller: PKDisbursementAuthorizationController, didAuthorizeWith disbursementVoucher: PKDisbursementVoucher) @available(iOS 12.2, *) - @asyncHandler func disbursementAuthorizationControllerDidFinish(_ controller: PKDisbursementAuthorizationController) + func disbursementAuthorizationControllerDidFinish(_ controller: PKDisbursementAuthorizationController) } class PKDisbursementAuthorizationController : NSObject { @available(iOS 12.2, *) diff --git a/iOS/PassKit/PKPaymentAuthorizationController.swift b/iOS/PassKit/PKPaymentAuthorizationController.swift index 97caba1..9a4e92b 100644 --- a/iOS/PassKit/PKPaymentAuthorizationController.swift +++ b/iOS/PassKit/PKPaymentAuthorizationController.swift @@ -1,41 +1,41 @@ protocol PKPaymentAuthorizationControllerDelegate : NSObjectProtocol { @available(iOS 10.0, *) - @asyncHandler func paymentAuthorizationControllerDidFinish(_ controller: PKPaymentAuthorizationController) + func paymentAuthorizationControllerDidFinish(_ controller: PKPaymentAuthorizationController) @available(iOS 11.0, *) - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) @available(iOS 11.0, *) optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationResult @available(iOS, introduced: 10.0, deprecated: 11.0, message: "Use paymentAuthorizationController:didAuthorizePayment:handler: instead to provide more granular errors") - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) @available(iOS, introduced: 10.0, deprecated: 11.0, message: "Use paymentAuthorizationController:didAuthorizePayment:handler: instead to provide more granular errors") optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationStatus @available(iOS 10.0, *) optional func paymentAuthorizationControllerWillAuthorizePayment(_ controller: PKPaymentAuthorizationController) @available(iOS 14.0, *) - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) @available(iOS 11.0, *) - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) @available(iOS 11.0, *) optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod) async -> PKPaymentRequestShippingMethodUpdate @available(iOS 11.0, *) - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) @available(iOS 11.0, *) optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact) async -> PKPaymentRequestShippingContactUpdate @available(iOS 11.0, *) - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) @available(iOS 11.0, *) optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod) async -> PKPaymentRequestPaymentMethodUpdate @available(iOS, introduced: 10.0, deprecated: 11.0, message: "Use paymentAuthorizationController:didSelectShippingMethod:handler: instead to provide more granular errors") - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) @available(iOS, introduced: 10.0, deprecated: 11.0, message: "Use paymentAuthorizationController:didSelectShippingMethod:handler: instead to provide more granular errors") optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod) async -> (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) @available(iOS, introduced: 10.0, deprecated: 11.0, message: "Use paymentAuthorizationController:didSelectShippingContact:handler: instead to provide more granular errors") - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) @available(iOS, introduced: 10.0, deprecated: 11.0, message: "Use paymentAuthorizationController:didSelectShippingContact:handler: instead to provide more granular errors") optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact) async -> (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) @available(iOS, introduced: 10.0, deprecated: 11.0, message: "Use paymentAuthorizationController:didSelectPaymentMethod:handler: instead to provide more granular errors") - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) @available(iOS, introduced: 10.0, deprecated: 11.0, message: "Use paymentAuthorizationController:didSelectPaymentMethod:handler: instead to provide more granular errors") optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod) async -> [PKPaymentSummaryItem] @available(iOS 14.0, *) diff --git a/iOS/PassKit/PKPaymentAuthorizationViewControllerDelegate.swift b/iOS/PassKit/PKPaymentAuthorizationViewControllerDelegate.swift index eb8ca10..26ba94c 100644 --- a/iOS/PassKit/PKPaymentAuthorizationViewControllerDelegate.swift +++ b/iOS/PassKit/PKPaymentAuthorizationViewControllerDelegate.swift @@ -1,45 +1,45 @@ protocol PKPaymentAuthorizationViewControllerDelegate : NSObjectProtocol { @available(iOS 8.0, *) - @asyncHandler func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) + func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) @available(iOS 11.0, *) - @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) @available(iOS 11.0, *) optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationResult @available(iOS 8.3, *) optional func paymentAuthorizationViewControllerWillAuthorizePayment(_ controller: PKPaymentAuthorizationViewController) @available(iOS 14.0, *) - @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) @available(iOS 11.0, *) - @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) @available(iOS 11.0, *) optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod) async -> PKPaymentRequestShippingMethodUpdate @available(iOS 11.0, *) - @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) @available(iOS 11.0, *) optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact) async -> PKPaymentRequestShippingContactUpdate @available(iOS 11.0, *) - @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) @available(iOS 11.0, *) optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod) async -> PKPaymentRequestPaymentMethodUpdate @available(iOS, introduced: 8.0, deprecated: 11.0, message: "Use paymentAuthorizationViewController:didAuthorizePayment:handler: instead to provide more granular errors") - @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) @available(iOS, introduced: 8.0, deprecated: 11.0, message: "Use paymentAuthorizationViewController:didAuthorizePayment:handler: instead to provide more granular errors") optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationStatus @available(iOS, introduced: 8.0, deprecated: 11.0, message: "Use paymentAuthorizationViewController:didSelectShippingMethod:handler: instead to provide more granular errors") - @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) @available(iOS, introduced: 8.0, deprecated: 11.0, message: "Use paymentAuthorizationViewController:didSelectShippingMethod:handler: instead to provide more granular errors") optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod) async -> (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) @available(iOS, introduced: 8.0, deprecated: 9.0, message: "ABRecordRef has been deprecated. Please migrate away from this delegate callback as soon as possible.") - @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingAddress address: ABRecord, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingAddress address: ABRecord, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) @available(iOS, introduced: 8.0, deprecated: 9.0, message: "ABRecordRef has been deprecated. Please migrate away from this delegate callback as soon as possible.") optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingAddress address: ABRecord) async -> (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) @available(iOS, introduced: 9.0, deprecated: 11.0, message: "Use paymentAuthorizationViewController:didSelectShippingContact:handler: instead to provide more granular errors") - @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) @available(iOS, introduced: 9.0, deprecated: 11.0, message: "Use paymentAuthorizationViewController:didSelectShippingContact:handler: instead to provide more granular errors") optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact) async -> (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) @available(iOS, introduced: 9.0, deprecated: 11.0, message: "Use paymentAuthorizationViewController:didSelectPaymentMethod:handler: instead to provide more granular errors") - @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) @available(iOS, introduced: 9.0, deprecated: 11.0, message: "Use paymentAuthorizationViewController:didSelectPaymentMethod:handler: instead to provide more granular errors") optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod) async -> [PKPaymentSummaryItem] } diff --git a/iOS/PencilKit/PKCanvasView.swift b/iOS/PencilKit/PKCanvasView.swift index 7a25ce2..c7c2ba9 100644 --- a/iOS/PencilKit/PKCanvasView.swift +++ b/iOS/PencilKit/PKCanvasView.swift @@ -1,10 +1,10 @@ @available(iOS 13.0, *) protocol PKCanvasViewDelegate : UIScrollViewDelegate { - @asyncHandler optional func canvasViewDrawingDidChange(_ canvasView: PKCanvasView) - @asyncHandler optional func canvasViewDidFinishRendering(_ canvasView: PKCanvasView) - @asyncHandler optional func canvasViewDidBeginUsingTool(_ canvasView: PKCanvasView) - @asyncHandler optional func canvasViewDidEndUsingTool(_ canvasView: PKCanvasView) + optional func canvasViewDrawingDidChange(_ canvasView: PKCanvasView) + optional func canvasViewDidFinishRendering(_ canvasView: PKCanvasView) + optional func canvasViewDidBeginUsingTool(_ canvasView: PKCanvasView) + optional func canvasViewDidEndUsingTool(_ canvasView: PKCanvasView) } enum PKCanvasViewDrawingPolicy : UInt { init?(rawValue: UInt) diff --git a/iOS/PencilKit/PKToolPicker.swift b/iOS/PencilKit/PKToolPicker.swift index 739f56a..05c7a64 100644 --- a/iOS/PencilKit/PKToolPicker.swift +++ b/iOS/PencilKit/PKToolPicker.swift @@ -1,10 +1,10 @@ @available(iOS 13.0, *) protocol PKToolPickerObserver : NSObjectProtocol { - @asyncHandler optional func toolPickerSelectedToolDidChange(_ toolPicker: PKToolPicker) - @asyncHandler optional func toolPickerIsRulerActiveDidChange(_ toolPicker: PKToolPicker) - @asyncHandler optional func toolPickerVisibilityDidChange(_ toolPicker: PKToolPicker) - @asyncHandler optional func toolPickerFramesObscuredDidChange(_ toolPicker: PKToolPicker) + optional func toolPickerSelectedToolDidChange(_ toolPicker: PKToolPicker) + optional func toolPickerIsRulerActiveDidChange(_ toolPicker: PKToolPicker) + optional func toolPickerVisibilityDidChange(_ toolPicker: PKToolPicker) + optional func toolPickerFramesObscuredDidChange(_ toolPicker: PKToolPicker) } @available(iOS 13.0, *) class PKToolPicker : NSObject { diff --git a/iOS/Photos/PHPhotoLibrary.swift b/iOS/Photos/PHPhotoLibrary.swift index 9eadd67..d70a13f 100644 --- a/iOS/Photos/PHPhotoLibrary.swift +++ b/iOS/Photos/PHPhotoLibrary.swift @@ -26,12 +26,12 @@ enum PHAccessLevel : Int { @available(iOS 8, *) protocol PHPhotoLibraryChangeObserver : NSObjectProtocol { @available(iOS 8, *) - @asyncHandler func photoLibraryDidChange(_ changeInstance: PHChange) + func photoLibraryDidChange(_ changeInstance: PHChange) } @available(iOS 13, *) protocol PHPhotoLibraryAvailabilityObserver : NSObjectProtocol { @available(iOS 13, *) - @asyncHandler func photoLibraryDidBecomeUnavailable(_ photoLibrary: PHPhotoLibrary) + func photoLibraryDidBecomeUnavailable(_ photoLibrary: PHPhotoLibrary) } @available(iOS 8, *) class PHPhotoLibrary : NSObject { diff --git a/iOS/PhotosUI/PHLivePhotoView.swift b/iOS/PhotosUI/PHLivePhotoView.swift index 552e0ae..525e44e 100644 --- a/iOS/PhotosUI/PHLivePhotoView.swift +++ b/iOS/PhotosUI/PHLivePhotoView.swift @@ -41,5 +41,5 @@ protocol PHLivePhotoViewDelegate : NSObjectProtocol { @available(iOS 9.1, *) optional func livePhotoView(_ livePhotoView: PHLivePhotoView, willBeginPlaybackWith playbackStyle: PHLivePhotoViewPlaybackStyle) @available(iOS 9.1, *) - @asyncHandler optional func livePhotoView(_ livePhotoView: PHLivePhotoView, didEndPlaybackWith playbackStyle: PHLivePhotoViewPlaybackStyle) + optional func livePhotoView(_ livePhotoView: PHLivePhotoView, didEndPlaybackWith playbackStyle: PHLivePhotoViewPlaybackStyle) } diff --git a/iOS/PhotosUI/PHPicker.swift b/iOS/PhotosUI/PHPicker.swift index 6a126fa..92ad94b 100644 --- a/iOS/PhotosUI/PHPicker.swift +++ b/iOS/PhotosUI/PHPicker.swift @@ -42,7 +42,7 @@ class __PHPickerResult : NSObject { @available(iOS 14, *) protocol __PHPickerViewControllerDelegate : NSObjectProtocol { @available(iOS 14, *) - @asyncHandler func picker(_ picker: PHPickerViewController, didFinishPicking results: [__PHPickerResult]) + func picker(_ picker: PHPickerViewController, didFinishPicking results: [__PHPickerResult]) } @available(iOS 14, *) class PHPickerViewController : UIViewController { diff --git a/iOS/PushKit/PKPushRegistry.swift b/iOS/PushKit/PKPushRegistry.swift index d5a0aab..cc9eac2 100644 --- a/iOS/PushKit/PKPushRegistry.swift +++ b/iOS/PushKit/PKPushRegistry.swift @@ -16,13 +16,13 @@ class PKPushRegistry : NSObject { } protocol PKPushRegistryDelegate : NSObjectProtocol { @available(iOS 8.0, *) - @asyncHandler func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) + func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) @available(iOS, introduced: 8.0, deprecated: 11.0) - @asyncHandler optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType) + optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType) @available(iOS 11.0, *) - @asyncHandler optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) + optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) @available(iOS 11.0, *) optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType) async @available(iOS 8.0, *) - @asyncHandler optional func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType) + optional func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType) } diff --git a/iOS/QuartzCore/CAAnimation.swift b/iOS/QuartzCore/CAAnimation.swift index 87d14c9..d2d7e67 100644 --- a/iOS/QuartzCore/CAAnimation.swift +++ b/iOS/QuartzCore/CAAnimation.swift @@ -29,9 +29,9 @@ class CAAnimation : NSObject, NSSecureCoding, NSCopying, CAMediaTiming, CAAction } protocol CAAnimationDelegate : NSObjectProtocol { @available(iOS 2.0, *) - @asyncHandler optional func animationDidStart(_ anim: CAAnimation) + optional func animationDidStart(_ anim: CAAnimation) @available(iOS 2.0, *) - @asyncHandler optional func animationDidStop(_ anim: CAAnimation, finished flag: Bool) + optional func animationDidStop(_ anim: CAAnimation, finished flag: Bool) } @available(iOS 2.0, *) class CAPropertyAnimation : CAAnimation { diff --git a/iOS/QuickLook/QLPreviewController.swift b/iOS/QuickLook/QLPreviewController.swift index 48b9a20..0e35c1f 100644 --- a/iOS/QuickLook/QLPreviewController.swift +++ b/iOS/QuickLook/QLPreviewController.swift @@ -27,7 +27,7 @@ protocol QLPreviewControllerDelegate : NSObjectProtocol { @available(iOS 4.0, *) optional func previewControllerWillDismiss(_ controller: QLPreviewController) @available(iOS 4.0, *) - @asyncHandler optional func previewControllerDidDismiss(_ controller: QLPreviewController) + optional func previewControllerDidDismiss(_ controller: QLPreviewController) @available(iOS 4.0, *) optional func previewController(_ controller: QLPreviewController, shouldOpen url: URL, for item: QLPreviewItem) -> Bool @available(iOS 4.0, *) @@ -39,7 +39,7 @@ protocol QLPreviewControllerDelegate : NSObjectProtocol { @available(iOS 13.0, *) optional func previewController(_ controller: QLPreviewController, editingModeFor previewItem: QLPreviewItem) -> QLPreviewItemEditingMode @available(iOS 13.0, *) - @asyncHandler optional func previewController(_ controller: QLPreviewController, didUpdateContentsOf previewItem: QLPreviewItem) + optional func previewController(_ controller: QLPreviewController, didUpdateContentsOf previewItem: QLPreviewItem) @available(iOS 13.0, *) - @asyncHandler optional func previewController(_ controller: QLPreviewController, didSaveEditedCopyOf previewItem: QLPreviewItem, at modifiedContentsURL: URL) + optional func previewController(_ controller: QLPreviewController, didSaveEditedCopyOf previewItem: QLPreviewItem, at modifiedContentsURL: URL) } diff --git a/iOS/ReplayKit/RPBroadcast.swift b/iOS/ReplayKit/RPBroadcast.swift index 09bbd4a..81b364e 100644 --- a/iOS/ReplayKit/RPBroadcast.swift +++ b/iOS/ReplayKit/RPBroadcast.swift @@ -9,7 +9,7 @@ class RPBroadcastActivityViewController : UIViewController { @available(iOS 10.0, *) protocol RPBroadcastActivityViewControllerDelegate : NSObjectProtocol { @available(iOS 10.0, *) - @asyncHandler func broadcastActivityViewController(_ broadcastActivityViewController: RPBroadcastActivityViewController, didFinishWith broadcastController: RPBroadcastController?, error: Error?) + func broadcastActivityViewController(_ broadcastActivityViewController: RPBroadcastActivityViewController, didFinishWith broadcastController: RPBroadcastController?, error: Error?) } @available(iOS 10.0, *) class RPBroadcastController : NSObject { @@ -27,10 +27,10 @@ class RPBroadcastController : NSObject { } @available(iOS 10.0, *) protocol RPBroadcastControllerDelegate : NSObjectProtocol { - @asyncHandler optional func broadcastController(_ broadcastController: RPBroadcastController, didFinishWithError error: Error?) - @asyncHandler optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateServiceInfo serviceInfo: [String : NSCoding & NSObjectProtocol]) + optional func broadcastController(_ broadcastController: RPBroadcastController, didFinishWithError error: Error?) + optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateServiceInfo serviceInfo: [String : NSCoding & NSObjectProtocol]) @available(iOS 11.0, *) - @asyncHandler optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateBroadcast broadcastURL: URL) + optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateBroadcast broadcastURL: URL) } @available(iOS 12.0, *) class RPSystemBroadcastPickerView : UIView, NSCoding { diff --git a/iOS/ReplayKit/RPPreviewViewController.swift b/iOS/ReplayKit/RPPreviewViewController.swift index 6ac7b0b..d6ad050 100644 --- a/iOS/ReplayKit/RPPreviewViewController.swift +++ b/iOS/ReplayKit/RPPreviewViewController.swift @@ -3,6 +3,6 @@ class RPPreviewViewController : UIViewController { weak var previewControllerDelegate: @sil_weak RPPreviewViewControllerDelegate? } protocol RPPreviewViewControllerDelegate : NSObjectProtocol { - @asyncHandler optional func previewControllerDidFinish(_ previewController: RPPreviewViewController) - @asyncHandler optional func previewController(_ previewController: RPPreviewViewController, didFinishWithActivityTypes activityTypes: Set) + optional func previewControllerDidFinish(_ previewController: RPPreviewViewController) + optional func previewController(_ previewController: RPPreviewViewController, didFinishWithActivityTypes activityTypes: Set) } diff --git a/iOS/ReplayKit/RPScreenRecorder.swift b/iOS/ReplayKit/RPScreenRecorder.swift index d81fbf0..9343ae1 100644 --- a/iOS/ReplayKit/RPScreenRecorder.swift +++ b/iOS/ReplayKit/RPScreenRecorder.swift @@ -38,8 +38,8 @@ class RPScreenRecorder : NSObject { @available(iOS 9.0, *) protocol RPScreenRecorderDelegate : NSObjectProtocol { @available(iOS, introduced: 9.0, deprecated: 10.0, message: "No longer supported") - @asyncHandler optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWithError error: Error, previewViewController: RPPreviewViewController?) + optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWithError error: Error, previewViewController: RPPreviewViewController?) @available(iOS 11.0, *) - @asyncHandler optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWith previewViewController: RPPreviewViewController?, error: Error?) - @asyncHandler optional func screenRecorderDidChangeAvailability(_ screenRecorder: RPScreenRecorder) + optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWith previewViewController: RPPreviewViewController?, error: Error?) + optional func screenRecorderDidChangeAvailability(_ screenRecorder: RPScreenRecorder) } diff --git a/iOS/SafariServices/SFSafariViewController.swift b/iOS/SafariServices/SFSafariViewController.swift index e896ebd..d51b058 100644 --- a/iOS/SafariServices/SFSafariViewController.swift +++ b/iOS/SafariServices/SFSafariViewController.swift @@ -31,8 +31,8 @@ protocol SFSafariViewControllerDelegate : NSObjectProtocol { optional func safariViewController(_ controller: SFSafariViewController, activityItemsFor URL: URL, title: String?) -> [UIActivity] @available(iOS 11.0, *) optional func safariViewController(_ controller: SFSafariViewController, excludedActivityTypesFor URL: URL, title: String?) -> [UIActivity.ActivityType] - @asyncHandler optional func safariViewControllerDidFinish(_ controller: SFSafariViewController) - @asyncHandler optional func safariViewController(_ controller: SFSafariViewController, didCompleteInitialLoad didLoadSuccessfully: Bool) + optional func safariViewControllerDidFinish(_ controller: SFSafariViewController) + optional func safariViewController(_ controller: SFSafariViewController, didCompleteInitialLoad didLoadSuccessfully: Bool) @available(iOS 11.0, *) optional func safariViewController(_ controller: SFSafariViewController, initialLoadDidRedirectTo URL: URL) @available(iOS 14.0, *) diff --git a/iOS/SceneKit/SCNCameraController.swift b/iOS/SceneKit/SCNCameraController.swift index c2cd63e..3fb8c51 100644 --- a/iOS/SceneKit/SCNCameraController.swift +++ b/iOS/SceneKit/SCNCameraController.swift @@ -14,7 +14,7 @@ enum SCNInteractionMode : Int { @available(iOS 11.0, *) protocol SCNCameraControllerDelegate : NSObjectProtocol { optional func cameraInertiaWillStart(for cameraController: SCNCameraController) - @asyncHandler optional func cameraInertiaDidEnd(for cameraController: SCNCameraController) + optional func cameraInertiaDidEnd(for cameraController: SCNCameraController) } @available(iOS 11.0, *) class SCNCameraController : NSObject { diff --git a/iOS/SceneKit/SCNConstraint.swift b/iOS/SceneKit/SCNConstraint.swift index c5124ef..7b26a8f 100644 --- a/iOS/SceneKit/SCNConstraint.swift +++ b/iOS/SceneKit/SCNConstraint.swift @@ -78,7 +78,7 @@ class SCNSliderConstraint : SCNConstraint { @available(iOS 11.0, *) protocol SCNAvoidOccluderConstraintDelegate : NSObjectProtocol { optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, shouldAvoidOccluder occluder: SCNNode, for node: SCNNode) -> Bool - @asyncHandler optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, didAvoidOccluder occluder: SCNNode, for node: SCNNode) + optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, didAvoidOccluder occluder: SCNNode, for node: SCNNode) } @available(iOS 11.0, *) class SCNAvoidOccluderConstraint : SCNConstraint { diff --git a/iOS/SceneKit/SCNPhysicsWorld.swift b/iOS/SceneKit/SCNPhysicsWorld.swift index 49f7d9b..74bf4d8 100644 --- a/iOS/SceneKit/SCNPhysicsWorld.swift +++ b/iOS/SceneKit/SCNPhysicsWorld.swift @@ -22,9 +22,9 @@ extension SCNPhysicsWorld.TestSearchMode { static let all: SCNPhysicsWorld.TestSearchMode } protocol SCNPhysicsContactDelegate : NSObjectProtocol { - @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didBegin contact: SCNPhysicsContact) - @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didUpdate contact: SCNPhysicsContact) - @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didEnd contact: SCNPhysicsContact) + optional func physicsWorld(_ world: SCNPhysicsWorld, didBegin contact: SCNPhysicsContact) + optional func physicsWorld(_ world: SCNPhysicsWorld, didUpdate contact: SCNPhysicsContact) + optional func physicsWorld(_ world: SCNPhysicsWorld, didEnd contact: SCNPhysicsContact) } class SCNPhysicsWorld : NSObject, NSSecureCoding { var gravity: SCNVector3 diff --git a/iOS/SceneKit/SCNSceneRenderer.swift b/iOS/SceneKit/SCNSceneRenderer.swift index e6973c6..d7fa230 100644 --- a/iOS/SceneKit/SCNSceneRenderer.swift +++ b/iOS/SceneKit/SCNSceneRenderer.swift @@ -83,10 +83,10 @@ protocol SCNSceneRenderer : NSObjectProtocol { } protocol SCNSceneRendererDelegate : NSObjectProtocol { optional func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) - @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didApplyAnimationsAtTime time: TimeInterval) - @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didSimulatePhysicsAtTime time: TimeInterval) + optional func renderer(_ renderer: SCNSceneRenderer, didApplyAnimationsAtTime time: TimeInterval) + optional func renderer(_ renderer: SCNSceneRenderer, didSimulatePhysicsAtTime time: TimeInterval) @available(iOS 11.0, *) - @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didApplyConstraintsAtTime time: TimeInterval) + optional func renderer(_ renderer: SCNSceneRenderer, didApplyConstraintsAtTime time: TimeInterval) optional func renderer(_ renderer: SCNSceneRenderer, willRenderScene scene: SCNScene, atTime time: TimeInterval) - @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didRenderScene scene: SCNScene, atTime time: TimeInterval) + optional func renderer(_ renderer: SCNSceneRenderer, didRenderScene scene: SCNScene, atTime time: TimeInterval) } diff --git a/iOS/SensorKit/SensorKit.swift b/iOS/SensorKit/SensorKit.swift index 36ee5b4..e0efc84 100644 --- a/iOS/SensorKit/SensorKit.swift +++ b/iOS/SensorKit/SensorKit.swift @@ -78,14 +78,14 @@ enum SRAuthorizationStatus : Int { @available(iOS 14.0, *) protocol SRSensorReaderDelegate : NSObjectProtocol { optional func sensorReader(_ reader: SRSensorReader, fetching fetchRequest: SRFetchRequest, didFetchResult result: SRFetchResult) -> Bool - @asyncHandler optional func sensorReader(_ reader: SRSensorReader, didCompleteFetch fetchRequest: SRFetchRequest) + optional func sensorReader(_ reader: SRSensorReader, didCompleteFetch fetchRequest: SRFetchRequest) optional func sensorReader(_ reader: SRSensorReader, fetching fetchRequest: SRFetchRequest, failedWithError error: Error) - @asyncHandler optional func sensorReader(_ reader: SRSensorReader, didChange authorizationStatus: SRAuthorizationStatus) + optional func sensorReader(_ reader: SRSensorReader, didChange authorizationStatus: SRAuthorizationStatus) optional func sensorReaderWillStartRecording(_ reader: SRSensorReader) optional func sensorReader(_ reader: SRSensorReader, startRecordingFailedWithError error: Error) - @asyncHandler optional func sensorReaderDidStopRecording(_ reader: SRSensorReader) + optional func sensorReaderDidStopRecording(_ reader: SRSensorReader) optional func sensorReader(_ reader: SRSensorReader, stopRecordingFailedWithError error: Error) - @asyncHandler optional func sensorReader(_ reader: SRSensorReader, didFetch devices: [SRDevice]) + optional func sensorReader(_ reader: SRSensorReader, didFetch devices: [SRDevice]) optional func sensorReader(_ reader: SRSensorReader, fetchDevicesDidFailWithError error: Error) } @available(iOS 14.0, *) diff --git a/iOS/SoundAnalysis/SNResult.swift b/iOS/SoundAnalysis/SNResult.swift index f2956c1..1e4c7f5 100644 --- a/iOS/SoundAnalysis/SNResult.swift +++ b/iOS/SoundAnalysis/SNResult.swift @@ -4,7 +4,7 @@ protocol SNResult : NSObjectProtocol { } @available(iOS 13.0, *) protocol SNResultsObserving : NSObjectProtocol { - @asyncHandler func request(_ request: SNRequest, didProduce result: SNResult) - @asyncHandler optional func request(_ request: SNRequest, didFailWithError error: Error) - @asyncHandler optional func requestDidComplete(_ request: SNRequest) + func request(_ request: SNRequest, didProduce result: SNResult) + optional func request(_ request: SNRequest, didFailWithError error: Error) + optional func requestDidComplete(_ request: SNRequest) } diff --git a/iOS/Speech/SFSpeechRecognitionTask.swift b/iOS/Speech/SFSpeechRecognitionTask.swift index aa97ba2..338e2d1 100644 --- a/iOS/Speech/SFSpeechRecognitionTask.swift +++ b/iOS/Speech/SFSpeechRecognitionTask.swift @@ -20,10 +20,10 @@ class SFSpeechRecognitionTask : NSObject { } @available(iOS 10.0, *) protocol SFSpeechRecognitionTaskDelegate : NSObjectProtocol { - @asyncHandler optional func speechRecognitionDidDetectSpeech(_ task: SFSpeechRecognitionTask) - @asyncHandler optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didHypothesizeTranscription transcription: SFTranscription) - @asyncHandler optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishRecognition recognitionResult: SFSpeechRecognitionResult) + optional func speechRecognitionDidDetectSpeech(_ task: SFSpeechRecognitionTask) + optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didHypothesizeTranscription transcription: SFTranscription) + optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishRecognition recognitionResult: SFSpeechRecognitionResult) optional func speechRecognitionTaskFinishedReadingAudio(_ task: SFSpeechRecognitionTask) optional func speechRecognitionTaskWasCancelled(_ task: SFSpeechRecognitionTask) - @asyncHandler optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishSuccessfully successfully: Bool) + optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishSuccessfully successfully: Bool) } diff --git a/iOS/SpriteKit/SKPhysicsWorld.swift b/iOS/SpriteKit/SKPhysicsWorld.swift index 9e19ea5..4bbdcf1 100644 --- a/iOS/SpriteKit/SKPhysicsWorld.swift +++ b/iOS/SpriteKit/SKPhysicsWorld.swift @@ -1,7 +1,7 @@ protocol SKPhysicsContactDelegate : NSObjectProtocol { - @asyncHandler optional func didBegin(_ contact: SKPhysicsContact) - @asyncHandler optional func didEnd(_ contact: SKPhysicsContact) + optional func didBegin(_ contact: SKPhysicsContact) + optional func didEnd(_ contact: SKPhysicsContact) } class SKPhysicsWorld : NSObject, NSSecureCoding { var gravity: CGVector diff --git a/iOS/SpriteKit/SKScene.swift b/iOS/SpriteKit/SKScene.swift index 0cbbc1d..bfcd6c3 100644 --- a/iOS/SpriteKit/SKScene.swift +++ b/iOS/SpriteKit/SKScene.swift @@ -11,10 +11,10 @@ enum SKSceneScaleMode : Int { @available(iOS 8.0, *) protocol SKSceneDelegate : NSObjectProtocol { optional func update(_ currentTime: TimeInterval, for scene: SKScene) - @asyncHandler optional func didEvaluateActions(for scene: SKScene) - @asyncHandler optional func didSimulatePhysics(for scene: SKScene) - @asyncHandler optional func didApplyConstraints(for scene: SKScene) - @asyncHandler optional func didFinishUpdate(for scene: SKScene) + optional func didEvaluateActions(for scene: SKScene) + optional func didSimulatePhysics(for scene: SKScene) + optional func didApplyConstraints(for scene: SKScene) + optional func didFinishUpdate(for scene: SKScene) } class SKScene : SKEffectNode { init(size: CGSize) diff --git a/iOS/StoreKit/SKCloudServiceSetupViewController.swift b/iOS/StoreKit/SKCloudServiceSetupViewController.swift index 39f3fa3..cd9f669 100644 --- a/iOS/StoreKit/SKCloudServiceSetupViewController.swift +++ b/iOS/StoreKit/SKCloudServiceSetupViewController.swift @@ -25,7 +25,7 @@ class SKCloudServiceSetupViewController : UIViewController { } protocol SKCloudServiceSetupViewControllerDelegate : NSObjectProtocol { @available(iOS 10.1, *) - @asyncHandler optional func cloudServiceSetupViewControllerDidDismiss(_ cloudServiceSetupViewController: SKCloudServiceSetupViewController) + optional func cloudServiceSetupViewControllerDidDismiss(_ cloudServiceSetupViewController: SKCloudServiceSetupViewController) } extension SKCloudServiceSetupOptionsKey { @available(iOS 10.1, *) diff --git a/iOS/StoreKit/SKOverlay.swift b/iOS/StoreKit/SKOverlay.swift index b9d191c..32b0b0a 100644 --- a/iOS/StoreKit/SKOverlay.swift +++ b/iOS/StoreKit/SKOverlay.swift @@ -1,11 +1,11 @@ @available(iOS 14.0, *) protocol SKOverlayDelegate : NSObjectProtocol { - @asyncHandler optional func storeOverlayDidFailToLoad(_ overlay: SKOverlay, error: Error) + optional func storeOverlayDidFailToLoad(_ overlay: SKOverlay, error: Error) optional func storeOverlayWillStartPresentation(_ overlay: SKOverlay, transitionContext: SKOverlay.TransitionContext) - @asyncHandler optional func storeOverlayDidFinishPresentation(_ overlay: SKOverlay, transitionContext: SKOverlay.TransitionContext) + optional func storeOverlayDidFinishPresentation(_ overlay: SKOverlay, transitionContext: SKOverlay.TransitionContext) optional func storeOverlayWillStartDismissal(_ overlay: SKOverlay, transitionContext: SKOverlay.TransitionContext) - @asyncHandler optional func storeOverlayDidFinishDismissal(_ overlay: SKOverlay, transitionContext: SKOverlay.TransitionContext) + optional func storeOverlayDidFinishDismissal(_ overlay: SKOverlay, transitionContext: SKOverlay.TransitionContext) } @available(iOS 14.0, *) class SKOverlay : NSObject { diff --git a/iOS/StoreKit/SKPaymentQueue.swift b/iOS/StoreKit/SKPaymentQueue.swift index b934994..a91e4ca 100644 --- a/iOS/StoreKit/SKPaymentQueue.swift +++ b/iOS/StoreKit/SKPaymentQueue.swift @@ -58,7 +58,7 @@ protocol SKPaymentTransactionObserver : NSObjectProtocol { @available(iOS 11.0, *) optional func paymentQueue(_ queue: SKPaymentQueue, shouldAddStorePayment payment: SKPayment, for product: SKProduct) -> Bool @available(iOS 13.0, *) - @asyncHandler optional func paymentQueueDidChangeStorefront(_ queue: SKPaymentQueue) + optional func paymentQueueDidChangeStorefront(_ queue: SKPaymentQueue) @available(iOS 14.0, *) - @asyncHandler optional func paymentQueue(_ queue: SKPaymentQueue, didRevokeEntitlementsForProductIdentifiers productIdentifiers: [String]) + optional func paymentQueue(_ queue: SKPaymentQueue, didRevokeEntitlementsForProductIdentifiers productIdentifiers: [String]) } diff --git a/iOS/StoreKit/SKProductsRequest.swift b/iOS/StoreKit/SKProductsRequest.swift index 0272e9a..30e0102 100644 --- a/iOS/StoreKit/SKProductsRequest.swift +++ b/iOS/StoreKit/SKProductsRequest.swift @@ -1,7 +1,7 @@ protocol SKProductsRequestDelegate : SKRequestDelegate { @available(iOS 3.0, *) - @asyncHandler func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) + func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) } @available(iOS 3.0, *) class SKProductsRequest : SKRequest { diff --git a/iOS/StoreKit/SKRequest.swift b/iOS/StoreKit/SKRequest.swift index 6a80961..d03cc50 100644 --- a/iOS/StoreKit/SKRequest.swift +++ b/iOS/StoreKit/SKRequest.swift @@ -10,7 +10,7 @@ class SKRequest : NSObject { } protocol SKRequestDelegate : NSObjectProtocol { @available(iOS 3.0, *) - @asyncHandler optional func requestDidFinish(_ request: SKRequest) + optional func requestDidFinish(_ request: SKRequest) @available(iOS 3.0, *) - @asyncHandler optional func request(_ request: SKRequest, didFailWithError error: Error) + optional func request(_ request: SKRequest, didFailWithError error: Error) } diff --git a/iOS/StoreKit/SKStoreProductViewController.swift b/iOS/StoreKit/SKStoreProductViewController.swift index 1fcaa92..67887bf 100644 --- a/iOS/StoreKit/SKStoreProductViewController.swift +++ b/iOS/StoreKit/SKStoreProductViewController.swift @@ -10,7 +10,7 @@ class SKStoreProductViewController : UIViewController { } protocol SKStoreProductViewControllerDelegate : NSObjectProtocol { @available(iOS 6.0, *) - @asyncHandler optional func productViewControllerDidFinish(_ viewController: SKStoreProductViewController) + optional func productViewControllerDidFinish(_ viewController: SKStoreProductViewController) } @available(iOS 6.0, *) let SKStoreProductParameterITunesItemIdentifier: String diff --git a/iOS/UIKit/NSLayoutManager.swift b/iOS/UIKit/NSLayoutManager.swift index 2397962..9266788 100644 --- a/iOS/UIKit/NSLayoutManager.swift +++ b/iOS/UIKit/NSLayoutManager.swift @@ -157,11 +157,11 @@ protocol NSLayoutManagerDelegate : NSObjectProtocol { @available(iOS 9.0, *) optional func layoutManager(_ layoutManager: NSLayoutManager, shouldSetLineFragmentRect lineFragmentRect: UnsafeMutablePointer, lineFragmentUsedRect: UnsafeMutablePointer, baselineOffset: UnsafeMutablePointer, in textContainer: NSTextContainer, forGlyphRange glyphRange: NSRange) -> Bool @available(iOS 7.0, *) - @asyncHandler optional func layoutManagerDidInvalidateLayout(_ sender: NSLayoutManager) + optional func layoutManagerDidInvalidateLayout(_ sender: NSLayoutManager) @available(iOS 7.0, *) - @asyncHandler optional func layoutManager(_ layoutManager: NSLayoutManager, didCompleteLayoutFor textContainer: NSTextContainer?, atEnd layoutFinishedFlag: Bool) + optional func layoutManager(_ layoutManager: NSLayoutManager, didCompleteLayoutFor textContainer: NSTextContainer?, atEnd layoutFinishedFlag: Bool) @available(iOS 7.0, *) - @asyncHandler optional func layoutManager(_ layoutManager: NSLayoutManager, textContainer: NSTextContainer, didChangeGeometryFrom oldSize: CGSize) + optional func layoutManager(_ layoutManager: NSLayoutManager, textContainer: NSTextContainer, didChangeGeometryFrom oldSize: CGSize) } @available(iOS, introduced: 7.0, deprecated: 9.0, message: "Use NSControlCharacterActionZeroAdvancement instead") var NSControlCharacterZeroAdvancementAction: Int { get } diff --git a/iOS/UIKit/NSTextStorage.swift b/iOS/UIKit/NSTextStorage.swift index 5087872..dbb49e1 100644 --- a/iOS/UIKit/NSTextStorage.swift +++ b/iOS/UIKit/NSTextStorage.swift @@ -31,5 +31,5 @@ protocol NSTextStorageDelegate : NSObjectProtocol { @available(iOS 7.0, *) optional func textStorage(_ textStorage: NSTextStorage, willProcessEditing editedMask: NSTextStorage.EditActions, range editedRange: NSRange, changeInLength delta: Int) @available(iOS 7.0, *) - @asyncHandler optional func textStorage(_ textStorage: NSTextStorage, didProcessEditing editedMask: NSTextStorage.EditActions, range editedRange: NSRange, changeInLength delta: Int) + optional func textStorage(_ textStorage: NSTextStorage, didProcessEditing editedMask: NSTextStorage.EditActions, range editedRange: NSRange, changeInLength delta: Int) } diff --git a/iOS/UIKit/UIActionSheet.swift b/iOS/UIKit/UIActionSheet.swift index d5b9262..56cd21e 100644 --- a/iOS/UIKit/UIActionSheet.swift +++ b/iOS/UIKit/UIActionSheet.swift @@ -42,9 +42,9 @@ protocol UIActionSheetDelegate : NSObjectProtocol { @available(iOS, introduced: 2.0, deprecated: 8.3, message: "Use UIAlertController instead.") optional func willPresent(_ actionSheet: UIActionSheet) @available(iOS, introduced: 2.0, deprecated: 8.3, message: "Use UIAlertController instead.") - @asyncHandler optional func didPresent(_ actionSheet: UIActionSheet) + optional func didPresent(_ actionSheet: UIActionSheet) @available(iOS, introduced: 2.0, deprecated: 8.3, message: "Use UIAlertController instead.") optional func actionSheet(_ actionSheet: UIActionSheet, willDismissWithButtonIndex buttonIndex: Int) @available(iOS, introduced: 2.0, deprecated: 8.3, message: "Use UIAlertController instead.") - @asyncHandler optional func actionSheet(_ actionSheet: UIActionSheet, didDismissWithButtonIndex buttonIndex: Int) + optional func actionSheet(_ actionSheet: UIActionSheet, didDismissWithButtonIndex buttonIndex: Int) } diff --git a/iOS/UIKit/UIAlertView.swift b/iOS/UIKit/UIAlertView.swift index cc6677d..3621258 100644 --- a/iOS/UIKit/UIAlertView.swift +++ b/iOS/UIKit/UIAlertView.swift @@ -38,11 +38,11 @@ protocol UIAlertViewDelegate : NSObjectProtocol { @available(iOS, introduced: 2.0, deprecated: 9.0, message: "Use UIAlertController instead.") optional func willPresent(_ alertView: UIAlertView) @available(iOS, introduced: 2.0, deprecated: 9.0, message: "Use UIAlertController instead.") - @asyncHandler optional func didPresent(_ alertView: UIAlertView) + optional func didPresent(_ alertView: UIAlertView) @available(iOS, introduced: 2.0, deprecated: 9.0, message: "Use UIAlertController instead.") optional func alertView(_ alertView: UIAlertView, willDismissWithButtonIndex buttonIndex: Int) @available(iOS, introduced: 2.0, deprecated: 9.0, message: "Use UIAlertController instead.") - @asyncHandler optional func alertView(_ alertView: UIAlertView, didDismissWithButtonIndex buttonIndex: Int) + optional func alertView(_ alertView: UIAlertView, didDismissWithButtonIndex buttonIndex: Int) @available(iOS, introduced: 2.0, deprecated: 9.0, message: "Use UIAlertController instead.") optional func alertViewShouldEnableFirstOtherButton(_ alertView: UIAlertView) -> Bool } diff --git a/iOS/UIKit/UIApplication.swift b/iOS/UIKit/UIApplication.swift index b8ea4ec..0383b3f 100644 --- a/iOS/UIKit/UIApplication.swift +++ b/iOS/UIKit/UIApplication.swift @@ -284,13 +284,13 @@ extension UIApplication { } protocol UIApplicationDelegate : NSObjectProtocol { @available(iOS 2.0, *) - @asyncHandler optional func applicationDidFinishLaunching(_ application: UIApplication) + optional func applicationDidFinishLaunching(_ application: UIApplication) @available(iOS 6.0, *) optional func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool @available(iOS 3.0, *) optional func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool @available(iOS 2.0, *) - @asyncHandler optional func applicationDidBecomeActive(_ application: UIApplication) + optional func applicationDidBecomeActive(_ application: UIApplication) @available(iOS 2.0, *) optional func applicationWillResignActive(_ application: UIApplication) @available(iOS, introduced: 2.0, deprecated: 9.0) @@ -300,7 +300,7 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(iOS 9.0, *) optional func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool @available(iOS 2.0, *) - @asyncHandler optional func applicationDidReceiveMemoryWarning(_ application: UIApplication) + optional func applicationDidReceiveMemoryWarning(_ application: UIApplication) @available(iOS 2.0, *) optional func applicationWillTerminate(_ application: UIApplication) @available(iOS 2.0, *) @@ -308,21 +308,21 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use viewWillTransitionToSize:withTransitionCoordinator: instead.") optional func application(_ application: UIApplication, willChangeStatusBarOrientation newStatusBarOrientation: UIInterfaceOrientation, duration: TimeInterval) @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use viewWillTransitionToSize:withTransitionCoordinator: instead.") - @asyncHandler optional func application(_ application: UIApplication, didChangeStatusBarOrientation oldStatusBarOrientation: UIInterfaceOrientation) + optional func application(_ application: UIApplication, didChangeStatusBarOrientation oldStatusBarOrientation: UIInterfaceOrientation) @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use viewWillTransitionToSize:withTransitionCoordinator: instead.") optional func application(_ application: UIApplication, willChangeStatusBarFrame newStatusBarFrame: CGRect) @available(iOS, introduced: 2.0, deprecated: 13.0, message: "Use viewWillTransitionToSize:withTransitionCoordinator: instead.") - @asyncHandler optional func application(_ application: UIApplication, didChangeStatusBarFrame oldStatusBarFrame: CGRect) + optional func application(_ application: UIApplication, didChangeStatusBarFrame oldStatusBarFrame: CGRect) @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenter requestAuthorizationWithOptions:completionHandler:]") - @asyncHandler optional func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings) + optional func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings) @available(iOS 3.0, *) - @asyncHandler optional func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) + optional func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) @available(iOS 3.0, *) - @asyncHandler optional func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) + optional func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) @available(iOS, introduced: 3.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate willPresentNotification:withCompletionHandler:] or -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:] for user visible notifications and -[UIApplicationDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:] for silent remote notifications") - @asyncHandler optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) + optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) @available(iOS, introduced: 4.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate willPresentNotification:withCompletionHandler:] or -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]") - @asyncHandler optional func application(_ application: UIApplication, didReceive notification: UILocalNotification) + optional func application(_ application: UIApplication, didReceive notification: UILocalNotification) @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]") optional func application(_ application: UIApplication, handleActionWithIdentifier identifier: String?, for notification: UILocalNotification, completionHandler: @escaping () -> Void) @available(iOS, introduced: 8.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]") @@ -340,7 +340,7 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(iOS, introduced: 9.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]") optional func application(_ application: UIApplication, handleActionWithIdentifier identifier: String?, for notification: UILocalNotification, withResponseInfo responseInfo: [AnyHashable : Any]) async @available(iOS 7.0, *) - @asyncHandler optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) + optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) @available(iOS 7.0, *) optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) async -> UIBackgroundFetchResult @available(iOS, introduced: 7.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead") @@ -362,13 +362,13 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(iOS 9.0, *) optional func applicationShouldRequestHealthAuthorization(_ application: UIApplication) @available(iOS 4.0, *) - @asyncHandler optional func applicationDidEnterBackground(_ application: UIApplication) + optional func applicationDidEnterBackground(_ application: UIApplication) @available(iOS 4.0, *) optional func applicationWillEnterForeground(_ application: UIApplication) @available(iOS 4.0, *) optional func applicationProtectedDataWillBecomeUnavailable(_ application: UIApplication) @available(iOS 4.0, *) - @asyncHandler optional func applicationProtectedDataDidBecomeAvailable(_ application: UIApplication) + optional func applicationProtectedDataDidBecomeAvailable(_ application: UIApplication) @available(iOS 5.0, *) optional var window: UIWindow? { get set } @available(iOS 6.0, *) @@ -384,7 +384,7 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(iOS 6.0, *) optional func application(_ application: UIApplication, willEncodeRestorableStateWith coder: NSCoder) @available(iOS 6.0, *) - @asyncHandler optional func application(_ application: UIApplication, didDecodeRestorableStateWith coder: NSCoder) + optional func application(_ application: UIApplication, didDecodeRestorableStateWith coder: NSCoder) @available(iOS, introduced: 6.0, deprecated: 13.2, message: "Use application:shouldSaveSecureApplicationState: instead") optional func application(_ application: UIApplication, shouldSaveApplicationState coder: NSCoder) -> Bool @available(iOS, introduced: 6.0, deprecated: 13.2, message: "Use application:shouldRestoreSecureApplicationState: instead") @@ -394,13 +394,13 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(iOS 8.0, *) optional func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool @available(iOS 8.0, *) - @asyncHandler optional func application(_ application: UIApplication, didFailToContinueUserActivityWithType userActivityType: String, error: Error) + optional func application(_ application: UIApplication, didFailToContinueUserActivityWithType userActivityType: String, error: Error) @available(iOS 8.0, *) - @asyncHandler optional func application(_ application: UIApplication, didUpdate userActivity: NSUserActivity) + optional func application(_ application: UIApplication, didUpdate userActivity: NSUserActivity) @available(iOS 13.0, *) optional func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration @available(iOS 13.0, *) - @asyncHandler optional func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) + optional func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) } extension UIApplicationDelegate { diff --git a/iOS/UIKit/UICloudSharingController.swift b/iOS/UIKit/UICloudSharingController.swift index b7fea79..ab9f943 100644 --- a/iOS/UIKit/UICloudSharingController.swift +++ b/iOS/UIKit/UICloudSharingController.swift @@ -20,9 +20,9 @@ protocol UICloudSharingControllerDelegate : NSObjectProtocol { @available(iOS 10.0, *) optional func itemType(for csc: UICloudSharingController) -> String? @available(iOS 10.0, *) - @asyncHandler optional func cloudSharingControllerDidSaveShare(_ csc: UICloudSharingController) + optional func cloudSharingControllerDidSaveShare(_ csc: UICloudSharingController) @available(iOS 10.0, *) - @asyncHandler optional func cloudSharingControllerDidStopSharing(_ csc: UICloudSharingController) + optional func cloudSharingControllerDidStopSharing(_ csc: UICloudSharingController) } @available(iOS 10.0, *) class UICloudSharingController : UIViewController { diff --git a/iOS/UIKit/UICollectionView.swift b/iOS/UIKit/UICollectionView.swift index c0047f0..5ee8669 100644 --- a/iOS/UIKit/UICollectionView.swift +++ b/iOS/UIKit/UICollectionView.swift @@ -53,25 +53,25 @@ protocol UICollectionViewDelegate : UIScrollViewDelegate { @available(iOS 6.0, *) optional func collectionView(_ collectionView: UICollectionView, shouldHighlightItemAt indexPath: IndexPath) -> Bool @available(iOS 6.0, *) - @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didHighlightItemAt indexPath: IndexPath) + optional func collectionView(_ collectionView: UICollectionView, didHighlightItemAt indexPath: IndexPath) @available(iOS 6.0, *) - @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didUnhighlightItemAt indexPath: IndexPath) + optional func collectionView(_ collectionView: UICollectionView, didUnhighlightItemAt indexPath: IndexPath) @available(iOS 6.0, *) optional func collectionView(_ collectionView: UICollectionView, shouldSelectItemAt indexPath: IndexPath) -> Bool @available(iOS 6.0, *) optional func collectionView(_ collectionView: UICollectionView, shouldDeselectItemAt indexPath: IndexPath) -> Bool @available(iOS 6.0, *) - @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) + optional func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) @available(iOS 6.0, *) - @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) + optional func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) @available(iOS 8.0, *) optional func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) @available(iOS 8.0, *) optional func collectionView(_ collectionView: UICollectionView, willDisplaySupplementaryView view: UICollectionReusableView, forElementKind elementKind: String, at indexPath: IndexPath) @available(iOS 6.0, *) - @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) + optional func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) @available(iOS 6.0, *) - @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didEndDisplayingSupplementaryView view: UICollectionReusableView, forElementOfKind elementKind: String, at indexPath: IndexPath) + optional func collectionView(_ collectionView: UICollectionView, didEndDisplayingSupplementaryView view: UICollectionReusableView, forElementOfKind elementKind: String, at indexPath: IndexPath) @available(iOS, introduced: 6.0, deprecated: 13.0) optional func collectionView(_ collectionView: UICollectionView, shouldShowMenuForItemAt indexPath: IndexPath) -> Bool @available(iOS, introduced: 6.0, deprecated: 13.0) @@ -85,7 +85,7 @@ protocol UICollectionViewDelegate : UIScrollViewDelegate { @available(iOS 9.0, *) optional func collectionView(_ collectionView: UICollectionView, shouldUpdateFocusIn context: UICollectionViewFocusUpdateContext) -> Bool @available(iOS 9.0, *) - @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didUpdateFocusIn context: UICollectionViewFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) + optional func collectionView(_ collectionView: UICollectionView, didUpdateFocusIn context: UICollectionViewFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) @available(iOS 9.0, *) optional func indexPathForPreferredFocusedView(in collectionView: UICollectionView) -> IndexPath? @available(iOS 9.0, *) @@ -99,9 +99,9 @@ protocol UICollectionViewDelegate : UIScrollViewDelegate { @available(iOS 13.0, *) optional func collectionView(_ collectionView: UICollectionView, shouldBeginMultipleSelectionInteractionAt indexPath: IndexPath) -> Bool @available(iOS 13.0, *) - @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didBeginMultipleSelectionInteractionAt indexPath: IndexPath) + optional func collectionView(_ collectionView: UICollectionView, didBeginMultipleSelectionInteractionAt indexPath: IndexPath) @available(iOS 13.0, *) - @asyncHandler optional func collectionViewDidEndMultipleSelectionInteraction(_ collectionView: UICollectionView) + optional func collectionViewDidEndMultipleSelectionInteraction(_ collectionView: UICollectionView) @available(iOS 13.0, *) optional func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? @available(iOS 13.0, *) diff --git a/iOS/UIKit/UIColorPickerViewController.swift b/iOS/UIKit/UIColorPickerViewController.swift index 16c99d9..a015f5f 100644 --- a/iOS/UIKit/UIColorPickerViewController.swift +++ b/iOS/UIKit/UIColorPickerViewController.swift @@ -1,8 +1,8 @@ @available(iOS 14.0, *) protocol UIColorPickerViewControllerDelegate : NSObjectProtocol { - @asyncHandler optional func colorPickerViewControllerDidSelectColor(_ viewController: UIColorPickerViewController) - @asyncHandler optional func colorPickerViewControllerDidFinish(_ viewController: UIColorPickerViewController) + optional func colorPickerViewControllerDidSelectColor(_ viewController: UIColorPickerViewController) + optional func colorPickerViewControllerDidFinish(_ viewController: UIColorPickerViewController) } @available(iOS 14.0, *) class UIColorPickerViewController : UIViewController { diff --git a/iOS/UIKit/UIDocumentBrowserViewController.swift b/iOS/UIKit/UIDocumentBrowserViewController.swift index 3651f68..83984a6 100644 --- a/iOS/UIKit/UIDocumentBrowserViewController.swift +++ b/iOS/UIKit/UIDocumentBrowserViewController.swift @@ -61,11 +61,11 @@ class UIDocumentBrowserViewController : UIViewController, NSCoding { @available(iOS 11.0, *) protocol UIDocumentBrowserViewControllerDelegate : NSObjectProtocol { @available(iOS, introduced: 11.0, deprecated: 12.0) - @asyncHandler optional func documentBrowser(_ controller: UIDocumentBrowserViewController, didPickDocumentURLs documentURLs: [URL]) + optional func documentBrowser(_ controller: UIDocumentBrowserViewController, didPickDocumentURLs documentURLs: [URL]) @available(iOS 12.0, *) - @asyncHandler optional func documentBrowser(_ controller: UIDocumentBrowserViewController, didPickDocumentsAt documentURLs: [URL]) - @asyncHandler optional func documentBrowser(_ controller: UIDocumentBrowserViewController, didRequestDocumentCreationWithHandler importHandler: @escaping (URL?, UIDocumentBrowserViewController.ImportMode) -> Void) - @asyncHandler optional func documentBrowser(_ controller: UIDocumentBrowserViewController, didImportDocumentAt sourceURL: URL, toDestinationURL destinationURL: URL) + optional func documentBrowser(_ controller: UIDocumentBrowserViewController, didPickDocumentsAt documentURLs: [URL]) + optional func documentBrowser(_ controller: UIDocumentBrowserViewController, didRequestDocumentCreationWithHandler importHandler: @escaping (URL?, UIDocumentBrowserViewController.ImportMode) -> Void) + optional func documentBrowser(_ controller: UIDocumentBrowserViewController, didImportDocumentAt sourceURL: URL, toDestinationURL destinationURL: URL) optional func documentBrowser(_ controller: UIDocumentBrowserViewController, failedToImportDocumentAt documentURL: URL, error: Error?) optional func documentBrowser(_ controller: UIDocumentBrowserViewController, applicationActivitiesForDocumentURLs documentURLs: [URL]) -> [UIActivity] optional func documentBrowser(_ controller: UIDocumentBrowserViewController, willPresent activityViewController: UIActivityViewController) diff --git a/iOS/UIKit/UIDocumentInteractionController.swift b/iOS/UIKit/UIDocumentInteractionController.swift index 5a73bfd..6c00a5b 100644 --- a/iOS/UIKit/UIDocumentInteractionController.swift +++ b/iOS/UIKit/UIDocumentInteractionController.swift @@ -23,11 +23,11 @@ protocol UIDocumentInteractionControllerDelegate : NSObjectProtocol { optional func documentInteractionControllerRectForPreview(_ controller: UIDocumentInteractionController) -> CGRect optional func documentInteractionControllerViewForPreview(_ controller: UIDocumentInteractionController) -> UIView? optional func documentInteractionControllerWillBeginPreview(_ controller: UIDocumentInteractionController) - @asyncHandler optional func documentInteractionControllerDidEndPreview(_ controller: UIDocumentInteractionController) + optional func documentInteractionControllerDidEndPreview(_ controller: UIDocumentInteractionController) optional func documentInteractionControllerWillPresentOptionsMenu(_ controller: UIDocumentInteractionController) - @asyncHandler optional func documentInteractionControllerDidDismissOptionsMenu(_ controller: UIDocumentInteractionController) + optional func documentInteractionControllerDidDismissOptionsMenu(_ controller: UIDocumentInteractionController) optional func documentInteractionControllerWillPresentOpenInMenu(_ controller: UIDocumentInteractionController) - @asyncHandler optional func documentInteractionControllerDidDismissOpenInMenu(_ controller: UIDocumentInteractionController) + optional func documentInteractionControllerDidDismissOpenInMenu(_ controller: UIDocumentInteractionController) optional func documentInteractionController(_ controller: UIDocumentInteractionController, willBeginSendingToApplication application: String?) - @asyncHandler optional func documentInteractionController(_ controller: UIDocumentInteractionController, didEndSendingToApplication application: String?) + optional func documentInteractionController(_ controller: UIDocumentInteractionController, didEndSendingToApplication application: String?) } diff --git a/iOS/UIKit/UIDocumentMenuViewController.swift b/iOS/UIKit/UIDocumentMenuViewController.swift index 82506df..830b965 100644 --- a/iOS/UIKit/UIDocumentMenuViewController.swift +++ b/iOS/UIKit/UIDocumentMenuViewController.swift @@ -8,7 +8,7 @@ enum UIDocumentMenuOrder : UInt { } @available(iOS, introduced: 8.0, deprecated: 13.0, message: "UIDocumentMenuDelegate is deprecated. Use UIDocumentPickerViewController directly.") protocol UIDocumentMenuDelegate : NSObjectProtocol { - @asyncHandler func documentMenu(_ documentMenu: UIDocumentMenuViewController, didPickDocumentPicker documentPicker: UIDocumentPickerViewController) + func documentMenu(_ documentMenu: UIDocumentMenuViewController, didPickDocumentPicker documentPicker: UIDocumentPickerViewController) optional func documentMenuWasCancelled(_ documentMenu: UIDocumentMenuViewController) } @available(iOS, introduced: 8.0, deprecated: 11.0, message: "UIDocumentMenuViewController is deprecated. Use UIDocumentPickerViewController directly.") diff --git a/iOS/UIKit/UIDocumentPickerViewController.swift b/iOS/UIKit/UIDocumentPickerViewController.swift index cf75451..3f756ed 100644 --- a/iOS/UIKit/UIDocumentPickerViewController.swift +++ b/iOS/UIKit/UIDocumentPickerViewController.swift @@ -1,11 +1,11 @@ protocol UIDocumentPickerDelegate : NSObjectProtocol { @available(iOS 11.0, *) - @asyncHandler optional func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) + optional func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) @available(iOS 8.0, *) optional func documentPickerWasCancelled(_ controller: UIDocumentPickerViewController) @available(iOS, introduced: 8.0, deprecated: 11.0) - @asyncHandler optional func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentAt url: URL) + optional func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentAt url: URL) } @available(iOS, introduced: 8.0, deprecated: 14.0, message: "Use appropriate initializers instead") enum UIDocumentPickerMode : UInt { diff --git a/iOS/UIKit/UIDragInteraction.swift b/iOS/UIKit/UIDragInteraction.swift index c802eed..c5d103c 100644 --- a/iOS/UIKit/UIDragInteraction.swift +++ b/iOS/UIKit/UIDragInteraction.swift @@ -24,7 +24,7 @@ protocol UIDragInteractionDelegate : NSObjectProtocol { optional func dragInteraction(_ interaction: UIDragInteraction, prefersFullSizePreviewsFor session: UIDragSession) -> Bool optional func dragInteraction(_ interaction: UIDragInteraction, sessionDidMove session: UIDragSession) optional func dragInteraction(_ interaction: UIDragInteraction, session: UIDragSession, willEndWith operation: UIDropOperation) - @asyncHandler optional func dragInteraction(_ interaction: UIDragInteraction, session: UIDragSession, didEndWith operation: UIDropOperation) + optional func dragInteraction(_ interaction: UIDragInteraction, session: UIDragSession, didEndWith operation: UIDropOperation) optional func dragInteraction(_ interaction: UIDragInteraction, sessionDidTransferItems session: UIDragSession) optional func dragInteraction(_ interaction: UIDragInteraction, itemsForAddingTo session: UIDragSession, withTouchAt point: CGPoint) -> [UIDragItem] optional func dragInteraction(_ interaction: UIDragInteraction, sessionForAddingItems sessions: [UIDragSession], withTouchAt point: CGPoint) -> UIDragSession? diff --git a/iOS/UIKit/UIDynamicAnimator.swift b/iOS/UIKit/UIDynamicAnimator.swift index 40eebb5..a7c9a34 100644 --- a/iOS/UIKit/UIDynamicAnimator.swift +++ b/iOS/UIKit/UIDynamicAnimator.swift @@ -3,7 +3,7 @@ protocol UIDynamicAnimatorDelegate : NSObjectProtocol { @available(iOS 7.0, *) optional func dynamicAnimatorWillResume(_ animator: UIDynamicAnimator) @available(iOS 7.0, *) - @asyncHandler optional func dynamicAnimatorDidPause(_ animator: UIDynamicAnimator) + optional func dynamicAnimatorDidPause(_ animator: UIDynamicAnimator) } @available(iOS 7.0, *) class UIDynamicAnimator : NSObject { diff --git a/iOS/UIKit/UIFocus.swift b/iOS/UIKit/UIFocus.swift index d2f2b53..983b31a 100644 --- a/iOS/UIKit/UIFocus.swift +++ b/iOS/UIKit/UIFocus.swift @@ -26,7 +26,7 @@ protocol UIFocusEnvironment : NSObjectProtocol { func setNeedsFocusUpdate() func updateFocusIfNeeded() func shouldUpdateFocus(in context: UIFocusUpdateContext) -> Bool - @asyncHandler func didUpdateFocus(in context: UIFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) + func didUpdateFocus(in context: UIFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) @available(iOS, introduced: 9.0, deprecated: 10.0) weak optional var preferredFocusedView: @sil_weak UIView? { get } @available(iOS 14.0, *) @@ -44,7 +44,7 @@ protocol UIFocusItem : UIFocusEnvironment { @available(iOS 12.0, *) var frame: CGRect { get } @available(iOS 12.0, *) - @asyncHandler optional func didHintFocusMovement(_ hint: UIFocusMovementHint) + optional func didHintFocusMovement(_ hint: UIFocusMovementHint) } @available(iOS 11.0, tvOS 11.0, *) diff --git a/iOS/UIKit/UIFontPickerViewController.swift b/iOS/UIKit/UIFontPickerViewController.swift index 7860611..1626895 100644 --- a/iOS/UIKit/UIFontPickerViewController.swift +++ b/iOS/UIKit/UIFontPickerViewController.swift @@ -1,8 +1,8 @@ @available(iOS 13.0, *) protocol UIFontPickerViewControllerDelegate : NSObjectProtocol { - @asyncHandler optional func fontPickerViewControllerDidCancel(_ viewController: UIFontPickerViewController) - @asyncHandler optional func fontPickerViewControllerDidPickFont(_ viewController: UIFontPickerViewController) + optional func fontPickerViewControllerDidCancel(_ viewController: UIFontPickerViewController) + optional func fontPickerViewControllerDidPickFont(_ viewController: UIFontPickerViewController) } @available(iOS 13.0, *) class UIFontPickerViewController : UIViewController { diff --git a/iOS/UIKit/UIGuidedAccess.swift b/iOS/UIKit/UIGuidedAccess.swift index 78e4558..67a6c75 100644 --- a/iOS/UIKit/UIGuidedAccess.swift +++ b/iOS/UIKit/UIGuidedAccess.swift @@ -24,7 +24,7 @@ extension UIAccessibility { @available(iOS 7.0, *) protocol UIGuidedAccessRestrictionDelegate : NSObjectProtocol { var guidedAccessRestrictionIdentifiers: [String]? { get } - @asyncHandler func guidedAccessRestriction(withIdentifier restrictionIdentifier: String, didChange newRestrictionState: UIAccessibility.GuidedAccessRestrictionState) + func guidedAccessRestriction(withIdentifier restrictionIdentifier: String, didChange newRestrictionState: UIAccessibility.GuidedAccessRestrictionState) func textForGuidedAccessRestriction(withIdentifier restrictionIdentifier: String) -> String? optional func detailTextForGuidedAccessRestriction(withIdentifier restrictionIdentifier: String) -> String? } diff --git a/iOS/UIKit/UIImagePickerController.swift b/iOS/UIKit/UIImagePickerController.swift index 7e90786..cbcd5dd 100644 --- a/iOS/UIKit/UIImagePickerController.swift +++ b/iOS/UIKit/UIImagePickerController.swift @@ -114,9 +114,9 @@ class UIImagePickerController : UINavigationController, NSCoding { } protocol UIImagePickerControllerDelegate : NSObjectProtocol { @available(iOS 2.0, *) - @asyncHandler optional func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) + optional func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) @available(iOS 2.0, *) - @asyncHandler optional func imagePickerControllerDidCancel(_ picker: UIImagePickerController) + optional func imagePickerControllerDidCancel(_ picker: UIImagePickerController) } func UIImageWriteToSavedPhotosAlbum(_ image: UIImage, _ completionTarget: Any?, _ completionSelector: Selector?, _ contextInfo: UnsafeMutableRawPointer?) @available(iOS 3.1, *) diff --git a/iOS/UIKit/UIIndirectScribbleInteraction.swift b/iOS/UIKit/UIIndirectScribbleInteraction.swift index 3cc55f8..56f445a 100644 --- a/iOS/UIKit/UIIndirectScribbleInteraction.swift +++ b/iOS/UIKit/UIIndirectScribbleInteraction.swift @@ -16,5 +16,5 @@ protocol __UIIndirectScribbleInteractionDelegate : NSObjectProtocol { func indirectScribbleInteraction(_ interaction: __UIIndirectScribbleInteraction, focusElementIfNeeded elementIdentifier: __UIScribbleElementIdentifier, referencePoint focusReferencePoint: CGPoint) async -> (UIResponder & UITextInput)? optional func indirectScribbleInteraction(_ interaction: __UIIndirectScribbleInteraction, shouldDelayFocusForElement elementIdentifier: __UIScribbleElementIdentifier) -> Bool optional func indirectScribbleInteraction(_ interaction: __UIIndirectScribbleInteraction, willBeginWritingInElement elementIdentifier: __UIScribbleElementIdentifier) - @asyncHandler optional func indirectScribbleInteraction(_ interaction: __UIIndirectScribbleInteraction, didFinishWritingInElement elementIdentifier: __UIScribbleElementIdentifier) + optional func indirectScribbleInteraction(_ interaction: __UIIndirectScribbleInteraction, didFinishWritingInElement elementIdentifier: __UIScribbleElementIdentifier) } diff --git a/iOS/UIKit/UIInteraction.swift b/iOS/UIKit/UIInteraction.swift index ee8e40a..ccdc2a0 100644 --- a/iOS/UIKit/UIInteraction.swift +++ b/iOS/UIKit/UIInteraction.swift @@ -3,7 +3,7 @@ protocol UIInteraction : NSObjectProtocol { weak var view: @sil_weak UIView? { get } func willMove(to view: UIView?) - @asyncHandler func didMove(to view: UIView?) + func didMove(to view: UIView?) } extension UIView { @available(iOS 11.0, *) diff --git a/iOS/UIKit/UILargeContentViewer.swift b/iOS/UIKit/UILargeContentViewer.swift index 81e96e9..92832e8 100644 --- a/iOS/UIKit/UILargeContentViewer.swift +++ b/iOS/UIKit/UILargeContentViewer.swift @@ -18,7 +18,7 @@ class UILargeContentViewerInteraction : NSObject, UIInteraction { } @available(iOS 13.0, *) protocol UILargeContentViewerInteractionDelegate : NSObjectProtocol { - @asyncHandler optional func largeContentViewerInteraction(_ interaction: UILargeContentViewerInteraction, didEndOn item: UILargeContentViewerItem?, at point: CGPoint) + optional func largeContentViewerInteraction(_ interaction: UILargeContentViewerInteraction, didEndOn item: UILargeContentViewerItem?, at point: CGPoint) optional func largeContentViewerInteraction(_ interaction: UILargeContentViewerInteraction, itemAt point: CGPoint) -> UILargeContentViewerItem? optional func viewController(for interaction: UILargeContentViewerInteraction) -> UIViewController } diff --git a/iOS/UIKit/UINavigationBar.swift b/iOS/UIKit/UINavigationBar.swift index bae039b..68422e6 100644 --- a/iOS/UIKit/UINavigationBar.swift +++ b/iOS/UIKit/UINavigationBar.swift @@ -48,9 +48,9 @@ protocol UINavigationBarDelegate : UIBarPositioningDelegate { @available(iOS 2.0, *) optional func navigationBar(_ navigationBar: UINavigationBar, shouldPush item: UINavigationItem) -> Bool @available(iOS 2.0, *) - @asyncHandler optional func navigationBar(_ navigationBar: UINavigationBar, didPush item: UINavigationItem) + optional func navigationBar(_ navigationBar: UINavigationBar, didPush item: UINavigationItem) @available(iOS 2.0, *) optional func navigationBar(_ navigationBar: UINavigationBar, shouldPop item: UINavigationItem) -> Bool @available(iOS 2.0, *) - @asyncHandler optional func navigationBar(_ navigationBar: UINavigationBar, didPop item: UINavigationItem) + optional func navigationBar(_ navigationBar: UINavigationBar, didPop item: UINavigationItem) } diff --git a/iOS/UIKit/UINavigationController.swift b/iOS/UIKit/UINavigationController.swift index de76da4..d8deb79 100644 --- a/iOS/UIKit/UINavigationController.swift +++ b/iOS/UIKit/UINavigationController.swift @@ -52,7 +52,7 @@ protocol UINavigationControllerDelegate : NSObjectProtocol { @available(iOS 2.0, *) optional func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) @available(iOS 2.0, *) - @asyncHandler optional func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) + optional func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) @available(iOS 7.0, *) optional func navigationControllerSupportedInterfaceOrientations(_ navigationController: UINavigationController) -> UIInterfaceOrientationMask @available(iOS 7.0, *) diff --git a/iOS/UIKit/UIPageViewController.swift b/iOS/UIKit/UIPageViewController.swift index d92413f..b3540fb 100644 --- a/iOS/UIKit/UIPageViewController.swift +++ b/iOS/UIKit/UIPageViewController.swift @@ -55,7 +55,7 @@ protocol UIPageViewControllerDelegate : NSObjectProtocol { @available(iOS 6.0, *) optional func pageViewController(_ pageViewController: UIPageViewController, willTransitionTo pendingViewControllers: [UIViewController]) @available(iOS 5.0, *) - @asyncHandler optional func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) + optional func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) @available(iOS 5.0, *) optional func pageViewController(_ pageViewController: UIPageViewController, spineLocationFor orientation: UIInterfaceOrientation) -> UIPageViewController.SpineLocation @available(iOS 7.0, *) diff --git a/iOS/UIKit/UIPencilInteraction.swift b/iOS/UIKit/UIPencilInteraction.swift index 6a2c01c..4d07237 100644 --- a/iOS/UIKit/UIPencilInteraction.swift +++ b/iOS/UIKit/UIPencilInteraction.swift @@ -17,5 +17,5 @@ class UIPencilInteraction : NSObject, UIInteraction { } @available(iOS 12.1, *) protocol UIPencilInteractionDelegate : NSObjectProtocol { - @asyncHandler optional func pencilInteractionDidTap(_ interaction: UIPencilInteraction) + optional func pencilInteractionDidTap(_ interaction: UIPencilInteraction) } diff --git a/iOS/UIKit/UIPickerView.swift b/iOS/UIKit/UIPickerView.swift index c06175b..af6f6fb 100644 --- a/iOS/UIKit/UIPickerView.swift +++ b/iOS/UIKit/UIPickerView.swift @@ -32,5 +32,5 @@ protocol UIPickerViewDelegate : NSObjectProtocol { @available(iOS 2.0, *) optional func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView @available(iOS 2.0, *) - @asyncHandler optional func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) + optional func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) } diff --git a/iOS/UIKit/UIPopoverController.swift b/iOS/UIKit/UIPopoverController.swift index e81b41f..6d88491 100644 --- a/iOS/UIKit/UIPopoverController.swift +++ b/iOS/UIKit/UIPopoverController.swift @@ -24,7 +24,7 @@ protocol UIPopoverControllerDelegate : NSObjectProtocol { @available(iOS, introduced: 3.2, deprecated: 9.0) optional func popoverControllerShouldDismissPopover(_ popoverController: UIPopoverController) -> Bool @available(iOS, introduced: 3.2, deprecated: 9.0) - @asyncHandler optional func popoverControllerDidDismissPopover(_ popoverController: UIPopoverController) + optional func popoverControllerDidDismissPopover(_ popoverController: UIPopoverController) @available(iOS, introduced: 7.0, deprecated: 9.0) optional func popoverController(_ popoverController: UIPopoverController, willRepositionPopoverTo rect: UnsafeMutablePointer, in view: AutoreleasingUnsafeMutablePointer) } diff --git a/iOS/UIKit/UIPopoverPresentationController.swift b/iOS/UIKit/UIPopoverPresentationController.swift index 0e631ea..379413f 100644 --- a/iOS/UIKit/UIPopoverPresentationController.swift +++ b/iOS/UIKit/UIPopoverPresentationController.swift @@ -5,7 +5,7 @@ protocol UIPopoverPresentationControllerDelegate : UIAdaptivePresentationControl @available(iOS, introduced: 8.0, deprecated: 13.0) optional func popoverPresentationControllerShouldDismissPopover(_ popoverPresentationController: UIPopoverPresentationController) -> Bool @available(iOS, introduced: 8.0, deprecated: 13.0) - @asyncHandler optional func popoverPresentationControllerDidDismissPopover(_ popoverPresentationController: UIPopoverPresentationController) + optional func popoverPresentationControllerDidDismissPopover(_ popoverPresentationController: UIPopoverPresentationController) @available(iOS 8.0, *) optional func popoverPresentationController(_ popoverPresentationController: UIPopoverPresentationController, willRepositionPopoverTo rect: UnsafeMutablePointer, in view: AutoreleasingUnsafeMutablePointer) } diff --git a/iOS/UIKit/UIPresentationController.swift b/iOS/UIKit/UIPresentationController.swift index df2ae51..9fb7b7f 100644 --- a/iOS/UIKit/UIPresentationController.swift +++ b/iOS/UIKit/UIPresentationController.swift @@ -13,9 +13,9 @@ protocol UIAdaptivePresentationControllerDelegate : NSObjectProtocol { @available(iOS 13.0, *) optional func presentationControllerWillDismiss(_ presentationController: UIPresentationController) @available(iOS 13.0, *) - @asyncHandler optional func presentationControllerDidDismiss(_ presentationController: UIPresentationController) + optional func presentationControllerDidDismiss(_ presentationController: UIPresentationController) @available(iOS 13.0, *) - @asyncHandler optional func presentationControllerDidAttemptToDismiss(_ presentationController: UIPresentationController) + optional func presentationControllerDidAttemptToDismiss(_ presentationController: UIPresentationController) } @available(iOS 8.0, *) class UIPresentationController : NSObject, UIAppearanceContainer, UITraitEnvironment, UIContentContainer, UIFocusEnvironment { diff --git a/iOS/UIKit/UIPreviewInteraction.swift b/iOS/UIKit/UIPreviewInteraction.swift index 4172c22..482a168 100644 --- a/iOS/UIKit/UIPreviewInteraction.swift +++ b/iOS/UIKit/UIPreviewInteraction.swift @@ -9,11 +9,11 @@ class UIPreviewInteraction : NSObject { } protocol UIPreviewInteractionDelegate : NSObjectProtocol { @available(iOS 10.0, *) - @asyncHandler func previewInteraction(_ previewInteraction: UIPreviewInteraction, didUpdatePreviewTransition transitionProgress: CGFloat, ended: Bool) + func previewInteraction(_ previewInteraction: UIPreviewInteraction, didUpdatePreviewTransition transitionProgress: CGFloat, ended: Bool) @available(iOS 10.0, *) - @asyncHandler func previewInteractionDidCancel(_ previewInteraction: UIPreviewInteraction) + func previewInteractionDidCancel(_ previewInteraction: UIPreviewInteraction) @available(iOS 10.0, *) optional func previewInteractionShouldBegin(_ previewInteraction: UIPreviewInteraction) -> Bool @available(iOS 10.0, *) - @asyncHandler optional func previewInteraction(_ previewInteraction: UIPreviewInteraction, didUpdateCommitTransition transitionProgress: CGFloat, ended: Bool) + optional func previewInteraction(_ previewInteraction: UIPreviewInteraction, didUpdateCommitTransition transitionProgress: CGFloat, ended: Bool) } diff --git a/iOS/UIKit/UIPrintInteractionController.swift b/iOS/UIKit/UIPrintInteractionController.swift index a3e39e2..2bb6a95 100644 --- a/iOS/UIKit/UIPrintInteractionController.swift +++ b/iOS/UIKit/UIPrintInteractionController.swift @@ -48,15 +48,15 @@ protocol UIPrintInteractionControllerDelegate : NSObjectProtocol { @available(iOS 4.2, *) optional func printInteractionControllerWillPresentPrinterOptions(_ printInteractionController: UIPrintInteractionController) @available(iOS 4.2, *) - @asyncHandler optional func printInteractionControllerDidPresentPrinterOptions(_ printInteractionController: UIPrintInteractionController) + optional func printInteractionControllerDidPresentPrinterOptions(_ printInteractionController: UIPrintInteractionController) @available(iOS 4.2, *) optional func printInteractionControllerWillDismissPrinterOptions(_ printInteractionController: UIPrintInteractionController) @available(iOS 4.2, *) - @asyncHandler optional func printInteractionControllerDidDismissPrinterOptions(_ printInteractionController: UIPrintInteractionController) + optional func printInteractionControllerDidDismissPrinterOptions(_ printInteractionController: UIPrintInteractionController) @available(iOS 4.2, *) optional func printInteractionControllerWillStartJob(_ printInteractionController: UIPrintInteractionController) @available(iOS 4.2, *) - @asyncHandler optional func printInteractionControllerDidFinishJob(_ printInteractionController: UIPrintInteractionController) + optional func printInteractionControllerDidFinishJob(_ printInteractionController: UIPrintInteractionController) @available(iOS 7.0, *) optional func printInteractionController(_ printInteractionController: UIPrintInteractionController, cutLengthFor paper: UIPrintPaper) -> CGFloat @available(iOS 9.0, *) diff --git a/iOS/UIKit/UIPrinterPickerController.swift b/iOS/UIKit/UIPrinterPickerController.swift index 0a04759..cbc411c 100644 --- a/iOS/UIKit/UIPrinterPickerController.swift +++ b/iOS/UIKit/UIPrinterPickerController.swift @@ -10,13 +10,13 @@ protocol UIPrinterPickerControllerDelegate : NSObjectProtocol { @available(iOS 8.0, *) optional func printerPickerControllerWillPresent(_ printerPickerController: UIPrinterPickerController) @available(iOS 8.0, *) - @asyncHandler optional func printerPickerControllerDidPresent(_ printerPickerController: UIPrinterPickerController) + optional func printerPickerControllerDidPresent(_ printerPickerController: UIPrinterPickerController) @available(iOS 8.0, *) optional func printerPickerControllerWillDismiss(_ printerPickerController: UIPrinterPickerController) @available(iOS 8.0, *) - @asyncHandler optional func printerPickerControllerDidDismiss(_ printerPickerController: UIPrinterPickerController) + optional func printerPickerControllerDidDismiss(_ printerPickerController: UIPrinterPickerController) @available(iOS 8.0, *) - @asyncHandler optional func printerPickerControllerDidSelectPrinter(_ printerPickerController: UIPrinterPickerController) + optional func printerPickerControllerDidSelectPrinter(_ printerPickerController: UIPrinterPickerController) } @available(iOS 8.0, *) class UIPrinterPickerController : NSObject { diff --git a/iOS/UIKit/UIScene.swift b/iOS/UIKit/UIScene.swift index 297cecf..2bf554a 100644 --- a/iOS/UIKit/UIScene.swift +++ b/iOS/UIKit/UIScene.swift @@ -13,17 +13,17 @@ class UIScene : UIResponder { @available(iOS 13.0, *) protocol UISceneDelegate : NSObjectProtocol { optional func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) - @asyncHandler optional func sceneDidDisconnect(_ scene: UIScene) - @asyncHandler optional func sceneDidBecomeActive(_ scene: UIScene) + optional func sceneDidDisconnect(_ scene: UIScene) + optional func sceneDidBecomeActive(_ scene: UIScene) optional func sceneWillResignActive(_ scene: UIScene) optional func sceneWillEnterForeground(_ scene: UIScene) - @asyncHandler optional func sceneDidEnterBackground(_ scene: UIScene) + optional func sceneDidEnterBackground(_ scene: UIScene) optional func scene(_ scene: UIScene, openURLContexts URLContexts: Set) optional func stateRestorationActivity(for scene: UIScene) -> NSUserActivity? optional func scene(_ scene: UIScene, willContinueUserActivityWithType userActivityType: String) optional func scene(_ scene: UIScene, continue userActivity: NSUserActivity) - @asyncHandler optional func scene(_ scene: UIScene, didFailToContinueUserActivityWithType userActivityType: String, error: Error) - @asyncHandler optional func scene(_ scene: UIScene, didUpdate userActivity: NSUserActivity) + optional func scene(_ scene: UIScene, didFailToContinueUserActivityWithType userActivityType: String, error: Error) + optional func scene(_ scene: UIScene, didUpdate userActivity: NSUserActivity) } extension UIScene { @available(iOS 13.0, *) diff --git a/iOS/UIKit/UIScribbleInteraction.swift b/iOS/UIKit/UIScribbleInteraction.swift index d16a515..b83a4cc 100644 --- a/iOS/UIKit/UIScribbleInteraction.swift +++ b/iOS/UIKit/UIScribbleInteraction.swift @@ -11,5 +11,5 @@ protocol UIScribbleInteractionDelegate : NSObjectProtocol { optional func scribbleInteraction(_ interaction: UIScribbleInteraction, shouldBeginAt location: CGPoint) -> Bool optional func scribbleInteractionShouldDelayFocus(_ interaction: UIScribbleInteraction) -> Bool optional func scribbleInteractionWillBeginWriting(_ interaction: UIScribbleInteraction) - @asyncHandler optional func scribbleInteractionDidFinishWriting(_ interaction: UIScribbleInteraction) + optional func scribbleInteractionDidFinishWriting(_ interaction: UIScribbleInteraction) } diff --git a/iOS/UIKit/UIScrollView.swift b/iOS/UIKit/UIScrollView.swift index aa115ba..735fa82 100644 --- a/iOS/UIKit/UIScrollView.swift +++ b/iOS/UIKit/UIScrollView.swift @@ -108,31 +108,31 @@ class UIScrollView : UIView, NSCoding, UIFocusItemScrollableContainer { } protocol UIScrollViewDelegate : NSObjectProtocol { @available(iOS 2.0, *) - @asyncHandler optional func scrollViewDidScroll(_ scrollView: UIScrollView) + optional func scrollViewDidScroll(_ scrollView: UIScrollView) @available(iOS 3.2, *) - @asyncHandler optional func scrollViewDidZoom(_ scrollView: UIScrollView) + optional func scrollViewDidZoom(_ scrollView: UIScrollView) @available(iOS 2.0, *) optional func scrollViewWillBeginDragging(_ scrollView: UIScrollView) @available(iOS 5.0, *) optional func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) @available(iOS 2.0, *) - @asyncHandler optional func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) + optional func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) @available(iOS 2.0, *) optional func scrollViewWillBeginDecelerating(_ scrollView: UIScrollView) @available(iOS 2.0, *) - @asyncHandler optional func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) + optional func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) @available(iOS 2.0, *) - @asyncHandler optional func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) + optional func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) @available(iOS 2.0, *) optional func viewForZooming(in scrollView: UIScrollView) -> UIView? @available(iOS 3.2, *) optional func scrollViewWillBeginZooming(_ scrollView: UIScrollView, with view: UIView?) @available(iOS 2.0, *) - @asyncHandler optional func scrollViewDidEndZooming(_ scrollView: UIScrollView, with view: UIView?, atScale scale: CGFloat) + optional func scrollViewDidEndZooming(_ scrollView: UIScrollView, with view: UIView?, atScale scale: CGFloat) @available(iOS 2.0, *) optional func scrollViewShouldScrollToTop(_ scrollView: UIScrollView) -> Bool @available(iOS 2.0, *) - @asyncHandler optional func scrollViewDidScrollToTop(_ scrollView: UIScrollView) + optional func scrollViewDidScrollToTop(_ scrollView: UIScrollView) @available(iOS 11.0, *) - @asyncHandler optional func scrollViewDidChangeAdjustedContentInset(_ scrollView: UIScrollView) + optional func scrollViewDidChangeAdjustedContentInset(_ scrollView: UIScrollView) } diff --git a/iOS/UIKit/UISearchBar.swift b/iOS/UIKit/UISearchBar.swift index 02948b6..27d07ee 100644 --- a/iOS/UIKit/UISearchBar.swift +++ b/iOS/UIKit/UISearchBar.swift @@ -89,11 +89,11 @@ protocol UISearchBarDelegate : UIBarPositioningDelegate { @available(iOS 2.0, *) optional func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool @available(iOS 2.0, *) - @asyncHandler optional func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) + optional func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) @available(iOS 2.0, *) optional func searchBarShouldEndEditing(_ searchBar: UISearchBar) -> Bool @available(iOS 2.0, *) - @asyncHandler optional func searchBarTextDidEndEditing(_ searchBar: UISearchBar) + optional func searchBarTextDidEndEditing(_ searchBar: UISearchBar) @available(iOS 2.0, *) optional func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) @available(iOS 3.0, *) diff --git a/iOS/UIKit/UISearchController.swift b/iOS/UIKit/UISearchController.swift index a8cb8ed..1e0ff3f 100644 --- a/iOS/UIKit/UISearchController.swift +++ b/iOS/UIKit/UISearchController.swift @@ -3,11 +3,11 @@ protocol UISearchControllerDelegate : NSObjectProtocol { @available(iOS 8.0, *) optional func willPresentSearchController(_ searchController: UISearchController) @available(iOS 8.0, *) - @asyncHandler optional func didPresentSearchController(_ searchController: UISearchController) + optional func didPresentSearchController(_ searchController: UISearchController) @available(iOS 8.0, *) optional func willDismissSearchController(_ searchController: UISearchController) @available(iOS 8.0, *) - @asyncHandler optional func didDismissSearchController(_ searchController: UISearchController) + optional func didDismissSearchController(_ searchController: UISearchController) @available(iOS 8.0, *) optional func presentSearchController(_ searchController: UISearchController) } diff --git a/iOS/UIKit/UISearchDisplayController.swift b/iOS/UIKit/UISearchDisplayController.swift index 18f4cf6..829200c 100644 --- a/iOS/UIKit/UISearchDisplayController.swift +++ b/iOS/UIKit/UISearchDisplayController.swift @@ -21,23 +21,23 @@ protocol UISearchDisplayDelegate : NSObjectProtocol { @available(iOS, introduced: 3.0, deprecated: 8.0) optional func searchDisplayControllerWillBeginSearch(_ controller: UISearchDisplayController) @available(iOS, introduced: 3.0, deprecated: 8.0) - @asyncHandler optional func searchDisplayControllerDidBeginSearch(_ controller: UISearchDisplayController) + optional func searchDisplayControllerDidBeginSearch(_ controller: UISearchDisplayController) @available(iOS, introduced: 3.0, deprecated: 8.0) optional func searchDisplayControllerWillEndSearch(_ controller: UISearchDisplayController) @available(iOS, introduced: 3.0, deprecated: 8.0) - @asyncHandler optional func searchDisplayControllerDidEndSearch(_ controller: UISearchDisplayController) + optional func searchDisplayControllerDidEndSearch(_ controller: UISearchDisplayController) @available(iOS, introduced: 3.0, deprecated: 8.0) - @asyncHandler optional func searchDisplayController(_ controller: UISearchDisplayController, didLoadSearchResultsTableView tableView: UITableView) + optional func searchDisplayController(_ controller: UISearchDisplayController, didLoadSearchResultsTableView tableView: UITableView) @available(iOS, introduced: 3.0, deprecated: 8.0) optional func searchDisplayController(_ controller: UISearchDisplayController, willUnloadSearchResultsTableView tableView: UITableView) @available(iOS, introduced: 3.0, deprecated: 8.0) optional func searchDisplayController(_ controller: UISearchDisplayController, willShowSearchResultsTableView tableView: UITableView) @available(iOS, introduced: 3.0, deprecated: 8.0) - @asyncHandler optional func searchDisplayController(_ controller: UISearchDisplayController, didShowSearchResultsTableView tableView: UITableView) + optional func searchDisplayController(_ controller: UISearchDisplayController, didShowSearchResultsTableView tableView: UITableView) @available(iOS, introduced: 3.0, deprecated: 8.0) optional func searchDisplayController(_ controller: UISearchDisplayController, willHideSearchResultsTableView tableView: UITableView) @available(iOS, introduced: 3.0, deprecated: 8.0) - @asyncHandler optional func searchDisplayController(_ controller: UISearchDisplayController, didHideSearchResultsTableView tableView: UITableView) + optional func searchDisplayController(_ controller: UISearchDisplayController, didHideSearchResultsTableView tableView: UITableView) @available(iOS, introduced: 3.0, deprecated: 8.0) optional func searchDisplayController(_ controller: UISearchDisplayController, shouldReloadTableForSearch searchString: String?) -> Bool @available(iOS, introduced: 3.0, deprecated: 8.0) diff --git a/iOS/UIKit/UISplitViewController.swift b/iOS/UIKit/UISplitViewController.swift index ea97dad..994d45d 100644 --- a/iOS/UIKit/UISplitViewController.swift +++ b/iOS/UIKit/UISplitViewController.swift @@ -155,9 +155,9 @@ protocol UISplitViewControllerDelegate { @available(iOS 14.0, *) optional func splitViewController(_ svc: UISplitViewController, displayModeForExpandingToProposedDisplayMode proposedDisplayMode: UISplitViewController.DisplayMode) -> UISplitViewController.DisplayMode @available(iOS 14.0, *) - @asyncHandler optional func splitViewControllerDidCollapse(_ svc: UISplitViewController) + optional func splitViewControllerDidCollapse(_ svc: UISplitViewController) @available(iOS 14.0, *) - @asyncHandler optional func splitViewControllerDidExpand(_ svc: UISplitViewController) + optional func splitViewControllerDidExpand(_ svc: UISplitViewController) @available(iOS 14.0, *) optional func splitViewController(_ svc: UISplitViewController, willShow column: UISplitViewController.Column) @available(iOS 14.0, *) @@ -165,7 +165,7 @@ protocol UISplitViewControllerDelegate { @available(iOS 14.0, *) optional func splitViewControllerInteractivePresentationGestureWillBegin(_ svc: UISplitViewController) @available(iOS 14.0, *) - @asyncHandler optional func splitViewControllerInteractivePresentationGestureDidEnd(_ svc: UISplitViewController) + optional func splitViewControllerInteractivePresentationGestureDidEnd(_ svc: UISplitViewController) } extension UIViewController { var splitViewController: UISplitViewController? { get } diff --git a/iOS/UIKit/UISpringLoadedInteraction.swift b/iOS/UIKit/UISpringLoadedInteraction.swift index f16b1ab..e315e86 100644 --- a/iOS/UIKit/UISpringLoadedInteraction.swift +++ b/iOS/UIKit/UISpringLoadedInteraction.swift @@ -18,11 +18,11 @@ class UISpringLoadedInteraction : NSObject, UIInteraction { @available(iOS 11.0, *) protocol UISpringLoadedInteractionBehavior : NSObjectProtocol { func shouldAllow(_ interaction: UISpringLoadedInteraction, with context: UISpringLoadedInteractionContext) -> Bool - @asyncHandler optional func interactionDidFinish(_ interaction: UISpringLoadedInteraction) + optional func interactionDidFinish(_ interaction: UISpringLoadedInteraction) } @available(iOS 11.0, *) protocol UISpringLoadedInteractionEffect : NSObjectProtocol { - @asyncHandler func interaction(_ interaction: UISpringLoadedInteraction, didChangeWith context: UISpringLoadedInteractionContext) + func interaction(_ interaction: UISpringLoadedInteraction, didChangeWith context: UISpringLoadedInteractionContext) } @available(iOS 11.0, *) protocol UISpringLoadedInteractionContext : NSObjectProtocol { diff --git a/iOS/UIKit/UITabBar.swift b/iOS/UIKit/UITabBar.swift index 506d750..2ee3fcf 100644 --- a/iOS/UIKit/UITabBar.swift +++ b/iOS/UIKit/UITabBar.swift @@ -45,15 +45,15 @@ class UITabBar : UIView { } protocol UITabBarDelegate : NSObjectProtocol { @available(iOS 2.0, *) - @asyncHandler optional func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) + optional func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) @available(iOS 2.0, *) optional func tabBar(_ tabBar: UITabBar, willBeginCustomizing items: [UITabBarItem]) @available(iOS 2.0, *) - @asyncHandler optional func tabBar(_ tabBar: UITabBar, didBeginCustomizing items: [UITabBarItem]) + optional func tabBar(_ tabBar: UITabBar, didBeginCustomizing items: [UITabBarItem]) @available(iOS 2.0, *) optional func tabBar(_ tabBar: UITabBar, willEndCustomizing items: [UITabBarItem], changed: Bool) @available(iOS 2.0, *) - @asyncHandler optional func tabBar(_ tabBar: UITabBar, didEndCustomizing items: [UITabBarItem], changed: Bool) + optional func tabBar(_ tabBar: UITabBar, didEndCustomizing items: [UITabBarItem], changed: Bool) } extension UITabBar : UISpringLoadedInteractionSupporting { } diff --git a/iOS/UIKit/UITabBarController.swift b/iOS/UIKit/UITabBarController.swift index d04bc0b..9fea8ab 100644 --- a/iOS/UIKit/UITabBarController.swift +++ b/iOS/UIKit/UITabBarController.swift @@ -15,13 +15,13 @@ protocol UITabBarControllerDelegate : NSObjectProtocol { @available(iOS 3.0, *) optional func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool @available(iOS 2.0, *) - @asyncHandler optional func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) + optional func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) @available(iOS 3.0, *) optional func tabBarController(_ tabBarController: UITabBarController, willBeginCustomizing viewControllers: [UIViewController]) @available(iOS 3.0, *) optional func tabBarController(_ tabBarController: UITabBarController, willEndCustomizing viewControllers: [UIViewController], changed: Bool) @available(iOS 2.0, *) - @asyncHandler optional func tabBarController(_ tabBarController: UITabBarController, didEndCustomizing viewControllers: [UIViewController], changed: Bool) + optional func tabBarController(_ tabBarController: UITabBarController, didEndCustomizing viewControllers: [UIViewController], changed: Bool) @available(iOS 7.0, *) optional func tabBarControllerSupportedInterfaceOrientations(_ tabBarController: UITabBarController) -> UIInterfaceOrientationMask @available(iOS 7.0, *) diff --git a/iOS/UIKit/UITableView.swift b/iOS/UIKit/UITableView.swift index ece0533..98e0f2c 100644 --- a/iOS/UIKit/UITableView.swift +++ b/iOS/UIKit/UITableView.swift @@ -72,11 +72,11 @@ protocol UITableViewDelegate : UIScrollViewDelegate { @available(iOS 6.0, *) optional func tableView(_ tableView: UITableView, willDisplayFooterView view: UIView, forSection section: Int) @available(iOS 6.0, *) - @asyncHandler optional func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) + optional func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) @available(iOS 6.0, *) - @asyncHandler optional func tableView(_ tableView: UITableView, didEndDisplayingHeaderView view: UIView, forSection section: Int) + optional func tableView(_ tableView: UITableView, didEndDisplayingHeaderView view: UIView, forSection section: Int) @available(iOS 6.0, *) - @asyncHandler optional func tableView(_ tableView: UITableView, didEndDisplayingFooterView view: UIView, forSection section: Int) + optional func tableView(_ tableView: UITableView, didEndDisplayingFooterView view: UIView, forSection section: Int) @available(iOS 2.0, *) optional func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat @available(iOS 2.0, *) @@ -98,17 +98,17 @@ protocol UITableViewDelegate : UIScrollViewDelegate { @available(iOS 6.0, *) optional func tableView(_ tableView: UITableView, shouldHighlightRowAt indexPath: IndexPath) -> Bool @available(iOS 6.0, *) - @asyncHandler optional func tableView(_ tableView: UITableView, didHighlightRowAt indexPath: IndexPath) + optional func tableView(_ tableView: UITableView, didHighlightRowAt indexPath: IndexPath) @available(iOS 6.0, *) - @asyncHandler optional func tableView(_ tableView: UITableView, didUnhighlightRowAt indexPath: IndexPath) + optional func tableView(_ tableView: UITableView, didUnhighlightRowAt indexPath: IndexPath) @available(iOS 2.0, *) optional func tableView(_ tableView: UITableView, willSelectRowAt indexPath: IndexPath) -> IndexPath? @available(iOS 3.0, *) optional func tableView(_ tableView: UITableView, willDeselectRowAt indexPath: IndexPath) -> IndexPath? @available(iOS 2.0, *) - @asyncHandler optional func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) + optional func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) @available(iOS 3.0, *) - @asyncHandler optional func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) + optional func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) @available(iOS 2.0, *) optional func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCell.EditingStyle @available(iOS 3.0, *) @@ -124,7 +124,7 @@ protocol UITableViewDelegate : UIScrollViewDelegate { @available(iOS 2.0, *) optional func tableView(_ tableView: UITableView, willBeginEditingRowAt indexPath: IndexPath) @available(iOS 2.0, *) - @asyncHandler optional func tableView(_ tableView: UITableView, didEndEditingRowAt indexPath: IndexPath?) + optional func tableView(_ tableView: UITableView, didEndEditingRowAt indexPath: IndexPath?) @available(iOS 2.0, *) optional func tableView(_ tableView: UITableView, targetIndexPathForMoveFromRowAt sourceIndexPath: IndexPath, toProposedIndexPath proposedDestinationIndexPath: IndexPath) -> IndexPath @available(iOS 2.0, *) @@ -140,7 +140,7 @@ protocol UITableViewDelegate : UIScrollViewDelegate { @available(iOS 9.0, *) optional func tableView(_ tableView: UITableView, shouldUpdateFocusIn context: UITableViewFocusUpdateContext) -> Bool @available(iOS 9.0, *) - @asyncHandler optional func tableView(_ tableView: UITableView, didUpdateFocusIn context: UITableViewFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) + optional func tableView(_ tableView: UITableView, didUpdateFocusIn context: UITableViewFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) @available(iOS 9.0, *) optional func indexPathForPreferredFocusedView(in tableView: UITableView) -> IndexPath? @available(iOS 11.0, *) @@ -148,9 +148,9 @@ protocol UITableViewDelegate : UIScrollViewDelegate { @available(iOS 13.0, *) optional func tableView(_ tableView: UITableView, shouldBeginMultipleSelectionInteractionAt indexPath: IndexPath) -> Bool @available(iOS 13.0, *) - @asyncHandler optional func tableView(_ tableView: UITableView, didBeginMultipleSelectionInteractionAt indexPath: IndexPath) + optional func tableView(_ tableView: UITableView, didBeginMultipleSelectionInteractionAt indexPath: IndexPath) @available(iOS 13.0, *) - @asyncHandler optional func tableViewDidEndMultipleSelectionInteraction(_ tableView: UITableView) + optional func tableViewDidEndMultipleSelectionInteraction(_ tableView: UITableView) @available(iOS 13.0, *) optional func tableView(_ tableView: UITableView, contextMenuConfigurationForRowAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? @available(iOS 13.0, *) diff --git a/iOS/UIKit/UITextField.swift b/iOS/UIKit/UITextField.swift index 017e6c6..8309224 100644 --- a/iOS/UIKit/UITextField.swift +++ b/iOS/UIKit/UITextField.swift @@ -50,17 +50,17 @@ protocol UITextFieldDelegate : NSObjectProtocol { @available(iOS 2.0, *) optional func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool @available(iOS 2.0, *) - @asyncHandler optional func textFieldDidBeginEditing(_ textField: UITextField) + optional func textFieldDidBeginEditing(_ textField: UITextField) @available(iOS 2.0, *) optional func textFieldShouldEndEditing(_ textField: UITextField) -> Bool @available(iOS 2.0, *) - @asyncHandler optional func textFieldDidEndEditing(_ textField: UITextField) + optional func textFieldDidEndEditing(_ textField: UITextField) @available(iOS 10.0, *) - @asyncHandler optional func textFieldDidEndEditing(_ textField: UITextField, reason: UITextField.DidEndEditingReason) + optional func textFieldDidEndEditing(_ textField: UITextField, reason: UITextField.DidEndEditingReason) @available(iOS 2.0, *) optional func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool @available(iOS 13.0, *) - @asyncHandler optional func textFieldDidChangeSelection(_ textField: UITextField) + optional func textFieldDidChangeSelection(_ textField: UITextField) @available(iOS 2.0, *) optional func textFieldShouldClear(_ textField: UITextField) -> Bool @available(iOS 2.0, *) diff --git a/iOS/UIKit/UITextInput.swift b/iOS/UIKit/UITextInput.swift index 1eff7ac..2303675 100644 --- a/iOS/UIKit/UITextInput.swift +++ b/iOS/UIKit/UITextInput.swift @@ -120,7 +120,7 @@ protocol UITextInput : UIKeyInput { optional var selectionAffinity: UITextStorageDirection { get set } @available(iOS 5.1, *) optional func insertDictationResult(_ dictationResult: [UIDictationPhrase]) - @asyncHandler optional func dictationRecordingDidEnd() + optional func dictationRecordingDidEnd() optional func dictationRecognitionFailed() optional var insertDictationResultPlaceholder: Any { get } optional func frame(forDictationResultPlaceholder placeholder: Any) -> CGRect @@ -164,9 +164,9 @@ class UITextSelectionRect : NSObject { } protocol UITextInputDelegate : NSObjectProtocol { func selectionWillChange(_ textInput: UITextInput?) - @asyncHandler func selectionDidChange(_ textInput: UITextInput?) + func selectionDidChange(_ textInput: UITextInput?) func textWillChange(_ textInput: UITextInput?) - @asyncHandler func textDidChange(_ textInput: UITextInput?) + func textDidChange(_ textInput: UITextInput?) } protocol UITextInputTokenizer : NSObjectProtocol { @available(iOS 3.2, *) diff --git a/iOS/UIKit/UITextInteraction.swift b/iOS/UIKit/UITextInteraction.swift index 707a812..ee76033 100644 --- a/iOS/UIKit/UITextInteraction.swift +++ b/iOS/UIKit/UITextInteraction.swift @@ -11,7 +11,7 @@ protocol UITextInteractionDelegate : NSObjectProtocol { @available(iOS 13.0, *) optional func interactionWillBegin(_ interaction: UITextInteraction) @available(iOS 13.0, *) - @asyncHandler optional func interactionDidEnd(_ interaction: UITextInteraction) + optional func interactionDidEnd(_ interaction: UITextInteraction) } @available(iOS 13.0, *) class UITextInteraction : NSObject, UIInteraction { diff --git a/iOS/UIKit/UITextView.swift b/iOS/UIKit/UITextView.swift index 5842545..fe6c3e5 100644 --- a/iOS/UIKit/UITextView.swift +++ b/iOS/UIKit/UITextView.swift @@ -5,15 +5,15 @@ protocol UITextViewDelegate : UIScrollViewDelegate { @available(iOS 2.0, *) optional func textViewShouldEndEditing(_ textView: UITextView) -> Bool @available(iOS 2.0, *) - @asyncHandler optional func textViewDidBeginEditing(_ textView: UITextView) + optional func textViewDidBeginEditing(_ textView: UITextView) @available(iOS 2.0, *) - @asyncHandler optional func textViewDidEndEditing(_ textView: UITextView) + optional func textViewDidEndEditing(_ textView: UITextView) @available(iOS 2.0, *) optional func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool @available(iOS 2.0, *) - @asyncHandler optional func textViewDidChange(_ textView: UITextView) + optional func textViewDidChange(_ textView: UITextView) @available(iOS 2.0, *) - @asyncHandler optional func textViewDidChangeSelection(_ textView: UITextView) + optional func textViewDidChangeSelection(_ textView: UITextView) @available(iOS 10.0, *) optional func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool @available(iOS 10.0, *) diff --git a/iOS/UIKit/UITraitCollection.swift b/iOS/UIKit/UITraitCollection.swift index 2358ade..49f572e 100644 --- a/iOS/UIKit/UITraitCollection.swift +++ b/iOS/UIKit/UITraitCollection.swift @@ -52,7 +52,7 @@ protocol UITraitEnvironment : NSObjectProtocol { @available(iOS 8.0, *) var traitCollection: UITraitCollection { get } @available(iOS 8.0, *) - @asyncHandler func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) + func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) } extension UITraitCollection { @available(iOS 13.0, *) diff --git a/iOS/UIKit/UIVideoEditorController.swift b/iOS/UIKit/UIVideoEditorController.swift index 3a0bfff..74c9bc0 100644 --- a/iOS/UIKit/UIVideoEditorController.swift +++ b/iOS/UIKit/UIVideoEditorController.swift @@ -9,9 +9,9 @@ class UIVideoEditorController : UINavigationController { } protocol UIVideoEditorControllerDelegate : NSObjectProtocol { @available(iOS 3.1, *) - @asyncHandler optional func videoEditorController(_ editor: UIVideoEditorController, didSaveEditedVideoToPath editedVideoPath: String) + optional func videoEditorController(_ editor: UIVideoEditorController, didSaveEditedVideoToPath editedVideoPath: String) @available(iOS 3.1, *) - @asyncHandler optional func videoEditorController(_ editor: UIVideoEditorController, didFailWithError error: Error) + optional func videoEditorController(_ editor: UIVideoEditorController, didFailWithError error: Error) @available(iOS 3.1, *) - @asyncHandler optional func videoEditorControllerDidCancel(_ editor: UIVideoEditorController) + optional func videoEditorControllerDidCancel(_ editor: UIVideoEditorController) } diff --git a/iOS/UIKit/UIViewController.swift b/iOS/UIKit/UIViewController.swift index fb090d9..8c5ad6c 100644 --- a/iOS/UIKit/UIViewController.swift +++ b/iOS/UIKit/UIViewController.swift @@ -35,9 +35,9 @@ protocol UIContentContainer : NSObjectProtocol { @available(iOS 8.0, *) var preferredContentSize: CGSize { get } @available(iOS 8.0, *) - @asyncHandler func preferredContentSizeDidChange(forChildContentContainer container: UIContentContainer) + func preferredContentSizeDidChange(forChildContentContainer container: UIContentContainer) @available(iOS 8.0, *) - @asyncHandler func systemLayoutFittingSizeDidChange(forChildContentContainer container: UIContentContainer) + func systemLayoutFittingSizeDidChange(forChildContentContainer container: UIContentContainer) @available(iOS 8.0, *) func size(forChildContentContainer container: UIContentContainer, withParentContainerSize parentSize: CGSize) -> CGSize @available(iOS 8.0, *) diff --git a/iOS/UIKit/UIWebView.swift b/iOS/UIKit/UIWebView.swift index 1813ee0..bb168f8 100644 --- a/iOS/UIKit/UIWebView.swift +++ b/iOS/UIKit/UIWebView.swift @@ -75,9 +75,9 @@ protocol UIWebViewDelegate : NSObjectProtocol { @available(iOS, introduced: 2.0, deprecated: 12.0, message: "No longer supported.") optional func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebView.NavigationType) -> Bool @available(iOS, introduced: 2.0, deprecated: 12.0, message: "No longer supported.") - @asyncHandler optional func webViewDidStartLoad(_ webView: UIWebView) + optional func webViewDidStartLoad(_ webView: UIWebView) @available(iOS, introduced: 2.0, deprecated: 12.0, message: "No longer supported.") - @asyncHandler optional func webViewDidFinishLoad(_ webView: UIWebView) + optional func webViewDidFinishLoad(_ webView: UIWebView) @available(iOS, introduced: 2.0, deprecated: 12.0, message: "No longer supported.") - @asyncHandler optional func webView(_ webView: UIWebView, didFailLoadWithError error: Error) + optional func webView(_ webView: UIWebView, didFailLoadWithError error: Error) } diff --git a/iOS/UIKit/UIWindowScene.swift b/iOS/UIKit/UIWindowScene.swift index 485e510..53a9c49 100644 --- a/iOS/UIKit/UIWindowScene.swift +++ b/iOS/UIKit/UIWindowScene.swift @@ -12,7 +12,7 @@ class UIWindowScene : UIScene { @available(iOS 13.0, *) protocol UIWindowSceneDelegate : UISceneDelegate { optional var window: UIWindow? { get set } - @asyncHandler optional func windowScene(_ windowScene: UIWindowScene, didUpdate previousCoordinateSpace: UICoordinateSpace, interfaceOrientation previousInterfaceOrientation: UIInterfaceOrientation, traitCollection previousTraitCollection: UITraitCollection) + optional func windowScene(_ windowScene: UIWindowScene, didUpdate previousCoordinateSpace: UICoordinateSpace, interfaceOrientation previousInterfaceOrientation: UIInterfaceOrientation, traitCollection previousTraitCollection: UITraitCollection) optional func windowScene(_ windowScene: UIWindowScene, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) optional func windowScene(_ windowScene: UIWindowScene, performActionFor shortcutItem: UIApplicationShortcutItem) async -> Bool } diff --git a/iOS/UserNotifications/UNUserNotificationCenter.swift b/iOS/UserNotifications/UNUserNotificationCenter.swift index 7660c79..90216ee 100644 --- a/iOS/UserNotifications/UNUserNotificationCenter.swift +++ b/iOS/UserNotifications/UNUserNotificationCenter.swift @@ -59,7 +59,7 @@ protocol UNUserNotificationCenterDelegate : NSObjectProtocol { @available(iOS 10.0, *) optional func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification) async -> UNNotificationPresentationOptions @available(iOS 10.0, *) - @asyncHandler optional func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) + optional func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) @available(iOS 10.0, *) optional func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async @available(iOS 12.0, *) diff --git a/iOS/UserNotificationsUI/UNNotificationContentExtension.swift b/iOS/UserNotificationsUI/UNNotificationContentExtension.swift index 17603c9..c5b5af0 100644 --- a/iOS/UserNotificationsUI/UNNotificationContentExtension.swift +++ b/iOS/UserNotificationsUI/UNNotificationContentExtension.swift @@ -17,8 +17,8 @@ enum UNNotificationContentExtensionResponseOption : UInt { } @available(iOS 10.0, *) protocol UNNotificationContentExtension : NSObjectProtocol { - @asyncHandler func didReceive(_ notification: UNNotification) - @asyncHandler optional func didReceive(_ response: UNNotificationResponse, completionHandler completion: @escaping (UNNotificationContentExtensionResponseOption) -> Void) + func didReceive(_ notification: UNNotification) + optional func didReceive(_ response: UNNotificationResponse, completionHandler completion: @escaping (UNNotificationContentExtensionResponseOption) -> Void) optional func didReceive(_ response: UNNotificationResponse) async -> UNNotificationContentExtensionResponseOption optional var mediaPlayPauseButtonType: UNNotificationContentExtensionMediaPlayPauseButtonType { get } optional var mediaPlayPauseButtonFrame: CGRect { get } diff --git a/iOS/VisionKit/VNDocumentCameraViewController.swift b/iOS/VisionKit/VNDocumentCameraViewController.swift index 1fc482c..570f934 100644 --- a/iOS/VisionKit/VNDocumentCameraViewController.swift +++ b/iOS/VisionKit/VNDocumentCameraViewController.swift @@ -6,7 +6,7 @@ class VNDocumentCameraViewController : UIViewController { } @available(iOS 13.0, *) protocol VNDocumentCameraViewControllerDelegate : NSObjectProtocol { - @asyncHandler optional func documentCameraViewController(_ controller: VNDocumentCameraViewController, didFinishWith scan: VNDocumentCameraScan) - @asyncHandler optional func documentCameraViewControllerDidCancel(_ controller: VNDocumentCameraViewController) - @asyncHandler optional func documentCameraViewController(_ controller: VNDocumentCameraViewController, didFailWithError error: Error) + optional func documentCameraViewController(_ controller: VNDocumentCameraViewController, didFinishWith scan: VNDocumentCameraScan) + optional func documentCameraViewControllerDidCancel(_ controller: VNDocumentCameraViewController) + optional func documentCameraViewController(_ controller: VNDocumentCameraViewController, didFailWithError error: Error) } diff --git a/iOS/WatchConnectivity/WCSession.swift b/iOS/WatchConnectivity/WCSession.swift index 55c3233..f4f0d9f 100644 --- a/iOS/WatchConnectivity/WCSession.swift +++ b/iOS/WatchConnectivity/WCSession.swift @@ -39,29 +39,29 @@ protocol WCSessionDelegate : NSObjectProtocol { @available(iOS 9.3, *) func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) @available(iOS 9.3, *) - @asyncHandler func sessionDidBecomeInactive(_ session: WCSession) + func sessionDidBecomeInactive(_ session: WCSession) @available(iOS 9.3, *) - @asyncHandler func sessionDidDeactivate(_ session: WCSession) + func sessionDidDeactivate(_ session: WCSession) @available(iOS 9.0, *) - @asyncHandler optional func sessionWatchStateDidChange(_ session: WCSession) + optional func sessionWatchStateDidChange(_ session: WCSession) @available(iOS 9.0, *) - @asyncHandler optional func sessionReachabilityDidChange(_ session: WCSession) + optional func sessionReachabilityDidChange(_ session: WCSession) @available(iOS 9.0, *) - @asyncHandler optional func session(_ session: WCSession, didReceiveMessage message: [String : Any]) + optional func session(_ session: WCSession, didReceiveMessage message: [String : Any]) @available(iOS 9.0, *) - @asyncHandler optional func session(_ session: WCSession, didReceiveMessage message: [String : Any], replyHandler: @escaping ([String : Any]) -> Void) + optional func session(_ session: WCSession, didReceiveMessage message: [String : Any], replyHandler: @escaping ([String : Any]) -> Void) @available(iOS 9.0, *) - @asyncHandler optional func session(_ session: WCSession, didReceiveMessageData messageData: Data) + optional func session(_ session: WCSession, didReceiveMessageData messageData: Data) @available(iOS 9.0, *) - @asyncHandler optional func session(_ session: WCSession, didReceiveMessageData messageData: Data, replyHandler: @escaping (Data) -> Void) + optional func session(_ session: WCSession, didReceiveMessageData messageData: Data, replyHandler: @escaping (Data) -> Void) @available(iOS 9.0, *) - @asyncHandler optional func session(_ session: WCSession, didReceiveApplicationContext applicationContext: [String : Any]) + optional func session(_ session: WCSession, didReceiveApplicationContext applicationContext: [String : Any]) @available(iOS 9.0, *) - @asyncHandler optional func session(_ session: WCSession, didFinish userInfoTransfer: WCSessionUserInfoTransfer, error: Error?) + optional func session(_ session: WCSession, didFinish userInfoTransfer: WCSessionUserInfoTransfer, error: Error?) @available(iOS 9.0, *) - @asyncHandler optional func session(_ session: WCSession, didReceiveUserInfo userInfo: [String : Any] = [:]) + optional func session(_ session: WCSession, didReceiveUserInfo userInfo: [String : Any] = [:]) @available(iOS 9.0, *) - @asyncHandler optional func session(_ session: WCSession, didFinish fileTransfer: WCSessionFileTransfer, error: Error?) + optional func session(_ session: WCSession, didFinish fileTransfer: WCSessionFileTransfer, error: Error?) @available(iOS 9.0, *) - @asyncHandler optional func session(_ session: WCSession, didReceive file: WCSessionFile) + optional func session(_ session: WCSession, didReceive file: WCSessionFile) } diff --git a/iOS/WebKit/WKHTTPCookieStore.swift b/iOS/WebKit/WKHTTPCookieStore.swift index 62e6489..7e6795f 100644 --- a/iOS/WebKit/WKHTTPCookieStore.swift +++ b/iOS/WebKit/WKHTTPCookieStore.swift @@ -1,7 +1,7 @@ @available(iOS 11.0, *) protocol WKHTTPCookieStoreObserver : NSObjectProtocol { - @asyncHandler optional func cookiesDidChange(in cookieStore: WKHTTPCookieStore) + optional func cookiesDidChange(in cookieStore: WKHTTPCookieStore) } @available(iOS 11.0, *) class WKHTTPCookieStore : NSObject { diff --git a/iOS/WebKit/WKNavigationDelegate.swift b/iOS/WebKit/WKNavigationDelegate.swift index 0ae3095..f49f9fd 100644 --- a/iOS/WebKit/WKNavigationDelegate.swift +++ b/iOS/WebKit/WKNavigationDelegate.swift @@ -21,23 +21,23 @@ protocol WKNavigationDelegate : NSObjectProtocol { @available(iOS 8.0, *) optional func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void) @available(iOS 8.0, *) - @asyncHandler optional func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) + optional func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) @available(iOS 8.0, *) - @asyncHandler optional func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) + optional func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) @available(iOS 8.0, *) - @asyncHandler optional func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) + optional func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) @available(iOS 8.0, *) - @asyncHandler optional func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) + optional func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) @available(iOS 8.0, *) - @asyncHandler optional func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) + optional func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) @available(iOS 8.0, *) - @asyncHandler optional func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) + optional func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) @available(iOS 8.0, *) - @asyncHandler optional func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) @available(iOS 8.0, *) optional func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) @available(iOS 9.0, *) - @asyncHandler optional func webViewWebContentProcessDidTerminate(_ webView: WKWebView) + optional func webViewWebContentProcessDidTerminate(_ webView: WKWebView) @available(iOS 14.0, *) optional func webView(_ webView: WKWebView, authenticationChallenge challenge: URLAuthenticationChallenge, shouldAllowDeprecatedTLS decisionHandler: @escaping (Bool) -> Void) } diff --git a/iOS/WebKit/WKScriptMessageHandler.swift b/iOS/WebKit/WKScriptMessageHandler.swift index ad44949..5353228 100644 --- a/iOS/WebKit/WKScriptMessageHandler.swift +++ b/iOS/WebKit/WKScriptMessageHandler.swift @@ -1,5 +1,5 @@ protocol WKScriptMessageHandler : NSObjectProtocol { @available(iOS 8.0, *) - @asyncHandler func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) + func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) } diff --git a/iOS/WebKit/WKScriptMessageHandlerWithReply.swift b/iOS/WebKit/WKScriptMessageHandlerWithReply.swift index f44e724..c1e8c04 100644 --- a/iOS/WebKit/WKScriptMessageHandlerWithReply.swift +++ b/iOS/WebKit/WKScriptMessageHandlerWithReply.swift @@ -1,5 +1,5 @@ protocol WKScriptMessageHandlerWithReply : NSObjectProtocol { @available(iOS 14.0, *) - @asyncHandler func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage, replyHandler: @escaping (Any?, String?) -> Void) + func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage, replyHandler: @escaping (Any?, String?) -> Void) } diff --git a/iOS/WebKit/WKUIDelegate.swift b/iOS/WebKit/WKUIDelegate.swift index 5752bd3..2c56689 100644 --- a/iOS/WebKit/WKUIDelegate.swift +++ b/iOS/WebKit/WKUIDelegate.swift @@ -3,7 +3,7 @@ protocol WKUIDelegate : NSObjectProtocol { @available(iOS 8.0, *) optional func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? @available(iOS 9.0, *) - @asyncHandler optional func webViewDidClose(_ webView: WKWebView) + optional func webViewDidClose(_ webView: WKWebView) @available(iOS 8.0, *) optional func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -> Void) @available(iOS 8.0, *) diff --git a/iOS/WebKit/WKURLSchemeTask.swift b/iOS/WebKit/WKURLSchemeTask.swift index 6457622..f23b5f4 100644 --- a/iOS/WebKit/WKURLSchemeTask.swift +++ b/iOS/WebKit/WKURLSchemeTask.swift @@ -2,8 +2,8 @@ @available(iOS 11.0, *) protocol WKURLSchemeTask : NSObjectProtocol { var request: URLRequest { get } - @asyncHandler func didReceive(_ response: URLResponse) - @asyncHandler func didReceive(_ data: Data) - @asyncHandler func didFinish() - @asyncHandler func didFailWithError(_ error: Error) + func didReceive(_ response: URLResponse) + func didReceive(_ data: Data) + func didFinish() + func didFailWithError(_ error: Error) } diff --git a/iOS/iAd/ADBannerView.swift b/iOS/iAd/ADBannerView.swift index 2e77a2f..0ccf87e 100644 --- a/iOS/iAd/ADBannerView.swift +++ b/iOS/iAd/ADBannerView.swift @@ -41,10 +41,10 @@ class ADBannerView : UIView { protocol ADBannerViewDelegate : NSObjectProtocol { @available(iOS 5.0, *) optional func bannerViewWillLoadAd(_ banner: ADBannerView) - @asyncHandler optional func bannerViewDidLoadAd(_ banner: ADBannerView) - @asyncHandler optional func bannerView(_ banner: ADBannerView, didFailToReceiveAdWithError error: Error) + optional func bannerViewDidLoadAd(_ banner: ADBannerView) + optional func bannerView(_ banner: ADBannerView, didFailToReceiveAdWithError error: Error) optional func bannerViewActionShouldBegin(_ banner: ADBannerView, willLeaveApplication willLeave: Bool) -> Bool - @asyncHandler optional func bannerViewActionDidFinish(_ banner: ADBannerView) + optional func bannerViewActionDidFinish(_ banner: ADBannerView) } @available(iOS, introduced: 12.0, deprecated: 13.0) func ADClampedBannerSize(_ size: CGSize) -> CGSize diff --git a/iOS/iAd/ADInterstitialAd.swift b/iOS/iAd/ADInterstitialAd.swift index f2ceb8e..c5bb5c0 100644 --- a/iOS/iAd/ADInterstitialAd.swift +++ b/iOS/iAd/ADInterstitialAd.swift @@ -10,13 +10,13 @@ class ADInterstitialAd : NSObject { } @available(iOS, introduced: 4.3, deprecated: 10.0) protocol ADInterstitialAdDelegate : NSObjectProtocol { - @asyncHandler func interstitialAdDidUnload(_ interstitialAd: ADInterstitialAd) - @asyncHandler func interstitialAd(_ interstitialAd: ADInterstitialAd, didFailWithError error: Error) + func interstitialAdDidUnload(_ interstitialAd: ADInterstitialAd) + func interstitialAd(_ interstitialAd: ADInterstitialAd, didFailWithError error: Error) @available(iOS 5.0, *) optional func interstitialAdWillLoad(_ interstitialAd: ADInterstitialAd) - @asyncHandler optional func interstitialAdDidLoad(_ interstitialAd: ADInterstitialAd) + optional func interstitialAdDidLoad(_ interstitialAd: ADInterstitialAd) optional func interstitialAdActionShouldBegin(_ interstitialAd: ADInterstitialAd, willLeaveApplication willLeave: Bool) -> Bool - @asyncHandler optional func interstitialAdActionDidFinish(_ interstitialAd: ADInterstitialAd) + optional func interstitialAdActionDidFinish(_ interstitialAd: ADInterstitialAd) } @available(iOS, introduced: 12.0, deprecated: 13.0) class ADInterstitialAdPresentationViewController : UIViewController { diff --git a/macOS/AVFoundation/AVAssetResourceLoader.swift b/macOS/AVFoundation/AVAssetResourceLoader.swift index 27f68c3..3701088 100644 --- a/macOS/AVFoundation/AVAssetResourceLoader.swift +++ b/macOS/AVFoundation/AVAssetResourceLoader.swift @@ -11,11 +11,11 @@ protocol AVAssetResourceLoaderDelegate : NSObjectProtocol { @available(macOS 10.10, *) optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForRenewalOfRequestedResource renewalRequest: AVAssetResourceRenewalRequest) -> Bool @available(macOS 10.9, *) - @asyncHandler optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel loadingRequest: AVAssetResourceLoadingRequest) + optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel loadingRequest: AVAssetResourceLoadingRequest) @available(macOS 10.10, *) optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForResponseTo authenticationChallenge: URLAuthenticationChallenge) -> Bool @available(macOS 10.10, *) - @asyncHandler optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel authenticationChallenge: URLAuthenticationChallenge) + optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel authenticationChallenge: URLAuthenticationChallenge) } @available(macOS 10.14, *) class AVAssetResourceLoadingRequestor : NSObject { diff --git a/macOS/AVFoundation/AVAssetWriter.swift b/macOS/AVFoundation/AVAssetWriter.swift index c805e6f..8576157 100644 --- a/macOS/AVFoundation/AVAssetWriter.swift +++ b/macOS/AVFoundation/AVAssetWriter.swift @@ -76,6 +76,6 @@ extension AVAssetWriter { } @available(macOS 11.0, *) protocol AVAssetWriterDelegate : NSObjectProtocol { - @asyncHandler optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType, segmentReport: AVAssetSegmentReport?) - @asyncHandler optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType) + optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType, segmentReport: AVAssetSegmentReport?) + optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType) } diff --git a/macOS/AVFoundation/AVCaptureAudioDataOutput.swift b/macOS/AVFoundation/AVCaptureAudioDataOutput.swift index 177c9f1..9337806 100644 --- a/macOS/AVFoundation/AVCaptureAudioDataOutput.swift +++ b/macOS/AVFoundation/AVCaptureAudioDataOutput.swift @@ -10,5 +10,5 @@ class AVCaptureAudioDataOutput : AVCaptureOutput { } @available(macOS 10.7, *) protocol AVCaptureAudioDataOutputSampleBufferDelegate : NSObjectProtocol { - @asyncHandler optional func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) + optional func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) } diff --git a/macOS/AVFoundation/AVCaptureFileOutput.swift b/macOS/AVFoundation/AVCaptureFileOutput.swift index 5a45a7f..e3699f0 100644 --- a/macOS/AVFoundation/AVCaptureFileOutput.swift +++ b/macOS/AVFoundation/AVCaptureFileOutput.swift @@ -17,17 +17,17 @@ class AVCaptureFileOutput : AVCaptureOutput { } @available(macOS 10.7, *) protocol AVCaptureFileOutputRecordingDelegate : NSObjectProtocol { - @asyncHandler optional func fileOutput(_ output: AVCaptureFileOutput, didStartRecordingTo fileURL: URL, from connections: [AVCaptureConnection]) - @asyncHandler optional func fileOutput(_ output: AVCaptureFileOutput, didPauseRecordingTo fileURL: URL, from connections: [AVCaptureConnection]) - @asyncHandler optional func fileOutput(_ output: AVCaptureFileOutput, didResumeRecordingTo fileURL: URL, from connections: [AVCaptureConnection]) + optional func fileOutput(_ output: AVCaptureFileOutput, didStartRecordingTo fileURL: URL, from connections: [AVCaptureConnection]) + optional func fileOutput(_ output: AVCaptureFileOutput, didPauseRecordingTo fileURL: URL, from connections: [AVCaptureConnection]) + optional func fileOutput(_ output: AVCaptureFileOutput, didResumeRecordingTo fileURL: URL, from connections: [AVCaptureConnection]) optional func fileOutput(_ output: AVCaptureFileOutput, willFinishRecordingTo fileURL: URL, from connections: [AVCaptureConnection], error: Error?) - @asyncHandler func fileOutput(_ output: AVCaptureFileOutput, didFinishRecordingTo outputFileURL: URL, from connections: [AVCaptureConnection], error: Error?) + func fileOutput(_ output: AVCaptureFileOutput, didFinishRecordingTo outputFileURL: URL, from connections: [AVCaptureConnection], error: Error?) } @available(macOS 10.7, *) protocol AVCaptureFileOutputDelegate : NSObjectProtocol { @available(macOS 10.8, *) func fileOutputShouldProvideSampleAccurateRecordingStart(_ output: AVCaptureFileOutput) -> Bool - @asyncHandler optional func fileOutput(_ output: AVCaptureFileOutput, didOutputSampleBuffer sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) + optional func fileOutput(_ output: AVCaptureFileOutput, didOutputSampleBuffer sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) } @available(macOS 10.7, *) class AVCaptureMovieFileOutput : AVCaptureFileOutput { diff --git a/macOS/AVFoundation/AVCapturePhotoOutput.swift b/macOS/AVFoundation/AVCapturePhotoOutput.swift index 6892225..9219df1 100644 --- a/macOS/AVFoundation/AVCapturePhotoOutput.swift +++ b/macOS/AVFoundation/AVCapturePhotoOutput.swift @@ -23,9 +23,9 @@ extension AVCapturePhotoOutput { protocol AVCapturePhotoCaptureDelegate : NSObjectProtocol { optional func photoOutput(_ output: AVCapturePhotoOutput, willBeginCaptureFor resolvedSettings: AVCaptureResolvedPhotoSettings) optional func photoOutput(_ output: AVCapturePhotoOutput, willCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings) - @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings) - @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) - @asyncHandler optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishCaptureFor resolvedSettings: AVCaptureResolvedPhotoSettings, error: Error?) + optional func photoOutput(_ output: AVCapturePhotoOutput, didCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings) + optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) + optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishCaptureFor resolvedSettings: AVCaptureResolvedPhotoSettings, error: Error?) } @available(macOS 10.15, *) class AVCapturePhotoSettings : NSObject, NSCopying { diff --git a/macOS/AVFoundation/AVCaptureVideoDataOutput.swift b/macOS/AVFoundation/AVCaptureVideoDataOutput.swift index b8ecd9b..a326660 100644 --- a/macOS/AVFoundation/AVCaptureVideoDataOutput.swift +++ b/macOS/AVFoundation/AVCaptureVideoDataOutput.swift @@ -22,6 +22,6 @@ extension AVCaptureVideoDataOutput { } @available(macOS 10.7, *) protocol AVCaptureVideoDataOutputSampleBufferDelegate : NSObjectProtocol { - @asyncHandler optional func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) - @asyncHandler optional func captureOutput(_ output: AVCaptureOutput, didDrop sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) + optional func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) + optional func captureOutput(_ output: AVCaptureOutput, didDrop sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) } diff --git a/macOS/AVFoundation/AVContentKeySession.swift b/macOS/AVFoundation/AVContentKeySession.swift index fb836c0..5a2294b 100644 --- a/macOS/AVFoundation/AVContentKeySession.swift +++ b/macOS/AVFoundation/AVContentKeySession.swift @@ -89,18 +89,18 @@ extension AVContentKeyRequest.RetryReason { } @available(macOS 10.12.4, *) protocol AVContentKeySessionDelegate : NSObjectProtocol { - @asyncHandler func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest) - @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didProvideRenewingContentKeyRequest keyRequest: AVContentKeyRequest) - @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVPersistableContentKeyRequest) + func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest) + optional func contentKeySession(_ session: AVContentKeySession, didProvideRenewingContentKeyRequest keyRequest: AVContentKeyRequest) + optional func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVPersistableContentKeyRequest) @available(macOS 10.15, *) - @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didUpdatePersistableContentKey persistableContentKey: Data, forContentKeyIdentifier keyIdentifier: Any) - @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequest keyRequest: AVContentKeyRequest, didFailWithError err: Error) + optional func contentKeySession(_ session: AVContentKeySession, didUpdatePersistableContentKey persistableContentKey: Data, forContentKeyIdentifier keyIdentifier: Any) + optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequest keyRequest: AVContentKeyRequest, didFailWithError err: Error) optional func contentKeySession(_ session: AVContentKeySession, shouldRetry keyRequest: AVContentKeyRequest, reason retryReason: AVContentKeyRequest.RetryReason) -> Bool @available(macOS 10.14, *) optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequestDidSucceed keyRequest: AVContentKeyRequest) - @asyncHandler optional func contentKeySessionContentProtectionSessionIdentifierDidChange(_ session: AVContentKeySession) + optional func contentKeySessionContentProtectionSessionIdentifierDidChange(_ session: AVContentKeySession) @available(macOS 10.14, *) - @asyncHandler optional func contentKeySessionDidGenerateExpiredSessionReport(_ session: AVContentKeySession) + optional func contentKeySessionDidGenerateExpiredSessionReport(_ session: AVContentKeySession) } @available(macOS 10.12.4, *) class AVContentKeyRequest : NSObject { diff --git a/macOS/AVFoundation/AVPlayerItemMediaDataCollector.swift b/macOS/AVFoundation/AVPlayerItemMediaDataCollector.swift index 3733757..51e6cb7 100644 --- a/macOS/AVFoundation/AVPlayerItemMediaDataCollector.swift +++ b/macOS/AVFoundation/AVPlayerItemMediaDataCollector.swift @@ -11,5 +11,5 @@ class AVPlayerItemMetadataCollector : AVPlayerItemMediaDataCollector { } protocol AVPlayerItemMetadataCollectorPushDelegate : NSObjectProtocol { @available(macOS 10.11.3, *) - @asyncHandler func metadataCollector(_ metadataCollector: AVPlayerItemMetadataCollector, didCollect metadataGroups: [AVDateRangeMetadataGroup], indexesOfNewGroups: IndexSet, indexesOfModifiedGroups: IndexSet) + func metadataCollector(_ metadataCollector: AVPlayerItemMetadataCollector, didCollect metadataGroups: [AVDateRangeMetadataGroup], indexesOfNewGroups: IndexSet, indexesOfModifiedGroups: IndexSet) } diff --git a/macOS/AVFoundation/AVPlayerItemOutput.swift b/macOS/AVFoundation/AVPlayerItemOutput.swift index b822a10..8a5fc85 100644 --- a/macOS/AVFoundation/AVPlayerItemOutput.swift +++ b/macOS/AVFoundation/AVPlayerItemOutput.swift @@ -54,7 +54,7 @@ extension AVPlayerItemLegibleOutput.TextStylingResolution { } protocol AVPlayerItemLegibleOutputPushDelegate : AVPlayerItemOutputPushDelegate { @available(macOS 10.9, *) - @asyncHandler optional func legibleOutput(_ output: AVPlayerItemLegibleOutput, didOutputAttributedStrings strings: [NSAttributedString], nativeSampleBuffers nativeSamples: [Any], forItemTime itemTime: CMTime) + optional func legibleOutput(_ output: AVPlayerItemLegibleOutput, didOutputAttributedStrings strings: [NSAttributedString], nativeSampleBuffers nativeSamples: [Any], forItemTime itemTime: CMTime) } protocol AVPlayerItemOutputPushDelegate : NSObjectProtocol { @available(macOS 10.8, *) @@ -70,5 +70,5 @@ class AVPlayerItemMetadataOutput : AVPlayerItemOutput { } protocol AVPlayerItemMetadataOutputPushDelegate : AVPlayerItemOutputPushDelegate { @available(macOS 10.10, *) - @asyncHandler optional func metadataOutput(_ output: AVPlayerItemMetadataOutput, didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup], from track: AVPlayerItemTrack?) + optional func metadataOutput(_ output: AVPlayerItemMetadataOutput, didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup], from track: AVPlayerItemTrack?) } diff --git a/macOS/AVKit/AVPictureInPictureController.swift b/macOS/AVKit/AVPictureInPictureController.swift index 590cacf..0f6f72e 100644 --- a/macOS/AVKit/AVPictureInPictureController.swift +++ b/macOS/AVKit/AVPictureInPictureController.swift @@ -18,10 +18,10 @@ class AVPictureInPictureController : NSObject { @available(macOS 10.15, *) protocol AVPictureInPictureControllerDelegate : NSObjectProtocol { optional func pictureInPictureControllerWillStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) - @asyncHandler optional func pictureInPictureControllerDidStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) + optional func pictureInPictureControllerDidStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, failedToStartPictureInPictureWithError error: Error) optional func pictureInPictureControllerWillStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) - @asyncHandler optional func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) + optional func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void) optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController) async -> Bool } diff --git a/macOS/AVKit/AVPlayerView.swift b/macOS/AVKit/AVPlayerView.swift index eaa14be..e9a3dc0 100644 --- a/macOS/AVKit/AVPlayerView.swift +++ b/macOS/AVKit/AVPlayerView.swift @@ -56,10 +56,10 @@ extension AVPlayerView { @available(macOS 10.15, *) protocol AVPlayerViewPictureInPictureDelegate : NSObjectProtocol { optional func playerViewWillStartPicture(inPicture playerView: AVPlayerView) - @asyncHandler optional func playerViewDidStartPicture(inPicture playerView: AVPlayerView) + optional func playerViewDidStartPicture(inPicture playerView: AVPlayerView) optional func playerView(_ playerView: AVPlayerView, failedToStartPictureInPictureWithError error: Error) optional func playerViewWillStopPicture(inPicture playerView: AVPlayerView) - @asyncHandler optional func playerViewDidStopPicture(inPicture playerView: AVPlayerView) + optional func playerViewDidStopPicture(inPicture playerView: AVPlayerView) optional func playerView(_ playerView: AVPlayerView, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void) optional func playerViewRestoreUserInterfaceForPictureInPictureStop(_ playerView: AVPlayerView) async -> Bool optional func playerViewShouldAutomaticallyDismissAtPicture(inPictureStart playerView: AVPlayerView) -> Bool diff --git a/macOS/AVKit/AVRoutePickerView.swift b/macOS/AVKit/AVRoutePickerView.swift index 035ecf8..2ff665f 100644 --- a/macOS/AVKit/AVRoutePickerView.swift +++ b/macOS/AVKit/AVRoutePickerView.swift @@ -22,5 +22,5 @@ protocol AVRoutePickerViewDelegate : NSObjectProtocol { @available(macOS 10.15, *) optional func routePickerViewWillBeginPresentingRoutes(_ routePickerView: AVRoutePickerView) @available(macOS 10.15, *) - @asyncHandler optional func routePickerViewDidEndPresentingRoutes(_ routePickerView: AVRoutePickerView) + optional func routePickerViewDidEndPresentingRoutes(_ routePickerView: AVRoutePickerView) } diff --git a/macOS/AppKit/NSAnimation.swift b/macOS/AppKit/NSAnimation.swift index 3922960..4d3005e 100644 --- a/macOS/AppKit/NSAnimation.swift +++ b/macOS/AppKit/NSAnimation.swift @@ -42,10 +42,10 @@ class NSAnimation : NSObject, NSCopying, NSCoding { } protocol NSAnimationDelegate : NSObjectProtocol { optional func animationShouldStart(_ animation: NSAnimation) -> Bool - @asyncHandler optional func animationDidStop(_ animation: NSAnimation) - @asyncHandler optional func animationDidEnd(_ animation: NSAnimation) + optional func animationDidStop(_ animation: NSAnimation) + optional func animationDidEnd(_ animation: NSAnimation) optional func animation(_ animation: NSAnimation, valueForProgress progress: NSAnimation.Progress) -> Float - @asyncHandler optional func animation(_ animation: NSAnimation, didReachProgressMark progress: NSAnimation.Progress) + optional func animation(_ animation: NSAnimation, didReachProgressMark progress: NSAnimation.Progress) } extension NSViewAnimation { struct Key : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable { diff --git a/macOS/AppKit/NSApplication.swift b/macOS/AppKit/NSApplication.swift index 001c4cb..94a770b 100644 --- a/macOS/AppKit/NSApplication.swift +++ b/macOS/AppKit/NSApplication.swift @@ -285,42 +285,42 @@ protocol NSApplicationDelegate : NSObjectProtocol { optional func applicationDockMenu(_ sender: NSApplication) -> NSMenu? optional func application(_ application: NSApplication, willPresentError error: Error) -> Error @available(macOS 10.7, *) - @asyncHandler optional func application(_ application: NSApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) + optional func application(_ application: NSApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) @available(macOS 10.7, *) - @asyncHandler optional func application(_ application: NSApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) + optional func application(_ application: NSApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) @available(macOS 10.7, *) - @asyncHandler optional func application(_ application: NSApplication, didReceiveRemoteNotification userInfo: [String : Any]) + optional func application(_ application: NSApplication, didReceiveRemoteNotification userInfo: [String : Any]) @available(macOS 10.7, *) optional func application(_ app: NSApplication, willEncodeRestorableState coder: NSCoder) @available(macOS 10.7, *) - @asyncHandler optional func application(_ app: NSApplication, didDecodeRestorableState coder: NSCoder) + optional func application(_ app: NSApplication, didDecodeRestorableState coder: NSCoder) @available(macOS 10.10, *) optional func application(_ application: NSApplication, willContinueUserActivityWithType userActivityType: String) -> Bool @available(macOS 10.10, *) optional func application(_ application: NSApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([NSUserActivityRestoring]) -> Void) -> Bool @available(macOS 10.10, *) - @asyncHandler optional func application(_ application: NSApplication, didFailToContinueUserActivityWithType userActivityType: String, error: Error) + optional func application(_ application: NSApplication, didFailToContinueUserActivityWithType userActivityType: String, error: Error) @available(macOS 10.10, *) - @asyncHandler optional func application(_ application: NSApplication, didUpdate userActivity: NSUserActivity) + optional func application(_ application: NSApplication, didUpdate userActivity: NSUserActivity) @available(macOS 10.12, *) optional func application(_ application: NSApplication, userDidAcceptCloudKitShareWith metadata: CKShare.Metadata) optional func application(_ sender: NSApplication, delegateHandlesKey key: String) -> Bool optional func applicationWillFinishLaunching(_ notification: Notification) - @asyncHandler optional func applicationDidFinishLaunching(_ notification: Notification) + optional func applicationDidFinishLaunching(_ notification: Notification) optional func applicationWillHide(_ notification: Notification) - @asyncHandler optional func applicationDidHide(_ notification: Notification) + optional func applicationDidHide(_ notification: Notification) optional func applicationWillUnhide(_ notification: Notification) - @asyncHandler optional func applicationDidUnhide(_ notification: Notification) + optional func applicationDidUnhide(_ notification: Notification) optional func applicationWillBecomeActive(_ notification: Notification) - @asyncHandler optional func applicationDidBecomeActive(_ notification: Notification) + optional func applicationDidBecomeActive(_ notification: Notification) optional func applicationWillResignActive(_ notification: Notification) - @asyncHandler optional func applicationDidResignActive(_ notification: Notification) + optional func applicationDidResignActive(_ notification: Notification) optional func applicationWillUpdate(_ notification: Notification) - @asyncHandler optional func applicationDidUpdate(_ notification: Notification) + optional func applicationDidUpdate(_ notification: Notification) optional func applicationWillTerminate(_ notification: Notification) - @asyncHandler optional func applicationDidChangeScreenParameters(_ notification: Notification) + optional func applicationDidChangeScreenParameters(_ notification: Notification) @available(macOS 10.9, *) - @asyncHandler optional func applicationDidChangeOcclusionState(_ notification: Notification) + optional func applicationDidChangeOcclusionState(_ notification: Notification) } extension NSApplicationDelegate { diff --git a/macOS/AppKit/NSBrowser.swift b/macOS/AppKit/NSBrowser.swift index 259c891..fd59370 100644 --- a/macOS/AppKit/NSBrowser.swift +++ b/macOS/AppKit/NSBrowser.swift @@ -154,10 +154,10 @@ protocol NSBrowserDelegate : NSObjectProtocol { optional func browser(_ sender: NSBrowser, selectRow row: Int, inColumn column: Int) -> Bool optional func browser(_ sender: NSBrowser, isColumnValid column: Int) -> Bool optional func browserWillScroll(_ sender: NSBrowser) - @asyncHandler optional func browserDidScroll(_ sender: NSBrowser) + optional func browserDidScroll(_ sender: NSBrowser) optional func browser(_ browser: NSBrowser, shouldSizeColumn columnIndex: Int, forUserResize: Bool, toWidth suggestedWidth: CGFloat) -> CGFloat optional func browser(_ browser: NSBrowser, sizeToFitWidthOfColumn columnIndex: Int) -> CGFloat - @asyncHandler optional func browserColumnConfigurationDidChange(_ notification: Notification) + optional func browserColumnConfigurationDidChange(_ notification: Notification) @available(macOS 10.5, *) optional func browser(_ browser: NSBrowser, shouldShowCellExpansionForRow row: Int, column: Int) -> Bool @available(macOS 10.5, *) @@ -182,7 +182,7 @@ protocol NSBrowserDelegate : NSObjectProtocol { optional func browser(_ browser: NSBrowser, previewViewControllerForLeafItem item: Any) -> NSViewController? @available(macOS 10.6, *) optional func browser(_ browser: NSBrowser, headerViewControllerForItem item: Any?) -> NSViewController? - @asyncHandler optional func browser(_ browser: NSBrowser, didChangeLastColumn oldLastColumn: Int, toColumn column: Int) + optional func browser(_ browser: NSBrowser, didChangeLastColumn oldLastColumn: Int, toColumn column: Int) @available(macOS 10.6, *) optional func browser(_ browser: NSBrowser, selectionIndexesForProposedSelection proposedSelectionIndexes: IndexSet, inColumn column: Int) -> IndexSet } diff --git a/macOS/AppKit/NSCollectionView.swift b/macOS/AppKit/NSCollectionView.swift index 15646e2..90451e9 100644 --- a/macOS/AppKit/NSCollectionView.swift +++ b/macOS/AppKit/NSCollectionView.swift @@ -42,7 +42,7 @@ protocol NSCollectionViewElement : NSUserInterfaceItemIdentification, NSObjectPr @available(macOS 10.11, *) optional func willTransition(from oldLayout: NSCollectionViewLayout, to newLayout: NSCollectionViewLayout) @available(macOS 10.11, *) - @asyncHandler optional func didTransition(from oldLayout: NSCollectionViewLayout, to newLayout: NSCollectionViewLayout) + optional func didTransition(from oldLayout: NSCollectionViewLayout, to newLayout: NSCollectionViewLayout) @available(macOS 10.11, *) optional func preferredLayoutAttributesFitting(_ layoutAttributes: NSCollectionViewLayoutAttributes) -> NSCollectionViewLayoutAttributes } @@ -222,23 +222,23 @@ protocol NSCollectionViewDelegate : NSObjectProtocol { @available(macOS 10.11, *) optional func collectionView(_ collectionView: NSCollectionView, shouldChangeItemsAt indexPaths: Set, to highlightState: NSCollectionViewItem.HighlightState) -> Set @available(macOS 10.11, *) - @asyncHandler optional func collectionView(_ collectionView: NSCollectionView, didChangeItemsAt indexPaths: Set, to highlightState: NSCollectionViewItem.HighlightState) + optional func collectionView(_ collectionView: NSCollectionView, didChangeItemsAt indexPaths: Set, to highlightState: NSCollectionViewItem.HighlightState) @available(macOS 10.11, *) optional func collectionView(_ collectionView: NSCollectionView, shouldSelectItemsAt indexPaths: Set) -> Set @available(macOS 10.11, *) optional func collectionView(_ collectionView: NSCollectionView, shouldDeselectItemsAt indexPaths: Set) -> Set @available(macOS 10.11, *) - @asyncHandler optional func collectionView(_ collectionView: NSCollectionView, didSelectItemsAt indexPaths: Set) + optional func collectionView(_ collectionView: NSCollectionView, didSelectItemsAt indexPaths: Set) @available(macOS 10.11, *) - @asyncHandler optional func collectionView(_ collectionView: NSCollectionView, didDeselectItemsAt indexPaths: Set) + optional func collectionView(_ collectionView: NSCollectionView, didDeselectItemsAt indexPaths: Set) @available(macOS 10.11, *) optional func collectionView(_ collectionView: NSCollectionView, willDisplay item: NSCollectionViewItem, forRepresentedObjectAt indexPath: IndexPath) @available(macOS 10.11, *) optional func collectionView(_ collectionView: NSCollectionView, willDisplaySupplementaryView view: NSView, forElementKind elementKind: NSCollectionView.SupplementaryElementKind, at indexPath: IndexPath) @available(macOS 10.11, *) - @asyncHandler optional func collectionView(_ collectionView: NSCollectionView, didEndDisplaying item: NSCollectionViewItem, forRepresentedObjectAt indexPath: IndexPath) + optional func collectionView(_ collectionView: NSCollectionView, didEndDisplaying item: NSCollectionViewItem, forRepresentedObjectAt indexPath: IndexPath) @available(macOS 10.11, *) - @asyncHandler optional func collectionView(_ collectionView: NSCollectionView, didEndDisplayingSupplementaryView view: NSView, forElementOfKind elementKind: NSCollectionView.SupplementaryElementKind, at indexPath: IndexPath) + optional func collectionView(_ collectionView: NSCollectionView, didEndDisplayingSupplementaryView view: NSView, forElementOfKind elementKind: NSCollectionView.SupplementaryElementKind, at indexPath: IndexPath) @available(macOS 10.11, *) optional func collectionView(_ collectionView: NSCollectionView, transitionLayoutForOldLayout fromLayout: NSCollectionViewLayout, newLayout toLayout: NSCollectionViewLayout) -> NSCollectionViewTransitionLayout } diff --git a/macOS/AppKit/NSComboBox.swift b/macOS/AppKit/NSComboBox.swift index fdb9a02..134d92c 100644 --- a/macOS/AppKit/NSComboBox.swift +++ b/macOS/AppKit/NSComboBox.swift @@ -14,7 +14,7 @@ protocol NSComboBoxDataSource : NSObjectProtocol { protocol NSComboBoxDelegate : NSTextFieldDelegate { optional func comboBoxWillPopUp(_ notification: Notification) optional func comboBoxWillDismiss(_ notification: Notification) - @asyncHandler optional func comboBoxSelectionDidChange(_ notification: Notification) + optional func comboBoxSelectionDidChange(_ notification: Notification) optional func comboBoxSelectionIsChanging(_ notification: Notification) } class NSComboBox : NSTextField { diff --git a/macOS/AppKit/NSControl.swift b/macOS/AppKit/NSControl.swift index 8cf8058..cdafcd6 100644 --- a/macOS/AppKit/NSControl.swift +++ b/macOS/AppKit/NSControl.swift @@ -57,13 +57,13 @@ extension NSControl { func endEditing(_ textObj: NSText) } protocol NSControlTextEditingDelegate : NSObjectProtocol { - @asyncHandler optional func controlTextDidBeginEditing(_ obj: Notification) - @asyncHandler optional func controlTextDidEndEditing(_ obj: Notification) - @asyncHandler optional func controlTextDidChange(_ obj: Notification) + optional func controlTextDidBeginEditing(_ obj: Notification) + optional func controlTextDidEndEditing(_ obj: Notification) + optional func controlTextDidChange(_ obj: Notification) optional func control(_ control: NSControl, textShouldBeginEditing fieldEditor: NSText) -> Bool optional func control(_ control: NSControl, textShouldEndEditing fieldEditor: NSText) -> Bool optional func control(_ control: NSControl, didFailToFormatString string: String, errorDescription error: String?) -> Bool - @asyncHandler optional func control(_ control: NSControl, didFailToValidatePartialString string: String, errorDescription error: String?) + optional func control(_ control: NSControl, didFailToValidatePartialString string: String, errorDescription error: String?) optional func control(_ control: NSControl, isValidObject obj: Any?) -> Bool optional func control(_ control: NSControl, textView: NSTextView, doCommandBy commandSelector: Selector) -> Bool optional func control(_ control: NSControl, textView: NSTextView, completions words: [String], forPartialWordRange charRange: NSRange, indexOfSelectedItem index: UnsafeMutablePointer) -> [String] diff --git a/macOS/AppKit/NSDrawer.swift b/macOS/AppKit/NSDrawer.swift index 35f080f..bf3fdb5 100644 --- a/macOS/AppKit/NSDrawer.swift +++ b/macOS/AppKit/NSDrawer.swift @@ -34,11 +34,11 @@ protocol NSDrawerDelegate : NSObjectProtocol { @available(macOS, introduced: 10.0, deprecated: 10.13, message: "Drawers are deprecated; consider using NSSplitViewController") optional func drawerWillOpen(_ notification: Notification) @available(macOS, introduced: 10.0, deprecated: 10.13, message: "Drawers are deprecated; consider using NSSplitViewController") - @asyncHandler optional func drawerDidOpen(_ notification: Notification) + optional func drawerDidOpen(_ notification: Notification) @available(macOS, introduced: 10.0, deprecated: 10.13, message: "Drawers are deprecated; consider using NSSplitViewController") optional func drawerWillClose(_ notification: Notification) @available(macOS, introduced: 10.0, deprecated: 10.13, message: "Drawers are deprecated; consider using NSSplitViewController") - @asyncHandler optional func drawerDidClose(_ notification: Notification) + optional func drawerDidClose(_ notification: Notification) } extension NSDrawer { @available(macOS, introduced: 10.0, deprecated: 10.13, message: "Drawers are deprecated; consider using NSSplitViewController") diff --git a/macOS/AppKit/NSImage.swift b/macOS/AppKit/NSImage.swift index 731c0a0..9d31f43 100644 --- a/macOS/AppKit/NSImage.swift +++ b/macOS/AppKit/NSImage.swift @@ -93,9 +93,9 @@ extension NSImage : NSCopying, NSSecureCoding, NSPasteboardReading, NSPasteboard protocol NSImageDelegate : NSObjectProtocol { optional func imageDidNotDraw(_ sender: NSImage, in rect: NSRect) -> NSImage? optional func image(_ image: NSImage, willLoadRepresentation rep: NSImageRep) - @asyncHandler optional func image(_ image: NSImage, didLoadRepresentationHeader rep: NSImageRep) - @asyncHandler optional func image(_ image: NSImage, didLoadPartOfRepresentation rep: NSImageRep, withValidRows rows: Int) - @asyncHandler optional func image(_ image: NSImage, didLoadRepresentation rep: NSImageRep, with status: NSImage.LoadStatus) + optional func image(_ image: NSImage, didLoadRepresentationHeader rep: NSImageRep) + optional func image(_ image: NSImage, didLoadPartOfRepresentation rep: NSImageRep, withValidRows rows: Int) + optional func image(_ image: NSImage, didLoadRepresentation rep: NSImageRep, with status: NSImage.LoadStatus) } extension Bundle { @available(macOS 10.7, *) diff --git a/macOS/AppKit/NSKeyValueBinding.swift b/macOS/AppKit/NSKeyValueBinding.swift index a4d1f64..7c77358 100644 --- a/macOS/AppKit/NSKeyValueBinding.swift +++ b/macOS/AppKit/NSKeyValueBinding.swift @@ -71,8 +71,8 @@ protocol NSEditor : NSObjectProtocol { func commitEditingWithoutPresentingError() throws } protocol NSEditorRegistration : NSObjectProtocol { - @asyncHandler optional func objectDidBeginEditing(_ editor: NSEditor) - @asyncHandler optional func objectDidEndEditing(_ editor: NSEditor) + optional func objectDidBeginEditing(_ editor: NSEditor) + optional func objectDidEndEditing(_ editor: NSEditor) } extension NSBindingName { static let alignment: NSBindingName diff --git a/macOS/AppKit/NSLayoutManager.swift b/macOS/AppKit/NSLayoutManager.swift index 64abbe3..dd59db0 100644 --- a/macOS/AppKit/NSLayoutManager.swift +++ b/macOS/AppKit/NSLayoutManager.swift @@ -200,11 +200,11 @@ protocol NSLayoutManagerDelegate : NSObjectProtocol { @available(macOS 10.11, *) optional func layoutManager(_ layoutManager: NSLayoutManager, shouldSetLineFragmentRect lineFragmentRect: UnsafeMutablePointer, lineFragmentUsedRect: UnsafeMutablePointer, baselineOffset: UnsafeMutablePointer, in textContainer: NSTextContainer, forGlyphRange glyphRange: NSRange) -> Bool @available(macOS 10.0, *) - @asyncHandler optional func layoutManagerDidInvalidateLayout(_ sender: NSLayoutManager) + optional func layoutManagerDidInvalidateLayout(_ sender: NSLayoutManager) @available(macOS 10.0, *) - @asyncHandler optional func layoutManager(_ layoutManager: NSLayoutManager, didCompleteLayoutFor textContainer: NSTextContainer?, atEnd layoutFinishedFlag: Bool) + optional func layoutManager(_ layoutManager: NSLayoutManager, didCompleteLayoutFor textContainer: NSTextContainer?, atEnd layoutFinishedFlag: Bool) @available(macOS 10.11, *) - @asyncHandler optional func layoutManager(_ layoutManager: NSLayoutManager, textContainer: NSTextContainer, didChangeGeometryFrom oldSize: NSSize) + optional func layoutManager(_ layoutManager: NSLayoutManager, textContainer: NSTextContainer, didChangeGeometryFrom oldSize: NSSize) @available(macOS 10.5, *) optional func layoutManager(_ layoutManager: NSLayoutManager, shouldUseTemporaryAttributes attrs: [NSAttributedString.Key : Any] = [:], forDrawingToScreen toScreen: Bool, atCharacterIndex charIndex: Int, effectiveRange effectiveCharRange: NSRangePointer?) -> [NSAttributedString.Key : Any]? } diff --git a/macOS/AppKit/NSMenu.swift b/macOS/AppKit/NSMenu.swift index b79dcd4..62c522e 100644 --- a/macOS/AppKit/NSMenu.swift +++ b/macOS/AppKit/NSMenu.swift @@ -69,7 +69,7 @@ protocol NSMenuDelegate : NSObjectProtocol { @available(macOS 10.5, *) optional func menuWillOpen(_ menu: NSMenu) @available(macOS 10.5, *) - @asyncHandler optional func menuDidClose(_ menu: NSMenu) + optional func menuDidClose(_ menu: NSMenu) @available(macOS 10.5, *) optional func menu(_ menu: NSMenu, willHighlight item: NSMenuItem?) @available(macOS 10.6, *) diff --git a/macOS/AppKit/NSOutlineView.swift b/macOS/AppKit/NSOutlineView.swift index 147519f..44d32dc 100644 --- a/macOS/AppKit/NSOutlineView.swift +++ b/macOS/AppKit/NSOutlineView.swift @@ -68,9 +68,9 @@ protocol NSOutlineViewDelegate : NSControlTextEditingDelegate { @available(macOS 10.7, *) optional func outlineView(_ outlineView: NSOutlineView, rowViewForItem item: Any) -> NSTableRowView? @available(macOS 10.7, *) - @asyncHandler optional func outlineView(_ outlineView: NSOutlineView, didAdd rowView: NSTableRowView, forRow row: Int) + optional func outlineView(_ outlineView: NSOutlineView, didAdd rowView: NSTableRowView, forRow row: Int) @available(macOS 10.7, *) - @asyncHandler optional func outlineView(_ outlineView: NSOutlineView, didRemove rowView: NSTableRowView, forRow row: Int) + optional func outlineView(_ outlineView: NSOutlineView, didRemove rowView: NSTableRowView, forRow row: Int) optional func outlineView(_ outlineView: NSOutlineView, willDisplayCell cell: Any, for tableColumn: NSTableColumn?, item: Any) optional func outlineView(_ outlineView: NSOutlineView, shouldEdit tableColumn: NSTableColumn?, item: Any) -> Bool optional func selectionShouldChange(in outlineView: NSOutlineView) -> Bool @@ -79,8 +79,8 @@ protocol NSOutlineViewDelegate : NSControlTextEditingDelegate { optional func outlineView(_ outlineView: NSOutlineView, selectionIndexesForProposedSelection proposedSelectionIndexes: IndexSet) -> IndexSet optional func outlineView(_ outlineView: NSOutlineView, shouldSelect tableColumn: NSTableColumn?) -> Bool optional func outlineView(_ outlineView: NSOutlineView, mouseDownInHeaderOf tableColumn: NSTableColumn) - @asyncHandler optional func outlineView(_ outlineView: NSOutlineView, didClick tableColumn: NSTableColumn) - @asyncHandler optional func outlineView(_ outlineView: NSOutlineView, didDrag tableColumn: NSTableColumn) + optional func outlineView(_ outlineView: NSOutlineView, didClick tableColumn: NSTableColumn) + optional func outlineView(_ outlineView: NSOutlineView, didDrag tableColumn: NSTableColumn) optional func outlineView(_ outlineView: NSOutlineView, toolTipFor cell: NSCell, rect: NSRectPointer, tableColumn: NSTableColumn?, item: Any, mouseLocation: NSPoint) -> String optional func outlineView(_ outlineView: NSOutlineView, heightOfRowByItem item: Any) -> CGFloat @available(macOS 11.0, *) @@ -108,14 +108,14 @@ protocol NSOutlineViewDelegate : NSControlTextEditingDelegate { optional func outlineView(_ outlineView: NSOutlineView, shouldReorderColumn columnIndex: Int, toColumn newColumnIndex: Int) -> Bool @available(macOS 10.6, *) optional func outlineView(_ outlineView: NSOutlineView, shouldShowOutlineCellForItem item: Any) -> Bool - @asyncHandler optional func outlineViewSelectionDidChange(_ notification: Notification) - @asyncHandler optional func outlineViewColumnDidMove(_ notification: Notification) - @asyncHandler optional func outlineViewColumnDidResize(_ notification: Notification) + optional func outlineViewSelectionDidChange(_ notification: Notification) + optional func outlineViewColumnDidMove(_ notification: Notification) + optional func outlineViewColumnDidResize(_ notification: Notification) optional func outlineViewSelectionIsChanging(_ notification: Notification) optional func outlineViewItemWillExpand(_ notification: Notification) - @asyncHandler optional func outlineViewItemDidExpand(_ notification: Notification) + optional func outlineViewItemDidExpand(_ notification: Notification) optional func outlineViewItemWillCollapse(_ notification: Notification) - @asyncHandler optional func outlineViewItemDidCollapse(_ notification: Notification) + optional func outlineViewItemDidCollapse(_ notification: Notification) } extension NSOutlineView { @available(macOS 10.9, *) diff --git a/macOS/AppKit/NSPageController.swift b/macOS/AppKit/NSPageController.swift index 8b574df..96e38ba 100644 --- a/macOS/AppKit/NSPageController.swift +++ b/macOS/AppKit/NSPageController.swift @@ -33,9 +33,9 @@ protocol NSPageControllerDelegate : NSObjectProtocol { @available(macOS 10.8, *) optional func pageController(_ pageController: NSPageController, prepare viewController: NSViewController, with object: Any?) @available(macOS 10.8, *) - @asyncHandler optional func pageController(_ pageController: NSPageController, didTransitionTo object: Any) + optional func pageController(_ pageController: NSPageController, didTransitionTo object: Any) @available(macOS 10.8, *) optional func pageControllerWillStartLiveTransition(_ pageController: NSPageController) @available(macOS 10.8, *) - @asyncHandler optional func pageControllerDidEndLiveTransition(_ pageController: NSPageController) + optional func pageControllerDidEndLiveTransition(_ pageController: NSPageController) } diff --git a/macOS/AppKit/NSPopover.swift b/macOS/AppKit/NSPopover.swift index 28d1d63..dc49b44 100644 --- a/macOS/AppKit/NSPopover.swift +++ b/macOS/AppKit/NSPopover.swift @@ -59,11 +59,11 @@ protocol NSPopoverDelegate : NSObjectProtocol { @available(macOS 10.10, *) optional func popoverShouldDetach(_ popover: NSPopover) -> Bool @available(macOS 10.10, *) - @asyncHandler optional func popoverDidDetach(_ popover: NSPopover) + optional func popoverDidDetach(_ popover: NSPopover) @available(macOS 10.7, *) optional func detachableWindow(for popover: NSPopover) -> NSWindow? optional func popoverWillShow(_ notification: Notification) - @asyncHandler optional func popoverDidShow(_ notification: Notification) + optional func popoverDidShow(_ notification: Notification) optional func popoverWillClose(_ notification: Notification) - @asyncHandler optional func popoverDidClose(_ notification: Notification) + optional func popoverDidClose(_ notification: Notification) } diff --git a/macOS/AppKit/NSRuleEditor.swift b/macOS/AppKit/NSRuleEditor.swift index 51078e1..af34d21 100644 --- a/macOS/AppKit/NSRuleEditor.swift +++ b/macOS/AppKit/NSRuleEditor.swift @@ -45,7 +45,7 @@ protocol NSRuleEditorDelegate : NSObjectProtocol { func ruleEditor(_ editor: NSRuleEditor, child index: Int, forCriterion criterion: Any?, with rowType: NSRuleEditor.RowType) -> Any func ruleEditor(_ editor: NSRuleEditor, displayValueForCriterion criterion: Any, inRow row: Int) -> Any optional func ruleEditor(_ editor: NSRuleEditor, predicatePartsForCriterion criterion: Any, withDisplayValue value: Any, inRow row: Int) -> [NSRuleEditor.PredicatePartKey : Any]? - @asyncHandler optional func ruleEditorRowsDidChange(_ notification: Notification) + optional func ruleEditorRowsDidChange(_ notification: Notification) } extension NSRuleEditor { class let rowsDidChangeNotification: NSNotification.Name diff --git a/macOS/AppKit/NSSavePanel.swift b/macOS/AppKit/NSSavePanel.swift index df82f0b..6346f2f 100644 --- a/macOS/AppKit/NSSavePanel.swift +++ b/macOS/AppKit/NSSavePanel.swift @@ -43,10 +43,10 @@ protocol NSOpenSavePanelDelegate : NSObjectProtocol { @available(macOS 10.6, *) optional func panel(_ sender: Any, validate url: URL) throws @available(macOS 10.6, *) - @asyncHandler optional func panel(_ sender: Any, didChangeToDirectoryURL url: URL?) + optional func panel(_ sender: Any, didChangeToDirectoryURL url: URL?) optional func panel(_ sender: Any, userEnteredFilename filename: String, confirmed okFlag: Bool) -> String? optional func panel(_ sender: Any, willExpand expanding: Bool) - @asyncHandler optional func panelSelectionDidChange(_ sender: Any?) + optional func panelSelectionDidChange(_ sender: Any?) } extension NSObject { } diff --git a/macOS/AppKit/NSScrubber.swift b/macOS/AppKit/NSScrubber.swift index d01fa5e..cddcfdd 100644 --- a/macOS/AppKit/NSScrubber.swift +++ b/macOS/AppKit/NSScrubber.swift @@ -7,17 +7,17 @@ protocol NSScrubberDataSource : NSObjectProtocol { } protocol NSScrubberDelegate : NSObjectProtocol { @available(macOS 10.12.2, *) - @asyncHandler optional func scrubber(_ scrubber: NSScrubber, didSelectItemAt selectedIndex: Int) + optional func scrubber(_ scrubber: NSScrubber, didSelectItemAt selectedIndex: Int) @available(macOS 10.12.2, *) - @asyncHandler optional func scrubber(_ scrubber: NSScrubber, didHighlightItemAt highlightedIndex: Int) + optional func scrubber(_ scrubber: NSScrubber, didHighlightItemAt highlightedIndex: Int) @available(macOS 10.12.2, *) - @asyncHandler optional func scrubber(_ scrubber: NSScrubber, didChangeVisibleRange visibleRange: NSRange) + optional func scrubber(_ scrubber: NSScrubber, didChangeVisibleRange visibleRange: NSRange) @available(macOS 10.12.2, *) - @asyncHandler optional func didBeginInteracting(with scrubber: NSScrubber) + optional func didBeginInteracting(with scrubber: NSScrubber) @available(macOS 10.12.2, *) - @asyncHandler optional func didFinishInteracting(with scrubber: NSScrubber) + optional func didFinishInteracting(with scrubber: NSScrubber) @available(macOS 10.12.2, *) - @asyncHandler optional func didCancelInteracting(with scrubber: NSScrubber) + optional func didCancelInteracting(with scrubber: NSScrubber) } extension NSScrubber { @available(macOS 10.12.2, *) diff --git a/macOS/AppKit/NSSearchField.swift b/macOS/AppKit/NSSearchField.swift index 86ecc17..28a51d3 100644 --- a/macOS/AppKit/NSSearchField.swift +++ b/macOS/AppKit/NSSearchField.swift @@ -4,9 +4,9 @@ extension NSSearchField { } protocol NSSearchFieldDelegate : NSTextFieldDelegate { @available(macOS 10.11, *) - @asyncHandler optional func searchFieldDidStartSearching(_ sender: NSSearchField) + optional func searchFieldDidStartSearching(_ sender: NSSearchField) @available(macOS 10.11, *) - @asyncHandler optional func searchFieldDidEndSearching(_ sender: NSSearchField) + optional func searchFieldDidEndSearching(_ sender: NSSearchField) } class NSSearchField : NSTextField { @available(macOS 11.0, *) diff --git a/macOS/AppKit/NSSharingService.swift b/macOS/AppKit/NSSharingService.swift index 5677522..6d9c39b 100644 --- a/macOS/AppKit/NSSharingService.swift +++ b/macOS/AppKit/NSSharingService.swift @@ -97,9 +97,9 @@ protocol NSSharingServiceDelegate : NSObjectProtocol { @available(macOS 10.8, *) optional func sharingService(_ sharingService: NSSharingService, willShareItems items: [Any]) @available(macOS 10.8, *) - @asyncHandler optional func sharingService(_ sharingService: NSSharingService, didFailToShareItems items: [Any], error: Error) + optional func sharingService(_ sharingService: NSSharingService, didFailToShareItems items: [Any], error: Error) @available(macOS 10.8, *) - @asyncHandler optional func sharingService(_ sharingService: NSSharingService, didShareItems items: [Any]) + optional func sharingService(_ sharingService: NSSharingService, didShareItems items: [Any]) @available(macOS 10.8, *) optional func sharingService(_ sharingService: NSSharingService, sourceFrameOnScreenForShareItem item: Any) -> NSRect @available(macOS 10.8, *) @@ -111,13 +111,13 @@ protocol NSSharingServiceDelegate : NSObjectProtocol { } protocol NSCloudSharingServiceDelegate : NSSharingServiceDelegate { @available(macOS 10.8, *) - @asyncHandler optional func sharingService(_ sharingService: NSSharingService, didCompleteForItems items: [Any], error: Error?) + optional func sharingService(_ sharingService: NSSharingService, didCompleteForItems items: [Any], error: Error?) @available(macOS 10.12, *) optional func options(for cloudKitSharingService: NSSharingService, share provider: NSItemProvider) -> NSSharingService.CloudKitOptions @available(macOS 10.12, *) - @asyncHandler optional func sharingService(_ sharingService: NSSharingService, didSave share: CKShare) + optional func sharingService(_ sharingService: NSSharingService, didSave share: CKShare) @available(macOS 10.12, *) - @asyncHandler optional func sharingService(_ sharingService: NSSharingService, didStopSharing share: CKShare) + optional func sharingService(_ sharingService: NSSharingService, didStopSharing share: CKShare) } extension NSItemProvider { @available(macOS 10.12, *) @@ -137,5 +137,5 @@ protocol NSSharingServicePickerDelegate : NSObjectProtocol { @available(macOS 10.8, *) optional func sharingServicePicker(_ sharingServicePicker: NSSharingServicePicker, delegateFor sharingService: NSSharingService) -> NSSharingServiceDelegate? @available(macOS 10.8, *) - @asyncHandler optional func sharingServicePicker(_ sharingServicePicker: NSSharingServicePicker, didChoose service: NSSharingService?) + optional func sharingServicePicker(_ sharingServicePicker: NSSharingServicePicker, didChoose service: NSSharingService?) } diff --git a/macOS/AppKit/NSSound.swift b/macOS/AppKit/NSSound.swift index 9ecea36..0d2e550 100644 --- a/macOS/AppKit/NSSound.swift +++ b/macOS/AppKit/NSSound.swift @@ -42,7 +42,7 @@ extension NSSound { extension NSSound { } protocol NSSoundDelegate : NSObjectProtocol { - @asyncHandler optional func sound(_ sound: NSSound, didFinishPlaying flag: Bool) + optional func sound(_ sound: NSSound, didFinishPlaying flag: Bool) } extension Bundle { func path(forSoundResource name: NSSound.Name) -> String? diff --git a/macOS/AppKit/NSSpeechRecognizer.swift b/macOS/AppKit/NSSpeechRecognizer.swift index f397697..4a98976 100644 --- a/macOS/AppKit/NSSpeechRecognizer.swift +++ b/macOS/AppKit/NSSpeechRecognizer.swift @@ -9,5 +9,5 @@ class NSSpeechRecognizer : NSObject { var blocksOtherRecognizers: Bool } protocol NSSpeechRecognizerDelegate : NSObjectProtocol { - @asyncHandler optional func speechRecognizer(_ sender: NSSpeechRecognizer, didRecognizeCommand command: String) + optional func speechRecognizer(_ sender: NSSpeechRecognizer, didRecognizeCommand command: String) } diff --git a/macOS/AppKit/NSSpeechSynthesizer.swift b/macOS/AppKit/NSSpeechSynthesizer.swift index 6b0aa57..94bdfe3 100644 --- a/macOS/AppKit/NSSpeechSynthesizer.swift +++ b/macOS/AppKit/NSSpeechSynthesizer.swift @@ -164,13 +164,13 @@ class NSSpeechSynthesizer : NSObject { class func attributes(forVoice voice: NSSpeechSynthesizer.VoiceName) -> [NSSpeechSynthesizer.VoiceAttributeKey : Any] } protocol NSSpeechSynthesizerDelegate : NSObjectProtocol { - @asyncHandler optional func speechSynthesizer(_ sender: NSSpeechSynthesizer, didFinishSpeaking finishedSpeaking: Bool) + optional func speechSynthesizer(_ sender: NSSpeechSynthesizer, didFinishSpeaking finishedSpeaking: Bool) optional func speechSynthesizer(_ sender: NSSpeechSynthesizer, willSpeakWord characterRange: NSRange, of string: String) optional func speechSynthesizer(_ sender: NSSpeechSynthesizer, willSpeakPhoneme phonemeOpcode: Int16) @available(macOS 10.5, *) - @asyncHandler optional func speechSynthesizer(_ sender: NSSpeechSynthesizer, didEncounterErrorAt characterIndex: Int, of string: String, message: String) + optional func speechSynthesizer(_ sender: NSSpeechSynthesizer, didEncounterErrorAt characterIndex: Int, of string: String, message: String) @available(macOS 10.5, *) - @asyncHandler optional func speechSynthesizer(_ sender: NSSpeechSynthesizer, didEncounterSyncMessage message: String) + optional func speechSynthesizer(_ sender: NSSpeechSynthesizer, didEncounterSyncMessage message: String) } extension NSSpeechSynthesizer.SpeechPropertyKey.Mode { @available(macOS 10.5, *) diff --git a/macOS/AppKit/NSSplitView.swift b/macOS/AppKit/NSSplitView.swift index eec54ea..346d4d6 100644 --- a/macOS/AppKit/NSSplitView.swift +++ b/macOS/AppKit/NSSplitView.swift @@ -52,7 +52,7 @@ protocol NSSplitViewDelegate : NSObjectProtocol { @available(macOS 10.5, *) optional func splitView(_ splitView: NSSplitView, additionalEffectiveRectOfDividerAt dividerIndex: Int) -> NSRect optional func splitViewWillResizeSubviews(_ notification: Notification) - @asyncHandler optional func splitViewDidResizeSubviews(_ notification: Notification) + optional func splitViewDidResizeSubviews(_ notification: Notification) } extension NSSplitView { class let willResizeSubviewsNotification: NSNotification.Name diff --git a/macOS/AppKit/NSStackView.swift b/macOS/AppKit/NSStackView.swift index 07aad4b..a857073 100644 --- a/macOS/AppKit/NSStackView.swift +++ b/macOS/AppKit/NSStackView.swift @@ -72,7 +72,7 @@ protocol NSStackViewDelegate : NSObjectProtocol { @available(macOS 10.9, *) optional func stackView(_ stackView: NSStackView, willDetach views: [NSView]) @available(macOS 10.9, *) - @asyncHandler optional func stackView(_ stackView: NSStackView, didReattach views: [NSView]) + optional func stackView(_ stackView: NSStackView, didReattach views: [NSView]) } extension NSStackView { func addView(_ view: NSView, in gravity: NSStackView.Gravity) diff --git a/macOS/AppKit/NSTabView.swift b/macOS/AppKit/NSTabView.swift index 698a08a..3d941ac 100644 --- a/macOS/AppKit/NSTabView.swift +++ b/macOS/AppKit/NSTabView.swift @@ -69,6 +69,6 @@ class NSTabView : NSView { protocol NSTabViewDelegate : NSObjectProtocol { optional func tabView(_ tabView: NSTabView, shouldSelect tabViewItem: NSTabViewItem?) -> Bool optional func tabView(_ tabView: NSTabView, willSelect tabViewItem: NSTabViewItem?) - @asyncHandler optional func tabView(_ tabView: NSTabView, didSelect tabViewItem: NSTabViewItem?) - @asyncHandler optional func tabViewDidChangeNumberOfTabViewItems(_ tabView: NSTabView) + optional func tabView(_ tabView: NSTabView, didSelect tabViewItem: NSTabViewItem?) + optional func tabViewDidChangeNumberOfTabViewItems(_ tabView: NSTabView) } diff --git a/macOS/AppKit/NSTableView.swift b/macOS/AppKit/NSTableView.swift index 8bb0f1c..e74fdce 100644 --- a/macOS/AppKit/NSTableView.swift +++ b/macOS/AppKit/NSTableView.swift @@ -230,9 +230,9 @@ protocol NSTableViewDelegate : NSControlTextEditingDelegate { @available(macOS 10.7, *) optional func tableView(_ tableView: NSTableView, rowViewForRow row: Int) -> NSTableRowView? @available(macOS 10.7, *) - @asyncHandler optional func tableView(_ tableView: NSTableView, didAdd rowView: NSTableRowView, forRow row: Int) + optional func tableView(_ tableView: NSTableView, didAdd rowView: NSTableRowView, forRow row: Int) @available(macOS 10.7, *) - @asyncHandler optional func tableView(_ tableView: NSTableView, didRemove rowView: NSTableRowView, forRow row: Int) + optional func tableView(_ tableView: NSTableView, didRemove rowView: NSTableRowView, forRow row: Int) optional func tableView(_ tableView: NSTableView, willDisplayCell cell: Any, for tableColumn: NSTableColumn?, row: Int) optional func tableView(_ tableView: NSTableView, shouldEdit tableColumn: NSTableColumn?, row: Int) -> Bool optional func tableView(_ tableView: NSTableView, toolTipFor cell: NSCell, rect: NSRectPointer, tableColumn: NSTableColumn?, row: Int, mouseLocation: NSPoint) -> String @@ -248,8 +248,8 @@ protocol NSTableViewDelegate : NSControlTextEditingDelegate { optional func tableView(_ tableView: NSTableView, selectionIndexesForProposedSelection proposedSelectionIndexes: IndexSet) -> IndexSet optional func tableView(_ tableView: NSTableView, shouldSelect tableColumn: NSTableColumn?) -> Bool optional func tableView(_ tableView: NSTableView, mouseDownInHeaderOf tableColumn: NSTableColumn) - @asyncHandler optional func tableView(_ tableView: NSTableView, didClick tableColumn: NSTableColumn) - @asyncHandler optional func tableView(_ tableView: NSTableView, didDrag tableColumn: NSTableColumn) + optional func tableView(_ tableView: NSTableView, didClick tableColumn: NSTableColumn) + optional func tableView(_ tableView: NSTableView, didDrag tableColumn: NSTableColumn) optional func tableView(_ tableView: NSTableView, heightOfRow row: Int) -> CGFloat @available(macOS 10.5, *) optional func tableView(_ tableView: NSTableView, typeSelectStringFor tableColumn: NSTableColumn?, row: Int) -> String? @@ -265,9 +265,9 @@ protocol NSTableViewDelegate : NSControlTextEditingDelegate { optional func tableView(_ tableView: NSTableView, shouldReorderColumn columnIndex: Int, toColumn newColumnIndex: Int) -> Bool @available(macOS 10.11, *) optional func tableView(_ tableView: NSTableView, rowActionsForRow row: Int, edge: NSTableView.RowActionEdge) -> [NSTableViewRowAction] - @asyncHandler optional func tableViewSelectionDidChange(_ notification: Notification) - @asyncHandler optional func tableViewColumnDidMove(_ notification: Notification) - @asyncHandler optional func tableViewColumnDidResize(_ notification: Notification) + optional func tableViewSelectionDidChange(_ notification: Notification) + optional func tableViewColumnDidMove(_ notification: Notification) + optional func tableViewColumnDidResize(_ notification: Notification) optional func tableViewSelectionIsChanging(_ notification: Notification) } protocol NSTableViewDataSource : NSObjectProtocol { diff --git a/macOS/AppKit/NSText.swift b/macOS/AppKit/NSText.swift index 6ce54ca..2ce5479 100644 --- a/macOS/AppKit/NSText.swift +++ b/macOS/AppKit/NSText.swift @@ -112,9 +112,9 @@ var NSOtherTextMovement: Int { get } protocol NSTextDelegate : NSObjectProtocol { optional func textShouldBeginEditing(_ textObject: NSText) -> Bool optional func textShouldEndEditing(_ textObject: NSText) -> Bool - @asyncHandler optional func textDidBeginEditing(_ notification: Notification) - @asyncHandler optional func textDidEndEditing(_ notification: Notification) - @asyncHandler optional func textDidChange(_ notification: Notification) + optional func textDidBeginEditing(_ notification: Notification) + optional func textDidEndEditing(_ notification: Notification) + optional func textDidChange(_ notification: Notification) } @available(macOS, introduced: 10.0, deprecated: 10.11, message: "Use NSWritingDirectionEmbedding instead") var NSTextWritingDirectionEmbedding: Int { get } diff --git a/macOS/AppKit/NSTextFinder.swift b/macOS/AppKit/NSTextFinder.swift index de5c53e..9e4f56d 100644 --- a/macOS/AppKit/NSTextFinder.swift +++ b/macOS/AppKit/NSTextFinder.swift @@ -67,7 +67,7 @@ protocol NSTextFinderClient : NSObjectProtocol { optional func scrollRangeToVisible(_ range: NSRange) optional func shouldReplaceCharacters(inRanges ranges: [NSValue], with strings: [String]) -> Bool optional func replaceCharacters(in range: NSRange, with string: String) - @asyncHandler optional func didReplaceCharacters() + optional func didReplaceCharacters() optional func contentView(at index: Int, effectiveCharacterRange outRange: NSRangePointer) -> NSView optional func rects(forCharacterRange range: NSRange) -> [NSValue]? optional var visibleCharacterRanges: [NSValue] { get } @@ -76,6 +76,6 @@ protocol NSTextFinderClient : NSObjectProtocol { protocol NSTextFinderBarContainer : NSObjectProtocol { var findBarView: NSView? { get set } var isFindBarVisible: Bool { get set } - @asyncHandler func findBarViewDidChangeHeight() + func findBarViewDidChangeHeight() optional func contentView() -> NSView? } diff --git a/macOS/AppKit/NSTextStorage.swift b/macOS/AppKit/NSTextStorage.swift index a308e5e..c3573cd 100644 --- a/macOS/AppKit/NSTextStorage.swift +++ b/macOS/AppKit/NSTextStorage.swift @@ -27,7 +27,7 @@ protocol NSTextStorageDelegate : NSObjectProtocol { @available(macOS 10.11, *) optional func textStorage(_ textStorage: NSTextStorage, willProcessEditing editedMask: NSTextStorageEditActions, range editedRange: NSRange, changeInLength delta: Int) @available(macOS 10.11, *) - @asyncHandler optional func textStorage(_ textStorage: NSTextStorage, didProcessEditing editedMask: NSTextStorageEditActions, range editedRange: NSRange, changeInLength delta: Int) + optional func textStorage(_ textStorage: NSTextStorage, didProcessEditing editedMask: NSTextStorageEditActions, range editedRange: NSRange, changeInLength delta: Int) } extension NSTextStorage { @available(macOS 10.0, *) diff --git a/macOS/AppKit/NSTextView.swift b/macOS/AppKit/NSTextView.swift index f860ad7..61c0573 100644 --- a/macOS/AppKit/NSTextView.swift +++ b/macOS/AppKit/NSTextView.swift @@ -242,8 +242,8 @@ protocol NSTextViewDelegate : NSTextDelegate { optional func textView(_ textView: NSTextView, shouldChangeTextInRanges affectedRanges: [NSValue], replacementStrings: [String]?) -> Bool @available(macOS 10.0, *) optional func textView(_ textView: NSTextView, shouldChangeTypingAttributes oldTypingAttributes: [String : Any] = [:], toAttributes newTypingAttributes: [NSAttributedString.Key : Any] = [:]) -> [NSAttributedString.Key : Any] - @asyncHandler optional func textViewDidChangeSelection(_ notification: Notification) - @asyncHandler optional func textViewDidChangeTypingAttributes(_ notification: Notification) + optional func textViewDidChangeSelection(_ notification: Notification) + optional func textViewDidChangeTypingAttributes(_ notification: Notification) optional func textView(_ textView: NSTextView, willDisplayToolTip tooltip: String, forCharacterAt characterIndex: Int) -> String? optional func textView(_ textView: NSTextView, completions words: [String], forPartialWordRange charRange: NSRange, indexOfSelectedItem index: UnsafeMutablePointer?) -> [String] optional func textView(_ textView: NSTextView, shouldChangeTextIn affectedCharRange: NSRange, replacementString: String?) -> Bool diff --git a/macOS/AppKit/NSToolbar.swift b/macOS/AppKit/NSToolbar.swift index 331403d..089c811 100644 --- a/macOS/AppKit/NSToolbar.swift +++ b/macOS/AppKit/NSToolbar.swift @@ -58,7 +58,7 @@ protocol NSToolbarDelegate : NSObjectProtocol { optional func toolbarAllowedItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] optional func toolbarSelectableItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] optional func toolbarWillAddItem(_ notification: Notification) - @asyncHandler optional func toolbarDidRemoveItem(_ notification: Notification) + optional func toolbarDidRemoveItem(_ notification: Notification) } extension NSToolbar { @available(macOS, introduced: 10.7, deprecated: 10.13, message: "Use NSTitlebarAccessoryViewController with NSWindow instead") diff --git a/macOS/AppKit/NSWindow.swift b/macOS/AppKit/NSWindow.swift index 914d432..1c5eed2 100644 --- a/macOS/AppKit/NSWindow.swift +++ b/macOS/AppKit/NSWindow.swift @@ -552,7 +552,7 @@ protocol NSWindowDelegate : NSObjectProtocol { @available(macOS 10.7, *) optional func window(_ window: NSWindow, startCustomAnimationToEnterFullScreenWithDuration duration: TimeInterval) @available(macOS 10.7, *) - @asyncHandler optional func windowDidFailToEnterFullScreen(_ window: NSWindow) + optional func windowDidFailToEnterFullScreen(_ window: NSWindow) @available(macOS 10.7, *) optional func customWindowsToExitFullScreen(for window: NSWindow) -> [NSWindow]? @available(macOS 10.7, *) @@ -562,54 +562,54 @@ protocol NSWindowDelegate : NSObjectProtocol { @available(macOS 10.9, *) optional func window(_ window: NSWindow, startCustomAnimationToEnterFullScreenOn screen: NSScreen, withDuration duration: TimeInterval) @available(macOS 10.7, *) - @asyncHandler optional func windowDidFailToExitFullScreen(_ window: NSWindow) + optional func windowDidFailToExitFullScreen(_ window: NSWindow) @available(macOS 10.7, *) optional func window(_ window: NSWindow, willResizeForVersionBrowserWithMaxPreferredSize maxPreferredFrameSize: NSSize, maxAllowedSize maxAllowedFrameSize: NSSize) -> NSSize @available(macOS 10.7, *) optional func window(_ window: NSWindow, willEncodeRestorableState state: NSCoder) @available(macOS 10.7, *) - @asyncHandler optional func window(_ window: NSWindow, didDecodeRestorableState state: NSCoder) - @asyncHandler optional func windowDidResize(_ notification: Notification) - @asyncHandler optional func windowDidExpose(_ notification: Notification) + optional func window(_ window: NSWindow, didDecodeRestorableState state: NSCoder) + optional func windowDidResize(_ notification: Notification) + optional func windowDidExpose(_ notification: Notification) optional func windowWillMove(_ notification: Notification) - @asyncHandler optional func windowDidMove(_ notification: Notification) - @asyncHandler optional func windowDidBecomeKey(_ notification: Notification) - @asyncHandler optional func windowDidResignKey(_ notification: Notification) - @asyncHandler optional func windowDidBecomeMain(_ notification: Notification) - @asyncHandler optional func windowDidResignMain(_ notification: Notification) + optional func windowDidMove(_ notification: Notification) + optional func windowDidBecomeKey(_ notification: Notification) + optional func windowDidResignKey(_ notification: Notification) + optional func windowDidBecomeMain(_ notification: Notification) + optional func windowDidResignMain(_ notification: Notification) optional func windowWillClose(_ notification: Notification) optional func windowWillMiniaturize(_ notification: Notification) - @asyncHandler optional func windowDidMiniaturize(_ notification: Notification) - @asyncHandler optional func windowDidDeminiaturize(_ notification: Notification) - @asyncHandler optional func windowDidUpdate(_ notification: Notification) - @asyncHandler optional func windowDidChangeScreen(_ notification: Notification) - @asyncHandler optional func windowDidChangeScreenProfile(_ notification: Notification) + optional func windowDidMiniaturize(_ notification: Notification) + optional func windowDidDeminiaturize(_ notification: Notification) + optional func windowDidUpdate(_ notification: Notification) + optional func windowDidChangeScreen(_ notification: Notification) + optional func windowDidChangeScreenProfile(_ notification: Notification) @available(macOS 10.7, *) - @asyncHandler optional func windowDidChangeBackingProperties(_ notification: Notification) + optional func windowDidChangeBackingProperties(_ notification: Notification) optional func windowWillBeginSheet(_ notification: Notification) - @asyncHandler optional func windowDidEndSheet(_ notification: Notification) + optional func windowDidEndSheet(_ notification: Notification) @available(macOS 10.6, *) optional func windowWillStartLiveResize(_ notification: Notification) @available(macOS 10.6, *) - @asyncHandler optional func windowDidEndLiveResize(_ notification: Notification) + optional func windowDidEndLiveResize(_ notification: Notification) @available(macOS 10.7, *) optional func windowWillEnterFullScreen(_ notification: Notification) @available(macOS 10.7, *) - @asyncHandler optional func windowDidEnterFullScreen(_ notification: Notification) + optional func windowDidEnterFullScreen(_ notification: Notification) @available(macOS 10.7, *) optional func windowWillExitFullScreen(_ notification: Notification) @available(macOS 10.7, *) - @asyncHandler optional func windowDidExitFullScreen(_ notification: Notification) + optional func windowDidExitFullScreen(_ notification: Notification) @available(macOS 10.7, *) optional func windowWillEnterVersionBrowser(_ notification: Notification) @available(macOS 10.7, *) - @asyncHandler optional func windowDidEnterVersionBrowser(_ notification: Notification) + optional func windowDidEnterVersionBrowser(_ notification: Notification) @available(macOS 10.7, *) optional func windowWillExitVersionBrowser(_ notification: Notification) @available(macOS 10.7, *) - @asyncHandler optional func windowDidExitVersionBrowser(_ notification: Notification) + optional func windowDidExitVersionBrowser(_ notification: Notification) @available(macOS 10.9, *) - @asyncHandler optional func windowDidChangeOcclusionState(_ notification: Notification) + optional func windowDidChangeOcclusionState(_ notification: Notification) } extension NSWindow { @available(macOS, introduced: 10.0, deprecated: 10.13, message: "This method shouldn’t be used as it doesn’t work in all drawing situations; instead, a subview should be used that implements the desired drawing behavior") diff --git a/macOS/AudioVideoBridging/AudioVideoBridging.swift b/macOS/AudioVideoBridging/AudioVideoBridging.swift index 1fe8b4e..ecb460e 100644 --- a/macOS/AudioVideoBridging/AudioVideoBridging.swift +++ b/macOS/AudioVideoBridging/AudioVideoBridging.swift @@ -427,21 +427,21 @@ struct AVB17221EntityPropertyChanged : OptionSet { } protocol AVB17221EntityDiscoveryDelegate { @available(macOS 10.8, *) - @asyncHandler func didAddRemoteEntity(_ newEntity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) + func didAddRemoteEntity(_ newEntity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) @available(macOS 10.8, *) - @asyncHandler func didRemoveRemoteEntity(_ oldEntity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) + func didRemoveRemoteEntity(_ oldEntity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) @available(macOS 10.8, *) - @asyncHandler func didRediscoverRemoteEntity(_ entity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) + func didRediscoverRemoteEntity(_ entity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) @available(macOS 10.8, *) - @asyncHandler func didUpdateRemoteEntity(_ entity: AVB17221Entity, changedProperties: AVB17221EntityPropertyChanged, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) + func didUpdateRemoteEntity(_ entity: AVB17221Entity, changedProperties: AVB17221EntityPropertyChanged, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) @available(macOS 10.8, *) - @asyncHandler func didAddLocalEntity(_ newEntity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) + func didAddLocalEntity(_ newEntity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) @available(macOS 10.8, *) - @asyncHandler func didRemoveLocalEntity(_ oldEntity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) + func didRemoveLocalEntity(_ oldEntity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) @available(macOS 10.8, *) - @asyncHandler func didRediscoverLocalEntity(_ entity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) + func didRediscoverLocalEntity(_ entity: AVB17221Entity, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) @available(macOS 10.8, *) - @asyncHandler func didUpdateLocalEntity(_ entity: AVB17221Entity, changedProperties: AVB17221EntityPropertyChanged, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) + func didUpdateLocalEntity(_ entity: AVB17221Entity, changedProperties: AVB17221EntityPropertyChanged, on17221EntityDiscovery entityDiscovery: AVB17221EntityDiscovery) } @available(macOS 10.8, *) class AVB17221EntityDiscovery : NSObject { diff --git a/macOS/AuthenticationServices/ASAuthorizationController.swift b/macOS/AuthenticationServices/ASAuthorizationController.swift index ca50cdc..df91b95 100644 --- a/macOS/AuthenticationServices/ASAuthorizationController.swift +++ b/macOS/AuthenticationServices/ASAuthorizationController.swift @@ -1,8 +1,8 @@ @available(macOS 10.15, *) protocol ASAuthorizationControllerDelegate : NSObjectProtocol { - @asyncHandler optional func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) - @asyncHandler optional func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) + optional func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) + optional func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) } @available(macOS 10.15, *) protocol ASAuthorizationControllerPresentationContextProviding : NSObjectProtocol { diff --git a/macOS/AuthenticationServices/ASWebAuthenticationSessionRequest.swift b/macOS/AuthenticationServices/ASWebAuthenticationSessionRequest.swift index 9305598..2a2e87e 100644 --- a/macOS/AuthenticationServices/ASWebAuthenticationSessionRequest.swift +++ b/macOS/AuthenticationServices/ASWebAuthenticationSessionRequest.swift @@ -1,8 +1,8 @@ @available(macOS 10.15, *) protocol ASWebAuthenticationSessionRequestDelegate : NSObjectProtocol { - @asyncHandler optional func authenticationSessionRequest(_ authenticationSessionRequest: ASWebAuthenticationSessionRequest, didCompleteWithCallbackURL callbackURL: URL) - @asyncHandler optional func authenticationSessionRequest(_ authenticationSessionRequest: ASWebAuthenticationSessionRequest, didCancelWithError error: Error) + optional func authenticationSessionRequest(_ authenticationSessionRequest: ASWebAuthenticationSessionRequest, didCompleteWithCallbackURL callbackURL: URL) + optional func authenticationSessionRequest(_ authenticationSessionRequest: ASWebAuthenticationSessionRequest, didCancelWithError error: Error) } @available(macOS 10.15, *) class ASWebAuthenticationSessionRequest : NSObject, NSSecureCoding, NSCopying { diff --git a/macOS/AutomaticAssessmentConfiguration/AutomaticAssessmentConfiguration.swift b/macOS/AutomaticAssessmentConfiguration/AutomaticAssessmentConfiguration.swift index 8759ab2..f9b3065 100644 --- a/macOS/AutomaticAssessmentConfiguration/AutomaticAssessmentConfiguration.swift +++ b/macOS/AutomaticAssessmentConfiguration/AutomaticAssessmentConfiguration.swift @@ -14,10 +14,10 @@ class AEAssessmentSession : NSObject { } @available(macOS 10.15.4, *) protocol AEAssessmentSessionDelegate : NSObjectProtocol { - @asyncHandler optional func assessmentSessionDidBegin(_ session: AEAssessmentSession) + optional func assessmentSessionDidBegin(_ session: AEAssessmentSession) optional func assessmentSession(_ session: AEAssessmentSession, failedToBeginWithError error: Error) optional func assessmentSession(_ session: AEAssessmentSession, wasInterruptedWithError error: Error) - @asyncHandler optional func assessmentSessionDidEnd(_ session: AEAssessmentSession) + optional func assessmentSessionDidEnd(_ session: AEAssessmentSession) } @available(macOS 10.15.4, *) let AEAssessmentErrorDomain: String diff --git a/macOS/Automator/AMWorkflowController.swift b/macOS/Automator/AMWorkflowController.swift index 96541fe..869fcf1 100644 --- a/macOS/Automator/AMWorkflowController.swift +++ b/macOS/Automator/AMWorkflowController.swift @@ -45,13 +45,13 @@ struct __AMWorkflowControllerDelegateRespondTo { protocol AMWorkflowControllerDelegate : NSObjectProtocol { optional func workflowControllerWillRun(_ controller: AMWorkflowController) optional func workflowControllerWillStop(_ controller: AMWorkflowController) - @asyncHandler optional func workflowControllerDidRun(_ controller: AMWorkflowController) - @asyncHandler optional func workflowControllerDidStop(_ controller: AMWorkflowController) + optional func workflowControllerDidRun(_ controller: AMWorkflowController) + optional func workflowControllerDidStop(_ controller: AMWorkflowController) @available(macOS 10.4, *) optional func workflowController(_ controller: AMWorkflowController, willRun action: AMAction) @available(macOS 10.4, *) - @asyncHandler optional func workflowController(_ controller: AMWorkflowController, didRun action: AMAction) - @asyncHandler optional func workflowController(_ controller: AMWorkflowController, didError error: Error) + optional func workflowController(_ controller: AMWorkflowController, didRun action: AMAction) + optional func workflowController(_ controller: AMWorkflowController, didError error: Error) } extension NSObject { @available(macOS, introduced: 10.4, deprecated: 10.13, message: "Use AMWorkflowControllerDelegate protocol.") diff --git a/macOS/CallKit/CXProvider.swift b/macOS/CallKit/CXProvider.swift index 1150934..bd30525 100644 --- a/macOS/CallKit/CXProvider.swift +++ b/macOS/CallKit/CXProvider.swift @@ -11,8 +11,8 @@ enum CXCallEndedReason : Int { } @available(macOS 11.0, *) protocol CXProviderDelegate : NSObjectProtocol { - @asyncHandler func providerDidReset(_ provider: CXProvider) - @asyncHandler optional func providerDidBegin(_ provider: CXProvider) + func providerDidReset(_ provider: CXProvider) + optional func providerDidBegin(_ provider: CXProvider) optional func provider(_ provider: CXProvider, execute transaction: CXTransaction) -> Bool optional func provider(_ provider: CXProvider, perform action: CXStartCallAction) optional func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) diff --git a/macOS/ContactsUI/CNContactPickerDelegate.swift b/macOS/ContactsUI/CNContactPickerDelegate.swift index aaec4d5..4f9adc3 100644 --- a/macOS/ContactsUI/CNContactPickerDelegate.swift +++ b/macOS/ContactsUI/CNContactPickerDelegate.swift @@ -2,5 +2,5 @@ @available(macOS 10.11, *) protocol CNContactPickerDelegate : NSObjectProtocol { optional func contactPickerWillClose(_ picker: CNContactPicker) - @asyncHandler optional func contactPickerDidClose(_ picker: CNContactPicker) + optional func contactPickerDidClose(_ picker: CNContactPicker) } diff --git a/macOS/CoreBluetooth/CBCentralManager.swift b/macOS/CoreBluetooth/CBCentralManager.swift index 764c206..967e01d 100644 --- a/macOS/CoreBluetooth/CBCentralManager.swift +++ b/macOS/CoreBluetooth/CBCentralManager.swift @@ -37,15 +37,15 @@ class CBCentralManager : CBManager { } protocol CBCentralManagerDelegate : NSObjectProtocol { @available(macOS 10.7, *) - @asyncHandler func centralManagerDidUpdateState(_ central: CBCentralManager) + func centralManagerDidUpdateState(_ central: CBCentralManager) @available(macOS 10.7, *) optional func centralManager(_ central: CBCentralManager, willRestoreState dict: [String : Any]) @available(macOS 10.7, *) - @asyncHandler optional func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) + optional func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) @available(macOS 10.7, *) - @asyncHandler optional func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) + optional func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) @available(macOS 10.7, *) - @asyncHandler optional func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) + optional func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) @available(macOS 10.7, *) - @asyncHandler optional func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) + optional func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) } diff --git a/macOS/CoreBluetooth/CBPeripheral.swift b/macOS/CoreBluetooth/CBPeripheral.swift index a51eb7c..8ef295b 100644 --- a/macOS/CoreBluetooth/CBPeripheral.swift +++ b/macOS/CoreBluetooth/CBPeripheral.swift @@ -42,33 +42,33 @@ class CBPeripheral : CBPeer { } protocol CBPeripheralDelegate : NSObjectProtocol { @available(macOS 10.9, *) - @asyncHandler optional func peripheralDidUpdateName(_ peripheral: CBPeripheral) + optional func peripheralDidUpdateName(_ peripheral: CBPeripheral) @available(macOS 10.9, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]) + optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]) @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, error: Error?) + optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, error: Error?) @available(macOS 10.13, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didReadRSSI RSSI: NSNumber, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didReadRSSI RSSI: NSNumber, error: Error?) @available(macOS 10.7, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) @available(macOS 10.7, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesFor service: CBService, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesFor service: CBService, error: Error?) @available(macOS 10.7, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) @available(macOS 10.7, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) @available(macOS 10.7, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) @available(macOS 10.7, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: Error?) @available(macOS 10.7, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverDescriptorsFor characteristic: CBCharacteristic, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didDiscoverDescriptorsFor characteristic: CBCharacteristic, error: Error?) @available(macOS 10.7, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor descriptor: CBDescriptor, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor descriptor: CBDescriptor, error: Error?) @available(macOS 10.7, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor descriptor: CBDescriptor, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor descriptor: CBDescriptor, error: Error?) @available(macOS 10.7, *) optional func peripheralIsReady(toSendWriteWithoutResponse peripheral: CBPeripheral) @available(macOS 10.13, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?) } diff --git a/macOS/CoreBluetooth/CBPeripheralManager.swift b/macOS/CoreBluetooth/CBPeripheralManager.swift index 23afcef..51eba48 100644 --- a/macOS/CoreBluetooth/CBPeripheralManager.swift +++ b/macOS/CoreBluetooth/CBPeripheralManager.swift @@ -51,27 +51,27 @@ class CBPeripheralManager : CBManager { } protocol CBPeripheralManagerDelegate : NSObjectProtocol { @available(macOS 10.9, *) - @asyncHandler func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) + func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) @available(macOS 10.9, *) optional func peripheralManager(_ peripheral: CBPeripheralManager, willRestoreState dict: [String : Any]) @available(macOS 10.9, *) - @asyncHandler optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error: Error?) + optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error: Error?) @available(macOS 10.9, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) @available(macOS 10.9, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didSubscribeTo characteristic: CBCharacteristic) + optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didSubscribeTo characteristic: CBCharacteristic) @available(macOS 10.9, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didUnsubscribeFrom characteristic: CBCharacteristic) + optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didUnsubscribeFrom characteristic: CBCharacteristic) @available(macOS 10.9, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveRead request: CBATTRequest) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveRead request: CBATTRequest) @available(macOS 10.9, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) @available(macOS 10.9, *) optional func peripheralManagerIsReady(toUpdateSubscribers peripheral: CBPeripheralManager) @available(macOS 10.9, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) @available(macOS 10.9, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didUnpublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didUnpublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) @available(macOS 10.13, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: Error?) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: Error?) } diff --git a/macOS/CoreData/NSFetchedResultsController.swift b/macOS/CoreData/NSFetchedResultsController.swift index 010f8be..182258a 100644 --- a/macOS/CoreData/NSFetchedResultsController.swift +++ b/macOS/CoreData/NSFetchedResultsController.swift @@ -34,15 +34,15 @@ enum NSFetchedResultsChangeType : UInt { } protocol NSFetchedResultsControllerDelegate : NSObjectProtocol { @available(macOS 10.15, *) - @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChangeContentWith diff: CollectionDifference) + optional func controller(_ controller: NSFetchedResultsController, didChangeContentWith diff: CollectionDifference) @available(macOS 10.12, *) - @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) + optional func controller(_ controller: NSFetchedResultsController, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) @available(macOS 10.12, *) - @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChange sectionInfo: NSFetchedResultsSectionInfo, atSectionIndex sectionIndex: Int, for type: NSFetchedResultsChangeType) + optional func controller(_ controller: NSFetchedResultsController, didChange sectionInfo: NSFetchedResultsSectionInfo, atSectionIndex sectionIndex: Int, for type: NSFetchedResultsChangeType) @available(macOS 10.12, *) optional func controllerWillChangeContent(_ controller: NSFetchedResultsController) @available(macOS 10.12, *) - @asyncHandler optional func controllerDidChangeContent(_ controller: NSFetchedResultsController) + optional func controllerDidChangeContent(_ controller: NSFetchedResultsController) @available(macOS 10.12, *) optional func controller(_ controller: NSFetchedResultsController, sectionIndexTitleForSectionName sectionName: String) -> String? } diff --git a/macOS/CoreLocation/CLLocationManagerDelegate.swift b/macOS/CoreLocation/CLLocationManagerDelegate.swift index 8ba5612..f650ee6 100644 --- a/macOS/CoreLocation/CLLocationManagerDelegate.swift +++ b/macOS/CoreLocation/CLLocationManagerDelegate.swift @@ -1,43 +1,43 @@ protocol CLLocationManagerDelegate : NSObjectProtocol { @available(macOS 10.6, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didUpdateTo newLocation: CLLocation, from oldLocation: CLLocation) + optional func locationManager(_ manager: CLLocationManager, didUpdateTo newLocation: CLLocation, from oldLocation: CLLocation) @available(macOS 10.9, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) + optional func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) @available(macOS 10.15, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) + optional func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) @available(macOS 10.15, *) optional func locationManagerShouldDisplayHeadingCalibration(_ manager: CLLocationManager) -> Bool @available(macOS 10.10, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didDetermineState state: CLRegionState, for region: CLRegion) + optional func locationManager(_ manager: CLLocationManager, didDetermineState state: CLRegionState, for region: CLRegion) @available(macOS, introduced: 10.15, deprecated: 10.15) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didRangeBeacons beacons: [CLBeacon], in region: CLBeaconRegion) + optional func locationManager(_ manager: CLLocationManager, didRangeBeacons beacons: [CLBeacon], in region: CLBeaconRegion) @available(macOS, introduced: 10.15, deprecated: 10.15) optional func locationManager(_ manager: CLLocationManager, rangingBeaconsDidFailFor region: CLBeaconRegion, withError error: Error) @available(macOS 10.15, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didRange beacons: [CLBeacon], satisfying beaconConstraint: CLBeaconIdentityConstraint) + optional func locationManager(_ manager: CLLocationManager, didRange beacons: [CLBeacon], satisfying beaconConstraint: CLBeaconIdentityConstraint) @available(macOS 10.15, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didFailRangingFor beaconConstraint: CLBeaconIdentityConstraint, error: Error) + optional func locationManager(_ manager: CLLocationManager, didFailRangingFor beaconConstraint: CLBeaconIdentityConstraint, error: Error) @available(macOS 10.8, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) + optional func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) @available(macOS 10.8, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) + optional func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) @available(macOS 10.6, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) + optional func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) @available(macOS 10.8, *) optional func locationManager(_ manager: CLLocationManager, monitoringDidFailFor region: CLRegion?, withError error: Error) @available(macOS, introduced: 10.7, deprecated: 11.0) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) + optional func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) @available(macOS 11.0, *) - @asyncHandler optional func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) + optional func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) @available(macOS 10.8, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didStartMonitoringFor region: CLRegion) + optional func locationManager(_ manager: CLLocationManager, didStartMonitoringFor region: CLRegion) @available(macOS 10.15, *) - @asyncHandler optional func locationManagerDidPauseLocationUpdates(_ manager: CLLocationManager) + optional func locationManagerDidPauseLocationUpdates(_ manager: CLLocationManager) @available(macOS 10.15, *) - @asyncHandler optional func locationManagerDidResumeLocationUpdates(_ manager: CLLocationManager) + optional func locationManagerDidResumeLocationUpdates(_ manager: CLLocationManager) @available(macOS 10.9, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didFinishDeferredUpdatesWithError error: Error?) + optional func locationManager(_ manager: CLLocationManager, didFinishDeferredUpdatesWithError error: Error?) @available(macOS 10.15, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didVisit visit: CLVisit) + optional func locationManager(_ manager: CLLocationManager, didVisit visit: CLVisit) } diff --git a/macOS/CoreSpotlight/CSSearchableIndex.swift b/macOS/CoreSpotlight/CSSearchableIndex.swift index 84fef3b..0216b00 100644 --- a/macOS/CoreSpotlight/CSSearchableIndex.swift +++ b/macOS/CoreSpotlight/CSSearchableIndex.swift @@ -41,8 +41,8 @@ extension CSSearchableIndex { protocol CSSearchableIndexDelegate : NSObjectProtocol { func searchableIndex(_ searchableIndex: CSSearchableIndex, reindexAllSearchableItemsWithAcknowledgementHandler acknowledgementHandler: @escaping () -> Void) func searchableIndex(_ searchableIndex: CSSearchableIndex, reindexSearchableItemsWithIdentifiers identifiers: [String], acknowledgementHandler: @escaping () -> Void) - @asyncHandler optional func searchableIndexDidThrottle(_ searchableIndex: CSSearchableIndex) - @asyncHandler optional func searchableIndexDidFinishThrottle(_ searchableIndex: CSSearchableIndex) + optional func searchableIndexDidThrottle(_ searchableIndex: CSSearchableIndex) + optional func searchableIndexDidFinishThrottle(_ searchableIndex: CSSearchableIndex) @available(macOS 10.11, *) optional func data(for searchableIndex: CSSearchableIndex, itemIdentifier: String, typeIdentifier: String) throws -> Data @available(macOS 10.11, *) diff --git a/macOS/CoreWLAN/CWWiFiClient.swift b/macOS/CoreWLAN/CWWiFiClient.swift index 179f186..413cad8 100644 --- a/macOS/CoreWLAN/CWWiFiClient.swift +++ b/macOS/CoreWLAN/CWWiFiClient.swift @@ -2,13 +2,13 @@ protocol CWEventDelegate { optional func clientConnectionInterrupted() optional func clientConnectionInvalidated() - @asyncHandler optional func powerStateDidChangeForWiFiInterface(withName interfaceName: String) - @asyncHandler optional func ssidDidChangeForWiFiInterface(withName interfaceName: String) - @asyncHandler optional func bssidDidChangeForWiFiInterface(withName interfaceName: String) - @asyncHandler optional func countryCodeDidChangeForWiFiInterface(withName interfaceName: String) - @asyncHandler optional func linkDidChangeForWiFiInterface(withName interfaceName: String) - @asyncHandler optional func linkQualityDidChangeForWiFiInterface(withName interfaceName: String, rssi: Int, transmitRate: Double) - @asyncHandler optional func modeDidChangeForWiFiInterface(withName interfaceName: String) + optional func powerStateDidChangeForWiFiInterface(withName interfaceName: String) + optional func ssidDidChangeForWiFiInterface(withName interfaceName: String) + optional func bssidDidChangeForWiFiInterface(withName interfaceName: String) + optional func countryCodeDidChangeForWiFiInterface(withName interfaceName: String) + optional func linkDidChangeForWiFiInterface(withName interfaceName: String) + optional func linkQualityDidChangeForWiFiInterface(withName interfaceName: String, rssi: Int, transmitRate: Double) + optional func modeDidChangeForWiFiInterface(withName interfaceName: String) optional func scanCacheUpdatedForWiFiInterface(withName interfaceName: String) } @available(macOS 10.10, *) diff --git a/macOS/ExternalAccessory/EAAccessory.swift b/macOS/ExternalAccessory/EAAccessory.swift index 7a29d9a..71387fc 100644 --- a/macOS/ExternalAccessory/EAAccessory.swift +++ b/macOS/ExternalAccessory/EAAccessory.swift @@ -27,5 +27,5 @@ class EAAccessory : NSObject { } protocol EAAccessoryDelegate : NSObjectProtocol { @available(macOS 10.13, *) - @asyncHandler optional func accessoryDidDisconnect(_ accessory: EAAccessory) + optional func accessoryDidDisconnect(_ accessory: EAAccessory) } diff --git a/macOS/FileProvider/NSFileProviderEnumerating.swift b/macOS/FileProvider/NSFileProviderEnumerating.swift index 0e29097..491e615 100644 --- a/macOS/FileProvider/NSFileProviderEnumerating.swift +++ b/macOS/FileProvider/NSFileProviderEnumerating.swift @@ -18,15 +18,15 @@ extension NSFileProviderPage { static let initialPageSortedByName: NSData } protocol NSFileProviderEnumerationObserver : NSObjectProtocol { - @asyncHandler func didEnumerate(_ updatedItems: [NSFileProviderItemProtocol]) + func didEnumerate(_ updatedItems: [NSFileProviderItemProtocol]) func finishEnumerating(upTo nextPage: NSFileProviderPage?) func finishEnumeratingWithError(_ error: Error) @available(macOS 11.0, *) optional var suggestedPageSize: Int { get } } protocol NSFileProviderChangeObserver : NSObjectProtocol { - @asyncHandler func didUpdate(_ updatedItems: [NSFileProviderItemProtocol]) - @asyncHandler func didDeleteItems(withIdentifiers deletedItemIdentifiers: [NSFileProviderItemIdentifier]) + func didUpdate(_ updatedItems: [NSFileProviderItemProtocol]) + func didDeleteItems(withIdentifiers deletedItemIdentifiers: [NSFileProviderItemIdentifier]) func finishEnumeratingChanges(upTo anchor: NSFileProviderSyncAnchor, moreComing: Bool) func finishEnumeratingWithError(_ error: Error) @available(macOS 11.0, *) diff --git a/macOS/FileProvider/NSFileProviderReplicatedExtension.swift b/macOS/FileProvider/NSFileProviderReplicatedExtension.swift index 89baacf..30d1674 100644 --- a/macOS/FileProvider/NSFileProviderReplicatedExtension.swift +++ b/macOS/FileProvider/NSFileProviderReplicatedExtension.swift @@ -45,9 +45,9 @@ protocol NSFileProviderReplicatedExtension : NSFileProviderEnumerating { func createItem(basedOn itemTemplate: NSFileProviderItem, fields: NSFileProviderItemFields, contents url: URL?, options: NSFileProviderCreateItemOptions = [], request: NSFileProviderRequest, completionHandler: @escaping (NSFileProviderItem?, NSFileProviderItemFields, Bool, Error?) -> Void) -> Progress func modifyItem(_ item: NSFileProviderItem, baseVersion version: NSFileProviderItemVersion, changedFields: NSFileProviderItemFields, contents newContents: URL?, options: NSFileProviderModifyItemOptions = [], request: NSFileProviderRequest, completionHandler: @escaping (NSFileProviderItem?, NSFileProviderItemFields, Bool, Error?) -> Void) -> Progress func deleteItem(identifier: NSFileProviderItemIdentifier, baseVersion version: NSFileProviderItemVersion, options: NSFileProviderDeleteItemOptions = [], request: NSFileProviderRequest, completionHandler: @escaping (Error?) -> Void) -> Progress - @asyncHandler optional func importDidFinish(completionHandler: @escaping () -> Void) + optional func importDidFinish(completionHandler: @escaping () -> Void) optional func importDidFinish() async - @asyncHandler optional func materializedItemsDidChange(completionHandler: @escaping () -> Void) + optional func materializedItemsDidChange(completionHandler: @escaping () -> Void) optional func materializedItemsDidChange() async } @available(macOS 11.0, *) diff --git a/macOS/Foundation/NSFilePresenter.swift b/macOS/Foundation/NSFilePresenter.swift index 33825c7..2079b93 100644 --- a/macOS/Foundation/NSFilePresenter.swift +++ b/macOS/Foundation/NSFilePresenter.swift @@ -11,27 +11,27 @@ protocol NSFilePresenter : NSObjectProtocol { optional func savePresentedItemChanges() async throws optional func accommodatePresentedItemDeletion(completionHandler: @escaping (Error?) -> Void) optional func accommodatePresentedItemDeletion() async throws - @asyncHandler optional func presentedItemDidMove(to newURL: URL) - @asyncHandler optional func presentedItemDidChange() + optional func presentedItemDidMove(to newURL: URL) + optional func presentedItemDidChange() @available(macOS 10.13, *) - @asyncHandler optional func presentedItemDidChangeUbiquityAttributes(_ attributes: Set) + optional func presentedItemDidChangeUbiquityAttributes(_ attributes: Set) @available(macOS 10.13, *) optional var observedPresentedItemUbiquityAttributes: Set { get } @available(macOS 10.7, *) - @asyncHandler optional func presentedItemDidGain(_ version: NSFileVersion) + optional func presentedItemDidGain(_ version: NSFileVersion) @available(macOS 10.7, *) - @asyncHandler optional func presentedItemDidLose(_ version: NSFileVersion) + optional func presentedItemDidLose(_ version: NSFileVersion) @available(macOS 10.7, *) - @asyncHandler optional func presentedItemDidResolveConflict(_ version: NSFileVersion) + optional func presentedItemDidResolveConflict(_ version: NSFileVersion) optional func accommodatePresentedSubitemDeletion(at url: URL, completionHandler: @escaping (Error?) -> Void) optional func accommodatePresentedSubitemDeletion(at url: URL) async throws - @asyncHandler optional func presentedSubitemDidAppear(at url: URL) - @asyncHandler optional func presentedSubitem(at oldURL: URL, didMoveTo newURL: URL) - @asyncHandler optional func presentedSubitemDidChange(at url: URL) + optional func presentedSubitemDidAppear(at url: URL) + optional func presentedSubitem(at oldURL: URL, didMoveTo newURL: URL) + optional func presentedSubitemDidChange(at url: URL) @available(macOS 10.7, *) - @asyncHandler optional func presentedSubitem(at url: URL, didGain version: NSFileVersion) + optional func presentedSubitem(at url: URL, didGain version: NSFileVersion) @available(macOS 10.7, *) - @asyncHandler optional func presentedSubitem(at url: URL, didLose version: NSFileVersion) + optional func presentedSubitem(at url: URL, didLose version: NSFileVersion) @available(macOS 10.7, *) - @asyncHandler optional func presentedSubitem(at url: URL, didResolve version: NSFileVersion) + optional func presentedSubitem(at url: URL, didResolve version: NSFileVersion) } diff --git a/macOS/Foundation/NSKeyedArchiver.swift b/macOS/Foundation/NSKeyedArchiver.swift index 4f83d00..ab5c1f5 100644 --- a/macOS/Foundation/NSKeyedArchiver.swift +++ b/macOS/Foundation/NSKeyedArchiver.swift @@ -80,17 +80,17 @@ extension NSKeyedUnarchiver { } protocol NSKeyedArchiverDelegate : NSObjectProtocol { optional func archiver(_ archiver: NSKeyedArchiver, willEncode object: Any) -> Any? - @asyncHandler optional func archiver(_ archiver: NSKeyedArchiver, didEncode object: Any?) + optional func archiver(_ archiver: NSKeyedArchiver, didEncode object: Any?) optional func archiver(_ archiver: NSKeyedArchiver, willReplace object: Any?, with newObject: Any?) optional func archiverWillFinish(_ archiver: NSKeyedArchiver) - @asyncHandler optional func archiverDidFinish(_ archiver: NSKeyedArchiver) + optional func archiverDidFinish(_ archiver: NSKeyedArchiver) } protocol NSKeyedUnarchiverDelegate : NSObjectProtocol { optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, cannotDecodeObjectOfClassName name: String, originalClasses classNames: [String]) -> AnyClass? optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, didDecode object: Any?) -> Any? optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, willReplace object: Any, with newObject: Any) optional func unarchiverWillFinish(_ unarchiver: NSKeyedUnarchiver) - @asyncHandler optional func unarchiverDidFinish(_ unarchiver: NSKeyedUnarchiver) + optional func unarchiverDidFinish(_ unarchiver: NSKeyedUnarchiver) } extension NSObject { var classForKeyedArchiver: AnyClass? { get } diff --git a/macOS/Foundation/NSNetServices.swift b/macOS/Foundation/NSNetServices.swift index 8bbe1f2..83933b4 100644 --- a/macOS/Foundation/NSNetServices.swift +++ b/macOS/Foundation/NSNetServices.swift @@ -70,23 +70,23 @@ class NetServiceBrowser : NSObject { @available(macOS 10.2, *) protocol NetServiceDelegate : NSObjectProtocol { optional func netServiceWillPublish(_ sender: NetService) - @asyncHandler optional func netServiceDidPublish(_ sender: NetService) - @asyncHandler optional func netService(_ sender: NetService, didNotPublish errorDict: [String : NSNumber]) + optional func netServiceDidPublish(_ sender: NetService) + optional func netService(_ sender: NetService, didNotPublish errorDict: [String : NSNumber]) optional func netServiceWillResolve(_ sender: NetService) - @asyncHandler optional func netServiceDidResolveAddress(_ sender: NetService) - @asyncHandler optional func netService(_ sender: NetService, didNotResolve errorDict: [String : NSNumber]) - @asyncHandler optional func netServiceDidStop(_ sender: NetService) - @asyncHandler optional func netService(_ sender: NetService, didUpdateTXTRecord data: Data) + optional func netServiceDidResolveAddress(_ sender: NetService) + optional func netService(_ sender: NetService, didNotResolve errorDict: [String : NSNumber]) + optional func netServiceDidStop(_ sender: NetService) + optional func netService(_ sender: NetService, didUpdateTXTRecord data: Data) @available(macOS 10.9, *) - @asyncHandler optional func netService(_ sender: NetService, didAcceptConnectionWith inputStream: InputStream, outputStream: OutputStream) + optional func netService(_ sender: NetService, didAcceptConnectionWith inputStream: InputStream, outputStream: OutputStream) } @available(macOS 10.2, *) protocol NetServiceBrowserDelegate : NSObjectProtocol { optional func netServiceBrowserWillSearch(_ browser: NetServiceBrowser) - @asyncHandler optional func netServiceBrowserDidStopSearch(_ browser: NetServiceBrowser) - @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didNotSearch errorDict: [String : NSNumber]) - @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didFindDomain domainString: String, moreComing: Bool) - @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didFind service: NetService, moreComing: Bool) - @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemoveDomain domainString: String, moreComing: Bool) - @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemove service: NetService, moreComing: Bool) + optional func netServiceBrowserDidStopSearch(_ browser: NetServiceBrowser) + optional func netServiceBrowser(_ browser: NetServiceBrowser, didNotSearch errorDict: [String : NSNumber]) + optional func netServiceBrowser(_ browser: NetServiceBrowser, didFindDomain domainString: String, moreComing: Bool) + optional func netServiceBrowser(_ browser: NetServiceBrowser, didFind service: NetService, moreComing: Bool) + optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemoveDomain domainString: String, moreComing: Bool) + optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemove service: NetService, moreComing: Bool) } diff --git a/macOS/Foundation/NSSpellServer.swift b/macOS/Foundation/NSSpellServer.swift index db90af6..cee62e3 100644 --- a/macOS/Foundation/NSSpellServer.swift +++ b/macOS/Foundation/NSSpellServer.swift @@ -16,8 +16,8 @@ struct __ssFlags { protocol NSSpellServerDelegate : NSObjectProtocol { optional func spellServer(_ sender: NSSpellServer, findMisspelledWordIn stringToCheck: String, language: String, wordCount: UnsafeMutablePointer, countOnly: Bool) -> NSRange optional func spellServer(_ sender: NSSpellServer, suggestGuessesForWord word: String, inLanguage language: String) -> [String]? - @asyncHandler optional func spellServer(_ sender: NSSpellServer, didLearnWord word: String, inLanguage language: String) - @asyncHandler optional func spellServer(_ sender: NSSpellServer, didForgetWord word: String, inLanguage language: String) + optional func spellServer(_ sender: NSSpellServer, didLearnWord word: String, inLanguage language: String) + optional func spellServer(_ sender: NSSpellServer, didForgetWord word: String, inLanguage language: String) optional func spellServer(_ sender: NSSpellServer, suggestCompletionsForPartialWordRange range: NSRange, in string: String, language: String) -> [String]? @available(macOS 10.5, *) optional func spellServer(_ sender: NSSpellServer, checkGrammarIn stringToCheck: String, language: String?, details: AutoreleasingUnsafeMutablePointer?) -> NSRange diff --git a/macOS/Foundation/NSURLConnection.swift b/macOS/Foundation/NSURLConnection.swift index 4c8e877..17d3da7 100644 --- a/macOS/Foundation/NSURLConnection.swift +++ b/macOS/Foundation/NSURLConnection.swift @@ -22,31 +22,31 @@ class NSURLConnection : NSObject { } @available(macOS 10.2, *) protocol NSURLConnectionDelegate : NSObjectProtocol { - @asyncHandler optional func connection(_ connection: NSURLConnection, didFailWithError error: Error) + optional func connection(_ connection: NSURLConnection, didFailWithError error: Error) optional func connectionShouldUseCredentialStorage(_ connection: NSURLConnection) -> Bool optional func connection(_ connection: NSURLConnection, willSendRequestFor challenge: URLAuthenticationChallenge) @available(macOS, introduced: 10.6, deprecated: 10.10, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") optional func connection(_ connection: NSURLConnection, canAuthenticateAgainstProtectionSpace protectionSpace: URLProtectionSpace) -> Bool @available(macOS, introduced: 10.2, deprecated: 10.10, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") - @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive challenge: URLAuthenticationChallenge) + optional func connection(_ connection: NSURLConnection, didReceive challenge: URLAuthenticationChallenge) @available(macOS, introduced: 10.2, deprecated: 10.10, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") - @asyncHandler optional func connection(_ connection: NSURLConnection, didCancel challenge: URLAuthenticationChallenge) + optional func connection(_ connection: NSURLConnection, didCancel challenge: URLAuthenticationChallenge) } @available(macOS 10.2, *) protocol NSURLConnectionDataDelegate : NSURLConnectionDelegate { optional func connection(_ connection: NSURLConnection, willSend request: URLRequest, redirectResponse response: URLResponse?) -> URLRequest? - @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive response: URLResponse) - @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive data: Data) + optional func connection(_ connection: NSURLConnection, didReceive response: URLResponse) + optional func connection(_ connection: NSURLConnection, didReceive data: Data) optional func connection(_ connection: NSURLConnection, needNewBodyStream request: URLRequest) -> InputStream? - @asyncHandler optional func connection(_ connection: NSURLConnection, didSendBodyData bytesWritten: Int, totalBytesWritten: Int, totalBytesExpectedToWrite: Int) + optional func connection(_ connection: NSURLConnection, didSendBodyData bytesWritten: Int, totalBytesWritten: Int, totalBytesExpectedToWrite: Int) optional func connection(_ connection: NSURLConnection, willCacheResponse cachedResponse: CachedURLResponse) -> CachedURLResponse? - @asyncHandler optional func connectionDidFinishLoading(_ connection: NSURLConnection) + optional func connectionDidFinishLoading(_ connection: NSURLConnection) } @available(macOS 10.2, *) protocol NSURLConnectionDownloadDelegate : NSURLConnectionDelegate { - @asyncHandler optional func connection(_ connection: NSURLConnection, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, expectedTotalBytes: Int64) - @asyncHandler optional func connectionDidResumeDownloading(_ connection: NSURLConnection, totalBytesWritten: Int64, expectedTotalBytes: Int64) - @asyncHandler func connectionDidFinishDownloading(_ connection: NSURLConnection, destinationURL: URL) + optional func connection(_ connection: NSURLConnection, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, expectedTotalBytes: Int64) + optional func connectionDidResumeDownloading(_ connection: NSURLConnection, totalBytesWritten: Int64, expectedTotalBytes: Int64) + func connectionDidFinishDownloading(_ connection: NSURLConnection, destinationURL: URL) } extension NSURLConnection { @available(macOS, introduced: 10.3, deprecated: 10.11, message: "Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h") diff --git a/macOS/Foundation/NSURLDownload.swift b/macOS/Foundation/NSURLDownload.swift index 9a0ca47..fcbc9fe 100644 --- a/macOS/Foundation/NSURLDownload.swift +++ b/macOS/Foundation/NSURLDownload.swift @@ -14,18 +14,18 @@ class NSURLDownload : NSObject { } @available(macOS 10.2, *) protocol NSURLDownloadDelegate : NSObjectProtocol { - @asyncHandler optional func downloadDidBegin(_ download: NSURLDownload) + optional func downloadDidBegin(_ download: NSURLDownload) optional func download(_ download: NSURLDownload, willSend request: URLRequest, redirectResponse: URLResponse?) -> URLRequest? optional func download(_ connection: NSURLDownload, canAuthenticateAgainstProtectionSpace protectionSpace: URLProtectionSpace) -> Bool - @asyncHandler optional func download(_ download: NSURLDownload, didReceive challenge: URLAuthenticationChallenge) - @asyncHandler optional func download(_ download: NSURLDownload, didCancel challenge: URLAuthenticationChallenge) + optional func download(_ download: NSURLDownload, didReceive challenge: URLAuthenticationChallenge) + optional func download(_ download: NSURLDownload, didCancel challenge: URLAuthenticationChallenge) optional func downloadShouldUseCredentialStorage(_ download: NSURLDownload) -> Bool - @asyncHandler optional func download(_ download: NSURLDownload, didReceive response: URLResponse) + optional func download(_ download: NSURLDownload, didReceive response: URLResponse) optional func download(_ download: NSURLDownload, willResumeWith response: URLResponse, fromByte startingByte: Int64) - @asyncHandler optional func download(_ download: NSURLDownload, didReceiveDataOfLength length: Int) + optional func download(_ download: NSURLDownload, didReceiveDataOfLength length: Int) optional func download(_ download: NSURLDownload, shouldDecodeSourceDataOfMIMEType encodingType: String) -> Bool optional func download(_ download: NSURLDownload, decideDestinationWithSuggestedFilename filename: String) - @asyncHandler optional func download(_ download: NSURLDownload, didCreateDestination path: String) - @asyncHandler optional func downloadDidFinish(_ download: NSURLDownload) - @asyncHandler optional func download(_ download: NSURLDownload, didFailWithError error: Error) + optional func download(_ download: NSURLDownload, didCreateDestination path: String) + optional func downloadDidFinish(_ download: NSURLDownload) + optional func download(_ download: NSURLDownload, didFailWithError error: Error) } diff --git a/macOS/Foundation/NSURLProtocol.swift b/macOS/Foundation/NSURLProtocol.swift index 3bd27b6..caab35d 100644 --- a/macOS/Foundation/NSURLProtocol.swift +++ b/macOS/Foundation/NSURLProtocol.swift @@ -3,12 +3,12 @@ protocol URLProtocolClient : NSObjectProtocol { func urlProtocol(_ protocol: URLProtocol, wasRedirectedTo request: URLRequest, redirectResponse: URLResponse) func urlProtocol(_ protocol: URLProtocol, cachedResponseIsValid cachedResponse: CachedURLResponse) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didReceive response: URLResponse, cacheStoragePolicy policy: URLCache.StoragePolicy) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didLoad data: Data) - @asyncHandler func urlProtocolDidFinishLoading(_ protocol: URLProtocol) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didFailWithError error: Error) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didReceive challenge: URLAuthenticationChallenge) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didCancel challenge: URLAuthenticationChallenge) + func urlProtocol(_ protocol: URLProtocol, didReceive response: URLResponse, cacheStoragePolicy policy: URLCache.StoragePolicy) + func urlProtocol(_ protocol: URLProtocol, didLoad data: Data) + func urlProtocolDidFinishLoading(_ protocol: URLProtocol) + func urlProtocol(_ protocol: URLProtocol, didFailWithError error: Error) + func urlProtocol(_ protocol: URLProtocol, didReceive challenge: URLAuthenticationChallenge) + func urlProtocol(_ protocol: URLProtocol, didCancel challenge: URLAuthenticationChallenge) } @available(macOS 10.2, *) class URLProtocol : NSObject { diff --git a/macOS/Foundation/NSURLSession.swift b/macOS/Foundation/NSURLSession.swift index bb2cadb..e7c11ec 100644 --- a/macOS/Foundation/NSURLSession.swift +++ b/macOS/Foundation/NSURLSession.swift @@ -274,11 +274,11 @@ extension URLSession { } @available(macOS 10.9, *) protocol URLSessionDelegate : NSObjectProtocol { - @asyncHandler optional func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) - @asyncHandler optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) + optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) @available(macOS 11.0, *) - @asyncHandler optional func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) + optional func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) } @available(macOS 10.9, *) protocol URLSessionTaskDelegate : URLSessionDelegate { @@ -290,43 +290,43 @@ protocol URLSessionTaskDelegate : URLSessionDelegate { optional func urlSession(_ session: URLSession, taskIsWaitingForConnectivity task: URLSessionTask) optional func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest, completionHandler: @escaping (URLRequest?) -> Void) optional func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest) async -> URLRequest? - @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) optional func urlSession(_ session: URLSession, task: URLSessionTask, needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) optional func urlSession(_ session: URLSession, task: URLSessionTask) async -> InputStream? - @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) @available(macOS 10.12, *) - @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) - @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) } @available(macOS 10.9, *) protocol URLSessionDataDelegate : URLSessionTaskDelegate { - @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse) async -> URLSession.ResponseDisposition - @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome downloadTask: URLSessionDownloadTask) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome downloadTask: URLSessionDownloadTask) @available(macOS 10.11, *) - @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome streamTask: URLSessionStreamTask) - @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome streamTask: URLSessionStreamTask) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse, completionHandler: @escaping (CachedURLResponse?) -> Void) optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse) async -> CachedURLResponse? } @available(macOS 10.9, *) protocol URLSessionDownloadDelegate : URLSessionTaskDelegate { - @asyncHandler func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) - @asyncHandler optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) - @asyncHandler optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) + func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) + optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) + optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) } @available(macOS 10.11, *) protocol URLSessionStreamDelegate : URLSessionTaskDelegate { optional func urlSession(_ session: URLSession, readClosedFor streamTask: URLSessionStreamTask) optional func urlSession(_ session: URLSession, writeClosedFor streamTask: URLSessionStreamTask) optional func urlSession(_ session: URLSession, betterRouteDiscoveredFor streamTask: URLSessionStreamTask) - @asyncHandler optional func urlSession(_ session: URLSession, streamTask: URLSessionStreamTask, didBecome inputStream: InputStream, outputStream: OutputStream) + optional func urlSession(_ session: URLSession, streamTask: URLSessionStreamTask, didBecome inputStream: InputStream, outputStream: OutputStream) } @available(macOS 10.15, *) protocol URLSessionWebSocketDelegate : URLSessionTaskDelegate { - @asyncHandler optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) - @asyncHandler optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) + optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) + optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) } @available(macOS 10.9, *) let NSURLSessionDownloadTaskResumeData: String diff --git a/macOS/Foundation/NSUserActivity.swift b/macOS/Foundation/NSUserActivity.swift index e948b7c..bbd6a5f 100644 --- a/macOS/Foundation/NSUserActivity.swift +++ b/macOS/Foundation/NSUserActivity.swift @@ -49,5 +49,5 @@ let NSUserActivityTypeBrowsingWeb: String protocol NSUserActivityDelegate : NSObjectProtocol { optional func userActivityWillSave(_ userActivity: NSUserActivity) optional func userActivityWasContinued(_ userActivity: NSUserActivity) - @asyncHandler optional func userActivity(_ userActivity: NSUserActivity, didReceive inputStream: InputStream, outputStream: OutputStream) + optional func userActivity(_ userActivity: NSUserActivity, didReceive inputStream: InputStream, outputStream: OutputStream) } diff --git a/macOS/Foundation/NSUserNotification.swift b/macOS/Foundation/NSUserNotification.swift index 27fdcef..8c2f3a3 100644 --- a/macOS/Foundation/NSUserNotification.swift +++ b/macOS/Foundation/NSUserNotification.swift @@ -65,9 +65,9 @@ class NSUserNotificationCenter : NSObject { } protocol NSUserNotificationCenterDelegate : NSObjectProtocol { @available(macOS, introduced: 10.8, deprecated: 11.0, message: "All NSUserNotifications API should be replaced with UserNotifications.frameworks API") - @asyncHandler optional func userNotificationCenter(_ center: NSUserNotificationCenter, didDeliver notification: NSUserNotification) + optional func userNotificationCenter(_ center: NSUserNotificationCenter, didDeliver notification: NSUserNotification) @available(macOS, introduced: 10.8, deprecated: 11.0, message: "All NSUserNotifications API should be replaced with UserNotifications.frameworks API") - @asyncHandler optional func userNotificationCenter(_ center: NSUserNotificationCenter, didActivate notification: NSUserNotification) + optional func userNotificationCenter(_ center: NSUserNotificationCenter, didActivate notification: NSUserNotification) @available(macOS, introduced: 10.8, deprecated: 11.0, message: "All NSUserNotifications API should be replaced with UserNotifications.frameworks API") optional func userNotificationCenter(_ center: NSUserNotificationCenter, shouldPresent notification: NSUserNotification) -> Bool } diff --git a/macOS/Foundation/NSXMLParser.swift b/macOS/Foundation/NSXMLParser.swift index 298e92f..09a76f5 100644 --- a/macOS/Foundation/NSXMLParser.swift +++ b/macOS/Foundation/NSXMLParser.swift @@ -23,18 +23,18 @@ extension XMLParser { var columnNumber: Int { get } } protocol XMLParserDelegate : NSObjectProtocol { - @asyncHandler optional func parserDidStartDocument(_ parser: XMLParser) - @asyncHandler optional func parserDidEndDocument(_ parser: XMLParser) + optional func parserDidStartDocument(_ parser: XMLParser) + optional func parserDidEndDocument(_ parser: XMLParser) optional func parser(_ parser: XMLParser, foundNotationDeclarationWithName name: String, publicID: String?, systemID: String?) optional func parser(_ parser: XMLParser, foundUnparsedEntityDeclarationWithName name: String, publicID: String?, systemID: String?, notationName: String?) optional func parser(_ parser: XMLParser, foundAttributeDeclarationWithName attributeName: String, forElement elementName: String, type: String?, defaultValue: String?) optional func parser(_ parser: XMLParser, foundElementDeclarationWithName elementName: String, model: String) optional func parser(_ parser: XMLParser, foundInternalEntityDeclarationWithName name: String, value: String?) optional func parser(_ parser: XMLParser, foundExternalEntityDeclarationWithName name: String, publicID: String?, systemID: String?) - @asyncHandler optional func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) - @asyncHandler optional func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) - @asyncHandler optional func parser(_ parser: XMLParser, didStartMappingPrefix prefix: String, toURI namespaceURI: String) - @asyncHandler optional func parser(_ parser: XMLParser, didEndMappingPrefix prefix: String) + optional func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) + optional func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) + optional func parser(_ parser: XMLParser, didStartMappingPrefix prefix: String, toURI namespaceURI: String) + optional func parser(_ parser: XMLParser, didEndMappingPrefix prefix: String) optional func parser(_ parser: XMLParser, foundCharacters string: String) optional func parser(_ parser: XMLParser, foundIgnorableWhitespace whitespaceString: String) optional func parser(_ parser: XMLParser, foundProcessingInstructionWithTarget target: String, data: String?) diff --git a/macOS/GameKit/GKAchievementViewController.swift b/macOS/GameKit/GKAchievementViewController.swift index 9c85361..9001203 100644 --- a/macOS/GameKit/GKAchievementViewController.swift +++ b/macOS/GameKit/GKAchievementViewController.swift @@ -5,5 +5,5 @@ class GKAchievementViewController : GKGameCenterViewController { } @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use GKGameCenterViewController instead") protocol GKAchievementViewControllerDelegate : NSObjectProtocol { - @asyncHandler func achievementViewControllerDidFinish(_ viewController: GKAchievementViewController!) + func achievementViewControllerDidFinish(_ viewController: GKAchievementViewController!) } diff --git a/macOS/GameKit/GKChallengeEventHandler.swift b/macOS/GameKit/GKChallengeEventHandler.swift index 48900c0..320eea8 100644 --- a/macOS/GameKit/GKChallengeEventHandler.swift +++ b/macOS/GameKit/GKChallengeEventHandler.swift @@ -1,13 +1,13 @@ @available(macOS, introduced: 10.8, deprecated: 10.10, message: "You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer.") protocol GKChallengeEventHandlerDelegate : NSObjectProtocol { - @asyncHandler optional func localPlayerDidSelect(_ challenge: GKChallenge!) + optional func localPlayerDidSelect(_ challenge: GKChallenge!) optional func shouldShowBanner(forLocallyReceivedChallenge challenge: GKChallenge!) -> Bool - @asyncHandler optional func localPlayerDidReceive(_ challenge: GKChallenge!) + optional func localPlayerDidReceive(_ challenge: GKChallenge!) optional func shouldShowBanner(forLocallyCompletedChallenge challenge: GKChallenge!) -> Bool - @asyncHandler optional func localPlayerDidComplete(_ challenge: GKChallenge!) + optional func localPlayerDidComplete(_ challenge: GKChallenge!) optional func shouldShowBanner(forRemotelyCompletedChallenge challenge: GKChallenge!) -> Bool - @asyncHandler optional func remotePlayerDidComplete(_ challenge: GKChallenge!) + optional func remotePlayerDidComplete(_ challenge: GKChallenge!) } @available(macOS, introduced: 10.8, deprecated: 10.10, message: "You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer.") class GKChallengeEventHandler : NSObject { diff --git a/macOS/GameKit/GKChallengesViewController.swift b/macOS/GameKit/GKChallengesViewController.swift index a776eee..2348f12 100644 --- a/macOS/GameKit/GKChallengesViewController.swift +++ b/macOS/GameKit/GKChallengesViewController.swift @@ -5,5 +5,5 @@ class GKChallengesViewController : NSViewController, GKViewController { } protocol GKChallengesViewControllerDelegate { @available(macOS 10.8, *) - @asyncHandler func challengesViewControllerDidFinish(_ viewController: GKChallengesViewController!) + func challengesViewControllerDidFinish(_ viewController: GKChallengesViewController!) } diff --git a/macOS/GameKit/GKEventListener.swift b/macOS/GameKit/GKEventListener.swift index 87a902c..9adde5a 100644 --- a/macOS/GameKit/GKEventListener.swift +++ b/macOS/GameKit/GKEventListener.swift @@ -3,9 +3,9 @@ protocol GKChallengeListener : NSObjectProtocol { @available(macOS 10.10, *) optional func player(_ player: GKPlayer, wantsToPlay challenge: GKChallenge) @available(macOS 10.10, *) - @asyncHandler optional func player(_ player: GKPlayer, didReceive challenge: GKChallenge) + optional func player(_ player: GKPlayer, didReceive challenge: GKChallenge) @available(macOS 10.10, *) - @asyncHandler optional func player(_ player: GKPlayer, didComplete challenge: GKChallenge, issuedByFriend friendPlayer: GKPlayer) + optional func player(_ player: GKPlayer, didComplete challenge: GKChallenge, issuedByFriend friendPlayer: GKPlayer) @available(macOS 10.10, *) optional func player(_ player: GKPlayer, issuedChallengeWasCompleted challenge: GKChallenge, byFriend friendPlayer: GKPlayer) } diff --git a/macOS/GameKit/GKFriendRequestComposeViewController.swift b/macOS/GameKit/GKFriendRequestComposeViewController.swift index acee956..7a3be08 100644 --- a/macOS/GameKit/GKFriendRequestComposeViewController.swift +++ b/macOS/GameKit/GKFriendRequestComposeViewController.swift @@ -16,5 +16,5 @@ extension GKFriendRequestComposeViewController { @available(macOS, introduced: 10.8, deprecated: 10.12) protocol GKFriendRequestComposeViewControllerDelegate { @available(macOS, introduced: 10.8, deprecated: 10.12) - @asyncHandler func friendRequestComposeViewControllerDidFinish(_ viewController: GKFriendRequestComposeViewController) + func friendRequestComposeViewControllerDidFinish(_ viewController: GKFriendRequestComposeViewController) } diff --git a/macOS/GameKit/GKGameCenterViewController.swift b/macOS/GameKit/GKGameCenterViewController.swift index a8b2fbc..0b4a38f 100644 --- a/macOS/GameKit/GKGameCenterViewController.swift +++ b/macOS/GameKit/GKGameCenterViewController.swift @@ -35,5 +35,5 @@ extension GKGameCenterViewController { } protocol GKGameCenterControllerDelegate : NSObjectProtocol { @available(macOS 10.9, *) - @asyncHandler func gameCenterViewControllerDidFinish(_ gameCenterViewController: GKGameCenterViewController) + func gameCenterViewControllerDidFinish(_ gameCenterViewController: GKGameCenterViewController) } diff --git a/macOS/GameKit/GKGameSessionEventListener.swift b/macOS/GameKit/GKGameSessionEventListener.swift index 74ed396..e4a9887 100644 --- a/macOS/GameKit/GKGameSessionEventListener.swift +++ b/macOS/GameKit/GKGameSessionEventListener.swift @@ -1,12 +1,12 @@ @available(macOS, introduced: 10.12, deprecated: 10.14, message: "Use GKLocalPlayerListener for multiplayer event notifications.") protocol GKGameSessionEventListener : NSObjectProtocol { - @asyncHandler optional func session(_ session: GKGameSession, didAdd player: GKCloudPlayer) - @asyncHandler optional func session(_ session: GKGameSession, didRemove player: GKCloudPlayer) - @asyncHandler optional func session(_ session: GKGameSession, player: GKCloudPlayer, didChange newState: GKConnectionState) - @asyncHandler optional func session(_ session: GKGameSession, player: GKCloudPlayer, didSave data: Data) - @asyncHandler optional func session(_ session: GKGameSession, didReceive data: Data, from player: GKCloudPlayer) - @asyncHandler optional func session(_ session: GKGameSession, didReceiveMessage message: String, with data: Data, from player: GKCloudPlayer) + optional func session(_ session: GKGameSession, didAdd player: GKCloudPlayer) + optional func session(_ session: GKGameSession, didRemove player: GKCloudPlayer) + optional func session(_ session: GKGameSession, player: GKCloudPlayer, didChange newState: GKConnectionState) + optional func session(_ session: GKGameSession, player: GKCloudPlayer, didSave data: Data) + optional func session(_ session: GKGameSession, didReceive data: Data, from player: GKCloudPlayer) + optional func session(_ session: GKGameSession, didReceiveMessage message: String, with data: Data, from player: GKCloudPlayer) } extension GKGameSession { @available(macOS, introduced: 10.12, deprecated: 10.14, message: "Use GKLocalPlayer's registerListener: to register for GKLocalPlayerListener event notifications.") diff --git a/macOS/GameKit/GKLeaderboardViewController.swift b/macOS/GameKit/GKLeaderboardViewController.swift index 40c3882..aea61cb 100644 --- a/macOS/GameKit/GKLeaderboardViewController.swift +++ b/macOS/GameKit/GKLeaderboardViewController.swift @@ -9,5 +9,5 @@ extension GKLeaderboardViewController { } @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use GKGameCenterViewController instead") protocol GKLeaderboardViewControllerDelegate : NSObjectProtocol { - @asyncHandler func leaderboardViewControllerDidFinish(_ viewController: GKLeaderboardViewController!) + func leaderboardViewControllerDidFinish(_ viewController: GKLeaderboardViewController!) } diff --git a/macOS/GameKit/GKMatch.swift b/macOS/GameKit/GKMatch.swift index cd60221..352ae7c 100644 --- a/macOS/GameKit/GKMatch.swift +++ b/macOS/GameKit/GKMatch.swift @@ -36,17 +36,17 @@ class GKMatch : NSObject { } protocol GKMatchDelegate : NSObjectProtocol { @available(macOS 10.10, *) - @asyncHandler optional func match(_ match: GKMatch, didReceive data: Data, fromRemotePlayer player: GKPlayer) + optional func match(_ match: GKMatch, didReceive data: Data, fromRemotePlayer player: GKPlayer) @available(macOS 10.11, *) - @asyncHandler optional func match(_ match: GKMatch, didReceive data: Data, forRecipient recipient: GKPlayer, fromRemotePlayer player: GKPlayer) + optional func match(_ match: GKMatch, didReceive data: Data, forRecipient recipient: GKPlayer, fromRemotePlayer player: GKPlayer) @available(macOS 10.8, *) - @asyncHandler optional func match(_ match: GKMatch, player: GKPlayer, didChange state: GKPlayerConnectionState) + optional func match(_ match: GKMatch, player: GKPlayer, didChange state: GKPlayerConnectionState) @available(macOS 10.8, *) - @asyncHandler optional func match(_ match: GKMatch, didFailWithError error: Error?) + optional func match(_ match: GKMatch, didFailWithError error: Error?) @available(macOS 10.10, *) optional func match(_ match: GKMatch, shouldReinviteDisconnectedPlayer player: GKPlayer) -> Bool @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use match:didReceiveData:fromRemotePlayer:") - @asyncHandler optional func match(_ match: GKMatch, didReceive data: Data, fromPlayer playerID: String) + optional func match(_ match: GKMatch, didReceive data: Data, fromPlayer playerID: String) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use shouldReinviteDisconnectedPlayer:") optional func match(_ match: GKMatch, shouldReinvitePlayer playerID: String) -> Bool } diff --git a/macOS/GameKit/GKMatchmaker.swift b/macOS/GameKit/GKMatchmaker.swift index 8657aa9..2bab19a 100644 --- a/macOS/GameKit/GKMatchmaker.swift +++ b/macOS/GameKit/GKMatchmaker.swift @@ -60,9 +60,9 @@ class GKInvite : NSObject { } protocol GKInviteEventListener { @available(macOS 10.10, *) - @asyncHandler optional func player(_ player: GKPlayer, didAccept invite: GKInvite) + optional func player(_ player: GKPlayer, didAccept invite: GKInvite) @available(macOS 10.10, *) - @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithRecipients recipientPlayers: [GKPlayer]) + optional func player(_ player: GKPlayer, didRequestMatchWithRecipients recipientPlayers: [GKPlayer]) } @available(macOS 10.8, *) class GKMatchmaker : NSObject { diff --git a/macOS/GameKit/GKMatchmakerViewController.swift b/macOS/GameKit/GKMatchmakerViewController.swift index 03e7fa8..e8f0bb9 100644 --- a/macOS/GameKit/GKMatchmakerViewController.swift +++ b/macOS/GameKit/GKMatchmakerViewController.swift @@ -29,15 +29,15 @@ protocol GKMatchmakerViewControllerDelegate : NSObjectProtocol { @available(macOS 10.8, *) func matchmakerViewControllerWasCancelled(_ viewController: GKMatchmakerViewController) @available(macOS 10.8, *) - @asyncHandler func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFailWithError error: Error) + func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFailWithError error: Error) @available(macOS 10.8, *) - @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFind match: GKMatch) + optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFind match: GKMatch) @available(macOS 10.10, *) - @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindHostedPlayers players: [GKPlayer]) + optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindHostedPlayers players: [GKPlayer]) @available(macOS 10.10, *) optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, hostedPlayerDidAccept player: GKPlayer) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use matchmakerViewController:didFindHostedPlayers:") - @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindPlayers playerIDs: [String]) + optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindPlayers playerIDs: [String]) @available(macOS, introduced: 10.8, deprecated: 10.10, message: "This is never invoked and its implementation does nothing, use matchmakerViewController:hostedPlayerDidAccept:") - @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didReceiveAcceptFromHostedPlayer playerID: String) + optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didReceiveAcceptFromHostedPlayer playerID: String) } diff --git a/macOS/GameKit/GKPublicProtocols.swift b/macOS/GameKit/GKPublicProtocols.swift index c55c95b..19b2bd6 100644 --- a/macOS/GameKit/GKPublicProtocols.swift +++ b/macOS/GameKit/GKPublicProtocols.swift @@ -1,8 +1,8 @@ @available(macOS, introduced: 10.8, deprecated: 10.10, message: "Use MCSession in association with MCSessionDelegate from the MultipeerConnectivity framework instead") protocol GKSessionDelegate : NSObjectProtocol { - @asyncHandler optional func session(_ session: GKSession, peer peerID: String, didChange state: GKPeerConnectionState) - @asyncHandler optional func session(_ session: GKSession, didReceiveConnectionRequestFromPeer peerID: String) + optional func session(_ session: GKSession, peer peerID: String, didChange state: GKPeerConnectionState) + optional func session(_ session: GKSession, didReceiveConnectionRequestFromPeer peerID: String) optional func session(_ session: GKSession, connectionWithPeerFailed peerID: String, withError error: Error) - @asyncHandler optional func session(_ session: GKSession, didFailWithError error: Error) + optional func session(_ session: GKSession, didFailWithError error: Error) } diff --git a/macOS/GameKit/GKSavedGameListener.swift b/macOS/GameKit/GKSavedGameListener.swift index 5ccbc5c..224ee0c 100644 --- a/macOS/GameKit/GKSavedGameListener.swift +++ b/macOS/GameKit/GKSavedGameListener.swift @@ -2,7 +2,7 @@ @available(macOS 10.10, *) protocol GKSavedGameListener : NSObjectProtocol { @available(macOS 10.10, *) - @asyncHandler optional func player(_ player: GKPlayer, didModifySavedGame savedGame: GKSavedGame) + optional func player(_ player: GKPlayer, didModifySavedGame savedGame: GKSavedGame) @available(macOS 10.10, *) optional func player(_ player: GKPlayer, hasConflictingSavedGames savedGames: [GKSavedGame]) } diff --git a/macOS/GameKit/GKTurnBasedMatch.swift b/macOS/GameKit/GKTurnBasedMatch.swift index e0beb94..dc062e1 100644 --- a/macOS/GameKit/GKTurnBasedMatch.swift +++ b/macOS/GameKit/GKTurnBasedMatch.swift @@ -52,9 +52,9 @@ extension GKTurnBasedParticipant { } protocol GKTurnBasedEventListener { @available(macOS 10.10, *) - @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithOtherPlayers playersToInvite: [GKPlayer]) + optional func player(_ player: GKPlayer, didRequestMatchWithOtherPlayers playersToInvite: [GKPlayer]) @available(macOS 10.10, *) - @asyncHandler optional func player(_ player: GKPlayer, receivedTurnEventFor match: GKTurnBasedMatch, didBecomeActive: Bool) + optional func player(_ player: GKPlayer, receivedTurnEventFor match: GKTurnBasedMatch, didBecomeActive: Bool) @available(macOS 10.8, *) optional func player(_ player: GKPlayer, matchEnded match: GKTurnBasedMatch) @available(macOS 10.10, *) @@ -202,7 +202,7 @@ protocol GKTurnBasedEventHandlerDelegate { @available(macOS, introduced: 10.8, deprecated: 10.10) func handleInvite(fromGameCenter playersToInvite: [String]) @available(macOS, introduced: 10.9, deprecated: 10.10) - @asyncHandler func handleTurnEvent(for match: GKTurnBasedMatch, didBecomeActive: Bool) + func handleTurnEvent(for match: GKTurnBasedMatch, didBecomeActive: Bool) @available(macOS, introduced: 10.8, deprecated: 10.10) optional func handleMatchEnded(_ match: GKTurnBasedMatch) } diff --git a/macOS/GameKit/GKTurnBasedMatchmakerViewController.swift b/macOS/GameKit/GKTurnBasedMatchmakerViewController.swift index 670dafe..e4f6d01 100644 --- a/macOS/GameKit/GKTurnBasedMatchmakerViewController.swift +++ b/macOS/GameKit/GKTurnBasedMatchmakerViewController.swift @@ -11,9 +11,9 @@ protocol GKTurnBasedMatchmakerViewControllerDelegate : NSObjectProtocol { @available(macOS 10.8, *) func turnBasedMatchmakerViewControllerWasCancelled(_ viewController: GKTurnBasedMatchmakerViewController) @available(macOS 10.8, *) - @asyncHandler func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFailWithError error: Error) + func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFailWithError error: Error) @available(macOS, introduced: 10.8, deprecated: 10.11, message: "use GKTurnBasedEventListener player:receivedTurnEventForMatch:didBecomeActive:") - @asyncHandler optional func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFind match: GKTurnBasedMatch) + optional func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFind match: GKTurnBasedMatch) @available(macOS, introduced: 10.8, deprecated: 10.11, message: "use GKTurnBasedEventListener player:wantsToQuitMatch:") optional func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, playerQuitFor match: GKTurnBasedMatch) } diff --git a/macOS/GameplayKit/GKAgent.swift b/macOS/GameplayKit/GKAgent.swift index a0bf8ef..e284afd 100644 --- a/macOS/GameplayKit/GKAgent.swift +++ b/macOS/GameplayKit/GKAgent.swift @@ -3,7 +3,7 @@ protocol GKAgentDelegate : NSObjectProtocol { @available(macOS 10.11, *) optional func agentWillUpdate(_ agent: GKAgent) @available(macOS 10.11, *) - @asyncHandler optional func agentDidUpdate(_ agent: GKAgent) + optional func agentDidUpdate(_ agent: GKAgent) } @available(macOS 10.11, *) class GKAgent : GKComponent, NSSecureCoding { diff --git a/macOS/IMServicePlugIn/IMServicePlugInChatRoomSupport.swift b/macOS/IMServicePlugIn/IMServicePlugInChatRoomSupport.swift index 2e39da6..fe5331b 100644 --- a/macOS/IMServicePlugIn/IMServicePlugInChatRoomSupport.swift +++ b/macOS/IMServicePlugIn/IMServicePlugInChatRoomSupport.swift @@ -13,19 +13,19 @@ protocol IMServicePlugInChatRoomSupport { } protocol IMServiceApplicationChatRoomSupport : IMServiceApplication { @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func plugInDidReceiveInvitation(_ invitation: IMServicePlugInMessage!, forChatRoom roomName: String!, fromHandle handle: String!) + func plugInDidReceiveInvitation(_ invitation: IMServicePlugInMessage!, forChatRoom roomName: String!, fromHandle handle: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func plugInDidReceive(_ message: IMServicePlugInMessage!, forChatRoom roomName: String!, fromHandle handle: String!) + func plugInDidReceive(_ message: IMServicePlugInMessage!, forChatRoom roomName: String!, fromHandle handle: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func plugInDidReceiveNotice(_ notice: String!, forChatRoom roomName: String!) + func plugInDidReceiveNotice(_ notice: String!, forChatRoom roomName: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func plugInDidSend(_ message: IMServicePlugInMessage!, toChatRoom roomName: String!, error: Error!) + func plugInDidSend(_ message: IMServicePlugInMessage!, toChatRoom roomName: String!, error: Error!) @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func plugInDidJoinChatRoom(_ roomName: String!) + func plugInDidJoinChatRoom(_ roomName: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func plugInDidLeaveChatRoom(_ roomName: String!, error: Error!) + func plugInDidLeaveChatRoom(_ roomName: String!, error: Error!) @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func handles(_ handles: [Any]!, didJoinChatRoom roomName: String!) + func handles(_ handles: [Any]!, didJoinChatRoom roomName: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func handles(_ handles: [Any]!, didLeaveChatRoom roomName: String!) + func handles(_ handles: [Any]!, didLeaveChatRoom roomName: String!) } diff --git a/macOS/IMServicePlugIn/IMServicePlugInFileTransferSessionSupport.swift b/macOS/IMServicePlugIn/IMServicePlugInFileTransferSessionSupport.swift index 030e648..9c2bd57 100644 --- a/macOS/IMServicePlugIn/IMServicePlugInFileTransferSessionSupport.swift +++ b/macOS/IMServicePlugIn/IMServicePlugInFileTransferSessionSupport.swift @@ -9,9 +9,9 @@ protocol IMServicePlugInFileTransferSessionSupport { } protocol IMServiceApplicationFileTransferSessionSupport : IMServiceApplication { @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func plugInDidReceive(_ session: IMServicePlugInIncomingFileTransferSession!, fromHandle handle: String!) + func plugInDidReceive(_ session: IMServicePlugInIncomingFileTransferSession!, fromHandle handle: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func plugInDidAccept(_ session: IMServicePlugInOutgoingFileTransferSession!) + func plugInDidAccept(_ session: IMServicePlugInOutgoingFileTransferSession!) @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func plugInDidFinish(_ session: IMServicePlugInFileTransferSession!, error: Error!) + func plugInDidFinish(_ session: IMServicePlugInFileTransferSession!, error: Error!) } diff --git a/macOS/IMServicePlugIn/IMServicePlugInGroupListSupport.swift b/macOS/IMServicePlugIn/IMServicePlugInGroupListSupport.swift index bb3bb98..ee58a69 100644 --- a/macOS/IMServicePlugIn/IMServicePlugInGroupListSupport.swift +++ b/macOS/IMServicePlugIn/IMServicePlugInGroupListSupport.swift @@ -34,9 +34,9 @@ protocol IMServicePlugInGroupListHandlePictureSupport : NSObjectProtocol { } protocol IMServiceApplicationGroupListSupport : IMServiceApplication { @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func plugInDidUpdateGroupList(_ groups: [Any]!, error: Error!) + func plugInDidUpdateGroupList(_ groups: [Any]!, error: Error!) } protocol IMServiceApplicationGroupListAuthorizationSupport : IMServiceApplicationGroupListSupport { @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func plugInDidReceiveAuthorizationRequest(fromHandle handle: String!) + func plugInDidReceiveAuthorizationRequest(fromHandle handle: String!) } diff --git a/macOS/IMServicePlugIn/IMServicePlugInInstantMessageSupport.swift b/macOS/IMServicePlugIn/IMServicePlugInInstantMessageSupport.swift index 05a1930..7237cea 100644 --- a/macOS/IMServicePlugIn/IMServicePlugInInstantMessageSupport.swift +++ b/macOS/IMServicePlugIn/IMServicePlugInInstantMessageSupport.swift @@ -1,19 +1,19 @@ protocol IMServicePlugInInstantMessagingSupport { @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func userDidStartTyping(toHandle handle: String!) + func userDidStartTyping(toHandle handle: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func userDidStopTyping(toHandle handle: String!) + func userDidStopTyping(toHandle handle: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) func send(_ message: IMServicePlugInMessage!, toHandle handle: String!) } protocol IMServiceApplicationInstantMessagingSupport { @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func handleDidStartTyping(_ handle: String!) + func handleDidStartTyping(_ handle: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func handleDidStopTyping(_ handle: String!) + func handleDidStopTyping(_ handle: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func plugInDidReceive(_ message: IMServicePlugInMessage!, fromHandle handle: String!) + func plugInDidReceive(_ message: IMServicePlugInMessage!, fromHandle handle: String!) @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func plugInDidSend(_ message: IMServicePlugInMessage!, toHandle handle: String!, error: Error!) + func plugInDidSend(_ message: IMServicePlugInMessage!, toHandle handle: String!, error: Error!) } diff --git a/macOS/IMServicePlugIn/IMServicePlugInProtocols.swift b/macOS/IMServicePlugIn/IMServicePlugInProtocols.swift index 986442c..b963b75 100644 --- a/macOS/IMServicePlugIn/IMServicePlugInProtocols.swift +++ b/macOS/IMServicePlugIn/IMServicePlugInProtocols.swift @@ -11,11 +11,11 @@ protocol IMServicePlugIn : NSObjectProtocol { } protocol IMServiceApplication : NSObjectProtocol { @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func plugInDidLogIn() + func plugInDidLogIn() @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func plugInDidLogOutWithError(_ error: Error!, reconnect: Bool) + func plugInDidLogOutWithError(_ error: Error!, reconnect: Bool) @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func plugInDidFailToAuthenticate() + func plugInDidFailToAuthenticate() @available(macOS, introduced: 10.7, deprecated: 10.13) - @asyncHandler func plugInDidUpdateProperties(_ changes: [AnyHashable : Any]!, ofHandle handle: String!) + func plugInDidUpdateProperties(_ changes: [AnyHashable : Any]!, ofHandle handle: String!) } diff --git a/macOS/ImageCaptureCore/ICCameraDevice.swift b/macOS/ImageCaptureCore/ICCameraDevice.swift index 0e5d9cd..619f8f0 100644 --- a/macOS/ImageCaptureCore/ICCameraDevice.swift +++ b/macOS/ImageCaptureCore/ICCameraDevice.swift @@ -121,43 +121,43 @@ class ICCameraDevice : ICDevice { } protocol ICCameraDeviceDelegate : ICDeviceDelegate { @available(macOS 10.4, *) - @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didAdd items: [ICCameraItem]) + func cameraDevice(_ camera: ICCameraDevice, didAdd items: [ICCameraItem]) @available(macOS 10.4, *) - @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didRemove items: [ICCameraItem]) + func cameraDevice(_ camera: ICCameraDevice, didRemove items: [ICCameraItem]) @available(macOS 10.15, *) - @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didReceiveThumbnail thumbnail: CGImage?, for item: ICCameraItem, error: Error?) + func cameraDevice(_ camera: ICCameraDevice, didReceiveThumbnail thumbnail: CGImage?, for item: ICCameraItem, error: Error?) @available(macOS 10.15, *) - @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didReceiveMetadata metadata: [AnyHashable : Any]?, for item: ICCameraItem, error: Error?) + func cameraDevice(_ camera: ICCameraDevice, didReceiveMetadata metadata: [AnyHashable : Any]?, for item: ICCameraItem, error: Error?) @available(macOS 10.4, *) - @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didRenameItems items: [ICCameraItem]) + func cameraDevice(_ camera: ICCameraDevice, didRenameItems items: [ICCameraItem]) @available(macOS 10.4, *) - @asyncHandler func cameraDeviceDidChangeCapability(_ camera: ICCameraDevice) + func cameraDeviceDidChangeCapability(_ camera: ICCameraDevice) @available(macOS 10.4, *) - @asyncHandler func cameraDevice(_ camera: ICCameraDevice, didReceivePTPEvent eventData: Data) + func cameraDevice(_ camera: ICCameraDevice, didReceivePTPEvent eventData: Data) @available(macOS 10.4, *) - @asyncHandler func deviceDidBecomeReady(withCompleteContentCatalog device: ICCameraDevice) + func deviceDidBecomeReady(withCompleteContentCatalog device: ICCameraDevice) @available(macOS 10.4, *) - @asyncHandler func cameraDeviceDidRemoveAccessRestriction(_ device: ICDevice) + func cameraDeviceDidRemoveAccessRestriction(_ device: ICDevice) @available(macOS 10.4, *) - @asyncHandler func cameraDeviceDidEnableAccessRestriction(_ device: ICDevice) + func cameraDeviceDidEnableAccessRestriction(_ device: ICDevice) @available(macOS 10.4, *) optional func cameraDevice(_ cameraDevice: ICCameraDevice, shouldGetThumbnailOf item: ICCameraItem) -> Bool @available(macOS 10.4, *) optional func cameraDevice(_ cameraDevice: ICCameraDevice, shouldGetMetadataOf item: ICCameraItem) -> Bool @available(macOS 10.4, *) - @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didCompleteDeleteFilesWithError error: Error?) + optional func cameraDevice(_ camera: ICCameraDevice, didCompleteDeleteFilesWithError error: Error?) @available(macOS, introduced: 10.4, deprecated: 10.15) - @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didAdd item: ICCameraItem) + optional func cameraDevice(_ camera: ICCameraDevice, didAdd item: ICCameraItem) @available(macOS, introduced: 10.4, deprecated: 10.15) - @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didRemove item: ICCameraItem) + optional func cameraDevice(_ camera: ICCameraDevice, didRemove item: ICCameraItem) @available(macOS, introduced: 10.4, deprecated: 10.15) - @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didReceiveThumbnailFor item: ICCameraItem) + optional func cameraDevice(_ camera: ICCameraDevice, didReceiveThumbnailFor item: ICCameraItem) @available(macOS, introduced: 10.4, deprecated: 10.15) - @asyncHandler optional func cameraDevice(_ camera: ICCameraDevice, didReceiveMetadataFor item: ICCameraItem) + optional func cameraDevice(_ camera: ICCameraDevice, didReceiveMetadataFor item: ICCameraItem) } protocol ICCameraDeviceDownloadDelegate : NSObjectProtocol { @available(macOS 10.4, *) optional func didDownloadFile(_ file: ICCameraFile, error: Error?, options: [String : Any] = [:], contextInfo: UnsafeMutableRawPointer?) @available(macOS 10.4, *) - @asyncHandler optional func didReceiveDownloadProgress(for file: ICCameraFile, downloadedBytes: off_t, maxBytes: off_t) + optional func didReceiveDownloadProgress(for file: ICCameraFile, downloadedBytes: off_t, maxBytes: off_t) } diff --git a/macOS/ImageCaptureCore/ICDevice.swift b/macOS/ImageCaptureCore/ICDevice.swift index 8b99ea2..742e6b6 100644 --- a/macOS/ImageCaptureCore/ICDevice.swift +++ b/macOS/ImageCaptureCore/ICDevice.swift @@ -170,21 +170,21 @@ class ICDevice : NSObject { } protocol ICDeviceDelegate : NSObjectProtocol { @available(macOS 10.4, *) - @asyncHandler func device(_ device: ICDevice, didCloseSessionWithError error: Error?) + func device(_ device: ICDevice, didCloseSessionWithError error: Error?) @available(macOS 10.4, *) - @asyncHandler func didRemove(_ device: ICDevice) + func didRemove(_ device: ICDevice) @available(macOS 10.4, *) - @asyncHandler func device(_ device: ICDevice, didOpenSessionWithError error: Error?) + func device(_ device: ICDevice, didOpenSessionWithError error: Error?) @available(macOS 10.4, *) - @asyncHandler optional func deviceDidBecomeReady(_ device: ICDevice) + optional func deviceDidBecomeReady(_ device: ICDevice) @available(macOS 10.4, *) - @asyncHandler optional func deviceDidChangeName(_ device: ICDevice) + optional func deviceDidChangeName(_ device: ICDevice) @available(macOS 10.4, *) - @asyncHandler optional func device(_ device: ICDevice, didReceiveStatusInformation status: [ICDeviceStatus : Any]) + optional func device(_ device: ICDevice, didReceiveStatusInformation status: [ICDeviceStatus : Any]) @available(macOS 10.4, *) - @asyncHandler optional func device(_ device: ICDevice, didEncounterError error: Error?) + optional func device(_ device: ICDevice, didEncounterError error: Error?) @available(macOS 10.4, *) - @asyncHandler optional func device(_ device: ICDevice, didEjectWithError error: Error?) + optional func device(_ device: ICDevice, didEjectWithError error: Error?) @available(macOS, introduced: 10.4, deprecated: 10.15, message: "Device sharing is no longer available") - @asyncHandler optional func deviceDidChangeSharingState(_ device: ICDevice) + optional func deviceDidChangeSharingState(_ device: ICDevice) } diff --git a/macOS/ImageCaptureCore/ICDeviceBrowser.swift b/macOS/ImageCaptureCore/ICDeviceBrowser.swift index aa5016f..98370e9 100644 --- a/macOS/ImageCaptureCore/ICDeviceBrowser.swift +++ b/macOS/ImageCaptureCore/ICDeviceBrowser.swift @@ -9,9 +9,9 @@ extension ICAuthorizationStatus { } protocol ICDeviceBrowserDelegate : NSObjectProtocol { @available(macOS 10.4, *) - @asyncHandler func deviceBrowser(_ browser: ICDeviceBrowser, didAdd device: ICDevice, moreComing: Bool) + func deviceBrowser(_ browser: ICDeviceBrowser, didAdd device: ICDevice, moreComing: Bool) @available(macOS 10.4, *) - @asyncHandler func deviceBrowser(_ browser: ICDeviceBrowser, didRemove device: ICDevice, moreGoing: Bool) + func deviceBrowser(_ browser: ICDeviceBrowser, didRemove device: ICDevice, moreGoing: Bool) @available(macOS 10.4, *) optional func deviceBrowser(_ browser: ICDeviceBrowser, deviceDidChangeName device: ICDevice) @available(macOS, introduced: 10.4, deprecated: 10.13, message: "deviceDidChangeSharingState will no longer be called") @@ -19,7 +19,7 @@ protocol ICDeviceBrowserDelegate : NSObjectProtocol { @available(macOS 10.4, *) optional func deviceBrowser(_ browser: ICDeviceBrowser, requestsSelect device: ICDevice) @available(macOS 10.4, *) - @asyncHandler optional func deviceBrowserDidEnumerateLocalDevices(_ browser: ICDeviceBrowser) + optional func deviceBrowserDidEnumerateLocalDevices(_ browser: ICDeviceBrowser) } @available(macOS 10.4, *) class ICDeviceBrowser : NSObject { diff --git a/macOS/ImageCaptureCore/ICScannerDevice.swift b/macOS/ImageCaptureCore/ICScannerDevice.swift index f5c1b72..67578f1 100644 --- a/macOS/ImageCaptureCore/ICScannerDevice.swift +++ b/macOS/ImageCaptureCore/ICScannerDevice.swift @@ -27,17 +27,17 @@ enum ICScannerTransferMode : UInt { @available(macOS 10.4, *) protocol ICScannerDeviceDelegate : ICDeviceDelegate { @available(macOS 10.4, *) - @asyncHandler optional func scannerDeviceDidBecomeAvailable(_ scanner: ICScannerDevice) + optional func scannerDeviceDidBecomeAvailable(_ scanner: ICScannerDevice) @available(macOS 10.4, *) - @asyncHandler optional func scannerDevice(_ scanner: ICScannerDevice, didSelect functionalUnit: ICScannerFunctionalUnit, error: Error?) + optional func scannerDevice(_ scanner: ICScannerDevice, didSelect functionalUnit: ICScannerFunctionalUnit, error: Error?) @available(macOS 10.7, *) - @asyncHandler optional func scannerDevice(_ scanner: ICScannerDevice, didScanTo url: URL) + optional func scannerDevice(_ scanner: ICScannerDevice, didScanTo url: URL) @available(macOS 10.7, *) - @asyncHandler optional func scannerDevice(_ scanner: ICScannerDevice, didScanTo data: ICScannerBandData) + optional func scannerDevice(_ scanner: ICScannerDevice, didScanTo data: ICScannerBandData) @available(macOS 10.4, *) - @asyncHandler optional func scannerDevice(_ scanner: ICScannerDevice, didCompleteOverviewScanWithError error: Error?) + optional func scannerDevice(_ scanner: ICScannerDevice, didCompleteOverviewScanWithError error: Error?) @available(macOS 10.4, *) - @asyncHandler optional func scannerDevice(_ scanner: ICScannerDevice, didCompleteScanWithError error: Error?) + optional func scannerDevice(_ scanner: ICScannerDevice, didCompleteScanWithError error: Error?) } @available(macOS 10.4, *) class ICScannerDevice : ICDevice { diff --git a/macOS/MapKit/MKLocalSearchCompleter.swift b/macOS/MapKit/MKLocalSearchCompleter.swift index 4e2997e..0b422e5 100644 --- a/macOS/MapKit/MKLocalSearchCompleter.swift +++ b/macOS/MapKit/MKLocalSearchCompleter.swift @@ -33,8 +33,8 @@ class MKLocalSearchCompleter : NSObject { } @available(macOS 10.11.4, *) protocol MKLocalSearchCompleterDelegate : NSObjectProtocol { - @asyncHandler optional func completerDidUpdateResults(_ completer: MKLocalSearchCompleter) - @asyncHandler optional func completer(_ completer: MKLocalSearchCompleter, didFailWithError error: Error) + optional func completerDidUpdateResults(_ completer: MKLocalSearchCompleter) + optional func completer(_ completer: MKLocalSearchCompleter, didFailWithError error: Error) } @available(macOS 10.11.4, *) class MKLocalSearchCompletion : NSObject { diff --git a/macOS/MapKit/MKMapView.swift b/macOS/MapKit/MKMapView.swift index 7ceef78..e6e8079 100644 --- a/macOS/MapKit/MKMapView.swift +++ b/macOS/MapKit/MKMapView.swift @@ -134,41 +134,41 @@ protocol MKMapViewDelegate : NSObjectProtocol { @available(macOS 10.9, *) optional func mapView(_ mapView: MKMapView, regionDidChangeAnimated animated: Bool) @available(macOS 10.13, *) - @asyncHandler optional func mapViewDidChangeVisibleRegion(_ mapView: MKMapView) + optional func mapViewDidChangeVisibleRegion(_ mapView: MKMapView) @available(macOS 10.9, *) optional func mapViewWillStartLoadingMap(_ mapView: MKMapView) @available(macOS 10.9, *) - @asyncHandler optional func mapViewDidFinishLoadingMap(_ mapView: MKMapView) + optional func mapViewDidFinishLoadingMap(_ mapView: MKMapView) @available(macOS 10.9, *) - @asyncHandler optional func mapViewDidFailLoadingMap(_ mapView: MKMapView, withError error: Error) + optional func mapViewDidFailLoadingMap(_ mapView: MKMapView, withError error: Error) @available(macOS 10.9, *) optional func mapViewWillStartRenderingMap(_ mapView: MKMapView) @available(macOS 10.9, *) - @asyncHandler optional func mapViewDidFinishRenderingMap(_ mapView: MKMapView, fullyRendered: Bool) + optional func mapViewDidFinishRenderingMap(_ mapView: MKMapView, fullyRendered: Bool) @available(macOS 10.9, *) optional func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? @available(macOS 10.9, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didAdd views: [MKAnnotationView]) + optional func mapView(_ mapView: MKMapView, didAdd views: [MKAnnotationView]) @available(macOS 10.9, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) + optional func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) @available(macOS 10.9, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView) + optional func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView) @available(macOS 10.9, *) optional func mapViewWillStartLocatingUser(_ mapView: MKMapView) @available(macOS 10.9, *) - @asyncHandler optional func mapViewDidStopLocatingUser(_ mapView: MKMapView) + optional func mapViewDidStopLocatingUser(_ mapView: MKMapView) @available(macOS 10.9, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didUpdate userLocation: MKUserLocation) + optional func mapView(_ mapView: MKMapView, didUpdate userLocation: MKUserLocation) @available(macOS 10.9, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didFailToLocateUserWithError error: Error) + optional func mapView(_ mapView: MKMapView, didFailToLocateUserWithError error: Error) @available(macOS 10.9, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, didChange newState: MKAnnotationView.DragState, fromOldState oldState: MKAnnotationView.DragState) + optional func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, didChange newState: MKAnnotationView.DragState, fromOldState oldState: MKAnnotationView.DragState) @available(macOS 11.0, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didChange mode: MKUserTrackingMode, animated: Bool) + optional func mapView(_ mapView: MKMapView, didChange mode: MKUserTrackingMode, animated: Bool) @available(macOS 10.9, *) optional func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer @available(macOS 10.9, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didAdd renderers: [MKOverlayRenderer]) + optional func mapView(_ mapView: MKMapView, didAdd renderers: [MKOverlayRenderer]) @available(macOS 10.13, *) optional func mapView(_ mapView: MKMapView, clusterAnnotationForMemberAnnotations memberAnnotations: [MKAnnotation]) -> MKClusterAnnotation } diff --git a/macOS/Metal/MTLBuffer.swift b/macOS/Metal/MTLBuffer.swift index 3f40dfb..bf67b08 100644 --- a/macOS/Metal/MTLBuffer.swift +++ b/macOS/Metal/MTLBuffer.swift @@ -4,7 +4,7 @@ protocol MTLBuffer : MTLResource { var length: Int { get } func contents() -> UnsafeMutableRawPointer @available(macOS 10.11, *) - @asyncHandler func __didModifyRange(_ range: NSRange) + func __didModifyRange(_ range: NSRange) @available(macOS 10.13, *) func makeTexture(descriptor: MTLTextureDescriptor, offset: Int, bytesPerRow: Int) -> MTLTexture? @available(macOS 10.12, *) diff --git a/macOS/MultipeerConnectivity/MCAdvertiserAssistant.swift b/macOS/MultipeerConnectivity/MCAdvertiserAssistant.swift index fd2de43..7509b57 100644 --- a/macOS/MultipeerConnectivity/MCAdvertiserAssistant.swift +++ b/macOS/MultipeerConnectivity/MCAdvertiserAssistant.swift @@ -13,5 +13,5 @@ protocol MCAdvertiserAssistantDelegate : NSObjectProtocol { @available(macOS 10.10, *) optional func advertiserAssistantWillPresentInvitation(_ advertiserAssistant: MCAdvertiserAssistant) @available(macOS 10.10, *) - @asyncHandler optional func advertiserAssistantDidDismissInvitation(_ advertiserAssistant: MCAdvertiserAssistant) + optional func advertiserAssistantDidDismissInvitation(_ advertiserAssistant: MCAdvertiserAssistant) } diff --git a/macOS/MultipeerConnectivity/MCBrowserViewController.swift b/macOS/MultipeerConnectivity/MCBrowserViewController.swift index 8dbfb3d..e8f4ab6 100644 --- a/macOS/MultipeerConnectivity/MCBrowserViewController.swift +++ b/macOS/MultipeerConnectivity/MCBrowserViewController.swift @@ -11,7 +11,7 @@ class MCBrowserViewController : NSViewController, MCNearbyServiceBrowserDelegate } protocol MCBrowserViewControllerDelegate : NSObjectProtocol { @available(macOS 10.10, *) - @asyncHandler func browserViewControllerDidFinish(_ browserViewController: MCBrowserViewController) + func browserViewControllerDidFinish(_ browserViewController: MCBrowserViewController) @available(macOS 10.10, *) func browserViewControllerWasCancelled(_ browserViewController: MCBrowserViewController) @available(macOS 10.10, *) diff --git a/macOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift b/macOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift index 200ac56..096663c 100644 --- a/macOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift +++ b/macOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift @@ -11,7 +11,7 @@ class MCNearbyServiceAdvertiser : NSObject { } protocol MCNearbyServiceAdvertiserDelegate : NSObjectProtocol { @available(macOS 10.10, *) - @asyncHandler func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didReceiveInvitationFromPeer peerID: MCPeerID, withContext context: Data?, invitationHandler: @escaping (Bool, MCSession?) -> Void) + func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didReceiveInvitationFromPeer peerID: MCPeerID, withContext context: Data?, invitationHandler: @escaping (Bool, MCSession?) -> Void) @available(macOS 10.10, *) - @asyncHandler optional func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didNotStartAdvertisingPeer error: Error) + optional func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didNotStartAdvertisingPeer error: Error) } diff --git a/macOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift b/macOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift index 630e720..2322166 100644 --- a/macOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift +++ b/macOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift @@ -15,5 +15,5 @@ protocol MCNearbyServiceBrowserDelegate : NSObjectProtocol { @available(macOS 10.10, *) func browser(_ browser: MCNearbyServiceBrowser, lostPeer peerID: MCPeerID) @available(macOS 10.10, *) - @asyncHandler optional func browser(_ browser: MCNearbyServiceBrowser, didNotStartBrowsingForPeers error: Error) + optional func browser(_ browser: MCNearbyServiceBrowser, didNotStartBrowsingForPeers error: Error) } diff --git a/macOS/MultipeerConnectivity/MCSession.swift b/macOS/MultipeerConnectivity/MCSession.swift index cfdeffd..34fe81b 100644 --- a/macOS/MultipeerConnectivity/MCSession.swift +++ b/macOS/MultipeerConnectivity/MCSession.swift @@ -42,17 +42,17 @@ class MCSession : NSObject { } protocol MCSessionDelegate : NSObjectProtocol { @available(macOS 10.10, *) - @asyncHandler func session(_ session: MCSession, peer peerID: MCPeerID, didChange state: MCSessionState) + func session(_ session: MCSession, peer peerID: MCPeerID, didChange state: MCSessionState) @available(macOS 10.10, *) - @asyncHandler func session(_ session: MCSession, didReceive data: Data, fromPeer peerID: MCPeerID) + func session(_ session: MCSession, didReceive data: Data, fromPeer peerID: MCPeerID) @available(macOS 10.10, *) - @asyncHandler func session(_ session: MCSession, didReceive stream: InputStream, withName streamName: String, fromPeer peerID: MCPeerID) + func session(_ session: MCSession, didReceive stream: InputStream, withName streamName: String, fromPeer peerID: MCPeerID) @available(macOS 10.10, *) - @asyncHandler func session(_ session: MCSession, didStartReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, with progress: Progress) + func session(_ session: MCSession, didStartReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, with progress: Progress) @available(macOS 10.10, *) - @asyncHandler func session(_ session: MCSession, didFinishReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, at localURL: URL?, withError error: Error?) + func session(_ session: MCSession, didFinishReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, at localURL: URL?, withError error: Error?) @available(macOS 10.10, *) - @asyncHandler optional func session(_ session: MCSession, didReceiveCertificate certificate: [Any]?, fromPeer peerID: MCPeerID, certificateHandler: @escaping (Bool) -> Void) + optional func session(_ session: MCSession, didReceiveCertificate certificate: [Any]?, fromPeer peerID: MCPeerID, certificateHandler: @escaping (Bool) -> Void) } extension MCSession { func nearbyConnectionData(forPeer peerID: MCPeerID, withCompletionHandler completionHandler: @escaping (Data?, Error?) -> Void) diff --git a/macOS/NotificationCenter/NCWidgetListViewController.swift b/macOS/NotificationCenter/NCWidgetListViewController.swift index 393cc7e..5efc4c1 100644 --- a/macOS/NotificationCenter/NCWidgetListViewController.swift +++ b/macOS/NotificationCenter/NCWidgetListViewController.swift @@ -15,7 +15,7 @@ protocol NCWidgetListViewDelegate : NSObjectProtocol { func widgetList(_ list: NCWidgetListViewController, viewControllerForRow row: Int) -> NSViewController optional func widgetListPerformAddAction(_ list: NCWidgetListViewController) optional func widgetList(_ list: NCWidgetListViewController, shouldReorderRow row: Int) -> Bool - @asyncHandler optional func widgetList(_ list: NCWidgetListViewController, didReorderRow row: Int, toRow newIndex: Int) + optional func widgetList(_ list: NCWidgetListViewController, didReorderRow row: Int, toRow newIndex: Int) optional func widgetList(_ list: NCWidgetListViewController, shouldRemoveRow row: Int) -> Bool - @asyncHandler optional func widgetList(_ list: NCWidgetListViewController, didRemoveRow row: Int) + optional func widgetList(_ list: NCWidgetListViewController, didRemoveRow row: Int) } diff --git a/macOS/NotificationCenter/NCWidgetProviding.swift b/macOS/NotificationCenter/NCWidgetProviding.swift index 985bdae..30e536f 100644 --- a/macOS/NotificationCenter/NCWidgetProviding.swift +++ b/macOS/NotificationCenter/NCWidgetProviding.swift @@ -18,9 +18,9 @@ protocol NCWidgetProviding : NSExtensionRequestHandling { @available(macOS, introduced: 10.10, deprecated: 11.0, message: "Use WidgetKit instead. Today View extensions have been deprecated.") optional var widgetAllowsEditing: Bool { get } @available(macOS, introduced: 10.10, deprecated: 11.0, message: "Use WidgetKit instead. Today View extensions have been deprecated.") - @asyncHandler optional func widgetDidBeginEditing() + optional func widgetDidBeginEditing() @available(macOS, introduced: 10.10, deprecated: 11.0, message: "Use WidgetKit instead. Today View extensions have been deprecated.") - @asyncHandler optional func widgetDidEndEditing() + optional func widgetDidEndEditing() } extension NSViewController { @available(macOS, introduced: 10.10, deprecated: 11.0, message: "Use WidgetKit instead. Today View extensions have been deprecated.") diff --git a/macOS/PDFKit/PDFDocument.swift b/macOS/PDFKit/PDFDocument.swift index 0195720..f47a159 100644 --- a/macOS/PDFKit/PDFDocument.swift +++ b/macOS/PDFKit/PDFDocument.swift @@ -132,14 +132,14 @@ class PDFDocument : NSObject, NSCopying { func selection(from startPage: PDFPage, atCharacterIndex startCharacter: Int, to endPage: PDFPage, atCharacterIndex endCharacter: Int) -> PDFSelection? } protocol PDFDocumentDelegate : NSObjectProtocol { - @asyncHandler optional func documentDidUnlock(_ notification: Notification) - @asyncHandler optional func documentDidBeginDocumentFind(_ notification: Notification) - @asyncHandler optional func documentDidEndDocumentFind(_ notification: Notification) - @asyncHandler optional func documentDidBeginPageFind(_ notification: Notification) - @asyncHandler optional func documentDidEndPageFind(_ notification: Notification) - @asyncHandler optional func documentDidFindMatch(_ notification: Notification) - @available(macOS 10.4, *) - @asyncHandler optional func didMatchString(_ instance: PDFSelection) + optional func documentDidUnlock(_ notification: Notification) + optional func documentDidBeginDocumentFind(_ notification: Notification) + optional func documentDidEndDocumentFind(_ notification: Notification) + optional func documentDidBeginPageFind(_ notification: Notification) + optional func documentDidEndPageFind(_ notification: Notification) + optional func documentDidFindMatch(_ notification: Notification) + @available(macOS 10.4, *) + optional func didMatchString(_ instance: PDFSelection) @available(macOS 10.6, *) optional func classForPage() -> AnyClass @available(macOS 10.13, *) diff --git a/macOS/ParavirtualizedGraphics/PGDevice.swift b/macOS/ParavirtualizedGraphics/PGDevice.swift index ec1b2aa..687d775 100644 --- a/macOS/ParavirtualizedGraphics/PGDevice.swift +++ b/macOS/ParavirtualizedGraphics/PGDevice.swift @@ -63,7 +63,7 @@ protocol PGDevice : NSObjectProtocol { @available(macOS 11.0, *) func willResume(withSuspendState suspendState: Data, error: NSErrorPointer) -> Bool @available(macOS 11.0, *) - @asyncHandler func didResume() + func didResume() } @available(macOS 11.0, *) func PGNewDeviceWithDescriptor(_ descriptor: PGDeviceDescriptor) -> PGDevice? diff --git a/macOS/PassKit/PKPaymentAuthorizationController.swift b/macOS/PassKit/PKPaymentAuthorizationController.swift index 53b4039..f0af447 100644 --- a/macOS/PassKit/PKPaymentAuthorizationController.swift +++ b/macOS/PassKit/PKPaymentAuthorizationController.swift @@ -1,41 +1,41 @@ protocol PKPaymentAuthorizationControllerDelegate : NSObjectProtocol { @available(macOS 11.0, *) - @asyncHandler func paymentAuthorizationControllerDidFinish(_ controller: PKPaymentAuthorizationController) + func paymentAuthorizationControllerDidFinish(_ controller: PKPaymentAuthorizationController) @available(macOS 11.0, *) - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) @available(macOS 11.0, *) optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationResult @available(macOS 11.0, *) - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) @available(macOS 11.0, *) optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationStatus @available(macOS 11.0, *) optional func paymentAuthorizationControllerWillAuthorizePayment(_ controller: PKPaymentAuthorizationController) @available(macOS 11.0, *) - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) @available(macOS 11.0, *) - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) @available(macOS 11.0, *) optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod) async -> PKPaymentRequestShippingMethodUpdate @available(macOS 11.0, *) - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) @available(macOS 11.0, *) optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact) async -> PKPaymentRequestShippingContactUpdate @available(macOS 11.0, *) - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) @available(macOS 11.0, *) optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod) async -> PKPaymentRequestPaymentMethodUpdate @available(macOS 11.0, *) - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) @available(macOS 11.0, *) optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod) async -> (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) @available(macOS 11.0, *) - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) @available(macOS 11.0, *) optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact) async -> (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) @available(macOS 11.0, *) - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) @available(macOS 11.0, *) optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod) async -> [PKPaymentSummaryItem] @available(macOS 11.0, *) diff --git a/macOS/PassKit/PKPaymentAuthorizationViewControllerDelegate.swift b/macOS/PassKit/PKPaymentAuthorizationViewControllerDelegate.swift index fe6137d..bf74fa9 100644 --- a/macOS/PassKit/PKPaymentAuthorizationViewControllerDelegate.swift +++ b/macOS/PassKit/PKPaymentAuthorizationViewControllerDelegate.swift @@ -1,41 +1,41 @@ protocol PKPaymentAuthorizationViewControllerDelegate : NSObjectProtocol { @available(macOS 11.0, *) - @asyncHandler func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) + func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) @available(macOS 11.0, *) - @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) @available(macOS 11.0, *) optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationResult @available(macOS 11.0, *) optional func paymentAuthorizationViewControllerWillAuthorizePayment(_ controller: PKPaymentAuthorizationViewController) @available(macOS 11.0, *) - @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) @available(macOS 11.0, *) - @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) @available(macOS 11.0, *) optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod) async -> PKPaymentRequestShippingMethodUpdate @available(macOS 11.0, *) - @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) @available(macOS 11.0, *) optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact) async -> PKPaymentRequestShippingContactUpdate @available(macOS 11.0, *) - @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) @available(macOS 11.0, *) optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod) async -> PKPaymentRequestPaymentMethodUpdate @available(macOS 11.0, *) - @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) @available(macOS 11.0, *) optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationStatus @available(macOS 11.0, *) - @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) @available(macOS 11.0, *) optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod) async -> (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) @available(macOS 11.0, *) - @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) @available(macOS 11.0, *) optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact) async -> (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) @available(macOS 11.0, *) - @asyncHandler optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) @available(macOS 11.0, *) optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod) async -> [PKPaymentSummaryItem] } diff --git a/macOS/Photos/PHPhotoLibrary.swift b/macOS/Photos/PHPhotoLibrary.swift index 209490f..92c664d 100644 --- a/macOS/Photos/PHPhotoLibrary.swift +++ b/macOS/Photos/PHPhotoLibrary.swift @@ -26,12 +26,12 @@ enum PHAccessLevel : Int { @available(macOS 10.13, *) protocol PHPhotoLibraryChangeObserver : NSObjectProtocol { @available(macOS 10.13, *) - @asyncHandler func photoLibraryDidChange(_ changeInstance: PHChange) + func photoLibraryDidChange(_ changeInstance: PHChange) } @available(macOS 10.15, *) protocol PHPhotoLibraryAvailabilityObserver : NSObjectProtocol { @available(macOS 10.15, *) - @asyncHandler func photoLibraryDidBecomeUnavailable(_ photoLibrary: PHPhotoLibrary) + func photoLibraryDidBecomeUnavailable(_ photoLibrary: PHPhotoLibrary) } @available(macOS 10.13, *) class PHPhotoLibrary : NSObject { diff --git a/macOS/PhotosUI/PHLivePhotoView.swift b/macOS/PhotosUI/PHLivePhotoView.swift index d3f445d..2d62aa2 100644 --- a/macOS/PhotosUI/PHLivePhotoView.swift +++ b/macOS/PhotosUI/PHLivePhotoView.swift @@ -45,5 +45,5 @@ protocol PHLivePhotoViewDelegate : NSObjectProtocol { @available(macOS 10.12, *) optional func livePhotoView(_ livePhotoView: PHLivePhotoView, willBeginPlaybackWith playbackStyle: PHLivePhotoViewPlaybackStyle) @available(macOS 10.12, *) - @asyncHandler optional func livePhotoView(_ livePhotoView: PHLivePhotoView, didEndPlaybackWith playbackStyle: PHLivePhotoViewPlaybackStyle) + optional func livePhotoView(_ livePhotoView: PHLivePhotoView, didEndPlaybackWith playbackStyle: PHLivePhotoViewPlaybackStyle) } diff --git a/macOS/PushKit/PKPushRegistry.swift b/macOS/PushKit/PKPushRegistry.swift index 5ab9533..b10a57d 100644 --- a/macOS/PushKit/PKPushRegistry.swift +++ b/macOS/PushKit/PKPushRegistry.swift @@ -12,11 +12,11 @@ class PKPushRegistry : NSObject { } protocol PKPushRegistryDelegate : NSObjectProtocol { @available(macOS 10.15, *) - @asyncHandler func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) + func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) @available(macOS 10.15, *) - @asyncHandler optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) + optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) @available(macOS 10.15, *) optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType) async @available(macOS 10.15, *) - @asyncHandler optional func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType) + optional func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType) } diff --git a/macOS/QuartzCore/CAAnimation.swift b/macOS/QuartzCore/CAAnimation.swift index c37137c..d832aea 100644 --- a/macOS/QuartzCore/CAAnimation.swift +++ b/macOS/QuartzCore/CAAnimation.swift @@ -29,9 +29,9 @@ class CAAnimation : NSObject, NSSecureCoding, NSCopying, CAMediaTiming, CAAction } protocol CAAnimationDelegate : NSObjectProtocol { @available(macOS 10.5, *) - @asyncHandler optional func animationDidStart(_ anim: CAAnimation) + optional func animationDidStart(_ anim: CAAnimation) @available(macOS 10.5, *) - @asyncHandler optional func animationDidStop(_ anim: CAAnimation, finished flag: Bool) + optional func animationDidStop(_ anim: CAAnimation, finished flag: Bool) } @available(macOS 10.5, *) class CAPropertyAnimation : CAAnimation { diff --git a/macOS/ReplayKit/RPBroadcast.swift b/macOS/ReplayKit/RPBroadcast.swift index 818bb27..653a468 100644 --- a/macOS/ReplayKit/RPBroadcast.swift +++ b/macOS/ReplayKit/RPBroadcast.swift @@ -9,7 +9,7 @@ class RPBroadcastActivityController : NSObject { @available(macOS 11.0, *) protocol RPBroadcastActivityControllerDelegate : NSObjectProtocol { @available(macOS 11.0, *) - @asyncHandler func broadcastActivityController(_ broadcastActivityController: RPBroadcastActivityController, didFinishWith broadcastController: RPBroadcastController?, error: Error?) + func broadcastActivityController(_ broadcastActivityController: RPBroadcastActivityController, didFinishWith broadcastController: RPBroadcastController?, error: Error?) } @available(macOS 11.0, *) class RPBroadcastController : NSObject { @@ -25,7 +25,7 @@ class RPBroadcastController : NSObject { } @available(macOS 11.0, *) protocol RPBroadcastControllerDelegate : NSObjectProtocol { - @asyncHandler optional func broadcastController(_ broadcastController: RPBroadcastController, didFinishWithError error: Error?) - @asyncHandler optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateServiceInfo serviceInfo: [String : NSCoding & NSObjectProtocol]) - @asyncHandler optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateBroadcast broadcastURL: URL) + optional func broadcastController(_ broadcastController: RPBroadcastController, didFinishWithError error: Error?) + optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateServiceInfo serviceInfo: [String : NSCoding & NSObjectProtocol]) + optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateBroadcast broadcastURL: URL) } diff --git a/macOS/ReplayKit/RPPreviewViewController.swift b/macOS/ReplayKit/RPPreviewViewController.swift index 5ac2c24..a16efcc 100644 --- a/macOS/ReplayKit/RPPreviewViewController.swift +++ b/macOS/ReplayKit/RPPreviewViewController.swift @@ -5,7 +5,7 @@ class RPPreviewViewController : NSViewController { } protocol RPPreviewViewControllerDelegate : NSObjectProtocol { @available(macOS 11.0, *) - @asyncHandler optional func previewControllerDidFinish(_ previewController: RPPreviewViewController) + optional func previewControllerDidFinish(_ previewController: RPPreviewViewController) @available(macOS 11.0, *) - @asyncHandler optional func previewController(_ previewController: RPPreviewViewController, didFinishWithActivityTypes activityTypes: Set) + optional func previewController(_ previewController: RPPreviewViewController, didFinishWithActivityTypes activityTypes: Set) } diff --git a/macOS/ReplayKit/RPScreenRecorder.swift b/macOS/ReplayKit/RPScreenRecorder.swift index fa601ca..511d7c0 100644 --- a/macOS/ReplayKit/RPScreenRecorder.swift +++ b/macOS/ReplayKit/RPScreenRecorder.swift @@ -35,6 +35,6 @@ class RPScreenRecorder : NSObject { @available(macOS 11.0, *) protocol RPScreenRecorderDelegate : NSObjectProtocol { @available(macOS 11.0, *) - @asyncHandler optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWith previewViewController: RPPreviewViewController?, error: Error?) - @asyncHandler optional func screenRecorderDidChangeAvailability(_ screenRecorder: RPScreenRecorder) + optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWith previewViewController: RPPreviewViewController?, error: Error?) + optional func screenRecorderDidChangeAvailability(_ screenRecorder: RPScreenRecorder) } diff --git a/macOS/SafariServices/SFSafariExtensionHandling.swift b/macOS/SafariServices/SFSafariExtensionHandling.swift index 4c41135..0054171 100644 --- a/macOS/SafariServices/SFSafariExtensionHandling.swift +++ b/macOS/SafariServices/SFSafariExtensionHandling.swift @@ -7,7 +7,7 @@ protocol SFSafariExtensionHandling : NSObjectProtocol { optional func contextMenuItemSelected(withCommand command: String, in page: SFSafariPage, userInfo: [String : Any]? = nil) optional func validateContextMenuItem(withCommand command: String, in page: SFSafariPage, userInfo: [String : Any]? = nil, validationHandler: @escaping (Bool, String?) -> Void) optional func popoverWillShow(in window: SFSafariWindow) - @asyncHandler optional func popoverDidClose(in window: SFSafariWindow) + optional func popoverDidClose(in window: SFSafariWindow) optional func popoverViewController() -> SFSafariExtensionViewController optional func additionalRequestHeaders(for url: URL, completionHandler: @escaping ([String : String]?) -> Void) optional func additionalRequestHeaders(for url: URL) async -> [String : String]? diff --git a/macOS/SceneKit/SCNCameraController.swift b/macOS/SceneKit/SCNCameraController.swift index 96fe41a..ee00739 100644 --- a/macOS/SceneKit/SCNCameraController.swift +++ b/macOS/SceneKit/SCNCameraController.swift @@ -14,7 +14,7 @@ enum SCNInteractionMode : Int { @available(macOS 10.13, *) protocol SCNCameraControllerDelegate : NSObjectProtocol { optional func cameraInertiaWillStart(for cameraController: SCNCameraController) - @asyncHandler optional func cameraInertiaDidEnd(for cameraController: SCNCameraController) + optional func cameraInertiaDidEnd(for cameraController: SCNCameraController) } @available(macOS 10.13, *) class SCNCameraController : NSObject { diff --git a/macOS/SceneKit/SCNConstraint.swift b/macOS/SceneKit/SCNConstraint.swift index b57c418..bc36e0f 100644 --- a/macOS/SceneKit/SCNConstraint.swift +++ b/macOS/SceneKit/SCNConstraint.swift @@ -84,7 +84,7 @@ class SCNSliderConstraint : SCNConstraint { @available(macOS 10.13, *) protocol SCNAvoidOccluderConstraintDelegate : NSObjectProtocol { optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, shouldAvoidOccluder occluder: SCNNode, for node: SCNNode) -> Bool - @asyncHandler optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, didAvoidOccluder occluder: SCNNode, for node: SCNNode) + optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, didAvoidOccluder occluder: SCNNode, for node: SCNNode) } @available(macOS 10.13, *) class SCNAvoidOccluderConstraint : SCNConstraint { diff --git a/macOS/SceneKit/SCNPhysicsWorld.swift b/macOS/SceneKit/SCNPhysicsWorld.swift index eb3d159..558a77d 100644 --- a/macOS/SceneKit/SCNPhysicsWorld.swift +++ b/macOS/SceneKit/SCNPhysicsWorld.swift @@ -29,9 +29,9 @@ extension SCNPhysicsWorld.TestSearchMode { } @available(macOS 10.10, *) protocol SCNPhysicsContactDelegate : NSObjectProtocol { - @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didBegin contact: SCNPhysicsContact) - @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didUpdate contact: SCNPhysicsContact) - @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didEnd contact: SCNPhysicsContact) + optional func physicsWorld(_ world: SCNPhysicsWorld, didBegin contact: SCNPhysicsContact) + optional func physicsWorld(_ world: SCNPhysicsWorld, didUpdate contact: SCNPhysicsContact) + optional func physicsWorld(_ world: SCNPhysicsWorld, didEnd contact: SCNPhysicsContact) } @available(macOS 10.10, *) class SCNPhysicsWorld : NSObject, NSSecureCoding { diff --git a/macOS/SceneKit/SCNSceneRenderer.swift b/macOS/SceneKit/SCNSceneRenderer.swift index 2b49386..330e270 100644 --- a/macOS/SceneKit/SCNSceneRenderer.swift +++ b/macOS/SceneKit/SCNSceneRenderer.swift @@ -100,11 +100,11 @@ protocol SCNSceneRendererDelegate : NSObjectProtocol { @available(macOS 10.10, *) optional func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) @available(macOS 10.10, *) - @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didApplyAnimationsAtTime time: TimeInterval) + optional func renderer(_ renderer: SCNSceneRenderer, didApplyAnimationsAtTime time: TimeInterval) @available(macOS 10.10, *) - @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didSimulatePhysicsAtTime time: TimeInterval) + optional func renderer(_ renderer: SCNSceneRenderer, didSimulatePhysicsAtTime time: TimeInterval) @available(macOS 10.13, *) - @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didApplyConstraintsAtTime time: TimeInterval) + optional func renderer(_ renderer: SCNSceneRenderer, didApplyConstraintsAtTime time: TimeInterval) optional func renderer(_ renderer: SCNSceneRenderer, willRenderScene scene: SCNScene, atTime time: TimeInterval) - @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didRenderScene scene: SCNScene, atTime time: TimeInterval) + optional func renderer(_ renderer: SCNSceneRenderer, didRenderScene scene: SCNScene, atTime time: TimeInterval) } diff --git a/macOS/SoundAnalysis/SNResult.swift b/macOS/SoundAnalysis/SNResult.swift index b61b8b1..3e45c9b 100644 --- a/macOS/SoundAnalysis/SNResult.swift +++ b/macOS/SoundAnalysis/SNResult.swift @@ -4,7 +4,7 @@ protocol SNResult : NSObjectProtocol { } @available(macOS 10.15, *) protocol SNResultsObserving : NSObjectProtocol { - @asyncHandler func request(_ request: SNRequest, didProduce result: SNResult) - @asyncHandler optional func request(_ request: SNRequest, didFailWithError error: Error) - @asyncHandler optional func requestDidComplete(_ request: SNRequest) + func request(_ request: SNRequest, didProduce result: SNResult) + optional func request(_ request: SNRequest, didFailWithError error: Error) + optional func requestDidComplete(_ request: SNRequest) } diff --git a/macOS/Speech/SFSpeechRecognitionTask.swift b/macOS/Speech/SFSpeechRecognitionTask.swift index 5e1c672..77f4c28 100644 --- a/macOS/Speech/SFSpeechRecognitionTask.swift +++ b/macOS/Speech/SFSpeechRecognitionTask.swift @@ -20,10 +20,10 @@ class SFSpeechRecognitionTask : NSObject { } @available(macOS 10.15, *) protocol SFSpeechRecognitionTaskDelegate : NSObjectProtocol { - @asyncHandler optional func speechRecognitionDidDetectSpeech(_ task: SFSpeechRecognitionTask) - @asyncHandler optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didHypothesizeTranscription transcription: SFTranscription) - @asyncHandler optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishRecognition recognitionResult: SFSpeechRecognitionResult) + optional func speechRecognitionDidDetectSpeech(_ task: SFSpeechRecognitionTask) + optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didHypothesizeTranscription transcription: SFTranscription) + optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishRecognition recognitionResult: SFSpeechRecognitionResult) optional func speechRecognitionTaskFinishedReadingAudio(_ task: SFSpeechRecognitionTask) optional func speechRecognitionTaskWasCancelled(_ task: SFSpeechRecognitionTask) - @asyncHandler optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishSuccessfully successfully: Bool) + optional func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishSuccessfully successfully: Bool) } diff --git a/macOS/SpriteKit/SKPhysicsWorld.swift b/macOS/SpriteKit/SKPhysicsWorld.swift index 4c7d27b..7921b60 100644 --- a/macOS/SpriteKit/SKPhysicsWorld.swift +++ b/macOS/SpriteKit/SKPhysicsWorld.swift @@ -1,7 +1,7 @@ protocol SKPhysicsContactDelegate : NSObjectProtocol { - @asyncHandler optional func didBegin(_ contact: SKPhysicsContact) - @asyncHandler optional func didEnd(_ contact: SKPhysicsContact) + optional func didBegin(_ contact: SKPhysicsContact) + optional func didEnd(_ contact: SKPhysicsContact) } class SKPhysicsWorld : NSObject, NSSecureCoding { var gravity: CGVector diff --git a/macOS/SpriteKit/SKScene.swift b/macOS/SpriteKit/SKScene.swift index ffa3c5f..9faf218 100644 --- a/macOS/SpriteKit/SKScene.swift +++ b/macOS/SpriteKit/SKScene.swift @@ -11,10 +11,10 @@ enum SKSceneScaleMode : Int { @available(macOS 10.10, *) protocol SKSceneDelegate : NSObjectProtocol { optional func update(_ currentTime: TimeInterval, for scene: SKScene) - @asyncHandler optional func didEvaluateActions(for scene: SKScene) - @asyncHandler optional func didSimulatePhysics(for scene: SKScene) - @asyncHandler optional func didApplyConstraints(for scene: SKScene) - @asyncHandler optional func didFinishUpdate(for scene: SKScene) + optional func didEvaluateActions(for scene: SKScene) + optional func didSimulatePhysics(for scene: SKScene) + optional func didApplyConstraints(for scene: SKScene) + optional func didFinishUpdate(for scene: SKScene) } class SKScene : SKEffectNode { init(size: CGSize) diff --git a/macOS/StoreKit/SKPaymentQueue.swift b/macOS/StoreKit/SKPaymentQueue.swift index 422471e..c710bb4 100644 --- a/macOS/StoreKit/SKPaymentQueue.swift +++ b/macOS/StoreKit/SKPaymentQueue.swift @@ -52,7 +52,7 @@ protocol SKPaymentTransactionObserver : NSObjectProtocol { @available(macOS 11.0, *) optional func paymentQueue(_ queue: SKPaymentQueue, shouldAddStorePayment payment: SKPayment, for product: SKProduct) -> Bool @available(macOS 10.15, *) - @asyncHandler optional func paymentQueueDidChangeStorefront(_ queue: SKPaymentQueue) + optional func paymentQueueDidChangeStorefront(_ queue: SKPaymentQueue) @available(macOS 11.0, *) - @asyncHandler optional func paymentQueue(_ queue: SKPaymentQueue, didRevokeEntitlementsForProductIdentifiers productIdentifiers: [String]) + optional func paymentQueue(_ queue: SKPaymentQueue, didRevokeEntitlementsForProductIdentifiers productIdentifiers: [String]) } diff --git a/macOS/StoreKit/SKProductsRequest.swift b/macOS/StoreKit/SKProductsRequest.swift index d3560fe..3663a1f 100644 --- a/macOS/StoreKit/SKProductsRequest.swift +++ b/macOS/StoreKit/SKProductsRequest.swift @@ -1,7 +1,7 @@ protocol SKProductsRequestDelegate : SKRequestDelegate { @available(macOS 10.7, *) - @asyncHandler func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) + func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) } @available(macOS 10.7, *) class SKProductsRequest : SKRequest { diff --git a/macOS/StoreKit/SKRequest.swift b/macOS/StoreKit/SKRequest.swift index f050289..f5859c8 100644 --- a/macOS/StoreKit/SKRequest.swift +++ b/macOS/StoreKit/SKRequest.swift @@ -10,7 +10,7 @@ class SKRequest : NSObject { } protocol SKRequestDelegate : NSObjectProtocol { @available(macOS 10.7, *) - @asyncHandler optional func requestDidFinish(_ request: SKRequest) + optional func requestDidFinish(_ request: SKRequest) @available(macOS 10.7, *) - @asyncHandler optional func request(_ request: SKRequest, didFailWithError error: Error) + optional func request(_ request: SKRequest, didFailWithError error: Error) } diff --git a/macOS/StoreKit/SKStoreProductViewController.swift b/macOS/StoreKit/SKStoreProductViewController.swift index b35b777..ef669d0 100644 --- a/macOS/StoreKit/SKStoreProductViewController.swift +++ b/macOS/StoreKit/SKStoreProductViewController.swift @@ -10,7 +10,7 @@ class SKStoreProductViewController : NSViewController { } protocol SKStoreProductViewControllerDelegate : NSObjectProtocol { @available(macOS 11.0, *) - @asyncHandler optional func productViewControllerDidFinish(_ viewController: SKStoreProductViewController) + optional func productViewControllerDidFinish(_ viewController: SKStoreProductViewController) } @available(macOS 11.0, *) let SKStoreProductParameterITunesItemIdentifier: String diff --git a/macOS/SystemExtensions/SystemExtensions.swift b/macOS/SystemExtensions/SystemExtensions.swift index 9860892..d6472ad 100644 --- a/macOS/SystemExtensions/SystemExtensions.swift +++ b/macOS/SystemExtensions/SystemExtensions.swift @@ -69,9 +69,9 @@ protocol OSSystemExtensionRequestDelegate : NSObjectProtocol { @available(macOS 10.15, *) func requestNeedsUserApproval(_ request: OSSystemExtensionRequest) @available(macOS 10.15, *) - @asyncHandler func request(_ request: OSSystemExtensionRequest, didFinishWithResult result: OSSystemExtensionRequest.Result) + func request(_ request: OSSystemExtensionRequest, didFinishWithResult result: OSSystemExtensionRequest.Result) @available(macOS 10.15, *) - @asyncHandler func request(_ request: OSSystemExtensionRequest, didFailWithError error: Error) + func request(_ request: OSSystemExtensionRequest, didFailWithError error: Error) } @available(macOS 10.15, *) class OSSystemExtensionManager : NSObject { diff --git a/macOS/UserNotifications/UNUserNotificationCenter.swift b/macOS/UserNotifications/UNUserNotificationCenter.swift index 04fd6cd..4ad85d9 100644 --- a/macOS/UserNotifications/UNUserNotificationCenter.swift +++ b/macOS/UserNotifications/UNUserNotificationCenter.swift @@ -57,7 +57,7 @@ protocol UNUserNotificationCenterDelegate : NSObjectProtocol { @available(macOS 10.14, *) optional func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification) async -> UNNotificationPresentationOptions @available(macOS 10.14, *) - @asyncHandler optional func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) + optional func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) @available(macOS 10.14, *) optional func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async @available(macOS 10.14, *) diff --git a/macOS/Virtualization/VZVirtualMachineDelegate.swift b/macOS/Virtualization/VZVirtualMachineDelegate.swift index ffe8b7b..6efc2fc 100644 --- a/macOS/Virtualization/VZVirtualMachineDelegate.swift +++ b/macOS/Virtualization/VZVirtualMachineDelegate.swift @@ -1,7 +1,7 @@ protocol VZVirtualMachineDelegate : NSObjectProtocol { @available(macOS 11.0, *) - @asyncHandler optional func guestDidStop(_ virtualMachine: VZVirtualMachine) + optional func guestDidStop(_ virtualMachine: VZVirtualMachine) @available(macOS 11.0, *) - @asyncHandler optional func virtualMachine(_ virtualMachine: VZVirtualMachine, didStopWithError error: Error) + optional func virtualMachine(_ virtualMachine: VZVirtualMachine, didStopWithError error: Error) } diff --git a/macOS/WebKit/WKHTTPCookieStore.swift b/macOS/WebKit/WKHTTPCookieStore.swift index a55bef9..967f22b 100644 --- a/macOS/WebKit/WKHTTPCookieStore.swift +++ b/macOS/WebKit/WKHTTPCookieStore.swift @@ -1,7 +1,7 @@ @available(macOS 10.13, *) protocol WKHTTPCookieStoreObserver : NSObjectProtocol { - @asyncHandler optional func cookiesDidChange(in cookieStore: WKHTTPCookieStore) + optional func cookiesDidChange(in cookieStore: WKHTTPCookieStore) } @available(macOS 10.13, *) class WKHTTPCookieStore : NSObject { diff --git a/macOS/WebKit/WKNavigationDelegate.swift b/macOS/WebKit/WKNavigationDelegate.swift index 1b7fbf3..df4ae5f 100644 --- a/macOS/WebKit/WKNavigationDelegate.swift +++ b/macOS/WebKit/WKNavigationDelegate.swift @@ -21,23 +21,23 @@ protocol WKNavigationDelegate : NSObjectProtocol { @available(macOS 10.10, *) optional func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void) @available(macOS 10.10, *) - @asyncHandler optional func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) + optional func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) @available(macOS 10.10, *) - @asyncHandler optional func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) + optional func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) @available(macOS 10.10, *) - @asyncHandler optional func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) + optional func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) @available(macOS 10.10, *) - @asyncHandler optional func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) + optional func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) @available(macOS 10.10, *) - @asyncHandler optional func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) + optional func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) @available(macOS 10.10, *) - @asyncHandler optional func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) + optional func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) @available(macOS 10.10, *) - @asyncHandler optional func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) @available(macOS 10.10, *) optional func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) @available(macOS 10.11, *) - @asyncHandler optional func webViewWebContentProcessDidTerminate(_ webView: WKWebView) + optional func webViewWebContentProcessDidTerminate(_ webView: WKWebView) @available(macOS 11.0, *) optional func webView(_ webView: WKWebView, authenticationChallenge challenge: URLAuthenticationChallenge, shouldAllowDeprecatedTLS decisionHandler: @escaping (Bool) -> Void) } diff --git a/macOS/WebKit/WKScriptMessageHandler.swift b/macOS/WebKit/WKScriptMessageHandler.swift index be900e1..23f978c 100644 --- a/macOS/WebKit/WKScriptMessageHandler.swift +++ b/macOS/WebKit/WKScriptMessageHandler.swift @@ -1,5 +1,5 @@ protocol WKScriptMessageHandler : NSObjectProtocol { @available(macOS 10.10, *) - @asyncHandler func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) + func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) } diff --git a/macOS/WebKit/WKScriptMessageHandlerWithReply.swift b/macOS/WebKit/WKScriptMessageHandlerWithReply.swift index bd87703..f4ba951 100644 --- a/macOS/WebKit/WKScriptMessageHandlerWithReply.swift +++ b/macOS/WebKit/WKScriptMessageHandlerWithReply.swift @@ -1,5 +1,5 @@ protocol WKScriptMessageHandlerWithReply : NSObjectProtocol { @available(macOS 11.0, *) - @asyncHandler func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage, replyHandler: @escaping (Any?, String?) -> Void) + func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage, replyHandler: @escaping (Any?, String?) -> Void) } diff --git a/macOS/WebKit/WKUIDelegate.swift b/macOS/WebKit/WKUIDelegate.swift index bcd7c99..1783f12 100644 --- a/macOS/WebKit/WKUIDelegate.swift +++ b/macOS/WebKit/WKUIDelegate.swift @@ -3,7 +3,7 @@ protocol WKUIDelegate : NSObjectProtocol { @available(macOS 10.10, *) optional func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? @available(macOS 10.11, *) - @asyncHandler optional func webViewDidClose(_ webView: WKWebView) + optional func webViewDidClose(_ webView: WKWebView) @available(macOS 10.10, *) optional func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -> Void) @available(macOS 10.10, *) diff --git a/macOS/WebKit/WKURLSchemeTask.swift b/macOS/WebKit/WKURLSchemeTask.swift index 1ddd801..6b7c449 100644 --- a/macOS/WebKit/WKURLSchemeTask.swift +++ b/macOS/WebKit/WKURLSchemeTask.swift @@ -2,8 +2,8 @@ @available(macOS 10.13, *) protocol WKURLSchemeTask : NSObjectProtocol { var request: URLRequest { get } - @asyncHandler func didReceive(_ response: URLResponse) - @asyncHandler func didReceive(_ data: Data) - @asyncHandler func didFinish() - @asyncHandler func didFailWithError(_ error: Error) + func didReceive(_ response: URLResponse) + func didReceive(_ data: Data) + func didFinish() + func didFailWithError(_ error: Error) } diff --git a/macOS/WebKit/WebDocument.swift b/macOS/WebKit/WebDocument.swift index 99f277b..67ffdb3 100644 --- a/macOS/WebKit/WebDocument.swift +++ b/macOS/WebKit/WebDocument.swift @@ -6,7 +6,7 @@ protocol WebDocumentView : NSObjectProtocol { func setNeedsLayout(_ flag: Bool) func layout() func viewWillMove(toHostWindow hostWindow: NSWindow!) - @asyncHandler func viewDidMoveToHostWindow() + func viewDidMoveToHostWindow() } @available(macOS, introduced: 10.3, deprecated: 10.14) protocol WebDocumentSearching : NSObjectProtocol { diff --git a/macOS/WebKit/WebEditingDelegate.swift b/macOS/WebKit/WebEditingDelegate.swift index 1edfddd..4c48d0a 100644 --- a/macOS/WebKit/WebEditingDelegate.swift +++ b/macOS/WebKit/WebEditingDelegate.swift @@ -18,10 +18,10 @@ protocol WebEditingDelegate : NSObjectProtocol { optional func webView(_ webView: WebView!, shouldApplyStyle style: DOMCSSStyleDeclaration!, toElementsIn range: DOMRange!) -> Bool optional func webView(_ webView: WebView!, shouldChangeTypingStyle currentStyle: DOMCSSStyleDeclaration!, toStyle proposedStyle: DOMCSSStyleDeclaration!) -> Bool optional func webView(_ webView: WebView!, doCommandBy selector: Selector!) -> Bool - @asyncHandler optional func webViewDidBeginEditing(_ notification: Notification!) - @asyncHandler optional func webViewDidChange(_ notification: Notification!) - @asyncHandler optional func webViewDidEndEditing(_ notification: Notification!) - @asyncHandler optional func webViewDidChangeTypingStyle(_ notification: Notification!) - @asyncHandler optional func webViewDidChangeSelection(_ notification: Notification!) + optional func webViewDidBeginEditing(_ notification: Notification!) + optional func webViewDidChange(_ notification: Notification!) + optional func webViewDidEndEditing(_ notification: Notification!) + optional func webViewDidChangeTypingStyle(_ notification: Notification!) + optional func webViewDidChangeSelection(_ notification: Notification!) optional func undoManager(for webView: WebView!) -> UndoManager! } diff --git a/macOS/WebKit/WebFrameLoadDelegate.swift b/macOS/WebKit/WebFrameLoadDelegate.swift index 369cd60..aee1b63 100644 --- a/macOS/WebKit/WebFrameLoadDelegate.swift +++ b/macOS/WebKit/WebFrameLoadDelegate.swift @@ -1,18 +1,18 @@ @available(macOS, introduced: 10.3, deprecated: 10.14) protocol WebFrameLoadDelegate : NSObjectProtocol { - @asyncHandler optional func webView(_ sender: WebView!, didStartProvisionalLoadFor frame: WebFrame!) - @asyncHandler optional func webView(_ sender: WebView!, didReceiveServerRedirectForProvisionalLoadFor frame: WebFrame!) - @asyncHandler optional func webView(_ sender: WebView!, didFailProvisionalLoadWithError error: Error!, for frame: WebFrame!) - @asyncHandler optional func webView(_ sender: WebView!, didCommitLoadFor frame: WebFrame!) - @asyncHandler optional func webView(_ sender: WebView!, didReceiveTitle title: String!, for frame: WebFrame!) - @asyncHandler optional func webView(_ sender: WebView!, didReceiveIcon image: NSImage!, for frame: WebFrame!) - @asyncHandler optional func webView(_ sender: WebView!, didFinishLoadFor frame: WebFrame!) - @asyncHandler optional func webView(_ sender: WebView!, didFailLoadWithError error: Error!, for frame: WebFrame!) - @asyncHandler optional func webView(_ sender: WebView!, didChangeLocationWithinPageFor frame: WebFrame!) + optional func webView(_ sender: WebView!, didStartProvisionalLoadFor frame: WebFrame!) + optional func webView(_ sender: WebView!, didReceiveServerRedirectForProvisionalLoadFor frame: WebFrame!) + optional func webView(_ sender: WebView!, didFailProvisionalLoadWithError error: Error!, for frame: WebFrame!) + optional func webView(_ sender: WebView!, didCommitLoadFor frame: WebFrame!) + optional func webView(_ sender: WebView!, didReceiveTitle title: String!, for frame: WebFrame!) + optional func webView(_ sender: WebView!, didReceiveIcon image: NSImage!, for frame: WebFrame!) + optional func webView(_ sender: WebView!, didFinishLoadFor frame: WebFrame!) + optional func webView(_ sender: WebView!, didFailLoadWithError error: Error!, for frame: WebFrame!) + optional func webView(_ sender: WebView!, didChangeLocationWithinPageFor frame: WebFrame!) optional func webView(_ sender: WebView!, willPerformClientRedirectTo URL: URL!, delay seconds: TimeInterval, fire date: Date!, for frame: WebFrame!) - @asyncHandler optional func webView(_ sender: WebView!, didCancelClientRedirectFor frame: WebFrame!) + optional func webView(_ sender: WebView!, didCancelClientRedirectFor frame: WebFrame!) optional func webView(_ sender: WebView!, willClose frame: WebFrame!) - @asyncHandler optional func webView(_ webView: WebView!, didClearWindowObject windowObject: WebScriptObject!, for frame: WebFrame!) - @asyncHandler optional func webView(_ webView: WebView!, didCreateJavaScriptContext context: JSContext!, for frame: WebFrame!) + optional func webView(_ webView: WebView!, didClearWindowObject windowObject: WebScriptObject!, for frame: WebFrame!) + optional func webView(_ webView: WebView!, didCreateJavaScriptContext context: JSContext!, for frame: WebFrame!) } diff --git a/macOS/WebKit/WebResourceLoadDelegate.swift b/macOS/WebKit/WebResourceLoadDelegate.swift index 0e5d498..23b71f4 100644 --- a/macOS/WebKit/WebResourceLoadDelegate.swift +++ b/macOS/WebKit/WebResourceLoadDelegate.swift @@ -3,11 +3,11 @@ protocol WebResourceLoadDelegate : NSObjectProtocol { optional func webView(_ sender: WebView!, identifierForInitialRequest request: URLRequest!, from dataSource: WebDataSource!) -> Any! optional func webView(_ sender: WebView!, resource identifier: Any!, willSend request: URLRequest!, redirectResponse: URLResponse!, from dataSource: WebDataSource!) -> URLRequest! - @asyncHandler optional func webView(_ sender: WebView!, resource identifier: Any!, didReceive challenge: URLAuthenticationChallenge!, from dataSource: WebDataSource!) - @asyncHandler optional func webView(_ sender: WebView!, resource identifier: Any!, didCancel challenge: URLAuthenticationChallenge!, from dataSource: WebDataSource!) - @asyncHandler optional func webView(_ sender: WebView!, resource identifier: Any!, didReceive response: URLResponse!, from dataSource: WebDataSource!) - @asyncHandler optional func webView(_ sender: WebView!, resource identifier: Any!, didReceiveContentLength length: Int, from dataSource: WebDataSource!) - @asyncHandler optional func webView(_ sender: WebView!, resource identifier: Any!, didFinishLoadingFrom dataSource: WebDataSource!) - @asyncHandler optional func webView(_ sender: WebView!, resource identifier: Any!, didFailLoadingWithError error: Error!, from dataSource: WebDataSource!) + optional func webView(_ sender: WebView!, resource identifier: Any!, didReceive challenge: URLAuthenticationChallenge!, from dataSource: WebDataSource!) + optional func webView(_ sender: WebView!, resource identifier: Any!, didCancel challenge: URLAuthenticationChallenge!, from dataSource: WebDataSource!) + optional func webView(_ sender: WebView!, resource identifier: Any!, didReceive response: URLResponse!, from dataSource: WebDataSource!) + optional func webView(_ sender: WebView!, resource identifier: Any!, didReceiveContentLength length: Int, from dataSource: WebDataSource!) + optional func webView(_ sender: WebView!, resource identifier: Any!, didFinishLoadingFrom dataSource: WebDataSource!) + optional func webView(_ sender: WebView!, resource identifier: Any!, didFailLoadingWithError error: Error!, from dataSource: WebDataSource!) optional func webView(_ sender: WebView!, plugInFailedWithError error: Error!, dataSource: WebDataSource!) } diff --git a/tvOS/AVFoundation/AVAssetResourceLoader.swift b/tvOS/AVFoundation/AVAssetResourceLoader.swift index 21100dd..83d2d2d 100644 --- a/tvOS/AVFoundation/AVAssetResourceLoader.swift +++ b/tvOS/AVFoundation/AVAssetResourceLoader.swift @@ -11,11 +11,11 @@ protocol AVAssetResourceLoaderDelegate : NSObjectProtocol { @available(tvOS 9.0, *) optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForRenewalOfRequestedResource renewalRequest: AVAssetResourceRenewalRequest) -> Bool @available(tvOS 9.0, *) - @asyncHandler optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel loadingRequest: AVAssetResourceLoadingRequest) + optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel loadingRequest: AVAssetResourceLoadingRequest) @available(tvOS 9.0, *) optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForResponseTo authenticationChallenge: URLAuthenticationChallenge) -> Bool @available(tvOS 9.0, *) - @asyncHandler optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel authenticationChallenge: URLAuthenticationChallenge) + optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel authenticationChallenge: URLAuthenticationChallenge) } @available(tvOS 12.0, *) class AVAssetResourceLoadingRequestor : NSObject { diff --git a/tvOS/AVFoundation/AVAssetWriter.swift b/tvOS/AVFoundation/AVAssetWriter.swift index 2821f6a..be7d6e3 100644 --- a/tvOS/AVFoundation/AVAssetWriter.swift +++ b/tvOS/AVFoundation/AVAssetWriter.swift @@ -78,6 +78,6 @@ extension AVAssetWriter { } @available(tvOS 14.0, *) protocol AVAssetWriterDelegate : NSObjectProtocol { - @asyncHandler optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType, segmentReport: AVAssetSegmentReport?) - @asyncHandler optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType) + optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType, segmentReport: AVAssetSegmentReport?) + optional func assetWriter(_ writer: AVAssetWriter, didOutputSegmentData segmentData: Data, segmentType: AVAssetSegmentType) } diff --git a/tvOS/AVFoundation/AVContentKeySession.swift b/tvOS/AVFoundation/AVContentKeySession.swift index b64cde0..ee1a073 100644 --- a/tvOS/AVFoundation/AVContentKeySession.swift +++ b/tvOS/AVFoundation/AVContentKeySession.swift @@ -73,16 +73,16 @@ extension AVContentKeyRequest.RetryReason { } @available(tvOS 10.2, *) protocol AVContentKeySessionDelegate : NSObjectProtocol { - @asyncHandler func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest) - @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didProvideRenewingContentKeyRequest keyRequest: AVContentKeyRequest) - @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVPersistableContentKeyRequest) - @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequest keyRequest: AVContentKeyRequest, didFailWithError err: Error) + func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest) + optional func contentKeySession(_ session: AVContentKeySession, didProvideRenewingContentKeyRequest keyRequest: AVContentKeyRequest) + optional func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVPersistableContentKeyRequest) + optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequest keyRequest: AVContentKeyRequest, didFailWithError err: Error) optional func contentKeySession(_ session: AVContentKeySession, shouldRetry keyRequest: AVContentKeyRequest, reason retryReason: AVContentKeyRequest.RetryReason) -> Bool @available(tvOS 12.0, *) optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequestDidSucceed keyRequest: AVContentKeyRequest) - @asyncHandler optional func contentKeySessionContentProtectionSessionIdentifierDidChange(_ session: AVContentKeySession) + optional func contentKeySessionContentProtectionSessionIdentifierDidChange(_ session: AVContentKeySession) @available(tvOS 12.0, *) - @asyncHandler optional func contentKeySessionDidGenerateExpiredSessionReport(_ session: AVContentKeySession) + optional func contentKeySessionDidGenerateExpiredSessionReport(_ session: AVContentKeySession) } @available(tvOS 10.2, *) class AVContentKeyRequest : NSObject { diff --git a/tvOS/AVFoundation/AVPlayerItemMediaDataCollector.swift b/tvOS/AVFoundation/AVPlayerItemMediaDataCollector.swift index ab74a75..4faf98c 100644 --- a/tvOS/AVFoundation/AVPlayerItemMediaDataCollector.swift +++ b/tvOS/AVFoundation/AVPlayerItemMediaDataCollector.swift @@ -11,5 +11,5 @@ class AVPlayerItemMetadataCollector : AVPlayerItemMediaDataCollector { } protocol AVPlayerItemMetadataCollectorPushDelegate : NSObjectProtocol { @available(tvOS 9.3, *) - @asyncHandler func metadataCollector(_ metadataCollector: AVPlayerItemMetadataCollector, didCollect metadataGroups: [AVDateRangeMetadataGroup], indexesOfNewGroups: IndexSet, indexesOfModifiedGroups: IndexSet) + func metadataCollector(_ metadataCollector: AVPlayerItemMetadataCollector, didCollect metadataGroups: [AVDateRangeMetadataGroup], indexesOfNewGroups: IndexSet, indexesOfModifiedGroups: IndexSet) } diff --git a/tvOS/AVFoundation/AVPlayerItemOutput.swift b/tvOS/AVFoundation/AVPlayerItemOutput.swift index 1d9a353..5685491 100644 --- a/tvOS/AVFoundation/AVPlayerItemOutput.swift +++ b/tvOS/AVFoundation/AVPlayerItemOutput.swift @@ -52,7 +52,7 @@ extension AVPlayerItemLegibleOutput.TextStylingResolution { } protocol AVPlayerItemLegibleOutputPushDelegate : AVPlayerItemOutputPushDelegate { @available(tvOS 9.0, *) - @asyncHandler optional func legibleOutput(_ output: AVPlayerItemLegibleOutput, didOutputAttributedStrings strings: [NSAttributedString], nativeSampleBuffers nativeSamples: [Any], forItemTime itemTime: CMTime) + optional func legibleOutput(_ output: AVPlayerItemLegibleOutput, didOutputAttributedStrings strings: [NSAttributedString], nativeSampleBuffers nativeSamples: [Any], forItemTime itemTime: CMTime) } protocol AVPlayerItemOutputPushDelegate : NSObjectProtocol { @available(tvOS 9.0, *) @@ -68,5 +68,5 @@ class AVPlayerItemMetadataOutput : AVPlayerItemOutput { } protocol AVPlayerItemMetadataOutputPushDelegate : AVPlayerItemOutputPushDelegate { @available(tvOS 9.0, *) - @asyncHandler optional func metadataOutput(_ output: AVPlayerItemMetadataOutput, didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup], from track: AVPlayerItemTrack?) + optional func metadataOutput(_ output: AVPlayerItemMetadataOutput, didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup], from track: AVPlayerItemTrack?) } diff --git a/tvOS/AVKit/AVPictureInPictureController.swift b/tvOS/AVKit/AVPictureInPictureController.swift index e852c0d..2e2f15c 100644 --- a/tvOS/AVKit/AVPictureInPictureController.swift +++ b/tvOS/AVKit/AVPictureInPictureController.swift @@ -24,10 +24,10 @@ class AVPictureInPictureController : NSObject { @available(tvOS 14.0, *) protocol AVPictureInPictureControllerDelegate : NSObjectProtocol { optional func pictureInPictureControllerWillStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) - @asyncHandler optional func pictureInPictureControllerDidStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) + optional func pictureInPictureControllerDidStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, failedToStartPictureInPictureWithError error: Error) optional func pictureInPictureControllerWillStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) - @asyncHandler optional func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) + optional func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void) optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController) async -> Bool } diff --git a/tvOS/AVKit/AVPlayerViewController.swift b/tvOS/AVKit/AVPlayerViewController.swift index 9b1ac21..c4f12b0 100644 --- a/tvOS/AVKit/AVPlayerViewController.swift +++ b/tvOS/AVKit/AVPlayerViewController.swift @@ -51,17 +51,17 @@ protocol AVPlayerViewControllerDelegate : NSObjectProtocol { @available(tvOS 11.0, *) optional func playerViewControllerWillBeginDismissalTransition(_ playerViewController: AVPlayerViewController) @available(tvOS 11.0, *) - @asyncHandler optional func playerViewControllerDidEndDismissalTransition(_ playerViewController: AVPlayerViewController) + optional func playerViewControllerDidEndDismissalTransition(_ playerViewController: AVPlayerViewController) @available(tvOS 9.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, willPresent interstitial: AVInterstitialTimeRange) @available(tvOS 9.0, *) - @asyncHandler optional func playerViewController(_ playerViewController: AVPlayerViewController, didPresent interstitial: AVInterstitialTimeRange) + optional func playerViewController(_ playerViewController: AVPlayerViewController, didPresent interstitial: AVInterstitialTimeRange) @available(tvOS 9.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, willResumePlaybackAfterUserNavigatedFrom oldTime: CMTime, to targetTime: CMTime) @available(tvOS 10.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, timeToSeekAfterUserNavigatedFrom oldTime: CMTime, to targetTime: CMTime) -> CMTime @available(tvOS 9.0, *) - @asyncHandler optional func playerViewController(_ playerViewController: AVPlayerViewController, didSelect mediaSelectionOption: AVMediaSelectionOption?, in mediaSelectionGroup: AVMediaSelectionGroup) + optional func playerViewController(_ playerViewController: AVPlayerViewController, didSelect mediaSelectionOption: AVMediaSelectionOption?, in mediaSelectionGroup: AVMediaSelectionGroup) @available(tvOS 10.0, *) optional func skipToNextItem(for playerViewController: AVPlayerViewController) @available(tvOS 10.0, *) @@ -81,21 +81,21 @@ protocol AVPlayerViewControllerDelegate : NSObjectProtocol { @available(tvOS 10.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, shouldPresent proposal: AVContentProposal) -> Bool @available(tvOS 10.0, *) - @asyncHandler optional func playerViewController(_ playerViewController: AVPlayerViewController, didAccept proposal: AVContentProposal) + optional func playerViewController(_ playerViewController: AVPlayerViewController, didAccept proposal: AVContentProposal) @available(tvOS 10.0, *) - @asyncHandler optional func playerViewController(_ playerViewController: AVPlayerViewController, didReject proposal: AVContentProposal) + optional func playerViewController(_ playerViewController: AVPlayerViewController, didReject proposal: AVContentProposal) @available(tvOS 11.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, willTransitionToVisibilityOfTransportBar visible: Bool, with coordinator: AVPlayerViewControllerAnimationCoordinator) @available(tvOS 9.0, *) optional func playerViewControllerWillStartPictureInPicture(_ playerViewController: AVPlayerViewController) @available(tvOS 9.0, *) - @asyncHandler optional func playerViewControllerDidStartPictureInPicture(_ playerViewController: AVPlayerViewController) + optional func playerViewControllerDidStartPictureInPicture(_ playerViewController: AVPlayerViewController) @available(tvOS 9.0, *) optional func playerViewController(_ playerViewController: AVPlayerViewController, failedToStartPictureInPictureWithError error: Error) @available(tvOS 9.0, *) optional func playerViewControllerWillStopPictureInPicture(_ playerViewController: AVPlayerViewController) @available(tvOS 9.0, *) - @asyncHandler optional func playerViewControllerDidStopPictureInPicture(_ playerViewController: AVPlayerViewController) + optional func playerViewControllerDidStopPictureInPicture(_ playerViewController: AVPlayerViewController) @available(tvOS 9.0, *) optional func playerViewControllerShouldAutomaticallyDismissAtPictureInPictureStart(_ playerViewController: AVPlayerViewController) -> Bool @available(tvOS 9.0, *) diff --git a/tvOS/AVKit/AVRoutePickerView.swift b/tvOS/AVKit/AVRoutePickerView.swift index 9ff0aee..3fad211 100644 --- a/tvOS/AVKit/AVRoutePickerView.swift +++ b/tvOS/AVKit/AVRoutePickerView.swift @@ -20,5 +20,5 @@ protocol AVRoutePickerViewDelegate : NSObjectProtocol { @available(tvOS 11.0, *) optional func routePickerViewWillBeginPresentingRoutes(_ routePickerView: AVRoutePickerView) @available(tvOS 11.0, *) - @asyncHandler optional func routePickerViewDidEndPresentingRoutes(_ routePickerView: AVRoutePickerView) + optional func routePickerViewDidEndPresentingRoutes(_ routePickerView: AVRoutePickerView) } diff --git a/tvOS/AuthenticationServices/ASAuthorizationController.swift b/tvOS/AuthenticationServices/ASAuthorizationController.swift index 249979c..7696774 100644 --- a/tvOS/AuthenticationServices/ASAuthorizationController.swift +++ b/tvOS/AuthenticationServices/ASAuthorizationController.swift @@ -1,8 +1,8 @@ @available(tvOS 13.0, *) protocol ASAuthorizationControllerDelegate : NSObjectProtocol { - @asyncHandler optional func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) - @asyncHandler optional func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) + optional func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) + optional func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) } @available(tvOS 13.0, *) protocol ASAuthorizationControllerPresentationContextProviding : NSObjectProtocol { diff --git a/tvOS/CoreBluetooth/CBCentralManager.swift b/tvOS/CoreBluetooth/CBCentralManager.swift index aa43f9f..74a64d4 100644 --- a/tvOS/CoreBluetooth/CBCentralManager.swift +++ b/tvOS/CoreBluetooth/CBCentralManager.swift @@ -47,19 +47,19 @@ class CBCentralManager : CBManager { } protocol CBCentralManagerDelegate : NSObjectProtocol { @available(tvOS 5.0, *) - @asyncHandler func centralManagerDidUpdateState(_ central: CBCentralManager) + func centralManagerDidUpdateState(_ central: CBCentralManager) @available(tvOS 5.0, *) optional func centralManager(_ central: CBCentralManager, willRestoreState dict: [String : Any]) @available(tvOS 5.0, *) - @asyncHandler optional func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) + optional func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) @available(tvOS 5.0, *) - @asyncHandler optional func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) + optional func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) @available(tvOS 5.0, *) - @asyncHandler optional func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) + optional func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) @available(tvOS 5.0, *) - @asyncHandler optional func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) + optional func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) @available(tvOS 13.0, *) optional func centralManager(_ central: CBCentralManager, connectionEventDidOccur event: CBConnectionEvent, for peripheral: CBPeripheral) @available(tvOS 13.0, *) - @asyncHandler optional func centralManager(_ central: CBCentralManager, didUpdateANCSAuthorizationFor peripheral: CBPeripheral) + optional func centralManager(_ central: CBCentralManager, didUpdateANCSAuthorizationFor peripheral: CBPeripheral) } diff --git a/tvOS/CoreBluetooth/CBPeripheral.swift b/tvOS/CoreBluetooth/CBPeripheral.swift index 9c2d6a6..3683a5d 100644 --- a/tvOS/CoreBluetooth/CBPeripheral.swift +++ b/tvOS/CoreBluetooth/CBPeripheral.swift @@ -44,33 +44,33 @@ class CBPeripheral : CBPeer { } protocol CBPeripheralDelegate : NSObjectProtocol { @available(tvOS 6.0, *) - @asyncHandler optional func peripheralDidUpdateName(_ peripheral: CBPeripheral) + optional func peripheralDidUpdateName(_ peripheral: CBPeripheral) @available(tvOS 7.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]) + optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]) @available(tvOS, introduced: 5.0, deprecated: 8.0) - @asyncHandler optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, error: Error?) + optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, error: Error?) @available(tvOS 8.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didReadRSSI RSSI: NSNumber, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didReadRSSI RSSI: NSNumber, error: Error?) @available(tvOS 5.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) @available(tvOS 5.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesFor service: CBService, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesFor service: CBService, error: Error?) @available(tvOS 5.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) @available(tvOS 5.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) @available(tvOS 5.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) @available(tvOS 5.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: Error?) @available(tvOS 5.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverDescriptorsFor characteristic: CBCharacteristic, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didDiscoverDescriptorsFor characteristic: CBCharacteristic, error: Error?) @available(tvOS 5.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor descriptor: CBDescriptor, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor descriptor: CBDescriptor, error: Error?) @available(tvOS 5.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor descriptor: CBDescriptor, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor descriptor: CBDescriptor, error: Error?) @available(tvOS 5.0, *) optional func peripheralIsReady(toSendWriteWithoutResponse peripheral: CBPeripheral) @available(tvOS 11.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?) } diff --git a/tvOS/CoreBluetooth/CBPeripheralManager.swift b/tvOS/CoreBluetooth/CBPeripheralManager.swift index c12b461..97eb23c 100644 --- a/tvOS/CoreBluetooth/CBPeripheralManager.swift +++ b/tvOS/CoreBluetooth/CBPeripheralManager.swift @@ -48,27 +48,27 @@ class CBPeripheralManager : CBManager { } protocol CBPeripheralManagerDelegate : NSObjectProtocol { @available(tvOS 6.0, *) - @asyncHandler func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) + func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) @available(tvOS 6.0, *) optional func peripheralManager(_ peripheral: CBPeripheralManager, willRestoreState dict: [String : Any]) @available(tvOS 6.0, *) - @asyncHandler optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error: Error?) + optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error: Error?) @available(tvOS 6.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) @available(tvOS 6.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didSubscribeTo characteristic: CBCharacteristic) + optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didSubscribeTo characteristic: CBCharacteristic) @available(tvOS 6.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didUnsubscribeFrom characteristic: CBCharacteristic) + optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didUnsubscribeFrom characteristic: CBCharacteristic) @available(tvOS 6.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveRead request: CBATTRequest) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveRead request: CBATTRequest) @available(tvOS 6.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) @available(tvOS 6.0, *) optional func peripheralManagerIsReady(toUpdateSubscribers peripheral: CBPeripheralManager) @available(tvOS 6.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) @available(tvOS 6.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didUnpublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didUnpublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) @available(tvOS 11.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: Error?) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: Error?) } diff --git a/tvOS/CoreData/NSFetchedResultsController.swift b/tvOS/CoreData/NSFetchedResultsController.swift index 6bcdbdc..bf886f9 100644 --- a/tvOS/CoreData/NSFetchedResultsController.swift +++ b/tvOS/CoreData/NSFetchedResultsController.swift @@ -34,15 +34,15 @@ enum NSFetchedResultsChangeType : UInt { } protocol NSFetchedResultsControllerDelegate : NSObjectProtocol { @available(tvOS 13.0, *) - @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChangeContentWith diff: CollectionDifference) + optional func controller(_ controller: NSFetchedResultsController, didChangeContentWith diff: CollectionDifference) @available(tvOS 3.0, *) - @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) + optional func controller(_ controller: NSFetchedResultsController, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) @available(tvOS 3.0, *) - @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChange sectionInfo: NSFetchedResultsSectionInfo, atSectionIndex sectionIndex: Int, for type: NSFetchedResultsChangeType) + optional func controller(_ controller: NSFetchedResultsController, didChange sectionInfo: NSFetchedResultsSectionInfo, atSectionIndex sectionIndex: Int, for type: NSFetchedResultsChangeType) @available(tvOS 3.0, *) optional func controllerWillChangeContent(_ controller: NSFetchedResultsController) @available(tvOS 3.0, *) - @asyncHandler optional func controllerDidChangeContent(_ controller: NSFetchedResultsController) + optional func controllerDidChangeContent(_ controller: NSFetchedResultsController) @available(tvOS 4.0, *) optional func controller(_ controller: NSFetchedResultsController, sectionIndexTitleForSectionName sectionName: String) -> String? } diff --git a/tvOS/CoreLocation/CLLocationManagerDelegate.swift b/tvOS/CoreLocation/CLLocationManagerDelegate.swift index 689be8b..db4e715 100644 --- a/tvOS/CoreLocation/CLLocationManagerDelegate.swift +++ b/tvOS/CoreLocation/CLLocationManagerDelegate.swift @@ -1,11 +1,11 @@ protocol CLLocationManagerDelegate : NSObjectProtocol { @available(tvOS 6.0, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) + optional func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) @available(tvOS 2.0, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) + optional func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) @available(tvOS, introduced: 9.0, deprecated: 14.0) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) + optional func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) @available(tvOS 14.0, *) - @asyncHandler optional func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) + optional func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) } diff --git a/tvOS/ExternalAccessory/EAAccessory.swift b/tvOS/ExternalAccessory/EAAccessory.swift index 31a6935..1f4f241 100644 --- a/tvOS/ExternalAccessory/EAAccessory.swift +++ b/tvOS/ExternalAccessory/EAAccessory.swift @@ -27,5 +27,5 @@ class EAAccessory : NSObject { } protocol EAAccessoryDelegate : NSObjectProtocol { @available(tvOS 10.0, *) - @asyncHandler optional func accessoryDidDisconnect(_ accessory: EAAccessory) + optional func accessoryDidDisconnect(_ accessory: EAAccessory) } diff --git a/tvOS/Foundation/NSFilePresenter.swift b/tvOS/Foundation/NSFilePresenter.swift index 046e6ba..4f74cc3 100644 --- a/tvOS/Foundation/NSFilePresenter.swift +++ b/tvOS/Foundation/NSFilePresenter.swift @@ -9,23 +9,23 @@ protocol NSFilePresenter : NSObjectProtocol { optional func savePresentedItemChanges() async throws optional func accommodatePresentedItemDeletion(completionHandler: @escaping (Error?) -> Void) optional func accommodatePresentedItemDeletion() async throws - @asyncHandler optional func presentedItemDidMove(to newURL: URL) - @asyncHandler optional func presentedItemDidChange() + optional func presentedItemDidMove(to newURL: URL) + optional func presentedItemDidChange() @available(tvOS 9.0, *) - @asyncHandler optional func presentedItemDidGain(_ version: NSFileVersion) + optional func presentedItemDidGain(_ version: NSFileVersion) @available(tvOS 9.0, *) - @asyncHandler optional func presentedItemDidLose(_ version: NSFileVersion) + optional func presentedItemDidLose(_ version: NSFileVersion) @available(tvOS 9.0, *) - @asyncHandler optional func presentedItemDidResolveConflict(_ version: NSFileVersion) + optional func presentedItemDidResolveConflict(_ version: NSFileVersion) optional func accommodatePresentedSubitemDeletion(at url: URL, completionHandler: @escaping (Error?) -> Void) optional func accommodatePresentedSubitemDeletion(at url: URL) async throws - @asyncHandler optional func presentedSubitemDidAppear(at url: URL) - @asyncHandler optional func presentedSubitem(at oldURL: URL, didMoveTo newURL: URL) - @asyncHandler optional func presentedSubitemDidChange(at url: URL) + optional func presentedSubitemDidAppear(at url: URL) + optional func presentedSubitem(at oldURL: URL, didMoveTo newURL: URL) + optional func presentedSubitemDidChange(at url: URL) @available(tvOS 9.0, *) - @asyncHandler optional func presentedSubitem(at url: URL, didGain version: NSFileVersion) + optional func presentedSubitem(at url: URL, didGain version: NSFileVersion) @available(tvOS 9.0, *) - @asyncHandler optional func presentedSubitem(at url: URL, didLose version: NSFileVersion) + optional func presentedSubitem(at url: URL, didLose version: NSFileVersion) @available(tvOS 9.0, *) - @asyncHandler optional func presentedSubitem(at url: URL, didResolve version: NSFileVersion) + optional func presentedSubitem(at url: URL, didResolve version: NSFileVersion) } diff --git a/tvOS/Foundation/NSKeyedArchiver.swift b/tvOS/Foundation/NSKeyedArchiver.swift index 68035b9..f3e8ff0 100644 --- a/tvOS/Foundation/NSKeyedArchiver.swift +++ b/tvOS/Foundation/NSKeyedArchiver.swift @@ -80,17 +80,17 @@ extension NSKeyedUnarchiver { } protocol NSKeyedArchiverDelegate : NSObjectProtocol { optional func archiver(_ archiver: NSKeyedArchiver, willEncode object: Any) -> Any? - @asyncHandler optional func archiver(_ archiver: NSKeyedArchiver, didEncode object: Any?) + optional func archiver(_ archiver: NSKeyedArchiver, didEncode object: Any?) optional func archiver(_ archiver: NSKeyedArchiver, willReplace object: Any?, with newObject: Any?) optional func archiverWillFinish(_ archiver: NSKeyedArchiver) - @asyncHandler optional func archiverDidFinish(_ archiver: NSKeyedArchiver) + optional func archiverDidFinish(_ archiver: NSKeyedArchiver) } protocol NSKeyedUnarchiverDelegate : NSObjectProtocol { optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, cannotDecodeObjectOfClassName name: String, originalClasses classNames: [String]) -> AnyClass? optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, didDecode object: Any?) -> Any? optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, willReplace object: Any, with newObject: Any) optional func unarchiverWillFinish(_ unarchiver: NSKeyedUnarchiver) - @asyncHandler optional func unarchiverDidFinish(_ unarchiver: NSKeyedUnarchiver) + optional func unarchiverDidFinish(_ unarchiver: NSKeyedUnarchiver) } extension NSObject { var classForKeyedArchiver: AnyClass? { get } diff --git a/tvOS/Foundation/NSNetServices.swift b/tvOS/Foundation/NSNetServices.swift index c90ce47..5b6142e 100644 --- a/tvOS/Foundation/NSNetServices.swift +++ b/tvOS/Foundation/NSNetServices.swift @@ -72,23 +72,23 @@ class NetServiceBrowser : NSObject { @available(tvOS 9.0, *) protocol NetServiceDelegate : NSObjectProtocol { optional func netServiceWillPublish(_ sender: NetService) - @asyncHandler optional func netServiceDidPublish(_ sender: NetService) - @asyncHandler optional func netService(_ sender: NetService, didNotPublish errorDict: [String : NSNumber]) + optional func netServiceDidPublish(_ sender: NetService) + optional func netService(_ sender: NetService, didNotPublish errorDict: [String : NSNumber]) optional func netServiceWillResolve(_ sender: NetService) - @asyncHandler optional func netServiceDidResolveAddress(_ sender: NetService) - @asyncHandler optional func netService(_ sender: NetService, didNotResolve errorDict: [String : NSNumber]) - @asyncHandler optional func netServiceDidStop(_ sender: NetService) - @asyncHandler optional func netService(_ sender: NetService, didUpdateTXTRecord data: Data) + optional func netServiceDidResolveAddress(_ sender: NetService) + optional func netService(_ sender: NetService, didNotResolve errorDict: [String : NSNumber]) + optional func netServiceDidStop(_ sender: NetService) + optional func netService(_ sender: NetService, didUpdateTXTRecord data: Data) @available(tvOS 9.0, *) - @asyncHandler optional func netService(_ sender: NetService, didAcceptConnectionWith inputStream: InputStream, outputStream: OutputStream) + optional func netService(_ sender: NetService, didAcceptConnectionWith inputStream: InputStream, outputStream: OutputStream) } @available(tvOS 9.0, *) protocol NetServiceBrowserDelegate : NSObjectProtocol { optional func netServiceBrowserWillSearch(_ browser: NetServiceBrowser) - @asyncHandler optional func netServiceBrowserDidStopSearch(_ browser: NetServiceBrowser) - @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didNotSearch errorDict: [String : NSNumber]) - @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didFindDomain domainString: String, moreComing: Bool) - @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didFind service: NetService, moreComing: Bool) - @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemoveDomain domainString: String, moreComing: Bool) - @asyncHandler optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemove service: NetService, moreComing: Bool) + optional func netServiceBrowserDidStopSearch(_ browser: NetServiceBrowser) + optional func netServiceBrowser(_ browser: NetServiceBrowser, didNotSearch errorDict: [String : NSNumber]) + optional func netServiceBrowser(_ browser: NetServiceBrowser, didFindDomain domainString: String, moreComing: Bool) + optional func netServiceBrowser(_ browser: NetServiceBrowser, didFind service: NetService, moreComing: Bool) + optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemoveDomain domainString: String, moreComing: Bool) + optional func netServiceBrowser(_ browser: NetServiceBrowser, didRemove service: NetService, moreComing: Bool) } diff --git a/tvOS/Foundation/NSURLConnection.swift b/tvOS/Foundation/NSURLConnection.swift index 836cc15..dabeaad 100644 --- a/tvOS/Foundation/NSURLConnection.swift +++ b/tvOS/Foundation/NSURLConnection.swift @@ -22,31 +22,31 @@ class NSURLConnection : NSObject { } @available(tvOS 9.0, *) protocol NSURLConnectionDelegate : NSObjectProtocol { - @asyncHandler optional func connection(_ connection: NSURLConnection, didFailWithError error: Error) + optional func connection(_ connection: NSURLConnection, didFailWithError error: Error) optional func connectionShouldUseCredentialStorage(_ connection: NSURLConnection) -> Bool optional func connection(_ connection: NSURLConnection, willSendRequestFor challenge: URLAuthenticationChallenge) @available(tvOS, introduced: 9.0, deprecated: 9.0, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") optional func connection(_ connection: NSURLConnection, canAuthenticateAgainstProtectionSpace protectionSpace: URLProtectionSpace) -> Bool @available(tvOS, introduced: 9.0, deprecated: 9.0, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") - @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive challenge: URLAuthenticationChallenge) + optional func connection(_ connection: NSURLConnection, didReceive challenge: URLAuthenticationChallenge) @available(tvOS, introduced: 9.0, deprecated: 9.0, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") - @asyncHandler optional func connection(_ connection: NSURLConnection, didCancel challenge: URLAuthenticationChallenge) + optional func connection(_ connection: NSURLConnection, didCancel challenge: URLAuthenticationChallenge) } @available(tvOS 9.0, *) protocol NSURLConnectionDataDelegate : NSURLConnectionDelegate { optional func connection(_ connection: NSURLConnection, willSend request: URLRequest, redirectResponse response: URLResponse?) -> URLRequest? - @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive response: URLResponse) - @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive data: Data) + optional func connection(_ connection: NSURLConnection, didReceive response: URLResponse) + optional func connection(_ connection: NSURLConnection, didReceive data: Data) optional func connection(_ connection: NSURLConnection, needNewBodyStream request: URLRequest) -> InputStream? - @asyncHandler optional func connection(_ connection: NSURLConnection, didSendBodyData bytesWritten: Int, totalBytesWritten: Int, totalBytesExpectedToWrite: Int) + optional func connection(_ connection: NSURLConnection, didSendBodyData bytesWritten: Int, totalBytesWritten: Int, totalBytesExpectedToWrite: Int) optional func connection(_ connection: NSURLConnection, willCacheResponse cachedResponse: CachedURLResponse) -> CachedURLResponse? - @asyncHandler optional func connectionDidFinishLoading(_ connection: NSURLConnection) + optional func connectionDidFinishLoading(_ connection: NSURLConnection) } @available(tvOS 9.0, *) protocol NSURLConnectionDownloadDelegate : NSURLConnectionDelegate { - @asyncHandler optional func connection(_ connection: NSURLConnection, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, expectedTotalBytes: Int64) - @asyncHandler optional func connectionDidResumeDownloading(_ connection: NSURLConnection, totalBytesWritten: Int64, expectedTotalBytes: Int64) - @asyncHandler func connectionDidFinishDownloading(_ connection: NSURLConnection, destinationURL: URL) + optional func connection(_ connection: NSURLConnection, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, expectedTotalBytes: Int64) + optional func connectionDidResumeDownloading(_ connection: NSURLConnection, totalBytesWritten: Int64, expectedTotalBytes: Int64) + func connectionDidFinishDownloading(_ connection: NSURLConnection, destinationURL: URL) } extension NSURLConnection { @available(tvOS, introduced: 9.0, deprecated: 9.0, message: "Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h") diff --git a/tvOS/Foundation/NSURLProtocol.swift b/tvOS/Foundation/NSURLProtocol.swift index b8b7495..deb3dfe 100644 --- a/tvOS/Foundation/NSURLProtocol.swift +++ b/tvOS/Foundation/NSURLProtocol.swift @@ -3,12 +3,12 @@ protocol URLProtocolClient : NSObjectProtocol { func urlProtocol(_ protocol: URLProtocol, wasRedirectedTo request: URLRequest, redirectResponse: URLResponse) func urlProtocol(_ protocol: URLProtocol, cachedResponseIsValid cachedResponse: CachedURLResponse) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didReceive response: URLResponse, cacheStoragePolicy policy: URLCache.StoragePolicy) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didLoad data: Data) - @asyncHandler func urlProtocolDidFinishLoading(_ protocol: URLProtocol) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didFailWithError error: Error) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didReceive challenge: URLAuthenticationChallenge) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didCancel challenge: URLAuthenticationChallenge) + func urlProtocol(_ protocol: URLProtocol, didReceive response: URLResponse, cacheStoragePolicy policy: URLCache.StoragePolicy) + func urlProtocol(_ protocol: URLProtocol, didLoad data: Data) + func urlProtocolDidFinishLoading(_ protocol: URLProtocol) + func urlProtocol(_ protocol: URLProtocol, didFailWithError error: Error) + func urlProtocol(_ protocol: URLProtocol, didReceive challenge: URLAuthenticationChallenge) + func urlProtocol(_ protocol: URLProtocol, didCancel challenge: URLAuthenticationChallenge) } @available(tvOS 9.0, *) class URLProtocol : NSObject { diff --git a/tvOS/Foundation/NSURLSession.swift b/tvOS/Foundation/NSURLSession.swift index 6d67a91..39bc129 100644 --- a/tvOS/Foundation/NSURLSession.swift +++ b/tvOS/Foundation/NSURLSession.swift @@ -274,11 +274,11 @@ extension URLSession { } @available(tvOS 9.0, *) protocol URLSessionDelegate : NSObjectProtocol { - @asyncHandler optional func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) - @asyncHandler optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) + optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) @available(tvOS 9.0, *) - @asyncHandler optional func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) + optional func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) } @available(tvOS 9.0, *) protocol URLSessionTaskDelegate : URLSessionDelegate { @@ -290,43 +290,43 @@ protocol URLSessionTaskDelegate : URLSessionDelegate { optional func urlSession(_ session: URLSession, taskIsWaitingForConnectivity task: URLSessionTask) optional func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest, completionHandler: @escaping (URLRequest?) -> Void) optional func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest) async -> URLRequest? - @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) optional func urlSession(_ session: URLSession, task: URLSessionTask, needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) optional func urlSession(_ session: URLSession, task: URLSessionTask) async -> InputStream? - @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) @available(tvOS 10.0, *) - @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) - @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) } @available(tvOS 9.0, *) protocol URLSessionDataDelegate : URLSessionTaskDelegate { - @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse) async -> URLSession.ResponseDisposition - @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome downloadTask: URLSessionDownloadTask) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome downloadTask: URLSessionDownloadTask) @available(tvOS 9.0, *) - @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome streamTask: URLSessionStreamTask) - @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome streamTask: URLSessionStreamTask) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse, completionHandler: @escaping (CachedURLResponse?) -> Void) optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse) async -> CachedURLResponse? } @available(tvOS 9.0, *) protocol URLSessionDownloadDelegate : URLSessionTaskDelegate { - @asyncHandler func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) - @asyncHandler optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) - @asyncHandler optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) + func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) + optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) + optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) } @available(tvOS 9.0, *) protocol URLSessionStreamDelegate : URLSessionTaskDelegate { optional func urlSession(_ session: URLSession, readClosedFor streamTask: URLSessionStreamTask) optional func urlSession(_ session: URLSession, writeClosedFor streamTask: URLSessionStreamTask) optional func urlSession(_ session: URLSession, betterRouteDiscoveredFor streamTask: URLSessionStreamTask) - @asyncHandler optional func urlSession(_ session: URLSession, streamTask: URLSessionStreamTask, didBecome inputStream: InputStream, outputStream: OutputStream) + optional func urlSession(_ session: URLSession, streamTask: URLSessionStreamTask, didBecome inputStream: InputStream, outputStream: OutputStream) } @available(tvOS 13.0, *) protocol URLSessionWebSocketDelegate : URLSessionTaskDelegate { - @asyncHandler optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) - @asyncHandler optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) + optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) + optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) } @available(tvOS 9.0, *) let NSURLSessionDownloadTaskResumeData: String diff --git a/tvOS/Foundation/NSUserActivity.swift b/tvOS/Foundation/NSUserActivity.swift index 8b1a8f6..f931d24 100644 --- a/tvOS/Foundation/NSUserActivity.swift +++ b/tvOS/Foundation/NSUserActivity.swift @@ -39,5 +39,5 @@ let NSUserActivityTypeBrowsingWeb: String protocol NSUserActivityDelegate : NSObjectProtocol { optional func userActivityWillSave(_ userActivity: NSUserActivity) optional func userActivityWasContinued(_ userActivity: NSUserActivity) - @asyncHandler optional func userActivity(_ userActivity: NSUserActivity, didReceive inputStream: InputStream, outputStream: OutputStream) + optional func userActivity(_ userActivity: NSUserActivity, didReceive inputStream: InputStream, outputStream: OutputStream) } diff --git a/tvOS/Foundation/NSXMLParser.swift b/tvOS/Foundation/NSXMLParser.swift index b9d92d2..007a50f 100644 --- a/tvOS/Foundation/NSXMLParser.swift +++ b/tvOS/Foundation/NSXMLParser.swift @@ -23,18 +23,18 @@ extension XMLParser { var columnNumber: Int { get } } protocol XMLParserDelegate : NSObjectProtocol { - @asyncHandler optional func parserDidStartDocument(_ parser: XMLParser) - @asyncHandler optional func parserDidEndDocument(_ parser: XMLParser) + optional func parserDidStartDocument(_ parser: XMLParser) + optional func parserDidEndDocument(_ parser: XMLParser) optional func parser(_ parser: XMLParser, foundNotationDeclarationWithName name: String, publicID: String?, systemID: String?) optional func parser(_ parser: XMLParser, foundUnparsedEntityDeclarationWithName name: String, publicID: String?, systemID: String?, notationName: String?) optional func parser(_ parser: XMLParser, foundAttributeDeclarationWithName attributeName: String, forElement elementName: String, type: String?, defaultValue: String?) optional func parser(_ parser: XMLParser, foundElementDeclarationWithName elementName: String, model: String) optional func parser(_ parser: XMLParser, foundInternalEntityDeclarationWithName name: String, value: String?) optional func parser(_ parser: XMLParser, foundExternalEntityDeclarationWithName name: String, publicID: String?, systemID: String?) - @asyncHandler optional func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) - @asyncHandler optional func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) - @asyncHandler optional func parser(_ parser: XMLParser, didStartMappingPrefix prefix: String, toURI namespaceURI: String) - @asyncHandler optional func parser(_ parser: XMLParser, didEndMappingPrefix prefix: String) + optional func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) + optional func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) + optional func parser(_ parser: XMLParser, didStartMappingPrefix prefix: String, toURI namespaceURI: String) + optional func parser(_ parser: XMLParser, didEndMappingPrefix prefix: String) optional func parser(_ parser: XMLParser, foundCharacters string: String) optional func parser(_ parser: XMLParser, foundIgnorableWhitespace whitespaceString: String) optional func parser(_ parser: XMLParser, foundProcessingInstructionWithTarget target: String, data: String?) diff --git a/tvOS/GameKit/GKEventListener.swift b/tvOS/GameKit/GKEventListener.swift index ca159c2..46015e1 100644 --- a/tvOS/GameKit/GKEventListener.swift +++ b/tvOS/GameKit/GKEventListener.swift @@ -3,9 +3,9 @@ protocol GKChallengeListener : NSObjectProtocol { @available(tvOS 7.0, *) optional func player(_ player: GKPlayer, wantsToPlay challenge: GKChallenge) @available(tvOS 7.0, *) - @asyncHandler optional func player(_ player: GKPlayer, didReceive challenge: GKChallenge) + optional func player(_ player: GKPlayer, didReceive challenge: GKChallenge) @available(tvOS 7.0, *) - @asyncHandler optional func player(_ player: GKPlayer, didComplete challenge: GKChallenge, issuedByFriend friendPlayer: GKPlayer) + optional func player(_ player: GKPlayer, didComplete challenge: GKChallenge, issuedByFriend friendPlayer: GKPlayer) @available(tvOS 7.0, *) optional func player(_ player: GKPlayer, issuedChallengeWasCompleted challenge: GKChallenge, byFriend friendPlayer: GKPlayer) } diff --git a/tvOS/GameKit/GKGameCenterViewController.swift b/tvOS/GameKit/GKGameCenterViewController.swift index 30ba5c4..53e690e 100644 --- a/tvOS/GameKit/GKGameCenterViewController.swift +++ b/tvOS/GameKit/GKGameCenterViewController.swift @@ -29,5 +29,5 @@ extension GKGameCenterViewController { } protocol GKGameCenterControllerDelegate : NSObjectProtocol { @available(tvOS 6.0, *) - @asyncHandler func gameCenterViewControllerDidFinish(_ gameCenterViewController: GKGameCenterViewController) + func gameCenterViewControllerDidFinish(_ gameCenterViewController: GKGameCenterViewController) } diff --git a/tvOS/GameKit/GKGameSessionEventListener.swift b/tvOS/GameKit/GKGameSessionEventListener.swift index 7730eb2..a38d619 100644 --- a/tvOS/GameKit/GKGameSessionEventListener.swift +++ b/tvOS/GameKit/GKGameSessionEventListener.swift @@ -1,12 +1,12 @@ @available(tvOS, introduced: 10.0, deprecated: 12.0, message: "Use GKLocalPlayerListener for multiplayer event notifications.") protocol GKGameSessionEventListener : NSObjectProtocol { - @asyncHandler optional func session(_ session: GKGameSession, didAdd player: GKCloudPlayer) - @asyncHandler optional func session(_ session: GKGameSession, didRemove player: GKCloudPlayer) - @asyncHandler optional func session(_ session: GKGameSession, player: GKCloudPlayer, didChange newState: GKConnectionState) - @asyncHandler optional func session(_ session: GKGameSession, player: GKCloudPlayer, didSave data: Data) - @asyncHandler optional func session(_ session: GKGameSession, didReceive data: Data, from player: GKCloudPlayer) - @asyncHandler optional func session(_ session: GKGameSession, didReceiveMessage message: String, with data: Data, from player: GKCloudPlayer) + optional func session(_ session: GKGameSession, didAdd player: GKCloudPlayer) + optional func session(_ session: GKGameSession, didRemove player: GKCloudPlayer) + optional func session(_ session: GKGameSession, player: GKCloudPlayer, didChange newState: GKConnectionState) + optional func session(_ session: GKGameSession, player: GKCloudPlayer, didSave data: Data) + optional func session(_ session: GKGameSession, didReceive data: Data, from player: GKCloudPlayer) + optional func session(_ session: GKGameSession, didReceiveMessage message: String, with data: Data, from player: GKCloudPlayer) } extension GKGameSession { @available(tvOS, introduced: 10.0, deprecated: 12.0, message: "Use GKLocalPlayer's registerListener: to register for GKLocalPlayerListener event notifications.") diff --git a/tvOS/GameKit/GKGameSessionSharingViewController.swift b/tvOS/GameKit/GKGameSessionSharingViewController.swift index 42caf2e..152d696 100644 --- a/tvOS/GameKit/GKGameSessionSharingViewController.swift +++ b/tvOS/GameKit/GKGameSessionSharingViewController.swift @@ -7,5 +7,5 @@ class GKGameSessionSharingViewController : UIViewController { } @available(tvOS, introduced: 10.0, deprecated: 12.0, message: "For real-time matches, use GKMatchmakerViewControllerDelegate to receive notifications from the GKMatchmakerViewController. For turn-based matches, use GKTurnBasedMatchmakerViewControllerDelegate and GKLocalPlayerListener to receive notifications from the GKTurnBasedMatchmakerViewController.") protocol GKGameSessionSharingViewControllerDelegate : NSObjectProtocol { - @asyncHandler func sharingViewController(_ viewController: GKGameSessionSharingViewController, didFinishWithError error: Error?) + func sharingViewController(_ viewController: GKGameSessionSharingViewController, didFinishWithError error: Error?) } diff --git a/tvOS/GameKit/GKMatch.swift b/tvOS/GameKit/GKMatch.swift index 9923a53..d136be5 100644 --- a/tvOS/GameKit/GKMatch.swift +++ b/tvOS/GameKit/GKMatch.swift @@ -36,13 +36,13 @@ class GKMatch : NSObject { } protocol GKMatchDelegate : NSObjectProtocol { @available(tvOS 8.0, *) - @asyncHandler optional func match(_ match: GKMatch, didReceive data: Data, fromRemotePlayer player: GKPlayer) + optional func match(_ match: GKMatch, didReceive data: Data, fromRemotePlayer player: GKPlayer) @available(tvOS 9.0, *) - @asyncHandler optional func match(_ match: GKMatch, didReceive data: Data, forRecipient recipient: GKPlayer, fromRemotePlayer player: GKPlayer) + optional func match(_ match: GKMatch, didReceive data: Data, forRecipient recipient: GKPlayer, fromRemotePlayer player: GKPlayer) @available(tvOS 4.1, *) - @asyncHandler optional func match(_ match: GKMatch, player: GKPlayer, didChange state: GKPlayerConnectionState) + optional func match(_ match: GKMatch, player: GKPlayer, didChange state: GKPlayerConnectionState) @available(tvOS 4.1, *) - @asyncHandler optional func match(_ match: GKMatch, didFailWithError error: Error?) + optional func match(_ match: GKMatch, didFailWithError error: Error?) @available(tvOS 8.0, *) optional func match(_ match: GKMatch, shouldReinviteDisconnectedPlayer player: GKPlayer) -> Bool } diff --git a/tvOS/GameKit/GKMatchmaker.swift b/tvOS/GameKit/GKMatchmaker.swift index 03dc961..7576f91 100644 --- a/tvOS/GameKit/GKMatchmaker.swift +++ b/tvOS/GameKit/GKMatchmaker.swift @@ -54,9 +54,9 @@ class GKInvite : NSObject { } protocol GKInviteEventListener { @available(tvOS 7.0, *) - @asyncHandler optional func player(_ player: GKPlayer, didAccept invite: GKInvite) + optional func player(_ player: GKPlayer, didAccept invite: GKInvite) @available(tvOS 8.0, *) - @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithRecipients recipientPlayers: [GKPlayer]) + optional func player(_ player: GKPlayer, didRequestMatchWithRecipients recipientPlayers: [GKPlayer]) } @available(tvOS 4.1, *) class GKMatchmaker : NSObject { diff --git a/tvOS/GameKit/GKMatchmakerViewController.swift b/tvOS/GameKit/GKMatchmakerViewController.swift index 0a193b5..b7d675e 100644 --- a/tvOS/GameKit/GKMatchmakerViewController.swift +++ b/tvOS/GameKit/GKMatchmakerViewController.swift @@ -25,11 +25,11 @@ protocol GKMatchmakerViewControllerDelegate : NSObjectProtocol { @available(tvOS 4.1, *) func matchmakerViewControllerWasCancelled(_ viewController: GKMatchmakerViewController) @available(tvOS 4.1, *) - @asyncHandler func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFailWithError error: Error) + func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFailWithError error: Error) @available(tvOS 4.1, *) - @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFind match: GKMatch) + optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFind match: GKMatch) @available(tvOS 8.0, *) - @asyncHandler optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindHostedPlayers players: [GKPlayer]) + optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindHostedPlayers players: [GKPlayer]) @available(tvOS 8.0, *) optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, hostedPlayerDidAccept player: GKPlayer) } diff --git a/tvOS/GameKit/GKTurnBasedMatch.swift b/tvOS/GameKit/GKTurnBasedMatch.swift index ea8ffd2..aefdece 100644 --- a/tvOS/GameKit/GKTurnBasedMatch.swift +++ b/tvOS/GameKit/GKTurnBasedMatch.swift @@ -50,9 +50,9 @@ extension GKTurnBasedParticipant { } protocol GKTurnBasedEventListener { @available(tvOS 8.0, *) - @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithOtherPlayers playersToInvite: [GKPlayer]) + optional func player(_ player: GKPlayer, didRequestMatchWithOtherPlayers playersToInvite: [GKPlayer]) @available(tvOS 7.0, *) - @asyncHandler optional func player(_ player: GKPlayer, receivedTurnEventFor match: GKTurnBasedMatch, didBecomeActive: Bool) + optional func player(_ player: GKPlayer, receivedTurnEventFor match: GKTurnBasedMatch, didBecomeActive: Bool) @available(tvOS 5.0, *) optional func player(_ player: GKPlayer, matchEnded match: GKTurnBasedMatch) @available(tvOS 7.0, *) diff --git a/tvOS/GameKit/GKTurnBasedMatchmakerViewController.swift b/tvOS/GameKit/GKTurnBasedMatchmakerViewController.swift index 8bc6f59..5019721 100644 --- a/tvOS/GameKit/GKTurnBasedMatchmakerViewController.swift +++ b/tvOS/GameKit/GKTurnBasedMatchmakerViewController.swift @@ -11,5 +11,5 @@ protocol GKTurnBasedMatchmakerViewControllerDelegate : NSObjectProtocol { @available(tvOS 5.0, *) func turnBasedMatchmakerViewControllerWasCancelled(_ viewController: GKTurnBasedMatchmakerViewController) @available(tvOS 5.0, *) - @asyncHandler func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFailWithError error: Error) + func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFailWithError error: Error) } diff --git a/tvOS/GameplayKit/GKAgent.swift b/tvOS/GameplayKit/GKAgent.swift index 4d621f3..f200241 100644 --- a/tvOS/GameplayKit/GKAgent.swift +++ b/tvOS/GameplayKit/GKAgent.swift @@ -3,7 +3,7 @@ protocol GKAgentDelegate : NSObjectProtocol { @available(tvOS 9.0, *) optional func agentWillUpdate(_ agent: GKAgent) @available(tvOS 9.0, *) - @asyncHandler optional func agentDidUpdate(_ agent: GKAgent) + optional func agentDidUpdate(_ agent: GKAgent) } @available(tvOS 9.0, *) class GKAgent : GKComponent, NSSecureCoding { diff --git a/tvOS/HomeKit/HMAccessory.swift b/tvOS/HomeKit/HMAccessory.swift index 9205a9a..6a7bd97 100644 --- a/tvOS/HomeKit/HMAccessory.swift +++ b/tvOS/HomeKit/HMAccessory.swift @@ -29,16 +29,16 @@ class HMAccessory : NSObject { } @available(tvOS 10.0, *) protocol HMAccessoryDelegate : NSObjectProtocol { - @asyncHandler optional func accessoryDidUpdateName(_ accessory: HMAccessory) - @asyncHandler optional func accessory(_ accessory: HMAccessory, didUpdateNameFor service: HMService) - @asyncHandler optional func accessory(_ accessory: HMAccessory, didUpdateAssociatedServiceTypeFor service: HMService) - @asyncHandler optional func accessoryDidUpdateServices(_ accessory: HMAccessory) + optional func accessoryDidUpdateName(_ accessory: HMAccessory) + optional func accessory(_ accessory: HMAccessory, didUpdateNameFor service: HMService) + optional func accessory(_ accessory: HMAccessory, didUpdateAssociatedServiceTypeFor service: HMService) + optional func accessoryDidUpdateServices(_ accessory: HMAccessory) @available(tvOS 11.0, *) - @asyncHandler optional func accessory(_ accessory: HMAccessory, didAdd profile: HMAccessoryProfile) + optional func accessory(_ accessory: HMAccessory, didAdd profile: HMAccessoryProfile) @available(tvOS 11.0, *) - @asyncHandler optional func accessory(_ accessory: HMAccessory, didRemove profile: HMAccessoryProfile) - @asyncHandler optional func accessoryDidUpdateReachability(_ accessory: HMAccessory) - @asyncHandler optional func accessory(_ accessory: HMAccessory, service: HMService, didUpdateValueFor characteristic: HMCharacteristic) + optional func accessory(_ accessory: HMAccessory, didRemove profile: HMAccessoryProfile) + optional func accessoryDidUpdateReachability(_ accessory: HMAccessory) + optional func accessory(_ accessory: HMAccessory, service: HMService, didUpdateValueFor characteristic: HMCharacteristic) @available(tvOS 11.0, *) - @asyncHandler optional func accessory(_ accessory: HMAccessory, didUpdateFirmwareVersion firmwareVersion: String) + optional func accessory(_ accessory: HMAccessory, didUpdateFirmwareVersion firmwareVersion: String) } diff --git a/tvOS/HomeKit/HMCameraSnapshotControl.swift b/tvOS/HomeKit/HMCameraSnapshotControl.swift index 2f60f14..f5aac04 100644 --- a/tvOS/HomeKit/HMCameraSnapshotControl.swift +++ b/tvOS/HomeKit/HMCameraSnapshotControl.swift @@ -7,6 +7,6 @@ class HMCameraSnapshotControl : HMCameraControl { } @available(tvOS 10.0, *) protocol HMCameraSnapshotControlDelegate : NSObjectProtocol { - @asyncHandler optional func cameraSnapshotControl(_ cameraSnapshotControl: HMCameraSnapshotControl, didTake snapshot: HMCameraSnapshot?, error: Error?) - @asyncHandler optional func cameraSnapshotControlDidUpdateMostRecentSnapshot(_ cameraSnapshotControl: HMCameraSnapshotControl) + optional func cameraSnapshotControl(_ cameraSnapshotControl: HMCameraSnapshotControl, didTake snapshot: HMCameraSnapshot?, error: Error?) + optional func cameraSnapshotControlDidUpdateMostRecentSnapshot(_ cameraSnapshotControl: HMCameraSnapshotControl) } diff --git a/tvOS/HomeKit/HMCameraStreamControl.swift b/tvOS/HomeKit/HMCameraStreamControl.swift index 76cf8e2..eec53e3 100644 --- a/tvOS/HomeKit/HMCameraStreamControl.swift +++ b/tvOS/HomeKit/HMCameraStreamControl.swift @@ -9,6 +9,6 @@ class HMCameraStreamControl : HMCameraControl { } @available(tvOS 10.0, *) protocol HMCameraStreamControlDelegate : NSObjectProtocol { - @asyncHandler optional func cameraStreamControlDidStartStream(_ cameraStreamControl: HMCameraStreamControl) - @asyncHandler optional func cameraStreamControl(_ cameraStreamControl: HMCameraStreamControl, didStopStreamWithError error: Error?) + optional func cameraStreamControlDidStartStream(_ cameraStreamControl: HMCameraStreamControl) + optional func cameraStreamControl(_ cameraStreamControl: HMCameraStreamControl, didStopStreamWithError error: Error?) } diff --git a/tvOS/HomeKit/HMHome.swift b/tvOS/HomeKit/HMHome.swift index 64eea36..5cb0335 100644 --- a/tvOS/HomeKit/HMHome.swift +++ b/tvOS/HomeKit/HMHome.swift @@ -51,41 +51,41 @@ extension HMHome { } @available(tvOS 10.0, *) protocol HMHomeDelegate : NSObjectProtocol { - @asyncHandler optional func homeDidUpdateName(_ home: HMHome) + optional func homeDidUpdateName(_ home: HMHome) @available(tvOS 11.0, *) - @asyncHandler optional func homeDidUpdateAccessControl(forCurrentUser home: HMHome) - @asyncHandler optional func home(_ home: HMHome, didAdd accessory: HMAccessory) - @asyncHandler optional func home(_ home: HMHome, didRemove accessory: HMAccessory) - @asyncHandler optional func home(_ home: HMHome, didAdd user: HMUser) - @asyncHandler optional func home(_ home: HMHome, didRemove user: HMUser) - @asyncHandler optional func home(_ home: HMHome, didUpdate room: HMRoom, for accessory: HMAccessory) - @asyncHandler optional func home(_ home: HMHome, didAdd room: HMRoom) - @asyncHandler optional func home(_ home: HMHome, didRemove room: HMRoom) - @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor room: HMRoom) - @asyncHandler optional func home(_ home: HMHome, didAdd zone: HMZone) - @asyncHandler optional func home(_ home: HMHome, didRemove zone: HMZone) - @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor zone: HMZone) - @asyncHandler optional func home(_ home: HMHome, didAdd room: HMRoom, to zone: HMZone) - @asyncHandler optional func home(_ home: HMHome, didRemove room: HMRoom, from zone: HMZone) - @asyncHandler optional func home(_ home: HMHome, didAdd group: HMServiceGroup) - @asyncHandler optional func home(_ home: HMHome, didRemove group: HMServiceGroup) - @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor group: HMServiceGroup) - @asyncHandler optional func home(_ home: HMHome, didAdd service: HMService, to group: HMServiceGroup) - @asyncHandler optional func home(_ home: HMHome, didRemove service: HMService, from group: HMServiceGroup) - @asyncHandler optional func home(_ home: HMHome, didAdd actionSet: HMActionSet) - @asyncHandler optional func home(_ home: HMHome, didRemove actionSet: HMActionSet) - @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor actionSet: HMActionSet) - @asyncHandler optional func home(_ home: HMHome, didUpdateActionsFor actionSet: HMActionSet) - @asyncHandler optional func home(_ home: HMHome, didAdd trigger: HMTrigger) - @asyncHandler optional func home(_ home: HMHome, didRemove trigger: HMTrigger) - @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor trigger: HMTrigger) - @asyncHandler optional func home(_ home: HMHome, didUpdate trigger: HMTrigger) - @asyncHandler optional func home(_ home: HMHome, didUnblockAccessory accessory: HMAccessory) - @asyncHandler optional func home(_ home: HMHome, didEncounterError error: Error, for accessory: HMAccessory) + optional func homeDidUpdateAccessControl(forCurrentUser home: HMHome) + optional func home(_ home: HMHome, didAdd accessory: HMAccessory) + optional func home(_ home: HMHome, didRemove accessory: HMAccessory) + optional func home(_ home: HMHome, didAdd user: HMUser) + optional func home(_ home: HMHome, didRemove user: HMUser) + optional func home(_ home: HMHome, didUpdate room: HMRoom, for accessory: HMAccessory) + optional func home(_ home: HMHome, didAdd room: HMRoom) + optional func home(_ home: HMHome, didRemove room: HMRoom) + optional func home(_ home: HMHome, didUpdateNameFor room: HMRoom) + optional func home(_ home: HMHome, didAdd zone: HMZone) + optional func home(_ home: HMHome, didRemove zone: HMZone) + optional func home(_ home: HMHome, didUpdateNameFor zone: HMZone) + optional func home(_ home: HMHome, didAdd room: HMRoom, to zone: HMZone) + optional func home(_ home: HMHome, didRemove room: HMRoom, from zone: HMZone) + optional func home(_ home: HMHome, didAdd group: HMServiceGroup) + optional func home(_ home: HMHome, didRemove group: HMServiceGroup) + optional func home(_ home: HMHome, didUpdateNameFor group: HMServiceGroup) + optional func home(_ home: HMHome, didAdd service: HMService, to group: HMServiceGroup) + optional func home(_ home: HMHome, didRemove service: HMService, from group: HMServiceGroup) + optional func home(_ home: HMHome, didAdd actionSet: HMActionSet) + optional func home(_ home: HMHome, didRemove actionSet: HMActionSet) + optional func home(_ home: HMHome, didUpdateNameFor actionSet: HMActionSet) + optional func home(_ home: HMHome, didUpdateActionsFor actionSet: HMActionSet) + optional func home(_ home: HMHome, didAdd trigger: HMTrigger) + optional func home(_ home: HMHome, didRemove trigger: HMTrigger) + optional func home(_ home: HMHome, didUpdateNameFor trigger: HMTrigger) + optional func home(_ home: HMHome, didUpdate trigger: HMTrigger) + optional func home(_ home: HMHome, didUnblockAccessory accessory: HMAccessory) + optional func home(_ home: HMHome, didEncounterError error: Error, for accessory: HMAccessory) @available(tvOS 11.0, *) - @asyncHandler optional func home(_ home: HMHome, didUpdate homeHubState: HMHomeHubState) + optional func home(_ home: HMHome, didUpdate homeHubState: HMHomeHubState) @available(tvOS 13.2, *) - @asyncHandler optional func homeDidUpdateSupportedFeatures(_ home: HMHome) + optional func homeDidUpdateSupportedFeatures(_ home: HMHome) } @available(tvOS 10.0, *) let HMUserFailedAccessoriesKey: String diff --git a/tvOS/HomeKit/HMHomeManager.swift b/tvOS/HomeKit/HMHomeManager.swift index 5ff954c..0f66806 100644 --- a/tvOS/HomeKit/HMHomeManager.swift +++ b/tvOS/HomeKit/HMHomeManager.swift @@ -18,9 +18,9 @@ class HMHomeManager : NSObject { @available(tvOS 10.0, *) protocol HMHomeManagerDelegate : NSObjectProtocol { @available(tvOS 13.0, *) - @asyncHandler optional func homeManager(_ manager: HMHomeManager, didUpdate status: HMHomeManagerAuthorizationStatus) - @asyncHandler optional func homeManagerDidUpdateHomes(_ manager: HMHomeManager) - @asyncHandler optional func homeManagerDidUpdatePrimaryHome(_ manager: HMHomeManager) - @asyncHandler optional func homeManager(_ manager: HMHomeManager, didAdd home: HMHome) - @asyncHandler optional func homeManager(_ manager: HMHomeManager, didRemove home: HMHome) + optional func homeManager(_ manager: HMHomeManager, didUpdate status: HMHomeManagerAuthorizationStatus) + optional func homeManagerDidUpdateHomes(_ manager: HMHomeManager) + optional func homeManagerDidUpdatePrimaryHome(_ manager: HMHomeManager) + optional func homeManager(_ manager: HMHomeManager, didAdd home: HMHome) + optional func homeManager(_ manager: HMHomeManager, didRemove home: HMHome) } diff --git a/tvOS/HomeKit/HMNetworkConfigurationProfile.swift b/tvOS/HomeKit/HMNetworkConfigurationProfile.swift index 16c2193..52ecf4a 100644 --- a/tvOS/HomeKit/HMNetworkConfigurationProfile.swift +++ b/tvOS/HomeKit/HMNetworkConfigurationProfile.swift @@ -6,5 +6,5 @@ class HMNetworkConfigurationProfile : HMAccessoryProfile { } @available(tvOS 13.0, *) protocol HMNetworkConfigurationProfileDelegate : NSObjectProtocol { - @asyncHandler optional func profileDidUpdateNetworkAccessMode(_ profile: HMNetworkConfigurationProfile) + optional func profileDidUpdateNetworkAccessMode(_ profile: HMNetworkConfigurationProfile) } diff --git a/tvOS/MapKit/MKLocalSearchCompleter.swift b/tvOS/MapKit/MKLocalSearchCompleter.swift index be7d940..e8ab3e6 100644 --- a/tvOS/MapKit/MKLocalSearchCompleter.swift +++ b/tvOS/MapKit/MKLocalSearchCompleter.swift @@ -33,8 +33,8 @@ class MKLocalSearchCompleter : NSObject { } @available(tvOS 9.2, *) protocol MKLocalSearchCompleterDelegate : NSObjectProtocol { - @asyncHandler optional func completerDidUpdateResults(_ completer: MKLocalSearchCompleter) - @asyncHandler optional func completer(_ completer: MKLocalSearchCompleter, didFailWithError error: Error) + optional func completerDidUpdateResults(_ completer: MKLocalSearchCompleter) + optional func completer(_ completer: MKLocalSearchCompleter, didFailWithError error: Error) } @available(tvOS 9.2, *) class MKLocalSearchCompletion : NSObject { diff --git a/tvOS/MapKit/MKMapView.swift b/tvOS/MapKit/MKMapView.swift index a4d0abd..9414930 100644 --- a/tvOS/MapKit/MKMapView.swift +++ b/tvOS/MapKit/MKMapView.swift @@ -124,39 +124,39 @@ protocol MKMapViewDelegate : NSObjectProtocol { @available(tvOS 9.2, *) optional func mapView(_ mapView: MKMapView, regionDidChangeAnimated animated: Bool) @available(tvOS 11, *) - @asyncHandler optional func mapViewDidChangeVisibleRegion(_ mapView: MKMapView) + optional func mapViewDidChangeVisibleRegion(_ mapView: MKMapView) @available(tvOS 9.2, *) optional func mapViewWillStartLoadingMap(_ mapView: MKMapView) @available(tvOS 9.2, *) - @asyncHandler optional func mapViewDidFinishLoadingMap(_ mapView: MKMapView) + optional func mapViewDidFinishLoadingMap(_ mapView: MKMapView) @available(tvOS 9.2, *) - @asyncHandler optional func mapViewDidFailLoadingMap(_ mapView: MKMapView, withError error: Error) + optional func mapViewDidFailLoadingMap(_ mapView: MKMapView, withError error: Error) @available(tvOS 7.0, *) optional func mapViewWillStartRenderingMap(_ mapView: MKMapView) @available(tvOS 7.0, *) - @asyncHandler optional func mapViewDidFinishRenderingMap(_ mapView: MKMapView, fullyRendered: Bool) + optional func mapViewDidFinishRenderingMap(_ mapView: MKMapView, fullyRendered: Bool) @available(tvOS 9.2, *) optional func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? @available(tvOS 9.2, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didAdd views: [MKAnnotationView]) + optional func mapView(_ mapView: MKMapView, didAdd views: [MKAnnotationView]) @available(tvOS 4.0, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) + optional func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) @available(tvOS 4.0, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView) + optional func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView) @available(tvOS 4.0, *) optional func mapViewWillStartLocatingUser(_ mapView: MKMapView) @available(tvOS 4.0, *) - @asyncHandler optional func mapViewDidStopLocatingUser(_ mapView: MKMapView) + optional func mapViewDidStopLocatingUser(_ mapView: MKMapView) @available(tvOS 4.0, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didUpdate userLocation: MKUserLocation) + optional func mapView(_ mapView: MKMapView, didUpdate userLocation: MKUserLocation) @available(tvOS 4.0, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didFailToLocateUserWithError error: Error) + optional func mapView(_ mapView: MKMapView, didFailToLocateUserWithError error: Error) @available(tvOS 9.2, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didChange mode: MKUserTrackingMode, animated: Bool) + optional func mapView(_ mapView: MKMapView, didChange mode: MKUserTrackingMode, animated: Bool) @available(tvOS 7.0, *) optional func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer @available(tvOS 7.0, *) - @asyncHandler optional func mapView(_ mapView: MKMapView, didAdd renderers: [MKOverlayRenderer]) + optional func mapView(_ mapView: MKMapView, didAdd renderers: [MKOverlayRenderer]) @available(tvOS 11.0, *) optional func mapView(_ mapView: MKMapView, clusterAnnotationForMemberAnnotations memberAnnotations: [MKAnnotation]) -> MKClusterAnnotation } diff --git a/tvOS/MediaPlayer/MPNowPlayingSession.swift b/tvOS/MediaPlayer/MPNowPlayingSession.swift index c260131..79f40e0 100644 --- a/tvOS/MediaPlayer/MPNowPlayingSession.swift +++ b/tvOS/MediaPlayer/MPNowPlayingSession.swift @@ -15,6 +15,6 @@ class MPNowPlayingSession : NSObject { } @available(tvOS 14.0, *) protocol MPNowPlayingSessionDelegate : NSObjectProtocol { - @asyncHandler optional func nowPlayingSessionDidChangeActive(_ nowPlayingSession: MPNowPlayingSession) - @asyncHandler optional func nowPlayingSessionDidChangeCanBecomeActive(_ nowPlayingSession: MPNowPlayingSession) + optional func nowPlayingSessionDidChangeActive(_ nowPlayingSession: MPNowPlayingSession) + optional func nowPlayingSessionDidChangeCanBecomeActive(_ nowPlayingSession: MPNowPlayingSession) } diff --git a/tvOS/MultipeerConnectivity/MCAdvertiserAssistant.swift b/tvOS/MultipeerConnectivity/MCAdvertiserAssistant.swift index ba28a80..827c5e0 100644 --- a/tvOS/MultipeerConnectivity/MCAdvertiserAssistant.swift +++ b/tvOS/MultipeerConnectivity/MCAdvertiserAssistant.swift @@ -13,5 +13,5 @@ protocol MCAdvertiserAssistantDelegate : NSObjectProtocol { @available(tvOS 7.0, *) optional func advertiserAssistantWillPresentInvitation(_ advertiserAssistant: MCAdvertiserAssistant) @available(tvOS 7.0, *) - @asyncHandler optional func advertiserAssistantDidDismissInvitation(_ advertiserAssistant: MCAdvertiserAssistant) + optional func advertiserAssistantDidDismissInvitation(_ advertiserAssistant: MCAdvertiserAssistant) } diff --git a/tvOS/MultipeerConnectivity/MCBrowserViewController.swift b/tvOS/MultipeerConnectivity/MCBrowserViewController.swift index 16d9b94..4574259 100644 --- a/tvOS/MultipeerConnectivity/MCBrowserViewController.swift +++ b/tvOS/MultipeerConnectivity/MCBrowserViewController.swift @@ -11,7 +11,7 @@ class MCBrowserViewController : UIViewController, MCNearbyServiceBrowserDelegate } protocol MCBrowserViewControllerDelegate : NSObjectProtocol { @available(tvOS 7.0, *) - @asyncHandler func browserViewControllerDidFinish(_ browserViewController: MCBrowserViewController) + func browserViewControllerDidFinish(_ browserViewController: MCBrowserViewController) @available(tvOS 7.0, *) func browserViewControllerWasCancelled(_ browserViewController: MCBrowserViewController) @available(tvOS 7.0, *) diff --git a/tvOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift b/tvOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift index 4fff340..bd01b80 100644 --- a/tvOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift +++ b/tvOS/MultipeerConnectivity/MCNearbyServiceAdvertiser.swift @@ -11,7 +11,7 @@ class MCNearbyServiceAdvertiser : NSObject { } protocol MCNearbyServiceAdvertiserDelegate : NSObjectProtocol { @available(tvOS 7.0, *) - @asyncHandler func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didReceiveInvitationFromPeer peerID: MCPeerID, withContext context: Data?, invitationHandler: @escaping (Bool, MCSession?) -> Void) + func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didReceiveInvitationFromPeer peerID: MCPeerID, withContext context: Data?, invitationHandler: @escaping (Bool, MCSession?) -> Void) @available(tvOS 7.0, *) - @asyncHandler optional func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didNotStartAdvertisingPeer error: Error) + optional func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didNotStartAdvertisingPeer error: Error) } diff --git a/tvOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift b/tvOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift index 8617971..c85021d 100644 --- a/tvOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift +++ b/tvOS/MultipeerConnectivity/MCNearbyServiceBrowser.swift @@ -15,5 +15,5 @@ protocol MCNearbyServiceBrowserDelegate : NSObjectProtocol { @available(tvOS 7.0, *) func browser(_ browser: MCNearbyServiceBrowser, lostPeer peerID: MCPeerID) @available(tvOS 7.0, *) - @asyncHandler optional func browser(_ browser: MCNearbyServiceBrowser, didNotStartBrowsingForPeers error: Error) + optional func browser(_ browser: MCNearbyServiceBrowser, didNotStartBrowsingForPeers error: Error) } diff --git a/tvOS/MultipeerConnectivity/MCSession.swift b/tvOS/MultipeerConnectivity/MCSession.swift index ab46352..73a8caa 100644 --- a/tvOS/MultipeerConnectivity/MCSession.swift +++ b/tvOS/MultipeerConnectivity/MCSession.swift @@ -42,17 +42,17 @@ class MCSession : NSObject { } protocol MCSessionDelegate : NSObjectProtocol { @available(tvOS 7.0, *) - @asyncHandler func session(_ session: MCSession, peer peerID: MCPeerID, didChange state: MCSessionState) + func session(_ session: MCSession, peer peerID: MCPeerID, didChange state: MCSessionState) @available(tvOS 7.0, *) - @asyncHandler func session(_ session: MCSession, didReceive data: Data, fromPeer peerID: MCPeerID) + func session(_ session: MCSession, didReceive data: Data, fromPeer peerID: MCPeerID) @available(tvOS 7.0, *) - @asyncHandler func session(_ session: MCSession, didReceive stream: InputStream, withName streamName: String, fromPeer peerID: MCPeerID) + func session(_ session: MCSession, didReceive stream: InputStream, withName streamName: String, fromPeer peerID: MCPeerID) @available(tvOS 9.0, *) - @asyncHandler func session(_ session: MCSession, didStartReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, with progress: Progress) + func session(_ session: MCSession, didStartReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, with progress: Progress) @available(tvOS 7.0, *) - @asyncHandler func session(_ session: MCSession, didFinishReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, at localURL: URL?, withError error: Error?) + func session(_ session: MCSession, didFinishReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, at localURL: URL?, withError error: Error?) @available(tvOS 7.0, *) - @asyncHandler optional func session(_ session: MCSession, didReceiveCertificate certificate: [Any]?, fromPeer peerID: MCPeerID, certificateHandler: @escaping (Bool) -> Void) + optional func session(_ session: MCSession, didReceiveCertificate certificate: [Any]?, fromPeer peerID: MCPeerID, certificateHandler: @escaping (Bool) -> Void) } extension MCSession { func nearbyConnectionData(forPeer peerID: MCPeerID, withCompletionHandler completionHandler: @escaping (Data?, Error?) -> Void) diff --git a/tvOS/Photos/PHPhotoLibrary.swift b/tvOS/Photos/PHPhotoLibrary.swift index a179186..ddfa53f 100644 --- a/tvOS/Photos/PHPhotoLibrary.swift +++ b/tvOS/Photos/PHPhotoLibrary.swift @@ -26,12 +26,12 @@ enum PHAccessLevel : Int { @available(tvOS 10, *) protocol PHPhotoLibraryChangeObserver : NSObjectProtocol { @available(tvOS 10, *) - @asyncHandler func photoLibraryDidChange(_ changeInstance: PHChange) + func photoLibraryDidChange(_ changeInstance: PHChange) } @available(tvOS 13, *) protocol PHPhotoLibraryAvailabilityObserver : NSObjectProtocol { @available(tvOS 13, *) - @asyncHandler func photoLibraryDidBecomeUnavailable(_ photoLibrary: PHPhotoLibrary) + func photoLibraryDidBecomeUnavailable(_ photoLibrary: PHPhotoLibrary) } @available(tvOS 10, *) class PHPhotoLibrary : NSObject { diff --git a/tvOS/PhotosUI/PHLivePhotoView.swift b/tvOS/PhotosUI/PHLivePhotoView.swift index 12c5e96..5a8899a 100644 --- a/tvOS/PhotosUI/PHLivePhotoView.swift +++ b/tvOS/PhotosUI/PHLivePhotoView.swift @@ -41,5 +41,5 @@ protocol PHLivePhotoViewDelegate : NSObjectProtocol { @available(tvOS 10, *) optional func livePhotoView(_ livePhotoView: PHLivePhotoView, willBeginPlaybackWith playbackStyle: PHLivePhotoViewPlaybackStyle) @available(tvOS 10, *) - @asyncHandler optional func livePhotoView(_ livePhotoView: PHLivePhotoView, didEndPlaybackWith playbackStyle: PHLivePhotoViewPlaybackStyle) + optional func livePhotoView(_ livePhotoView: PHLivePhotoView, didEndPlaybackWith playbackStyle: PHLivePhotoViewPlaybackStyle) } diff --git a/tvOS/QuartzCore/CAAnimation.swift b/tvOS/QuartzCore/CAAnimation.swift index 25ff41f..415b51b 100644 --- a/tvOS/QuartzCore/CAAnimation.swift +++ b/tvOS/QuartzCore/CAAnimation.swift @@ -29,9 +29,9 @@ class CAAnimation : NSObject, NSSecureCoding, NSCopying, CAMediaTiming, CAAction } protocol CAAnimationDelegate : NSObjectProtocol { @available(tvOS 9.0, *) - @asyncHandler optional func animationDidStart(_ anim: CAAnimation) + optional func animationDidStart(_ anim: CAAnimation) @available(tvOS 9.0, *) - @asyncHandler optional func animationDidStop(_ anim: CAAnimation, finished flag: Bool) + optional func animationDidStop(_ anim: CAAnimation, finished flag: Bool) } @available(tvOS 9.0, *) class CAPropertyAnimation : CAAnimation { diff --git a/tvOS/ReplayKit/RPBroadcast.swift b/tvOS/ReplayKit/RPBroadcast.swift index d74183e..a064d1e 100644 --- a/tvOS/ReplayKit/RPBroadcast.swift +++ b/tvOS/ReplayKit/RPBroadcast.swift @@ -7,7 +7,7 @@ class RPBroadcastActivityViewController : UIViewController { @available(tvOS 10.0, *) protocol RPBroadcastActivityViewControllerDelegate : NSObjectProtocol { @available(tvOS 10.0, *) - @asyncHandler func broadcastActivityViewController(_ broadcastActivityViewController: RPBroadcastActivityViewController, didFinishWith broadcastController: RPBroadcastController?, error: Error?) + func broadcastActivityViewController(_ broadcastActivityViewController: RPBroadcastActivityViewController, didFinishWith broadcastController: RPBroadcastController?, error: Error?) } @available(tvOS 10.0, *) class RPBroadcastController : NSObject { @@ -25,8 +25,8 @@ class RPBroadcastController : NSObject { } @available(tvOS 10.0, *) protocol RPBroadcastControllerDelegate : NSObjectProtocol { - @asyncHandler optional func broadcastController(_ broadcastController: RPBroadcastController, didFinishWithError error: Error?) - @asyncHandler optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateServiceInfo serviceInfo: [String : NSCoding & NSObjectProtocol]) + optional func broadcastController(_ broadcastController: RPBroadcastController, didFinishWithError error: Error?) + optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateServiceInfo serviceInfo: [String : NSCoding & NSObjectProtocol]) @available(tvOS 11.0, *) - @asyncHandler optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateBroadcast broadcastURL: URL) + optional func broadcastController(_ broadcastController: RPBroadcastController, didUpdateBroadcast broadcastURL: URL) } diff --git a/tvOS/ReplayKit/RPPreviewViewController.swift b/tvOS/ReplayKit/RPPreviewViewController.swift index f274ad9..09e0792 100644 --- a/tvOS/ReplayKit/RPPreviewViewController.swift +++ b/tvOS/ReplayKit/RPPreviewViewController.swift @@ -11,5 +11,5 @@ class RPPreviewViewController : UIViewController { var mode: RPPreviewViewControllerMode } protocol RPPreviewViewControllerDelegate : NSObjectProtocol { - @asyncHandler optional func previewControllerDidFinish(_ previewController: RPPreviewViewController) + optional func previewControllerDidFinish(_ previewController: RPPreviewViewController) } diff --git a/tvOS/ReplayKit/RPScreenRecorder.swift b/tvOS/ReplayKit/RPScreenRecorder.swift index 4e5f0b7..a6c7a4f 100644 --- a/tvOS/ReplayKit/RPScreenRecorder.swift +++ b/tvOS/ReplayKit/RPScreenRecorder.swift @@ -24,8 +24,8 @@ class RPScreenRecorder : NSObject { @available(tvOS 10.0, *) protocol RPScreenRecorderDelegate : NSObjectProtocol { @available(tvOS, introduced: 10.0, deprecated: 10.0, message: "No longer supported") - @asyncHandler optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWithError error: Error, previewViewController: RPPreviewViewController?) + optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWithError error: Error, previewViewController: RPPreviewViewController?) @available(tvOS 11.0, *) - @asyncHandler optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWith previewViewController: RPPreviewViewController?, error: Error?) - @asyncHandler optional func screenRecorderDidChangeAvailability(_ screenRecorder: RPScreenRecorder) + optional func screenRecorder(_ screenRecorder: RPScreenRecorder, didStopRecordingWith previewViewController: RPPreviewViewController?, error: Error?) + optional func screenRecorderDidChangeAvailability(_ screenRecorder: RPScreenRecorder) } diff --git a/tvOS/SceneKit/SCNCameraController.swift b/tvOS/SceneKit/SCNCameraController.swift index 12c7735..9fada80 100644 --- a/tvOS/SceneKit/SCNCameraController.swift +++ b/tvOS/SceneKit/SCNCameraController.swift @@ -14,7 +14,7 @@ enum SCNInteractionMode : Int { @available(tvOS 11.0, *) protocol SCNCameraControllerDelegate : NSObjectProtocol { optional func cameraInertiaWillStart(for cameraController: SCNCameraController) - @asyncHandler optional func cameraInertiaDidEnd(for cameraController: SCNCameraController) + optional func cameraInertiaDidEnd(for cameraController: SCNCameraController) } @available(tvOS 11.0, *) class SCNCameraController : NSObject { diff --git a/tvOS/SceneKit/SCNConstraint.swift b/tvOS/SceneKit/SCNConstraint.swift index e4f0ff7..664ef6b 100644 --- a/tvOS/SceneKit/SCNConstraint.swift +++ b/tvOS/SceneKit/SCNConstraint.swift @@ -78,7 +78,7 @@ class SCNSliderConstraint : SCNConstraint { @available(tvOS 11.0, *) protocol SCNAvoidOccluderConstraintDelegate : NSObjectProtocol { optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, shouldAvoidOccluder occluder: SCNNode, for node: SCNNode) -> Bool - @asyncHandler optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, didAvoidOccluder occluder: SCNNode, for node: SCNNode) + optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, didAvoidOccluder occluder: SCNNode, for node: SCNNode) } @available(tvOS 11.0, *) class SCNAvoidOccluderConstraint : SCNConstraint { diff --git a/tvOS/SceneKit/SCNPhysicsWorld.swift b/tvOS/SceneKit/SCNPhysicsWorld.swift index 49f7d9b..74bf4d8 100644 --- a/tvOS/SceneKit/SCNPhysicsWorld.swift +++ b/tvOS/SceneKit/SCNPhysicsWorld.swift @@ -22,9 +22,9 @@ extension SCNPhysicsWorld.TestSearchMode { static let all: SCNPhysicsWorld.TestSearchMode } protocol SCNPhysicsContactDelegate : NSObjectProtocol { - @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didBegin contact: SCNPhysicsContact) - @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didUpdate contact: SCNPhysicsContact) - @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didEnd contact: SCNPhysicsContact) + optional func physicsWorld(_ world: SCNPhysicsWorld, didBegin contact: SCNPhysicsContact) + optional func physicsWorld(_ world: SCNPhysicsWorld, didUpdate contact: SCNPhysicsContact) + optional func physicsWorld(_ world: SCNPhysicsWorld, didEnd contact: SCNPhysicsContact) } class SCNPhysicsWorld : NSObject, NSSecureCoding { var gravity: SCNVector3 diff --git a/tvOS/SceneKit/SCNSceneRenderer.swift b/tvOS/SceneKit/SCNSceneRenderer.swift index 718b70b..2b70ec2 100644 --- a/tvOS/SceneKit/SCNSceneRenderer.swift +++ b/tvOS/SceneKit/SCNSceneRenderer.swift @@ -83,10 +83,10 @@ protocol SCNSceneRenderer : NSObjectProtocol { } protocol SCNSceneRendererDelegate : NSObjectProtocol { optional func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) - @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didApplyAnimationsAtTime time: TimeInterval) - @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didSimulatePhysicsAtTime time: TimeInterval) + optional func renderer(_ renderer: SCNSceneRenderer, didApplyAnimationsAtTime time: TimeInterval) + optional func renderer(_ renderer: SCNSceneRenderer, didSimulatePhysicsAtTime time: TimeInterval) @available(tvOS 11.0, *) - @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didApplyConstraintsAtTime time: TimeInterval) + optional func renderer(_ renderer: SCNSceneRenderer, didApplyConstraintsAtTime time: TimeInterval) optional func renderer(_ renderer: SCNSceneRenderer, willRenderScene scene: SCNScene, atTime time: TimeInterval) - @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didRenderScene scene: SCNScene, atTime time: TimeInterval) + optional func renderer(_ renderer: SCNSceneRenderer, didRenderScene scene: SCNScene, atTime time: TimeInterval) } diff --git a/tvOS/SoundAnalysis/SNResult.swift b/tvOS/SoundAnalysis/SNResult.swift index 1a37ab3..c3b10b4 100644 --- a/tvOS/SoundAnalysis/SNResult.swift +++ b/tvOS/SoundAnalysis/SNResult.swift @@ -4,7 +4,7 @@ protocol SNResult : NSObjectProtocol { } @available(tvOS 13.0, *) protocol SNResultsObserving : NSObjectProtocol { - @asyncHandler func request(_ request: SNRequest, didProduce result: SNResult) - @asyncHandler optional func request(_ request: SNRequest, didFailWithError error: Error) - @asyncHandler optional func requestDidComplete(_ request: SNRequest) + func request(_ request: SNRequest, didProduce result: SNResult) + optional func request(_ request: SNRequest, didFailWithError error: Error) + optional func requestDidComplete(_ request: SNRequest) } diff --git a/tvOS/SpriteKit/SKPhysicsWorld.swift b/tvOS/SpriteKit/SKPhysicsWorld.swift index 1fb7de6..4437a64 100644 --- a/tvOS/SpriteKit/SKPhysicsWorld.swift +++ b/tvOS/SpriteKit/SKPhysicsWorld.swift @@ -1,7 +1,7 @@ protocol SKPhysicsContactDelegate : NSObjectProtocol { - @asyncHandler optional func didBegin(_ contact: SKPhysicsContact) - @asyncHandler optional func didEnd(_ contact: SKPhysicsContact) + optional func didBegin(_ contact: SKPhysicsContact) + optional func didEnd(_ contact: SKPhysicsContact) } class SKPhysicsWorld : NSObject, NSSecureCoding { var gravity: CGVector diff --git a/tvOS/SpriteKit/SKScene.swift b/tvOS/SpriteKit/SKScene.swift index fb4db81..c6bc345 100644 --- a/tvOS/SpriteKit/SKScene.swift +++ b/tvOS/SpriteKit/SKScene.swift @@ -11,10 +11,10 @@ enum SKSceneScaleMode : Int { @available(tvOS 9.0, *) protocol SKSceneDelegate : NSObjectProtocol { optional func update(_ currentTime: TimeInterval, for scene: SKScene) - @asyncHandler optional func didEvaluateActions(for scene: SKScene) - @asyncHandler optional func didSimulatePhysics(for scene: SKScene) - @asyncHandler optional func didApplyConstraints(for scene: SKScene) - @asyncHandler optional func didFinishUpdate(for scene: SKScene) + optional func didEvaluateActions(for scene: SKScene) + optional func didSimulatePhysics(for scene: SKScene) + optional func didApplyConstraints(for scene: SKScene) + optional func didFinishUpdate(for scene: SKScene) } class SKScene : SKEffectNode { init(size: CGSize) diff --git a/tvOS/StoreKit/SKPaymentQueue.swift b/tvOS/StoreKit/SKPaymentQueue.swift index 76719c3..8537174 100644 --- a/tvOS/StoreKit/SKPaymentQueue.swift +++ b/tvOS/StoreKit/SKPaymentQueue.swift @@ -52,7 +52,7 @@ protocol SKPaymentTransactionObserver : NSObjectProtocol { @available(tvOS 11.0, *) optional func paymentQueue(_ queue: SKPaymentQueue, shouldAddStorePayment payment: SKPayment, for product: SKProduct) -> Bool @available(tvOS 13.0, *) - @asyncHandler optional func paymentQueueDidChangeStorefront(_ queue: SKPaymentQueue) + optional func paymentQueueDidChangeStorefront(_ queue: SKPaymentQueue) @available(tvOS 14.0, *) - @asyncHandler optional func paymentQueue(_ queue: SKPaymentQueue, didRevokeEntitlementsForProductIdentifiers productIdentifiers: [String]) + optional func paymentQueue(_ queue: SKPaymentQueue, didRevokeEntitlementsForProductIdentifiers productIdentifiers: [String]) } diff --git a/tvOS/StoreKit/SKProductsRequest.swift b/tvOS/StoreKit/SKProductsRequest.swift index 479418d..1a3256d 100644 --- a/tvOS/StoreKit/SKProductsRequest.swift +++ b/tvOS/StoreKit/SKProductsRequest.swift @@ -1,7 +1,7 @@ protocol SKProductsRequestDelegate : SKRequestDelegate { @available(tvOS 3.0, *) - @asyncHandler func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) + func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) } @available(tvOS 3.0, *) class SKProductsRequest : SKRequest { diff --git a/tvOS/StoreKit/SKRequest.swift b/tvOS/StoreKit/SKRequest.swift index b4c54d0..c5efc1f 100644 --- a/tvOS/StoreKit/SKRequest.swift +++ b/tvOS/StoreKit/SKRequest.swift @@ -10,7 +10,7 @@ class SKRequest : NSObject { } protocol SKRequestDelegate : NSObjectProtocol { @available(tvOS 3.0, *) - @asyncHandler optional func requestDidFinish(_ request: SKRequest) + optional func requestDidFinish(_ request: SKRequest) @available(tvOS 3.0, *) - @asyncHandler optional func request(_ request: SKRequest, didFailWithError error: Error) + optional func request(_ request: SKRequest, didFailWithError error: Error) } diff --git a/tvOS/TVMLKit/TVApplicationController.swift b/tvOS/TVMLKit/TVApplicationController.swift index 2650eb1..e4f9285 100644 --- a/tvOS/TVMLKit/TVApplicationController.swift +++ b/tvOS/TVMLKit/TVApplicationController.swift @@ -11,11 +11,11 @@ protocol TVApplicationControllerDelegate : NSObjectProtocol { @available(tvOS 9.0, *) optional func appController(_ appController: TVApplicationController, evaluateAppJavaScriptIn jsContext: JSContext) @available(tvOS 9.0, *) - @asyncHandler optional func appController(_ appController: TVApplicationController, didFinishLaunching options: [String : Any]?) + optional func appController(_ appController: TVApplicationController, didFinishLaunching options: [String : Any]?) @available(tvOS 9.0, *) - @asyncHandler optional func appController(_ appController: TVApplicationController, didFail error: Error) + optional func appController(_ appController: TVApplicationController, didFail error: Error) @available(tvOS 9.0, *) - @asyncHandler optional func appController(_ appController: TVApplicationController, didStop options: [String : Any]?) + optional func appController(_ appController: TVApplicationController, didStop options: [String : Any]?) @available(tvOS 12.0, *) optional func player(for appController: TVApplicationController) -> TVPlayer? } diff --git a/tvOS/TVMLKit/TVBrowserViewController.swift b/tvOS/TVMLKit/TVBrowserViewController.swift index f4daf08..09f5650 100644 --- a/tvOS/TVMLKit/TVBrowserViewController.swift +++ b/tvOS/TVMLKit/TVBrowserViewController.swift @@ -9,7 +9,7 @@ protocol TVBrowserViewControllerDataSource : NSObjectProtocol { @available(tvOS 13.0, *) protocol TVBrowserViewControllerDelegate : NSObjectProtocol { optional func browserViewController(_ browserViewController: TVBrowserViewController, willCenterOn viewElement: TVViewElement) - @asyncHandler optional func browserViewController(_ browserViewController: TVBrowserViewController, didCenterOn viewElement: TVViewElement) + optional func browserViewController(_ browserViewController: TVBrowserViewController, didCenterOn viewElement: TVViewElement) } @available(tvOS 13.0, *) class TVBrowserViewController : UIViewController { diff --git a/tvOS/TVMLKit/TVDocumentViewController.swift b/tvOS/TVMLKit/TVDocumentViewController.swift index bfcd3b3..30b3925 100644 --- a/tvOS/TVMLKit/TVDocumentViewController.swift +++ b/tvOS/TVMLKit/TVDocumentViewController.swift @@ -39,9 +39,9 @@ extension TVDocumentViewController.Event { @available(tvOS 13.0, *) protocol TVDocumentViewControllerDelegate : NSObjectProtocol { optional func documentViewControllerWillUpdate(_ documentViewController: TVDocumentViewController) - @asyncHandler optional func documentViewControllerDidUpdate(_ documentViewController: TVDocumentViewController) - @asyncHandler optional func documentViewController(_ documentViewController: TVDocumentViewController, didUpdateWithContext context: [String : Any]) - @asyncHandler optional func documentViewController(_ documentViewController: TVDocumentViewController, didFailUpdateWithError error: Error) + optional func documentViewControllerDidUpdate(_ documentViewController: TVDocumentViewController) + optional func documentViewController(_ documentViewController: TVDocumentViewController, didUpdateWithContext context: [String : Any]) + optional func documentViewController(_ documentViewController: TVDocumentViewController, didFailUpdateWithError error: Error) optional func documentViewController(_ documentViewController: TVDocumentViewController, handleEvent event: TVDocumentViewController.Event, with element: TVViewElement) -> Bool } @available(tvOS 13.0, *) diff --git a/tvOS/TVUIKit/TVCollectionViewFullScreenLayout.swift b/tvOS/TVUIKit/TVCollectionViewFullScreenLayout.swift index 163213b..b357bf6 100644 --- a/tvOS/TVUIKit/TVCollectionViewFullScreenLayout.swift +++ b/tvOS/TVUIKit/TVCollectionViewFullScreenLayout.swift @@ -10,7 +10,7 @@ class TVCollectionViewFullScreenLayoutAttributes : UICollectionViewLayoutAttribu @available(tvOS 13.0, *) protocol TVCollectionViewDelegateFullScreenLayout : UICollectionViewDelegate { optional func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, willCenterCellAt indexPath: IndexPath) - @asyncHandler optional func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, didCenterCellAt indexPath: IndexPath) + optional func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, didCenterCellAt indexPath: IndexPath) } @available(tvOS 13.0, *) class TVCollectionViewFullScreenLayout : UICollectionViewLayout { diff --git a/tvOS/UIKit/NSLayoutManager.swift b/tvOS/UIKit/NSLayoutManager.swift index 41557f7..dfe47dc 100644 --- a/tvOS/UIKit/NSLayoutManager.swift +++ b/tvOS/UIKit/NSLayoutManager.swift @@ -157,11 +157,11 @@ protocol NSLayoutManagerDelegate : NSObjectProtocol { @available(tvOS 9.0, *) optional func layoutManager(_ layoutManager: NSLayoutManager, shouldSetLineFragmentRect lineFragmentRect: UnsafeMutablePointer, lineFragmentUsedRect: UnsafeMutablePointer, baselineOffset: UnsafeMutablePointer, in textContainer: NSTextContainer, forGlyphRange glyphRange: NSRange) -> Bool @available(tvOS 7.0, *) - @asyncHandler optional func layoutManagerDidInvalidateLayout(_ sender: NSLayoutManager) + optional func layoutManagerDidInvalidateLayout(_ sender: NSLayoutManager) @available(tvOS 7.0, *) - @asyncHandler optional func layoutManager(_ layoutManager: NSLayoutManager, didCompleteLayoutFor textContainer: NSTextContainer?, atEnd layoutFinishedFlag: Bool) + optional func layoutManager(_ layoutManager: NSLayoutManager, didCompleteLayoutFor textContainer: NSTextContainer?, atEnd layoutFinishedFlag: Bool) @available(tvOS 7.0, *) - @asyncHandler optional func layoutManager(_ layoutManager: NSLayoutManager, textContainer: NSTextContainer, didChangeGeometryFrom oldSize: CGSize) + optional func layoutManager(_ layoutManager: NSLayoutManager, textContainer: NSTextContainer, didChangeGeometryFrom oldSize: CGSize) } @available(tvOS, introduced: 7.0, deprecated: 9.0, message: "Use NSControlCharacterActionZeroAdvancement instead") var NSControlCharacterZeroAdvancementAction: Int { get } diff --git a/tvOS/UIKit/NSTextStorage.swift b/tvOS/UIKit/NSTextStorage.swift index 7f7c96d..9553f4b 100644 --- a/tvOS/UIKit/NSTextStorage.swift +++ b/tvOS/UIKit/NSTextStorage.swift @@ -31,5 +31,5 @@ protocol NSTextStorageDelegate : NSObjectProtocol { @available(tvOS 7.0, *) optional func textStorage(_ textStorage: NSTextStorage, willProcessEditing editedMask: NSTextStorage.EditActions, range editedRange: NSRange, changeInLength delta: Int) @available(tvOS 7.0, *) - @asyncHandler optional func textStorage(_ textStorage: NSTextStorage, didProcessEditing editedMask: NSTextStorage.EditActions, range editedRange: NSRange, changeInLength delta: Int) + optional func textStorage(_ textStorage: NSTextStorage, didProcessEditing editedMask: NSTextStorage.EditActions, range editedRange: NSRange, changeInLength delta: Int) } diff --git a/tvOS/UIKit/UIApplication.swift b/tvOS/UIKit/UIApplication.swift index d386b62..b25d14b 100644 --- a/tvOS/UIKit/UIApplication.swift +++ b/tvOS/UIKit/UIApplication.swift @@ -183,31 +183,31 @@ extension UIApplication { } protocol UIApplicationDelegate : NSObjectProtocol { @available(tvOS 2.0, *) - @asyncHandler optional func applicationDidFinishLaunching(_ application: UIApplication) + optional func applicationDidFinishLaunching(_ application: UIApplication) @available(tvOS 6.0, *) optional func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool @available(tvOS 3.0, *) optional func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool @available(tvOS 2.0, *) - @asyncHandler optional func applicationDidBecomeActive(_ application: UIApplication) + optional func applicationDidBecomeActive(_ application: UIApplication) @available(tvOS 2.0, *) optional func applicationWillResignActive(_ application: UIApplication) @available(tvOS 9.0, *) optional func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool @available(tvOS 2.0, *) - @asyncHandler optional func applicationDidReceiveMemoryWarning(_ application: UIApplication) + optional func applicationDidReceiveMemoryWarning(_ application: UIApplication) @available(tvOS 2.0, *) optional func applicationWillTerminate(_ application: UIApplication) @available(tvOS 2.0, *) optional func applicationSignificantTimeChange(_ application: UIApplication) @available(tvOS 3.0, *) - @asyncHandler optional func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) + optional func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) @available(tvOS 3.0, *) - @asyncHandler optional func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) + optional func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) @available(tvOS, introduced: 3.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate willPresentNotification:withCompletionHandler:] or -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:] for user visible notifications and -[UIApplicationDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:] for silent remote notifications") - @asyncHandler optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) + optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) @available(tvOS 7.0, *) - @asyncHandler optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) + optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) @available(tvOS 7.0, *) optional func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) async -> UIBackgroundFetchResult @available(tvOS, introduced: 11.0, deprecated: 13.0, message: "Use a BGAppRefreshTask in the BackgroundTasks framework instead") @@ -225,13 +225,13 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(tvOS 9.0, *) optional func applicationShouldRequestHealthAuthorization(_ application: UIApplication) @available(tvOS 4.0, *) - @asyncHandler optional func applicationDidEnterBackground(_ application: UIApplication) + optional func applicationDidEnterBackground(_ application: UIApplication) @available(tvOS 4.0, *) optional func applicationWillEnterForeground(_ application: UIApplication) @available(tvOS 4.0, *) optional func applicationProtectedDataWillBecomeUnavailable(_ application: UIApplication) @available(tvOS 4.0, *) - @asyncHandler optional func applicationProtectedDataDidBecomeAvailable(_ application: UIApplication) + optional func applicationProtectedDataDidBecomeAvailable(_ application: UIApplication) @available(tvOS 5.0, *) optional var window: UIWindow? { get set } @available(tvOS 8.0, *) @@ -245,7 +245,7 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(tvOS 6.0, *) optional func application(_ application: UIApplication, willEncodeRestorableStateWith coder: NSCoder) @available(tvOS 6.0, *) - @asyncHandler optional func application(_ application: UIApplication, didDecodeRestorableStateWith coder: NSCoder) + optional func application(_ application: UIApplication, didDecodeRestorableStateWith coder: NSCoder) @available(tvOS, introduced: 6.0, deprecated: 13.2, message: "Use application:shouldSaveSecureApplicationState: instead") optional func application(_ application: UIApplication, shouldSaveApplicationState coder: NSCoder) -> Bool @available(tvOS, introduced: 6.0, deprecated: 13.2, message: "Use application:shouldRestoreSecureApplicationState: instead") @@ -255,13 +255,13 @@ protocol UIApplicationDelegate : NSObjectProtocol { @available(tvOS 8.0, *) optional func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool @available(tvOS 8.0, *) - @asyncHandler optional func application(_ application: UIApplication, didFailToContinueUserActivityWithType userActivityType: String, error: Error) + optional func application(_ application: UIApplication, didFailToContinueUserActivityWithType userActivityType: String, error: Error) @available(tvOS 8.0, *) - @asyncHandler optional func application(_ application: UIApplication, didUpdate userActivity: NSUserActivity) + optional func application(_ application: UIApplication, didUpdate userActivity: NSUserActivity) @available(tvOS 13.0, *) optional func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration @available(tvOS 13.0, *) - @asyncHandler optional func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) + optional func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) } extension UIApplicationDelegate { diff --git a/tvOS/UIKit/UICollectionView.swift b/tvOS/UIKit/UICollectionView.swift index 4180f7a..69fbbc7 100644 --- a/tvOS/UIKit/UICollectionView.swift +++ b/tvOS/UIKit/UICollectionView.swift @@ -45,25 +45,25 @@ protocol UICollectionViewDelegate : UIScrollViewDelegate { @available(tvOS 6.0, *) optional func collectionView(_ collectionView: UICollectionView, shouldHighlightItemAt indexPath: IndexPath) -> Bool @available(tvOS 6.0, *) - @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didHighlightItemAt indexPath: IndexPath) + optional func collectionView(_ collectionView: UICollectionView, didHighlightItemAt indexPath: IndexPath) @available(tvOS 6.0, *) - @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didUnhighlightItemAt indexPath: IndexPath) + optional func collectionView(_ collectionView: UICollectionView, didUnhighlightItemAt indexPath: IndexPath) @available(tvOS 6.0, *) optional func collectionView(_ collectionView: UICollectionView, shouldSelectItemAt indexPath: IndexPath) -> Bool @available(tvOS 6.0, *) optional func collectionView(_ collectionView: UICollectionView, shouldDeselectItemAt indexPath: IndexPath) -> Bool @available(tvOS 6.0, *) - @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) + optional func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) @available(tvOS 6.0, *) - @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) + optional func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) @available(tvOS 8.0, *) optional func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) @available(tvOS 8.0, *) optional func collectionView(_ collectionView: UICollectionView, willDisplaySupplementaryView view: UICollectionReusableView, forElementKind elementKind: String, at indexPath: IndexPath) @available(tvOS 6.0, *) - @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) + optional func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) @available(tvOS 6.0, *) - @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didEndDisplayingSupplementaryView view: UICollectionReusableView, forElementOfKind elementKind: String, at indexPath: IndexPath) + optional func collectionView(_ collectionView: UICollectionView, didEndDisplayingSupplementaryView view: UICollectionReusableView, forElementOfKind elementKind: String, at indexPath: IndexPath) @available(tvOS, introduced: 6.0, deprecated: 13.0) optional func collectionView(_ collectionView: UICollectionView, shouldShowMenuForItemAt indexPath: IndexPath) -> Bool @available(tvOS, introduced: 6.0, deprecated: 13.0) @@ -77,7 +77,7 @@ protocol UICollectionViewDelegate : UIScrollViewDelegate { @available(tvOS 9.0, *) optional func collectionView(_ collectionView: UICollectionView, shouldUpdateFocusIn context: UICollectionViewFocusUpdateContext) -> Bool @available(tvOS 9.0, *) - @asyncHandler optional func collectionView(_ collectionView: UICollectionView, didUpdateFocusIn context: UICollectionViewFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) + optional func collectionView(_ collectionView: UICollectionView, didUpdateFocusIn context: UICollectionViewFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) @available(tvOS 9.0, *) optional func indexPathForPreferredFocusedView(in collectionView: UICollectionView) -> IndexPath? @available(tvOS 9.0, *) diff --git a/tvOS/UIKit/UIDynamicAnimator.swift b/tvOS/UIKit/UIDynamicAnimator.swift index 04f36c8..6566d74 100644 --- a/tvOS/UIKit/UIDynamicAnimator.swift +++ b/tvOS/UIKit/UIDynamicAnimator.swift @@ -3,7 +3,7 @@ protocol UIDynamicAnimatorDelegate : NSObjectProtocol { @available(tvOS 7.0, *) optional func dynamicAnimatorWillResume(_ animator: UIDynamicAnimator) @available(tvOS 7.0, *) - @asyncHandler optional func dynamicAnimatorDidPause(_ animator: UIDynamicAnimator) + optional func dynamicAnimatorDidPause(_ animator: UIDynamicAnimator) } @available(tvOS 7.0, *) class UIDynamicAnimator : NSObject { diff --git a/tvOS/UIKit/UIFocus.swift b/tvOS/UIKit/UIFocus.swift index 272a2de..c9db678 100644 --- a/tvOS/UIKit/UIFocus.swift +++ b/tvOS/UIKit/UIFocus.swift @@ -26,7 +26,7 @@ protocol UIFocusEnvironment : NSObjectProtocol { func setNeedsFocusUpdate() func updateFocusIfNeeded() func shouldUpdateFocus(in context: UIFocusUpdateContext) -> Bool - @asyncHandler func didUpdateFocus(in context: UIFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) + func didUpdateFocus(in context: UIFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) @available(tvOS 11.0, *) optional func soundIdentifierForFocusUpdate(in context: UIFocusUpdateContext) -> UIFocusSoundIdentifier? @available(tvOS, introduced: 9.0, deprecated: 10.0) @@ -44,7 +44,7 @@ protocol UIFocusItem : UIFocusEnvironment { @available(tvOS 12.0, *) var frame: CGRect { get } @available(tvOS 12.0, *) - @asyncHandler optional func didHintFocusMovement(_ hint: UIFocusMovementHint) + optional func didHintFocusMovement(_ hint: UIFocusMovementHint) } @available(iOS 11.0, tvOS 11.0, *) diff --git a/tvOS/UIKit/UIGuidedAccess.swift b/tvOS/UIKit/UIGuidedAccess.swift index d37ae5d..6738a08 100644 --- a/tvOS/UIKit/UIGuidedAccess.swift +++ b/tvOS/UIKit/UIGuidedAccess.swift @@ -14,7 +14,7 @@ extension UIAccessibility { @available(tvOS 7.0, *) protocol UIGuidedAccessRestrictionDelegate : NSObjectProtocol { var guidedAccessRestrictionIdentifiers: [String]? { get } - @asyncHandler func guidedAccessRestriction(withIdentifier restrictionIdentifier: String, didChange newRestrictionState: UIAccessibility.GuidedAccessRestrictionState) + func guidedAccessRestriction(withIdentifier restrictionIdentifier: String, didChange newRestrictionState: UIAccessibility.GuidedAccessRestrictionState) func textForGuidedAccessRestriction(withIdentifier restrictionIdentifier: String) -> String? optional func detailTextForGuidedAccessRestriction(withIdentifier restrictionIdentifier: String) -> String? } diff --git a/tvOS/UIKit/UIInteraction.swift b/tvOS/UIKit/UIInteraction.swift index 3dd0aff..e366cd0 100644 --- a/tvOS/UIKit/UIInteraction.swift +++ b/tvOS/UIKit/UIInteraction.swift @@ -3,7 +3,7 @@ protocol UIInteraction : NSObjectProtocol { weak var view: @sil_weak UIView? { get } func willMove(to view: UIView?) - @asyncHandler func didMove(to view: UIView?) + func didMove(to view: UIView?) } extension UIView { @available(tvOS 13.0, *) diff --git a/tvOS/UIKit/UINavigationBar.swift b/tvOS/UIKit/UINavigationBar.swift index bb55421..acde45b 100644 --- a/tvOS/UIKit/UINavigationBar.swift +++ b/tvOS/UIKit/UINavigationBar.swift @@ -39,9 +39,9 @@ protocol UINavigationBarDelegate : UIBarPositioningDelegate { @available(tvOS 2.0, *) optional func navigationBar(_ navigationBar: UINavigationBar, shouldPush item: UINavigationItem) -> Bool @available(tvOS 2.0, *) - @asyncHandler optional func navigationBar(_ navigationBar: UINavigationBar, didPush item: UINavigationItem) + optional func navigationBar(_ navigationBar: UINavigationBar, didPush item: UINavigationItem) @available(tvOS 2.0, *) optional func navigationBar(_ navigationBar: UINavigationBar, shouldPop item: UINavigationItem) -> Bool @available(tvOS 2.0, *) - @asyncHandler optional func navigationBar(_ navigationBar: UINavigationBar, didPop item: UINavigationItem) + optional func navigationBar(_ navigationBar: UINavigationBar, didPop item: UINavigationItem) } diff --git a/tvOS/UIKit/UINavigationController.swift b/tvOS/UIKit/UINavigationController.swift index 4a45a5b..f7fc68b 100644 --- a/tvOS/UIKit/UINavigationController.swift +++ b/tvOS/UIKit/UINavigationController.swift @@ -32,7 +32,7 @@ protocol UINavigationControllerDelegate : NSObjectProtocol { @available(tvOS 2.0, *) optional func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) @available(tvOS 2.0, *) - @asyncHandler optional func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) + optional func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) @available(tvOS 7.0, *) optional func navigationController(_ navigationController: UINavigationController, interactionControllerFor animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? @available(tvOS 7.0, *) diff --git a/tvOS/UIKit/UIPageViewController.swift b/tvOS/UIKit/UIPageViewController.swift index 2e89ed5..c2fe741 100644 --- a/tvOS/UIKit/UIPageViewController.swift +++ b/tvOS/UIKit/UIPageViewController.swift @@ -55,7 +55,7 @@ protocol UIPageViewControllerDelegate : NSObjectProtocol { @available(tvOS 6.0, *) optional func pageViewController(_ pageViewController: UIPageViewController, willTransitionTo pendingViewControllers: [UIViewController]) @available(tvOS 5.0, *) - @asyncHandler optional func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) + optional func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) } protocol UIPageViewControllerDataSource : NSObjectProtocol { @available(tvOS 5.0, *) diff --git a/tvOS/UIKit/UIPopoverController.swift b/tvOS/UIKit/UIPopoverController.swift index c5e5dce..1d4611c 100644 --- a/tvOS/UIKit/UIPopoverController.swift +++ b/tvOS/UIKit/UIPopoverController.swift @@ -24,7 +24,7 @@ protocol UIPopoverControllerDelegate : NSObjectProtocol { @available(tvOS, introduced: 3.2, deprecated: 9.0) optional func popoverControllerShouldDismissPopover(_ popoverController: UIPopoverController) -> Bool @available(tvOS, introduced: 3.2, deprecated: 9.0) - @asyncHandler optional func popoverControllerDidDismissPopover(_ popoverController: UIPopoverController) + optional func popoverControllerDidDismissPopover(_ popoverController: UIPopoverController) @available(tvOS, introduced: 7.0, deprecated: 9.0) optional func popoverController(_ popoverController: UIPopoverController, willRepositionPopoverTo rect: UnsafeMutablePointer, in view: AutoreleasingUnsafeMutablePointer) } diff --git a/tvOS/UIKit/UIPresentationController.swift b/tvOS/UIKit/UIPresentationController.swift index eba4ed8..ef049f4 100644 --- a/tvOS/UIKit/UIPresentationController.swift +++ b/tvOS/UIKit/UIPresentationController.swift @@ -13,9 +13,9 @@ protocol UIAdaptivePresentationControllerDelegate : NSObjectProtocol { @available(tvOS 13.0, *) optional func presentationControllerWillDismiss(_ presentationController: UIPresentationController) @available(tvOS 13.0, *) - @asyncHandler optional func presentationControllerDidDismiss(_ presentationController: UIPresentationController) + optional func presentationControllerDidDismiss(_ presentationController: UIPresentationController) @available(tvOS 13.0, *) - @asyncHandler optional func presentationControllerDidAttemptToDismiss(_ presentationController: UIPresentationController) + optional func presentationControllerDidAttemptToDismiss(_ presentationController: UIPresentationController) } @available(tvOS 8.0, *) class UIPresentationController : NSObject, UIAppearanceContainer, UITraitEnvironment, UIContentContainer, UIFocusEnvironment { diff --git a/tvOS/UIKit/UIScene.swift b/tvOS/UIKit/UIScene.swift index 111a703..b07ce8c 100644 --- a/tvOS/UIKit/UIScene.swift +++ b/tvOS/UIKit/UIScene.swift @@ -13,17 +13,17 @@ class UIScene : UIResponder { @available(tvOS 13.0, *) protocol UISceneDelegate : NSObjectProtocol { optional func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) - @asyncHandler optional func sceneDidDisconnect(_ scene: UIScene) - @asyncHandler optional func sceneDidBecomeActive(_ scene: UIScene) + optional func sceneDidDisconnect(_ scene: UIScene) + optional func sceneDidBecomeActive(_ scene: UIScene) optional func sceneWillResignActive(_ scene: UIScene) optional func sceneWillEnterForeground(_ scene: UIScene) - @asyncHandler optional func sceneDidEnterBackground(_ scene: UIScene) + optional func sceneDidEnterBackground(_ scene: UIScene) optional func scene(_ scene: UIScene, openURLContexts URLContexts: Set) optional func stateRestorationActivity(for scene: UIScene) -> NSUserActivity? optional func scene(_ scene: UIScene, willContinueUserActivityWithType userActivityType: String) optional func scene(_ scene: UIScene, continue userActivity: NSUserActivity) - @asyncHandler optional func scene(_ scene: UIScene, didFailToContinueUserActivityWithType userActivityType: String, error: Error) - @asyncHandler optional func scene(_ scene: UIScene, didUpdate userActivity: NSUserActivity) + optional func scene(_ scene: UIScene, didFailToContinueUserActivityWithType userActivityType: String, error: Error) + optional func scene(_ scene: UIScene, didUpdate userActivity: NSUserActivity) } extension UIScene { @available(tvOS 13.0, *) diff --git a/tvOS/UIKit/UIScrollView.swift b/tvOS/UIKit/UIScrollView.swift index be25fc7..9a14243 100644 --- a/tvOS/UIKit/UIScrollView.swift +++ b/tvOS/UIKit/UIScrollView.swift @@ -107,31 +107,31 @@ class UIScrollView : UIView, NSCoding, UIFocusItemScrollableContainer { } protocol UIScrollViewDelegate : NSObjectProtocol { @available(tvOS 2.0, *) - @asyncHandler optional func scrollViewDidScroll(_ scrollView: UIScrollView) + optional func scrollViewDidScroll(_ scrollView: UIScrollView) @available(tvOS 3.2, *) - @asyncHandler optional func scrollViewDidZoom(_ scrollView: UIScrollView) + optional func scrollViewDidZoom(_ scrollView: UIScrollView) @available(tvOS 2.0, *) optional func scrollViewWillBeginDragging(_ scrollView: UIScrollView) @available(tvOS 5.0, *) optional func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) @available(tvOS 2.0, *) - @asyncHandler optional func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) + optional func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) @available(tvOS 2.0, *) optional func scrollViewWillBeginDecelerating(_ scrollView: UIScrollView) @available(tvOS 2.0, *) - @asyncHandler optional func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) + optional func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) @available(tvOS 2.0, *) - @asyncHandler optional func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) + optional func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) @available(tvOS 2.0, *) optional func viewForZooming(in scrollView: UIScrollView) -> UIView? @available(tvOS 3.2, *) optional func scrollViewWillBeginZooming(_ scrollView: UIScrollView, with view: UIView?) @available(tvOS 2.0, *) - @asyncHandler optional func scrollViewDidEndZooming(_ scrollView: UIScrollView, with view: UIView?, atScale scale: CGFloat) + optional func scrollViewDidEndZooming(_ scrollView: UIScrollView, with view: UIView?, atScale scale: CGFloat) @available(tvOS 2.0, *) optional func scrollViewShouldScrollToTop(_ scrollView: UIScrollView) -> Bool @available(tvOS 2.0, *) - @asyncHandler optional func scrollViewDidScrollToTop(_ scrollView: UIScrollView) + optional func scrollViewDidScrollToTop(_ scrollView: UIScrollView) @available(tvOS 11.0, *) - @asyncHandler optional func scrollViewDidChangeAdjustedContentInset(_ scrollView: UIScrollView) + optional func scrollViewDidChangeAdjustedContentInset(_ scrollView: UIScrollView) } diff --git a/tvOS/UIKit/UISearchBar.swift b/tvOS/UIKit/UISearchBar.swift index b251d52..b34f635 100644 --- a/tvOS/UIKit/UISearchBar.swift +++ b/tvOS/UIKit/UISearchBar.swift @@ -75,11 +75,11 @@ protocol UISearchBarDelegate : UIBarPositioningDelegate { @available(tvOS 2.0, *) optional func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool @available(tvOS 2.0, *) - @asyncHandler optional func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) + optional func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) @available(tvOS 2.0, *) optional func searchBarShouldEndEditing(_ searchBar: UISearchBar) -> Bool @available(tvOS 2.0, *) - @asyncHandler optional func searchBarTextDidEndEditing(_ searchBar: UISearchBar) + optional func searchBarTextDidEndEditing(_ searchBar: UISearchBar) @available(tvOS 2.0, *) optional func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) @available(tvOS 3.0, *) diff --git a/tvOS/UIKit/UISearchController.swift b/tvOS/UIKit/UISearchController.swift index fc3d8e7..8fe2890 100644 --- a/tvOS/UIKit/UISearchController.swift +++ b/tvOS/UIKit/UISearchController.swift @@ -3,11 +3,11 @@ protocol UISearchControllerDelegate : NSObjectProtocol { @available(tvOS 8.0, *) optional func willPresentSearchController(_ searchController: UISearchController) @available(tvOS 8.0, *) - @asyncHandler optional func didPresentSearchController(_ searchController: UISearchController) + optional func didPresentSearchController(_ searchController: UISearchController) @available(tvOS 8.0, *) optional func willDismissSearchController(_ searchController: UISearchController) @available(tvOS 8.0, *) - @asyncHandler optional func didDismissSearchController(_ searchController: UISearchController) + optional func didDismissSearchController(_ searchController: UISearchController) @available(tvOS 8.0, *) optional func presentSearchController(_ searchController: UISearchController) } diff --git a/tvOS/UIKit/UISplitViewController.swift b/tvOS/UIKit/UISplitViewController.swift index d734eb0..203a4a6 100644 --- a/tvOS/UIKit/UISplitViewController.swift +++ b/tvOS/UIKit/UISplitViewController.swift @@ -134,9 +134,9 @@ protocol UISplitViewControllerDelegate { @available(tvOS 14.0, *) optional func splitViewController(_ svc: UISplitViewController, displayModeForExpandingToProposedDisplayMode proposedDisplayMode: UISplitViewController.DisplayMode) -> UISplitViewController.DisplayMode @available(tvOS 14.0, *) - @asyncHandler optional func splitViewControllerDidCollapse(_ svc: UISplitViewController) + optional func splitViewControllerDidCollapse(_ svc: UISplitViewController) @available(tvOS 14.0, *) - @asyncHandler optional func splitViewControllerDidExpand(_ svc: UISplitViewController) + optional func splitViewControllerDidExpand(_ svc: UISplitViewController) @available(tvOS 14.0, *) optional func splitViewController(_ svc: UISplitViewController, willShow column: UISplitViewController.Column) @available(tvOS 14.0, *) @@ -144,7 +144,7 @@ protocol UISplitViewControllerDelegate { @available(tvOS 14.0, *) optional func splitViewControllerInteractivePresentationGestureWillBegin(_ svc: UISplitViewController) @available(tvOS 14.0, *) - @asyncHandler optional func splitViewControllerInteractivePresentationGestureDidEnd(_ svc: UISplitViewController) + optional func splitViewControllerInteractivePresentationGestureDidEnd(_ svc: UISplitViewController) } extension UIViewController { var splitViewController: UISplitViewController? { get } diff --git a/tvOS/UIKit/UITabBar.swift b/tvOS/UIKit/UITabBar.swift index 82c1c6e..68d1715 100644 --- a/tvOS/UIKit/UITabBar.swift +++ b/tvOS/UIKit/UITabBar.swift @@ -40,5 +40,5 @@ class UITabBar : UIView { } protocol UITabBarDelegate : NSObjectProtocol { @available(tvOS 2.0, *) - @asyncHandler optional func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) + optional func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) } diff --git a/tvOS/UIKit/UITabBarController.swift b/tvOS/UIKit/UITabBarController.swift index 7b60c0f..9feb81b 100644 --- a/tvOS/UIKit/UITabBarController.swift +++ b/tvOS/UIKit/UITabBarController.swift @@ -13,7 +13,7 @@ protocol UITabBarControllerDelegate : NSObjectProtocol { @available(tvOS 3.0, *) optional func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool @available(tvOS 2.0, *) - @asyncHandler optional func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) + optional func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) @available(tvOS 7.0, *) optional func tabBarController(_ tabBarController: UITabBarController, interactionControllerFor animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? @available(tvOS 7.0, *) diff --git a/tvOS/UIKit/UITableView.swift b/tvOS/UIKit/UITableView.swift index bf2dcfb..e7fac53 100644 --- a/tvOS/UIKit/UITableView.swift +++ b/tvOS/UIKit/UITableView.swift @@ -52,11 +52,11 @@ protocol UITableViewDelegate : UIScrollViewDelegate { @available(tvOS 6.0, *) optional func tableView(_ tableView: UITableView, willDisplayFooterView view: UIView, forSection section: Int) @available(tvOS 6.0, *) - @asyncHandler optional func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) + optional func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) @available(tvOS 6.0, *) - @asyncHandler optional func tableView(_ tableView: UITableView, didEndDisplayingHeaderView view: UIView, forSection section: Int) + optional func tableView(_ tableView: UITableView, didEndDisplayingHeaderView view: UIView, forSection section: Int) @available(tvOS 6.0, *) - @asyncHandler optional func tableView(_ tableView: UITableView, didEndDisplayingFooterView view: UIView, forSection section: Int) + optional func tableView(_ tableView: UITableView, didEndDisplayingFooterView view: UIView, forSection section: Int) @available(tvOS 2.0, *) optional func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat @available(tvOS 2.0, *) @@ -78,17 +78,17 @@ protocol UITableViewDelegate : UIScrollViewDelegate { @available(tvOS 6.0, *) optional func tableView(_ tableView: UITableView, shouldHighlightRowAt indexPath: IndexPath) -> Bool @available(tvOS 6.0, *) - @asyncHandler optional func tableView(_ tableView: UITableView, didHighlightRowAt indexPath: IndexPath) + optional func tableView(_ tableView: UITableView, didHighlightRowAt indexPath: IndexPath) @available(tvOS 6.0, *) - @asyncHandler optional func tableView(_ tableView: UITableView, didUnhighlightRowAt indexPath: IndexPath) + optional func tableView(_ tableView: UITableView, didUnhighlightRowAt indexPath: IndexPath) @available(tvOS 2.0, *) optional func tableView(_ tableView: UITableView, willSelectRowAt indexPath: IndexPath) -> IndexPath? @available(tvOS 3.0, *) optional func tableView(_ tableView: UITableView, willDeselectRowAt indexPath: IndexPath) -> IndexPath? @available(tvOS 2.0, *) - @asyncHandler optional func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) + optional func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) @available(tvOS 3.0, *) - @asyncHandler optional func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) + optional func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) @available(tvOS 2.0, *) optional func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCell.EditingStyle @available(tvOS 2.0, *) @@ -108,7 +108,7 @@ protocol UITableViewDelegate : UIScrollViewDelegate { @available(tvOS 9.0, *) optional func tableView(_ tableView: UITableView, shouldUpdateFocusIn context: UITableViewFocusUpdateContext) -> Bool @available(tvOS 9.0, *) - @asyncHandler optional func tableView(_ tableView: UITableView, didUpdateFocusIn context: UITableViewFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) + optional func tableView(_ tableView: UITableView, didUpdateFocusIn context: UITableViewFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) @available(tvOS 9.0, *) optional func indexPathForPreferredFocusedView(in tableView: UITableView) -> IndexPath? } diff --git a/tvOS/UIKit/UITextField.swift b/tvOS/UIKit/UITextField.swift index eb9daf8..0f6eed3 100644 --- a/tvOS/UIKit/UITextField.swift +++ b/tvOS/UIKit/UITextField.swift @@ -48,17 +48,17 @@ protocol UITextFieldDelegate : NSObjectProtocol { @available(tvOS 2.0, *) optional func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool @available(tvOS 2.0, *) - @asyncHandler optional func textFieldDidBeginEditing(_ textField: UITextField) + optional func textFieldDidBeginEditing(_ textField: UITextField) @available(tvOS 2.0, *) optional func textFieldShouldEndEditing(_ textField: UITextField) -> Bool @available(tvOS 2.0, *) - @asyncHandler optional func textFieldDidEndEditing(_ textField: UITextField) + optional func textFieldDidEndEditing(_ textField: UITextField) @available(tvOS 10.0, *) - @asyncHandler optional func textFieldDidEndEditing(_ textField: UITextField, reason: UITextField.DidEndEditingReason) + optional func textFieldDidEndEditing(_ textField: UITextField, reason: UITextField.DidEndEditingReason) @available(tvOS 2.0, *) optional func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool @available(tvOS 13.0, *) - @asyncHandler optional func textFieldDidChangeSelection(_ textField: UITextField) + optional func textFieldDidChangeSelection(_ textField: UITextField) @available(tvOS 2.0, *) optional func textFieldShouldClear(_ textField: UITextField) -> Bool @available(tvOS 2.0, *) diff --git a/tvOS/UIKit/UITextInput.swift b/tvOS/UIKit/UITextInput.swift index 967aa8e..462ba4c 100644 --- a/tvOS/UIKit/UITextInput.swift +++ b/tvOS/UIKit/UITextInput.swift @@ -114,7 +114,7 @@ protocol UITextInput : UIKeyInput { optional var selectionAffinity: UITextStorageDirection { get set } @available(tvOS 5.1, *) optional func insertDictationResult(_ dictationResult: [UIDictationPhrase]) - @asyncHandler optional func dictationRecordingDidEnd() + optional func dictationRecordingDidEnd() optional func dictationRecognitionFailed() optional var insertDictationResultPlaceholder: Any { get } optional func frame(forDictationResultPlaceholder placeholder: Any) -> CGRect @@ -152,9 +152,9 @@ class UITextSelectionRect : NSObject { } protocol UITextInputDelegate : NSObjectProtocol { func selectionWillChange(_ textInput: UITextInput?) - @asyncHandler func selectionDidChange(_ textInput: UITextInput?) + func selectionDidChange(_ textInput: UITextInput?) func textWillChange(_ textInput: UITextInput?) - @asyncHandler func textDidChange(_ textInput: UITextInput?) + func textDidChange(_ textInput: UITextInput?) } protocol UITextInputTokenizer : NSObjectProtocol { @available(tvOS 3.2, *) diff --git a/tvOS/UIKit/UITextInteraction.swift b/tvOS/UIKit/UITextInteraction.swift index babefaf..c320235 100644 --- a/tvOS/UIKit/UITextInteraction.swift +++ b/tvOS/UIKit/UITextInteraction.swift @@ -8,5 +8,5 @@ enum UITextInteractionMode : Int { protocol UITextInteractionDelegate : NSObjectProtocol { optional func interactionShouldBegin(_ interaction: UITextInteraction, at point: CGPoint) -> Bool optional func interactionWillBegin(_ interaction: UITextInteraction) - @asyncHandler optional func interactionDidEnd(_ interaction: UITextInteraction) + optional func interactionDidEnd(_ interaction: UITextInteraction) } diff --git a/tvOS/UIKit/UITextView.swift b/tvOS/UIKit/UITextView.swift index 7f31a3c..5badf3d 100644 --- a/tvOS/UIKit/UITextView.swift +++ b/tvOS/UIKit/UITextView.swift @@ -5,15 +5,15 @@ protocol UITextViewDelegate : UIScrollViewDelegate { @available(tvOS 2.0, *) optional func textViewShouldEndEditing(_ textView: UITextView) -> Bool @available(tvOS 2.0, *) - @asyncHandler optional func textViewDidBeginEditing(_ textView: UITextView) + optional func textViewDidBeginEditing(_ textView: UITextView) @available(tvOS 2.0, *) - @asyncHandler optional func textViewDidEndEditing(_ textView: UITextView) + optional func textViewDidEndEditing(_ textView: UITextView) @available(tvOS 2.0, *) optional func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool @available(tvOS 2.0, *) - @asyncHandler optional func textViewDidChange(_ textView: UITextView) + optional func textViewDidChange(_ textView: UITextView) @available(tvOS 2.0, *) - @asyncHandler optional func textViewDidChangeSelection(_ textView: UITextView) + optional func textViewDidChangeSelection(_ textView: UITextView) @available(tvOS 10.0, *) optional func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool @available(tvOS 10.0, *) diff --git a/tvOS/UIKit/UITraitCollection.swift b/tvOS/UIKit/UITraitCollection.swift index 4316ca1..034374d 100644 --- a/tvOS/UIKit/UITraitCollection.swift +++ b/tvOS/UIKit/UITraitCollection.swift @@ -48,7 +48,7 @@ protocol UITraitEnvironment : NSObjectProtocol { @available(tvOS 8.0, *) var traitCollection: UITraitCollection { get } @available(tvOS 8.0, *) - @asyncHandler func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) + func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) } extension UITraitCollection { @available(tvOS 13.0, *) diff --git a/tvOS/UIKit/UIViewController.swift b/tvOS/UIKit/UIViewController.swift index 29886f8..16eeb41 100644 --- a/tvOS/UIKit/UIViewController.swift +++ b/tvOS/UIKit/UIViewController.swift @@ -28,9 +28,9 @@ protocol UIContentContainer : NSObjectProtocol { @available(tvOS 8.0, *) var preferredContentSize: CGSize { get } @available(tvOS 8.0, *) - @asyncHandler func preferredContentSizeDidChange(forChildContentContainer container: UIContentContainer) + func preferredContentSizeDidChange(forChildContentContainer container: UIContentContainer) @available(tvOS 8.0, *) - @asyncHandler func systemLayoutFittingSizeDidChange(forChildContentContainer container: UIContentContainer) + func systemLayoutFittingSizeDidChange(forChildContentContainer container: UIContentContainer) @available(tvOS 8.0, *) func size(forChildContentContainer container: UIContentContainer, withParentContainerSize parentSize: CGSize) -> CGSize @available(tvOS 8.0, *) diff --git a/watchOS/AVFoundation/AVContentKeySession.swift b/watchOS/AVFoundation/AVContentKeySession.swift index 8d6484d..f87daea 100644 --- a/watchOS/AVFoundation/AVContentKeySession.swift +++ b/watchOS/AVFoundation/AVContentKeySession.swift @@ -89,18 +89,18 @@ extension AVContentKeyRequest.RetryReason { } @available(watchOS 7.0, *) protocol AVContentKeySessionDelegate : NSObjectProtocol { - @asyncHandler func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest) - @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didProvideRenewingContentKeyRequest keyRequest: AVContentKeyRequest) - @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVPersistableContentKeyRequest) + func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest) + optional func contentKeySession(_ session: AVContentKeySession, didProvideRenewingContentKeyRequest keyRequest: AVContentKeyRequest) + optional func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVPersistableContentKeyRequest) @available(watchOS 7.0, *) - @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, didUpdatePersistableContentKey persistableContentKey: Data, forContentKeyIdentifier keyIdentifier: Any) - @asyncHandler optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequest keyRequest: AVContentKeyRequest, didFailWithError err: Error) + optional func contentKeySession(_ session: AVContentKeySession, didUpdatePersistableContentKey persistableContentKey: Data, forContentKeyIdentifier keyIdentifier: Any) + optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequest keyRequest: AVContentKeyRequest, didFailWithError err: Error) optional func contentKeySession(_ session: AVContentKeySession, shouldRetry keyRequest: AVContentKeyRequest, reason retryReason: AVContentKeyRequest.RetryReason) -> Bool @available(watchOS 7.0, *) optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequestDidSucceed keyRequest: AVContentKeyRequest) - @asyncHandler optional func contentKeySessionContentProtectionSessionIdentifierDidChange(_ session: AVContentKeySession) + optional func contentKeySessionContentProtectionSessionIdentifierDidChange(_ session: AVContentKeySession) @available(watchOS 7.0, *) - @asyncHandler optional func contentKeySessionDidGenerateExpiredSessionReport(_ session: AVContentKeySession) + optional func contentKeySessionDidGenerateExpiredSessionReport(_ session: AVContentKeySession) } @available(watchOS 7.0, *) class AVContentKeyRequest : NSObject { diff --git a/watchOS/AVFoundation/AVPlayerItemMediaDataCollector.swift b/watchOS/AVFoundation/AVPlayerItemMediaDataCollector.swift index 2bb8e69..1e35d8a 100644 --- a/watchOS/AVFoundation/AVPlayerItemMediaDataCollector.swift +++ b/watchOS/AVFoundation/AVPlayerItemMediaDataCollector.swift @@ -11,5 +11,5 @@ class AVPlayerItemMetadataCollector : AVPlayerItemMediaDataCollector { } protocol AVPlayerItemMetadataCollectorPushDelegate : NSObjectProtocol { @available(watchOS 2.3, *) - @asyncHandler func metadataCollector(_ metadataCollector: AVPlayerItemMetadataCollector, didCollect metadataGroups: [AVDateRangeMetadataGroup], indexesOfNewGroups: IndexSet, indexesOfModifiedGroups: IndexSet) + func metadataCollector(_ metadataCollector: AVPlayerItemMetadataCollector, didCollect metadataGroups: [AVDateRangeMetadataGroup], indexesOfNewGroups: IndexSet, indexesOfModifiedGroups: IndexSet) } diff --git a/watchOS/AVFoundation/AVPlayerItemOutput.swift b/watchOS/AVFoundation/AVPlayerItemOutput.swift index 7fd34ec..f385ccc 100644 --- a/watchOS/AVFoundation/AVPlayerItemOutput.swift +++ b/watchOS/AVFoundation/AVPlayerItemOutput.swift @@ -41,5 +41,5 @@ class AVPlayerItemMetadataOutput : AVPlayerItemOutput { } protocol AVPlayerItemMetadataOutputPushDelegate : AVPlayerItemOutputPushDelegate { @available(watchOS 1.0, *) - @asyncHandler optional func metadataOutput(_ output: AVPlayerItemMetadataOutput, didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup], from track: AVPlayerItemTrack?) + optional func metadataOutput(_ output: AVPlayerItemMetadataOutput, didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup], from track: AVPlayerItemTrack?) } diff --git a/watchOS/AuthenticationServices/ASAuthorizationController.swift b/watchOS/AuthenticationServices/ASAuthorizationController.swift index dceedd6..3bc6954 100644 --- a/watchOS/AuthenticationServices/ASAuthorizationController.swift +++ b/watchOS/AuthenticationServices/ASAuthorizationController.swift @@ -1,8 +1,8 @@ @available(watchOS 6.0, *) protocol ASAuthorizationControllerDelegate : NSObjectProtocol { - @asyncHandler optional func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) - @asyncHandler optional func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) + optional func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) + optional func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) } @available(watchOS 6.0, *) class ASAuthorizationController : NSObject { diff --git a/watchOS/ClockKit/CLKComplicationDataSource.swift b/watchOS/ClockKit/CLKComplicationDataSource.swift index abd3995..2828ae6 100644 --- a/watchOS/ClockKit/CLKComplicationDataSource.swift +++ b/watchOS/ClockKit/CLKComplicationDataSource.swift @@ -25,7 +25,7 @@ protocol CLKComplicationDataSource : NSObjectProtocol { @available(watchOS, introduced: 2.0, deprecated: 4.0, message: "Use WKRefreshBackgroundTask instead") optional func getNextRequestedUpdateDate(handler: @escaping (Date?) -> Void) @available(watchOS, introduced: 2.0, deprecated: 4.0, message: "Use WKRefreshBackgroundTask instead") - @asyncHandler optional func requestedUpdateDidBegin() + optional func requestedUpdateDidBegin() @available(watchOS, introduced: 2.0, deprecated: 4.0, message: "Use WKRefreshBackgroundTask instead") optional func requestedUpdateBudgetExhausted() } diff --git a/watchOS/CoreBluetooth/CBCentralManager.swift b/watchOS/CoreBluetooth/CBCentralManager.swift index 974ac0b..0006c89 100644 --- a/watchOS/CoreBluetooth/CBCentralManager.swift +++ b/watchOS/CoreBluetooth/CBCentralManager.swift @@ -47,19 +47,19 @@ class CBCentralManager : CBManager { } protocol CBCentralManagerDelegate : NSObjectProtocol { @available(watchOS 2.0, *) - @asyncHandler func centralManagerDidUpdateState(_ central: CBCentralManager) + func centralManagerDidUpdateState(_ central: CBCentralManager) @available(watchOS 2.0, *) optional func centralManager(_ central: CBCentralManager, willRestoreState dict: [String : Any]) @available(watchOS 2.0, *) - @asyncHandler optional func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) + optional func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) @available(watchOS 2.0, *) - @asyncHandler optional func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) + optional func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) @available(watchOS 2.0, *) - @asyncHandler optional func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) + optional func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) @available(watchOS 2.0, *) - @asyncHandler optional func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) + optional func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) @available(watchOS 6.0, *) optional func centralManager(_ central: CBCentralManager, connectionEventDidOccur event: CBConnectionEvent, for peripheral: CBPeripheral) @available(watchOS 6.0, *) - @asyncHandler optional func centralManager(_ central: CBCentralManager, didUpdateANCSAuthorizationFor peripheral: CBPeripheral) + optional func centralManager(_ central: CBCentralManager, didUpdateANCSAuthorizationFor peripheral: CBPeripheral) } diff --git a/watchOS/CoreBluetooth/CBPeripheral.swift b/watchOS/CoreBluetooth/CBPeripheral.swift index 306db7b..538fd86 100644 --- a/watchOS/CoreBluetooth/CBPeripheral.swift +++ b/watchOS/CoreBluetooth/CBPeripheral.swift @@ -44,33 +44,33 @@ class CBPeripheral : CBPeer { } protocol CBPeripheralDelegate : NSObjectProtocol { @available(watchOS 2.0, *) - @asyncHandler optional func peripheralDidUpdateName(_ peripheral: CBPeripheral) + optional func peripheralDidUpdateName(_ peripheral: CBPeripheral) @available(watchOS 2.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]) + optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]) @available(watchOS, introduced: 2.0, deprecated: 2.0) - @asyncHandler optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, error: Error?) + optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, error: Error?) @available(watchOS 2.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didReadRSSI RSSI: NSNumber, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didReadRSSI RSSI: NSNumber, error: Error?) @available(watchOS 2.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) @available(watchOS 2.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesFor service: CBService, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesFor service: CBService, error: Error?) @available(watchOS 2.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) @available(watchOS 2.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) @available(watchOS 2.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) @available(watchOS 2.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: Error?) @available(watchOS 2.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didDiscoverDescriptorsFor characteristic: CBCharacteristic, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didDiscoverDescriptorsFor characteristic: CBCharacteristic, error: Error?) @available(watchOS 2.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor descriptor: CBDescriptor, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor descriptor: CBDescriptor, error: Error?) @available(watchOS 2.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor descriptor: CBDescriptor, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didWriteValueFor descriptor: CBDescriptor, error: Error?) @available(watchOS 2.0, *) optional func peripheralIsReady(toSendWriteWithoutResponse peripheral: CBPeripheral) @available(watchOS 4.0, *) - @asyncHandler optional func peripheral(_ peripheral: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?) + optional func peripheral(_ peripheral: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?) } diff --git a/watchOS/CoreBluetooth/CBPeripheralManager.swift b/watchOS/CoreBluetooth/CBPeripheralManager.swift index ee0d131..07df083 100644 --- a/watchOS/CoreBluetooth/CBPeripheralManager.swift +++ b/watchOS/CoreBluetooth/CBPeripheralManager.swift @@ -48,27 +48,27 @@ class CBPeripheralManager : CBManager { } protocol CBPeripheralManagerDelegate : NSObjectProtocol { @available(watchOS 2.0, *) - @asyncHandler func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) + func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) @available(watchOS 2.0, *) optional func peripheralManager(_ peripheral: CBPeripheralManager, willRestoreState dict: [String : Any]) @available(watchOS 2.0, *) - @asyncHandler optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error: Error?) + optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error: Error?) @available(watchOS 2.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) @available(watchOS 2.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didSubscribeTo characteristic: CBCharacteristic) + optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didSubscribeTo characteristic: CBCharacteristic) @available(watchOS 2.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didUnsubscribeFrom characteristic: CBCharacteristic) + optional func peripheralManager(_ peripheral: CBPeripheralManager, central: CBCentral, didUnsubscribeFrom characteristic: CBCharacteristic) @available(watchOS 2.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveRead request: CBATTRequest) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveRead request: CBATTRequest) @available(watchOS 2.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) @available(watchOS 2.0, *) optional func peripheralManagerIsReady(toUpdateSubscribers peripheral: CBPeripheralManager) @available(watchOS 2.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) @available(watchOS 2.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didUnpublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didUnpublishL2CAPChannel PSM: CBL2CAPPSM, error: Error?) @available(watchOS 4.0, *) - @asyncHandler optional func peripheralManager(_ peripheral: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: Error?) + optional func peripheralManager(_ peripheral: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: Error?) } diff --git a/watchOS/CoreData/NSFetchedResultsController.swift b/watchOS/CoreData/NSFetchedResultsController.swift index b549bb7..6cc5853 100644 --- a/watchOS/CoreData/NSFetchedResultsController.swift +++ b/watchOS/CoreData/NSFetchedResultsController.swift @@ -34,15 +34,15 @@ enum NSFetchedResultsChangeType : UInt { } protocol NSFetchedResultsControllerDelegate : NSObjectProtocol { @available(watchOS 6.0, *) - @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChangeContentWith diff: CollectionDifference) + optional func controller(_ controller: NSFetchedResultsController, didChangeContentWith diff: CollectionDifference) @available(watchOS 2.0, *) - @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) + optional func controller(_ controller: NSFetchedResultsController, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) @available(watchOS 2.0, *) - @asyncHandler optional func controller(_ controller: NSFetchedResultsController, didChange sectionInfo: NSFetchedResultsSectionInfo, atSectionIndex sectionIndex: Int, for type: NSFetchedResultsChangeType) + optional func controller(_ controller: NSFetchedResultsController, didChange sectionInfo: NSFetchedResultsSectionInfo, atSectionIndex sectionIndex: Int, for type: NSFetchedResultsChangeType) @available(watchOS 2.0, *) optional func controllerWillChangeContent(_ controller: NSFetchedResultsController) @available(watchOS 2.0, *) - @asyncHandler optional func controllerDidChangeContent(_ controller: NSFetchedResultsController) + optional func controllerDidChangeContent(_ controller: NSFetchedResultsController) @available(watchOS 2.0, *) optional func controller(_ controller: NSFetchedResultsController, sectionIndexTitleForSectionName sectionName: String) -> String? } diff --git a/watchOS/CoreLocation/CLLocationManagerDelegate.swift b/watchOS/CoreLocation/CLLocationManagerDelegate.swift index 5df2a28..778cd88 100644 --- a/watchOS/CoreLocation/CLLocationManagerDelegate.swift +++ b/watchOS/CoreLocation/CLLocationManagerDelegate.swift @@ -1,15 +1,15 @@ protocol CLLocationManagerDelegate : NSObjectProtocol { @available(watchOS 2.0, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) + optional func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) @available(watchOS 2.0, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) + optional func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) @available(watchOS 2.0, *) optional func locationManagerShouldDisplayHeadingCalibration(_ manager: CLLocationManager) -> Bool @available(watchOS 2.0, *) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) + optional func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) @available(watchOS, introduced: 1.0, deprecated: 7.0) - @asyncHandler optional func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) + optional func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) @available(watchOS 7.0, *) - @asyncHandler optional func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) + optional func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) } diff --git a/watchOS/CoreMotion/CMHeadphoneMotionManagerDelegate.swift b/watchOS/CoreMotion/CMHeadphoneMotionManagerDelegate.swift index 60cab6f..cf3c51a 100644 --- a/watchOS/CoreMotion/CMHeadphoneMotionManagerDelegate.swift +++ b/watchOS/CoreMotion/CMHeadphoneMotionManagerDelegate.swift @@ -1,6 +1,6 @@ @available(watchOS 7.0, *) protocol CMHeadphoneMotionManagerDelegate : NSObjectProtocol { - @asyncHandler optional func headphoneMotionManagerDidConnect(_ manager: CMHeadphoneMotionManager) - @asyncHandler optional func headphoneMotionManagerDidDisconnect(_ manager: CMHeadphoneMotionManager) + optional func headphoneMotionManagerDidConnect(_ manager: CMHeadphoneMotionManager) + optional func headphoneMotionManagerDidDisconnect(_ manager: CMHeadphoneMotionManager) } diff --git a/watchOS/Foundation/NSFilePresenter.swift b/watchOS/Foundation/NSFilePresenter.swift index 8f74420..3a01197 100644 --- a/watchOS/Foundation/NSFilePresenter.swift +++ b/watchOS/Foundation/NSFilePresenter.swift @@ -9,23 +9,23 @@ protocol NSFilePresenter : NSObjectProtocol { optional func savePresentedItemChanges() async throws optional func accommodatePresentedItemDeletion(completionHandler: @escaping (Error?) -> Void) optional func accommodatePresentedItemDeletion() async throws - @asyncHandler optional func presentedItemDidMove(to newURL: URL) - @asyncHandler optional func presentedItemDidChange() + optional func presentedItemDidMove(to newURL: URL) + optional func presentedItemDidChange() @available(watchOS 2.0, *) - @asyncHandler optional func presentedItemDidGain(_ version: NSFileVersion) + optional func presentedItemDidGain(_ version: NSFileVersion) @available(watchOS 2.0, *) - @asyncHandler optional func presentedItemDidLose(_ version: NSFileVersion) + optional func presentedItemDidLose(_ version: NSFileVersion) @available(watchOS 2.0, *) - @asyncHandler optional func presentedItemDidResolveConflict(_ version: NSFileVersion) + optional func presentedItemDidResolveConflict(_ version: NSFileVersion) optional func accommodatePresentedSubitemDeletion(at url: URL, completionHandler: @escaping (Error?) -> Void) optional func accommodatePresentedSubitemDeletion(at url: URL) async throws - @asyncHandler optional func presentedSubitemDidAppear(at url: URL) - @asyncHandler optional func presentedSubitem(at oldURL: URL, didMoveTo newURL: URL) - @asyncHandler optional func presentedSubitemDidChange(at url: URL) + optional func presentedSubitemDidAppear(at url: URL) + optional func presentedSubitem(at oldURL: URL, didMoveTo newURL: URL) + optional func presentedSubitemDidChange(at url: URL) @available(watchOS 2.0, *) - @asyncHandler optional func presentedSubitem(at url: URL, didGain version: NSFileVersion) + optional func presentedSubitem(at url: URL, didGain version: NSFileVersion) @available(watchOS 2.0, *) - @asyncHandler optional func presentedSubitem(at url: URL, didLose version: NSFileVersion) + optional func presentedSubitem(at url: URL, didLose version: NSFileVersion) @available(watchOS 2.0, *) - @asyncHandler optional func presentedSubitem(at url: URL, didResolve version: NSFileVersion) + optional func presentedSubitem(at url: URL, didResolve version: NSFileVersion) } diff --git a/watchOS/Foundation/NSKeyedArchiver.swift b/watchOS/Foundation/NSKeyedArchiver.swift index 32403dd..0cf8f46 100644 --- a/watchOS/Foundation/NSKeyedArchiver.swift +++ b/watchOS/Foundation/NSKeyedArchiver.swift @@ -80,17 +80,17 @@ extension NSKeyedUnarchiver { } protocol NSKeyedArchiverDelegate : NSObjectProtocol { optional func archiver(_ archiver: NSKeyedArchiver, willEncode object: Any) -> Any? - @asyncHandler optional func archiver(_ archiver: NSKeyedArchiver, didEncode object: Any?) + optional func archiver(_ archiver: NSKeyedArchiver, didEncode object: Any?) optional func archiver(_ archiver: NSKeyedArchiver, willReplace object: Any?, with newObject: Any?) optional func archiverWillFinish(_ archiver: NSKeyedArchiver) - @asyncHandler optional func archiverDidFinish(_ archiver: NSKeyedArchiver) + optional func archiverDidFinish(_ archiver: NSKeyedArchiver) } protocol NSKeyedUnarchiverDelegate : NSObjectProtocol { optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, cannotDecodeObjectOfClassName name: String, originalClasses classNames: [String]) -> AnyClass? optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, didDecode object: Any?) -> Any? optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, willReplace object: Any, with newObject: Any) optional func unarchiverWillFinish(_ unarchiver: NSKeyedUnarchiver) - @asyncHandler optional func unarchiverDidFinish(_ unarchiver: NSKeyedUnarchiver) + optional func unarchiverDidFinish(_ unarchiver: NSKeyedUnarchiver) } extension NSObject { var classForKeyedArchiver: AnyClass? { get } diff --git a/watchOS/Foundation/NSURLConnection.swift b/watchOS/Foundation/NSURLConnection.swift index 0e0d28c..3c395f4 100644 --- a/watchOS/Foundation/NSURLConnection.swift +++ b/watchOS/Foundation/NSURLConnection.swift @@ -18,31 +18,31 @@ class NSURLConnection : NSObject { } @available(watchOS 2.0, *) protocol NSURLConnectionDelegate : NSObjectProtocol { - @asyncHandler optional func connection(_ connection: NSURLConnection, didFailWithError error: Error) + optional func connection(_ connection: NSURLConnection, didFailWithError error: Error) optional func connectionShouldUseCredentialStorage(_ connection: NSURLConnection) -> Bool optional func connection(_ connection: NSURLConnection, willSendRequestFor challenge: URLAuthenticationChallenge) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") optional func connection(_ connection: NSURLConnection, canAuthenticateAgainstProtectionSpace protectionSpace: URLProtectionSpace) -> Bool @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") - @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive challenge: URLAuthenticationChallenge) + optional func connection(_ connection: NSURLConnection, didReceive challenge: URLAuthenticationChallenge) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use -connection:willSendRequestForAuthenticationChallenge: instead.") - @asyncHandler optional func connection(_ connection: NSURLConnection, didCancel challenge: URLAuthenticationChallenge) + optional func connection(_ connection: NSURLConnection, didCancel challenge: URLAuthenticationChallenge) } @available(watchOS 2.0, *) protocol NSURLConnectionDataDelegate : NSURLConnectionDelegate { optional func connection(_ connection: NSURLConnection, willSend request: URLRequest, redirectResponse response: URLResponse?) -> URLRequest? - @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive response: URLResponse) - @asyncHandler optional func connection(_ connection: NSURLConnection, didReceive data: Data) + optional func connection(_ connection: NSURLConnection, didReceive response: URLResponse) + optional func connection(_ connection: NSURLConnection, didReceive data: Data) optional func connection(_ connection: NSURLConnection, needNewBodyStream request: URLRequest) -> InputStream? - @asyncHandler optional func connection(_ connection: NSURLConnection, didSendBodyData bytesWritten: Int, totalBytesWritten: Int, totalBytesExpectedToWrite: Int) + optional func connection(_ connection: NSURLConnection, didSendBodyData bytesWritten: Int, totalBytesWritten: Int, totalBytesExpectedToWrite: Int) optional func connection(_ connection: NSURLConnection, willCacheResponse cachedResponse: CachedURLResponse) -> CachedURLResponse? - @asyncHandler optional func connectionDidFinishLoading(_ connection: NSURLConnection) + optional func connectionDidFinishLoading(_ connection: NSURLConnection) } @available(watchOS 2.0, *) protocol NSURLConnectionDownloadDelegate : NSURLConnectionDelegate { - @asyncHandler optional func connection(_ connection: NSURLConnection, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, expectedTotalBytes: Int64) - @asyncHandler optional func connectionDidResumeDownloading(_ connection: NSURLConnection, totalBytesWritten: Int64, expectedTotalBytes: Int64) - @asyncHandler func connectionDidFinishDownloading(_ connection: NSURLConnection, destinationURL: URL) + optional func connection(_ connection: NSURLConnection, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, expectedTotalBytes: Int64) + optional func connectionDidResumeDownloading(_ connection: NSURLConnection, totalBytesWritten: Int64, expectedTotalBytes: Int64) + func connectionDidFinishDownloading(_ connection: NSURLConnection, destinationURL: URL) } extension NSURLConnection { } diff --git a/watchOS/Foundation/NSURLProtocol.swift b/watchOS/Foundation/NSURLProtocol.swift index 3def2f6..90e7fbc 100644 --- a/watchOS/Foundation/NSURLProtocol.swift +++ b/watchOS/Foundation/NSURLProtocol.swift @@ -3,12 +3,12 @@ protocol URLProtocolClient : NSObjectProtocol { func urlProtocol(_ protocol: URLProtocol, wasRedirectedTo request: URLRequest, redirectResponse: URLResponse) func urlProtocol(_ protocol: URLProtocol, cachedResponseIsValid cachedResponse: CachedURLResponse) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didReceive response: URLResponse, cacheStoragePolicy policy: URLCache.StoragePolicy) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didLoad data: Data) - @asyncHandler func urlProtocolDidFinishLoading(_ protocol: URLProtocol) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didFailWithError error: Error) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didReceive challenge: URLAuthenticationChallenge) - @asyncHandler func urlProtocol(_ protocol: URLProtocol, didCancel challenge: URLAuthenticationChallenge) + func urlProtocol(_ protocol: URLProtocol, didReceive response: URLResponse, cacheStoragePolicy policy: URLCache.StoragePolicy) + func urlProtocol(_ protocol: URLProtocol, didLoad data: Data) + func urlProtocolDidFinishLoading(_ protocol: URLProtocol) + func urlProtocol(_ protocol: URLProtocol, didFailWithError error: Error) + func urlProtocol(_ protocol: URLProtocol, didReceive challenge: URLAuthenticationChallenge) + func urlProtocol(_ protocol: URLProtocol, didCancel challenge: URLAuthenticationChallenge) } @available(watchOS 2.0, *) class URLProtocol : NSObject { diff --git a/watchOS/Foundation/NSURLSession.swift b/watchOS/Foundation/NSURLSession.swift index 04803b8..d9bb823 100644 --- a/watchOS/Foundation/NSURLSession.swift +++ b/watchOS/Foundation/NSURLSession.swift @@ -272,11 +272,11 @@ extension URLSession { } @available(watchOS 2.0, *) protocol URLSessionDelegate : NSObjectProtocol { - @asyncHandler optional func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) - @asyncHandler optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) + optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) optional func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) @available(watchOS 2.0, *) - @asyncHandler optional func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) + optional func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) } @available(watchOS 2.0, *) protocol URLSessionTaskDelegate : URLSessionDelegate { @@ -288,43 +288,43 @@ protocol URLSessionTaskDelegate : URLSessionDelegate { optional func urlSession(_ session: URLSession, taskIsWaitingForConnectivity task: URLSessionTask) optional func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest, completionHandler: @escaping (URLRequest?) -> Void) optional func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest) async -> URLRequest? - @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) optional func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) optional func urlSession(_ session: URLSession, task: URLSessionTask, needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) optional func urlSession(_ session: URLSession, task: URLSessionTask) async -> InputStream? - @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) @available(watchOS 3.0, *) - @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) - @asyncHandler optional func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) + optional func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) } @available(watchOS 2.0, *) protocol URLSessionDataDelegate : URLSessionTaskDelegate { - @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse) async -> URLSession.ResponseDisposition - @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome downloadTask: URLSessionDownloadTask) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome downloadTask: URLSessionDownloadTask) @available(watchOS 2.0, *) - @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome streamTask: URLSessionStreamTask) - @asyncHandler optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome streamTask: URLSessionStreamTask) + optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse, completionHandler: @escaping (CachedURLResponse?) -> Void) optional func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse) async -> CachedURLResponse? } @available(watchOS 2.0, *) protocol URLSessionDownloadDelegate : URLSessionTaskDelegate { - @asyncHandler func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) - @asyncHandler optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) - @asyncHandler optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) + func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) + optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) + optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) } @available(watchOS 2.0, *) protocol URLSessionStreamDelegate : URLSessionTaskDelegate { optional func urlSession(_ session: URLSession, readClosedFor streamTask: URLSessionStreamTask) optional func urlSession(_ session: URLSession, writeClosedFor streamTask: URLSessionStreamTask) optional func urlSession(_ session: URLSession, betterRouteDiscoveredFor streamTask: URLSessionStreamTask) - @asyncHandler optional func urlSession(_ session: URLSession, streamTask: URLSessionStreamTask, didBecome inputStream: InputStream, outputStream: OutputStream) + optional func urlSession(_ session: URLSession, streamTask: URLSessionStreamTask, didBecome inputStream: InputStream, outputStream: OutputStream) } @available(watchOS 6.0, *) protocol URLSessionWebSocketDelegate : URLSessionTaskDelegate { - @asyncHandler optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) - @asyncHandler optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) + optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) + optional func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) } @available(watchOS 2.0, *) let NSURLSessionDownloadTaskResumeData: String diff --git a/watchOS/Foundation/NSUserActivity.swift b/watchOS/Foundation/NSUserActivity.swift index 5ed659b..31d18cc 100644 --- a/watchOS/Foundation/NSUserActivity.swift +++ b/watchOS/Foundation/NSUserActivity.swift @@ -51,5 +51,5 @@ let NSUserActivityTypeBrowsingWeb: String protocol NSUserActivityDelegate : NSObjectProtocol { optional func userActivityWillSave(_ userActivity: NSUserActivity) optional func userActivityWasContinued(_ userActivity: NSUserActivity) - @asyncHandler optional func userActivity(_ userActivity: NSUserActivity, didReceive inputStream: InputStream, outputStream: OutputStream) + optional func userActivity(_ userActivity: NSUserActivity, didReceive inputStream: InputStream, outputStream: OutputStream) } diff --git a/watchOS/Foundation/NSXMLParser.swift b/watchOS/Foundation/NSXMLParser.swift index c4dfafa..cff8f83 100644 --- a/watchOS/Foundation/NSXMLParser.swift +++ b/watchOS/Foundation/NSXMLParser.swift @@ -23,18 +23,18 @@ extension XMLParser { var columnNumber: Int { get } } protocol XMLParserDelegate : NSObjectProtocol { - @asyncHandler optional func parserDidStartDocument(_ parser: XMLParser) - @asyncHandler optional func parserDidEndDocument(_ parser: XMLParser) + optional func parserDidStartDocument(_ parser: XMLParser) + optional func parserDidEndDocument(_ parser: XMLParser) optional func parser(_ parser: XMLParser, foundNotationDeclarationWithName name: String, publicID: String?, systemID: String?) optional func parser(_ parser: XMLParser, foundUnparsedEntityDeclarationWithName name: String, publicID: String?, systemID: String?, notationName: String?) optional func parser(_ parser: XMLParser, foundAttributeDeclarationWithName attributeName: String, forElement elementName: String, type: String?, defaultValue: String?) optional func parser(_ parser: XMLParser, foundElementDeclarationWithName elementName: String, model: String) optional func parser(_ parser: XMLParser, foundInternalEntityDeclarationWithName name: String, value: String?) optional func parser(_ parser: XMLParser, foundExternalEntityDeclarationWithName name: String, publicID: String?, systemID: String?) - @asyncHandler optional func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) - @asyncHandler optional func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) - @asyncHandler optional func parser(_ parser: XMLParser, didStartMappingPrefix prefix: String, toURI namespaceURI: String) - @asyncHandler optional func parser(_ parser: XMLParser, didEndMappingPrefix prefix: String) + optional func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) + optional func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) + optional func parser(_ parser: XMLParser, didStartMappingPrefix prefix: String, toURI namespaceURI: String) + optional func parser(_ parser: XMLParser, didEndMappingPrefix prefix: String) optional func parser(_ parser: XMLParser, foundCharacters string: String) optional func parser(_ parser: XMLParser, foundIgnorableWhitespace whitespaceString: String) optional func parser(_ parser: XMLParser, foundProcessingInstructionWithTarget target: String, data: String?) diff --git a/watchOS/GameKit/GKMatchmaker.swift b/watchOS/GameKit/GKMatchmaker.swift index bcfb3ae..14cc17d 100644 --- a/watchOS/GameKit/GKMatchmaker.swift +++ b/watchOS/GameKit/GKMatchmaker.swift @@ -48,7 +48,7 @@ enum GKMatchType : UInt { } protocol GKInviteEventListener { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "This method is obsolete. It will never be invoked its implementation does nothing, use player:didRequestMatchWithRecipients:") - @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithPlayers playerIDsToInvite: [String]) + optional func player(_ player: GKPlayer, didRequestMatchWithPlayers playerIDsToInvite: [String]) } extension GKMatchmaker { @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use registerListener on GKLocalPlayer to register an object that implements the GKInviteEventListenerProtocol instead") diff --git a/watchOS/GameKit/GKPublicProtocols.swift b/watchOS/GameKit/GKPublicProtocols.swift index 82b37fd..53bf283 100644 --- a/watchOS/GameKit/GKPublicProtocols.swift +++ b/watchOS/GameKit/GKPublicProtocols.swift @@ -1,18 +1,18 @@ @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use MCSession in association with MCSessionDelegate from the MultipeerConnectivity framework instead") protocol GKSessionDelegate : NSObjectProtocol { - @asyncHandler optional func session(_ session: GKSession, peer peerID: String, didChange state: GKPeerConnectionState) - @asyncHandler optional func session(_ session: GKSession, didReceiveConnectionRequestFromPeer peerID: String) + optional func session(_ session: GKSession, peer peerID: String, didChange state: GKPeerConnectionState) + optional func session(_ session: GKSession, didReceiveConnectionRequestFromPeer peerID: String) optional func session(_ session: GKSession, connectionWithPeerFailed peerID: String, withError error: Error) - @asyncHandler optional func session(_ session: GKSession, didFailWithError error: Error) + optional func session(_ session: GKSession, didFailWithError error: Error) } @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "Use GKVoiceChat instead") protocol GKVoiceChatClient : NSObjectProtocol { func voiceChatService(_ voiceChatService: GKVoiceChatService, send data: Data, toParticipantID participantID: String) func participantID() -> String optional func voiceChatService(_ voiceChatService: GKVoiceChatService, sendRealTime data: Data, toParticipantID participantID: String) - @asyncHandler optional func voiceChatService(_ voiceChatService: GKVoiceChatService, didStartWithParticipantID participantID: String) - @asyncHandler optional func voiceChatService(_ voiceChatService: GKVoiceChatService, didNotStartWithParticipantID participantID: String, error: Error?) - @asyncHandler optional func voiceChatService(_ voiceChatService: GKVoiceChatService, didStopWithParticipantID participantID: String, error: Error?) - @asyncHandler optional func voiceChatService(_ voiceChatService: GKVoiceChatService, didReceiveInvitationFromParticipantID participantID: String, callID: Int) + optional func voiceChatService(_ voiceChatService: GKVoiceChatService, didStartWithParticipantID participantID: String) + optional func voiceChatService(_ voiceChatService: GKVoiceChatService, didNotStartWithParticipantID participantID: String, error: Error?) + optional func voiceChatService(_ voiceChatService: GKVoiceChatService, didStopWithParticipantID participantID: String, error: Error?) + optional func voiceChatService(_ voiceChatService: GKVoiceChatService, didReceiveInvitationFromParticipantID participantID: String, callID: Int) } diff --git a/watchOS/GameKit/GKTurnBasedMatch.swift b/watchOS/GameKit/GKTurnBasedMatch.swift index c254837..32a7127 100644 --- a/watchOS/GameKit/GKTurnBasedMatch.swift +++ b/watchOS/GameKit/GKTurnBasedMatch.swift @@ -52,7 +52,7 @@ extension GKTurnBasedParticipant { } protocol GKTurnBasedEventListener { @available(watchOS 3.0, *) - @asyncHandler optional func player(_ player: GKPlayer, receivedTurnEventFor match: GKTurnBasedMatch, didBecomeActive: Bool) + optional func player(_ player: GKPlayer, receivedTurnEventFor match: GKTurnBasedMatch, didBecomeActive: Bool) @available(watchOS 3.0, *) optional func player(_ player: GKPlayer, matchEnded match: GKTurnBasedMatch) @available(watchOS 3.0, *) @@ -64,7 +64,7 @@ protocol GKTurnBasedEventListener { @available(watchOS 3.0, *) optional func player(_ player: GKPlayer, wantsToQuitMatch match: GKTurnBasedMatch) @available(watchOS, introduced: 2.0, deprecated: 2.0, message: "use didRequestMatchWithOtherPlayers") - @asyncHandler optional func player(_ player: GKPlayer, didRequestMatchWithPlayers playerIDsToInvite: [String]) + optional func player(_ player: GKPlayer, didRequestMatchWithPlayers playerIDsToInvite: [String]) } @available(watchOS 3.0, *) var GKTurnTimeoutDefault: TimeInterval @@ -210,7 +210,7 @@ protocol GKTurnBasedEventHandlerDelegate { @available(watchOS, introduced: 2.0, deprecated: 2.0) func handleInvite(fromGameCenter playersToInvite: [String]) @available(watchOS, introduced: 2.0, deprecated: 2.0) - @asyncHandler func handleTurnEvent(for match: GKTurnBasedMatch, didBecomeActive: Bool) + func handleTurnEvent(for match: GKTurnBasedMatch, didBecomeActive: Bool) @available(watchOS, introduced: 2.0, deprecated: 2.0) optional func handleTurnEvent(for match: GKTurnBasedMatch) @available(watchOS, introduced: 2.0, deprecated: 2.0) diff --git a/watchOS/HealthKit/HKLiveWorkoutBuilder.swift b/watchOS/HealthKit/HKLiveWorkoutBuilder.swift index b3a548b..1a22b20 100644 --- a/watchOS/HealthKit/HKLiveWorkoutBuilder.swift +++ b/watchOS/HealthKit/HKLiveWorkoutBuilder.swift @@ -1,8 +1,8 @@ @available(watchOS 5.0, *) protocol HKLiveWorkoutBuilderDelegate : NSObjectProtocol { - @asyncHandler func workoutBuilder(_ workoutBuilder: HKLiveWorkoutBuilder, didCollectDataOf collectedTypes: Set) - @asyncHandler func workoutBuilderDidCollectEvent(_ workoutBuilder: HKLiveWorkoutBuilder) + func workoutBuilder(_ workoutBuilder: HKLiveWorkoutBuilder, didCollectDataOf collectedTypes: Set) + func workoutBuilderDidCollectEvent(_ workoutBuilder: HKLiveWorkoutBuilder) } @available(watchOS 5.0, *) class HKLiveWorkoutBuilder : HKWorkoutBuilder { diff --git a/watchOS/HealthKit/HKWorkoutSession.swift b/watchOS/HealthKit/HKWorkoutSession.swift index 1f5b0d3..eb99727 100644 --- a/watchOS/HealthKit/HKWorkoutSession.swift +++ b/watchOS/HealthKit/HKWorkoutSession.swift @@ -48,8 +48,8 @@ class HKWorkoutSession : NSObject, NSSecureCoding { } @available(watchOS 2.0, *) protocol HKWorkoutSessionDelegate : NSObjectProtocol { - @asyncHandler func workoutSession(_ workoutSession: HKWorkoutSession, didChangeTo toState: HKWorkoutSessionState, from fromState: HKWorkoutSessionState, date: Date) - @asyncHandler func workoutSession(_ workoutSession: HKWorkoutSession, didFailWithError error: Error) + func workoutSession(_ workoutSession: HKWorkoutSession, didChangeTo toState: HKWorkoutSessionState, from fromState: HKWorkoutSessionState, date: Date) + func workoutSession(_ workoutSession: HKWorkoutSession, didFailWithError error: Error) @available(watchOS 3.0, *) - @asyncHandler optional func workoutSession(_ workoutSession: HKWorkoutSession, didGenerate event: HKWorkoutEvent) + optional func workoutSession(_ workoutSession: HKWorkoutSession, didGenerate event: HKWorkoutEvent) } diff --git a/watchOS/HomeKit/HMAccessory.swift b/watchOS/HomeKit/HMAccessory.swift index e34f6a9..6d62b17 100644 --- a/watchOS/HomeKit/HMAccessory.swift +++ b/watchOS/HomeKit/HMAccessory.swift @@ -29,16 +29,16 @@ class HMAccessory : NSObject { } @available(watchOS 2.0, *) protocol HMAccessoryDelegate : NSObjectProtocol { - @asyncHandler optional func accessoryDidUpdateName(_ accessory: HMAccessory) - @asyncHandler optional func accessory(_ accessory: HMAccessory, didUpdateNameFor service: HMService) - @asyncHandler optional func accessory(_ accessory: HMAccessory, didUpdateAssociatedServiceTypeFor service: HMService) - @asyncHandler optional func accessoryDidUpdateServices(_ accessory: HMAccessory) + optional func accessoryDidUpdateName(_ accessory: HMAccessory) + optional func accessory(_ accessory: HMAccessory, didUpdateNameFor service: HMService) + optional func accessory(_ accessory: HMAccessory, didUpdateAssociatedServiceTypeFor service: HMService) + optional func accessoryDidUpdateServices(_ accessory: HMAccessory) @available(watchOS 4.0, *) - @asyncHandler optional func accessory(_ accessory: HMAccessory, didAdd profile: HMAccessoryProfile) + optional func accessory(_ accessory: HMAccessory, didAdd profile: HMAccessoryProfile) @available(watchOS 4.0, *) - @asyncHandler optional func accessory(_ accessory: HMAccessory, didRemove profile: HMAccessoryProfile) - @asyncHandler optional func accessoryDidUpdateReachability(_ accessory: HMAccessory) - @asyncHandler optional func accessory(_ accessory: HMAccessory, service: HMService, didUpdateValueFor characteristic: HMCharacteristic) + optional func accessory(_ accessory: HMAccessory, didRemove profile: HMAccessoryProfile) + optional func accessoryDidUpdateReachability(_ accessory: HMAccessory) + optional func accessory(_ accessory: HMAccessory, service: HMService, didUpdateValueFor characteristic: HMCharacteristic) @available(watchOS 4.0, *) - @asyncHandler optional func accessory(_ accessory: HMAccessory, didUpdateFirmwareVersion firmwareVersion: String) + optional func accessory(_ accessory: HMAccessory, didUpdateFirmwareVersion firmwareVersion: String) } diff --git a/watchOS/HomeKit/HMCameraSnapshotControl.swift b/watchOS/HomeKit/HMCameraSnapshotControl.swift index 4e5eebd..0744f19 100644 --- a/watchOS/HomeKit/HMCameraSnapshotControl.swift +++ b/watchOS/HomeKit/HMCameraSnapshotControl.swift @@ -7,6 +7,6 @@ class HMCameraSnapshotControl : HMCameraControl { } @available(watchOS 3.0, *) protocol HMCameraSnapshotControlDelegate : NSObjectProtocol { - @asyncHandler optional func cameraSnapshotControl(_ cameraSnapshotControl: HMCameraSnapshotControl, didTake snapshot: HMCameraSnapshot?, error: Error?) - @asyncHandler optional func cameraSnapshotControlDidUpdateMostRecentSnapshot(_ cameraSnapshotControl: HMCameraSnapshotControl) + optional func cameraSnapshotControl(_ cameraSnapshotControl: HMCameraSnapshotControl, didTake snapshot: HMCameraSnapshot?, error: Error?) + optional func cameraSnapshotControlDidUpdateMostRecentSnapshot(_ cameraSnapshotControl: HMCameraSnapshotControl) } diff --git a/watchOS/HomeKit/HMCameraStreamControl.swift b/watchOS/HomeKit/HMCameraStreamControl.swift index f54301a..2d296bb 100644 --- a/watchOS/HomeKit/HMCameraStreamControl.swift +++ b/watchOS/HomeKit/HMCameraStreamControl.swift @@ -9,6 +9,6 @@ class HMCameraStreamControl : HMCameraControl { } @available(watchOS 3.0, *) protocol HMCameraStreamControlDelegate : NSObjectProtocol { - @asyncHandler optional func cameraStreamControlDidStartStream(_ cameraStreamControl: HMCameraStreamControl) - @asyncHandler optional func cameraStreamControl(_ cameraStreamControl: HMCameraStreamControl, didStopStreamWithError error: Error?) + optional func cameraStreamControlDidStartStream(_ cameraStreamControl: HMCameraStreamControl) + optional func cameraStreamControl(_ cameraStreamControl: HMCameraStreamControl, didStopStreamWithError error: Error?) } diff --git a/watchOS/HomeKit/HMHome.swift b/watchOS/HomeKit/HMHome.swift index eced495..625f5a1 100644 --- a/watchOS/HomeKit/HMHome.swift +++ b/watchOS/HomeKit/HMHome.swift @@ -51,41 +51,41 @@ extension HMHome { } @available(watchOS 2.0, *) protocol HMHomeDelegate : NSObjectProtocol { - @asyncHandler optional func homeDidUpdateName(_ home: HMHome) + optional func homeDidUpdateName(_ home: HMHome) @available(watchOS 4.0, *) - @asyncHandler optional func homeDidUpdateAccessControl(forCurrentUser home: HMHome) - @asyncHandler optional func home(_ home: HMHome, didAdd accessory: HMAccessory) - @asyncHandler optional func home(_ home: HMHome, didRemove accessory: HMAccessory) - @asyncHandler optional func home(_ home: HMHome, didAdd user: HMUser) - @asyncHandler optional func home(_ home: HMHome, didRemove user: HMUser) - @asyncHandler optional func home(_ home: HMHome, didUpdate room: HMRoom, for accessory: HMAccessory) - @asyncHandler optional func home(_ home: HMHome, didAdd room: HMRoom) - @asyncHandler optional func home(_ home: HMHome, didRemove room: HMRoom) - @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor room: HMRoom) - @asyncHandler optional func home(_ home: HMHome, didAdd zone: HMZone) - @asyncHandler optional func home(_ home: HMHome, didRemove zone: HMZone) - @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor zone: HMZone) - @asyncHandler optional func home(_ home: HMHome, didAdd room: HMRoom, to zone: HMZone) - @asyncHandler optional func home(_ home: HMHome, didRemove room: HMRoom, from zone: HMZone) - @asyncHandler optional func home(_ home: HMHome, didAdd group: HMServiceGroup) - @asyncHandler optional func home(_ home: HMHome, didRemove group: HMServiceGroup) - @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor group: HMServiceGroup) - @asyncHandler optional func home(_ home: HMHome, didAdd service: HMService, to group: HMServiceGroup) - @asyncHandler optional func home(_ home: HMHome, didRemove service: HMService, from group: HMServiceGroup) - @asyncHandler optional func home(_ home: HMHome, didAdd actionSet: HMActionSet) - @asyncHandler optional func home(_ home: HMHome, didRemove actionSet: HMActionSet) - @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor actionSet: HMActionSet) - @asyncHandler optional func home(_ home: HMHome, didUpdateActionsFor actionSet: HMActionSet) - @asyncHandler optional func home(_ home: HMHome, didAdd trigger: HMTrigger) - @asyncHandler optional func home(_ home: HMHome, didRemove trigger: HMTrigger) - @asyncHandler optional func home(_ home: HMHome, didUpdateNameFor trigger: HMTrigger) - @asyncHandler optional func home(_ home: HMHome, didUpdate trigger: HMTrigger) - @asyncHandler optional func home(_ home: HMHome, didUnblockAccessory accessory: HMAccessory) - @asyncHandler optional func home(_ home: HMHome, didEncounterError error: Error, for accessory: HMAccessory) + optional func homeDidUpdateAccessControl(forCurrentUser home: HMHome) + optional func home(_ home: HMHome, didAdd accessory: HMAccessory) + optional func home(_ home: HMHome, didRemove accessory: HMAccessory) + optional func home(_ home: HMHome, didAdd user: HMUser) + optional func home(_ home: HMHome, didRemove user: HMUser) + optional func home(_ home: HMHome, didUpdate room: HMRoom, for accessory: HMAccessory) + optional func home(_ home: HMHome, didAdd room: HMRoom) + optional func home(_ home: HMHome, didRemove room: HMRoom) + optional func home(_ home: HMHome, didUpdateNameFor room: HMRoom) + optional func home(_ home: HMHome, didAdd zone: HMZone) + optional func home(_ home: HMHome, didRemove zone: HMZone) + optional func home(_ home: HMHome, didUpdateNameFor zone: HMZone) + optional func home(_ home: HMHome, didAdd room: HMRoom, to zone: HMZone) + optional func home(_ home: HMHome, didRemove room: HMRoom, from zone: HMZone) + optional func home(_ home: HMHome, didAdd group: HMServiceGroup) + optional func home(_ home: HMHome, didRemove group: HMServiceGroup) + optional func home(_ home: HMHome, didUpdateNameFor group: HMServiceGroup) + optional func home(_ home: HMHome, didAdd service: HMService, to group: HMServiceGroup) + optional func home(_ home: HMHome, didRemove service: HMService, from group: HMServiceGroup) + optional func home(_ home: HMHome, didAdd actionSet: HMActionSet) + optional func home(_ home: HMHome, didRemove actionSet: HMActionSet) + optional func home(_ home: HMHome, didUpdateNameFor actionSet: HMActionSet) + optional func home(_ home: HMHome, didUpdateActionsFor actionSet: HMActionSet) + optional func home(_ home: HMHome, didAdd trigger: HMTrigger) + optional func home(_ home: HMHome, didRemove trigger: HMTrigger) + optional func home(_ home: HMHome, didUpdateNameFor trigger: HMTrigger) + optional func home(_ home: HMHome, didUpdate trigger: HMTrigger) + optional func home(_ home: HMHome, didUnblockAccessory accessory: HMAccessory) + optional func home(_ home: HMHome, didEncounterError error: Error, for accessory: HMAccessory) @available(watchOS 4.0, *) - @asyncHandler optional func home(_ home: HMHome, didUpdate homeHubState: HMHomeHubState) + optional func home(_ home: HMHome, didUpdate homeHubState: HMHomeHubState) @available(watchOS 6.1, *) - @asyncHandler optional func homeDidUpdateSupportedFeatures(_ home: HMHome) + optional func homeDidUpdateSupportedFeatures(_ home: HMHome) } @available(watchOS 2.0, *) let HMUserFailedAccessoriesKey: String diff --git a/watchOS/HomeKit/HMHomeManager.swift b/watchOS/HomeKit/HMHomeManager.swift index de46a31..8d276c8 100644 --- a/watchOS/HomeKit/HMHomeManager.swift +++ b/watchOS/HomeKit/HMHomeManager.swift @@ -18,9 +18,9 @@ class HMHomeManager : NSObject { @available(watchOS 2.0, *) protocol HMHomeManagerDelegate : NSObjectProtocol { @available(watchOS 6.0, *) - @asyncHandler optional func homeManager(_ manager: HMHomeManager, didUpdate status: HMHomeManagerAuthorizationStatus) - @asyncHandler optional func homeManagerDidUpdateHomes(_ manager: HMHomeManager) - @asyncHandler optional func homeManagerDidUpdatePrimaryHome(_ manager: HMHomeManager) - @asyncHandler optional func homeManager(_ manager: HMHomeManager, didAdd home: HMHome) - @asyncHandler optional func homeManager(_ manager: HMHomeManager, didRemove home: HMHome) + optional func homeManager(_ manager: HMHomeManager, didUpdate status: HMHomeManagerAuthorizationStatus) + optional func homeManagerDidUpdateHomes(_ manager: HMHomeManager) + optional func homeManagerDidUpdatePrimaryHome(_ manager: HMHomeManager) + optional func homeManager(_ manager: HMHomeManager, didAdd home: HMHome) + optional func homeManager(_ manager: HMHomeManager, didRemove home: HMHome) } diff --git a/watchOS/HomeKit/HMNetworkConfigurationProfile.swift b/watchOS/HomeKit/HMNetworkConfigurationProfile.swift index 78e55ce..142d563 100644 --- a/watchOS/HomeKit/HMNetworkConfigurationProfile.swift +++ b/watchOS/HomeKit/HMNetworkConfigurationProfile.swift @@ -6,5 +6,5 @@ class HMNetworkConfigurationProfile : HMAccessoryProfile { } @available(watchOS 6.0, *) protocol HMNetworkConfigurationProfileDelegate : NSObjectProtocol { - @asyncHandler optional func profileDidUpdateNetworkAccessMode(_ profile: HMNetworkConfigurationProfile) + optional func profileDidUpdateNetworkAccessMode(_ profile: HMNetworkConfigurationProfile) } diff --git a/watchOS/Intents/INGetRideStatusIntent.swift b/watchOS/Intents/INGetRideStatusIntent.swift index 2733c9d..9c6cb24 100644 --- a/watchOS/Intents/INGetRideStatusIntent.swift +++ b/watchOS/Intents/INGetRideStatusIntent.swift @@ -13,5 +13,5 @@ protocol INGetRideStatusIntentHandling : NSObjectProtocol { } @available(watchOS 3.2, *) protocol INGetRideStatusIntentResponseObserver : NSObjectProtocol { - @asyncHandler func didUpdate(getRideStatus response: INGetRideStatusIntentResponse) + func didUpdate(getRideStatus response: INGetRideStatusIntentResponse) } diff --git a/watchOS/PassKit/PKPaymentAuthorizationController.swift b/watchOS/PassKit/PKPaymentAuthorizationController.swift index 452fbfe..3847b28 100644 --- a/watchOS/PassKit/PKPaymentAuthorizationController.swift +++ b/watchOS/PassKit/PKPaymentAuthorizationController.swift @@ -1,41 +1,41 @@ protocol PKPaymentAuthorizationControllerDelegate : NSObjectProtocol { @available(watchOS 3.0, *) - @asyncHandler func paymentAuthorizationControllerDidFinish(_ controller: PKPaymentAuthorizationController) + func paymentAuthorizationControllerDidFinish(_ controller: PKPaymentAuthorizationController) @available(watchOS 4.0, *) - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) @available(watchOS 4.0, *) optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationResult @available(watchOS, introduced: 3.0, deprecated: 4.0, message: "Use paymentAuthorizationController:didAuthorizePayment:handler: instead to provide more granular errors") - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) @available(watchOS, introduced: 3.0, deprecated: 4.0, message: "Use paymentAuthorizationController:didAuthorizePayment:handler: instead to provide more granular errors") optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment) async -> PKPaymentAuthorizationStatus @available(watchOS 3.0, *) optional func paymentAuthorizationControllerWillAuthorizePayment(_ controller: PKPaymentAuthorizationController) @available(watchOS 7.0, *) - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) @available(watchOS 4.0, *) - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) @available(watchOS 4.0, *) optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod) async -> PKPaymentRequestShippingMethodUpdate @available(watchOS 4.0, *) - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) @available(watchOS 4.0, *) optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact) async -> PKPaymentRequestShippingContactUpdate @available(watchOS 4.0, *) - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) @available(watchOS 4.0, *) optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod) async -> PKPaymentRequestPaymentMethodUpdate @available(watchOS, introduced: 3.0, deprecated: 4.0, message: "Use paymentAuthorizationController:didSelectShippingMethod:handler: instead to provide more granular errors") - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) @available(watchOS, introduced: 3.0, deprecated: 4.0, message: "Use paymentAuthorizationController:didSelectShippingMethod:handler: instead to provide more granular errors") optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod) async -> (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) @available(watchOS, introduced: 3.0, deprecated: 4.0, message: "Use paymentAuthorizationController:didSelectShippingContact:handler: instead to provide more granular errors") - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) @available(watchOS, introduced: 3.0, deprecated: 4.0, message: "Use paymentAuthorizationController:didSelectShippingContact:handler: instead to provide more granular errors") optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact) async -> (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) @available(watchOS, introduced: 3.0, deprecated: 4.0, message: "Use paymentAuthorizationController:didSelectPaymentMethod:handler: instead to provide more granular errors") - @asyncHandler optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) + optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) @available(watchOS, introduced: 3.0, deprecated: 4.0, message: "Use paymentAuthorizationController:didSelectPaymentMethod:handler: instead to provide more granular errors") optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectPaymentMethod paymentMethod: PKPaymentMethod) async -> [PKPaymentSummaryItem] } diff --git a/watchOS/PushKit/PKPushRegistry.swift b/watchOS/PushKit/PKPushRegistry.swift index ab6aca5..f1edc79 100644 --- a/watchOS/PushKit/PKPushRegistry.swift +++ b/watchOS/PushKit/PKPushRegistry.swift @@ -12,11 +12,11 @@ class PKPushRegistry : NSObject { } protocol PKPushRegistryDelegate : NSObjectProtocol { @available(watchOS 6.0, *) - @asyncHandler func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) + func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) @available(watchOS 6.0, *) - @asyncHandler optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) + optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) @available(watchOS 6.0, *) optional func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType) async @available(watchOS 6.0, *) - @asyncHandler optional func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType) + optional func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType) } diff --git a/watchOS/SceneKit/SCNCameraController.swift b/watchOS/SceneKit/SCNCameraController.swift index 9675215..81c9a93 100644 --- a/watchOS/SceneKit/SCNCameraController.swift +++ b/watchOS/SceneKit/SCNCameraController.swift @@ -14,7 +14,7 @@ enum SCNInteractionMode : Int { @available(watchOS 4.0, *) protocol SCNCameraControllerDelegate : NSObjectProtocol { optional func cameraInertiaWillStart(for cameraController: SCNCameraController) - @asyncHandler optional func cameraInertiaDidEnd(for cameraController: SCNCameraController) + optional func cameraInertiaDidEnd(for cameraController: SCNCameraController) } @available(watchOS 4.0, *) class SCNCameraController : NSObject { diff --git a/watchOS/SceneKit/SCNConstraint.swift b/watchOS/SceneKit/SCNConstraint.swift index 023fb4e..b66a20c 100644 --- a/watchOS/SceneKit/SCNConstraint.swift +++ b/watchOS/SceneKit/SCNConstraint.swift @@ -78,7 +78,7 @@ class SCNSliderConstraint : SCNConstraint { @available(watchOS 4.0, *) protocol SCNAvoidOccluderConstraintDelegate : NSObjectProtocol { optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, shouldAvoidOccluder occluder: SCNNode, for node: SCNNode) -> Bool - @asyncHandler optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, didAvoidOccluder occluder: SCNNode, for node: SCNNode) + optional func avoidOccluderConstraint(_ constraint: SCNAvoidOccluderConstraint, didAvoidOccluder occluder: SCNNode, for node: SCNNode) } @available(watchOS 4.0, *) class SCNAvoidOccluderConstraint : SCNConstraint { diff --git a/watchOS/SceneKit/SCNPhysicsWorld.swift b/watchOS/SceneKit/SCNPhysicsWorld.swift index 49f7d9b..74bf4d8 100644 --- a/watchOS/SceneKit/SCNPhysicsWorld.swift +++ b/watchOS/SceneKit/SCNPhysicsWorld.swift @@ -22,9 +22,9 @@ extension SCNPhysicsWorld.TestSearchMode { static let all: SCNPhysicsWorld.TestSearchMode } protocol SCNPhysicsContactDelegate : NSObjectProtocol { - @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didBegin contact: SCNPhysicsContact) - @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didUpdate contact: SCNPhysicsContact) - @asyncHandler optional func physicsWorld(_ world: SCNPhysicsWorld, didEnd contact: SCNPhysicsContact) + optional func physicsWorld(_ world: SCNPhysicsWorld, didBegin contact: SCNPhysicsContact) + optional func physicsWorld(_ world: SCNPhysicsWorld, didUpdate contact: SCNPhysicsContact) + optional func physicsWorld(_ world: SCNPhysicsWorld, didEnd contact: SCNPhysicsContact) } class SCNPhysicsWorld : NSObject, NSSecureCoding { var gravity: SCNVector3 diff --git a/watchOS/SceneKit/SCNSceneRenderer.swift b/watchOS/SceneKit/SCNSceneRenderer.swift index f092225..cd14a22 100644 --- a/watchOS/SceneKit/SCNSceneRenderer.swift +++ b/watchOS/SceneKit/SCNSceneRenderer.swift @@ -68,10 +68,10 @@ protocol SCNSceneRenderer : NSObjectProtocol { } protocol SCNSceneRendererDelegate : NSObjectProtocol { optional func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) - @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didApplyAnimationsAtTime time: TimeInterval) - @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didSimulatePhysicsAtTime time: TimeInterval) + optional func renderer(_ renderer: SCNSceneRenderer, didApplyAnimationsAtTime time: TimeInterval) + optional func renderer(_ renderer: SCNSceneRenderer, didSimulatePhysicsAtTime time: TimeInterval) @available(watchOS 4.0, *) - @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didApplyConstraintsAtTime time: TimeInterval) + optional func renderer(_ renderer: SCNSceneRenderer, didApplyConstraintsAtTime time: TimeInterval) optional func renderer(_ renderer: SCNSceneRenderer, willRenderScene scene: SCNScene, atTime time: TimeInterval) - @asyncHandler optional func renderer(_ renderer: SCNSceneRenderer, didRenderScene scene: SCNScene, atTime time: TimeInterval) + optional func renderer(_ renderer: SCNSceneRenderer, didRenderScene scene: SCNScene, atTime time: TimeInterval) } diff --git a/watchOS/SoundAnalysis/SNResult.swift b/watchOS/SoundAnalysis/SNResult.swift index e495d8a..856fde1 100644 --- a/watchOS/SoundAnalysis/SNResult.swift +++ b/watchOS/SoundAnalysis/SNResult.swift @@ -4,7 +4,7 @@ protocol SNResult : NSObjectProtocol { } @available(watchOS 6.0, *) protocol SNResultsObserving : NSObjectProtocol { - @asyncHandler func request(_ request: SNRequest, didProduce result: SNResult) - @asyncHandler optional func request(_ request: SNRequest, didFailWithError error: Error) - @asyncHandler optional func requestDidComplete(_ request: SNRequest) + func request(_ request: SNRequest, didProduce result: SNResult) + optional func request(_ request: SNRequest, didFailWithError error: Error) + optional func requestDidComplete(_ request: SNRequest) } diff --git a/watchOS/SpriteKit/SKPhysicsWorld.swift b/watchOS/SpriteKit/SKPhysicsWorld.swift index 74c60fb..5f8199a 100644 --- a/watchOS/SpriteKit/SKPhysicsWorld.swift +++ b/watchOS/SpriteKit/SKPhysicsWorld.swift @@ -1,7 +1,7 @@ protocol SKPhysicsContactDelegate : NSObjectProtocol { - @asyncHandler optional func didBegin(_ contact: SKPhysicsContact) - @asyncHandler optional func didEnd(_ contact: SKPhysicsContact) + optional func didBegin(_ contact: SKPhysicsContact) + optional func didEnd(_ contact: SKPhysicsContact) } class SKPhysicsWorld : NSObject, NSSecureCoding { var gravity: CGVector diff --git a/watchOS/SpriteKit/SKScene.swift b/watchOS/SpriteKit/SKScene.swift index 903b1c0..f571ce0 100644 --- a/watchOS/SpriteKit/SKScene.swift +++ b/watchOS/SpriteKit/SKScene.swift @@ -11,10 +11,10 @@ enum SKSceneScaleMode : Int { @available(watchOS 1.0, *) protocol SKSceneDelegate : NSObjectProtocol { optional func update(_ currentTime: TimeInterval, for scene: SKScene) - @asyncHandler optional func didEvaluateActions(for scene: SKScene) - @asyncHandler optional func didSimulatePhysics(for scene: SKScene) - @asyncHandler optional func didApplyConstraints(for scene: SKScene) - @asyncHandler optional func didFinishUpdate(for scene: SKScene) + optional func didEvaluateActions(for scene: SKScene) + optional func didSimulatePhysics(for scene: SKScene) + optional func didApplyConstraints(for scene: SKScene) + optional func didFinishUpdate(for scene: SKScene) } class SKScene : SKEffectNode { init(size: CGSize) diff --git a/watchOS/StoreKit/SKPaymentQueue.swift b/watchOS/StoreKit/SKPaymentQueue.swift index 740c3d2..775dbf4 100644 --- a/watchOS/StoreKit/SKPaymentQueue.swift +++ b/watchOS/StoreKit/SKPaymentQueue.swift @@ -50,7 +50,7 @@ protocol SKPaymentTransactionObserver : NSObjectProtocol { @available(watchOS 6.2, *) optional func paymentQueue(_ queue: SKPaymentQueue, updatedDownloads downloads: [SKDownload]) @available(watchOS 6.2, *) - @asyncHandler optional func paymentQueueDidChangeStorefront(_ queue: SKPaymentQueue) + optional func paymentQueueDidChangeStorefront(_ queue: SKPaymentQueue) @available(watchOS 7.0, *) - @asyncHandler optional func paymentQueue(_ queue: SKPaymentQueue, didRevokeEntitlementsForProductIdentifiers productIdentifiers: [String]) + optional func paymentQueue(_ queue: SKPaymentQueue, didRevokeEntitlementsForProductIdentifiers productIdentifiers: [String]) } diff --git a/watchOS/StoreKit/SKProductsRequest.swift b/watchOS/StoreKit/SKProductsRequest.swift index 20a5854..b936442 100644 --- a/watchOS/StoreKit/SKProductsRequest.swift +++ b/watchOS/StoreKit/SKProductsRequest.swift @@ -1,7 +1,7 @@ protocol SKProductsRequestDelegate : SKRequestDelegate { @available(watchOS 6.2, *) - @asyncHandler func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) + func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) } @available(watchOS 6.2, *) class SKProductsRequest : SKRequest { diff --git a/watchOS/StoreKit/SKRequest.swift b/watchOS/StoreKit/SKRequest.swift index e3cc7b6..da14eb1 100644 --- a/watchOS/StoreKit/SKRequest.swift +++ b/watchOS/StoreKit/SKRequest.swift @@ -10,7 +10,7 @@ class SKRequest : NSObject { } protocol SKRequestDelegate : NSObjectProtocol { @available(watchOS 6.2, *) - @asyncHandler optional func requestDidFinish(_ request: SKRequest) + optional func requestDidFinish(_ request: SKRequest) @available(watchOS 6.2, *) - @asyncHandler optional func request(_ request: SKRequest, didFailWithError error: Error) + optional func request(_ request: SKRequest, didFailWithError error: Error) } diff --git a/watchOS/UserNotifications/UNUserNotificationCenter.swift b/watchOS/UserNotifications/UNUserNotificationCenter.swift index 65f1088..a5b5f31 100644 --- a/watchOS/UserNotifications/UNUserNotificationCenter.swift +++ b/watchOS/UserNotifications/UNUserNotificationCenter.swift @@ -59,7 +59,7 @@ protocol UNUserNotificationCenterDelegate : NSObjectProtocol { @available(watchOS 3.0, *) optional func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification) async -> UNNotificationPresentationOptions @available(watchOS 3.0, *) - @asyncHandler optional func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) + optional func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) @available(watchOS 3.0, *) optional func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async } diff --git a/watchOS/WatchConnectivity/WCSession.swift b/watchOS/WatchConnectivity/WCSession.swift index 2029b7c..e3a1436 100644 --- a/watchOS/WatchConnectivity/WCSession.swift +++ b/watchOS/WatchConnectivity/WCSession.swift @@ -36,25 +36,25 @@ protocol WCSessionDelegate : NSObjectProtocol { @available(watchOS 2.2, *) func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) @available(watchOS 6.0, *) - @asyncHandler optional func sessionCompanionAppInstalledDidChange(_ session: WCSession) + optional func sessionCompanionAppInstalledDidChange(_ session: WCSession) @available(watchOS 2.0, *) - @asyncHandler optional func sessionReachabilityDidChange(_ session: WCSession) + optional func sessionReachabilityDidChange(_ session: WCSession) @available(watchOS 2.0, *) - @asyncHandler optional func session(_ session: WCSession, didReceiveMessage message: [String : Any]) + optional func session(_ session: WCSession, didReceiveMessage message: [String : Any]) @available(watchOS 2.0, *) - @asyncHandler optional func session(_ session: WCSession, didReceiveMessage message: [String : Any], replyHandler: @escaping ([String : Any]) -> Void) + optional func session(_ session: WCSession, didReceiveMessage message: [String : Any], replyHandler: @escaping ([String : Any]) -> Void) @available(watchOS 2.0, *) - @asyncHandler optional func session(_ session: WCSession, didReceiveMessageData messageData: Data) + optional func session(_ session: WCSession, didReceiveMessageData messageData: Data) @available(watchOS 2.0, *) - @asyncHandler optional func session(_ session: WCSession, didReceiveMessageData messageData: Data, replyHandler: @escaping (Data) -> Void) + optional func session(_ session: WCSession, didReceiveMessageData messageData: Data, replyHandler: @escaping (Data) -> Void) @available(watchOS 2.0, *) - @asyncHandler optional func session(_ session: WCSession, didReceiveApplicationContext applicationContext: [String : Any]) + optional func session(_ session: WCSession, didReceiveApplicationContext applicationContext: [String : Any]) @available(watchOS 2.0, *) - @asyncHandler optional func session(_ session: WCSession, didFinish userInfoTransfer: WCSessionUserInfoTransfer, error: Error?) + optional func session(_ session: WCSession, didFinish userInfoTransfer: WCSessionUserInfoTransfer, error: Error?) @available(watchOS 2.0, *) - @asyncHandler optional func session(_ session: WCSession, didReceiveUserInfo userInfo: [String : Any] = [:]) + optional func session(_ session: WCSession, didReceiveUserInfo userInfo: [String : Any] = [:]) @available(watchOS 2.0, *) - @asyncHandler optional func session(_ session: WCSession, didFinish fileTransfer: WCSessionFileTransfer, error: Error?) + optional func session(_ session: WCSession, didFinish fileTransfer: WCSessionFileTransfer, error: Error?) @available(watchOS 2.0, *) - @asyncHandler optional func session(_ session: WCSession, didReceive file: WCSessionFile) + optional func session(_ session: WCSession, didReceive file: WCSessionFile) } diff --git a/watchOS/WatchKit/WKCrownSequencer.swift b/watchOS/WatchKit/WKCrownSequencer.swift index 7c5165b..363952b 100644 --- a/watchOS/WatchKit/WKCrownSequencer.swift +++ b/watchOS/WatchKit/WKCrownSequencer.swift @@ -11,6 +11,6 @@ class WKCrownSequencer : NSObject { } @available(watchOS 3.0, *) protocol WKCrownDelegate : NSObjectProtocol { - @asyncHandler optional func crownDidRotate(_ crownSequencer: WKCrownSequencer?, rotationalDelta: Double) - @asyncHandler optional func crownDidBecomeIdle(_ crownSequencer: WKCrownSequencer?) + optional func crownDidRotate(_ crownSequencer: WKCrownSequencer?, rotationalDelta: Double) + optional func crownDidBecomeIdle(_ crownSequencer: WKCrownSequencer?) } diff --git a/watchOS/WatchKit/WKExtendedRuntimeSession.swift b/watchOS/WatchKit/WKExtendedRuntimeSession.swift index 96550f1..80d0cde 100644 --- a/watchOS/WatchKit/WKExtendedRuntimeSession.swift +++ b/watchOS/WatchKit/WKExtendedRuntimeSession.swift @@ -46,7 +46,7 @@ class WKExtendedRuntimeSession : NSObject { } @available(watchOS 6.0, *) protocol WKExtendedRuntimeSessionDelegate : NSObjectProtocol { - @asyncHandler func extendedRuntimeSession(_ extendedRuntimeSession: WKExtendedRuntimeSession, didInvalidateWith reason: WKExtendedRuntimeSessionInvalidationReason, error: Error?) - @asyncHandler func extendedRuntimeSessionDidStart(_ extendedRuntimeSession: WKExtendedRuntimeSession) + func extendedRuntimeSession(_ extendedRuntimeSession: WKExtendedRuntimeSession, didInvalidateWith reason: WKExtendedRuntimeSessionInvalidationReason, error: Error?) + func extendedRuntimeSessionDidStart(_ extendedRuntimeSession: WKExtendedRuntimeSession) func extendedRuntimeSessionWillExpire(_ extendedRuntimeSession: WKExtendedRuntimeSession) } diff --git a/watchOS/WatchKit/WKExtension.swift b/watchOS/WatchKit/WKExtension.swift index 3e3cc8b..3dba031 100644 --- a/watchOS/WatchKit/WKExtension.swift +++ b/watchOS/WatchKit/WKExtension.swift @@ -46,11 +46,11 @@ enum WKBackgroundFetchResult : UInt { } @available(watchOS 2.0, *) protocol WKExtensionDelegate : NSObjectProtocol { - @asyncHandler optional func applicationDidFinishLaunching() - @asyncHandler optional func applicationDidBecomeActive() + optional func applicationDidFinishLaunching() + optional func applicationDidBecomeActive() optional func applicationWillResignActive() optional func applicationWillEnterForeground() - @asyncHandler optional func applicationDidEnterBackground() + optional func applicationDidEnterBackground() @available(watchOS 5.0, *) optional func handleActiveWorkoutRecovery() @available(watchOS 6.0, *) @@ -63,13 +63,13 @@ protocol WKExtensionDelegate : NSObjectProtocol { @available(watchOS 3.0, *) optional func handle(_ backgroundTasks: Set) @available(watchOS 4.0, *) - @asyncHandler optional func deviceOrientationDidChange() + optional func deviceOrientationDidChange() @available(watchOS 6.0, *) - @asyncHandler optional func didRegisterForRemoteNotifications(withDeviceToken deviceToken: Data) + optional func didRegisterForRemoteNotifications(withDeviceToken deviceToken: Data) @available(watchOS 6.0, *) - @asyncHandler optional func didFailToRegisterForRemoteNotificationsWithError(_ error: Error) + optional func didFailToRegisterForRemoteNotificationsWithError(_ error: Error) @available(watchOS 6.0, *) - @asyncHandler optional func didReceiveRemoteNotification(_ userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (WKBackgroundFetchResult) -> Void) + optional func didReceiveRemoteNotification(_ userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (WKBackgroundFetchResult) -> Void) @available(watchOS 6.0, *) optional func didReceiveRemoteNotification(_ userInfo: [AnyHashable : Any]) async -> WKBackgroundFetchResult @available(watchOS 2.0, *) @@ -86,10 +86,10 @@ protocol WKExtensionDelegate : NSObjectProtocol { optional func handleAction(withIdentifier identifier: String?, for localNotification: UILocalNotification, withResponseInfo responseInfo: [AnyHashable : Any]) @available(watchOS 2.0, *) @available(watchOS, deprecated: 3.0, message: "use UNUserNotificationCenterDelegate") - @asyncHandler optional func didReceiveRemoteNotification(_ userInfo: [AnyHashable : Any]) + optional func didReceiveRemoteNotification(_ userInfo: [AnyHashable : Any]) @available(watchOS 2.0, *) @available(watchOS, deprecated: 3.0, message: "use UNUserNotificationCenterDelegate") - @asyncHandler optional func didReceive(_ notification: UILocalNotification) + optional func didReceive(_ notification: UILocalNotification) } extension WKExtension { @available(watchOS 7.0, *)