Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Commit

Permalink
iGap version 0.1.1
Browse files Browse the repository at this point in the history
Using IGProtobufLibrary to version 2.0
UI changes, added Persian font
Startd code migration to swift 4.0
Added QR scanner for easy login
Early implementation of Two Step Verification
Fixed a few bugs
  • Loading branch information
Kayvan Nouri committed Oct 15, 2017
1 parent a9c2d24 commit c130204
Show file tree
Hide file tree
Showing 315 changed files with 9,029 additions and 3,842 deletions.
10 changes: 5 additions & 5 deletions Cartfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ github "MortimerGoro/MGSwipeTableCell"
github "ashleymills/Reachability.swift" ~> 3.0
github "artemkrachulov/AKMaskField.git"
github "krzyzanowskim/CryptoSwift"

github "ninjaprox/NVActivityIndicatorView"

github "RooyeKhat-Media/Gifu" "v2.0.0-b"
github "RooyeKhat-Media/ALCameraViewController" "1.2.7"
github "RooyeKhat-Media/IGProtoBuffLibrary" "build54"
github "RooyeKhat-Media/INSPhotoGallery" "1.1.0-d"
github "RooyeKhat-Media/INSPhotoGallery" "1.1.01"
github "RooyeKhat-Media/Starscream" "2.0.4-a"
github "RooyeKhat-Media/DBAttachmentPickerController" "1.1.4-a"

