Skip to content

Commit

Permalink
- Added IQKeyboardToolbarManager as direct dependency and using it in…
Browse files Browse the repository at this point in the history
…side a wrapper now.
  • Loading branch information
hackiftekhar committed Oct 28, 2024
1 parent bb17076 commit ffef427
Show file tree
Hide file tree
Showing 25 changed files with 109 additions and 1,421 deletions.
4 changes: 3 additions & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
github "hackiftekhar/IQKeyboardNotification"
github "hackiftekhar/IQTextInputViewNotification"
github "hackiftekhar/IQTextInputViewNotification"
github "hackiftekhar/IQKeyboardToolbarManager"
github "hackiftekhar/IQTextView"
9 changes: 6 additions & 3 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
github "hackiftekhar/IQKeyboardCore" "1.0.6"
github "hackiftekhar/IQKeyboardNotification" "1.0.4"
github "hackiftekhar/IQTextInputViewNotification" "1.0.6"
github "hackiftekhar/IQKeyboardCore" "1.0.7"
github "hackiftekhar/IQKeyboardNotification" "1.0.5"
github "hackiftekhar/IQKeyboardToolbar" "1.1.0"
github "hackiftekhar/IQKeyboardToolbarManager" "1.1.0"
github "hackiftekhar/IQTextInputViewNotification" "1.0.7"
github "hackiftekhar/IQTextView" "1.0.3"
86 changes: 22 additions & 64 deletions Demo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21225" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21207"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down
1 change: 1 addition & 0 deletions Demo/Swift_Demo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

window?.backgroundColor = UIColor.white
IQKeyboardManager.shared.enable = true
IQKeyboardManager.shared.enableAutoToolbar = true
return true
}

Expand Down
8 changes: 4 additions & 4 deletions Demo/Swift_Demo/Storyboard/Base.lproj/General.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<scene sceneID="kAr-5b-4Sn">
<objects>
<viewController storyboardIdentifier="TextFieldViewController" id="csO-qF-Ohn" customClass="TextFieldViewController" customModule="DemoSwift" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="i84-jm-CzI" customClass="IQDeepResponderContainerView" customModule="IQKeyboardManagerSwift">
<view key="view" contentMode="scaleToFill" id="i84-jm-CzI" customClass="IQDeepResponderContainerView" customModule="IQKeyboardToolbarManager">
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
Expand Down Expand Up @@ -113,7 +113,7 @@
<color key="textColor" red="0.66666666666666663" green="0.66666666666666663" blue="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" tag="101" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="Nry-4j-VcI" customClass="IQTextView" customModule="IQKeyboardManagerSwift">
<textView clipsSubviews="YES" multipleTouchEnabled="YES" tag="101" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="Nry-4j-VcI" customClass="IQTextView" customModule="IQTextView">
<rect key="frame" x="20" y="28" width="335" height="35"/>
<color key="backgroundColor" name="EBEDF0"/>
<color key="tintColor" red="0.47692340353260865" green="0.013985326711680755" blue="0.039278733763664801" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
Expand Down Expand Up @@ -163,7 +163,7 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="63Q-wt-23t">
<rect key="frame" x="0.0" y="596" width="375" height="91"/>
<subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" tag="108" contentMode="scaleToFill" text="Can resign on touching outside" translatesAutoresizingMaskIntoConstraints="NO" id="wIC-LZ-asw" customClass="IQTextView" customModule="IQKeyboardManagerSwift">
<textView clipsSubviews="YES" multipleTouchEnabled="YES" tag="108" contentMode="scaleToFill" text="Can resign on touching outside" translatesAutoresizingMaskIntoConstraints="NO" id="wIC-LZ-asw" customClass="IQTextView" customModule="IQTextView">
<rect key="frame" x="20" y="28" width="335" height="35"/>
<color key="backgroundColor" name="EBEDF0"/>
<color key="tintColor" red="0.2440839877768155" green="0.0" blue="0.47692340353260865" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
Expand Down Expand Up @@ -646,7 +646,7 @@
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemGrayColor">
<color red="0.5568627451" green="0.5568627451" blue="0.57647058819999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.55686274509803924" green="0.55686274509803924" blue="0.57647058823529407" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>
10 changes: 5 additions & 5 deletions Demo/Swift_Demo/Storyboard/Base.lproj/SpecialCase.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uLB-dv-85O" customClass="IQDeepResponderContainerView" customModule="IQKeyboardManagerSwift">
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uLB-dv-85O" customClass="IQDeepResponderContainerView" customModule="IQKeyboardToolbarManager">
<rect key="frame" x="10" y="88" width="394" height="764"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Oad-Sj-fOj">
Expand Down Expand Up @@ -1091,19 +1091,19 @@
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="separatorColor">
<color red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.28999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.23529411764705882" green="0.23529411764705882" blue="0.2627450980392157" alpha="0.28999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemBlueColor">
<color red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemGray5Color">
<color red="0.8980392157" green="0.8980392157" blue="0.91764705879999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.89803921568627454" green="0.89803921568627454" blue="0.91764705882352937" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemGrayColor">
<color red="0.5568627451" green="0.5568627451" blue="0.57647058819999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.55686274509803924" green="0.55686274509803924" blue="0.57647058823529407" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>
1 change: 1 addition & 0 deletions Demo/Swift_Demo/ViewController/CustomViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import UIKit
import IQKeyboardManagerSwift
import IQKeyboardToolbarManager

