Skip to content

Commit

Permalink
Atualização para swift 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro Nakamuta committed Oct 20, 2016
1 parent aa9e4a9 commit 0b48297
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 26 deletions.
50 changes: 37 additions & 13 deletions JeraUtils.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Pod::Spec.new do |s|
s.summary = "Basic Tools for App Development in Jera"
s.requires_arc = true

s.version = "0.3.2"
s.version = "0.4.0"

s.license = { :type => "MIT", :file => "LICENSE" }

Expand All @@ -19,18 +19,42 @@ Pod::Spec.new do |s|
s.framework = "UIKit"

#Swift
s.dependency 'Cartography', '~> 0.6'
s.dependency 'ChameleonFramework/Swift', '~> 2.1'
#s.dependency 'Eureka', '~> 1.5'
s.dependency 'FontAwesome.swift', '~> 0.7'
s.dependency 'Kingfisher', '~> 2.4'
# s.dependency 'MK', '~> 1.27'
s.dependency 'Material', '~> 1.41'
s.dependency 'Moya-ObjectMapper/RxSwift', '~> 1.2'
s.dependency 'ReachabilitySwift', '~> 2.3'
s.dependency 'RxCocoa', '~> 2.5'
s.dependency 'Tactile', '~> 1.2'
s.dependency 'TZStackView', '~> 1.1'
s.dependency 'Cartography', '= 0.7.0'
s.dependency 'Kingfisher', '= 2.6.1'
s.dependency 'ReachabilitySwift', '= 2.4'
s.dependency 'TZStackView', '= 1.2.0'

s.dependency 'Material'
s.dependency 'ChameleonFramework/Swift'
s.dependency 'FontAwesome.swift'
s.dependency 'Moya-ObjectMapper/RxSwift'
s.dependency 'RxCocoa'

#Adicione essas linhas Podfile do seu projeto
#Podfile Swift 2.3
# pod 'Material', :git => 'https://github.com/CosmicMind/Material', :branch => 'swift-2.3'
# pod 'ChameleonFramework', :git => 'https://github.com/ViccAlexander/Chameleon', :tag => '2.1.0'
# pod 'FontAwesome.swift', :git => 'https://github.com/thii/FontAwesome.swift', :tag => '0.10.1'

# pod 'Moya-ObjectMapper/RxSwift', :git => 'https://github.com/ivanbruel/Moya-ObjectMapper',:tag => '1.4'
# pod 'Moya', :git => 'https://github.com/Moya/Moya', :tag => '7.0.3'
# pod 'RxCocoa', :git => 'https://github.com/ReactiveX/RxSwift', :tag => '2.6.0'
# pod 'RxSwift', :git => 'https://github.com/ReactiveX/RxSwift', :tag => '2.6.0'

#e no final
# post_install do |installer|

# installer.pods_project.targets.each do |target|

# target.build_configurations.each do |configuration|

# configuration.build_settings['SWIFT_VERSION'] = "2.3"

# end

# end

# end

