Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions KILabel/Source/KILabel.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ typedef NS_ENUM(NSUInteger, KILinkType)
* URLs, http etc
*/
KILinkTypeURL,
/**
* Phones
*/
KILinkTypePhone
};

/**
Expand Down Expand Up @@ -73,6 +77,12 @@ typedef NS_OPTIONS(NSUInteger, KILinkTypeOption)
*/
KILinkTypeOptionURL = 1 << KILinkTypeURL,


/**
* Specifies to include KILinkTypePhone links
*/
KILinkTypeOptionPhone = 1 << KILinkTypePhone,

/**
* Convenience contstant to include all link types
*/
Expand All @@ -90,6 +100,7 @@ typedef NS_OPTIONS(NSUInteger, KILinkTypeOption)
* @param range The range of the string within the label's text
*/
typedef void (^KILinkTapHandler)(KILabel *label, NSString *string, NSRange range);
typedef void (^KILinkLongTapHandler)(KILabel *label, KILinkType type, NSString *string, NSRange range);

extern NSString * const KILabelLinkTypeKey;
extern NSString * const KILabelRangeKey;
Expand Down Expand Up @@ -176,6 +187,16 @@ IB_DESIGNABLE
*/
@property (nullable, nonatomic, copy) KILinkTapHandler urlLinkTapHandler;

/**
* Callback block for KILinkTypePhone link tap.
*/
@property (nullable, nonatomic, copy) KILinkTapHandler phoneLinkTapHandler;

/**
* Callback block for long link tap.
*/
@property (nullable, nonatomic, copy) KILinkLongTapHandler linkLongTapHandler;

/** ****************************************************************************************** **
* @name Geometry
** ****************************************************************************************** **/
Expand Down
Loading