How to get red distance lines in storyboard Xcode? - ios

Watching a tutorial and it looks like the guy is holding down a button to show the distance between his selected view and what's around it.
I've tried command, option, control, and every other button I can think might work. What button needs to be held to get these lines?

By pressing option key only on your keyboard.
Select an element, and move the mouse while pressing the option key, it will show the red lines with the distances.
Hovering over another element will show you the distance between the selected element and that element.

Related

How to delete item from Swift UI List in UI Test

Is it possible to delete a Swift UI List item from a UI test?
For the user they can press the edit button which puts the list into edit mode (screenshot 1), then press the red circle with the white line, then press Delete.
Alternatively the user can swipe delete the list item.
Even with the accessibility inspector on I can't see what the icon is (the red circle with the white line). It doesn't show anything when I hover over it. Also the recorder doesn't record anything if I try using that tool.
If I try with .swipeLeft() to try to delete using the swipe gesture instead, it actually "taps" on the list button instead of swiping and just opens the detail view.
Any ideas? What am I missing here? Or is this not actually possible?
Ok I found a way to make it work with the swipe method. It's pretty simple. Just need to let the test know to swipe a bit slower.
app.staticTexts["Test"].swipeLeft(velocity: XCUIGestureVelocity.slow)
Using that I'm able to then tap on the delete button and assert that the item is gone.
I'm not super fussed right now about the other method, as long as there's a way to test deleting (and as long as I'm allowing swipe delete). However would be good to know if someone has the answer.

Buttons in UITextView

I want to create a View very similar To the iOS notes application. The main function is to allow the user to get a check box in front of a line of Text.
My first attempt is this:
I have a UITextView where i try to insert buttons on the left side of the View, the Problem is i dont get the right y Position for each line and the whole text is offsetted even if there is no Button in Front of the line.
Question:
Is there a better approach, maybe much simpler or even built in functionality in UITextView i couldnā€˜t find?
If not, how do i get the exact y position of the line the cursor is currently in, so i can set the Buttons in the correct positions?

In Delphi, how can I make a button appear on top of a TCheckListBox?

We want a list box with check boxes and formatted text. We get that using a TCheckListBox in owner-draw mode.
But we would like to also have a button appear at the right end of the selected row. Just adding a button (TSpeedButton) with the CheckListBox as the Parent doesn't get drawn correctly.
Does anyone know how to do this?

iOS - What do we call the type of menu which pops up, as seen when highlighting text

When you highlight text in iOS, a menu is shown giving options such as cut and copy, it floats above the text and is black. What is this called and how can i implement it in a tableview (to give options when a row is selected)
You mean this, this is a UIMenuController
https://developer.apple.com/library/ios/documentation/iPhone/Reference/UIMenuController_Class/
another bit of info:
http://nshipster.com/uimenucontroller/
How to use it:
https://www.captechconsulting.com/blogs/getting-started-with-uimenucontroller-in-ios-5
An actual example already coded up for you:
https://github.com/jszumski/uimenucontroller-example
It is called UIMenuController.
This menu is referred to as the editing menu. When you make this menu visible, UIMenuController positions it relative to a target rectangle on the screen; this rectangle usually defines a selection. The menu appears above the target rectangle or, if there is not enough space for it, below it.
You can also provide your own menu items via the menuItems property. When you modify the menu items, you can use the update method to force the menu to update its display.

How to select background views in a storyboard or xib

If I select a view with my mouse in a storyboard or xib, Xcode will select the front most view. I know that I can select the other views in the document outline, but if I want to grab a background view to move it with my mouse, the front most view gets selected again when I click in the storyboard.
I think there is a way to cycle through the views and select the ones in the back by holding down on some keys, but I can't find what it is. Does anyone know?
I'm using Xcode 4.6. I know that I can also move background views using the size inspector, but I'm looking for a way to position them with my mouse.
One way is to use the jump bar at the top of the editor. It's the control that shows the path of objects leading to the current selection.
Another way is to press control+shift and left click (or shift right click) an item. That shows you all of the objects under the mouse in a menu, and allows you to disambiguate the one you meant to select.
The good news: Place your mouse on the overlapped images, press and hold shift and right click the mouse. You should see the list of objects, select your object in the back. You can resize as you wish.
The bad news: you can only use the cursor arrows if you want to move it!
Select the view from the menu on the left of interface builder.

Resources