5 Matching Annotations
  1. Sep 2023
    1. You can add property observers in the following places:
      • Stored properties that you define
      • Stored properties that you inherit
      • Computed properties that you inherit
      • Static Methods:

      • Static methods are defined using the static keyword.

      • They are associated with the type itself, rather than instances of the type.
      • They cannot be overridden by subclasses.
      • They cannot be dispatched dynamically at runtime based on the actual type of the instance.
      • Static methods are useful when you want to define utility or helper methods that are not tied to any specific instance of a type.
      • Static methods can only access other static members (properties or methods) of the type.

      Class Methods: * Class methods are defined using the class keyword. * They are associated with the type itself, similar to static methods. * Unlike static methods, class methods can be overridden by subclasses using the override keyword. * Class methods can be dispatched dynamically at runtime based on the actual type of the instance, allowing polymorphic behavior. * Class methods can access other class methods and properties, as well as instance methods and properties using the self keyword. * Class methods can also be used to create factory methods, which are responsible for creating and returning instances of the class.

  2. Jul 2023
    1. After the user makes a selection and determines the status, the location manager delivers the results to the delegate's locationManager(_:didChangeAuthorization:) method. If the initial authorization status is anything other than CLAuthorizationStatus.notDetermined, this method does nothing and doesn't call the locationManager(_:didChangeAuthorization:) method.Insert

    2. S - A class should have a single responsibility

      O - Classes should be open for extension, but closed for modification

      L - Objects of a superclass should be replaceable with objects of its subclass without affecting the correctness of the program

      I - Clients should not be forced to depend on methods that they do not use.

      D -  High-level modules should not depend on low-level modules. Both should depend on the abstraction. Abstractions should not depend on details. Details should depend on abstractions.