Skip to content

Commit be781d4

Browse files
authored
Merge pull request #24 from BenEmdon/swift-4
Swift 4 + Release
2 parents 46a00a7 + df5ad63 commit be781d4

11 files changed

Lines changed: 102 additions & 34 deletions

File tree

.travis.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
1-
# references:
2-
# * http://www.objc.io/issue-6/travis-ci.html
3-
# * https://github.com/supermarin/xcpretty#usage
1+
language: swift
2+
xcode_project: Example/CenteredCollectionView.xcworkspace
3+
xcode_schema: CenteredCollectionView_Tests
44

5-
osx_image: xcode8.2
6-
language: objective-c
7-
# cache: cocoapods
8-
podfile: Example/Podfile
9-
before_install:
10-
- gem install cocoapods # Since Travis is not always on latest version
11-
- pod install --project-directory=Example
12-
script:
13-
- set -o pipefail && xcodebuild test -workspace Example/CenteredCollectionView.xcworkspace -scheme CenteredCollectionView-Example -sdk iphonesimulator10.2 -destination 'platform=iOS Simulator,OS=10.2,id=3F31386B-6108-4E3F-BCF7-2A3B0C16AAFE' ONLY_ACTIVE_ARCH=NO | xcpretty
14-
- pod lib lint
5+
env:
6+
- PLATFORM=iOS NAME='iPhone SE'

CenteredCollectionView.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
#
1717

1818
s.name = 'CenteredCollectionView'
19-
s.version = '1.0'
19+
s.version = '1.1'
2020
s.summary = 'A `CollectionViewFlowLayout` that \'pages\' and centers it\'s cells 🎡 written in Swift'
2121

2222
# This description is used to generate tags and improve search results.
@@ -26,7 +26,7 @@ Pod::Spec.new do |s|
2626
# * Finally, don't worry about the indent, CocoaPods strips it!
2727
s.description = <<-DESC
2828
`CenteredCollectionView` is a lightweight drop in place `UICollectionViewFlowLayout` that pages and keeps its cells centered, resulting in the "carousel effect" 🎡
29-
DESC
29+
DESC
3030

3131
s.homepage = 'https://github.com/BenEmdon/CenteredCollectionView'
3232
# s.screenshots = 'www.example.com/screenshots_1.gif', 'www.example.com/screenshots_2.gif'

Example/CenteredCollectionView.xcodeproj/project.pbxproj

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,16 +229,17 @@
229229
isa = PBXProject;
230230
attributes = {
231231
LastSwiftUpdateCheck = 0720;
232-
LastUpgradeCheck = 0820;
232+
LastUpgradeCheck = 0920;
233233
ORGANIZATIONNAME = CocoaPods;
234234
TargetAttributes = {
235235
607FACCF1AFB9204008FA782 = {
236236
CreatedOnToolsVersion = 6.3.1;
237-
LastSwiftMigration = 0820;
237+
LastSwiftMigration = 0920;
238+
ProvisioningStyle = Automatic;
238239
};
239240
607FACE41AFB9204008FA782 = {
240241
CreatedOnToolsVersion = 6.3.1;
241-
LastSwiftMigration = 0820;
242+
LastSwiftMigration = 0920;
242243
TestTargetID = 607FACCF1AFB9204008FA782;
243244
};
244245
};
@@ -453,14 +454,20 @@
453454
CLANG_CXX_LIBRARY = "libc++";
454455
CLANG_ENABLE_MODULES = YES;
455456
CLANG_ENABLE_OBJC_ARC = YES;
457+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
456458
CLANG_WARN_BOOL_CONVERSION = YES;
459+
CLANG_WARN_COMMA = YES;
457460
CLANG_WARN_CONSTANT_CONVERSION = YES;
458461
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
459462
CLANG_WARN_EMPTY_BODY = YES;
460463
CLANG_WARN_ENUM_CONVERSION = YES;
461464
CLANG_WARN_INFINITE_RECURSION = YES;
462465
CLANG_WARN_INT_CONVERSION = YES;
466+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
467+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
463468
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
469+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
470+
CLANG_WARN_STRICT_PROTOTYPES = YES;
464471
CLANG_WARN_SUSPICIOUS_MOVE = YES;
465472
CLANG_WARN_UNREACHABLE_CODE = YES;
466473
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -501,14 +508,20 @@
501508
CLANG_CXX_LIBRARY = "libc++";
502509
CLANG_ENABLE_MODULES = YES;
503510
CLANG_ENABLE_OBJC_ARC = YES;
511+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
504512
CLANG_WARN_BOOL_CONVERSION = YES;
513+
CLANG_WARN_COMMA = YES;
505514
CLANG_WARN_CONSTANT_CONVERSION = YES;
506515
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
507516
CLANG_WARN_EMPTY_BODY = YES;
508517
CLANG_WARN_ENUM_CONVERSION = YES;
509518
CLANG_WARN_INFINITE_RECURSION = YES;
510519
CLANG_WARN_INT_CONVERSION = YES;
520+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
521+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
511522
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
523+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
524+
CLANG_WARN_STRICT_PROTOTYPES = YES;
512525
CLANG_WARN_SUSPICIOUS_MOVE = YES;
513526
CLANG_WARN_UNREACHABLE_CODE = YES;
514527
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -540,14 +553,18 @@
540553
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
541554
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
542555
CLANG_ENABLE_MODULES = YES;
556+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
557+
CODE_SIGN_STYLE = Automatic;
543558
DEVELOPMENT_TEAM = "";
544559
INFOPLIST_FILE = CenteredCollectionView/Info.plist;
545560
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
546561
MODULE_NAME = ExampleApp;
547562
PRODUCT_BUNDLE_IDENTIFIER = "io.github.benemdon.CenteredCollectionView-Example";
548563
PRODUCT_NAME = "$(TARGET_NAME)";
564+
PROVISIONING_PROFILE_SPECIFIER = "";
549565
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
550-
SWIFT_VERSION = 3.0;
566+
SWIFT_SWIFT3_OBJC_INFERENCE = On;
567+
SWIFT_VERSION = 4.0;
551568
};
552569
name = Debug;
553570
};
@@ -558,13 +575,17 @@
558575
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
559576
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
560577
CLANG_ENABLE_MODULES = YES;
578+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
579+
CODE_SIGN_STYLE = Automatic;
561580
DEVELOPMENT_TEAM = "";
562581
INFOPLIST_FILE = CenteredCollectionView/Info.plist;
563582
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
564583
MODULE_NAME = ExampleApp;
565584
PRODUCT_BUNDLE_IDENTIFIER = "io.github.benemdon.CenteredCollectionView-Example";
566585
PRODUCT_NAME = "$(TARGET_NAME)";
567-
SWIFT_VERSION = 3.0;
586+
PROVISIONING_PROFILE_SPECIFIER = "";
587+
SWIFT_SWIFT3_OBJC_INFERENCE = On;
588+
SWIFT_VERSION = 4.0;
568589
};
569590
name = Release;
570591
};
@@ -583,7 +604,8 @@
583604
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
584605
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
585606
PRODUCT_NAME = "$(TARGET_NAME)";
586-
SWIFT_VERSION = 3.0;
607+
SWIFT_SWIFT3_OBJC_INFERENCE = On;
608+
SWIFT_VERSION = 4.0;
587609
};
588610
name = Debug;
589611
};
@@ -598,7 +620,8 @@
598620
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
599621
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
600622
PRODUCT_NAME = "$(TARGET_NAME)";
601-
SWIFT_VERSION = 3.0;
623+
SWIFT_SWIFT3_OBJC_INFERENCE = On;
624+
SWIFT_VERSION = 4.0;
602625
};
603626
name = Release;
604627
};

