Mac Developer Library

Developer

Quartz Framework Reference QCCompositionRepository Class Reference

Options
Deployment Target:

On This Page
Language:

QCCompositionRepository

The QCCompositionRepository class represents a system-wide centralized repository of built-in and installed Quartz Composer compositions (/Library/Compositions and ~/Library/Compositions). The QCCompositionRepository class cannot be subclassed.

Compositions in the repository are represented by the QCComposition class. You can use the methods of the QCCompositionRepository class to fetch all compositions or only those that meet specific criteria.

Inheritance


Conforms To


Import Statement


Swift

import Quartz

Objective-C

@import Quartz;

Availability


Available in OS X v10.5 and later.
  • Returns the shared instance of the composition repository.

    Declaration

    Swift

    class func sharedCompositionRepository() -> QCCompositionRepository!

    Objective-C

    + (QCCompositionRepository *)sharedCompositionRepository

    Return Value

    The shared instance of QCCompositionRepository.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Returns the composition that corresponds to the identifier.

    Declaration

    Swift

    func compositionWithIdentifier(_ identifier: String!) -> QCComposition!

    Objective-C

    - (QCComposition *)compositionWithIdentifier:(NSString *)identifier

    Parameters

    identifier

    A string that uniquely identifies the composition to retrieve.

    Return Value

    The composition identified by the provided string, or nil if there is no composition with that identifier in the composition repository.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Returns an array of compositions that match a set of criteria.

    Declaration

    Swift

    func compositionsWithProtocols(_ protocols: [AnyObject]!, andAttributes attributes: [NSObject : AnyObject]!) -> [AnyObject]!

    Objective-C

    - (NSArray *)compositionsWithProtocols:(NSArray *)protocols andAttributes:(NSDictionary *)attributes

    Parameters

    protocols

    The protocols that you want compositions to conform to. Pass nil if you don’t want to filter based on the protocol. You can pass any of these protocols: QCCompositionProtocolAnimation, QCCompositionProtocolImageProducer, QCCompositionProtocolImageFilter, QCCompositionProtocolImageCompositor, QCCompositionProtocolImageTransition, and QCCompositionProtocolScreenSaverRSS.

    attributes

    A dictionary that contains the attributes, and their associated values, that you want compositions to match. Pass nil if you don’t want to filter based on the attributes. For example, you can pass any of these attributes: QCCompositionAttributeNameKey, QCCompositionAttributeDescriptionKey, QCCompositionAttributeCopyrightKey, QCCompositionAttributeBuiltInKey, and QCCompositionAttributeTimeDependentKey.

    Return Value

    An array of QCComposition objects that meet the supplied criteria.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Returns an array that contains all compositions currently in the composition repository.

    Declaration

    Swift

    func allCompositions() -> [AnyObject]!

    Objective-C

    - (NSArray *)allCompositions

    Return Value

    An array of QCComposition objects.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.