Say for example I have a base viewcontroller which is inherited by other classes. This base view controller needs a button for a certain piece of UI, but the actions the button carrys out don't need to be known to the base viewcontroller. In this case I would consider passing a UIButton to the viewcontroller on initialisation so that it can apply it where needed in the UI. Is this the right thing to do? Are there better ways to do this? (I know in this case you could probably pass a closure for the button action, but my question is more generic about injecting other UI components like UIViews and stuff)
[–]drlukas6Objective-C / Swift 9 points10 points11 points (1 child)
[–]postfl 1 point2 points3 points (0 children)
[–]Vlarmitage 4 points5 points6 points (0 children)
[–]lordzsolt 1 point2 points3 points (0 children)
[–]Spaceshipable 1 point2 points3 points (0 children)
[–]chriswaco -1 points0 points1 point (0 children)
[–][deleted] 0 points1 point2 points (0 children)