Skip to content

Instantly share code, notes, and snippets.

@steipete
Created March 26, 2020 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steipete/0752db09a3ae12d9bf0b3eef0ed4a4c9 to your computer and use it in GitHub Desktop.
Save steipete/0752db09a3ae12d9bf0b3eef0ed4a4c9 to your computer and use it in GitHub Desktop.
Support Pointer Interactions while CI still running on Xcode 11.3
//
// Copyright © 2020 PSPDFKit GmbH. All rights reserved.
//
// THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
// AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
// UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
// This notice may not be removed from this file.
//
#import <Foundation/Foundation.h>
// Compatibility with Xcode 11.2/11.3 (CI)
#if !__has_include(<UIKit/UIPointerRegion.h>)
NS_ASSUME_NONNULL_BEGIN
PSPDF_UNGUARDED_AVAILABILITY_BEGIN
typedef NS_OPTIONS(NSUInteger, UIAxis) {
UIAxisNeither = 0,
UIAxisHorizontal = 1 << 0,
UIAxisVertical = 1 << 1,
UIAxisBoth = (UIAxisHorizontal | UIAxisVertical),
};
@class UIPointerInteraction, UITargetedPreview;
// merci to https://pastebin.com/f7wm3sr7
@interface UIPointerInteractionAnimator: NSObject
- (void)addAnimations:(void(^)(void))animations;
- (void)addCompletion:(void(^)(BOOL finished))completion;
@end
@interface UIPointerEffect : NSObject
@property (nonatomic, copy, readonly) UITargetedPreview *preview;
+ (instancetype)effectWithPreview:(UITargetedPreview *)preview;
@end
@interface UIPointerRegionRequest : NSObject
@property (nonatomic, readonly) CGPoint location;
@end
@interface UIPointerShape: NSObject
+ (instancetype)shapeWithPath:(UIBezierPath *)path;
+ (instancetype)shapeWithRoundedRect:(CGRect)rect cornerRadius:(CGFloat)radius;
+ (instancetype)beamWithPreferredLength:(CGFloat)preferredLength axis:(UIAxis)axis;
@end
@interface UIPointerRegion : NSObject
@property (nonatomic, readonly) CGRect rect;
@property (nonatomic, readonly, nullable) id<NSObject> identifier;
+ (instancetype)regionWithRect:(CGRect)rect identifier:(NSString *)identifier;
@end
@interface UIPointerStyle : NSObject
+ (instancetype)styleWithEffect:(UIPointerEffect *)effect shape:(nullable UIPointerShape *)shape;
+ (instancetype)styleWithShape:(UIPointerShape *)shape constrainedAxes:(UIAxis)axes;
+ (instancetype)hiddenPointerStyle;
@end
@interface UIButton (PSPDFPointerInteraction)
@property (nonatomic, readwrite, assign, getter = isPointerInteractionEnabled) BOOL pointerInteractionEnabled;
@end
PSPDF_UNGUARDED_AVAILABILITY_END
NS_ASSUME_NONNULL_END
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment