Open docash59 opened 5 years ago
This issue happens to me just sometimes, not yet sure why. I am using carthage btw.
Same for me - tapping the ( X ) does nothing, same with the other buttons. It looks like the BLTNItemManager
is nil
at the moment the ( X ) is being pressed, and thus the view can't be dismissed.
It is a common error for people who use the library: you need to retain the manager as a property, usually on the view controller that presents it.
Another possibility... If you are overriding the setUp
method, make sure you call super.setUp()
or [super setUp]
. This is where the action button gets wired up and if you forget to call the super method it doesn't work.
Understood thank you. Have tried again and the BLTNBoard
now works, thank you!
Can you expand on what you mean by "you need to retain the manager as a property, usually on the view controller that presents it."? Can you give some example code. I've tried doing the following on the presenting viewcontroller but that doesn't fix it. Not sure how else to do it? lazy var bulletinManager: BLTNItemManager = { let introPage = BulletinDataSource.makeIntroPage() let manager = introPage.manager return BLTNItemManager(rootItem: introPage) }()
Follow on from the above comment, this is the code of the root item: static func makeIntroPage() -> BLTNPageItem {
let page = BLTNPageItem(title: "Boost your creativity and improve your writing ability")
page.appearance.titleTextColor = UIColor(red: 34/256, green: 34/256, blue: 34/256, alpha: 1)
page.appearance.titleFontSize = 25
page.descriptionText = "Daily Prompt helps you get into the habit of creating beautiful works of art every day.\n\n\n\n"
page.actionButtonTitle = "Continue"
page.appearance.actionButtonColor = UIColor(red: 111/256, green: 101/256, blue: 215/256, alpha: 1)
page.appearance.actionButtonFontSize = 22
page.isDismissable = false
page.actionHandler = { item in
item.manager?.displayNextItem()
}
page.next = newPromptdaily()
return page
}
Problem Description: The action buttons/handlers do not work.
Steps to reproduce:
@import BLTNBoard
Allow
on theBulletinBoard
Environment: