MMMStylesheetConverter

Objective-C

@protocol MMMStylesheetConverter <NSObject>

Swift

protocol MMMStylesheetConverter : NSObjectProtocol

Something that converts dimensions given for one size class (e.g. font sizes from the design made for iPhone 6) into dimensions for another size class (e.g. font size for iPhone 5 that were not explicitely mentioned in the design).

Different converters can be used for different kinds of values. For example, it might make sense to scale paddings proportionally to screen widths, but keep font sizes the same.

  • Converts a dimension know for certain size class according to the rules of the converter.

    Declaration

    Objective-C

    - (CGFloat)convertFloat:(CGFloat)value
              fromSizeClass:(nonnull NSString *)sourceSizeClass;

    Swift

    func convert(_ value: CGFloat, fromSizeClass sourceSizeClass: String) -> CGFloat