Skip to content

Commit c057e7c

Browse files
committed
update to swift 4.2
1 parent f9cadde commit c057e7c

18 files changed

+125
-101
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0
1+
4.2

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
language: objective-c
22
os: osx
3-
osx_image: xcode8.3
3+
osx_image: xcode10
44

55
script:
66
- set -o pipefail
7-
- xcodebuild clean test -workspace SFFocusViewLayout.xcworkspace -scheme SFFocusViewLayout -destination "platform=iOS Simulator,name=iPhone 7" -enableCodeCoverage YES | xcpretty
7+
- xcodebuild -workspace SFFocusViewLayout.xcworkspace -scheme SFFocusViewLayout -configuration Test -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 7' -enableCodeCoverage YES clean build-for-testing test-without-building | xcpretty
88
- pod lib lint --quick
99

1010
after_success:

CHANGELOG

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
# CHANGELOG
22

3+
## 3.2.0
4+
- Swift 4.2 version.
5+
36
## 3.1.0
4-
Swift 3.0 version.
7+
- Swift 3.0 version.
58

69
## 3.0.0
7-
Swift 2.1 version.
10+
- Swift 2.1 version.
811

912
## 2.0.0
10-
Carthage support.
11-
Swift compatible.
13+
- Carthage support.
14+
- Swift compatible.
1215

1316
## 1.1.0
14-
Added Xcode 6.4 support.
17+
- Added Xcode 6.4 support.
1518

1619
## 1.0.1
17-
18-
Change pod structure.
20+
- Change pod structure.
1921

2022
## 1.0.0
21-
22-
Initial release.
23+
- Initial release.

Configuration/Common.xcconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,20 @@ CLANG_ENABLE_MODULES = YES
2727
// Enable ARC
2828
CLANG_ENABLE_OBJC_ARC = YES
2929

30+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES
31+
3032
// Warn about implicit conversions to boolean values that are suspicious.
3133
// For example, writing 'if (foo)' with 'foo' being the name a function will trigger a warning.
3234
CLANG_WARN_BOOL_CONVERSION = YES
3335

36+
CLANG_WARN_COMMA = YES
37+
3438
// Warn about implicit conversions of constant values that cause the constant value to change,
3539
// either through a loss of precision, or entirely in its meaning.
3640
CLANG_WARN_CONSTANT_CONVERSION = YES
3741

42+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES
43+
3844
// Whether to warn when overriding deprecated methods
3945
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES
4046

@@ -58,9 +64,16 @@ CLANG_WARN_IMPLICIT_SIGN_CONVERSION = NO
5864
// For example, this can catch issues when one incorrectly intermixes using NSNumbers and raw integers.
5965
CLANG_WARN_INT_CONVERSION = YES
6066

67+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES
68+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
69+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES
70+
6171
// Warn about implicit capture of self (e.g. direct ivar access)
6272
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
6373

74+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES
75+
CLANG_WARN_STRICT_PROTOTYPES = YES
76+
6477
// Don't warn about repeatedly using a weak reference without assigning the weak reference to a strong reference. Too many false positives.
6578
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = NO
6679

Configuration/Environments/Debug.xcconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG
4444
// final installation location
4545
STRIP_INSTALLED_PRODUCT = NO
4646

47+
SWIFT_COMPILATION_MODE = singlefile
48+
4749
// The optimization level (-Onone, -O, -Ofast) for the produced Swift binary
4850
SWIFT_OPTIMIZATION_LEVEL = -Onone
4951

@@ -52,3 +54,5 @@ OTHER_CODE_SIGN_FLAGS = --timestamp=none
5254

5355
// Allow @testable imports
5456
ENABLE_TESTABILITY = YES
57+
58+
DEBUG_INFORMATION_FORMAT = dwarf

Configuration/Framework.xcconfig

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,15 @@ SKIP_INSTALL = YES
3737
APPLICATION_EXTENSION_API_ONLY = NO
3838

3939
// Configuration swift version
40-
SWIFT_VERSION = 3.0
40+
SWIFT_VERSION = 4.2
41+
42+
SWIFT_COMPILATION_MODE = wholemodule
4143

4244
// Always embed Swift std libs
4345
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
4446

47+
SDKROOT = iphoneos
48+
4549
// Universal framework
4650
SUPPORTED_PLATFORMS = iphonesimulator iphoneos appletvos appletvsimulator
4751
VALID_ARCHS[sdk=iphoneos*] = arm64 armv7 armv7s
@@ -70,3 +74,7 @@ ENABLE_BITCODE[sdk=appletv*] = YES
7074

7175
// iOS-specific deployment target
7276
IPHONEOS_DEPLOYMENT_TARGET = 8.0
77+
78+
// Product Configuration
79+
PRODUCT_BUNDLE_IDENTIFIER = com.fdzsergio.SFFocusViewLayout
80+
PRODUCT_NAME = SFFocusViewLayout

