Preview layouts in Xcode 14 render the layout in live mode by default.
Can this default be changed to "Selectable" permanently? E.g. through an Xcode plist entry?
I know there is a manual option to switch to the Selectable option exists in the bottom left.
Post
Replies
Boosts
Views
Activity
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
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.
Command Plugin(s), if available, can be triggered from "File" menu.
Is it possible to define a key binding in Xcode to trigger a command plugin more conveniently? Same is possible for Xcode Extensions today.
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
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?
Hi, thanks for adding markdown support in SwiftUI's Text with Xcode 13 and iOS 15! :)
Even formatting like strikethrough works!
Text("Hello ~~World~~")
So which specification is supported?? This goes apparently beyond Commonmark (as strikethrough is not part of Commonmark specification). Is it GitHub Flavored Markdown or even a different spec?
Hi, great to see SwiftUI support to load images asynchronously! However, it seems that GIFs are not supported. I tested with Xcode 13 Beta 1 and the following code
AsyncImage(url: URL(string: "https://media.wired.com/photos/59326d5344db296121d6aee9/master/pass/8552.gif"))
will show only as a static image.
Is GIF supported planned for final version?
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 :)
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