Git Product home page Git Product logo

dogekit's Introduction

DogeKit for iOS - Dogeumentation

Example

DogeKit was inspired by this project. Use it as you like.

Installation

If you use Cocoapods: pod 'DogeKit' then #include "DogeKit.h"

If not, just copy DogeKit.h and DogeKit.m into your project, and whereever you'd like to use it, just include it.

#include "DogeKit.h"

Usage

DogeKit *dk = [[DogeKit alloc] initWithTargetView:self.view]; //Init with a target view

[dk start]; //Start adding comments to your view

[dk stop]; //Stop adding comments to your view

Or you can use the sharedInstance. So you can have DogeKit supported all throughout your application if you want.

For example you can set it up so no matter what view you are in, if you tap on the navigation bar (or something) DogeKit will be triggered

In AppDelegate or somewhere

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
	
	UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController;
	
	// Add gesture recognizer to toggle DogeKit if two figer tap 
	// is done on navigation bar
	UITapGestureRecognizer *superTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(toggleDogeKit)];
       superTap.numberOfTapsRequired = 1;
       superTap.numberOfTouchesRequired = 2;
       [navigationController.navigationBar addGestureRecognizer:superTap];
       
	return YES;
}

// More AppDelegate Code...

- (void)toggleDogeKit {
    [[DogeKit sharedInstance] toggle];
}	

Extras

You can set your own 'things' too. These are then printed with prefixes. Prefixes are stored in a mutable array so you can change them as you like. You could consider changing out the prefixes for all the text in the user's current context. Such news. Much stocks. Wow.

dk.things = [NSMutableArray arrayWithObjects:<(id), ...>, nil];

DogeKitDelegate

'Things' get even more powerful when you implement the DogeKitDelgate.

// After initilization

dk.delegate = self;
[dk createThings]; //Will traverse your hierarchy and pull out words and feed them to your delegate method.

#pragma mark -
#pragma mark DogeKitDelegate methods

-(BOOL)allowWordInThings:(NSString *)word{
    if (word.length > 4) { //A very simple filter
        return YES;
    } else return NO;
}

Clearing

If you really wanted to, you can also clear the labels again thanks to this pull request

[dk clear];

Label control

You can control the rotation and size of the lables with the minSize, maxSize and shouldRotateLabels properties thanks to these pull requests.

Pull Requests?

I'd love them!

Comments?

Let's hear them! (The nice ones please!)

Me?

In case you're interested I'm @samjarman

Using DogeKit?

Simply submit a pull request editing this ReadMe. Or tweet me.

Apps using DogeKit:

Who will be first?

Doge

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.