Enviar pesquisa
Carregar
UIToolbarの同時タッチを防ぐ
•
3 gostaram
•
8,433 visualizações
Yuichi Yoshida
Seguir
Tecnologia
Arte e fotografia
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 26
Baixar agora
Baixar para ler offline
Recomendados
Tinder風なUIを実装する際のアイデアと実装例紹介
Tinder風なUIを実装する際のアイデアと実装例紹介
Fumiya Sakai
Getting started with CloudKit
Getting started with CloudKit
Yuichi Yoshida
Handoffは動かない〜これから役立たないバッドノウハウ集
Handoffは動かない〜これから役立たないバッドノウハウ集
Yuichi Yoshida
だいすきStoryboard - #potatotips (iOS/Android開発Tips共有会) 第7回
だいすきStoryboard - #potatotips (iOS/Android開発Tips共有会) 第7回
Kentaro Matsumae
ICTutorialOverlay : A utility for making "Overlay Tutorial"
ICTutorialOverlay : A utility for making "Overlay Tutorial"
Ichito Nagata
Getting started with Handoff
Getting started with Handoff
Yuichi Yoshida
Swift 2 (& lldb) シンポジウム
Swift 2 (& lldb) シンポジウム
Yuichi Yoshida
Halide, Darkroom - 並列化のためのソフトウェア・研究
Halide, Darkroom - 並列化のためのソフトウェア・研究
Yuichi Yoshida
Recomendados
Tinder風なUIを実装する際のアイデアと実装例紹介
Tinder風なUIを実装する際のアイデアと実装例紹介
Fumiya Sakai
Getting started with CloudKit
Getting started with CloudKit
Yuichi Yoshida
Handoffは動かない〜これから役立たないバッドノウハウ集
Handoffは動かない〜これから役立たないバッドノウハウ集
Yuichi Yoshida
だいすきStoryboard - #potatotips (iOS/Android開発Tips共有会) 第7回
だいすきStoryboard - #potatotips (iOS/Android開発Tips共有会) 第7回
Kentaro Matsumae
ICTutorialOverlay : A utility for making "Overlay Tutorial"
ICTutorialOverlay : A utility for making "Overlay Tutorial"
Ichito Nagata
Getting started with Handoff
Getting started with Handoff
Yuichi Yoshida
Swift 2 (& lldb) シンポジウム
Swift 2 (& lldb) シンポジウム
Yuichi Yoshida
Halide, Darkroom - 並列化のためのソフトウェア・研究
Halide, Darkroom - 並列化のためのソフトウェア・研究
Yuichi Yoshida
Aseemearth
Aseemearth
Sumit Singh
ΒΑΚΑΛΟΥΔΗ - ΠΡΟΣΚΛΗΣΗ
ΒΑΚΑΛΟΥΔΗ - ΠΡΟΣΚΛΗΣΗ
Βακαλούδη Αναστασία
Snr 2012 ee020344
Snr 2012 ee020344
Johana201225
מחדד 05.03
מחדד 05.03
Leo Burnett Israel
Boletín XVII abril 2016
Boletín XVII abril 2016
Nueva Canarias-BC
Martin Nerstad - VG
Martin Nerstad - VG
Mobile Oslo
CANENERO Advertising - Gilberto Chiacchiera
CANENERO Advertising - Gilberto Chiacchiera
bnioceanoblu
Каталог Wellness
Каталог Wellness
Нелли Щербина
Creatividad o mal gusto de los japoneses.
Creatividad o mal gusto de los japoneses.
Emilio Gil (unjubilado)
LR KONKURENCIJOS TARYBOS (KT) 2015 m. VEIKLOS ATASKAITA
LR KONKURENCIJOS TARYBOS (KT) 2015 m. VEIKLOS ATASKAITA
Arunas Vizickas ✔
Hopes, plans and pleasures of children
Hopes, plans and pleasures of children
Gorg Sciberras Wouldn't it be nice if all followers commented on member's show. It shows a sign of friendship and appreciation.
CloudSurance - We backup web application data
CloudSurance - We backup web application data
Sam Bowen
Il Web E Le Reti Di Vendita
Il Web E Le Reti Di Vendita
Gagliano Giuseppe
Js高级技巧
Js高级技巧
fool2fish
Swift 2 (& lldb) シンポジウム
Swift 2 (& lldb) シンポジウム
Yuichi Yoshida
Swift 2 (& lldb) シンポジウム
Swift 2 (& lldb) シンポジウム
Yuichi Yoshida
Swiftで多層型で戻り値を返すことの是非と雑談
Swiftで多層型で戻り値を返すことの是非と雑談
Yuichi Yoshida
Swift - Result<t>型で結果を返すのは邪道か,王道か
Swift - Result<t>型で結果を返すのは邪道か,王道か
Yuichi Yoshida
Machine Learning : The high interest credit card of technical debt
Machine Learning : The high interest credit card of technical debt
Yuichi Yoshida
キーボードアプリとSketchのススメ
キーボードアプリとSketchのススメ
Yuichi Yoshida
Handoff from Safari
Handoff from Safari
Yuichi Yoshida
UZTextView, UZMultilayeredPopoverControllerの解説
UZTextView, UZMultilayeredPopoverControllerの解説
Yuichi Yoshida
Mais conteúdo relacionado
Destaque
Aseemearth
Aseemearth
Sumit Singh
ΒΑΚΑΛΟΥΔΗ - ΠΡΟΣΚΛΗΣΗ
ΒΑΚΑΛΟΥΔΗ - ΠΡΟΣΚΛΗΣΗ
Βακαλούδη Αναστασία
Snr 2012 ee020344
Snr 2012 ee020344
Johana201225
מחדד 05.03
מחדד 05.03
Leo Burnett Israel
Boletín XVII abril 2016
Boletín XVII abril 2016
Nueva Canarias-BC
Martin Nerstad - VG
Martin Nerstad - VG
Mobile Oslo
CANENERO Advertising - Gilberto Chiacchiera
CANENERO Advertising - Gilberto Chiacchiera
bnioceanoblu
Каталог Wellness
Каталог Wellness
Нелли Щербина
Creatividad o mal gusto de los japoneses.
Creatividad o mal gusto de los japoneses.
Emilio Gil (unjubilado)
LR KONKURENCIJOS TARYBOS (KT) 2015 m. VEIKLOS ATASKAITA
LR KONKURENCIJOS TARYBOS (KT) 2015 m. VEIKLOS ATASKAITA
Arunas Vizickas ✔
Hopes, plans and pleasures of children
Hopes, plans and pleasures of children
Gorg Sciberras Wouldn't it be nice if all followers commented on member's show. It shows a sign of friendship and appreciation.
CloudSurance - We backup web application data
CloudSurance - We backup web application data
Sam Bowen
Il Web E Le Reti Di Vendita
Il Web E Le Reti Di Vendita
Gagliano Giuseppe
Js高级技巧
Js高级技巧
fool2fish
Destaque
(14)
Aseemearth
Aseemearth
ΒΑΚΑΛΟΥΔΗ - ΠΡΟΣΚΛΗΣΗ
ΒΑΚΑΛΟΥΔΗ - ΠΡΟΣΚΛΗΣΗ
Snr 2012 ee020344
Snr 2012 ee020344
מחדד 05.03
מחדד 05.03
Boletín XVII abril 2016
Boletín XVII abril 2016
Martin Nerstad - VG
Martin Nerstad - VG
CANENERO Advertising - Gilberto Chiacchiera
CANENERO Advertising - Gilberto Chiacchiera
Каталог Wellness
Каталог Wellness
Creatividad o mal gusto de los japoneses.
Creatividad o mal gusto de los japoneses.
LR KONKURENCIJOS TARYBOS (KT) 2015 m. VEIKLOS ATASKAITA
LR KONKURENCIJOS TARYBOS (KT) 2015 m. VEIKLOS ATASKAITA
Hopes, plans and pleasures of children
Hopes, plans and pleasures of children
CloudSurance - We backup web application data
CloudSurance - We backup web application data
Il Web E Le Reti Di Vendita
Il Web E Le Reti Di Vendita
Js高级技巧
Js高级技巧
Mais de Yuichi Yoshida
Swift 2 (& lldb) シンポジウム
Swift 2 (& lldb) シンポジウム
Yuichi Yoshida
Swift 2 (& lldb) シンポジウム
Swift 2 (& lldb) シンポジウム
Yuichi Yoshida
Swiftで多層型で戻り値を返すことの是非と雑談
Swiftで多層型で戻り値を返すことの是非と雑談
Yuichi Yoshida
Swift - Result<t>型で結果を返すのは邪道か,王道か
Swift - Result<t>型で結果を返すのは邪道か,王道か
Yuichi Yoshida
Machine Learning : The high interest credit card of technical debt
Machine Learning : The high interest credit card of technical debt
Yuichi Yoshida
キーボードアプリとSketchのススメ
キーボードアプリとSketchのススメ
Yuichi Yoshida
Handoff from Safari
Handoff from Safari
Yuichi Yoshida
UZTextView, UZMultilayeredPopoverControllerの解説
UZTextView, UZMultilayeredPopoverControllerの解説
Yuichi Yoshida
64bit化してみた話
64bit化してみた話
Yuichi Yoshida
Gitのすすめ
Gitのすすめ
Yuichi Yoshida
Mais de Yuichi Yoshida
(10)
Swift 2 (& lldb) シンポジウム
Swift 2 (& lldb) シンポジウム
Swift 2 (& lldb) シンポジウム
Swift 2 (& lldb) シンポジウム
Swiftで多層型で戻り値を返すことの是非と雑談
Swiftで多層型で戻り値を返すことの是非と雑談
Swift - Result<t>型で結果を返すのは邪道か,王道か
Swift - Result<t>型で結果を返すのは邪道か,王道か
Machine Learning : The high interest credit card of technical debt
Machine Learning : The high interest credit card of technical debt
キーボードアプリとSketchのススメ
キーボードアプリとSketchのススメ
Handoff from Safari
Handoff from Safari
UZTextView, UZMultilayeredPopoverControllerの解説
UZTextView, UZMultilayeredPopoverControllerの解説
64bit化してみた話
64bit化してみた話
Gitのすすめ
Gitのすすめ
UIToolbarの同時タッチを防ぐ
1.
potatotips UIToolbarの同時タッチを防ぐ デンソーアイティーラボラトリ @sonson_twit 吉田悠一
2.
本業
3.
自己紹介
4.
sonsongithubで検索
5.
2tchのモジュールをOSSに • UZMultipleLayeredPopoverController • UZTextView •
UZInputCandidateAccessory
6.
コードの保守性を高めるために • モジュールを切り出して公開する
7.
本日のお題 @sonson_twit http://sonson.jp
8.
まずはこの症状をご覧ください
9.
10.
11.
問題点 • 同時入力できてしまう • ツールバーのボタン •
UINav.Con.のジェスチャ ! • UIViewControllerの階層構造が壊れる • MobileSafariはロックして回避しているようだ
12.
対策案 • UIBarButtonItemに対策を施す • exclusiveTouch? •
UIBarButtonItemからdownとupを奪う
13.
exclusiveTouch • 役立たず • だが,ツールバー上のボタン二つ同時押しは 避けることができた
14.
/**! * UIToolbarでボタンふたつの同時押しを防止する.! **/! - (void)setExclusiveForUIBarButtonsOnToolbar
{! ! for (UIView* view in [self.navigationController.toolbar subviews]) {! ! ! view.exclusiveTouch=YES;! ! }! } これもグレーといえば,グレー
15.
UIBarButtonItemのイベント • タップイベントの横取りが直接できない • C2ToolbarButton
- undocumented class • viewからswizzlingでタップイベントを奪う • customにしてUIButtonを内蔵する • UIToolbarにジェスチャをつける
16.
Undocumented API • ダメですわ・・・・
17.
Swizzling • え・・・そんなんやりたくないです • 昔,リジェクトされたし・・・・
18.
UIButton in UIBarButtonItem •
え・・・汎用性なくなりますよ • Storyboardのボタンを全部作り替えるとか • 難のためにそんなアホなことを • 嫌です
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.
UIToolbarにジェスチャ • UIGestureRecognizerのサブクラスを実装 • touchesBegin •
touchesCancelled, touchesEnded • ジェスチャは失敗させる • UINavigationControllerにコールバック • interactiveGestureRecognizer.enable
21.
- (void)viewDidLoad {! [super
viewDidLoad];! ! 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 *)touches
withEvent:(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.
まとめ • 自己紹介 • 2tchのモジュール •
ツールバーとジェスチャの衝突を防ぎたい
25.
Thank you. @sonson_twit http://sonson.jp
26.
backup slide backup
Baixar agora