项目配比
ios 2人,android 3人!
背景
之前的IOS端项目是使用OC开发的,已经到了2.0版本了,本人现在是做android客户端,但现在想加速ios的开发进度,所以,我决定使用swift参与到ios项目中。
遇到的问题
因为没有过类似的经验,所以想请教下过来人,如何用swift杀入现有的oc项目。特别是UI这块的融入,以及OC之前封装的一些工具的调用。
大家讲道理2017-04-28 09:07:48
Swift’s excellent type detection may make you uncomfortable at first, with all kinds of troublesome judgment and processing! But after you get used to it, you will find that you have never been so confident in the program you wrote
The release package will be at least 6M
larger than before because the swift runtime library needs to be packaged in it
You only need to add a header file, and all the things written in objective-c before can be used directly with confidence
Once you start using something written in objective-c before, you will most likely want to rewrite it in swift, because objective-c lacks a lot of type checking capabilities, for example: calling the objectForKey:
method in swift will usually return AnyObject, you You need to do type conversion on this
Swift will force you to consider all logically obvious wrong situations, which can reduce the chance of errors during runtime; but because of this, you will often see some "inexplicable" error reports. Read the error messages carefully, and you will find that you It’s really wrong
Most of the APIs of Objective-C were the same before. Apple just used Swift to make a layer of skin, and internally still called Objective-C. The implementation of Fundation is here: https://github.com/apple/swift- corelibs-foundation
String != NSString
Pointer variables can be very troublesome to use
....
Overall, Swift has not improved the efficiency of development (maybe the development efficiency is slower), but when your application is online, you will find that you have never been so confident about the code you wrote, because it passed the compilation code, meaning it has avoided most errors. Mixing will make the project complicated. If it is a team collaboration, everyone in the entire team should know what is going on before using Swift.
Please point out any errors :)