Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图AVPlayerView在 Swift 中使用,但编译器抱怨它找不到名为playerin的成员AVPlayerView。
AVPlayerView
player
但AVPlayerView显然确实有一个名为player.
其他属性或方法都可以。似乎只有player不承认。
您必须明确导入 AVFoundation 框架(它定义了AVPlayer类):
AVPlayer
import AVKit import AVFoundation let playerView = AVPlayerView() let player = playerView.player
这可能被认为是 AVKit 框架(Swift 视图)中的一个错误。