Status Message Window
Displays a non-modal status message window at the top of the screen that responds to orientation changes.
Installing
Carthage
- Add the following to your
Cartfile:git "git@source.ind.ie:project/status-message-window.git" ~> 3.0 carthage update- Drag
StatusMessageWindow.frameworkfrom theCarthage/Buildfolder into the Linked Frameworks and Libraries section of your project’s target under General. Important: Status Message Window uses a framework called Handle. As Carthage does not handle frameworks within frameworks automatically, you must manually add this framework to your main application. To do this, add
$(SRCROOT)/Carthage/Build/iOS/Handle.frameworkinto the Carthage Run Script (copy-frameworks) phase in your target settings (under the Project settings). This should be the only other entry in the list of input files, next to$(SRCROOT)/Carthage/Build/iOS/StatusMessageWindow.frameworkfor the Status Message Window framework itself.
Manual
You can install as a framework or as source:
Framework
- Build the StatusMessageWindow framework.
- Drag the framework into the Linked Frameworks and Libraries section of your project’s target under General.
Source
- Drag the StatusMessageWindow.swift file into your project and rebuild.
- If you want to take advantage of the CCHLinkTextView framework for more responsive links within messages, also copy the files in that group into your project and add them to your bridging header.
Usage
import StatusMessageWindow
var statusMessageWindow:StatusMessageWindow?
// You can also just pass a regular string.
let message = NSMutableAttributedString.centeredMessage("First line.\nSecond line.", atFontSize: 16.0)
_ = message.boldface("First line.", atFontSize: 16.0)
_ = message.link("line", to: "https://ind.ie", usingLinkAttributeName: NSLinkAttributeName)
statusMessageWindow = StatusMessageWindow(attributedString: message as! NSMutableAttributedString, backgroundColor: UIColor.darkGray, foregroundColor: UIColor.white)
statusMessageWindow!.isHidden = false