DEV Community

Opeyemi Noah
Opeyemi Noah

Posted on

1 1

Day 4/100 day of SwiftUI

Mission log 4.

Type Annotation

Type annotation let us state what data type we want for our variable and constant.

example:

var name: String = "Opeyemi"
Enter fullscreen mode Exit fullscreen mode

Type inference is when swift is able to figure out the data type of a variable or constants, based on value we assign.

example:

var name = "John Doe"
Enter fullscreen mode Exit fullscreen mode

From the snippet above , swift will infer the data type to be String, because we assign text value to the variable.

Top comments (0)

Billboard image

πŸ“Š A side-by-side product comparison between Sentry and Crashlytics

A free guide pointing out the differences between Sentry and Crashlytics, that’s it. See which is best for your mobile crash reporting needs.

See Comparison