Is it a bug of NSTextView in macOS Sierra? - swift

Switching to the released macOS Sierra I've noticed a very strange behavior of the NSTextView object. And what really strange is that it reproduced even on a new empty project.
Just create a new project in Xcode, add Text View in Interface Builder and run the app. Just type any text so text view become having two lines. But do not hit Enter.
Now when you grab your mouse and select the beginning of the second line, the cursor will jump onto the end of the previous one! The interesting part is that when you move the cursor with keyboard everything works fine.
How to avoid that glitch? I'm sure that not just me is building an app on the macOS Sierra :)

Related

macOS 11: Changing a NSSplitViewItem's NSTitlebarSeparatorStyle does not update immediately

If you change the titlebarSeparatorStyle property of a NSSplitViewItem, the window does not update immediately. You have to set the focus to another app first for the window to update. However the window isn’t update correctly either. For example the shadow never really gets applied. It works if you set the property in the storyboard. But if you want to change it programatically, it does not work as expected.
I would expect something like the Finder in Big Sur: If you display the content of a Finder window as symbols, there is no shadow or line below the toolbar. If you switch to another view (like column view) a line is being added and the toolbar becomes transparent.
I have added an example project to demonstrate the issue.
GitHub: SplitViewItem-titlebarSeperator
macOS 11.0.1 Beta (20B5012d)
Xcode Version 12.2 beta 3 (12B5035g)
https://openradar.appspot.com/radar?id=4949260923568128

Get rid of file icon shadow when file is not saved in Xcode

When a file was just edited and not saved in the Xcode editor the icon of the file in the right pane is darkened a little, and because I have OCD this drives me absolutely crazy and I end up having to click Ctrl+S every time I do anything as simple as commenting a line of code or moving a button 1 pixel in storyboard.
I am using Xcode 10.1 Beta 2, but this happens in all versions of Xcode.
How do you make it so the file is never darkened?
I have the same problem in Xcode and I always command s everything as well. I have looked for a way to disable this, but for now I don’t think there is a way... Maybe they’ll add a way to turn this off in another update soon :)

Clicking different NSButtons in quick succession

I have an app where clicking on different buttons in a quick succession is necessary but Cocoa seems to disallow it.
I'm using the same subclass of NSButton on all the button instances and the mouseUp/mouseDown events call actions based on the button's instance tag (defined in IB).
The problem is that clicking different buttons quickly triggers the click on the first button but not the current button being clicked. How do I fix this?
Note: I'm using Swift 3 and targeting the latest macOS.
This turns out to have been a bug with a Wacom tablet driver on macOS Sierra. The driver from a previous OS version was outdated and was registering double clicks in an incorrect way. If anyone encounters this problem, be sure to check your system default for double-click speed.
This code snippet prints your double-click speed:
Swift.print(NSEvent.doubleClickInterval())

Why in Xcode 6 doesn't work Assistant Preview?

Sometimes in Xcode 6 Assistant Editor -> Preview stops working.
Showing just "No selection" even if no errors and Storyboard is ok.
Why does this happen?
The reason is "?" (questionmark) in Project's name (maybe there is a bug with other symbols – didn't check it).
You can try to rename Project or just create new one with name without "?" in it.
You must to Kill Xcode from processes for complete and then open it again. You can do it with Activity Monitor o CLI. Voila! - Preview is working again.
Don't just close Xcode keeping the app working. Sometimes also works closing with CMD + Q.
I had similar problem, but fixed it
You must open the xib or storyboard file in both assistant editors. Click the navigation button in the second editor (either the bottom or the right editor, depending on how you stack the assistant editors) and choose Preview to get the preview to appear.
thanks to
http://meandmark.com/blog/2014/09/xcode-6-no-simulate-document-in-interface-builder/comment-page-1/#comment-2883
I have played with Xcode 6 for a while and I encountered similar problems occasionally. I never used special characters in project or class names but the problem sometimes happens.
Now I have to test all ViewControllers at starting point to see if the Assistant Editor work. If not, I will just delete the class file and recreate the same one, it usually fix the problem.
Hope this can be fixed soon.

Weird iOS5 glitch when keyboard appears after selecting textfield

When selecting a textfield in iOS5 a weird arrow moves from the top left to bottom right of the screen when the keyboard appears. This only happens in iOS5 on the device and the simulator. When running with iOS4 it works as expected.
It only happens the first time the app runs, when i dismiss the keyboard and select the textfield again the arrow isnt visible. I have to restart the app to see it again.
Notes:
Ive posted a video to display what i'm getting http://youtu.be/4Ju2-wQ3hVY
I've tried stripping out other classes and creating a new blank nib with a textbox only but the problem still persists within my project. Creating a new project with xcode 4.3, the problem isnt visible. I've also tried with zombies enabled and didnt get any errors.
Are there new project / build settings that might conflict with the older versions?
This arrow looks like bug to me. I suggest you to file a bug report to Apple and post your issue to http://devforums.apple.com, where maybe issue will be notice by Apple employees and you may get more details on this.