I added a Safari tab-like system to my Cocoa application and since, I got some serious graphical glitches. I implemented the tab system in Auto Layout, simply with buttons on a horizontal stack view with another tabless tab view, nothing special.
I started with something looking like this:
to issues like blank labels and the search field color and font are weird.
There are no errors in the console, just graphical glitches. The constraints looks okay, the keyboard and mouse events are working well as well, nothing seems to be broken other than the render.
The "Debug View Hierarchy" does not seems to have the same issue than in Runtime:
I looked around for similar graphical glitches, but could not found anything.
My app is in Swift 4.0, I am using the last stable XCode and OS X version.
I don't know where to look. I am looking for some tips to help me debug this! Thanks!
I found the problem, it was because I had a Visual Effect View with the "Vibrant Dark" effect, then the tab view were created from a custom view controller which was inheriting the Aqua apparence by default. The mix of the two apparences seems to be the cause of the graphical issues and it explained why default apparence inheritance was not an issue until I implemented my tab system which broke the main view into a separated view controller. Such a weird Cocoa display issue...
Related
I'm running into an issue in a mac osx app. I'm displaying a popover using an NSBox and I'm noticing tooltips from elements underneath are showing through
I've created a quick demo project to show the issue: https://github.com/GP89/tooltipper
I've tried everything I can think of
setting nextResponder on the box to nil
overriding all the mouse event handlers I can find in a subclass of NSBox (eg. mouseMoved)
setting acceptsTouchEvents to false
Plus a bunch of searching online
I did find some similar issues like this one where they silence mouse events, but I can't seem to find a way of doing it for tooltips
I have updated xcode to the last version (V8.0). In the previous stable version, the live preview sections shows the app exactly how it would be in the device. However, in the new version, the live preview sections shows the app exactly how it appears into interface builder.
how can I have the live preview as it was before?
Any idea will be appreciated.
Thanks in advance.
The Interface Builder of Xcode 8 has been thoroughly reengineered. It is not possible to set it back to the Interface Builder of Xcode 7.
You have two options.
Either you download Xcode 7.3.1 from the Apple developer center. But you'll lose the ability to use Swift 3. This option is absolutely not recommended since you'll also lose future updates and future new features.
Or you make yourself familiar with the new Interface Builder. That option is recommended. The Apple promotion tells you exactly why:
See a live preview of exactly how your app will appear on any Apple
device with full vibrancy. As you quickly switch between different
devices to customize your UI for size classes, you will always see the
same interface as your customers. Pan and zoom are incredibly fast,
and you can even edit your interfaces when fully zoomed out for a
bird's eye view of your storyboard.
A Beginner’s Guide to Auto Layout with Xcode 8
Also I can advise you to look at this thread. I had issues with the new Interface Builder as well. The key answer: Split big Storyboard into many small ones. And update the Constraints from Xcode 7 projects as suggested in the answer:
1) Remove only one of the "Height equals: xx" constraint from one of your views inside the cell.
2) Update all frames.
3) Select the view you removed constraint from.
4) Click to add new constraint button. Now it should be showing a new height, probably with a decimal value.
5) Add height constraint without changing the value inside the box.
But splitting my Storyboard into many smaller ones did the trick. Take a Storyboard for every scene of your App. Like Login. Tweets. Pictures. Settings.
In Xcode 8, preview is by default attached at bottom side of view editor,
Here is the screenshot of the bottom view, which gives you the preview,
Select Any of the size shown to preview it in respective size.
i have a problem. I had a storyboard in Xcode 6 with the inferred size of the view controller and the "Use Auto layout" option checked. Today i wanted to use the new " Use Size Classes" option. I checked the option and then in the simulator the screen was all black!
EDIT
now that i resolved this issue i have another thing here ! I use "Add missing costraints" option to have a resize for all Apple Device, the Tab bar and navigation bar are good, but then all the buttons ( they have an image ) are in different position !
How i can resolve that ? Thanks in advance.
A black view.. if not always, is a good indicative that the view is not loaded. Size Classes introduces a new concept ...You can have several views that will be installed or not into your view depending of your view configuration. More details on images below:
This is what you will be looking for:
This is what I call view rendering configuration (sure Apple has another name for it). It is located at center bottom of your storyboard view.
This is always located at the end of Attributes Inspector tab:
Make sure it is enabled for the view that suits your testing device.
I found out that the ViewController wasn't set as Initial Controller.
You should avoid as possible the use of "add missing constrains". Is an automatic tool that almost always ends up adding unnecessary constrains or breaking others.
If you want something to look really good an stable, sadly there are no shortcuts... you will eventually end having to do it all by yourself.
I am trying to create an interface similar to the app Instapaper. The works just like a navigation bar except its on the left hand side.
I'm having an issue creating this interface. Any ideas on how to do this type of interface. I was thinking of a window with a view controller split up with two different views.
Any ideas, suggestions, or even a tutorial?
Mine (in Instapaper) is just one big view controller with a sidebar view that toggles the contents of the larger view manually. It's not too bad in my case, since it can only have two states -- grid or browser -- that simply switch which data is shown in the grid/browser.
If you can require iOS 5 as the minimum, you can use some of the new child-view-controller mechanics, but I couldn't yet.
You may want to start with and try this library out
Ok, I know this seems like a duplicate question, but don't think it is. I actually have this implemented already (thanks to this SO question), but it seems sluggish. I am willing to tweak it a bit, but I ran across a demo app by AboutObjects that seems to have exactly the right functionality with absolutely no code doing it. I have looked through their demo code dozens of times, and I can't figure out what they are doing that I am not. The code to look at is in their iPhone Development Tutorials section, and is called "Editable TableView" (2nd from the bottom). There are a couple of questions on the forums on that site asking how they got the functionality, but there is no answer (other than "It's a built in function"). Does anyone have any clue as to why their UITableView would implement the input scrolling by default (including being able to scroll the view manually when the keyboard pops up, which I cannot get to work).
Not sure what I was doing wrong, or what I changed, but it "just works" now. No code necessary. Weird.
I believe the UITableViewController handles the automatic scrolling including scrolling up making rows visible when the keyboard pops up.