A lightweight UILabel replacement for iOS with emoji support
cnplabel is a lightweight UILabel replacement for iOS that provides additional features such as emoji support. It offers an easy-to-use interface for displaying and customizing text in your iOS applications. This library is built using Swift and is compatible with both Objective-C and Swift projects.
Features
- Supports the display of emojis within iOS applications.
- Provides additional customization options for UILabels, such as text styling and alignment.
- Compatible with both Objective-C and Swift projects.
- Offers a lightweight alternative to the standard UILabel class.
Installation
To integrate cnplabel into your project, you can use CocoaPods or manually add the library files to your project.
CocoaPods
Add the following line to your Podfile:
pod 'cnplabel'
Then, run the following command:
$ pod install
Manual Installation
Manually adding the library to your project is also an option. Simply follow these steps:
- Download the latest version of cnplabel from the GitHub repository.
- Unzip the downloaded file.
- Drag and drop the cnplabel.swift file into your Xcode project.
Usage
Using cnplabel in your project is straightforward. Follow the steps below to get started:
- Import the cnplabel module into your file:
- Create an instance of cnplabel:
- Configure the label properties:
- Add the label to your view:
// Swift import cnplabel // Objective-C @import cnplabel;
// Swift let label = CNPLabel(frame: frame) // Objective-C CNPLabel *label = [[CNPLabel alloc] initWithFrame:frame];
// Set the label text label.text = "Hello, World!" // Customize the label appearance label.textColor = .red label.font = UIFont.boldSystemFont(ofSize: 18) // Enable/disable emoji support label.emojiEnabled = true
// Swift view.addSubview(label) // Objective-C [self.view addSubview:label];
Credits
CNPLabel is developed and maintained by [Your Name]. You can find the official repository on GitHub.
License
cnplabel is available under the [License Name] license. See the LICENSE file for more info.