From 76891c843158192c124b4a324fa17d58863a5b66 Mon Sep 17 00:00:00 2001 From: Alexandre Podlewski Date: Thu, 25 Apr 2024 18:55:11 +0200 Subject: [PATCH] Fix build warnings --- FormDemoTests/FormDirectionManager.swift | 2 +- Modules/ADFormController/Classes/FormBaseTableViewCell.swift | 2 +- Modules/ADFormController/Classes/FormDirectionManager.swift | 2 +- Modules/ADFormController/Classes/FormInputTableViewCell.swift | 4 ++-- .../ADFormController/Classes/SimpleFormPickerDataSource.swift | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/FormDemoTests/FormDirectionManager.swift b/FormDemoTests/FormDirectionManager.swift index 5f44ec8..433107a 100644 --- a/FormDemoTests/FormDirectionManager.swift +++ b/FormDemoTests/FormDirectionManager.swift @@ -14,7 +14,7 @@ enum AccessoryViewDirection: Int { case next } -protocol FormDirectionManagerDelegate: class { +protocol FormDirectionManagerDelegate: AnyObject { func formDirectionManager(_ formDirectionManager: FormDirectionManager, canEditCellAtIndexPath indexPath: IndexPath) -> Bool } diff --git a/Modules/ADFormController/Classes/FormBaseTableViewCell.swift b/Modules/ADFormController/Classes/FormBaseTableViewCell.swift index 34d336f..182c8c4 100644 --- a/Modules/ADFormController/Classes/FormBaseTableViewCell.swift +++ b/Modules/ADFormController/Classes/FormBaseTableViewCell.swift @@ -8,7 +8,7 @@ import Foundation import UIKit -protocol FormTableViewCellActionHandler: class { +protocol FormTableViewCellActionHandler: AnyObject { func handleLeftViewAction(from cell: FormBaseTableViewCell) func handleRightViewAction(from cell: FormBaseTableViewCell) } diff --git a/Modules/ADFormController/Classes/FormDirectionManager.swift b/Modules/ADFormController/Classes/FormDirectionManager.swift index ce82fd3..5cf66f4 100644 --- a/Modules/ADFormController/Classes/FormDirectionManager.swift +++ b/Modules/ADFormController/Classes/FormDirectionManager.swift @@ -14,7 +14,7 @@ enum AccessoryViewDirection: Int { case next } -protocol FormDirectionManagerDelegate: class { +protocol FormDirectionManagerDelegate: AnyObject { func formDirectionManager(_ formDirectionManager: FormDirectionManager, canEditCellAt indexPath: IndexPath) -> Bool } diff --git a/Modules/ADFormController/Classes/FormInputTableViewCell.swift b/Modules/ADFormController/Classes/FormInputTableViewCell.swift index 004b070..6f99eff 100644 --- a/Modules/ADFormController/Classes/FormInputTableViewCell.swift +++ b/Modules/ADFormController/Classes/FormInputTableViewCell.swift @@ -18,7 +18,7 @@ protocol FormTextInputTableViewCell { func apply(configuration: FormCellTextConfiguration) } -protocol FormTextInputTableViewCellDelegate: class { +protocol FormTextInputTableViewCellDelegate: AnyObject { func textInputTableViewCellDidBeginEditing(_ cell: FormTextInputTableViewCell) func textInputTableViewCellShouldReturn(_ cell: FormTextInputTableViewCell) -> Bool func textInputTableViewCellValueChanged(_ cell: FormTextInputTableViewCell) @@ -32,6 +32,6 @@ protocol FormBoolInputTableViewCell { func apply(configuration: FormCellBoolConfiguration) } -protocol FormBoolInputTableViewCellDelegate: class { +protocol FormBoolInputTableViewCellDelegate: AnyObject { func boolInputTableViewCellDidChangeValue(_ cell: FormBoolInputTableViewCell) } diff --git a/Modules/ADFormController/Classes/SimpleFormPickerDataSource.swift b/Modules/ADFormController/Classes/SimpleFormPickerDataSource.swift index e67fbef..335e4b2 100644 --- a/Modules/ADFormController/Classes/SimpleFormPickerDataSource.swift +++ b/Modules/ADFormController/Classes/SimpleFormPickerDataSource.swift @@ -34,7 +34,7 @@ import Foundation } open func selectedIndexes(from string: String) -> [Int] { - guard let index = options.index(of: string) else { + guard let index = options.firstIndex(of: string) else { return [0] } return [index]