Skip to content

Data Input plugin

eXaLy edited this page Jan 28, 2013 · 8 revisions

The data input part is for the end-user. If you want to pre-set datasources, you should look into the wiki about adding datasources. This extension possibility is for users who wants to add their own datasource through the GUI. At the moment there are already two plugins: Standard Text Input and a (QR) Barcode reader. Users have the choice to put datasource in the app by typing it or uses the Barcode reader. If you have more creative ideas to let the user get new datasources, you can create a plugin for the DataInput. Use the StandardInput class or BarcodeInput class as an example or read below.

Create your own DataInput

  • Create your plugin class
  • Import Mixare library #import <Mixare/Mixare.h>
  • In your .h file, use the DataInput protocol.

Example

@interface YourProcessorClass : NSObject <DataInput>

How to implement code in .m file

- (NSString*)getTitle;

You must return a string what your DataInput plugin should be called.

- (void)runInput:(id<SetDataSourceDelegate>)classToSetYourData;

The object (with SetDataSourceDelegate protocol) from the parameter will be used to set your obtained input data. The obtained data should be set in a array with two dictionaries with the keys: title and url.

Example

- (void)runInput:(id<SetDataSourceDelegate>)classToSetYourData {
    //DO SOMETHING TO GET DATA
    [classToSetYourData setNewData:@{@"title":obtainedTitle, @"url":obtainedUrl}];
}

Take a look in the extensions folder of Mixare to find more examples.

Clone this wiki locally