Posts

SiwftUI - WEBIMAGE

WEBIMAGE webImage is used to download the web image, use the URLSession to download the original Image after successful download; you can also use Kingfisher in the downloadWebImage function . Example: var body : some View { Image ( uiImage : self . uiImage ?? placeholderImage ) . resizable () . onAppear ( perform : downloadWebImage ) . frame ( width : 80 , height : 80 , alignment : . center ) . onTapGesture { print ( "Tap " ) } }

SiwftUI - IMAGE

  IMAGE The  Image  control is used to display images, example: Image ( "icon" ) . resizable () . frame ( width : 100 , height : 100 , alignment : . center )

SwiftUI - TEXTFIELD

TEXTFIELD TextField is used to add a normal input box, which is often used as a text input. Example: TextField ( self . $ name , placeholder : self . nameText , onEditingChanged : { changed in print ( "onEditing: \( changed ) " ) }) { print ( "userName: \( self . name ) " ) self . endEditing ( true ) }} . padding ( 10 ) . frame ( height : 50 ) . textFieldStyle ( RoundedBorderTextFieldStyle ()) . padding ( EdgeInsets ( top : 0 , leading : 20 , bottom : 0 , trailing : 20 ))

SwiftUI - TEXT

TEXT Text is used to display one or more lines of text content with the same effect as UILabel, but it is even better. If you want to create Text, just create it with Text("SwiftUI"); With chained syntax, you can also add multiple attributes to the text, such as fonts, colors, shadows, spacing between top left and right, and so on. Example: Text ( "SwiftUI" ) . foregroundColor ( . orange ) . bold () . font ( . system ( . largeTitle )) . fontWeight ( . medium ) . italic () . shadow ( color : . black , radius : 1 , x : 0 , y : 2 )

PostgreSQL - DATE/TIME Functions and Operators

Image
  We had discussed about the Date/Time data types in the chapter   Data Types . Now, let us see the Date/Time operators and Functions. The following table lists the behaviors of the basic arithmetic operators − The following is the list of all important Date and Time related functions available. AGE(timestamp, timestamp), AGE(timestamp) Example of the function AGE(timestamp, timestamp) is − testdb =# SELECT AGE ( timestamp '2001-04-10' , timestamp '1957-06-13' ); The above given PostgreSQL statement will produce the following result − age ------------------------- 43 years 9 mons 27 days Example of the function AGE(timestamp) is − testdb =# select age ( timestamp '1957-06-13' ); The above given PostgreSQL statement will produce the following result − age -------------------------- 55 years 10 mons 22 days CURRENT DATE/TIME() PostgreSQL provides a number of functions that return values related to the current date and time. Foll

PostgreSQL - String Function

PostgreSQL string functions are used primarily for string manipulation. The following table details the important string functions − ASCII(str) Returns the numeric value of the leftmost character of the string str. Returns 0 if str is an empty string. Returns NULL if str is NULL. ASCII() works for characters with numeric values from 0 to 255. testdb=# SELECT ASCII('2'); +---------------------------------------------------------+ | ASCII('2') | +---------------------------------------------------------+ | 50 | +---------------------------------------------------------+ 1 row in set (0.00 sec) testdb=# SELECT ASCII('dx'); +---------------------------------------------------------+ | ASCII('dx') | +---------------------------------------------------------+ | 100 |