Skip to content

Commit

Permalink
first version
Browse files Browse the repository at this point in the history
  • Loading branch information
Uriel Battanoli committed May 9, 2017
1 parent 7f284cd commit 4f2e245
Show file tree
Hide file tree
Showing 36 changed files with 1,732 additions and 17 deletions.
10 changes: 10 additions & 0 deletions Example/GeneralFormatter.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 38 additions & 6 deletions Example/GeneralFormatter/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,25 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="GeneralFormatter_Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="sZE-na-M02">
<rect key="frame" x="87.5" y="318" width="200" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="200" id="can-nv-0kY"/>
<constraint firstAttribute="height" constant="30" id="vAZ-uA-fNu"/>
</constraints>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<connections>
<outlet property="delegate" destination="vXZ-lx-hvc" id="7Ky-kq-XjE"/>
</connections>
</textField>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="sZE-na-M02" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="HEM-dj-G8m"/>
<constraint firstItem="sZE-na-M02" firstAttribute="centerY" secondItem="kh9-bI-dsS" secondAttribute="centerY" id="y0z-Nl-rue"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" id="T6Y-uk-yg5">
<rect key="frame" x="0.0" y="0.0" width="97" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
</objects>
<point key="canvasLocation" x="32.799999999999997" y="36.431784107946029"/>
</scene>
</scenes>
</document>
13 changes: 8 additions & 5 deletions Example/GeneralFormatter/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@
//

import UIKit
import GeneralFormatter

class ViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.

}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}

extension ViewController: UITextFieldDelegate {
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
let formatter = GeneralFormatter(type: .cpfCnpj)
return formatter.formatTextField(textField, shouldChangeCharactersIn: range, replacementString: string)
}
}

16 changes: 16 additions & 0 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
PODS:
- GeneralFormatter (1.0.0)

DEPENDENCIES:
- GeneralFormatter (from `../`)

EXTERNAL SOURCES:
GeneralFormatter:
:path: ../

SPEC CHECKSUMS:
GeneralFormatter: b7323404c723a041a08895a7fcb7db14b18e7fb8

PODFILE CHECKSUM: ec4a3bc57021d94ba554319e839e0fcdacabf704

COCOAPODS: 1.2.1
22 changes: 22 additions & 0 deletions Example/Pods/Local Podspecs/GeneralFormatter.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4f2e245

Please sign in to comment.