alexisakers / BulletinBoard

General-purpose contextual cards for iOS
MIT License
5.38k stars 304 forks source link

iPad Does not Dismiss View #125

Open reggatta opened 6 years ago

reggatta commented 6 years ago

**Problem Description: When I present the popup on an iPad I can't close it.

**Steps to reproduce: Run the app on an iPad and present a page. There is no way to close the page. I have isDismissable set to TRUE. It may be something dumb I am doing, not sure.

**Environment:

alexisakers commented 6 years ago

Hey! On iPad you can tap outside of the view to dismiss the bulletin (there is no "swipe to dismiss"). Can you do this?

If not, could you share the code you use to setup the item so we can figure it out?

reggatta commented 6 years ago

Alexis:

Thanks for your interest. I was not able to dismiss the view no matter what I did. At first I thought it was just an iPad thing as it seemed to work fine on the phone, but then it got worse somehow.

I stepped through the code and it looked like the manager variable was getting set to nil somehow, so when the code tried to dismiss the view, it could not. I changed a line of code in your BulletinViewController.swift file to remove the weak attribute on the manager variable like shown below. This seemed to do the trick. It might be that I am not using your library properly, I am using Objective-C.

final class BulletinViewController: UIViewController, UIGestureRecognizerDelegate {

    /// The object managing the view controller.
    var manager: BLTNItemManager?
    // PGB Old code below
    // weak var manager:BLTNItemManager?

Let me know if you need anymore info. I really like your code.

Cheers,

Peter

reggatta commented 5 years ago

Alexis:

I just updated all my pods, and the code I had added to fix this original problem was overwritten, so I had to dig through your code and make some changes again. Please know that I am calling your code from Objective-C. I have attached an updated version of your BulletinViewController.swift with my two changes. Just search the file for REGGATTA, and you’ll see the changes I made. I am not sure why the changes work, I just know that they do, at least as I use your code in my application. Let me know if I can be of further assistance, and thanks for writing such a useful component.

Cheers,

Peter Blair

On Oct 17, 2018, at 3:14 AM, Alexis Aubry notifications@github.com<mailto:notifications@github.com> wrote:

Hey! On iPad you can tap outside of the view to dismiss the bulletin (there is no "swipe to dismiss"). Can you do this?

If not, could you share the code you use to setup the item so we can figure it out?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/alexaubry/BulletinBoard/issues/125#issuecomment-430572257, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHPB8bXcB1-LBUlyen1n29Q6IY8UpT5Mks5ulwMIgaJpZM4XX3vP.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/alexaubry/BulletinBoard","title":"alexaubry/BulletinBoard","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/alexaubry/BulletinBoard"}},"updates":{"snippets":[{"icon":"PERSON","message":"@alexaubry in #125: Hey! On iPad you can tap outside of the view to dismiss the bulletin (there is no \"swipe to dismiss\"). Can you do this? \r\n\r\nIf not, could you share the code you use to setup the item so we can figure it out?"}],"action":{"name":"View Issue","url":"https://github.com/alexaubry/BulletinBoard/issues/125#issuecomment-430572257"}}} [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/alexaubry/BulletinBoard/issues/125#issuecomment-430572257", "url": "https://github.com/alexaubry/BulletinBoard/issues/125#issuecomment-430572257", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } }, { "@type": "MessageCard", "@context": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB", "title": "Re: [alexaubry/BulletinBoard] iPad Does not Dismiss View (#125)", "sections": [ { "text": "", "activityTitle": "Alexis Aubry", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": "@alexaubry", "facts": [ ] } ], "potentialAction": [ { "name": "Add a comment", "@type": "ActionCard", "inputs": [ { "isMultiLine": true, "@type": "TextInput", "id": "IssueComment", "isRequired": false } ], "actions": [ { "name": "Comment", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"alexaubry/BulletinBoard\",\n\"issueId\": 125,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}" } ] }, { "name": "Close issue", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"alexaubry/BulletinBoard\",\n\"issueId\": 125\n}" }, { "targets": [ { "os": "default", "uri": "https://github.com/alexaubry/BulletinBoard/issues/125#issuecomment-430572257" } ], "@type": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 392133583\n}" } ], "themeColor": "26292E" } ]