Phitext is the first rich text editor library for iPhone OS developers who want more control over UITextView but don't want to resort to private API calls.
The library takes advantage of the UITextView protocol introduced in iPhone OS 3.2 (and available in 4.0) to accept input from the system (or custom) keyboard. Phitext overcomes the challenges of implementing the UITextView protocol in the face of sparse Apple documentation. Because Phitext is backed by an NSAttributedString and uses Core Text to render it's content the developer is free to add any style attributes supported by NSAttributedString and Core Text.
You may like to start at the Phitext-workspace repository, which will get you started with a workspace and submodules for this and related projects.
To use the library in your projects:
- Clone or download this repository.
- Drag and drop the Xcode project into your Xcode workspace.
- Add the Phitext.a static library to your project's Linked Frameworks and Libraries.
- From your target's (or project's) Build Settings, ensure that Other Linker Flags (
OTHER_LDFLAGS
) contains-ObjC
. - In your storyboard, add a
UIScrollView
and set its Custom Class toPhiTextEditorView
, from the Identity Inspector. - Programmatically set the
NSAttributedString
in thePhiTextStorage
object of thePhiTextDocument
associated with everyPhiTextEditorView
.
See the sample code in Phitext-workspace repository for more details.
Pull requests are welcome.