mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-03-11 13:26:17 +00:00
using wkwebview - i dont like how it turned out...
takes a second to load and has a white bg :(
This commit is contained in:
33
StickerSlack/Emoji/GifView.swift
Normal file
33
StickerSlack/Emoji/GifView.swift
Normal file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// GifView.swift
|
||||
// StickerSlack
|
||||
//
|
||||
// Created by neon443 on 20/11/2025.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
import SwiftUI
|
||||
import WebKit
|
||||
|
||||
struct GifView: UIViewRepresentable {
|
||||
private let url: URL
|
||||
|
||||
init(url: URL) {
|
||||
self.url = url
|
||||
}
|
||||
|
||||
func makeUIView(context: Context) -> WKWebView {
|
||||
let webview = WKWebView()
|
||||
|
||||
webview.allowsLinkPreview = false
|
||||
webview.allowsBackForwardNavigationGestures = false
|
||||
|
||||
webview.load(URLRequest(url: url))
|
||||
return webview
|
||||
}
|
||||
|
||||
func updateUIView(_ uiView: WKWebView, context: Context) {
|
||||
uiView.reload()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user