Skip to content

Commit

Permalink
Merge pull request #68 from Yalantis/feature/swift5.2
Browse files Browse the repository at this point in the history
Feature/swift5.2
  • Loading branch information
PravdaEvgen committed Apr 8, 2020
2 parents b2e6ed8 + 0882bef commit c026df0
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 82 deletions.
67 changes: 30 additions & 37 deletions MenuExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
5008F06C1A6D0B4E00D6B4EE /* SideMenu.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 50B42F261A6A8E9800B05352 /* SideMenu.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
5097E21E1A6A95CB002B4838 /* SideMenu.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50B42F261A6A8E9800B05352 /* SideMenu.framework */; };
188B7A1D2434A43400AD2C7E /* SideMenu.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 188B7A1B2434A42C00AD2C7E /* SideMenu.framework */; };
188B7A1E2434A43400AD2C7E /* SideMenu.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 188B7A1B2434A42C00AD2C7E /* SideMenu.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
D527A101E3BF9D807CC9609B /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = D527A8A79CD3995976B1E6E1 /* LaunchScreen.xib */; };
D527A20BFCB7C7B0E37A4763 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D527A0056D698FE36A57118C /* Main.storyboard */; };
D527A433F1D6C1CBE9A8CCFE /* ContentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D527AA09B1BD9459C6ADB97B /* ContentViewController.swift */; };
Expand All @@ -24,20 +24,13 @@
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
50B42F251A6A8E9800B05352 /* PBXContainerItemProxy */ = {
188B7A1A2434A42C00AD2C7E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 50B42F211A6A8E9800B05352 /* SideMenu.xcodeproj */;
containerPortal = 188B7A162434A42C00AD2C7E /* SideMenu.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 50B42F001A6A879C00B05352;
remoteInfo = SideMenu;
};
50B42F271A6A8EA300B05352 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 50B42F211A6A8E9800B05352 /* SideMenu.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 50B42EFF1A6A879C00B05352;
remoteInfo = SideMenu;
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -47,14 +40,14 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
5008F06C1A6D0B4E00D6B4EE /* SideMenu.framework in CopyFiles */,
188B7A1E2434A43400AD2C7E /* SideMenu.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
50B42F211A6A8E9800B05352 /* SideMenu.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SideMenu.xcodeproj; path = ../../SideMenu/SideMenu.xcodeproj; sourceTree = "<group>"; };
188B7A162434A42C00AD2C7E /* SideMenu.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = SideMenu.xcodeproj; sourceTree = SOURCE_ROOT; };
50B9664E1A25E40E00208F2E /* MenuExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MenuExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
50B966521A25E40E00208F2E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D527A0056D698FE36A57118C /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
Expand All @@ -76,34 +69,42 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
5097E21E1A6A95CB002B4838 /* SideMenu.framework in Frameworks */,
188B7A1D2434A43400AD2C7E /* SideMenu.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
50B42F201A6A8E8500B05352 /* Framework */ = {
188B7A172434A42C00AD2C7E /* Products */ = {
isa = PBXGroup;
children = (
50B42F211A6A8E9800B05352 /* SideMenu.xcodeproj */,
188B7A1B2434A42C00AD2C7E /* SideMenu.framework */,
);
name = Framework;
name = Products;
sourceTree = "<group>";
};
50B42F221A6A8E9800B05352 /* Products */ = {
188B7A1C2434A43400AD2C7E /* Frameworks */ = {
isa = PBXGroup;
children = (
50B42F261A6A8E9800B05352 /* SideMenu.framework */,
);
name = Products;
name = Frameworks;
sourceTree = "<group>";
};
50B42F201A6A8E8500B05352 /* Framework */ = {
isa = PBXGroup;
children = (
188B7A162434A42C00AD2C7E /* SideMenu.xcodeproj */,
);
name = Framework;
sourceTree = "<group>";
};
50B966451A25E40E00208F2E = {
isa = PBXGroup;
children = (
50B966501A25E40E00208F2E /* MenuExample */,
50B9664F1A25E40E00208F2E /* Products */,
188B7A1C2434A43400AD2C7E /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -223,7 +224,6 @@
buildRules = (
);
dependencies = (
50B42F281A6A8EA300B05352 /* PBXTargetDependency */,
);
name = MenuExample;
productName = Menu;
Expand All @@ -242,24 +242,25 @@
TargetAttributes = {
50B9664D1A25E40E00208F2E = {
CreatedOnToolsVersion = 6.1;
LastSwiftMigration = 0800;
LastSwiftMigration = 1140;
};
};
};
buildConfigurationList = 50B966491A25E40E00208F2E /* Build configuration list for PBXProject "MenuExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 50B966451A25E40E00208F2E;
productRefGroup = 50B9664F1A25E40E00208F2E /* Products */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = 50B42F221A6A8E9800B05352 /* Products */;
ProjectRef = 50B42F211A6A8E9800B05352 /* SideMenu.xcodeproj */;
ProductGroup = 188B7A172434A42C00AD2C7E /* Products */;
ProjectRef = 188B7A162434A42C00AD2C7E /* SideMenu.xcodeproj */;
},
);
projectRoot = "";
Expand All @@ -270,11 +271,11 @@
/* End PBXProject section */

/* Begin PBXReferenceProxy section */
50B42F261A6A8E9800B05352 /* SideMenu.framework */ = {
188B7A1B2434A42C00AD2C7E /* SideMenu.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = SideMenu.framework;
remoteRef = 50B42F251A6A8E9800B05352 /* PBXContainerItemProxy */;
remoteRef = 188B7A1A2434A42C00AD2C7E /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
Expand Down Expand Up @@ -311,14 +312,6 @@
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
50B42F281A6A8EA300B05352 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = SideMenu;
targetProxy = 50B42F271A6A8EA300B05352 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin XCBuildConfiguration section */
50B9666B1A25E40E00208F2E /* Debug */ = {
isa = XCBuildConfiguration;
Expand Down Expand Up @@ -432,7 +425,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.yalantis.ios.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = MenuExample;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -445,7 +438,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.yalantis.ios.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = MenuExample;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
LastUpgradeVersion = "1140"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -27,8 +27,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -38,8 +36,8 @@
ReferencedContainer = "container:MenuExample.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -61,8 +59,6 @@
ReferencedContainer = "container:MenuExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Check this <a href="https://www.behance.net/gallery/20411445/Mobile-Animations-I
## Requirements

- iOS 7+
- Swift 4.2
- Xcode 9
- Swift 5
- Xcode 11

## Installation

Expand All @@ -23,7 +23,7 @@ Check this <a href="https://www.behance.net/gallery/20411445/Mobile-Animations-I
Simply add the following line to your Podfile:

```ruby
pod 'YALSideMenu', '~> 2.1'
pod 'YALSideMenu', '~> 2.0.1'
```

*(CocoaPods v1.1 or later is required)*
Expand Down Expand Up @@ -53,7 +53,7 @@ pod 'YALSideMenu', '~> 2.1'

```swift
class MyFancyMenuViewController: UIViewController, Menu {
@IBOutlet var menuItems = [UIView] ()
@IBOutlet var menuItems = [UIView] ()
}
```

Expand All @@ -63,25 +63,28 @@ pod 'YALSideMenu', '~> 2.1'
```swift
import SideMenu
class ContentViewController: UIViewController {
var menuAnimator : MenuTransitionAnimator!
var menuAnimator : MenuTransitionAnimator!
}
```
5. Initialize an animator for presentation with parameters

```swift
menuAnimator = MenuTransitionAnimator(mode: .presentation, shouldPassEventsOutsideMenu: false) { [unowned self] in
self.dismiss(animated: true, completion: nil)
self.dismiss(animated: true, completion: nil)
}
```

If you want, for example, to dismiss your menu when a tap outside menu takes place, you should pass 'false' to 'shouldPassEventsOutsideMenu' flag and assign a 'tappedOutsideHandler'.In fact, you are free to do whatever you want when a tap outside menu occurs or, if you want to have access to your content view controller, just pass 'true' and assign 'tappedOutsideHandler' to nil.
If you want, for example, to dismiss your menu when a tap outside menu takes place, you should pass `false` to `shouldPassEventsOutsideMenu` flag and assign a `tappedOutsideHandler`.In fact, you are free to do whatever you want when a tap outside menu occurs or, if you want to have access to your content view controller, just pass `true` and assign `tappedOutsideHandler` to nil.

It's possible to specify menu position starting from version `2.0.2`. To position menu on the left side you should pass `.left` to `position` in `MenuTransitionAnimator` init. To position menu on the right side - pass `.right` accordingly.

6. Implement class of UIViewControllerTransitioningDelegate that will return our menuAnimator from method animationControllerForPresentedController and assign it to transitioningDelegate of menu view controller(Don't forget to set .Custom modal presentation style). To dismiss menu you should return MenuTransitionAnimator(mode: .Dismissal) from animationControllerForDismissedController method.

```swift
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let menu = segue.destination as! MenuViewController
menu.transitioningDelegate = self
menu.modalPresentationStyle = .custom
let menu = segue.destination as! MenuViewController
menu.transitioningDelegate = self
menu.modalPresentationStyle = .custom
}

func animationController(forPresented presented: UIViewController, presenting _: UIViewController,
Expand Down
11 changes: 7 additions & 4 deletions SideMenu.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@
attributes = {
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 1000;
LastUpgradeCheck = 1140;
ORGANIZATIONNAME = Yalantis;
TargetAttributes = {
50B42EFF1A6A879C00B05352 = {
CreatedOnToolsVersion = 6.1.1;
LastSwiftMigration = 0800;
LastSwiftMigration = 1140;
};
};
};
Expand All @@ -123,6 +123,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = 50B42EF61A6A879C00B05352;
Expand Down Expand Up @@ -163,6 +164,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -222,6 +224,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -286,7 +289,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.yalantis.ios.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -306,7 +309,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.yalantis.ios.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
24 changes: 10 additions & 14 deletions SideMenu.xcodeproj/xcshareddata/xcschemes/SideMenu.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
LastUpgradeVersion = "1140"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -41,6 +41,15 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "50B42EFF1A6A879C00B05352"
BuildableName = "SideMenu.framework"
BlueprintName = "SideMenu"
ReferencedContainer = "container:SideMenu.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -53,17 +62,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "50B42EFF1A6A879C00B05352"
BuildableName = "SideMenu.framework"
BlueprintName = "SideMenu"
ReferencedContainer = "container:SideMenu.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -84,8 +82,6 @@
ReferencedContainer = "container:SideMenu.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Loading

0 comments on commit c026df0

Please sign in to comment.