Posts

Post not yet marked as solved
2 Replies
Do you have a UITextFieldDelegate setup? It defines the appropriate methods, e.g., textFieldDidBeginEditing(), textFieldDidEndEditing(), etc.
Post marked as solved
1 Replies
The documentation now states that this property is ignored in Mac Catalyst (I'm not sure if that was there when I originally posted the question).
Post marked as solved
1 Replies
The solution is, when becoming first responder, to set the UITextField's selectedTextRange to nil.
Post not yet marked as solved
11 Replies
I have this same problem, I'm sure Apple's going to get right on it.
Post marked as solved
7 Replies
Thanks, thegathering - I bow to your superior Googling skills 😀
Post marked as solved
7 Replies
Update: reinstalled Xcode beta, that didn't help either. And, for once, I actually read the release notes, and did not see this mentioned.
Post marked as solved
7 Replies
Thanks for your reply, KMT, that inspired me -- I created a new project in Xcode 12 beta, and got the same error, so it's not just my current app. It must be something on my end, otherwise I'm sure more people would have run into this, but I filed feedback anyways: it shouldn't happen on any system.
Post marked as solved
5 Replies
cookieapps, thank you so much! All I had to do was fiddle with the scroll bars, and I'm sure that I would've figured that out ... sometimes in the early 2030's 😀
Post marked as solved
3 Replies
Yes ... and no :-( What I want is to a) create a folder, CrosswordRewind, inside the sandbox's Documents folder, and b) put up a gorgeous UI to show me that folders contents (with UIDocumentsPickerViewController). I've accomplished a), and the reason I said "yes ... and no" is because I can see CrosswordRewind on the simulator, not on an iPad The folder got created on the iPad (I can see it thanks to the Devices window), but Files is showing me 3 folders -- Minecraft, Exploring EDU, and Recovered Files. I have 3 theories: I'm using the wrong class. The docs say a UIDocumentPickerViewController is a "view controller that provides access to documents or destinations outside [my emphasis] your app's sandbox." They don't say anything about inside. I've misconfigured UIDocumentPickerViewController somehow, so it won't show me (on the iPad) my current Document folder. What I'm saving isn't actually a UIDocument -- maybe that's illegal (but just on the iPad)
Post not yet marked as solved
97 Replies
I too was reminded why they call this macOS Beta. The progress bar would complete, then start again and end at about 5%, not moving even after several hours. I could log in in Safe Mode, but the Finder would lock up almost immediately. I just gave up, erased the entire drive, and reinstalled, thankful for iCloud Drive and Dropbox (eh, except the Dropbox app isn't compatible with Big Sur 🙁)
Post not yet marked as solved
2 Replies
Thanks for your repsonse, m_bedwell, I am grateful. You're right that I have a copy and paste error. I wanted canadianDollar to be a backing variable for canadian, and americanDollar to be a backing variable for american (so I rewrote it as shown below). But regardless of what I do in the getter or setter, when I tap on either Button, both Button's actions get triggered -- e.g., if I tap on CAD ->USD, I see "Canadian to US" and "US to Canadian" being printed. I take it you're seeing something different?Update (breaking news): if I eliminate the last HStack, or change it to a Group, each button works independently, as it should. It's only in a HStack or VStack that the stack itself seems tappable, and passes the tap to all of its child views. var canadian:String { get { "\(canadianDollar)"} set { canadianDollar = Double(newValue) ?? 0.00} } var american:String { get { "\(americanDollar)"} set { americanDollar = Double(newValue) ?? 0.00} } var canadianDollar:Double var americanDollar:Double struct ContentView : View { @State private var currency = Currency(canadianDollar: 0.00, americanDollar: 0.00) var body: some View { NavigationView { Form { HStack { Text("CAD: ") TextField($currency.canadian).textFieldStyle(.roundedBorder) } HStack { Text("USD: ") TextField($currency.american).textFieldStyle(.roundedBorder) } HStack { Button(action: { print("Canadian to US") }){ Text("CAD -> USD") }.background(Color.green) Button(action: { print("US to Canadian") }){ Text("USD -> CAD") }.background(Color.yellow) } }.navigationBarTitle(Text("Currency Converter")) } } }
Post marked as solved
7 Replies
Thanks so much, m_bedwell. I copied your code, and it worked. I then uncommented out the redundant didChange.send(), cleaned the project, and it still worked. However, when I restored my old Picker code:ForEach(self.favoriteFoods.identified(by: \.self)){ food in Text(food) } it crashed with EXC_BAD_INSTRUCTION (which it did not do previously). So, I'm not quite sure what's going on with ForEach() but I'm sticking with your (and hackingwithswift.com's) way of doing things. 🙂Thanks again for you assistance, it is much appreciated!