Post

Replies

Boosts

Views

Activity

Reply to Weird debugger issue
Are you sure the x you see in debugger is the x of the if statement ? May be you have declared x twice in code. Could you show more code ? Or the value you get in debugger is not captured at the same time as the one in if. Before entering 424 for x, did you enter a value over 15000 just before ? And the update of x from textField not done when test occurs ?
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’21
Reply to iOS Bug: Frequently unable to change from main phase to attack phase by clicking the turn button during draft games.
Why do you conclude it is an iOS bug ? Could well be an app problem. In any case, this is not a question for the developers forum. So, please go to the app developer to ask question and don't forget to close the thread. PS: Apparently you are very new to the forum. Welcome so. But please note that it is not a good practice on the forum to complain for not getting answer. Everyone here is helping on voluntary basis.
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’21
Reply to WWDC 2020 swift student challenge
Conditions for applying are given here: https://developer.apple.com/wwdc21/swift-student-challenge/ Applying Build your Swift playground, answer a few written prompts, provide documentation, and submit. To be eligible for the Challenge, you must: Be 13 years of age or older, or the equivalent minimum age in the relevant jurisdiction (for example, 16 years of age in the European Union); Be registered for free with Apple as an Apple developer or be a member of the Apple Developer Program; and Fulfill one of the following requirements: Be enrolled in an accredited academic institution or official homeschool equivalent; Be enrolled in a STEM organization’s educational curriculum; Be enrolled in an Apple Developer Academy; or Have graduated from high school or equivalent within the past 6 months and be awaiting acceptance or have received acceptance to an accredited academic institution. See last condition: Have graduated from high school or equivalent within the past 6 months and be awaiting acceptance or have received acceptance to an accredited academic institution. So, july 2020 graduation does not match. But may be you meet one of the other requirements ?
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’21
Reply to Rearrange collection view cells within it's section
Unless I miss something, you want to authorise change only within the same section. So, you should change line 6 as: if (sourceSection == destSection) { With your code, you could move from section 0 to section 1. In the else { }, you could just emit a beep, to let user know something wrong occurred. Or even better, create a counter of mismoves: var counter = 0 In else, increment counter and trigger alert only if count is 3 } else { count += 1 if count = 3 { // display alert count = 0 // Then reset count to 0 } else { // play a beep } } If that solves the problem, don't forget to close the thread by marking correct answer. Otherwise, please give details on errors: I am using following code but It is giving me errors...
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’21
Reply to UITableView duplicates bottom row on animated insert
Could you try to isolate the problem ? What happens when: you comment out lines 6 to 11 and another try: not using beginUpdates (comment out lines 13 and 15) BTW, doc recommends to preferably use  performBatchUpdates(:completion:) method instead (of beginUpdates-endUpdates): Use the performBatchUpdates(:completion:) method instead of this one whenever possible.  (void)insertRow { NSUInteger rowIndex = self.items.count == 0 ? 0 : 1; [self.items insertObject:[NSString stringWithFormat:@"New item %lu", self.items.count + 1] atIndex:rowIndex]; [UIView beginAnimations:@"twisterTableAnimationId" context:nil]; [UIView setAnimationDuration:1.0f]; [CATransaction begin]; [CATransaction setCompletionBlock:^{ NSLog(@"animation complete"); }]; [self.tableView beginUpdates]; [self.tableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:rowIndex inSection:0]] withRowAnimation:UITableViewRowAnimationNone]; [self.tableView endUpdates]; [CATransaction commit]; [UIView commitAnimations]; CGRect frame = self.tableView.frame; frame.size.height = [self.tableView sizeThatFits:CGSizeMake(frame.size.width, CGFLOAT_MAX)].height; self.preferredContentSize = frame.size; }
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’21