Skip to content

Instantly share code, notes, and snippets.

@tanshio
Created October 4, 2015 16:16
Show Gist options
  • Save tanshio/645bf9f90251f2f70d02 to your computer and use it in GitHub Desktop.
Save tanshio/645bf9f90251f2f70d02 to your computer and use it in GitHub Desktop.
Picker
///
// ExhibitViewController.h
// auction
//
// Created by TannoShota on 2015/09/28.
// Copyright (c) 2015年 TannoShota. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "DownPicker.h"
#import "UIDownPicker.h"
@interface ExhibitViewController : UIViewController
@property (nonatomic) DownPicker *picker;
@property (nonatomic) DownPicker *picker2;
@property (nonatomic) DownPicker *picker3;
@end
//
// ExhibitViewController.m
// auction
//
// Created by TannoShota on 2015/09/28.
// Copyright (c) 2015年 TannoShota. All rights reserved.
//
#import "ExhibitViewController.h"
@interface ExhibitViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *cat01;
@property (weak, nonatomic) IBOutlet UIImageView *cat02;
@property (weak, nonatomic) IBOutlet UIImageView *cat03;
@property (weak, nonatomic) IBOutlet UIImageView *cat04;
@property (weak, nonatomic) IBOutlet UIImageView *cat05;
@property (weak, nonatomic) IBOutlet UIImageView *cat06;
@property (weak, nonatomic) IBOutlet UIImageView *cat07;
@property (weak, nonatomic) IBOutlet UIImageView *cat08;
@property (weak, nonatomic) IBOutlet UIImageView *cat09;
@property (weak, nonatomic) IBOutlet UIImageView *cat10;
@property (weak, nonatomic) IBOutlet UIImageView *image01;
@property (weak, nonatomic) IBOutlet UIImageView *image02;
@property (weak, nonatomic) IBOutlet UIImageView *image03;
@property (weak, nonatomic) IBOutlet UIImageView *image04;
@property (weak, nonatomic) IBOutlet UITextField *startField;
@property (weak, nonatomic) IBOutlet UITextField *lowField;
@property (weak, nonatomic) IBOutlet UITextField *buyField;
@property (weak, nonatomic) IBOutlet UITextField *monthField;
@property (weak, nonatomic) IBOutlet UITextField *dayField;
@property (weak, nonatomic) IBOutlet UITextField *timeField;
@property (weak, nonatomic) IBOutlet UIImageView *suefaceImage;
@property (weak, nonatomic) IBOutlet UIImageView *reverseImage;
@property (weak, nonatomic) IBOutlet UIButton *exhibitButton;
@end
@implementation ExhibitViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
NSArray *el = @[@"1", @"2", @"3", @"4", @"5", @"6", @"7", @"8", @"9",@"10",@"11",@"12"];
self.picker = [[DownPicker alloc] initWithTextField:self.monthField withData:el];
NSMutableArray *el2 = [[NSMutableArray alloc]init];
for (int i=1; i<32; i++) {
[el2 addObject:[NSString stringWithFormat:@"%d", i]];
}
//NSNumber型に変換
self.picker2 = [[DownPicker alloc] initWithTextField:self.dayField withData:el2];
NSArray *el3 = @[@"午前中", @"12-4", @"14-16", @"16-18", @"18-21"];
self.picker3 = [[DownPicker alloc] initWithTextField:self.timeField withData:el3];
self.exhibitButton.layer.cornerRadius = 5.0;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment