Skip to content

Commit 80e5624

Browse files
committed
Merge branch 'release/v1.1'
2 parents 131d503 + 4d6188f commit 80e5624

File tree

130 files changed

+4254
-5196
lines changed

Some content is hidden

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

130 files changed

+4254
-5196
lines changed

.travis.yml

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
language: objective-c
22
xcode_project: ThunderTable.xcodeproj # path to your xcodeproj folder
33
xcode_scheme: ThunderTable
4-
osx_image: xcode7.2
4+
osx_image: xcode9.2
55
env:
66
global:
77
- LC_CTYPE=en_US.UTF-8
88
- LANG=en_US.UTF-8
99
- IOS_FRAMEWORK_SCHEME="ThunderTable"
1010
- TVOS_FRAMEWORK_SCHEME=""
1111
- OSX_FRAMEWORK_SCHEME=""
12-
- IOS_SDK=iphonesimulator9.2
13-
- TVOS_SDK=appletvsimulator9.1
14-
- OSX_SDK=macosx10.11
12+
- IOS_SDK=iphonesimulator11.2
13+
- TVOS_SDK=appletvsimulator11.2
14+
- OSX_SDK=macosx10.13
1515
matrix:
16-
- DESTINATION="OS=8.1,name=iPhone 5" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
17-
- DESTINATION="OS=8.2,name=iPhone 5S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
18-
- DESTINATION="OS=8.3,name=iPhone 6" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
19-
- DESTINATION="OS=8.4,name=iPhone 6 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
20-
- DESTINATION="OS=9.0,name=iPhone 6S Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
21-
- DESTINATION="OS=9.1,name=iPhone 6S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
22-
- DESTINATION="OS=9.2,name=iPhone 6S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
23-
- DESTINATION="OS=9.2,name=iPhone 6S Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
16+
- DESTINATION="OS=10.0,name=iPhone 5" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
17+
- DESTINATION="OS=10.1,name=iPhone 5S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
18+
- DESTINATION="OS=10.3.1,name=iPhone 7" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
19+
- DESTINATION="OS=10.3.1,name=iPhone 7 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
20+
- DESTINATION="OS=11.0.1,name=iPhone 7 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
21+
- DESTINATION="OS=11.1,name=iPhone 7" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
22+
- DESTINATION="OS=11.2,name=iPhone 7" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
23+
- DESTINATION="OS=11.1,name=iPhone 7 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
24+
- DESTINATION="OS=11.2,name=iPhone 7 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
2425
script:
2526
- set -o pipefail
2627
- xcodebuild -version
@@ -33,19 +34,12 @@ script:
3334
xcodebuild -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c;
3435
fi
3536

36-
# Build Framework in Release and Run Tests if specified
37-
- if [ $RUN_TESTS == "YES" ]; then
38-
xcodebuild -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO test | xcpretty -c;
39-
else
40-
xcodebuild -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty -c;
41-
fi
42-
4337
# Build Example in Debug if specified
4438
- if [ $BUILD_EXAMPLE == "YES" ]; then
4539
xcodebuild -scheme "$EXAMPLE_SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c;
4640
fi
4741

4842
# Build Example in Release if specified
49-
- if [ $BUILD_EXAMPLE == "YES" ]; then
50-
xcodebuild -scheme "$EXAMPLE_SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty -c;
51-
fi
43+
- if [ $BUILD_EXAMPLE == "YES" ]; then
44+
xcodebuild -scheme "$EXAMPLE_SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty -c;
45+
fi

README.md

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,55 +10,44 @@ Thunder table comprises of two main types of objects:
1010

1111
### Rows
1212

13-
Table rows are objects that conform to the `TSCTableRowDataSource` protocol, this protocol has properties such as: title, subtitle and image which are responsible for providing the content to a table view cell. As this is a protocol any object can conform to it, which allows you to simply send an array of model objects to the table view to display your content.
13+
Table rows are objects that conform to the `Row` protocol, this protocol has properties such as: title, subtitle and image which are responsible for providing the content to a table view cell. As this is a protocol any object can conform to it, which allows you to simply send an array of model objects to the table view to display your content.
1414

1515
### Sections
1616

