I want to add the tabbing mechanism that you can see e.g. in Safari, the Console or the Finder (http://dailymactips.com/working-with-finder-tabs-on-your-mac/). I have already searched a lot, but I can not find a good guide for this.
Ideally, I want to be able to push an alert-dialog before a new tab is created by the user.
NSWindow has native tabs for a couple of years now.
The "Whats new in Cocoa" session from WWDC 2016 is the best place to start, since the documentation is quite thin still.
Whats New In Cocoa (203 WWDC 2016)
If you are using (for example) the method addTabbedWindow::ordered:, you can simply show your alert before adding the tab.
Related
I wanted to migrate away from the deprecated UIWebView in Xamarin Forms iOS, and I read online that WKWebView is now the default in Xamarin Forms 4.x, and I was currently in 3.6.0.x.
So I decided to update hoping that the Webview would automatically update for me, but I realized there is no way to tell because I don't know what, and if there even is a difference in how the webviews look. I've looked online but can't find any side by side pictures of the same app/interface using WK vs. UI. Is there a difference at all?
The only difference I saw after updating, was that on one of the pages, the loading icon wouldn't disappear whereas it did after a couple of seconds in UI.
Thanks!
Welcome to StackOverflow! :)
The easiest way to answer this question is simply going to be to test it. To my knowledge, both UIWebView and WKWebView use the exact same underlying WebKit code/engine to render HTML content. There may be differences due to separate defaults and properties that one has vs. the other, but for the most part, they should be identical. But you shouldn't take my word for it! If you can, give it a try.
Currently I am trying to create a standalone window which is triggered from pressing a drop down button in a status bar icon. I am able to create windows however I am unable to move, minimise or close the windwos and they have the missing red, oragne and yellow butons that are visible in Mac.
Any ideas how to fix?
Edit: to provide more details I am building a Status bar app. I have removed the default windows Views controller from Storyboard and create a new one to make up my "settings" Screen
( screenshot below)
I use the following code to instantiate the window -
let mainStoryboard = NSStoryboard(name: NSStoryboard.Name(rawValue: "Main"), bundle: nil)
let myWindowController = mainStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: "NewWindowVC")) as? NSWindowController
window?.windowController = myWindowController
and it results in the screen with no red, yellow and green buttons
whic isn't movable and doesn't have the buttons on it..
It sounds like you need an introduction to event & window handling under macOS. To get started try reading through the Cocoa Event Handling Guide and Windows Programming Guide which between them cover the principles of handling events and moving, resizing, closing windows in response. If you are opening "document" windows you might want to read Document-Based App Programming Guide for Mac as the document kit handles a lot of the mundane tasks. These are all found in Apple's Documentation Archive along with sample code, and many of these documents are referenced directly from the current API documentation.
Documentation Archive? All these are older guides and no longer being updated by Apple. You should check anything you read in them against the current API documents for the various classes, but the core hasn't changed a lot.
Another answer might reveal where Apple has hidden the up-to-date guides and sample code, but Apple's current documentation includes links back to these old ones...
If you fail to get your windows moving, closing etc. ask a new question showing your code and describing your problem and some will undoubtedly help you along.
I'm looking to add two finger "fluid swiping" to my app. Anyone who has used the week view in the Calendar app that comes with OSX will have seen what I'm trying to do.
I have a scroll view, and I want to be able to use swipe gestures and scrolling to move the content view in the horizontal axis of my NSScrollView, ie a day or a week.
The video from WWDC 2011 titled "Scrolling, Swiping, Dragging: Now with more animation" was quite useful, and looks like it will be able to explain what I want to do, but unfortunately the sample code for PictureSwiper isn't provided with the video.
I'm aware that a newer version of PictureSwiper is avaliable, but it uses NSPageController and I'm really looking for the older Lion 10.7 way of handling things as I can't use NSPageController. Is it still possible to find the old PictureSwiper somewhere?
If not could someone explain how the PictureSwiper sample on Lion worked? I'm aware of the App note https://developer.apple.com/library/mac/#releasenotes/Cocoa/AppKitOlderNotes.html (search for "scrollWheel:") but that has only gone part of the way to explaining the kind of functionality I am after.
Many thanks for any help.
David.
For anyone looking to this for an answer I eventually used one of my "Developer Technical Support" queries that came with my paid Dev account to ask for the old code. A few days latter an Apple engineer emailed me the old Picture Swiper.
Now that I have seen the code the App note makes complete sense! Picture Swiper moves CALayers around, but in my case I just use NSClipView's scrollToPoint:.
Within the scroll handler I just do something like: (gestureAmount * columnWidth) + currentColumnIndexOffset.
Seems to work!
When using the interface builder, if I select a button that is in my layout, the interface builder immediately zooms into that button.
Is there any way I can stop that behaviour.
i.e. I want the interface builder to just select the button and not zoom in.
XCode 4.2 snow Leopard
Post-Script. I think the answer is "you can't". One other suggestion refers to making zoom shortcuts but that does seem to help either.
In response to my own question. As of 24 hours later I think the answer is
"you can't".
One other suggestion found when researching in StackOverFlow refers to making zoom shortcuts but that does seem to help either.
I've been looking for a way to implement a global shortcut for my app that would work like shortcut recorder. The problem is I haven't found one that works with the current version of xcode, every single one I've found throws an error in xcode about legacy stuff. The only one i've found that is any good in Lion is DDHotKey, which does exactly what I want, but it has the downside that the user doesn't record the shortcut in a nifty smart textfield sort of thing, its a preset shortcut.
Can anyone tell me how to add a smart textfield to DDHotKet, or a fix for SR in Lion? It seems that for ShortcutRecorder the specific problem has to do with the actual textfield in IB using old plug-ins, so I can't use the text field (which is what I really want). I've looked up a whole bunch of different frameworks but they all have outdated stuff. To be honest even if I found a fix for running SR I still have no idea what to do since it seems to be waaay more complicated than all the others i've found.
This fork of ShortcutRecorder builds in Xcode 4:
https://github.com/youknowone/shortcutrecorder
It also has a nice demo project that shows how to use the API.