Post

Replies

Boosts

Views

Activity

Xcode opening all files as text
Xcode is opening all of my storyboards and xcassets files as text. The menu option for "Open As..." now contains just one grayed out entry "<None>. When re-opening Xcode with an xcasset file it does say "No editor" for a moment before opening the file as text. I did install a macos update this morning which may have triggered this but I can't be sure. Is anybody aware of a fix for this?
2
3
4.3k
Jun ’22
DragGesture + ScrollView = problems. Any good workarounds?
When placing a DragGesture on a view containing a ScrollView, dragging within the ScrollView causes onChanged to trigger, while onEnded does not trigger. Does anybody have a workaround for this?struct ContentView: View { @State var offset: CGSize = .zero var body: some View { ZStack { Spacer() Color.clear if self.offset != .zero { Color.blue.opacity(0.25) } VStack { Color.gray.frame(height: 44.0) ScrollView { ForEach(0..<100, id: \.self) { _ in Text("Don't move please") } } Color.gray.frame(height: 44.0) } .frame(width: 320.0, height: 568.0) .offset(self.offset) .animation(.easeInOut) .gesture( DragGesture(minimumDistance: 10.0, coordinateSpace: .global) .onChanged { (value) in self.offset = value.translation } .onEnded { (_) in self.offset = .zero }) } } }I know I could place gestures on the top/bottom gray areas (they represent bars), but in my actual app the owner of the drag gesture is a container that knows nothing about its contents.
3
3
8.3k
May ’22
Xcode opening all files as text
Xcode is opening all of my storyboards and xcassets files as text. The menu option for "Open As..." now contains just one grayed out entry "<None>. When re-opening Xcode with an xcasset file it does say "No editor" for a moment before opening the file as text. I did install a macos update this morning which may have triggered this but I can't be sure. Is anybody aware of a fix for this?
Replies
2
Boosts
3
Views
4.3k
Activity
Jun ’22
Xcode 13 vim mode documentation?
Is there any documentation on which commands are supported for vim mode now? I know there's the help bar (though I haven't seen it appear since yesterday...). Is there vimrc support, etc...?
Replies
22
Boosts
0
Views
31k
Activity
May ’22
DragGesture + ScrollView = problems. Any good workarounds?
When placing a DragGesture on a view containing a ScrollView, dragging within the ScrollView causes onChanged to trigger, while onEnded does not trigger. Does anybody have a workaround for this?struct ContentView: View { @State var offset: CGSize = .zero var body: some View { ZStack { Spacer() Color.clear if self.offset != .zero { Color.blue.opacity(0.25) } VStack { Color.gray.frame(height: 44.0) ScrollView { ForEach(0..<100, id: \.self) { _ in Text("Don't move please") } } Color.gray.frame(height: 44.0) } .frame(width: 320.0, height: 568.0) .offset(self.offset) .animation(.easeInOut) .gesture( DragGesture(minimumDistance: 10.0, coordinateSpace: .global) .onChanged { (value) in self.offset = value.translation } .onEnded { (_) in self.offset = .zero }) } } }I know I could place gestures on the top/bottom gray areas (they represent bars), but in my actual app the owner of the drag gesture is a container that knows nothing about its contents.
Replies
3
Boosts
3
Views
8.3k
Activity
May ’22
Image(uiImage:) and UIImage.prepareForDisplay() performance
Is there any performance benefit to using UIImage.prepareForDisplay() or its related methods when using Image(uiImage:)?
Replies
1
Boosts
0
Views
652
Activity
Dec ’21