Hi everyone.,
- I have a doubt is it possible to run 2targets at a time in xcode ?
- Is it possible to use classes of one platform and use it to run test when target platform is something else ?
Hi everyone.,
Welcome to the community!!
I am not sure I understand the questions.
You CAN run two simulators at the same time, but I believe Xcode will only allow you to run one project at a time. Although I admit have never tried to run two projects at the same time.
Blessings,
—Mark
Hi Mark,
I am running on real device not in simulator.
Reframing questions:
Hi,
Xcode can only track one device at a time but you can share classes with the latest version of Xcode and Mac OS and iOS. Just ensure you are selected added the target membership. See pict.
You may find that some code will need to be modified to run in both environments.
For example:
#if os(macOS)
if let ciColor = CIColor(color: NSColor(color)) {
try container.encode(NSColor(ciColor: ciColor).hexString(), forKey: CodingKeys.color)
}
#else
try container.encode(UIColor(color).hexString(), forKey: CodingKeys.color)
#endif
MacOS is NSColor and iOS is UIColor.
Blessings,
–Mark