TipKit 在 Xcode 15.4 beta 上不适用于 iOS 17。

huangapple go评论72阅读模式
英文:

TipKit not working on Xcode 15.4 beta for iOS 17

问题

我正在尝试使用苹果的新功能TipKit,并在iOS 17在今年秋季发布之前为我的应用程序创建示例提示。然而,我无法编译程序。

我下载了Xcode 15.4 beta,并尝试使用从https://developer.apple.com/videos/play/wwdc2023/10229/?time=323 中找到的示例代码创建一个结构体:

struct FavoriteBackyardTip: Tip {
    var title: Text {
        Text("Save as a Favorite")
    }
    
    var message: Text {
        Text("Your favorite backyards always appear at the top of the list.")
    }
}

编译器立即无法识别Tip类并报错。我需要在SwiftUI中对Tip进行子类化,就像在创建普通视图时对View进行子类化一样。我有这样的印象,TipKit尚未添加到Xcode 15.4 beta,我需要等待。如果尚未添加,下一个beta版本计划何时发布?另外,我可能错过了一个导入语句,尽管我尝试过但找不到任何内容(我假设我不需要导入)。

是否有其他人成功测试过其应用程序的Tip?此外,我想将TipKit与UIKit集成,想知道是否可能,如果可能的话,如何操作。

关于TipKit的任何信息将不胜感激!

英文:

I am trying to experiment with Apple's new feature called TipKit and create sample Tips for my app prior to iOS 17 release this fall. However, I am unable to compile the program.

I downloaded Xcode 15.4 beta and I tried creating a struct using the sample code found from https://developer.apple.com/videos/play/wwdc2023/10229/?time=323:

struct FavoriteBackyardTip: Tip {

    var title: Text {
        Text("Save as a Favorite")
    }
    
    var message: Text {
        Text("Your favorite backyards always appear at the top of the list.")
    }
}

The compiler immediately does not recognize the Tip class and throws an error. I need to subclass Tip in SwiftUI just like I would with View if I were creating a normal view. I am under the impression TipKit has not been added to Xcode 15.4 beta and that I need to wait. If it has not been added, when will it be added? When is the next beta release planned for? It is also possible I am missing an import statement, although I did try and was unable to find anything (I assume that I won't need an import).

Has anyone else been able to successfully test out a Tip for their app?

Additionally, I want to integrate TipKit with UIKit and wondered if that is possible, and if so, how to do it.

Any information on TipKit would be appreciated!

答案1

得分: 2

更新: 根据发布说明,TipKit现在可以在Xcode 15 beta 5中使用。

目前,TipKit还不能在Xcode中使用,因此它未包含在Xcode中。您需要等待,直到它在未来的Xcode测试版中包含在内,所以请密切关注发布说明,因为我们不知道何时会可用。

关于在UIKit中使用TipKit的问题,是的,您将能够这样做,因为Apple员工在他们的论坛中正式确认了这一点。

英文:

UPDATE: TipKit is now available with Xcode 15 beta 5, as stated in the release notes.

For now TipKit is not available for use, so it is not included in Xcode. You will need to wait until they include it in future Xcode betas, so stay tuned for the release notes as we don't have any clue about when it will be available.

Answering your question about using TipKit in UIKit, yeah, you will be able to do so, as Apple staff officially confirmed this in their forums here.

答案2

得分: 0

根据Javier的说法,TipKit在Xcode 15 beta 5中可用。然而,没有修订的示例代码,并且自WWDC会话以来实现已经发生了变化。

我已经创建了一个示例应用程序这里,展示了如何实现它。

英文:

As Javier says, TipKit is available in Xcode 15 beta 5. However, there is no revised sample code, and the implementation has changed since the WWDC session.

I've created a sample app here which shows how to implement it.

huangapple
  • 本文由 发表于 2023年7月18日 03:25:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/76707545.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定