Skip to content

Commit

Permalink
migrating to swift 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
numen31337 committed Mar 26, 2019
1 parent d1a306b commit 57c504f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
10 changes: 4 additions & 6 deletions Day.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,13 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.1;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down Expand Up @@ -347,11 +347,11 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.1;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -371,7 +371,6 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Day/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.numen.Day;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
Expand All @@ -394,7 +393,6 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Day/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.numen.Day;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
Expand Down
12 changes: 1 addition & 11 deletions Day/Day.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct Day {
public struct Day: Hashable {
public let rawValue: Date

fileprivate init(withRawValue value: Date) {
Expand Down Expand Up @@ -50,22 +50,12 @@ extension Day {
}
}

extension Day: Equatable {
public static func ==(lhs: Day, rhs: Day) -> Bool {
return lhs.rawValue == rhs.rawValue
}
}

extension Day: Comparable {
public static func <(lhs: Day, rhs: Day) -> Bool {
return lhs.rawValue < rhs.rawValue
}
}

extension Day: Hashable {
public var hashValue: Int { return rawValue.hashValue }
}

extension Date {
public var dayValue: Day { return Day(self) }
}
Expand Down

0 comments on commit 57c504f

Please sign in to comment.