Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added entry panel code

  • Loading branch information...
commit c9feff2057e2c03b5c37315463eed856b035e9ff 1 parent f964d33
@MugunthKumar authored
View
43 MKEntryPanel/MKEntryPanel.h
@@ -0,0 +1,43 @@
+//
+// MKEntryPanel.h
+// HorizontalMenu
+//
+// Created by Mugunth on 25/04/11.
+// Copyright 2011 Steinlogic. All rights reserved.
+// Permission granted to do anything, commercial/non-commercial with this file apart from removing the line/URL above
+
+#import <UIKit/UIKit.h>
+typedef void (^CloseBlock)(NSString *inputString);
+
+#define RGBA(r, g, b, a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
+#define kAnimationDuration 0.35
+
+@interface DimView : UIView {
+
+ SEL onTapped;
+ UIView *parentView;
+}
+
+- (id)initWithParent:(UIView*) aParentView onTappedSelector:(SEL) tappedSel;
+@end
+
+@interface MKEntryPanel : UIView {
+
+ CloseBlock _closeBlock;
+ UILabel *_titleLabel;
+ UITextField *_entryField;
+
+ UIImageView *_backgroundGradient;
+
+ DimView *_dimView;
+}
+
+@property (nonatomic, copy) CloseBlock closeBlock;
+@property (nonatomic, assign) DimView *dimView;
+@property (nonatomic, assign) IBOutlet UILabel *titleLabel;
+@property (nonatomic, assign) IBOutlet UITextField *entryField;
+@property (nonatomic, assign) IBOutlet UIImageView *backgroundGradient;
+
++(void) showPanelWithTitle:(NSString*) title inView:(UIView*) view onTextEntered:(CloseBlock) editingEndedBlock;
+- (IBAction) textFieldDidEndOnExit:(UITextField *)textField;
+@end
View
148 MKEntryPanel/MKEntryPanel.m
@@ -0,0 +1,148 @@
+//
+// MKInfoPanel.m
+// HorizontalMenu
+//
+// Created by Mugunth on 25/04/11.
+// Copyright 2011 Steinlogic. All rights reserved.
+// Permission granted to do anything, commercial/non-commercial with this file apart from removing the line/URL above
+// Read my blog post at http://mk.sg/8e on how to use this code
+
+// As a side note on using this code, you might consider giving some credit to me by
+// 1) linking my website from your app's website
+// 2) or crediting me inside the app's credits page
+// 3) or a tweet mentioning @mugunthkumar
+// 4) A paypal donation to mugunth.kumar@gmail.com
+//
+// A note on redistribution
+// While I'm ok with modifications to this source code,
+// if you are re-publishing after editing, please retain the above copyright notices
+
+#import "MKEntryPanel.h"
+#import <QuartzCore/QuartzCore.h>
+
+// Private Methods
+// this should be added before implementation block
+
+@interface MKEntryPanel (PrivateMethods)
++ (MKEntryPanel*) panel;
+@end
+
+
+@implementation DimView
+
+- (id)initWithParent:(UIView*) aParentView onTappedSelector:(SEL) tappedSel
+{
+ self = [super initWithFrame:[UIScreen mainScreen].bounds];
+ if (self) {
+ // Initialization code
+ parentView = aParentView;
+ onTapped = tappedSel;
+ self.backgroundColor = [UIColor blackColor];
+ self.alpha = 0.0;
+ }
+ return self;
+}
+
+-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
+{
+ [parentView performSelector:onTapped];
+}
+- (void)dealloc
+{
+ [super dealloc];
+}
+@end
+
+@implementation MKEntryPanel
+@synthesize closeBlock = _closeBlock;
+@synthesize titleLabel = _titleLabel;
+@synthesize entryField = _entryField;
+@synthesize backgroundGradient = _backgroundGradient;
+@synthesize dimView = _dimView;
+
+- (id)initWithFrame:(CGRect)frame
+{
+ self = [super initWithFrame:frame];
+ if (self) {
+ // Initialization code
+ }
+ return self;
+}
+
++(MKEntryPanel*) panel
+{
+ MKEntryPanel *panel = (MKEntryPanel*) [[[UINib nibWithNibName:@"MKEntryPanel" bundle:nil]
+ instantiateWithOwner:self options:nil] objectAtIndex:0];
+
+
+ panel.backgroundGradient.image = [[UIImage imageNamed:@"TopBar"] stretchableImageWithLeftCapWidth:1 topCapHeight:5];
+
+ CATransition *transition = [CATransition animation];
+ transition.duration = kAnimationDuration;
+ transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
+ transition.type = kCATransitionPush;
+ transition.subtype = kCATransitionFromBottom;
+ [panel.layer addAnimation:transition forKey:nil];
+
+ return panel;
+}
+
++(void) showPanelWithTitle:(NSString*) title inView:(UIView*) view onTextEntered:(CloseBlock) editingEndedBlock
+{
+ MKEntryPanel *panel = [MKEntryPanel panel];
+ panel.closeBlock = editingEndedBlock;
+ panel.titleLabel.text = title;
+ [panel.entryField becomeFirstResponder];
+
+ panel.dimView = [[[DimView alloc] initWithParent:panel onTappedSelector:@selector(cancelTapped:)] autorelease];
+ CATransition *transition = [CATransition animation];
+ transition.duration = kAnimationDuration;
+ transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
+ transition.type = kCATransitionFade;
+ [panel.dimView.layer addAnimation:transition forKey:nil];
+ panel.dimView.alpha = 0.8;
+ [view addSubview:panel.dimView];
+ [view addSubview:panel];
+}
+
+- (IBAction) textFieldDidEndOnExit:(UITextField *)textField {
+
+ [self performSelectorOnMainThread:@selector(hidePanel) withObject:nil waitUntilDone:YES];
+ self.closeBlock(self.entryField.text);
+}
+
+-(void) cancelTapped:(id) sender
+{
+ [self performSelectorOnMainThread:@selector(hidePanel) withObject:nil waitUntilDone:YES];
+}
+
+-(void) hidePanel
+{
+ [self.entryField resignFirstResponder];
+ CATransition *transition = [CATransition animation];
+ transition.duration = kAnimationDuration;
+ transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
+ transition.type = kCATransitionPush;
+ transition.subtype = kCATransitionFromTop;
+ [self.layer addAnimation:transition forKey:nil];
+ self.frame = CGRectMake(0, -self.frame.size.height, 320, self.frame.size.height);
+
+ transition = [CATransition animation];
+ transition.duration = kAnimationDuration;
+ transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
+ transition.type = kCATransitionFade;
+ self.dimView.alpha = 0.0;
+ [self.dimView.layer addAnimation:transition forKey:nil];
+
+ [self.dimView performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:0.40];
+ [self performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:0.45];
+}
+
+- (void)dealloc
+{
+ [super dealloc];
+}
+
+@end
+
+
View
328 MKEntryPanel/MKEntryPanel.xib
@@ -0,0 +1,328 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">1056</int>
+ <string key="IBDocument.SystemVersion">10J869</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1306</string>
+ <string key="IBDocument.AppKitVersion">1038.35</string>
+ <string key="IBDocument.HIToolboxVersion">461.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">301</string>
+ </object>
+ <object class="NSArray" key="IBDocument.IntegratedClassDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>IBUITextField</string>
+ <string>IBUIImageView</string>
+ <string>IBUIView</string>
+ <string>IBUILabel</string>
+ <string>IBProxyObject</string>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <reference key="dict.values" ref="0"/>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="975951072">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIView" id="191373211">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBUIImageView" id="167006686">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">274</int>
+ <string key="NSFrameSize">{320, 70}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="446193903"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MCAwAA</bytes>
+ </object>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUILabel" id="446193903">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{15, 6}, {290, 21}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="911762610"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <int key="IBUIContentMode">7</int>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <string key="IBUIText">Enter a playlist name</string>
+ <object class="NSFont" key="IBUIFont">
+ <string key="NSName">Helvetica-Bold</string>
+ <double key="NSSize">15</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <nil key="IBUIHighlightedColor"/>
+ <object class="NSColor" key="IBUIShadowColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MCAwIDAgMC4zNQA</bytes>
+ </object>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">10</float>
+ <int key="IBUITextAlignment">1</int>
+ </object>
+ <object class="IBUITextField" id="911762610">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{15, 32}, {290, 31}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <string key="IBUIText"/>
+ <int key="IBUIBorderStyle">3</int>
+ <string key="IBUIPlaceholder">Text</string>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <float key="IBUIMinimumFontSize">17</float>
+ <object class="IBUITextInputTraits" key="IBUITextInputTraits">
+ <int key="IBUIReturnKeyType">9</int>
+ <bool key="IBUIEnablesReturnKeyAutomatically">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{320, 70}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="167006686"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MSAwLjI1AA</bytes>
+ </object>
+ <float key="IBUIAlpha">0.92000001668930054</float>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">titleLabel</string>
+ <reference key="source" ref="191373211"/>
+ <reference key="destination" ref="446193903"/>
+ </object>
+ <int key="connectionID">7</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">backgroundGradient</string>
+ <reference key="source" ref="191373211"/>
+ <reference key="destination" ref="167006686"/>
+ </object>
+ <int key="connectionID">10</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">entryField</string>
+ <reference key="source" ref="191373211"/>
+ <reference key="destination" ref="911762610"/>
+ </object>
+ <int key="connectionID">14</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchEventConnection" key="connection">
+ <string key="label">textFieldDidEndOnExit:</string>
+ <reference key="source" ref="911762610"/>
+ <reference key="destination" ref="191373211"/>
+ <int key="IBEventType">20</int>
+ </object>
+ <int key="connectionID">17</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1</int>
+ <reference key="object" ref="191373211"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="446193903"/>
+ <reference ref="167006686"/>
+ <reference ref="911762610"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="975951072"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">3</int>
+ <reference key="object" ref="446193903"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">9</int>
+ <reference key="object" ref="167006686"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">12</int>
+ <reference key="object" ref="911762610"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-2.CustomClassName</string>
+ <string>1.CustomClassName</string>
+ <string>1.IBEditorWindowLastContentRect</string>
+ <string>1.IBPluginDependency</string>
+ <string>12.IBPluginDependency</string>
+ <string>3.IBPluginDependency</string>
+ <string>9.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>UIResponder</string>
+ <string>MKEntryPanel</string>
+ <string>{{354, 412}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <reference key="dict.values" ref="0"/>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <reference key="dict.values" ref="0"/>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">17</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">MKEntryPanel</string>
+ <string key="superclassName">UIView</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">textFieldDidEndOnExit:</string>
+ <string key="NS.object.0">UITextField</string>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <string key="NS.key.0">textFieldDidEndOnExit:</string>
+ <object class="IBActionInfo" key="NS.object.0">
+ <string key="name">textFieldDidEndOnExit:</string>
+ <string key="candidateClassName">UITextField</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>backgroundGradient</string>
+ <string>entryField</string>
+ <string>titleLabel</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>UIImageView</string>
+ <string>UITextField</string>
+ <string>UILabel</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>backgroundGradient</string>
+ <string>entryField</string>
+ <string>titleLabel</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">backgroundGradient</string>
+ <string key="candidateClassName">UIImageView</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">entryField</string>
+ <string key="candidateClassName">UITextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">titleLabel</string>
+ <string key="candidateClassName">UILabel</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/MKEntryPanel.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
+ <integer value="3100" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">301</string>
+ </data>
+</archive>
View
BIN  MKEntryPanel/TopBar.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  MKEntryPanel/TopBar@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
38 MKEntryPanelDemo.xcodeproj/project.pbxproj
@@ -16,6 +16,11 @@
AB82E7221374F29500056B00 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = AB82E7201374F29500056B00 /* MainWindow.xib */; };
AB82E7251374F29600056B00 /* MKEntryPanelDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB82E7241374F29600056B00 /* MKEntryPanelDemoViewController.m */; };
AB82E7281374F29600056B00 /* MKEntryPanelDemoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AB82E7261374F29600056B00 /* MKEntryPanelDemoViewController.xib */; };
+ AB82E7341374F2D500056B00 /* MKEntryPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = AB82E7301374F2D500056B00 /* MKEntryPanel.m */; };
+ AB82E7351374F2D500056B00 /* MKEntryPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = AB82E7311374F2D500056B00 /* MKEntryPanel.xib */; };
+ AB82E7361374F2D500056B00 /* TopBar.png in Resources */ = {isa = PBXBuildFile; fileRef = AB82E7321374F2D500056B00 /* TopBar.png */; };
+ AB82E7371374F2D500056B00 /* TopBar@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AB82E7331374F2D500056B00 /* TopBar@2x.png */; };
+ AB82E7411374F43D00056B00 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB82E7401374F43D00056B00 /* QuartzCore.framework */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -23,16 +28,22 @@
AB82E70E1374F29500056B00 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
AB82E7101374F29500056B00 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
AB82E7121374F29500056B00 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
- AB82E7161374F29500056B00 /* MKEntryPanelDemo-Info.plist */ = {isa = PBXFileReference; path = "MKEntryPanelDemo-Info.plist"; sourceTree = "<group>"; };
+ AB82E7161374F29500056B00 /* MKEntryPanelDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MKEntryPanelDemo-Info.plist"; sourceTree = "<group>"; };
AB82E7181374F29500056B00 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- AB82E71A1374F29500056B00 /* MKEntryPanelDemo-Prefix.pch */ = {isa = PBXFileReference; path = "MKEntryPanelDemo-Prefix.pch"; sourceTree = "<group>"; };
+ AB82E71A1374F29500056B00 /* MKEntryPanelDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MKEntryPanelDemo-Prefix.pch"; sourceTree = "<group>"; };
AB82E71B1374F29500056B00 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
- AB82E71D1374F29500056B00 /* MKEntryPanelDemoAppDelegate.h */ = {isa = PBXFileReference; path = MKEntryPanelDemoAppDelegate.h; sourceTree = "<group>"; };
+ AB82E71D1374F29500056B00 /* MKEntryPanelDemoAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MKEntryPanelDemoAppDelegate.h; sourceTree = "<group>"; };
AB82E71E1374F29500056B00 /* MKEntryPanelDemoAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MKEntryPanelDemoAppDelegate.m; sourceTree = "<group>"; };
AB82E7211374F29500056B00 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow.xib; sourceTree = "<group>"; };
- AB82E7231374F29500056B00 /* MKEntryPanelDemoViewController.h */ = {isa = PBXFileReference; path = MKEntryPanelDemoViewController.h; sourceTree = "<group>"; };
+ AB82E7231374F29500056B00 /* MKEntryPanelDemoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MKEntryPanelDemoViewController.h; sourceTree = "<group>"; };
AB82E7241374F29600056B00 /* MKEntryPanelDemoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MKEntryPanelDemoViewController.m; sourceTree = "<group>"; };
AB82E7271374F29600056B00 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MKEntryPanelDemoViewController.xib; sourceTree = "<group>"; };
+ AB82E72F1374F2D500056B00 /* MKEntryPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MKEntryPanel.h; sourceTree = "<group>"; };
+ AB82E7301374F2D500056B00 /* MKEntryPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MKEntryPanel.m; sourceTree = "<group>"; };
+ AB82E7311374F2D500056B00 /* MKEntryPanel.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MKEntryPanel.xib; sourceTree = "<group>"; };
+ AB82E7321374F2D500056B00 /* TopBar.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = TopBar.png; sourceTree = "<group>"; };
+ AB82E7331374F2D500056B00 /* TopBar@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "TopBar@2x.png"; sourceTree = "<group>"; };
+ AB82E7401374F43D00056B00 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -40,6 +51,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ AB82E7411374F43D00056B00 /* QuartzCore.framework in Frameworks */,
AB82E70F1374F29500056B00 /* UIKit.framework in Frameworks */,
AB82E7111374F29500056B00 /* Foundation.framework in Frameworks */,
AB82E7131374F29500056B00 /* CoreGraphics.framework in Frameworks */,
@@ -52,6 +64,8 @@
AB82E6FF1374F29500056B00 = {
isa = PBXGroup;
children = (
+ AB82E7401374F43D00056B00 /* QuartzCore.framework */,
+ AB82E72E1374F2D500056B00 /* MKEntryPanel */,
AB82E7141374F29500056B00 /* MKEntryPanelDemo */,
AB82E70D1374F29500056B00 /* Frameworks */,
AB82E70B1374F29500056B00 /* Products */,
@@ -101,6 +115,18 @@
name = "Supporting Files";
sourceTree = "<group>";
};
+ AB82E72E1374F2D500056B00 /* MKEntryPanel */ = {
+ isa = PBXGroup;
+ children = (
+ AB82E72F1374F2D500056B00 /* MKEntryPanel.h */,
+ AB82E7301374F2D500056B00 /* MKEntryPanel.m */,
+ AB82E7311374F2D500056B00 /* MKEntryPanel.xib */,
+ AB82E7321374F2D500056B00 /* TopBar.png */,
+ AB82E7331374F2D500056B00 /* TopBar@2x.png */,
+ );
+ path = MKEntryPanel;
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -154,6 +180,9 @@
AB82E7191374F29500056B00 /* InfoPlist.strings in Resources */,
AB82E7221374F29500056B00 /* MainWindow.xib in Resources */,
AB82E7281374F29600056B00 /* MKEntryPanelDemoViewController.xib in Resources */,
+ AB82E7351374F2D500056B00 /* MKEntryPanel.xib in Resources */,
+ AB82E7361374F2D500056B00 /* TopBar.png in Resources */,
+ AB82E7371374F2D500056B00 /* TopBar@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -167,6 +196,7 @@
AB82E71C1374F29500056B00 /* main.m in Sources */,
AB82E71F1374F29500056B00 /* MKEntryPanelDemoAppDelegate.m in Sources */,
AB82E7251374F29600056B00 /* MKEntryPanelDemoViewController.m in Sources */,
+ AB82E7341374F2D500056B00 /* MKEntryPanel.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
14 MKEntryPanelDemo/MKEntryPanelDemoViewController.m
@@ -7,6 +7,7 @@
//
#import "MKEntryPanelDemoViewController.h"
+#import "MKEntryPanel.h"
@implementation MKEntryPanelDemoViewController
@@ -25,13 +26,22 @@ - (void)didReceiveMemoryWarning
#pragma mark - View lifecycle
-/*
+
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
[super viewDidLoad];
}
-*/
+
+-(IBAction) addTapped:(id) sender
+{
+ [MKEntryPanel showPanelWithTitle:NSLocalizedString(@"Enter a text name", @"")
+ inView:self.view
+ onTextEntered:^(NSString* enteredString)
+ {
+ NSLog(@"Entered: %@", enteredString);
+ }];
+}
- (void)viewDidUnload
{
View
4,493 MKEntryPanelDemo/en.lproj/MKEntryPanelDemoViewController.xib
4,466 additions, 27 deletions not shown
Please sign in to comment.
Something went wrong with that request. Please try again.