Skip to content

Commit c60a0ef

Browse files
committed
Added section footer to show number of records in section.
1 parent d399af1 commit c60a0ef

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Swift Push/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>396</string>
22+
<string>398</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
2525
<key>UIBackgroundModes</key>

Swift Push/ViewController.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ class ViewController: UIViewController, UITableViewDataSource, UITableViewDelega
7575
return nil
7676
}
7777

78+
func tableView(tableView: UITableView, titleForFooterInSection section: Int) -> String? {
79+
if let sections = fetchedResultsController!.sections {
80+
let sectionInfo = sections[section]
81+
return ("\(sectionInfo.numberOfObjects)")
82+
}
83+
return nil
84+
}
85+
7886
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
7987
if let sections = fetchedResultsController!.sections {
8088
let sectionInfo = sections[section]

0 commit comments

Comments
 (0)