TKMedium

@interface TKMedium : NSObject

Entity preserving information about a remote displayable Medium. An Image or a Video.

  • ID

    Global identifier.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NS_SWIFT_NAME(ID) NSString *ID;

    Swift

    var ID: String { get }
  • Medium type.

    Declaration

    Objective-C

    @property (readonly) TKMediumType type;

    Swift

    var type: TKMediumType { get }
  • Medium suitability.

    Declaration

    Objective-C

    @property (readonly) TKMediumSuitability suitability;

    Swift

    var suitability: TKMediumSuitability { get }
  • Medium width, if available.

    Declaration

    Objective-C

    @property (readonly) CGFloat width;

    Swift

    var width: CGFloat { get }
  • Medium height, if available.

    Declaration

    Objective-C

    @property (readonly) CGFloat height;

    Swift

    var height: CGFloat { get }
  • Medium title.

    Declaration

    Objective-C

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

    Swift

    var title: String? { get }
  • Medium author, usually full name or similar.

    Declaration

    Objective-C

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

    Swift

    var author: String? { get }
  • Medium provider.

    Declaration

    Objective-C

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

    Swift

    var provider: String? { get }
  • Medium license name.

    Declaration

    Objective-C

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

    Swift

    var license: String? { get }
  • URL

    Unmodified Medium URL.

    This URL links the original Medium file.

    Note

    To get a URL for different dimensions, use -displayableImageURLForSize:contentMode:.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSURL *_Nonnull URL;

    Swift

    var url: URL { get }
  • URL for the original source of the image.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSURL *originURL;

    Swift

    var originURL: URL? { get }
  • URL link to a Medium author.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSURL *authorURL;

    Swift

    var authorURL: URL? { get }
  • External ID of the Medium.

    Declaration

    Objective-C

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

    Swift

    var externalID: String? { get }
  • Method for getting an URL to a Medium image with a given size.

    Declaration

    Objective-C

    - (nullable NSURL *)displayableImageURLForSize:(CGSize)size
                                       contentMode:(TKMediumContentMode)mode;

    Swift

    func displayableImageURL(for size: CGSize, contentMode mode: TKMediumContentMode) -> URL?

    Parameters

    size

    Desired size of the image.

    mode

    Content mode of the image.

    Return Value

    URL for loading the resized image.

  • Method for getting an URL to a Medium video with a given resolution.

    Declaration

    Objective-C

    - (nullable NSURL *)displayableVideoURLForResolution:
        (TKMediumVideoResolution)resolution;

    Swift

    func displayableVideoURL(for resolution: TKMediumVideoResolution) -> URL?

    Parameters

    resolution

    Desired resolution of the video.

    Return Value

    URL for video playback.