Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ajijoyo/ajmessage
Simple popup message
https://github.com/ajijoyo/ajmessage
ios message notification popup swift ui
Last synced: 1 day ago
JSON representation
Simple popup message
- Host: GitHub
- URL: https://github.com/ajijoyo/ajmessage
- Owner: ajijoyo
- License: mit
- Created: 2018-12-19T04:23:32.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-13T14:11:54.000Z (about 5 years ago)
- Last Synced: 2025-01-11T04:37:52.970Z (19 days ago)
- Topics: ios, message, notification, popup, swift, ui
- Language: Swift
- Size: 756 KB
- Stars: 35
- Watchers: 5
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AJMessage
[![Language](https://img.shields.io/badge/Swift-4.2-orange.svg)]()
[![CI Status](https://img.shields.io/travis/ajijoyo/AJMessage.svg?style=flat)](https://travis-ci.org/ajijoyo/AJMessage)
[![Version](https://img.shields.io/cocoapods/v/AJMessage.svg?style=flat)](https://cocoapods.org/pods/AJMessage)
[![License](https://img.shields.io/cocoapods/l/AJMessage.svg?style=flat)](https://cocoapods.org/pods/AJMessage)
[![Platform](https://img.shields.io/cocoapods/p/AJMessage.svg?style=flat)](https://cocoapods.org/pods/AJMessage)## Example
![demo](https://github.com/ajijoyo/AJMessage/blob/master/Demo/demo.gif)
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
```
XCode 10.2
Swift 5
```## Installation
AJMessage is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'AJMessage'
```## Changelog
- separated function show with initial view :
```swift
AJMessage(title: title, message: msg).show()//or
let asd = AJMessage(title: title, message: msg)
asd.show()```
- function callback `onHide` has deprecated and changed to `onDismiss` and have value `AJMessage` class
- add new configuration of backgroundcolor `setBackgroundColor` for each status
- add new configuratoin of icon `setImage` for each status## Used
Simple used
```swift
AJMessage.show(title: "This is title", message: "message for description",position:.top).onHide {
print("did dissmiss")
}
```
Can use NSAttributeString
```swift
let title = NSAttributedString(string: "Title", attributes: [.font:UIFont.systemFont(ofSize: 15)])
let msg = NSMutableAttributedString(string: "aasdasd", attributes: [.font:UIFont.systemFont(ofSize: 14)])
let attach = NSTextAttachment()
attach.image = UIImage(named:"plus")
msg.append(NSAttributedString(attachment: attach))
msg.append(NSAttributedString(string: "asdasdasdasd asdasdasdasd asdasdasdasd asdasdasdasd asdasd"))
AJMessage.show(title: title, message: msg,position:.top).onHide {
print("did dissmiss")
}
```customize config
for spesific view present
```swift
var config = AJMessageConfig()/**
config.titleFont
config.setBackgroundColor(.cyan, status: .success)
config.setImage(UIImage(named:"warning"), status: .info)
*/AJMessage.show(title: "This is title", message: "message for description", config: config)
```for global view present
just set `AJMessageConfig.shared` on `didFinishLaunchingWithOptions`
```swift
var config = AJMessageConfig.shared
/**
config.titleFont
config.setBackgroundColor(.cyan, status: .success)
config.setImage(UIImage(named:"warning"), status: .info)
*/
```## Author
ajijoyo, [email protected]
## License
AJMessage is available under the MIT license. See the LICENSE file for more info.