Skip to content

jukai9316/OCtoSwift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OCtoSwift

OC调用Swift

ViewController.m中 下面方法调用SeconViewController,SeconViewController是swift创建的

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{

SeconViewController *vc = [[SeconViewController alloc]init];
[vc seconViewFunc];
vc.delegate = self;
[self.navigationController pushViewController:vc animated:YES];

}

在SeconViewController中,通过SwiftViewDelegate代理的方式,可以给ViewController反向传值 override func touchesBegan(_ touches: Set, with event: UIEvent?) { //代理 self.delegate?.removeSwiftView() }

About

OC调用Swift

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published