Git Product home page Git Product logo

layoutinspector's Introduction

Introduction

CI Status Version License Platform

Features

  • Inspect layouts directly on iOS devices
  • 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)
  • Objective-C compatible
  • 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)
LayoutInspector.shared.showLayout()
  • automatically when taking app screenshot
LayoutInspector.shared.setAutoTrigger(.screenshot)
  • automatically on device shaking
LayoutInspector.shared.setAutoTrigger(.shake)

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.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.

layoutinspector's People

Contributors

atahhan avatar edm17 avatar isavinskyi avatar isavynskyi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

layoutinspector's Issues

Not found on CocoaPods

# pod install
Analyzing dependencies
[!] Unable to find a specification for `LayoutInspector`

It may better to remove #if DEBUG

Basically large APP will use multiple scheme and use different macro to distinguish, most of them may not in debug mode, and also we don't Introduce debug tool in release from pods, so it's no need to add #if DEBUG in func startLayoutInspection()

minimum iOS support version

For my project
It's platform :ios, '9.0' in podfile
I want to install and enable this library on iOS 11 +, is there any way ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.