Skip to content

Commit

Permalink
Provided support for iOS 13 Context Menus
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerome Boursier committed Mar 3, 2020
1 parent 191063e commit 92e927a
Show file tree
Hide file tree
Showing 70 changed files with 1,550 additions and 1,327 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ jobs:
name: Cocoapods Lint
# We need to pass all of the podspecs here so that Cocoapods uses the local version,
# rather than searching the specs repository for the other specs in the repo.
script: bundle exec pod lib lint --allow-warnings "--include-podspecs=*.podspec"

script:
- bundle exec pod lib lint IGListDiffKit.podspec --allow-warnings
- bundle exec pod lib lint IGListKit.podspec --allow-warnings "--include-podspecs=IGListDiffKit.podspec"
- bundle exec pod lib lint IGListSwiftKit.podspec --allow-warnings "--include-podspecs=*.podspec"

# Build example projects
- &build-examples
stage: build examples
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ The changelog for `IGListKit`. Also see the [releases](https://github.com/instag
4.1.0 (upcoming release)
-----

### Enhancements

- Introduce `IGListSwiftKit`, with Swift refinements for `dequeueReusableCellOfClass` methods. [Koen Punt](https://github.com/koenpunt) [(#1388)](https://github.com/Instagram/IGListKit/pull/1388).

- Added `APPLICATION_EXTENSION_API_ONLY` support for `IGListDiffKit` [Peter Meyers](https://github.com/pm-dev) [(#1422)](https://github.com/Instagram/IGListKit/pull/1422)

- Added support for iOS 13 Context Menus with `contextMenuConfigurationForItemAt` method. [Jérôme B.](https://github.com/jjbourdev) [(#1430)](https://github.com/Instagram/IGListKit/pull/1430).

4.0.0
-----
### Breaking Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,26 @@ final class MonthSectionController: ListBindingSectionController<ListDiffable>,

func sectionController(_ sectionController: ListBindingSectionController<ListDiffable>, didUnhighlightItemAt index: Int, viewModel: Any) {}

@available(iOS 13.0, *)
func sectionController(_ sectionController: ListBindingSectionController<ListDiffable>, contextMenuConfigurationForItemAt index: Int, point: CGPoint, viewModel: Any) -> UIContextMenuConfiguration? {
return UIContextMenuConfiguration(identifier: nil, previewProvider: nil) { _ in
// Create an action for sharing
let share = UIAction(title: "Share", image: UIImage(systemName: "square.and.arrow.up")) { _ in
// Show share sheet
}

// Create an action for copy
let rename = UIAction(title: "Copy", image: UIImage(systemName: "doc.on.doc")) { _ in
// Perform copy
}

// Create an action for delete with destructive attributes (highligh in red)
let delete = UIAction(title: "Delete", image: UIImage(systemName: "trash"), attributes: .destructive) { _ in
// Perform delete
}

// Create a UIMenu with all the actions as children
return UIMenu(title: "", children: [share, rename, delete])
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,012 changes: 510 additions & 502 deletions Examples/Examples-iOS/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Examples/Examples-macOS/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- IGListDiffKit (4.0.0)
- IGListDiffKit (4.1.0)

DEPENDENCIES:
- IGListDiffKit (from `../../IGListDiffKit.podspec`)
Expand All @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "../../IGListDiffKit.podspec"

SPEC CHECKSUMS:
IGListDiffKit: 665d6cf43ce726e676013db9c7d6c4294259b6b2
IGListDiffKit: 7d70583ef1f7883b23b40a21051844c6036128ca

PODFILE CHECKSUM: a5e65f00463ec091d58ee2241126ab30f6d2ee69

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 92e927a

Please sign in to comment.