Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into 4.0
Browse files Browse the repository at this point in the history
Conflicts:
	Parchment.xcodeproj/project.pbxproj
	Parchment.xcodeproj/xcshareddata/xcschemes/Example.xcscheme
	Parchment.xcodeproj/xcshareddata/xcschemes/ExampleSwiftUI.xcscheme
	Parchment.xcodeproj/xcshareddata/xcschemes/Parchment.xcscheme
	README.md
  • Loading branch information
rechsteiner committed Feb 17, 2024
2 parents bae5e44 + 7caeb06 commit 57a2144
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.7
5.9
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 21 additions & 5 deletions Example/Examples/Calendar/CalendarViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
}

Expand All @@ -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 {
Expand Down
9 changes: 6 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -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")
]
)
]
)
12 changes: 5 additions & 7 deletions Parchment.podspec.json
Original file line number Diff line number Diff line change
@@ -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": "[email protected]"
},
"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",
Expand Down
18 changes: 12 additions & 6 deletions Parchment.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 53;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -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 */; };
Expand Down Expand Up @@ -358,6 +359,7 @@
95D790172299D57A00E6EE7C /* PagingMenuDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PagingMenuDelegate.swift; sourceTree = "<group>"; };
95E4BA6F1FF15E84008871A3 /* PagingViewControllerDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PagingViewControllerDataSource.swift; sourceTree = "<group>"; };
95E4BA711FF15EFE008871A3 /* PagingFiniteDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PagingFiniteDataSource.swift; sourceTree = "<group>"; };
95ED82632B5056AC0055227B /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
95F83D6326237D2B003B728F /* SelectedIndexView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectedIndexView.swift; sourceTree = "<group>"; };
95F83D6B26237DA4003B728F /* LifecycleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LifecycleView.swift; sourceTree = "<group>"; };
95F83D822623804F003B728F /* DynamicItemsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DynamicItemsView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -542,6 +544,7 @@
children = (
3E49C71D1C8F5ABD006269DD /* Parchment.h */,
3EC0184C1C95F993005421AD /* Info.plist */,
95ED82632B5056AC0055227B /* PrivacyInfo.xcprivacy */,
3E4090A31C88BD1700800E22 /* Classes */,
3E4090951C88BC9100800E22 /* Enums */,
3EA04A701C53C0640054E5E0 /* Extensions */,
Expand Down Expand Up @@ -931,7 +934,7 @@
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1130;
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1520;
ORGANIZATIONNAME = "Martin Rechsteiner";
TargetAttributes = {
3E504EC31C7465B000AE1CE3 = {
Expand Down Expand Up @@ -997,6 +1000,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
95ED82642B5056AC0055227B /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1520"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1520"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1520"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
23 changes: 23 additions & 0 deletions Parchment/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyCollectedDataTypes</key>
<array>
<dict>
<key>NSPrivacyCollectedDataType</key>
<string></string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<false/>
<key>NSPrivacyCollectedDataTypeTracking</key>
<false/>
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string></string>
</array>
</dict>
</array>
<key>NSPrivacyTracking</key>
<false/>
</dict>
</plist>
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 57a2144

Please sign in to comment.