Skip to content

Commit 89894d0

Browse files
committed
Merge branch 'release/1.2.2'
2 parents 70ec82d + 23d95ae commit 89894d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2774
-2446
lines changed

.codecov.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
coverage:
22
status:
33
patch: off
4+
project:
5+
default:
6+
target: 90%
47
comment:
58
layout: "diff, files"
69
ignore:

.github/workflows/run_tests.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Tests
2+
on: [push, pull_request]
3+
4+
jobs:
5+
run-tests:
6+
name: Run tests
7+
runs-on: macOS-latest
8+
steps:
9+
- uses: actions/checkout@master
10+
- uses: actions/setup-ruby@v1
11+
with:
12+
ruby-version: '2.6.x'
13+
- uses: actions/cache@v1
14+
with:
15+
path: vendor/bundle
16+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
17+
restore-keys: ${{ runner.os }}-gems-
18+
- uses: actions/cache@v1
19+
with:
20+
path: Pods
21+
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
22+
restore-keys: ${{ runner.os }}-pods-
23+
- name: Bundle install
24+
run: |
25+
gem install bundler:2.1.4
26+
bundle config path vendor/bundle
27+
bundle install --jobs 4 --retry 3
28+
- name: Pod install
29+
run: |
30+
bundle exec pod install
31+
- run: |
32+
bundle exec fastlane ios unit_tests
33+
- run: |
34+
bundle exec fastlane tvos unit_tests
35+
- name: Report coverage
36+
run: |
37+
bash <(curl -s https://codecov.io/bash) -cF ios -J "QuickTableViewController"
38+
- run: |
39+
bundle exec fastlane ios ui_tests
40+
- run: |
41+
bundle exec fastlane tvos ui_tests

.jazzy.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ clean: true
22
author: bcylin
33
author_url: https://github.com/bcylin
44
github_url: https://github.com/bcylin/QuickTableViewController
5-
github_file_prefix: https://github.com/bcylin/QuickTableViewController/blob/v1.2.1
6-
xcodebuild_arguments: [-project, QuickTableViewController.xcodeproj, -scheme, QuickTableViewController-iOS]
5+
github_file_prefix: https://github.com/bcylin/QuickTableViewController/blob/v1.2.2
6+
xcodebuild_arguments: [
7+
-project, QuickTableViewController.xcodeproj,
8+
-scheme, QuickTableViewController-iOS,
9+
-sdk, iphonesimulator
10+
]
711
module: QuickTableViewController
8-
module_version: 1.2.1
12+
module_version: 1.2.2
913
output: docs/output
1014
theme: fullwidth
1115
skip_undocumented: true

.swiftlint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ disabled_rules:
33
- force_cast
44
- function_body_length
55
- identifier_name
6+
- implicit_return
67
- line_length
78
- vertical_whitespace
89
opt_in_rules:
@@ -14,7 +15,6 @@ opt_in_rules:
1415
- explicit_top_level_acl
1516
- fatal_error_message
1617
- first_where
17-
- implicit_return
1818
- implicitly_unwrapped_optional
1919
- let_var_whitespace
2020
- multiline_parameters

.travis.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
language: objective-c
2-
osx_image: xcode11.1
2+
osx_image: xcode11.3
33
cache:
44
- bundler
5-
- cocoapods
65
before_install:
76
- export LANG=en_US.UTF-8
87
- xcrun instruments -s devices
98
install:
109
- bundle install --without development --deployment --jobs=3 --retry=3
11-
- bundle exec rake launch:simulators
12-
- bundle exec pod install
13-
before_script:
14-
- if [ -n "$DANGER_GITHUB_API_TOKEN" ]; then bundle exec danger; fi
1510
script:
1611
- set -e
17-
- bundle exec rake "test:ios[QuickTableViewController-iOS]"
18-
- bash <(curl -s https://codecov.io/bash) -cF ios -J "QuickTableViewController"
19-
- bundle exec rake "test:ios[Example-iOS]"
2012
- make -B carthage
2113
- make -B docs
2214
after_success:

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Change Log
22

3+
## v1.2.2
4+
5+
#### Fixes
6+
7+
* Fix `SwitchRow` subtitles, [#45](https://github.com/bcylin/QuickTableViewController/pull/45) by [@dnicolson](https://github.com/dnicolson)
8+
9+
#### Project Updates
10+
11+
* Add an example of dynamic table, [#42](https://github.com/bcylin/QuickTableViewController/pull/42) by [@twodayslate](https://github.com/twodayslate)
12+
* Convert specs to XCTests
13+
* Move tests to GitHub Actions
14+
315
## v1.2.1
416

517
* Support Swift Package

Dangerfile

Lines changed: 0 additions & 24 deletions
This file was deleted.

Example-iOS/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.2.1</string>
20+
<string>1.2.2</string>
2121
<key>CFBundleVersion</key>
2222
<string>101</string>
2323
<key>LSRequiresIPhoneOS</key>
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
//
2+
// DynamicTableView.swift
3+
// Example-iOS
4+
//
5+
// Created by Zac on 14/02/2020.
6+
//
7+
// Permission is hereby granted, free of charge, to any person obtaining a copy
8+
// of this software and associated documentation files (the "Software"), to deal
9+
// in the Software without restriction, including without limitation the rights
10+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
// copies of the Software, and to permit persons to whom the Software is
12+
// furnished to do so, subject to the following conditions:
13+
//
14+
// The above copyright notice and this permission notice shall be included in all
15+
// copies or substantial portions of the Software.
16+
//
17+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
// SOFTWARE.
24+
//
25+
26+
import Foundation
27+
import UIKit
28+
29+
internal protocol QuickTableViewDelegate: class {
30+
func quickReload()
31+
}
32+
33+
open class QuickTableView: UITableView {
34+
internal weak var quickDelegate: QuickTableViewDelegate?
35+
36+
override open func reloadData() {
37+
self.quickDelegate?.quickReload()
38+
super.reloadData()
39+
}
40+
41+
// MARK: Rows
42+
43+
override open func reloadRows(at indexPaths: [IndexPath], with animation: UITableView.RowAnimation) {
44+
self.quickDelegate?.quickReload()
45+
super.reloadRows(at: indexPaths, with: animation)
46+
}
47+
48+
override open func insertRows(at indexPaths: [IndexPath], with animation: UITableView.RowAnimation) {
49+
self.quickDelegate?.quickReload()
50+
super.insertRows(at: indexPaths, with: animation)
51+
}
52+
53+
override open func deleteRows(at indexPaths: [IndexPath], with animation: UITableView.RowAnimation) {
54+
self.quickDelegate?.quickReload()
55+
super.deleteRows(at: indexPaths, with: animation)
56+
}
57+
58+
override open func moveRow(at indexPath: IndexPath, to newIndexPath: IndexPath) {
59+
self.quickDelegate?.quickReload()
60+
super.moveRow(at: indexPath, to: newIndexPath)
61+
}
62+
63+
// MARK: Sections
64+
65+
override open func reloadSections(_ sections: IndexSet, with animation: UITableView.RowAnimation) {
66+
self.quickDelegate?.quickReload()
67+
super.reloadSections(sections, with: animation)
68+
}
69+
70+
override open func deleteSections(_ sections: IndexSet, with animation: UITableView.RowAnimation) {
71+
self.quickDelegate?.quickReload()
72+
super.deleteSections(sections, with: animation)
73+
}
74+
75+
override open func insertSections(_ sections: IndexSet, with animation: UITableView.RowAnimation) {
76+
self.quickDelegate?.quickReload()
77+
super.insertSections(sections, with: animation)
78+
}
79+
80+
override open func reloadSectionIndexTitles() {
81+
self.quickDelegate?.quickReload()
82+
super.reloadSectionIndexTitles()
83+
}
84+
85+
override open func moveSection(_ section: Int, toSection newSection: Int) {
86+
self.quickDelegate?.quickReload()
87+
super.moveSection(section, toSection: newSection)
88+
}
89+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
//
2+
// DynamicTableViewController.swift
3+
// Example-iOS
4+
//
5+
// Created by Zac on 30/01/2018.
6+
//
7+
// Permission is hereby granted, free of charge, to any person obtaining a copy
8+
// of this software and associated documentation files (the "Software"), to deal
9+
// in the Software without restriction, including without limitation the rights
10+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
// copies of the Software, and to permit persons to whom the Software is
12+
// furnished to do so, subject to the following conditions:
13+
//
14+
// The above copyright notice and this permission notice shall be included in all
15+
// copies or substantial portions of the Software.
16+
//
17+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
// SOFTWARE.
24+
//
25+
26+
import UIKit
27+
import QuickTableViewController
28+
29+
internal final class DynamicViewController: QuickTableViewController {
30+
31+
var dynamicRows: [Row & RowStyle] = []
32+
33+
private var cachedTableContents: [Section] = []
34+
35+
override var tableContents: [Section] {
36+
get {
37+
return cachedTableContents
38+
}
39+
set {} // swiftlint:disable:this unused_setter_value
40+
}
41+
42+
private let quickTableView = QuickTableView(frame: .zero, style: .grouped)
43+
44+
override var tableView: UITableView {
45+
get {
46+
return quickTableView
47+
}
48+
set {} // swiftlint:disable:this unused_setter_value
49+
}
50+
51+
private func buildContents() -> [Section] {
52+
let rows: [Row & RowStyle] = [
53+
TapActionRow(text: "AddCell", action: { [unowned self] _ in
54+
self.dynamicRows.append(
55+
NavigationRow(text: "UITableViewCell", detailText: .value1(String(describing: (self.dynamicRows.count + 1))), action: nil)
56+
)
57+
self.tableView.insertRows(at: [IndexPath(row: self.dynamicRows.count, section: 0)], with: .automatic)
58+
})
59+
] + dynamicRows
60+
61+
return [
62+
Section(title: "Tap Action", rows: rows)
63+
]
64+
}
65+
66+
override func viewDidLoad() {
67+
super.viewDidLoad()
68+
title = "Dynamic"
69+
cachedTableContents = buildContents()
70+
quickTableView.quickDelegate = self
71+
}
72+
73+
}
74+
75+
extension DynamicViewController: QuickTableViewDelegate {
76+
func quickReload() {
77+
cachedTableContents = buildContents()
78+
}
79+
}

0 commit comments

Comments
 (0)