From cfebb5371978bed558fee720fc7f15cf2639e4bc Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Sat, 30 Mar 2019 08:11:08 -0600 Subject: [PATCH] more concise constants post translation --- Signal/src/ViewControllers/ContactsPicker.swift | 2 +- .../Cells/ConversationMediaView.swift | 12 ++++++------ .../Cells/MediaDownloadView.swift | 2 +- .../ConversationView/Cells/MediaUploadView.swift | 2 +- .../CropScaleImageViewController.swift | 2 +- .../GifPicker/GifPickerViewController.swift | 2 +- .../MediaGalleryViewController.swift | 4 ++-- .../OnboardingSplashViewController.swift | 4 ++-- .../ViewControllers/MediaMessageView.swift | 16 ++++++++-------- SignalMessaging/Views/AvatarImageView.swift | 12 ++++++------ 10 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Signal/src/ViewControllers/ContactsPicker.swift b/Signal/src/ViewControllers/ContactsPicker.swift index 246caef1b..1ec660512 100644 --- a/Signal/src/ViewControllers/ContactsPicker.swift +++ b/Signal/src/ViewControllers/ContactsPicker.swift @@ -172,7 +172,7 @@ public class ContactsPicker: OWSViewController, UITableViewDelegate, UITableView let title = NSLocalizedString("INVITE_FLOW_REQUIRES_CONTACT_ACCESS_TITLE", comment: "Alert title when contacts disabled while trying to invite contacts to signal") let body = NSLocalizedString("INVITE_FLOW_REQUIRES_CONTACT_ACCESS_BODY", comment: "Alert body when contacts disabled while trying to invite contacts to signal") - let alert = UIAlertController(title: title, message: body, preferredStyle: UIAlertController.Style.alert) + let alert = UIAlertController(title: title, message: body, preferredStyle: .alert) let dismissText = CommonStrings.cancelButton diff --git a/Signal/src/ViewControllers/ConversationView/Cells/ConversationMediaView.swift b/Signal/src/ViewControllers/ConversationView/Cells/ConversationMediaView.swift index dc917b7a8..243ca6983 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/ConversationMediaView.swift +++ b/Signal/src/ViewControllers/ConversationView/Cells/ConversationMediaView.swift @@ -204,8 +204,8 @@ public class ConversationMediaView: UIView { animatedImageView.contentMode = .scaleAspectFill // Use trilinear filters for better scaling quality at // some performance cost. - animatedImageView.layer.minificationFilter = CALayerContentsFilter.trilinear - animatedImageView.layer.magnificationFilter = CALayerContentsFilter.trilinear + animatedImageView.layer.minificationFilter = .trilinear + animatedImageView.layer.magnificationFilter = .trilinear animatedImageView.backgroundColor = Theme.offBackgroundColor addSubview(animatedImageView) animatedImageView.autoPinEdgesToSuperviewEdges() @@ -263,8 +263,8 @@ public class ConversationMediaView: UIView { stillImageView.contentMode = .scaleAspectFill // Use trilinear filters for better scaling quality at // some performance cost. - stillImageView.layer.minificationFilter = CALayerContentsFilter.trilinear - stillImageView.layer.magnificationFilter = CALayerContentsFilter.trilinear + stillImageView.layer.minificationFilter = .trilinear + stillImageView.layer.magnificationFilter = .trilinear stillImageView.backgroundColor = Theme.offBackgroundColor addSubview(stillImageView) stillImageView.autoPinEdgesToSuperviewEdges() @@ -318,8 +318,8 @@ public class ConversationMediaView: UIView { stillImageView.contentMode = .scaleAspectFill // Use trilinear filters for better scaling quality at // some performance cost. - stillImageView.layer.minificationFilter = CALayerContentsFilter.trilinear - stillImageView.layer.magnificationFilter = CALayerContentsFilter.trilinear + stillImageView.layer.minificationFilter = .trilinear + stillImageView.layer.magnificationFilter = .trilinear stillImageView.backgroundColor = Theme.offBackgroundColor addSubview(stillImageView) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/MediaDownloadView.swift b/Signal/src/ViewControllers/ConversationView/Cells/MediaDownloadView.swift index a1c09e06c..65102dd3b 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/MediaDownloadView.swift +++ b/Signal/src/ViewControllers/ConversationView/Cells/MediaDownloadView.swift @@ -105,7 +105,7 @@ public class MediaDownloadView: UIView { shapeLayer1.path = bezierPath1.cgPath let fillColor1: UIColor = UIColor(white: 1.0, alpha: 0.4) shapeLayer1.fillColor = fillColor1.cgColor - shapeLayer1.fillRule = CAShapeLayerFillRule.evenOdd + shapeLayer1.fillRule = .evenOdd let bezierPath2 = UIBezierPath() bezierPath2.addArc(withCenter: center, radius: outerRadius, startAngle: startAngle, endAngle: endAngle, clockwise: true) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/MediaUploadView.swift b/Signal/src/ViewControllers/ConversationView/Cells/MediaUploadView.swift index f2159af58..1e13ae255 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/MediaUploadView.swift +++ b/Signal/src/ViewControllers/ConversationView/Cells/MediaUploadView.swift @@ -110,7 +110,7 @@ public class MediaUploadView: UIView { bezierPath2.append(UIBezierPath(ovalIn: outerCircleBounds)) shapeLayer2.path = bezierPath2.cgPath shapeLayer2.fillColor = UIColor(white: 1.0, alpha: 0.4).cgColor - shapeLayer2.fillRule = CAShapeLayerFillRule.evenOdd + shapeLayer2.fillRule = .evenOdd CATransaction.commit() } diff --git a/Signal/src/ViewControllers/CropScaleImageViewController.swift b/Signal/src/ViewControllers/CropScaleImageViewController.swift index 1c816ea8d..541b376df 100644 --- a/Signal/src/ViewControllers/CropScaleImageViewController.swift +++ b/Signal/src/ViewControllers/CropScaleImageViewController.swift @@ -184,7 +184,7 @@ import SignalMessaging path.usesEvenOddFillRule = true layer.path = path.cgPath - layer.fillRule = CAShapeLayerFillRule.evenOdd + layer.fillRule = .evenOdd layer.fillColor = UIColor.black.cgColor layer.opacity = 0.7 } diff --git a/Signal/src/ViewControllers/GifPicker/GifPickerViewController.swift b/Signal/src/ViewControllers/GifPicker/GifPickerViewController.swift index 1834d4396..35eacbe00 100644 --- a/Signal/src/ViewControllers/GifPicker/GifPickerViewController.swift +++ b/Signal/src/ViewControllers/GifPicker/GifPickerViewController.swift @@ -349,7 +349,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect path.append(UIBezierPath(rect: cellRect)) layer.path = path.cgPath - layer.fillRule = CAShapeLayerFillRule.evenOdd + layer.fillRule = .evenOdd layer.fillColor = UIColor.black.cgColor layer.opacity = 0.7 } diff --git a/Signal/src/ViewControllers/MediaGalleryViewController.swift b/Signal/src/ViewControllers/MediaGalleryViewController.swift index e252f7e43..b0ecda828 100644 --- a/Signal/src/ViewControllers/MediaGalleryViewController.swift +++ b/Signal/src/ViewControllers/MediaGalleryViewController.swift @@ -282,8 +282,8 @@ class MediaGalleryNavigationController: OWSNavigationController { presentationView.isHidden = true presentationView.clipsToBounds = true presentationView.layer.allowsEdgeAntialiasing = true - presentationView.layer.minificationFilter = CALayerContentsFilter.trilinear - presentationView.layer.magnificationFilter = CALayerContentsFilter.trilinear + presentationView.layer.minificationFilter = .trilinear + presentationView.layer.magnificationFilter = .trilinear presentationView.contentMode = .scaleAspectFit guard let navigationBar = self.navigationBar as? OWSNavigationBar else { diff --git a/Signal/src/ViewControllers/Registration/OnboardingSplashViewController.swift b/Signal/src/ViewControllers/Registration/OnboardingSplashViewController.swift index 7dfada0f2..755b8d7d7 100644 --- a/Signal/src/ViewControllers/Registration/OnboardingSplashViewController.swift +++ b/Signal/src/ViewControllers/Registration/OnboardingSplashViewController.swift @@ -17,8 +17,8 @@ public class OnboardingSplashViewController: OnboardingBaseViewController { let heroImage = UIImage(named: "onboarding_splash_hero") let heroImageView = UIImageView(image: heroImage) heroImageView.contentMode = .scaleAspectFit - heroImageView.layer.minificationFilter = CALayerContentsFilter.trilinear - heroImageView.layer.magnificationFilter = CALayerContentsFilter.trilinear + heroImageView.layer.minificationFilter = .trilinear + heroImageView.layer.magnificationFilter = .trilinear heroImageView.setCompressionResistanceLow() heroImageView.setContentHuggingVerticalLow() heroImageView.accessibilityIdentifier = "onboarding.splash." + "heroImageView" diff --git a/SignalMessaging/ViewControllers/MediaMessageView.swift b/SignalMessaging/ViewControllers/MediaMessageView.swift index 4f3da9010..f78c4dba9 100644 --- a/SignalMessaging/ViewControllers/MediaMessageView.swift +++ b/SignalMessaging/ViewControllers/MediaMessageView.swift @@ -138,8 +138,8 @@ public class MediaMessageView: UIView, OWSAudioPlayerDelegate { let audioPlayButton = UIButton() self.audioPlayButton = audioPlayButton setAudioIconToPlay() - audioPlayButton.imageView?.layer.minificationFilter = CALayerContentsFilter.trilinear - audioPlayButton.imageView?.layer.magnificationFilter = CALayerContentsFilter.trilinear + audioPlayButton.imageView?.layer.minificationFilter = .trilinear + audioPlayButton.imageView?.layer.magnificationFilter = .trilinear audioPlayButton.addTarget(self, action: #selector(audioPlayButtonPressed), for: .touchUpInside) let buttonSize = createHeroViewSize() audioPlayButton.autoSetDimension(.width, toSize: buttonSize) @@ -221,8 +221,8 @@ public class MediaMessageView: UIView, OWSAudioPlayerDelegate { } let imageView = UIImageView(image: image) - imageView.layer.minificationFilter = CALayerContentsFilter.trilinear - imageView.layer.magnificationFilter = CALayerContentsFilter.trilinear + imageView.layer.minificationFilter = .trilinear + imageView.layer.magnificationFilter = .trilinear let aspectRatio = image.size.width / image.size.height addSubviewWithScaleAspectFitLayout(view: imageView, aspectRatio: aspectRatio) contentView = imageView @@ -243,8 +243,8 @@ public class MediaMessageView: UIView, OWSAudioPlayerDelegate { } let imageView = UIImageView(image: image) - imageView.layer.minificationFilter = CALayerContentsFilter.trilinear - imageView.layer.magnificationFilter = CALayerContentsFilter.trilinear + imageView.layer.minificationFilter = .trilinear + imageView.layer.magnificationFilter = .trilinear let aspectRatio = image.size.width / image.size.height addSubviewWithScaleAspectFitLayout(view: imageView, aspectRatio: aspectRatio) contentView = imageView @@ -307,8 +307,8 @@ public class MediaMessageView: UIView, OWSAudioPlayerDelegate { let image = UIImage(named: imageName) assert(image != nil) let imageView = UIImageView(image: image) - imageView.layer.minificationFilter = CALayerContentsFilter.trilinear - imageView.layer.magnificationFilter = CALayerContentsFilter.trilinear + imageView.layer.minificationFilter = .trilinear + imageView.layer.magnificationFilter = .trilinear imageView.layer.shadowColor = UIColor.black.cgColor let shadowScaling = 5.0 imageView.layer.shadowRadius = CGFloat(2.0 * shadowScaling) diff --git a/SignalMessaging/Views/AvatarImageView.swift b/SignalMessaging/Views/AvatarImageView.swift index 1e08b37c3..5495bc2e8 100644 --- a/SignalMessaging/Views/AvatarImageView.swift +++ b/SignalMessaging/Views/AvatarImageView.swift @@ -32,8 +32,8 @@ public class AvatarImageView: UIImageView { func configureView() { self.autoPinToSquareAspectRatio() - self.layer.minificationFilter = CALayerContentsFilter.trilinear - self.layer.magnificationFilter = CALayerContentsFilter.trilinear + self.layer.minificationFilter = .trilinear + self.layer.magnificationFilter = .trilinear self.layer.masksToBounds = true self.layer.addSublayer(self.shadowLayer) @@ -57,7 +57,7 @@ public class AvatarImageView: UIImageView { // This can be any color since the fill should be clipped. self.shadowLayer.fillColor = UIColor.black.cgColor self.shadowLayer.path = shadowPath.cgPath - self.shadowLayer.fillRule = CAShapeLayerFillRule.evenOdd + self.shadowLayer.fillRule = .evenOdd self.shadowLayer.shadowColor = (Theme.isDarkThemeEnabled ? UIColor.white : UIColor.black).cgColor self.shadowLayer.shadowRadius = 0.5 self.shadowLayer.shadowOpacity = 0.15 @@ -203,7 +203,7 @@ public class AvatarImageButton: UIButton { // This can be any color since the fill should be clipped. shadowLayer.fillColor = UIColor.black.cgColor shadowLayer.path = shadowPath.cgPath - shadowLayer.fillRule = CAShapeLayerFillRule.evenOdd + shadowLayer.fillRule = .evenOdd shadowLayer.shadowColor = (Theme.isDarkThemeEnabled ? UIColor.white : UIColor.black).cgColor shadowLayer.shadowRadius = 0.5 shadowLayer.shadowOpacity = 0.15 @@ -226,8 +226,8 @@ public class AvatarImageButton: UIButton { autoPinToSquareAspectRatio() - layer.minificationFilter = CALayerContentsFilter.trilinear - layer.magnificationFilter = CALayerContentsFilter.trilinear + layer.minificationFilter = .trilinear + layer.magnificationFilter = .trilinear layer.masksToBounds = true layer.addSublayer(shadowLayer)