tableview

UIView and TableView resizable

依然范特西╮ 提交于 2020-07-23 06:35:23
问题 image 1 image 2 As you see, i have storyboard like in pic 1, but in simulator it looks like in pic 2. How can i make it, thats this tableView inside View will be fullsized if contains some data. If not - it will be hidden. At this moment, if its contains some data, UIview doesnt change the height and uitableview is almost not visible. This lines didnt help: tableView.estimatedRowHeight = 44.0 tableView.rowHeight = UITableView.automaticDimension ------------------part 2--------here is code of

UIView and TableView resizable

爷,独闯天下 提交于 2020-07-23 06:34:05
问题 image 1 image 2 As you see, i have storyboard like in pic 1, but in simulator it looks like in pic 2. How can i make it, thats this tableView inside View will be fullsized if contains some data. If not - it will be hidden. At this moment, if its contains some data, UIview doesnt change the height and uitableview is almost not visible. This lines didnt help: tableView.estimatedRowHeight = 44.0 tableView.rowHeight = UITableView.automaticDimension ------------------part 2--------here is code of

How to store dictionary values into an array from array of dictionaries in swift [closed]

孤人 提交于 2020-07-22 21:43:27
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . Improve this question i'm new to iOS development i'm trying to display data in tableview in swift the data is coming from webservice for that i used NSURLSessionDataTask. The data was coming as shown below: { categorys: [ { category_id: "all", category_name: "ALL", category_desc: "All Categories" }

How to store dictionary values into an array from array of dictionaries in swift [closed]

自古美人都是妖i 提交于 2020-07-22 21:41:01
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . Improve this question i'm new to iOS development i'm trying to display data in tableview in swift the data is coming from webservice for that i used NSURLSessionDataTask. The data was coming as shown below: { categorys: [ { category_id: "all", category_name: "ALL", category_desc: "All Categories" }

Hide SearchController again after scrolling down

こ雲淡風輕ζ 提交于 2020-07-22 05:50:07
问题 I got SearchController to show up with my TableView, this is what is looks like on launch vs when I scroll up: This is perfect since I want it hidden when not in use. However, after showing it, I can't hide it again by scrolling down. How do I get that functionality? import UIKit class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate, UISearchControllerDelegate, UISearchResultsUpdating { @IBOutlet weak var tableView: UITableView! func updateSearchResults(for

Dealing with dynamic cells in a UITableView?

倖福魔咒の 提交于 2020-07-10 10:26:47
问题 New Error Message Error Message . Now, I'm getting this error message. Updated Code with error message shown in this image link error message : func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = runReportTableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) cell.textLabel?.text = valuesArray[indexPath.row] cell.SetCheckMark(cell.checkMark) //Call 'SetCheckMark' function here cell.tapButton = { if cell.checkMark

How To Save Re-Ordered Tableview Cells To Core Data

送分小仙女□ 提交于 2020-07-10 03:51:39
问题 So I have my tableview when I re-order my rows it updates the tableview and everything but it isn't saving to core data . func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) { let appDelegate = UIApplication.shared.delegate as! AppDelegate let context = appDelegate.persistentContainer.viewContext let movedCampSites = itemName[sourceIndexPath.item] itemName.remove(at: sourceIndexPath.item) itemName.insert(movedCampSites, at:

Show JSON as TableView Section and TableView row in Swift 4.2 without Decodable?

天涯浪子 提交于 2020-06-23 14:16:06
问题 I have below JSON response array with key "events" { "events": [ { "name": "event foo", "date": "2020-05-22", "time": "7:00", "am_or_pm": "PM", "day": "Saturday", "description": "test " }, { "name": "event bar", "date": "2020-05-22", "time": "7:00", "am_or_pm": "PM", "day": "Saturday", "description": "test2" }, { "name": "event foobar", "date": "2020-05-24", "time": "11:00", "am_or_pm": "PM", "day": "Saturday", "description": "test3" }, { "name": "event foobar", "date": "2020-05-24", "time":

Populating firebase information into tableView

大城市里の小女人 提交于 2020-06-17 04:22:08
问题 Hi I am wanting to populate some data from my firebase to my tableView but do not really understand how to go about doing it. Below is a snippet from my code detailing where the data is coming from and the current tableView arrangement I have: Edited Attempt func fetchPosts(completion:@escaping (_ theposts:[Posts])->()){ oldPostQuery.queryLimited(toLast: 20).observeSingleEvent(of: .value, with: { snapshot in var tempPosts = [Posts]() let lastPost = self.theposts.last for child in snapshot

Populating firebase information into tableView

浪子不回头ぞ 提交于 2020-06-17 04:21:25
问题 Hi I am wanting to populate some data from my firebase to my tableView but do not really understand how to go about doing it. Below is a snippet from my code detailing where the data is coming from and the current tableView arrangement I have: Edited Attempt func fetchPosts(completion:@escaping (_ theposts:[Posts])->()){ oldPostQuery.queryLimited(toLast: 20).observeSingleEvent(of: .value, with: { snapshot in var tempPosts = [Posts]() let lastPost = self.theposts.last for child in snapshot