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 | |
enum NibBaseError:Error { | |
case badClassName | |
case noNibFile | |
case noStoryboard | |
} | |
class NibBaseViewController: UIViewController, IsNibBaseViewController { |
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 UITabBarController { | |
func set(visible: Bool, animated: Bool, completion: ((Bool)->Void)? = nil ) { | |
guard isVisible() != visible else { | |
completion?(true) | |
return | |
} | |
let offsetY = tabBar.frame.size.height |
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 | |
info="Info.plist" | |
plistBuddy=/usr/libexec/PlistBuddy | |
version=`$plistBuddy -c "print CFBundleVersion" "$info"` | |
echo "Current version: $version" | |
((version++)) | |
echo "New version: $version" | |
$plistBuddy -c "set CFBundleVersion $version" "$info" |
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
// | |
// NibBaseViewController.swift | |
// | |
// Created by Maciej Gad on 23/09/2018. | |
// Copyright © 2018 Maciej Gad. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
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 add(_ char:Character, to input:String, pattern:[UInt]) -> String { | |
guard pattern.reduce(0, +) > 0 else { return input } | |
var str = input | |
var index:String.Index? = str.startIndex | |
var i = 0 | |
while index != nil { | |
let offset = pattern[i%pattern.count] | |
i += 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
import Foundation | |
import CFNetwork | |
public class FTPUpload { | |
fileprivate let ftpBaseUrl: String | |
fileprivate let directoryPath: String | |
fileprivate let username: String | |
fileprivate let password: String |
OlderNewer