Skip to content

Commit 53ec6ce

Browse files
authored
Merge pull request #40 from jeantimex/update-documentation-for-release
Updated document for release.
2 parents 625325b + e6bb130 commit 53ec6ce

File tree

3 files changed

+60
-30
lines changed

3 files changed

+60
-30
lines changed

CollapsibleTableSectionViewController.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
#
1717

1818
s.name = "CollapsibleTableSectionViewController"
19-
s.version = "0.0.9"
19+
s.version = "1.0.0"
2020
s.summary = "Swift 3.0 library to support collapsible sections in a table view."
2121

2222
# This description is used to generate tags and improve search results.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 Su
3+
Copyright (c) 2017 Yong Su @jeantimex
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 58 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,13 @@ Swift library to support collapsible sections in a table view.
1212

1313
![cover](docs/images/cover.gif)
1414

15-
## When can I use this pod?
15+
## Features
1616

17-
This CocoaPod is still under development.
18-
19-
#### Release Roadmap
20-
- [x] Cocoa framework development folder structure
21-
- [x] Add travis CI for unit testing
22-
- [x] Wrap the collapsible table view in a UIViewController to hide the implementation of collapsing table sections
23-
- [x] Basic interface design, the goal is make this library easy to use and extend for more features in the future
24-
- [x] Add test cases, test, test and test
25-
- [x] Add several examples in the Examples project
26-
- [ ] Complete the documentation
27-
- [ ] Release
28-
29-
Can't wait to use it? Please checkout this repo for the implementation: https://github.com/jeantimex/ios-swift-collapsible-table-section.
17+
- Support collapsible sections in a table view
18+
- Collapse all the sections by default (configurable)
19+
- Keep only one section expanded (configurable)
20+
- Auto resize table view cell
21+
- Easy-to-use protocols for configuration
3022

3123
## Requirements
3224

@@ -50,7 +42,7 @@ Just clone and add the following Swift files to your project:
5042
- `nano Podfile`, add:
5143
```
5244
use_frameworks!
53-
pod 'CollapsibleTableSectionViewController', :git => 'https://github.com/jeantimex/CollapsibleTableSectionViewController.git'
45+
pod 'CollapsibleTableSectionViewController', '~> 1.0.0'
5446
```
5547
- Save it: `ctrl-x`, `y`, `enter`
5648
- `pod update`
@@ -60,7 +52,7 @@ pod 'CollapsibleTableSectionViewController', :git => 'https://github.com/jeantim
6052
### Carthage
6153

6254
* `nano Cartfile`
63-
* put `github "jeantimex/CollapsibleTableSectionViewController" "master"` into Cartfile
55+
* put `github "jeantimex/CollapsibleTableSectionViewController" ~> 1.0.0` into Cartfile
6456
* Save it: `ctrl-x`, `y`, `enter`
6557
* Run `carthage update`
6658
* Copy `CollapsibleTableSectionViewController.framework` from `Carthage/Build/iOS` to your project
@@ -83,11 +75,11 @@ class ViewController: CollapsibleTableSectionViewController { ... }
8375
extension ViewController: CollapsibleTableSectionDelegate { ... }
8476
```
8577

86-
Most of the protocol methods are very similar to `UITableViewDataSource` and `UITableViewDelegate`, if you know how to use them in `UITableViewController`, then you will find our protocol methods easy to use.
78+
## CollapsibleTableSectionDelegate Protocols
8779

88-
Here is a list of the available protocol methods:
80+
Most of the protocol methods are optional and they are very similar to `UITableViewDataSource` and `UITableViewDelegate`, here is a list of the available protocol methods:
8981

90-
1. `optional func numberOfSections(_ tableView: UITableView) -> Int`<br />
82+
#### 1. optional func numberOfSections(_ tableView: UITableView) -> Int
9183
Asks the data source to return the number of sections in the table view. Default is `1`.
9284

9385
```swift
@@ -98,7 +90,7 @@ extension ViewController: CollapsibleTableSectionDelegate {
9890
}
9991
```
10092

101-
2. `optional func collapsibleTableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int`<br />
93+
#### 2. optional func collapsibleTableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
10294
Returns the number of rows (table cells) in a specified section. Default is `0`.
10395

10496
```swift
@@ -109,7 +101,8 @@ extension ViewController: CollapsibleTableSectionDelegate {
109101
}
110102
```
111103

112-
3. `optional func collapsibleTableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell`<br />
104+
#### 3. optional func collapsibleTableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
105+
113106
Returns the table cell at the specified index path. You can also use your custom cells, see our example projects for more details.
114107

115108
```swift
@@ -122,24 +115,61 @@ extension ViewController: CollapsibleTableSectionDelegate {
122115
}
123116
```
124117

125-
4. `optional func shouldCollapseByDefault(_ tableView: UITableView) -> Bool`<br />
118+
#### 4. optional func shouldCollapseByDefault(_ tableView: UITableView) -> Bool
119+
126120
Return `true` if you would like collapse all the sections when the table is loaded. Default is `false`.
127121

128-
5. `optional func shouldCollapseOthers(_ tableView: UITableView) -> Bool`<br />
122+
#### 5. optional func shouldCollapseOthers(_ tableView: UITableView) -> Bool
123+
129124
Return `true` if you would like to keep only one extended section (like accordion style). Default is `false`.
130125

131-
6. `optional func collapsibleTableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String?`<br />
126+
#### 6. optional func collapsibleTableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String?
127+
132128
The title for each section. Default is `nil`.
133129

134-
7. `optional func collapsibleTableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)`<br />
130+
#### 7. optional func collapsibleTableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
131+
135132
Tells the delegate that the specified row is now selected.
136133

134+
## Examples
135+
136+
Run the Examples project in this repo and you will find the following demos that help you get up and running:
137+
138+
1. Basic: The minimal working example
139+
2. Custom Cell: Implement a custom cell programmatically
140+
3. Collapse By Default: All sections are collapsed by default
141+
4. Collapse Others: Accordion-style table view that only keeps one section expanded at a time
142+
143+
For more details of how to implement collapsible table sections using Swift, please checkout this repo for more information: https://github.com/jeantimex/ios-swift-collapsible-table-section.
144+
137145
## Contribution
138146

139-
You are welcome to fork and submit pull requests
147+
Anyone who would like to contribute to the project is more than welcome.
148+
149+
* Fork this repo
150+
* Make your changes
151+
* Submit pull request
140152

141153
## License
142154

143-
This project is licensed under the MIT license, Copyright (c) 2017 Yong Su. For more information see `LICENSE.md`.
155+
MIT License
156+
157+
Copyright (c) 2017 Yong Su @jeantimex
158+
159+
Permission is hereby granted, free of charge, to any person obtaining a copy
160+
of this software and associated documentation files (the "Software"), to deal
161+
in the Software without restriction, including without limitation the rights
162+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
163+
copies of the Software, and to permit persons to whom the Software is
164+
furnished to do so, subject to the following conditions:
165+
166+
The above copyright notice and this permission notice shall be included in all
167+
copies or substantial portions of the Software.
144168

145-
Author: [Yong Su](https://github.com/jeantimex) @ Box Inc.
169+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
170+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
171+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
172+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
173+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
174+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
175+
SOFTWARE.

0 commit comments

Comments
 (0)