Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/isavynskyi/LayoutInspector
Tool to debug layouts directly on iOS devices: inspect layers in 3D and debug each visible view attributes
https://github.com/isavynskyi/LayoutInspector
Last synced: 3 months ago
JSON representation
Tool to debug layouts directly on iOS devices: inspect layers in 3D and debug each visible view attributes
- Host: GitHub
- URL: https://github.com/isavynskyi/LayoutInspector
- Owner: isavynskyi
- License: mit
- Created: 2019-01-04T17:09:50.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-06T19:16:20.000Z (about 4 years ago)
- Last Synced: 2024-07-25T21:56:46.560Z (7 months ago)
- Language: Swift
- Homepage:
- Size: 15.1 MB
- Stars: 512
- Watchers: 11
- Forks: 24
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - LayoutInspector - Debug app layouts directly on iOS device: inspect layers in 3D and debug each visible view attributes. (Debugging / Getting Started)
- awesome-ios-star - LayoutInspector - Debug app layouts directly on iOS device: inspect layers in 3D and debug each visible view attributes. (Debugging / Getting Started)
- fucking-awesome-ios - LayoutInspector - Debug app layouts directly on iOS device: inspect layers in 3D and debug each visible view attributes. (Debugging / Getting Started)
- fucking-awesome-ios - LayoutInspector - Debug app layouts directly on iOS device: inspect layers in 3D and debug each visible view attributes. (Debugging / Getting Started)
README
# Introduction
[](https://travis-ci.org/isavynskyi/LayoutInspector)
[](https://cocoapods.org/pods/LayoutInspector)
[](https://cocoapods.org/pods/LayoutInspector)
[](https://cocoapods.org/pods/LayoutInspector)## Features
- [x] Inspect layouts directly on iOS devices
- [x] Inspection could be triggered only if app is running under `DEBUG` build configuration, so it won't affect any other kind of the app builds (i.e. `RELEASE`)
- [x] Objective-C compatible
- [x] Works on all devices with iOS 11.0+## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
- iOS 11.0 and higher
- Xcode 10.3 and higher
- Swift 5.0 and higher## Installation
`LayoutInspector` is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'LayoutInspector'
```## Usage
**Layout inspection could be trigger:**
- manually whenever you want (on some actions, events, notifications etc)
```swift
LayoutInspector.shared.showLayout()
```- automatically when taking app screenshot
```swift
LayoutInspector.shared.setAutoTrigger(.screenshot)
```- automatically on device shaking
```swift
LayoutInspector.shared.setAutoTrigger(.shake)
```**Swift**
```swift
import LayoutInspector@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
LayoutInspector.shared.setAutoTrigger(.screenshot)
return true
}
}```
**Objective-C**
```obj-c
@import LayoutInspector;@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[LayoutInspector.shared setAutoTrigger:AutoTriggerScreenshot];
return YES;
}@end
```## Changelog
| Version | Description |
| ------------- | ------------- |
| `1.2.1` | 📝 Font attribute added to inspection pane|
| `1.2.0` | 👋 Shake gesture added to trigger layout inspection
🧰 CI configuration upgrade|
| `1.1.0` | 🏎️ Swift 5.0 and ABI stability in da house
✈️ New build system activated
🔌 Dropped iOS 10 support|
| `1.0.0` | 🎉 Release 1.0
👮 Test coverage added|
| `0.2.0` | Pre-release: Objective-C compatibility 👦 |
| `0.1.1` | Pre-release: fixed Lint warnings 👶 |
| `0.1.0` | Pre-release: initial version 🎬 |## Author
Ihor Savynskyi\
✉️ [email protected]\
🌎 [Twitter](https://twitter.com/iWadedunk), [LinkedIn](https://www.linkedin.com/in/isavynskyi/)## License
LayoutInspector is available under the MIT license. See the LICENSE file for more info.