Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/beat843796/CHSectionSelectionView
Easy to use and highly customizable View that displays selector controls for (e.g.) UITableView Sections. This project is inspired by the iPads Address Book application.
https://github.com/beat843796/CHSectionSelectionView
Last synced: 3 months ago
JSON representation
Easy to use and highly customizable View that displays selector controls for (e.g.) UITableView Sections. This project is inspired by the iPads Address Book application.
- Host: GitHub
- URL: https://github.com/beat843796/CHSectionSelectionView
- Owner: beat843796
- Created: 2012-11-20T19:52:02.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2015-09-28T16:35:28.000Z (about 9 years ago)
- Last Synced: 2024-07-20T07:09:28.958Z (4 months ago)
- Language: Objective-C
- Size: 192 KB
- Stars: 31
- Watchers: 6
- Forks: 16
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## CHSectionSelectionView
Easy to use and highly customizable View that displays selector controls for (e.g.) UITableView Sections. This project is inspired by the iPads Address Book application.## Usage
- Refer to the **Demo project**.
- Drag and Drop CHSectionSelectionView.h/.m and CHSectionSelectionItemView to your project
- Subclass CHSectionSelectionItemView to handle communication between static and sliding controller
- Implement the delegate and datasource protocol in your ViewControllerSetting up the SectionSelectionView (Example)
```objc
_selectionView = [[CHSectionSelectionView alloc] init];
_selectionView.backgroundColor = [UIColor whiteColor];
_selectionView.dataSource = self;
_selectionView.delegate = self;
_selectionView.showCallouts = YES; // the view should show a callout when an item is selected
_selectionView.calloutDirection = SectionCalloutDirectionRight; // Callouts should appear on the right side
[self.view addSubview:_selectionView];
```Implement the Datasource
```objc
-(CHSectionSelectionItemView *)sectionSelectionView:(CHSectionSelectionView *)sectionSelectionView sectionSelectionItemViewForSection:(NSInteger)section;
-(NSInteger)numberOfSectionsInSectionSelectionView:(CHSectionSelectionView *)sectionSelectionView;@optional
-(UIView *)sectionSelectionView:(CHSectionSelectionView *)sectionSelectionView callOutViewForSelectedSection:(NSInteger)section;
```Implement the delegate
```objc
@optional
-(void)sectionSelectionView:(CHSectionSelectionView *)sectionSelectionView didSelectSection:(NSInteger)section;
```## License
Copyright 2012 Clemens HammerlLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.Attribution is appreciated.