swift 各种学习

本文介绍如何在Swift项目中通过CocoaPods引入OC第三方库,并配置桥接文件;同时分享了Swift中使用Selector的方法以及调试模式下的注意事项。

 

 

 

swift使用cocoapods引用oc第三方库

1. 创建桥接文件

2. 在主工程的 build Settings 搜索 bridge   设置 Objective-C Bridging Heading  为刚刚创建的文件

3. pod update

4. 在主工程的 build Settings 搜索 search paths  设置 User Header Search Path 为  $(SRCROOT)  然后选择 recursive(默认的是 nonrecursive)

 


 

swift lldb 调试出错

http://www.jianshu.com/p/9d030b03dd8b


swift 使用selector 问题

 

@objc func refresh() {
        print("refresh")
        })
    }

let action = #selector(refresh)

 

记得一定需要在 func 前面加上 @objc 要不然会出现错误!!! 



 

swift debug 模式 release 模式

http://www.jianshu.com/p/19f6de25e566 

        #if DEBUG1
            print("无法输出1111111")
        #endif
        
        #if DEBUG
            print("可以输出1111111")
        #endif
        
        #if DEBUGTEST
            print("可以输出1111111")
        #endif
        
        #if DEBUGTEST2
            print("无法输出1111111")
        #endif

 

 编译出错!

 


 

转载于:https://www.cnblogs.com/xzjxylophone/p/7997868.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值