原生html编辑器,一个可复用的原生iOS可视化HTML文本编辑器组件

Aztec是一个用Swift编写的库,为UITextView提供HTML视觉编辑功能,适用于处理原始HTML内容。WordPressEditor是另一个Swift库,用于使Aztec与WordPress内容协同工作。它们都支持iOS 10及以上版本,且可以通过Carthage或CocoaPods进行集成。要运行示例应用,首先需要安装依赖项。集成库后,即可在项目中使用Aztec.TextView类进行HTML编辑。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Aztec for iOS: Native HTML Editor

625332134c6f4d4600884b99daebf603.png

625332134c6f4d4600884b99daebf603.png625332134c6f4d4600884b99daebf603.png625332134c6f4d4600884b99daebf603.png625332134c6f4d4600884b99daebf603.png

About Aztec & WordPressEditor

Aztec is a Swift library that provides a UITextView subclass with HTML visual-editing capabilities.

Use this library if you want to create an App that interacts with raw HTML content.

WordPressEditor is a Swift library that provides a plugin to make Aztec work with WordPress content.

Use this library if you want to create an App that interacts with WordPress HTML content.

Requirements

iOS 10 and above

Xcode 9.3 and above

Running the Example App

To run the Example app, you first need to make sure its dependencies are installed:

Make sure you have Carthage installed.

Using the command line:

cd Example

carthage update --platform iOS

Once Carthage finishes, you should open the file Aztec.xcworkspace from the root directory of Aztec.

Make sure the AztecExample target it selected, and press CMD + R to run it.

Integrating the Library with Carthage

Both libraries are available through Carthage. To install it, simply add the following line to your Cartfile:

github "wordpress-mobile/AztecEditor-iOS" "1.0" # or the version number you want

github "wordpress-mobile/WordPressEditor-iOS" "1.0"

Follow these instructions to add Aztec.framework or WordPressEditor.framework to your App.

Then:

Open your project, head to Build Settings for your target and add $(SDKROOT)/usr/include/libxml2/ to your Header Search Paths.

Go to Build Phases > Link Binary With Libraries and add Aztec.framework.

Add import Aztec to your project's source.

Integrating the Library with CocoaPods

Both libraries are available through CocoaPods. To install them, simply add the following lines to your Podfile:

pod "WordPress-Aztec-iOS", "1.0" # or the version number you want

pod "WordPress-Editor-iOS", "1.0"

Usage

After installing Aztec, import the module and use the Aztec.TextView view as shown below:

import Aztec

// ...

let textView = Aztec.TextView(

defaultFont: UIFont,

defaultParagraphStyle: ParagraphStyle = ParagraphStyle.default,

defaultMissingImage: UIImage) {

License

WordPress-Aztec-iOS is available under the GPLv2 license. See the LICENSE file for more info. WordPress-Editor-iOS is available under the GPLv2 license. See the LICENSE file for more info.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值