diff --git a/.swift-version b/.swift-version index 760606e1..95ee81a4 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -5.7 +5.9 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f7112aa..699f7237 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ `Parchment` adheres to [Semantic Versioning](http://semver.org/). +## [3.3.0](https://github.com/rechsteiner/Parchment/compare/v3.2.1...v3.3.0) - 2024-02-17 + +- Set minimum deployment target to iOS 12 #699 +- Add privacy manifest file #695 +- Update Swift version to 5.9 #700 + ## [3.2.1](https://github.com/rechsteiner/Parchment/compare/v3.2.0...v3.2.1) - 2023-03-07 ### Fixes diff --git a/Example/Examples/Calendar/CalendarViewController.swift b/Example/Examples/Calendar/CalendarViewController.swift index a6a02204..827bb438 100644 --- a/Example/Examples/Calendar/CalendarViewController.swift +++ b/Example/Examples/Calendar/CalendarViewController.swift @@ -22,10 +22,12 @@ struct CalendarItem: PagingItem, Hashable, Comparable { } class CalendarViewController: UIViewController { + private let calendar: Calendar = .current + private let pagingViewController = PagingViewController() + override func viewDidLoad() { super.viewDidLoad() - let pagingViewController = PagingViewController() pagingViewController.register(CalendarPagingCell.self, for: CalendarItem.self) pagingViewController.menuItemSize = .fixed(width: 48, height: 58) pagingViewController.textColor = UIColor.gray @@ -40,8 +42,20 @@ class CalendarViewController: UIViewController { // Set our custom data source pagingViewController.infiniteDataSource = self - // Set the current date as the selected paging item - pagingViewController.select(pagingItem: CalendarItem(date: Date())) + // Set the current date as the selected paging item. + let today = calendar.startOfDay(for: Date()) + pagingViewController.select(pagingItem: CalendarItem(date: today)) + + navigationItem.rightBarButtonItem = UIBarButtonItem( + title: "Today", + style: .plain, + target: self, + action: #selector(selectToday)) + } + + @objc private func selectToday() { + let date = calendar.startOfDay(for: Date()) + pagingViewController.select(pagingItem: CalendarItem(date: date), animated: true) } } @@ -54,12 +68,14 @@ class CalendarViewController: UIViewController { extension CalendarViewController: PagingViewControllerInfiniteDataSource { func pagingViewController(_: PagingViewController, itemAfter pagingItem: PagingItem) -> PagingItem? { let calendarItem = pagingItem as! CalendarItem - return CalendarItem(date: calendarItem.date.addingTimeInterval(86400)) + let nextDate = calendar.date(byAdding: .day, value: 1, to: calendarItem.date)! + return CalendarItem(date: nextDate) } func pagingViewController(_: PagingViewController, itemBefore pagingItem: PagingItem) -> PagingItem? { let calendarItem = pagingItem as! CalendarItem - return CalendarItem(date: calendarItem.date.addingTimeInterval(-86400)) + let previousDate = calendar.date(byAdding: .day, value: -1, to: calendarItem.date)! + return CalendarItem(date: previousDate) } func pagingViewController(_: PagingViewController, viewControllerFor pagingItem: PagingItem) -> UIViewController { diff --git a/Package.swift b/Package.swift index 026f2451..f16a22a4 100644 --- a/Package.swift +++ b/Package.swift @@ -1,16 +1,19 @@ -// swift-tools-version:5.7 +// swift-tools-version:5.9 import PackageDescription let package = Package( name: "Parchment", - platforms: [.iOS(.v11)], + platforms: [.iOS(.v12)], products: [ .library(name: "Parchment", targets: ["Parchment"]), ], targets: [ .target( name: "Parchment", - path: "Parchment" + path: "Parchment", + resources: [ + .copy("PrivacyInfo.xcprivacy") + ] ) ] ) diff --git a/Parchment.podspec.json b/Parchment.podspec.json index 2e0d0eb3..22ea8413 100644 --- a/Parchment.podspec.json +++ b/Parchment.podspec.json @@ -1,20 +1,18 @@ { "name": "Parchment", - "version": "3.2.1", + "version": "3.3.0", "license": "MIT", "summary": "A flexible paging menu controller with support for infinite data sources.", "description": "Parchment allows you to page between view controllers while showing menu items that scrolls along with the content. It’s build to be very customizable, it’s well-tested and written fully in Swift.", "homepage": "https://github.com/rechsteiner/Parchment", - "authors": { - "Martin Rechsteiner": "marrechsteiner@gmail.com" - }, - "social_media_url": "http://twitter.com/rechsteiner", + "authors": "Martin Rechsteiner", "source": { "git": "https://github.com/rechsteiner/Parchment.git", - "tag": "v3.2.1" + "tag": "v3.3.0" }, + "swift_version": "5.9", "platforms": { - "ios": "11.0" + "ios": "12.0" }, "source_files": [ "Parchment/**/*.swift", diff --git a/Parchment.xcodeproj/project.pbxproj b/Parchment.xcodeproj/project.pbxproj index e2effd05..3cd70d92 100644 --- a/Parchment.xcodeproj/project.pbxproj +++ b/Parchment.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 53; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -142,6 +142,7 @@ 95D790182299D57A00E6EE7C /* PagingMenuDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95D790172299D57A00E6EE7C /* PagingMenuDelegate.swift */; }; 95E4BA701FF15E84008871A3 /* PagingViewControllerDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95E4BA6F1FF15E84008871A3 /* PagingViewControllerDataSource.swift */; }; 95E4BA721FF15EFE008871A3 /* PagingFiniteDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95E4BA711FF15EFE008871A3 /* PagingFiniteDataSource.swift */; }; + 95ED82642B5056AC0055227B /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 95ED82632B5056AC0055227B /* PrivacyInfo.xcprivacy */; }; 95F5660F2128707900F2A75E /* PagingMenuItemSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9D1BE1D211E409400E86B72 /* PagingMenuItemSource.swift */; }; 95F83D6426237D2B003B728F /* SelectedIndexView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95F83D6326237D2B003B728F /* SelectedIndexView.swift */; }; 95F83D6C26237DA4003B728F /* LifecycleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95F83D6B26237DA4003B728F /* LifecycleView.swift */; }; @@ -358,6 +359,7 @@ 95D790172299D57A00E6EE7C /* PagingMenuDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PagingMenuDelegate.swift; sourceTree = ""; }; 95E4BA6F1FF15E84008871A3 /* PagingViewControllerDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PagingViewControllerDataSource.swift; sourceTree = ""; }; 95E4BA711FF15EFE008871A3 /* PagingFiniteDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PagingFiniteDataSource.swift; sourceTree = ""; }; + 95ED82632B5056AC0055227B /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; 95F83D6326237D2B003B728F /* SelectedIndexView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectedIndexView.swift; sourceTree = ""; }; 95F83D6B26237DA4003B728F /* LifecycleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LifecycleView.swift; sourceTree = ""; }; 95F83D822623804F003B728F /* DynamicItemsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DynamicItemsView.swift; sourceTree = ""; }; @@ -542,6 +544,7 @@ children = ( 3E49C71D1C8F5ABD006269DD /* Parchment.h */, 3EC0184C1C95F993005421AD /* Info.plist */, + 95ED82632B5056AC0055227B /* PrivacyInfo.xcprivacy */, 3E4090A31C88BD1700800E22 /* Classes */, 3E4090951C88BC9100800E22 /* Enums */, 3EA04A701C53C0640054E5E0 /* Extensions */, @@ -931,7 +934,7 @@ attributes = { BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 1130; - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1520; ORGANIZATIONNAME = "Martin Rechsteiner"; TargetAttributes = { 3E504EC31C7465B000AE1CE3 = { @@ -997,6 +1000,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 95ED82642B5056AC0055227B /* PrivacyInfo.xcprivacy in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1323,6 +1327,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -1337,7 +1342,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -1383,6 +1388,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -1391,7 +1397,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; @@ -1419,7 +1425,7 @@ FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Parchment/Resources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1450,7 +1456,7 @@ FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Parchment/Resources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/Parchment.xcodeproj/xcshareddata/xcschemes/Example.xcscheme b/Parchment.xcodeproj/xcshareddata/xcschemes/Example.xcscheme index bafc29b0..d55f916b 100644 --- a/Parchment.xcodeproj/xcshareddata/xcschemes/Example.xcscheme +++ b/Parchment.xcodeproj/xcshareddata/xcschemes/Example.xcscheme @@ -1,6 +1,6 @@ + + + + NSPrivacyCollectedDataTypes + + + NSPrivacyCollectedDataType + + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + + + + + NSPrivacyTracking + + + diff --git a/README.md b/README.md index 3fa2471d..99a7e5f9 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,6 @@ Parchment lets you page between view controllers while showing any type of gener - [Reloading data](#reloading-data) - [Delegate](#delegate) - [Size delegate](#size-delegate) - - [Selecting items](#selecting-items) - [Customization](#customization) - [Options](#options) - [Installation](#installation) @@ -613,7 +612,7 @@ Parchment will be compatible with the lastest public release of Swift. ### Requirements -- iOS 11.0+ +- iOS 12.0+ - Xcode 14.0+ ### CocoaPods