alexaubry / alexaubry/BulletinBoard
Provide a mechanism to pop the current card or dismiss the manager
- 主要言語
- Swift
- スター
- 5.3k
- フォーク
- 301
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
I have a couple of Bulletin Board pages that can be used either standalone, or be pushed from another page. When they are used as standalone pages, the action buttons must trigger dismissBulletin() and when they are pushed from another page, the action buttons may trigger either popItem() or dismissBulletin()
Unfortunately, BLTNItemManager declares many of its internal variables as fileprivate so I can't access itemStack, currentItem, or rootItem (and can't get at them via extension).
I can think of a couple of ways to skin this beast:
- remove fileprivate from rootItem or itemsStack
- add ````manager?.isRootItem()```` which returns (currentItem == rootItem)
- add ````manager?.positionInStack()```` which returns itemsStack.index(of: currentItem), requires implementing Equatable for BLTNItem
- add ````manager?.popOrDismissBulletin(animated:)````
I'd be happy to submit a PR if you have a preferred mechanism.
コントリビューションガイド
評価
この issue はまだ評価されていません。