Some readme fixes
dependencies: [ .package(url: "https://github.com/nikitabelopotapov/Glance.git", .upToNextMajor(from: "0.0.1")) ]
Suggested use-case is to attach Glance to shake gesture in UIWindow extension
import Glance extension UIWindow { open override func motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?) { super.motionEnded(motion, with: event) if motion == .motionShake { Glance.main.debug(view: self) } } }
In order you have any custom or not supported view (such as view that drows in content in CGContext), you can provide custom.
final class CustomLayoutProvider: LayoutProvidable { var layoutMapper: LayoutMappable? func provide(for view: UIView, depth: inout Float, masterView: UIView?) -> [LayoutSnapshot] { return [LayoutSnapshot(image: UIImage(), depth: 1, frame: .zero, view: view)] } }
And then add it to Glance layout providers
@main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { Glance.main.addLayoutProvider(provider: CustomLayoutProvider(), viewClass: MyCustomClass.Type) return true } }
By tapping any view in Glance main screen you can inspect view properties. Now this feature is not fully implemented.
Now this feature is not fully implemented.
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
Glance
Glance is lightweight library that allows you debug view hierarchy right from you mobile device or simulator
Installation
Swift Package Manager
Usage
Suggested use-case is to attach Glance to shake gesture in UIWindow extension
Custom views
In order you have any custom or not supported view (such as view that drows in content in CGContext), you can provide custom.
And then add it to Glance layout providers
View properties (Beta)
By tapping any view in Glance main screen you can inspect view properties.
Now this feature is not fully implemented.
Contributing
Feel free to open Pull request or issue