Example/CenteredCollectionView.xcodeproj/xcshareddata/xcschemes/CenteredCollectionView-Example.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0820"
3+
LastUpgradeVersion = "0920"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -40,6 +40,7 @@
4040
buildConfiguration = "Debug"
4141
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4242
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43+
language = ""
4344
shouldUseLaunchSchemeArgsEnv = "YES">
4445
<Testables>
4546
<TestableReference
@@ -69,6 +70,7 @@
6970
buildConfiguration = "Debug"
7071
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
7172
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
73+
language = ""
7274
launchStyle = "0"
7375
useCustomWorkingDirectory = "NO"
7476
ignoresPersistentStateOnLaunch = "NO"

Example/CenteredCollectionView/ControlCenterView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ class ControlCenterView: UIView {
6969

7070
// MARK: - Actions
7171

72-
func controlStateDidChange(sender: UISegmentedControl) {
72+
@objc func controlStateDidChange(sender: UISegmentedControl) {
7373
guard let scrollDirection = UICollectionViewScrollDirection(rawValue: sender.selectedSegmentIndex) else { return }
7474
delegate?.stateChanged(scrollDirection: scrollDirection)
7575
}
7676

77-
func switchStateDidChange(sender: UISwitch) {
77+
@objc func switchStateDidChange(sender: UISwitch) {
7878
delegate?.stateChanged(scrollToEdgeEnabled: sender.isOn)
7979
}
8080

Example/CenteredCollectionView/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<dict>
55
<key>CFBundleDevelopmentRegion</key>
66
<string>en</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>CenteredCollectionView</string>
79
<key>CFBundleExecutable</key>
810
<string>$(EXECUTABLE_NAME)</string>
911
<key>CFBundleIdentifier</key>

Example/CenteredCollectionView/UIColor+Extensions.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import UIKit
1010

1111
extension UIColor {
1212
static var peach: UIColor {
13-
return UIColor(colorLiteralRed: 1, green: 0.5764705882, blue: 0.5843137255, alpha: 1)
13+
return UIColor(red: 1, green: 0.5764705882, blue: 0.5843137255, alpha: 1)
1414
}
1515

1616
static var orange: UIColor {
17-
return UIColor(colorLiteralRed: 1, green: 0.5764705882, blue: 0.462745098, alpha: 1)
17+
return UIColor(red: 1, green: 0.5764705882, blue: 0.462745098, alpha: 1)
1818
}
1919
}

Example/Pods/Pods.xcodeproj/project.pbxproj

Lines changed: 31 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/CenteredCollectionView.xcscheme

Lines changed: 22 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Target Support Files/CenteredCollectionView/Info.plist

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)