Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MahdiBM authored Jul 12, 2024
1 parent f2b21da commit 2380ade
Showing 1 changed file with 53 additions and 53 deletions.
106 changes: 53 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ enum TestEnum {
}
```
Is expanded to:
```swift
```diff
enum TestEnum {
case a(val1: String, val2: Int)
case b
case testCase(testValue: String)

var caseName: String {
switch self {
case .a: "a"
case .b: "b"
case .testCase: "testCase"
}
}
+ var caseName: String {
+ switch self {
+ case .a: "a"
+ case .b: "b"
+ case .testCase: "testCase"
+ }
+ }
}
```

Expand All @@ -74,32 +74,32 @@ enum TestEnum {
}
```
Is expanded to:
```swift
```diff
enum TestEnum {
case a(val1: String, val2: Int)
case b
case testCase(testValue: String)

var isA: Bool {
switch self {
case .a: return true
default: return false
}
}

var isB: Bool {
switch self {
case .b: return true
default: return false
}
}

var isTestCase: Bool {
switch self {
case .testCase: return true
default: return false
}
}
+ var isA: Bool {
+ switch self {
+ case .a: return true
+ default: return false
+ }
+ }

+ var isB: Bool {
+ switch self {
+ case .b: return true
+ default: return false
+ }
+ }

+ var isTestCase: Bool {
+ switch self {
+ case .testCase: return true
+ default: return false
+ }
+ }
}
```

Expand Down Expand Up @@ -127,17 +127,17 @@ enum TestEnum {
}
```
Is expanded to:
```swift
```diff
enum TestEnum {
case a(val1: String, val2: Int)
case b
case testCase(testValue: String)

enum Copy {
case a(val1: String, val2: Int)
case b
case testCase(testValue: String)
}
+ enum Copy {
+ case a(val1: String, val2: Int)
+ case b
+ case testCase(testValue: String)
+ }
}
```

Expand Down Expand Up @@ -167,29 +167,29 @@ enum TestEnum {
}
```
Is expanded to:
```swift
```diff
enum TestEnum {
case a(val1: String, Int)
case b
case testCase(testValue: String)

func getA() -> (val1: String, param2: Int)? {
switch self {
case let .a(val1, param2):
return (val1, param2)
default:
return nil
}
}

func getTestCase() -> (String)? {
switch self {
case let .testCase(testValue):
return (testValue)
default:
return nil
}
}
+ func getA() -> (val1: String, param2: Int)? {
+ switch self {
+ case let .a(val1, param2):
+ return (val1, param2)
+ default:
+ return nil
+ }
+ }

+ func getTestCase() -> (String)? {
+ switch self {
+ case let .testCase(testValue):
+ return (testValue)
+ default:
+ return nil
+ }
+ }
}
```

Expand Down

0 comments on commit 2380ade

Please sign in to comment.