一个简单易用的 SwiftUI 视图,用于添加类似的模糊效果

SwiftUI 渐变模糊

此软件包提供了一个简单易用的 SwiftUI 视图,用于添加类似于您在 AppleTV 和 App Store 上看到的模糊效果。

截图

应用截图

App Screenshot

Installation

Install with SPM

.package(url: "https://github.com/unitedadityaa/SwiftUIGradientBlur.git", .branch("main"))

Usage/Examples

import SwiftUIGradientBlur
import AVKit

//MARK:- For image
GradientImageView(image: Image("tetris") , height: UIScreen.main.bounds.height , width: UIScreen.main.bounds.width , style: .dark)

//MARK:- For Video
  let player = AVPlayer(url: Bundle.main.url(forResource: "video1", withExtension: "mp4")!)

GradientVideoView(player: player, height: UIScreen.main.bounds.height, width: UIScreen.main.bounds.height , style: .systemThinMaterialDark)
.onAppear(perform:{
    player.play()
})

GitHub

点击跳转