Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes of the library will be documented in this file.
## 2.2
### Added
- Ability to globally change the drop shadow of the current content view while the menu is open (#61)
- New sample project controller to tweak the transition settings
- Status bar color can now be updated on a controller by controller basis

### Changed
- Changed default `contentScale` value from `0.88` to `0.86`
- Updated sample project to better reflect the README demo gif

## 2.1 - [2017-10-23]
### Added
Expand Down
4 changes: 2 additions & 2 deletions InteractiveSideMenu.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = is.handsome.InteractiveSideMenu;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -300,7 +300,7 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = is.handsome.InteractiveSideMenu;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
12 changes: 10 additions & 2 deletions Sample/Sample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
D4C58476202DD6B0006EF43A /* Storyboardable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C58475202DD6B0006EF43A /* Storyboardable.swift */; };
D4C58478202DD6DF006EF43A /* TabBarViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D4C58477202DD6DF006EF43A /* TabBarViewController.storyboard */; };
D4C5847F202DD896006EF43A /* SampleMenuViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D4C5847E202DD896006EF43A /* SampleMenuViewController.storyboard */; };
D4C58482202DECB4006EF43A /* TweakViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C58481202DECB4006EF43A /* TweakViewController.swift */; };
D4C58484202DECBB006EF43A /* TweakViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D4C58483202DECBB006EF43A /* TweakViewController.storyboard */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -79,6 +81,8 @@
D4C58475202DD6B0006EF43A /* Storyboardable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Storyboardable.swift; sourceTree = "<group>"; };
D4C58477202DD6DF006EF43A /* TabBarViewController.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = TabBarViewController.storyboard; sourceTree = "<group>"; };
D4C5847E202DD896006EF43A /* SampleMenuViewController.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = SampleMenuViewController.storyboard; sourceTree = "<group>"; };
D4C58481202DECB4006EF43A /* TweakViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TweakViewController.swift; sourceTree = "<group>"; };
D4C58483202DECBB006EF43A /* TweakViewController.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = TweakViewController.storyboard; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -147,6 +151,8 @@
D4C58472202DD647006EF43A /* KittyViewController.storyboard */,
9A6755021EA8E30C00F0C71D /* TabBarViewController.swift */,
D4C58477202DD6DF006EF43A /* TabBarViewController.storyboard */,
D4C58481202DECB4006EF43A /* TweakViewController.swift */,
D4C58483202DECBB006EF43A /* TweakViewController.storyboard */,
);
path = "Menu Controllers";
sourceTree = "<group>";
Expand Down Expand Up @@ -257,6 +263,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D4C58484202DECBB006EF43A /* TweakViewController.storyboard in Resources */,
D4C5847F202DD896006EF43A /* SampleMenuViewController.storyboard in Resources */,
881EF0B21E3102E30035DEB4 /* LaunchScreen.storyboard in Resources */,
D4C58473202DD647006EF43A /* KittyViewController.storyboard in Resources */,
Expand All @@ -280,6 +287,7 @@
881EF0BF1E31037D0035DEB4 /* SampleMenuViewController.swift in Sources */,
9A6755031EA8E30C00F0C71D /* TabBarViewController.swift in Sources */,
881EF0A81E3102E30035DEB4 /* AppDelegate.swift in Sources */,
D4C58482202DECB4006EF43A /* TweakViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -415,7 +423,7 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Sample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = is.handsome.Sample;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -429,7 +437,7 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Sample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = is.handsome.Sample;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
9 changes: 3 additions & 6 deletions Sample/Sample/Controllers/HostViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ import InteractiveSideMenu
*/
class HostViewController: MenuContainerViewController {

override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}

override var prefersStatusBarHidden: Bool {
return false
}
Expand Down Expand Up @@ -67,8 +63,9 @@ class HostViewController: MenuContainerViewController {

private func contentControllers() -> [UIViewController] {
let kittyController = KittyViewController.storyboardViewController()
let tabController = TabBarViewController.storyboardTabBarController()
let tabController = TabBarViewController.storyboardNavigationController()
let tweakController = TweakViewController.storyboardNavigationController()

return [kittyController, tabController]
return [kittyController, tabController, tweakController]
}
}
28 changes: 16 additions & 12 deletions Sample/Sample/Controllers/SampleMenuViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class SampleMenuViewController: MenuViewController, Storyboardable {
@IBOutlet fileprivate weak var tableView: UITableView!
@IBOutlet fileprivate weak var avatarImageView: UIImageView!
@IBOutlet fileprivate weak var avatarImageViewCenterXConstraint: NSLayoutConstraint!
private var gradientLayer = CAGradientLayer()

private var gradientApplied: Bool = false

Expand All @@ -50,19 +51,22 @@ class SampleMenuViewController: MenuViewController, Storyboardable {
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()

if !gradientApplied {
gradientApplied = true
avatarImageViewCenterXConstraint.constant = -(menuContainerViewController?.transitionOptions.visibleContentWidth ?? 0.0)/2

let gradient = CAGradientLayer()
let topColor = UIColor(red: 16.0/255.0, green: 12.0/255.0, blue: 54.0/255.0, alpha: 1.0)
let bottomColor = UIColor(red: 57.0/255.0, green: 33.0/255.0, blue: 61.0/255.0, alpha: 1.0)
gradient.startPoint = CGPoint(x: 0.0, y: 0.0)
gradient.endPoint = CGPoint(x: 1.0, y: 1.0)
gradient.colors = [topColor.cgColor, bottomColor.cgColor]
gradient.frame = view.bounds
view.layer.insertSublayer(gradient, at: 0)
avatarImageViewCenterXConstraint.constant = -(menuContainerViewController?.transitionOptions.visibleContentWidth ?? 0.0)/2

if gradientLayer.superlayer != nil {
gradientLayer.removeFromSuperlayer()
}
let topColor = UIColor(red: 16.0/255.0, green: 12.0/255.0, blue: 54.0/255.0, alpha: 1.0)
let bottomColor = UIColor(red: 57.0/255.0, green: 33.0/255.0, blue: 61.0/255.0, alpha: 1.0)
gradientLayer.startPoint = CGPoint(x: 0.0, y: 0.0)
gradientLayer.endPoint = CGPoint(x: 1.0, y: 1.0)
gradientLayer.colors = [topColor.cgColor, bottomColor.cgColor]
gradientLayer.frame = view.bounds
view.layer.insertSublayer(gradientLayer, at: 0)
}

deinit{
print()
}
}

Expand Down
18 changes: 9 additions & 9 deletions Sample/Sample/Menu Controllers/KittyViewController.storyboard
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="kCe-tA-DYp">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="kCe-tA-DYp">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Kitty-->
<scene sceneID="XXc-3z-hj0">
<objects>
<viewController storyboardIdentifier="Kitty" title="Kitty" id="kCe-tA-DYp" customClass="KittyViewController" customModule="Sample" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="MnU-2i-clD"/>
<viewControllerLayoutGuide type="bottom" id="7Ag-j5-qwW"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="bee-0f-QMn">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Expand All @@ -27,8 +25,8 @@
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8q9-2m-oaU">
<rect key="frame" x="6" y="20" width="44" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="6pE-SZ-sng"/>
<constraint firstAttribute="width" constant="44" id="ezd-p9-AZV"/>
<constraint firstAttribute="width" secondItem="8q9-2m-oaU" secondAttribute="height" multiplier="1:1" id="z7n-lH-ezv"/>
</constraints>
<state key="normal" image="Menu"/>
<connections>
Expand All @@ -38,13 +36,15 @@
</subviews>
<constraints>
<constraint firstItem="7ls-Ss-Had" firstAttribute="top" secondItem="bee-0f-QMn" secondAttribute="top" id="5aB-JJ-2xL"/>
<constraint firstItem="7Ag-j5-qwW" firstAttribute="top" secondItem="7ls-Ss-Had" secondAttribute="bottom" id="D8s-GM-dI1"/>
<constraint firstAttribute="bottom" secondItem="7ls-Ss-Had" secondAttribute="bottom" id="D8s-GM-dI1"/>
<constraint firstAttribute="trailing" secondItem="7ls-Ss-Had" secondAttribute="trailing" id="INM-nv-WJb"/>
<constraint firstItem="8q9-2m-oaU" firstAttribute="top" secondItem="bee-0f-QMn" secondAttribute="top" constant="20" id="JRX-iP-1mR"/>
<constraint firstItem="8q9-2m-oaU" firstAttribute="leading" secondItem="bee-0f-QMn" secondAttribute="leading" constant="6" id="T0F-XP-Eic"/>
<constraint firstItem="8q9-2m-oaU" firstAttribute="top" secondItem="Kc9-m1-lM2" secondAttribute="top" id="JRX-iP-1mR"/>
<constraint firstItem="8q9-2m-oaU" firstAttribute="leading" secondItem="Kc9-m1-lM2" secondAttribute="leading" constant="6" id="T0F-XP-Eic"/>
<constraint firstItem="7ls-Ss-Had" firstAttribute="leading" secondItem="bee-0f-QMn" secondAttribute="leading" id="l1Y-yB-aKr"/>
</constraints>
<viewLayoutGuide key="safeArea" id="Kc9-m1-lM2"/>
</view>
<navigationItem key="navigationItem" id="fSg-K2-jW4"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Obq-0h-SGM" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
Expand Down
9 changes: 6 additions & 3 deletions Sample/Sample/Menu Controllers/KittyViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@
import UIKit
import InteractiveSideMenu

/*
/**
KittyViewController is a controller relevant one of the side menu items. To indicate this it adopts `SideMenuItemContent` protocol.
*/
class KittyViewController: UIViewController, SideMenuItemContent, Storyboardable {

/* Show side menu on menu button click
*/
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}

// Show side menu on menu button click
@IBAction func openMenu(_ sender: UIButton) {
showSideMenu()
}
Expand Down
Loading