Commit 78de6781 authored by Alex Moore's avatar Alex Moore

replaced SectionTableViewController with SectionViewController, added...

replaced SectionTableViewController with SectionViewController, added GlobalWebController and connected global webview to SectionView and ScanBookView
parent df9cee72
No preview for this file type
......@@ -20,13 +20,14 @@
78FD6B381A817F4500D48A92 /* greencheck.png in Resources */ = {isa = PBXBuildFile; fileRef = 78FD6B371A817F4500D48A92 /* greencheck.png */; };
78FD6B3A1A817F4D00D48A92 /* redx.png in Resources */ = {isa = PBXBuildFile; fileRef = 78FD6B391A817F4D00D48A92 /* redx.png */; };
78FD6B3D1A8185AF00D48A92 /* ScanBookViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 78FD6B3C1A8185AF00D48A92 /* ScanBookViewController.m */; };
78FD6B431A818D3100D48A92 /* SectionTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 78FD6B421A818D3100D48A92 /* SectionTableViewController.m */; };
78FD6B461A81929200D48A92 /* LogInViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 78FD6B451A81929200D48A92 /* LogInViewController.m */; };
EF2233281A9FA2DD005F0FFC /* CaptuvoScannerController.m in Sources */ = {isa = PBXBuildFile; fileRef = EF2233251A9FA2DD005F0FFC /* CaptuvoScannerController.m */; };
EF2233291A9FA2DD005F0FFC /* CaptuvoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EF2233271A9FA2DD005F0FFC /* CaptuvoViewController.m */; };
EF22332C1A9FA2FC005F0FFC /* CaptuvoOptionsController.m in Sources */ = {isa = PBXBuildFile; fileRef = EF22332B1A9FA2FC005F0FFC /* CaptuvoOptionsController.m */; };
EF22332F1A9FA320005F0FFC /* libCaptuvoSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EF22332E1A9FA320005F0FFC /* libCaptuvoSDK.a */; };
EF5D7C151A93E7F7005FD90F /* SettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EF5D7C141A93E7F7005FD90F /* SettingsViewController.m */; };
EF80050A1AB9E1E200A10D56 /* SectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EF8005091AB9E1E200A10D56 /* SectionViewController.m */; };
EF80050D1ABA122E00A10D56 /* GlobalWebController.m in Sources */ = {isa = PBXBuildFile; fileRef = EF80050C1ABA122E00A10D56 /* GlobalWebController.m */; };
EFF4A0F31AB9110800FA82F3 /* WebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EFF4A0F21AB9110800FA82F3 /* WebViewController.m */; };
/* End PBXBuildFile section */
......@@ -61,8 +62,6 @@
78FD6B391A817F4D00D48A92 /* redx.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = redx.png; sourceTree = "<group>"; };
78FD6B3B1A8185AF00D48A92 /* ScanBookViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScanBookViewController.h; sourceTree = "<group>"; };
78FD6B3C1A8185AF00D48A92 /* ScanBookViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScanBookViewController.m; sourceTree = "<group>"; };
78FD6B411A818D3000D48A92 /* SectionTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SectionTableViewController.h; sourceTree = "<group>"; };
78FD6B421A818D3100D48A92 /* SectionTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SectionTableViewController.m; sourceTree = "<group>"; };
78FD6B441A81929200D48A92 /* LogInViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogInViewController.h; sourceTree = "<group>"; };
78FD6B451A81929200D48A92 /* LogInViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LogInViewController.m; sourceTree = "<group>"; };
EF2233241A9FA2DD005F0FFC /* CaptuvoScannerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CaptuvoScannerController.h; sourceTree = "<group>"; };
......@@ -75,6 +74,10 @@
EF22332E1A9FA320005F0FFC /* libCaptuvoSDK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libCaptuvoSDK.a; sourceTree = "<group>"; };
EF5D7C131A93E7F7005FD90F /* SettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsViewController.h; sourceTree = "<group>"; };
EF5D7C141A93E7F7005FD90F /* SettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingsViewController.m; sourceTree = "<group>"; };
EF8005081AB9E1E200A10D56 /* SectionViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SectionViewController.h; sourceTree = "<group>"; };
EF8005091AB9E1E200A10D56 /* SectionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SectionViewController.m; sourceTree = "<group>"; };
EF80050B1ABA122E00A10D56 /* GlobalWebController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GlobalWebController.h; sourceTree = "<group>"; };
EF80050C1ABA122E00A10D56 /* GlobalWebController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GlobalWebController.m; sourceTree = "<group>"; };
EFF4A0F11AB9110800FA82F3 /* WebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewController.h; sourceTree = "<group>"; };
EFF4A0F21AB9110800FA82F3 /* WebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
......@@ -160,17 +163,18 @@
EF2233301A9FA327005F0FFC /* Include */ = {
isa = PBXGroup;
children = (
EFF4A0F11AB9110800FA82F3 /* WebViewController.h */,
EF22332D1A9FA320005F0FFC /* Captuvo.h */,
78FD6B0F1A81713A00D48A92 /* AppDelegate.h */,
EF22332D1A9FA320005F0FFC /* Captuvo.h */,
EF22332A1A9FA2FC005F0FFC /* CaptuvoOptionsController.h */,
EF2233241A9FA2DD005F0FFC /* CaptuvoScannerController.h */,
EF2233261A9FA2DD005F0FFC /* CaptuvoViewController.h */,
EF80050B1ABA122E00A10D56 /* GlobalWebController.h */,
78FD6B441A81929200D48A92 /* LogInViewController.h */,
78FD6B3B1A8185AF00D48A92 /* ScanBookViewController.h */,
78FD6B411A818D3000D48A92 /* SectionTableViewController.h */,
EF8005081AB9E1E200A10D56 /* SectionViewController.h */,
784F46F41A83D47300EAC872 /* Session.h */,
EF5D7C131A93E7F7005FD90F /* SettingsViewController.h */,
EFF4A0F11AB9110800FA82F3 /* WebViewController.h */,
);
name = Include;
sourceTree = "<group>";
......@@ -186,16 +190,17 @@
EF2233321A9FA349005F0FFC /* Source */ = {
isa = PBXGroup;
children = (
EFF4A0F21AB9110800FA82F3 /* WebViewController.m */,
78FD6B101A81713A00D48A92 /* AppDelegate.m */,
EF22332B1A9FA2FC005F0FFC /* CaptuvoOptionsController.m */,
EF2233251A9FA2DD005F0FFC /* CaptuvoScannerController.m */,
EF2233271A9FA2DD005F0FFC /* CaptuvoViewController.m */,
EF80050C1ABA122E00A10D56 /* GlobalWebController.m */,
78FD6B451A81929200D48A92 /* LogInViewController.m */,
78FD6B3C1A8185AF00D48A92 /* ScanBookViewController.m */,
78FD6B421A818D3100D48A92 /* SectionTableViewController.m */,
EF8005091AB9E1E200A10D56 /* SectionViewController.m */,
784F46F51A83D47300EAC872 /* Session.m */,
EF5D7C141A93E7F7005FD90F /* SettingsViewController.m */,
EFF4A0F21AB9110800FA82F3 /* WebViewController.m */,
);
name = Source;
sourceTree = "<group>";
......@@ -324,9 +329,10 @@
78FD6B111A81713A00D48A92 /* AppDelegate.m in Sources */,
78FD6B0E1A81713A00D48A92 /* main.m in Sources */,
EF2233281A9FA2DD005F0FFC /* CaptuvoScannerController.m in Sources */,
EF80050D1ABA122E00A10D56 /* GlobalWebController.m in Sources */,
EF2233291A9FA2DD005F0FFC /* CaptuvoViewController.m in Sources */,
78FD6B431A818D3100D48A92 /* SectionTableViewController.m in Sources */,
784F46F61A83D47300EAC872 /* Session.m in Sources */,
EF80050A1AB9E1E200A10D56 /* SectionViewController.m in Sources */,
EF22332C1A9FA2FC005F0FFC /* CaptuvoOptionsController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
......
//
// GlobalWebController.h
// PLUCdraft
//
// Created by PLUC SeniorDesign on 3/18/15.
// Copyright (c) 2015 Alexander W. Moore. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface GlobalWebController : NSObject
{
UIWebView *web;
}
@property(nonatomic, retain) UIWebView *web;
+(GlobalWebController*) getInstance;
@end
//
// GlobalWebController.m
// PLUCdraft
//
// Created by PLUC SeniorDesign on 3/18/15.
// Copyright (c) 2015 Alexander W. Moore. All rights reserved.
//
#import "GlobalWebController.h"
@implementation GlobalWebController
@synthesize web;
static GlobalWebController *instance = nil;
+(GlobalWebController*) getInstance
{
@synchronized(self)
{
if (instance==nil) {
instance = [GlobalWebController new];
}
}
return instance;
}
@end
......@@ -47,6 +47,7 @@
</state>
<connections>
<action selector="btnLogInTouch:" destination="BYZ-38-t0r" eventType="touchDown" id="lMz-3L-Q1E"/>
<segue destination="Feu-98-wZh" kind="show" identifier="segueLogIn" id="1yM-zj-aAu"/>
</connections>
</button>
</subviews>
......@@ -76,7 +77,6 @@
<connections>
<outlet property="txtPassword" destination="u4E-6x-G9M" id="sbx-w0-Hox"/>
<outlet property="txtUsername" destination="rFc-Xp-Oik" id="Q9Z-xl-cFg"/>
<segue destination="hd5-pu-gvE" kind="show" identifier="segueLogIn" id="hdj-Os-6E3"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
......@@ -84,38 +84,47 @@
<point key="canvasLocation" x="952" y="136"/>
</scene>
<!--Inventory Section-->
<scene sceneID="gF8-Ti-qWb">
<scene sceneID="8NC-rw-Ief">
<objects>
<tableViewController id="hd5-pu-gvE" customClass="SectionTableViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="pVm-I9-Hre">
<viewController id="Feu-98-wZh" customClass="SectionViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="opR-je-HOt"/>
<viewControllerLayoutGuide type="bottom" id="Oim-8n-gGb"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Via-s0-aIE">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="KQi-KS-V1c">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="ListPrototypeCell" id="Lit-iu-3da">
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Lit-iu-3da" id="sY5-sD-kSW">
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="ListPrototypeCell" id="oZ4-7t-OSJ">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="oZ4-7t-OSJ" id="5ru-vO-wS7">
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
<sections/>
<connections>
<outlet property="dataSource" destination="hd5-pu-gvE" id="VlL-9I-afr"/>
<outlet property="delegate" destination="hd5-pu-gvE" id="C0p-rx-sqA"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Inventory Section" id="63h-Vr-Yee">
<barButtonItem key="rightBarButtonItem" title="Select" id="lnO-7M-YCe">
</view>
<navigationItem key="navigationItem" title="Inventory Section" id="GVO-9b-BCZ">
<barButtonItem key="rightBarButtonItem" title="Select" id="3yH-Ki-T0s">
<connections>
<segue destination="chc-VY-Gqa" kind="show" id="DPt-Dp-BvG"/>
<segue destination="chc-VY-Gqa" kind="show" id="zVe-eO-sOn"/>
</connections>
</barButtonItem>
</navigationItem>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="4Gm-22-v5X" userLabel="First Responder" sceneMemberID="firstResponder"/>
<connections>
<outlet property="tableView" destination="KQi-KS-V1c" id="bSM-0w-K36"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="j5n-xV-83T" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1686" y="128"/>
<point key="canvasLocation" x="1643" y="136"/>
</scene>
<!--Settings-->
<scene sceneID="lmw-fN-nDU">
......
......@@ -13,7 +13,7 @@
@interface ScanBookViewController : CaptuvoScannerController
@property Session *session;
@property UIWebView *webview;
@property (nonatomic) BOOL contScan;
@property (nonatomic) int volume;
......
......@@ -8,8 +8,8 @@
#import "ScanBookViewController.h"
#import "SectionTableViewController.h"
#import <AudioToolbox/AudioToolbox.h>
#import "SectionViewController.h"
#import "GlobalWebController.h"
static int BOOK_ID_LENGTH = 14;
......@@ -42,6 +42,25 @@ static int BOOK_ID_LENGTH = 14;
// SEND SESSION TO RTI
//self.navigationItem.hidesBackButton = YES;
GlobalWebController *globalWeb = [GlobalWebController getInstance];
self.webview = globalWeb.web;
[self.view addSubview:self.webview];
}
-(void) viewDidAppear:(BOOL)animated {
NSLog(@"viewDidAppear, 2nd view controller");
GlobalWebController *globalWeb = [GlobalWebController getInstance];
self.webview = globalWeb.web;
[self.view addSubview:self.webview];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView {
NSURLRequest *currentRequest = [webView request];
NSURL *currentURL = [currentRequest URL];
NSLog(@"2: Current URL is %@", currentURL.absoluteString);
}
- (void)didReceiveMemoryWarning {
......@@ -71,7 +90,7 @@ static int BOOK_ID_LENGTH = 14;
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
if([segue.destinationViewController isKindOfClass:[SectionTableViewController class]]) {
if([segue.destinationViewController isKindOfClass:[SectionViewController class]]) {
// TELL OCI TO END SESSION aka exit out of page
}
......
//
// SectionTableViewController.h
// SectionViewController.h
// PLUCdraft
//
// Created by Alexander W. Moore on 2/3/15.
// Created by PLUC SeniorDesign on 3/18/15.
// Copyright (c) 2015 Alexander W. Moore. All rights reserved.
//
......@@ -10,6 +10,7 @@
#import "Session.h"
#import "ScanBookViewController.h"
@interface SectionTableViewController : UITableViewController
@interface SectionViewController : WebViewController <UITableViewDataSource, UITableViewDelegate, UIWebViewDelegate>
@property (weak, nonatomic) IBOutlet UITableView *tableView ;
@end
......@@ -6,16 +6,20 @@
// Copyright (c) 2015 Alexander W. Moore. All rights reserved.
//
#import "SectionTableViewController.h"
#import "SectionViewController.h"
#import "GlobalWebController.h"
@interface SectionTableViewController ()
@interface SectionViewController ()
@property NSMutableArray *sections;
@property UIWebView *webview;
@end
@implementation SectionTableViewController
@implementation SectionViewController
bool firstLoad = true;
- (void)viewDidLoad {
[super viewDidLoad];
......@@ -26,9 +30,36 @@
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
self.sections = [[NSMutableArray alloc] init];
self.tableView.delegate = self;
self.tableView.dataSource = self;
[self loadInitialData];
[self.tableView reloadData];
//set up uiwebview
if (firstLoad) {
self.webview = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
GlobalWebController *globalWeb = [GlobalWebController getInstance];
globalWeb.web = self.webview;
self.webview.delegate = self;
NSString *fullURL = @"http://www.google.com";
NSURL *url = [NSURL URLWithString:fullURL];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
//self.webview.scalesPageToFit = YES;
[self.webview loadRequest:request];
[self.view addSubview:self.webview];
firstLoad = false;
}
}
- (void)viewDidAppear:(BOOL)animated {
NSLog(@"viewDidAppear");
//GlobalWebController *globalWeb = [GlobalWebController getInstance];
//self.webview = globalWeb.web;
[self.view addSubview:self.webview];
}
-(void)loadInitialData {
[self.sections addObject:@"Adult Non-Fiction"];
[self.sections addObject:@"Adult Fiction"];
......@@ -68,13 +99,13 @@
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
return [self.sections count];
}
......@@ -91,38 +122,38 @@
/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the specified item to be editable.
return YES;
}
*/
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the specified item to be editable.
return YES;
}
*/
/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/
/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the item to be re-orderable.
return YES;
}
*/
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the item to be re-orderable.
return YES;
}
*/
#pragma mark - Navigation
......
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