Commit 10ce7b38 authored by Drewdabb's avatar Drewdabb

saturdaylibrary testing m9

parent b1b13488
No preview for this file type
......@@ -217,6 +217,7 @@
<textInputTraits key="textInputTraits"/>
<connections>
<action selector="txtChange:" destination="chc-VY-Gqa" eventType="editingChanged" id="8Fd-OM-q60"/>
<action selector="txtChange:" destination="chc-VY-Gqa" eventType="valueChanged" id="rNI-lq-ipd"/>
</connections>
</textField>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" allowsSelectionDuringEditing="YES" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="HXe-Ct-PRX">
......
......@@ -228,8 +228,8 @@ static int BOOK_ID_LENGTH = 14;
});
});
}
//31172001492867
- (IBAction)txtChange:(id)sender {
- (void) barcodeTextChanged {
NSCharacterSet* notDigits = [[NSCharacterSet decimalDigitCharacterSet] invertedSet];
if(self.txtBookID.text.length == BOOK_ID_LENGTH) { //string is proper length
if([self.txtBookID.text rangeOfCharacterFromSet:notDigits].location == NSNotFound) { //string is numeric
......@@ -249,16 +249,16 @@ static int BOOK_ID_LENGTH = 14;
[self.webview stringByEvaluatingJavaScriptFromString:inputCode];
[self.webview stringByEvaluatingJavaScriptFromString:scan];
// //randomly generate errors
// int random = arc4random() % 10;
// if(random < 5) {
// //green check
// [self changeCheckImage];
//
// } else {
// //red x
// [self changeXImage];
// }
// //randomly generate errors
// int random = arc4random() % 10;
// if(random < 5) {
// //green check
// [self changeCheckImage];
//
// } else {
// //red x
// [self changeXImage];
// }
NSLog(@"ID accepted");
self.view.backgroundColor = [UIColor greenColor];
[UIView animateWithDuration:1.0 animations:^{
......@@ -282,7 +282,7 @@ static int BOOK_ID_LENGTH = 14;
// delegate:self
// cancelButtonTitle:@"OK"
// otherButtonTitles:nil];
//
//
// [previousScan show];
[self extractInformation:scanned];
} else {
......@@ -296,6 +296,16 @@ static int BOOK_ID_LENGTH = 14;
}
}
//31172001492867
- (IBAction)txtChange:(id)sender {
[self barcodeTextChanged];
}
- (void)decoderDataReceived:(NSString *)data {
[super decoderDataReceived:data];
[self barcodeTextChanged];
}
- (IBAction)clickedFinish:(id)sender {
NSString *path =
[[NSBundle mainBundle] pathForResource:@"WhatPage" ofType:@"js"];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment