GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mindbody/MBDebugPanel: Embed iOS app settings and shortcuts inside a hidden panel

BranchesTags
Open more actions menu

Latest commit

 

History

17 Commits
17 Commits

Folders and files

NameName
Last commit message
Last commit date
MBDebugPanel.xcodeproj
MBDebugPanel.xcodeproj
 
 
MBDebugPanel.xcworkspace
MBDebugPanel.xcworkspace
 
 
MBDebugPanelDemo
MBDebugPanelDemo
 
 
Sources/MBDebugPanel
Sources/MBDebugPanel
 
 
Tests
Tests
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
MBDebugPanel.podspec
MBDebugPanel.podspec
 
 
Package.swift
Package.swift
 
 
README.md
README.md
 
 
Rakefile
Rakefile
 
 

Repository files navigation

MBDebugPanel

Version Platform

MBDebugPanel is a development helper to let you easily add 'behind the scenes' shortcuts to your app. It is intended for use during development & debugging.

It offers a simple way to define helper tools, and present them in a Table View above the root window:

Basic Usage

// Define a component.
MBDebugPanelSimpleButtonComponent *buttonComponent
= [[MBDebugPanelSimpleButtonComponent alloc] initWithTitle:@"Trigger Some Call"
                                               buttonTitle:@"Do it!"
                                           onButtonPressed:^{
    /* 
      --- Your code goes here ---
      You can skip to a ViewController, trigger some API request,
       run some NSLog's ... anything you'd like to trigger.
    */
        
    // (Optionally) dismiss the panel immediately and return to your app.
    [MBDebugPanel hide];
}];

[MBDebugPanel addComponent:buttonComponent];

...

// Present the panel above the root view.
[MBDebugPanel show];

Included Components

MBDebugPanel ships with two MBDebugPanelComponent implementations to handle common scenarios:


`MBDebugPanelSimpleSwitchComponent` -- renders a UISwitch and description label

Imgur


`MBDebugPanelSimpleButtonComponent` -- renders a UIButton and description label

Imgur

##Make your own components You can easily define your own components by implementing the MBDebugPanelComponent protocol.

"Components" are objects that represent a row in the Debug Panel. Components need only conform to the MBDebugPanelComponent protocol and implement two methods:

@protocol MBDebugPanelComponent <NSObject>
@required

// The height this component will require in a UITableView when
// represented as a UITableViewCell
-(CGFloat)cellHeight;

// A UITableView cell representing the component.
// `indexPath` is passed so you can reuse cells with -[UITableView dequeueReusableCellWithIdentifier:forIndexPath]
-(UITableViewCell*)cellForDisplayInTableView:(UITableView*)tableView atIndexPath:(NSIndexPath*)indexPath;

##Removing components

Components can easily be removed from the DebugPanel. This is particularly useful if you want certain components only visible in certain contexts of your app.

For instance, if your app has a "Create Account" screen, you might wish to quickly fill in some text fields with fake information.

However, you only want this component visible when your app is on that screen:

@implementation MySignUpViewController

MBDebugPanelSimpleButtonComponent *makeFakeUserButton_;

-(void)viewWillAppear:(BOOL)animated
{
    makeFakeUserButton_ = [[MBDebugPanelSimpleButtonComponent alloc] initWithTitle:@"Make Fake User" buttonTitle:@"Create" onButtonPressed:^{
        self.firstName.text = @"Fake";
        self.lastName.text  = @"User";
        self.email.text = @"[email protected]"
        ...
        ...

        [MBDebugPanel hide];
    }];
    [MBDebugPanel addComponent:makeFakeUserButton_];
}

-(void)viewWillDisappear:(BOOL)animated
{
    [MBDebugPanel removeComponent:makeFakeUserButton_];
}

...

@end

Additional APIs

A detailed description of all available APIs is visible in MBDebugPanel.h

Demo App

To run the example project; clone the repo and open MBDebugPanel.xcworkspace. Select and run the Demo app's scheme.

Installation

MBDebugPanel is available through CocoaPods, to install it simply add the following line to your Podfile:

pod "MBDebugPanel"

Authors

Matthew Holden, [email protected]

License

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

About

Embed iOS app settings and shortcuts inside a hidden panel

Topics

iosios-framework

Resources

Readme
MIT license
Activity
Custom properties

Stars

9 stars

Watchers

89 watching

Forks

5 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.