commit_hash:5de4dcb932319c0c69772a1f7376f203674d633a
DivKit for iOS client library
How it works
DivKit builds native views from JSON data.
JSON → DivData → DivView
-
JSON – raw data with templates in DivKit format (see DivKit schema).
-
DivKitComponents – DivView dependencies.
-
DivView - plain UIKit View.
Although DivKit produces UIKit views, it can be easily used in SwiftUI apps (see playground application).
Installing DivKit
DivKit supports Swift Package Manager and CocoaPods.
Use this repository to install DivKit using Swift Package Manager: https://github.com/divkit/divkit-ios.git.
Add DivKit pod into your application Podfile to install DivKit using CocoaPods:
source 'https://github.com/divkit/divkit-ios.git'
target 'MyApp' do
pod 'DivKit'
end
DivKit Project
DivKit.xcodeproj – main Xcode project that contains all DivKit modules, tests and playground application.
Use DivKitPlayground scheme to build and run playground application.
Use UnitTests scheme to run all unit tests.
Use SnapshotTests scheme to run snapshot tests.
Sample Projects
Samples/UIKitIntegration/DivKitSample.xcodeproj – sample project with simple DivKit integration using Swift Package Manager and UIKit.
Samples/SwiftUIIntegration/DivKitSample.xcodeproj – sample project with simple DivKit integration using Swift Package Manager and SwiftUI.
Documentation. Medium tutorial. Habr tutorial.
Telegram: English-speaking chat | Чат на русском.