Reputation: 1492
Original Question:
This is my first post ever. I'm trying to learn ios programming by following cs193p (online). I got stuck on assignment 3 with a very (seemingly) simple thing. I did a few google searches on it already.
I don't know how to copy my view from assignment 2 (which is a storyboard) to my new xcode project.
I created a new master detail application (called it Calculator3), copied the storyboard from assignment 2 (Calculator2) in there as well. However, it's not possible for me to get the contents of that storyboard and put them in the new generated storyboard.
So is it possible to copy the contents of one storyboard into another? If not, then how do I do this?
Upvotes: 9
Views: 8505
Reputation: 1929
You can copy a storyboard to another project by drag and dropping the story board. Make sure to tick the box "Copy items into destination groups folder".
Of course all of your references will break and have to be rebuild, but the layout and segues will all be there.
Upvotes: 0
Reputation: 1735
Bringing the old storyboard from source project into your new target project as a temp storyboard works. :)
(I've found it in en.lproj folder from source project) Also you can copy & paste all view controller component by selecting gray bar under your view.
Then remove temp storyboard and continue with pasted one.
Upvotes: 2
Reputation: 1492
Thanks to LU RD I post my answer here, instead of using an edit in my first post.
Answer:
A friend of mine solved it. The reason why I got this wrong the whole time was because I did cmd/apple A + cmd/apple C. Instead of clicking at the top of the view I wanted to copy and then do cmd/apple C. After that, paste it with cmd/apple V in the storyboard you want to.
I noticed it only really works in the following situation (I thought it worked in more situations).
Upvotes: 22