Highlight
open class Highlight : Object
A Highlight object
-
Declaration
Swift
@objc open dynamic var bookId: String!
-
Declaration
Swift
@objc open dynamic var content: String!
-
Declaration
Swift
@objc open dynamic var contentPost: String!
-
Declaration
Swift
@objc open dynamic var contentPre: String!
-
Declaration
Swift
@objc open dynamic var date: Date!
-
Declaration
Swift
@objc open dynamic var highlightId: String!
-
Declaration
Swift
@objc open dynamic var page: Int
-
Declaration
Swift
@objc open dynamic var type: Int
-
Declaration
Swift
@objc open dynamic var startOffset: Int
-
Declaration
Swift
@objc open dynamic var endOffset: Int
-
Declaration
Swift
@objc open dynamic var noteForHighlight: String?
-
Declaration
Swift
override open class func primaryKey() -> String
-
Save a Highlight with completion block
Declaration
Swift
public func persist(withConfiguration readerConfig: FolioReaderConfig, completion: Completion? = nil)
Parameters
readerConfig
Current folio reader configuration.
completion
Completion block.
-
Remove a Highlight
Declaration
Swift
public func remove(withConfiguration readerConfig: FolioReaderConfig)
Parameters
readerConfig
Current folio reader configuration.
-
Remove a Highlight by ID
Declaration
Swift
public static func removeById(withConfiguration readerConfig: FolioReaderConfig, highlightId: String)
Parameters
readerConfig
Current folio reader configuration.
highlightId
The ID to be removed
-
Return a Highlight by ID
Declaration
Swift
public static func getById(withConfiguration readerConfig: FolioReaderConfig, highlightId: String) -> Highlight?
Return Value
Return a Highlight
-
Update a Highlight by ID
Declaration
Swift
public static func updateById(withConfiguration readerConfig: FolioReaderConfig, highlightId: String, type: HighlightStyle)
Parameters
readerConfig
Current folio reader configuration.
highlightId
The ID to be removed
type
The
HighlightStyle
-
Return a list of Highlights with a given ID
Declaration
Swift
public static func allByBookId(withConfiguration readerConfig: FolioReaderConfig, bookId: String, andPage page: NSNumber? = nil) -> [Highlight]
Parameters
readerConfig
Current folio reader configuration.
bookId
Book ID
page
Page number
Return Value
Return a list of Highlights
-
Return all Highlights
Declaration
Swift
public static func all(withConfiguration readerConfig: FolioReaderConfig) -> [Highlight]
Parameters
readerConfig
- readerConfig: Current folio reader configuration.
Return Value
Return all Highlights
-
Declaration
Swift
public struct MatchingHighlight
-
Match a highlight on string.
Declaration
Swift
public static func matchHighlight(_ matchingHighlight: MatchingHighlight) -> Highlight?
-
Remove a Highlight from HTML by ID
Declaration
Swift
@discardableResult public static func removeFromHTMLById(withinPage page: FolioReaderPage?, highlightId: String) -> String?
Parameters
page
The page containing the HTML.
highlightId
The ID to be removed
Return Value
The removed id
-
Remove span tag before store the highlight, this span is added on JavaScript.
Declaration
Swift
public static func removeSentenceSpam(_ text: String) -> String
Parameters
text
Text to analise
Return Value
Striped text