Tutorial by Examples

Objective-C //Checking for 3-D Touch availability if ([self.traitCollection respondsToSelector:@selector(forceTouchCapability)] && (self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable)) { [self registerForPreviewingWithDelegate:self sourceVie...
Each control has a property DataBindings which is a list of System.Windows.Forms.Binding objects. The Add()-method has some overloads which enables you easily binding to the property of an object: textBox.DataBindings.Add( "Text", dataObj, "MyProperty" ); Note, that binding b...
Passing ByRef or ByVal indicates whether the actual value of an argument is passed to the CalledProcedure by the CallingProcedure, or whether a reference (called a pointer in some other languages) is passed to the CalledProcedure. If an argument is passed ByRef, the memory address of the argument i...
Default modifier If no modifier is specified for a parameter, that parameter is implicitly passed by reference. Public Sub DoSomething1(foo As Long) End Sub Public Sub DoSomething2(ByRef foo As Long) End Sub The foo parameter is passed ByRef in both DoSomething1 and DoSomething2. Wa...
let bodies = (contact.bodyA.categoryBitMask <= contact.bodyB.categoryBitMask) ? (A:contact.bodyA,B:contact.bodyB) : (A:contact.bodyB,B:contact.bodyA) switch (bodies.A.categoryBitMask,bodies.B.categoryBitMask) { case let (a, _) where (a && superPower): //All we care about is i...
Linear search is a simple algorithm. It loops through items until the query has been found, which makes it a linear algorithm - the complexity is O(n), where n is the number of items to go through. Why O(n)? In worst-case scenario, you have to go through all of the n items. It can be compared to l...
View : <form id="form"> <label>First Name: <input data-bind="value: firstName" /></label> <label>Last Name: <input data-bind="value: lastName" /></label> <label>Gender: <select data-bind="s...
First of all, install gulp and gulp-jsdoc3 to your project: npm install gulp-jsdoc3 --save-dev Then add it to your gulpfile.js var gulp = require('gulp'); var jsdoc = require('gulp-jsoc3'); gulp.task('doc', function (cb){ gulp.src('src/*.js') .pipe(jsdoc(cb)); }); In order...
Objective-C First add the Social Framework to the XCode project. Import the #import "Social/Social.h" class to the required ViewController Twitter with text, image and link //- - To Share text on twitter - - if([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) ...
// myString is "hi" NSMutableString *reversedString = [NSMutableString string]; NSInteger charIndex = [myString length]; while (charIndex > 0) { charIndex--; NSRange subStrRange = NSMakeRange(charIndex, 1); [reversedString appendString:[myString substringWithRange:subS...
Given a money system, is it possible to give an amount of coins and how to find a minimal set of coins corresponding to this amount. Canonical money systems. For some money system, like the ones we use in the real life, the "intuitive" solution works perfectly. For example, if the diffe...
The module keyword can be used to begin a module, which allows code to be organized and namespaced. Modules can define an external interface, typically consisting of exported symbols. To support this external interface, modules can have unexported internal functions and types not intended for public...
Typically, packages consist of one or more modules. As packages grow, it may be useful to organize the main module of the package into smaller modules. A common idiom is to define those modules as submodules of the main module: module RootModule module SubModule1 ... end module SubModul...
The Button is probably the most common control not only in mobile applications, but in any applications that have a UI. The concept of a button has too many purposes to list here. Generally speaking though, you will use a button to allow users to initiate some sort of action or operation within you...
Quite often within mobile applications, there will be a reason to deal with dates. When working with dates, you will probably need some sort of user input to select a date. This could occur when working with a scheduling or calendar app. In this case, it is best to provide users with a specialized c...
The Entry View is used to allow users to type a single line of text. This single line of text can be used for multiple purposes including entering basic notes, credentials, URLs, and more. This View is a multi-purpose View, meaning that if you need to type regular text or want to obscure a password,...
The Editor is very similar to the Entry in that it allows users to enter some free-form text. The difference is that the Editor allows for multi-line input whereas the Entry is only used for single line input. The Entry also provides a few more properties than the Editor to allow further customizati...
Images are very important parts of any application. They provide the opportunity to inject additional visual elements as well as branding into your application. Not to mention that images are typically more interesting to look at than text or buttons. You can use an Image as a standalone element ...
Believe it or not, the Label is one of the most crucial yet underappreciated View classes not only in Xamarin.Forms, but in UI development in general. It is seen as a rather boring line of text, but without that line of text it would be very difficult to convey certain ideas to the user. Label co...
An EntryCell is a Cell that combines the capabilities of a Label and an Entry. The EntryCell can be useful in scenarios when building some functionality within your application to gather data from the user. They can easily be placed into a TableView and be treated as a simple form. XAML <Ent...

Page 980 of 1336