Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ea8b9a8

Browse files
done with types in swift
1 parent 05d33b5 commit ea8b9a8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎SwiftBasics/TypesOperators.playground/Contents.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,22 @@ import Foundation
77
class LightSwitch {
88
var on: Bool = true
99
var dimmer: Int = 3
10+
var floatDimmer: Float = 3.15
11+
var dobuleDimmer: Double = 3.1111554
1012
}
1113

1214
var livingRoomSwitch = LightSwitch()
1315
livingRoomSwitch.on
1416
//: ### Example 2: Strings and Characters
1517
var dollarSign: Character = "$"
18+
var euroSign: Character = ""
19+
var myName: String = "divyanshu"
1620
var myFirstSwiftString: String = "mo' money"
1721
var mySecondSwiftString: String = "mo' problems"
1822
var concatenatedString:String = myFirstSwiftString + ", " + mySecondSwiftString
1923

24+
type(of: euroSign)
25+
2026
//: ### Stay tuned for more on Optionals and Tuples in the upcoming lessons!
2127

2228
//: # Operators

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /