Reuse your website’s existing content and easily integrate it into a mobile app. User our snippet builder to enrich content and integrate it with our iOS and Android SDKs. Stop rebuilding - start reusing.
Using our powerful SDKs, integrate easily. Build a full app or add web content to existing one.
Optimized for both iOS and Android, ensuring a smooth and consistent experience across all devices.
Easily add CSS & JS to tweak your web page for your app - hide elements, restyle the UI, or adjust colors.
import SwiftUI
import TWS
@main
struct SampleApp: App {
let config = TWSBasicConfiguration(id: "<TWS_PROJECT>")
var body: some Scene {
WindowGroup {
ContentView()
// Injects manager into environment
// Needed only when displaying remote snippets
.twsEnable(configuration: config)
}
}
}
struct ContentView: View {
@Environment(TWSManager.self) var tws
var body: some View {
// Display remote snippet
if let snippet = tws.snippets().first(where: {$0.id == "home" }) {
TWSView(snippet: snippet)
}
// Display a snippet created locally
TWSView(
snippet: TWSSnippet(
id: "mySnippetId",
target: URL(string: "https://thewebsnippet.dev")!
)
)
// This is only needed if you already have an active manager
.twsLocal()
}
}
The built-in Mustache templating language allows you to efficiently generate dynamic content on the mobile device by replacing placeholders, enclosed in {{ }} brackets, with actual values - whether defined in the snippet or retrieved from the device.