Skip to content

Commit

Permalink
Check iOS 17, *
Browse files Browse the repository at this point in the history
  • Loading branch information
prongbang committed Oct 6, 2023
1 parent 85642af commit eed4217
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ In your `Package.swift` file, add `ScreenProtectorKit` dependency to correspondi
```swift
let package = Package(
dependencies: [
.package(url: "https://github.com/prongbang/ScreenProtectorKit.git", from: "1.3.0"),
.package(url: "https://github.com/prongbang/ScreenProtectorKit.git", from: "1.3.1"),
],
)
```
Expand Down
2 changes: 1 addition & 1 deletion ScreenProtectorKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'ScreenProtectorKit'
s.version = '1.3.0'
s.version = '1.3.1'
s.summary = 'Safe Data Leakage via Application Background Screenshot and Prevent Screenshot for iOS.'
s.homepage = 'https://github.com/prongbang/ScreenProtectorKit'
s.license = 'MIT'
Expand Down
6 changes: 5 additions & 1 deletion Sources/ScreenProtectorKit/ScreenProtectorKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ public class ScreenProtectorKit {
screenPrevent.centerYAnchor.constraint(equalTo: w.centerYAnchor).isActive = true
screenPrevent.centerXAnchor.constraint(equalTo: w.centerXAnchor).isActive = true
w.layer.superlayer?.addSublayer(screenPrevent.layer)
screenPrevent.layer.sublayers?.first?.addSublayer(w.layer)
if #available(iOS 17.0, *) {
screenPrevent.layer.sublayers?.last?.addSublayer(w.layer)
} else {
screenPrevent.layer.sublayers?.first?.addSublayer(w.layer)
}
}
}

Expand Down
2 changes: 0 additions & 2 deletions Tests/ScreenProtectorKitTests/ScreenProtectorKitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ final class ScreenProtectorKitTests: XCTestCase {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct
// results.
let screenProtectorKit = ScreenProtectorKit(window: nil)
XCTAssertEqual(screenProtectorKit != nil, true)
}
}

0 comments on commit eed4217

Please sign in to comment.