Closed krzyzanowskim closed 7 years ago
it's here where the problem is visible: https://github.com/krzyzanowskim/Natalie/blame/master/natalie.swift#L958 cc @jai
the generated code doesn't compile?
In my project I have this generated code and its work (Xcode 6.3.2 and 10.10 OSX target) (not generated since all PR merge from today)
extension MyViewController {
enum Segue: String, Printable, SegueProtocol {
case add = "add"
case activate = "activate"
var kind: SegueKind? {
switch (self) {
case add:
return SegueKind(rawValue: "sheet")
case activate:
return SegueKind(rawValue: "sheet")
default:
preconditionFailure("Invalid value")
break
}
}
var destination: AnyObject.Type? {
switch (self) {
case add:
return InputController.self
default:
assertionFailure("Unknown destination")
return nil
}
}
var identifier: String? { return self.description }
var description: String { return self.rawValue }
}
}
ha! damn. it's the Swift thing. I named segue after view controller type. It seem the issue like found here: https://github.com/krzyzanowskim/Natalie/pull/32
segue have bad names, same as controller class There is no naming convention but something like ShowXxx, ToXxx or action name is better
It should be possible to have it working this way. It would require have Storyboards.swift as a separate module.
What is the support for Swift frameworks on OS X ? They are only supported on iOS 8.
Just something to think about.
@CallumOz frameworks or storyboards ? Swift is available for OS X 10.9+ and storyboards for OS X 10.10+
I thought that to have a custom module, you needed to use a pure swift Framework. Pure swift Frameworks, from my quick google search, seem to only be supported on 10.10
this https://github.com/krzyzanowskim/Natalie/blame/master/natalie.swift#L681 is not working for OSX. Do not compile. saying that Segue is not convertible to AnyObject.Type cc @phimage