- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
public var messageStatus = MessageStatus.IncomingMessage {
didSet {
self.messageStatusChanged(messageStatus)
switch messageStatus {
case .IncomingMessage:
haloView.alpha = 0.0
whiteCircleView.fillColor = .clearColor()
whiteCircleView.borderColor = .clearColor()
colorCircleView.fillColor = .clearColor()
colorCircleView.borderColor = .clearColor()
haloView.color = .clearColor()
default:
whiteCircleView.fillColor = collectionViewBackgroundColor
haloView.alpha = 1.0
}
switch messageStatus {
case .ReadedMessage:
colorCircleView.fillColor = bubbleColor
colorCircleView.borderColor = bubbleColor
haloView.color = bubbleColor
case .DeliveredMessage:
colorCircleView.fillColor = .whiteColor()
colorCircleView.borderColor = bubbleColor
haloView.color = bubbleColor
case .NonDeliveredMessage:
colorCircleView.fillColor = .clearColor()
colorCircleView.borderColor = bubbleColor
haloView.color = .clearColor()
default: break
}
}
}
Когда одного switch мало...
PS: язык Swift
Комментарии (0) RSS
Добавить комментарий