Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create new IBOutlets in ProfileContentHeaderView.swift #2

Open
wangela opened this issue Oct 9, 2017 · 4 comments
Open

Cannot create new IBOutlets in ProfileContentHeaderView.swift #2

wangela opened this issue Oct 9, 2017 · 4 comments

Comments

@wangela
Copy link
Owner

wangela commented Oct 9, 2017

Even though the superview of the "tweet counts" text label is properly assigned the custom class of ProfileContentHeaderView.swift and that file shows up as an option for Automatic assistant editing, I can't seem to ctrl-drag any new outlets into the class file.

@wangela
Copy link
Owner Author

wangela commented Oct 10, 2017

Did a "bad" workaround by coding the assignment of this label in TimelineViewController instead of ProfileContentHeaderView.swift. Any help debugging why I can't add new UIlabel outlets to ProfileContentHeaderView.swift is appreciated.

@timothy1ee
Copy link

I see the same behavior when I open your project. How did you create the initial outlets? You can also manually type the outlet. Once you add that line, if you hover over the empty circle on the divider next to the outlet, you can drag it back to the appropriate item in the Storyboard.

screen shot 2017-10-15 at 9 25 42 pm

@wangela
Copy link
Owner Author

wangela commented Oct 16, 2017

@timothy1ee Thanks for taking a look. IIRC, I originally created this content view in its own viewcontroller outside of a tableview. Then I realized the profile page was just the same as my home timeline but with an optional profile header at the top. I may have then placed it in a stack view where the profile header was the top of the stack and the timeline table view was the second thing in the stack. Then I learned about headerviews in tableviews. So I converted it to a custom view and put that custom view into a headerview in my home timeline. The way I either converted it into a custom view or placed the view into the headerview is probably what broke it. I did this before Jane gave the lecture on custom views, so in moving between view controllers I probably did some cutting and pasting of of the labels and elements in the tree outline pane of the storyboard in an effort to preserve the autolayout constraints so I wouldn't have to re-do them every time I tried a different place to put this collection of elements.

@timothy1ee
Copy link

I see, I think it might be a Storyboard bug, but I'm not sure. The way I would normally do this is via a xib.

There's also a feature in Storyboard where if you include a custom view that has its own xib, it'll preview the xib in the Storyboard, which gets you the same thing you have now, but it lets you keep the header design file separate, which can be nice. Just a warning, that preview feature is still slightly new-ish, so it's a little finicky, I haven't tried it in Xcode 9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants