当我将ios SDK Pod安装到我的ios项目中时,它说:“:-1:不支持SWIFT_VERSION'5.0',受支持的版本是:3.0、4.0、4.2。(在目标'FacebookCore'中)”
我正在使用swift 4.2任何解决方案吗?
我正在尝试使用 Xcode 11.2 制作一个简单的游戏,其中包含一个动画循环背景和一个视图,该视图显示和更改项目中多个 Lottie JSON 文件的各种动画。
当我单击“下一步”按钮更改视图动画时,循环的背景视图会卡住一秒钟,直到加载视图内的下一个动画,应用程序中的所有内容都会像背景动画一样同时冻结。
CPU 使用率从 30% 到 63% 不等。
我不想让问题复杂化,所以我只是展示我使用 Lottie 的方式。
@IBAction func SubmitButtonAction(_ sender: UIButton) {
showNextQuestion()
}
func showNextQuestion()->(){
myTimer.invalidate()
startCountdown(fromTime: 15)
Manager.generateQuestion()
lblLevel.text = String(Manager.questionNumber) + "/" + String(DataModel.Questions.count)
nIndex = 0
let animation = AnimationView(name: Manager.currentImage)
animation.loopMode = .loop
animation.play()
animation.backgroundColor = UIColor.clear
animation.frame = self.AnimView.bounds
animation.backgroundBehavior = .pauseAndRestore
if AnimView.subviews.isEmpty{
self.AnimView.addSubview(animation)
}
else {
for one in imgImageView.subviews{
one.removeFromSuperview()
}
self.AnimView.addSubview(animation)
}
AnswerCollectionView.reloadData()
RandomCollectionView.reloadData()
}
Run Code Online (Sandbox Code Playgroud)
我对有关该问题与什么相关的建议感兴趣 - 它是否与线程问题有关?
我一直收到以下错误,现有的 Stack Overflow 答案都没有帮助。我不擅长通过查看控制台结果来找到形成错误的确切位置。
这是我在旧设备上运行时遇到的错误(在新设备上运行良好)。我可以尝试哪些方法来确定问题?
2019-12-30 16:52:04.784 Hospital[7075:164758] *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named _UIScrollViewLayoutGuide'
*** First throw call stack:
(
0 CoreFoundation 0x000000010ad9fb0b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010a804141 objc_exception_throw + 48
2 CoreFoundation 0x000000010ae08625 +[NSException raise:format:] + 197
3 UIKit 0x000000010c15368d UINibDecoderDecodeObjectForValue + 323
4 UIKit 0x000000010c15353f -[UINibDecoder decodeObjectForKey:] + 89
5 Foundation 0x0000000109b0e417 -[NSLayoutConstraint initWithCoder:] + 757
6 UIKit 0x000000010c1537ff UINibDecoderDecodeObjectForValue + 693
7 UIKit 0x000000010c15399d UINibDecoderDecodeObjectForValue + 1107 …
Run Code Online (Sandbox Code Playgroud)