Example/Example.xcodeproj/project.pbxproj

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@
226226
isa = PBXProject;
227227
attributes = {
228228
LastSwiftUpdateCheck = 0720;
229-
LastUpgradeCheck = 0810;
229+
LastUpgradeCheck = 1000;
230230
ORGANIZATIONNAME = fdzsergio;
231231
TargetAttributes = {
232232
E766BCA81C5BEFE20036C384 = {
@@ -329,14 +329,22 @@
329329
CLANG_CXX_LIBRARY = "libc++";
330330
CLANG_ENABLE_MODULES = YES;
331331
CLANG_ENABLE_OBJC_ARC = YES;
332+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
332333
CLANG_WARN_BOOL_CONVERSION = YES;
334+
CLANG_WARN_COMMA = YES;
333335
CLANG_WARN_CONSTANT_CONVERSION = YES;
336+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
334337
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
335338
CLANG_WARN_EMPTY_BODY = YES;
336339
CLANG_WARN_ENUM_CONVERSION = YES;
337340
CLANG_WARN_INFINITE_RECURSION = YES;
338341
CLANG_WARN_INT_CONVERSION = YES;
342+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
343+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
344+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
339345
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
346+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
347+
CLANG_WARN_STRICT_PROTOTYPES = YES;
340348
CLANG_WARN_SUSPICIOUS_MOVE = YES;
341349
CLANG_WARN_UNREACHABLE_CODE = YES;
342350
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -363,7 +371,7 @@
363371
ONLY_ACTIVE_ARCH = YES;
364372
SDKROOT = iphoneos;
365373
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
366-
SWIFT_VERSION = 3.0.1;
374+
SWIFT_VERSION = 4.2;
367375
TARGETED_DEVICE_FAMILY = "1,2";
368376
};
369377
name = Debug;
@@ -376,14 +384,22 @@
376384
CLANG_CXX_LIBRARY = "libc++";
377385
CLANG_ENABLE_MODULES = YES;
378386
CLANG_ENABLE_OBJC_ARC = YES;
387+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
379388
CLANG_WARN_BOOL_CONVERSION = YES;
389+
CLANG_WARN_COMMA = YES;
380390
CLANG_WARN_CONSTANT_CONVERSION = YES;
391+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
381392
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
382393
CLANG_WARN_EMPTY_BODY = YES;
383394
CLANG_WARN_ENUM_CONVERSION = YES;
384395
CLANG_WARN_INFINITE_RECURSION = YES;
385396
CLANG_WARN_INT_CONVERSION = YES;
397+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
398+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
399+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
386400
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
401+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
402+
CLANG_WARN_STRICT_PROTOTYPES = YES;
387403
CLANG_WARN_SUSPICIOUS_MOVE = YES;
388404
CLANG_WARN_UNREACHABLE_CODE = YES;
389405
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -403,7 +419,7 @@
403419
MTL_ENABLE_DEBUG_INFO = NO;
404420
SDKROOT = iphoneos;
405421
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
406-
SWIFT_VERSION = 3.0.1;
422+
SWIFT_VERSION = 4.2;
407423
TARGETED_DEVICE_FAMILY = "1,2";
408424
VALIDATE_PRODUCT = YES;
409425
};

Example/Example/AppDelegate.swift

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,13 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
1313

1414
var window: UIWindow?
1515

16-
17-
func application(_ application: UIApplication, didFinishLaunchingWithOptions
18-
launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
16+
func application(_ application: UIApplication,
17+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1918
window = UIWindow(frame: UIScreen.main.bounds)
2019
window?.rootViewController = ViewController()
2120
window?.makeKeyAndVisible()
2221

2322
return true
2423
}
2524

26-
func applicationWillResignActive(_ application: UIApplication) {
27-
28-
}
29-
30-
func applicationDidEnterBackground(_ application: UIApplication) {
31-
32-
}
33-
34-
func applicationWillEnterForeground(_ application: UIApplication) {
35-
36-
}
37-
38-
func applicationDidBecomeActive(_ application: UIApplication) {
39-
40-
}
41-
42-
func applicationWillTerminate(_ application: UIApplication) {
43-
44-
}
45-
46-
4725
}

Example/Example/CollectionViewCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ private extension CollectionViewCell {
6868
}
6969
}
7070

71-
extension CollectionViewCell : NibLoadableView { }
71+
extension CollectionViewCell: NibLoadableView {}

Example/Example/Repository.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct Repository: DataSource {
1414
}
1515

1616
private extension Repository {
17-
17+
1818
static var resources: [Resource] {
1919
guard
2020
let fileURL = Bundle.main
@@ -23,8 +23,8 @@ private extension Repository {
2323
else {
2424
fatalError("resource file not found")
2525
}
26-
27-
return resources.flatMap(Parser.map)
26+
27+
return resources.compactMap(Parser.map)
2828
}
2929

3030
private struct Constant {

Example/Example/ReusableView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ extension UICollectionViewCell: ReusableView { }
3434

3535
extension UICollectionView {
3636

37-
func register<T: UICollectionViewCell>(_: T.Type) where T: ReusableView {
37+
func register<T: UICollectionViewCell>(_: T.Type) {
3838
self.register(T.self, forCellWithReuseIdentifier: T.defaultReuseIdentifier)
3939
}
4040

41-
func register<T: UICollectionViewCell>(_: T.Type) where T: ReusableView, T: NibLoadableView {
41+
func register<T: UICollectionViewCell>(_: T.Type) where T: NibLoadableView {
4242
let bundle = Bundle(for: T.self)
4343
let nib = UINib(nibName: T.nibName, bundle: bundle)
4444

4545
self.register(nib, forCellWithReuseIdentifier: T.defaultReuseIdentifier)
4646
}
4747

48-
func dequeueReusableCell<T: UICollectionViewCell>(forIndexPath indexPath: IndexPath) -> T where T: ReusableView {
48+
func dequeueReusableCell<T: UICollectionViewCell>(forIndexPath indexPath: IndexPath) -> T {
4949
let reuseIdentifier = T.defaultReuseIdentifier
5050
guard
5151
let cell = self.dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath) as? T

Example/Example/ViewController.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ final class ViewController: UIViewController {
2424

2525
collectionView.register(CollectionViewCell.self)
2626

27-
collectionView.decelerationRate = UIScrollViewDecelerationRateFast
27+
collectionView.decelerationRate = .fast
2828
collectionView.backgroundColor = UIColor(red: 51/255, green: 55/255, blue: 61/255, alpha: 1)
2929
}
3030

3131
override func didReceiveMemoryWarning() {
3232
super.didReceiveMemoryWarning()
3333
}
3434

35-
override var preferredStatusBarStyle : UIStatusBarStyle {
35+
override var preferredStatusBarStyle: UIStatusBarStyle {
3636
return .lightContent
3737
}
3838
}
@@ -43,12 +43,14 @@ extension ViewController: UICollectionViewDataSource {
4343
return repository.count
4444
}
4545

46-
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
46+
func collectionView(_ collectionView: UICollectionView,
47+
cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
4748
return collectionView.dequeueReusableCell(forIndexPath: indexPath) as CollectionViewCell
4849
}
4950

50-
func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
51-
51+
func collectionView(_ collectionView: UICollectionView,
52+
willDisplay cell: UICollectionViewCell,
53+
forItemAt indexPath: IndexPath) {
5254
guard
5355
let cell = cell as? CollectionViewCellInterface
5456
else {

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Travis CI](https://travis-ci.org/fdzsergio/SFFocusViewLayout.svg?branch=master)](https://travis-ci.org/fdzsergio/SFFocusViewLayout)
44
[![codecov.io](https://codecov.io/github/fdzsergio/SFFocusViewLayout/coverage.svg?branch=master)](https://codecov.io/github/fdzsergio/SFFocusViewLayout?branch=master)
5-
[![Swift Version](https://img.shields.io/badge/Swift-3.1.x-orange.svg)]()
5+
[![Swift Version](https://img.shields.io/badge/Swift-4.2.x-orange.svg)]()
66
[![Version](https://img.shields.io/cocoapods/v/SFFocusViewLayout.svg?style=flat)](http://cocoapods.org/pods/SFFocusViewLayout)
77
[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)
88
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)

SFFocusViewLayout.podspec

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
Pod::Spec.new do |s|
2-
s.name = "SFFocusViewLayout"
3-
s.version = "3.1.0"
4-
s.summary = "UICollectionViewLayout subclass with focused content."
2+
s.name = 'SFFocusViewLayout'
3+
s.version = '3.2.0'
4+
s.summary = 'UICollectionViewLayout subclass with focused content.'
55

66
s.description = <<-DESC
77
SFFocusViewLayout is a UICollectionViewLayout subclass
88
for displaying focused content on UICollectionView which
99
is the largest cell of all.
1010
DESC
1111

12-
s.homepage = "https://github.com/fdzsergio/SFFocusViewLayout"
13-
s.screenshots = "https://raw.githubusercontent.com/fdzsergio/SFFocusViewLayout/master/Screenshots/SFFocusViewLayout.gif"
12+
s.homepage = 'https://github.com/fdzsergio/SFFocusViewLayout'
13+
s.screenshots = 'https://raw.githubusercontent.com/fdzsergio/SFFocusViewLayout/master/Screenshots/SFFocusViewLayout.gif'
1414
s.license = { :type => 'MIT', :file => 'LICENSE' }
15-
s.author = { "Sergio Fernández" => "[email protected]" }
16-
s.source = { :git => "https://github.com/fdzsergio/SFFocusViewLayout.git", :tag => s.version.to_s }
15+
s.author = { 'Sergio Fernández' => '[email protected]' }
16+
s.source = { :git => 'https://github.com/fdzsergio/SFFocusViewLayout.git', :tag => s.version.to_s }
1717
s.social_media_url = 'https://twitter.com/fdzsergio'
1818

1919
s.platform = :ios, '8.0'
20-
s.requires_arc = true
20+
s.ios.deployment_target = '8.0'
2121

22-
s.source_files = 'Source/*.swift'
2322
s.frameworks = 'UIKit'
23+
s.requires_arc = true
24+
25+
s.swift_version = '4.2'
26+
s.source_files = 'Source/*.swift'
2427

25-
s.ios.deployment_target = '8.0'
2628
end

0 commit comments

Comments
 (0)