Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 794767455a | |||
| 7359ee6801 | |||
| 0b62749bff | |||
| 7179713c18 | |||
| 60f6f204c1 | |||
| 98c5b2b3e3 | |||
| e8882a952d | |||
| efc2e11fb2 | |||
| 36662fa0f3 | |||
| dce89eb448 | |||
| 32f1101e86 | |||
| d25de76a92 |
@@ -0,0 +1,17 @@
|
||||
// swift-tools-version:5.0
|
||||
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
||||
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "SideMenu",
|
||||
products: [
|
||||
.library(name: "SideMenu", targets: ["SideMenu"])
|
||||
],
|
||||
dependencies: [],
|
||||
targets: [
|
||||
.target(name: "SideMenu", path: "Pod/Classes")
|
||||
],
|
||||
swiftLanguageVersions: [.v4_2, .v5]
|
||||
)
|
||||
|
||||
@@ -12,15 +12,15 @@ extension NSObject: InitializableClass {}
|
||||
internal extension UIView {
|
||||
|
||||
@discardableResult func untransformed(_ block: () -> CGFloat) -> CGFloat {
|
||||
let transform = self.transform
|
||||
self.transform = .identity
|
||||
let t = self.transform
|
||||
transform = .identity
|
||||
let value = block()
|
||||
self.transform = transform
|
||||
transform = t
|
||||
return value
|
||||
}
|
||||
|
||||
func bringToFront() {
|
||||
self.superview?.bringSubviewToFront(self)
|
||||
superview?.bringSubviewToFront(self)
|
||||
}
|
||||
|
||||
func untransform(_ block: () -> Void) {
|
||||
@@ -31,10 +31,10 @@ internal extension UIView {
|
||||
}
|
||||
|
||||
static func animationsEnabled(_ block: () -> Void) {
|
||||
let areAnimationsEnabled = UIView.areAnimationsEnabled
|
||||
UIView.setAnimationsEnabled(true)
|
||||
let a = areAnimationsEnabled
|
||||
setAnimationsEnabled(true)
|
||||
block()
|
||||
UIView.setAnimationsEnabled(areAnimationsEnabled)
|
||||
setAnimationsEnabled(a)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -607,7 +607,7 @@ private extension SideMenuNavigationController {
|
||||
NotificationCenter.default.removeObserver(self)
|
||||
|
||||
[UIApplication.willChangeStatusBarFrameNotification,
|
||||
UIApplication.didEnterBackgroundNotification].forEach {
|
||||
UIApplication.didEnterBackgroundNotification].forEach {
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleNotification), name: $0, object: nil)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
* **[Installation](#installation)**
|
||||
* [CocoaPods](#cocoapods)
|
||||
* [Carthage](#carthage)
|
||||
* [Swift Package Manager](#swift-package-manager)
|
||||
* **[Usage](#usage)**
|
||||
* [Code-less Storyboard Implementation](#code-less-storyboard-implementation)
|
||||
* [Code Implementation](#code-implementation)
|
||||
@@ -102,6 +103,18 @@ To integrate SideMenu into your Xcode project using Carthage, specify it in your
|
||||
github "jonkykong/SideMenu" "master"
|
||||
```
|
||||
|
||||
### Swift Package Manager
|
||||
|
||||
The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. It is in early development, but SideMenu does support its use on supported platforms.
|
||||
|
||||
Once you have your Swift package set up, adding SideMenu as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.
|
||||
|
||||
```swift
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/jonkykong/SideMenu.git", from: "6.0.0")
|
||||
]
|
||||
```
|
||||
|
||||
## Usage
|
||||
### Code-less Storyboard Implementation
|
||||
1. Create a Navigation Controller for a side menu. Set the `Custom Class` of the Navigation Controller to be `SideMenuNavigationController` in the **Identity Inspector**. Set the `Module` to `SideMenu` (ignore this step if you've manually added SideMenu to your project). Create a Root View Controller for the Navigation Controller (shown as a UITableViewController below). Set up any Triggered Segues you want in that view controller.
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "SideMenu"
|
||||
s.version = "6.2.8"
|
||||
s.version = "6.3.1"
|
||||
s.summary = "Simple side menu control for iOS in Swift inspired by Facebook. Right and Left sides. No coding required."
|
||||
|
||||
# This description is used to generate tags and improve search results.
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
8432CC0122FFBCF4003D2BBD /* ExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8432CC0322FFBCF5003D2BBD /* ExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleTests.swift; sourceTree = "<group>"; };
|
||||
8432CC0522FFBCF5003D2BBD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
849F7B67232104BD005DEB6A /* SideMenu.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SideMenu.h; path = "Pods/Target Support Files/SideMenu/SideMenu.h"; sourceTree = "<group>"; };
|
||||
849F7B67232104BD005DEB6A /* SideMenu.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SideMenu.h; path = SideMenu/SideMenu.h; sourceTree = "<group>"; };
|
||||
849F7B8823210C9A005DEB6A /* UITableViewVibrantCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UITableViewVibrantCell.swift; path = Pod/Classes/UITableViewVibrantCell.swift; sourceTree = "<group>"; };
|
||||
849F7B8923210C9A005DEB6A /* SideMenuTransitionController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SideMenuTransitionController.swift; path = Pod/Classes/SideMenuTransitionController.swift; sourceTree = "<group>"; };
|
||||
849F7B8A23210C9A005DEB6A /* SideMenuAnimationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SideMenuAnimationController.swift; path = Pod/Classes/SideMenuAnimationController.swift; sourceTree = "<group>"; };
|
||||
|
||||
Reference in New Issue
Block a user