├── .gitignore
├── Apache_License_2_0.txt
├── LICENSE.txt
├── README.md
├── StaticDataTableViewController.h
├── StaticDataTableViewController.m
├── StaticDataTableViewController.podspec
├── StaticDataTableViewControllerFramework
├── StaticDataTableViewControllerFramework.xcodeproj
│ ├── project.pbxproj
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Framework.xcscheme
└── StaticDataTableViewControllerFramework
│ ├── Info.plist
│ └── StaticDataTableViewControllerFramework.h
├── StaticTableViewControllerSample
├── StaticTableViewControllerSample.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcuserdata
│ │ │ └── Paulis.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcuserdata
│ │ └── Paulis.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints.xcbkptlist
│ │ └── xcschemes
│ │ ├── StaticTableViewControllerSample.xcscheme
│ │ └── xcschememanagement.plist
└── StaticTableViewControllerSample
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── DemoTableViewController.h
│ ├── DemoTableViewController.m
│ ├── Images.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ └── LaunchImage.launchimage
│ │ ├── Contents.json
│ │ ├── Default-568h@2x.png
│ │ └── Default@2x.png
│ ├── Launch Screen.xib
│ ├── StaticTableViewControllerSample-Info.plist
│ ├── StaticTableViewControllerSample-Prefix.pch
│ ├── en.lproj
│ ├── InfoPlist.strings
│ └── MainStoryboard.storyboard
│ └── main.m
└── demoapp.jpg
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | .DS_Store
3 | build/
4 | *.pbxuser
5 | !default.pbxuser
6 | *.mode1v3
7 | !default.mode1v3
8 | *.mode2v3
9 | !default.mode2v3
10 | *.perspectivev3
11 | !default.perspectivev3
12 | *.xcworkspace
13 | !default.xcworkspace
14 | xcuserdata
15 | profile
16 | *.moved-aside
17 | DerivedData
18 | .idea/
19 |
--------------------------------------------------------------------------------
/Apache_License_2_0.txt:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright [yyyy] [name of copyright owner]
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright 2015 Peter Paulis - min60 s.r.o. (min60.com)
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://github.com/Carthage/Carthage)
2 |
3 | # StaticDataTableViewController
4 |
5 | This class enables animated hide/show of static cells and sections (created in IB, using the option Content : Static cells) for UITableView
6 |
7 | This method **doesn't use the hacky solution** with setting height to 0 and **allows you to animate** the change and hide **whole sections**
8 |
9 | ## Features
10 |
11 | - [x] Animations on cells and sections
12 | - [x] Change height / Resize cells
13 | - [x] Not using the hacky solution with height 0
14 | - [x] Hide empty sections
15 | - [x] Control section header, footer visibility for empty sections
16 |
17 |
18 | Demo app
19 |
20 | Created with Vernissage app
21 |
22 |
23 | ## Installation with CocoaPods
24 |
25 | To integrate StaticDataTableViewController into your Xcode project using CocoaPods, specify it in your `Podfile`:
26 |
27 | ```bash
28 | pod 'StaticDataTableViewController'
29 | ```
30 |
31 | ## Usage
32 |
33 | Subclass your `UITableViewController` with the `StaticDataTableViewController`
34 |
35 | ```objective-c
36 | #import "StaticDataTableViewController.h"
37 |
38 | @interface DemoTableViewController : StaticDataTableViewController
39 |
40 | @end
41 | ```
42 |
43 | **Always use this method for table view reload**
44 |
45 | ```objective-c
46 | - (void)reloadDataAnimated:(BOOL)animated)
47 | ```
48 |
49 | don't call `[self.tableView reloadData]`
50 |
51 | To hide/show specific cells, to which you have an outlet or an outlet collection
52 |
53 | ``` objective-c
54 | [self cell:self.outletToMyStaticCell1 setHidden:YES];
55 | [self cell:self.outletToMyStaticCell2 setHidden:NO];
56 | [self cells:self.outletToManyCells setHidden:YES];
57 | [self reloadDataAnimated:YES];
58 | ```
59 | - if you want to hide the whole section, just create a IBOutletCollection to all its cell, and then use `[self cells:setHidden:]`
60 |
61 | To change height of specific cells, to which you have an outlet or an outlet collection
62 |
63 | ``` objective-c
64 | [self cell:self.outletToMyStaticCell1 setHeight:44];
65 | [self cell:self.outletToMyStaticCell2 setHeight:44];
66 | [self cells:self.outletToManyCells setHeight:200];
67 | [self reloadDataAnimated:YES];
68 | ```
69 |
70 | to customize animations, just set these properties to desired values
71 |
72 | ``` objective-c
73 | self.insertTableViewRowAnimation = UITableViewRowAnimationRight;
74 | self.deleteTableViewRowAnimation = UITableViewRowAnimationLeft;
75 | self.reloadTableViewRowAnimation = UITableViewRowAnimationMiddle;
76 | ```
77 |
78 | or call `reloadDataAnimated:insertAnimation:reloadAnimation:deleteAnimation:` with desired animation values
79 |
80 | to control if the footer or header should be displayed, overwrite these methods in your subclass
81 |
82 | ``` objective-c
83 | - (BOOL)showHeaderForSection:(NSInteger)section vissibleRows:(NSInteger)vissibleRows;
84 | - (BOOL)showFooterForSection:(NSInteger)section vissibleRows:(NSInteger)vissibleRows;
85 | ```
86 |
87 | ## Note
88 | - Create outlets to UITableViewsCells, not their content views!
89 |
90 | ## License
91 | Apache License 2.0: http://www.apache.org/licenses/LICENSE-2.0.txt
92 |
93 | ## Credits
94 | min:60 - Building mobile solutions - https://min60.com
95 |
--------------------------------------------------------------------------------
/StaticDataTableViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // StaticTableViewController.h
3 | // StaticTableViewController 2.0
4 | //
5 | // Created by Peter Paulis on 31.1.2013.
6 | // Copyright (c) 2013 Peter Paulis. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface StaticDataTableViewController : UITableViewController
12 |
13 |
14 | @property (nonatomic, assign) UITableViewRowAnimation insertTableViewRowAnimation;
15 |
16 | @property (nonatomic, assign) UITableViewRowAnimation reloadTableViewRowAnimation;
17 |
18 | @property (nonatomic, assign) UITableViewRowAnimation deleteTableViewRowAnimation;
19 |
20 |
21 | // Shown / Hidden
22 | - (void)cell:(nonnull UITableViewCell *)cell setHidden:(BOOL)hidden;
23 |
24 | - (void)cells:(nonnull NSArray *)cells setHidden:(BOOL)hidden;
25 |
26 | - (BOOL)isCellHidden:(nonnull UITableViewCell *)cell;
27 |
28 |
29 | // Height
30 | - (void)cell:(nonnull UITableViewCell *)cell setHeight:(CGFloat)height;
31 |
32 | - (void)cells:(nonnull NSArray *)cells setHeight:(CGFloat)height;
33 |
34 |
35 | // Update
36 | - (void)updateCell:(nonnull UITableViewCell *)cell;
37 |
38 | - (void)updateCells:(nonnull NSArray *)cells;
39 |
40 |
41 | // Reload
42 | // never call [self.tableView reloadData] directly
43 | // doing so will lead to data inconsistency
44 | // ALWAYS! use this method for reload!
45 | - (void)reloadDataAnimated:(BOOL)animated;
46 |
47 | - (void)reloadDataAnimated:(BOOL)animated insertAnimation:(UITableViewRowAnimation)insertAnimation reloadAnimation:(UITableViewRowAnimation)reloadAnimation deleteAnimation:(UITableViewRowAnimation)deleteAnimation;
48 |
49 |
50 | // you may want to overwrite these two methods in your subclass, to provide custom logic (eg. force the header or footer to be shown, even when no cell are vissible)
51 | - (BOOL)showHeaderForSection:(NSInteger)section vissibleRows:(NSInteger)vissibleRows;
52 | - (BOOL)showFooterForSection:(NSInteger)section vissibleRows:(NSInteger)vissibleRows;
53 |
54 |
55 | // Depracated
56 | @property (nonatomic, assign) BOOL animateSectionHeaders DEPRECATED_ATTRIBUTE;
57 | @property (nonatomic, assign) BOOL hideSectionsWithHiddenRows DEPRECATED_ATTRIBUTE; // use showHeaderForSection:vissibleRows: and showFooterForSection::vissibleRows:
58 | - (BOOL)cellIsHidden:(nonnull UITableViewCell *)cell DEPRECATED_ATTRIBUTE; // use isCellHidden:
59 |
60 | @end
61 |
--------------------------------------------------------------------------------
/StaticDataTableViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // StaticTableViewController.m
3 | // StaticTableViewController 2.0
4 | //
5 | // Created by Peter Paulis on 31.1.2013.
6 | // Copyright (c) 2013 Peter Paulis. All rights reserved.
7 | //
8 |
9 | #import "StaticDataTableViewController.h"
10 |
11 | #define kBatchOperationNone 0
12 | #define kBatchOperationInsert 1
13 | #define kBatchOperationDelete 2
14 | #define kBatchOperationUpdate 3
15 |
16 | ////////////////////////////////////////////////////////////////////////
17 | #pragma mark - OriginalRow
18 | ////////////////////////////////////////////////////////////////////////
19 |
20 | @interface OriginalRow : NSObject
21 |
22 | @property (nonatomic, assign) BOOL hidden;
23 |
24 | @property (nonatomic, assign) BOOL hiddenReal;
25 |
26 | @property (nonatomic, assign) BOOL hiddenPlanned;
27 |
28 | @property (nonatomic, assign) int batchOperation;
29 |
30 | @property (nonatomic, weak) UITableViewCell * cell;
31 |
32 | @property (nonatomic, strong) NSIndexPath * originalIndexPath;
33 |
34 | @property (nonatomic, assign) CGFloat height;
35 |
36 | - (void)update;
37 |
38 | @end
39 |
40 | @implementation OriginalRow
41 |
42 | - (id)init {
43 | self = [super init];
44 |
45 | if (self) {
46 | self.height = CGFLOAT_MAX;
47 | }
48 |
49 | return self;
50 | }
51 |
52 | - (BOOL)hidden {
53 | return (self.hiddenPlanned);
54 | }
55 |
56 | - (void)setHidden:(BOOL)hidden {
57 |
58 | if ((!self.hiddenReal) && (hidden)) {
59 | self.batchOperation = kBatchOperationDelete;
60 | } else if ((self.hiddenReal) && (!hidden)) {
61 | self.batchOperation = kBatchOperationInsert;
62 | }
63 |
64 | self.hiddenPlanned = hidden;
65 | }
66 |
67 | - (void)update {
68 |
69 | if (!self.hidden) {
70 | if (self.batchOperation == kBatchOperationNone) {
71 | self.batchOperation = kBatchOperationUpdate;
72 | }
73 | }
74 | }
75 |
76 | @end
77 |
78 | ////////////////////////////////////////////////////////////////////////
79 | #pragma mark - OriginalSection
80 | ////////////////////////////////////////////////////////////////////////
81 |
82 | @interface OriginalSection : NSObject
83 |
84 | @property (nonatomic, strong) NSString * label;
85 |
86 | @property (nonatomic, strong) NSMutableArray * rows;
87 |
88 | @end
89 |
90 | @implementation OriginalSection
91 |
92 | - (NSInteger)numberOfVissibleRows {
93 | NSInteger count = 0;
94 | for (OriginalRow * or in self.rows) {
95 | if (!or.hidden) {
96 | ++count;
97 | }
98 | }
99 |
100 | return count;
101 | }
102 |
103 | - (NSInteger)vissibleRowIndexWithTableViewCell:(UITableViewCell *)cell {
104 |
105 | NSInteger i = 0;
106 | for (OriginalRow * or in self.rows) {
107 |
108 | if (or.cell == cell) {
109 | return i;
110 | }
111 |
112 | if (!or.hidden) {
113 | ++i;
114 | }
115 | }
116 |
117 | return -1;
118 | }
119 |
120 | @end
121 |
122 | ////////////////////////////////////////////////////////////////////////
123 | #pragma mark - OriginalTable
124 | ////////////////////////////////////////////////////////////////////////
125 |
126 | @interface OriginalTable : NSObject
127 |
128 | @property (nonatomic, strong) NSMutableArray * sections;
129 |
130 | @property (nonatomic, weak) UITableView * tableView;
131 |
132 | @property (nonatomic, strong) NSMutableArray * insertIndexPaths;
133 |
134 | @property (nonatomic, strong) NSMutableArray * deleteIndexPaths;
135 |
136 | @property (nonatomic, strong) NSMutableArray * updateIndexPaths;
137 |
138 | @property (nonatomic, strong) NSMutableArray * reloadSectionsIndexes;
139 |
140 | @end
141 |
142 | @implementation OriginalTable
143 |
144 | - (id)initWithTableView:(UITableView *)tableView {
145 |
146 | self = [super init];
147 | if (self) {
148 |
149 | NSInteger numberOfSections = [tableView numberOfSections];
150 | self.sections = [[NSMutableArray alloc] initWithCapacity:numberOfSections];
151 |
152 | NSInteger totalNumberOfRows = 0;
153 | for (NSInteger i = 0; i < numberOfSections; ++i) {
154 | OriginalSection * originalSection = [OriginalSection new];
155 |
156 | NSInteger numberOfRows = [tableView numberOfRowsInSection:i];
157 | totalNumberOfRows += numberOfRows;
158 | originalSection.rows = [[NSMutableArray alloc] initWithCapacity:numberOfRows];
159 | for (NSInteger ii = 0; ii < numberOfRows; ++ii) {
160 | OriginalRow * tableViewRow = [OriginalRow new];
161 |
162 | NSIndexPath * ip = [NSIndexPath indexPathForRow:ii inSection:i];
163 | tableViewRow.cell = [tableView.dataSource tableView:tableView cellForRowAtIndexPath:ip];
164 |
165 | NSAssert(tableViewRow.cell != nil, @"cannot be nil");
166 |
167 | tableViewRow.originalIndexPath = [NSIndexPath indexPathForRow:ii inSection:i];
168 |
169 | originalSection.rows[ii] = tableViewRow;
170 | }
171 |
172 | self.sections[i] = originalSection;
173 | }
174 |
175 | self.insertIndexPaths = [[NSMutableArray alloc] initWithCapacity:totalNumberOfRows];
176 | self.deleteIndexPaths = [[NSMutableArray alloc] initWithCapacity:totalNumberOfRows];
177 | self.updateIndexPaths = [[NSMutableArray alloc] initWithCapacity:totalNumberOfRows];
178 | self.reloadSectionsIndexes = [[NSMutableArray alloc] initWithCapacity:numberOfSections];
179 |
180 | self.tableView = tableView;
181 |
182 | }
183 |
184 | return self;
185 | }
186 |
187 | - (OriginalRow *)originalRowWithIndexPath:(NSIndexPath *)indexPath {
188 |
189 | OriginalSection * oSection = self.sections[indexPath.section];
190 | OriginalRow * oRow = oSection.rows[indexPath.row];
191 |
192 | return oRow;
193 | }
194 |
195 | - (OriginalRow *)vissibleOriginalRowWithIndexPath:(NSIndexPath *)indexPath {
196 |
197 | OriginalSection * oSection = self.sections[indexPath.section];
198 | NSInteger vissibleIndex = -1;
199 | for (int i = 0; i < [oSection.rows count]; ++i) {
200 |
201 | OriginalRow * oRow = [oSection.rows objectAtIndex:i];
202 |
203 | if (!oRow.hidden) {
204 | ++vissibleIndex;
205 | }
206 |
207 | if (indexPath.row == vissibleIndex) {
208 | return oRow;
209 | }
210 |
211 | }
212 |
213 | return nil;
214 | }
215 |
216 | - (OriginalRow *)originalRowWithTableViewCell:(UITableViewCell *)cell {
217 |
218 | for (NSInteger i = 0; i < [self.sections count]; ++i) {
219 |
220 | OriginalSection * os = self.sections[i];
221 |
222 | for (NSInteger ii = 0; ii < [os.rows count]; ++ii) {
223 |
224 | if ([os.rows[ii] cell] == cell) {
225 | return os.rows[ii];
226 | }
227 |
228 | }
229 |
230 | }
231 |
232 | return nil;
233 | }
234 |
235 | - (NSIndexPath *)indexPathForInsertingOriginalRow:(OriginalRow *)originalRow {
236 |
237 | OriginalSection * oSection = self.sections[originalRow.originalIndexPath.section];
238 | NSInteger vissibleIndex = -1;
239 | for (NSInteger i = 0; i < originalRow.originalIndexPath.row; ++i) {
240 |
241 | OriginalRow * oRow = [oSection.rows objectAtIndex:i];
242 |
243 | if (!oRow.hidden) {
244 | ++vissibleIndex;
245 | }
246 |
247 | }
248 |
249 | return [NSIndexPath indexPathForRow:vissibleIndex + 1 inSection:originalRow.originalIndexPath.section];
250 |
251 | }
252 |
253 | - (NSIndexPath *)indexPathForDeletingOriginalRow:(OriginalRow *)originalRow {
254 |
255 | OriginalSection * oSection = self.sections[originalRow.originalIndexPath.section];
256 | NSInteger vissibleIndex = -1;
257 | for (NSInteger i = 0; i < originalRow.originalIndexPath.row; ++i) {
258 |
259 | OriginalRow * oRow = [oSection.rows objectAtIndex:i];
260 |
261 | if (!oRow.hiddenReal) {
262 | ++vissibleIndex;
263 | }
264 |
265 | }
266 |
267 | return [NSIndexPath indexPathForRow:vissibleIndex + 1 inSection:originalRow.originalIndexPath.section];
268 |
269 | }
270 |
271 | - (void)prepareUpdates {
272 |
273 | [self.insertIndexPaths removeAllObjects];
274 | [self.deleteIndexPaths removeAllObjects];
275 | [self.updateIndexPaths removeAllObjects];
276 |
277 | [self.reloadSectionsIndexes removeAllObjects];
278 |
279 | NSInteger sectionIndex = 0;
280 | for (OriginalSection * os in self.sections) {
281 |
282 | BOOL visibleBefore = NO;
283 | BOOL visibleAfter = NO;
284 |
285 | for (OriginalRow * or in os.rows) {
286 |
287 | visibleBefore = visibleBefore || !or.hiddenReal;
288 |
289 | if (or.batchOperation == kBatchOperationDelete) {
290 |
291 | NSIndexPath * ip = [self indexPathForDeletingOriginalRow:or];
292 | [self.deleteIndexPaths addObject:ip];
293 |
294 | } else if (or.batchOperation == kBatchOperationInsert) {
295 |
296 | NSIndexPath * ip = [self indexPathForInsertingOriginalRow:or];
297 | [self.insertIndexPaths addObject:ip];
298 |
299 | } else if (or.batchOperation == kBatchOperationUpdate) {
300 |
301 | NSIndexPath * ip = [self indexPathForInsertingOriginalRow:or];
302 | [self.updateIndexPaths addObject:ip];
303 |
304 | }
305 |
306 | visibleAfter = visibleAfter || !or.hiddenPlanned;
307 |
308 | }
309 |
310 | if (visibleBefore != visibleAfter) {
311 | [self.reloadSectionsIndexes addObject:@(sectionIndex)];
312 | }
313 | ++sectionIndex;
314 |
315 | }
316 |
317 | // we must do this AFTER all updates calculations, so the indexes dont mess up
318 | for (OriginalSection * os in self.sections) {
319 |
320 | for (OriginalRow * or in os.rows) {
321 |
322 | or.hiddenReal = or.hiddenPlanned;
323 | or.batchOperation = kBatchOperationNone;
324 |
325 | }
326 |
327 | }
328 |
329 | }
330 |
331 | @end
332 |
333 | ////////////////////////////////////////////////////////////////////////
334 | #pragma mark - StaticDataTableViewController
335 | ////////////////////////////////////////////////////////////////////////
336 |
337 | @interface StaticDataTableViewController ()
338 |
339 | @property (nonatomic, strong) OriginalTable * originalTable;
340 |
341 | @end
342 |
343 | @implementation StaticDataTableViewController
344 |
345 | - (id)initWithStyle:(UITableViewStyle)style
346 | {
347 | self = [super initWithStyle:style];
348 | if (self) {
349 |
350 | }
351 | return self;
352 | }
353 |
354 | - (void)viewDidLoad
355 | {
356 | [super viewDidLoad];
357 |
358 | self.insertTableViewRowAnimation = UITableViewRowAnimationRight;
359 | self.deleteTableViewRowAnimation = UITableViewRowAnimationLeft;
360 | self.reloadTableViewRowAnimation = UITableViewRowAnimationMiddle;
361 |
362 | self.originalTable = [[OriginalTable alloc] initWithTableView:self.tableView];
363 |
364 | }
365 |
366 | ////////////////////////////////////////////////////////////////////////
367 | #pragma mark - Public
368 | ////////////////////////////////////////////////////////////////////////
369 |
370 | - (void)updateCell:(UITableViewCell *)cell {
371 |
372 | OriginalRow * row = [self.originalTable originalRowWithTableViewCell:cell];
373 | [row update];
374 |
375 | }
376 |
377 | - (void)updateCells:(NSArray *)cells {
378 | for (UITableViewCell * cell in cells) {
379 | [self updateCell:cell];
380 | }
381 | }
382 |
383 | - (void)cell:(UITableViewCell *)cell setHidden:(BOOL)hidden {
384 |
385 | OriginalRow * row = [self.originalTable originalRowWithTableViewCell:cell];
386 | [row setHidden:hidden];
387 |
388 | }
389 |
390 | - (void)cells:(NSArray *)cells setHidden:(BOOL)hidden {
391 | for (UITableViewCell * cell in cells) {
392 | [self cell:cell setHidden:hidden];
393 | }
394 | }
395 |
396 | - (void)cell:(UITableViewCell *)cell setHeight:(CGFloat)height {
397 |
398 | OriginalRow * row = [self.originalTable originalRowWithTableViewCell:cell];
399 | [row setHeight:height];
400 |
401 | }
402 |
403 | - (void)cells:(NSArray *)cells setHeight:(CGFloat)height {
404 | for (UITableViewCell * cell in cells) {
405 | [self cell:cell setHeight:height];
406 | }
407 | }
408 |
409 | - (BOOL)cellIsHidden:(UITableViewCell *)cell {
410 | return [[self.originalTable originalRowWithTableViewCell:cell] hidden];
411 | }
412 |
413 | - (BOOL)isCellHidden:(UITableViewCell *)cell {
414 | return [[self.originalTable originalRowWithTableViewCell:cell] hidden];
415 | }
416 |
417 | - (void)reloadDataAnimated:(BOOL)animated {
418 |
419 | [self reloadDataAnimated:animated insertAnimation:self.insertTableViewRowAnimation reloadAnimation:self.reloadTableViewRowAnimation deleteAnimation:self.deleteTableViewRowAnimation];
420 |
421 | }
422 |
423 | - (void)reloadDataAnimated:(BOOL)animated insertAnimation:(UITableViewRowAnimation)insertAnimation reloadAnimation:(UITableViewRowAnimation)reloadAnimation deleteAnimation:(UITableViewRowAnimation)deleteAnimation {
424 |
425 | [self.originalTable prepareUpdates];
426 |
427 | if (!animated) {
428 |
429 | [self.tableView reloadData];
430 |
431 | } else {
432 |
433 | [self.tableView beginUpdates];
434 |
435 | [self.tableView reloadRowsAtIndexPaths:self.originalTable.updateIndexPaths withRowAnimation:reloadAnimation];
436 |
437 | [self.tableView insertRowsAtIndexPaths:self.originalTable.insertIndexPaths withRowAnimation:insertAnimation];
438 |
439 | [self.tableView deleteRowsAtIndexPaths:self.originalTable.deleteIndexPaths withRowAnimation:deleteAnimation];
440 |
441 | if ([self.originalTable.reloadSectionsIndexes count] > 0) {
442 |
443 | for (NSNumber * i in self.originalTable.reloadSectionsIndexes) {
444 | [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:[i integerValue]] withRowAnimation:self.reloadTableViewRowAnimation];
445 | }
446 |
447 | }
448 |
449 | [self.tableView endUpdates];
450 |
451 | }
452 |
453 | }
454 |
455 | ////////////////////////////////////////////////////////////////////////
456 | #pragma mark - Public / Should Overwrite
457 | ////////////////////////////////////////////////////////////////////////
458 |
459 | - (BOOL)showHeaderForSection:(NSInteger)section vissibleRows:(NSInteger)vissibleRows {
460 | return vissibleRows > 0;
461 | }
462 |
463 | - (BOOL)showFooterForSection:(NSInteger)section vissibleRows:(NSInteger)vissibleRows {
464 | return vissibleRows > 0;
465 | }
466 |
467 | ////////////////////////////////////////////////////////////////////////
468 | #pragma mark - TableView Data Source
469 | ////////////////////////////////////////////////////////////////////////
470 |
471 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
472 |
473 | if (self.originalTable == nil) {
474 | return [super tableView:tableView numberOfRowsInSection:section];
475 | }
476 |
477 | return [self.originalTable.sections[section] numberOfVissibleRows];
478 | }
479 |
480 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
481 |
482 | if (self.originalTable == nil) {
483 | return [super tableView:tableView cellForRowAtIndexPath:indexPath];
484 | }
485 |
486 | OriginalRow * or = [self.originalTable vissibleOriginalRowWithIndexPath:indexPath];
487 |
488 | NSAssert(or.cell != nil, @"Original cell cannot be nil, make sure to use a static table view");
489 |
490 | return or.cell;
491 | }
492 |
493 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
494 |
495 | if (self.originalTable != nil) {
496 | OriginalRow * or = [self.originalTable vissibleOriginalRowWithIndexPath:indexPath];
497 |
498 | if (or.height != CGFLOAT_MAX) {
499 | return or.height;
500 | }
501 |
502 | indexPath = or.originalIndexPath;
503 | }
504 | return [super tableView:tableView heightForRowAtIndexPath:indexPath];
505 | }
506 |
507 |
508 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
509 |
510 | if (self.originalTable == nil) {
511 | return [super tableView:tableView titleForHeaderInSection:section];
512 | }
513 |
514 | OriginalSection * os = self.originalTable.sections[section];
515 | if ([self showHeaderForSection:section vissibleRows:[os numberOfVissibleRows]]) {
516 | return [super tableView:tableView titleForHeaderInSection:section];
517 | } else {
518 | return nil;
519 | }
520 |
521 | }
522 |
523 | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
524 |
525 | if (self.originalTable == nil) {
526 | return [super tableView:tableView viewForHeaderInSection:section];
527 | }
528 |
529 | OriginalSection * os = self.originalTable.sections[section];
530 | if ([self showHeaderForSection:section vissibleRows:[os numberOfVissibleRows]]) {
531 | return [super tableView:tableView viewForHeaderInSection:section];
532 | } else {
533 | return nil;
534 | }
535 |
536 | }
537 |
538 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
539 |
540 | if (self.originalTable == nil) {
541 | return [super tableView:tableView heightForHeaderInSection:section];
542 | }
543 |
544 | OriginalSection * os = self.originalTable.sections[section];
545 | if ([self showHeaderForSection:section vissibleRows:[os numberOfVissibleRows]]) {
546 | return [super tableView:tableView heightForHeaderInSection:section];
547 | } else {
548 | return CGFLOAT_MIN;
549 | }
550 |
551 | }
552 |
553 | - (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section {
554 |
555 | if (self.originalTable == nil) {
556 | return [super tableView:tableView titleForFooterInSection:section];
557 | }
558 |
559 | OriginalSection * os = self.originalTable.sections[section];
560 | if ([self showFooterForSection:section vissibleRows:[os numberOfVissibleRows]]) {
561 | return [super tableView:tableView titleForFooterInSection:section];
562 | } else {
563 | return nil;
564 | }
565 |
566 | }
567 |
568 | - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
569 |
570 | if (self.originalTable == nil) {
571 | return [super tableView:tableView viewForFooterInSection:section];
572 | }
573 |
574 | OriginalSection * os = self.originalTable.sections[section];
575 | if ([self showFooterForSection:section vissibleRows:[os numberOfVissibleRows]]) {
576 | return [super tableView:tableView viewForFooterInSection:section];
577 | } else {
578 | return nil;
579 | }
580 |
581 | }
582 |
583 | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
584 |
585 | if (self.originalTable == nil) {
586 | return [super tableView:tableView heightForFooterInSection:section];
587 | }
588 |
589 | OriginalSection * os = self.originalTable.sections[section];
590 | if ([self showHeaderForSection:section vissibleRows:[os numberOfVissibleRows]]) {
591 | return [super tableView:tableView heightForFooterInSection:section];
592 | } else {
593 | return CGFLOAT_MIN;
594 | }
595 |
596 | }
597 |
598 | @end
599 |
--------------------------------------------------------------------------------
/StaticDataTableViewController.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = 'StaticDataTableViewController'
3 | s.version = '2.5.0'
4 | s.platform = :ios
5 | s.ios.deployment_target = '5.0'
6 | s.summary = 'Enabling animated hide/show of static cells for UITableView.'
7 | s.license = 'Apache License 2.0'
8 | s.homepage = 'https://github.com/peterpaulis/StaticDataTableViewController'
9 | s.requires_arc = true
10 | s.author = {
11 | 'Peter Paulis' => 'peter@min60.com'
12 | }
13 | s.source = {
14 | :git => 'https://github.com/peterpaulis/StaticDataTableViewController.git',
15 | :tag => '2.5.0'
16 | }
17 | s.source_files = '*.{h,m}'
18 | end
19 |
--------------------------------------------------------------------------------
/StaticDataTableViewControllerFramework/StaticDataTableViewControllerFramework.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 84A76D7720E141F5006CD4C4 /* StaticDataTableViewControllerFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A76D7520E141F5006CD4C4 /* StaticDataTableViewControllerFramework.h */; settings = {ATTRIBUTES = (Public, ); }; };
11 | /* End PBXBuildFile section */
12 |
13 | /* Begin PBXFileReference section */
14 | 84A76D7220E141F5006CD4C4 /* StaticDataTableViewControllerFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = StaticDataTableViewControllerFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; };
15 | 84A76D7520E141F5006CD4C4 /* StaticDataTableViewControllerFramework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StaticDataTableViewControllerFramework.h; sourceTree = ""; };
16 | 84A76D7620E141F5006CD4C4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
17 | /* End PBXFileReference section */
18 |
19 | /* Begin PBXFrameworksBuildPhase section */
20 | 84A76D6E20E141F5006CD4C4 /* Frameworks */ = {
21 | isa = PBXFrameworksBuildPhase;
22 | buildActionMask = 2147483647;
23 | files = (
24 | );
25 | runOnlyForDeploymentPostprocessing = 0;
26 | };
27 | /* End PBXFrameworksBuildPhase section */
28 |
29 | /* Begin PBXGroup section */
30 | 84A76D6820E141F5006CD4C4 = {
31 | isa = PBXGroup;
32 | children = (
33 | 84A76D7420E141F5006CD4C4 /* StaticDataTableViewControllerFramework */,
34 | 84A76D7320E141F5006CD4C4 /* Products */,
35 | );
36 | sourceTree = "";
37 | };
38 | 84A76D7320E141F5006CD4C4 /* Products */ = {
39 | isa = PBXGroup;
40 | children = (
41 | 84A76D7220E141F5006CD4C4 /* StaticDataTableViewControllerFramework.framework */,
42 | );
43 | name = Products;
44 | sourceTree = "";
45 | };
46 | 84A76D7420E141F5006CD4C4 /* StaticDataTableViewControllerFramework */ = {
47 | isa = PBXGroup;
48 | children = (
49 | 84A76D7520E141F5006CD4C4 /* StaticDataTableViewControllerFramework.h */,
50 | 84A76D7620E141F5006CD4C4 /* Info.plist */,
51 | );
52 | path = StaticDataTableViewControllerFramework;
53 | sourceTree = "";
54 | };
55 | /* End PBXGroup section */
56 |
57 | /* Begin PBXHeadersBuildPhase section */
58 | 84A76D6F20E141F5006CD4C4 /* Headers */ = {
59 | isa = PBXHeadersBuildPhase;
60 | buildActionMask = 2147483647;
61 | files = (
62 | 84A76D7720E141F5006CD4C4 /* StaticDataTableViewControllerFramework.h in Headers */,
63 | );
64 | runOnlyForDeploymentPostprocessing = 0;
65 | };
66 | /* End PBXHeadersBuildPhase section */
67 |
68 | /* Begin PBXNativeTarget section */
69 | 84A76D7120E141F5006CD4C4 /* StaticDataTableViewControllerFramework */ = {
70 | isa = PBXNativeTarget;
71 | buildConfigurationList = 84A76D7A20E141F5006CD4C4 /* Build configuration list for PBXNativeTarget "StaticDataTableViewControllerFramework" */;
72 | buildPhases = (
73 | 84A76D6D20E141F5006CD4C4 /* Sources */,
74 | 84A76D6E20E141F5006CD4C4 /* Frameworks */,
75 | 84A76D6F20E141F5006CD4C4 /* Headers */,
76 | 84A76D7020E141F5006CD4C4 /* Resources */,
77 | );
78 | buildRules = (
79 | );
80 | dependencies = (
81 | );
82 | name = StaticDataTableViewControllerFramework;
83 | productName = StaticDataTableViewControllerFramework;
84 | productReference = 84A76D7220E141F5006CD4C4 /* StaticDataTableViewControllerFramework.framework */;
85 | productType = "com.apple.product-type.framework";
86 | };
87 | /* End PBXNativeTarget section */
88 |
89 | /* Begin PBXProject section */
90 | 84A76D6920E141F5006CD4C4 /* Project object */ = {
91 | isa = PBXProject;
92 | attributes = {
93 | LastUpgradeCheck = 0940;
94 | ORGANIZATIONNAME = "Peter Paulis";
95 | TargetAttributes = {
96 | 84A76D7120E141F5006CD4C4 = {
97 | CreatedOnToolsVersion = 9.4.1;
98 | };
99 | };
100 | };
101 | buildConfigurationList = 84A76D6C20E141F5006CD4C4 /* Build configuration list for PBXProject "StaticDataTableViewControllerFramework" */;
102 | compatibilityVersion = "Xcode 9.3";
103 | developmentRegion = en;
104 | hasScannedForEncodings = 0;
105 | knownRegions = (
106 | en,
107 | );
108 | mainGroup = 84A76D6820E141F5006CD4C4;
109 | productRefGroup = 84A76D7320E141F5006CD4C4 /* Products */;
110 | projectDirPath = "";
111 | projectRoot = "";
112 | targets = (
113 | 84A76D7120E141F5006CD4C4 /* StaticDataTableViewControllerFramework */,
114 | );
115 | };
116 | /* End PBXProject section */
117 |
118 | /* Begin PBXResourcesBuildPhase section */
119 | 84A76D7020E141F5006CD4C4 /* Resources */ = {
120 | isa = PBXResourcesBuildPhase;
121 | buildActionMask = 2147483647;
122 | files = (
123 | );
124 | runOnlyForDeploymentPostprocessing = 0;
125 | };
126 | /* End PBXResourcesBuildPhase section */
127 |
128 | /* Begin PBXSourcesBuildPhase section */
129 | 84A76D6D20E141F5006CD4C4 /* Sources */ = {
130 | isa = PBXSourcesBuildPhase;
131 | buildActionMask = 2147483647;
132 | files = (
133 | );
134 | runOnlyForDeploymentPostprocessing = 0;
135 | };
136 | /* End PBXSourcesBuildPhase section */
137 |
138 | /* Begin XCBuildConfiguration section */
139 | 84A76D7820E141F5006CD4C4 /* Debug */ = {
140 | isa = XCBuildConfiguration;
141 | buildSettings = {
142 | ALWAYS_SEARCH_USER_PATHS = NO;
143 | CLANG_ANALYZER_NONNULL = YES;
144 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
145 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
146 | CLANG_CXX_LIBRARY = "libc++";
147 | CLANG_ENABLE_MODULES = YES;
148 | CLANG_ENABLE_OBJC_ARC = YES;
149 | CLANG_ENABLE_OBJC_WEAK = YES;
150 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
151 | CLANG_WARN_BOOL_CONVERSION = YES;
152 | CLANG_WARN_COMMA = YES;
153 | CLANG_WARN_CONSTANT_CONVERSION = YES;
154 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
155 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
156 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
157 | CLANG_WARN_EMPTY_BODY = YES;
158 | CLANG_WARN_ENUM_CONVERSION = YES;
159 | CLANG_WARN_INFINITE_RECURSION = YES;
160 | CLANG_WARN_INT_CONVERSION = YES;
161 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
162 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
163 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
164 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
165 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
166 | CLANG_WARN_STRICT_PROTOTYPES = YES;
167 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
168 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
169 | CLANG_WARN_UNREACHABLE_CODE = YES;
170 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
171 | CODE_SIGN_IDENTITY = "iPhone Developer";
172 | COPY_PHASE_STRIP = NO;
173 | CURRENT_PROJECT_VERSION = 1;
174 | DEBUG_INFORMATION_FORMAT = dwarf;
175 | ENABLE_STRICT_OBJC_MSGSEND = YES;
176 | ENABLE_TESTABILITY = YES;
177 | GCC_C_LANGUAGE_STANDARD = gnu11;
178 | GCC_DYNAMIC_NO_PIC = NO;
179 | GCC_NO_COMMON_BLOCKS = YES;
180 | GCC_OPTIMIZATION_LEVEL = 0;
181 | GCC_PREPROCESSOR_DEFINITIONS = (
182 | "DEBUG=1",
183 | "$(inherited)",
184 | );
185 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
186 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
187 | GCC_WARN_UNDECLARED_SELECTOR = YES;
188 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
189 | GCC_WARN_UNUSED_FUNCTION = YES;
190 | GCC_WARN_UNUSED_VARIABLE = YES;
191 | IPHONEOS_DEPLOYMENT_TARGET = 11.4;
192 | MTL_ENABLE_DEBUG_INFO = YES;
193 | ONLY_ACTIVE_ARCH = YES;
194 | SDKROOT = iphoneos;
195 | VERSIONING_SYSTEM = "apple-generic";
196 | VERSION_INFO_PREFIX = "";
197 | };
198 | name = Debug;
199 | };
200 | 84A76D7920E141F5006CD4C4 /* Release */ = {
201 | isa = XCBuildConfiguration;
202 | buildSettings = {
203 | ALWAYS_SEARCH_USER_PATHS = NO;
204 | CLANG_ANALYZER_NONNULL = YES;
205 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
206 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
207 | CLANG_CXX_LIBRARY = "libc++";
208 | CLANG_ENABLE_MODULES = YES;
209 | CLANG_ENABLE_OBJC_ARC = YES;
210 | CLANG_ENABLE_OBJC_WEAK = YES;
211 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
212 | CLANG_WARN_BOOL_CONVERSION = YES;
213 | CLANG_WARN_COMMA = YES;
214 | CLANG_WARN_CONSTANT_CONVERSION = YES;
215 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
216 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
217 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
218 | CLANG_WARN_EMPTY_BODY = YES;
219 | CLANG_WARN_ENUM_CONVERSION = YES;
220 | CLANG_WARN_INFINITE_RECURSION = YES;
221 | CLANG_WARN_INT_CONVERSION = YES;
222 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
223 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
224 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
225 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
226 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
227 | CLANG_WARN_STRICT_PROTOTYPES = YES;
228 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
229 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
230 | CLANG_WARN_UNREACHABLE_CODE = YES;
231 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
232 | CODE_SIGN_IDENTITY = "iPhone Developer";
233 | COPY_PHASE_STRIP = NO;
234 | CURRENT_PROJECT_VERSION = 1;
235 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
236 | ENABLE_NS_ASSERTIONS = NO;
237 | ENABLE_STRICT_OBJC_MSGSEND = YES;
238 | GCC_C_LANGUAGE_STANDARD = gnu11;
239 | GCC_NO_COMMON_BLOCKS = YES;
240 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
241 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
242 | GCC_WARN_UNDECLARED_SELECTOR = YES;
243 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
244 | GCC_WARN_UNUSED_FUNCTION = YES;
245 | GCC_WARN_UNUSED_VARIABLE = YES;
246 | IPHONEOS_DEPLOYMENT_TARGET = 11.4;
247 | MTL_ENABLE_DEBUG_INFO = NO;
248 | SDKROOT = iphoneos;
249 | VALIDATE_PRODUCT = YES;
250 | VERSIONING_SYSTEM = "apple-generic";
251 | VERSION_INFO_PREFIX = "";
252 | };
253 | name = Release;
254 | };
255 | 84A76D7B20E141F5006CD4C4 /* Debug */ = {
256 | isa = XCBuildConfiguration;
257 | buildSettings = {
258 | CODE_SIGN_IDENTITY = "";
259 | CODE_SIGN_STYLE = Manual;
260 | DEFINES_MODULE = YES;
261 | DEVELOPMENT_TEAM = "";
262 | DYLIB_COMPATIBILITY_VERSION = 1;
263 | DYLIB_CURRENT_VERSION = 1;
264 | DYLIB_INSTALL_NAME_BASE = "@rpath";
265 | INFOPLIST_FILE = StaticDataTableViewControllerFramework/Info.plist;
266 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
267 | LD_RUNPATH_SEARCH_PATHS = (
268 | "$(inherited)",
269 | "@executable_path/Frameworks",
270 | "@loader_path/Frameworks",
271 | );
272 | PRODUCT_BUNDLE_IDENTIFIER = com.min60.StaticDataTableViewControllerFramework;
273 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
274 | PROVISIONING_PROFILE_SPECIFIER = "";
275 | SKIP_INSTALL = YES;
276 | TARGETED_DEVICE_FAMILY = "1,2";
277 | };
278 | name = Debug;
279 | };
280 | 84A76D7C20E141F5006CD4C4 /* Release */ = {
281 | isa = XCBuildConfiguration;
282 | buildSettings = {
283 | CODE_SIGN_IDENTITY = "";
284 | CODE_SIGN_STYLE = Manual;
285 | DEFINES_MODULE = YES;
286 | DEVELOPMENT_TEAM = "";
287 | DYLIB_COMPATIBILITY_VERSION = 1;
288 | DYLIB_CURRENT_VERSION = 1;
289 | DYLIB_INSTALL_NAME_BASE = "@rpath";
290 | INFOPLIST_FILE = StaticDataTableViewControllerFramework/Info.plist;
291 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
292 | LD_RUNPATH_SEARCH_PATHS = (
293 | "$(inherited)",
294 | "@executable_path/Frameworks",
295 | "@loader_path/Frameworks",
296 | );
297 | PRODUCT_BUNDLE_IDENTIFIER = com.min60.StaticDataTableViewControllerFramework;
298 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
299 | PROVISIONING_PROFILE_SPECIFIER = "";
300 | SKIP_INSTALL = YES;
301 | TARGETED_DEVICE_FAMILY = "1,2";
302 | };
303 | name = Release;
304 | };
305 | /* End XCBuildConfiguration section */
306 |
307 | /* Begin XCConfigurationList section */
308 | 84A76D6C20E141F5006CD4C4 /* Build configuration list for PBXProject "StaticDataTableViewControllerFramework" */ = {
309 | isa = XCConfigurationList;
310 | buildConfigurations = (
311 | 84A76D7820E141F5006CD4C4 /* Debug */,
312 | 84A76D7920E141F5006CD4C4 /* Release */,
313 | );
314 | defaultConfigurationIsVisible = 0;
315 | defaultConfigurationName = Release;
316 | };
317 | 84A76D7A20E141F5006CD4C4 /* Build configuration list for PBXNativeTarget "StaticDataTableViewControllerFramework" */ = {
318 | isa = XCConfigurationList;
319 | buildConfigurations = (
320 | 84A76D7B20E141F5006CD4C4 /* Debug */,
321 | 84A76D7C20E141F5006CD4C4 /* Release */,
322 | );
323 | defaultConfigurationIsVisible = 0;
324 | defaultConfigurationName = Release;
325 | };
326 | /* End XCConfigurationList section */
327 | };
328 | rootObject = 84A76D6920E141F5006CD4C4 /* Project object */;
329 | }
330 |
--------------------------------------------------------------------------------
/StaticDataTableViewControllerFramework/StaticDataTableViewControllerFramework.xcodeproj/xcshareddata/xcschemes/Framework.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/StaticDataTableViewControllerFramework/StaticDataTableViewControllerFramework/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 2.5.1
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | NSPrincipalClass
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/StaticDataTableViewControllerFramework/StaticDataTableViewControllerFramework/StaticDataTableViewControllerFramework.h:
--------------------------------------------------------------------------------
1 | //
2 | // StaticDataTableViewControllerFramework.h
3 | // StaticDataTableViewControllerFramework
4 | //
5 | // Created by Peter Paulis on 25/06/2018.
6 | // Copyright © 2018 Peter Paulis. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for StaticDataTableViewControllerFramework.
12 | FOUNDATION_EXPORT double StaticDataTableViewControllerFrameworkVersionNumber;
13 |
14 | //! Project version string for StaticDataTableViewControllerFramework.
15 | FOUNDATION_EXPORT const unsigned char StaticDataTableViewControllerFrameworkVersionString[];
16 |
17 | #ifndef _StaticDataTableViewControllerFramework_
18 | #define _StaticDataTableViewControllerFramework_
19 |
20 | #import
21 |
22 | #endif /* _StaticDataTableViewControllerFramework_ */
23 |
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 7EF99BD916BC4DB90066958C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7EF99BD816BC4DB90066958C /* UIKit.framework */; };
11 | 7EF99BDB16BC4DB90066958C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7EF99BDA16BC4DB90066958C /* Foundation.framework */; };
12 | 7EF99BDD16BC4DB90066958C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7EF99BDC16BC4DB90066958C /* CoreGraphics.framework */; };
13 | 7EF99BE316BC4DB90066958C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7EF99BE116BC4DB90066958C /* InfoPlist.strings */; };
14 | 7EF99BE516BC4DB90066958C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7EF99BE416BC4DB90066958C /* main.m */; };
15 | 7EF99BE916BC4DB90066958C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7EF99BE816BC4DB90066958C /* AppDelegate.m */; };
16 | 7EF99BF216BC4DB90066958C /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7EF99BF016BC4DB90066958C /* MainStoryboard.storyboard */; };
17 | 7EF99BFD16BC4DCD0066958C /* StaticDataTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7EF99BFC16BC4DCD0066958C /* StaticDataTableViewController.m */; };
18 | 84A19D5220B70B48006E56E3 /* DemoTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84A19D5120B70B48006E56E3 /* DemoTableViewController.m */; };
19 | BEC71BC61B613BA000684A56 /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = BEC71BC51B613BA000684A56 /* Launch Screen.xib */; };
20 | BEC71BC81B613C0000684A56 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BEC71BC71B613C0000684A56 /* Images.xcassets */; };
21 | /* End PBXBuildFile section */
22 |
23 | /* Begin PBXFileReference section */
24 | 7EF99BD516BC4DB90066958C /* StaticTableViewControllerSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = StaticTableViewControllerSample.app; sourceTree = BUILT_PRODUCTS_DIR; };
25 | 7EF99BD816BC4DB90066958C /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
26 | 7EF99BDA16BC4DB90066958C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
27 | 7EF99BDC16BC4DB90066958C /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
28 | 7EF99BE016BC4DB90066958C /* StaticTableViewControllerSample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "StaticTableViewControllerSample-Info.plist"; sourceTree = ""; };
29 | 7EF99BE216BC4DB90066958C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
30 | 7EF99BE416BC4DB90066958C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
31 | 7EF99BE616BC4DB90066958C /* StaticTableViewControllerSample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "StaticTableViewControllerSample-Prefix.pch"; sourceTree = ""; };
32 | 7EF99BE716BC4DB90066958C /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
33 | 7EF99BE816BC4DB90066958C /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
34 | 7EF99BF116BC4DB90066958C /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = ""; };
35 | 7EF99BFB16BC4DCD0066958C /* StaticDataTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StaticDataTableViewController.h; path = ../../StaticDataTableViewController.h; sourceTree = ""; };
36 | 7EF99BFC16BC4DCD0066958C /* StaticDataTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = StaticDataTableViewController.m; path = ../../StaticDataTableViewController.m; sourceTree = ""; };
37 | 84A19D5020B70B48006E56E3 /* DemoTableViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DemoTableViewController.h; sourceTree = ""; };
38 | 84A19D5120B70B48006E56E3 /* DemoTableViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DemoTableViewController.m; sourceTree = ""; };
39 | 84A19D5320B7360E006E56E3 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
40 | BEC71BC51B613BA000684A56 /* Launch Screen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "Launch Screen.xib"; sourceTree = ""; };
41 | BEC71BC71B613C0000684A56 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
42 | /* End PBXFileReference section */
43 |
44 | /* Begin PBXFrameworksBuildPhase section */
45 | 7EF99BD216BC4DB90066958C /* Frameworks */ = {
46 | isa = PBXFrameworksBuildPhase;
47 | buildActionMask = 2147483647;
48 | files = (
49 | 7EF99BD916BC4DB90066958C /* UIKit.framework in Frameworks */,
50 | 7EF99BDB16BC4DB90066958C /* Foundation.framework in Frameworks */,
51 | 7EF99BDD16BC4DB90066958C /* CoreGraphics.framework in Frameworks */,
52 | );
53 | runOnlyForDeploymentPostprocessing = 0;
54 | };
55 | /* End PBXFrameworksBuildPhase section */
56 |
57 | /* Begin PBXGroup section */
58 | 7EF99BCC16BC4DB90066958C = {
59 | isa = PBXGroup;
60 | children = (
61 | 7EF99BDE16BC4DB90066958C /* StaticTableViewControllerSample */,
62 | 7EF99BD716BC4DB90066958C /* Frameworks */,
63 | 7EF99BD616BC4DB90066958C /* Products */,
64 | );
65 | sourceTree = "";
66 | };
67 | 7EF99BD616BC4DB90066958C /* Products */ = {
68 | isa = PBXGroup;
69 | children = (
70 | 7EF99BD516BC4DB90066958C /* StaticTableViewControllerSample.app */,
71 | );
72 | name = Products;
73 | sourceTree = "";
74 | };
75 | 7EF99BD716BC4DB90066958C /* Frameworks */ = {
76 | isa = PBXGroup;
77 | children = (
78 | 84A19D5320B7360E006E56E3 /* QuartzCore.framework */,
79 | 7EF99BD816BC4DB90066958C /* UIKit.framework */,
80 | 7EF99BDA16BC4DB90066958C /* Foundation.framework */,
81 | 7EF99BDC16BC4DB90066958C /* CoreGraphics.framework */,
82 | );
83 | name = Frameworks;
84 | sourceTree = "";
85 | };
86 | 7EF99BDE16BC4DB90066958C /* StaticTableViewControllerSample */ = {
87 | isa = PBXGroup;
88 | children = (
89 | 7EF99BFB16BC4DCD0066958C /* StaticDataTableViewController.h */,
90 | 7EF99BFC16BC4DCD0066958C /* StaticDataTableViewController.m */,
91 | 7EF99BE716BC4DB90066958C /* AppDelegate.h */,
92 | 7EF99BE816BC4DB90066958C /* AppDelegate.m */,
93 | 7EF99BF016BC4DB90066958C /* MainStoryboard.storyboard */,
94 | 84A19D5020B70B48006E56E3 /* DemoTableViewController.h */,
95 | 84A19D5120B70B48006E56E3 /* DemoTableViewController.m */,
96 | BEC71BC71B613C0000684A56 /* Images.xcassets */,
97 | 7EF99BDF16BC4DB90066958C /* Supporting Files */,
98 | );
99 | path = StaticTableViewControllerSample;
100 | sourceTree = "";
101 | };
102 | 7EF99BDF16BC4DB90066958C /* Supporting Files */ = {
103 | isa = PBXGroup;
104 | children = (
105 | 7EF99BE016BC4DB90066958C /* StaticTableViewControllerSample-Info.plist */,
106 | 7EF99BE116BC4DB90066958C /* InfoPlist.strings */,
107 | 7EF99BE416BC4DB90066958C /* main.m */,
108 | 7EF99BE616BC4DB90066958C /* StaticTableViewControllerSample-Prefix.pch */,
109 | BEC71BC51B613BA000684A56 /* Launch Screen.xib */,
110 | );
111 | name = "Supporting Files";
112 | sourceTree = "";
113 | };
114 | /* End PBXGroup section */
115 |
116 | /* Begin PBXNativeTarget section */
117 | 7EF99BD416BC4DB90066958C /* StaticTableViewControllerSample */ = {
118 | isa = PBXNativeTarget;
119 | buildConfigurationList = 7EF99BF816BC4DB90066958C /* Build configuration list for PBXNativeTarget "StaticTableViewControllerSample" */;
120 | buildPhases = (
121 | 7EF99BD116BC4DB90066958C /* Sources */,
122 | 7EF99BD216BC4DB90066958C /* Frameworks */,
123 | 7EF99BD316BC4DB90066958C /* Resources */,
124 | );
125 | buildRules = (
126 | );
127 | dependencies = (
128 | );
129 | name = StaticTableViewControllerSample;
130 | productName = StaticTableViewControllerSample;
131 | productReference = 7EF99BD516BC4DB90066958C /* StaticTableViewControllerSample.app */;
132 | productType = "com.apple.product-type.application";
133 | };
134 | /* End PBXNativeTarget section */
135 |
136 | /* Begin PBXProject section */
137 | 7EF99BCD16BC4DB90066958C /* Project object */ = {
138 | isa = PBXProject;
139 | attributes = {
140 | LastUpgradeCheck = 0930;
141 | ORGANIZATIONNAME = "Peter Paulis";
142 | };
143 | buildConfigurationList = 7EF99BD016BC4DB90066958C /* Build configuration list for PBXProject "StaticTableViewControllerSample" */;
144 | compatibilityVersion = "Xcode 3.2";
145 | developmentRegion = English;
146 | hasScannedForEncodings = 0;
147 | knownRegions = (
148 | en,
149 | );
150 | mainGroup = 7EF99BCC16BC4DB90066958C;
151 | productRefGroup = 7EF99BD616BC4DB90066958C /* Products */;
152 | projectDirPath = "";
153 | projectRoot = "";
154 | targets = (
155 | 7EF99BD416BC4DB90066958C /* StaticTableViewControllerSample */,
156 | );
157 | };
158 | /* End PBXProject section */
159 |
160 | /* Begin PBXResourcesBuildPhase section */
161 | 7EF99BD316BC4DB90066958C /* Resources */ = {
162 | isa = PBXResourcesBuildPhase;
163 | buildActionMask = 2147483647;
164 | files = (
165 | 7EF99BE316BC4DB90066958C /* InfoPlist.strings in Resources */,
166 | BEC71BC81B613C0000684A56 /* Images.xcassets in Resources */,
167 | 7EF99BF216BC4DB90066958C /* MainStoryboard.storyboard in Resources */,
168 | BEC71BC61B613BA000684A56 /* Launch Screen.xib in Resources */,
169 | );
170 | runOnlyForDeploymentPostprocessing = 0;
171 | };
172 | /* End PBXResourcesBuildPhase section */
173 |
174 | /* Begin PBXSourcesBuildPhase section */
175 | 7EF99BD116BC4DB90066958C /* Sources */ = {
176 | isa = PBXSourcesBuildPhase;
177 | buildActionMask = 2147483647;
178 | files = (
179 | 7EF99BE516BC4DB90066958C /* main.m in Sources */,
180 | 7EF99BE916BC4DB90066958C /* AppDelegate.m in Sources */,
181 | 84A19D5220B70B48006E56E3 /* DemoTableViewController.m in Sources */,
182 | 7EF99BFD16BC4DCD0066958C /* StaticDataTableViewController.m in Sources */,
183 | );
184 | runOnlyForDeploymentPostprocessing = 0;
185 | };
186 | /* End PBXSourcesBuildPhase section */
187 |
188 | /* Begin PBXVariantGroup section */
189 | 7EF99BE116BC4DB90066958C /* InfoPlist.strings */ = {
190 | isa = PBXVariantGroup;
191 | children = (
192 | 7EF99BE216BC4DB90066958C /* en */,
193 | );
194 | name = InfoPlist.strings;
195 | sourceTree = "";
196 | };
197 | 7EF99BF016BC4DB90066958C /* MainStoryboard.storyboard */ = {
198 | isa = PBXVariantGroup;
199 | children = (
200 | 7EF99BF116BC4DB90066958C /* en */,
201 | );
202 | name = MainStoryboard.storyboard;
203 | sourceTree = "";
204 | };
205 | /* End PBXVariantGroup section */
206 |
207 | /* Begin XCBuildConfiguration section */
208 | 7EF99BF616BC4DB90066958C /* Debug */ = {
209 | isa = XCBuildConfiguration;
210 | buildSettings = {
211 | ALWAYS_SEARCH_USER_PATHS = NO;
212 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
213 | CLANG_CXX_LIBRARY = "libc++";
214 | CLANG_ENABLE_OBJC_ARC = YES;
215 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
216 | CLANG_WARN_BOOL_CONVERSION = YES;
217 | CLANG_WARN_COMMA = YES;
218 | CLANG_WARN_CONSTANT_CONVERSION = YES;
219 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
220 | CLANG_WARN_EMPTY_BODY = YES;
221 | CLANG_WARN_ENUM_CONVERSION = YES;
222 | CLANG_WARN_INFINITE_RECURSION = YES;
223 | CLANG_WARN_INT_CONVERSION = YES;
224 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
225 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
226 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
227 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
228 | CLANG_WARN_STRICT_PROTOTYPES = YES;
229 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
230 | CLANG_WARN_UNREACHABLE_CODE = YES;
231 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
232 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
233 | COPY_PHASE_STRIP = NO;
234 | ENABLE_STRICT_OBJC_MSGSEND = YES;
235 | ENABLE_TESTABILITY = YES;
236 | GCC_C_LANGUAGE_STANDARD = gnu99;
237 | GCC_DYNAMIC_NO_PIC = NO;
238 | GCC_NO_COMMON_BLOCKS = YES;
239 | GCC_OPTIMIZATION_LEVEL = 0;
240 | GCC_PREPROCESSOR_DEFINITIONS = (
241 | "DEBUG=1",
242 | "$(inherited)",
243 | );
244 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
245 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
246 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
247 | GCC_WARN_UNDECLARED_SELECTOR = YES;
248 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
249 | GCC_WARN_UNUSED_FUNCTION = YES;
250 | GCC_WARN_UNUSED_VARIABLE = YES;
251 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
252 | ONLY_ACTIVE_ARCH = YES;
253 | SDKROOT = iphoneos;
254 | };
255 | name = Debug;
256 | };
257 | 7EF99BF716BC4DB90066958C /* Release */ = {
258 | isa = XCBuildConfiguration;
259 | buildSettings = {
260 | ALWAYS_SEARCH_USER_PATHS = NO;
261 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
262 | CLANG_CXX_LIBRARY = "libc++";
263 | CLANG_ENABLE_OBJC_ARC = YES;
264 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
265 | CLANG_WARN_BOOL_CONVERSION = YES;
266 | CLANG_WARN_COMMA = YES;
267 | CLANG_WARN_CONSTANT_CONVERSION = YES;
268 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
269 | CLANG_WARN_EMPTY_BODY = YES;
270 | CLANG_WARN_ENUM_CONVERSION = YES;
271 | CLANG_WARN_INFINITE_RECURSION = YES;
272 | CLANG_WARN_INT_CONVERSION = YES;
273 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
274 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
275 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
276 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
277 | CLANG_WARN_STRICT_PROTOTYPES = YES;
278 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
279 | CLANG_WARN_UNREACHABLE_CODE = YES;
280 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
281 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
282 | COPY_PHASE_STRIP = YES;
283 | ENABLE_STRICT_OBJC_MSGSEND = YES;
284 | GCC_C_LANGUAGE_STANDARD = gnu99;
285 | GCC_NO_COMMON_BLOCKS = YES;
286 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
287 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
288 | GCC_WARN_UNDECLARED_SELECTOR = YES;
289 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
290 | GCC_WARN_UNUSED_FUNCTION = YES;
291 | GCC_WARN_UNUSED_VARIABLE = YES;
292 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
293 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
294 | SDKROOT = iphoneos;
295 | VALIDATE_PRODUCT = YES;
296 | };
297 | name = Release;
298 | };
299 | 7EF99BF916BC4DB90066958C /* Debug */ = {
300 | isa = XCBuildConfiguration;
301 | buildSettings = {
302 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
303 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
304 | DEVELOPMENT_TEAM = "";
305 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
306 | GCC_PREFIX_HEADER = "StaticTableViewControllerSample/StaticTableViewControllerSample-Prefix.pch";
307 | INFOPLIST_FILE = "StaticTableViewControllerSample/StaticTableViewControllerSample-Info.plist";
308 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
309 | PRODUCT_BUNDLE_IDENTIFIER = com.cocoapods.StaticTableViewControllerSample;
310 | PRODUCT_NAME = "$(TARGET_NAME)";
311 | TARGETED_DEVICE_FAMILY = 1;
312 | WRAPPER_EXTENSION = app;
313 | };
314 | name = Debug;
315 | };
316 | 7EF99BFA16BC4DB90066958C /* Release */ = {
317 | isa = XCBuildConfiguration;
318 | buildSettings = {
319 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
320 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
321 | DEVELOPMENT_TEAM = "";
322 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
323 | GCC_PREFIX_HEADER = "StaticTableViewControllerSample/StaticTableViewControllerSample-Prefix.pch";
324 | INFOPLIST_FILE = "StaticTableViewControllerSample/StaticTableViewControllerSample-Info.plist";
325 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
326 | PRODUCT_BUNDLE_IDENTIFIER = com.cocoapods.StaticTableViewControllerSample;
327 | PRODUCT_NAME = "$(TARGET_NAME)";
328 | TARGETED_DEVICE_FAMILY = 1;
329 | WRAPPER_EXTENSION = app;
330 | };
331 | name = Release;
332 | };
333 | /* End XCBuildConfiguration section */
334 |
335 | /* Begin XCConfigurationList section */
336 | 7EF99BD016BC4DB90066958C /* Build configuration list for PBXProject "StaticTableViewControllerSample" */ = {
337 | isa = XCConfigurationList;
338 | buildConfigurations = (
339 | 7EF99BF616BC4DB90066958C /* Debug */,
340 | 7EF99BF716BC4DB90066958C /* Release */,
341 | );
342 | defaultConfigurationIsVisible = 0;
343 | defaultConfigurationName = Release;
344 | };
345 | 7EF99BF816BC4DB90066958C /* Build configuration list for PBXNativeTarget "StaticTableViewControllerSample" */ = {
346 | isa = XCConfigurationList;
347 | buildConfigurations = (
348 | 7EF99BF916BC4DB90066958C /* Debug */,
349 | 7EF99BFA16BC4DB90066958C /* Release */,
350 | );
351 | defaultConfigurationIsVisible = 0;
352 | defaultConfigurationName = Release;
353 | };
354 | /* End XCConfigurationList section */
355 | };
356 | rootObject = 7EF99BCD16BC4DB90066958C /* Project object */;
357 | }
358 |
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample.xcodeproj/project.xcworkspace/xcuserdata/Paulis.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterpaulis/StaticDataTableViewController/818eb911db2f4165cb9be14a16f7bd27d8a0da14/StaticTableViewControllerSample/StaticTableViewControllerSample.xcodeproj/project.xcworkspace/xcuserdata/Paulis.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample.xcodeproj/xcuserdata/Paulis.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
18 |
19 |
31 |
32 |
33 |
34 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample.xcodeproj/xcuserdata/Paulis.xcuserdatad/xcschemes/StaticTableViewControllerSample.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
51 |
52 |
58 |
59 |
60 |
61 |
62 |
63 |
69 |
70 |
76 |
77 |
78 |
79 |
81 |
82 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample.xcodeproj/xcuserdata/Paulis.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | StaticTableViewControllerSample.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 7EF99BD416BC4DB90066958C
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // StaticTableViewControllerSample
4 | //
5 | // Created by Peter Paulis on 1.2.2013.
6 | // Copyright (c) 2013 Peter Paulis. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // StaticTableViewControllerSample
4 | //
5 | // Created by Peter Paulis on 1.2.2013.
6 | // Copyright (c) 2013 Peter Paulis. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @implementation AppDelegate
12 |
13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
14 | {
15 | // Override point for customization after application launch.
16 | return YES;
17 | }
18 |
19 | - (void)applicationWillResignActive:(UIApplication *)application
20 | {
21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
23 | }
24 |
25 | - (void)applicationDidEnterBackground:(UIApplication *)application
26 | {
27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
29 | }
30 |
31 | - (void)applicationWillEnterForeground:(UIApplication *)application
32 | {
33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | - (void)applicationDidBecomeActive:(UIApplication *)application
37 | {
38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
39 | }
40 |
41 | - (void)applicationWillTerminate:(UIApplication *)application
42 | {
43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
44 | }
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample/DemoTableViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // DemoTableViewController.h
3 | // StaticTableViewControllerSample
4 | //
5 | // Created by Peter Paulis on 24/05/2018.
6 | // Copyright © 2018 Peter Paulis. All rights reserved.
7 | //
8 |
9 | #import "StaticDataTableViewController.h"
10 |
11 | @interface DemoTableViewController : StaticDataTableViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample/DemoTableViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // DemoTableViewController.m
3 | // StaticTableViewControllerSample
4 | //
5 | // Created by Peter Paulis on 24/05/2018.
6 | // Copyright © 2018 Peter Paulis. All rights reserved.
7 | //
8 |
9 | #import "DemoTableViewController.h"
10 |
11 | @interface DemoTableViewController ()
12 |
13 | @property (weak, nonatomic) IBOutlet UITableViewCell *cell1;
14 | @property (weak, nonatomic) IBOutlet UITableViewCell *cell3;
15 | @property (weak, nonatomic) IBOutlet UITableViewCell *cell4;
16 | @property (weak, nonatomic) IBOutlet UITableViewCell *cell9;
17 |
18 | @property (weak, nonatomic) IBOutlet UIButton *cell2Button;
19 | @property (weak, nonatomic) IBOutlet UIButton *cell3Button;
20 | @property (weak, nonatomic) IBOutlet UIButton *cell6Button;
21 |
22 | @property (weak, nonatomic) IBOutlet UITableViewCell *animationSettingsCells;
23 |
24 | @property (weak, nonatomic) IBOutlet UISegmentedControl *insertAnimationsSegmentedControl;
25 | @property (weak, nonatomic) IBOutlet UISegmentedControl *deleteAnimationsSegmentedControl;
26 | @property (weak, nonatomic) IBOutlet UISegmentedControl *reloadAnimationsSegmentedControl;
27 | @property (weak, nonatomic) IBOutlet UISwitch *animationsSwitch;
28 | @property (strong, nonatomic) IBOutlet UIView *animationsCustomHeaderView;
29 |
30 | @property (strong, nonatomic) IBOutletCollection(UITableViewCell) NSArray *section2Cells;
31 |
32 |
33 | @end
34 |
35 | @implementation DemoTableViewController
36 |
37 | - (IBAction)cell1ButtonPressed:(id)sender {
38 |
39 | [self cell:self.cell1 setHidden:YES];
40 |
41 | [self reloadDataAnimated:self.animationsSwitch.isOn];
42 |
43 | }
44 |
45 | - (IBAction)cell2ButtonPressed:(id)sender {
46 |
47 | BOOL isHidden = [self isCellHidden:self.cell1];
48 | [self cell:self.cell1 setHidden:!isHidden];
49 |
50 | [self reloadDataAnimated:self.animationsSwitch.isOn];
51 |
52 | }
53 |
54 | - (IBAction)cell3ButtonPressed:(id)sender {
55 |
56 | BOOL isHidden = [self isCellHidden:self.cell3];
57 | [self cell:self.cell3 setHidden:!isHidden];
58 | [self cell:self.cell4 setHidden:!isHidden];
59 |
60 | [self reloadDataAnimated:self.animationsSwitch.isOn];
61 |
62 | [self.cell3Button setTitle:isHidden?@"Hide cells 4 and 5":@"Show cells 4 and 5" forState:UIControlStateNormal];
63 |
64 | }
65 |
66 | - (IBAction)cell6ButtonPresssed:(id)sender {
67 |
68 | BOOL isHidden = [self isCellHidden:[self.section2Cells firstObject]];
69 | [self cells:self.section2Cells setHidden:!isHidden];
70 |
71 | [self reloadDataAnimated:self.animationsSwitch.isOn];
72 |
73 | [self.cell6Button setTitle:isHidden?@"Hide section 2":@"Show section 2" forState:UIControlStateNormal];
74 |
75 | }
76 |
77 | - (IBAction)insertAnimationsSegmentedControlChanged:(UISegmentedControl *)sender {
78 |
79 | self.insertTableViewRowAnimation = [self animationWithSegmentIndex:sender.selectedSegmentIndex];
80 |
81 | }
82 |
83 | - (IBAction)deleteAnimationsSegmentedControlChanged:(UISegmentedControl *)sender {
84 |
85 | self.deleteTableViewRowAnimation = [self animationWithSegmentIndex:sender.selectedSegmentIndex];
86 |
87 | }
88 |
89 | - (IBAction)reloadAnimationsSegmentedControlChanged:(UISegmentedControl *)sender {
90 |
91 | self.reloadTableViewRowAnimation = [self animationWithSegmentIndex:sender.selectedSegmentIndex];
92 |
93 | }
94 |
95 | - (IBAction)animationSwitchChanged:(UISwitch *)sender {
96 |
97 | [self cell:self.animationSettingsCells setHidden:!sender.isOn];
98 | [self reloadDataAnimated:YES];
99 |
100 | }
101 |
102 | - (IBAction)cell7ButtonPressed:(id)sender {
103 |
104 | CGFloat h = self.cell9.bounds.size.height;
105 | [self cell:self.cell9 setHeight:h + 32];
106 | [self reloadDataAnimated:self.animationsSwitch.isOn];
107 |
108 | }
109 |
110 | - (IBAction)cell8ButtonPressed:(id)sender {
111 |
112 | CGFloat h = self.cell9.bounds.size.height;
113 | [self cell:self.cell9 setHeight:MAX(0, h - 32)];
114 | [self reloadDataAnimated:self.animationsSwitch.isOn];
115 |
116 | }
117 |
118 | ////////////////////////////////////////////////////////////////////////
119 | #pragma mark - Private
120 | ////////////////////////////////////////////////////////////////////////
121 |
122 | - (UITableViewRowAnimation)animationWithSegmentIndex:(NSUInteger)index {
123 |
124 | NSArray * animations = @[
125 | @(UITableViewRowAnimationAutomatic),
126 | @(UITableViewRowAnimationFade),
127 | @(UITableViewRowAnimationRight),
128 | @(UITableViewRowAnimationLeft),
129 | @(UITableViewRowAnimationTop),
130 | @(UITableViewRowAnimationBottom),
131 | @(UITableViewRowAnimationMiddle)
132 | ];
133 |
134 | return (UITableViewRowAnimation)[animations[index] integerValue];
135 |
136 | }
137 |
138 | ////////////////////////////////////////////////////////////////////////
139 | #pragma mark - Overwrited
140 | ////////////////////////////////////////////////////////////////////////
141 |
142 | - (void)cell:(UITableViewCell *)cell setHidden:(BOOL)hidden {
143 |
144 | [super cell:cell setHidden:hidden];
145 |
146 | if (cell == self.cell1) {
147 | [self.cell2Button setTitle:hidden?@"Show cell 1":@"Hide cell 1" forState:UIControlStateNormal];
148 | }
149 |
150 | }
151 |
152 | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
153 | if (section == 2) {
154 | return self.animationsCustomHeaderView;
155 | }
156 | return [super tableView:tableView viewForHeaderInSection:section];
157 | }
158 |
159 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
160 | if (section == 2) {
161 | return self.animationsCustomHeaderView.bounds.size.height;
162 | }
163 | return [super tableView:tableView heightForHeaderInSection:section];
164 | }
165 |
166 | @end
167 |
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ios-marketing",
45 | "size" : "1024x1024",
46 | "scale" : "1x"
47 | }
48 | ],
49 | "info" : {
50 | "version" : 1,
51 | "author" : "xcode"
52 | }
53 | }
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "filename" : "Default@2x.png",
9 | "scale" : "2x"
10 | },
11 | {
12 | "extent" : "full-screen",
13 | "idiom" : "iphone",
14 | "subtype" : "retina4",
15 | "filename" : "Default-568h@2x.png",
16 | "minimum-system-version" : "7.0",
17 | "orientation" : "portrait",
18 | "scale" : "2x"
19 | }
20 | ],
21 | "info" : {
22 | "version" : 1,
23 | "author" : "xcode"
24 | }
25 | }
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterpaulis/StaticDataTableViewController/818eb911db2f4165cb9be14a16f7bd27d8a0da14/StaticTableViewControllerSample/StaticTableViewControllerSample/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample/Images.xcassets/LaunchImage.launchimage/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterpaulis/StaticDataTableViewController/818eb911db2f4165cb9be14a16f7bd27d8a0da14/StaticTableViewControllerSample/StaticTableViewControllerSample/Images.xcassets/LaunchImage.launchimage/Default@2x.png
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample/Launch Screen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample/StaticTableViewControllerSample-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIcons
12 |
13 | CFBundleIcons~ipad
14 |
15 | CFBundleIdentifier
16 | $(PRODUCT_BUNDLE_IDENTIFIER)
17 | CFBundleInfoDictionaryVersion
18 | 6.0
19 | CFBundleName
20 | ${PRODUCT_NAME}
21 | CFBundlePackageType
22 | APPL
23 | CFBundleShortVersionString
24 | 2.5
25 | CFBundleSignature
26 | ????
27 | CFBundleVersion
28 | 1.0
29 | LSRequiresIPhoneOS
30 |
31 | UILaunchStoryboardName
32 | Launch Screen
33 | UIMainStoryboardFile
34 | MainStoryboard
35 | UIRequiredDeviceCapabilities
36 |
37 | armv7
38 |
39 | UISupportedInterfaceOrientations
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationLandscapeLeft
43 | UIInterfaceOrientationLandscapeRight
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample/StaticTableViewControllerSample-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'StaticTableViewControllerSample' target in the 'StaticTableViewControllerSample' project
3 | //
4 |
5 | #import
6 |
7 | #ifndef __IPHONE_5_0
8 | #warning "This project uses features only available in iOS SDK 5.0 and later."
9 | #endif
10 |
11 | #ifdef __OBJC__
12 | #import
13 | #import
14 | #endif
15 |
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample/en.lproj/MainStoryboard.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
--------------------------------------------------------------------------------
/StaticTableViewControllerSample/StaticTableViewControllerSample/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // StaticTableViewControllerSample
4 | //
5 | // Created by Peter Paulis on 1.2.2013.
6 | // Copyright (c) 2013 Peter Paulis. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #import "AppDelegate.h"
12 |
13 | int main(int argc, char *argv[])
14 | {
15 | @autoreleasepool {
16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/demoapp.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterpaulis/StaticDataTableViewController/818eb911db2f4165cb9be14a16f7bd27d8a0da14/demoapp.jpg
--------------------------------------------------------------------------------