Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 36 additions & 16 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,41 @@
# rule identifiers to exclude from running
disabled_rules:
- line_length

# some rules are only opt-in
opt_in_rules:
# Find all the available rules by running:
# swiftlint rules

- anyobject_protocol
- closure_spacing
- contains_over_first_not_nil
- convenience_type
- empty_count
- empty_string
- empty_xctest_method
- explicit_init
- fallthrough
- fatal_error_message
- file_name
- first_where
- force_unwrapping
- implicit_return
- let_var_whitespace
- literal_expression_end_indentation
- operator_usage_whitespace
- overridden_super_call
- override_in_extension
- private_action
- private_outlet
- prohibited_super_call
- single_test_class
- sorted_imports
- toggle_bool
- unused_import
- unused_private_declaration

# paths to include during linting. `--path` is ignored if present.
included:


# paths to ignore during linting. Takes precedence over `included`.
excluded:


# configurable rules can be customized from this configuration file
# binary rules can set their severity level
force_cast: warning

identifier_name:
min_length: 2

line_length: 160

disabled_rules:
- nesting
- custom_rules
5 changes: 3 additions & 2 deletions Classes/GLCollectionTableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ class GLIndexedCollectionViewFlowLayout: UICollectionViewFlowLayout {
// if statement below. This will fix the "last cell" issue.
let discardableScrollingElementsFrame: CGFloat = collectionView.contentOffset.x + (collectionView.frame.size.width / 2)

if (cellLayoutAttribute.center.x <= discardableScrollingElementsFrame && velocity.x > 0) || (cellLayoutAttribute.center.x >= discardableScrollingElementsFrame && velocity.x < 0) {
if (cellLayoutAttribute.center.x <= discardableScrollingElementsFrame && velocity.x > 0) ||
(cellLayoutAttribute.center.x >= discardableScrollingElementsFrame && velocity.x < 0) {
return
}

Expand Down Expand Up @@ -157,7 +158,7 @@ class GLCollectionTableViewCell: UITableViewCell {
/// Default value is `nil`, since `Bool` is `Optional`.
var collectionViewPaginatedScroll: Bool?

override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)

collectionFlowLayout = GLIndexedCollectionViewFlowLayout()
Expand Down
4 changes: 2 additions & 2 deletions Classes/GLTableCollectionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ final class GLTableCollectionViewController: UITableViewController, UICollection
cell = GLCollectionTableViewCell(style: .default, reuseIdentifier: GLTableCollectionViewController.tableCellID + indexPath.section.description)

// Configure the cell...
cell!.selectionStyle = .none
cell!.collectionViewPaginatedScroll = paginationEnabled
cell?.selectionStyle = .none
cell?.collectionViewPaginatedScroll = paginationEnabled
}

return cell!
Expand Down
20 changes: 8 additions & 12 deletions GLTableCollectionView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@
isa = PBXNativeTarget;
buildConfigurationList = 747CF9161DE6EB010051A5FF /* Build configuration list for PBXNativeTarget "GLTableCollectionView" */;
buildPhases = (
EF73511D1E8E9B5800F73EDB /* SwiftLint */,
747CF8F51DE6EB010051A5FF /* Sources */,
747CF8F61DE6EB010051A5FF /* Frameworks */,
747CF8F71DE6EB010051A5FF /* Resources */,
EF73511D1E8E9B5800F73EDB /* SwiftLint */,
);
buildRules = (
);
Expand Down Expand Up @@ -157,12 +157,12 @@
TargetAttributes = {
747CF8F81DE6EB010051A5FF = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 0900;
LastSwiftMigration = 1010;
ProvisioningStyle = Manual;
};
747CF90C1DE6EB010051A5FF = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 0900;
LastSwiftMigration = 1010;
ProvisioningStyle = Manual;
TestTargetID = 747CF8F81DE6EB010051A5FF;
};
Expand Down Expand Up @@ -221,7 +221,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down Expand Up @@ -426,8 +426,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand Down Expand Up @@ -464,8 +463,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = giuliolombardo.GLTableCollectionView;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -481,8 +479,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = giuliolombardo.GLTableCollectionViewTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GLTableCollectionView.app/GLTableCollectionView";
};
name = Debug;
Expand All @@ -499,8 +496,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = giuliolombardo.GLTableCollectionViewTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GLTableCollectionView.app/GLTableCollectionView";
};
name = Release;
Expand Down
2 changes: 1 addition & 1 deletion GLTableCollectionView/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import UIKit
final class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?

func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
Expand Down
4 changes: 2 additions & 2 deletions GLTableCollectionView/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Ik1-Jh-kcr">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Ik1-Jh-kcr">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions GLTableCollectionView/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ClH-cz-IEW">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ClH-cz-IEW">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
|`master`|[![BuddyBuild](https://dashboard.buddybuild.com/api/statusImage?appID=592889ed482e8d00016f99eb&branch=master&build=latest)](https://dashboard.buddybuild.com/apps/592889ed482e8d00016f99eb/build/latest?branch=master)|
|`develop`|[![BuddyBuild](https://dashboard.buddybuild.com/api/statusImage?appID=592889ed482e8d00016f99eb&branch=develop&build=latest)](https://dashboard.buddybuild.com/apps/592889ed482e8d00016f99eb/build/latest?branch=develop)|

![Language](https://img.shields.io/badge/language-Swift%204.x-orange.svg)
![Language](https://img.shields.io/badge/language-Swift%204.2-orange.svg)
![Supported platforms](https://img.shields.io/badge/platform-iOS-lightgrey.svg)
[![codebeat badge](https://codebeat.co/badges/5a29ccd4-fda0-45d1-ae57-e7158e01449a)](https://codebeat.co/projects/github-com-giulio92-gltablecollectionview)
[![license](https://img.shields.io/github/license/giulio92/GLTableCollectionView.svg)](https://github.com/giulio92/GLTableCollectionView/blob/master/LICENSE.txt)
Expand Down Expand Up @@ -47,8 +47,8 @@ var paginationEnabled: Bool = true
</p>

## Requirements
- Xcode 9.0+
- Swift 4.0+
- Xcode 10.0+
- Swift 4.2+
- iOS 9.0+
- [SwiftLint](https://github.com/realm/SwiftLint) (Optional, but _highly_ suggested)

Expand Down