Skip to content

Commit

Permalink
Fixed warning
Browse files Browse the repository at this point in the history
  • Loading branch information
arturdev committed May 18, 2020
1 parent f9065c6 commit 2c0d94d
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion AMSlideMenu.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "AMSlideMenu"
s.version = "2.0.1"
s.version = "2.0.2"
s.swift_version = '5.1'
s.summary = "Easy slide menu with high customization for ios"
s.platform = :ios, '10.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

//
// AMSlideMenuMainVC.swift
// AMSlideMenuMainViewController.swift
// AMSlideMenu
//
// The MIT License (MIT)
Expand Down Expand Up @@ -77,7 +77,7 @@ public extension AMSlideMenuDelegate {
}

@IBDesignable
open class AMSlideMenuMainVC: UIViewController {
open class AMSlideMenuMainViewController: UIViewController {

public private(set) var leftMenuVC: UIViewController?
public private(set) var rightMenuVC: UIViewController?
Expand Down Expand Up @@ -139,7 +139,7 @@ open class AMSlideMenuMainVC: UIViewController {
view.backgroundColor = .clear
view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
view.isUserInteractionEnabled = false
view.layer.zPosition = CGFloat.greatestFiniteMagnitude - 1
view.layer.zPosition = CGFloat(Float.greatestFiniteMagnitude) - 1
view.tag = 1000
return view
}()
Expand All @@ -148,11 +148,11 @@ open class AMSlideMenuMainVC: UIViewController {
super.viewDidLoad()
setupContent()
NotificationCenter.default.addObserver(self,
selector: #selector(AMSlideMenuMainVC.handleShowLeftMenuNote),
selector: #selector(AMSlideMenuMainViewController.handleShowLeftMenuNote),
name: .showLeftMenu,
object: nil)
NotificationCenter.default.addObserver(self,
selector: #selector(AMSlideMenuMainVC.handleShowRightMenuNote),
selector: #selector(AMSlideMenuMainViewController.handleShowRightMenuNote),
name: .showRightMenu,
object: nil)

Expand Down Expand Up @@ -487,7 +487,7 @@ open class AMSlideMenuMainVC: UIViewController {
}
}

extension AMSlideMenuMainVC: UIGestureRecognizerDelegate {
extension AMSlideMenuMainViewController: UIGestureRecognizerDelegate {
open func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
if gestureRecognizer == leftMenuPanGestureRecognizer || gestureRecognizer == rightMenuPanGestureRecognizer || gestureRecognizer == contentPanGestureRecognizer {
if let pan = gestureRecognizer as? UIPanGestureRecognizer {
Expand Down Expand Up @@ -558,7 +558,7 @@ extension AMSlideMenuMainVC: UIGestureRecognizerDelegate {
}
}

extension AMSlideMenuMainVC {
extension AMSlideMenuMainViewController {
public enum MenuState {
case closed
case leftOpened
Expand Down
12 changes: 6 additions & 6 deletions AMSlideMenu/Extensions/UIViewController+AMExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ fileprivate struct AssociationKeys {

public extension UIViewController {

weak var slideMenuMainVC: AMSlideMenuMainVC? {
weak var slideMenuMainVC: AMSlideMenuMainViewController? {
get {
let vc = objc_getAssociatedObject(self, &AssociationKeys.slideMenuMainVCKey) as? AMSlideMenuMainVC
let vc = objc_getAssociatedObject(self, &AssociationKeys.slideMenuMainVCKey) as? AMSlideMenuMainViewController
if vc == nil && parent != nil {
return parent?.slideMenuMainVC
}
Expand All @@ -46,22 +46,22 @@ public extension UIViewController {
}

@objc func showLeftMenu(animated: Bool = true, completion handler: (()->Void)? = nil) {
guard !(self is AMSlideMenuMainVC) else { return }
guard !(self is AMSlideMenuMainViewController) else { return }
slideMenuMainVC?.showLeftMenu(animated: animated, completion: handler)
}

@objc func hideLeftMenu(animated: Bool = true, completion handler: (()->Void)? = nil) {
guard !(self is AMSlideMenuMainVC) else { return }
guard !(self is AMSlideMenuMainViewController) else { return }
slideMenuMainVC?.hideLeftMenu(animated: animated, completion: handler)
}

@objc func showRightMenu(animated: Bool = true, completion handler: (()->Void)? = nil) {
guard !(self is AMSlideMenuMainVC) else { return }
guard !(self is AMSlideMenuMainViewController) else { return }
slideMenuMainVC?.showRightMenu(animated: animated, completion: handler)
}

@objc func hideRightMenu(animated: Bool = true, completion handler: (()->Void)? = nil) {
guard !(self is AMSlideMenuMainVC) else { return }
guard !(self is AMSlideMenuMainViewController) else { return }
slideMenuMainVC?.hideRightMenu(animated: animated, completion: handler)
}
}
4 changes: 2 additions & 2 deletions AMSlideMenu/Segues/AMContentSegue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import UIKit

open class AMContentSegue: UIStoryboardSegue {
override open func perform() {
var mainVC:AMSlideMenuMainVC?
if let sourceVC = self.source as? AMSlideMenuMainVC {
var mainVC:AMSlideMenuMainViewController?
if let sourceVC = self.source as? AMSlideMenuMainViewController {
mainVC = sourceVC
} else if let sourceVC = self.source.slideMenuMainVC {
mainVC = sourceVC
Expand Down
2 changes: 1 addition & 1 deletion AMSlideMenu/Segues/AMLeftMenuSegue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import UIKit

open class AMLeftMenuSegue: UIStoryboardSegue {
override open func perform() {
guard let sourceVC = self.source as? AMSlideMenuMainVC else { return }
guard let sourceVC = self.source as? AMSlideMenuMainViewController else { return }

destination.slideMenuMainVC = sourceVC
destination.view.autoresizingMask = [.flexibleHeight, .flexibleWidth]
Expand Down
2 changes: 1 addition & 1 deletion AMSlideMenu/Segues/AMRightMenuSegue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import UIKit

class AMRightMenuSegue: UIStoryboardSegue {
override open func perform() {
guard let sourceVC = self.source as? AMSlideMenuMainVC else { return }
guard let sourceVC = self.source as? AMSlideMenuMainViewController else { return }

destination.slideMenuMainVC = sourceVC
destination.view.autoresizingMask = [.flexibleHeight, .flexibleWidth]
Expand Down
21 changes: 10 additions & 11 deletions AMSlideMenuExample/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2c0d94d

Please sign in to comment.