mirror of
https://github.com/HackPlan/IQKeyboardManager.git
synced 2026-03-26 06:54:36 +08:00
Optimised for Swift 3.0.1 Xcode8.1
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
4C0EFE2B1CF332C900C908D3 /* LayoutGuideViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0EFE2A1CF332C900C908D3 /* LayoutGuideViewController.swift */; };
|
||||
4C0EFE2D1CF332D200C908D3 /* ChatViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0EFE2C1CF332D200C908D3 /* ChatViewController.swift */; };
|
||||
4C0EFE2F1CF332DD00C908D3 /* TextViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0EFE2E1CF332DD00C908D3 /* TextViewController.swift */; };
|
||||
4C1286321DD1C5B900F0C1E5 /* Launch.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4C1286311DD1C5B900F0C1E5 /* Launch.storyboard */; };
|
||||
4C1286331DD1C5B900F0C1E5 /* Launch.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4C1286311DD1C5B900F0C1E5 /* Launch.storyboard */; };
|
||||
4C134C811D10758F00C016CA /* SearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C134C801D10758F00C016CA /* SearchViewController.m */; };
|
||||
4C2F12E21D9E8CDF004AF58C /* PopoverViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C2F12E11D9E8CDF004AF58C /* PopoverViewController.swift */; };
|
||||
4C34D9EF1D1319A60013E61D /* SearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C34D9EE1D1319A60013E61D /* SearchViewController.swift */; };
|
||||
@@ -160,6 +162,7 @@
|
||||
4C0EFE2A1CF332C900C908D3 /* LayoutGuideViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LayoutGuideViewController.swift; sourceTree = "<group>"; };
|
||||
4C0EFE2C1CF332D200C908D3 /* ChatViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChatViewController.swift; sourceTree = "<group>"; };
|
||||
4C0EFE2E1CF332DD00C908D3 /* TextViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextViewController.swift; sourceTree = "<group>"; };
|
||||
4C1286311DD1C5B900F0C1E5 /* Launch.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Launch.storyboard; sourceTree = "<group>"; };
|
||||
4C134C7F1D10758F00C016CA /* SearchViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SearchViewController.h; sourceTree = "<group>"; };
|
||||
4C134C801D10758F00C016CA /* SearchViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SearchViewController.m; sourceTree = "<group>"; };
|
||||
4C2F12E11D9E8CDF004AF58C /* PopoverViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PopoverViewController.swift; sourceTree = "<group>"; };
|
||||
@@ -564,6 +567,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C0CB61A21B884D4100C33368 /* Main.storyboard */,
|
||||
4C1286311DD1C5B900F0C1E5 /* Launch.storyboard */,
|
||||
);
|
||||
path = Storyboard;
|
||||
sourceTree = "<group>";
|
||||
@@ -822,7 +826,7 @@
|
||||
attributes = {
|
||||
LastSwiftMigration = 0700;
|
||||
LastSwiftUpdateCheck = 0700;
|
||||
LastUpgradeCheck = 0800;
|
||||
LastUpgradeCheck = 0810;
|
||||
ORGANIZATIONNAME = Iftekhar;
|
||||
TargetAttributes = {
|
||||
4CE6119C1B98B7250020591A = {
|
||||
@@ -832,7 +836,7 @@
|
||||
C0ACB0F419CF104B0057B571 = {
|
||||
CreatedOnToolsVersion = 6.0.1;
|
||||
DevelopmentTeam = 7UUTF6T5P9;
|
||||
LastSwiftMigration = 0800;
|
||||
LastSwiftMigration = 0810;
|
||||
};
|
||||
C0B63B9A1781FAB1008D3B64 = {
|
||||
DevelopmentTeam = 7UUTF6T5P9;
|
||||
@@ -877,6 +881,7 @@
|
||||
C0CB61E81B884F1500C33368 /* iTunesArtwork@2x in Resources */,
|
||||
4C0EFE1D1CF2F8A800C908D3 /* MainSwift.storyboard in Resources */,
|
||||
C0CB61E71B884F1500C33368 /* iTunesArtwork in Resources */,
|
||||
4C1286331DD1C5B900F0C1E5 /* Launch.storyboard in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -889,6 +894,7 @@
|
||||
C0CB62741B8856B300C33368 /* IQKeyboardManagerScreenshot.png in Resources */,
|
||||
C0CB61E91B884F1600C33368 /* iTunesArtwork in Resources */,
|
||||
C0CB62161B884FB000C33368 /* Main.storyboard in Resources */,
|
||||
4C1286321DD1C5B900F0C1E5 /* Launch.storyboard in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0800"
|
||||
LastUpgradeVersion = "0810"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0800"
|
||||
LastUpgradeVersion = "0810"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0800"
|
||||
LastUpgradeVersion = "0810"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
<string>4.0.7</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>Launch</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
|
||||
31
Demo/Objective_C_Demo/Storyboard/Launch.storyboard
Normal file
31
Demo/Objective_C_Demo/Storyboard/Launch.storyboard
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11542" systemVersion="16A323" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="SLD-W0-iHs">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="Upz-E2-HnO">
|
||||
<objects>
|
||||
<viewController id="SLD-W0-iHs" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="hmy-1I-BWH"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="gFv-gy-qWo"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="gvr-2z-xYP">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="473-od-mMH" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="84" y="160"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
@@ -26,7 +26,7 @@
|
||||
NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
|
||||
|
||||
CGFloat lineSpacing;
|
||||
if (CTParagraphStyleGetValueForSpecifier(CTStyle, kCTParagraphStyleSpecifierLineSpacing, sizeof(CGFloat), &lineSpacing)) {
|
||||
if (CTParagraphStyleGetValueForSpecifier(CTStyle, kCTParagraphStyleSpecifierMinimumLineSpacing, sizeof(CGFloat), &lineSpacing)) {
|
||||
style.lineSpacing = lineSpacing;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
int count = 0;
|
||||
|
||||
CGFloat lineSpacing = self.lineSpacing;
|
||||
set[count].spec = kCTParagraphStyleSpecifierLineSpacing;
|
||||
set[count].spec = kCTParagraphStyleSpecifierMinimumLineSpacing;
|
||||
set[count].valueSize = sizeof(CGFloat);
|
||||
set[count].value = &lineSpacing;
|
||||
count++;
|
||||
|
||||
@@ -1155,7 +1155,7 @@ static dispatch_queue_t YYLabelGetReleaseQueue() {
|
||||
}
|
||||
[layer removeAnimationForKey:@"contents"];
|
||||
|
||||
YYLabel *view = layer.delegate;
|
||||
YYLabel *view = (YYLabel*)layer.delegate;
|
||||
if (!view) return;
|
||||
if (view->_state.layoutNeedUpdate && layoutUpdated) {
|
||||
view->_innerLayout = layout;
|
||||
|
||||
@@ -32,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
The YYTextAsyncLayer's delegate protocol. The delegate of the YYTextAsyncLayer (typically a UIView)
|
||||
must implements the method in this protocol.
|
||||
*/
|
||||
@protocol YYTextAsyncLayerDelegate <NSObject>
|
||||
@protocol YYTextAsyncLayerDelegate <CALayerDelegate>
|
||||
@required
|
||||
/// This method is called to return a new display task when the layer's contents need update.
|
||||
- (YYTextAsyncLayerDisplayTask *)newAsyncDisplayTask;
|
||||
|
||||
@@ -118,7 +118,7 @@ static dispatch_queue_t YYTextAsyncLayerGetReleaseQueue() {
|
||||
#pragma mark - Private
|
||||
|
||||
- (void)_displayAsync:(BOOL)async {
|
||||
__strong id<YYTextAsyncLayerDelegate> delegate = self.delegate;
|
||||
__strong id<YYTextAsyncLayerDelegate> delegate = (id<YYTextAsyncLayerDelegate>)self.delegate;
|
||||
YYTextAsyncLayerDisplayTask *task = [delegate newAsyncDisplayTask];
|
||||
if (!task.display) {
|
||||
if (task.willDisplay) task.willDisplay(self);
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-Small-3.png",
|
||||
"filename" : "Icon-Small@2x-3.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-Small@2x-3.png",
|
||||
"filename" : "Icon-60@2x-1.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.8 KiB |
@@ -24,6 +24,8 @@
|
||||
<string>4.0.7</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>Launch</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>MainSwift</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
|
||||
@@ -461,7 +461,7 @@ class SettingsViewController: UITableViewController, OptionsViewControllerDelega
|
||||
tableView.deselectRow(at: indexPath, animated: true)
|
||||
}
|
||||
|
||||
private func colorPickerTextField(_ textField: ColorPickerTextField, selectedColorAttributes colorAttributes: [String : AnyObject]) {
|
||||
fileprivate func colorPickerTextField(_ textField: ColorPickerTextField, selectedColorAttributes colorAttributes: [String : AnyObject]) {
|
||||
|
||||
if textField.tag == 15 {
|
||||
let color = colorAttributes["color"] as! UIColor
|
||||
|
||||
@@ -15,7 +15,7 @@ class YYTextViewController: UIViewController, YYTextViewDelegate {
|
||||
override internal class func initialize() {
|
||||
super.initialize()
|
||||
|
||||
IQKeyboardManager.sharedManager().registerTextFieldViewClass(YYTextView.self, didBeginEditingNotificationName: NSNotification.Name.YYTextViewTextDidBeginEditing.rawValue, didEndEditingNotificationName: NSNotification.Name.YYTextViewTextDidEndEditing.rawValue)
|
||||
IQKeyboardManager.sharedManager().registerTextFieldViewClass(YYTextView.self, didBeginEditingNotificationName: Notification.Name.YYTextViewTextDidBeginEditing.rawValue, didEndEditingNotificationName: Notification.Name.YYTextViewTextDidEndEditing.rawValue)
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
|
||||
Reference in New Issue
Block a user