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 4e28ddf

Browse files
committed
Add collections examples and docs
1 parent 867da79 commit 4e28ddf

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

‎docs/overview/Collections.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ fun set(collection: List<Int>){
3939

4040
In Swift:
4141
```swift
42-
print(CollectionsKt.getList())
43-
print(CollectionsKt.getArray())
44-
print(CollectionsKt.getMap())
45-
print(CollectionsKt.getSet())
42+
let a: Array<KotlinInt> =CollectionsKt.getList()
43+
let a2: KotlinArray<KotlinInt> =CollectionsKt.getArray()
44+
let d: Dictionary<String, KotlinInt> =CollectionsKt.getMap()
45+
let s: Set<KotlinInt> =CollectionsKt.getSet()
4646
CollectionsKt.set(collection: [1,2,3])
4747
```
4848

‎kotlin-swift-interopedia-samples/iosApp/iosApp/Overview/CollectionsExample.swift‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ import Foundation
22
import shared
33

44
func getCollectionsExample(){
5-
print(CollectionsKt.getList())
6-
print(CollectionsKt.getArray())
7-
print(CollectionsKt.getMap())
8-
print(CollectionsKt.getSet())
5+
let a: Array<KotlinInt> = CollectionsKt.getList()
6+
print(a)
7+
let a2: KotlinArray<KotlinInt> = CollectionsKt.getArray()
8+
print(a2)
9+
let d: Dictionary<String, KotlinInt> = CollectionsKt.getMap()
10+
print(d)
11+
let s: Set<KotlinInt> = CollectionsKt.getSet()
12+
print(s)
913
}
1014

1115
func setCollectionsExample(){

0 commit comments

Comments
(0)

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