{"id":22192526,"url":"https://github.com/3sidedcube/messagestackview","last_synced_at":"2026-02-07T00:35:39.176Z","repository":{"id":46159609,"uuid":"224210096","full_name":"3sidedcube/MessageStackView","owner":"3sidedcube","description":"Wrapper of a UIStackView for posting and removing messages.","archived":false,"fork":false,"pushed_at":"2024-09-07T14:23:13.000Z","size":1608,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-12-02T12:29:36.265Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/3sidedcube.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-26T14:22:23.000Z","updated_at":"2021-10-06T16:06:33.000Z","dependencies_parsed_at":"2024-12-02T12:39:57.048Z","dependency_job_id":null,"html_url":"https://github.com/3sidedcube/MessageStackView","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3sidedcube%2FMessageStackView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3sidedcube%2FMessageStackView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3sidedcube%2FMessageStackView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3sidedcube%2FMessageStackView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3sidedcube","download_url":"https://codeload.github.com/3sidedcube/MessageStackView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236280907,"owners_count":19123647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-02T12:25:46.282Z","updated_at":"2025-10-12T23:30:18.063Z","avatar_url":"https://github.com/3sidedcube.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Example\n\nThis is an example of posting a message from the top of the window:\n\n```swift\nUIApplication.shared.postView.post(badgeMessage:\n    BadgeMessage(\n        title: \"This is a window notification\",\n        subtitle: \"This notification has been posted on the key window\",\n        image: UIImage(named: \"donations\"),\n        fillColor: .red\n    )\n)\n```\n    \n![Alt Text](https://github.com/3sidedcube/MessageStackView/blob/develop/Documentation/toastGif.gif)\n\n1. The `BadgeMessage` model defines what the message should look like\n2. A `BadgeMessageView` is created with properties defined by the `BadgeMessage`\n3. The `BadgeMessageView` is posted on a `PostView` on the `keyWindow`\n\nThis `PostView` adds and removes itself from the `keyWindow` dynamically based on what is in its queue.\nSee the Example project for more on what this framework can do! \n\n## Installation\n\n### CocoaPods\n\n[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. To integrate MessageStackView into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\npod 'MessageStackView', :git =\u003e 'https://github.com/3sidedcube/MessageStackView.git', :tag ~\u003e '3.0.0'\n```\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate MessageStackView into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"3sidedcube/MessageStackView\" ~\u003e 3.0.0\n```\n\n### Swift Package Manager\n\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. To integrate MessageStackView into your project using Swift Package Manager, specify it in the `dependencies` of your `Package.swift`:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/3sidedcube/MessageStackView.git\", .upToNextMajor(from: \"3.0.0\"))\n]\n```\n\n## Core Entities\n\n### PostManager\n\nEncaspsulates the logic of when and how `UIView`s should be posted and removed.\n\nInternally `PostManager` handles:\n1. Dismissal `Timer`s which, after a given time, request to remove a previously posted `UIView`\n2. A `PostGestureManager` for gesture related dismissals, e.g. pan.\n3. Serial `Queue` if required\n\n### UIViewPoster\n\nWhile `PostManager` handles the logic of when to post and remove a `UIView`, `UIViewPoster` handles the actual posting and subviews.\nSpecifically, adding and removing the subview to the subview hierarchy, and animating when required.\n\n`PostManager` references a `UIViewPoster` communicating when to post and remove.\nThere are a few common implementations of `UIViewPoster` provided in this framwork.\n\n### PostView\n\nA `UIView` for posting other `UIView`s in a serial manner.\nThe animation of posted `UIView`s is via a `translation` from the top.\n\nCommonly, `PostView` is constrained to the top, leading, trailing edges of a `UIView` e.g. `UIWindow`.\nWhen a subview is posted, the `PostView` constrains its edges to the added subview.\nSo, in this case, a posted `UIView` would define its height either intrinsically or via explicit constraints, with its width determined by the `PostView`.\n\n### MessageStackView\n\nA simple wrapper of a vertical `UIStackView` for posting and removing `UIView`s.\nThese `UIView`s, being a `UIStackView`, are part of the `arrangedSubviews`.\nThe animation of posted `UIView`s is handled via the `UIStackView` by setting `isHidden`.\n    \n## Models\n\n### Message\n\nProperties include:  \n1. `title` -  required  \n2. `subtitle` -  Optional  \n3. `leftImage` - Optional  \n3. `rightImage` - Optional  \n\nA `Message` describes how a `MessageView` should look, which is the view which is posted on the `UIViewPoster`.\n\n### BadgeMessage\n\n`BadgeMessage` is similar to `Message` with an updated design and interface.\n\n## Other\n\n### MessageStackView + Custom View\n  \nThe posted `UIView`s width will be determined by the `UIStackView` as the `distribution` is `fill` and the `UIStackView` axis is `.vertical`.  \nHowever the height of the `UIView` is driven by the `UIView` itself, e.g. autolayout.  \n  \nIf, when posting and removing this `UIView` from the `MessageStackView` you want the animation to be smooth, then consider a \"breakable\" constraint for the height. Since the `UIStackView` will animate the `isHidden` property on the `UIView`, which will set an explict height during animation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3sidedcube%2Fmessagestackview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3sidedcube%2Fmessagestackview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3sidedcube%2Fmessagestackview/lists"}