Soumettre la recherche
Mettre en ligne
UISearchController par Stéphane sudre
•
0 j'aime
•
6,043 vues
CocoaHeads France
Suivre
Présentation Cocoaheads Février 2015 sur la nouvelle API iOS8.
Lire moins
Lire la suite
Logiciels
Signaler
Partager
Signaler
Partager
1 sur 35
Télécharger maintenant
Télécharger pour lire hors ligne
Recommandé
Peek inside the fantastical Ukrainian Village home and studio of artists Jare...
Peek inside the fantastical Ukrainian Village home and studio of artists Jare...
irwinvifxcfesre
アプリ設定の保存をシンプルに
アプリ設定の保存をシンプルに
susan335
RxSwift 예제로 감잡기
RxSwift 예제로 감잡기
Yongha Yoo
JQuery应用开发
JQuery应用开发
chevionlu
Proyecto Final Android-SQLite
Proyecto Final Android-SQLite
José Antonio Sandoval Acosta
Check out our photos of the Pixies' Metro show
Check out our photos of the Pixies' Metro show
chicagonewsyesterday
Chief Keef's hologram can't catch a break, and it's a win for Keef
Chief Keef's hologram can't catch a break, and it's a win for Keef
chicagonewsonlineradio
jQuery - Javascript para quem não sabe Javascript
jQuery - Javascript para quem não sabe Javascript
Nando Vieira
Contenu connexe
Tendances
2015 Key Ingredient Cook-Off
2015 Key Ingredient Cook-Off
irwinvifxcfesre
Get more votes!
Get more votes!
chicagonewsyesterday
[2019] 실용적인 프런트엔드 테스트 전략
[2019] 실용적인 프런트엔드 테스트 전략
NHN FORWARD
Meet Magento Milano 2016
Meet Magento Milano 2016
Enrico
JavascriptMVC
JavascriptMVC
4lb0
Best Fried Chicken
Best Fried Chicken
irwinvifxcfesre
Practical JavaScript Programming - Session 2/8
Practical JavaScript Programming - Session 2/8
Wilson Su
Hacer una calculadora en Java y en Visual Basic
Hacer una calculadora en Java y en Visual Basic
HumbertoWuwu
Iteratory
Iteratory
Łukasz Kużyński
Best gourmet market
Best gourmet market
chicagonewsyesterday
Best hotel
Best hotel
chicagonewsyesterday
Spring Framework Orm Di
Spring Framework Orm Di
ahwkong2000
Local storages
Local storages
Дмитрий Скинтиян
Practical JavaScript Programming - Session 3/8
Practical JavaScript Programming - Session 3/8
Wilson Su
JAVA Program in NetBeans
JAVA Program in NetBeans
HimanshiSingh71
Index2
Index2
grateful7
es6.concurrency()
es6.concurrency()
Ingvar Stepanyan
Macro
Macro
nildik
InterCon 2017 - Otimizando renderização e animações na Web - Sergio Lopes
InterCon 2017 - Otimizando renderização e animações na Web - Sergio Lopes
iMasters
Pianist and composer Jeff Kowalkowski releases strong new trio album
Pianist and composer Jeff Kowalkowski releases strong new trio album
irwinvifxcfesre
Tendances
(20)
2015 Key Ingredient Cook-Off
2015 Key Ingredient Cook-Off
Get more votes!
Get more votes!
[2019] 실용적인 프런트엔드 테스트 전략
[2019] 실용적인 프런트엔드 테스트 전략
Meet Magento Milano 2016
Meet Magento Milano 2016
JavascriptMVC
JavascriptMVC
Best Fried Chicken
Best Fried Chicken
Practical JavaScript Programming - Session 2/8
Practical JavaScript Programming - Session 2/8
Hacer una calculadora en Java y en Visual Basic
Hacer una calculadora en Java y en Visual Basic
Iteratory
Iteratory
Best gourmet market
Best gourmet market
Best hotel
Best hotel
Spring Framework Orm Di
Spring Framework Orm Di
Local storages
Local storages
Practical JavaScript Programming - Session 3/8
Practical JavaScript Programming - Session 3/8
JAVA Program in NetBeans
JAVA Program in NetBeans
Index2
Index2
es6.concurrency()
es6.concurrency()
Macro
Macro
InterCon 2017 - Otimizando renderização e animações na Web - Sergio Lopes
InterCon 2017 - Otimizando renderização e animações na Web - Sergio Lopes
Pianist and composer Jeff Kowalkowski releases strong new trio album
Pianist and composer Jeff Kowalkowski releases strong new trio album
En vedette
OHHttpStubs
OHHttpStubs
CocoaHeads France
OSX Complex Application Challenge Architecture
OSX Complex Application Challenge Architecture
CocoaHeads France
Conférence DotSwift 2016
Conférence DotSwift 2016
CocoaHeads France
Code flow - Cocoaheads paris
Code flow - Cocoaheads paris
CocoaHeads France
Apple Watch par Benoit Capallere et Joeffrey Bocquet
Apple Watch par Benoit Capallere et Joeffrey Bocquet
CocoaHeads France
Talk KVO with rac by Philippe Converset
Talk KVO with rac by Philippe Converset
CocoaHeads France
Revue des annonces WWDC2015
Revue des annonces WWDC2015
CocoaHeads France
Apple Search Optimization
Apple Search Optimization
CocoaHeads France
CocoaHeads Paris iBeacon par Clément Sauvage
CocoaHeads Paris iBeacon par Clément Sauvage
CocoaHeads France
Couverture de code
Couverture de code
CocoaHeads France
POI clusturing
POI clusturing
CocoaHeads France
Mastering Interface Builder
Mastering Interface Builder
CocoaHeads France
BlaBlaCar et la mise en place d'une fonctionnalité FlagFeature
BlaBlaCar et la mise en place d'une fonctionnalité FlagFeature
CocoaHeads France
Premiers pas en freelancing - HopWork - Jean Baptiste
Premiers pas en freelancing - HopWork - Jean Baptiste
CocoaHeads France
Framework dynamic par Simone Sivetta
Framework dynamic par Simone Sivetta
CocoaHeads France
Plugins Xcode
Plugins Xcode
CocoaHeads France
Silent push
Silent push
CocoaHeads France
Local Authentication par Pierre-Alban Toth
Local Authentication par Pierre-Alban Toth
CocoaHeads France
MultiPeer Connectivity Framework
MultiPeer Connectivity Framework
CocoaHeads France
Snips MVC revisited by Michael Fester
Snips MVC revisited by Michael Fester
CocoaHeads France
En vedette
(20)
OHHttpStubs
OHHttpStubs
OSX Complex Application Challenge Architecture
OSX Complex Application Challenge Architecture
Conférence DotSwift 2016
Conférence DotSwift 2016
Code flow - Cocoaheads paris
Code flow - Cocoaheads paris
Apple Watch par Benoit Capallere et Joeffrey Bocquet
Apple Watch par Benoit Capallere et Joeffrey Bocquet
Talk KVO with rac by Philippe Converset
Talk KVO with rac by Philippe Converset
Revue des annonces WWDC2015
Revue des annonces WWDC2015
Apple Search Optimization
Apple Search Optimization
CocoaHeads Paris iBeacon par Clément Sauvage
CocoaHeads Paris iBeacon par Clément Sauvage
Couverture de code
Couverture de code
POI clusturing
POI clusturing
Mastering Interface Builder
Mastering Interface Builder
BlaBlaCar et la mise en place d'une fonctionnalité FlagFeature
BlaBlaCar et la mise en place d'une fonctionnalité FlagFeature
Premiers pas en freelancing - HopWork - Jean Baptiste
Premiers pas en freelancing - HopWork - Jean Baptiste
Framework dynamic par Simone Sivetta
Framework dynamic par Simone Sivetta
Plugins Xcode
Plugins Xcode
Silent push
Silent push
Local Authentication par Pierre-Alban Toth
Local Authentication par Pierre-Alban Toth
MultiPeer Connectivity Framework
MultiPeer Connectivity Framework
Snips MVC revisited by Michael Fester
Snips MVC revisited by Michael Fester
Plus de CocoaHeads France
Mutation testing for a safer Future
Mutation testing for a safer Future
CocoaHeads France
iOS App Group for Debugging
iOS App Group for Debugging
CocoaHeads France
Asynchronous swift
Asynchronous swift
CocoaHeads France
Visual accessibility in iOS11
Visual accessibility in iOS11
CocoaHeads France
My script - One year of CocoaHeads
My script - One year of CocoaHeads
CocoaHeads France
Ui testing dealing with push notifications
Ui testing dealing with push notifications
CocoaHeads France
CONTINUOUS DELIVERY WITH FASTLANE
CONTINUOUS DELIVERY WITH FASTLANE
CocoaHeads France
L'intégration continue avec Bitrise
L'intégration continue avec Bitrise
CocoaHeads France
Super combinators
Super combinators
CocoaHeads France
Design like a developer
Design like a developer
CocoaHeads France
Handle the error
Handle the error
CocoaHeads France
Quoi de neuf dans iOS 10.3
Quoi de neuf dans iOS 10.3
CocoaHeads France
IoT Best practices
IoT Best practices
CocoaHeads France
SwiftyGPIO
SwiftyGPIO
CocoaHeads France
Présentation de HomeKit
Présentation de HomeKit
CocoaHeads France
Programme MFI retour d'expérience
Programme MFI retour d'expérience
CocoaHeads France
How to communicate with Smart things?
How to communicate with Smart things?
CocoaHeads France
Build a lego app with CocoaPods
Build a lego app with CocoaPods
CocoaHeads France
Let's migrate to Swift 3.0
Let's migrate to Swift 3.0
CocoaHeads France
Project Entourage
Project Entourage
CocoaHeads France
Plus de CocoaHeads France
(20)
Mutation testing for a safer Future
Mutation testing for a safer Future
iOS App Group for Debugging
iOS App Group for Debugging
Asynchronous swift
Asynchronous swift
Visual accessibility in iOS11
Visual accessibility in iOS11
My script - One year of CocoaHeads
My script - One year of CocoaHeads
Ui testing dealing with push notifications
Ui testing dealing with push notifications
CONTINUOUS DELIVERY WITH FASTLANE
CONTINUOUS DELIVERY WITH FASTLANE
L'intégration continue avec Bitrise
L'intégration continue avec Bitrise
Super combinators
Super combinators
Design like a developer
Design like a developer
Handle the error
Handle the error
Quoi de neuf dans iOS 10.3
Quoi de neuf dans iOS 10.3
IoT Best practices
IoT Best practices
SwiftyGPIO
SwiftyGPIO
Présentation de HomeKit
Présentation de HomeKit
Programme MFI retour d'expérience
Programme MFI retour d'expérience
How to communicate with Smart things?
How to communicate with Smart things?
Build a lego app with CocoaPods
Build a lego app with CocoaPods
Let's migrate to Swift 3.0
Let's migrate to Swift 3.0
Project Entourage
Project Entourage
UISearchController par Stéphane sudre
1.
Recherche
2.
Recherche
3.
Recherche
4.
RechercheUISearchController
5.
RecherchesearchBar 0,00 €
6.
Recherche searchResultsController searchBar
7.
searchResultsUpdater <UISearchResultsUpdating> searchBar searchResultsController Recherche
8.
<UISearchResultsUpdating> dimsBackgroundDuringPresentation searchBar searchResultsController searchResultsUpdater Recherche
9.
<UISearchResultsUpdating> delegate <UISearchControllerDelegate> searchBar searchResultsController searchResultsUpdater dimsBackgroundDuringPresentation Recherche
10.
Exemple 0 2 4 6 8 10 12 14 16 18 20 Recherche 19:04Wanadoo E
11.
@interface ACTableViewController ()
<UISearchResultsUpdating> { ACResultsTableViewController *_resultsTableViewController; UISearchController *_searchController; NSArray *_array; } @end 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
12.
- (void)viewDidLoad { [super
viewDidLoad]; NSMutableArray * tMutableArray=[NSMutableArray array]; for(NSUInteger tIndex=0;tIndex<100;tIndex++) [tMutableArray addObject:[@(tIndex*2) stringValue]]; _array=[tMutableArray copy]; _resultsTableViewController=[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"ACResultsTableViewController"]; _searchController = [[UISearchController alloc] initWithSearchResultsController:_resultsTableViewController]; _searchController.searchResultsUpdater = self; [_searchController.searchBar sizeToFit]; self.tableView.tableHeaderView = _searchController.searchBar; self.definesPresentationContext=YES; } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
13.
_searchController = [[UISearchController
alloc] initWithSearchResultsController:_resultsTableViewController]; _searchController.searchResultsUpdater = self; 10 11 12 13
14.
_searchController = [[UISearchController
alloc] initWithSearchResultsController:_resultsTableViewController]; _searchController.searchResultsUpdater = self; 10 11 12 13
15.
[_searchController.searchBar sizeToFit]; 13 14 15
16.
self.definesPresentationContext=YES; } 17 18 19
17.
Exemple 0 2 4 6 8 10 12 14 16 18 20 Recherche 19:06Wanadoo E
18.
Exemple Recherche 0 2 4 6 8 10 12 14 16 18 20 Recherche 22 Annuler 19:06Wanadoo E Q
W E R T Y U I O P A S D F G H J K L Z X C V B N M space123 Search☺ ×
19.
Tap sur Recherche willPresentSearchController: update…SearchController: didPresentSearchController: @"" delegate delegate searchResultUpdater
20.
- (void)updateSearchResultsForSearchController:(UISearchController *)inSearchController { NSString
*tSearchText = inSearchController.searchBar.text; NSArray * tResultsArray=[_array objectsAtIndexes:[_array indexesOfObjectsPassingTest:^BOOL(NSString * bNumber,NSUInteger bIndex, BOOL * bOutStop) { return ([bNumber rangeOfString:tSearchText].location!=NSNotFound); }]]; _resultsTableViewController.resultsArray=tResultsArray; } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
21.
- (void)updateSearchResultsForSearchController:(UISearchController *)inSearchController { NSString
*tSearchText = inSearchController.searchBar.text; 1 2 3
22.
Exemple Recherche 0 10 20 30 40 50 60 70 80 90 100 0 102 Annuler 19:07Wanadoo E Q
W E R T Y U I O P A S D F G H J K L Z X C V B N M space123 Search☺ ×
23.
Exemple Recherche 0 10 20 30 40 50 60 70 80 90 100 0 102 Annuler 19:07Wanadoo E Action
24.
Tap sur Annuler willDismissSearchController: update…SearchController: didDismissSearchController: @"" delegate delegate searchResultUpdater
25.
Tap sur update…SearchController: update…SearchController: @"" @"" searchResultUpdater searchResultUpdater
26.
Exemple 2 0 2 4 6 8 10 12 14 16 18 20 Filtrage 19:08Wanadoo E
27.
@interface ACTableViewController ()
<UISearchResultsUpdating> { UISearchController *_searchController; NSArray *_originalArray; NSArray *_visibleArray; } @end 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
28.
- (void)viewDidLoad { [super
viewDidLoad]; NSMutableArray * tMutableArray=[NSMutableArray array]; for(NSUInteger tIndex=0;tIndex<100;tIndex++) [tMutableArray addObject:[@(tIndex*2) stringValue]]; _originalArray=[tMutableArray copy]; _visibleArray=_originalArray; _searchController = [[UISearchController alloc] initWithSearchResultsController:nil]; _searchController.searchResultsUpdater = self; _searchController.dimsBackgroundDuringPresentation=NO; [_searchController.searchBar sizeToFit]; _searchController.searchBar.placeholder=NSLocalizedString(@"Filter", @""); self.tableView.tableHeaderView = _searchController.searchBar; self.definesPresentationContext=YES; } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
29.
_searchController = [[UISearchController
alloc] initWithSearchResultsController:nil]; _searchController.searchResultsUpdater = self; 9 10 11 12
30.
_searchController.dimsBackgroundDuringPresentation=NO; 12 13 14
31.
Exemple 2 0 2 4 6 8 10 12 14 16 18 20 Filtrage 19:09Wanadoo E
32.
Exemple Recherche 0 2 4 6 8 10 12 14 16 18 20 Filtrage 22 Annuler 19:09Wanadoo E
33.
- (void)updateSearchResultsForSearchController:(UISearchController *)inSearchController { NSString
*tSearchText = inSearchController.searchBar.text; if ([tSearchText length]>0) { NSArray * tResultsArray=[_originalArray objectsAtIndexes:[_originalArray indexesOfObjectsPassingTest:^BOOL(NSString * bNumber,NSUInteger bIndex, BOOL * bOutStop){ return ([bNumber rangeOfString:tSearchText].location!=NSNotFound); }]]; _visibleArray=tResultsArray; } else { _visibleArray=_originalArray; } [self.tableView reloadData]; } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
34.
Références Exemples de code s.sudre.free.fr/Stuff/CocoaHeads/UISearchControllerSimpleCode.zip github.com/dempseyatgithub/Sample-UISearchController Session
WWDC A Look Inside Presentation Controllers - Session 228 - WWDC14 developer.apple.com/library/ios/samplecode/UICatalog
35.
QA&
Télécharger maintenant