Skip to content
This repository was archived by the owner on Jun 17, 2018. It is now read-only.

Commit 621a604

Browse files
committed
Merge branch 'master' into swift3.0
Conflicts: Pod/Classes/MenuView.swift Pod/Classes/PagingMenuController.swift
2 parents 22c5eb2 + 3f266a9 commit 621a604

File tree

4 files changed

+49
-40
lines changed

4 files changed

+49
-40
lines changed

Example/PagingMenuControllerDemo.xcodeproj/project.pbxproj

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,13 @@
307307
isa = PBXNativeTarget;
308308
buildConfigurationList = 707C60FA1AFF822200BDAB0B /* Build configuration list for PBXNativeTarget "PagingMenuControllerDemo" */;
309309
buildPhases = (
310-
81D7254A1C3EA86418ABA06D /* 📦 Check Pods Manifest.lock */,
310+
81D7254A1C3EA86418ABA06D /* [CP] Check Pods Manifest.lock */,
311311
707C60D71AFF822100BDAB0B /* Sources */,
312312
707C60D81AFF822100BDAB0B /* Frameworks */,
313313
707C60D91AFF822100BDAB0B /* Resources */,
314314
70C505481B0058B10007571E /* Embed Frameworks */,
315-
8EBB653436FDCF3C48E9A04C /* 📦 Embed Pods Frameworks */,
316-
4912F03CF8BCA040ACEF6BB3 /* 📦 Copy Pods Resources */,
315+
8EBB653436FDCF3C48E9A04C /* [CP] Embed Pods Frameworks */,
316+
4912F03CF8BCA040ACEF6BB3 /* [CP] Copy Pods Resources */,
317317
);
318318
buildRules = (
319319
);
@@ -328,12 +328,12 @@
328328
isa = PBXNativeTarget;
329329
buildConfigurationList = 707C60FD1AFF822200BDAB0B /* Build configuration list for PBXNativeTarget "PagingMenuControllerDemoTests" */;
330330
buildPhases = (
331-
064F5A6B604DDCD41EF6E479 /* 📦 Check Pods Manifest.lock */,
331+
064F5A6B604DDCD41EF6E479 /* [CP] Check Pods Manifest.lock */,
332332
707C60EC1AFF822200BDAB0B /* Sources */,
333333
707C60ED1AFF822200BDAB0B /* Frameworks */,
334334
707C60EE1AFF822200BDAB0B /* Resources */,
335-
EE6D7E4E867A74F09D5D2603 /* 📦 Embed Pods Frameworks */,
336-
A76777B0290FC45617EB6DD0 /* 📦 Copy Pods Resources */,
335+
EE6D7E4E867A74F09D5D2603 /* [CP] Embed Pods Frameworks */,
336+
A76777B0290FC45617EB6DD0 /* [CP] Copy Pods Resources */,
337337
);
338338
buildRules = (
339339
);
@@ -349,12 +349,12 @@
349349
isa = PBXNativeTarget;
350350
buildConfigurationList = EC7BA4171B524BB4007FB8A5 /* Build configuration list for PBXNativeTarget "PagingMenuControllerDemo2" */;
351351
buildPhases = (
352-
57D5C21541759D87796E93F9 /* 📦 Check Pods Manifest.lock */,
352+
57D5C21541759D87796E93F9 /* [CP] Check Pods Manifest.lock */,
353353
EC7BA3F31B524BB4007FB8A5 /* Sources */,
354354
EC7BA3F41B524BB4007FB8A5 /* Frameworks */,
355355
EC7BA3F51B524BB4007FB8A5 /* Resources */,
356-
229F81CB8BD76DBAF1B4719F /* 📦 Embed Pods Frameworks */,
357-
DB74A7466A8710147CF4667C /* 📦 Copy Pods Resources */,
356+
229F81CB8BD76DBAF1B4719F /* [CP] Embed Pods Frameworks */,
357+
DB74A7466A8710147CF4667C /* [CP] Copy Pods Resources */,
358358
);
359359
buildRules = (
360360
);
@@ -504,134 +504,134 @@
504504
/* End PBXResourcesBuildPhase section */
505505

