Skip to content
This repository was archived by the owner on Oct 15, 2023. It is now read-only.

Commit 8d178c9

Browse files
authored
Merge pull request #5 from shtnkgm/feature/swift5
Supporting Swift 5.0
2 parents 96e1dc2 + 75bdaa4 commit 8d178c9

9 files changed

+25
-21
lines changed

.swiftlint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ disabled_rules:
22
- identifier_name
33
- multiple_closures_with_trailing_closure
44
- empty_enum_arguments
5+
- explicit_top_level_acl
56
- conditional_returns_on_newline
67
- closure_end_indentation
78
- discouraged_optional_collection
@@ -82,7 +83,7 @@ opt_in_rules:
8283
included:
8384
- ImageTransition
8485
- Demo
85-
86+
8687
# Lint対象から除外するパス
8788
excluded:
8889

@@ -124,4 +125,3 @@ custom_rules:
124125
regex: "^(private |fileprivate |internal |public |open )class"
125126
message: "Final Class"
126127
severity: error
127-

.travis.yml

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

55
env:
66
global:
@@ -14,7 +14,7 @@ matrix:
1414
- env: JOB=xcode SCHEME=ImageTransition SDK=iphonesimulator
1515

1616
branches:
17-
only:
17+
only:
1818
- master
1919

2020
cache:
@@ -24,6 +24,6 @@ cache:
2424
script:
2525
- set -o pipefail
2626
- xcodebuild $ACTION -project $PROJECT -scheme $SCHEME -sdk $SDK -destination 'name=iPhone 8,OS=11.4' -configuration $CONFIG ENABLE_TESTABILITY=YES | xcpretty
27-
27+
2828
after_success:
29-
- bash <(curl -s https://codecov.io/bash)
29+
- bash <(curl -s https://codecov.io/bash)

ImageTransition.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Pod::Spec.new do |spec|
22
spec.name = "ImageTransition"
3-
spec.version = "0.3.0"
3+
spec.version = "0.4.0"
44
spec.summary = "ImageTransition is a library for smooth animation of images during transitions."
55
spec.homepage = "https://github.com/shtnkgm/ImageTransition"
66
spec.license = { :type => "MIT", :file => "LICENSE" }
77
spec.author = "shtnkgm"
88
spec.platform = :ios, "9.0"
9-
spec.swift_version = "4.2"
9+
spec.swift_version = "5.0"
1010
spec.source = { :git => "https://github.com/shtnkgm/ImageTransition.git", :tag => "#{spec.version}" }
1111
spec.source_files = "ImageTransition/**/*.swift"
1212
end

ImageTransition.xcodeproj/project.pbxproj

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@
467467
SDKROOT = iphoneos;
468468
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
469469
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
470+
SWIFT_VERSION = "";
470471
VERSIONING_SYSTEM = "apple-generic";
471472
VERSION_INFO_PREFIX = "";
472473
};
@@ -524,6 +525,7 @@
524525
SDKROOT = iphoneos;
525526
SWIFT_COMPILATION_MODE = wholemodule;
526527
SWIFT_OPTIMIZATION_LEVEL = "-O";
528+
SWIFT_VERSION = "";
527529
VALIDATE_PRODUCT = YES;
528530
VERSIONING_SYSTEM = "apple-generic";
529531
VERSION_INFO_PREFIX = "";
@@ -553,7 +555,7 @@
553555
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
554556
SKIP_INSTALL = YES;
555557
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
556-
SWIFT_VERSION = 4.2;
558+
SWIFT_VERSION = 5.0;
557559
TARGETED_DEVICE_FAMILY = "1,2";
558560
};
559561
name = Debug;
@@ -580,7 +582,7 @@
580582
PRODUCT_BUNDLE_IDENTIFIER = com.github.shtnkgm.ImageTransition;
581583
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
582584
SKIP_INSTALL = YES;
583-
SWIFT_VERSION = 4.2;
585+
SWIFT_VERSION = 5.0;
584586
TARGETED_DEVICE_FAMILY = "1,2";
585587
};
586588
name = Release;
@@ -600,7 +602,7 @@
600602
);
601603
PRODUCT_BUNDLE_IDENTIFIER = com.shotanakagami.ImageTransitionTests;
602604
PRODUCT_NAME = "$(TARGET_NAME)";
603-
SWIFT_VERSION = 4.2;
605+
SWIFT_VERSION = 5.0;
604606
TARGETED_DEVICE_FAMILY = "1,2";
605607
};
606608
name = Debug;
@@ -620,7 +622,7 @@
620622
);
621623
PRODUCT_BUNDLE_IDENTIFIER = com.shotanakagami.ImageTransitionTests;
622624
PRODUCT_NAME = "$(TARGET_NAME)";
623-
SWIFT_VERSION = 4.2;
625+
SWIFT_VERSION = 5.0;
624626
TARGETED_DEVICE_FAMILY = "1,2";
625627
};
626628
name = Release;
@@ -639,7 +641,7 @@
639641
);
640642
PRODUCT_BUNDLE_IDENTIFIER = com.github.shtnkgm.Sample;
641643
PRODUCT_NAME = "$(TARGET_NAME)";
642-
SWIFT_VERSION = 4.2;
644+
SWIFT_VERSION = 5.0;
643645
TARGETED_DEVICE_FAMILY = "1,2";
644646
};
645647
name = Debug;
@@ -658,7 +660,7 @@
658660
);
659661
PRODUCT_BUNDLE_IDENTIFIER = com.github.shtnkgm.Sample;
660662
PRODUCT_NAME = "$(TARGET_NAME)";
661-
SWIFT_VERSION = 4.2;
663+
SWIFT_VERSION = 5.0;
662664
TARGETED_DEVICE_FAMILY = "1,2";
663665
};
664666
name = Release;

ImageTransition/ImageTransitionDelegate.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ extension ImageTransitionDelegate: UINavigationControllerDelegate {
4747
return ImageTransitioning(duration: popDuration, animationOptions: popAnimationOptions)
4848
case .push:
4949
return ImageTransitioning(duration: pushDuration, animationOptions: pushAnimationOptions)
50+
@unknown default:
51+
fatalError()
5052
}
5153
}
5254
}

ImageTransition/UIImage+.swift

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

1111
internal extension UIImage {
12-
internal var area: CGFloat {
12+
var area: CGFloat {
1313
return size.width * size.height
1414
}
1515

16-
internal func largerCompared(with comparedImage: UIImage) -> UIImage {
16+
func largerCompared(with comparedImage: UIImage) -> UIImage {
1717
return area > comparedImage.area ? self : comparedImage
1818
}
1919
}

ImageTransition/UIImageView+.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import AVFoundation
1010
import UIKit
1111

1212
internal extension UIImageView {
13-
internal var displayingImageSize: CGSize {
13+
var displayingImageSize: CGSize {
1414
guard let image = image else { return .zero }
1515
switch contentMode {
1616
case .scaleAspectFit:

ImageTransition/UIView+.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
import UIKit
1010

1111
internal extension UIView {
12-
internal func convertFrame(to view: UIView) -> CGRect {
12+
func convertFrame(to view: UIView) -> CGRect {
1313
return convert(bounds, to: view)
1414
}
1515

16-
internal func convertCenter(to view: UIView) -> CGPoint {
16+
func convertCenter(to view: UIView) -> CGPoint {
1717
let frame = convertFrame(to: view)
1818
return CGPoint(x: frame.minX + frame.width / 2.0, y: frame.minY + frame.height / 2.0)
1919
}
2020

21-
internal func addSubviews(_ views: UIView...) {
21+
func addSubviews(_ views: UIView...) {
2222
views.forEach {
2323
addSubview($0)
2424
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Build Status](https://travis-ci.com/shtnkgm/ImageTransition.svg?branch=master)](https://travis-ci.com/shtnkgm/ImageTransition)
44
[![Cocoapods](https://img.shields.io/cocoapods/v/ImageTransition.svg)](https://github.com/shtnkgm/ImageTransition)
55
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
6-
[![Swift Version](https://img.shields.io/badge/Swift-4-F16D39.svg)](https://developer.apple.com/swift)
6+
[![Swift Version](https://img.shields.io/badge/Swift-5.0-F16D39.svg)](https://developer.apple.com/swift)
77
[![GitHub](https://img.shields.io/github/license/shtnkgm/ImageTransition.svg)](https://github.com/shtnkgm/ImageTransition/blob/master/LICENSE)
88
[![codebeat badge](https://codebeat.co/badges/fb61c826-2d9c-4931-9be1-3080abc936cd)](https://codebeat.co/projects/g.yxqyang.asia-shtnkgm-imagetransition-master)
99

0 commit comments

Comments
 (0)