iosiOS_UIKit

UIDragInteraction拖拽UIDropInterac

2018-05-14  本文已影响1人  絮语时光杨

if (IOS11) {
UIDragInteraction* drag = [[UIDragInteraction alloc] initWithDelegate:self];
[self addInteraction:drag];
self.userInteractionEnabled = true;
}
**************代理
API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(watchos, tvos) @protocol UIDragInteractionDelegate <NSObject>
@required
//提供数据源 长按UI开始拖拽

API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(watchos, tvos) @protocol UIDropInteractionDelegate <NSObject>

@optional
//是否可以处理来自Drag的数据

上一篇 下一篇

猜你喜欢

热点阅读