Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Grechuhin <i.grechuhin@gmail.com>2017-10-02 11:40:33 +0300
committerSergey Yershov <syershov@maps.me>2017-10-02 13:55:26 +0300
commit1378117154de38e7c932845ecb462b4b225c042f (patch)
tree8392aa60627678d87f06fda782fbe14db41cf6f7
parent0073585dc40edb0008266449af0856b622e21b21 (diff)
[frameworks] [ios] Fixed long expressions to speedup compilation.
-rw-r--r--iphone/Maps/Classes/Components/RatingView/RatingViewSettings.swift89
1 files changed, 53 insertions, 36 deletions
diff --git a/iphone/Maps/Classes/Components/RatingView/RatingViewSettings.swift b/iphone/Maps/Classes/Components/RatingView/RatingViewSettings.swift
index 6b10a15f3b..0a5ac75429 100644
--- a/iphone/Maps/Classes/Components/RatingView/RatingViewSettings.swift
+++ b/iphone/Maps/Classes/Components/RatingView/RatingViewSettings.swift
@@ -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]!