Latest 1.2.0
Homepage https://github.com/ajijoyo/AJMessage
License MIT
Platforms ios 9.0
Authors

[Language]()
CI Status
Version
License
Platform

Example

demo

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

XCode 10.1
Swift 4.2

Installation

AJMessage is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'AJMessage'

Changelog

  • separated function show with initial view :
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

AJMessage.show(title: "This is title", message: "message for description",position:.top).onHide {
print("did dissmiss")
}

Can use NSAttributeString

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

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

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.

Latest podspec

{
    "name": "AJMessage",
    "version": "1.2.0",
    "summary": "Simple Message",
    "description": "Show simple message easily",
    "homepage": "https://github.com/ajijoyo/AJMessage",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "ajijoyo": "[email protected]com"
    },
    "source": {
        "git": "https://github.com/ajijoyo/AJMessage.git",
        "tag": "1.2.0"
    },
    "swift_version": "4.2",
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "Classes/**/*",
    "resource_bundles": {
        "AJMessage": [
            "Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This