#Obj-C
s.dependency 'HMSegmentedControl', '~> 1.5'
Expand Down
3 changes: 3 additions & 0 deletions JeraUtils.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@
TargetAttributes = {
5F54587E1CCE9851003484CA = {
CreatedOnToolsVersion = 7.3;
LastSwiftMigration = 0800;
};
};
};
Expand Down Expand Up @@ -620,6 +621,7 @@
PRODUCT_BUNDLE_IDENTIFIER = br.com.jera.JeraUtils;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -637,6 +639,7 @@
PRODUCT_BUNDLE_IDENTIFIER = br.com.jera.JeraUtils;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand Down
4 changes: 2 additions & 2 deletions JeraUtils/Base/Helper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public extension UIImage {
UIGraphicsBeginImageContextWithOptions(size, false, 0)
color.setFill()
UIRectFill(rect)
let image: UIImage = UIGraphicsGetImageFromCurrentImageContext()
let image: UIImage = UIGraphicsGetImageFromCurrentImageContext()!
UIGraphicsEndImageContext()
return image
}
Expand Down Expand Up @@ -388,4 +388,4 @@ public extension Helper {
}
return AlertManager.createErrorForAlert("", localizedDescription: "Número inválido", alertRetry: false)
}
}
}
2 changes: 1 addition & 1 deletion JeraUtils/Form/MaterialCheckFormView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class MaterialCheckFormView: UIView {
let podBundle = NSBundle(forClass: self)
if let bundleURL = podBundle.URLForResource("JeraUtils", withExtension: "bundle") {
if let bundle = NSBundle(URL: bundleURL) {
return bundle.loadNibNamed("MaterialCheckFormView", owner: nil, options: nil).first as! MaterialCheckFormView
return bundle.loadNibNamed("MaterialCheckFormView", owner: nil, options: nil)!.first as! MaterialCheckFormView
}else {
assertionFailure("Could not load the bundle")
}
Expand Down
2 changes: 1 addition & 1 deletion JeraUtils/HUD/Views/HudToast.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class HudToast: UIView {
let podBundle = NSBundle(forClass: self)
if let bundleURL = podBundle.URLForResource("JeraUtils", withExtension: "bundle") {
if let bundle = NSBundle(URL: bundleURL) {
return bundle.loadNibNamed("HudToast", owner: nil, options: nil).first as! HudToast
return bundle.loadNibNamed("HudToast", owner: nil, options: nil)!.first as! HudToast
}else {
assertionFailure("Could not load the bundle")
}
Expand Down
2 changes: 1 addition & 1 deletion JeraUtils/HUD/Views/HudView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class HudView: UIView {
let podBundle = NSBundle(forClass: self)
if let bundleURL = podBundle.URLForResource("JeraUtils", withExtension: "bundle") {
if let bundle = NSBundle(URL: bundleURL) {
return bundle.loadNibNamed("HudView", owner: nil, options: nil).first as! HudView
return bundle.loadNibNamed("HudView", owner: nil, options: nil)!.first as! HudView
}else {
assertionFailure("Could not load the bundle")
}
Expand Down
2 changes: 1 addition & 1 deletion JeraUtils/Messages/Views/LoadingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class LoadingView: UIView {
let podBundle = NSBundle(forClass: self)
if let bundleURL = podBundle.URLForResource("JeraUtils", withExtension: "bundle") {
if let bundle = NSBundle(URL: bundleURL) {
return bundle.loadNibNamed("LoadingView", owner: nil, options: nil).first as! LoadingView
return bundle.loadNibNamed("LoadingView", owner: nil, options: nil)!.first as! LoadingView
}else {
assertionFailure("Could not load the bundle")
}
Expand Down
2 changes: 1 addition & 1 deletion JeraUtils/Messages/Views/MessageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class MessageView: UIView {
let podBundle = NSBundle(forClass: self)
if let bundleURL = podBundle.URLForResource("JeraUtils", withExtension: "bundle") {
if let bundle = NSBundle(URL: bundleURL) {
return bundle.loadNibNamed("MessageView", owner: nil, options: nil).first as! MessageView
return bundle.loadNibNamed("MessageView", owner: nil, options: nil)!.first as! MessageView
}else {
assertionFailure("Could not load the bundle")
}
Expand Down
2 changes: 1 addition & 1 deletion JeraUtils/PullToRefresh/InfinityScrollRefreshView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class InfinityScrollRefreshView: UIView {
let podBundle = NSBundle(forClass: self)
if let bundleURL = podBundle.URLForResource("JeraUtils", withExtension: "bundle") {
if let bundle = NSBundle(URL: bundleURL) {
return bundle.loadNibNamed("InfinityScrollRefreshView", owner: nil, options: nil).first as! InfinityScrollRefreshView
return bundle.loadNibNamed("InfinityScrollRefreshView", owner: nil, options: nil)!.first as! InfinityScrollRefreshView
}else {
assertionFailure("Could not load the bundle")
}
Expand Down
2 changes: 1 addition & 1 deletion JeraUtils/PullToRefresh/PullToRefreshView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class PullToRefreshView: UIView {
let podBundle = NSBundle(forClass: self)
if let bundleURL = podBundle.URLForResource("JeraUtils", withExtension: "bundle") {
if let bundle = NSBundle(URL: bundleURL) {
return bundle.loadNibNamed("PullToRefreshView", owner: nil, options: nil).first as! PullToRefreshView
return bundle.loadNibNamed("PullToRefreshView", owner: nil, options: nil)!.first as! PullToRefreshView
}else {
assertionFailure("Could not load the bundle")
}
Expand Down
10 changes: 6 additions & 4 deletions JeraUtils/Requests/TransformTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,12 @@ public class URLTransform: TransformType {
if let urlString = value as? String where urlString.characters.count > 0 {
if let UTF8URLString = urlString.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLQueryAllowedCharacterSet()) {
if let webSiteURL = NSURL(string: UTF8URLString) {
if webSiteURL.scheme.isEmpty {
let trimmedResourceSpecifier = webSiteURL.resourceSpecifier.stringByTrimmingCharactersInSet(NSCharacterSet(charactersInString: "/"))
if trimmedResourceSpecifier.characters.count > 0 {
return NSURL(string: "http://\(trimmedResourceSpecifier)") //for URLs without scheme
if let scheme = webSiteURL.scheme where scheme.isEmpty {
if let resourceSpecifier = webSiteURL.resourceSpecifier{
let trimmedResourceSpecifier = resourceSpecifier.stringByTrimmingCharactersInSet(NSCharacterSet(charactersInString: "/"))
if trimmedResourceSpecifier.characters.count > 0 {
return NSURL(string: "http://\(trimmedResourceSpecifier)") //for URLs without scheme
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions JeraUtils/WebView/JeraWebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public class JeraWebView: WKWebView {

addObservers()
}

required public init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}


private func addProgressView() {
Expand Down

0 comments on commit 0b48297

Please sign in to comment.