I’m sure most of you are familiar with the UISwitch on iOS.
Is their any existing project trying to implement something like a UISwitch for macOS and AppKit?
If not, where would one start to make one? I see them frequently and can think of so many uses.
I think you should use NSCheckBox since it is the equivalent on a computer where you use a mouse and not your finger.
For anyone that comes across this question in the future, I have developed a UISwitch for Mac (MacToggle) Swift 3 & AutoLayout
https://github.com/RichAppz/MacToggle
It's a replica of the iOS UISwitch and fully customisable.
Enjoy
I've used the Mondo Switch that's part of the Cocoa Mondo Kit. It works pretty well.
I recently extended Peter Hosey's PRHOnOffButton to add iOS-like background colors and labels. Since mine is derived, it may or may not have the same caveat described above by Peter.
You could use Peter Hosey’s PRHOnOffButton.
ITSwitch requires no images, integrates with Interface Builder and has lovely (modern) animations:
https://github.com/iluuu1994/ITSwitch
Recommended.
starting with macOS 10.15 'Catalina' there is a native control for that called NSSwitch: https://developer.apple.com/documentation/appkit/nsswitch?language=objc
Related
I'm looking for a way to make key binding always active even when the top level is minimized. In other words, when the Wish app is in the background.
I work in Windows.
Any ideas?
Since you're on windows, get the TWAPI package (Tcl Windows API) and use twapi::register_hotkey. Documentation is at http://twapi.magicsplat.com/v4.0/input.html#register_hotkey and there's a blog article on this at http://www.magicsplat.com/blog/hotkeys-on-demand/ .
Tk is not designed to work that way. You'll need something like AutoHotkey instead.
i'm experiencing some issues with AutoLayout. Building for 10.8 with Xcode 4.6.2 none of the constraints i setup work for OSX 10.7. Are there any known issues around this?
Thanks!
I got this problem too, so I wrote a custom split view based on constraints. See my repo for code. https://github.com/silvansky/TwinPanelView
I personally gave up trying to use auto layout with split views. The manual layout works the best, in my experience, and is actually not much more complicated at all.
In particular, take a look at this answer: https://stackoverflow.com/a/843870/2308693
It's brilliant, and it gives you full control of everything (so I agree fully with the first comment on that answer).
I'm looking for suggestions for a 2d game engine or library. I'm not picky about the language used but more about the capabilities of the library and the platforms it works on.
I would like to write one code base that would work on iOS, OSX, Android, Win and *nix. I understand there would be some platform specific code but I would like the bulk to be useable on all platforms.
I have looked around and I have some ideas but I'm looking for other opinions. Anyone have any ideas?
SDL(Simple DirectMedia Layer) http://www.libsdl.org/
Here's a link to a list of game engines that might suit your needs.
I truly do not know if such a engine/framework exists. I think you are going to have to sacrifice a platform or two.
PyGame will run on everything you mentioned besides iOS.
http://www.pygame.org/news.html
That would be where I would start.
V-Play (I am part of the developer team) supports all your mentioned platforms from a single code base. A wide range of tutorials, examples, demos and full source code of some games that are already live in the App Stores will help you get started quickly.
what is the best way to reproduce a page turning effect (like the one in iBooks) under Mac OS X?
Thanks in advance for your help,
Regards,
I haven’t personally done this. That being said, my advice is to take a look at Leaves, which implements an iBooks-like page turning interface for iOS, and try to port it to Mac OS.
I'm starting a Mac OS X app that will connect to a small website I'm currently developing.
The idea is that the app will store a number of snippets on a local database and then sync with the website whenever it can.
So my questions are:
Carbon or Cocoa?
SQLite for local storage / another solution?
Is there any decent free text-editor control with basic syntax highlighting to embed on the app?
For new projects you should use Cocoa. Carbon is only useful to port already existing apps.
Cocoa brings it's own database backend called Core Data. It's quite simple to use but at the same time really powerful.
For syntax highlighting use a NSTextField, they are really powerful in Cocoa. One can even write highly graphical applications like Pages with it. For some examples of syntax highlighting see syntax highlighting on cocoadev.
You could also have a look at how other editors do it. For example there's Smultron, which is discontinued for the moment.
If you know ruby you can try out MacRuby. This let's you use ruby with the Cocoa classes. I'm quite sure that ruby will be the second programming language for the Mac because of its similarities to Objective-C.
At this point in each product's lifecycle, there is not really any compelling reason to use Carbon.
It's a fine API, and fine applications are written using it (Photoshop, iTunes), but a 64 bit version has not been made available, and it just seems that the writing is on the wall.
If you are just learning, and you want your knowledge to transfer to new projects in the future, Cocoa all the way.
Carbon is being phased out. You should really go for Cocoa.
Cocoa has its own database solutions (a flavor of SQL I think).
Cocoa. Carbon is going the way of the dodo and is only available in 32 bits.
And Xcode is free, with lots of syntax highlighting ;)
Check out this link for info about syntax highlighting in cocoa