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 When_Trying_To_Create_User : XCTestCase { | |
func test_should_create_user_successfully() { | |
let user = User(username: "johndoe", password: "password") | |
XCTAssertNotNil(user) | |
} | |
} |
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 When_Trying_To_Save_User : XCTestCase { | |
private var dataAccess :DataAccess! | |
override func setUp() { | |
super.setUp() | |
self.dataAccess = DataAccess() | |
} | |
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
func saveUser(_ user:User) -> Bool { | |
var isSaved = false | |
user.userId = UUID().uuidString | |
var users = getUsers() | |
users.append(user) | |
let usersData = NSKeyedArchiver.archivedData(withRootObject: users) | |
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
public class User : NSObject, NSCoding { | |
var username :String! | |
var password :String! | |
var userId :String! | |
init(username :String, password :String) { | |
self.username = username | |
self.password = password | |
} |
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
@IBAction func saveButtonClicked() { | |
let user = User(username: self.usernameTextField.text!, password: self.passwordTextField.text!) | |
let isSaved = self.dataAccess.saveUser(user) | |
if isSaved { | |
performSegue(withIdentifier: "LoginTableViewController", sender: self) | |
} else { | |
self.messageLabel.text = "User name is already taken" |
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
@IBAction func saveButtonClicked() { | |
let user = User(username: self.usernameTextField.text!, password: self.passwordTextField.text!) | |
let isSaved = self.dataAccess.saveUser(user) | |
if isSaved { | |
performSegue(withIdentifier: "LoginTableViewController", sender: self) | |
} else { | |
self.messageLabel.text = "User name is already taken" |
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
@IBAction func saveButtonClicked() { | |
let user = User(username: self.usernameTextField.text!, password: self.passwordTextField.text!) | |
self.dataAccess.saveUser(user) | |
} |
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 When_User_Is_Registering_For_A_New_Account: XCTestCase { | |
private var app :XCUIApplication! | |
override func setUp() { | |
super.setUp() | |
continueAfterFailure = false | |
self.app = XCUIApplication() | |
self.app.launchArguments = ["UI-Testing"] |
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
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
resetUserDefaults() |
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 tfcoreml as tf_converter | |
tf_converter.convert(tf_model_path = 'inception_v1_2016_08_28_frozen.pb', | |
mlmodel_path = 'InceptionV1.mlmodel', | |
output_feature_names = ['softmax:0']) |