From 80b445ee3879674b8f7f802b3ab85b7366b95b6c Mon Sep 17 00:00:00 2001 From: Jax DesMarais-Leder Date: Fri, 1 Dec 2023 13:26:58 -0600 Subject: [PATCH] remove CustomButton and CustomTextField UIKit shared components --- Demo/Demo.xcodeproj/project.pbxproj | 16 --------- Demo/Demo/Views/CustomButton.swift | 52 --------------------------- Demo/Demo/Views/CustomTextField.swift | 17 --------- 3 files changed, 85 deletions(-) delete mode 100644 Demo/Demo/Views/CustomButton.swift delete mode 100644 Demo/Demo/Views/CustomTextField.swift diff --git a/Demo/Demo.xcodeproj/project.pbxproj b/Demo/Demo.xcodeproj/project.pbxproj index 73a9be1e5..10e6737ae 100644 --- a/Demo/Demo.xcodeproj/project.pbxproj +++ b/Demo/Demo.xcodeproj/project.pbxproj @@ -74,8 +74,6 @@ BE9F36D82745490400AFC7DA /* FloatingLabelTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE9F36D72745490400AFC7DA /* FloatingLabelTextField.swift */; }; BECD84A027036DC2007CCAE4 /* Environment.swift in Sources */ = {isa = PBXBuildFile; fileRef = BECD849F27036DC2007CCAE4 /* Environment.swift */; }; BECD84A227036DDB007CCAE4 /* Intent.swift in Sources */ = {isa = PBXBuildFile; fileRef = BECD84A127036DDB007CCAE4 /* Intent.swift */; }; - BED041AF270CA0FB00C80954 /* CustomButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = BED041AE270CA0FB00C80954 /* CustomButton.swift */; }; - BED041B1270CB33900C80954 /* CustomTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = BED041B0270CB33900C80954 /* CustomTextField.swift */; }; BED042312710833F00C80954 /* CardType.swift in Sources */ = {isa = PBXBuildFile; fileRef = BED042302710833F00C80954 /* CardType.swift */; }; BED04233271084DF00C80954 /* CardFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BED04232271084DF00C80954 /* CardFormatter.swift */; }; BEDE304A275EA33500D275FD /* UIViewController+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = BEDE3049275EA33500D275FD /* UIViewController+Extension.swift */; }; @@ -202,8 +200,6 @@ BE9F36D72745490400AFC7DA /* FloatingLabelTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FloatingLabelTextField.swift; sourceTree = ""; }; BECD849F27036DC2007CCAE4 /* Environment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Environment.swift; sourceTree = ""; }; BECD84A127036DDB007CCAE4 /* Intent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Intent.swift; sourceTree = ""; }; - BED041AE270CA0FB00C80954 /* CustomButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomButton.swift; sourceTree = ""; }; - BED041B0270CB33900C80954 /* CustomTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTextField.swift; sourceTree = ""; }; BED042302710833F00C80954 /* CardType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardType.swift; sourceTree = ""; }; BED04232271084DF00C80954 /* CardFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardFormatter.swift; sourceTree = ""; }; BEDE3049275EA33500D275FD /* UIViewController+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+Extension.swift"; sourceTree = ""; }; @@ -363,7 +359,6 @@ BE1766B526FA562B007EF438 /* Networking */, BEDE3047275E998700D275FD /* SwiftUIComponents */, BE4876A827567D4200802EAF /* ViewModels */, - BEE0EB6326FD10D90021AD42 /* Views */, 3BCCFE482A9D96CA00C5102F /* DemoApp.swift */, ); path = Demo; @@ -474,15 +469,6 @@ path = Extensions; sourceTree = ""; }; - BEE0EB6326FD10D90021AD42 /* Views */ = { - isa = PBXGroup; - children = ( - BED041AE270CA0FB00C80954 /* CustomButton.swift */, - BED041B0270CB33900C80954 /* CustomTextField.swift */, - ); - path = Views; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -613,7 +599,6 @@ 53B9E8EA28C93B4400719239 /* OrderRequestHelpers.swift in Sources */, 3BCCFE4B2A9D985F00C5102F /* FeatureSelectionView.swift in Sources */, CB9ED44C283FDA900081F4DE /* PaymentButtonEnums+Extension.swift in Sources */, - BED041B1270CB33900C80954 /* CustomTextField.swift in Sources */, 3B80D50E2A291C0800D2EAC4 /* ClientIDRequest.swift in Sources */, 3BA56FF02A9DCCFD0081D14F /* CardOrderApproveView.swift in Sources */, 3BDB348E2A7CB02C008100D7 /* SetupTokenRequest.swift in Sources */, @@ -625,7 +610,6 @@ 80F33CE826F8DE29006811B1 /* DemoMerchantAPI.swift in Sources */, 80F33CEF26F8E7CC006811B1 /* CreateOrderParams.swift in Sources */, BECD84A227036DDB007CCAE4 /* Intent.swift in Sources */, - BED041AF270CA0FB00C80954 /* CustomButton.swift in Sources */, 3BB7A9772A5CA6FD00C05140 /* MerchantIntegration.swift in Sources */, 3BA56FEE2A9DCC340081D14F /* OrderCreateCardResultView.swift in Sources */, BE1766B326F911A2007EF438 /* URLResponseError.swift in Sources */, diff --git a/Demo/Demo/Views/CustomButton.swift b/Demo/Demo/Views/CustomButton.swift deleted file mode 100644 index afa7ca71f..000000000 --- a/Demo/Demo/Views/CustomButton.swift +++ /dev/null @@ -1,52 +0,0 @@ -import UIKit - -class CustomButton: UIButton { - - let activityIndicator: UIActivityIndicatorView = { - let activityIndicator = UIActivityIndicatorView() - activityIndicator.hidesWhenStopped = true - activityIndicator.color = UIColor.white - return activityIndicator - }() - - convenience init(title: String) { - self.init(type: .system) - - setTitle(title, for: .normal) - translatesAutoresizingMaskIntoConstraints = false - titleLabel?.font = .preferredFont(forTextStyle: .body) - titleLabel?.numberOfLines = 0 - titleLabel?.textAlignment = .center - } - - override init(frame: CGRect) { - super.init(frame: .zero) - - activityIndicator.translatesAutoresizingMaskIntoConstraints = false - self.addSubview(activityIndicator) - setupConstraints() - } - - required init?(coder: NSCoder) { - super.init(coder: coder) - } - - func startAnimating() { - self.setTitleColor(.clear, for: .normal) - activityIndicator.startAnimating() - } - - func stopAnimating() { - DispatchQueue.main.async { - self.setTitleColor(.none, for: .normal) - self.activityIndicator.stopAnimating() - } - } - - private func setupConstraints() { - NSLayoutConstraint.activate([ - activityIndicator.centerXAnchor.constraint(equalTo: centerXAnchor), - activityIndicator.centerYAnchor.constraint(equalTo: centerYAnchor) - ]) - } -} diff --git a/Demo/Demo/Views/CustomTextField.swift b/Demo/Demo/Views/CustomTextField.swift deleted file mode 100644 index 76074d598..000000000 --- a/Demo/Demo/Views/CustomTextField.swift +++ /dev/null @@ -1,17 +0,0 @@ -import UIKit - -class CustomTextField: UITextField { - - convenience init(placeholderText: String? = nil, defaultValue: String? = nil) { - self.init(frame: .zero) - - translatesAutoresizingMaskIntoConstraints = false - borderStyle = .roundedRect - placeholder = placeholderText - text = defaultValue - clearButtonMode = .never - if let textDelegate = self as? UITextFieldDelegate { - delegate = textDelegate - } - } -}