Tutorial by Examples: ti

UIButtons can be initialized in a frame: Swift let button = UIButton(frame: CGRect(x: x, y: y, width: width, height: height) Objective C UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(x, y, width, height)]; A specific type of UIButton can be created like this: Swift let but...
Swift button.setTitle(titleString, forState: controlState) Objective C [button setTitle:(NSString *) forState:(UIControlState)]; To set the default title to "Hello, World!" Swift button.setTitle("Hello, World!", forState: .normal) Objective C [button setTitle:@&quot...
//Swift button.setTitleColor(color, forControlState: controlState) //Objective-C [button setTitleColor:(nullable UIColor *) forState:(UIControlState)]; To set the title color to blue //Swift button.setTitleColor(.blue, for: .normal) //Objective-C [button setTitleColor:[UIColor blueColo...
The underlying title label, if one exists, can be fetched using Swift var label: UILabel? = button.titleLabel Objective C UILabel *label = button.titleLabel; This can be used to set the font of the title label, for example Swift button.titleLabel?.font = UIFont.boldSystemFontOfSize(12) ...
The datepicker is used to show an interactive date selector which is tied to a standard form input field. It makes selecting of date for input tasks very easy and also it is also highly configurable. Any input field can be bound with jquery-ui datepicker by the input field's selector (id,class etc....
To get the physical size of the screen (including window chrome and menubar/launcher): var width = window.screen.width, height = window.screen.height;
To get the “available” area of the screen (i.e. not including any bars on the edges of the screen, but including window chrome and other windows: var availableArea = { pos: { x: window.screen.availLeft, y: window.screen.availTop }, size: { width: window.scr...
To determine the color and pixel depths of the screen: var pixelDepth = window.screen.pixelDepth, colorDepth = window.screen.colorDepth;
<?php echo get_bloginfo( 'name' ); ?> or <?php echo get_bloginfo(); ?> Output Matt Mullenweg Based on these sample settings
<?php echo get_bloginfo( 'description' ); ?> Output Just another WordPress site Based on these sample settings
The <mark> element is new in HTML5 and is used to mark or highlight text in a document "due to its relevance in another context".1 The most common example would be in the results of a search were the user has entered a search query and results are shown highlighting the desired quer...
Standard Collections Java Collections framework A simple way to construct a List from individual data values is to use java.utils.Arrays method Arrays.asList: List<String> data = Arrays.asList("ab", "bc", "cd", "ab", "bc", "cd"); ...
If you are using the PASSWORD_DEFAULT method to let the system choose the best algorithm to hash your passwords with, as the default increases in strength you may wish to rehash old passwords as users log in <?php // first determine if a supplied password is valid if (password_verify($plaintex...
Create password hashes using password_hash() to use the current industry best-practice standard hash or key derivation. At time of writing, the standard is bcrypt, which means, that PASSWORD_DEFAULT contains the same value as PASSWORD_BCRYPT. $options = [ 'cost' => 12, ]; $hashedPasswor...
Spoilers are used to hide text or images that would otherwise negatively impact another user's experience. They can be created using >! >!This is hidden until your cursor hovers on top of it This is hidden until your cursor hovers on top of it Note: This is not part of standard markup...
Markdown tables are physically represented using dash - for to separate the header row from the content ones and pipe | for columns. ColumnColumnCellCell is produced by Column | Column ------ | ------ Cell | Cell You can also populate a table in any way you want - LetterDigitCharactera4...
Declare a new variable with var, followed by a name, type, and value: var num: Int = 10 Variables can have their values changed: num = 20 // num now equals 20 Unless they're defined with let: let num: Int = 10 // num cannot change Swift infers the type of variable, so you don't always ha...
Lazy stored properties have values that are not calculated until first accessed. This is useful for memory saving when the variable's calculation is computationally expensive. You declare a lazy property with lazy: lazy var veryExpensiveVariable = expensiveMethod() Often it is assigned to a retu...
Different from stored properties, computed properties are built with a getter and a setter, performing necessary code when accessed and set. Computed properties must define a type: var pi = 3.14 class Circle { var radius = 0.0 var circumference: Double { get { ret...
Type properties are properties on the type itself, not on the instance. They can be both stored or computed properties. You declare a type property with static: struct Dog { static var noise = "Bark!" } print(Dog.noise) // Prints "Bark!" In a class, you can use the c...

Page 26 of 505