-
Notifications
You must be signed in to change notification settings - Fork 545
AVKit iOS xcode26.0 b5
Alex Soto edited this page Aug 5, 2025
·
1 revision
#AVKit.framework
diff -ruN /Applications/Xcode_26.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVCaptureEvent.h /Applications/Xcode_26.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVCaptureEvent.h
--- /Applications/Xcode_26.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVCaptureEvent.h 2025-07-12 00:30:41
+++ /Applications/Xcode_26.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVCaptureEvent.h 2025-07-25 23:03:19
@@ -27,47 +27,53 @@
// MARK: -
-/// An enum describing the phase of a capture event.
+/// An enumeration that describes the phase of a capture event.
typedef NS_ENUM(NSUInteger, AVCaptureEventPhase) {
- /// A phase sent at the beginning of a capture event.
+ /// A phase that indicates the beginning of a capture event.
AVCaptureEventPhaseBegan,
- /// A phase sent at the end of a capture event.
+ /// A phase that indicates the end of a capture event.
AVCaptureEventPhaseEnded,
- /// A phase sent when a capture event is cancelled.
+ /// A phase that indicates the cancellation of a capture event.
AVCaptureEventPhaseCancelled,
} API_AVAILABLE(ios(17.2)) API_UNAVAILABLE(visionos) API_UNAVAILABLE(macos, tvos, watchos);
// MARK: -
-/// An object describing a system capture event.
+/// An object that describes a user interaction with a system hardware button.
+///
+/// Inspect a capture event’s ``phase`` to determine whether the event begins, ends, or is in a canceled state.
API_AVAILABLE(ios(17.2)) API_UNAVAILABLE(visionos) API_UNAVAILABLE(macos, tvos, watchos)
@interface AVCaptureEvent : NSObject
AVKIT_INIT_UNAVAILABLE
-/// The current phase of this capture event.
+/// The current phase of a capture event.
@property (nonatomic, readonly) AVCaptureEventPhase phase;
/*!
- * Plays the given capture sound through AirPods.
+ * Plays the specified capture sound through AirPods.
*
- * This method has no effect if `shouldPlaySound` is `NO` or if the event object's lifetime exceeds 15 seconds.
- *
* - Parameter sound: The capture sound to play for this event.
- * - Returns: A BOOL indicating whether a sound was played or not.
+ * - Returns: A Boolean value that indicates whether the system played the sound.
+ *
+ * This method has no effect if ``shouldPlaySound`` is `false` or if the event object's lifetime exceeds 15 seconds.
+ *
+ * > Important: To use AirPods Camera Control, it must be available in your country or region. AirPods Camera Control is not currently available in the European Union.
*/
- (BOOL)playSound:(AVCaptureEventSound *)sound API_AVAILABLE(ios(26.0)) API_UNAVAILABLE(visionos, macCatalyst) API_UNAVAILABLE(macos, tvos, watchos);
/*!
- * Indicates whether a sound must be played manually using the `playSound` method.
+ * A Boolean value that indicates whether you must play a sound manually.
*
- * This property is `YES` only when both of the following conditions are true:
- * 1. The event was triggered by an AirPod stem click.
- * 2. The default capture sound is disabled.
+ * This property is `true` only when both of the following conditions are true:
+ * 1. A person performs an AirPod stem click.
+ * 2. You disable the default capture sound.
*
- * If `shouldPlaySound ` is `NO`, calling `playSound` will have no effect. Omitting the sound when expected can significantly impact the user experience.
+ * If this property is `false`, calling ``playSound:`` has no effect. Omitting the sound when expected can significantly impact the user experience.
+ *
+ * > Important: To use AirPods Camera Control, it must be available in your country or region. AirPods Camera Control is not currently available in the European Union.
*/
@property (nonatomic, readonly) BOOL shouldPlaySound API_AVAILABLE(ios(26.0)) API_UNAVAILABLE(visionos, macCatalyst) API_UNAVAILABLE(macos, tvos, watchos);
diff -ruN /Applications/Xcode_26.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVCaptureEventInteraction.h /Applications/Xcode_26.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVCaptureEventInteraction.h
--- /Applications/Xcode_26.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVCaptureEventInteraction.h 2025-07-12 00:30:41
+++ /Applications/Xcode_26.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVCaptureEventInteraction.h 2025-07-25 23:11:48
@@ -26,11 +26,52 @@
// MARK: -
/*!
- * A UIInteraction used to register actions triggered by system capture events.
+ * An object that registers handlers to respond to capture events from system hardware buttons.
*
- * Events may or may not be sent to applications based on the current system state. Backgrounded applications will not receive events, additionally events will only be sent to applications that are actively using the camera. AVCaptureEventInteraction should be attached to views in the responder chain.
+ * The system Camera app allows people to perform capture functions by pressing hardware buttons on their iOS device. UIKit apps can add similar functionality by using this type to register handlers that respond to interactions from device hardware.
*
- * This API is for media capture use cases only.
+ * > Note:
+ * > In SwiftUI, respond to capture events from hardware buttons using <doc://com.apple.documentation/documentation/swiftui/view/oncameracaptureevent(isenabled:action:)> and <doc://com.apple.documentation/documentation/swiftui/view/oncameracaptureevent(isenabled:primaryaction:secondaryaction:)> instead.
+ *
+ * The following example shows how to add a handler that captures a photo when a user presses a hardware button on their device.
+ *
+ * ```swift
+ * class CameraViewController: UIViewController {
+ *
+ * /// An object that manages the camera functionality.
+ * private let camera = CameraModel()
+ *
+ * /// A capture event interaction to handle hardware button presses.
+ * private var eventInteraction: AVCaptureEventInteraction?
+ *
+ * override func viewDidLoad() {
+ * super.viewDidLoad()
+ * // Configure the app to take a photo on hardware button press.
+ * configureHardwareInteraction()
+ * }
+ *
+ * private func configureHardwareInteraction() {
+ * // Create a new capture event interaction with a handler that captures a photo.
+ * let interaction = AVCaptureEventInteraction { [weak self] event in
+ * // Capture a photo on "press up" of a hardware button.
+ * if event.phase == .ended {
+ * self?.camera.capturePhoto()
+ * }
+ * }
+ * // Add the interaction to the view controller's view.
+ * view.addInteraction(interaction)
+ * eventInteraction = interaction
+ * }
+ * }
+ * ```
+ *
+ *
+ * The event handler queries the capture event to determine its phase, and when the interaction ends, captures a photo.
+ *
+ * > Important:
+ * > You can only use this API for capture use cases. The system sends capture events only to apps that actively use the camera. Backgrounded capture apps, and apps not performing capture, don't receive events.
+ * >
+ * > Adopting this API overrides default hardware button behavior, so apps must always respond appropriately to any events received. Failing to handle events results in a nonfunctional button that provides a poor user experience. If your app is temporarily unable to handle events, disable the interaction by setting its ``isEnabled`` property to `false`, which restores the system button behavior.
*/
API_AVAILABLE(ios(17.2)) API_UNAVAILABLE(visionos) API_UNAVAILABLE(macos, tvos, watchos)
@interface AVCaptureEventInteraction : NSObject <UIInteraction>
@@ -38,33 +79,33 @@
AVKIT_INIT_UNAVAILABLE
/*!
- * Initializer for an AVCaptureEventInteraction.
+ * Creates a capture event interaction with a handler that responds to presses of hardware buttons.
*
- * - Parameter handler: An event handler called when either the primary or secondary events are triggered.
- * - Returns: An AVCaptureEventInteraction.
+ * - Parameter handler: An event handler the system calls when a person performs a primary or secondary capture event.
*/
- (instancetype)initWithEventHandler:(void (^)(AVCaptureEvent *event))handler NS_SWIFT_NAME(init(handler:));
/*!
- * Initializer for an AVCaptureEventInteraction.
+ * Creates a capture event interaction with handlers that respond independently to presses of hardware buttons.
*
- * - Parameter primaryHandler: An event handler called when a primary capture event is triggered.
- * - Parameter secondaryHandler: An event handler called when a secondary capture event is triggered.
- * - Returns: An AVCaptureEventInteraction.
+ * - Parameter primaryHandler: An event handler the system calls when a person performs a primary capture event.
+ * - Parameter secondaryHandler: An event handler the system calls when a person performs a secondary capture event.
*/
- (instancetype)initWithPrimaryEventHandler:(void (^)(AVCaptureEvent *event))primaryHandler secondaryEventHandler:(void (^)(AVCaptureEvent *event))secondaryHandler NS_SWIFT_NAME(init(primary:secondary:));
/*!
- * A boolean value indicating whether this capture event interaction is active or not.
+ * A Boolean value that indicates whether this capture event interaction is in an enabled state.
*
- * Set this value to NO when your application cannot or will not respond to the action callbacks to avoid non-interactive buttons or UI elements.
+ * Set this value to `false` when your app can’t or won’t respond to the action callbacks to avoid non-interactive buttons or UI elements.
*/
@property (nonatomic, readwrite, getter=isEnabled) BOOL enabled;
/*!
- * A boolean value indicating whether or not the default sound is disabled.
+ * A Boolean value that indicates whether the default sound is in a disabled state.
*
- * If `YES`, sound playback for capture events must be handled manually using the `playSound` method.
+ * If `true`, you must handle sound playback for capture events manually using the ``AVCaptureEvent/playSound:`` method.
+ *
+ * > Important: To use AirPods Camera Control, it must be available in your country or region. AirPods Camera Control is not currently available in the European Union.
*/
@property (class, nonatomic, readwrite) BOOL defaultCaptureSoundDisabled API_AVAILABLE(ios(26.0)) API_UNAVAILABLE(visionos, macCatalyst) API_UNAVAILABLE(macos, tvos, watchos);
diff -ruN /Applications/Xcode_26.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVCaptureEventSound.h /Applications/Xcode_26.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVCaptureEventSound.h
--- /Applications/Xcode_26.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVCaptureEventSound.h 2025-07-12 00:30:41
+++ /Applications/Xcode_26.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVCaptureEventSound.h 2025-07-25 23:03:19
@@ -15,23 +15,26 @@
#import <AVKit/AVKitDefines.h>
#endif // TARGET_OS_OSX || TARGET_OS_MACCATALYST
+NS_ASSUME_NONNULL_BEGIN
+
// MARK: -
/// A sound object for a capture event.
+///
+/// > Important: To use AirPods Camera Control, it must be available in your country or region. AirPods Camera Control is not currently available in the European Union.
API_AVAILABLE(ios(26.0)) API_UNAVAILABLE(visionos, macCatalyst) API_UNAVAILABLE(macos, tvos, watchos)
@interface AVCaptureEventSound : NSObject
AVKIT_INIT_UNAVAILABLE
/*!
- * Initializer for an AVCaptureEventSound with a custom sound.
+ * Creates a sound object for a capture event.
*
* - Parameter url: A URL within the app's bundle for a custom capture sound.
* - Parameter error: A return by-reference error that specifies any error in creating the sound object.
- * - Returns: An AVCaptureEventSound.
*/
-- (instancetype)initWithURL:(NSURL *)url error:(NSError **)error;
+- (nullable instancetype)initWithURL:(NSURL *)url error:(NSError * _Nullable * _Nullable)error;
/// The default sound for photo capture.
@property (class, readonly) AVCaptureEventSound *cameraShutterSound;
@@ -43,3 +46,5 @@
@property (class, readonly) AVCaptureEventSound *endVideoRecordingSound;
@end
+
+NS_ASSUME_NONNULL_END