Skip to content

Commit

Permalink
fix for swift 4
Browse files Browse the repository at this point in the history
  • Loading branch information
cwnga committed Jan 24, 2018
1 parent 06519bb commit 814e556
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Classes/CAPSPageMenu+UIConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ extension CAPSPageMenu {
let controllerTitle : String? = controller.title

let titleText : String = controllerTitle != nil ? controllerTitle! : "Menu \(Int(index) + 1)"
let itemWidthRect : CGRect = (titleText as NSString).boundingRect(with: CGSize(width: 1000, height: 1000), options: NSStringDrawingOptions.usesLineFragmentOrigin, attributes: [NSFontAttributeName:configuration.menuItemFont], context: nil)
let itemWidthRect : CGRect = (titleText as NSString).boundingRect(with: CGSize(width: 1000, height: 1000), options: NSStringDrawingOptions.usesLineFragmentOrigin, attributes: [NSAttributedStringKey.font:configuration.menuItemFont], context: nil)
configuration.menuItemWidth = itemWidthRect.width

menuItemFrame = CGRect(x: totalMenuItemWidthIfDifferentWidths + configuration.menuMargin + (configuration.menuMargin * index), y: 0.0, width: configuration.menuItemWidth, height: configuration.menuHeight)
Expand Down
2 changes: 1 addition & 1 deletion Classes/CAPSPageMenu+UIGestureRecognizerDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import UIKit

extension CAPSPageMenu : UIGestureRecognizerDelegate {
func handleMenuItemTap(_ gestureRecognizer : UITapGestureRecognizer) {
@objc func handleMenuItemTap(_ gestureRecognizer : UITapGestureRecognizer) {
let tappedPoint : CGPoint = gestureRecognizer.location(in: menuScrollView)

if tappedPoint.y < menuScrollView.frame.height {
Expand Down
2 changes: 1 addition & 1 deletion Classes/CAPSPageMenu+UIScrollViewDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ extension CAPSPageMenu : UIScrollViewDelegate {
}
}

func scrollViewDidEndTapScrollingAnimation() {
@objc func scrollViewDidEndTapScrollingAnimation() {
// Call didMoveToPage delegate function
let currentController = controllerArray[currentPageIndex]
delegate?.didMoveToPage?(currentController, index: currentPageIndex)
Expand Down

0 comments on commit 814e556

Please sign in to comment.