This file contains hidden or 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 WTFViewModel { | |
let passwordMinChars: Int = 6 | |
let passwordMinCriterias: Int = 3 | |
/// Checks if the text meets the validity criteria | |
/// | |
/// - Parameter text: The text | |
/// - Returns: The result | |
private func isPasswordCriteriaSatisfied(text: String) -> Bool { |
This file contains hidden or 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
class ViewController: UITableViewDataSource, UITableViewDelegate { | |
var longPressGesture: UILongPressGestureRecognizer! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
... | |
longPressGesture = UILongPressGestureRecognizer(target: self, action: #selector(longPressGestureRecognized(_:))) |
This file contains hidden or 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 React from 'react'; | |
import { View } from 'react-native'; | |
interface IProps { | |
color?: string; | |
marginTop?: number; | |
marginBottom?: number; | |
} | |
export class SeparatorLine extends React.Component<IProps, any> { |
This file contains hidden or 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 UIKit | |
class UserSession { | |
let name: String = "Mario" | |
let id: String = "id_123123123" | |
let token: String = "s79s2waas9432j2jf23f2" | |
} | |
let userSession = UserSession() |
This file contains hidden or 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 UserDefaults { | |
static func makeClearedInstance( | |
for functionName: StaticString = #function, | |
inFile fileName: StaticString = #file | |
) -> UserDefaults { | |
let className = "\(fileName)".split(separator: ".")[0] | |
let testName = "\(functionName)".split(separator: "(")[0] | |
let suiteName = "com.johnsundell.test.\(className).\(testName)" | |
let defaults = self.init(suiteName: suiteName)! |
This file contains hidden or 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 decoder = RPJSONDecoder() | |
do { | |
let response = try decoder.decode(BaseDataArrayResponse<T>.self, from: json) | |
completion(response.data, nil) | |
} catch let DecodingError.dataCorrupted(context) { | |
completion(nil, DecodingError.dataCorrupted(context)) | |
print("codingPath:", context.codingPath) | |
} catch let DecodingError.typeMismatch(type, context) { | |
completion(nil, DecodingError.typeMismatch(type, context)) | |
print("Type '\(type)' mismatch:", context.debugDescription) |
This file contains hidden or 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
pod cache clear --all | |
pod cache clear 'alamofire' | |
pod cache clear 'alamofire' --all // delete all installed 'alamofire' pods |
This file contains hidden or 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
# Xcode 10.2 | |
# please use within Xcode environment (Build Phases -> Run Script or Scheme -> Post Actions) | |
xcodebuild -version | |
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal | |
# make sure the output directory exists | |
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}" | |
env > env.txt | |
# Step 1. Build Device and Simulator versions | |
xcodebuild -project "${PROJECT_NAME}.xcodeproj" -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build |