-2

I need to develop an application which works in both iPhone and Apple Watch. Both apps have the same features like fall detection and reporting but the UI will be different in both devices. So can we have a single code base for iPhone app and Apple Watch app? Both will act as independent apps.

So, can I have the same codebase for the single application to work on both devices?

Kalyan
  • 263
  • 5
  • 22
  • 1
    You can possibly move some common functions into a shared package but you can't have a single codebase. iOS and watchOS apps have different structure and different view controller classes – Paulw11 Feb 17 '20 at 07:09
  • Thanks @Paulw11. But can we have common code apart and having the iOS app with watchkit extension so that I can use the same code base but have the UI in respective storyboards and submit iOS and Watch apps both as different apps in stores? – Kalyan Feb 17 '20 at 14:15
  • 1
    You can have common cod, but they will be separate targets. You could share some source files between target sin Xcode I guess. There is going to be a fair amount of unique code for each platform. – Paulw11 Feb 17 '20 at 19:36
  • Thanks @Paulw11. Gonna try this soon. – Kalyan Feb 19 '20 at 07:24

1 Answers1

0

Found that we can use same code base for Watch and iPhone app with different targets and can use the API calling and other common code for both the apps except the UI.

Kalyan
  • 263
  • 5
  • 22