Skip to content

Commit

Permalink
Callback support added
Browse files Browse the repository at this point in the history
  • Loading branch information
chanonly123 committed Aug 29, 2017
1 parent 8239b97 commit 9f8e563
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 52 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 14 additions & 10 deletions Auto Keyborad Demo/Auto Keyborad Demo/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="0ep-si-YxG">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="0ep-si-YxG">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand All @@ -23,16 +23,18 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="749" image="image1" translatesAutoresizingMaskIntoConstraints="NO" id="GjC-Kb-O3B">
<rect key="frame" x="0.0" y="64" width="375" height="603"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vOd-Ig-xDy">
<rect key="frame" x="16" y="621" width="109" height="30"/>
<color key="backgroundColor" red="0.18779608607292175" green="0.51187342405319214" blue="0.69045674800872803" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<state key="normal" title="Resign"/>
<connections>
<action selector="bResingTap:" destination="Tu2-nt-tDa" eventType="touchUpInside" id="Jfd-vS-e7G"/>
</connections>
</button>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="749" image="image1" translatesAutoresizingMaskIntoConstraints="NO" id="GjC-Kb-O3B">
<rect key="frame" x="0.0" y="106" width="375" height="511"/>
</imageView>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Click here" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="YlA-tt-T3a">
<rect key="frame" x="20" y="72" width="335" height="30"/>
<nil key="textColor"/>
Expand All @@ -41,6 +43,8 @@
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1NP-Se-tuI">
<rect key="frame" x="141" y="621" width="218" height="30"/>
<color key="backgroundColor" red="0.18779608607292175" green="0.51187342405319214" blue="0.69045674800872803" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<state key="normal" title="Scroll View Example"/>
<connections>
<segue destination="BGR-We-ubx" kind="show" id="1T6-jy-zLe"/>
Expand All @@ -49,14 +53,14 @@
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="GjC-Kb-O3B" firstAttribute="top" secondItem="ZU4-Dn-Oq8" secondAttribute="bottom" id="C3l-mR-KSG"/>
<constraint firstItem="1NP-Se-tuI" firstAttribute="leading" secondItem="vOd-Ig-xDy" secondAttribute="trailing" constant="16" id="FaM-Lo-7ae"/>
<constraint firstItem="1NP-Se-tuI" firstAttribute="trailing" secondItem="Ug3-vt-BUj" secondAttribute="trailingMargin" id="G3d-QJ-lsn"/>
<constraint firstItem="vOd-Ig-xDy" firstAttribute="top" secondItem="GjC-Kb-O3B" secondAttribute="bottom" constant="4" id="LoG-tk-dHy"/>
<constraint firstItem="TS8-c0-Gak" firstAttribute="top" secondItem="vOd-Ig-xDy" secondAttribute="bottom" constant="16" id="PO7-eS-dfZ"/>
<constraint firstItem="GjC-Kb-O3B" firstAttribute="top" secondItem="YlA-tt-T3a" secondAttribute="bottom" constant="4" id="RjE-dV-uiF"/>
<constraint firstItem="vOd-Ig-xDy" firstAttribute="width" secondItem="1NP-Se-tuI" secondAttribute="width" multiplier="1:2" id="TEd-RX-DJx"/>
<constraint firstItem="YlA-tt-T3a" firstAttribute="top" secondItem="ZU4-Dn-Oq8" secondAttribute="bottom" constant="8" id="Wen-in-OcY"/>
<constraint firstItem="TS8-c0-Gak" firstAttribute="top" secondItem="1NP-Se-tuI" secondAttribute="bottom" constant="16" id="etB-DA-hdI"/>
<constraint firstItem="TS8-c0-Gak" firstAttribute="top" secondItem="GjC-Kb-O3B" secondAttribute="bottom" id="kSB-xo-GOG"/>
<constraint firstItem="GjC-Kb-O3B" firstAttribute="leading" secondItem="Ug3-vt-BUj" secondAttribute="leading" id="lr8-fP-rah"/>
<constraint firstItem="vOd-Ig-xDy" firstAttribute="leading" secondItem="Ug3-vt-BUj" secondAttribute="leading" constant="16" id="pFp-G2-qBa"/>
<constraint firstAttribute="trailingMargin" secondItem="YlA-tt-T3a" secondAttribute="trailing" constant="4" id="qa2-4O-V2X"/>
Expand Down Expand Up @@ -106,7 +110,7 @@
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="23U-49-MBH">
<rect key="frame" x="35" y="35" width="305" height="669.5"/>
<mutableString key="text">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</mutableString>
<string key="text">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</string>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
Expand Down Expand Up @@ -175,6 +179,6 @@
</scene>
</scenes>
<resources>
<image name="image1" width="736" height="1308"/>
<image name="image1" width="1920" height="1080"/>
</resources>
</document>
42 changes: 22 additions & 20 deletions Auto Keyborad Demo/Auto Keyborad Demo/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,28 @@ import UIKit
import AutoKeyboard

class ViewController: UIViewController {

@IBOutlet weak var tfAny: UITextField!

override func viewDidLoad() {
super.viewDidLoad()
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
registerAutoKeyboard()
}

override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
unRegisterAutoKeyboard()
}

@IBAction func bResingTap(_ sender: Any) {
tfAny.resignFirstResponder()
}

@IBOutlet weak var tfAny: UITextField!

override func viewDidLoad() {
super.viewDidLoad()
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
registerAutoKeyboard { (result) in
print("keyboard status \(result.status)")
}
}

override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
unRegisterAutoKeyboard()
}

@IBAction func bResingTap(_ sender: Any) {
tfAny.resignFirstResponder()
}
}


Expand Down
4 changes: 2 additions & 2 deletions AutoKeyboard.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#

s.name = "AutoKeyboard"
s.version = "1.0.2"
s.version = "1.0.3"
s.summary = "Automatic Keyboard handling with ease"
s.description = "Automatic bottom constraints changes with extreamly easy integration."
s.homepage = "https://github.com/chanonly123/AutoKeyboard"
Expand Down Expand Up @@ -80,7 +80,7 @@ Pod::Spec.new do |s|
# Supports git, hg, bzr, svn and HTTP.
#

s.source = { :git => "https://github.com/chanonly123/AutoKeyboard.git", :tag => "1.0.2" }
s.source = { :git => "https://github.com/chanonly123/AutoKeyboard.git", :tag => "1.0.3" }


# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
Expand Down
Loading

0 comments on commit 9f8e563

Please sign in to comment.