Post

Replies

Boosts

Views

Activity

Reply to Build an app by Swift Playgrounds
What is your question precisely ? There are already a lot of family tree apps, they will show you what they are exactly. Did you search on the web ? http ://en.wikipedia. org/wiki/Family_tree If you are a beginner, take care, that is a complex app, which requires a good knowledge of Swift. Don't forget to close your threads when you get the answer you need, by marking the correct answer.
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to Build a List with keyboard selection (macOS App)
Could you explain more clearly your problems ? First is the textfield, you can only edit in a textfield when you click on the text, otherwise you selected the row. However my textfield is alway in full width... Is the problem that the text in the list is too large and you cannot click outside of text ? Or something else ? Note there is (yet another) bug in List: SwiftUI Textfields embedded in a List are not editable when target is macOS https://stackoverflow.com/questions/57576128/editable-textfield-in-swiftui-list In any case, posting your code would help understand the problem.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’21
Reply to Big Sur crashing all the time
If that may help, some threads resolving similar problems: https://developer.apple.com/forums/thread/667376 I had the same issue after upgrading to Big Sur. Computer would crash every five minutes with no applications running (just sitting idle). Apple walked me through the following steps. Boot into Safe Mode and see if computer crashes (it did eventually) Create a new user account and see if the computer crashes (it did) These didn't solve my problem, but may be helpful for others. Eventually, I needed to boot into Internet Recover mode (Shift-Command-R), erase hard drive, reformat hard drive, and re-install Big Sur. Once I did that, the problem was resolved. A radical solution, but it worked. Apple was very helpful in resolving this problem. On the positive side, a new install was a nice refresh and my laptop runs faster. Luckily, I had all my data files in my Apple iCloud Drive. And that is a long and widespread problem, dating back to Catalina. They say here it's GPU related. https ://forums.macrumors. com/threads/constant-kernel-panics-userspace-watchdog-timeout-no-successful-checkins-from-com-apple-windowserver.2222878/
Topic: App & System Services SubTopic: Core OS Tags:
May ’21
Reply to Change localization of UIDatePicker in iOS 14
@edford I do it in all apps now. That's very convenient. It allows for a very fast language switching. The only caveat of course, it that when you open settings from iOS, the app settings are not localized. Nevertheless, there is something not possible here. Here is the use case. I work or play with s.o. on the iPad. I speak french, he speaks spanish. When I face the iPad, app is in french. When I lean to him, view rotates and now it's spanish. Wouldn't it be cool ?
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’21
Reply to ITMS-90809: Deprecated API Usage
Did you try the solution presented here (I think the important is the flag to add to the build): https ://devblogs.microsoft. com/xamarin/uiwebview-deprecation-xamarin-forms/ Go and see it to have screenshots as well. The solution only involves three steps:  Use the right versions of Xamarin.Forms and Xamarin.iOS.  Do you use Forms ≥ 4.5 and .Xamarin.iOS ≥ 13.10.0.17 Add a flag to the build configuration. (is it what you did with link all ?). Did you add the Additional mtouch arguments defined in the screen shot (--optimize=experimental-xforms-product-type)? Build and submit your app to the App Store On the Xamarin.Forms side we also had to make some changes to make all this work correctly. These new changes are part of Xamarin.Forms 4.5, including the pre-releases. Make sure that you are using the Forms 4.5 or newer NuGet package in your projects.  You also need to make sure that you are using Xamarin.iOS 13.10.0.17. You can check this from Visual Studio. This version of Xamarin.iOS is included with Visual Studio for Mac 8.4.1 and Visual Studio 16.4.3 and up.  With that in place, you can simply go to your iOS project, open the project properties and add this flag in the additional mtouch arguments field: --optimize=experimental-xforms-product-type this flag works together with the Linker Behavior set to SDK Only or All. If for any reason you see errors when setting the Linker Behavior to All, this is most likely a problem within the app code or a 3rd party library that is not linker safe. For more information on the linker, please refer to the docs. If that works, don't forget to mark the correct answer, it may help others.
May ’21
Reply to Why is this crashing?
A general comment first. You could streamline your code by replacing statement like if unlocked.contains("Summer") { } else { unlocked.append("Summer") } by if !unlocked.contains("Summer") { unlocked.append("Summer") } Which line do you get the crash exactly ? (code is slightly different from the snippet you present, so that makes it difficult to localise where this occurs); is it in didSelectRowAt ? Line 7, 10 or 16, 19 ? If that's here: i don't understand how you use names: rows in sections will be 0, 1, 2, restarting at zero in each section you call self.unlocked[indexPath.row] ; Could you test with a print the size of self.unlocked and the number of rows in section ? func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { print(indexPath.row) tableView.deselectRow(at: indexPath, animated: true) if indexPath.section == 0 { let icon = self.unlocked[indexPath.row] setIcon(name: icon) if IconChange.setIconPurchased == true { iconSelected = names[indexPath.row] UserDefaults.standard.setValue(names[indexPath.row], forKey: "iconSelected") IconSelector.reloadData() tableView.cellForRow(at: indexPath)?.accessoryType = .checkmark } } else if indexPath.section == 1 { let icon = self.locked[indexPath.row] setIcon(name: icon) if IconChange.setIconPurchased == true { iconSelected = names[indexPath.row] UserDefaults.standard.setValue(names[indexPath.row], forKey: "iconSelected") IconSelector.reloadData() tableView.cellForRow(at: indexPath)?.accessoryType = .checkmark IconChange.pushBack = true self.navigationController?.popViewController(animated: true) } } } Yet another comment. Maintaining several arrays to keep track of what is in tableView is really a risky design (the crash is just an illustration). You'd better have a single dataSource, with attributes as locked: Bool instead of locked and unlocked arrays.
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to Why aren't Apple employees monitoring this forum? What gives?
Just my personal comment on this. I appreciate the way some, like Quinn -- BTW, the most active contributor by far on the forum --, contribute to the forum, with very precise and helpful answers when he feels that exchanges between developers are stuck in the sand. But I find it useful to keep this forum a developers forum, developers helping developers, sharing their experience and knowledge, and not to become a substitute for the Apple support channel. This being said, I regret that, when a problem is reported again and again and that no-one with in depth knowledge of the root causes jumps in.
May ’21
Reply to Why is this crashing?
So, add the print and tell what you get before crash: func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { print(indexPath.row) print("unlocked:", self.unlocked.count, "locked:", self.locked.count) // -- add this tableView.deselectRow(at: indexPath, animated: true) if indexPath.section == 0 { let icon = self.unlocked[indexPath.row] setIcon(name: icon) if IconChange.setIconPurchased == true { iconSelected = names[indexPath.row] UserDefaults.standard.setValue(names[indexPath.row], forKey: "iconSelected") IconSelector.reloadData() tableView.cellForRow(at: indexPath)?.accessoryType = .checkmark } } else if indexPath.section == 1 { let icon = self.locked[indexPath.row] setIcon(name: icon) if IconChange.setIconPurchased == true { iconSelected = names[indexPath.row] UserDefaults.standard.setValue(names[indexPath.row], forKey: "iconSelected") IconSelector.reloadData() tableView.cellForRow(at: indexPath)?.accessoryType = .checkmark IconChange.pushBack = true self.navigationController?.popViewController(animated: true) } } } My guess is that indexPath.row gets larger than the array size.
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to Why is this crashing?
Once an icon gets purchased, setIconPurchased gets set to true, and then if it equals true it does more actions. If so, why don't you launch the other action in the same func where you set setIconPurchased to true ? But the overall problem is that your code is too complex. One reason is that you store ate of cells in different arrays that you need to sync.
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to Fatal error: Index out of range. In for loop using an array.
You can also create the array with the right number of elements : let maxLevel:Int = 99 var randomSeq: [Int] = Array(repeating: 0, count: 99). // Array full of zero ; in playground, you can use maxLevel here Now, you can use your code Take care in your loop, array indexes start at zero: for i in 0...maxLevel-1 { randomSeq[i] = Int.random(in: 1...4) or for i in 0...randomSeq.count-1 { randomSeq[i] = Int.random(in: 1...4)
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to MKPolyline 'inside' an MKOverlay: How do I access the points that construct the line?
MKOverlay is a protocol. And type is effectively MKPolyline In the GitHub code, they note: // MKPointAnnotations and are not MKOverlays. var points: [MKAnnotation] { return _placemarks.compactMap{$0.point} } So, to get the points, instead of using         let overlays = self.kmlParser.overlays did you try using         let points = self.kmlParser.points (but that may be only the coordinates of the annotation, not your line).
Topic: Programming Languages SubTopic: Swift Tags:
May ’21