gitmyhub

SwiftEntryKit

Swift ★ 6.8k updated 2y ago

SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps.

A Swift library for iOS that lets you show banners, toast messages, and pop-ups over your app with a few lines of code, with full control over animation, position, styling, and dismiss behavior.

SwiftiOSCocoaPodsCarthagesetup: easycomplexity 2/5

SwiftEntryKit is a Swift library for iOS that makes it easy to display notifications, alerts, banners, and pop-ups inside your app. Rather than building these interface elements from scratch, you use the library to show what it calls "entries" over your existing screens with minimal setup code.

Entries appear inside a separate window that sits above your app's normal interface. This means the user can still interact with the underlying app while a banner is displayed, rather than being blocked by a modal screen. The library comes with built-in presets for common patterns like toast messages, floating notifications, rating prompts, and form sheets, each of which can be colored and styled to match your app.

Positioning and animation are both configurable. An entry can appear at the top, center, or bottom of the screen, slide in from the side, or fade in. Background styles include solid colors, gradients, blurs, and dimming effects. You can add rounded corners, drop shadows, and borders. Users can dismiss entries with a swipe, and you can configure rubber-banding physics so the entry stretches slightly when the user pulls against it.

For cases where multiple entries might appear at once, the library has a priority and queue system. Each entry has a priority level, and a new entry can either wait in a queue behind the current one, replace it immediately, or be blocked by a higher-priority item. You can also hook into lifecycle events to know when an entry appears or disappears.

The library supports Swift 5 and requires iOS 9 or later and Xcode 9 or later. It can be added to a project through CocoaPods, Carthage, or Accio. It also has Objective-C interoperability, so it can be called from older code that mixes languages. The example project included in the repository has a live playground screen for testing different configurations. The full README is longer than what was shown.

Where it fits