diff --git a/RRuleSwift.xcodeproj/project.pbxproj b/RRuleSwift.xcodeproj/project.pbxproj index bdddd99..54d9a9c 100644 --- a/RRuleSwift.xcodeproj/project.pbxproj +++ b/RRuleSwift.xcodeproj/project.pbxproj @@ -184,25 +184,26 @@ D31B138E1CA8E02E00D0B863 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = Teambition; TargetAttributes = { D31B13961CA8E02E00D0B863 = { CreatedOnToolsVersion = 7.3; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; }; EB48D1361D641AD6001EE872 = { CreatedOnToolsVersion = 7.3; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; }; }; }; buildConfigurationList = D31B13911CA8E02E00D0B863 /* Build configuration list for PBXProject "RRuleSwift" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = D31B138D1CA8E02E00D0B863; productRefGroup = D31B13981CA8E02E00D0B863 /* Products */; @@ -272,6 +273,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -331,6 +333,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -396,8 +399,7 @@ PRODUCT_NAME = RRuleSwift; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -416,8 +418,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "Teambition.RRuleSwift-iOS"; PRODUCT_NAME = RRuleSwift; SKIP_INSTALL = YES; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -440,8 +441,7 @@ SKIP_INSTALL = YES; SWIFT_OBJC_INTERFACE_HEADER_NAME = "$(SWIFT_MODULE_NAME)-Swift.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -465,8 +465,7 @@ SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_OBJC_INTERFACE_HEADER_NAME = "$(SWIFT_MODULE_NAME)-Swift.h"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; diff --git a/RRuleSwift.xcodeproj/xcshareddata/xcschemes/RRuleSwift iOS.xcscheme b/RRuleSwift.xcodeproj/xcshareddata/xcschemes/RRuleSwift iOS.xcscheme index 01b7c8a..480332d 100644 --- a/RRuleSwift.xcodeproj/xcshareddata/xcschemes/RRuleSwift iOS.xcscheme +++ b/RRuleSwift.xcodeproj/xcshareddata/xcschemes/RRuleSwift iOS.xcscheme @@ -1,6 +1,6 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 0.4.2 + 0.5.0 CFBundleSignature ???? CFBundleVersion - 17 + 18 NSExtension NSExtensionMainStoryboard diff --git a/RRuleSwiftExample-Watch Extension/Info.plist b/RRuleSwiftExample-Watch Extension/Info.plist index eb573a5..9dc288a 100644 --- a/RRuleSwiftExample-Watch Extension/Info.plist +++ b/RRuleSwiftExample-Watch Extension/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 0.4.2 + 0.5.0 CFBundleSignature ???? CFBundleVersion - 17 + 18 NSExtension NSExtensionAttributes diff --git a/RRuleSwiftExample-Watch/Assets.xcassets/AppIcon.appiconset/Contents.json b/RRuleSwiftExample-Watch/Assets.xcassets/AppIcon.appiconset/Contents.json index dd221ba..6c0f2b4 100644 --- a/RRuleSwiftExample-Watch/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/RRuleSwiftExample-Watch/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -33,6 +33,20 @@ "role" : "appLauncher", "subtype" : "38mm" }, + { + "size" : "44x44", + "idiom" : "watch", + "scale" : "2x", + "role" : "appLauncher", + "subtype" : "40mm" + }, + { + "size" : "50x50", + "idiom" : "watch", + "scale" : "2x", + "role" : "appLauncher", + "subtype" : "44mm" + }, { "size" : "86x86", "idiom" : "watch", @@ -46,10 +60,22 @@ "scale" : "2x", "role" : "quickLook", "subtype" : "42mm" + }, + { + "size" : "108x108", + "idiom" : "watch", + "scale" : "2x", + "role" : "quickLook", + "subtype" : "44mm" + }, + { + "idiom" : "watch-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } -} +} \ No newline at end of file diff --git a/RRuleSwiftExample-Watch/Info.plist b/RRuleSwiftExample-Watch/Info.plist index 745f8e9..20ea9b2 100644 --- a/RRuleSwiftExample-Watch/Info.plist +++ b/RRuleSwiftExample-Watch/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.4.2 + 0.5.0 CFBundleSignature ???? CFBundleVersion - 17 + 18 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait diff --git a/RRuleSwiftExample.xcodeproj/project.pbxproj b/RRuleSwiftExample.xcodeproj/project.pbxproj index caaa6cc..8b86298 100644 --- a/RRuleSwiftExample.xcodeproj/project.pbxproj +++ b/RRuleSwiftExample.xcodeproj/project.pbxproj @@ -308,16 +308,16 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = Teambition; TargetAttributes = { D31B13771CA8D8E400D0B863 = { CreatedOnToolsVersion = 7.3; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; }; D325D6451D0574E00021E620 = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 1020; }; EB48D17E1D64202E001EE872 = { CreatedOnToolsVersion = 7.3; @@ -325,13 +325,13 @@ }; EB48D18A1D64202E001EE872 = { CreatedOnToolsVersion = 7.3; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; }; }; }; buildConfigurationList = D31B13731CA8D8E400D0B863 /* Build configuration list for PBXProject "RRuleSwiftExample" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -464,6 +464,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -520,6 +521,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -574,8 +576,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = Teambition.RRuleSwiftExample; PRODUCT_NAME = RRuleSwiftExample; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -587,8 +588,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = Teambition.RRuleSwiftExample; PRODUCT_NAME = RRuleSwiftExample; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -601,7 +601,7 @@ PRODUCT_BUNDLE_IDENTIFIER = Teambition.RRuleSwiftExample.TodayExtension; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -614,7 +614,7 @@ PRODUCT_BUNDLE_IDENTIFIER = Teambition.RRuleSwiftExample.TodayExtension; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -630,7 +630,7 @@ SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -648,7 +648,7 @@ SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -663,8 +663,7 @@ PRODUCT_NAME = "${TARGET_NAME}"; SDKROOT = watchos; SKIP_INSTALL = YES; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -679,8 +678,7 @@ PRODUCT_NAME = "${TARGET_NAME}"; SDKROOT = watchos; SKIP_INSTALL = YES; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; diff --git a/RRuleSwiftExample.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/RRuleSwiftExample-TodayExtension.xcscheme b/RRuleSwiftExample.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/RRuleSwiftExample-TodayExtension.xcscheme index 7f80c23..dff725e 100644 --- a/RRuleSwiftExample.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/RRuleSwiftExample-TodayExtension.xcscheme +++ b/RRuleSwiftExample.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/RRuleSwiftExample-TodayExtension.xcscheme @@ -1,6 +1,6 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.4.2 + 0.5.0 CFBundleSignature ???? CFBundleVersion - 17 + 18 LSRequiresIPhoneOS UILaunchStoryboardName diff --git a/RRuleSwiftExample/RRuleExampleViewController.swift b/RRuleSwiftExample/RRuleExampleViewController.swift index 197bdfe..7a26e74 100644 --- a/RRuleSwiftExample/RRuleExampleViewController.swift +++ b/RRuleSwiftExample/RRuleExampleViewController.swift @@ -155,7 +155,7 @@ extension RRuleExampleViewController: UITableViewDataSource, UITableViewDelegate cell.pickerView.tag = indexPath.section cell.pickerView.dataSource = self cell.pickerView.delegate = self - cell.pickerView.selectRow(kFrequencyStrings.index(of: rule.frequency.toString()) ?? 0, inComponent: 0, animated: true) + cell.pickerView.selectRow(kFrequencyStrings.firstIndex(of: rule.frequency.toString()) ?? 0, inComponent: 0, animated: true) return cell case (1, _): let cell = tableView.dequeueReusableCell(withIdentifier: kPickerViewCellID, for: indexPath) as! PickerViewCell @@ -263,7 +263,7 @@ extension RRuleExampleViewController: UITableViewDataSource, UITableViewDelegate }) if weekdays.contains(indexPath) { cell?.accessoryType = .none - weekdays.remove(at: weekdays.index(of: indexPath)!) + weekdays.remove(at: weekdays.firstIndex(of: indexPath)!) rule.byweekday = weekdays.map({ (indexPath) -> EKWeekday in return kEKWeekdays[indexPath.row] }).sorted(by: <) @@ -281,7 +281,7 @@ extension RRuleExampleViewController: UITableViewDataSource, UITableViewDelegate }) if months.contains(indexPath) { cell?.accessoryType = .none - months.remove(at: months.index(of: indexPath)!) + months.remove(at: months.firstIndex(of: indexPath)!) rule.bymonth = months.map({ (indexPath) -> Int in return indexPath.row + 1 }).sorted(by: <) @@ -299,7 +299,7 @@ extension RRuleExampleViewController: UITableViewDataSource, UITableViewDelegate }) if monthdays.contains(indexPath) { cell?.accessoryType = .none - monthdays.remove(at: monthdays.index(of: indexPath)!) + monthdays.remove(at: monthdays.firstIndex(of: indexPath)!) rule.bymonthday = monthdays.map({ (indexPath) -> Int in return indexPath.row + 1 }).sorted(by: <) diff --git a/Sources/EKWeekday+RRule.swift b/Sources/EKWeekday+RRule.swift index 5793941..48c3c20 100644 --- a/Sources/EKWeekday+RRule.swift +++ b/Sources/EKWeekday+RRule.swift @@ -9,7 +9,7 @@ import EventKit internal extension EKWeekday { - internal func toSymbol() -> String { + func toSymbol() -> String { switch self { case .monday: return "MO" case .tuesday: return "TU" @@ -21,7 +21,7 @@ internal extension EKWeekday { } } - internal func toNumberSymbol() -> Int { + func toNumberSymbol() -> Int { switch self { case .monday: return 0 case .tuesday: return 1 @@ -33,7 +33,7 @@ internal extension EKWeekday { } } - internal static func weekdayFromSymbol(_ symbol: String) -> EKWeekday? { + static func weekdayFromSymbol(_ symbol: String) -> EKWeekday? { switch symbol { case "MO", "0": return EKWeekday.monday case "TU", "1": return EKWeekday.tuesday diff --git a/Sources/Iterators.swift b/Sources/Iterators.swift index 2d0bf15..2216377 100644 --- a/Sources/Iterators.swift +++ b/Sources/Iterators.swift @@ -25,7 +25,7 @@ public struct Iterator { } public extension RecurrenceRule { - public func allOccurrences(endless endlessRecurrenceCount: Int = Iterator.endlessRecurrenceCount) -> [Date] { + func allOccurrences(endless endlessRecurrenceCount: Int = Iterator.endlessRecurrenceCount) -> [Date] { guard let _ = JavaScriptBridge.rrulejs() else { return [] } @@ -45,7 +45,7 @@ public extension RecurrenceRule { for occurrence in occurrences { for exdate in exdates { if calendar.isDate(occurrence, equalTo: exdate, toGranularity: component) { - let index = occurrences.index(of: occurrence)! + let index = occurrences.firstIndex(of: occurrence)! occurrences.remove(at: index) break } @@ -56,7 +56,7 @@ public extension RecurrenceRule { return occurrences.sorted { $0.isBeforeOrSame(with: $1) } } - public func occurrences(between date: Date, and otherDate: Date, endless endlessRecurrenceCount: Int = Iterator.endlessRecurrenceCount) -> [Date] { + func occurrences(between date: Date, and otherDate: Date, endless endlessRecurrenceCount: Int = Iterator.endlessRecurrenceCount) -> [Date] { guard let _ = JavaScriptBridge.rrulejs() else { return [] } @@ -81,7 +81,7 @@ public extension RecurrenceRule { for occurrence in occurrences { for exdate in exdates { if calendar.isDate(occurrence, equalTo: exdate, toGranularity: component) { - let index = occurrences.index(of: occurrence)! + let index = occurrences.firstIndex(of: occurrence)! occurrences.remove(at: index) break } diff --git a/Sources/JavaScriptBridge.swift b/Sources/JavaScriptBridge.swift index ec1b6fd..4d8c2d9 100644 --- a/Sources/JavaScriptBridge.swift +++ b/Sources/JavaScriptBridge.swift @@ -53,7 +53,7 @@ internal extension EKWeekday { } internal extension RecurrenceRule { - internal func toJSONString(endless endlessRecurrenceCount: Int) -> String { + func toJSONString(endless endlessRecurrenceCount: Int) -> String { var jsonString = "freq: \(frequency.toJSONFrequency())," jsonString += "interval: \(max(1, interval))," jsonString += "wkst: \(firstDayOfWeek.toJSONSymbol())," diff --git a/Sources/NSDate+Comparison.swift b/Sources/NSDate+Comparison.swift index d278bbc..baac244 100644 --- a/Sources/NSDate+Comparison.swift +++ b/Sources/NSDate+Comparison.swift @@ -9,23 +9,23 @@ import Foundation internal extension Date { - internal func isBefore(_ date: Date) -> Bool { + func isBefore(_ date: Date) -> Bool { return compare(date) == .orderedAscending } - internal func isSame(with date: Date) -> Bool { + func isSame(with date: Date) -> Bool { return compare(date) == .orderedSame } - internal func isAfter(_ date: Date) -> Bool { + func isAfter(_ date: Date) -> Bool { return compare(date) == .orderedDescending } - internal func isBeforeOrSame(with date: Date) -> Bool { + func isBeforeOrSame(with date: Date) -> Bool { return isBefore(date) || isSame(with: date) } - internal func isAfterOrSame(with date: Date) -> Bool { + func isAfterOrSame(with date: Date) -> Bool { return isAfter(date) || isSame(with: date) } } diff --git a/Sources/Supporting Files/Info-iOS.plist b/Sources/Supporting Files/Info-iOS.plist index 7c9f8bd..288c341 100644 --- a/Sources/Supporting Files/Info-iOS.plist +++ b/Sources/Supporting Files/Info-iOS.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.4.2 + 0.5.0 CFBundleSignature ???? CFBundleVersion diff --git a/Sources/Supporting Files/Info-watchOS.plist b/Sources/Supporting Files/Info-watchOS.plist index 7c9f8bd..288c341 100644 --- a/Sources/Supporting Files/Info-watchOS.plist +++ b/Sources/Supporting Files/Info-watchOS.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.4.2 + 0.5.0 CFBundleSignature ???? CFBundleVersion