轻松复制 UILabel 文本:简单易用的类别

想要为你的 UILabel 添加复制功能?UILabel+Copyable 类别让这变得轻而易举。它支持用故事板和代码创建界面,并允许你通过长按手势复制文本。你甚至可以自由选择开启或关闭复制功能。

开始使用

最方便的安装方法是使用 CocoaPods:

pod 'UILabel+Copyable', '~> 2.0'

你也可以手动将 UILabel+Copyable.swift 文件添加到你的项目中。

如何使用

导入模块:

import UILabel_Copyable

然后将 isCopyingEnabled 属性设置为 true

let label = UILabel()
label.isCopyingEnabled = true

现在,你的 UILabel 就可以复制文本啦!

zip
UILabel-Copyable-master.zip 预估大小:31个文件
folder
UILabel-Copyable-master 文件夹
file
.travis.yml 341B
file
.slather.yml 178B
file
Rakefile 2KB
folder
Demo 文件夹
file
main.m 342B
folder
Controllers 文件夹
file
AppDelegate.h 292B
file
AppDelegate.m 372B
file
ViewController.h 228B
file
ViewController.m 676B
folder
UILabel+Copyable Demo.xcodeproj 文件夹
folder
project.xcworkspace 文件夹
file
contents.xcworkspacedata 166B
folder
xcshareddata 文件夹
file
IDEWorkspaceChecks.plist 238B
file
project.pbxproj 16KB
folder
xcshareddata 文件夹
folder
xcschemes 文件夹
file
UILabel+Copyable Demo.xcscheme 4KB
file
Default-568h@2x.png 18KB
folder
Resources 文件夹
folder
Base.lproj 文件夹
file
Main.storyboard 10KB
folder
Images.xcassets 文件夹
folder
AppIcon.appiconset 文件夹
file
Contents.json 2KB
file
Contents.json 62B
file
Info.plist 2KB
file
LICENSE.md 1KB
file
.gitignore 274B
file
CHANGELOG.md 173B
folder
UILabel+CopyableTests 文件夹
file
UILabel_CopyableTests.swift 3KB
file
Info.plist 727B
file
README.md 2KB
folder
UILabel+Copyable.xcodeproj 文件夹
folder
project.xcworkspace 文件夹
file
contents.xcworkspacedata 83B
folder
xcshareddata 文件夹
file
IDEWorkspaceChecks.plist 238B
file
project.pbxproj 19KB
folder
xcshareddata 文件夹
folder
xcschemes 文件夹
file
UILabel+Copyable.xcscheme 3KB
file
UILabel+Copyable.podspec 1KB
folder
UILabel+Copyable 文件夹
file
UILabel_Copyable.h 573B
file
Info.plist 752B
file
UILabel+Copyable.swift 5KB
zip 文件大小:31.97KB