Skip to content

Commit efac586

Browse files
committed
- Fixed one more Swift 6 error
1 parent 06d880e commit efac586

9 files changed

Lines changed: 43 additions & 21 deletions

File tree

Demo/Swift_Demo/Storyboard/Base.lproj/TestCases.storyboard

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23077.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
33
<device id="retina6_12" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23068.1"/>
77
<capability name="Named colors" minToolsVersion="9.0"/>
88
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
99
<capability name="System colors in document resources" minToolsVersion="11.0"/>
@@ -19,7 +19,7 @@
1919
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2020
<subviews>
2121
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="4s8-Og-pQg">
22-
<rect key="frame" x="20" y="625.66666666666663" width="353" height="88"/>
22+
<rect key="frame" x="20" y="630" width="353" height="88"/>
2323
<subviews>
2424
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Username" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Tq0-rf-tlo">
2525
<rect key="frame" x="0.0" y="0.0" width="353" height="34"/>
@@ -36,9 +36,13 @@
3636
</subviews>
3737
</stackView>
3838
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Hdv-V2-Ods">
39-
<rect key="frame" x="20" y="733.66666666666663" width="353" height="34.333333333333371"/>
40-
<state key="normal" title="Button"/>
41-
<buttonConfiguration key="configuration" style="filled" title="Login"/>
39+
<rect key="frame" x="20" y="738" width="353" height="30"/>
40+
<color key="backgroundColor" name="TouchBarBezel"/>
41+
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
42+
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
43+
<state key="normal" title="Login">
44+
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
45+
</state>
4246
<connections>
4347
<action selector="loginActin:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="UpW-Hx-Qc0"/>
4448
</connections>
@@ -403,6 +407,9 @@ f
403407
<namedColor name="EBEDF0">
404408
<color red="0.92156862745098034" green="0.92941176470588238" blue="0.94117647058823528" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
405409
</namedColor>
410+
<namedColor name="TouchBarBezel">
411+
<color red="0.68627450980392157" green="0.32156862745098042" blue="0.87058823529411766" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
412+
</namedColor>
406413
<systemColor name="labelColor">
407414
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
408415
</systemColor>

Demo/Swift_Demo/ViewController/SettingsViewController+TableView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ extension SettingsViewController {
212212

213213
cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
214214
cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
215-
cell.selectedColorView.backgroundColor = IQKeyboardManager.shared.toolbarConfiguration.tintColor;
215+
cell.selectedColorView.backgroundColor = IQKeyboardManager.shared.toolbarConfiguration.tintColor
216216
cell.selectedColorView.layer.borderColor = UIColor.lightGray.cgColor
217217
cell.selectedColorView.layer.borderWidth = 1.0
218218
return cell

Demo/Swift_Demo/ViewController/SettingsViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ extension SettingsViewController: UIColorPickerViewControllerDelegate {
227227
}
228228
}
229229

