[frameworks] [ios] Fixed long expressions to speedup compilation.

This commit is contained in:
Ilya Grechuhin 2017-10-02 11:40:33 +03:00 committed by Sergey Yershov
parent 0073585dc4
commit 1378117154

View file

@ -38,26 +38,35 @@ struct RatingViewSettings {
static let starType = StarType.boxed
static let starPointsBoxSize: CGFloat = 100
static let starPoints: [StarType: [CGPoint]] = [StarType.regular: [CGPoint(x: 49.5, y: 0.0),
CGPoint(x: 60.5, y: 35.0),
CGPoint(x: 99.0, y: 35.0),
CGPoint(x: 67.5, y: 58.0),
CGPoint(x: 78.5, y: 92.0),
CGPoint(x: 49.5, y: 71.0),
CGPoint(x: 20.5, y: 92.0),
CGPoint(x: 31.5, y: 58.0),
CGPoint(x: 0.0, y: 35.0),
CGPoint(x: 38.5, y: 35.0)],
StarType.boxed: [CGPoint(x: 50.5, y: 22.2),
CGPoint(x: 57.6, y: 45.6),
CGPoint(x: 79.9, y: 45.6),
CGPoint(x: 61.7, y: 58.1),
CGPoint(x: 68.6, y: 78.8),
CGPoint(x: 50.5, y: 66.0),
CGPoint(x: 32.4, y: 78.8),
CGPoint(x: 39.3, y: 58.1),
CGPoint(x: 21.2, y: 45.6),
CGPoint(x: 43.4, y: 45.6)]]
static let starPoints: [StarType: [CGPoint]] = {
let regular: [CGPoint] = [
CGPoint(x: 49.5, y: 0.0),
CGPoint(x: 60.5, y: 35.0),
CGPoint(x: 99.0, y: 35.0),
CGPoint(x: 67.5, y: 58.0),
CGPoint(x: 78.5, y: 92.0),
CGPoint(x: 49.5, y: 71.0),
CGPoint(x: 20.5, y: 92.0),
CGPoint(x: 31.5, y: 58.0),
CGPoint(x: 0.0, y: 35.0),
CGPoint(x: 38.5, y: 35.0),
]
let boxed: [CGPoint] = [
CGPoint(x: 50.5, y: 22.2),
CGPoint(x: 57.6, y: 45.6),
CGPoint(x: 79.9, y: 45.6),
CGPoint(x: 61.7, y: 58.1),
CGPoint(x: 68.6, y: 78.8),
CGPoint(x: 50.5, y: 66.0),
CGPoint(x: 32.4, y: 78.8),
CGPoint(x: 39.3, y: 58.1),
CGPoint(x: 21.2, y: 45.6),
CGPoint(x: 43.4, y: 45.6),
]
return [.regular: regular, .boxed: boxed]
}()
}
init() {}
@ -72,22 +81,30 @@ struct RatingViewSettings {
var filledImage: UIImage?
var minTouchRating = Default.minTouchRating
var textColors: [TextSide: UIColor] = [.left: Default.textColor,
.right: Default.textColor,
.top: Default.textColor,
.bottom: Default.textColor]
var textFonts: [TextSide: UIFont] = [.left: Default.textFont,
.right: Default.textFont,
.top: Default.textFont,
.bottom: Default.textFont]
var textSizes: [TextSide: CGFloat] = [.left: Default.textSize,
.right: Default.textSize,
.top: Default.textSize,
.bottom: Default.textSize]
var textMargins: [TextSide: CGFloat] = [.left: Default.textMargin,
.right: Default.textMargin,
.top: Default.textMargin,
.bottom: Default.textMargin]
var textColors: [TextSide: UIColor] = [
.left: Default.textColor,
.right: Default.textColor,
.top: Default.textColor,
.bottom: Default.textColor,
]
var textFonts: [TextSide: UIFont] = [
.left: Default.textFont,
.right: Default.textFont,
.top: Default.textFont,
.bottom: Default.textFont,
]
var textSizes: [TextSide: CGFloat] = [
.left: Default.textSize,
.right: Default.textSize,
.top: Default.textSize,
.bottom: Default.textSize,
]
var textMargins: [TextSide: CGFloat] = [
.left: Default.textMargin,
.right: Default.textMargin,
.top: Default.textMargin,
.bottom: Default.textMargin,
]
var starMargin = Default.starMargin
var starPoints = Default.starPoints[Default.starType]!