- Open below directory in Finder with Cmnd + Shift + G
/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/
#!/usr/bin/env swift | |
import Foundation | |
@discardableResult | |
func shell(_ args: String...) -> Int32 { | |
let task = Process() | |
task.launchPath = "/usr/bin/env" | |
task.arguments = args | |
task.launch() |
# Created by: Rostyslav Druzhchenko | |
# | |
# Get current time | |
# | |
START_DATE=$(date +"%s") | |
# Save Swiftlint full path to a local variable | |
# | |
SWIFT_LINT=/usr/local/bin/swiftlint |
# Created by: Rostyslav Druzhchenko | |
# | |
# 1: Declare variables | |
RESULT_DIR="libUniversal" | |
BUILD_DIR_SIMULATOR="Debug-iphonesimulator" | |
BUILD_DIR_DEVICE="Debug-iphoneos" | |
LIB_NAME="Networking" |
#!/bin/bash | |
set -e | |
defaults write com.apple.dt.Xcode DVTTextEditorTrimTrailingWhitespace -bool YES | |
defaults write com.apple.dt.Xcode DVTTextEditorTrimWhitespaceOnlyLines -bool YES | |
defaults write com.apple.dt.Xcode DVTTextIndentTabWidth -int 4 | |
defaults write com.apple.dt.Xcode DVTTextIndentWidth -int 4 |
#!/usr/bin/swift | |
import Foundation | |
func basicAuth(_ username: String, _ password: String) -> String { | |
let auth = username + ":" + password | |
let authData = auth.data(using: .utf8)! | |
return authData.base64EncodedString() | |
} |
import UIKit | |
import Networking // 1 | |
class ViewController: UIViewController { | |
let authService = AuthenticationService() // 2 | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let token = authService.login("user", "S7eo#0-2K&b") // 3 | |
print("token: \(token)") // 4 | |
} |
import Foundation | |
public class AuthenticationService { | |
public init() { | |
} | |
public func login(_ username: String, _ password: String) -> String { | |
return UUID().uuidString | |
} |