Post

Replies

Boosts

Views

Activity

Reply to Stack feature not working as per plan.
And now with progress bar overlaying: struct ContentView: View { let barHeight: CGFloat = 30 let barColor = Color.gray let duration: Double = 10 let icon = "globe" @State private var progress: CGFloat = 0 var body: some View { ZStack(alignment: .leading) { // VStack { // Background bar RoundedRectangle(cornerRadius: 10) // .fill(Color.gray.opacity(0.3)) // .frame(height: barHeight) // Set height to the specified barHeight // Progress bar // GeometryReader { geometry in RoundedRectangle(cornerRadius: 10) .fill(barColor.opacity(0.5)) // To see through .frame(width: CGFloat(progress) * UIScreen.main.bounds.width, height: barHeight) // .frame(width: CGFloat(progress) * geometry.size.width, height: barHeight) .animation(.linear(duration: 10), value: progress) // } // .cornerRadius(10) // That's redundant // Icon and label HStack { Rectangle() // to avoid frame moving when animation starts) .fill(.clear) .frame(width: UIScreen.main.bounds.width * 0.05, height: barHeight) Image(systemName: icon) .foregroundColor(.black) .font(.system(size: 28)) // Increased size .padding(.leading, 8) .onTapGesture { progress = 1 // Added to see progress } Spacer() Text(String/*timeString*/(format: "%.1f", /*from: */duration * Double(progress))) .foregroundColor(.black) .bold() .font(.system(size: 24)) // Increased size .padding(.trailing, 8) } .frame(width: UIScreen.main.bounds.width/* * 0.9*/, height: barHeight) // Changed to avoid frame moving when animation starts .zIndex(1) // Ensure the HStack is on top Spacer() // ADDED THIS } .padding(.horizontal) } } We get this during progress: May be we could use overlay, but did not try.
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’24
Reply to Stack feature not working as per plan.
What is ProgressiveBar ? Is it RoundedRectangle(cornerRadius: 10) What do you mean by above or on top. Please show what you get and what you want. Why do you need geometry reader and not just set the zIndex of the progress bar ? I edited your code to guess and complete missing parts: struct ContentView: View { let barHeight: CGFloat = 30 let barColor = Color.gray let duration: Double = 10 let icon = "globe" @State private var progress = 0 var body: some View { ZStack(alignment: .leading) { // Background bar RoundedRectangle(cornerRadius: 10) // .fill(Color.gray.opacity(0.3)) // .frame(height: barHeight) // Set height to the specified barHeight // Progress bar GeometryReader { geometry in RoundedRectangle(cornerRadius: 10) .fill(barColor) .frame(width: CGFloat(progress) * geometry.size.width, height: barHeight) .animation(.linear(duration: 10), value: progress) } .cornerRadius(10) // Icon and label HStack { Image(systemName: icon) .foregroundColor(.black) .font(.system(size: 28)) // Increased size .padding(.leading, 8) .onTapGesture { progress = 10 // Added to see progress } Spacer() Text(String/*timeString*/(format: "%.1f", /*from: */duration * Double(progress))) .foregroundColor(.black) .bold() .font(.system(size: 24)) // Increased size .padding(.trailing, 8) } .frame(width: UIScreen.main.bounds.width * 0.9, height: barHeight) .zIndex(1) // Ensure the HStack is on top } .padding(.horizontal) } } The progressBar is above: I changed ZStack to VStack and removing geometryReader and get this: struct ContentView: View { let barHeight: CGFloat = 30 let barColor = Color.gray let duration: Double = 10 let icon = "globe" @State private var progress = 0 var body: some View { // ZStack(alignment: .leading) { VStack { // Set height to the specified barHeight // Progress bar // GeometryReader { geometry in // REMOVED RoundedRectangle(cornerRadius: 10) .fill(barColor) .frame(width: CGFloat(progress) * UIScreen.main.bounds.width, height: barHeight) // WE CAN get screen width directly // .frame(width: CGFloat(progress) * geometry.size.width, height: barHeight) .animation(.linear(duration: 10), value: progress) // } .cornerRadius(10) // Icon and label HStack { Image(systemName: icon) .foregroundColor(.black) .font(.system(size: 28)) // Increased size .padding(.leading, 8) .onTapGesture { progress = 10 // Added to see progress } Spacer() Text(String/*timeString*/(format: "%.1f", /*from: */duration * Double(progress))) .foregroundColor(.black) .bold() .font(.system(size: 24)) // Increased size .padding(.trailing, 8) } .frame(width: UIScreen.main.bounds.width * 0.9, height: barHeight) // .zIndex(1) // Ensure the HStack is on top Spacer() // ADDED THIS } .padding(.horizontal) } } Is it what you are looking for ? If so, don't forget to close the thread by marking the answer as correct.
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’24
Reply to App Rejected for Minimal Functionality
Sorry to say, but rejection here appears a very sound decision. Imagine the appStore populated with a lot of similar apps… what a frustration for users. Now, if you change your app to become really an educational app, showing examples of what could be a "complex" UI and a minimalist that perform the same task, that would provide some user value and may be pass the review. Good luck.
Aug ’24
Reply to Bug description: App forze on the splash screen
We don't know the tests that are done in review. So no way to reproduce, simulate or whatever. There is probably a problem in your code, you have to find where and what. What is the error report you get. Is is about a crash, a performance issue, a problem with your metadata… Without it, impossible to help. If I understand the thread title correctly(it would be better to detail in post), the app freezes on splash screen. Are you loading data from network during app launching ? Or anything else that can take a long time ?
Aug ’24
Reply to Apple Intelligence- US Only
That's not totally correct. What we read is that at initial rollout, some functions will be available in US only; but will be available later in other countries. Delay may depend on compliance issues with local regulations (Europe and China notably) or the fact that it is not yet localized. Get details here. https://www.macrumors.com/2024/06/21/apple-intelligence-europe-delay/ https://www.macrumors.com/how-to/enable-apple-intelligence-outside-us/ PS: not sure it is a strong enough reason for emigration… 😉
Aug ’24
Reply to how to use swift
What do you want to learn ? the language itself ? How to develop an app ? There are many (free) tutorials available from Apple: all references (a lot) here. https://developer.apple.com/pathways/ to learn Swift: you can search in Apple Library: App development with Swift To develop app: Intro to app development with Swift To use SwiftUI to develop app (in Swift): https://developer.apple.com/tutorials/app-dev-training/getting-started-with-scrumdinger Good learning.
Aug ’24
Reply to is it true that xcode 15 apps won't compile in xcode 16?
NO. I have several apps that were developed in various versions of Xcode. And compiled on Xcode 15, they compile without issue on Xcode 16. What could happen is that you get some warnings that some API will be obsoleted. But that's something very common that any serious developer knows how to solve easily. So your developer may be trying to fool you, just to ask for some extra cost or it did something really weird in its code. My advice: Ask him/her to send you a screenshot with the error and the involved code when trying to compile on Xcode 16. And post it on the forum.
Aug ’24
Reply to Apple Intelligence- US Only
Some recent news for Apple Intelligence availability in Europe (in English only): https://www.macrumors.com/how-to/get-apple-intelligence-in-the-eu/
Replies
Boosts
Views
Activity
Aug ’24
Reply to Stack feature not working as per plan.
And now with progress bar overlaying: struct ContentView: View { let barHeight: CGFloat = 30 let barColor = Color.gray let duration: Double = 10 let icon = "globe" @State private var progress: CGFloat = 0 var body: some View { ZStack(alignment: .leading) { // VStack { // Background bar RoundedRectangle(cornerRadius: 10) // .fill(Color.gray.opacity(0.3)) // .frame(height: barHeight) // Set height to the specified barHeight // Progress bar // GeometryReader { geometry in RoundedRectangle(cornerRadius: 10) .fill(barColor.opacity(0.5)) // To see through .frame(width: CGFloat(progress) * UIScreen.main.bounds.width, height: barHeight) // .frame(width: CGFloat(progress) * geometry.size.width, height: barHeight) .animation(.linear(duration: 10), value: progress) // } // .cornerRadius(10) // That's redundant // Icon and label HStack { Rectangle() // to avoid frame moving when animation starts) .fill(.clear) .frame(width: UIScreen.main.bounds.width * 0.05, height: barHeight) Image(systemName: icon) .foregroundColor(.black) .font(.system(size: 28)) // Increased size .padding(.leading, 8) .onTapGesture { progress = 1 // Added to see progress } Spacer() Text(String/*timeString*/(format: "%.1f", /*from: */duration * Double(progress))) .foregroundColor(.black) .bold() .font(.system(size: 24)) // Increased size .padding(.trailing, 8) } .frame(width: UIScreen.main.bounds.width/* * 0.9*/, height: barHeight) // Changed to avoid frame moving when animation starts .zIndex(1) // Ensure the HStack is on top Spacer() // ADDED THIS } .padding(.horizontal) } } We get this during progress: May be we could use overlay, but did not try.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to Stack feature not working as per plan.
What is ProgressiveBar ? Is it RoundedRectangle(cornerRadius: 10) What do you mean by above or on top. Please show what you get and what you want. Why do you need geometry reader and not just set the zIndex of the progress bar ? I edited your code to guess and complete missing parts: struct ContentView: View { let barHeight: CGFloat = 30 let barColor = Color.gray let duration: Double = 10 let icon = "globe" @State private var progress = 0 var body: some View { ZStack(alignment: .leading) { // Background bar RoundedRectangle(cornerRadius: 10) // .fill(Color.gray.opacity(0.3)) // .frame(height: barHeight) // Set height to the specified barHeight // Progress bar GeometryReader { geometry in RoundedRectangle(cornerRadius: 10) .fill(barColor) .frame(width: CGFloat(progress) * geometry.size.width, height: barHeight) .animation(.linear(duration: 10), value: progress) } .cornerRadius(10) // Icon and label HStack { Image(systemName: icon) .foregroundColor(.black) .font(.system(size: 28)) // Increased size .padding(.leading, 8) .onTapGesture { progress = 10 // Added to see progress } Spacer() Text(String/*timeString*/(format: "%.1f", /*from: */duration * Double(progress))) .foregroundColor(.black) .bold() .font(.system(size: 24)) // Increased size .padding(.trailing, 8) } .frame(width: UIScreen.main.bounds.width * 0.9, height: barHeight) .zIndex(1) // Ensure the HStack is on top } .padding(.horizontal) } } The progressBar is above: I changed ZStack to VStack and removing geometryReader and get this: struct ContentView: View { let barHeight: CGFloat = 30 let barColor = Color.gray let duration: Double = 10 let icon = "globe" @State private var progress = 0 var body: some View { // ZStack(alignment: .leading) { VStack { // Set height to the specified barHeight // Progress bar // GeometryReader { geometry in // REMOVED RoundedRectangle(cornerRadius: 10) .fill(barColor) .frame(width: CGFloat(progress) * UIScreen.main.bounds.width, height: barHeight) // WE CAN get screen width directly // .frame(width: CGFloat(progress) * geometry.size.width, height: barHeight) .animation(.linear(duration: 10), value: progress) // } .cornerRadius(10) // Icon and label HStack { Image(systemName: icon) .foregroundColor(.black) .font(.system(size: 28)) // Increased size .padding(.leading, 8) .onTapGesture { progress = 10 // Added to see progress } Spacer() Text(String/*timeString*/(format: "%.1f", /*from: */duration * Double(progress))) .foregroundColor(.black) .bold() .font(.system(size: 24)) // Increased size .padding(.trailing, 8) } .frame(width: UIScreen.main.bounds.width * 0.9, height: barHeight) // .zIndex(1) // Ensure the HStack is on top Spacer() // ADDED THIS } .padding(.horizontal) } } Is it what you are looking for ? If so, don't forget to close the thread by marking the answer as correct.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to App Rejected for Minimal Functionality
Sorry to say, but rejection here appears a very sound decision. Imagine the appStore populated with a lot of similar apps… what a frustration for users. Now, if you change your app to become really an educational app, showing examples of what could be a "complex" UI and a minimalist that perform the same task, that would provide some user value and may be pass the review. Good luck.
Replies
Boosts
Views
Activity
Aug ’24
Reply to SwiftUI Hierarchical List Performance
I have no specific recommendation either, but found this thread which addresses some lists performance issues and proposes solutions: https://fatbobman.com/en/posts/optimize_the_response_efficiency_of_list/ I did not test, but hope that may help.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to Bug description: App forze on the splash screen
We don't know the tests that are done in review. So no way to reproduce, simulate or whatever. There is probably a problem in your code, you have to find where and what. What is the error report you get. Is is about a crash, a performance issue, a problem with your metadata… Without it, impossible to help. If I understand the thread title correctly(it would be better to detail in post), the app freezes on splash screen. Are you loading data from network during app launching ? Or anything else that can take a long time ?
Replies
Boosts
Views
Activity
Aug ’24
Reply to Sending '$0' risks causing data races
I cannot find this line of code in the referenced link… But it could have to deal with $0 not being sendable. Read here explanations in a different context: https://forums.swift.org/t/cannot-understand-the-nature-of-data-race-warnings-in-swift-5-10/70472
Topic: Media Technologies SubTopic: Video Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to Apple Intelligence- US Only
That's not totally correct. What we read is that at initial rollout, some functions will be available in US only; but will be available later in other countries. Delay may depend on compliance issues with local regulations (Europe and China notably) or the fact that it is not yet localized. Get details here. https://www.macrumors.com/2024/06/21/apple-intelligence-europe-delay/ https://www.macrumors.com/how-to/enable-apple-intelligence-outside-us/ PS: not sure it is a strong enough reason for emigration… 😉
Replies
Boosts
Views
Activity
Aug ’24
Reply to The incorrect work of print function in any browser
That's a question about use of apps, not about its development. So it is not for this forum. You'd better post on support community forum: https://discussions.apple.com/welcome You can also file a bug report in Feedback Assistant: https://feedbackassistant.apple.com
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to Develop in Swift - SwiftUI update?
Could this Apple tutorial help ? https://developer.apple.com/documentation/visionos
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to App Store Connect - Trends sections is not working
The message is general, to all users. And it is very clear: data are not uptodate. It happens from time to time and usually lasts a week or so.
Replies
Boosts
Views
Activity
Aug ’24
Reply to Convert view to PDF
Where in code does it crash ? What is the error message if any (crashlog) ?
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to how to use swift
What do you want to learn ? the language itself ? How to develop an app ? There are many (free) tutorials available from Apple: all references (a lot) here. https://developer.apple.com/pathways/ to learn Swift: you can search in Apple Library: App development with Swift To develop app: Intro to app development with Swift To use SwiftUI to develop app (in Swift): https://developer.apple.com/tutorials/app-dev-training/getting-started-with-scrumdinger Good learning.
Replies
Boosts
Views
Activity
Aug ’24
Reply to New Subscribe on Apple Developer Program
welcome to the forum. Hard to say with this limited information. Could you check against this checklist ? Have you done exactly all the steps ? If not enough, could you show a screenshot of your submission form before getting the error message ? In the screenshot you should partially hide sensitive information.
Replies
Boosts
Views
Activity
Aug ’24
Reply to is it true that xcode 15 apps won't compile in xcode 16?
NO. I have several apps that were developed in various versions of Xcode. And compiled on Xcode 15, they compile without issue on Xcode 16. What could happen is that you get some warnings that some API will be obsoleted. But that's something very common that any serious developer knows how to solve easily. So your developer may be trying to fool you, just to ask for some extra cost or it did something really weird in its code. My advice: Ask him/her to send you a screenshot with the error and the involved code when trying to compile on Xcode 16. And post it on the forum.
Replies
Boosts
Views
Activity
Aug ’24