Production version
Add to Git the current app version (the same available in the OriginalZip folder)
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// PickerViewController.h
|
||||
// Osteopatia
|
||||
//
|
||||
// Created by Beretta Luca on 17/12/12.
|
||||
// Copyright (c) 2012 Luca Beretta. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@protocol PickerViewDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
-(void)inviaDati:(NSDictionary *)elementi;
|
||||
-(void)chiudiView;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface PickerViewController : UIViewController <UIPickerViewDataSource, UIPickerViewDelegate>
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIPickerView *pickerController;
|
||||
@property (nonatomic, strong) id <PickerViewDelegate> delegate;
|
||||
@property (nonatomic, weak) IBOutlet UIBarButtonItem *cancellaButton;
|
||||
@property (nonatomic, weak) IBOutlet UIBarButtonItem *confermabutton;
|
||||
|
||||
-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil dati:(NSArray *)dati;
|
||||
|
||||
- (IBAction)chiudi:(id)sender;
|
||||
- (IBAction)inviaDati:(id)sender;
|
||||
@end
|
||||
@@ -0,0 +1,108 @@
|
||||
//
|
||||
// PickerViewController.m
|
||||
// Osteopatia
|
||||
//
|
||||
// Created by Beretta Luca on 17/12/12.
|
||||
// Copyright (c) 2012 Luca Beretta. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PickerViewController.h"
|
||||
|
||||
@interface PickerViewController (){
|
||||
|
||||
NSArray *datiPicker;
|
||||
NSNumber *indiceElemento;
|
||||
NSString *elemento;
|
||||
UIFont *customFont;
|
||||
|
||||
BOOL isVAS;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation PickerViewController
|
||||
|
||||
-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil dati:(NSArray *)dati
|
||||
{
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
// Custom initialization
|
||||
datiPicker = [NSArray arrayWithArray:dati];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
indiceElemento = 0;
|
||||
elemento = datiPicker[[indiceElemento intValue]];
|
||||
customFont = [UIFont fontWithName:@"Tahoma" size:23.0];
|
||||
|
||||
[self.cancellaButton setTitle:NSLocalizedString(@"Annulla", @"")];
|
||||
[self.confermabutton setTitle:NSLocalizedString(@"Seleziona", @"")];
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning
|
||||
{
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
- (IBAction)chiudi:(id)sender {
|
||||
|
||||
[self.delegate chiudiView];
|
||||
}
|
||||
|
||||
- (IBAction)inviaDati:(id)sender {
|
||||
|
||||
if (indiceElemento == NULL) indiceElemento = [NSNumber numberWithInt:0];
|
||||
NSDictionary *dict = @{@"indice":indiceElemento, @"elemento" : elemento};
|
||||
[self.delegate inviaDati:dict];
|
||||
}
|
||||
- (void)viewDidUnload {
|
||||
[self setPickerController:nil];
|
||||
[super viewDidUnload];
|
||||
}
|
||||
#pragma mark UIPickerViewDataSource
|
||||
|
||||
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{
|
||||
|
||||
return datiPicker.count;
|
||||
|
||||
}
|
||||
|
||||
#pragma mark UIPickerViewDelegate
|
||||
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
|
||||
|
||||
indiceElemento = [NSNumber numberWithInteger:row];
|
||||
elemento = datiPicker[row];
|
||||
|
||||
}
|
||||
/*
|
||||
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
|
||||
{
|
||||
return datiPicker[row];
|
||||
}
|
||||
*/
|
||||
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
|
||||
{
|
||||
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, pickerView.frame.size.width, 25)];
|
||||
label.textAlignment = NSTextAlignmentCenter;
|
||||
label.textColor = [UIColor colorWithRed:0.1569 green:0.22745 blue:0.3411 alpha:1];
|
||||
label.backgroundColor = [UIColor clearColor];
|
||||
label.font = customFont;
|
||||
label.text = datiPicker[row];
|
||||
return label;
|
||||
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
|
||||
<device id="ipad9_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PickerViewController">
|
||||
<connections>
|
||||
<outlet property="cancellaButton" destination="10" id="u1J-qh-ftk"/>
|
||||
<outlet property="confermabutton" destination="11" id="eOF-hb-J01"/>
|
||||
<outlet property="pickerController" destination="4" id="22"/>
|
||||
<outlet property="view" destination="2" id="3"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="2">
|
||||
<rect key="frame" x="0.0" y="0.0" width="201" height="259"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<pickerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4">
|
||||
<rect key="frame" x="0.0" y="43" width="201" height="216"/>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="-1" id="23"/>
|
||||
<outlet property="delegate" destination="-1" id="24"/>
|
||||
</connections>
|
||||
</pickerView>
|
||||
<navigationBar contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8">
|
||||
<rect key="frame" x="0.0" y="0.0" width="201" height="50"/>
|
||||
<color key="tintColor" red="0.15686274510000001" green="0.2274509804" blue="0.3411764706" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<items>
|
||||
<navigationItem id="9">
|
||||
<barButtonItem key="leftBarButtonItem" systemItem="cancel" id="10">
|
||||
<connections>
|
||||
<action selector="chiudi:" destination="-1" id="19"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
<barButtonItem key="rightBarButtonItem" style="done" systemItem="done" id="11">
|
||||
<connections>
|
||||
<action selector="inviaDati:" destination="-1" id="21"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
</navigationItem>
|
||||
</items>
|
||||
</navigationBar>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="4" firstAttribute="bottom" secondItem="2" secondAttribute="bottom" id="7"/>
|
||||
<constraint firstItem="8" firstAttribute="top" secondItem="2" secondAttribute="top" id="12"/>
|
||||
<constraint firstItem="8" firstAttribute="leading" secondItem="2" secondAttribute="leading" id="17"/>
|
||||
<constraint firstItem="4" firstAttribute="leading" secondItem="2" secondAttribute="leading" id="33"/>
|
||||
<constraint firstItem="4" firstAttribute="trailing" secondItem="2" secondAttribute="trailing" id="35"/>
|
||||
<constraint firstItem="8" firstAttribute="trailing" secondItem="2" secondAttribute="trailing" id="36"/>
|
||||
</constraints>
|
||||
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="blackOpaque"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
</view>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// TBDInputViewControllerData.h
|
||||
// Salva lo scontrino
|
||||
//
|
||||
// Created by Luca Beretta on 16/07/12.
|
||||
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@protocol InputViewControllerDataDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
-(void)dataSelezionata:(NSDate *)data withTextFild:(UITextField *)textFild;
|
||||
-(void)esci;
|
||||
|
||||
@end
|
||||
|
||||
@interface TBDInputViewControllerData : UIViewController
|
||||
|
||||
@property (nonatomic, retain) id<InputViewControllerDataDelegate> delegate;
|
||||
@property (nonatomic, retain) IBOutlet UIDatePicker *myDataPicker;
|
||||
@property (nonatomic, strong) UITextField *testFild;
|
||||
-(IBAction)chiudiView:(id)sender;
|
||||
-(IBAction)inviaData:(id)sender;
|
||||
@property (weak, nonatomic) IBOutlet UIBarButtonItem *cancellaButton;
|
||||
@property (weak, nonatomic) IBOutlet UIBarButtonItem *confermaButton;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// TBDInputViewControllerData.m
|
||||
// Salva lo scontrino
|
||||
//
|
||||
// Created by Luca Beretta on 16/07/12.
|
||||
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TBDInputViewControllerData.h"
|
||||
|
||||
@interface TBDInputViewControllerData ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation TBDInputViewControllerData
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
||||
{
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
// Custom initialization
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
|
||||
self.myDataPicker.date = [NSDate date];
|
||||
[self.cancellaButton setTitle:NSLocalizedString(@"Annulla", @"")];
|
||||
[self.confermaButton setTitle:NSLocalizedString(@"Seleziona", @"")];
|
||||
}
|
||||
|
||||
|
||||
- (void)viewDidUnload
|
||||
{
|
||||
[super viewDidUnload];
|
||||
// Release any retained subviews of the main view.
|
||||
}
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
||||
{
|
||||
return (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) || (interfaceOrientation == UIInterfaceOrientationPortrait);
|
||||
}
|
||||
-(IBAction)chiudiView:(id)sender{
|
||||
|
||||
[self.delegate esci];
|
||||
}
|
||||
-(IBAction)inviaData:(id)sender{
|
||||
|
||||
[self.delegate dataSelezionata:self.myDataPicker.date withTextFild:self.testFild];
|
||||
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="TBDInputViewControllerData">
|
||||
<connections>
|
||||
<outlet property="cancellaButton" destination="56" id="bf0-Lp-RA0"/>
|
||||
<outlet property="confermaButton" destination="54" id="pzP-oG-XQs"/>
|
||||
<outlet property="myDataPicker" destination="5" id="10"/>
|
||||
<outlet property="view" destination="3" id="9"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<view contentMode="scaleToFill" id="3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="260"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<datePicker contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" datePickerMode="time" minuteInterval="1" id="5">
|
||||
<rect key="frame" x="0.0" y="42" width="320" height="216"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<date key="date" timeIntervalSinceReferenceDate="363823200.64402503">
|
||||
<!--2012-07-12 22:00:00 +0000-->
|
||||
</date>
|
||||
<locale key="locale" localeIdentifier="it_IT"/>
|
||||
</datePicker>
|
||||
<navigationBar contentMode="scaleToFill" id="52">
|
||||
<rect key="frame" x="0.0" y="-2" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="tintColor" red="0.15686274510000001" green="0.2274509804" blue="0.3411764706" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<items>
|
||||
<navigationItem title="Data" id="53">
|
||||
<barButtonItem key="leftBarButtonItem" systemItem="cancel" id="56">
|
||||
<connections>
|
||||
<action selector="chiudiView:" destination="-1" id="57"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
<barButtonItem key="rightBarButtonItem" style="done" systemItem="done" id="54">
|
||||
<connections>
|
||||
<action selector="inviaData:" destination="-1" id="55"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
</navigationItem>
|
||||
</items>
|
||||
</navigationBar>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
</view>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
</objects>
|
||||
</document>
|
||||
Reference in New Issue
Block a user