Latest 1.0.0
Homepage https://github.com/isavynskyi/LayoutInspector
License MIT
Platforms ios 10.0
Authors

Introduction

CI Status
Version
License
Platform

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 10.0+

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 10.0+ / macOS 10.12+ / tvOS 10.0+ / watchOS 3.0+
  • Xcode 10.1+
  • Swift 4.2+

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)

    LayoutInspector.shared.showLayout()
  • automatically when taking app screenshot
    LayoutInspector.shared.setAutoTrigger(.screenshot)

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

@import LayoutInspector;

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [LayoutInspector.shared setAutoTrigger:AutoTriggerScreenshot];
    return YES;
}

@end

Changelog

Version Description
1.0.0 Test coverage
0.2.0 Objective-C compatibility
0.1.1 Fixed Lint warnings
0.1.0 Initial version

Author

Ihor Savynskyi
✉️ [email protected]
🌎 Twitter, LinkedIn

License

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

Latest podspec

{
    "name": "LayoutInspector",
    "version": "1.0.0",
    "summary": "LayoutInspector module",
    "description": "LayoutInspector is a tool for debugging layers on iOS devices. It allows to get common information about each visible view and to inspect layers in 3D mode",
    "homepage": "https://github.com/isavynskyi/LayoutInspector",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Ihor Savynskyi": "[email protected]"
    },
    "source": {
        "git": "https://github.com/isavynskyi/LayoutInspector.git",
        "tag": "1.0.0"
    },
    "social_media_url": "https://twitter.com/iWadedunk",
    "platforms": {
        "ios": "10.0"
    },
    "swift_version": "4.2",
    "source_files": "LayoutInspector/**/*.{h,m,swift}",
    "resources": [
        "LayoutInspector/**/*.xib",
        "LayoutInspector/**/*.xcassets",
        "LayoutInspector/**/*.storyboard"
    ]
}

Pin It on Pinterest

Share This