Activate "Focus follows selection" in Xcode 9 beta 5? - xcode9-beta5

I used Focus Follows Selection in Xcode 8 and loved it.
I cannot find it anymore in Xcode 9 beta 5... When I search Xcode 9 help gives me this result: (where it actually was inside of Xcode 8)
You can focus attention on the code you’re currently editing, easily identifying where it begins and ends, by highlighting the current scope in the source editor.

Click here to see Apple Help screenshot
Click anywhere in the source editor.
Choose Editor > Code Folding > Focus Follows Selection.
But the option seems to have moved or been removed.
It would greatly help me if anyone would know how to activate it inside of Xcode 9 beta 5?

They rewrote the editor. Try cmd + mouse over on the func / class / struct / var keywords. You should get a similar behaviour.

Related

How to dismiss the UIActivityViewController during a UI test with Xcode 11 & iOS 13

Apple has re-designed the share sheet that appears, which has now broken my UI tests.
I have attempted to record a new UI test through Xcode, but as soon as I tap on the dismiss button, the test terminates so I have not been able to capture the event.
Ultimately, I just want to know how I can access the gray 'X' shown with the arrow below:
I have just tested this with Xcode 13 and have found that the original answer no longer works. However, I am keeping it for posterity, or those using previous versions of Xcode.
Xcode 13
I have tested this with Xcode 13.0 and verified it works for iPhone and iPad:
let activityListView = app.otherElements.element(matching: .other,
identifier: "ActivityListView")
XCTAssertTrue(activityListView.waitForExistence(timeout: 2.0))
activityListView.buttons["Close"].tap()
Previous versions
After some trial and error, I was able to locate where my specific elements were with the following:
app.otherElements.element(boundBy: 1).buttons.element(boundBy: 0).tap()
Using app.otherElements.element(boundBy: 1) would identify the share sheet for me. I had attempted to locate it through accessibility identifiers, but I could not find one that worked, including previously valid ones used in iOS 12 and below.
Please note that based on the layout of your screen, the index value
may differ from what I am seeing.
Next, .buttons.element(boundBy: 0).tap() was used to locate the Close button. I again attempted to use identifiers, but could not find anything that represented the button.
When I attempted to discern additional information through the console while testing, I would always wind up crashing the test. This result was surprising, as I was able to query these elements with Xcode 10.
Ultimately, I would like to find working identifier values so that I can have something that works reliably across products, without the trial and error to find the share sheet's index value.
For iPad
The following will dismiss the popover for an iPad:
app.otherElements["PopoverDismissRegion"].tap()

What does the Swift-Icon in the Xcode 10 opening menu?

I see a new shiny Swift-Icon in the opening mode from Xcode 10 (See screenshots). Can someone clarify what function is behind that icon.
We suppose that only swift files would showed, but that is not the case. Tested with an mixed project.
Thanks in advance :)
Hamish's comment is correct. When the Swift icon is solid blue, it means Xcode will show you the compiler-generated Swift interface corresponding to the selected header file.

Xcode 9, Selected code snippet type removed when enter key is pressed

In XCode 8.3.3 and below when a code snippet was highlighted and you hit enter, XCode would replace the snippet type with the actual type.
Now when you hit enter it deletes the placeholder type. I've looked around in preferences and cannot find a setting to revert this.
Any help?
Shift + Enter should leave the highlighted text in place
Upgraded to Xcode 10 and it solved the issue

Seeing small dashes under Button's title in Xcode 8.1

I was creating a simple app in Xcode 8.1 with swift 3 and I got this problem (picture): dashes under buttons symbols.
How can I fix this issue?
Thanks.
So Nirmit dagly (https://stackoverflow.com/users/3401707/nirmit-dagly) has given the exact solution and it works perfectly.
He says: "You need to check button style on your iPhone device's setting. To check please go to General -> Accessibility -> Button Shapes. If it is enabled, then make it disable and run the app again. It'll hide the underlines from buttons."
I do thank him for his helpful answer and I has republish it here for the benefit of others.
Thank you again Nirmit and I prefer if we can get other independent solutions(not linked to the parameters of the phone user.).

Xcode 6.1 replace greyed out / not available

I'm trying to use find / replace in Xcode to replace some deprecated functions however it seems to be greyed out for some reason. I'm still finding my way round Xcode so it may be for something simple, but I can't find what it's unavailable?
Thanks
I'am using Xcode 6.1, find&replace working fine for me. You just type the replace text and press return key
When you open, it appears to be greyed out
Press return key after entering text

Resources