diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fab9362..acad9bc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. `JTAppleCalendar` adheres to [Semantic Versioning](http://semver.org/). #### 7.x Releases -- `7.1.0` Releases - [7.1.0](#710)|[7.1.1](#711)|[7.1.2](#712)|[7.1.3](#713)|[7.1.4](#714)|[7.1.5](#715)|[7.1.6](#716)|[7.1.7](#717) +- `7.1.0` Releases - [7.1.0](#710)|[7.1.1](#711)|[7.1.2](#712)|[7.1.3](#713)|[7.1.4](#714)|[7.1.5](#715)|[7.1.6](#716)|[7.1.7](#717)|[7.1.8](#718) - `7.0.0` Releases - [7.0.0](#700)|[7.0.1](#701)|[7.0.2](#702)|[7.0.3](#703)|[7.0.4](#704)|[7.0.5](#705)|[7.0.6](#706) #### 6.x Releases @@ -30,6 +30,13 @@ All notable changes to this project will be documented in this file. - `1.0.x` Releases - [1.0.0](#100) --- +## [7.1.8](https://github.com/patchthecode/JTAppleCalendar/releases/tag/7.1.8) +- fixed scrolling issues +- [fixed edge case bug](https://github.com/patchthecode/JTAppleCalendar/issues/1010) +- [fixed visual issue on reload in cerain cases](https://github.com/patchthecode/JTAppleCalendar/issues/1002) +- swift 5 conversion +- [fixed japansese calendar crash](https://github.com/patchthecode/JTAppleCalendar/commit/c06f0eec472e4ef39ac97e031ae55ec1231df1c1) + ## [7.1.7](https://github.com/patchthecode/JTAppleCalendar/releases/tag/7.1.7) - fixed broken cell size change - fixed rotation code diff --git a/JTAppleCalendar.podspec b/JTAppleCalendar.podspec index 0cdf3553..bf963384 100644 --- a/JTAppleCalendar.podspec +++ b/JTAppleCalendar.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "JTAppleCalendar" - s.version = "7.1.7" + s.version = "7.1.8" s.summary = "The Unofficial Swift Apple Calendar Library. View. Control. for iOS & tvOS" s.description = <<-DESC A highly configurable Apple calendar control. Contains features like boundary dates, month and week view. Very light weight. @@ -14,8 +14,8 @@ A highly configurable Apple calendar control. Contains features like boundary da s.swift_version = '4.2' - s.ios.deployment_target = '8.0' - s.tvos.deployment_target = '9.0' + s.ios.deployment_target = '10.0' + s.tvos.deployment_target = '10.0' s.source_files = 'Sources/*.swift' end diff --git a/JTAppleCalendar.xcodeproj/project.pbxproj b/JTAppleCalendar.xcodeproj/project.pbxproj index d2ebaead..24e70bb9 100644 --- a/JTAppleCalendar.xcodeproj/project.pbxproj +++ b/JTAppleCalendar.xcodeproj/project.pbxproj @@ -1165,7 +1165,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "Sources/Info-iOS.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; @@ -1219,7 +1219,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "Sources/Info-iOS.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "OST.JTAppleCalendar-iOS"; @@ -1287,7 +1287,7 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 10.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1339,7 +1339,7 @@ SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 10.0; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -1384,7 +1384,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; @@ -1427,7 +1427,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "OST.JTAppleCalendar-iOSTests"; @@ -1479,7 +1479,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "Example/JTAppleCalendar iOS Example/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; @@ -1526,7 +1526,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "Example/JTAppleCalendar iOS Example/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "OST.JTAppleCalendar-iOS-Example"; @@ -1580,7 +1580,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TVOS_DEPLOYMENT_TARGET = 9.2; + TVOS_DEPLOYMENT_TARGET = 10.0; }; name = Debug; }; @@ -1620,7 +1620,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "OST.JTAppleCalendar-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.2; + TVOS_DEPLOYMENT_TARGET = 10.0; VALIDATE_PRODUCT = YES; }; name = Release; @@ -1673,7 +1673,7 @@ SDKROOT = appletvos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.2; + TVOS_DEPLOYMENT_TARGET = 10.0; }; name = Debug; }; @@ -1717,7 +1717,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.2; + TVOS_DEPLOYMENT_TARGET = 10.0; VALIDATE_PRODUCT = YES; }; name = Release; @@ -1751,7 +1751,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INFOPLIST_FILE = UITests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = com.apple.com.UITests; @@ -1789,7 +1789,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INFOPLIST_FILE = UITests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = com.apple.com.UITests; diff --git a/Sources/GlobalFunctionsAndExtensions.swift b/Sources/GlobalFunctionsAndExtensions.swift index a78d9408..9184483c 100644 --- a/Sources/GlobalFunctionsAndExtensions.swift +++ b/Sources/GlobalFunctionsAndExtensions.swift @@ -32,28 +32,13 @@ extension Calendar { func startOfMonth(for date: Date) -> Date? { - if #available(iOS 10.0, *) { - guard let interval = self.dateInterval(of: .month, for: date) else { return nil } - return interval.start - } else { - guard let comp = dateFormatterComponents(from: date) else { return nil } - return Calendar.formatter.date(from: "\(comp.year) \(comp.month) 01") - } + guard let interval = self.dateInterval(of: .month, for: date) else { return nil } + return interval.start } func endOfMonth(for date: Date) -> Date? { - if #available(iOS 10.0, *) { - guard let interval = self.dateInterval(of: .month, for: date) else { return nil } - return self.date(byAdding: DateComponents(day: -1), to: interval.end) - } else { - guard - let comp = dateFormatterComponents(from: date), - let day = self.range(of: .day, in: .month, for: date)?.count, - let retVal = Calendar.formatter.date(from: "\(comp.year) \(comp.month) \(day)") else { - return nil - } - return retVal - } + guard let interval = self.dateInterval(of: .month, for: date) else { return nil } + return self.date(byAdding: DateComponents(day: -1), to: interval.end) } private func dateFormatterComponents(from date: Date) -> (month: Int, year: Int)? { diff --git a/Sources/InternalActionFunctions.swift b/Sources/InternalActionFunctions.swift index f2cde329..8da887b2 100644 --- a/Sources/InternalActionFunctions.swift +++ b/Sources/InternalActionFunctions.swift @@ -56,10 +56,7 @@ extension JTAppleCalendarView { minimumLineSpacing = newLayout.minimumLineSpacing minimumInteritemSpacing = newLayout.minimumInteritemSpacing - - if #available(iOS 9.0, *) { - transform.a = semanticContentAttribute == .forceRightToLeft ? -1 : 1 - } + transform.a = semanticContentAttribute == .forceRightToLeft ? -1 : 1 super.dataSource = self super.delegate = self diff --git a/Sources/JTAppleCalendarVariables.swift b/Sources/JTAppleCalendarVariables.swift index 547485ea..9a5ada46 100644 --- a/Sources/JTAppleCalendarVariables.swift +++ b/Sources/JTAppleCalendarVariables.swift @@ -63,7 +63,7 @@ extension JTAppleCalendarView { var monthInfo: [Month] { get { return theData.months } - set { theData.months = monthInfo } + set { theData.months = newValue } } var numberOfMonths: Int { diff --git a/Sources/JTAppleCalendarView.swift b/Sources/JTAppleCalendarView.swift index cdad3c1b..68fedb4a 100644 --- a/Sources/JTAppleCalendarView.swift +++ b/Sources/JTAppleCalendarView.swift @@ -161,7 +161,7 @@ open class JTAppleCalendarView: UICollectionView { var monthMap: [Int: Int] { get { return theData.sectionToMonthMap } - set { theData.sectionToMonthMap = monthMap } + set { theData.sectionToMonthMap = newValue } } var decelerationRateMatchingScrollingMode: CGFloat { @@ -193,13 +193,9 @@ extension JTAppleCalendarView { /// A semantic description of the view’s contents, used to determine whether the view should be flipped when switching between left-to-right and right-to-left layouts. open override var semanticContentAttribute: UISemanticContentAttribute { didSet { - if #available(iOS 10.0, tvOS 10.0, *) { - var superviewIsRTL = false - if let validSuperView = superview?.effectiveUserInterfaceLayoutDirection { superviewIsRTL = validSuperView == .rightToLeft && semanticContentAttribute == .unspecified } - transform.a = semanticContentAttribute == .forceRightToLeft || superviewIsRTL ? -1: 1 - } else { - transform.a = semanticContentAttribute == .forceRightToLeft ? -1 : 1 - } + var superviewIsRTL = false + if let validSuperView = superview?.effectiveUserInterfaceLayoutDirection { superviewIsRTL = validSuperView == .rightToLeft && semanticContentAttribute == .unspecified } + transform.a = semanticContentAttribute == .forceRightToLeft || superviewIsRTL ? -1: 1 } } } diff --git a/Sources/UICollectionViewDelegates.swift b/Sources/UICollectionViewDelegates.swift index 601b1c94..49a7652b 100644 --- a/Sources/UICollectionViewDelegates.swift +++ b/Sources/UICollectionViewDelegates.swift @@ -35,9 +35,7 @@ extension JTAppleCalendarView: UICollectionViewDelegate, UICollectionViewDataSou } let headerView = delegate.calendar(self, headerViewForDateRange: validDate.range, at: indexPath) - if #available(iOS 9.0, *) { - headerView.transform.a = semanticContentAttribute == .forceRightToLeft ? -1 : 1 - } + headerView.transform.a = semanticContentAttribute == .forceRightToLeft ? -1 : 1 return headerView } @@ -65,10 +63,7 @@ extension JTAppleCalendarView: UICollectionViewDelegate, UICollectionViewDataSou let configuredCell = delegate.calendar(self, cellForItemAt: cellState.date, cellState: cellState, indexPath: indexPath) pathsToReload.remove(indexPath) - - if #available(iOS 9.0, *) { - configuredCell.transform.a = semanticContentAttribute == .forceRightToLeft ? -1 : 1 - } + configuredCell.transform.a = semanticContentAttribute == .forceRightToLeft ? -1 : 1 return configuredCell }