Skip to content
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
1 change: 0 additions & 1 deletion .swift-version

This file was deleted.

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.

12 changes: 6 additions & 6 deletions Example/SwiftCronExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
};
name = Debug;
};
Expand Down Expand Up @@ -548,7 +548,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -564,7 +564,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.Rush42.SwiftCronExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
};
name = Debug;
};
Expand All @@ -579,7 +579,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.Rush42.SwiftCronExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
};
name = Release;
};
Expand All @@ -597,7 +597,7 @@
SWIFT_OBJC_BRIDGING_HEADER = "SwiftCronExampleTests/SwiftCronExampleTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftCronExample.app/SwiftCronExample";
};
name = Debug;
Expand All @@ -615,7 +615,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "SwiftCronExampleTests/SwiftCronExampleTests-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftCronExample.app/SwiftCronExample";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,52 @@
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
2 changes: 1 addition & 1 deletion Example/SwiftCronExampleTests/SwiftCronExampleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class SwiftCronExampleTests: XCTestCase {

func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock {
measure {
// Put the code you want to measure the time of here.
}
}
Expand Down
16 changes: 8 additions & 8 deletions Example/SwiftCronExampleTests/Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ class TableOfContentsSpec: QuickSpec {
it("will eventually pass") {
var time = "passing"

dispatch_async(dispatch_get_main_queue()) {
time = "done"
}
DispatchQueue.main.async {
time = "done"
}

waitUntil { done in
NSThread.sleepForTimeInterval(0.5)
expect(time) == "done"
waitUntil { done in
Thread.sleep(forTimeInterval: 0.5)
expect(time) == "done"

done()
}
done()
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.0
// swift-tools-version:6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription

Expand All @@ -11,5 +11,5 @@ let package = Package(
targets: [
.target(name: "SwiftCron", dependencies: [], path: "Sources/")
],
swiftLanguageVersions: [.v5]
swiftLanguageModes: [.v5, .v6]
)
6 changes: 4 additions & 2 deletions Sources/CronRepresentation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
import Foundation

enum CronField: Int {
case minute, hour, day, month, weekday, year
private static let fieldCheckers: Array<FieldCheckerInterface> = [MinutesField(), HoursField(), DayOfMonthField(), MonthField(), DayOfWeekField(), YearField()]
case minute, hour, day, month, weekday, year
private static var fieldCheckers: [FieldCheckerInterface] {
[MinutesField(), HoursField(), DayOfMonthField(), MonthField(), DayOfWeekField(), YearField()]
}

func getFieldChecker() -> FieldCheckerInterface {
return CronField.fieldCheckers[rawValue]
Expand Down
7 changes: 1 addition & 6 deletions Sources/StringValidator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@ struct StringValidator {
}

private static func validate(_ value: String, regex: String) -> Bool {
#if os(Linux)
typealias Regex = RegularExpression
#else
typealias Regex = NSRegularExpression
#endif

typealias Regex = NSRegularExpression
guard let regex = try? Regex(pattern: regex, options: []) else { return false }
return regex.numberOfMatches(in: value, options: [], range: NSMakeRange(0, value.count)) > 0
}
Expand Down
3 changes: 2 additions & 1 deletion SwiftCron.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ A cron expression parser written in Swift that can take a cron string and give y
s.author = { "Keegan Rush" => "[email protected]" }
s.source = { :git => "https://github.com/TheCodedSelf/SwiftCron.git", :tag => "#{s.version}" }
s.social_media_url = 'https://twitter.com/RushKeegan'
s.swift_versions = ['6.0']

s.ios.deployment_target = '9.0'
s.ios.deployment_target = '13.0'

s.source_files = 'Sources/**/*'
end
12 changes: 6 additions & 6 deletions SwiftCron.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,14 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -322,12 +322,12 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -352,7 +352,7 @@
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
};
name = Debug;
};
Expand All @@ -372,7 +372,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
};
name = Release;
};
Expand Down