Skip to content

Swiftlint Type Violation #20

Discussion options

You must be logged in to vote

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

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@sherryycxie
Comment options

sherryycxie Jan 25, 2023
Collaborator Author

@vishnuravi
Comment options

Answer selected by vishnuravi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants