[
  {
    "path": ".gitignore",
    "content": ".DS_Store\n# Xcode\n#\n# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore\n\n## Build generated\nbuild/\nDerivedData\n\n## Various settings\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\n\n## Other\n*.xccheckout\n*.moved-aside\n*.xcuserstate\n*.xcscmblueprint\n\n## Obj-C/Swift specific\n*.hmap\n*.ipa\n\n## Playgrounds\ntimeline.xctimeline\nplayground.xcworkspace\n\n# Swift Package Manager\n#\n# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.\n# Packages/\n.build/\n\n# CocoaPods\n#\n# We recommend against adding the Pods directory to your .gitignore. However\n# you should judge for yourself, the pros and cons are mentioned at:\n# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control\n#\n# Pods/\n\n# Carthage\n#\n# Add this line if you want to avoid checking in source code from Carthage dependencies.\n# Carthage/Checkouts\n\nCarthage/Build\n\n# fastlane\n#\n# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the \n# screenshots whenever they are needed.\n# For more information about the recommended setup visit:\n# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md\n\nfastlane/report.xml\nfastlane/screenshots\n"
  },
  {
    "path": "HYLabel/HYLabel/HYLabel.h",
    "content": "//\n//  HYLabel.h\n//  HYLabel\n//\n//  Created by apple on 16/3/9.\n//  Copyright © 2016年 xiaomage. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\n//! Project version number for HYLabel.\nFOUNDATION_EXPORT double HYLabelVersionNumber;\n\n//! Project version string for HYLabel.\nFOUNDATION_EXPORT const unsigned char HYLabelVersionString[];\n\n// In this header, you should import all the public headers of your framework using statements like #import <HYLabel/PublicHeader.h>\n\n\n"
  },
  {
    "path": "HYLabel/HYLabel/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>FMWK</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>$(CURRENT_PROJECT_VERSION)</string>\n\t<key>NSPrincipalClass</key>\n\t<string></string>\n</dict>\n</plist>\n"
  },
  {
    "path": "HYLabel/HYLabel.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t187A8A111C8FC0EB00D8DA51 /* HYLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 187A8A101C8FC0EB00D8DA51 /* HYLabel.h */; settings = {ATTRIBUTES = (Public, ); }; };\n\t\t187A8A1A1C8FC15300D8DA51 /* HYLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 187A8A191C8FC15300D8DA51 /* HYLabel.swift */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXFileReference section */\n\t\t187A8A0D1C8FC0EB00D8DA51 /* HYLabel.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = HYLabel.framework; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t187A8A101C8FC0EB00D8DA51 /* HYLabel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HYLabel.h; sourceTree = \"<group>\"; };\n\t\t187A8A121C8FC0EB00D8DA51 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t187A8A191C8FC15300D8DA51 /* HYLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HYLabel.swift; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t187A8A091C8FC0EB00D8DA51 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t187A8A031C8FC0EB00D8DA51 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t187A8A0F1C8FC0EB00D8DA51 /* HYLabel */,\n\t\t\t\t187A8A0E1C8FC0EB00D8DA51 /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t187A8A0E1C8FC0EB00D8DA51 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t187A8A0D1C8FC0EB00D8DA51 /* HYLabel.framework */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t187A8A0F1C8FC0EB00D8DA51 /* HYLabel */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t187A8A181C8FC13E00D8DA51 /* Source */,\n\t\t\t\t187A8A101C8FC0EB00D8DA51 /* HYLabel.h */,\n\t\t\t\t187A8A121C8FC0EB00D8DA51 /* Info.plist */,\n\t\t\t);\n\t\t\tpath = HYLabel;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t187A8A181C8FC13E00D8DA51 /* Source */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t187A8A191C8FC15300D8DA51 /* HYLabel.swift */,\n\t\t\t);\n\t\t\tpath = Source;\n\t\t\tsourceTree = SOURCE_ROOT;\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXHeadersBuildPhase section */\n\t\t187A8A0A1C8FC0EB00D8DA51 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t187A8A111C8FC0EB00D8DA51 /* HYLabel.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXHeadersBuildPhase section */\n\n/* Begin PBXNativeTarget section */\n\t\t187A8A0C1C8FC0EB00D8DA51 /* HYLabel */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 187A8A151C8FC0EB00D8DA51 /* Build configuration list for PBXNativeTarget \"HYLabel\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t187A8A081C8FC0EB00D8DA51 /* Sources */,\n\t\t\t\t187A8A091C8FC0EB00D8DA51 /* Frameworks */,\n\t\t\t\t187A8A0A1C8FC0EB00D8DA51 /* Headers */,\n\t\t\t\t187A8A0B1C8FC0EB00D8DA51 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = HYLabel;\n\t\t\tproductName = HYLabel;\n\t\t\tproductReference = 187A8A0D1C8FC0EB00D8DA51 /* HYLabel.framework */;\n\t\t\tproductType = \"com.apple.product-type.framework\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t187A8A041C8FC0EB00D8DA51 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0720;\n\t\t\t\tORGANIZATIONNAME = xiaomage;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t187A8A0C1C8FC0EB00D8DA51 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 7.2;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 187A8A071C8FC0EB00D8DA51 /* Build configuration list for PBXProject \"HYLabel\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 187A8A031C8FC0EB00D8DA51;\n\t\t\tproductRefGroup = 187A8A0E1C8FC0EB00D8DA51 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t187A8A0C1C8FC0EB00D8DA51 /* HYLabel */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t187A8A0B1C8FC0EB00D8DA51 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t187A8A081C8FC0EB00D8DA51 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t187A8A1A1C8FC15300D8DA51 /* HYLabel.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t187A8A131C8FC0EB00D8DA51 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t\tVERSION_INFO_PREFIX = \"\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t187A8A141C8FC0EB00D8DA51 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t\tVERSION_INFO_PREFIX = \"\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t187A8A161C8FC0EB00D8DA51 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tDEFINES_MODULE = YES;\n\t\t\t\tDYLIB_COMPATIBILITY_VERSION = 1;\n\t\t\t\tDYLIB_CURRENT_VERSION = 1;\n\t\t\t\tDYLIB_INSTALL_NAME_BASE = \"@rpath\";\n\t\t\t\tINFOPLIST_FILE = HYLabel/Info.plist;\n\t\t\t\tINSTALL_PATH = \"$(LOCAL_LIBRARY_DIR)/Frameworks\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.520it.HYLabel;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t187A8A171C8FC0EB00D8DA51 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tDEFINES_MODULE = YES;\n\t\t\t\tDYLIB_COMPATIBILITY_VERSION = 1;\n\t\t\t\tDYLIB_CURRENT_VERSION = 1;\n\t\t\t\tDYLIB_INSTALL_NAME_BASE = \"@rpath\";\n\t\t\t\tINFOPLIST_FILE = HYLabel/Info.plist;\n\t\t\t\tINSTALL_PATH = \"$(LOCAL_LIBRARY_DIR)/Frameworks\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.520it.HYLabel;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t187A8A071C8FC0EB00D8DA51 /* Build configuration list for PBXProject \"HYLabel\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t187A8A131C8FC0EB00D8DA51 /* Debug */,\n\t\t\t\t187A8A141C8FC0EB00D8DA51 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t187A8A151C8FC0EB00D8DA51 /* Build configuration list for PBXNativeTarget \"HYLabel\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t187A8A161C8FC0EB00D8DA51 /* Debug */,\n\t\t\t\t187A8A171C8FC0EB00D8DA51 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 187A8A041C8FC0EB00D8DA51 /* Project object */;\n}\n"
  },
  {
    "path": "HYLabel/Source/HYLabel.swift",
    "content": "//\n//  HYLabel.swift\n//  HYLabel\n//\n//  Created by apple on 16/3/8.\n//  Copyright © 2016年 xiaomage. All rights reserved.\n//\n\nimport UIKit\n\nenum TapHandlerType : Int {\n    case noneHandle = 0\n    case userHandle = 1\n    case topicHandle = 2\n    case linkHandle = 3\n}\n\npublic class HYLabel: UILabel {\n    \n    // MARK:- 属性\n    // 重写系统的属性\n    override public var text : String? {\n        didSet {\n            prepareText()\n        }\n    }\n    \n    override public var attributedText: NSAttributedString? {\n        didSet {\n            prepareText()\n        }\n    }\n    \n    override public var font: UIFont! {\n        didSet {\n            prepareText()\n        }\n    }\n    \n    override public var textColor: UIColor! {\n        didSet {\n            prepareText()\n        }\n    }\n    \n    public var matchTextColor : UIColor = UIColor(red: 87 / 255.0, green: 196 / 255.0, blue: 251 / 255.0, alpha: 1.0) {\n        didSet {\n            prepareText()\n        }\n    }\n    \n    // 懒加载属性\n    private lazy var textStorage : NSTextStorage = NSTextStorage() // NSMutableAttributeString的子类\n    private lazy var layoutManager : NSLayoutManager = NSLayoutManager() // 布局管理者\n    private lazy var textContainer : NSTextContainer = NSTextContainer() // 容器,需要设置容器的大小\n    \n    // 用于记录下标值\n    private lazy var linkRanges : [NSRange] = [NSRange]()\n    private lazy var userRanges : [NSRange] = [NSRange]()\n    private lazy var topicRanges : [NSRange] = [NSRange]()\n    \n    // 用于记录用户选中的range\n    private var selectedRange : NSRange?\n    \n    // 用户记录点击还是松开\n    private var isSelected : Bool = false\n    \n    // 闭包属性,用于回调\n    private var tapHandlerType : TapHandlerType = TapHandlerType.noneHandle\n    \n    public typealias HYTapHandler = (HYLabel, String, NSRange) -> Void\n    public var linkTapHandler : HYTapHandler?\n    public var topicTapHandler : HYTapHandler?\n    public var userTapHandler : HYTapHandler?\n    \n    // MARK:- 构造函数\n    override init(frame: CGRect) {\n        super.init(frame: frame)\n        \n        prepareTextSystem()\n    }\n    \n    required public init?(coder aDecoder: NSCoder) {\n        super.init(coder: aDecoder)\n        \n        prepareTextSystem()\n    }\n    \n    // MARK:- 布局子控件\n    override public func layoutSubviews() {\n        super.layoutSubviews()\n        \n        // 设置容器的大小为Label的尺寸\n        textContainer.size = frame.size\n    }\n    \n    // MARK:- 重写drawTextInRect方法\n    override public func drawTextInRect(rect: CGRect) {\n        // 1.绘制背景\n        if selectedRange != nil {\n            // 2.0.确定颜色\n            let selectedColor = isSelected ? UIColor(white: 0.7, alpha: 0.2) : UIColor.clearColor()\n            \n            // 2.1.设置颜色\n            textStorage.addAttribute(NSBackgroundColorAttributeName, value: selectedColor, range: selectedRange!)\n            \n            // 2.2.绘制背景\n            layoutManager.drawBackgroundForGlyphRange(selectedRange!, atPoint: CGPoint(x: 0, y: 0))\n        }\n        \n        // 2.绘制字形\n        // 需要绘制的范围\n        let range = NSRange(location: 0, length: textStorage.length)\n        layoutManager.drawGlyphsForGlyphRange(range, atPoint: CGPointZero)\n    }\n}\n\nextension HYLabel {\n    /// 准备文本系统\n    private func prepareTextSystem() {\n        // 0.准备文本\n        prepareText()\n        \n        // 1.将布局添加到storeage中\n        textStorage.addLayoutManager(layoutManager)\n        \n        // 2.将容器添加到布局中\n        layoutManager.addTextContainer(textContainer)\n        \n        // 3.让label可以和用户交互\n        userInteractionEnabled = true\n        \n        // 4.设置间距为0\n        textContainer.lineFragmentPadding = 0\n    }\n    \n    /// 准备文本\n    private func prepareText() {\n        // 1.准备字符串\n        var attrString : NSAttributedString?\n        if attributedText != nil {\n            attrString = attributedText\n        } else if text != nil {\n            attrString = NSAttributedString(string: text!)\n        } else {\n            attrString = NSAttributedString(string: \"\")\n        }\n        \n        selectedRange = nil\n        \n        // 2.设置换行模型\n        let attrStringM = addLineBreak(attrString!)\n        \n        attrStringM.addAttribute(NSFontAttributeName, value: font, range: NSRange(location: 0, length: attrStringM.length))\n        \n        // 3.设置textStorage的内容\n        textStorage.setAttributedString(attrStringM)\n        \n        // 4.匹配URL\n        if let linkRanges = getLinkRanges() {\n            self.linkRanges = linkRanges\n            for range in linkRanges {\n                textStorage.addAttribute(NSForegroundColorAttributeName, value: matchTextColor, range: range)\n            }\n        }\n        \n        // 5.匹配@用户\n        if let userRanges = getRanges(\"@[\\\\u4e00-\\\\u9fa5a-zA-Z0-9_-]*\") {\n            self.userRanges = userRanges\n            for range in userRanges {\n                textStorage.addAttribute(NSForegroundColorAttributeName, value: matchTextColor, range: range)\n            }\n        }\n        \n        \n        // 6.匹配话题##\n        if let topicRanges = getRanges(\"#.*?#\") {\n            self.topicRanges = topicRanges\n            for range in topicRanges {\n                textStorage.addAttribute(NSForegroundColorAttributeName, value: matchTextColor, range: range)\n            }\n        }\n        \n        setNeedsDisplay()\n    }\n}\n\n\n// MARK:- 字符串匹配封装\nextension HYLabel {\n    private func getRanges(pattern : String) -> [NSRange]? {\n        // 创建正则表达式对象\n        guard let regex = try? NSRegularExpression(pattern: pattern, options: []) else {\n            return nil\n        }\n        \n        return getRangesFromResult(regex)\n    }\n    \n    private func getLinkRanges() -> [NSRange]? {\n        // 创建正则表达式\n        guard let detector = try? NSDataDetector(types: NSTextCheckingType.Link.rawValue) else {\n            return nil\n        }\n        \n        return getRangesFromResult(detector)\n    }\n    \n    private func getRangesFromResult(regex : NSRegularExpression) -> [NSRange] {\n        // 1.匹配结果\n        let results = regex.matchesInString(textStorage.string, options: [], range: NSRange(location: 0, length: textStorage.length))\n        \n        // 2.遍历结果\n        var ranges = [NSRange]()\n        for res in results {\n            ranges.append(res.range)\n        }\n        \n        return ranges\n    }\n}\n\n\n// MARK:- 点击交互的封装\nextension HYLabel {\n    override public func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {\n        // 0.记录点击\n        isSelected = true\n        \n        // 1.获取用户点击的点\n        let selectedPoint = touches.first!.locationInView(self)\n        \n        // 2.获取该点所在的字符串的range\n        selectedRange = getSelectRange(selectedPoint)\n        \n        // 3.是否处理了事件\n        if selectedRange == nil {\n            super.touchesBegan(touches, withEvent: event)\n        }\n    }\n    \n    override public func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) {\n        if selectedRange == nil {\n            super.touchesBegan(touches, withEvent: event)\n            return\n        }\n        \n        // 0.记录松开\n        isSelected = false\n        \n        // 2.重新绘制\n        setNeedsDisplay()\n        \n        // 3.取出内容\n        let contentText = (textStorage.string as NSString).substringWithRange(selectedRange!)\n        \n        // 3.回调\n        switch tapHandlerType {\n        case .linkHandle:\n            if linkTapHandler != nil {\n                linkTapHandler!(self, contentText, selectedRange!)\n            }\n        case .topicHandle:\n            if topicTapHandler != nil {\n                topicTapHandler!(self, contentText, selectedRange!)\n            }\n        case .userHandle:\n            if userTapHandler != nil {\n                userTapHandler!(self, contentText, selectedRange!)\n            }\n        default:\n            break\n        }\n    }\n    \n    private func getSelectRange(selectedPoint : CGPoint) -> NSRange? {\n        // 0.如果属性字符串为nil,则不需要判断\n        if textStorage.length == 0 {\n            return nil\n        }\n        \n        // 1.获取选中点所在的下标值(index)\n        let index = layoutManager.glyphIndexForPoint(selectedPoint, inTextContainer: textContainer)\n        \n        // 2.判断下标在什么内\n        // 2.1.判断是否是一个链接\n        for linkRange in linkRanges {\n            if index > linkRange.location && index < linkRange.location + linkRange.length {\n                setNeedsDisplay()\n                tapHandlerType = .linkHandle\n                return linkRange\n            }\n        }\n        \n        // 2.2.判断是否是一个@用户\n        for userRange in userRanges {\n            if index > userRange.location && index < userRange.location + userRange.length {\n                setNeedsDisplay()\n                tapHandlerType = .userHandle\n                return userRange\n            }\n        }\n        \n        // 2.3.判断是否是一个#话题#\n        for topicRange in topicRanges {\n            if index > topicRange.location && index < topicRange.location + topicRange.length {\n                setNeedsDisplay()\n                tapHandlerType = .topicHandle\n                return topicRange\n            }\n        }\n        \n        return nil\n    }\n}\n\n// MARK:- 补充\nextension HYLabel {\n    /// 如果用户没有设置lineBreak,则所有内容会绘制到同一行中,因此需要主动设置\n    private func addLineBreak(attrString: NSAttributedString) -> NSMutableAttributedString {\n        let attrStringM = NSMutableAttributedString(attributedString: attrString)\n        \n        if attrStringM.length == 0 {\n            return attrStringM\n        }\n        \n        var range = NSRange(location: 0, length: 0)\n        var attributes = attrStringM.attributesAtIndex(0, effectiveRange: &range)\n        var paragraphStyle = attributes[NSParagraphStyleAttributeName] as? NSMutableParagraphStyle\n        \n        if paragraphStyle != nil {\n            paragraphStyle!.lineBreakMode = NSLineBreakMode.ByWordWrapping\n        } else {\n            paragraphStyle = NSMutableParagraphStyle()\n            paragraphStyle!.lineBreakMode = NSLineBreakMode.ByWordWrapping\n            attributes[NSParagraphStyleAttributeName] = paragraphStyle\n            \n            attrStringM.setAttributes(attributes, range: range)\n        }\n        \n        return attrStringM\n    }\n}\n"
  },
  {
    "path": "HYLabel.podspec",
    "content": "Pod::Spec.new do |s|\n    s.name         = 'HYLabel'\n    s.version      = '1.0.1'\n    s.summary      = '用于识别Label中的@用户-话题##-链接'\n    s.homepage     = 'https://github.com/coderwhy/HYLabel'\n    s.license      = 'MIT'\n    s.authors      = {'coderwhy' => '372623326@qq.com'}\n    s.platform     = :ios, '8.0'\n    s.source       = {:git => 'https://github.com/coderwhy/HYLabel.git', :tag => s.version}\n    s.source_files = 'HYLabel/Source/*.swift'\n    s.framework    = 'UIKit'\n    s.requires_arc = true\nend"
  },
  {
    "path": "HYLabel.xcworkspace/contents.xcworkspacedata",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"group:HYLabelDemo-Swift/HYLabelDemo-Swift.xcodeproj\">\n   </FileRef>\n   <FileRef\n      location = \"group:HYLabelDemoOC/HYLabelDemoOC.xcodeproj\">\n   </FileRef>\n   <FileRef\n      location = \"group:HYLabel/HYLabel.xcodeproj\">\n   </FileRef>\n</Workspace>\n"
  },
  {
    "path": "HYLabelDemo-Swift/HYLabelDemo-Swift/AppDelegate.swift",
    "content": "//\n//  AppDelegate.swift\n//  HYLabelDemo-Swift\n//\n//  Created by apple on 16/3/9.\n//  Copyright © 2016年 xiaomage. All rights reserved.\n//\n\nimport UIKit\n\n@UIApplicationMain\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n\n    var window: UIWindow?\n\n\n    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {\n        // Override point for customization after application launch.\n        return true\n    }\n\n    func applicationWillResignActive(application: UIApplication) {\n        // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.\n        // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.\n    }\n\n    func applicationDidEnterBackground(application: UIApplication) {\n        // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.\n        // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.\n    }\n\n    func applicationWillEnterForeground(application: UIApplication) {\n        // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.\n    }\n\n    func applicationDidBecomeActive(application: UIApplication) {\n        // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.\n    }\n\n    func applicationWillTerminate(application: UIApplication) {\n        // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.\n    }\n\n\n}\n\n"
  },
  {
    "path": "HYLabelDemo-Swift/HYLabelDemo-Swift/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"60x60\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"60x60\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "HYLabelDemo-Swift/HYLabelDemo-Swift/Base.lproj/LaunchScreen.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"8150\" systemVersion=\"15A204g\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\" initialViewController=\"01J-lp-oVM\">\n    <dependencies>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"8122\"/>\n    </dependencies>\n    <scenes>\n        <!--View Controller-->\n        <scene sceneID=\"EHf-IW-A2E\">\n            <objects>\n                <viewController id=\"01J-lp-oVM\" sceneMemberID=\"viewController\">\n                    <layoutGuides>\n                        <viewControllerLayoutGuide type=\"top\" id=\"Llm-lL-Icb\"/>\n                        <viewControllerLayoutGuide type=\"bottom\" id=\"xb3-aO-Qok\"/>\n                    </layoutGuides>\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"Ze5-6b-2t3\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"600\" height=\"600\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <animations/>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"calibratedWhite\"/>\n                    </view>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"iYj-Kq-Ea1\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"53\" y=\"375\"/>\n        </scene>\n    </scenes>\n</document>\n"
  },
  {
    "path": "HYLabelDemo-Swift/HYLabelDemo-Swift/Base.lproj/Main.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"9531\" systemVersion=\"15D21\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" useTraitCollections=\"YES\" initialViewController=\"BYZ-38-t0r\">\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"9529\"/>\n    </dependencies>\n    <scenes>\n        <!--View Controller-->\n        <scene sceneID=\"tne-QT-ifu\">\n            <objects>\n                <viewController id=\"BYZ-38-t0r\" customClass=\"ViewController\" customModule=\"HYLabelDemo_Swift\" customModuleProvider=\"target\" sceneMemberID=\"viewController\">\n                    <layoutGuides>\n                        <viewControllerLayoutGuide type=\"top\" id=\"y3c-jy-aDJ\"/>\n                        <viewControllerLayoutGuide type=\"bottom\" id=\"wfy-db-euE\"/>\n                    </layoutGuides>\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"8bC-Xf-vdC\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"600\" height=\"600\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <subviews>\n                            <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"#HYLabale# 用于匹配字符串中的内容显示 请关注:https://github.com/coderwhy/HYLabel 作者:@coderwhy\" textAlignment=\"natural\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"z7C-vI-SNt\" customClass=\"HYLabel\" customModule=\"HYLabel\">\n                                <rect key=\"frame\" x=\"40\" y=\"60\" width=\"520\" height=\"36\"/>\n                                <color key=\"backgroundColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"calibratedWhite\"/>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"15\"/>\n                                <color key=\"textColor\" cocoaTouchSystemColor=\"darkTextColor\"/>\n                                <nil key=\"highlightedColor\"/>\n                            </label>\n                        </subviews>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"calibratedWhite\"/>\n                        <constraints>\n                            <constraint firstAttribute=\"trailing\" secondItem=\"z7C-vI-SNt\" secondAttribute=\"trailing\" constant=\"40\" id=\"2Ua-hY-b5m\"/>\n                            <constraint firstItem=\"z7C-vI-SNt\" firstAttribute=\"top\" secondItem=\"y3c-jy-aDJ\" secondAttribute=\"bottom\" constant=\"40\" id=\"DMA-CD-NRR\"/>\n                            <constraint firstItem=\"z7C-vI-SNt\" firstAttribute=\"leading\" secondItem=\"8bC-Xf-vdC\" secondAttribute=\"leading\" constant=\"40\" id=\"mm4-zz-PfY\"/>\n                        </constraints>\n                    </view>\n                    <connections>\n                        <outlet property=\"demoLabel\" destination=\"z7C-vI-SNt\" id=\"4Op-va-crb\"/>\n                    </connections>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"dkx-z0-nzr\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n        </scene>\n    </scenes>\n</document>\n"
  },
  {
    "path": "HYLabelDemo-Swift/HYLabelDemo-Swift/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>UILaunchStoryboardName</key>\n\t<string>LaunchScreen</string>\n\t<key>UIMainStoryboardFile</key>\n\t<string>Main</string>\n\t<key>UIRequiredDeviceCapabilities</key>\n\t<array>\n\t\t<string>armv7</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "HYLabelDemo-Swift/HYLabelDemo-Swift/ViewController.swift",
    "content": "//\n//  ViewController.swift\n//  HYLabelDemo-Swift\n//\n//  Created by apple on 16/3/9.\n//  Copyright © 2016年 xiaomage. All rights reserved.\n//\n\nimport UIKit\nimport HYLabel\n\nclass ViewController: UIViewController {\n    \n    @IBOutlet weak var demoLabel: HYLabel!\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        \n    // 监听@谁谁谁的点击\n    demoLabel.userTapHandler = { (label, user, range) in\n        print(label)\n        print(user)\n        print(range)\n    }\n    \n    // 监听链接的点击\n    demoLabel.linkTapHandler = { (label, link, range) in\n        print(label)\n        print(link)\n        print(range)\n    }\n    \n    // 监听话题的点击\n    demoLabel.topicTapHandler = { (label, topic, range) in\n        print(label)\n        print(topic)\n        print(range)\n    }\n    }\n    \n    override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {\n        demoLabel.text = \"作者:@coderwhy 话题:#Label字符串识别# 网址:http://www.520it.com\"\n    }\n}\n\n"
  },
  {
    "path": "HYLabelDemo-Swift/HYLabelDemo-Swift.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t187A89F21C8FC0A300D8DA51 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 187A89F11C8FC0A300D8DA51 /* AppDelegate.swift */; };\n\t\t187A89F41C8FC0A300D8DA51 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 187A89F31C8FC0A300D8DA51 /* ViewController.swift */; };\n\t\t187A89F71C8FC0A300D8DA51 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 187A89F51C8FC0A300D8DA51 /* Main.storyboard */; };\n\t\t187A89F91C8FC0A300D8DA51 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 187A89F81C8FC0A300D8DA51 /* Assets.xcassets */; };\n\t\t187A89FC1C8FC0A300D8DA51 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 187A89FA1C8FC0A300D8DA51 /* LaunchScreen.storyboard */; };\n\t\t187A8A1D1C8FC2E200D8DA51 /* HYLabel.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 187A8A1C1C8FC2E200D8DA51 /* HYLabel.framework */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXFileReference section */\n\t\t187A89EE1C8FC0A300D8DA51 /* HYLabelDemo-Swift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"HYLabelDemo-Swift.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t187A89F11C8FC0A300D8DA51 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = \"<group>\"; };\n\t\t187A89F31C8FC0A300D8DA51 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = \"<group>\"; };\n\t\t187A89F61C8FC0A300D8DA51 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = \"<group>\"; };\n\t\t187A89F81C8FC0A300D8DA51 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = \"<group>\"; };\n\t\t187A89FB1C8FC0A300D8DA51 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = \"<group>\"; };\n\t\t187A89FD1C8FC0A300D8DA51 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t187A8A1C1C8FC2E200D8DA51 /* HYLabel.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HYLabel.framework; path = \"../HYLabel/build/Debug-iphoneos/HYLabel.framework\"; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t187A89EB1C8FC0A300D8DA51 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t187A8A1D1C8FC2E200D8DA51 /* HYLabel.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t187A89E51C8FC0A300D8DA51 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t187A8A1C1C8FC2E200D8DA51 /* HYLabel.framework */,\n\t\t\t\t187A89F01C8FC0A300D8DA51 /* HYLabelDemo-Swift */,\n\t\t\t\t187A89EF1C8FC0A300D8DA51 /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t187A89EF1C8FC0A300D8DA51 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t187A89EE1C8FC0A300D8DA51 /* HYLabelDemo-Swift.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t187A89F01C8FC0A300D8DA51 /* HYLabelDemo-Swift */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t187A89F11C8FC0A300D8DA51 /* AppDelegate.swift */,\n\t\t\t\t187A89F31C8FC0A300D8DA51 /* ViewController.swift */,\n\t\t\t\t187A89F51C8FC0A300D8DA51 /* Main.storyboard */,\n\t\t\t\t187A89F81C8FC0A300D8DA51 /* Assets.xcassets */,\n\t\t\t\t187A89FA1C8FC0A300D8DA51 /* LaunchScreen.storyboard */,\n\t\t\t\t187A89FD1C8FC0A300D8DA51 /* Info.plist */,\n\t\t\t);\n\t\t\tpath = \"HYLabelDemo-Swift\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t187A89ED1C8FC0A300D8DA51 /* HYLabelDemo-Swift */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 187A8A001C8FC0A300D8DA51 /* Build configuration list for PBXNativeTarget \"HYLabelDemo-Swift\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t187A89EA1C8FC0A300D8DA51 /* Sources */,\n\t\t\t\t187A89EB1C8FC0A300D8DA51 /* Frameworks */,\n\t\t\t\t187A89EC1C8FC0A300D8DA51 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"HYLabelDemo-Swift\";\n\t\t\tproductName = \"HYLabelDemo-Swift\";\n\t\t\tproductReference = 187A89EE1C8FC0A300D8DA51 /* HYLabelDemo-Swift.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t187A89E61C8FC0A300D8DA51 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastSwiftUpdateCheck = 0720;\n\t\t\t\tLastUpgradeCheck = 0720;\n\t\t\t\tORGANIZATIONNAME = xiaomage;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t187A89ED1C8FC0A300D8DA51 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 7.2;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 187A89E91C8FC0A300D8DA51 /* Build configuration list for PBXProject \"HYLabelDemo-Swift\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 187A89E51C8FC0A300D8DA51;\n\t\t\tproductRefGroup = 187A89EF1C8FC0A300D8DA51 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t187A89ED1C8FC0A300D8DA51 /* HYLabelDemo-Swift */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t187A89EC1C8FC0A300D8DA51 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t187A89FC1C8FC0A300D8DA51 /* LaunchScreen.storyboard in Resources */,\n\t\t\t\t187A89F91C8FC0A300D8DA51 /* Assets.xcassets in Resources */,\n\t\t\t\t187A89F71C8FC0A300D8DA51 /* Main.storyboard in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t187A89EA1C8FC0A300D8DA51 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t187A89F41C8FC0A300D8DA51 /* ViewController.swift in Sources */,\n\t\t\t\t187A89F21C8FC0A300D8DA51 /* AppDelegate.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXVariantGroup section */\n\t\t187A89F51C8FC0A300D8DA51 /* Main.storyboard */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t187A89F61C8FC0A300D8DA51 /* Base */,\n\t\t\t);\n\t\t\tname = Main.storyboard;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t187A89FA1C8FC0A300D8DA51 /* LaunchScreen.storyboard */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t187A89FB1C8FC0A300D8DA51 /* Base */,\n\t\t\t);\n\t\t\tname = LaunchScreen.storyboard;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\t187A89FE1C8FC0A300D8DA51 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t187A89FF1C8FC0A300D8DA51 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t187A8A011C8FC0A300D8DA51 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tINFOPLIST_FILE = \"HYLabelDemo-Swift/Info.plist\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.520it.HYLabelDemo-Swift\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t187A8A021C8FC0A300D8DA51 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tINFOPLIST_FILE = \"HYLabelDemo-Swift/Info.plist\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.520it.HYLabelDemo-Swift\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t187A89E91C8FC0A300D8DA51 /* Build configuration list for PBXProject \"HYLabelDemo-Swift\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t187A89FE1C8FC0A300D8DA51 /* Debug */,\n\t\t\t\t187A89FF1C8FC0A300D8DA51 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t187A8A001C8FC0A300D8DA51 /* Build configuration list for PBXNativeTarget \"HYLabelDemo-Swift\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t187A8A011C8FC0A300D8DA51 /* Debug */,\n\t\t\t\t187A8A021C8FC0A300D8DA51 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 187A89E61C8FC0A300D8DA51 /* Project object */;\n}\n"
  },
  {
    "path": "HYLabelDemoOC/HYLabelDemoOC/AppDelegate.h",
    "content": "//\n//  AppDelegate.h\n//  HYLabelDemoOC\n//\n//  Created by apple on 16/3/15.\n//  Copyright © 2016年 xiaomage. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\n@interface AppDelegate : UIResponder <UIApplicationDelegate>\n\n@property (strong, nonatomic) UIWindow *window;\n\n\n@end\n\n"
  },
  {
    "path": "HYLabelDemoOC/HYLabelDemoOC/AppDelegate.m",
    "content": "//\n//  AppDelegate.m\n//  HYLabelDemoOC\n//\n//  Created by apple on 16/3/15.\n//  Copyright © 2016年 xiaomage. All rights reserved.\n//\n\n#import \"AppDelegate.h\"\n\n@interface AppDelegate ()\n\n@end\n\n@implementation AppDelegate\n\n\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\n    // Override point for customization after application launch.\n    return YES;\n}\n\n- (void)applicationWillResignActive:(UIApplication *)application {\n    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.\n    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.\n}\n\n- (void)applicationDidEnterBackground:(UIApplication *)application {\n    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.\n    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.\n}\n\n- (void)applicationWillEnterForeground:(UIApplication *)application {\n    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.\n}\n\n- (void)applicationDidBecomeActive:(UIApplication *)application {\n    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.\n}\n\n- (void)applicationWillTerminate:(UIApplication *)application {\n    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.\n}\n\n@end\n"
  },
  {
    "path": "HYLabelDemoOC/HYLabelDemoOC/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"60x60\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"60x60\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "HYLabelDemoOC/HYLabelDemoOC/Base.lproj/LaunchScreen.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"8150\" systemVersion=\"15A204g\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\" initialViewController=\"01J-lp-oVM\">\n    <dependencies>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"8122\"/>\n    </dependencies>\n    <scenes>\n        <!--View Controller-->\n        <scene sceneID=\"EHf-IW-A2E\">\n            <objects>\n                <viewController id=\"01J-lp-oVM\" sceneMemberID=\"viewController\">\n                    <layoutGuides>\n                        <viewControllerLayoutGuide type=\"top\" id=\"Llm-lL-Icb\"/>\n                        <viewControllerLayoutGuide type=\"bottom\" id=\"xb3-aO-Qok\"/>\n                    </layoutGuides>\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"Ze5-6b-2t3\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"600\" height=\"600\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <animations/>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"calibratedWhite\"/>\n                    </view>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"iYj-Kq-Ea1\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"53\" y=\"375\"/>\n        </scene>\n    </scenes>\n</document>\n"
  },
  {
    "path": "HYLabelDemoOC/HYLabelDemoOC/Base.lproj/Main.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"9531\" systemVersion=\"15D21\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" useTraitCollections=\"YES\" initialViewController=\"BYZ-38-t0r\">\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"9529\"/>\n    </dependencies>\n    <scenes>\n        <!--View Controller-->\n        <scene sceneID=\"tne-QT-ifu\">\n            <objects>\n                <viewController id=\"BYZ-38-t0r\" customClass=\"ViewController\" sceneMemberID=\"viewController\">\n                    <layoutGuides>\n                        <viewControllerLayoutGuide type=\"top\" id=\"y3c-jy-aDJ\"/>\n                        <viewControllerLayoutGuide type=\"bottom\" id=\"wfy-db-euE\"/>\n                    </layoutGuides>\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"8bC-Xf-vdC\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"600\" height=\"600\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <subviews>\n                            <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"#HYLabale# 用于匹配字符串中的内容显示 请关注:https://github.com/coderwhy/HYLabel 作者:@coderwhy\" textAlignment=\"natural\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"Fvo-1U-W5h\" customClass=\"HYLabel\" customModule=\"HYLabelDemoOC\" customModuleProvider=\"target\">\n                                <rect key=\"frame\" x=\"40\" y=\"60\" width=\"520\" height=\"36\"/>\n                                <color key=\"backgroundColor\" red=\"0.98039215690000003\" green=\"0.90196078430000004\" blue=\"0.90196078430000004\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"15\"/>\n                                <color key=\"textColor\" cocoaTouchSystemColor=\"darkTextColor\"/>\n                                <nil key=\"highlightedColor\"/>\n                            </label>\n                        </subviews>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"calibratedWhite\"/>\n                        <constraints>\n                            <constraint firstItem=\"Fvo-1U-W5h\" firstAttribute=\"leading\" secondItem=\"8bC-Xf-vdC\" secondAttribute=\"leading\" constant=\"40\" id=\"DMp-FS-CZ3\"/>\n                            <constraint firstItem=\"Fvo-1U-W5h\" firstAttribute=\"top\" secondItem=\"y3c-jy-aDJ\" secondAttribute=\"bottom\" constant=\"40\" id=\"Z20-Nc-ht8\"/>\n                            <constraint firstAttribute=\"trailing\" secondItem=\"Fvo-1U-W5h\" secondAttribute=\"trailing\" constant=\"40\" id=\"lOV-NS-5pg\"/>\n                        </constraints>\n                    </view>\n                    <connections>\n                        <outlet property=\"demoLabel\" destination=\"Fvo-1U-W5h\" id=\"yJt-rV-JdR\"/>\n                    </connections>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"dkx-z0-nzr\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n        </scene>\n    </scenes>\n</document>\n"
  },
  {
    "path": "HYLabelDemoOC/HYLabelDemoOC/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>UILaunchStoryboardName</key>\n\t<string>LaunchScreen</string>\n\t<key>UIMainStoryboardFile</key>\n\t<string>Main</string>\n\t<key>UIRequiredDeviceCapabilities</key>\n\t<array>\n\t\t<string>armv7</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "HYLabelDemoOC/HYLabelDemoOC/Source/HYLabel.swift",
    "content": "//\n//  HYLabel.swift\n//  HYLabel\n//\n//  Created by apple on 16/3/8.\n//  Copyright © 2016年 xiaomage. All rights reserved.\n//\n\nimport UIKit\n\nenum TapHandlerType : Int {\n    case noneHandle = 0\n    case userHandle = 1\n    case topicHandle = 2\n    case linkHandle = 3\n}\n\npublic class HYLabel: UILabel {\n    \n    // MARK:- 属性\n    // 重写系统的属性\n    override public var text : String? {\n        didSet {\n            prepareText()\n        }\n    }\n    \n    override public var attributedText: NSAttributedString? {\n        didSet {\n            prepareText()\n        }\n    }\n    \n    override public var font: UIFont! {\n        didSet {\n            prepareText()\n        }\n    }\n    \n    override public var textColor: UIColor! {\n        didSet {\n            prepareText()\n        }\n    }\n    \n    // 懒加载属性\n    private lazy var textStorage : NSTextStorage = NSTextStorage() // NSMutableAttributeString的子类\n    private lazy var layoutManager : NSLayoutManager = NSLayoutManager() // 布局管理者\n    private lazy var textContainer : NSTextContainer = NSTextContainer() // 容器,需要设置容器的大小\n    \n    // 用于记录下标值\n    private lazy var linkRanges : [NSRange] = [NSRange]()\n    private lazy var userRanges : [NSRange] = [NSRange]()\n    private lazy var topicRanges : [NSRange] = [NSRange]()\n    \n    // 用于记录用户选中的range\n    private var selectedRange : NSRange?\n    \n    // 用户记录点击还是松开\n    private var isSelected : Bool = false\n    \n    // 闭包属性,用于回调\n    private var tapHandlerType : TapHandlerType = TapHandlerType.noneHandle\n    \n    public typealias HYTapHandler = (HYLabel, String, NSRange) -> Void\n    public var linkTapHandler : HYTapHandler?\n    public var topicTapHandler : HYTapHandler?\n    public var userTapHandler : HYTapHandler?\n    \n    // MARK:- 构造函数\n    override init(frame: CGRect) {\n        super.init(frame: frame)\n        \n        prepareTextSystem()\n    }\n    \n    required public init?(coder aDecoder: NSCoder) {\n        super.init(coder: aDecoder)\n        \n        prepareTextSystem()\n    }\n    \n    // MARK:- 布局子控件\n    override public func layoutSubviews() {\n        super.layoutSubviews()\n        \n        // 设置容器的大小为Label的尺寸\n        textContainer.size = frame.size\n    }\n    \n    // MARK:- 重写drawTextInRect方法\n    override public func drawTextInRect(rect: CGRect) {\n        // 1.绘制背景\n        if selectedRange != nil {\n            // 2.0.确定颜色\n            let selectedColor = isSelected ? UIColor(white: 0.7, alpha: 0.2) : UIColor.clearColor()\n            \n            // 2.1.设置颜色\n            textStorage.addAttribute(NSBackgroundColorAttributeName, value: selectedColor, range: selectedRange!)\n            \n            // 2.2.绘制背景\n            layoutManager.drawBackgroundForGlyphRange(selectedRange!, atPoint: CGPoint(x: 0, y: 0))\n        }\n        \n        // 2.绘制字形\n        // 需要绘制的范围\n        let range = NSRange(location: 0, length: textStorage.length)\n        layoutManager.drawGlyphsForGlyphRange(range, atPoint: CGPointZero)\n    }\n}\n\nextension HYLabel {\n    /// 准备文本系统\n    private func prepareTextSystem() {\n        // 0.准备文本\n        prepareText()\n        \n        // 1.将布局添加到storeage中\n        textStorage.addLayoutManager(layoutManager)\n        \n        // 2.将容器添加到布局中\n        layoutManager.addTextContainer(textContainer)\n        \n        // 3.让label可以和用户交互\n        userInteractionEnabled = true\n        \n        // 4.设置间距为0\n        textContainer.lineFragmentPadding = 0\n    }\n    \n    /// 准备文本\n    private func prepareText() {\n        // 1.准备字符串\n        var attrString : NSAttributedString?\n        if attributedText != nil {\n            attrString = attributedText\n        } else if text != nil {\n            attrString = NSAttributedString(string: text!)\n        } else {\n            attrString = NSAttributedString(string: \"\")\n        }\n        \n        selectedRange = nil\n        \n        // 2.设置换行模型\n        let attrStringM = addLineBreak(attrString!)\n        \n        attrStringM.addAttribute(NSFontAttributeName, value: font, range: NSRange(location: 0, length: attrStringM.length))\n        \n        // 3.设置textStorage的内容\n        textStorage.setAttributedString(attrStringM)\n        \n        // 4.匹配URL\n        if let linkRanges = getLinkRanges() {\n            self.linkRanges = linkRanges\n            for range in linkRanges {\n                textStorage.addAttribute(NSForegroundColorAttributeName, value: UIColor.blueColor(), range: range)\n            }\n        }\n        \n        // 5.匹配@用户\n        if let userRanges = getRanges(\"@[\\\\u4e00-\\\\u9fa5a-zA-Z0-9_-]*\") {\n            self.userRanges = userRanges\n            for range in userRanges {\n                textStorage.addAttribute(NSForegroundColorAttributeName, value: UIColor.blueColor(), range: range)\n            }\n        }\n        \n        \n        // 6.匹配话题##\n        if let topicRanges = getRanges(\"#.*?#\") {\n            self.topicRanges = topicRanges\n            for range in topicRanges {\n                textStorage.addAttribute(NSForegroundColorAttributeName, value: UIColor.blueColor(), range: range)\n            }\n        }\n        \n        setNeedsDisplay()\n    }\n}\n\n\n// MARK:- 字符串匹配封装\nextension HYLabel {\n    private func getRanges(pattern : String) -> [NSRange]? {\n        // 创建正则表达式对象\n        guard let regex = try? NSRegularExpression(pattern: pattern, options: []) else {\n            return nil\n        }\n        \n        return getRangesFromResult(regex)\n    }\n    \n    private func getLinkRanges() -> [NSRange]? {\n        // 创建正则表达式\n        guard let detector = try? NSDataDetector(types: NSTextCheckingType.Link.rawValue) else {\n            return nil\n        }\n        \n        return getRangesFromResult(detector)\n    }\n    \n    private func getRangesFromResult(regex : NSRegularExpression) -> [NSRange] {\n        // 1.匹配结果\n        let results = regex.matchesInString(textStorage.string, options: [], range: NSRange(location: 0, length: textStorage.length))\n        \n        // 2.遍历结果\n        var ranges = [NSRange]()\n        for res in results {\n            ranges.append(res.range)\n        }\n        \n        return ranges\n    }\n}\n\n\n// MARK:- 点击交互的封装\nextension HYLabel {\n    override public func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {\n        // 0.记录点击\n        isSelected = true\n        \n        // 1.获取用户点击的点\n        let selectedPoint = touches.first!.locationInView(self)\n        \n        // 2.获取该点所在的字符串的range\n        selectedRange = getSelectRange(selectedPoint)\n        \n        // 3.是否处理了事件\n        if selectedRange == nil {\n            super.touchesBegan(touches, withEvent: event)\n        }\n    }\n    \n    override public func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) {\n        if selectedRange == nil {\n            super.touchesBegan(touches, withEvent: event)\n            return\n        }\n        \n        // 0.记录松开\n        isSelected = false\n        \n        // 2.重新绘制\n        setNeedsDisplay()\n        \n        // 3.取出内容\n        let contentText = (textStorage.string as NSString).substringWithRange(selectedRange!)\n        \n        // 3.回调\n        switch tapHandlerType {\n        case .linkHandle:\n            if linkTapHandler != nil {\n                linkTapHandler!(self, contentText, selectedRange!)\n            }\n        case .topicHandle:\n            if topicTapHandler != nil {\n                topicTapHandler!(self, contentText, selectedRange!)\n            }\n        case .userHandle:\n            if userTapHandler != nil {\n                userTapHandler!(self, contentText, selectedRange!)\n            }\n        default:\n            break\n        }\n    }\n    \n    private func getSelectRange(selectedPoint : CGPoint) -> NSRange? {\n        // 0.如果属性字符串为nil,则不需要判断\n        if textStorage.length == 0 {\n            return nil\n        }\n        \n        // 1.获取选中点所在的下标值(index)\n        let index = layoutManager.glyphIndexForPoint(selectedPoint, inTextContainer: textContainer)\n        \n        // 2.判断下标在什么内\n        // 2.1.判断是否是一个链接\n        for linkRange in linkRanges {\n            if index > linkRange.location && index < linkRange.location + linkRange.length {\n                setNeedsDisplay()\n                tapHandlerType = .linkHandle\n                return linkRange\n            }\n        }\n        \n        // 2.2.判断是否是一个@用户\n        for userRange in userRanges {\n            if index > userRange.location && index < userRange.location + userRange.length {\n                setNeedsDisplay()\n                tapHandlerType = .userHandle\n                return userRange\n            }\n        }\n        \n        // 2.3.判断是否是一个#话题#\n        for topicRange in topicRanges {\n            if index > topicRange.location && index < topicRange.location + topicRange.length {\n                setNeedsDisplay()\n                tapHandlerType = .topicHandle\n                return topicRange\n            }\n        }\n        \n        return nil\n    }\n}\n\n// MARK:- 补充\nextension HYLabel {\n    /// 如果用户没有设置lineBreak,则所有内容会绘制到同一行中,因此需要主动设置\n    private func addLineBreak(attrString: NSAttributedString) -> NSMutableAttributedString {\n        let attrStringM = NSMutableAttributedString(attributedString: attrString)\n        \n        if attrStringM.length == 0 {\n            return attrStringM\n        }\n        \n        var range = NSRange(location: 0, length: 0)\n        var attributes = attrStringM.attributesAtIndex(0, effectiveRange: &range)\n        var paragraphStyle = attributes[NSParagraphStyleAttributeName] as? NSMutableParagraphStyle\n        \n        if paragraphStyle != nil {\n            paragraphStyle!.lineBreakMode = NSLineBreakMode.ByWordWrapping\n        } else {\n            paragraphStyle = NSMutableParagraphStyle()\n            paragraphStyle!.lineBreakMode = NSLineBreakMode.ByWordWrapping\n            attributes[NSParagraphStyleAttributeName] = paragraphStyle\n            \n            attrStringM.setAttributes(attributes, range: range)\n        }\n        \n        return attrStringM\n    }\n}\n"
  },
  {
    "path": "HYLabelDemoOC/HYLabelDemoOC/ViewController.h",
    "content": "//\n//  ViewController.h\n//  HYLabelDemoOC\n//\n//  Created by apple on 16/3/15.\n//  Copyright © 2016年 xiaomage. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\n@interface ViewController : UIViewController\n\n\n@end\n\n"
  },
  {
    "path": "HYLabelDemoOC/HYLabelDemoOC/ViewController.m",
    "content": "//\n//  ViewController.m\n//  HYLabelDemoOC\n//\n//  Created by apple on 16/3/15.\n//  Copyright © 2016年 xiaomage. All rights reserved.\n//\n\n#import \"ViewController.h\"\n#import \"HYLabelDemoOC-Swift.h\"\n\n@interface ViewController ()\n\n@property (weak, nonatomic) IBOutlet HYLabel *demoLabel;\n\n@end\n\n@implementation ViewController\n\n- (void)viewDidLoad {\n    [super viewDidLoad];\n    \n    self.demoLabel.userTapHandler = ^(HYLabel *label, NSString *user, NSRange range){\n        NSLog(@\"%@\", label);\n        NSLog(@\"%@\", user);\n        NSLog(@\"%@\", NSStringFromRange(range));\n    };\n    \n    self.demoLabel.linkTapHandler = ^(HYLabel *label, NSString *link, NSRange range){\n        NSLog(@\"%@\", label);\n        NSLog(@\"%@\", link);\n        NSLog(@\"%@\", NSStringFromRange(range));\n    };\n    \n    self.demoLabel.userTapHandler = ^(HYLabel *label, NSString *topic, NSRange range){\n        NSLog(@\"%@\", label);\n        NSLog(@\"%@\", topic);\n        NSLog(@\"%@\", NSStringFromRange(range));\n    };\n}\n\n- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event\n{\n    self.demoLabel.text = @\"作者:@coderwhy 话题:#Label字符串识别# 网址:http://www.520it.com\";\n}\n\n@end\n"
  },
  {
    "path": "HYLabelDemoOC/HYLabelDemoOC/main.m",
    "content": "//\n//  main.m\n//  HYLabelDemoOC\n//\n//  Created by apple on 16/3/15.\n//  Copyright © 2016年 xiaomage. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n#import \"AppDelegate.h\"\n\nint main(int argc, char * argv[]) {\n    @autoreleasepool {\n        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));\n    }\n}\n"
  },
  {
    "path": "HYLabelDemoOC/HYLabelDemoOC.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t18B0EE1F1C97B4F700BD3B93 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 18B0EE1E1C97B4F700BD3B93 /* main.m */; };\n\t\t18B0EE221C97B4F700BD3B93 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 18B0EE211C97B4F700BD3B93 /* AppDelegate.m */; };\n\t\t18B0EE251C97B4F700BD3B93 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 18B0EE241C97B4F700BD3B93 /* ViewController.m */; };\n\t\t18B0EE281C97B4F700BD3B93 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 18B0EE261C97B4F700BD3B93 /* Main.storyboard */; };\n\t\t18B0EE2A1C97B4F700BD3B93 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 18B0EE291C97B4F700BD3B93 /* Assets.xcassets */; };\n\t\t18B0EE2D1C97B4F700BD3B93 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 18B0EE2B1C97B4F700BD3B93 /* LaunchScreen.storyboard */; };\n\t\t18B0EE391C97B6C500BD3B93 /* HYLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18B0EE381C97B6C500BD3B93 /* HYLabel.swift */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXFileReference section */\n\t\t18B0EE1A1C97B4F700BD3B93 /* HYLabelDemoOC.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HYLabelDemoOC.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t18B0EE1E1C97B4F700BD3B93 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = \"<group>\"; };\n\t\t18B0EE201C97B4F700BD3B93 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t18B0EE211C97B4F700BD3B93 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = \"<group>\"; };\n\t\t18B0EE231C97B4F700BD3B93 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = \"<group>\"; };\n\t\t18B0EE241C97B4F700BD3B93 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = \"<group>\"; };\n\t\t18B0EE271C97B4F700BD3B93 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = \"<group>\"; };\n\t\t18B0EE291C97B4F700BD3B93 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = \"<group>\"; };\n\t\t18B0EE2C1C97B4F700BD3B93 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = \"<group>\"; };\n\t\t18B0EE2E1C97B4F700BD3B93 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t18B0EE381C97B6C500BD3B93 /* HYLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HYLabel.swift; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t18B0EE171C97B4F700BD3B93 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t18B0EE111C97B4F700BD3B93 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t18B0EE1C1C97B4F700BD3B93 /* HYLabelDemoOC */,\n\t\t\t\t18B0EE1B1C97B4F700BD3B93 /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t18B0EE1B1C97B4F700BD3B93 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t18B0EE1A1C97B4F700BD3B93 /* HYLabelDemoOC.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t18B0EE1C1C97B4F700BD3B93 /* HYLabelDemoOC */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t18B0EE371C97B6C500BD3B93 /* Source */,\n\t\t\t\t18B0EE201C97B4F700BD3B93 /* AppDelegate.h */,\n\t\t\t\t18B0EE211C97B4F700BD3B93 /* AppDelegate.m */,\n\t\t\t\t18B0EE231C97B4F700BD3B93 /* ViewController.h */,\n\t\t\t\t18B0EE241C97B4F700BD3B93 /* ViewController.m */,\n\t\t\t\t18B0EE261C97B4F700BD3B93 /* Main.storyboard */,\n\t\t\t\t18B0EE291C97B4F700BD3B93 /* Assets.xcassets */,\n\t\t\t\t18B0EE2B1C97B4F700BD3B93 /* LaunchScreen.storyboard */,\n\t\t\t\t18B0EE2E1C97B4F700BD3B93 /* Info.plist */,\n\t\t\t\t18B0EE1D1C97B4F700BD3B93 /* Supporting Files */,\n\t\t\t);\n\t\t\tpath = HYLabelDemoOC;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t18B0EE1D1C97B4F700BD3B93 /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t18B0EE1E1C97B4F700BD3B93 /* main.m */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t18B0EE371C97B6C500BD3B93 /* Source */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t18B0EE381C97B6C500BD3B93 /* HYLabel.swift */,\n\t\t\t);\n\t\t\tpath = Source;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t18B0EE191C97B4F700BD3B93 /* HYLabelDemoOC */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 18B0EE311C97B4F700BD3B93 /* Build configuration list for PBXNativeTarget \"HYLabelDemoOC\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t18B0EE161C97B4F700BD3B93 /* Sources */,\n\t\t\t\t18B0EE171C97B4F700BD3B93 /* Frameworks */,\n\t\t\t\t18B0EE181C97B4F700BD3B93 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = HYLabelDemoOC;\n\t\t\tproductName = HYLabelDemoOC;\n\t\t\tproductReference = 18B0EE1A1C97B4F700BD3B93 /* HYLabelDemoOC.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t18B0EE121C97B4F700BD3B93 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0720;\n\t\t\t\tORGANIZATIONNAME = xiaomage;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t18B0EE191C97B4F700BD3B93 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 7.2;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 18B0EE151C97B4F700BD3B93 /* Build configuration list for PBXProject \"HYLabelDemoOC\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 18B0EE111C97B4F700BD3B93;\n\t\t\tproductRefGroup = 18B0EE1B1C97B4F700BD3B93 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t18B0EE191C97B4F700BD3B93 /* HYLabelDemoOC */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t18B0EE181C97B4F700BD3B93 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t18B0EE2D1C97B4F700BD3B93 /* LaunchScreen.storyboard in Resources */,\n\t\t\t\t18B0EE2A1C97B4F700BD3B93 /* Assets.xcassets in Resources */,\n\t\t\t\t18B0EE281C97B4F700BD3B93 /* Main.storyboard in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t18B0EE161C97B4F700BD3B93 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t18B0EE251C97B4F700BD3B93 /* ViewController.m in Sources */,\n\t\t\t\t18B0EE391C97B6C500BD3B93 /* HYLabel.swift in Sources */,\n\t\t\t\t18B0EE221C97B4F700BD3B93 /* AppDelegate.m in Sources */,\n\t\t\t\t18B0EE1F1C97B4F700BD3B93 /* main.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXVariantGroup section */\n\t\t18B0EE261C97B4F700BD3B93 /* Main.storyboard */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t18B0EE271C97B4F700BD3B93 /* Base */,\n\t\t\t);\n\t\t\tname = Main.storyboard;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t18B0EE2B1C97B4F700BD3B93 /* LaunchScreen.storyboard */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t18B0EE2C1C97B4F700BD3B93 /* Base */,\n\t\t\t);\n\t\t\tname = LaunchScreen.storyboard;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\t18B0EE2F1C97B4F700BD3B93 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t18B0EE301C97B4F700BD3B93 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 9.2;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t18B0EE321C97B4F700BD3B93 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tINFOPLIST_FILE = HYLabelDemoOC/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.520it.HYLabelDemoOC;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t18B0EE331C97B4F700BD3B93 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tINFOPLIST_FILE = HYLabelDemoOC/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.520it.HYLabelDemoOC;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t18B0EE151C97B4F700BD3B93 /* Build configuration list for PBXProject \"HYLabelDemoOC\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t18B0EE2F1C97B4F700BD3B93 /* Debug */,\n\t\t\t\t18B0EE301C97B4F700BD3B93 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t18B0EE311C97B4F700BD3B93 /* Build configuration list for PBXNativeTarget \"HYLabelDemoOC\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t18B0EE321C97B4F700BD3B93 /* Debug */,\n\t\t\t\t18B0EE331C97B4F700BD3B93 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 18B0EE121C97B4F700BD3B93 /* Project object */;\n}\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2016 coderwhy\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# HYLabel\n### 框架的作用\n* 用于识别Label中的@用户-话题##-链接\n* 框架地址:[https://github.com/coderwhy/HYLabel](https://github.com/coderwhy/HYLabel)\n\n### 使用效果\n* 如图所示\n* 并且可以监听点击<br>\n* ![image](https://raw.githubusercontent.com/coderwhy/HYLabel/master/ReadmeImage/image1.png)\n\n\n### 使用方式\n* 导入框架\n\t* 直接将HYLabel.swift拖入项目\n\t* 该框架支持cocoapods:pod 'HYLabel', '~> 1.0.1'\n* 将UIlabel修改为HYLabel\n* 按照下列方式监听点击即可\n* OC监听方式\n\n```objc\n\n    self.demoLabel.userTapHandler = ^(HYLabel *label, NSString *user, NSRange range){\n        NSLog(@\"%@\", label);\n        NSLog(@\"%@\", user);\n        NSLog(@\"%@\", NSStringFromRange(range));\n    };\n    \n    self.demoLabel.linkTapHandler = ^(HYLabel *label, NSString *link, NSRange range){\n        NSLog(@\"%@\", label);\n        NSLog(@\"%@\", link);\n        NSLog(@\"%@\", NSStringFromRange(range));\n    };\n    \n    self.demoLabel.userTapHandler = ^(HYLabel *label, NSString *topic, NSRange range){\n        NSLog(@\"%@\", label);\n        NSLog(@\"%@\", topic);\n        NSLog(@\"%@\", NSStringFromRange(range));\n    };\n```\n\n* swift监听方式\n\n```swift\n\n    // 监听@谁谁谁的点击\n    demoLabel.userTapHandler = { (label, user, range) in\n        print(label)\n        print(user)\n        print(range)\n    }\n    \n    // 监听链接的点击\n    demoLabel.linkTapHandler = { (label, link, range) in\n        print(label)\n        print(link)\n        print(range)\n    }\n    \n    // 监听话题的点击\n    demoLabel.topicTapHandler = { (label, topic, range) in\n        print(label)\n        print(topic)\n        print(range)\n    }\n```\n\n\n\n"
  }
]