Storyboard - connect distant scenes - ios

I've got a bunch of controllers on my storyboard but I'm struggling to connect two scenes that are far apart graphically.
You can't seem to do it when zoomed out and when you're zoomed in you can't see both scenes on the storyboard.
Suggestions?
==== UPDATE ====
Holding the arrow at the edge of the screen did it but wasn't easy finding that magic boundary initially.
Ticked as correct answer although not quite sure what was meant by the = sign shortcut.
The doc outline is handy. For those wanting to use it - there's a little arrow button bottom left of the storyboard. Or use Editor > Show Document Outline (or Reveal in Document Outline).

If you hit = sign and then ctrl drag from one controller to other it should work. You hold the end of the arrow at edge of screen and it should scroll the screen for you. Oh also you can use the document outline(the area next to navigator that has the arrow pointing left that opens and closes it) and ctrl drag from one controller to the other.

Related

How do I make the elements in my UIView responsive?

My goal is to create an alert that has three text fields, one taller than the others, and an image that, when tapped, allows the user to choose a picture to replace a set default one.
After unsuccessfully searching for a library for this, I decided to create my own alert by placing a UIView off the screen and, when prompted by a button, would zoom onto the screen; it consists of all the elements I require.
When I run the application, the view pops up correctly, but none of the elements on the view are responding to touch. I've checked that isUserInteractionEnabled for everything is turned on.
What's also odd is that when I keep the view on the screen (instead of placing it some distance away on Storyboard), all the elements work fine.
I'm assuming it had something to do with the animation. I tested it with a fade in instead of a displacement, and the result was the same - the elements were unresponsive.
In order for your elements to be responsive you have to link the action of you clicking them to your view's code. You can do this in a non-programmatic manner by ctrl-clicking your element on story-views and then dragging to the view controller. Then choose action instead of outlet, and choose when the action you want will be triggered (bottom part). Then insert your code in the viewController.
So I figured it out. I used the debug view hierarchy and saw that the alert was behind the elements behind it, even though it was still being shown (for some reason). I changed the zIndex of the UIView and it worked!

Wiring up Outlet Collection Trouble

