-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd2b0ab
commit 35e2d5d
Showing
3 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,5 @@ class ViewController: UIViewController { | |
userDefaults.set(data, forKey: "appSettings") | ||
} | ||
|
||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//: Playground - noun: a place where people can play | ||
|
||
import UIKit | ||
|
||
var str = "Hello, playground" | ||
|
||
// First way | ||
print(String(str.reversed())) | ||
|
||
//Second way | ||
var charArray: [Character] = [Character]() | ||
for ch in str { | ||
charArray.append(ch) | ||
} | ||
|
||
var reversedArray: [Character] = [Character]() | ||
|
||
for i in (0..<str.count).reversed() { | ||
reversedArray.append(charArray[i]) | ||
} | ||
|
||
print(String(reversedArray)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<playground version='5.0' target-platform='ios'> | ||
<timeline fileName='timeline.xctimeline'/> | ||
</playground> |