Skip to content

Commit f0fb82f

Browse files
nepaul0xcj
authored andcommitted
fix(Xcode14): using @available with stored properties
1 parent c5dc96e commit f0fb82f

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import PackageDescription
66
let package = Package(
77
name: "SectionIndexView",
88
platforms: [
9-
.iOS(.v9),
9+
.iOS(.v10),
1010
],
1111
products: [
1212
// Products define the executables and libraries a package produces, and make them visible to other packages.

SectionIndexViewDemo/SectionIndexViewDemo.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@
317317
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
318318
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
319319
CODE_SIGN_STYLE = Automatic;
320-
DEVELOPMENT_TEAM = 76TH7FM7MJ;
320+
DEVELOPMENT_TEAM = S3J7V3MKL5;
321321
INFOPLIST_FILE = SectionIndexViewDemo/Info.plist;
322322
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
323323
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -335,7 +335,7 @@
335335
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
336336
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
337337
CODE_SIGN_STYLE = Automatic;
338-
DEVELOPMENT_TEAM = 76TH7FM7MJ;
338+
DEVELOPMENT_TEAM = S3J7V3MKL5;
339339
INFOPLIST_FILE = SectionIndexViewDemo/Info.plist;
340340
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
341341
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";

Sources/SectionIndexView/SectionIndexView.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,7 @@ public class SectionIndexView: UIView {
8080

8181
@objc public private(set) var selectedItem: SectionIndexViewItem?
8282
@objc public private(set) var isTouching = false
83-
84-
@available(iOS 10.0, *)
85-
private lazy var generator: UIImpactFeedbackGenerator = {
86-
return UIImpactFeedbackGenerator.init(style: .light)
87-
}()
88-
83+
8984
private var items = [SectionIndexViewItem]()
9085

9186
// MARK: - Func
@@ -106,6 +101,7 @@ public class SectionIndexView: UIView {
106101

107102
@objc public func impact() {
108103
guard #available(iOS 10.0, *) else { return }
104+
var generator: UIImpactFeedbackGenerator = UIImpactFeedbackGenerator.init(style: .light)
109105
generator.prepare()
110106
generator.impactOccurred()
111107
}

0 commit comments

Comments
 (0)