Skip to content

Commit

Permalink
v.1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Budnikov Vyacheslav committed Oct 11, 2016
2 parents b8b37a3 + fde64d2 commit 228b7f4
Show file tree
Hide file tree
Showing 21 changed files with 328 additions and 97 deletions.
2 changes: 1 addition & 1 deletion ASDKCore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Pod::Spec.new do |s|

s.name = "ASDKCore"
s.version = "1.0.2"
s.version = "1.0.3"
s.summary = "Core library that allows you to use internet acquiring from Tinkoff Bank in your app"
s.description = "Core library that allows you to use internet acquiring from Tinkoff Bank in your app!"

Expand Down
2 changes: 1 addition & 1 deletion ASDKCore/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.2</string>
<string>1.0.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion ASDKUI.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "ASDKUI"
s.version = "1.0.2"
s.version = "1.0.3"
s.summary = "UI components library for internet acquiring from Tinkoff Bank"
s.description = "UI components library for internet acquiring from Tinkoff Bank!"
s.homepage = "https://www.tinkoff.ru"
Expand Down
2 changes: 0 additions & 2 deletions ASDKUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@
831672521C64798800533D85 /* ASDKUI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASDKUI.h; sourceTree = "<group>"; };
831672541C64798800533D85 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8316725F1C647A1200533D85 /* ASDKCore.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = ASDKCore.xcodeproj; sourceTree = "<group>"; };
831672AB1C64925700533D85 /* ASDKCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = ASDKCore.framework; sourceTree = "<group>"; };
8333793D1C7470E20097208D /* ASDKBarButtonItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASDKBarButtonItem.h; sourceTree = "<group>"; };
8333793E1C7470E20097208D /* ASDKBarButtonItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASDKBarButtonItem.m; sourceTree = "<group>"; };
83E156431C71AE6F000BBD57 /* ASDKUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASDKUtils.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -258,7 +257,6 @@
83E1565E1C7206BF000BBD57 /* Loader */,
83E1565D1C720696000BBD57 /* Base Classes */,
94C869FF1C6B2E5100046F0E /* Resources */,
831672AB1C64925700533D85 /* ASDKCore.framework */,
831672521C64798800533D85 /* ASDKUI.h */,
831672541C64798800533D85 /* Info.plist */,
83129AFD1C68CAAD00A1F5DE /* Helpers */,
Expand Down
6 changes: 5 additions & 1 deletion ASDKUI/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.2</string>
<string>1.0.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
<key>NSPhotoLibraryUsageDescription</key>
<string>NSPhotoLibraryUsageDescription</string>
<key>NSCameraUsageDescription</key>
<string>NSCameraUsageDescription</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,28 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
return cell;
}

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
BOOL result = NO;

switch (indexPath.section)
{
case ASDKCardsListSectionCard:
result = YES;
break;

case ASDKCardsListSectionAddNewCard:
default:
result = NO;
break;
}

