Skip to content

Commit

Permalink
Merge pull request #52 from matthewpalmer/swift5
Browse files Browse the repository at this point in the history
Use Swift 5
  • Loading branch information
nakajijapan authored Apr 12, 2019
2 parents 12169aa + 6f61447 commit 94998e7
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# references:
# * http://www.objc.io/issue-6/travis-ci.html
# * https:/supermarin/xcpretty#usage
osx_image: xcode9
language: objective-c
osx_image: xcode10.2
language: swift
# cache: cocoapods
# podfile: Example/Podfile
# before_install:
# - gem install cocoapods # Since Travis is not always on latest version
# - pod install --project-directory=Example
install:
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
- gem install xcpretty --no-document --quiet
script:
- set -o pipefail && xcodebuild test -project Regift.xcodeproj/ -scheme Regift -destination 'platform=iOS Simulator,name=iPhone X' ONLY_ACTIVE_ARCH=NO | xcpretty -c
- set -o pipefail && xcodebuild test -project Regift.xcodeproj/ -scheme RegiftOSX -destination 'platform=OS X,arch=x86_64' ONLY_ACTIVE_ARCH=NO | xcpretty -c
Expand Down
23 changes: 12 additions & 11 deletions Regift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,11 @@
};
buildConfigurationList = 0E0C3BBA1A4E9A7D00325FF0 /* Build configuration list for PBXProject "Regift" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 0E0C3BB61A4E9A7D00325FF0;
productRefGroup = 0E0C3BC11A4E9A7D00325FF0 /* Products */;
Expand Down Expand Up @@ -466,7 +467,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -516,7 +517,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -540,7 +541,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -559,7 +560,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "net.matthewpalmer.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -575,7 +576,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "net.matthewpalmer.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -587,7 +588,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "net.matthewpalmer.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -612,7 +613,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -637,7 +638,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -655,7 +656,7 @@
PRODUCT_BUNDLE_IDENTIFIER = net.matthewpalmer.RegiftOSXTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -673,7 +674,7 @@
PRODUCT_BUNDLE_IDENTIFIER = net.matthewpalmer.RegiftOSXTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Regift/AVAssetImageGeneratorTimePoints.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import AVFoundation

public extension AVAssetImageGenerator {
public func generateCGImagesAsynchronouslyForTimePoints(timePoints: [TimePoint], completionHandler: @escaping AVAssetImageGeneratorCompletionHandler) {
func generateCGImagesAsynchronouslyForTimePoints(timePoints: [TimePoint], completionHandler: @escaping AVAssetImageGeneratorCompletionHandler) {
let times = timePoints.map {timePoint in
return NSValue(time: timePoint)
}
Expand Down
4 changes: 2 additions & 2 deletions Regift/Regift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public struct Regift {

for frameNumber in 0 ..< frameCount {
let seconds: Float64 = Float64(startTime) + (Float64(increment) * Float64(frameNumber))
let time = CMTimeMakeWithSeconds(seconds, Constants.TimeInterval)
let time = CMTimeMakeWithSeconds(seconds, preferredTimescale: Constants.TimeInterval)

timePoints.append(time)
}
Expand Down Expand Up @@ -344,7 +344,7 @@ public struct Regift {
generator.maximumSize = size
}

let tolerance = CMTimeMakeWithSeconds(Constants.Tolerance, Constants.TimeInterval)
let tolerance = CMTimeMakeWithSeconds(Constants.Tolerance, preferredTimescale: Constants.TimeInterval)
generator.requestedTimeToleranceBefore = tolerance
generator.requestedTimeToleranceAfter = tolerance

Expand Down

0 comments on commit 94998e7

Please sign in to comment.