如何使用
要运行示例项目,请克隆仓库,并首先从 Example 目录运行 pod install。
1. 创建自定义视图:GDP DemoView
GDPDemoView.h GDPDemoView.m GDPDemoView.xib
2. 前往 GDPDemoView.xib,将 文件所有者 设置为 GDPDemoView 类。
3. 将文件所有者的contentView链接到GDPDemoView.xib中的视图。
4. 在xib文件中执行你想做的操作 ...(是的)
5. 将GDPDemoView当作UIView使用。
(1) 通过代码
GDPDemoView *demoView = [[GDPDemoView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)];
demoView.detail = @"GDPDemoView, Init by code!";
demoView.contentView.backgroundColor = UIColor.redColor;
[self.view addSubview:demoView];(2) 在Xib/Storyboard中
6. 快照
需求
iOS 8+ Xcode 10+
安装
GDPView可通过CocoaPods获取。要安装它,只需将以下行添加到您的Podfile中
pod 'GDPView'作者
宇园: [email protected], [email protected] 来自稿定(厦门)科技有限公司 https://www.gaoding.com/
许可协议
GDPView遵循MIT许可协议。详见LICENSE文件获取更多信息。



