More Related Content
PDF
Tinder風なUIを実装する際のアイデアと実装例紹介 PDF
Getting started with CloudKit PDF
Handoffは動かない〜これから役立たないバッドノウハウ集 PDF
だいすきStoryboard - #potatotips (iOS/Android開発Tips共有会) 第7回 PPTX
ICTutorialOverlay : A utility for making "Overlay Tutorial" PDF
Getting started with Handoff PDF
Swift 2 (& lldb) シンポジウム PDF
Halide, Darkroom - 並列化のためのソフトウェア・研究 Viewers also liked
PPSX
PDF
PDF
PPTX
PDF
PPTX
PDF
CANENERO Advertising - Gilberto Chiacchiera PDF
PDF
Creatividad o mal gusto de los japoneses. PDF
LR KONKURENCIJOS TARYBOS (KT) 2015 m. VEIKLOS ATASKAITA PPS
Hopes, plans and pleasures of children PPT
CloudSurance - We backup web application data PDF
Il Web E Le Reti Di Vendita PPTX
More from Yuichi Yoshida
PDF
Swift 2 (& lldb) シンポジウム PDF
Swift 2 (& lldb) シンポジウム PDF
PDF
Swift - Result<t>型で結果を返すのは邪道か,王道か PDF
Machine Learning : The high interest credit card of technical debt PDF
PDF
PDF
UZTextView, UZMultilayeredPopoverControllerの解説 PDF
PDF
UIToolbarの同時タッチを防ぐ
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
/**!
* UIButtonをUIBarButtonItemにセット!
* addTergetで触ったタイミングを検出・・・!
**/!
UIButton*insideButton = [UIButton
buttonWithType:UIButtonTypeCustom];!
insideButton.bounds = CGRectMake(0, 0, 44, 44);!
[insideButton setImage:[UIImage imageNamed:@"hoge.png"]
forState:UIControlStateNormal];!
UIBarButtonItem *item = [[UIBarButtonItem alloc]
initWithCustomView:insideButton];
ないわー,絶対ないわー!
Storyboardとか使えないですやん
- 20.
- 21.
- (void)viewDidLoad {!
[superviewDidLoad];!
! C2ToolbarTapGestureRecognizer* tapGesture = !
! ! [[C2ToolbarTapGestureRecognizer alloc] initWithTarget:nil action:nil];!
! tapGesture.dummyDelegate = self;!
! tapGesture.delegate = self;!
! [self.toolbar addGestureRecognizer:tapGesture];!
}
カスタムのGestureRecognizerをUIToolbarにセット.
UINavigationControllerのサブクラスで
- 22.
- (void)touchesBegan:(NSSet *)toucheswithEvent:(UIEvent *)event {!
! self.state = UIGestureRecognizerStatePossible;!
! [self.dummyDelegate didBeginDummyTap:self];!
}!
!
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {!
! self.state = UIGestureRecognizerStateFailed;!
! [self.dummyDelegate didEndDummyTap:self];!
}!
!
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {!
! self.state = UIGestureRecognizerStateFailed;!
! [self.dummyDelegate didEndDummyTap:self];!
}
タップのダウン・アップを検出し,UINav.に送る
- 23.
- 24.
- 25.
- 26.