Coder Social home page Coder Social logo

ti.passcode's Introduction

Ti.Passcode

Cross-platform implementation of the iOS passcode screen for Titanium Mobile.

How to install

Installing Ti.Queue is straightforward, simply copy the ti.passcode.js file into your Titanium project.

Since Ti.Passcode is a CommonJS module, can you import the module anywhere in your app by simply using the require method.

For example:

var mod = require('Ti.Passcode');

Sample

First requre the module into our project

var mod = require('Ti.Passcode');

Next create some configuration options

	var options = {
			window:{
				backgroundColor:'#ccc',
				navBarHidden:true
			},
			view:{
				title:'Enter application passcode',
				errorColor:'yellow'
			}
		};		

Then build our callback method

	function onCompleted(d){					
		if(d.success){
			var msg = Ti.UI.createAlertDialog({
				title:'Information',
				message:'Passcode entered is correct'
			});				
			msg.addEventListener('click',function(t){
				codeWindow.close();		
			});
			msg.show();				
		}else{
			var msg = Ti.UI.createAlertDialog({
				title:'Information',
				message:'Invalid passcode, please try again'
			}).show();
		}			
	};

Next create a new instance of the module

var passcode = new my.mod();

Finally, open the Passcode window

var codeWindow = passcode.createWindow(txtPasscode.value,onCompleted,options);
codeWindow.open({modal:true});

Example app.js

Please download the demo project's [app.js](https://github.com/benbahrenburg/Ti.Queue/blob/master/app.js) for a complete sample.

Credits

This module contains code forked from the following projects:

Pedro Enrique ‏ @pecdev https://gist.github.com/pec1985/1819804

Terry Martin @tzmartin https://github.com/tzmartin/TiUIExamples

Licensing & Support

This project is licensed under the OSI approved Apache Public License (version 2). For details please see the license associated with each project.

Developed by Ben Bahrenburg available on twitter @benCoding

Learn More

Twitter

Please consider following the @benCoding Twitter for updates and more about Titanium.

Blog

For module updates, Titanium tutorials and more please check out my blog at benCoding.Com.

ti.passcode's People

Contributors

benbahrenburg avatar

Stargazers

Abdulatif Henno avatar Otniel Gomez avatar Touhidur Rahman avatar Adam Pash avatar Matt Delmarter avatar Steven avatar Iñaki Abete avatar Jeff Haynie avatar samuele coppede avatar Josh Miller avatar Andrew Tokmakoff avatar Achraf Bouyakhsass avatar  avatar Nikhil Nigade avatar

Watchers

 avatar James Cloos avatar

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.