Skip to content

Commit 6f0e360

Browse files
Merge pull request #6 from SimformSolutionsPvtLtd/develop
Develop
2 parents f976af3 + 04bf6f9 commit 6f0e360

16 files changed

+85
-2
lines changed

.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/SSCustomSideMenu.xcodeproj/project.pbxproj

+8
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,12 @@
484484
MODULE_NAME = ExampleApp;
485485
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
486486
PRODUCT_NAME = "$(TARGET_NAME)";
487+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
488+
SUPPORTS_MACCATALYST = NO;
489+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
487490
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
488491
SWIFT_VERSION = 4.0;
492+
TARGETED_DEVICE_FAMILY = "1,2";
489493
};
490494
name = Debug;
491495
};
@@ -500,8 +504,12 @@
500504
MODULE_NAME = ExampleApp;
501505
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
502506
PRODUCT_NAME = "$(TARGET_NAME)";
507+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
508+
SUPPORTS_MACCATALYST = NO;
509+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
503510
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
504511
SWIFT_VERSION = 4.0;
512+
TARGETED_DEVICE_FAMILY = "1,2";
505513
};
506514
name = Release;
507515
};

Example/SSCustomSideMenu/Info.plist

+7
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,15 @@
3232
</array>
3333
<key>UISupportedInterfaceOrientations</key>
3434
<array>
35+
<string>UIInterfaceOrientationLandscapeLeft</string>
3536
<string>UIInterfaceOrientationPortrait</string>
37+
</array>
38+
<key>UISupportedInterfaceOrientations~ipad</key>
39+
<array>
3640
<string>UIInterfaceOrientationLandscapeLeft</string>
41+
<string>UIInterfaceOrientationLandscapeRight</string>
42+
<string>UIInterfaceOrientationPortrait</string>
43+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
3744
</array>
3845
</dict>
3946
</plist>

Package.swift

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// swift-tools-version: 5.6
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "SSCustomSideMenu",
8+
platforms: [.iOS(.v13)],
9+
products: [
10+
// Products define the executables and libraries a package produces, and make them visible to other packages.
11+
.library(
12+
name: "SSCustomSideMenu",
13+
targets: ["SSCustomSideMenu"]),
14+
],
15+
dependencies: [
16+
// Dependencies declare other packages that this package depends on.
17+
// .package(url: /* package url */, from: "1.0.0"),
18+
],
19+
targets: [
20+
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
21+
// Targets can depend on other targets in this package, and on products in packages this package depends on.
22+
.target(
23+
name: "SSCustomSideMenu",
24+
dependencies: [])
25+
]
26+
)

SSCustomSideMenu.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'SSCustomSideMenu'
11-
s.version = '0.1.1'
11+
s.version = '1.0.0'
1212
s.summary = 'Custom Side menu control'
1313

1414
# This description is used to generate tags and improve search results.
@@ -31,7 +31,7 @@ Pod::Spec.new do |s|
3131
s.ios.deployment_target = '11.0'
3232
s.swift_versions = '5.0'
3333

34-
s.source_files = 'SSCustomSideMenu/Classes/**/*'
34+
s.source_files = 'Sources/SSCustomSideMenu/Classes/**/*'
3535

3636
# s.resource_bundles = {
3737
# 'SSCustomSideMenu' => ['SSCustomSideMenu/Assets/*.png']

SSCustomSideMenu/Classes/SSSideMenuContainerViewController.swift renamed to Sources/SSCustomSideMenu/Classes/SSSideMenuContainerViewController.swift

+29
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,35 @@ open class SSSideMenuContainerViewController: UIViewController {
4747
}
4848
}
4949

50+
open override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
51+
super.viewWillTransition(to: size, with: coordinator)
52+
if isExpanded {
53+
tapGesture?.isEnabled = false
54+
UIView.animate(withDuration: ssMenuConfig.animationDuration, delay: 0, usingSpringWithDamping: ssMenuConfig.damping, initialSpringVelocity: 0, options: .curveEaseInOut, animations: { [weak self] in
55+
guard let self else { return }
56+
performCloseAnimation()
57+
}) { [weak self] (_) in
58+
guard let self else { return }
59+
switch ssMenuConfig.animationType {
60+
case .compress(_):
61+
load(self.ssMenuConfig.homeController, on: self.contentContainerView)
62+
default:
63+
break
64+
}
65+
imageView.removeFromSuperview()
66+
if let selectedIndexPath = ssMenuConfig.menuTable.selectedIndexPath?.row {
67+
didSelectMenuOption(menuOption: selectedIndexPath)
68+
}
69+
}
70+
}
71+
self.ssMenuConfig.menuWidth = UIScreen.main.bounds.width / 2
72+
coordinator.animate(alongsideTransition: { [weak self] _ in
73+
guard let self else { return }
74+
contentContainerView.frame = CGRect(x: 0, y: 0, width: view.bounds.size.width, height: view.bounds.size.height)
75+
imageView.frame = contentContainerView.frame
76+
}, completion: nil)
77+
}
78+
5079
// MARK: -
5180
// MARK: - Class Functions
5281

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
public struct SSCustomSideMenu {
2+
public private(set) var text = "Hello, World!"
3+
4+
public init() {
5+
}
6+
}

0 commit comments

Comments
 (0)