return result;
}

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete)
if (indexPath.section == ASDKCardsListSectionCard && editingStyle == UITableViewCellEditingStyleDelete)
{
ASDKCard *card = _cards[indexPath.row];

Expand All @@ -172,11 +191,13 @@ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEd
[[NSNotificationCenter defaultCenter] postNotificationName:ASDKNotificationHideLoader object:nil];

[weakSelf setCards:[ASDKCardsListDataController instance].externalCards];

[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
[tableView reloadData];

_didRemoveCards = YES;

[tableView beginUpdates];
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
[tableView reloadSections:[NSIndexSet indexSetWithIndex:indexPath.section] withRowAnimation:UITableViewRowAnimationAutomatic];
[tableView endUpdates];

_didRemoveCards = YES;
}
errorBlock:^(ASDKAcquringSdkError *error)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,22 @@ - (void)didPressOnDeleteButton

NSRange selectedRange = [(ASDKTextField *)textField selectedRange];

if (selectedRange.length > 0)
if (selectedRange.location != NSNotFound)
{
range = selectedRange;
if (selectedRange.location > 0)
{
range.location = selectedRange.location - 1;
}
else
{
range.location = 0;
}
}

if (selectedRange.length > 0)
{
range.length = selectedRange.length;
}

[self.cardRequisitesCell textField:textField shouldChangeCharactersInRange:range replacementString:@""];
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10116" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ASDKCardInputViewController">
Expand All @@ -12,14 +14,13 @@
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="375" height="226"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="216"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="JXT-6e-MHd">
<rect key="frame" x="0.0" y="0.0" width="375" height="226"/>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="JXT-6e-MHd">
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" constant="226" id="r8Y-be-n0c"/>
<constraint firstAttribute="height" constant="216" id="r8Y-be-n0c"/>
</constraints>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="0.0" minimumInteritemSpacing="0.0" id="RDn-3x-KeV">
<size key="itemSize" width="106" height="54"/>
Expand All @@ -33,14 +34,14 @@
</connections>
</collectionView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="JXT-6e-MHd" secondAttribute="trailing" id="3Gc-Wu-sBI"/>
<constraint firstAttribute="bottom" secondItem="JXT-6e-MHd" secondAttribute="bottom" id="fv1-0f-eQ4"/>
<constraint firstItem="JXT-6e-MHd" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="mfJ-Lg-oL8"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="374.5" y="551"/>
<point key="canvasLocation" x="-365" y="-107"/>
</view>
</objects>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -333,18 +333,21 @@ - (void)awakeFromNib
self.textFieldCardNumber = [[ASDKTextField alloc] init];
[self.textFieldCardNumber setInputMask:@"____ ____ ____ _____"];
[self.textFieldCardNumber setShowInputMask:NO];
[self.textFieldCardNumber setDisablePaste:YES];
[self.textFieldCardNumber setDisableCopy:YES];
[self.textFieldCardNumber setKeyboardType:UIKeyboardTypeNumberPad];
[self.textFieldCardNumber setKeyboardAppearance:UIKeyboardAppearanceLight];
[self.textFieldCardNumber setFont:[UIFont systemFontOfSize:17.0 weight:UIFontWeightLight]];
[self.textFieldCardNumber setDelegate:self];

[_viewCardNumber addSubview:self.textFieldCardNumber];
[self.textFieldCardNumber autoPinEdgesToSuperviewEdgesWithInsets:textFieldInsets];

self.textFieldCardDate = [[ASDKTextField alloc] init];
[self.textFieldCardDate setInputMask:@"__/__"];
[self.textFieldCardDate setShowInputMask:NO];
[self.textFieldCardDate setDisablePaste:YES];
[self.textFieldCardDate setDisableCopy:YES];
[self.textFieldCardDate setDelegate:self];
[self.textFieldCardDate setKeyboardType:UIKeyboardTypeNumberPad];
[self.textFieldCardDate setKeyboardAppearance:UIKeyboardAppearanceLight];
Expand All @@ -357,6 +360,8 @@ - (void)awakeFromNib
self.textFieldCardCVC = [[ASDKTextField alloc] init];
[self.textFieldCardCVC setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
[self.textFieldCardCVC setInputMask:@"___"];
[self.textFieldCardCVC setDisablePaste:YES];
[self.textFieldCardCVC setDisableCopy:YES];
[self.textFieldCardCVC setKeyboardType:UIKeyboardTypeNumberPad];
[self.textFieldCardCVC setKeyboardAppearance:UIKeyboardAppearanceLight];
[self.textFieldCardCVC setFont:[UIFont systemFontOfSize:17.0 weight:UIFontWeightLight]];
Expand All @@ -369,6 +374,8 @@ - (void)awakeFromNib

[self.secretCVVTextField setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
[self.secretCVVTextField setInputMask:@"___"];
[self.secretCVVTextField setDisablePaste:YES];
[self.secretCVVTextField setDisableCopy:YES];
[self.secretCVVTextField setKeyboardType:UIKeyboardTypeNumberPad];
[self.secretCVVTextField setKeyboardAppearance:UIKeyboardAppearanceLight];
[self.secretCVVTextField setFont:[UIFont systemFontOfSize:17.0 weight:UIFontWeightLight]];
Expand Down Expand Up @@ -569,7 +576,15 @@ - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRang
return result;
}
}
else if (textField == self.textFieldCardCVC || textField == self.textFieldCardDate || textField == self.secretCVVTextField)
else if (textField == self.textFieldCardDate)
{
ASDKTextField *tcsTextField = (ASDKTextField *)textField;
BOOL result = [tcsTextField shouldChangeCharactersInRange:range replacementString:string];

[self textFieldDidChange:textField];
return result;
}
else if (textField == self.textFieldCardCVC || textField == self.secretCVVTextField)
{
ASDKTextField *tcsTextField = (ASDKTextField *)textField;
if (![tcsTextField shouldChangeCharactersInRange:range replacementString:string])
Expand Down
Loading

0 comments on commit 228b7f4

Please sign in to comment.