I am createing a Swift Framework that will support all current Apple Platforms (iOS, macOS, tvOS and maybe watchOS). Part of my goal is to create subclasses of all major controls so that code that I write uses ONE syntax so I can created projects that are “X-plat”. Since macOS uses AppKit (NSxxx) and iOS uses UIKit (UIxxx) this is part of what I wish to abstract… creating a DSxxx that will use compiler directives to create the proper code (like Xojo Target).
Now to the opinion. for all the macOS controls, there is Xojo like “lock” properties. However these properties are pretty much meaningless to iOS. So the question is, should I include non-operational versions for iOS? so that I can create a better consistency for the compiler?
something like this
#if os(macOS)
var lockLeft: Bool {
get { return getAssociated(associatedKey: &lockKeys.leftKey) }
set { setAssociated(value: newValue, associatedKey: &lockKeys.leftKey) }
}
#else
var lockLeft: Bool {
get { return false) }
set { }
}
#endif
or should I leave that up to the developer? If they were making a macOS only or iOS only app, it wouldn’t matter, but if they were making a hybrid they’d have to isolate those from the compiler manually
And yes I know about Catalyst, but that doesn’t fit the paradigm I’m using