Best route to creating a Calendar based Date picker for Cocoa? - cocoa

I'd like to implement a date picker using a calendar. Before I go ahead and try to build one, is there something that does this already?
I've looked at the date picker in Interface Builder and it's pretty much just a text field as far as I can tell. And looking (albeit quickly) through the developer docs, it seems there's plenty of date related functionality available, but not very much in the way of an interface. So If I do go ahead and build my own, what's the best line of attack
I've already built what i need in HTML/CSS and Javascript with jQuery for a website I'm working on, so my initial thought was that I could use a web view and display that, assuming there's some way to detect events happening inside a web view. But this feels a bit cheap to me. What would be the recommended route?

Use NSDatePicker. You can change it to be a Calendar or Clock, or both, using the Inspector:
(source: quicksnapper.com)
This is what it looks like:
(source: quicksnapper.com)

Related

Bigcommerce product image customization with text change

Currently I am trying to build such customization of product in Bigcommerce Storefront that allows to display image with dynamic text, which was entered in Textbox. That means product image preview should be shown INSTANTLY with new image with written text.
so that the end user will know how the final product will looks like and also same image should go in shopping cart as well.
I know that there is an app on Shopify named as Product Builder.
Is this possible to do it on Bigcommerce?
Thanks in Advance
It's definitely possible with some fairly advanced client-side code. Unfortunately I don't know of any plug and play systems or apps for Bigcommerce that will achieve what you're looking for, but there are a couple ways to get a live updating product preview if you're willing to get your hands dirty.
Here's an example from my site. Click the button under "personalize this item", and you'll see a live preview image like you describe in the modal. Enter some text and change the monogram style and color, the preview image should update pretty quickly every time you change an option. A solution exactly like mine may not be feasible for you, since that site is using a pretty complex React/Redux implementation built on an extensively customized Stencil theme... it's far from a turnkey solution. That said, you could implement something similar without needing a totally custom app.
The image preview itself in the example above is powered by IMGIX.com. They offer a great service at a fantastic price. Basically my system translates the user-selected Bigcommerce option into a URL string per IMGIX's URL-based API. Displaying the live preview is then as simple as changing the image's src attribute to the corresponding IMGIX URL on every input change. I do this in a React component that consumes a Redux store, but something similar could definitely be done in the framework of your choice, or plain old vanilla JavaScript. Cloudinary offers a similar (maybe even a little bigger) feature set to IMGIX, but I found IMGIX to be a bit faster, and the pricing was considerably less for my usage.
You could also write something that uses the HTML5 canvas to overlay text and effects on an image, and thereby avoid using a third-party service. I found such a solution to be way more work and way more taxing on the client-side device, but it'd definitely be another way to skin the proverbial cat.
There may be other viable solutions out there, but the above has been my experience in implementing something similar to what you're looking for on Bigcommerce. I hope this is helpful!

Xamarin.Forms - Choose list

I don't know what is the real name of what I want to do, but I would like to make a list similar as this website link (Standard Select part at the top), does anyone can help me? I know it's something easy but I can't find what I want to do it for Xamarin. Maybe I don't search in the right direction, I assume it too!
There's no 1-1 implementation of a dropdown control in Xamarin.Forms but you'll get very close by using the Picker control.
Please notice that the default Picker control doesn't support binding so you might want to look for an extended version with that support.
There is no such thing built in Xamarin.Forms. You can choose one of the controls described in documentation.
To implement what you are looking for you will have to use Custom Renderer with control like this from Android. Of course for iOS you will have to use something different because there is no such control on iOS platform, but you can use this.
Have you looked at the Syncfusion AutoComplete control?
I think this is the closest you will get to what you are looking for.
They also provide a free community licence for developers

MvvmCross vnext : monodroid use a VideoView inside a plugin

I was playing with Xamarin Mobile api MediaPicker which uses MediaRecorder with monodroid to make a plugin to record a video.
Android must preview the video inside a VideoView. This restriction applies to wp7 and ios too for privacy.
So, I need to get the VideoView (or Rectangle in wp7) from my custom view and setPreviewDisplay to this VideoView in my plugin (or init MediaPicker with this VideoView).
What is the best way to implement my portable plugin which requires UI element ?
Thanks in advance for your help.
What is the best way to implement my portable plugin which requires UI element ?
I guess my first question is "do you need a portable plugin?"
What is the interface that you actually need at the ViewModel layer or lower?
My guess is that the cross-platform interface that the ViewModel will see might contain just:
some control commands (things like start/stop)
some summary information - e.g. video length
a file access layer - this may be as little as a file path?
If that's the case, then I'd probably implement most of the logic within Controls/Views/UIViews in the UIs, and would then bind the relevant commands and values to those ViewModel properties.
So I wouldn't personally implement this as a plugin at all!
I've previously done a couple of apps which use video views - one for video capture (Android only), one for bar code scanning.
I found that the basic available samples worked quite well. However, once I started trying to extend them, then they became quickly fragile, they were hard to get working and they were quite frustrating to develop!
I would genuinely recommend starting your current develop as UI View code. After you've got it working, then you might find a nice way to split up the control and interface into a plugin - but I suspect that this won't be where most of your time is spent.
e.g. for my next QR code app, I plan to use the separate UI controls in https://github.com/Redth/ZxingSharp.Mobile - at the ViewModel level, I can hopefully just expose some sort of Command which acts on the decoded QR strings.

Date time format UI

My app shows many dates/times and I would like to allow user to create its own format using a friendly interface like the OSX system UI shown in image
I can't find any cocoa or CF API to show a similar panel, if possible I prefer don't re-implement it from the scratch.
Anyone can point me if this panel can be shown from standard API or if exists a ready to use component?
You're looking for NSTokenField, though you will need to do some modifications to make it work for your case.

Which GUI element does iCal use for calendar view?

I’m writing a simple iCal-like app in Cocoa that I’d like to resemble the main view of iCal.
Does anyone know which GUI element (i.e. NSWhatever) was used to create the Month-view (this thing: http://skitch.com/edwardog/b38ba/ical)?
Thanks!
PS – A hint at figuring this sort of thing out for myself would also be well appreciated; I’ve got a feeling that the answer lies somewhere in .nib, but after poking around I didn’t have much luck.
CalendarWindow.nib, "Window".
Looks like it's all custom views I'm afraid.
The main calendar view must be a custom subclass of NSView, with custom drawing in the overridden drawRect: method.
If you really feel like poking around in running applications, check out F-Script Anywhere.
I'm not claiming that iCal uses it, but you might try NSDatePicker, which supports a calendar style.

Resources