Skip to content

Commit 38697f8

Browse files
committed
Adds support for excluded activity types
1 parent 8c47371 commit 38697f8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Sources/ActivityView/ActivityItem.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ public struct ActivityItem {
55

66
internal var items: [Any]
77
internal var activities: [UIActivity]
8+
internal var excludedTypes: [UIActivity.ActivityType]
89

910
/// The
1011
/// - Parameters:
1112
/// - items: The items to share via a `UIActivityViewController`
1213
/// - activities: Custom activities you want to include in the sheet
13-
public init(items: Any..., activities: [UIActivity] = []) {
14+
public init(items: Any..., activities: [UIActivity] = [], excludedTypes: [UIActivity.ActivityType]) {
1415
self.items = items
1516
self.activities = activities
17+
self.excludedTypes = excludedTypes
1618
}
1719

1820
}

Sources/ActivityView/ActivityView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ private final class ActivityViewControllerWrapper: UIViewController {
6969
if item.wrappedValue != nil {
7070
if !isActivityPresented {
7171
let controller = UIActivityViewController(activityItems: item.wrappedValue?.items ?? [], applicationActivities: item.wrappedValue?.activities)
72+
controller.excludedActivityTypes = item.wrappedValue?.excludedTypes
7273
controller.popoverPresentationController?.permittedArrowDirections = permittedArrowDirections
7374
controller.popoverPresentationController?.sourceView = view
7475
controller.completionWithItemsHandler = { [weak self] (activityType, success, items, error) in

0 commit comments

Comments
 (0)