swift - iOS - ViewController access into a cocoa touch class -


i have been working on app, , have cocoa touch class file called tiles. inside class have applied sizeconstraints each of tiles. started off set these sizeconstraints constant, work on device. made sure worked on device, decided change constant zero, , set multiplier of uiview inside viewcontroller. inside viewcontroller have containerview, uiview going hold tiles. problem is, unable access containerview inside tiles class , therefore can not assign each tile of multiplier of containerview. positionconstraints inside viewcontroller, simple , has been done, exact size of actual tiles not working me. help!

welcome stack overflow.

your question worded strangely , it's bit hard figure out you're asking.

i think saying have parent view controller has 1 or more container views host other child view controllers, linked embed segues. child view controllers responsible "tiles" of parent view controller's window.

further, want child tile view controllers have access container view contained in. right?

if so, short answer "don't that." should treat view controller's views private.

what should build protocol parent view controller can use communicate tile view controllers. give each tile view controller property "tilehostvc" conforms protocol tilehostvcprotocol.

then in prepareforsegue method of parent view controller, check identifiers of embed segues, , see one, set tile's tilehostvc property.

now, in tile vcs, can send messages (defied in tilehostvcprotocol) host view controller ask questions or request services.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -