Skip to content

Merge ToastKit features: add attribute-based configuration and enhanced UI capabilities#4

Open
Copilot wants to merge 6 commits intomainfrom
copilot/merge-toastkit-into-toastswift
Open

Merge ToastKit features: add attribute-based configuration and enhanced UI capabilities#4
Copilot wants to merge 6 commits intomainfrom
copilot/merge-toastkit-into-toastswift

Conversation

Copy link

Copilot AI commented Feb 16, 2026

Integrates ToastKit's attribute-based API and UI enhancements into ToastSwift while preserving the existing queue-based management system.

Added Components

  • ToastAttributes - Structured configuration with 18 parameters (insets, colors, fonts, spacing, position, duration)
  • ToastPosition - Enum for .top, .center, .bottom positioning
  • ToastKitView - Enhanced view supporting title+message dual labels and optional interactive button
  • UIView+Toast - Extension for simplified toast display
  • UIColor+Extension - Hex color parsing with validation (#FF5733UIColor)

Usage

New simplified API alongside existing queue-based API:

// New: Attribute-based (ToastKit-inspired)
let attributes = ToastAttributes(
    backgroundColor: .colorWithHexString("#3C3C3E"),
    title: "Success",
    message: "Operation completed",
    showButton: true,
    buttonText: "Undo",
    position: .top
)
view.showToastMessage(with: attributes) {
    // Handle button tap
}

// Existing: Queue-based (ToastSwift original) - still works
let toast = ToastSwift(text: "Hello")
toast.show()

Technical Notes

  • Both APIs functional and can be used together
  • ToastKitView made public with proper encapsulation (private(set) for internal state)
  • Button target fixed (was nil, now self)
  • Hex color validation with black fallback for invalid inputs
  • Memory management: consistent weak self capture in animation chains
  • iOS 12.0+ for original API, iOS 15.0+ for new features (matches package requirements)

Documentation

  • EXAMPLES.md - 12 usage patterns
  • FEATURE_COMPARISON.md - Feature matrix and migration guide
  • MERGE_SUMMARY.md - Implementation details

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 5 commits February 16, 2026 06:12
…ion, ToastKitView, and UIView extension

Co-authored-by: JerwinPRO <1425196+JerwinPRO@users.noreply.github.com>
Co-authored-by: JerwinPRO <1425196+JerwinPRO@users.noreply.github.com>
…et, rename deadline parameter

Co-authored-by: JerwinPRO <1425196+JerwinPRO@users.noreply.github.com>
Co-authored-by: JerwinPRO <1425196+JerwinPRO@users.noreply.github.com>
Co-authored-by: JerwinPRO <1425196+JerwinPRO@users.noreply.github.com>
Copilot AI changed the title [WIP] Merge features from ToastKit into ToastSwift Merge ToastKit features: add attribute-based configuration and enhanced UI capabilities Feb 16, 2026
Copilot AI requested a review from JerwinPRO February 16, 2026 06:18
@JerwinPRO JerwinPRO marked this pull request as ready for review February 16, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants