GSMessages Documentation
GSMessages is a handy and popular Swift library that assists in displaying in-app notifications. Below you will find the detailed documentation.
Installation
GSMessages can be easily installed using CocoaPods or Carthage, two depended-on package managers for iOS.
- CocoaPods: Add
pod 'GSMessages'
to your Podfile and runpod install
. - Carthage: Add
github "wxxsw/GSMessages"
to your Cartfile and follow the instructions to add the built framework to your project.
Usage
To use GSMessages, you first need to import the module in the file you want to use it:
import GSMessages
Then, you can show a message with just one line of code:
self.showMessage("Hello World")
Customization
You can customize the appearance and behavior of the messages using various parameters. Here’s an example:
self.showMessage("Hello World", type: .warning, options: [.textNumberOfLines(2), .animation(.slide)])
Message Types
GSMessages supports four types of messages:
- Success: For successful operations, displays a green message bar.
- Warning: For warnings, displays a yellow message bar.
- Error: For errors, displays a red message bar.
- Info: For informational messages, displays a blue message bar.
Feedback and Support
If you have any issues or suggestions regarding GSMessages, feel free to open an issue on the GitHub page. Your feedback is always appreciated.
Note: This documentation is subject to updates as the library gets improved or when new features are implemented. Always check back for the most recent documentation.