Introducing Hakawai - a powerful, mentions-enabled text view for iOS

Austin Z.
6 min readintermediate
--
View Original

Overview

Hakawai is an open-source Objective-C library designed for iOS that enhances the standard UITextView with additional functionalities, including a mentions-enabled text view. It features a block-based API for text manipulation, an abstraction layer for change notifications, and a plug-in architecture for extensibility.

What You'll Learn

1

How to use block-based APIs for text transformation in Hakawai

2

Why the Abstraction Layer improves text view change notifications

3

How to implement a mentions plug-in for text views

Prerequisites & Requirements

  • Basic understanding of Objective-C and iOS development
  • Familiarity with Git for accessing the Hakawai repository(optional)

Key Questions Answered

What is Hakawai and what functionalities does it provide?
Hakawai is an open-source Objective-C library for iOS that enhances UITextView with additional features such as block-based APIs for text manipulation and a mentions plug-in. It simplifies working with text views by providing clear notifications for content changes and allows for extensibility through its plug-in architecture.
How does the Abstraction Layer improve text view notifications?
The Abstraction Layer in Hakawai provides a higher-level change notification API compared to UITextViewDelegate. It handles various edge cases, such as input from different languages and autocorrection, ensuring that developers receive accurate notifications about user interactions with the text view.
What types of plug-ins does Hakawai support?
Hakawai supports two types of plug-ins: basic plug-ins, which perform simple text transformations without event notifications, and control flow plug-ins, which receive notifications and can integrate more deeply with the text view. This flexibility allows developers to extend functionality as needed.

Technologies & Tools

Programming Language
Objective-c
Used to develop the Hakawai library for iOS applications.
Platform
Ios
The target platform for the Hakawai library, specifically iOS 7.1 and newer.

Key Actionable Insights

1
Utilize Hakawai's block-based APIs to simplify text transformations in your iOS applications.
These APIs allow you to easily manipulate text content, making it straightforward to implement features like text formatting or custom transformations without complex logic.
2
Leverage the Abstraction Layer to enhance user experience by providing accurate text change notifications.
This layer abstracts away the complexities of handling various input methods, ensuring that your app responds correctly to user actions across different languages and input styles.
3
Explore the mentions plug-in to add interactive features to your text views.
By implementing this plug-in, you can create a more engaging user experience, allowing users to mention others directly within text inputs, similar to social media applications.

Common Pitfalls

1
Failing to properly handle edge cases with text input can lead to inconsistent user experiences.
Developers should ensure that their implementations account for various input methods, especially for languages with complex input systems like Chinese and Japanese.

Related Concepts

Objective-c Programming
Ios App Development
Text View Customization
Plug-in Architecture