Skip to content

Instantly share code, notes, and snippets.

View alokc83's full-sized avatar
๐Ÿš€
Open to new opportunities

Alok Choudhary alokc83

๐Ÿš€
Open to new opportunities
View GitHub Profile
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")
// /////////////////////////////////////////////////////////
// For Loops 2
// /////////////////////////////////////////////////////////
import Foundation
/// Use of .some in For loop with `for case let`
func usingForCaseLet() {
@alokc83
alokc83 / lsby-hello-world.swift
Last active January 31, 2020 21:40
lsby1-hello-world.swift
import Foundation
var str = "Hello, playground"
@alokc83
alokc83 / enable-xcode-debug-menu.sh
Created February 25, 2020 17:33 — forked from dsabanin/enable-xcode-debug-menu.sh
Enable internal Xcode debug menu in Xcode 11
defaults write com.apple.dt.Xcode ShowDVTDebugMenu -bool YES
sudo mkdir -p /Applications/Xcode.app/Contents/Developer/AppleInternal/Library/Xcode
sudo touch /Applications/Xcode.app/Contents/Developer/AppleInternal/Library/Xcode/AppleInternal.plist
# Don't forget to restart Xcode
@alokc83
alokc83 / Count lines of code in Xcode project
Created February 26, 2020 06:31 — forked from Tokuriku/Count lines of code in Xcode project
Count lines of code in SWIFT Xcode project
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
<!-- 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>
### 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: