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
#!/bin/bash | |
cd "$(dirname "$0")" | |
files=($(find . -type f -regex "^.*m")) | |
for item in ${files[*]} | |
do | |
objc2swift $item | |
done |
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
// MARK: - Server Request - | |
internal func userDetailsRequest() { | |
if reachability.connection != .none { | |
operationQueue.addOperation { [weak self] in | |
if self == nil { | |
return | |
} | |
self!.isRunningRequest = true |
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
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
// Override point for customization after application launch. | |
window = UIWindow(frame: UIScreen.main.bounds) | |
window?.rootViewController = CustomNavigationController(rootViewController: TabsController()) | |
window?.makeKeyAndVisible() | |
//Change status bar color | |
let statusBar: UIView = UIApplication.shared.value(forKey: "statusBar") as! UIView |
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
TAGS="TODO:|FIXME:|WARNING:" | |
ERRORTAG="ERROR:" | |
find "$PROJECT_DIR/$PROJECT_NAME" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$|($ERRORTAG).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/"| perl -p -e "s/($ERRORTAG)/ error: \$1/" |
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
set -x | |
#--------- START OF CONFIGURATION | |
# Get base path to project | |
BASE_PATH="$PROJECT_DIR/$PROJECT_NAME" | |
# Get path to Laurine Generator script | |
LAURINE_PATH="$BASE_PATH/LocalizationsGenerator.swift" |
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 | |
// A Naïve Event Implementation | |
// class Event<T> { | |
// | |
// typealias EventHandler = T -> () | |
// | |
// private var eventHandlers = [EventHandler]() | |
// |
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
extension URLRequest { | |
/** | |
Returns a cURL command representation of this URL request. | |
*/ | |
public var curlString: String { | |
guard let url = url else { return "" } | |
var baseCommand = "curl \(url.absoluteString)" | |
if httpMethod == "HEAD" { |
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 RxSwift | |
import Foundation | |
import Reachability | |
public enum ReachabilityStatus { | |
case reachable(viaWiFi: Bool) | |
case unreachable | |
} | |
extension ReachabilityStatus { |
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 RxSwift | |
import RxCocoa | |
private struct ActivityToken<E> : ObservableConvertibleType, Disposable { | |
private let _source: Observable<E> | |
private let _dispose: Cancelable | |
init(source: Observable<E>, disposeAction: @escaping () -> ()) { | |
_source = source |
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
struct Application { | |
struct Auth { | |
static func isUserLoggedin() -> Bool { | |
return Defaults[.authToken] != "" | |
} | |
static func signOut() { | |
Defaults.removeAll() | |
Application.appDelegate()?.isAuthorized() | |
} |
OlderNewer