@@ -13,6 +13,32 @@ class DashboardPromptsCardCell: UICollectionViewCell, Reusable {
1313 }
1414 }
1515
16+ // This is public so it can be accessed from the BloggingPromptsFeatureDescriptionView.
17+ lazy var cardFrameView : BlogDashboardCardFrameView = {
18+ let frameView = BlogDashboardCardFrameView ( )
19+ frameView. translatesAutoresizingMaskIntoConstraints = false
20+ frameView. title = Strings . cardFrameTitle
21+ frameView. icon = Style . frameIconImage
22+
23+ // NOTE: Remove the logic for iOS 13 once we drop that version.
24+ if #available ( iOS 14 . 0 , * ) {
25+ // assign an empty closure so the button appears.
26+ frameView. onEllipsisButtonTap = { }
27+ frameView. ellipsisButton. showsMenuAsPrimaryAction = true
28+ frameView. ellipsisButton. menu = contextMenu
29+ } else {
30+ // Show a fallback implementation using `MenuSheetViewController`.
31+ // iOS 13 doesn't support showing UIMenu programmatically.
32+ frameView. onEllipsisButtonTap = { [ weak self] in
33+ self ? . showMenuSheet ( )
34+ }
35+ }
36+
37+ return frameView
38+ } ( )
39+
40+ // MARK: - Private Properties
41+
1642 /// When set to true, a "default" version of the card is displayed. That is:
1743 /// - `maxAvatarCount` number of avatars.
1844 /// - `maxAvatarCount` answer count.
@@ -25,8 +51,6 @@ class DashboardPromptsCardCell: UICollectionViewCell, Reusable {
2551 }
2652 }
2753
28- // MARK: - Private Properties
29-
3054 // Used to present the menu sheet for contextual menu.
3155 // NOTE: Remove this once we drop support for iOS 13.
3256 private weak var presenterViewController : BlogDashboardViewController ? = nil
@@ -39,29 +63,6 @@ class DashboardPromptsCardCell: UICollectionViewCell, Reusable {
3963 return stackView
4064 } ( )
4165
42- private lazy var cardFrameView : BlogDashboardCardFrameView = {
43- let frameView = BlogDashboardCardFrameView ( )
44- frameView. translatesAutoresizingMaskIntoConstraints = false
45- frameView. title = Strings . cardFrameTitle
46- frameView. icon = Style . frameIconImage
47-
48- // NOTE: Remove the logic for iOS 13 once we drop that version.
49- if #available ( iOS 14 . 0 , * ) {
50- // assign an empty closure so the button appears.
51- frameView. onEllipsisButtonTap = { }
52- frameView. ellipsisButton. showsMenuAsPrimaryAction = true
53- frameView. ellipsisButton. menu = contextMenu
54- } else {
55- // Show a fallback implementation using `MenuSheetViewController`.
56- // iOS 13 doesn't support showing UIMenu programmatically.
57- frameView. onEllipsisButtonTap = { [ weak self] in
58- self ? . showMenuSheet ( )
59- }
60- }
61-
62- return frameView
63- } ( )
64-
6566 // MARK: Top row views
6667
6768 private lazy var promptLabel : UILabel = {
0 commit comments