506506
/* Begin PBXShellScriptBuildPhase section */
507-
064F5A6B604DDCD41EF6E479 /* 📦 Check Pods Manifest.lock */ = {
507+
064F5A6B604DDCD41EF6E479 /* [CP] Check Pods Manifest.lock */ = {
508508
isa = PBXShellScriptBuildPhase;
509509
buildActionMask = 2147483647;
510510
files = (
511511
);
512512
inputPaths = (
513513
);
514-
name = "📦 Check Pods Manifest.lock";
514+
name = "[CP] Check Pods Manifest.lock";
515515
outputPaths = (
516516
);
517517
runOnlyForDeploymentPostprocessing = 0;
518518
shellPath = /bin/sh;
519519
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
520520
showEnvVarsInLog = 0;
521521
};
522-
229F81CB8BD76DBAF1B4719F /* 📦 Embed Pods Frameworks */ = {
522+
229F81CB8BD76DBAF1B4719F /* [CP] Embed Pods Frameworks */ = {
523523
isa = PBXShellScriptBuildPhase;
524524
buildActionMask = 2147483647;
525525
files = (
526526
);
527527
inputPaths = (
528528
);
529-
name = "📦 Embed Pods Frameworks";
529+
name = "[CP] Embed Pods Frameworks";
530530
outputPaths = (
531531
);
532532
runOnlyForDeploymentPostprocessing = 0;
533533
shellPath = /bin/sh;
534534
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PagingMenuControllerDemo2/Pods-PagingMenuControllerDemo2-frameworks.sh\"\n";
535535
showEnvVarsInLog = 0;
536536
};
537-
4912F03CF8BCA040ACEF6BB3 /* 📦 Copy Pods Resources */ = {
537+
4912F03CF8BCA040ACEF6BB3 /* [CP] Copy Pods Resources */ = {
538538
isa = PBXShellScriptBuildPhase;
539539
buildActionMask = 2147483647;
540540
files = (
541541
);
542542
inputPaths = (
543543
);
544-
name = "📦 Copy Pods Resources";
544+
name = "[CP] Copy Pods Resources";
545545
outputPaths = (
546546
);
547547
runOnlyForDeploymentPostprocessing = 0;
548548
shellPath = /bin/sh;
549549
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PagingMenuControllerDemo/Pods-PagingMenuControllerDemo-resources.sh\"\n";
550550
showEnvVarsInLog = 0;
551551
};
552-
57D5C21541759D87796E93F9 /* 📦 Check Pods Manifest.lock */ = {
552+
57D5C21541759D87796E93F9 /* [CP] Check Pods Manifest.lock */ = {
553553
isa = PBXShellScriptBuildPhase;
554554
buildActionMask = 2147483647;
555555
files = (
556556
);
557557
inputPaths = (
558558
);
559-
name = "📦 Check Pods Manifest.lock";
559+
name = "[CP] Check Pods Manifest.lock";
560560
outputPaths = (
561561
);
562562
runOnlyForDeploymentPostprocessing = 0;
563563
shellPath = /bin/sh;
564564
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
565565
showEnvVarsInLog = 0;
566566
};
567-
81D7254A1C3EA86418ABA06D /* 📦 Check Pods Manifest.lock */ = {
567+
81D7254A1C3EA86418ABA06D /* [CP] Check Pods Manifest.lock */ = {
568568
isa = PBXShellScriptBuildPhase;
569569
buildActionMask = 2147483647;
570570
files = (
571571
);
572572
inputPaths = (
573573
);
574-
name = "📦 Check Pods Manifest.lock";
574+
name = "[CP] Check Pods Manifest.lock";
575575
outputPaths = (
576576
);
577577
runOnlyForDeploymentPostprocessing = 0;
578578
shellPath = /bin/sh;
579579
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
580580
showEnvVarsInLog = 0;
581581
};
582-
8EBB653436FDCF3C48E9A04C /* 📦 Embed Pods Frameworks */ = {
582+
8EBB653436FDCF3C48E9A04C /* [CP] Embed Pods Frameworks */ = {
583583
isa = PBXShellScriptBuildPhase;
584584
buildActionMask = 2147483647;
585585
files = (
586586
);
587587
inputPaths = (
588588
);
589-
name = "📦 Embed Pods Frameworks";
589+
name = "[CP] Embed Pods Frameworks";
590590
outputPaths = (
591591
);
592592
runOnlyForDeploymentPostprocessing = 0;
593593
shellPath = /bin/sh;
594594
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PagingMenuControllerDemo/Pods-PagingMenuControllerDemo-frameworks.sh\"\n";
595595
showEnvVarsInLog = 0;
596596
};
597-
A76777B0290FC45617EB6DD0 /* 📦 Copy Pods Resources */ = {
597+
A76777B0290FC45617EB6DD0 /* [CP] Copy Pods Resources */ = {
598598
isa = PBXShellScriptBuildPhase;
599599
buildActionMask = 2147483647;
600600
files = (
601601
);
602602
inputPaths = (
603603
);
604-
name = "📦 Copy Pods Resources";
604+
name = "[CP] Copy Pods Resources";
605605
outputPaths = (
606606
);
607607
runOnlyForDeploymentPostprocessing = 0;
608608
shellPath = /bin/sh;
609609
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PagingMenuControllerDemoTests/Pods-PagingMenuControllerDemoTests-resources.sh\"\n";
610610
showEnvVarsInLog = 0;
611611
};
612-
DB74A7466A8710147CF4667C /* 📦 Copy Pods Resources */ = {
612+
DB74A7466A8710147CF4667C /* [CP] Copy Pods Resources */ = {
613613
isa = PBXShellScriptBuildPhase;
614614
buildActionMask = 2147483647;
615615
files = (
616616
);
617617
inputPaths = (
618618
);
619-
name = "📦 Copy Pods Resources";
619+
name = "[CP] Copy Pods Resources";
620620
outputPaths = (
621621
);
622622
runOnlyForDeploymentPostprocessing = 0;
623623
shellPath = /bin/sh;
624624
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PagingMenuControllerDemo2/Pods-PagingMenuControllerDemo2-resources.sh\"\n";
625625
showEnvVarsInLog = 0;
626626
};
627-
EE6D7E4E867A74F09D5D2603 /* 📦 Embed Pods Frameworks */ = {
627+
EE6D7E4E867A74F09D5D2603 /* [CP] Embed Pods Frameworks */ = {
628628
isa = PBXShellScriptBuildPhase;
629629
buildActionMask = 2147483647;
630630
files = (
631631
);
632632
inputPaths = (
633633
);
634-
name = "📦 Embed Pods Frameworks";
634+
name = "[CP] Embed Pods Frameworks";
635635
outputPaths = (
636636
);
637637
runOnlyForDeploymentPostprocessing = 0;

Example/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ DEPENDENCIES:
66

77
EXTERNAL SOURCES:
88
PagingMenuController:
9-
:path: ../
9+
:path: "../"
1010

1111
SPEC CHECKSUMS:
1212
PagingMenuController: a47a9669760b95f630cc3ef28bdce104f9107d14
1313

1414
PODFILE CHECKSUM: 182e65100ed4f1fc8683837abd55ef28346367f5
1515

16-
COCOAPODS: 1.0.0
16+
COCOAPODS: 1.0.1

Pod/Classes/MenuView.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ open class MenuView: UIScrollView {
107107
let previousPage = currentPage
108108
let previousMenuItemView = currentMenuItemView
109109

110-
if let previousMenuItemView = previousMenuItemView , page != previousPage {
111-
viewDelegate?.willMoveToMenuItemView?(menuItemView, previousMenuItemView: previousMenuItemView)
110+
if let previousMenuItemView = previousMenuItemView,
111+
page != previousPage {
112+
viewDelegate?.willMoveToMenuItemView(menuItemView, previousMenuItemView: previousMenuItemView)
112113
}
113114

114115
updateCurrentPage(page)
@@ -137,8 +138,9 @@ open class MenuView: UIScrollView {
137138
self!.alpha = 1
138139
}
139140

140-
if let previousMenuItemView = previousMenuItemView , page != previousPage {
141-
self!.viewDelegate?.didMoveToMenuItemView?(self!.currentMenuItemView, previousMenuItemView: previousMenuItemView)
141+
if let previousMenuItemView = previousMenuItemView,
142+
page != previousPage {
143+
self!.viewDelegate?.didMoveToMenuItemView(self!.currentMenuItemView, previousMenuItemView: previousMenuItemView)
142144
}
143145
}
144146
}

Pod/Classes/PagingMenuController.swift

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@
88

99
import UIKit
1010

11-
@objc public protocol PagingMenuControllerDelegate: class {
12-
@objc optional func willMoveToPageMenuController(_ menuController: UIViewController, previousMenuController: UIViewController)
13-
@objc optional func didMoveToPageMenuController(_ menuController: UIViewController, previousMenuController: UIViewController)
14-
@objc optional func willMoveToMenuItemView(_ menuItemView: MenuItemView, previousMenuItemView: MenuItemView)
15-
@objc optional func didMoveToMenuItemView(_ menuItemView: MenuItemView, previousMenuItemView: MenuItemView)
11+
public protocol PagingMenuControllerDelegate: class {
12+
func willMoveToPageMenuController(_ menuController: UIViewController, previousMenuController: UIViewController)
13+
func didMoveToPageMenuController(_ menuController: UIViewController, previousMenuController: UIViewController)
14+
func willMoveToMenuItemView(_ menuItemView: MenuItemView, previousMenuItemView: MenuItemView)
15+
func didMoveToMenuItemView(_ menuItemView: MenuItemView, previousMenuItemView: MenuItemView)
16+
}
17+
18+
public extension PagingMenuControllerDelegate {
19+
func willMoveToPageMenuController(menuController: UIViewController, previousMenuController: UIViewController) {}
20+
func didMoveToPageMenuController(menuController: UIViewController, previousMenuController: UIViewController) {}
21+
func willMoveToMenuItemView(menuItemView: MenuItemView, previousMenuItemView: MenuItemView) {}
22+
func didMoveToMenuItemView(menuItemView: MenuItemView, previousMenuItemView: MenuItemView) {}
1623
}
1724

1825
internal let MinimumSupportedViewCount = 1
@@ -159,7 +166,7 @@ open class PagingMenuController: UIViewController, PagingValidator {
159166

160167
let nextPage = page % pagingViewController.controllers.count
161168
let nextPagingViewController = pagingViewController.controllers[nextPage]
162-
delegate?.willMoveToPageMenuController?(nextPagingViewController, previousMenuController: previousViewController)
169+
delegate?.willMoveToPageMenuController(nextPagingViewController, previousMenuController: previousViewController)
163170
menuView?.moveToMenu(page)
164171

165172
pagingViewController.updateCurrentPage(nextPage)
@@ -175,7 +182,7 @@ open class PagingMenuController: UIViewController, PagingValidator {
175182
// show paging views
176183
self?.showPagingMenuControllers()
177184

178-
self?.delegate?.didMoveToPageMenuController?(nextPagingViewController, previousMenuController: previousViewController)
185+
self?.delegate?.didMoveToPageMenuController(nextPagingViewController, previousMenuController: previousViewController)
179186
}
180187
}
181188

0 commit comments

Comments
 (0)