DebugHead 3.0.0

DebugHead 3.0.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Mar 2020
SPMSupports SPM

Maintained by Koji Murata.




DebugHead 3.0.0

  • By
  • Tomoya Hirano and Koji Murata

DebugHead

Platform Language CocoaPods Carthage compatible License

Screenshot

About DebugHead

DebugHead is a library that arranges buttons that display the debug menu on the screen. You can also move the button by dragging it. You can also add menu functions yourself.

Example

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

Usage

Initialize

Specify the class of the menu you want to display first. DebugHead is displayed when prepare is called.

Please do not call in production environment.

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
  DebugHead.sharedInstance.prepare(menuClasses: [DebugMenuExit.self, DebugMenuHideDebugHead.self/*, and your plugins */])
}

To Create Plugins

You can create menus by conforming to the DebugMenu protocol.

public class DebugMenuFoo: DebugMenu {
  public static let debugMenuTitle = "Title"
  public static let debugMenuDangerLevel = DebugMenuDangerLevel.[None or Low or High or Extreme]
  public static let debugMenuAccessoryType = UITableViewCellAccessoryType.None
  public static func debugMenuSelected(debugHead: UIView, debugMenuTableViewController: UITableViewController) -> UIViewController? {
    // Do something
    return nil // If return a UIViewController instance, it will show.
  }
}

Other Features

  • You can remove the head with force touch.

Built-in Plugins

  • DebugMenuHideDebugHead
  • DebugMenuExit

Recommended Plugins

Installation

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

pod "DebugHead"

Author

License

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