GULSwizzledObject.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright 2018 Google LLC
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. @class GULObjectSwizzler;
  18. /** This class exists as a method donor. These methods will be added to all objects that are
  19. * swizzled by the object swizzler. This class should not be instantiated.
  20. */
  21. @interface GULSwizzledObject : NSObject
  22. - (instancetype)init NS_UNAVAILABLE;
  23. /** Copies the methods below to the swizzled object.
  24. *
  25. * @param objectSwizzler The swizzler to use when adding the methods below.
  26. */
  27. + (void)copyDonorSelectorsUsingObjectSwizzler:(GULObjectSwizzler *)objectSwizzler;
  28. #pragma mark - Donor methods.
  29. /** @return The generated subclass. Used in respondsToSelector: calls. */
  30. - (Class)gul_class;
  31. /** @return The object swizzler that manages this object. */
  32. - (GULObjectSwizzler *)gul_objectSwizzler;
  33. @end