Xcode has a multi-platform app project template that gives you one app target with destinations for iOS, iPad, and Mac. Use this template if you want people to have access to all three versions with one purchase. Create separate targets if you want to require separate purchases to access each person.
Regarding the views, if you have separate targets, you can create view files that apply to a specific target. A Mac version of the view would be part of the Mac app target but not the iOS version.
If you go with the multiplatform-app template, you can create view files that apply to only one platform. Go to the target's Compile Sources build phases and specify the platforms to build for. More details about the multi-platform app template are in the following article:
swiftdevjournal.com/xcode-multiplatform-app-targets/