Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 5 #56

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode7.2
osx_image: xcode12.4
branches:
only:
- master
Expand All @@ -9,7 +9,7 @@ env:
- LANG=en_US.UTF-8
- FRAMEWORK_NAME="CountdownLabel"
matrix:
- DESTINATION="OS=9.2,name=iPhone 6" SCHEME="CountdownLabelTests" SDK="iphonesimulator9.2" $ACTION="test"
- DESTINATION="OS=11.0,name=iPhone 11" SCHEME="CountdownLabelTests" SDK="iphonesimulator11.0" $ACTION="test"

before_install:
- brew update
Expand Down
7 changes: 4 additions & 3 deletions CountdownLabel.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
Pod::Spec.new do |s|
s.name = "CountdownLabel"
s.version = '4.0.1'
s.version = '5.0.0'

s.summary = 'Simple countdown UILabel with morphing animation, and some useful function.'
s.homepage = "https://github.com/suzuki-0000/CountdownLabel"
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "suzuki_keishi" => "keishi.1983@gmail.com" }
s.source = { :git => "https://github.com/suzuki-0000/CountdownLabel.git", :tag => s.version }
s.platform = :ios, "8.2"
s.source_files = 'CountdownLabel/*.swift'
s.source_files = 'CountdownLabel/**/*.swift'
s.source_files = 'CountdownLabel/source/*.swift'
s.source_files = 'CountdownLabel/source/**/*.swift'
s.requires_arc = true
s.frameworks = "UIKit"
end
117 changes: 11 additions & 106 deletions CountdownLabel.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,8 @@
764D994C1F87830200204ED2 /* LTCharacterDiffResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 764D992A1F877FF500204ED2 /* LTCharacterDiffResult.swift */; };
892106D41C3CF4140007CDEC /* CountdownLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 892106D31C3CF4140007CDEC /* CountdownLabel.h */; settings = {ATTRIBUTES = (Public, ); }; };
892107001C3CF4490007CDEC /* CountdownLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 892106FF1C3CF4490007CDEC /* CountdownLabel.swift */; };
8999B51E1C4F2F7200C46F10 /* CountdownLabelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8999B51D1C4F2F7200C46F10 /* CountdownLabelTests.swift */; };
8999B5201C4F2F7200C46F10 /* CountdownLabel.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 892106D01C3CF4140007CDEC /* CountdownLabel.framework */; };
8999B5271C4F2F8700C46F10 /* StoryboardTests.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8999B5261C4F2F8700C46F10 /* StoryboardTests.storyboard */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
8999B5211C4F2F7200C46F10 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 892106C71C3CF4140007CDEC /* Project object */;
proxyType = 1;
remoteGlobalIDString = 892106CF1C3CF4140007CDEC;
remoteInfo = CountdownLabel;
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
764D992A1F877FF500204ED2 /* LTCharacterDiffResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LTCharacterDiffResult.swift; sourceTree = "<group>"; };
764D992B1F877FF500204ED2 /* LTCharacterLimbo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LTCharacterLimbo.swift; sourceTree = "<group>"; };
Expand All @@ -60,7 +47,6 @@
892106D31C3CF4140007CDEC /* CountdownLabel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CountdownLabel.h; sourceTree = "<group>"; };
892106D51C3CF4140007CDEC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
892106FF1C3CF4490007CDEC /* CountdownLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CountdownLabel.swift; sourceTree = "<group>"; };
8999B51B1C4F2F7200C46F10 /* CountdownLabelTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CountdownLabelTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
8999B51D1C4F2F7200C46F10 /* CountdownLabelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountdownLabelTests.swift; sourceTree = "<group>"; };
8999B51F1C4F2F7200C46F10 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8999B5261C4F2F8700C46F10 /* StoryboardTests.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = StoryboardTests.storyboard; sourceTree = "<group>"; };
Expand All @@ -74,14 +60,6 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
8999B5181C4F2F7200C46F10 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8999B5201C4F2F7200C46F10 /* CountdownLabel.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
Expand Down Expand Up @@ -131,7 +109,6 @@
isa = PBXGroup;
children = (
892106D01C3CF4140007CDEC /* CountdownLabel.framework */,
8999B51B1C4F2F7200C46F10 /* CountdownLabelTests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand All @@ -144,7 +121,8 @@
892106FF1C3CF4490007CDEC /* CountdownLabel.swift */,
892106D51C3CF4140007CDEC /* Info.plist */,
);
path = CountdownLabel;
name = CountdownLabel;
path = Sources/CountdownLabel;
sourceTree = "<group>";
};
8999B51C1C4F2F7200C46F10 /* CountdownLabelTests */ = {
Expand Down Expand Up @@ -190,24 +168,6 @@
productReference = 892106D01C3CF4140007CDEC /* CountdownLabel.framework */;
productType = "com.apple.product-type.framework";
};
8999B51A1C4F2F7200C46F10 /* CountdownLabelTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 8999B5231C4F2F7200C46F10 /* Build configuration list for PBXNativeTarget "CountdownLabelTests" */;
buildPhases = (
8999B5171C4F2F7200C46F10 /* Sources */,
8999B5181C4F2F7200C46F10 /* Frameworks */,
8999B5191C4F2F7200C46F10 /* Resources */,
);
buildRules = (
);
dependencies = (
8999B5221C4F2F7200C46F10 /* PBXTargetDependency */,
);
name = CountdownLabelTests;
productName = CountdownLabelTests;
productReference = 8999B51B1C4F2F7200C46F10 /* CountdownLabelTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
Expand All @@ -222,17 +182,14 @@
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0800;
};
8999B51A1C4F2F7200C46F10 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0830;
};
};
};
buildConfigurationList = 892106CA1C3CF4140007CDEC /* Build configuration list for PBXProject "CountdownLabel" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = 892106C61C3CF4140007CDEC;
Expand All @@ -241,7 +198,6 @@
projectRoot = "";
targets = (
892106CF1C3CF4140007CDEC /* CountdownLabel */,
8999B51A1C4F2F7200C46F10 /* CountdownLabelTests */,
);
};
/* End PBXProject section */
Expand All @@ -254,14 +210,6 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
8999B5191C4F2F7200C46F10 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8999B5271C4F2F8700C46F10 /* StoryboardTests.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -302,24 +250,8 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
8999B5171C4F2F7200C46F10 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8999B51E1C4F2F7200C46F10 /* CountdownLabelTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
8999B5221C4F2F7200C46F10 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 892106CF1C3CF4140007CDEC /* CountdownLabel */;
targetProxy = 8999B5211C4F2F7200C46F10 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin XCBuildConfiguration section */
892106D61C3CF4140007CDEC /* Debug */ = {
isa = XCBuildConfiguration;
Expand Down Expand Up @@ -443,13 +375,15 @@
);
INFOPLIST_FILE = CountdownLabel/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.keishi.suzuki.CountdownLabel;
PRODUCT_NAME = CountdownLabel;
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
Expand All @@ -469,34 +403,14 @@
);
INFOPLIST_FILE = CountdownLabel/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.keishi.suzuki.CountdownLabel;
PRODUCT_NAME = CountdownLabel;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
};
name = Release;
};
8999B5241C4F2F7200C46F10 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = CountdownLabelTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.keishi.suzuki.CountdownLabelTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
8999B5251C4F2F7200C46F10 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = CountdownLabelTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.keishi.suzuki.CountdownLabelTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SUPPORTS_MACCATALYST = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
Expand All @@ -521,15 +435,6 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
8999B5231C4F2F7200C46F10 /* Build configuration list for PBXNativeTarget "CountdownLabelTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
8999B5241C4F2F7200C46F10 /* Debug */,
8999B5251C4F2F7200C46F10 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 892106C71C3CF4140007CDEC /* Project object */;
Expand Down
27 changes: 27 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "CountdownLabel",
platforms: [.iOS(.v11)],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "CountdownLabel",
targets: ["CountdownLabel"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "CountdownLabel",
dependencies: [])

]
)
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CountdownLabel
========================

