Swiftlint Type Violation #20
Answered
by
vishnuravi
sherryycxie
asked this question in
Technical Questions
-
Beta Was this translation helpful? Give feedback.
Answered by
vishnuravi
Jan 25, 2023
Replies: 1 comment 2 replies
-
Hey @sherryycxie, the issue here is that SwiftLint wants your type properties (i.e. static properties) to be declared first in your struct, then your instance properties: struct Page: Identifiable, Equatable {
static var samplePage = ...
static var samplePages = ...
let id = UUID()
var name: String
var description: String
var imageUrl: String
var tag: Int
} You can see an example of the full order of subtypes, properties, methods, etc. here: https://realm.github.io/SwiftLint/type_contents_order.html |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
vishnuravi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @sherryycxie, the issue here is that SwiftLint wants your type properties (i.e. static properties) to be declared first in your struct, then your instance properties:
You can see an example of the full order of subtypes, properties, methods, etc. here: https://realm.github.io/SwiftLint/type_contents_order.html