News for hackers. Stuff that matters.
Re:Tempted to Abandon React Native for Native Android by kartickv on Sunday February 05, 2017 @12:06AM (#13570976)
The NativeScript site says that I can use their cross-platform wrappers like Button, which delegates to UIButton on iOS and android.whatever.Button on Android. So far, so good. But suppose I now want to invoke some method on Button that exists only on iOS. Can I do that? If not, it's the least-common-denominator, which I'm not interested in using to build an app. I'm thinking about something like:

var button = new Button(...);

// Set the common properties:

button.backgroundColor = ...;

button.text = ...;

if (iOS) {

  // Set iOS-specific properties
} else {

  // Set Android-specific properties

}
Re:Tempted to Abandon React Native for Native Android by dbbk on Monday February 06, 2017 @05:05PM (#13584680)
Yes, it literally works like that. See the docs: http://docs.nativescript.org/cookbook/application

The variable is app.ios / app.android