So, the app I'm making has a home screen where we can add widgets, and the widgets are displayed in a table view using some custom cells that are "foldable". And we're loading all the cells programmatically with views created in a different story board. So that way everything is modular.
I'm having an issue with getting the view to display correctly with auto layout. The weather should be centered, but it isn't. I've checked in the preview of the weather widget in the IB and it is centered, but it isn't being centered in the table cell.
Here is code, this is in cell for row at index path. Since it is a special cell I'm using from an external library, there is a small view to the cell and a big view. Currently, I'm focusing on the big view first. Also note: Inside of the table view cells I have added a view underneath the bar. That's what bigView and smallView are. A
let storyboard = UIStoryboard.init(name: "\(self.widgets[indexPath.row])Widget", bundle: nil)
let controller = storyboard.instantiateViewControllerWithIdentifier("\(self.widgets[indexPath.row])Widget")
let smallController = storyboard.instantiateViewControllerWithIdentifier("\(self.widgets[indexPath.row])WidgetSmall")
self.addChildViewController(controller)
self.addChildViewController(smallController)
cell.bigView.addSubview(controller.view)
cell.smallView.addSubview(smallController.view)
controller.didMoveToParentViewController(self)
smallController.didMoveToParentViewController(self)
return cell
View to be loaded at home screen
Home screen where view is loaded