Displaying activity indicator to the right of tableview row
My tableview is having Disclosure indicator as an accessory item. The didSelectItem()
call of this tableview cell performs an api call on background. So the view will need to wait until the response to show next page. I have to provide an activity indicator to the position of disclosure indicator. how it is possible like in ios settings page
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// Returns the cell value for each index
let cell = tableView.dequeueReusableCell(withIdentifier: TenantCell.identifier, for: indexPath) as! TenantCell
cell.populate(with: tenantList[indexPath.row])
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
Api.domain = tenantList[indexPath.row].url!
sharedAFManager.getJsonData(api: Api.theme, completionHandler: { (response, statusCode) in
if let theme = response {
Api.logo = theme["logo"].stringValue
Constants.passwordRegx = theme["passwordRegex"].stringValue
self.performSegue(withIdentifier: Segue.login, sender: indexPath.row)
}
})
}
/// UITableview cell populating tenant informations
class TenantCell: UITableViewCell {
@IBOutlet weak var tenantImage: UIImageView!
@IBOutlet weak var tenantNameLabel: UILabel!
@IBOutlet weak var tenantUrlLabel: UILabel!
func populate(with tenant: Tenant) {
tenantNameLabel?.text = tenant.name
tenantUrlLabel?.text = tenant.url
tenantImage.image = UIImage(named: "breifcase")
}
}
swift uitableview uiactivityindicatorview
add a comment |
My tableview is having Disclosure indicator as an accessory item. The didSelectItem()
call of this tableview cell performs an api call on background. So the view will need to wait until the response to show next page. I have to provide an activity indicator to the position of disclosure indicator. how it is possible like in ios settings page
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// Returns the cell value for each index
let cell = tableView.dequeueReusableCell(withIdentifier: TenantCell.identifier, for: indexPath) as! TenantCell
cell.populate(with: tenantList[indexPath.row])
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
Api.domain = tenantList[indexPath.row].url!
sharedAFManager.getJsonData(api: Api.theme, completionHandler: { (response, statusCode) in
if let theme = response {
Api.logo = theme["logo"].stringValue
Constants.passwordRegx = theme["passwordRegex"].stringValue
self.performSegue(withIdentifier: Segue.login, sender: indexPath.row)
}
})
}
/// UITableview cell populating tenant informations
class TenantCell: UITableViewCell {
@IBOutlet weak var tenantImage: UIImageView!
@IBOutlet weak var tenantNameLabel: UILabel!
@IBOutlet weak var tenantUrlLabel: UILabel!
func populate(with tenant: Tenant) {
tenantNameLabel?.text = tenant.name
tenantUrlLabel?.text = tenant.url
tenantImage.image = UIImage(named: "breifcase")
}
}
swift uitableview uiactivityindicatorview
where iscellForRowAt
method code? plz upload your full code
– Pratik Prajapati
Jan 1 at 6:40
AddedcellForRowAt
method to the code sample
– Vaisakh KP
Jan 1 at 6:50
add a comment |
My tableview is having Disclosure indicator as an accessory item. The didSelectItem()
call of this tableview cell performs an api call on background. So the view will need to wait until the response to show next page. I have to provide an activity indicator to the position of disclosure indicator. how it is possible like in ios settings page
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// Returns the cell value for each index
let cell = tableView.dequeueReusableCell(withIdentifier: TenantCell.identifier, for: indexPath) as! TenantCell
cell.populate(with: tenantList[indexPath.row])
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
Api.domain = tenantList[indexPath.row].url!
sharedAFManager.getJsonData(api: Api.theme, completionHandler: { (response, statusCode) in
if let theme = response {
Api.logo = theme["logo"].stringValue
Constants.passwordRegx = theme["passwordRegex"].stringValue
self.performSegue(withIdentifier: Segue.login, sender: indexPath.row)
}
})
}
/// UITableview cell populating tenant informations
class TenantCell: UITableViewCell {
@IBOutlet weak var tenantImage: UIImageView!
@IBOutlet weak var tenantNameLabel: UILabel!
@IBOutlet weak var tenantUrlLabel: UILabel!
func populate(with tenant: Tenant) {
tenantNameLabel?.text = tenant.name
tenantUrlLabel?.text = tenant.url
tenantImage.image = UIImage(named: "breifcase")
}
}
swift uitableview uiactivityindicatorview
My tableview is having Disclosure indicator as an accessory item. The didSelectItem()
call of this tableview cell performs an api call on background. So the view will need to wait until the response to show next page. I have to provide an activity indicator to the position of disclosure indicator. how it is possible like in ios settings page
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// Returns the cell value for each index
let cell = tableView.dequeueReusableCell(withIdentifier: TenantCell.identifier, for: indexPath) as! TenantCell
cell.populate(with: tenantList[indexPath.row])
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
Api.domain = tenantList[indexPath.row].url!
sharedAFManager.getJsonData(api: Api.theme, completionHandler: { (response, statusCode) in
if let theme = response {
Api.logo = theme["logo"].stringValue
Constants.passwordRegx = theme["passwordRegex"].stringValue
self.performSegue(withIdentifier: Segue.login, sender: indexPath.row)
}
})
}
/// UITableview cell populating tenant informations
class TenantCell: UITableViewCell {
@IBOutlet weak var tenantImage: UIImageView!
@IBOutlet weak var tenantNameLabel: UILabel!
@IBOutlet weak var tenantUrlLabel: UILabel!
func populate(with tenant: Tenant) {
tenantNameLabel?.text = tenant.name
tenantUrlLabel?.text = tenant.url
tenantImage.image = UIImage(named: "breifcase")
}
}
swift uitableview uiactivityindicatorview
swift uitableview uiactivityindicatorview
edited Jan 16 at 10:05
d.felber
2,87011025
2,87011025
asked Jan 1 at 6:01
Vaisakh KPVaisakh KP
302317
302317
where iscellForRowAt
method code? plz upload your full code
– Pratik Prajapati
Jan 1 at 6:40
AddedcellForRowAt
method to the code sample
– Vaisakh KP
Jan 1 at 6:50
add a comment |
where iscellForRowAt
method code? plz upload your full code
– Pratik Prajapati
Jan 1 at 6:40
AddedcellForRowAt
method to the code sample
– Vaisakh KP
Jan 1 at 6:50
where is
cellForRowAt
method code? plz upload your full code– Pratik Prajapati
Jan 1 at 6:40
where is
cellForRowAt
method code? plz upload your full code– Pratik Prajapati
Jan 1 at 6:40
Added
cellForRowAt
method to the code sample– Vaisakh KP
Jan 1 at 6:50
Added
cellForRowAt
method to the code sample– Vaisakh KP
Jan 1 at 6:50
add a comment |
3 Answers
3
active
oldest
votes
Please write in cellForRowAt
Method :
cell.accessoryType = .disclosureIndicator
Then in didSelectRowAt
Method please write
guard let cell : TenantCell = (tableView.cellForRow(at: indexPath) as! TenantCell) else {
return
}
cell.accessoryView = activityIndi
activityIndi. startAnimating()
After geting the response
activityIndi. stopAnimating()
It may helps you. Thank you
Please press the up button for vote my answer. Thank you
– Sanjukta
Jan 18 at 9:57
add a comment |
Add Activity Indicator in TableViewCell
As per your required
class TenantCell: UITableViewCell {
@IBOutlet weak var tenantImage: UIImageView!
@IBOutlet weak var tenantNameLabel: UILabel!
@IBOutlet weak var tenantUrlLabel: UILabel!
@IBOutlet weak var activityIndi: UIActivityIndicatorView!
func populate(with tenant: Tenant) {
tenantNameLabel?.text = tenant.name
tenantUrlLabel?.text = tenant.url
tenantImage.image = UIImage(named: "breifcase")
if tenant.isLoaderShow{
activityIndi.startAnimating()
}else{
activityIndi.stopAnimating()
}
Add one Bool
Variable to your Tenant Model isLoaderShow
and Change as per api completion and reload the tableView
or reload tableViewCell
Sorry this doesn't full-fill my requirement. as i need to show the activity indicator in place of Disclosure indicator on loading like in my referral image
– Vaisakh KP
Jan 1 at 8:17
Sorry this doesn't full-fill my requirement. as i need to show the activity indicator in place of Disclosure indicator on loading.
– Vaisakh KP
Jan 1 at 8:17
1
Yes, you can achieve this using Hide and Show Disclosure indicator as per api completion
– Kaushik Makwana
Jan 1 at 8:21
add a comment |
Place right Arrow image and activity indicator in your
tableviewCell
first. (Default
right_Arrow_image.isHidden = false and indicator.isHidden = true
)in
didSelectRowAt
method hideright_Arrow_image.isHidden = true
andindicator.isHidden = false
Then call your
webservice
and after getting response Again set it as first step and move to the next screen
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53993340%2fdisplaying-activity-indicator-to-the-right-of-tableview-row%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Please write in cellForRowAt
Method :
cell.accessoryType = .disclosureIndicator
Then in didSelectRowAt
Method please write
guard let cell : TenantCell = (tableView.cellForRow(at: indexPath) as! TenantCell) else {
return
}
cell.accessoryView = activityIndi
activityIndi. startAnimating()
After geting the response
activityIndi. stopAnimating()
It may helps you. Thank you
Please press the up button for vote my answer. Thank you
– Sanjukta
Jan 18 at 9:57
add a comment |
Please write in cellForRowAt
Method :
cell.accessoryType = .disclosureIndicator
Then in didSelectRowAt
Method please write
guard let cell : TenantCell = (tableView.cellForRow(at: indexPath) as! TenantCell) else {
return
}
cell.accessoryView = activityIndi
activityIndi. startAnimating()
After geting the response
activityIndi. stopAnimating()
It may helps you. Thank you
Please press the up button for vote my answer. Thank you
– Sanjukta
Jan 18 at 9:57
add a comment |
Please write in cellForRowAt
Method :
cell.accessoryType = .disclosureIndicator
Then in didSelectRowAt
Method please write
guard let cell : TenantCell = (tableView.cellForRow(at: indexPath) as! TenantCell) else {
return
}
cell.accessoryView = activityIndi
activityIndi. startAnimating()
After geting the response
activityIndi. stopAnimating()
It may helps you. Thank you
Please write in cellForRowAt
Method :
cell.accessoryType = .disclosureIndicator
Then in didSelectRowAt
Method please write
guard let cell : TenantCell = (tableView.cellForRow(at: indexPath) as! TenantCell) else {
return
}
cell.accessoryView = activityIndi
activityIndi. startAnimating()
After geting the response
activityIndi. stopAnimating()
It may helps you. Thank you
answered Jan 7 at 10:11
SanjuktaSanjukta
900315
900315
Please press the up button for vote my answer. Thank you
– Sanjukta
Jan 18 at 9:57
add a comment |
Please press the up button for vote my answer. Thank you
– Sanjukta
Jan 18 at 9:57
Please press the up button for vote my answer. Thank you
– Sanjukta
Jan 18 at 9:57
Please press the up button for vote my answer. Thank you
– Sanjukta
Jan 18 at 9:57
add a comment |
Add Activity Indicator in TableViewCell
As per your required
class TenantCell: UITableViewCell {
@IBOutlet weak var tenantImage: UIImageView!
@IBOutlet weak var tenantNameLabel: UILabel!
@IBOutlet weak var tenantUrlLabel: UILabel!
@IBOutlet weak var activityIndi: UIActivityIndicatorView!
func populate(with tenant: Tenant) {
tenantNameLabel?.text = tenant.name
tenantUrlLabel?.text = tenant.url
tenantImage.image = UIImage(named: "breifcase")
if tenant.isLoaderShow{
activityIndi.startAnimating()
}else{
activityIndi.stopAnimating()
}
Add one Bool
Variable to your Tenant Model isLoaderShow
and Change as per api completion and reload the tableView
or reload tableViewCell
Sorry this doesn't full-fill my requirement. as i need to show the activity indicator in place of Disclosure indicator on loading like in my referral image
– Vaisakh KP
Jan 1 at 8:17
Sorry this doesn't full-fill my requirement. as i need to show the activity indicator in place of Disclosure indicator on loading.
– Vaisakh KP
Jan 1 at 8:17
1
Yes, you can achieve this using Hide and Show Disclosure indicator as per api completion
– Kaushik Makwana
Jan 1 at 8:21
add a comment |
Add Activity Indicator in TableViewCell
As per your required
class TenantCell: UITableViewCell {
@IBOutlet weak var tenantImage: UIImageView!
@IBOutlet weak var tenantNameLabel: UILabel!
@IBOutlet weak var tenantUrlLabel: UILabel!
@IBOutlet weak var activityIndi: UIActivityIndicatorView!
func populate(with tenant: Tenant) {
tenantNameLabel?.text = tenant.name
tenantUrlLabel?.text = tenant.url
tenantImage.image = UIImage(named: "breifcase")
if tenant.isLoaderShow{
activityIndi.startAnimating()
}else{
activityIndi.stopAnimating()
}
Add one Bool
Variable to your Tenant Model isLoaderShow
and Change as per api completion and reload the tableView
or reload tableViewCell
Sorry this doesn't full-fill my requirement. as i need to show the activity indicator in place of Disclosure indicator on loading like in my referral image
– Vaisakh KP
Jan 1 at 8:17
Sorry this doesn't full-fill my requirement. as i need to show the activity indicator in place of Disclosure indicator on loading.
– Vaisakh KP
Jan 1 at 8:17
1
Yes, you can achieve this using Hide and Show Disclosure indicator as per api completion
– Kaushik Makwana
Jan 1 at 8:21
add a comment |
Add Activity Indicator in TableViewCell
As per your required
class TenantCell: UITableViewCell {
@IBOutlet weak var tenantImage: UIImageView!
@IBOutlet weak var tenantNameLabel: UILabel!
@IBOutlet weak var tenantUrlLabel: UILabel!
@IBOutlet weak var activityIndi: UIActivityIndicatorView!
func populate(with tenant: Tenant) {
tenantNameLabel?.text = tenant.name
tenantUrlLabel?.text = tenant.url
tenantImage.image = UIImage(named: "breifcase")
if tenant.isLoaderShow{
activityIndi.startAnimating()
}else{
activityIndi.stopAnimating()
}
Add one Bool
Variable to your Tenant Model isLoaderShow
and Change as per api completion and reload the tableView
or reload tableViewCell
Add Activity Indicator in TableViewCell
As per your required
class TenantCell: UITableViewCell {
@IBOutlet weak var tenantImage: UIImageView!
@IBOutlet weak var tenantNameLabel: UILabel!
@IBOutlet weak var tenantUrlLabel: UILabel!
@IBOutlet weak var activityIndi: UIActivityIndicatorView!
func populate(with tenant: Tenant) {
tenantNameLabel?.text = tenant.name
tenantUrlLabel?.text = tenant.url
tenantImage.image = UIImage(named: "breifcase")
if tenant.isLoaderShow{
activityIndi.startAnimating()
}else{
activityIndi.stopAnimating()
}
Add one Bool
Variable to your Tenant Model isLoaderShow
and Change as per api completion and reload the tableView
or reload tableViewCell
edited Jan 1 at 7:29
answered Jan 1 at 7:21
Kaushik MakwanaKaushik Makwana
854422
854422
Sorry this doesn't full-fill my requirement. as i need to show the activity indicator in place of Disclosure indicator on loading like in my referral image
– Vaisakh KP
Jan 1 at 8:17
Sorry this doesn't full-fill my requirement. as i need to show the activity indicator in place of Disclosure indicator on loading.
– Vaisakh KP
Jan 1 at 8:17
1
Yes, you can achieve this using Hide and Show Disclosure indicator as per api completion
– Kaushik Makwana
Jan 1 at 8:21
add a comment |
Sorry this doesn't full-fill my requirement. as i need to show the activity indicator in place of Disclosure indicator on loading like in my referral image
– Vaisakh KP
Jan 1 at 8:17
Sorry this doesn't full-fill my requirement. as i need to show the activity indicator in place of Disclosure indicator on loading.
– Vaisakh KP
Jan 1 at 8:17
1
Yes, you can achieve this using Hide and Show Disclosure indicator as per api completion
– Kaushik Makwana
Jan 1 at 8:21
Sorry this doesn't full-fill my requirement. as i need to show the activity indicator in place of Disclosure indicator on loading like in my referral image
– Vaisakh KP
Jan 1 at 8:17
Sorry this doesn't full-fill my requirement. as i need to show the activity indicator in place of Disclosure indicator on loading like in my referral image
– Vaisakh KP
Jan 1 at 8:17
Sorry this doesn't full-fill my requirement. as i need to show the activity indicator in place of Disclosure indicator on loading.
– Vaisakh KP
Jan 1 at 8:17
Sorry this doesn't full-fill my requirement. as i need to show the activity indicator in place of Disclosure indicator on loading.
– Vaisakh KP
Jan 1 at 8:17
1
1
Yes, you can achieve this using Hide and Show Disclosure indicator as per api completion
– Kaushik Makwana
Jan 1 at 8:21
Yes, you can achieve this using Hide and Show Disclosure indicator as per api completion
– Kaushik Makwana
Jan 1 at 8:21
add a comment |
Place right Arrow image and activity indicator in your
tableviewCell
first. (Default
right_Arrow_image.isHidden = false and indicator.isHidden = true
)in
didSelectRowAt
method hideright_Arrow_image.isHidden = true
andindicator.isHidden = false
Then call your
webservice
and after getting response Again set it as first step and move to the next screen
add a comment |
Place right Arrow image and activity indicator in your
tableviewCell
first. (Default
right_Arrow_image.isHidden = false and indicator.isHidden = true
)in
didSelectRowAt
method hideright_Arrow_image.isHidden = true
andindicator.isHidden = false
Then call your
webservice
and after getting response Again set it as first step and move to the next screen
add a comment |
Place right Arrow image and activity indicator in your
tableviewCell
first. (Default
right_Arrow_image.isHidden = false and indicator.isHidden = true
)in
didSelectRowAt
method hideright_Arrow_image.isHidden = true
andindicator.isHidden = false
Then call your
webservice
and after getting response Again set it as first step and move to the next screen
Place right Arrow image and activity indicator in your
tableviewCell
first. (Default
right_Arrow_image.isHidden = false and indicator.isHidden = true
)in
didSelectRowAt
method hideright_Arrow_image.isHidden = true
andindicator.isHidden = false
Then call your
webservice
and after getting response Again set it as first step and move to the next screen
edited Jan 18 at 7:41
Kaushik Makwana
854422
854422
answered Jan 1 at 9:02
PunitPunit
829310
829310
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53993340%2fdisplaying-activity-indicator-to-the-right-of-tableview-row%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
where is
cellForRowAt
method code? plz upload your full code– Pratik Prajapati
Jan 1 at 6:40
Added
cellForRowAt
method to the code sample– Vaisakh KP
Jan 1 at 6:50