Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation warnings solved. #312

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions Spring/DesignableTabBarController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import UIKit
@IBInspectable var firstSelectedImage: UIImage? {
didSet {
if let image = firstSelectedImage {
var tabBarItems = self.tabBar.items as [UITabBarItem]!
var tabBarItems = self.tabBar.items as [UITabBarItem]?
tabBarItems?[0].selectedImage = image.withRenderingMode(UIImageRenderingMode.alwaysTemplate)
}
}
Expand All @@ -56,7 +56,7 @@ import UIKit
@IBInspectable var secondSelectedImage: UIImage? {
didSet {
if let image = secondSelectedImage {
var tabBarItems = self.tabBar.items as [UITabBarItem]!
var tabBarItems = self.tabBar.items as [UITabBarItem]?
tabBarItems?[1].selectedImage = image.withRenderingMode(UIImageRenderingMode.alwaysTemplate)
}
}
Expand All @@ -65,7 +65,7 @@ import UIKit
@IBInspectable var thirdSelectedImage: UIImage? {
didSet {
if let image = thirdSelectedImage {
var tabBarItems = self.tabBar.items as [UITabBarItem]!
var tabBarItems = self.tabBar.items as [UITabBarItem]?
tabBarItems?[2].selectedImage = image.withRenderingMode(UIImageRenderingMode.alwaysTemplate)
}
}
Expand All @@ -74,7 +74,7 @@ import UIKit
@IBInspectable var fourthSelectedImage: UIImage? {
didSet {
if let image = fourthSelectedImage {
var tabBarItems = self.tabBar.items as [UITabBarItem]!
var tabBarItems = self.tabBar.items as [UITabBarItem]?
tabBarItems?[3].selectedImage = image.withRenderingMode(UIImageRenderingMode.alwaysTemplate)
}
}
Expand All @@ -83,7 +83,7 @@ import UIKit
@IBInspectable var fifthSelectedImage: UIImage? {
didSet {
if let image = fifthSelectedImage {
var tabBarItems = self.tabBar.items as [UITabBarItem]!
var tabBarItems = self.tabBar.items as [UITabBarItem]?
tabBarItems?[4].selectedImage = image.withRenderingMode(UIImageRenderingMode.alwaysTemplate)
}
}
Expand All @@ -92,7 +92,9 @@ import UIKit
override func viewDidLoad() {
super.viewDidLoad()

for item in self.tabBar.items as [UITabBarItem]! {
guard let items = self.tabBar.items as [UITabBarItem]? else { return }

for item in items {
if let image = item.image {
item.image = image.imageWithColor(tintColor: self.normalTint).withRenderingMode(UIImageRenderingMode.alwaysOriginal)
}
Expand Down
4 changes: 2 additions & 2 deletions Spring/Misc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import UIKit

public extension String {
public var length: Int { return self.characters.count }
public var length: Int { return self.count }

public func toURL() -> NSURL? {
return NSURL(string: self)
Expand Down Expand Up @@ -73,7 +73,7 @@ public extension UIColor {
let scanner = Scanner(string: hex)
var hexValue: CUnsignedLongLong = 0
if scanner.scanHexInt64(&hexValue) {
switch (hex.characters.count) {
switch (hex.count) {
case 3:
red = CGFloat((hexValue & 0xF00) >> 8) / 15.0
green = CGFloat((hexValue & 0x0F0) >> 4) / 15.0
Expand Down