Post

Replies

Boosts

Views

Activity

Reply to want start my journey
There are a lot of tutorials in Apple's Library. Get there, search for Swift. You may start with "Intro to app development with Swift". It may be based on an older version of Xcode, but the basics are still the same. If you want to start with SwiftUI, you could look here: https://developer.apple.com/tutorials/app-dev-training/getting-started-with-scrumdinger
Jun ’24
Reply to Iphone SE2 IOS18 crashed
Did you try this ? https://support.apple.com/en-us/118106 Make sure that your Mac is up to date. If you're using a PC, make sure you have the latest version of the Apple Devices app or iTunes. Connect your device to your computer with a USB cable. Open the Finder on your Mac, or open the Apple Devices app on your PC. If your PC doesn't have the Apple Devices app, or your Mac is using macOS Mojave or earlier, open iTunes instead. Keep your device connected and wait until the Connect to computer screen appears. iPhone 8 or later, including iPhone SE (2nd generation and later): Press and quickly release the volume up button. Press and quickly release the volume down button. Then, press and hold the side button until you see the Connect to computer screen. An animation of an iPhone with arrows pointing to the Volume Up button, then to the Volume Down button, and then to the side button.
Topic: App & System Services SubTopic: General Tags:
Jun ’24
Reply to Hiding chevron from list, SwiftUI
Here is a way to mimic a List without chevron, with a ScrollView: ScrollView(.vertical, showsIndicators: true) { ForEach(0..<15) { index in HStack { Spacer() NavigationLink(destination: DestinationView(item: index)) { Text("Navigate \(index) to View 1") } // Text(">") // This would mimic a List's chevron Spacer() } .padding(.vertical, 5) } } .navigationBarTitle("Navigation Links") } } } struct DestinationView: View { var item: Int var body: some View { Text("Destination View for item \(item)") .navigationBarTitle("View", displayMode: .inline) } }
Topic: UI Frameworks SubTopic: SwiftUI
Jun ’24
Reply to My app Xcode SwiftUI
You have probably a free developer license ? If so, you have to rebuild app regularly (I thought it was every week, but may be shorter). The point is that free licence is done to let you learn to develop, not really to build apps to use.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’24
Reply to SwiftUI chart legend overflow
I tried with Xcode 16.0ß and Xcode 15.3, on iOS 17.4 and 18.0 simulators and got a correct result. It is not wrapped but correctly positioned and sized. So I extended your text further more and got a correct result again: And even more, to exceed width limit: ChartData(id: 2, title: "Item 2 With a Long Title and then some more and even some more for a crazy legend length", count: 6, color: .blue), Then it did not work. I used a different modifier to build the legend manually: .chartLegend(alignment: .leading, content: { HStack(alignment: .top, spacing: 5) { ForEach(data) { d in HStack { Text("•") .font(.system(size: 48)) .bold() .foregroundStyle(d.color) Text("\(d.title)") .font(.system(size: 14)) .lineLimit(nil) // Multilines .foregroundStyle(Color.gray) } .frame(width: 125, height: 120) } } }) You can adapt content to better fit your need.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’24
Reply to Data update issue when both parent and child views are @State in SwiftUI
For the first question. You have to use Binding and not State in SubView1: struct SubView1: View { // @State var data: String @Binding var data: String And of course call it appropriately: SubView1(data: $data) With State, you keep the state of the var. With Binding, you reference the parameter passed, so it is updated. In SubView2, you pass directly the parameter, so it is used for display. For your second question, my understanding is that effectively the compiler optimises the views creation. As Subview1 is already created, it can reuse it immediately without creating a new instance.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’24
Reply to I want to limit input on textfield...
You shoals use the onChange on TextField to test on the fly. Do it in onSubmit to test only when you hit return key. If the State var in the TextField is input, you should test if only letters .onChange(of: input) { oldInput, proposedInput in if onlyLetters(proposedInput) { input = proposedInput } else { input = oldInput } } onlyLetters is a func to test the proposed string contains only letters. func onlyLetters(_ s: String) -> Bool { return resultoftest } See here a way to implement: https://stackoverflow.com/questions/60657152/how-to-check-whether-string-only-consists-of-letters-and-spaces-in-swift-5
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’24
Reply to want start my journey
There are a lot of tutorials in Apple's Library. Get there, search for Swift. You may start with "Intro to app development with Swift". It may be based on an older version of Xcode, but the basics are still the same. If you want to start with SwiftUI, you could look here: https://developer.apple.com/tutorials/app-dev-training/getting-started-with-scrumdinger
Replies
Boosts
Views
Activity
Jun ’24
Reply to Iphone SE2 IOS18 crashed
Did you try this ? https://support.apple.com/en-us/118106 Make sure that your Mac is up to date. If you're using a PC, make sure you have the latest version of the Apple Devices app or iTunes. Connect your device to your computer with a USB cable. Open the Finder on your Mac, or open the Apple Devices app on your PC. If your PC doesn't have the Apple Devices app, or your Mac is using macOS Mojave or earlier, open iTunes instead. Keep your device connected and wait until the Connect to computer screen appears. iPhone 8 or later, including iPhone SE (2nd generation and later): Press and quickly release the volume up button. Press and quickly release the volume down button. Then, press and hold the side button until you see the Connect to computer screen. An animation of an iPhone with arrows pointing to the Volume Up button, then to the Volume Down button, and then to the side button.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to Hiding chevron from list, SwiftUI
Here is a way to mimic a List without chevron, with a ScrollView: ScrollView(.vertical, showsIndicators: true) { ForEach(0..<15) { index in HStack { Spacer() NavigationLink(destination: DestinationView(item: index)) { Text("Navigate \(index) to View 1") } // Text(">") // This would mimic a List's chevron Spacer() } .padding(.vertical, 5) } } .navigationBarTitle("Navigation Links") } } } struct DestinationView: View { var item: Int var body: some View { Text("Destination View for item \(item)") .navigationBarTitle("View", displayMode: .inline) } }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Jun ’24
Reply to Iphone repeatedly crashes on IOS 18 dev beta.
Which iPhone model do you have ? Hard to help on betas. Best is to return to release and wait for iOS 18 release.
Replies
Boosts
Views
Activity
Jun ’24
Reply to View with 2 labels of dynamic height
IMHO, even though it is possible to do this with constraints, I fear it is too complex. If I understand what you want to achieve, I would position the labels manually in their View. And call needsToUpdate when the label length changes.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to Apple Developer's Age of majority conflict!
I see this message Which message ? is it 'Apple Developer's Age of majority conflict!' What is the exact error message you receive, at what step of registration ? You may read this: https://discussions.apple.com/thread/6441831?sortBy=best Are you sure rejection is due to age and not another issue ?
Replies
Boosts
Views
Activity
Jun ’24
Reply to Rejected with Guideline 2.5.1 & NEVPNManager APIs
I don't think you may find a permission for this. You have to use the official VPN APIs as told in the reviewer's answer. Good continuation.
Replies
Boosts
Views
Activity
Jun ’24
Reply to How to disable screen record/capture?
No, there is no API for this. And, as you can find in many posts on the forum which asked this question, there is no sure way to achieve it. It would always be possible to shoot a photo of the screen from a second device.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to Membership expired, no where to renew it?
Could you show the screen you get after you signed in ? If not successful, I advise you to contact support. They will tell where the problem is.
Replies
Boosts
Views
Activity
Jun ’24
Reply to My app Xcode SwiftUI
You have probably a free developer license ? If so, you have to rebuild app regularly (I thought it was every week, but may be shorter). The point is that free licence is done to let you learn to develop, not really to build apps to use.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to Can I enroll my iPhone 6s?
iPhone 6s is limited to iOS 15. So you cannot install betas of iOS 18 for instance.
Replies
Boosts
Views
Activity
Jun ’24
Reply to SwiftUI chart legend overflow
I tried with Xcode 16.0ß and Xcode 15.3, on iOS 17.4 and 18.0 simulators and got a correct result. It is not wrapped but correctly positioned and sized. So I extended your text further more and got a correct result again: And even more, to exceed width limit: ChartData(id: 2, title: "Item 2 With a Long Title and then some more and even some more for a crazy legend length", count: 6, color: .blue), Then it did not work. I used a different modifier to build the legend manually: .chartLegend(alignment: .leading, content: { HStack(alignment: .top, spacing: 5) { ForEach(data) { d in HStack { Text("•") .font(.system(size: 48)) .bold() .foregroundStyle(d.color) Text("\(d.title)") .font(.system(size: 14)) .lineLimit(nil) // Multilines .foregroundStyle(Color.gray) } .frame(width: 125, height: 120) } } }) You can adapt content to better fit your need.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to xcodebuild destination for any mac
Maybe you'll find the answer here: https://mokacoding.com/blog/xcodebuild-destination-options/ Source : https://forums.developer.apple.com/forums/thread/702296
Replies
Boosts
Views
Activity
Jun ’24
Reply to Data update issue when both parent and child views are @State in SwiftUI
For the first question. You have to use Binding and not State in SubView1: struct SubView1: View { // @State var data: String @Binding var data: String And of course call it appropriately: SubView1(data: $data) With State, you keep the state of the var. With Binding, you reference the parameter passed, so it is updated. In SubView2, you pass directly the parameter, so it is used for display. For your second question, my understanding is that effectively the compiler optimises the views creation. As Subview1 is already created, it can reuse it immediately without creating a new instance.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to I want to limit input on textfield...
You shoals use the onChange on TextField to test on the fly. Do it in onSubmit to test only when you hit return key. If the State var in the TextField is input, you should test if only letters .onChange(of: input) { oldInput, proposedInput in if onlyLetters(proposedInput) { input = proposedInput } else { input = oldInput } } onlyLetters is a func to test the proposed string contains only letters. func onlyLetters(_ s: String) -> Bool { return resultoftest } See here a way to implement: https://stackoverflow.com/questions/60657152/how-to-check-whether-string-only-consists-of-letters-and-spaces-in-swift-5
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’24