UITextField 禁用剪切板

2016-07-12  本文已影响31人  西博尔

新建一个类继承UITextField,然后实现canPerformAction方法:
.h

import <UIKit/UIKit.h>

@interface NoCopyTextField : UITextField
@end
.m

import "NoCopyTextField.h"

@implementation NoCopyTextField

用hook机制对canPerformAction 检测就好了, 很简单

上一篇 下一篇

猜你喜欢

热点阅读