Latest 1.3.6
License MIT
Platforms ios 8.0, requires ARC


ZenCopy is the last copy (text) manager you’ll ever need.
With ZenCopy you can:

  • Style NSAttributedStrings with ease (1 line!)
  • Regex search, then add styles to NSAttributedString with ease (1 line!)
  • Localize NSAttributedStrings
  • Store all your strings in one place


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

pod "ZenCopy"


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


Configuring Copy

You’ll notice that Copy can include args. Simply use $0, $1, … to set your args. Order within the text doesn’t matter.

// english chat copy. prefix is for establishing context (optional)
ZenCopy.manager.config.addCopy("en", prefix: "chat") {
  return [
    "dance": ["@$0 dances with themself"], // note: this is

// spanish chat copy
ZenCopy.manager.config.addCopy("sp", prefix: "chat") {
  return [
    "dance": ["@$0 baila con sí mismos"], // note: this is

Using Copy


myLabel.attributedText = ZenCopy.manager.attributedString(key: "", args: [sender, other])


Configuring Styles

ZenCopy.manager.config.setStyles {
    return [
        "action": Style(
            color: .lightGrayColor()
        "token": Style(
            color: .blueColor(),
            fontSize: 14
        "hulk": Style (
            color: .greenColor(),
            fontSize: 40

Set Style on NSAttributedString (with Regex!)

let atUserRegex = "(@[A-Za-z0-9_]*)"
mutableAttributedString.regexFind(atUserRegex, addStyle: "token")

Styling in copy

In this example, chat.poke has arguments $0 and $1 styled as "token"

ZenCopy.manager.config.addCopy("en", prefix: "chat") {
  return [
    "poke": ["@$0 ".style("token"), "pokes ", "@$1".style("token")] // note: this is chat.poke

Additional notes

I recommend storing all your strings in a Copy.swift (name it what you want) file within your project. I also recommend making use of the copy ‘prefixes’ to separate your keys by context (e.g. "global", "profile", "chat", etc.)

Let me know if you have any questions! Please submit feedback, issues, and pull requests :D


  • Have option to automatically set ZenCopy localization from device localization. Currently this is manual.
  • Scripts to help you work with or migrate NSLocalizedStrings
  • Clean integrations with other useful NSAttributedString libraries


JP McGlone, [email protected]


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

Latest podspec

    "name": "ZenCopy",
    "version": "1.3.6",
    "summary": "ZenCopy makes NSAttributedStrings EASY! It also functions as a Copy and Localization tool.",
    "description": "ZenCopy makes NSAttributedStrings easy! It also functions as a Copy and Localization tool. Check it out and leave me some feedback.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "JP McGlone": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.3.6"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0"
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*"

Pin It on Pinterest

Share This