"SwiftAutoScreenShot" is a library for semi-automatically creating and simultaneously sending screenshots of your app to the XXX service
Add the following line to your Package.swift
file:
dependencies: [
.package(url: "https://github.com/xtone/SwiftAutoScreenShot", .branch("main")),
]
or
Please select PackageDependencies
and search for SwiftAutoScreenShot
. Afterwards, select branch and main under Dependency Rule.
To save screenshots to your device, please set the Privacy - Photo Library Usage Description
in your info.plist.
To use SwiftAutoScreenShot, first obtain the apiKey and project ID from the web page, and then perform the initialization process in the AppDelegate.
import SwiftAutoScreenShot
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
AutoScreenShot.shared.setup(apiKey: "your api key", projectId: "your project id")
}
Below is a simple sample code for taking a screenshot. Please check the Usage for more details.
import SwiftAutoScreenShot
import UIKit
class SampleViewController: UIViewController {
override func viewDidAppear() {
super.viewDidAppear()
AutoScreenShot.shared.takeScreenShot(self)
}
}
Detailed references can be found here.
Screenshots cannot be obtained in the following cases:
There may be cases where the progress indicating the upload progress of screenshots is not displayed.
Due to a bug in Xcode, it is no longer possible to specify multiple targets. This issue has been confirmed to be fixed in Xcode 14.3. Additionally, when specifying multiple targets, please add them in the project settings under General > Frameworks, Libraries, and Embedded Content.
link |
Stars: 0 |
Last commit: 4 days ago |
2024_0422_ver0.10095
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics