Skip to content

UIViewController viewIsAppearing is not supported by type_contents_order rule #5259

Description

@way-to-code

New Issue Checklist

Describe the bug

Since Xcode 15 SDK Apple introduced a new UIViewController life cycle method viewIsAppearing(_:). The official documentation for the new method can be found here.

As for now type_contents_order rule considers the new method as other_method that is not correct. The new method should be considered as view_life_cycle_method.

Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint
Linting Swift files in current working directory
Linting 'ViewController.swift' (1/3)
ViewController.swift:15:14: warning: Type Contents Order Violation: An 'other_method' should not be placed amongst the type content(s) 'view_life_cycle_method' (type_contents_order)
Done linting! Found 1 violation, 0 serious in 3 files.

Environment

  • SwiftLint version: 0.53.0
  • Installation method used: pkg file
  • Configuration file:
only_rules:
    - type_contents_order
  • Are you using nested configurations?
    No

  • Which Xcode version are you using (check xcodebuild -version)?
    Xcode 15.0 Build version 15A240d

  • Do you have a sample that shows the issue?

    final class ViewController: UIViewController {
        override func viewDidLoad() {
            super.viewDidLoad()
        }
        
        override func viewIsAppearing(_ animated: Bool) {
            super.viewIsAppearing(animated)
        }
        
        override func viewDidAppear(_ animated: Bool) {
            super.viewDidAppear(animated)
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementIdeas for improvements of existing features and rules.good first issueIssue to be taken up by new contributors yet unfamiliar with the project.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions