Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated the sidepanel controller to use a own gesture recognizer that…

… only allow horzontal gestures

change to use the gesture recognizers velocity instead of a self calculated momentum
removed some duplicated code
changed that the left and right views are always added as subview, but where hidden if the menu opens on the opposite side
  • Loading branch information...
commit 52614d8dab75fcb098fbe62af2693e6926174839 1 parent fb64e5b
@renep renep authored
View
5 .idea/find.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="OCFindUsagesOptions" text="true" ivars="false" properties="true" derivedClasses="false" />
+</project>
+
View
270 Core/Source/iOS/DTSidePanel/DTSidePanelController.m
@@ -12,6 +12,7 @@
#import "UIView+DTFoundation.h"
#import "UIViewController+DTSidePanelController.h"
#import "DTLog.h"
+#import "DTSidePanelPanGestureRecognizer.h"
@interface UIViewController () // private setter
- (void)setSidePanelController:(DTSidePanelController *)sidePanelController;
@@ -33,12 +34,8 @@ @implementation DTSidePanelController
CGFloat _minimumVisibleCenterWidth;
CGPoint _lastTranslation;
- NSTimeInterval _lastMoveTimestamp;
- CGFloat _minimumAnimationMomentum;
- CGFloat _maximumAnimationMomentum;
- CGFloat _minimumDragOffsetToAccept; // minimum distance from which a panel drag is accepted
- CGFloat _minimumDragOffsetToPrepPanels; // minimum distance until subviews are added i.e. viewWillAppear etc.
-
+ CGFloat _animationVelocityMaximum;
+
DTSidePanelControllerPanel _panelToPresentAfterLayout; // the panel presentation to restore after subview layouting
BOOL _panelIsMoving; // if the panel is being dragged or being animated
@@ -46,7 +43,7 @@ @implementation DTSidePanelController
CGPoint _maxPanRange;
UITapGestureRecognizer *_tapToCloseGesture;
- UIPanGestureRecognizer *_centerPanelPanGesture;
+ DTSidePanelPanGestureRecognizer *_centerPanelPanGesture;
UIViewController *_presentedPanelViewController;
@@ -73,11 +70,8 @@ - (void)loadView
self.view = view;
- _minimumVisibleCenterWidth = 50;
- _minimumAnimationMomentum = 700;
- _maximumAnimationMomentum = 2000;
- _minimumDragOffsetToAccept = 15;
- _minimumDragOffsetToPrepPanels = 7;
+ _minimumVisibleCenterWidth = 50.0f;
+ _animationVelocityMaximum = 700.0f;
}
- (void)viewWillAppear:(BOOL)animated
@@ -87,24 +81,6 @@ - (void)viewWillAppear:(BOOL)animated
[super viewWillAppear:animated];
}
-- (void)_sortPanels
-{
- if (_centerBaseView)
- {
- [self.view bringSubviewToFront:_centerBaseView];
- }
-
- if ([self _rightPanelVisibleWidth]==0)
- {
- [self.view sendSubviewToBack:_rightBaseView];
- }
-
- if ([self _leftPanelVisibleWidth]==0)
- {
- [self.view sendSubviewToBack:_leftBaseView];
- }
-}
-
- (void)_updateUserInteractionEnabled
{
DTSidePanelControllerPanel panel = [self presentedPanel];
@@ -189,31 +165,10 @@ - (UIViewController *)_presentedPanelWithPosition:(CGPoint)position
- (void)_addSubviewForPresentedPanel:(UIViewController *)panel
{
- if (panel == _leftPanelController)
- {
- _leftPanelController.view.frame = _leftBaseView.bounds;
- [_leftBaseView addSubview:_leftPanelController.view];
-
- if (_rightBaseView)
- {
- [self.view sendSubviewToBack:_rightBaseView];
- }
- }
- else if (panel == _rightPanelController)
- {
- _rightPanelController.view.frame = _rightBaseView.bounds;
- [_rightBaseView addSubview:_rightPanelController.view];
-
- if (_leftBaseView)
- {
- [self.view sendSubviewToBack:_leftBaseView];
- }
- }
-
- [self _sortPanels];
+ _leftBaseView.hidden = (panel != _leftPanelController);
+ _rightBaseView.hidden = (panel != _rightPanelController);
}
-
- (void)_updatePanelViewControllerPresentationBeforeAnimationForPosition:(CGPoint)position
{
UIViewController *_targetPanel = [self _presentedPanelWithPosition:position];
@@ -243,13 +198,10 @@ - (void)_updatePanelViewControllerPresentationAfterAnimationForPosition:(CGPoint
if (_presentedPanelViewController && _targetPanel != _presentedPanelViewController)
{
- [_presentedPanelViewController.view removeFromSuperview];
-
[_presentedPanelViewController endAppearanceTransition];
[_presentedPanelViewController didMoveToParentViewController:nil];
-
-
+
_presentedPanelViewController = nil;
}
@@ -265,7 +217,7 @@ - (void)_updatePanelViewControllerPresentationAfterAnimationForPosition:(CGPoint
_presentedPanelViewController = _targetPanel;
}
-- (void)_updatePanelViewControllerPresentationForBeginningToShowPanel:(UIViewController *)panel
+- (void)_prepareViewControllerToBeShown:(UIViewController *)panel
{
if (panel == _centerPanelController || _presentedPanelViewController == panel)
{
@@ -296,8 +248,6 @@ - (void)_removePanelViewController:(UIViewController *)viewController notifyDidM
[viewController beginAppearanceTransition:NO animated:NO];
- [viewController.view removeFromSuperview];
-
[viewController endAppearanceTransition];
[viewController removeFromParentViewController];
@@ -445,124 +395,56 @@ - (void)_updateTapToCloseGesture
}
}
-- (void)_animateCenterPanelToPosition:(CGPoint)position duration:(NSTimeInterval)duration
-{
- _panelIsMoving = YES;
-
- [self _updatePanelViewControllerPresentationBeforeAnimationForPosition:position];
-
- [UIView animateWithDuration:duration delay:0 options:UIViewAnimationOptionBeginFromCurrentState|UIViewAnimationOptionCurveEaseOut animations:^{
- _centerBaseView.center = position;
- } completion:^(BOOL finished) {
- _panelIsMoving = NO;
-
- [self _updateTapToCloseGesture];
- [self _updatePanelViewControllerPresentationAfterAnimationForPosition:position];
- [self _updateUserInteractionEnabled];
- }];
-}
-- (void)_animateCenterPanelToPosition:(CGPoint)position withMomentum:(CGPoint)momentum
+- (void)_animateCenterPanelToPosition:(CGPoint)position withVelocity:(CGFloat)velocity
{
CALayer *presentationlayer = _centerBaseView.layer.presentationLayer;
CGPoint currentPosition = presentationlayer.position;
CGFloat deltaX = position.x - currentPosition.x;
- CGFloat deltaY = position.y - currentPosition.y;
- CGFloat distanceToTravel = sqrtf(deltaX*deltaX + deltaY*deltaY);
- CGFloat distanceMomentum = sqrtf(momentum.x * momentum.x + momentum.y * momentum.y);
-
- // limit
- distanceMomentum = MIN(MAX(distanceMomentum, _minimumAnimationMomentum), _maximumAnimationMomentum);
-
- CGFloat duration = distanceToTravel / distanceMomentum;
-
- [self _animateCenterPanelToPosition:position duration:duration];
-}
-- (void)_animateCenterPanelToClosedPosition
-{
- [self _animateCenterPanelToPosition:[self _centerPanelClosedPosition] withMomentum:CGPointZero];
-}
+ CGFloat duration = deltaX / _animationVelocityMaximum;
+ DTLogInfo(@"duration %1.1f", duration);
-- (void)_animateLeftPanelToOpenPosition
-{
- [self _animateCenterPanelToPosition:[self _centerPanelPositionWithLeftPanelOpen] withMomentum:CGPointZero];
-}
+ _panelIsMoving = YES;
-- (void)_animateRightPanelToOpenPosition
-{
- [self _animateCenterPanelToPosition:[self _centerPanelPositionWithRightPanelOpen] withMomentum:CGPointZero];
-}
+ [self _updatePanelViewControllerPresentationBeforeAnimationForPosition:position];
-- (void)_animateCenterPanelToRestingPosition
-{
- CGFloat leftVisibleWidth = [self _leftPanelVisibleWidth];
- CGFloat rightVisibleWidth = [self _rightPanelVisibleWidth];
-
- if (leftVisibleWidth>0)
- {
- if (leftVisibleWidth<_leftBaseView.bounds.size.width/2.0f)
- {
- [self _animateCenterPanelToClosedPosition];
- }
- else
- {
- [self _animateLeftPanelToOpenPosition];
- }
-
- return;
- }
-
- if (rightVisibleWidth>0)
- {
- if (rightVisibleWidth<_rightBaseView.bounds.size.width/2.0f)
- {
- [self _animateCenterPanelToClosedPosition];
- }
- else
- {
- [self _animateRightPanelToOpenPosition];
- }
- return;
- }
+ [UIView animateWithDuration:duration delay:0 options:UIViewAnimationOptionBeginFromCurrentState|UIViewAnimationOptionCurveEaseOut animations:^{
+ _centerBaseView.center = position;
+ } completion:^(BOOL finished) {
+ _panelIsMoving = NO;
+
+ [self _updateTapToCloseGesture];
+ [self _updatePanelViewControllerPresentationAfterAnimationForPosition:position];
+ [self _updateUserInteractionEnabled];
+ }];
}
-- (void)_animateCenterPanelToRestingPositionWithMomentum:(CGPoint)momentum
+
+- (void)_animateCenterPanelToRestingPositionWithVelocity:(CGFloat)velocity
{
- CGFloat leftVisibleWidth = [self _leftPanelVisibleWidth];
-
- if (leftVisibleWidth>0)
+
+ CGPoint endPosition = [self _centerPanelClosedPosition];
+
+ if ([self _leftPanelVisibleWidth]>0)
{
- if (momentum.x>0)
+ if (velocity > 100.0f)
{
- [self _animateCenterPanelToPosition:[self _centerPanelPositionWithLeftPanelOpen] withMomentum:momentum];
+ endPosition = [self _centerPanelPositionWithLeftPanelOpen];
}
- else
- {
- [self _animateCenterPanelToPosition:[self _centerPanelClosedPosition] withMomentum:momentum];
- }
-
- return;
- }
-
- CGFloat rightVisibleWidth = [self _rightPanelVisibleWidth];
-
- if (rightVisibleWidth>0)
+ } else if ([self _rightPanelVisibleWidth]>0)
{
- if (momentum.x<0)
+ if (velocity < 100.0f)
{
- [self _animateCenterPanelToPosition:[self _centerPanelPositionWithRightPanelOpen] withMomentum:momentum];
+ endPosition = [self _centerPanelPositionWithRightPanelOpen];
}
- else
- {
- [self _animateCenterPanelToPosition:[self _centerPanelClosedPosition] withMomentum:momentum];
- }
-
- return;
}
+
+ [self _animateCenterPanelToPosition:endPosition withVelocity:velocity];
+
}
#pragma mark - Rotation
@@ -772,14 +654,12 @@ - (void)handlePan:(UIPanGestureRecognizer *)gesture
CGPoint translation = [gesture translationInView:self.view];
_lastTranslation = translation;
- _lastMoveTimestamp = [NSDate timeIntervalSinceReferenceDate];
CGPoint center = _centerBaseView.center;
center.x += _lastTranslation.x;
if (!_panelIsMoving)
{
- CGFloat dragDistance = sqrtf(translation.x * translation.x + translation.y + translation.y);
UIViewController *panel = [self _presentedPanelWithPosition:center];
if (!panel)
@@ -792,18 +672,8 @@ - (void)handlePan:(UIPanGestureRecognizer *)gesture
return;
}
- if (dragDistance>_minimumDragOffsetToPrepPanels)
- {
- // update panels even though it maybe it is not going to be an drag
- [self _updatePanelViewControllerPresentationForBeginningToShowPanel:panel];
- }
-
- // ignore drag attempts below threshold
- if (dragDistance<_minimumDragOffsetToAccept)
- {
- return;
- }
-
+ [self _prepareViewControllerToBeShown:panel];
+
if (panel == _leftPanelController)
{
_minPanRange = [self _centerPanelClosedPosition];
@@ -827,14 +697,11 @@ - (void)handlePan:(UIPanGestureRecognizer *)gesture
[CATransaction setDisableActions:YES];
_centerBaseView.center = center;
-
+
[CATransaction commit];
-
- [self _sortPanels];
-
break;
}
-
+
case UIGestureRecognizerStateCancelled:
case UIGestureRecognizerStateEnded:
{
@@ -851,21 +718,10 @@ - (void)handlePan:(UIPanGestureRecognizer *)gesture
_presentedPanelViewController = nil;
return;
}
-
- NSTimeInterval timestamp = [NSDate timeIntervalSinceReferenceDate];
- NSTimeInterval secondsSinceLastMovement = timestamp - _lastMoveTimestamp;
-
- if (secondsSinceLastMovement<0.2f)
- {
- CGPoint momentum = CGPointMake(_lastTranslation.x/secondsSinceLastMovement, _lastTranslation.y/secondsSinceLastMovement);
-
- [self _animateCenterPanelToRestingPositionWithMomentum:momentum];
- }
- else
- {
- [self _animateCenterPanelToRestingPosition];
- }
-
+
+ CGPoint velocity = [gesture velocityInView:self.view];
+ DTLogInfo(@"velocity %@", NSStringFromCGPoint(velocity));
+ [self _animateCenterPanelToRestingPositionWithVelocity:velocity.x];
break;
}
@@ -925,7 +781,7 @@ - (void)presentPanel:(DTSidePanelControllerPanel)panel animated:(BOOL)animated
if (animated)
{
// uses minimum momentum for animation
- [self _animateCenterPanelToPosition:targetPosition duration:0.25];
+ [self _animateCenterPanelToPosition:targetPosition withVelocity:_animationVelocityMaximum];
}
else
{
@@ -1006,12 +862,12 @@ - (void)setCenterPanelController:(UIViewController *)centerPanelController
[_centerBaseView addShadowWithColor:[UIColor blackColor] alpha:1 radius:6 offset:CGSizeZero];
- _centerPanelPanGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
+ _centerPanelPanGesture = [[DTSidePanelPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
_centerPanelPanGesture.delegate = self;
[self.view addGestureRecognizer:_centerPanelPanGesture];
}
- [self _sortPanels];
+ //[self _sortPanels];
[self addChildViewController:_centerPanelController];
@@ -1036,13 +892,12 @@ - (void)setLeftPanelController:(UIViewController *)leftPanelController
_leftPanelController = leftPanelController;
_leftPanelController.sidePanelController = self;
- if (!_leftBaseView)
- {
- _leftBaseView = [[UIView alloc] initWithFrame:[self _leftPanelFrame]];
- _leftBaseView.userInteractionEnabled = NO;
- [self.view addSubview:_leftBaseView];
- }
-
+ _leftBaseView = [[UIView alloc] initWithFrame:[self _leftPanelFrame]];
+ _leftBaseView.userInteractionEnabled = NO;
+ [self.view addSubview:_leftBaseView];
+ [self.view sendSubviewToBack:_leftBaseView];
+ [_leftBaseView addSubview:leftPanelController.view];
+
[self _updatePanelAutoresizingMasks];
}
@@ -1058,14 +913,13 @@ - (void)setRightPanelController:(UIViewController *)rightPanelController
_rightPanelController = rightPanelController;
_rightPanelController.sidePanelController = self;
-
- if (!_rightBaseView)
- {
- _rightBaseView = [[UIView alloc] initWithFrame:[self _rightPanelFrame]];
- _rightBaseView.userInteractionEnabled = NO;
- [self.view addSubview:_rightBaseView];
- }
-
+
+ _rightBaseView = [[UIView alloc] initWithFrame:[self _rightPanelFrame]];
+ _rightBaseView.userInteractionEnabled = NO;
+ [self.view addSubview:_rightBaseView];
+ [self.view sendSubviewToBack:_rightBaseView];
+ [_rightBaseView addSubview:_rightPanelController.view];
+
[self _updatePanelAutoresizingMasks];
}
View
16 Core/Source/iOS/DTSidePanel/DTSidePanelPanGestureRecognizer.h
@@ -0,0 +1,16 @@
+//
+// DTFoundation
+//
+// Created by rene on 25.11.13.
+// Copyright 2013 Drobnik.com. All rights reserved.
+//
+//
+//
+
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIGestureRecognizerSubclass.h>
+
+
+@interface DTSidePanelPanGestureRecognizer : UIPanGestureRecognizer
+@end
View
56 Core/Source/iOS/DTSidePanel/DTSidePanelPanGestureRecognizer.m
@@ -0,0 +1,56 @@
+//
+// DTFoundation
+//
+// Created by rene on 25.11.13.
+// Copyright 2013 Drobnik.com. All rights reserved.
+//
+//
+//
+
+
+#import "DTSidePanelPanGestureRecognizer.h"
+
+int const static kDirectionPanThreshold = 20;
+
+@implementation DTSidePanelPanGestureRecognizer {
+
+ CGFloat _moveY;
+}
+
+- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
+ if (self.state == UIGestureRecognizerStateBegan || self.state == UIGestureRecognizerStatePossible)
+ {
+ CGPoint nowPoint = [[touches anyObject] locationInView:self.view];
+ CGPoint prevPoint = [[touches anyObject] previousLocationInView:self.view];
+ _moveY += prevPoint.y - nowPoint.y;
+
+ if (fabs(_moveY) > kDirectionPanThreshold)
+ {
+ self.state = UIGestureRecognizerStateFailed;
+ }
+ }
+
+ if (self.state == UIGestureRecognizerStateFailed)
+ {
+ return;
+ }
+ [super touchesMoved:touches withEvent:event];
+
+}
+
+
+- (BOOL)canPreventGestureRecognizer:(UIGestureRecognizer *)preventedGestureRecognizer
+{
+ if (self.state == UIGestureRecognizerStateChanged)
+ {
+ return YES;
+ }
+ return NO;
+}
+
+
+- (void)reset {
+ [super reset];
+ _moveY = 0;
+}
+@end
View
14 DTFoundation.xcodeproj/project.pbxproj
@@ -21,6 +21,8 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
+ 355B26B862090A50B1ED1EB4 /* DTSidePanelPanGestureRecognizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 355B257CC69FC64D78ABE0BE /* DTSidePanelPanGestureRecognizer.h */; };
+ 355B2F0AD6E0ED773FACD941 /* DTSidePanelPanGestureRecognizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 355B210F4174F2B22B0CD6A0 /* DTSidePanelPanGestureRecognizer.m */; };
A70B4CD01486621B00873A4A /* DTFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = A70B4CC51486621B00873A4A /* DTFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; };
A70B4CD11486621B00873A4A /* DTVersion.h in Headers */ = {isa = PBXBuildFile; fileRef = A70B4CC71486621B00873A4A /* DTVersion.h */; settings = {ATTRIBUTES = (Public, ); }; };
A70B4CD21486621B00873A4A /* DTVersion.m in Sources */ = {isa = PBXBuildFile; fileRef = A70B4CC81486621B00873A4A /* DTVersion.m */; };
@@ -280,6 +282,8 @@
A7E88ED316BC0278008CBA9C /* DTCustomColoredAccessory.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E88ED016BC0278008CBA9C /* DTCustomColoredAccessory.h */; };
A7E88ED416BC0278008CBA9C /* DTCustomColoredAccessory.m in Sources */ = {isa = PBXBuildFile; fileRef = A7E88ED116BC0278008CBA9C /* DTCustomColoredAccessory.m */; };
A7E88ED516BC0278008CBA9C /* DTCustomColoredAccessory.m in Sources */ = {isa = PBXBuildFile; fileRef = A7E88ED116BC0278008CBA9C /* DTCustomColoredAccessory.m */; };
+ A7F3BD2C18436A0F00DB7854 /* DTSidePanelPanGestureRecognizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 355B210F4174F2B22B0CD6A0 /* DTSidePanelPanGestureRecognizer.m */; };
+ A7F3BD2D18436A1200DB7854 /* DTSidePanelController.m in Sources */ = {isa = PBXBuildFile; fileRef = A74663B31743D43600D4D7D5 /* DTSidePanelController.m */; };
A7FA5FA417B0F7B4000FC61F /* DTLog.h in Headers */ = {isa = PBXBuildFile; fileRef = A7FA5FA217B0F7B4000FC61F /* DTLog.h */; };
A7FA5FA517B0F7B4000FC61F /* DTLog.h in Headers */ = {isa = PBXBuildFile; fileRef = A7FA5FA217B0F7B4000FC61F /* DTLog.h */; };
A7FA5FA617B0F7B4000FC61F /* DTLog.h in Headers */ = {isa = PBXBuildFile; fileRef = A7FA5FA217B0F7B4000FC61F /* DTLog.h */; };
@@ -296,7 +300,6 @@
A7FAA38A1652291D006ED151 /* NSURL+DTComparing.h in Headers */ = {isa = PBXBuildFile; fileRef = A7FAA3871652291D006ED151 /* NSURL+DTComparing.h */; };
A7FAA38B1652291D006ED151 /* NSURL+DTComparing.m in Sources */ = {isa = PBXBuildFile; fileRef = A7FAA3881652291D006ED151 /* NSURL+DTComparing.m */; };
A7FAA38C1652291D006ED151 /* NSURL+DTComparing.m in Sources */ = {isa = PBXBuildFile; fileRef = A7FAA3881652291D006ED151 /* NSURL+DTComparing.m */; };
- A7FB1214175C9C6100D4B7F0 /* DTSidePanelController.m in Sources */ = {isa = PBXBuildFile; fileRef = A74663B31743D43600D4D7D5 /* DTSidePanelController.m */; };
A7FB1215175C9C6200D4B7F0 /* DTSidePanelController.m in Sources */ = {isa = PBXBuildFile; fileRef = A74663B31743D43600D4D7D5 /* DTSidePanelController.m */; };
A7FB1216175C9C8B00D4B7F0 /* DTSidePanelController.h in Headers */ = {isa = PBXBuildFile; fileRef = A74663B21743D43600D4D7D5 /* DTSidePanelController.h */; settings = {ATTRIBUTES = (); }; };
A7FB1217175C9C8C00D4B7F0 /* DTSidePanelController.h in Headers */ = {isa = PBXBuildFile; fileRef = A74663B21743D43600D4D7D5 /* DTSidePanelController.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -524,6 +527,8 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
+ 355B210F4174F2B22B0CD6A0 /* DTSidePanelPanGestureRecognizer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DTSidePanelPanGestureRecognizer.m; sourceTree = "<group>"; };
+ 355B257CC69FC64D78ABE0BE /* DTSidePanelPanGestureRecognizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTSidePanelPanGestureRecognizer.h; sourceTree = "<group>"; };
3D7CE547166613B60028D339 /* libDTHTMLParser_Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDTHTMLParser_Mac.a; sourceTree = BUILT_PRODUCTS_DIR; };
A70B4CC51486621B00873A4A /* DTFoundation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTFoundation.h; sourceTree = "<group>"; };
A70B4CC71486621B00873A4A /* DTVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTVersion.h; sourceTree = "<group>"; };
@@ -1078,6 +1083,8 @@
A74663B31743D43600D4D7D5 /* DTSidePanelController.m */,
A7C92B67174F9AEC0019D70A /* UIViewController+DTSidePanelController.h */,
A7C92B68174F9AEC0019D70A /* UIViewController+DTSidePanelController.m */,
+ 355B210F4174F2B22B0CD6A0 /* DTSidePanelPanGestureRecognizer.m */,
+ 355B257CC69FC64D78ABE0BE /* DTSidePanelPanGestureRecognizer.h */,
);
path = DTSidePanel;
sourceTree = "<group>";
@@ -1721,6 +1728,7 @@
A78D661D17AFFCCC0039F5E6 /* DTFolderMonitor.h in Headers */,
A7FA5FA417B0F7B4000FC61F /* DTLog.h in Headers */,
A7FA5FB117B127E0000FC61F /* DTAsyncFileDeleter.h in Headers */,
+ 355B26B862090A50B1ED1EB4 /* DTSidePanelPanGestureRecognizer.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2270,11 +2278,11 @@
A76DB4D716A5E5100010CD85 /* UIImage+DTFoundation.m in Sources */,
A76DB4DF16A5E5100010CD85 /* UIView+DTFoundation.m in Sources */,
A76DB4E316A5E5100010CD85 /* UIWebView+DTFoundation.m in Sources */,
+ A7F3BD2C18436A0F00DB7854 /* DTSidePanelPanGestureRecognizer.m in Sources */,
A7E88ED516BC0278008CBA9C /* DTCustomColoredAccessory.m in Sources */,
A730BCD116D2892E003B849F /* DTTiledLayerWithoutFade.m in Sources */,
A77D5BFE16E4961A00A45C28 /* DTBase64Coding.m in Sources */,
A7C92B6C174F9AEC0019D70A /* UIViewController+DTSidePanelController.m in Sources */,
- A7FB1214175C9C6100D4B7F0 /* DTSidePanelController.m in Sources */,
A70C4FCC17AA7CEC00000DF5 /* UIColor+DTDebug.m in Sources */,
A70C4FCD17AA7CEC00000DF5 /* UIView+DTDebug.m in Sources */,
A70C4FD017AA7CF800000DF5 /* DTActionSheet.m in Sources */,
@@ -2289,6 +2297,7 @@
A7FA5FA817B0F7B4000FC61F /* DTLog.m in Sources */,
A7FA5FAF17B127E0000FC61F /* DTAsyncFileDeleter.m in Sources */,
A768BE4017FC3C91008834C6 /* DTBlockFunctions.m in Sources */,
+ A7F3BD2D18436A1200DB7854 /* DTSidePanelController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2417,6 +2426,7 @@
A78D662017AFFCCC0039F5E6 /* DTFolderMonitor.m in Sources */,
A7FA5FA717B0F7B4000FC61F /* DTLog.m in Sources */,
A7FA5FAE17B127E0000FC61F /* DTAsyncFileDeleter.m in Sources */,
+ 355B2F0AD6E0ED773FACD941 /* DTSidePanelPanGestureRecognizer.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
13 DTFoundation.xcodeproj/xcshareddata/xcschemes/Unit Tests.xcscheme
@@ -5,6 +5,19 @@
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForRunning = "YES"
+ buildForTesting = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "A7D60FCE15D3B0BC00AEDD1B"
+ BuildableName = "UnitTests.octest"
+ BlueprintName = "Unit Tests"
+ ReferencedContainer = "container:DTFoundation.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
View
4 Demo/DTSidePanels/Source/AppDelegate.m
@@ -51,14 +51,14 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
_sidePanelController = [[DTSidePanelController alloc] init];
// left panel has fixed width, right panel width is variable
- [_sidePanelController setWidth:100 forPanel:DTSidePanelControllerPanelLeft animated:NO];
+ [_sidePanelController setWidth:200 forPanel:DTSidePanelControllerPanelLeft animated:NO];
// set the panels on the controller
_sidePanelController.leftPanelController = leftNav;
_sidePanelController.centerPanelController = centerNav;
_sidePanelController.rightPanelController = rightNav;
_sidePanelController.sidePanelDelegate = self;
-
+
self.window.rootViewController = _sidePanelController;
[self.window makeKeyAndVisible];
Please sign in to comment.
Something went wrong with that request. Please try again.