230-
func colorPickerViewController(_ viewController: UIColorPickerViewController, didSelect color: UIColor, continuously: Bool) {
230+
func colorPickerViewController(_ viewController: UIColorPickerViewController,
231+
didSelect color: UIColor, continuously: Bool) {
231232
viewController.dismiss(animated: true)
232233
if color.isEqual(UIColor.clear) {
233234
IQKeyboardManager.shared.toolbarConfiguration.tintColor = nil

IQKeyboardManagerSwift.podspec.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "IQKeyboardManagerSwift",
3-
"version": "7.0.3",
3+
"version": "7.1.0",
44
"source": {
55
"git": "https://github.com/hackiftekhar/IQKeyboardManager.git",
6-
"tag": "7.0.3"
6+
"tag": "7.1.0"
77
},
88
"summary": "Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView.",
99
"homepage": "https://github.com/hackiftekhar/IQKeyboardManager",

IQKeyboardManagerSwift/IQToolbar/IQTitleBarButtonItem.swift

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,23 @@ import UIKit
146146
private func updateAccessibility() {
147147
if title == nil || title?.isEmpty == true {
148148
isAccessibilityElement = false
149-
accessibilityTraits = .none
149+
// Swift 6: Reference to static property 'none'
150+
// is not concurrency-safe because it involves shared mutable state
151+
// accessibilityTraits = .none
152+
accessibilityTraits = .init(rawValue: 0)
150153
} else if titleButton?.isEnabled == true {
151154
isAccessibilityElement = true
152-
accessibilityTraits = .button
155+
// Swift 6: Reference to static property 'button'
156+
// is not concurrency-safe because it involves shared mutable state
157+
// accessibilityTraits = .button
158+
accessibilityTraits = .init(rawValue: 1)
153159
} else {
154160
isAccessibilityElement = true
155-
accessibilityTraits = .staticText
161+
162+
// Swift 6: Reference to static property 'staticText'
163+
// is not concurrency-safe because it involves shared mutable state
164+
// accessibilityTraits = .staticText
165+
accessibilityTraits = .init(rawValue: 64)
156166
}
157167
}
158168
}

IQKeyboardManagerSwift/IQToolbar/IQUIView+IQKeyboardToolbar.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ public extension IQKeyboardManagerWrapper where Base: UIView {
9797
}
9898
set(newValue) {
9999
if let base = base {
100+
// swiftlint:disable line_length
100101
objc_setAssociatedObject(base, &AssociatedKeys.placeholder, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
101102
toolbar.titleBarButton.title = drawingPlaceholder
103+
// swiftlint:enable line_length
102104
}
103105
}
104106
}

IQKeyboardManagerSwift/ReturnKeyHandler/IQKeyboardReturnKeyHandler+TextViewDelegate.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ extension IQKeyboardReturnKeyHandler: UITextViewDelegate {
9393
if delegate == nil {
9494

9595
if let unwrapDelegate: any UITextViewDelegate = textFieldViewCachedInfo(textView)?.textViewDelegate {
96-
let selector: Selector = #selector((any UITextViewDelegate).textView(_:shouldChangeTextIn:replacementText:))
96+
let selector = #selector((any UITextViewDelegate).textView(_:shouldChangeTextIn:replacementText:))
9797
if unwrapDelegate.responds(to: selector) {
9898
isReturn = (unwrapDelegate.textView?(textView,
9999
shouldChangeTextIn: range,
@@ -245,7 +245,8 @@ extension IQKeyboardReturnKeyHandler {
245245
return nil
246246
}
247247

248-
public func textView(_ aTextView: UITextView, willPresentEditMenuWith animator: any UIEditMenuInteractionAnimating) {
248+
public func textView(_ aTextView: UITextView,
249+
willPresentEditMenuWith animator: any UIEditMenuInteractionAnimating) {
249250
var aDelegate: (any UITextViewDelegate)? = delegate
250251

251252
if aDelegate == nil {
@@ -258,7 +259,8 @@ extension IQKeyboardReturnKeyHandler {
258259
aDelegate?.textView?(aTextView, willPresentEditMenuWith: animator)
259260
}
260261

261-
public func textView(_ aTextView: UITextView, willDismissEditMenuWith animator: any UIEditMenuInteractionAnimating) {
262+
public func textView(_ aTextView: UITextView,
263+
willDismissEditMenuWith animator: any UIEditMenuInteractionAnimating) {
262264
var aDelegate: (any UITextViewDelegate)? = delegate
263265

264266
if aDelegate == nil {

IQKeyboardManagerSwift/UIKitExtensions/IQUITextFieldView+Additions.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ public extension IQKeyboardManagerWrapper where Base: UIView {
111111
*/
112112
var resignOnTouchOutsideMode: IQEnableMode {
113113
get {
114-
if let base = base {
115-
return objc_getAssociatedObject(base, &AssociatedKeys.resignOnTouchOutsideMode) as? IQEnableMode ?? .default
114+
guard let base = base else {
115+
return .default
116116
}
117-
return .default
117+
return objc_getAssociatedObject(base, &AssociatedKeys.resignOnTouchOutsideMode) as? IQEnableMode ?? .default
118118
}
119119
set(newValue) {
120120
if let base = base {

Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PODS:
22
- IQDropDownTextField (4.0.1)
33
- IQDropDownTextFieldSwift (4.0.1)
44
- IQKeyboardManager (6.5.19)
5-
- IQKeyboardManagerSwift (7.0.3)
5+
- IQKeyboardManagerSwift (7.1.0)
66
- RSKPlaceholderTextView (6.1.0)
77
- SwiftLint (0.53.0)
88

@@ -31,7 +31,7 @@ SPEC CHECKSUMS:
3131
IQDropDownTextField: c3a149deb3c6c4bba5edd85d88b6e83e90e08f63
3232
IQDropDownTextFieldSwift: a194ca9853f29cb90c19af31fabe7d899b0049ca
3333
IQKeyboardManager: c8665b3396bd0b79402b4c573eac345a31c7d485
34-
IQKeyboardManagerSwift: f9c5dc36cba16ddd2e51fa7d51c34a2e083029b5
34+
IQKeyboardManagerSwift: 495f69040c27ee118ad2f4180d2c9b27b3ccb2e4
3535
RSKPlaceholderTextView: 52f26e643b6f9bbf16f45cd2bbe2181b6dfe090c
3636
SwiftLint: 5ce4d6a8ff83f1b5fd5ad5dbf30965d35af65e44
3737

0 commit comments

Comments
 (0)