Inherits from UIView
Declared in DTLoupeView.h

Overview

DTLoupeView represents the “magnifying glass” shown when positioning a caret or ranged selection. It has three different styles: the regular round loupe, a ranged selection loupe with an arrow at the bottom and a rectangual loupe without arrow.

You should not create instances of DTLoupeView, but retrieve a reference to the shared loupe instance via sharedLoupe.

Tasks

Getting the Shared Loupe

Presenting the Loupe

Changing the Loupe Style

Getting Information

Properties

magnification

The magnification factor of the loupe, defaults to 1.2

@property (nonatomic, assign) CGFloat magnification

Declared In

DTLoupeView.h

magnifiedImageOffset

Different loupes have a different vertical offset for the magnified image (otherwise the touchpoint = equals the centre of maginified image). Setting the loupe style also sets the appropriate offset. This property can be used to customize the offset

@property (nonatomic, assign) CGPoint magnifiedImageOffset

Declared In

DTLoupeView.h

seeThroughMode

See-Through Mode is used by Apple if the touch point leaves the visible area of editing views. This makes the loupe slightly translucent and does not display a magnified image.

@property (nonatomic, assign) BOOL seeThroughMode

Declared In

DTLoupeView.h

style

The loupe style.

@property (nonatomic, assign) DTLoupeStyle style

Discussion

Available loupe styles are:

  • DTLoupeStyleCircle
  • DTLoupeStyleRectangle
  • DTLoupeStyleRectangleWithArrow

Declared In

DTLoupeView.h

targetView

The target view. This determines the coordinate system in which touchPoint is referring to.

@property (nonatomic, WEAK) UIView *targetView

Declared In

DTLoupeView.h

touchPoint

Moves the loupe to be showing the location at the current touch point

@property (nonatomic, assign) CGPoint touchPoint

Declared In

DTLoupeView.h

touchPointOffset

A static offset to apply to the touch point. Setting the loupe style resets this to default CGSizeZero.

@property (nonatomic, assign) CGSize touchPointOffset

Declared In

DTLoupeView.h

Class Methods

sharedLoupe

Get the shared instance of the loupe

+ (DTLoupeView *)sharedLoupe

Return Value

A reference to the loupe

Declared In

DTLoupeView.h

Instance Methods

dismissLoupeTowardsLocation:

Dismisses the loupe with an animation towards a location

- (void)dismissLoupeTowardsLocation:(CGPoint)location

Parameters

location

The point to animate the dismissal towards

Declared In

DTLoupeView.h

isShowing

Determine if the the loupe is currently showing

- (BOOL)isShowing

Return Value

YES if the receiver is visible

Declared In

DTLoupeView.h

presentLoupeFromLocation:

Presents the loupe with an animation beginning from the given location

- (void)presentLoupeFromLocation:(CGPoint)location

Parameters

location

The point to begin the presenting aninimation from

Declared In

DTLoupeView.h