Status Message Window

Status Message Window

A simple, non-modal status message window.

432ee3fe Swift 3 · by Aral Balkan

Status Message Window

Displays a non-modal status message window at the top of the screen that responds to orientation changes.

Installing

Carthage

Carthage compatible

  1. Add the following to your Cartfile: git "git@source.ind.ie:project/status-message-window.git" ~> 3.0
  2. carthage update
  3. Drag StatusMessageWindow.framework from the Carthage/Build folder into the Linked Frameworks and Libraries section of your project’s target under General.
  4. Follow the rest of the instructions on the Carthage docs.

  5. 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.framework into 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.framework for the Status Message Window framework itself.

Manual

You can install as a framework or as source:

Framework

  1. Build the StatusMessageWindow framework.
  2. Drag the framework into the Linked Frameworks and Libraries section of your project’s target under General.

Source

  1. Drag the StatusMessageWindow.swift file into your project and rebuild.
  2. 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