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
52f15563
Commit
52f15563
authored
May 04, 2016
by
Dima Bart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add loading indicator when initiating login or signup actions.
parent
7e49d2c4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
0 deletions
+64
-0
project.pbxproj
... Customers/Sample App Customers.xcodeproj/project.pbxproj
+12
-0
ActionCell.swift
...ample App Customers/Sample App Customers/ActionCell.swift
+26
-0
Main.storyboard
...Customers/Sample App Customers/Base.lproj/Main.storyboard
+0
-0
LoginViewController.swift
... Customers/Sample App Customers/LoginViewController.swift
+13
-0
SignupViewController.swift
...Customers/Sample App Customers/SignupViewController.swift
+13
-0
No files found.
Mobile Buy SDK Sample Apps/Sample App Customers/Sample App Customers.xcodeproj/project.pbxproj
View file @
52f15563
...
...
@@ -7,6 +7,7 @@
objects
=
{
/* Begin PBXBuildFile section */
9A102CEE1CDAA6080026CC43
/* ActionCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A102CED1CDAA6080026CC43
/* ActionCell.swift */
;
};
9A9C03071CD8F9AC00AE79BD
/* AppDelegate.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A9C03061CD8F9AC00AE79BD
/* AppDelegate.swift */
;
};
9A9C03091CD8F9AC00AE79BD
/* LoginViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A9C03081CD8F9AC00AE79BD
/* LoginViewController.swift */
;
};
9A9C030C1CD8F9AC00AE79BD
/* Main.storyboard in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A9C030A1CD8F9AC00AE79BD
/* Main.storyboard */
;
};
...
...
@@ -64,6 +65,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
9A102CED1CDAA6080026CC43
/* ActionCell.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ActionCell.swift
;
sourceTree
=
"<group>"
;
};
9A9C03031CD8F9AC00AE79BD
/* Sample App Customers.app */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.application
;
includeInIndex
=
0
;
path
=
"Sample App Customers.app"
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
9A9C03061CD8F9AC00AE79BD
/* AppDelegate.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
AppDelegate.swift
;
sourceTree
=
"<group>"
;
};
9A9C03081CD8F9AC00AE79BD
/* LoginViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
LoginViewController.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -89,6 +91,14 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
9A102CE81CDAA5F00026CC43
/* Cells */
=
{
isa
=
PBXGroup
;
children
=
(
9A102CED1CDAA6080026CC43
/* ActionCell.swift */
,
);
name
=
Cells
;
sourceTree
=
"<group>"
;
};
9A9C02FA1CD8F9AC00AE79BD
=
{
isa
=
PBXGroup
;
children
=
(
...
...
@@ -112,6 +122,7 @@
children
=
(
9A9C03061CD8F9AC00AE79BD
/* AppDelegate.swift */
,
9A9C03391CD920F600AE79BD
/* Extensions */
,
9A102CE81CDAA5F00026CC43
/* Cells */
,
9A9C031A1CD8FA0C00AE79BD
/* View Controllers */
,
9A9C030A1CD8F9AC00AE79BD
/* Main.storyboard */
,
);
...
...
@@ -271,6 +282,7 @@
9A9C03091CD8F9AC00AE79BD
/* LoginViewController.swift in Sources */
,
9A9C03071CD8F9AC00AE79BD
/* AppDelegate.swift in Sources */
,
9A9C033B1CD921D700AE79BD
/* BUYClient+Extensions.swift in Sources */
,
9A102CEE1CDAA6080026CC43
/* ActionCell.swift in Sources */
,
9A9C031C1CD8FC6A00AE79BD
/* AccountViewController.swift in Sources */
,
9A9C031E1CD8FD2300AE79BD
/* SignupViewController.swift in Sources */
,
);
...
...
Mobile Buy SDK Sample Apps/Sample App Customers/Sample App Customers/ActionCell.swift
0 → 100644
View file @
52f15563
//
// ActionCell.swift
// Sample App Customers
//
// Created by Dima Bart on 2016-05-04.
// Copyright © 2016 Shopify Inc. All rights reserved.
//
import
UIKit
class
ActionCell
:
UITableViewCell
{
@IBOutlet
private
weak
var
actionLabel
:
UILabel
!
@IBOutlet
private
weak
var
loader
:
UIActivityIndicatorView
!
var
loading
:
Bool
{
get
{
return
self
.
actionLabel
.
hidden
}
set
{
self
.
actionLabel
.
hidden
=
newValue
self
.
loader
.
hidden
=
!
newValue
}
}
}
Mobile Buy SDK Sample Apps/Sample App Customers/Sample App Customers/Base.lproj/Main.storyboard
View file @
52f15563
This diff is collapsed.
Click to expand it.
Mobile Buy SDK Sample Apps/Sample App Customers/Sample App Customers/LoginViewController.swift
View file @
52f15563
...
...
@@ -31,11 +31,21 @@ class LoginViewController: UITableViewController {
@IBOutlet
private
weak
var
emailField
:
UITextField
!
@IBOutlet
private
weak
var
passwordField
:
UITextField
!
@IBOutlet
private
weak
var
actionCell
:
ActionCell
!
var
email
:
String
{
return
self
.
emailField
.
text
??
""
}
var
password
:
String
{
return
self
.
passwordField
.
text
??
""
}
// ----------------------------------
// MARK: - View Loading -
//
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
self
.
actionCell
.
loading
=
false
}
// ----------------------------------
// MARK: - Actions -
//
private
func
loginUser
()
{
...
...
@@ -44,7 +54,10 @@ class LoginViewController: UITableViewController {
BUYAccountCredentialItem
(
password
:
self
.
password
),
])
self
.
actionCell
.
loading
=
true
BUYClient
.
sharedClient
.
loginCustomerWithCredentials
(
credentials
)
{
(
customer
,
token
,
error
)
in
self
.
actionCell
.
loading
=
false
print
(
"Customer:
\(
customer
)
, Token:
\(
token
)
, Error:
\(
error
)
"
)
}
}
...
...
Mobile Buy SDK Sample Apps/Sample App Customers/Sample App Customers/SignupViewController.swift
View file @
52f15563
...
...
@@ -34,6 +34,7 @@ class SignupViewController: UITableViewController {
@IBOutlet
private
weak
var
emailField
:
UITextField
!
@IBOutlet
private
weak
var
passwordField
:
UITextField
!
@IBOutlet
private
weak
var
passwordConfirmField
:
UITextField
!
@IBOutlet
private
weak
var
actionCell
:
ActionCell
!
var
firstName
:
String
{
return
self
.
firstNameField
.
text
??
""
}
var
lastName
:
String
{
return
self
.
lastNameField
.
text
??
""
}
...
...
@@ -42,6 +43,15 @@ class SignupViewController: UITableViewController {
var
passwordConfirm
:
String
{
return
self
.
passwordField
.
text
??
""
}
// ----------------------------------
// MARK: - View Loading -
//
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
self
.
actionCell
.
loading
=
false
}
// ----------------------------------
// MARK: - Actions -
//
private
func
createUser
()
{
...
...
@@ -53,7 +63,10 @@ class SignupViewController: UITableViewController {
BUYAccountCredentialItem
(
passwordConfirmation
:
self
.
passwordConfirm
),
])
self
.
actionCell
.
loading
=
true
BUYClient
.
sharedClient
.
createCustomerWithCredentials
(
credentials
)
{
(
customer
,
token
,
error
)
in
self
.
actionCell
.
loading
=
false
print
(
"Customer:
\(
customer
)
, Token:
\(
token
)
, Error:
\(
error
)
"
)
}
}
...
...
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