stepie.ub
1 year ago
21 changed files with 488 additions and 111 deletions
-
23GME Remit.xcodeproj/project.pbxproj
-
6GME Remit/Modules/BeneficiaryDetail/User Interface/View/BeneficiaryDetail.storyboard
-
4GME Remit/Modules/BeneficiaryDetail/User Interface/View/BeneficiaryDetailViewController.swift
-
3GME Remit/Modules/ExchangeRates/User Interface/View/ExchangeRatesViewController.swift
-
53GME Remit/Modules/Home/User Interface/View/Cell/PageIndicatorCollectionViewCell.swift
-
2GME Remit/Modules/Home/User Interface/View/Custom/HomeCarouselView.swift
-
143GME Remit/Modules/Home/User Interface/View/Custom/HomeExchangeRateView.swift
-
137GME Remit/Modules/Home/User Interface/View/Custom/RePageControl.swift
-
2GME Remit/Modules/Home/User Interface/View/HomeViewController.swift
-
4GME Remit/Modules/Main/User Interface/View/MainViewController.swift
-
6GME Remit/Modules/RegisterModules/UserAuthentication/ChooseKycDocumentType/View/ChooseDocTableViewCell.swift
-
22GME Remit/Modules/RegisterModules/UserAuthentication/KYCVerifyStep1/User Interface/View/KYCVerifyStep1.storyboard
-
151GME Remit/Modules/RegisterModules/UserAuthentication/KYCVerifyStep1/User Interface/View/KYCVerifyStep1ViewController.swift
-
2GME Remit/Modules/RegisterModules/UserAuthentication/KYCVerifyStep1/User Interface/Wireframe/KYCVerifyStep1Wireframe.swift
-
14GME Remit/Modules/RegisterModules/UserAuthentication/NewRegister/User Interface/Wireframe/NewRegisterWireframe.swift
-
BINGME Remit/Supported Files/Assets.xcassets/.DS_Store
-
21GME Remit/Supported Files/Assets.xcassets/ic_arrow_right_white.imageset/Contents.json
-
BINGME Remit/Supported Files/Assets.xcassets/ic_arrow_right_white.imageset/long-arrow-pointing-to-the-right.png
-
2GME Remit/Utilities/ExchangeRateCustomView.swift
-
2GME Remit/Utilities/TabBar Helper/CustomItemTabView.swift
-
2GME Remit/Utilities/TabBar Helper/CustomTabBar.swift
@ -0,0 +1,53 @@ |
|||
// |
|||
|
|||
import UIKit |
|||
|
|||
class PageIndicatorCollectionViewCell: UICollectionViewCell { |
|||
|
|||
static let identifier: String = "CarouselCollectionCellID" |
|||
|
|||
let pageControl: CustomPageControl = { |
|||
let view = CustomPageControl(frame: .zero) |
|||
view.backgroundColor = .themeWhite |
|||
view.currentPageIndicatorTintColor = .theme2E89FF |
|||
view.pageIndicatorTintColor = .themeGray2 |
|||
view.translatesAutoresizingMaskIntoConstraints = false |
|||
return view |
|||
}() |
|||
|
|||
var count: Int = 0 { |
|||
didSet { |
|||
pageControl.numberOfPages = count |
|||
setup() |
|||
} |
|||
} |
|||
|
|||
override init(frame: CGRect) { |
|||
super.init(frame: frame) |
|||
setup() |
|||
} |
|||
|
|||
required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } |
|||
|
|||
|
|||
func setup(){ |
|||
let _pageControl = pageControl |
|||
self.backgroundColor = .themeWhite |
|||
self.addSubview(_pageControl) |
|||
_pageControl.centerXAnchor.constraint(equalTo: self.centerXAnchor).isActive = true |
|||
_pageControl.bottomAnchor.constraint(equalTo: self.bottomAnchor, constant: 0).isActive = true |
|||
_pageControl.heightAnchor.constraint(equalToConstant: 30).isActive = true |
|||
} |
|||
|
|||
@objc open dynamic var currentIndex: Int = 0 { |
|||
didSet { |
|||
updateAccessoryViews() |
|||
} |
|||
} |
|||
|
|||
|
|||
func updateAccessoryViews() { |
|||
pageControl.currentPage = currentIndex |
|||
|
|||
} |
|||
} |
@ -0,0 +1,137 @@ |
|||
// |
|||
|
|||
import Foundation |
|||
import UIKit |
|||
|
|||
@IBDesignable |
|||
class ReCustomPageControl: UIControl { |
|||
//MARK:- Properties |
|||
|
|||
private var numberOfDots = [UIView]() { |
|||
didSet{ |
|||
if numberOfDots.count == numberOfPages { |
|||
setupViews() |
|||
} |
|||
} |
|||
} |
|||
|
|||
@IBInspectable var numberOfPages: Int = 0 { |
|||
didSet{ |
|||
|
|||
for tag in 0 ..< numberOfPages { |
|||
let dot = getDotView() |
|||
dot.tag = tag |
|||
dot.backgroundColor = pageIndicatorTintColor |
|||
self.numberOfDots.append(dot) |
|||
} |
|||
} |
|||
} |
|||
|
|||
var currentPage: Int = 0 { |
|||
didSet{ |
|||
onPageControlSwipe() |
|||
} |
|||
} |
|||
|
|||
@IBInspectable var pageIndicatorTintColor: UIColor? = .blue |
|||
@IBInspectable var currentPageIndicatorTintColor: UIColor? = .green |
|||
|
|||
private lazy var stackView = UIStackView.init(frame: self.bounds) |
|||
private lazy var constantSpace = ((stackView.spacing) * CGFloat(numberOfPages - 1) + ((self.bounds.height * 0.45) * CGFloat(numberOfPages)) - self.bounds.width) |
|||
|
|||
|
|||
override var bounds: CGRect { |
|||
didSet{ |
|||
self.numberOfDots.forEach { (dot) in |
|||
self.setupDotAppearance(dot: dot) |
|||
} |
|||
} |
|||
} |
|||
|
|||
//MARK:- Intialisers |
|||
convenience init() { |
|||
self.init(frame: .zero) |
|||
} |
|||
|
|||
func refreshPagerView() { |
|||
numberOfDots = [] |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
init(withNoOfPages pages: Int) { |
|||
self.numberOfPages = pages |
|||
self.currentPage = 0 |
|||
super.init(frame: .zero) |
|||
setupViews() |
|||
} |
|||
|
|||
override init(frame: CGRect) { |
|||
super.init(frame: frame) |
|||
setupViews() |
|||
} |
|||
|
|||
required init?(coder aDecoder: NSCoder) { |
|||
super.init(coder: aDecoder) |
|||
|
|||
} |
|||
private func setupViews() { |
|||
|
|||
self.numberOfDots.forEach { (dot) in |
|||
self.stackView.addArrangedSubview(dot) |
|||
} |
|||
|
|||
stackView.alignment = .center |
|||
stackView.axis = .horizontal |
|||
stackView.distribution = .fillEqually |
|||
stackView.spacing = 8 |
|||
stackView.translatesAutoresizingMaskIntoConstraints = false |
|||
self.addSubview(stackView) |
|||
|
|||
self.addConstraints([ |
|||
stackView.centerXAnchor.constraint(equalTo: self.centerXAnchor), |
|||
stackView.centerYAnchor.constraint(equalTo: self.centerYAnchor), |
|||
stackView.heightAnchor.constraint(equalTo: self.heightAnchor), |
|||
]) |
|||
|
|||
self.numberOfDots.forEach { dot in |
|||
self.addConstraints([ |
|||
dot.centerYAnchor.constraint(equalTo: self.stackView.centerYAnchor), |
|||
dot.widthAnchor.constraint(equalToConstant: 7), |
|||
dot.heightAnchor.constraint(equalToConstant: 7), |
|||
]) |
|||
} |
|||
self.numberOfDots.forEach { dot in |
|||
dot.layer.cornerRadius = dot.bounds.height / 2 |
|||
} |
|||
} |
|||
|
|||
@objc private func onPageControlSwipe() { |
|||
_ = numberOfDots.map { (dot) in |
|||
setupDotAppearance(dot: dot) |
|||
if dot.tag == currentPage { |
|||
UIView.animate(withDuration: 0.2, animations: { |
|||
dot.layer.cornerRadius = dot.bounds.height / 5 |
|||
dot.transform = CGAffineTransform.init(scaleX: 2, y: 1) |
|||
dot.backgroundColor = self.currentPageIndicatorTintColor |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
|
|||
//MARK: Helper methods... |
|||
private func getDotView() -> UIView { |
|||
let dot = UIView() |
|||
dot.translatesAutoresizingMaskIntoConstraints = false |
|||
self.setupDotAppearance(dot: dot) |
|||
return dot |
|||
} |
|||
|
|||
private func setupDotAppearance(dot: UIView) { |
|||
dot.transform = .identity |
|||
dot.layer.cornerRadius = dot.bounds.height / 2 |
|||
dot.layer.masksToBounds = true |
|||
dot.backgroundColor = pageIndicatorTintColor |
|||
} |
|||
} |
@ -0,0 +1,21 @@ |
|||
{ |
|||
"images" : [ |
|||
{ |
|||
"idiom" : "universal", |
|||
"scale" : "1x" |
|||
}, |
|||
{ |
|||
"filename" : "long-arrow-pointing-to-the-right.png", |
|||
"idiom" : "universal", |
|||
"scale" : "2x" |
|||
}, |
|||
{ |
|||
"idiom" : "universal", |
|||
"scale" : "3x" |
|||
} |
|||
], |
|||
"info" : { |
|||
"author" : "xcode", |
|||
"version" : 1 |
|||
} |
|||
} |
After Width: 50 | Height: 50 | Size: 2.1 KiB |
Write
Preview
Loading…
Cancel
Save
Reference in new issue