# ADR 001: Cloud Status Detection via performSelector ## Status Accepted ## Context We need to detect whether a photo asset is stored locally or in iCloud. Apple's PhotoKit does not expose `PHAsset.cloudIdentifier` as a public property on macOS. The `PHAsset` class has this property on iOS but it is undocumented on macOS. ## Decision Use `performSelector:@selector(cloudIdentifier)` with `@try/@catch` to detect cloud status. If the selector returns a non-null value, the asset is in iCloud. If it throws an exception, fall back to checking `PHAssetResource.isLocallyAvailable` (also via `performSelector`). ## Consequences - This accesses an undocumented Apple API. It may break in any macOS update without warning. - The `@try/@catch` pattern prevents crashes if the selector is removed. - If both checks fail or throw, we default to "local" — this may incorrectly report cloud-only assets as local. - This approach could cause notarization issues if Apple enforces stricter private API checks in the future. - No alternative public API exists on macOS for this purpose as of macOS 14.