{"action":"created","issue":{"url":"https://api.github.com/repos/Daltron/NotificationBanner/issues/10","repository_url":"https://api.github.com/repos/Daltron/NotificationBanner","labels_url":"https://api.github.com/repos/Daltron/NotificationBanner/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/Daltron/NotificationBanner/issues/10/comments","events_url":"https://api.github.com/repos/Daltron/NotificationBanner/issues/10/events","html_url":"https://github.com/Daltron/NotificationBanner/issues/10","id":227631007,"number":10,"title":"Title label gets truncated instead of scrolling with custom duration","user":{"login":"egenvall","id":3669105,"avatar_url":"https://avatars3.githubusercontent.com/u/3669105?v=3","gravatar_id":"","url":"https://api.github.com/users/egenvall","html_url":"https://github.com/egenvall","followers_url":"https://api.github.com/users/egenvall/followers","following_url":"https://api.github.com/users/egenvall/following{/other_user}","gists_url":"https://api.github.com/users/egenvall/gists{/gist_id}","starred_url":"https://api.github.com/users/egenvall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egenvall/subscriptions","organizations_url":"https://api.github.com/users/egenvall/orgs","repos_url":"https://api.github.com/users/egenvall/repos","events_url":"https://api.github.com/users/egenvall/events{/privacy}","received_events_url":"https://api.github.com/users/egenvall/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-10T10:13:18Z","updated_at":"2017-05-11T02:19:55Z","closed_at":null,"body":"The titlelabel of a NotificationBanner does not scroll if a custom duration is set for the banner, instead it gets truncated at the end.\r\nI didn't check for the subtitle or status banner.\r\n\r\n     func successNotificationBanner(_ text: String, subtitle: String){\r\n        showBanner(NotificationBanner(title: text, subtitle: subtitle, style: .success))\r\n    }\r\n\r\n    private func showBanner(_ banner: BaseNotificationBanner){\r\n        //banner.duration = 2.5 <- Won't scroll with this set\r\n        banner.show()\r\n    }\r\n\r\nCalled as\r\n\r\n    successNotificationBanner( * Really long text here * , subtitle: *Subtitle here*)\r\n\r\n\r\nAlso won't scroll doing it the standard way\r\n\r\n    let banner = NotificationBanner(title: *etc..*, subtitle: *sub*, style: .success)\r\n    banner.duration = 2.5\r\n    banner.show()\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Daltron/NotificationBanner/issues/comments/300664154","html_url":"https://github.com/Daltron/NotificationBanner/issues/10#issuecomment-300664154","issue_url":"https://api.github.com/repos/Daltron/NotificationBanner/issues/10","id":300664154,"user":{"login":"Daltron","id":9689335,"avatar_url":"https://avatars2.githubusercontent.com/u/9689335?v=3","gravatar_id":"","url":"https://api.github.com/users/Daltron","html_url":"https://github.com/Daltron","followers_url":"https://api.github.com/users/Daltron/followers","following_url":"https://api.github.com/users/Daltron/following{/other_user}","gists_url":"https://api.github.com/users/Daltron/gists{/gist_id}","starred_url":"https://api.github.com/users/Daltron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daltron/subscriptions","organizations_url":"https://api.github.com/users/Daltron/orgs","repos_url":"https://api.github.com/users/Daltron/repos","events_url":"https://api.github.com/users/Daltron/events{/privacy}","received_events_url":"https://api.github.com/users/Daltron/received_events","type":"User","site_admin":false},"created_at":"2017-05-11T02:19:55Z","updated_at":"2017-05-11T02:19:55Z","body":"Hi @egenvall! 😄 \r\n\r\nSo the problem you are running into is actually by design and expected. When the duration is set, the `didSet` method calls this:\r\n\r\n```swift\r\n/**\r\n    Updates the scrolling marquee label duration\r\n*/\r\ninternal func updateMarqueeLabelsDurations() {\r\n    titleLabel?.speed = .duration(CGFloat(duration - 3))\r\n}\r\n```\r\n\r\nThe problem is the duration you are setting is not greater than 3, thus causing the label to have a speed duration less than or equal to zero. Based on my findings when I first designed this, I decided to subtract 3 from the duration given because it provides the optimal user experience. We want the banner to stop for a moment before dismissing. With a duration of 2.5 you gave, there simply isn't enough time to scroll all the way to the end and pause momentarily. Let me know if you have any more questions as I will be glad to answer them!\r\n\r\nThanks!"}}
{"actor":{"display_login":"Daltron"}}