![Swift](http://img.shields.io/badge/swift-4.0-brightgreen.svg)
![Swift](http://img.shields.io/badge/swift-5.0-brightgreen.svg)
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/CountdownLabel.svg?style=flat)](http://cocoadocs.org/docsets/CountdownLabel)

Expand All @@ -23,6 +23,7 @@ Below is a table that shows which version of what you should use for your Swift

| Swift version | version |
| ------------- | --------------- |
| 5.0 | >= 5.0 |
| 4.2 | >= 4.0 |
| 4.0, 4.1 | >= 3.0 |
| 3.X | >= 2.0 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class CountdownLabel: LTMorphingLabel {
public var dateFormatter: DateFormatter {
let df = DateFormatter()
df.locale = Locale(identifier: "en_US_POSIX")
df.timeZone = NSTimeZone(name: "GMT") as TimeZone!
df.timeZone = TimeZone(identifier: "GMT")
df.dateFormat = timeFormat
return df
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ public struct LTEasing {

public static func easeOutQuint(_ t: Float, _ b: Float, _ c: Float, _ d: Float = 1.0) -> Float {
return {
return c * ($0 * $0 * $0 * $0 * $0 + 1.0) + b
return c * (pow($0, 5) + 1.0) + b
}(t / d - 1.0)
}

public static func easeInQuint(_ t: Float, _ b: Float, _ c: Float, _ d: Float = 1.0) -> Float {
return {
return c * $0 * $0 * $0 * $0 * $0 + b
return (c * pow($0, 5) + b)
}(t / d)
}

Expand Down
15 changes: 15 additions & 0 deletions Tests/CountdownLabelTests/CountdownLabelTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import XCTest
@testable import CountdownLabel

final class CountdownLabelTests: XCTestCase {
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct
// results.
XCTAssertEqual(CountdownLabel().text, "Hello, World!")
}

static var allTests = [
("testExample", testExample),
]
}
9 changes: 9 additions & 0 deletions Tests/CountdownLabelTests/XCTestManifests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import XCTest

#if !canImport(ObjectiveC)
public func allTests() -> [XCTestCaseEntry] {
return [
testCase(CountdownLabelTests.allTests),
]
}
#endif
7 changes: 7 additions & 0 deletions Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import XCTest

import CountdownLabelTests

var tests = [XCTestCaseEntry]()
tests += CountdownLabelTests.allTests()
XCTMain(tests)