Post

Replies

Boosts

Views

Activity

Reply to XCode 14.2 randomly crashes often since update to Ventura
If Xcode itself is crashing, file a bug, this will tell you how. https://developer.apple.com/bug-reporting/ If your program is crashing, and you want help on this forum, you'll want to post relevant code samples, after you've gone some way to investigate the problem yourself. Start here. https://developer.apple.com/documentation/xcode/diagnosing-and-resolving-bugs-in-your-running-app
Jan ’23
Reply to Background video recording
Well, I'm not Apple, but I think it is unlikely that you'll ever hear a reason for their design decisions. What you'll usually hear is that if you want a feature, use the Feedback Assistant to request that feature - outline your use case, what you can do, what you can't do, why you would like to be able to do it. Often, decisions like these are made to improve the overall user experience of the phone; it is quite easy to drain the battery rapidly if you leave. video recording on inadvertently. You may contend that the user should be made the final arbiter in this decision (it's my phone, and I'll drain the battery if I want to!), and that is so on other platforms, but this is Apple's design and Apple make the rules.
Topic: App & System Services SubTopic: Core OS Tags:
Dec ’22
Reply to Sendig UDP packets with specified local port
I might be completely wrong here, but it looks like you can do this line differently connection = NWConnection(host: host, port: port, using: .udp) the last parameter doesn't need to be fixed as .udp, the default udp parameters. You can make new NWParameters and alter the value of requiredLocalEndpoint. hth, and Happy New Year
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’22
Reply to How Can WithAnimation Code be placed inside the view to be animated
Your code wouldn't compile as-is, but I think you want your GradientLegendView to slide in from the leading edge, and out on the trailing edge of the ContentView, in response to pressing a button. And you don't want to animate the isShowingLegend variable, you'd rather attach the animation to your GradientLegendView. The thing is, what you want to animate (the position of the GradientLegendView) isn't intrinsic to the GradientLegendView. The view position is a property of the GradientLegendView which only makes sense in the ContentView. I took the .transition modifier out of the GradientLegendView, and removed its isShowingLegend. The GradientLegendView is the thing which shows the gradient legend; it doesn't make sense for it to take that bool parameter. The piece of UI which uses the GradientLegendView decides whether to show it or not. I attached a .transition(.slide) to the HStack which builds your GradientLegendView, and provided a .animation controlled by isShowingLegend. The animation is applied to a Group in your overlay. The Group returns an HStack if isShowingLegend is true and an (implied) EmptyView otherwise. It is necessary because the type of the parameter to .overlay should be some View. this is my ContentView     @State private var isShowingLegend = true     var body: some View {         Button("Press Me") {             isShowingLegend.toggle()         }          .frame(maxWidth: .infinity, maxHeight: .infinity)         .edgesIgnoringSafeArea(.all) //        .task { //          setupMenuItems() // won't compile, don't have //        }         .overlay(             Group {                 if isShowingLegend {                     HStack {                         GradientLegendView(                             // doesn't need isShowingLegend                             labels: SampleData.createHeatmapLegendLabelArray(),                             colors: SampleData.createHeatmapLegendColorArray(),                             width: 120,                             height: 200)                         Spacer()                     }                     .transition(.slide)                 }             }             .animation(.easeInOut, value:isShowingLegend)           ,           alignment: .bottom         )     } } I don't know if this is what you are looking for (or were looking for, because it has been two weeks!), but I hope it helps. This is a pretty good article about transitions https://www.objc.io/blog/2022/04/14/transitions/ And I found this tutorial very useful also https://www.hackingwithswift.com/books/ios-swiftui/creating-implicit-animations
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’22
Reply to c++ formatting library fmt not working in Xcode 14.1
at the top of your file, change #include "fmt/core.h" to `#define FMT_HEADER_ONLY #include "fmt/format.h"` that worked for me. I found the magic ju-ju on Stackoverflow, if you search for "How to use fmt library in the header-only mode?" you should see the answer I found. If this forum allows direct links, it is here: https://stackoverflow.com/questions/66944554/how-to-use-fmt-library-in-the-header-only-mode
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’22
Reply to Problems with ForEach, SwiftUI
your view model is publishing an array (a random access collection of artworks), but your ArtworkGridView declares a single var artwork: Artwork . You're asking ForEach to iterate over something that isn't a collection.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to Xcode 14.2 editor mis-parses Swift extended delimiter string with backslash at end
what is the question here? You can file bugs using Feedback Assistant.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to Can defaults command on macOS read app group preferences?
maybe the domain isn't quite what you expect it to be. Have you tried grepping the output of "defaults domains" to see if this is the case?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to Error while compiling in VS Code but not in Xcode
You might get more help asking where people are using VSCode. Most of the folks on this Apple forum are using tools provided by Apple, while you're asking about a problem with a Microsoft tool. Have you set up your VSCode correctly for C++? See https://code.visualstudio.com/docs/cpp/config-clang-mac.
Replies
Boosts
Views
Activity
Jan ’23
Reply to XCode 14.2 randomly crashes often since update to Ventura
If Xcode itself is crashing, file a bug, this will tell you how. https://developer.apple.com/bug-reporting/ If your program is crashing, and you want help on this forum, you'll want to post relevant code samples, after you've gone some way to investigate the problem yourself. Start here. https://developer.apple.com/documentation/xcode/diagnosing-and-resolving-bugs-in-your-running-app
Replies
Boosts
Views
Activity
Jan ’23
Reply to Wired spacing between rows when using LazyVGrid
change your text in the CardView from Text(content) .font(.largeTitle) to Text(content) .font(.largeTitle).frame(maxHeight: .infinity) embarrassingly, I can't remember why that does the trick.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to App crash on launch only in Ireland
You tested on a phone with language, calendar, date and time etc set appropriately for Ireland?
Replies
Boosts
Views
Activity
Jan ’23
Reply to MacOS Ventura Python version?
I followed the instructions at https://opensource.com/article/19/5/python-3-default-mac#what-to-do which basically say install and use pyenv with homebrew.
Replies
Boosts
Views
Activity
Jan ’23
Reply to Im interested to make HomeKit enabled accessory
I suggest you file a bug with Feedback Assistant for the documentation at the link https://mfi.apple.com/en/who-should-join.html, asking for Apple to fix the link or to clarify the situation for non-commercial development.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to Background video recording
Well, I'm not Apple, but I think it is unlikely that you'll ever hear a reason for their design decisions. What you'll usually hear is that if you want a feature, use the Feedback Assistant to request that feature - outline your use case, what you can do, what you can't do, why you would like to be able to do it. Often, decisions like these are made to improve the overall user experience of the phone; it is quite easy to drain the battery rapidly if you leave. video recording on inadvertently. You may contend that the user should be made the final arbiter in this decision (it's my phone, and I'll drain the battery if I want to!), and that is so on other platforms, but this is Apple's design and Apple make the rules.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Dec ’22
Reply to Sendig UDP packets with specified local port
I might be completely wrong here, but it looks like you can do this line differently connection = NWConnection(host: host, port: port, using: .udp) the last parameter doesn't need to be fixed as .udp, the default udp parameters. You can make new NWParameters and alter the value of requiredLocalEndpoint. hth, and Happy New Year
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’22
Reply to How Can WithAnimation Code be placed inside the view to be animated
Your code wouldn't compile as-is, but I think you want your GradientLegendView to slide in from the leading edge, and out on the trailing edge of the ContentView, in response to pressing a button. And you don't want to animate the isShowingLegend variable, you'd rather attach the animation to your GradientLegendView. The thing is, what you want to animate (the position of the GradientLegendView) isn't intrinsic to the GradientLegendView. The view position is a property of the GradientLegendView which only makes sense in the ContentView. I took the .transition modifier out of the GradientLegendView, and removed its isShowingLegend. The GradientLegendView is the thing which shows the gradient legend; it doesn't make sense for it to take that bool parameter. The piece of UI which uses the GradientLegendView decides whether to show it or not. I attached a .transition(.slide) to the HStack which builds your GradientLegendView, and provided a .animation controlled by isShowingLegend. The animation is applied to a Group in your overlay. The Group returns an HStack if isShowingLegend is true and an (implied) EmptyView otherwise. It is necessary because the type of the parameter to .overlay should be some View. this is my ContentView     @State private var isShowingLegend = true     var body: some View {         Button("Press Me") {             isShowingLegend.toggle()         }          .frame(maxWidth: .infinity, maxHeight: .infinity)         .edgesIgnoringSafeArea(.all) //        .task { //          setupMenuItems() // won't compile, don't have //        }         .overlay(             Group {                 if isShowingLegend {                     HStack {                         GradientLegendView(                             // doesn't need isShowingLegend                             labels: SampleData.createHeatmapLegendLabelArray(),                             colors: SampleData.createHeatmapLegendColorArray(),                             width: 120,                             height: 200)                         Spacer()                     }                     .transition(.slide)                 }             }             .animation(.easeInOut, value:isShowingLegend)           ,           alignment: .bottom         )     } } I don't know if this is what you are looking for (or were looking for, because it has been two weeks!), but I hope it helps. This is a pretty good article about transitions https://www.objc.io/blog/2022/04/14/transitions/ And I found this tutorial very useful also https://www.hackingwithswift.com/books/ios-swiftui/creating-implicit-animations
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’22
Reply to c++ formatting library fmt not working in Xcode 14.1
at the top of your file, change #include "fmt/core.h" to `#define FMT_HEADER_ONLY #include "fmt/format.h"` that worked for me. I found the magic ju-ju on Stackoverflow, if you search for "How to use fmt library in the header-only mode?" you should see the answer I found. If this forum allows direct links, it is here: https://stackoverflow.com/questions/66944554/how-to-use-fmt-library-in-the-header-only-mode
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to Special camera application issue
when you record a video, is the phone using the same field of view as for a still picture?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’22