forked from mmackh/Hacker-News-for-iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Several Fixes, cleaned up code & new transitioning effect
- Loading branch information
Showing
8 changed files
with
96 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+4.91 KB
(130%)
...codeproj/project.xcworkspace/xcuserdata/mmackh.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// UIView.h | ||
// Hacker News | ||
// | ||
// Created by Maximilian Mackh on 02/07/13. | ||
// Copyright (c) 2013 Maximilian Mackh. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface UIView (AnchorPoint) | ||
|
||
-(void)setAnchorPoint:(CGPoint)anchorPoint forView:(UIView *)view; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// UIView.m | ||
// Hacker News | ||
// | ||
// Created by Maximilian Mackh on 02/07/13. | ||
// Copyright (c) 2013 Maximilian Mackh. All rights reserved. | ||
// | ||
|
||
#import "UIView+AnchorPoint.h" | ||
#import <QuartzCore/QuartzCore.h> | ||
|
||
@implementation UIView (AnchorPoint) | ||
|
||
//Thanks http://stackoverflow.com/a/5666430/1091044 | ||
|
||
-(void)setAnchorPoint:(CGPoint)anchorPoint forView:(UIView *)view | ||
{ | ||
CGPoint newPoint = CGPointMake(view.bounds.size.width * anchorPoint.x, view.bounds.size.height * anchorPoint.y); | ||
CGPoint oldPoint = CGPointMake(view.bounds.size.width * view.layer.anchorPoint.x, view.bounds.size.height * view.layer.anchorPoint.y); | ||
|
||
newPoint = CGPointApplyAffineTransform(newPoint, view.transform); | ||
oldPoint = CGPointApplyAffineTransform(oldPoint, view.transform); | ||
|
||
CGPoint position = view.layer.position; | ||
|
||
position.x -= oldPoint.x; | ||
position.x += newPoint.x; | ||
|
||
position.y -= oldPoint.y; | ||
position.y += newPoint.y; | ||
|
||
view.layer.position = position; | ||
view.layer.anchorPoint = anchorPoint; | ||
} | ||
|
||
@end |