Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shopify_iossdk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cemarose
shopify_iossdk
Commits
94cde519
Commit
94cde519
authored
May 05, 2016
by
Dima Bart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clear textfields on successful login or signup.
parent
623fb96a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletions
+20
-1
LoginViewController.swift
... Customers/Sample App Customers/LoginViewController.swift
+8
-0
SignupViewController.swift
...Customers/Sample App Customers/SignupViewController.swift
+12
-1
No files found.
Mobile Buy SDK Sample Apps/Sample App Customers/Sample App Customers/LoginViewController.swift
View file @
94cde519
...
...
@@ -58,10 +58,18 @@ class LoginViewController: UITableViewController {
BUYClient
.
sharedClient
.
loginCustomerWithCredentials
(
credentials
)
{
(
customer
,
token
,
error
)
in
self
.
actionCell
.
loading
=
false
if
let
_
=
customer
{
self
.
clear
()
}
print
(
"Customer:
\(
customer
)
, Token:
\(
token
)
, Error:
\(
error
)
"
)
}
}
private
func
clear
()
{
self
.
emailField
.
text
=
""
self
.
passwordField
.
text
=
""
}
// ----------------------------------
// MARK: - UITableViewDelegate -
//
...
...
Mobile Buy SDK Sample Apps/Sample App Customers/Sample App Customers/SignupViewController.swift
View file @
94cde519
...
...
@@ -40,7 +40,7 @@ class SignupViewController: UITableViewController {
var
lastName
:
String
{
return
self
.
lastNameField
.
text
??
""
}
var
email
:
String
{
return
self
.
emailField
.
text
??
""
}
var
password
:
String
{
return
self
.
passwordField
.
text
??
""
}
var
passwordConfirm
:
String
{
return
self
.
password
Field
.
text
??
""
}
var
passwordConfirm
:
String
{
return
self
.
password
ConfirmField
.
text
??
""
}
// ----------------------------------
// MARK: - View Loading -
...
...
@@ -67,10 +67,21 @@ class SignupViewController: UITableViewController {
BUYClient
.
sharedClient
.
createCustomerWithCredentials
(
credentials
)
{
(
customer
,
token
,
error
)
in
self
.
actionCell
.
loading
=
false
if
let
_
=
customer
{
self
.
clear
()
}
print
(
"Customer:
\(
customer
)
, Token:
\(
token
)
, Error:
\(
error
)
"
)
}
}
private
func
clear
()
{
self
.
firstNameField
.
text
=
""
self
.
lastNameField
.
text
=
""
self
.
emailField
.
text
=
""
self
.
passwordField
.
text
=
""
self
.
passwordConfirmField
.
text
=
""
}
// ----------------------------------
// MARK: - UITableViewDelegate -
//
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment