SBSDKFinderView
@interface SBSDKFinderView : UIView
A UIView subclass to display a view finder with colored background and transparent cutout with the given aspect ratio.
-
The receivers delegate.
Declaration
Objective-C
@property (nonatomic, weak, nullable) id<SBSDKFinderViewDelegate> finderDelegate;
Swift
weak var finderDelegate: SBSDKFinderViewDelegate? { get set }
-
The aspect ratio of the viewport (cutout), if set to -1, no cutout is drawn. Defaults to -1.
Declaration
Objective-C
@property (nonatomic) double displayedAspectRatio;
Swift
var displayedAspectRatio: Double { get set }
-
The aspect ratio of the secondary viewport drawn with dashed lines, if set to -1, no secondary viewport is drawn. Defaults to -1.
Declaration
Objective-C
@property (nonatomic) double secondaryAspectRatio;
Swift
var secondaryAspectRatio: Double { get set }
-
Parameter that defines minimum inset of viewport from edge of the screen. The default value is {20, 20, 20, 20}.
Declaration
Objective-C
@property (nonatomic) UIEdgeInsets minimumInset;
Swift
var minimumInset: UIEdgeInsets { get set }
-
Minimum inset of the secondary viewport, related to the primary viewport. The default value is {10, 10, 10, 10}.
Declaration
Objective-C
@property (nonatomic) UIEdgeInsets secondaryMinimumInset;
Swift
var secondaryMinimumInset: UIEdgeInsets { get set }
-
If positive, the receiver will try to maintain the preferred height and the aspect ratio for the finder by dynamically changing the inset. If negative this property will be ignored. The default value is -1;
Declaration
Objective-C
@property (nonatomic) CGFloat preferredHeight;
Swift
var preferredHeight: CGFloat { get set }
-
The color of the receivers border line. Can be nil.
Declaration
Objective-C
@property (nonatomic, strong, nullable) UIColor *lineColor;
Swift
var lineColor: UIColor? { get set }
-
The corner radius of the receivers border line. Defaults to 8.
Declaration
Objective-C
@property (nonatomic) CGFloat lineCornerRadius;
Swift
var lineCornerRadius: CGFloat { get set }
-
The line width of the receivers border line. Defaults to 2.
Declaration
Objective-C
@property (nonatomic) CGFloat lineWidth;
Swift
var lineWidth: CGFloat { get set }
-
If set to NO, the finder is inset by the safe area insets. Otherwise the safe area inset is ignored.
Declaration
Objective-C
@property (nonatomic) BOOL ignoresSafeAreaInsets;
Swift
var ignoresSafeAreaInsets: Bool { get set }
-
Set to YES for animated finder changes, to NO otherwise. Defaults to YES.
Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite, getter=isAnimatingChanges) BOOL animateChanges;
Swift
var isAnimatingChanges: Bool { get set }
-
The current rect of the finders viewport in local coordinate system. Returns CGRectZero if the viewport is disabled.
Declaration
Objective-C
@property (nonatomic, readonly) CGRect finderRect;
Swift
var finderRect: CGRect { get }
-
The current rect of the finders secondary viewport in local coordinate system. Returns CGRectZero if the secondary viewport is disabled.
Declaration
Objective-C
@property (nonatomic, readonly) CGRect secondaryFinderRect;
Swift
var secondaryFinderRect: CGRect { get }
-
A function that returns a bezier path describing the finder rectangle in the specified views coordinate system.
Declaration
Objective-C
- (nullable UIBezierPath *)bezierPathConvertedToView:(nullable UIView *)view;
Swift
func bezierPathConverted(to view: UIView?) -> UIBezierPath?
Parameters
view
The UIView instance to which the bezier path of the finder rectangle is converted to. If nil, the bezier path is not transformed.
Return Value
The requested bezier path for the finder rect. If the finder rects size is CGRectZero, nil is returned.
-
A function, that returns a rect of a finder, if it will be placed in view with certain bounds, with given aspect ratio and insets. Useful for pre-calculations in some animation cases.
Declaration
Objective-C
+ (CGRect)potentialFinderRectWithBounds:(CGRect)bounds aspectRatio:(double)aspectRatio minimumInsets:(UIEdgeInsets)minimumInsets;
Swift
class func potentialFinderRect(withBounds bounds: CGRect, aspectRatio: Double, minimumInsets: UIEdgeInsets) -> CGRect
Parameters
bounds
The bounds of the view, where potential view will be placed.
aspectRatio
An expected aspect ratio.
minimumInsets
Minimal insets of finder.
Return Value
A calculated rect of potential finder.