Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit d3746f5e368864bf9b6ff34c666a0a1d5ce169b5 @ishkawa committed Feb 22, 2013
@@ -0,0 +1,2 @@
+build
+Products
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>-.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
@@ -0,0 +1,14 @@
+//
+// Prefix header for all source files of the 'DemoApp' target in the 'DemoApp' project
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_3_0
+#warning "This project uses features only available in iOS SDK 3.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
@@ -0,0 +1,7 @@
+#import <UIKit/UIKit.h>
+
+@interface ISAppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@end
@@ -0,0 +1,20 @@
+#import "ISAppDelegate.h"
+#import "ISDemoViewController.h"
+
+@implementation ISAppDelegate
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ ISDemoViewController *viewController = [[ISDemoViewController alloc] init];
+ UINavigationController *navigationController = [[UINavigationController alloc] init];
+ navigationController.viewControllers = @[viewController];
+
+ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+ self.window.backgroundColor = [UIColor whiteColor];
+ self.window.rootViewController = navigationController;
+ [self.window makeKeyAndVisible];
+
+ return YES;
+}
+
+@end
@@ -0,0 +1,5 @@
+#import <UIKit/UIKit.h>
+
+@interface ISDemoViewController : UIViewController
+
+@end
@@ -0,0 +1,63 @@
+#import "ISDemoViewController.h"
+#import "UIViewController+BackGesture.h"
+#import <objc/runtime.h>
+
+@implementation ISDemoViewController
+
+- (id)init
+{
+ self = [super init];
+ if (self) {
+ self.backGestureEnabled = YES;
+
+ [self addObserver:self forKeyPath:@"backProgress" options:0 context:NULL];
+ }
+ return self;
+}
+
+- (void)dealloc
+{
+ [self removeObserver:self forKeyPath:@"backProgress"];
+}
+
+- (void)loadView
+{
+ [super loadView];
+
+ UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
+ button.frame = CGRectMake(120, 200, 80, 40);
+ [button setTitle:@"Push" forState:UIControlStateNormal];
+ [button addTarget:self
+ action:@selector(push)
+ forControlEvents:UIControlEventTouchUpInside];
+
+ [self.view addSubview:button];
+}
+
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
+{
+ if (object == self && [keyPath isEqualToString:@"backProgress"]) {
+ NSString *title = [NSString stringWithFormat:@"%.2f", self.backProgress];
+
+ NSInteger index = [self.navigationController.viewControllers count] - 2;
+ if (index >= 0) {
+ UIViewController *viewController = [self.navigationController.viewControllers objectAtIndex:index];
+
+ viewController.navigationItem.backBarButtonItem =
+ [[UIBarButtonItem alloc] initWithTitle:title
+ style:UIBarButtonItemStyleBordered
+ target:nil
+ action:nil];
+ }
+ } else {
+ [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
+ }
+}
+
+- (void)push
+{
+ ISDemoViewController *viewController = [[ISDemoViewController alloc] init];
+ [self.navigationController pushViewController:viewController animated:YES];
+}
+
+@end
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
@@ -0,0 +1,18 @@
+//
+// main.m
+// DemoApp
+//
+// Created by Yosuke Ishikawa on 2013/02/22.
+// Copyright (c) 2013年 Yosuke Ishikawa. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+#import "ISAppDelegate.h"
+
+int main(int argc, char *argv[])
+{
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([ISAppDelegate class]));
+ }
+}
@@ -0,0 +1,22 @@
+Pod::Spec.new do |s|
+ s.name = "ISBackGesture"
+ s.version = "0.0.1"
+ s.summary = "equips UIViewController with recognizing swipe to back."
+ s.homepage = "https://github.com/ishkawa/ISBackGesture"
+ s.author = { "Yosuke Ishikawa" => "ishkawa73@gmail.com" }
+ s.source = { :git => "https://github.com/ishkawa/ISBackGesture.git", :tag => "0.0.1" }
+ s.platform = :ios, '4.0'
+ s.source_files = 'Classes', 'ISBackGesture/**/*.{h,m}'
+ s.license = {
+ :type => 'MIT',
+ :text => <<-LICENSE
+ Copyright (c) 2013 Yosuke Ishikawa
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ LICENSE
+ }
+end
Oops, something went wrong.

0 comments on commit d3746f5

Please sign in to comment.