Hey there! If you enjoyed this video, don't forget to hit the like button and subscribe to my channel for more amazing content. And make sure to click the bell icon so you never miss an update! Thanks for your support! 😊
Thanks for your tutorial , but i have 1 question , if 1 viewcontroller i have 2 uitableview and i want 2 uitableview have contentsize , how cant i do that ??
here is the solution .... don't forgot to like and subscribe .. override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?){ if(keyPath == "contentSize") && object is UITableView { if let newvalue = change?[.newKey] { if self.tableView == object as? UITableView { let newsize = newvalue as! CGSize self.tableHeight.constant = newsize.height } } } }
Hi! Great video, I have a question that I'm struggling with. Suppose I have the same case but I need three TableViews in the same viewController, all of them with dynamic height, how should I fix or implement that? Thanks!!
here is the solution for you override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?){ if(keyPath == "contentSize"){ if let tbl = object as? UITableView { if tbl == self.tbl_view { if let newvalue = change?[.newKey] { let newsize = newvalue as! CGSize self.tbl_view_height.constant = newsize.height } } } } }
Nice video but can you make video on dynamic collection view height with height constraint or any idea on how to achieve it with help of height constraint
remove the "class" after override function declaration. Do this " override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {}"
On this line: self.tbl_height.constant = newSize.height I get this error: Instance member 'tbl_height' cannot be used on type 'ViewController' What does this mean
Hey there! If you enjoyed this video, don't forget to hit the like button and subscribe to my channel for more amazing content. And make sure to click the bell icon so you never miss an update! Thanks for your support! 😊
Collectionview inside Scrollview th-cam.com/video/MGQPRuoTdVo/w-d-xo.html
Your video is still a solution. Thank you :)
MUITO BOM ME SALVOU, MUITO OBRIGADOOO!!!!! 👍👍👍👍
Hey there! If you enjoyed this video, don't forget to hit the like button and subscribe to my channel for more amazing content. And make sure to click the bell icon so you never miss an update! Thanks for your support! 😊
Loved your video. Thank you.
please don't forget to like and subscribe to our channel Thank you for watching ....🙂
Brilliant!!!! I've been struggling with this issue for a long time and finally, it works!
Thank you for watching video. please do like and subscribe to this channel
02:08 how yellow view turned to gray? I don't understand what you did in 02:08
there i remove uiview height constant which is under the scrollview please don't forget to subscribe !!!
@@DivyeshGondaliya why? do i need to remove it too if I didn't get red error constraints?
@@nurlanakylbekov7266 yes you have to remove it because we have to give scrollview dynamic hight
Thanks man, you saved my life
DON'T FORGET TO SUBSCRIBE and hit the notification bell for more updates! 💕
@@DivyeshGondaliya sure
Thank you very much, it's very useful
welcome 😊 please don't forget to subscribe
Thanks for your tutorial , but i have 1 question , if 1 viewcontroller i have 2 uitableview and i want 2 uitableview have contentsize , how cant i do that ??
here is the solution ....
don't forgot to like and subscribe ..
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?){
if(keyPath == "contentSize") && object is UITableView
{
if let newvalue = change?[.newKey]
{
if self.tableView == object as? UITableView
{
let newsize = newvalue as! CGSize
self.tableHeight.constant = newsize.height
}
}
}
}
@@DivyeshGondaliya Oh mann this saved my life. Thankssss
How to implement this to expandable table view with some section ? its Same ? and I have 3 tabs to with table view
thanks it helped me a lot
Glad to hear that! Don't forget to subscribe us ...
what if you want to apply let's say like animation when a specific cell appears ?????????????????????
you can apply animation in a cell like normal tableview cell size is automatically increase ir decrease according
This was very helpful. Thanks a lot.
Will it still work with each cell having an expandable view?
yes
Can I give me my project to solve the problem of not being able to scroll? Is the interface of the playback menu
yes sure send me in email
Amazing , Thankss !
Thanks For Solution @divyesh
Welcome do not forget to subscribe
Hi! Great video, I have a question that I'm struggling with. Suppose I have the same case but I need three TableViews in the same viewController, all of them with dynamic height, how should I fix or implement that? Thanks!!
here is the solution for you
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?){
if(keyPath == "contentSize"){
if let tbl = object as? UITableView
{
if tbl == self.tbl_view
{
if let newvalue = change?[.newKey] {
let newsize = newvalue as! CGSize
self.tbl_view_height.constant = newsize.height
}
}
}
}
}
@@DivyeshGondaliya Hi! Thanks for your tutorial, I also have problem with multiple tableview, Can you help me fix it. Here is my source code.
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.tblView.addObserver(self, forKeyPath: "contentSize", options: .new
, context: nil)
self.tblView2.addObserver(self, forKeyPath: "contentSize", options: .new
, context: nil)
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.tblView.removeObserver(self, forKeyPath: "contentSize")
self.tblView2.removeObserver(self, forKeyPath: "contentSize")
}
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
if keyPath == "contentSize" {
if let tbl = object as? UITableView {
if tbl == tblView {
if let newValue = change?[.newKey] {
let newSize = newValue as! CGSize
self.tblHeight.constant = newSize.width
}
} else {
if let newValue = change?[.newKey] {
let newSize = newValue as! CGSize
self.tblHeight2.constant = newSize.width
}
}
}
}
}
Nice video but can you make video on dynamic collection view height with height constraint or any idea on how to achieve it with help of height constraint
yes you can manage with height constraint for collection view height
Thank you!! Brilliant solution
please subscribe to channel for more video like this
#1 solution!
Thank you 😊 please don't forget to share and subscribe to our channel
Thanks so much for your help!
Welcome ☺️ don't forget to like and subscribe to this channel ☺️
Giving Error Instance member 'height' cannot be used on type 'ViewController' Inside Observer
remove the "class" after override function declaration. Do this " override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {}"
hai thanks for the video, but what if my scrollview not resize its content size?
check your constant its proper or not
could you make a video for this topic in collectionview (Collectionview in scrollview)
here you go th-cam.com/video/MGQPRuoTdVo/w-d-xo.html don't forget to subscribe us ....
need disable scrolling and:
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
let size = 10
tableViewHeight.constant = CGFloat(size) * UITableViewCell().frame.size.height
return size
}
Instance member 'tbl_height' cannot be used on type 'ViewController' Unable to solve issue plz suggest some thing went wrong
I had the same error. Check if you have selected: "override class func observeValue...." instead of "override func observeValue...". Remove the class.
The tableview height is not increasing? Please help me to solve the issue?
Please do all the step which i show in video
thankyou so much
Please don't forgot to subscribe us ....
scrolling not working in my case
Thanks.. I was looking for this exactly. Can you also provide the source code
sure please give me a email id i will send it to you
cool~
please use camleCase
Can you please send me the cide
share your email here i send you the code
@maninder If u received the source code please send it to me
@@agung_laksana check your mail don't forget to subscribe us
Github project?
share your email i will send you project
My green view is not scrollable, does anyone have the same issue?
Update, it works on iPhone SE simulator but not iPhone 14
Tanto lío para hacer solo eso?? 😂
I have a problem
The tableview height is not increasing
@@patelmaheshumeshbhai4230 please chek your tableview constant
@@DivyeshGondaliya Thanks a lot 😎😎
@@patelmaheshumeshbhai4230 welcome please don't forget to subscribe us
it doesn't work
On this line: self.tbl_height.constant = newSize.height
I get this error: Instance member 'tbl_height' cannot be used on type 'ViewController'
What does this mean
i got the same error , Can anybody help?
any help on this error please?
I had the same error. Check if you have selected: "override class func observeValue...." instead of "override func observeValue...". Remove the class.
thank you so much
Hey there! If you enjoyed this video, don't forget to hit the like button and subscribe to my channel for more amazing content. And make sure to click the bell icon so you never miss an update! Thanks for your support! 😊