17-
Table sections are objects that conform to the `TSCTableSectionDataSource` protocol, most of the time you won't need to implement this protocol yourself as Thunder Table has a convenience class TSCTableSection which can be used in most circumstances. However you can implement more complex layouts using this protocol on your own classes.
18-
19-
## Dynamic Cell Heights
20-
21-
Yes. You heard it here first. Thunder Table has an automatic cell height calculation system, so there's no need for constraints auto layout or calculating the height of your text manually.
22-
23-
Cell height is calculated automatically, but if you do wisth to override it you can do so using methods in the `TSCTableSectionDataSource` protocol.
17+
Table sections are objects that conform to the `Section` protocol, most of the time you won't need to implement this protocol yourself as Thunder Table has a convenience class `TableSection` which can be used in most circumstances. However you can implement more complex layouts using this protocol on your own classes.
2418

2519
# Installation
2620

27-
Setting up your app to use Thunder Table is a simple and quick process. For now Thunder Table is built as a static framework, meaning you will need to include the whole Xcode project in your workspace.
21+
Setting up your app to use Thunder Table is a simple.
2822

29-
+ Drag all included files and folders to a location within your existing project.
23+
+ Drag ThunderTable.xcodeproj
3024
+ Add ThunderTable.framework to your Embedded Binaries.
31-
+ Wherever you want to use ThunderTable use `@import ThunderTable` or `import ThunderTable` if you're using swift.
25+
+ Wherever you want to use ThunderTable use `import ThunderTable`
3226

3327
# Code Example
3428
## A Simple Table View Controller
3529

36-
Setting up a table view is massively simplified using thunder table, in fact, we can get a simple table view running with just a few lines of code. To create a custom table view we subclass from TSCTableViewController, in the initalizer we determine which tableView style we want by calling the correct `[super init]` method like so:
37-
38-
- (id)init
39-
{
40-
if (self = [super initWithStyle:UITableViewStyleGrouped]) {
41-
42-
// Handle any custom initialisation here.
43-
}
44-
return self;
45-
}
30+
Setting up a table view is massively simplified using thunder table, in fact, we can get a simple table view running with just a few lines of code. To create a custom table view we subclass from `TableViewController`. We then set up our table in the `viewDidLoad:` method. Below is the full code for a table view that displays one row, with text, a subtitle, image and handles table selection by pushing another view.
4631

47-
We then set up our table in the `viewDidLoad:` method. First we initialise the rows which we want to appear in our table view:
32+
```
33+
import ThunderTable
4834
49-
TSCTableImageRow *userImageRow = [TSCTableImageRow rowWithImage:[UIImage imageNamed:@"Avatar.png"]];
50-
TSCTableRow *nameRow = [TSCTableRow rowWithTitle:@"Name" subtitle:@"Simon" image:[UIImage imageNamed:@"Avatar_Thumb.png"]];
51-
TCSTableRow *addressRow = [TSCTableRow rowWithTitle:@"Address" subtitle:@"42 Some Road" image:nil];
52-
TSCTableRow *editRow = [TSCTableRow rowWithTitle:@"Edit"];
53-
[editRow addTarget:self selector:@selector(handleEdit:)];
35+
class MyTableViewController: TableViewController {
5436
55-
We then group our rows into the sections we want to display in our table view:
56-
57-
TSCTableSection *userSection = [TSCTableSection sectionWithTitle:@"User" footer:nil items@[userImageRow, nameRow, addressRow, editRow]];
58-
59-
And then finally we set our tableView's datasource like so:
60-
61-
self.dataSource = @[userSection];
37+
override func viewDidLoad() {
38+
super.viewDidLoad()
39+
40+
let imageRow = TableRow(title: "Settings", subtitle: "Configure your settings", image: UIImage(named: "settings-cog")) { (row, selected, indexPath, tableView) -> (Void) in
41+
42+
let settings = SettingsViewController()
43+
self.showDetailViewController(settings, sender: self)
44+
}
45+
46+
let section = TableSection(rows: [imageRow])
47+
data = [section]
48+
}
49+
}
50+
```
6251

6352
#Code level documentation
6453
Documentation is available for the entire library in AppleDoc format. This is available in the framework itself or in the [Hosted Version](http://3sidedcube.github.io/iOS-ThunderTable/)

0 commit comments

Comments
 (0)