NSURL(SDWebImagePhotosPlugin)

@interface NSURL (SDWebImagePhotosPlugin)

NSURL category for Photos URL support

  • The localIdentifier value for Photos URL, or nil for other URL.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable)
        NSString *sd_assetLocalIdentifier;

    Swift

    var sd_assetLocalIdentifier: String? { get }
  • The PHAsset value for Photos URL, or nil for other URL, or the PHAsset is not availble.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) PHAsset *sd_asset;

    Swift

    var sd_asset: PHAsset? { get }
  • Check whether the current URL represents Photos URL.

    Declaration

    Objective-C

    @property (readonly, assign, nonatomic) BOOL sd_isPhotosURL;

    Swift

    var sd_isPhotosURL: Bool { get }
  • Create a Photos URL with PHAsset ‘s local identifier

    Declaration

    Objective-C

    + (nullable instancetype)sd_URLWithAssetLocalIdentifier:
        (nonnull NSString *)identifier;

    Swift

    class func sd_URL(withAssetLocalIdentifier identifier: String) -> Self?

    Parameters

    identifier

    PHAsset ‘s local identifier

    Return Value

    A Photos URL

  • Create a Photos URL with PHAsset

    Declaration

    Objective-C

    + (nullable instancetype)sd_URLWithAsset:(nonnull PHAsset *)asset;

    Swift

    class func sd_URL(with asset: PHAsset) -> Self?

    Parameters

    asset

    PHAsset object

    Return Value

    A Photos URL