From what I can tell there are some challenges people are having in XCode6 in terms of wiring up outlet collections. I just wanted to see if i'm doing this right or what I need to do correctly! I reviewed here Can't hook up an outlet collection in Xcode 6 using storyboard as well as other areas, but I wanted to be more basic about this first.
I have 7 images on a screen. I'd like to iterate through all of them in a loop or something. I read an outlet collection would be a sensible way to do this. To create an outlet collection, I am doing this:
While splitting the screen (storyboard on left, assistant editor on right) I control+click on one of my 7 images, and drag it into the view controller code on the right. This will prompt me to create an outlet, or outlet collection (I select outlet collection).
Now that this is done, a circle appears in the left margin next to this variable indicating that the image is associated with that variable. If I hover over the circle, the first image lights up.
What you're supposed to do (can someone confirm this please??) is you just hover your mouse over the circle, and a + symbol appears, and all you do is hold down the left mouse button, and drag over to another image (for example image#2), and it should automatically add that to the collection. The idea is to simply drag to each image so they are all added.
Is that right in step #3 above? Is this the normal way you would add items to a collection? Drag from the + to the image within your controller? For me, when I do this, the line appears, but it doesn't seem to respond to connecting the line to anything. I just hover it over the images, and it doesn't highlight the image or select it or anything, and when I let go, nothing happens.
I'm still somewhat new to this - what am I doing wrong?
Thanks so much for your patience/help!
OK I had the same issue and I think I have just found a workaround
1) Do steps one and 2 with the first image
2) Now repeat exactly what you did using the second image - drag and drop just below the first outlet collection (this would simply create a second outlet collection use exactly the same name )
3) Now Xcode won't like it as you have two outletCollections with the same name. Now comment out the first one
4) Now you only have one outlet collection. And it would be wired up to both your images. confirm it by hovering your mouse pointer over the little 'circle' next to the IBOutlet to see your images being highlighted.
This seems to work for me. So hope this helps :-)
There is an error with Xcode and Interface Builder that causes problems with outlet collections. You are doing it right, Xcode is problematic.
A workaround is to:
Go to your DerivedData folder (Xcode preferences -> locations)
Clean build folder from the Product menu while holding option (alt) button
Quit Xcode
Delete the folder starting with your app's name in the derived data folder
Go to your xcodeproj file, right click it, show package contents.
Delete the xcuserdata folder (warning: don't touch the others!)
Open Xcode again.
When you delete user data, window positions etc. will be reset to defaults and breakpoints will be deleted. Your project should work smoother (after a few seconds of re-indexing) and outlet collections should work properly.
I have had some success by just changing my workflow as follows (no need to restart Xcode).
First, create the outlets in code in the controller class file.
Second, drag from the objects (in the outline view of IB) to the controller, or back (for actions).
This has always worked without fail. It is slightly more effort, but actually negligible. Definitely an Xcode bug.

Preventing Sliding When Top View is Off Screen

So I've been playing around with the examples included with ECSlidingView.
In the BasicMenu Example: I've placed 20 rows in the Settings table view. When I open the menu, the table view in settings continues to slide if I touch it.
In the TransitionFun Example, the table views are not slide-able when they're not full screen.
I've looked through the code and don't see what's causing this difference. Can someone point it out to me? I have an app that pretty much started as BasicMenu and I sometimes have trouble using the pan gesture to close the menu, because I end up accidentally sliding the mostly off screen table view instead.
Thanks!
Look at setting:
slidingController.topViewAnchoredGesture = ECSlidingViewControllerAnchoredGesturePanning | ECSlidingViewControllerAnchoredGestureTapping;
such that, when the top view is anchored, tapping and panning it will both result in sliding. This eliminates the ability to otherwise interact with the top view controller contents.

UIView/ViewController name [picture]

What is the name of the UIView/UIViewController in the left upper corner of the attached picture?
And more general question: where could an iOS developer find full and illustrated list of all available UIViews and ViewControllers?
Sorry, don't have enough reputation to attach the picture, please follow the link: image with iphone interface mockup.
That isn't a controller, it's a UIActionSheet. Also, the XCode documentation is pretty useful for browsing through iOS classes. To get to it, press the button in the top right-hand corner of XCode, labeled "Organizer".
More on UIActionSheet, you declare one by calling:
initWithTitle:delegate:cancelButtonTitle:destructiveButtonTitle:otherButtonTitles:
Make sure to set your controller as the delegate and to implement:
actionSheet:clickedButtonAtIndex:
to specify what should happen when a button is clicked.
To show the Action Sheet initially, it has a bunch of showFrom... methods to specify where it will appear on the screen (for iPad, at least).

How to create a Flap-up Info page on iOS

I remember seeing multiple apps that will have a little i on the bottom of the screen, and the corner will flap up a bit to show a few things, such as a masthead. The Maps app (before iOS6) has what I'm talking about in the bottom right corner. It shows allows you to print maps and drop the pin, etc.
I want to do exactly that. I want that corner to flap up, and show that I created it, and anything else. Is there any way I can create this? It can be text-based, image-based, anything. I tried something, but it didn't work:
I created the i (made a 'Round Rect Button' and turned it into an 'Info Light button), and tried making a new window in the .xib, and linking them together, but it didn't seem to work.
TL;DR: How do I create the info page that flaps up from the bottom right/left corner?
BTW: I'm using XIB, not storyboard.
That is fairly easy. You have to present your viewcontroller modally and set the transition mode:
controller.modalTransitionStyle = UIModalTransitionStylePartialCurl;
You can try to start a new project....select Utility Application....it will make a flip between the two viewcontrollers....just change the transistionStyle to what I wrote above then it should curl up like in the maps app

Resources