class CustomViewController: BaseViewController {

Expand Down
4 changes: 3 additions & 1 deletion Demo/Swift_Demo/ViewController/SettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

import UIKit
import IQKeyboardManagerSwift
import IQKeyboardToolbar
import IQKeyboardToolbarManager

class SettingsViewController: UITableViewController {

Expand Down Expand Up @@ -280,7 +282,7 @@ extension SettingsViewController: OptionsViewControllerDelegate {
}

if selectedIndexPath.section == 1 && selectedIndexPath.row == 1 {
let value = IQAutoToolbarManageBehavior(rawValue: index)!
let value = IQKeyboardToolbarManageBehavior(rawValue: index)!
IQKeyboardManager.shared.toolbarConfiguration.manageBehavior = value
} else if selectedIndexPath.section == 1 && selectedIndexPath.row == 4 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import UIKit
import IQKeyboardManagerSwift
import IQDropDownTextFieldSwift
import IQTextView

class TextFieldViewController: BaseViewController, UITextViewDelegate {

Expand Down
15 changes: 4 additions & 11 deletions IQKeyboardManagerSwift.podspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,17 @@
"IQKeyboardManagerSwift/IQKeyboardToolbarManager/**/*.{swift}"
],
"dependencies": {
"IQKeyboardManagerSwift/Core": []
},
"subspecs": [
{
"name": "IQKeyboardToolbar",
"source_files": [
"IQKeyboardManagerSwift/IQKeyboardToolbar/**/*.{swift}"
]
}
]
"IQKeyboardToolbarManager": []
}
},
{
"name": "IQTextView",
"source_files": [
"IQKeyboardManagerSwift/IQTextView/**/*.{swift}"
],
"dependencies": {
"IQKeyboardManagerSwift/IQKeyboardToolbarManager/IQKeyboardToolbar": []
"IQTextView": [],
"IQKeyboardToolbar": []
}
},
{
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
// THE SOFTWARE.

import UIKit
import IQKeyboardToolbarManager

@available(iOSApplicationExtension, unavailable)
// swiftlint:disable line_length
Expand All @@ -37,35 +38,26 @@ import UIKit
}

internal var toolbarManager: IQKeyboardToolbarManager {
if let object = objc_getAssociatedObject(self, &AssociatedKeys.toolbarManager)
as? IQKeyboardToolbarManager {
return object
}

let object: IQKeyboardToolbarManager = .init()
objc_setAssociatedObject(self, &AssociatedKeys.toolbarManager,
object, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)

return object
IQKeyboardToolbarManager.shared
}

var enableToolbarDebugging: Bool {
get { toolbarManager.enableDebugging }
set { toolbarManager.enableDebugging = newValue }
get { toolbarManager.isDebuggingEnabled }
set { toolbarManager.isDebuggingEnabled = newValue }
}

/**
Automatic add the toolbar functionality. Default is YES.
*/
var enableAutoToolbar: Bool {
get { toolbarManager.enable }
set { toolbarManager.enable = newValue }
get { toolbarManager.isEnabled }
set { toolbarManager.isEnabled = newValue }
}

/**
Configurations related to the toolbar display over the keyboard.
*/
var toolbarConfiguration: IQToolbarConfiguration {
var toolbarConfiguration: IQKeyboardToolbarConfiguration {
toolbarManager.toolbarConfiguration
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
// THE SOFTWARE.

import UIKit
import IQKeyboardToolbarManager

// swiftlint:disable unused_setter_value
// swiftlint:disable identifier_name
Expand All @@ -41,7 +42,7 @@ import UIKit
@objc public extension IQKeyboardManager {

@available(*, unavailable, renamed: "toolbarConfiguration.manageBehavior")
var toolbarManageBehaviour: IQAutoToolbarManageBehavior {
var toolbarManageBehaviour: IQKeyboardToolbarManageBehavior {
get { .bySubviews }
set { }
}
Expand Down
Loading

0 comments on commit ffef427

Please sign in to comment.