Skip to content

Commit

Permalink
Set public func and constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
prongbang committed Feb 19, 2022
1 parent 47ab3eb commit c9400e4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 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.0.2"),
.package(url: "https://github.com/prongbang/ScreenProtectorKit.git", from: "1.0.3"),
],
)
```
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.0.2'
s.version = '1.0.3'
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
16 changes: 8 additions & 8 deletions Sources/ScreenProtectorKit/ScreenProtectorKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ScreenProtectorKit {
private var screenBlur: UIView? = nil
private var screenPrevent = UITextField()

init(window: UIWindow?) {
public init(window: UIWindow?) {
self.window = window
}

Expand All @@ -37,7 +37,7 @@ public class ScreenProtectorKit {
//
// return true
// }
func configurePreventionScreenshot() {
public func configurePreventionScreenshot() {
guard let w = window else { return }

if (!w.subviews.contains(screenPrevent)) {
Expand All @@ -54,7 +54,7 @@ public class ScreenProtectorKit {
// override func applicationDidBecomeActive(_ application: UIApplication) {
// screenProtectorKit.enabledPreventScreenshot()
// }
func enabledPreventScreenshot() {
public func enabledPreventScreenshot() {
screenPrevent.isSecureTextEntry = true
}

Expand All @@ -63,7 +63,7 @@ public class ScreenProtectorKit {
// override func applicationWillResignActive(_ application: UIApplication) {
// screenProtectorKit.disablePreventScreenshot()
// }
func disablePreventScreenshot() {
public func disablePreventScreenshot() {
screenPrevent.isSecureTextEntry = false
}

Expand All @@ -72,7 +72,7 @@ public class ScreenProtectorKit {
// override func applicationWillResignActive(_ application: UIApplication) {
// screenProtectorKit.enabledBlurScreen()
// }
func enabledBlurScreen(style: UIBlurEffect.Style = UIBlurEffect.Style.light) {
public func enabledBlurScreen(style: UIBlurEffect.Style = UIBlurEffect.Style.light) {
screenBlur = UIScreen.main.snapshotView(afterScreenUpdates: false)
let blurEffect = UIBlurEffect(style: style)
let blurBackground = UIVisualEffectView(effect: blurEffect)
Expand All @@ -86,7 +86,7 @@ public class ScreenProtectorKit {
// override func applicationDidBecomeActive(_ application: UIApplication) {
// screenProtectorKit.disableBlurScreen()
// }
func disableBlurScreen() {
public func disableBlurScreen() {
screenBlur?.removeFromSuperview()
screenBlur = nil
}
Expand All @@ -96,7 +96,7 @@ public class ScreenProtectorKit {
// override func applicationWillResignActive(_ application: UIApplication) {
// screenProtectorKit.enabledImageScreen(named: "LaunchImage")
// }
func enabledImageScreen(named: String) {
public func enabledImageScreen(named: String) {
screenImage = UIImageView(frame: UIScreen.main.bounds)
screenImage?.image = UIImage(named: named)
screenImage?.isUserInteractionEnabled = false
Expand All @@ -110,7 +110,7 @@ public class ScreenProtectorKit {
// override func applicationDidBecomeActive(_ application: UIApplication) {
// screenProtectorKit.disableImageScreen()
// }
func disableImageScreen() {
public func disableImageScreen() {
screenImage?.removeFromSuperview()
screenImage = nil
}
Expand Down
3 changes: 2 additions & 1 deletion Tests/ScreenProtectorKitTests/ScreenProtectorKitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ 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.
XCTAssertEqual(ScreenProtectorKit().text, "Hello, World!")
let screenProtectorKit = ScreenProtectorKit(window: nil)
XCTAssertEqual(screenProtectorKit != nil, true)
}
}

0 comments on commit c9400e4

Please sign in to comment.