Skip to content

Commit b34cc9f

Browse files
author
Athul Sai
committed
Added option to set underline color from storyboard, fixed copyright message and fixed access levels
1 parent 7bf7af8 commit b34cc9f

8 files changed

Lines changed: 31 additions & 25 deletions

File tree

Example/KWVerificationCodeView.xcodeproj/project.pbxproj

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,10 @@
215215
TargetAttributes = {
216216
607FACCF1AFB9204008FA782 = {
217217
CreatedOnToolsVersion = 6.3.1;
218-
DevelopmentTeam = MJQV7AA4JY;
219218
LastSwiftMigration = 0820;
220219
};
221220
607FACE41AFB9204008FA782 = {
222221
CreatedOnToolsVersion = 6.3.1;
223-
DevelopmentTeam = MJQV7AA4JY;
224222
LastSwiftMigration = 0820;
225223
TestTargetID = 607FACCF1AFB9204008FA782;
226224
};
@@ -499,7 +497,7 @@
499497
buildSettings = {
500498
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
501499
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
502-
DEVELOPMENT_TEAM = MJQV7AA4JY;
500+
DEVELOPMENT_TEAM = "";
503501
INFOPLIST_FILE = KWVerificationCodeView/Info.plist;
504502
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
505503
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -517,7 +515,7 @@
517515
buildSettings = {
518516
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
519517
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
520-
DEVELOPMENT_TEAM = MJQV7AA4JY;
518+
DEVELOPMENT_TEAM = "";
521519
INFOPLIST_FILE = KWVerificationCodeView/Info.plist;
522520
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
523521
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -533,7 +531,7 @@
533531
isa = XCBuildConfiguration;
534532
baseConfigurationReference = 423112B5C6F551741EC3F015 /* Pods-KWVerificationCodeView_Tests.debug.xcconfig */;
535533
buildSettings = {
536-
DEVELOPMENT_TEAM = MJQV7AA4JY;
534+
DEVELOPMENT_TEAM = "";
537535
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
538536
GCC_PREPROCESSOR_DEFINITIONS = (
539537
"DEBUG=1",
@@ -551,7 +549,7 @@
551549
isa = XCBuildConfiguration;
552550
baseConfigurationReference = 8F723ADDC751FC9CC3C9BE34 /* Pods-KWVerificationCodeView_Tests.release.xcconfig */;
553551
buildSettings = {
554-
DEVELOPMENT_TEAM = MJQV7AA4JY;
552+
DEVELOPMENT_TEAM = "";
555553
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
556554
INFOPLIST_FILE = Tests/Info.plist;
557555
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";

Example/KWVerificationCodeView/AppDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// AppDelegate.swift
33
// KWVerificationCodeView
44
//
5-
// Created by Athul Sai on 01/10/2017.
6-
// Copyright (c) 2017 Keep Works. All rights reserved.
5+
// Created by KeepWorks on 01/10/2017.
6+
// Copyright (c) 2017 KeepWorks Technologies Pvt Ltd. All rights reserved.
77
//
88

99
import UIKit

Example/KWVerificationCodeView/VerificationCodeViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// VerificationCodeViewController.swift
33
// KWVerificationCodeView
44
//
5-
// Created by Athul Sai on 01/10/2017.
6-
// Copyright (c) 2017 Keep Works. All rights reserved.
5+
// Created by KeepWorks on 01/10/2017.
6+
// Copyright (c) 2017 KeepWorks Technologies Pvt Ltd. All rights reserved.
77
//
88

99
import UIKit

KWVerificationCodeView/Classes/Extensions/StringExtension.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// StringExtension.swift
33
// Pods
44
//
5-
// Created by Pavan Kotesh on 5/27/16.
6-
// Copyright © 2016 KeepWorks. All rights reserved.
5+
// Created by KeepWorks on 5/27/16.
6+
// Copyright © 2017 KeepWorks Technologies Pvt Ltd. All rights reserved.
77
//
88

99
import UIKit

KWVerificationCodeView/Classes/Extensions/UIViewExtension.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// UIViewExtension.swift
33
// Pods
44
//
5-
// Created by Pavan Kotesh on 5/27/16.
6-
// Copyright © 2016 KeepWorks. All rights reserved.
5+
// Created by KeepWorks on 5/27/16.
6+
// Copyright © 2017 KeepWorks Technologies Pvt Ltd. All rights reserved.
77
//
88

99
import UIKit

KWVerificationCodeView/Classes/KWVerificationCodeView.swift

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// KWVerificationCodeView.swift
33
// Pods
44
//
5-
// Created by Athul Sai on 11/01/17.
6-
// Copyright © 2017 KeepWorks. All rights reserved.
5+
// Created by KeepWorks on 11/01/17.
6+
// Copyright © 2017 KeepWorks Technologies Pvt Ltd. All rights reserved.
77
//
88

99
import UIKit
@@ -13,14 +13,22 @@ public protocol KWVerificationCodeDelegate: class {
1313
func moveToPrevious(_ verificationCodeView: KWVerificationCodeView, oldCode: String)
1414
}
1515

16-
open class KWVerificationCodeView: UIView {
16+
17+
@IBDesignable open class KWVerificationCodeView: UIView {
1718

1819
// MARK: - Constants
1920
static let maxCharactersLength = 1
2021

22+
// MARK: - IBInspectables
23+
@IBInspectable open var underlineColor: UIColor = UIColor.darkGray {
24+
didSet {
25+
underlineView.backgroundColor = self.underlineColor.withAlphaComponent(0.3)
26+
}
27+
}
28+
2129
// MARK: - IBOutlets
22-
@IBOutlet public var numberTextField: UITextField!
23-
@IBOutlet public var underlineView: UIView!
30+
@IBOutlet public weak var numberTextField: UITextField!
31+
@IBOutlet public weak var underlineView: UIView!
2432

2533
// MARK: - Variables
2634
weak public var delegate: KWVerificationCodeDelegate?
@@ -45,18 +53,18 @@ open class KWVerificationCodeView: UIView {
4553
}
4654

4755
// MARK: - Public Methods
48-
open func activate() {
56+
public func activate() {
4957
numberTextField.becomeFirstResponder()
5058
if numberTextField.text?.characters.count == 0 {
5159
numberTextField.text = " "
5260
}
5361
}
5462

55-
open func deactivate() {
63+
public func deactivate() {
5664
numberTextField.resignFirstResponder()
5765
}
5866

59-
open func reset() {
67+
public func reset() {
6068
numberTextField.text = " "
6169
updateUnderline()
6270
}
@@ -69,7 +77,7 @@ open class KWVerificationCodeView: UIView {
6977
}
7078

7179
fileprivate func updateUnderline() {
72-
underlineView.backgroundColor = numberTextField.text?.trim() != "" ? UIColor.darkGray : UIColor.darkGray.withAlphaComponent(0.3)
80+
underlineView.backgroundColor = numberTextField.text?.trim() != "" ? self.underlineColor : self.underlineColor.withAlphaComponent(0.3)
7381
}
7482
}
7583

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2017 Keep Works <ios@keepworks.com>
1+
Copyright (c) 2017 KeepWorks Technologies Pvt Ltd <ios@keepworks.com>
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pod "KWVerificationCodeView"
2222

2323
## Author
2424

25-
Keep Works, ios@keepworks.com
25+
KeepWorks, ios@keepworks.com
2626

2727
## License
2828

0 commit comments

Comments
 (0)