Post

Replies

Boosts

Views

Activity

Reply to Users are not able to login after updating ios version to 14+
What exact error do you get ? Crash ? Should check this: Do you have any non-ASCII characters in your App name? There's this new issue appearing in iOS 14 app, where asking permissions on iOS 14 app which has any non-ASCII characters crashes the app. See: https://stackoverflow.com/questions/63938854/react-native-ios-14-only-attempt-to-insert-nil-object-from-objects0-29970 You should also ask directly to React Native.
Topic: App & System Services SubTopic: Core OS Tags:
Mar ’21
Reply to How to detect when a user clears all notifications from Notification Center
Apparently, there is no way to receive a notification when you clear all notifications (as explained in previous link). So, maybe a work around would either to: cyclically in your app to refresh its badge by checking how many notifications remain pending. Find info here: https://stackoverflow.com/questions/49309223/run-a-periodic-task-in-background-independent-from-viewcontrollers set a timer in each VC example here: https ://www.hackingwithswift. com/example-code/system/how-to-make-an-action-repeat-using-timer Frequency of one every 10 seconds would probably be enough (in termes of User experience), which would not drain too much resources.
Topic: App & System Services SubTopic: Core OS Tags:
Mar ’21
Reply to Splitting text into cards
Splitting text into cards Usually, it is better UI to have text in a scrollView than in different cards. the title must appear once on the first card That will be harder for user. You'd better keep a title, adding "Cont'd" at the end. Now if you still want to do this. you can have several cards (VCs) or only one in which you will change the content of textView and title. What you have is to evaluate the size needed for some text. Use func boundingRect(with size: CGSize, options: NSStringDrawingOptions = [], context: NSStringDrawingContext?) - CGRect See here how to use: https://stackoverflow.com/questions/19128797/calculating-uilabel-text-size You will have to iterate on the original text: startPoint = first char endPoint : last char of next word compute the rect it it fits, test with next word for end point if does not fit, keep the previous endPoint: that is where you have to split For next card, start at previous endPoint and repeat the algorithm above.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to How popular is Dark Mode?
@nathanmark  My dark mode is not working. Does anyone know any solution? Solution to what precise problem ? If you want some useful answer, you should explain: what is "not working" ? what did you do to implement it ? Did you set all colors to be system colors ? which versions of iOS, Xcode ? Does it occur on simulator and / or device
Topic: UI Frameworks SubTopic: UIKit Tags:
Mar ’21
Reply to TableView relsoaddata from textField on the same viewController with TableView
I would thus investigate the sequence of events (by just adding some prints to start with. Possibly, when loadData() is called, data are not yet loaded… override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(true) print(#function, "going to loadData") // ==== loadData() } func loadData() { r_feedback(rtaskId: idTask.text ?? "") print(#function, "going to buttonChange") // ==== buttonChange() } func r_feedback(rtaskId: String) { var singleFeed = myFeedback() self.arrayOfFeedback.removeAll() queryFeedback(taskId: rtaskId).findObjectsInBackground { (objects, error) in if let objects = objects { if (objects.count 0) { print(#function, "queryFeedback") // ==== for eachFeed in objects { singleFeed.feedDate = eachFeed.createdAt! singleFeed.userNameFrom = eachFeed["UserNameFrom"] as? String singleFeed.feedMessage = eachFeed["TaskFeedback"] as? String singleFeed.atype = eachFeed["AType"] as? Int self.arrayOfFeedback.append(singleFeed) } } else { singleFeed.feedDate = nil singleFeed.userNameFrom = "" singleFeed.feedMessage = "" singleFeed.atype = nil } DispatchQueue.main.async { print(#function, "going to reloadData") // ==== self.fTableView.reloadData() } } } } func buttonChange() { let stat = taskStatus?.text let rqType = Int(reqTypeIndex.text ?? "") ?? 0 switch(rqType) { case 0: if (stat == status[1]) || (stat == status[3]) { statusChange(imageLabel: task_image[2]) } else { statusChange(imageLabel: "") } case 1: if (stat == status[2]) { statusChange(imageLabel: task_image[3]) } else { statusChange(imageLabel: "") } default: statusChange(imageLabel: "") } print(#function, "button has changed") // ==== } Please show the complete log.
Topic: App & System Services SubTopic: Core OS Tags:
Mar ’21
Reply to UIcollectionView with array no loading sections
So, next test I would do is the didSet, to check: if it is properly called if the content of model is correct Could you add 2 print statements: func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) - UICollectionViewCell { if collectionView == UI.castCollectionView{ let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "identifierSeasons", for: indexPath) as! SeasonCell cell.backgroundColor = .clear let arreglo = arraySeasonsEpisodes[indexPath.item] cell.model = arreglo print(indexPath.item, arreglo.episode_number) return cell } and class SeasonCell: UICollectionViewCell { var model: episodess? { didSet { guard let viewModel = model else { return } let episodio = viewModel.episode_number let nombre = viewModel.name let guardado = viewModel.still_path episodeNumber.text = "Episode Number: \(episodio ?? 0)" episodeName.text = "Episode Name: \(nombre ?? "")" let image = "https :// image.tmdb.org/t/p/w500\(guardado ?? "")" if image == "" || image == "undefined" { seasonImage.image = UIImage(named: "") seasonImage.contentMode = .scaleAspectFill } else { seasonImage.downloaded(from: image) seasonImage.contentMode = .scaleAspectFill } print("model", model.episode_number) // } } Note: struct names should start with Uppercase. What is Initiable ?
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to How fix tableView scroll problem when keyboard is open?
OK, so you need to reload the table. But this code cell.priceText.delegate = self cell.priceText.addTarget(self, action: #selector(textChanged(_:)), for: .editingChanged) cell.priceText.addTarget(self, action: #selector(onTextFieldTap), for: .touchDown) should be in cellForRow. Could you also try: to comment out reloadData() to see if the problem disappear. And also try to add a reselect after reloadData() tableView.reloadData() tableView.electRow(at: index, animated: true, scrollPosition: UITableViewScrollPosition.none) // May test other UITableViewScrollPosition
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to Legacy Segmented Control style?
If that's not enough, you could define your complete custom segmentedControl. But note that unless you have a compelling reason to do so, it's not a great idea to go against standard control design. Very rapidly, your app will look outdated and surprise the users.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to Limiting the number of questions for an indexpath
about 100 questions in an index path What do you mean, in a tabView ? want the game to end at say 30 questions, So, just create a property in the class var questionsAsked = 0 Each time you ask a question, increment it by 1 questionsAsked += 1 And before asking a new question, test if questionsAsked = 30 { // alert user that game is over } If that answers your question, don't forget to close the thread by marking the correct answer, otherwise, please explain more your problem.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21