Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit 26e7de7

Browse files
Merge pull request #597 from nikola-milicevic/feature/search-table-view-cell-loader
Feature/SearchTableViewCell loading indicator
2 parents 6a463a8 + 00f2564 commit 26e7de7

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

WordPressAuthenticator.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "WordPressAuthenticator"
3-
s.version = "1.38.0-beta.1"
3+
s.version = "1.38.0-beta.2"
44

55
s.summary = "WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps."
66
s.description = <<-DESC

WordPressAuthenticator/UI/SearchTableViewCell.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,25 @@ extension SearchTableViewCell: UITextFieldDelegate {
7373
return false
7474
}
7575
}
76+
77+
// MARK: - Loader
78+
//
79+
extension SearchTableViewCell {
80+
func showLoader() {
81+
guard let leftView = textField.leftView else { return }
82+
let spinner = UIActivityIndicatorView(frame: leftView.frame)
83+
addSubview(spinner)
84+
spinner.startAnimating()
85+
86+
textField.leftView?.alpha = 0
87+
}
88+
89+
func hideLoader() {
90+
for subview in subviews where subview is UIActivityIndicatorView {
91+
subview.removeFromSuperview()
92+
break
93+
}
94+
95+
textField.leftView?.alpha = 1
96+
}
97+
}

0 commit comments

Comments
 (0)