LayoutInspector

by isavynskyi

isavynskyi / LayoutInspector

Tool to debug layouts directly on iOS devices: inspect layers in 3D and debug each visible view attr...

456 Stars 19 Forks Last release: 9 months ago (1.2.0) MIT License 149 Commits 7 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

Introduction

CI Status Version License Platform

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. To install it, simply add the following line to your Podfile:
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, LinkedIn

License

LayoutInspector is available under the MIT license. See the LICENSE file for more info.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.