ApplicationDelegate.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright 2017 Google
  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 <UIKit/UIKit.h>
  17. NS_ASSUME_NONNULL_BEGIN
  18. @protocol OpenURLDelegate <NSObject>
  19. /** @fn handleOpenURL:sourceApplication:
  20. @brief Handles application:openURL:... methods for @c UIApplicationDelegate .
  21. */
  22. - (BOOL)handleOpenURL:(NSURL *)url sourceApplication:(nullable NSString *)sourceApplication;
  23. @end
  24. /** @class ApplicationDelegate
  25. @brief The sample application's delegate.
  26. */
  27. @interface ApplicationDelegate : UIResponder <UIApplicationDelegate>
  28. /** @property window
  29. @brief The sample application's @c UIWindow.
  30. */
  31. @property(strong, nonatomic) UIWindow *window;
  32. /** @fn setOpenURLDelegate:
  33. @brief Sets the delegate to handle application:openURL:... methods.
  34. @param openURLDelegate The delegate which is not retained by this method.
  35. */
  36. + (void)setOpenURLDelegate:(nullable id<OpenURLDelegate>)openURLDelegate;
  37. @end
  38. NS_ASSUME_NONNULL_END