Skip to content

Commit

Permalink
Merge pull request #593 from bertugyilmaz/feature/add-content-interac…
Browse files Browse the repository at this point in the history
…tion-option

Added contentInteraction property into pagingOptions
  • Loading branch information
rechsteiner committed Sep 18, 2021
2 parents 60b4096 + f497835 commit 843bbb3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Parchment/Classes/PagingOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public struct PagingOptions {
/// Determine how users can interact with the menu items.
/// _Default: .scrolling_
public var menuInteraction: PagingMenuInteraction

/// Determine how users can interact with the contents
/// _Default: .scrolling_
public var contentInteraction: PagingContentInteraction

/// The class type for collection view layout. Override this if you
/// want to use your own subclass of the layout. Setting this
Expand Down Expand Up @@ -182,5 +186,6 @@ public struct PagingOptions {
borderColor = UIColor(white: 0.9, alpha: 1)
indicatorColor = UIColor(red: 3 / 255, green: 125 / 255, blue: 233 / 255, alpha: 1)
contentNavigationOrientation = .horizontal
contentInteraction = .scrolling
}
}
10 changes: 6 additions & 4 deletions Parchment/Classes/PagingViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,12 @@ open class PagingViewController:

/// Determine how users can interact with the page view controller.
/// _Default: .scrolling_
public var contentInteraction: PagingContentInteraction = .scrolling {
didSet {
configureContentInteraction()
}
public var contentInteraction: PagingContentInteraction {
get { return options.contentInteraction }
set {
options.contentInteraction = newValue
configureContentInteraction()
}
}

/// The current state of the menu items. Indicates whether an item
Expand Down

0 comments on commit 843bbb3

Please sign in to comment.