Latest 0.1.1
License MIT
Platforms ios 8.0

Build Status


To run the example project, clone the repo, open and run Example scheme.




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

pod "MFNoticeLabel"


Start with some importing:

import MFNoticeLabel

Creat and customize your label:
(add notice message and define selection type)

label.frame = CGRect(x: 0, y: 0, width: 300, height: 40) =
label.textAlignment = .Center
label.text = "Something something"
label.noticeMessage = "Longer than something something because it is a description and stuff"
label.textColor = UIColor.blueColor()
label.noticeSelectionType = MFNoticeLabelSelectionType.LongPress
label.longPressDelegate = self

Be sure to properly define selection type you want to use:

label.noticeSelectionType = MFNoticeLabelSelectionType.LongPress

You can conform to either long press (see above) or tap delegate protocols:

public protocol MFNoticeLabelTapDelegate: class
  func didSelectLabel(text: String)

public protocol MFNoticeLabelLongPressDelegate: class
  func didLongPressLabel(text: String)
  func longPressEnded()

Or you can define tap handler or long press start/end handlers

public func handleTap(handler:(String) -> ()){}
public func handleLongPressStarted(handler:(String) -> ()){}
public func handleLongPressEnded(handler:() -> ()){}

You can either use your own way of presenting notice message or you can use build in alert-like controller (a bit customizable: background color, alert title label and alert description label were made public)

let button2 = MFNoticeAlertButton(title: "Dismiss", style: MFNoticeAlertButtonStyle.Cancel, action: {
  self.dismissViewControllerAnimated(true, completion: nil)

let button1 = MFNoticeAlertButton(title: "Ok", style: MFNoticeAlertButtonStyle.Default, action: {
  self.dismissViewControllerAnimated(true, completion: nil)

let alertVC = MFNoticeAlertController(title: "Some title", description: "A little bit of text just to give you a taste on what it may look like, little bit of text just to give you a taste on what it may look like", image: UIImage(named: "phone"))

alertVC.addButtons([button1, button2])

self.presentViewController(alertVC, animated: true, completion: nil)


Mateusz Fidos, [email protected]


MFNoticeLabel is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "MFNoticeLabel",
    "version": "0.1.1",
    "summary": "Get a hint?",
    "description": "Just a label that allows you to present some custom alert like controller with extra descritpion on tap or long press",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Mateusz Fidos": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.1"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0"
    "source_files": "MFNoticeLabel/**/*"

Pin It on Pinterest

Share This