Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

给monkey加小手显示,OC项目使用monkeyPaws #29

Closed
Paulswith opened this issue Mar 21, 2018 · 0 comments
Closed

给monkey加小手显示,OC项目使用monkeyPaws #29

Paulswith opened this issue Mar 21, 2018 · 0 comments

Comments

@Paulswith
Copy link

代码入库

  • 简单粗暴的:
    monkeyPaws中的四个.swift拖到项目中

  • pod安装,但是坑略多, 真的踩坑了再at我吧~

修改如下代码

1.在AppDelegate.m:

  • 导入#import "YouProjectName-Swift.h" YouProjectName是你项目的名称
  • @interface 里新增属性@property (strong, nonatomic) MonkeyPaws *paws;
  • didFinishLaunchingWithOptions启动回调里加入代码self.paws = [[MonkeyPaws alloc] initWithView:self.window tapUIApplication:true];

2.在MonkeyPaws.swift:

  • MonkeyPaws该类需要被@objc修饰
  • 修改初始化方法init, 把参数有默认值的直接就在init内部赋值, 不要在形参占坑

改前:
image
改后:
image

嗯~ 然后呢, 其他问题看图(来自OC和Swift混编开发配置):
image

重点: 然后先别管报错, 直接试着撸起来

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant