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
### Keybase proof | |
I hereby claim: | |
* I am alokc83 on github. | |
* I am stakingnode (https://keybase.io/stakingnode) on keybase. | |
* I have a public key ASCHeGGWDt7hK-nlzuT8Ojo3O5pZOW8-uSclPjv_-7DIrwo | |
To claim this, I am signing this object: |
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
<!-- Add this file to: ~/Library/Developer/Xcode/UserData/FontAndColorThemes --> | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>DVTConsoleDebuggerInputTextColor</key> | |
<string>0.901961 0.831373 0.639216 1</string> | |
<key>DVTConsoleDebuggerInputTextFont</key> | |
<string>SFMono-Bold - 11.0</string> | |
<key>DVTConsoleDebuggerOutputTextColor</key> |
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
1. Open Terminal | |
2. cd to your Xcode project | |
3. Execute the following when inside your target project: | |
find . -name "*.swift" -print0 | xargs -0 wc -l |
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
import Foundation | |
var str = "Hello, playground" |
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
// ///////////////////////////////////////////////////////// | |
// For Loops 2 | |
// ///////////////////////////////////////////////////////// | |
import Foundation | |
/// Use of .some in For loop with `for case let` | |
func usingForCaseLet() { |
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
import Foundation | |
import UIKit | |
func unwrappingWithOprator(input: String? = nil) { | |
print("\n-----------Result for function \(#function) -----------") | |
let name: String? = input | |
let unwrappedName = name ?? "Unknown Entity" | |
print(unwrappedName) | |
// or you can | |
print(name ?? "Unknown Entity") |
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
import Foundation | |
let ironman = (name: "Tony", password: "M#n") | |
let spiderman = (name: "Peter", password: "Spid3r") | |
let deadpool = (name: "Wade", password: "w1lls0n") | |
let users = [ironman, spiderman, deadpool] | |
func firstLoop() { | |
//simply printing name |
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
import Foundation | |
func simpleSwitch() { | |
let name = "Ironman" | |
switch name { | |
case "Spiderman": print("Hello, Peter Parker") | |
case "Ironman": print("Hello, Tony Stark") | |
default: print("who are you?") | |
} | |
} |
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
let states-short-long = [ "AK - Alaska", | |
"AL - Alabama", | |
"AR - Arkansas", | |
"AS - American Samoa", | |
"AZ - Arizona", | |
"CA - California", | |
"CO - Colorado", | |
"CT - Connecticut", | |
"DC - District of Columbia", | |
"DE - Delaware", |
NewerOlder