From ca1f8efdad4033f0d502cd1fa0175eceacaabd2c Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 10 Apr 2018 13:09:18 -0400 Subject: [PATCH] Move 'never clear' view to proper subfolder. --- Signal.xcodeproj/project.pbxproj | 20 +++++++++---------- .../Utils/NeverClearView.swift | 13 ------------ Signal/src/views/NeverClearView.swift | 18 +++++++++++++++++ 3 files changed, 28 insertions(+), 23 deletions(-) delete mode 100644 Signal/src/ViewControllers/Utils/NeverClearView.swift create mode 100644 Signal/src/views/NeverClearView.swift diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index 8d325171c..2524d09d6 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -48,6 +48,7 @@ 34330A5C1E787A9800DF2FB9 /* dripicons-v2.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 34330A5B1E787A9800DF2FB9 /* dripicons-v2.ttf */; }; 34330A5E1E787BD800DF2FB9 /* ElegantIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 34330A5D1E787BD800DF2FB9 /* ElegantIcons.ttf */; }; 34330AA31E79686200DF2FB9 /* OWSProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = 34330AA21E79686200DF2FB9 /* OWSProgressView.m */; }; + 34386A54207D271D009F5D9C /* NeverClearView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34386A53207D271C009F5D9C /* NeverClearView.swift */; }; 343A65951FC47D5E000477A1 /* DebugUISyncMessages.m in Sources */ = {isa = PBXBuildFile; fileRef = 343A65941FC47D5E000477A1 /* DebugUISyncMessages.m */; }; 343A65981FC4CFE7000477A1 /* ConversationScrollButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 343A65961FC4CFE6000477A1 /* ConversationScrollButton.m */; }; 34480B361FD0929200BC14EF /* ShareAppExtensionContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 34480B351FD0929200BC14EF /* ShareAppExtensionContext.m */; }; @@ -223,7 +224,6 @@ 34E3EF101EFC2684007F6822 /* DebugUIPage.m in Sources */ = {isa = PBXBuildFile; fileRef = 34E3EF0F1EFC2684007F6822 /* DebugUIPage.m */; }; 34F308A21ECB469700BB7697 /* OWSBezierPathView.m in Sources */ = {isa = PBXBuildFile; fileRef = 34F308A11ECB469700BB7697 /* OWSBezierPathView.m */; }; 34FD93701E3BD43A00109093 /* OWSAnyTouchGestureRecognizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 34FD936F1E3BD43A00109093 /* OWSAnyTouchGestureRecognizer.m */; }; - 35BC54F2205409B900283EF6 /* NeverClearView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35BF1A52204BF9B300AF5900 /* NeverClearView.swift */; }; 4503F1BE20470A5B00CEE724 /* classic-quiet.aifc in Resources */ = {isa = PBXBuildFile; fileRef = 4503F1BB20470A5B00CEE724 /* classic-quiet.aifc */; }; 4503F1BF20470A5B00CEE724 /* classic.aifc in Resources */ = {isa = PBXBuildFile; fileRef = 4503F1BC20470A5B00CEE724 /* classic.aifc */; }; 4503F1C3204711D300CEE724 /* OWS107LegacySounds.m in Sources */ = {isa = PBXBuildFile; fileRef = 4503F1C1204711D200CEE724 /* OWS107LegacySounds.m */; }; @@ -616,6 +616,7 @@ 34330A5D1E787BD800DF2FB9 /* ElegantIcons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = ElegantIcons.ttf; sourceTree = ""; }; 34330AA11E79686200DF2FB9 /* OWSProgressView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSProgressView.h; sourceTree = ""; }; 34330AA21E79686200DF2FB9 /* OWSProgressView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSProgressView.m; sourceTree = ""; }; + 34386A53207D271C009F5D9C /* NeverClearView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NeverClearView.swift; sourceTree = ""; }; 343A65931FC47D5D000477A1 /* DebugUISyncMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugUISyncMessages.h; sourceTree = ""; }; 343A65941FC47D5E000477A1 /* DebugUISyncMessages.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DebugUISyncMessages.m; sourceTree = ""; }; 343A65961FC4CFE6000477A1 /* ConversationScrollButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConversationScrollButton.m; sourceTree = ""; }; @@ -861,7 +862,6 @@ 34F308A11ECB469700BB7697 /* OWSBezierPathView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSBezierPathView.m; sourceTree = ""; }; 34FD936E1E3BD43A00109093 /* OWSAnyTouchGestureRecognizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OWSAnyTouchGestureRecognizer.h; path = views/OWSAnyTouchGestureRecognizer.h; sourceTree = ""; }; 34FD936F1E3BD43A00109093 /* OWSAnyTouchGestureRecognizer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OWSAnyTouchGestureRecognizer.m; path = views/OWSAnyTouchGestureRecognizer.m; sourceTree = ""; }; - 35BF1A52204BF9B300AF5900 /* NeverClearView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NeverClearView.swift; sourceTree = ""; }; 435EAC2E5E22D3F087EB3192 /* Pods-SignalShareExtension.app store release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalShareExtension.app store release.xcconfig"; path = "Pods/Target Support Files/Pods-SignalShareExtension/Pods-SignalShareExtension.app store release.xcconfig"; sourceTree = ""; }; 4503F1BB20470A5B00CEE724 /* classic-quiet.aifc */ = {isa = PBXFileReference; lastKnownFileType = file; path = "classic-quiet.aifc"; sourceTree = ""; }; 4503F1BC20470A5B00CEE724 /* classic.aifc */ = {isa = PBXFileReference; lastKnownFileType = file; path = classic.aifc; sourceTree = ""; }; @@ -1695,7 +1695,6 @@ 34D1F0BE1F8EC1760066283D /* Utils */ = { isa = PBXGroup; children = ( - 35BF1A52204BF9B300AF5900 /* NeverClearView.swift */, 34D1F0BF1F8EC1760066283D /* MessageRecipientStatusUtils.swift */, ); path = Utils; @@ -2034,25 +2033,26 @@ 76EB052B18170B33006006FC /* Views */ = { isa = PBXGroup; children = ( - 45E5A6981F61E6DD001E4A8A /* MarqueeLabel.swift */, 452EA09D1EA7ABE00078744B /* AttachmentPointerView.swift */, 34E3E5671EC4B19400495BAC /* AudioProgressView.swift */, 451764291DE939FD00EDB8B9 /* ContactCell.swift */, - 45A663C41F92EC760027B59E /* GroupTableViewCell.swift */, 451764281DE939FD00EDB8B9 /* ContactCell.xib */, + 4523149F1F7E9E18003A428C /* DirectionalPanGestureRecognizer.swift */, + 45A663C41F92EC760027B59E /* GroupTableViewCell.swift */, + 45E5A6981F61E6DD001E4A8A /* MarqueeLabel.swift */, + 34386A53207D271C009F5D9C /* NeverClearView.swift */, 34F308A01ECB469700BB7697 /* OWSBezierPathView.h */, 34F308A11ECB469700BB7697 /* OWSBezierPathView.m */, 459311FA1D75C948008DD4F0 /* OWSDeviceTableViewCell.h */, 459311FB1D75C948008DD4F0 /* OWSDeviceTableViewCell.m */, 34330AA11E79686200DF2FB9 /* OWSProgressView.h */, 34330AA21E79686200DF2FB9 /* OWSProgressView.m */, - 45A6DAD51EBBF85500893231 /* ReminderView.swift */, - 450D19111F85236600970622 /* RemoteVideoView.h */, - 450D19121F85236600970622 /* RemoteVideoView.m */, - 4523149F1F7E9E18003A428C /* DirectionalPanGestureRecognizer.swift */, 45D308AB2049A439000189E4 /* PinEntryView.h */, 45D308AC2049A439000189E4 /* PinEntryView.m */, 457F671A20746193000EABCD /* QuotedReplyPreview.swift */, + 45A6DAD51EBBF85500893231 /* ReminderView.swift */, + 450D19111F85236600970622 /* RemoteVideoView.h */, + 450D19121F85236600970622 /* RemoteVideoView.m */, ); name = Views; path = views; @@ -3189,9 +3189,9 @@ 4585C4681ED8F8D200896AEA /* SafetyNumberConfirmationAlert.swift in Sources */, 450D19131F85236600970622 /* RemoteVideoView.m in Sources */, B6B9ECFC198B31BA00C620D3 /* PushManager.m in Sources */, + 34386A54207D271D009F5D9C /* NeverClearView.swift in Sources */, 45DF5DF21DDB843F00C936C7 /* CompareSafetyNumbersActivity.swift in Sources */, 458DE9D91DEE7B360071BB03 /* OWSWebRTCDataProtos.pb.m in Sources */, - 35BC54F2205409B900283EF6 /* NeverClearView.swift in Sources */, 451166C01FD86B98000739BA /* AccountManager.swift in Sources */, 34D2CCD220618B3000CB1A14 /* OWSBackupLazyRestoreJob.swift in Sources */, 3430FE181F7751D4000EC51B /* GiphyAPI.swift in Sources */, diff --git a/Signal/src/ViewControllers/Utils/NeverClearView.swift b/Signal/src/ViewControllers/Utils/NeverClearView.swift deleted file mode 100644 index 66935e964..000000000 --- a/Signal/src/ViewControllers/Utils/NeverClearView.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. -// - -@objc class NeverClearView: UIView { - override var backgroundColor: UIColor? { - didSet { - if backgroundColor?.cgColor.alpha == 0 { - backgroundColor = oldValue - } - } - } -} diff --git a/Signal/src/views/NeverClearView.swift b/Signal/src/views/NeverClearView.swift new file mode 100644 index 000000000..1d3ddc498 --- /dev/null +++ b/Signal/src/views/NeverClearView.swift @@ -0,0 +1,18 @@ +// +// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// + +// This view can be used to safely fill a region of a table +// or collection view cell. These cells change the background +// colors of their subviews when selected. This can inadvertently +// change the color of filled subviews. This view will +// reject a new background once its background has been set. +@objc class NeverClearView: UIView { + override var backgroundColor: UIColor? { + didSet { + if backgroundColor?.cgColor.alpha == 0 { + backgroundColor = oldValue + } + } + } +}