Skip to content

Commit

Permalink
Fixed an issue which failing carthage build
Browse files Browse the repository at this point in the history
  • Loading branch information
hackiftekhar committed Sep 24, 2017
1 parent 2a4101f commit 415ca85
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 58 deletions.
4 changes: 2 additions & 2 deletions IQKeyboardManager.podspec.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "IQKeyboardManager",
"version": "5.0.1",
"version": "5.0.2",
"source": {
"git": "https://github.com/hackiftekhar/IQKeyboardManager.git",
"tag": "v5.0.1"
"tag": "v5.0.2"
},
"summary": "Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView.",
"homepage": "https://github.com/hackiftekhar/IQKeyboardManager",
Expand Down
2 changes: 1 addition & 1 deletion IQKeyboardManager/IQToolbar/IQBarButtonItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ +(void)initialize
{
UIControlState controlState = [state unsignedIntegerValue];

[appearanceProxy setTitleTextAttributes:@{ NSFontAttributeName: [UIFont systemFontOfSize:15.0], NSForegroundColorAttributeName: [UIColor redColor] } forState:controlState];
[appearanceProxy setTitleTextAttributes:nil forState:controlState];
[appearanceProxy setBackgroundImage:nil forState:controlState barMetrics:UIBarMetricsDefault];
[appearanceProxy setBackgroundImage:nil forState:controlState style:UIBarButtonItemStyleDone barMetrics:UIBarMetricsDefault];
[appearanceProxy setBackgroundImage:nil forState:controlState style:UIBarButtonItemStylePlain barMetrics:UIBarMetricsDefault];
Expand Down
4 changes: 2 additions & 2 deletions IQKeyboardManagerSwift.podspec.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "IQKeyboardManagerSwift",
"version": "5.0.1",
"version": "5.0.2",
"source": {
"git": "https://github.com/hackiftekhar/IQKeyboardManager.git",
"tag": "v5.0.1"
"tag": "v5.0.2"
},
"summary": "Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView.",
"homepage": "https://github.com/hackiftekhar/IQKeyboardManager",
Expand Down
57 changes: 16 additions & 41 deletions IQKeyboardManagerSwift/IQToolbar/IQBarButtonItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,51 +41,26 @@ open class IQBarButtonItem: UIBarButtonItem {

private class func classInitialize() {

//Tint color
self.appearance().tintColor = nil
let appearanceProxy = self.appearance()

//Title
self.appearance().setTitlePositionAdjustment(UIOffset.zero, for: UIBarMetrics.default)
self.appearance().setTitleTextAttributes(nil, for: UIControlState())
self.appearance().setTitleTextAttributes(nil, for: UIControlState.highlighted)
self.appearance().setTitleTextAttributes(nil, for: UIControlState.disabled)
self.appearance().setTitleTextAttributes(nil, for: UIControlState.selected)
self.appearance().setTitleTextAttributes(nil, for: UIControlState.application)
self.appearance().setTitleTextAttributes(nil, for: UIControlState.reserved)
let states : [UIControlState] = [.normal,.highlighted,.disabled,.selected,.application,.reserved];

//Background Image
self.appearance().setBackgroundImage(nil, for: UIControlState(), barMetrics: UIBarMetrics.default)
self.appearance().setBackgroundImage(nil, for: UIControlState.highlighted, barMetrics: UIBarMetrics.default)
self.appearance().setBackgroundImage(nil, for: UIControlState.disabled, barMetrics: UIBarMetrics.default)
self.appearance().setBackgroundImage(nil, for: UIControlState.selected, barMetrics: UIBarMetrics.default)
self.appearance().setBackgroundImage(nil, for: UIControlState.application, barMetrics: UIBarMetrics.default)
self.appearance().setBackgroundImage(nil, for: UIControlState.reserved, barMetrics: UIBarMetrics.default)

self.appearance().setBackgroundImage(nil, for: UIControlState(), style: UIBarButtonItemStyle.done, barMetrics: UIBarMetrics.default)
self.appearance().setBackgroundImage(nil, for: UIControlState.highlighted, style: UIBarButtonItemStyle.done, barMetrics: UIBarMetrics.default)
self.appearance().setBackgroundImage(nil, for: UIControlState.disabled, style: UIBarButtonItemStyle.done, barMetrics: UIBarMetrics.default)
self.appearance().setBackgroundImage(nil, for: UIControlState.selected, style: UIBarButtonItemStyle.done, barMetrics: UIBarMetrics.default)
self.appearance().setBackgroundImage(nil, for: UIControlState.application, style: UIBarButtonItemStyle.done, barMetrics: UIBarMetrics.default)
self.appearance().setBackgroundImage(nil, for: UIControlState.reserved, style: UIBarButtonItemStyle.done, barMetrics: UIBarMetrics.default)

self.appearance().setBackgroundImage(nil, for: UIControlState(), style: UIBarButtonItemStyle.plain, barMetrics: UIBarMetrics.default)
self.appearance().setBackgroundImage(nil, for: UIControlState.highlighted, style: UIBarButtonItemStyle.plain, barMetrics: UIBarMetrics.default)
self.appearance().setBackgroundImage(nil, for: UIControlState.disabled, style: UIBarButtonItemStyle.plain, barMetrics: UIBarMetrics.default)
self.appearance().setBackgroundImage(nil, for: UIControlState.selected, style: UIBarButtonItemStyle.plain, barMetrics: UIBarMetrics.default)
self.appearance().setBackgroundImage(nil, for: UIControlState.application, style: UIBarButtonItemStyle.plain, barMetrics: UIBarMetrics.default)
self.appearance().setBackgroundImage(nil, for: UIControlState.reserved, style: UIBarButtonItemStyle.plain, barMetrics: UIBarMetrics.default)
self.appearance().setBackgroundVerticalPositionAdjustment(0, for: UIBarMetrics.default)
//Tint color
appearanceProxy.tintColor = nil

//Back Button
self.appearance().setBackButtonBackgroundImage(nil, for: UIControlState(), barMetrics: UIBarMetrics.default)
self.appearance().setBackButtonBackgroundImage(nil, for: UIControlState.highlighted, barMetrics: UIBarMetrics.default)
self.appearance().setBackButtonBackgroundImage(nil, for: UIControlState.disabled, barMetrics: UIBarMetrics.default)
self.appearance().setBackButtonBackgroundImage(nil, for: UIControlState.selected, barMetrics: UIBarMetrics.default)
self.appearance().setBackButtonBackgroundImage(nil, for: UIControlState.application, barMetrics: UIBarMetrics.default)
self.appearance().setBackButtonBackgroundImage(nil, for: UIControlState.reserved, barMetrics: UIBarMetrics.default)
for state in states {

self.appearance().setBackButtonTitlePositionAdjustment(UIOffset.zero, for: UIBarMetrics.default)
self.appearance().setBackButtonBackgroundVerticalPositionAdjustment(0, for: UIBarMetrics.default)
appearanceProxy.setTitleTextAttributes(nil, for: state)
appearanceProxy.setBackgroundImage(nil, for: state, barMetrics: .default)
appearanceProxy.setBackgroundImage(nil, for: state, style: .done, barMetrics: .default)
appearanceProxy.setBackgroundImage(nil, for: state, style: .plain, barMetrics: .default)
appearanceProxy.setBackButtonBackgroundImage(nil, for: state, barMetrics: .default)
}

appearanceProxy.setTitlePositionAdjustment(UIOffset.zero, for: .default)
appearanceProxy.setBackgroundVerticalPositionAdjustment(0, for: .default)
appearanceProxy.setBackButtonTitlePositionAdjustment(UIOffset.zero, for: .default)
appearanceProxy.setBackButtonBackgroundVerticalPositionAdjustment(0, for: .default)
}

/**
Expand Down
24 changes: 12 additions & 12 deletions IQKeyboardManagerSwift/IQToolbar/IQToolbar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ open class IQToolbar: UIToolbar , UIInputViewAudioFeedback {
private static var _classInitialize: Void = classInitialize()

private class func classInitialize() {

self.appearance().barTintColor = nil

//Background image
self.appearance().setBackgroundImage(nil, forToolbarPosition: UIBarPosition.any, barMetrics: UIBarMetrics.default)
self.appearance().setBackgroundImage(nil, forToolbarPosition: UIBarPosition.bottom, barMetrics: UIBarMetrics.default)
self.appearance().setBackgroundImage(nil, forToolbarPosition: UIBarPosition.top, barMetrics: UIBarMetrics.default)
self.appearance().setBackgroundImage(nil, forToolbarPosition: UIBarPosition.topAttached, barMetrics: UIBarMetrics.default)
let appearanceProxy = self.appearance()

self.appearance().setShadowImage(nil, forToolbarPosition: UIBarPosition.any)
self.appearance().setShadowImage(nil, forToolbarPosition: UIBarPosition.bottom)
self.appearance().setShadowImage(nil, forToolbarPosition: UIBarPosition.top)
self.appearance().setShadowImage(nil, forToolbarPosition: UIBarPosition.topAttached)
appearanceProxy.tintColor = nil
appearanceProxy.barTintColor = nil

let positions : [UIBarPosition] = [.any,.bottom,.top,.topAttached];

for position in positions {

appearanceProxy.setBackgroundImage(nil, forToolbarPosition: position, barMetrics: .default)
appearanceProxy.setShadowImage(nil, forToolbarPosition: .any)
}

//Background color
self.appearance().backgroundColor = nil
position.backgroundColor = nil
}

/**
Expand Down

0 comments on commit 415ca85

Please sign in to comment.