BionicReader
public class BionicReader : NSObject
-
Creates a new
BionicReaderinstance.This initializer returns
nilif the API key is not valid.Declaration
Swift
public init?(fixation: Int? = nil, saccade: Int? = nil, opacity: Int? = nil)Parameters
fixationif
nil,fixationfromBionicReadingSettingswill be used.saccadeif
nil,saccadefromBionicReadingSettingswill be used.opacityif
nil,opacityfromBionicReadingSettingswill be used. -
Start a new text block.
This makes sure saccade is correctly applied (if
saccadeis greater than 1) when starting a new text block like for example a paragraph.Declaration
Swift
public func newTextBlock() -
Reset all parameters.
If you want to reuse an instance of
BionicReaderfor another text, you should call this before. This will also updatefixation,saccadeandopacitywith the current values fromBionicReadingSettings(if no values for these were provided).Declaration
Swift
public func reset(fixation: Int? = nil, saccade: Int? = nil, opacity: Int? = nil)Parameters
fixationif
nil,fixationfromBionicReadingSettingswill be used.saccadeif
nil,saccadefromBionicReadingSettingswill be used.opacityif
nil,opacityfromBionicReadingSettingswill be used. -
Apply Bionic Reading to a plaintext string.
Bolded parts of the returned HTML will be wrapped using the
<b>tag.<b class="bionic-b" style="opacity: 1.0;">Bio</b>nicImportant
This method treats
stringas plaintext. If you want to convert a HTML string, you can usebionicReadableHTML(sourceType:fixation:saccade:opacity:)which will take care of the HTML parsing.Declaration
Swift
public func readableHTML(_ string: String) -> StringParameters
stringPlaintext string. HTML is not supported for this parameter.
Return Value
HTML string with Bionic Reading applied.
BionicReader Class Reference