Post

Replies

Boosts

Views

Activity

XcodeBuildToolPlugin not available in XcodeProjectPlugin
For WWDC22 session "Meet Swift Package plugins " the following code snipped is shared in Apple's Developer application: In Xcode 14 Beta 1 I receive the compilation error Cannot find type 'XcodeBuildToolPlugin' in scope Is the given example valid and is a struct/type missing in the new library module XcodeProjectPlugin ? Or needs the example code to be adjusted (further then I bug I mentioned below in the comments)? import PackagePlugin @main struct MyPlugin: BuildToolPlugin {? /// This entry point is called when operating on a Swift package. func createBuildCommands(context: PluginContext, target: Target) throws -> [Command] debugPrint(context) // BUG: needs to return an array !!!!!!!!!!!!!!!!!!!!!! } } #if canImport(XcodeProjectPlugin) import XcodeProjectPlugin extension MyPlugin: XcodeBuildToolPlugin { /// This entry point is called when operating on an Xcode project. func createBuildCommands(context: XcodePluginContext, target: XcodeTarget) throws -> [Command] debugPrint(context) return [] } } #endif
2
0
2.0k
Jun ’22
Where are the predefined SwiftUI code snippets stored in Xcode?
Hi, in the Xcode library (⇧⌘L) I am unable to find the predefined SwiftUI code snippets which I can choose via autocompletion in the editor. One example is the {} View snippet which is available via autocompletion but cannot be found in the library. Where are those code snippets stored in Xcode (package contents) ? I'd like to get an overview how many and which code snippets are provided for SwiftUI.
0
0
396
Jun ’22
Xcodebuild error Swift Package with -derivedDataPath
Hi, building swift package - https://github.com/SAP/cloud-sdk-ios-fiori with Xcode 12.1 and the following command xcodebuild -enableCodeCoverage YES -derivedDataPath Build/ -scheme FioriSwiftUI-Package -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=14.1,name=iPhone 11' clean build test results in the following error: Error: Mismatch between existing container extension: <DVTExtension 0x7fd732e56260: Swift User Managed Package Folder (Xcode.IDEFoundation.Container.SwiftPackageUserManagedFolder) from com.apple.dt.IDE.IDESwiftPackageSupport> and requested container extension: <DVTExtension 0x7fd732e56750: Swift Package Proxy (Xcode.IDEFoundation.Container.SwiftPackageProxy) from com.apple.dt.IDE.IDESwiftPackageSupport> for file path: <DVTFilePath:0x7fd738728c30:'/Users/d041771/git/cloud-sdk-ios-fiori/Build/SourcePackages/checkouts/observable-array'> Why? How is it possible to build with -derivedDataPath without requiring a xcodeproj file? Note Building without -derivedDataPath works Building with -derivedDataPath and specifying -project works but is not an option for us as the package shall embed localized resources (swift-tools-version 5.3) in the future and building with xcoceproj will not work then - https://developer.apple.com/forums/thread/650278
1
0
3.5k
Nov ’20
SwiftUI: Markdown support for string variables
Text in iOS 15 Beta 1 (Xcode 13 Beta 1) only handles markdown when string literal was passed to initializer. struct MarkdownTest: View {   var text: String = "**Hello** *World*"   var body: some View {     VStack {       Text("**Hello** *World*") // will be rendered with markdown formatting       Text(text) // will NOT be rendered according to markdown     }   } } struct MarkdownTestPreviews: PreviewProvider {   static var previews: some View {     MarkdownTest()   } } Is this a known bug or do I have to create an entry in Feedback Assistant?
3
0
8.7k
Jun ’21
How to avoid compilation error in Xcode 11.5 when adding custom views and modifiers to the Xcode Library
I face compilation error in Xcode 11.5 for iOS 13.5 even when declaring that my LibraryContentProvider shall be available for iOS 14 only. Error Use of undeclared type 'LibraryContentProvider' Code @available(iOS 14.0, *) struct LibraryContent : LibraryContentProvider {  @LibraryContentBuilder  var views: [LibraryItem] {   LibraryItem(    Text("Hello WWDC!"),    title: "Custom View In The Library"   )  } } How to avoid this? I am asking because I'd like to ship my custom LibraryContentProvider as early as possible for people using Xcode 12 beta but I need to avoid compilation error for Xcode 11.5 users, of course :)
1
0
1.8k
Jun ’20
xcodeproj and Swift package localization
I added *.lproj folders and Localizable.strings files and building in Xcode 12 is successful when opening Package.swift But I observed that *.lproj folders and Localizable.strings file do not get added to Xcode project file when generating such with swift package generate-xcodeproj Building module from Xcode project file results in error Type 'Bundle' has no member 'module' Is this a bug or limitation? Reproduce with https://github.com/MarcoEidinger/cloud-sdk-ios-fiori/tree/xcode12 when building for iOS simulator
4
0
2.0k
Jun ’20