How are properties of components accessed in componentkit? - objective-c++

in compenentskit if you add a uiswitch as a view how do you access its state? or if you add a textfield how do you access it text? I have tried setting a property and that has not worked. since the components are separated and specific to their child location there is nothing connecting them.

The file CKComponentDelegateAttribute should be able to allow you to do this.

Related

Syncfusion Xamarin sfList - How to get hold of list item template instance?

Is it possible to directly address the View instance behind the selected item in a sfList? Rather than using bindable properties I would prefer to just set properties directly on the views contained in the layout instance that displays the selected item (without affecting the properties of all the other itmes based on the template?
Possible somehow?
We have checked with the reported query “Need for customization of list item template” from our side. We would like to let you know that the SfListView provides support for customizing the appearance of each item with different templates based on specific constraints using DataTemplateSelector. You can refer the following UG documentation link for more information.
Documentation link: https://help.syncfusion.com/xamarin/sflistview/viewappearance#defining-the-data-template-selector

User Defined RunTime Attributes Set a Color

I have a package from GitHub with custom UITextFields and in the User Defined Run Time Attributes there is a field borderActiveColor with a custom color. Is there anyway I can add in my own color in the code?
I don't believe that the attribute borderActiveColor is not a standard iOS attribute. Is the project in question using the following custom text field control by any chance?
https://github.com/hdoria/HDNTextField
If so, all you need to do is use that UITextField subclass in your project as well and then set the borderActiveColor property in your code for the subclassed text fields.

Filtering an object field in Unity Editor Extension

I'm looking to use Unity's ObjectField to have users search for objects of a particular type. I know the constructor allows for a typeOf(objectType), but that does not seem to allow for filtering on custom components.
Essentially, a previous editor script I have sets up objects, and places a unique custom script on each of the components, but I've been unsuccessful in utilizing the ObjectField to search for just those objects. If I change the typeOf in my object field to be my component, it is always empty, despite there being many prefabs with that script attached in my project.
Has anyone had any success with this? Using GameObject finds them, but this finds all game objects. Is there any way to restrict this? Or to keep it only looking at particular folders?
Adding a filter while the field itself stays as type Object is a bit tricky. Here's one way.
Use ShowObjectPicker
Try opening a custom ObjectPicker. To do so you'll have to hide the default object picker and call one with a set searchFilter. It is quite a bit of work.
Setting searchFilter
Use https://docs.unity3d.com/ScriptReference/EditorGUIUtility.ShowObjectPicker.html with a searchFilter that matches the component you add to every object you want to show up in an ObjectPicker. for example "t:objectType".
There's some good information on using ShowObjectPicker at https://answers.unity.com/questions/554012/how-do-i-use-editorguiutilityshowobjectpicker-c.html
Hide default object picker
Here's a post with a way to hide the default object picker Is there any way to hide the "Object picker" of an EditorGUILayout.ObjectField in Unity Isnpector?
Show picker
You'll need to create your own Editor GUI.Button to bring up the ShowObjectPicker with the custom searchFilter.
Assets searchFilter
As a sidenote, to do the same with file assets use a "l:labelName" fileFilter instead of "t:objectType". You can set the label with the Unity Editor UI as shown here:
or with "ref:relative/path/from/assets/to/material/material.mat"

How to disable entire Column selection when clicking on column header in Nattable?

I have a simple nattable with column header layer. But when I click on column header entire column gets selected. I have to have a selection layer for only bodydata layer.
Also I want to disable all selection/click events on Column headers.
The default selection bindings are configured via DefaultSelectionBindings configuration. This is automatically registered when creating the SelectionLayer with autoconfigure turned on.
You can either turn the autoconfiguration off and register customized configurations. The easiest way would be to create a subclass of DefaultSelectionBindings and override configureColumnHeaderMouseClickBindings() to do nothing. And then create a subclass of DefaultSelectionLayerConfiguration where you override addSelectionUIBindings() to register your binding configuration. This customized selection layer configuration then needs to be added to the SelectionLayer.
The other way would be to try to unregister the applied ui bindings after NatTable#configure(). But for that approach you need some more in-depth knowledge to know what you need to unregister.

How to bind value of UILabel to an instance variable?

I am a complete newbie to mac/objective-c. My question is: I wonder if it's possible to bind a UILabel text to a variable, while not having to manually set the text when value change.
For example, on Mac OS, when I open a new Finder window and delete a file, then the global free space in the taskbar is changing. And that value also change in all the "finder" that are open.
How can I replicate such behavior using Objective-c, either on Mac or for iPhone ? I was thinking about UILabel, but I couldn't find a way different from manually set each UILabel.
thanks
Leonardo
The current version of iPhone OS (3.1) does not support bindings (such as you would find in desktop Cocoa). For the time being, you will need to write the controller glue manually to keep the UI in sync with your model.
Specifically, you would add an IBAction method in your controller, and connect the UILabel to call it when the contents changes.
This question has been covered before also:
Bindings using Interface Builder (for iPhone apps)
On the Mac, you would use Key-Value Coding (KVC) and bind the label to an object controller in IB. The bindings documentation covers this in quite some detail:
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaBindings/CocoaBindings.html
You will need to research the following:
Notifications Notifications
and/or
Key Value Coding KVC
Notifications will allow you to setup up automatic notifications of changes to let's say an object (e.g. variable) who's changes you want to be cascaded throughout your program. KVC allows you to hook up data to objects and may be helpful if you're using Core Data.
I'd start with notifications first.
It is very possible and there are 2 ways to do it.
Programatically by making a UILabel in the code and simply setting the myLabel.text.text of it
Though Interface Builder where you drag and drop the UILabel where you want it and have a property in the code to hook it up to and then use that property to set the myLabel.text on it.