#development repos
github "RooyeKhat-Media/swift-protobuf" "4c9b588"
github "RooyeKhat-Media/IGProtoBuffLibrary" "18158ab"
23 changes: 12 additions & 11 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
github "KennethTsang/GrowingTextView" "0.2.4"
github "MortimerGoro/MGSwipeTableCell" "1.5.6"
github "ReactiveX/RxSwift" "3.4.1"
github "KennethTsang/GrowingTextView" "0.3.0"
github "MortimerGoro/MGSwipeTableCell" "1.6.1"
github "ReactiveX/RxSwift" "3.6.1"
github "RooyeKhat-Media/ALCameraViewController" "1.2.7"
github "RooyeKhat-Media/DBAttachmentPickerController" "1.1.4-a"
github "RooyeKhat-Media/Gifu" "v2.0.0-b"
github "RooyeKhat-Media/IGProtoBuffLibrary" "build54"
github "RooyeKhat-Media/INSPhotoGallery" "1.1.0-d"
github "RooyeKhat-Media/Protobuf-Swift" "3.0.13-d"
github "RooyeKhat-Media/IGProtoBuffLibrary" "18158ab3c5e15e62e3d7d591d7feb69fd85051d4"
github "RooyeKhat-Media/INSPhotoGallery" "1.1.01"
github "RooyeKhat-Media/Starscream" "2.0.4-a"
github "RxSwiftCommunity/RxRealm" "0.6.0"
github "RooyeKhat-Media/swift-protobuf" "4c9b5889ba4bdc0e314620ddfa3e8885f1a804c7"
github "RxSwiftCommunity/RxRealm" "0.7.2"
github "SnapKit/SnapKit" "3.2.0"
github "TakeScoop/SwiftyRSA" "0.5.0"
github "artemkrachulov/AKMaskField" "v2.0.3"
github "ashleymills/Reachability.swift" "v3"
github "facebook/pop" "1.0.9"
github "ashleymills/Reachability.swift" "v3.0"
github "facebook/pop" "1.0.10"
github "jdg/MBProgressHUD" "1.0.0"
github "krzyzanowskim/CryptoSwift" "0.6.9"
github "realm/realm-cocoa" "v2.7.0"
github "krzyzanowskim/CryptoSwift" "0.7.2"
github "ninjaprox/NVActivityIndicatorView" "4.0.0"
github "realm/realm-cocoa" "v2.10.2"
Empty file modified Fabric.framework/run
100644 → 100755
Empty file.
Empty file modified Fabric.framework/uploadDSYM
100644 → 100755
Empty file.
144 changes: 125 additions & 19 deletions iGap.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ class IGNavigationBar: UINavigationBar, UINavigationBarDelegate {

override func awakeFromNib() {
super.awakeFromNib()
self.tintColor = UIColor.organizationalColor()
self.tintColor = UIColor.white
self.isTranslucent = false
//self.barStyle = .black
self.barTintColor = UIColor.white
self.barTintColor = UIColor.organizationalColor()
self.layer.shadowColor = UIColor.darkGray.cgColor
self.layer.shadowOffset = CGSize(width: 2.0, height: 2.0)
self.layer.shadowRadius = 4.0
Expand All @@ -31,10 +31,10 @@ class IGNavigationBar: UINavigationBar, UINavigationBarDelegate {

override func layoutSubviews() {
super.layoutSubviews()

for items in self.items! {
if items.leftBarButtonItems != nil {

for item in items.leftBarButtonItems! {
item.setBackgroundVerticalPositionAdjustment(-100, for: .default)
item.setBackgroundVerticalPositionAdjustment(-100, for: .compact)
Expand All @@ -49,10 +49,35 @@ class IGNavigationBar: UINavigationBar, UINavigationBarDelegate {
//barButton.imageInsets = UIEdgeInsetsMake(0.0, -20, 50, 0)
//item.imageInsets = UIEdgeInsetsMake(0.0, -20, 50, 0)
}

// super.layoutSubviews()
//
// frame = CGRect(x: frame.origin.x, y: 0, width: frame.size.width, height: 56.0)
//
// // title position (statusbar height / 2)
// setTitleVerticalPositionAdjustment(-10, for: UIBarMetrics.default)
//
// for subview in self.subviews {
// var stringFromClass = NSStringFromClass(subview.classForCoder)
// if stringFromClass.contains("BarBackground") {
// subview.frame = CGRect(x: 0, y: 0, width: self.frame.width, height: 56.0)
// subview.backgroundColor = .yellow
//
// }
//
// stringFromClass = NSStringFromClass(subview.classForCoder)
// if stringFromClass.contains("BarContent") {
//
// subview.frame = CGRect(x: subview.frame.origin.x, y: 20, width: subview.frame.width, height: 56.0)
//
// subview.backgroundColor = UIColor(red: 20/255, green: 20/255, blue: 20/255, alpha: 0.4)
//
// }
// }
}

override func sizeThatFits(_ size: CGSize) -> CGSize {
let newSize :CGSize = CGSize(width: UIScreen.main.bounds.width, height: 56)
return newSize
}
// override func sizeThatFits(_ size: CGSize) -> CGSize {
// let newSize :CGSize = CGSize(width: UIScreen.main.bounds.width, height: 156)
// return newSize
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@

import UIKit

class IGNavigationController: UINavigationController ,UINavigationBarDelegate {
class IGNavigationController: UINavigationController, UINavigationBarDelegate {

override func viewDidLoad() {
super.viewDidLoad()
addShadowToBar()
// addShadowToBar()


// self.setNavigationBarHidden(true, animated: false)
// let customNavigationBar = UINavigationBar(frame: CGRect(x: 0, y: 0, width: self.view.bounds.width, height: 64))
// self.view.addSubview(customNavigationBar)

self.navigationBar.topItem?.backBarButtonItem?.setTitlePositionAdjustment(UIOffset(horizontal: 0, vertical: 50), for: UIBarMetrics.default)
}

Expand All @@ -32,128 +38,129 @@ class IGNavigationController: UINavigationController ,UINavigationBarDelegate {
}


override func viewDidAppear(_ animated: Bool) {
UIApplication.shared.statusBarStyle = .default
// self.navigationBar.topItem?.backBarButtonItem?.backButtonTitlePositionAdjustment(for: UIBarMetrics.compactPrompt)
// self.navigationBar.topItem?.backBarButtonItem?.backButtonBackgroundVerticalPositionAdjustment(for: UIBarMetrics.compactPrompt)
// self.navigationBar.backItem.
let cancelBtn = UIButton()
cancelBtn.frame = CGRect(x: 8, y: 0, width: 60, height: 60)
cancelBtn.backgroundColor = UIColor.yellow
let topLeftbarButtonItem = UIBarButtonItem(customView: cancelBtn)
self.navigationBar.topItem?.backBarButtonItem = topLeftbarButtonItem
}


func addShadowToBar() {
self.navigationBar.layer.shadowColor = UIColor.darkGray.cgColor
self.navigationBar.layer.shadowOffset = CGSize(width: 2.0, height: 2.0)
self.navigationBar.layer.shadowRadius = 4.0
self.navigationBar.layer.shadowOpacity = 0.35
}

func setRightBarButtonItem(rightBarButton : UIButton, rightBarButtonImage:UIImage?=nil){
// if rightBarButtonImage != nil {
// rightBarButton.setImage(rightBarButtonImage, for: UIControlState.normal)
// //set frame
rightBarButton.frame = CGRect(x:0,y: 0,width: 40, height:40)
roundUserImage(rightBarButton)
// }else{
// rightBarButton.setTitle("Done", for: .normal)
// rightBarButton.setTitleColor(UIColor.red, for: .normal)
// rightBarButton.frame = CGRect(x:0,y: 0,width: 60, height:60)
// }
let barButton = UIBarButtonItem(customView: rightBarButton)
self.navigationBar.topItem?.rightBarButtonItem = barButton
}


func roundUserImage(_ Button:UIButton){
Button.layer.borderWidth = 0
Button.layer.masksToBounds = true
let borderUserImageColor = UIColor.organizationalColor()
Button.layer.borderColor = borderUserImageColor.cgColor
Button.layer.cornerRadius = Button.frame.size.height/2
Button.clipsToBounds = true
}

func setTitleView(_ titleView : UIView){
titleView.backgroundColor = UIColor.yellow
self.navigationItem.titleView = titleView
self.navigationBar.topItem?.titleView = titleView


}


func setCenterView() {
let titleView = UIView(frame: CGRect(x: 0, y: 0, width: 150, height: 45))
let nameLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 150, height: 21))
nameLabel.text = "John Smith"
nameLabel.textAlignment = .center
nameLabel.font = UIFont.boldSystemFont(ofSize: 16)
let lastSeenStatusLabel = UILabel(frame: CGRect(x: 0, y: 22, width: 150, height: 21))
lastSeenStatusLabel.text = "Online"
lastSeenStatusLabel.textColor = UIColor.organizationalColor()
lastSeenStatusLabel.textAlignment = .center
lastSeenStatusLabel.font = UIFont.boldSystemFont(ofSize: 9)
titleView.addSubview(nameLabel)
titleView.addSubview(lastSeenStatusLabel)
self.navigationBar.topItem?.titleView = titleView
}

func getHightOfNavigationBar()->(CGFloat) {
let navBarHeight = self.navigationBar.frame.size.height
return navBarHeight
}

func connectingTitleView() {
let connectingTitleView = UIView(frame: CGRect(x: 0, y: 0, width: 150, height: 30))
let activityIndicator: UIActivityIndicatorView = UIActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 30, height: 30))
connectingTitleView.addSubview(activityIndicator)
activityIndicator.startAnimating()
let textLabel = UILabel(frame: CGRect(x: 30, y: 5, width: 100, height: 21))
textLabel.text = "Connecting.."
textLabel.textColor = UIColor.black
connectingTitleView.addSubview(textLabel)
activityIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyle.gray
self.navigationBar.topItem?.titleView = connectingTitleView

}
func updatingTitleView(){
let updatingTitleView = UIView(frame: CGRect(x: 0, y: 0, width: 150, height: 30))
let activityIndicator: UIActivityIndicatorView = UIActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 30, height: 30))
updatingTitleView.addSubview(activityIndicator)
activityIndicator.startAnimating()
let textLabel = UILabel(frame: CGRect(x: 30, y: 5, width: 100, height: 21))
textLabel.text = "Updating.."
textLabel.textColor = UIColor.black
updatingTitleView.addSubview(textLabel)
activityIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyle.gray
self.navigationBar.topItem?.titleView = updatingTitleView
}
// override func viewDidAppear(_ animated: Bool) {
// UIApplication.shared.statusBarStyle = .default
// // self.navigationBar.topItem?.backBarButtonItem?.backButtonTitlePositionAdjustment(for: UIBarMetrics.compactPrompt)
// // self.navigationBar.topItem?.backBarButtonItem?.backButtonBackgroundVerticalPositionAdjustment(for: UIBarMetrics.compactPrompt)
// // self.navigationBar.backItem.
// let cancelBtn = UIButton()
// cancelBtn.frame = CGRect(x: 8, y: 0, width: 60, height: 60)
// cancelBtn.backgroundColor = UIColor.yellow
// let topLeftbarButtonItem = UIBarButtonItem(customView: cancelBtn)
// self.navigationBar.topItem?.backBarButtonItem = topLeftbarButtonItem
// }


// func addShadowToBar() {
// self.navigationBar.layer.shadowColor = UIColor.darkGray.cgColor
// self.navigationBar.layer.shadowOffset = CGSize(width: 2.0, height: 2.0)
// self.navigationBar.layer.shadowRadius = 4.0
// self.navigationBar.layer.shadowOpacity = 0.35
// }

// func setRightBarButtonItem(rightBarButton : UIButton, rightBarButtonImage:UIImage?=nil){
//// if rightBarButtonImage != nil {
//// rightBarButton.setImage(rightBarButtonImage, for: UIControlState.normal)
//// //set frame
// rightBarButton.frame = CGRect(x:0,y: 0,width: 40, height:40)
// roundUserImage(rightBarButton)
//// }else{
//// rightBarButton.setTitle("Done", for: .normal)
//// rightBarButton.setTitleColor(UIColor.red, for: .normal)
//// rightBarButton.frame = CGRect(x:0,y: 0,width: 60, height:60)
//// }
// let barButton = UIBarButtonItem(customView: rightBarButton)
// self.navigationBar.topItem?.rightBarButtonItem = barButton
// }
//
//
// func roundUserImage(_ Button:UIButton){
// Button.layer.borderWidth = 0
// Button.layer.masksToBounds = true
// let borderUserImageColor = UIColor.organizationalColor()
// Button.layer.borderColor = borderUserImageColor.cgColor
// Button.layer.cornerRadius = Button.frame.size.height/2
// Button.clipsToBounds = true
// }
//
// func setTitleView(_ titleView : UIView){
// titleView.backgroundColor = UIColor.yellow
// self.navigationItem.titleView = titleView
// self.navigationBar.topItem?.titleView = titleView
//
//
// }


// func setCenterView() {
// let titleView = UIView(frame: CGRect(x: 0, y: 0, width: 150, height: 45))
// let nameLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 150, height: 21))
// nameLabel.text = "John Smith"
// nameLabel.textAlignment = .center
// nameLabel.font = UIFont.boldSystemFont(ofSize: 16)
// let lastSeenStatusLabel = UILabel(frame: CGRect(x: 0, y: 22, width: 150, height: 21))
// lastSeenStatusLabel.text = "Online"
// lastSeenStatusLabel.textColor = UIColor.organizationalColor()
// lastSeenStatusLabel.textAlignment = .center
// lastSeenStatusLabel.font = UIFont.boldSystemFont(ofSize: 9)
// titleView.addSubview(nameLabel)
// titleView.addSubview(lastSeenStatusLabel)
// self.navigationBar.topItem?.titleView = titleView
// }

// func getHightOfNavigationBar()->(CGFloat) {
// let navBarHeight = self.navigationBar.frame.size.height
// return navBarHeight
// }

// func connectingTitleView() {
// let connectingTitleView = UIView(frame: CGRect(x: 0, y: 0, width: 150, height: 30))
// let activityIndicator: UIActivityIndicatorView = UIActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 30, height: 30))
// activityIndicator.tintColor = UIColor.white
// connectingTitleView.addSubview(activityIndicator)
// activityIndicator.startAnimating()
// let textLabel = UILabel(frame: CGRect(x: 30, y: 5, width: 100, height: 21))
// textLabel.text = "Connecting.."
// textLabel.textColor = UIColor.white
// connectingTitleView.addSubview(textLabel)
// activityIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyle.gray
// self.navigationBar.topItem?.titleView = connectingTitleView
//
// }
// func updatingTitleView(){
// let updatingTitleView = UIView(frame: CGRect(x: 0, y: 0, width: 150, height: 30))
// let activityIndicator: UIActivityIndicatorView = UIActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 30, height: 30))
// updatingTitleView.addSubview(activityIndicator)
// activityIndicator.startAnimating()
// let textLabel = UILabel(frame: CGRect(x: 30, y: 5, width: 100, height: 21))
// textLabel.text = "Updating.."
// textLabel.textColor = UIColor.black
// updatingTitleView.addSubview(textLabel)
// activityIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyle.gray
// self.navigationBar.topItem?.titleView = updatingTitleView
// }


func isTyping(){
let titleView = UIView(frame: CGRect(x: 0, y: 0, width: 150, height: 45))
let nameLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 150, height: 21))
nameLabel.text = "John Smith"
nameLabel.textAlignment = .center
nameLabel.font = UIFont.boldSystemFont(ofSize: 16)
let dotsLoader = IGDotActivityIndicator(frame: CGRect(x: 0, y: 0, width: 40, height: 21))
let isTyping = UITextField(frame: CGRect(x: 20, y: 22, width: 150, height: 21))
isTyping.text = "is typing"
isTyping.font = UIFont.systemFont(ofSize: 14)
//isTyping.textAlignment = .center
isTyping.leftView = dotsLoader
isTyping.leftViewMode = UITextFieldViewMode.always
isTyping.textColor = UIColor.organizationalColor()
isTyping.isUserInteractionEnabled = false
titleView.addSubview(nameLabel)
//titleView.addSubview(dotsLoader)
titleView.addSubview(isTyping)
self.navigationBar.topItem?.titleView = titleView


}
// func isTyping(){
// let titleView = UIView(frame: CGRect(x: 0, y: 0, width: 150, height: 45))
// let nameLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 150, height: 21))
// nameLabel.text = "John Smith"
// nameLabel.textAlignment = .center
// nameLabel.font = UIFont.boldSystemFont(ofSize: 16)
// let dotsLoader = IGDotActivityIndicator(frame: CGRect(x: 0, y: 0, width: 40, height: 21))
// let isTyping = UITextField(frame: CGRect(x: 20, y: 22, width: 150, height: 21))
// isTyping.text = "is typing"
// isTyping.font = UIFont.systemFont(ofSize: 14)
// //isTyping.textAlignment = .center
// isTyping.leftView = dotsLoader
// isTyping.leftViewMode = UITextFieldViewMode.always
// isTyping.textColor = UIColor.organizationalColor()
// isTyping.isUserInteractionEnabled = false
// titleView.addSubview(nameLabel)
// //titleView.addSubview(dotsLoader)
// titleView.addSubview(isTyping)
// self.navigationBar.topItem?.titleView = titleView
//
//
// }
}
Loading

0 comments on commit c130204

Please sign in to comment.