我正在编写一个用Objective-C编写的项目。 当前的应用程序有三个基于环境的目标(Dev,Prelive和Live)。
现在我必须添加必须用Swift语言编写的新功能。 我遵循这个链接和应用程序在开发目标(即环境)中成功编译。
在objective-C文件中,我添加了如下标题
#import“Dev-Swift.h”
我已经在多个文件中导入了'Dev-Swift.h'之上。
现在的问题是,我有三个目标,并假设如果我必须运行任何其他目标(说Prelive),那么我必须在多个文件中再次对头进行更改,这将是
导入“Prelive-Swift.h”
这将是一项艰巨的任务,并可能在改变目标的同时引发错误。
任何人都可以建议如何解决这个问题。 每当我改变目标时我都不想要改变标题。
如果我更多地澄清问题,请告诉我。
I am working on a project written in Objective-C. Current app has three target based on environment(Dev, Prelive and Live).
Now I have to add new functionality which must be written in Swift language. I follow this link and app complied successfully in Dev target (i.e. Environment) .
In objective-C files I have added header as below
#import "Dev-Swift.h"
and I have imported above 'Dev-Swift.h' in multiple files.
Now issue is that I have three target and suppose If I have to run on any other target(Say Prelive) then I have to made changes with header again in multiple files & it will be
import "Prelive-Swift.h"
which will be again a tough task & may leads error while changing target.
Can any one suggest how to tackle this issue. I do not want change header every time when I change target.
Let me know if I have clarify question more.
最满意答案
你是否尝试为三种环境设置相同的名称? 在这种情况下,您不需要每次都像这样更改文件名称:
did you try to put the same name for the three environment. in this case you don't need to change the file name each time like this :
更多推荐
发布评论