diff --git a/.travis.yml b/.travis.yml index 456de05..b25e707 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: swift -osx_image: xcode11.3 +osx_image: xcode12 script: - swift package generate-xcodeproj - xcodebuild clean test -destination 'name=iPhone 8' -scheme AdvancedList-Package -enableCodeCoverage YES -derivedDataPath .build/derivedData -quiet diff --git a/Package.swift b/Package.swift index dfb9074..2afc314 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.1 +// swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription diff --git a/README.md b/README.md index b8fdf16..ab860e8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # AdvancedList -[![Swift 5](https://img.shields.io/badge/swift-5-green.svg?longCache=true&style=flat-square)](https://developer.apple.com/swift) +[![Swift 5.3](https://img.shields.io/badge/swift-5.3-green.svg?longCache=true&style=flat-square)](https://developer.apple.com/swift) [![Platforms](https://img.shields.io/badge/platform-iOS%20%7C%20macOS%20%7C%20tvOS-lightgrey.svg?longCache=true&style=flat-square)](https://www.apple.com) [![Current version](https://img.shields.io/github/v/tag/crelies/AdvancedList?longCache=true&style=flat-square)](https://github.com/crelies/AdvancedList) [![Build status](https://travis-ci.com/crelies/AdvancedList.svg?token=THnaziKxRFFz1nKcsPgz&branch=dev)](https://travis-ci.com/crelies/AdvancedList) @@ -148,7 +148,10 @@ AdvancedList(yourData, content: { item in For more examples take a look at [AdvancedList-SwiftUI](https://github.com/crelies/AdvancedList-SwiftUI). -## Migration 2.x -> 3.0 +## Migration + +
+Migration 2.x -> 3.0 The `AdvancedList` was dramatically simplified and is now more like the `List` and `ForEach` SwiftUI views. @@ -158,6 +161,7 @@ The `AdvancedList` was dramatically simplified and is now more like the `List` a 4. **Move and delete:** Instead of setting `AdvancedListActions` on your list service just pass a `onMoveAction` and/or `onDeleteAction` block to the initializer **Before:** + ```swift import AdvancedList @@ -193,6 +197,7 @@ listService.listState = .items ``` **After:** + ```swift import AdvancedList @@ -221,12 +226,15 @@ AdvancedList(yourData, content: { item in Text("Loading ...") }, pagination: .noPagination) ``` +
-## Migration 3.0 -> 4.0 +
+Migration 3.0 -> 4.0 Thanks to a hint from @SpectralDragon I could refactor the `onMove` and `onDelete` functionality to view modifiers. **Before:** + ```swift import AdvancedList @@ -257,6 +265,7 @@ AdvancedList(yourData, content: { item in ``` **After:** + ```swift import AdvancedList @@ -287,3 +296,4 @@ AdvancedList(yourData, content: { item in // delete me } ``` +
diff --git a/Sources/AdvancedList/public/Views/AdvancedList.swift b/Sources/AdvancedList/public/Views/AdvancedList.swift index 98e4130..08c63b7 100644 --- a/Sources/AdvancedList/public/Views/AdvancedList.swift +++ b/Sources/AdvancedList/public/Views/AdvancedList.swift @@ -41,7 +41,8 @@ public struct AdvancedList