Skip to content
This repository
Browse code

For real this time, last commit

Fixed layouting code, cleaned up demo project and organized into
folders.  Added several more convenience methods, corrected padding
around contentViews.  Added the daysView as a demo of what the view can
do
  • Loading branch information...
commit af71bb0af69d8063473027b8b23720c8519d0cf3 1 parent 86ba852
authored September 14, 2012

Showing 28 changed files with 2,391 additions and 0 deletions. Show diff stats Hide diff stats

  1. 1  .gitignore
  2. 535  popover.xcodeproj/project.pbxproj
  3. 7  popover.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  4. BIN  popover.xcodeproj/project.xcworkspace/xcuserdata/ocrickard.xcuserdatad/UserInterfaceState.xcuserstate
  5. 96  popover.xcodeproj/xcuserdata/ocrickard.xcuserdatad/xcschemes/popover.xcscheme
  6. 27  popover.xcodeproj/xcuserdata/ocrickard.xcuserdatad/xcschemes/xcschememanagement.plist
  7. 15  popover/Demo/AppDelegate.h
  8. 52  popover/Demo/AppDelegate.m
  9. 36  popover/Demo/Calendar View/OCDaysView.h
  10. 223  popover/Demo/Calendar View/OCDaysView.m
  11. 14  popover/Demo/ViewController.h
  12. 110  popover/Demo/ViewController.m
  13. 2  popover/Demo/en.lproj/InfoPlist.strings
  14. 27  popover/Demo/en.lproj/MainStoryboard_iPad.storyboard
  15. 27  popover/Demo/en.lproj/MainStoryboard_iPhone.storyboard
  16. 18  popover/Demo/main.m
  17. 47  popover/Demo/popover-Info.plist
  18. 14  popover/Demo/popover-Prefix.pch
  19. BIN  popover/Images/error.png
  20. BIN  popover/Images/error@2x.png
  21. BIN  popover/Images/success.png
  22. BIN  popover/Images/success@2x.png
  23. 127  popover/PopoverView.h
  24. 944  popover/PopoverView.m
  25. 2  popoverTests/en.lproj/InfoPlist.strings
  26. 22  popoverTests/popoverTests-Info.plist
  27. 13  popoverTests/popoverTests.h
  28. 32  popoverTests/popoverTests.m
1  .gitignore
... ...
@@ -0,0 +1 @@
  1
+build/
535  popover.xcodeproj/project.pbxproj
... ...
@@ -0,0 +1,535 @@
  1
+// !$*UTF8*$!
  2
+{
  3
+	archiveVersion = 1;
  4
+	classes = {
  5
+	};
  6
+	objectVersion = 46;
  7
+	objects = {
  8
+
  9
+/* Begin PBXBuildFile section */
  10
+		B1175C5A15E3FBEE002FBFF1 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B1175C5915E3FBEE002FBFF1 /* UIKit.framework */; };
  11
+		B1175C5C15E3FBEE002FBFF1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B1175C5B15E3FBEE002FBFF1 /* Foundation.framework */; };
  12
+		B1175C5E15E3FBEE002FBFF1 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B1175C5D15E3FBEE002FBFF1 /* CoreGraphics.framework */; };
  13
+		B1175C6415E3FBEE002FBFF1 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = B1175C6215E3FBEE002FBFF1 /* InfoPlist.strings */; };
  14
+		B1175C6615E3FBEE002FBFF1 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B1175C6515E3FBEE002FBFF1 /* main.m */; };
  15
+		B1175C6A15E3FBEE002FBFF1 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B1175C6915E3FBEE002FBFF1 /* AppDelegate.m */; };
  16
+		B1175C6D15E3FBEE002FBFF1 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B1175C6B15E3FBEE002FBFF1 /* MainStoryboard_iPhone.storyboard */; };
  17
+		B1175C7015E3FBEE002FBFF1 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B1175C6E15E3FBEE002FBFF1 /* MainStoryboard_iPad.storyboard */; };
  18
+		B1175C7315E3FBEE002FBFF1 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B1175C7215E3FBEE002FBFF1 /* ViewController.m */; };
  19
+		B1175C7B15E3FBEE002FBFF1 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B1175C7A15E3FBEE002FBFF1 /* SenTestingKit.framework */; };
  20
+		B1175C7C15E3FBEE002FBFF1 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B1175C5915E3FBEE002FBFF1 /* UIKit.framework */; };
  21
+		B1175C7D15E3FBEE002FBFF1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B1175C5B15E3FBEE002FBFF1 /* Foundation.framework */; };
  22
+		B1175C8515E3FBEE002FBFF1 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = B1175C8315E3FBEE002FBFF1 /* InfoPlist.strings */; };
  23
+		B1175C8815E3FBEE002FBFF1 /* popoverTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B1175C8715E3FBEE002FBFF1 /* popoverTests.m */; };
  24
+		B1175C9215E3FC07002FBFF1 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B1175C9115E3FC07002FBFF1 /* QuartzCore.framework */; };
  25
+		B1175C9515E3FC13002FBFF1 /* PopoverView.m in Sources */ = {isa = PBXBuildFile; fileRef = B1175C9415E3FC13002FBFF1 /* PopoverView.m */; };
  26
+		B1175C9615E3FC13002FBFF1 /* PopoverView.m in Sources */ = {isa = PBXBuildFile; fileRef = B1175C9415E3FC13002FBFF1 /* PopoverView.m */; };
  27
+		B14F47581603A267003EC4FF /* error.png in Resources */ = {isa = PBXBuildFile; fileRef = B14F47541603A267003EC4FF /* error.png */; };
  28
+		B14F47591603A267003EC4FF /* error@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B14F47551603A267003EC4FF /* error@2x.png */; };
  29
+		B14F475A1603A267003EC4FF /* success.png in Resources */ = {isa = PBXBuildFile; fileRef = B14F47561603A267003EC4FF /* success.png */; };
  30
+		B14F475B1603A267003EC4FF /* success@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B14F47571603A267003EC4FF /* success@2x.png */; };
  31
+		B1ACBE981603859A006F8461 /* OCDaysView.m in Sources */ = {isa = PBXBuildFile; fileRef = B1ACBE971603859A006F8461 /* OCDaysView.m */; };
  32
+/* End PBXBuildFile section */
  33
+
  34
+/* Begin PBXContainerItemProxy section */
  35
+		B1175C7E15E3FBEE002FBFF1 /* PBXContainerItemProxy */ = {
  36
+			isa = PBXContainerItemProxy;
  37
+			containerPortal = B1175C4C15E3FBEE002FBFF1 /* Project object */;
  38
+			proxyType = 1;
  39
+			remoteGlobalIDString = B1175C5415E3FBEE002FBFF1;
  40
+			remoteInfo = popover;
  41
+		};
  42
+/* End PBXContainerItemProxy section */
  43
+
  44
+/* Begin PBXFileReference section */
  45
+		B1175C5515E3FBEE002FBFF1 /* popover.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = popover.app; sourceTree = BUILT_PRODUCTS_DIR; };
  46
+		B1175C5915E3FBEE002FBFF1 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
  47
+		B1175C5B15E3FBEE002FBFF1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
  48
+		B1175C5D15E3FBEE002FBFF1 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
  49
+		B1175C6115E3FBEE002FBFF1 /* popover-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "popover-Info.plist"; sourceTree = "<group>"; };
  50
+		B1175C6315E3FBEE002FBFF1 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
  51
+		B1175C6515E3FBEE002FBFF1 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
  52
+		B1175C6715E3FBEE002FBFF1 /* popover-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "popover-Prefix.pch"; sourceTree = "<group>"; };
  53
+		B1175C6815E3FBEE002FBFF1 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
  54
+		B1175C6915E3FBEE002FBFF1 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
  55
+		B1175C6C15E3FBEE002FBFF1 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = "<group>"; };
  56
+		B1175C6F15E3FBEE002FBFF1 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = "<group>"; };
  57
+		B1175C7115E3FBEE002FBFF1 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
  58
+		B1175C7215E3FBEE002FBFF1 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
  59
+		B1175C7915E3FBEE002FBFF1 /* popoverTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = popoverTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
  60
+		B1175C7A15E3FBEE002FBFF1 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
  61
+		B1175C8215E3FBEE002FBFF1 /* popoverTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "popoverTests-Info.plist"; sourceTree = "<group>"; };
  62
+		B1175C8415E3FBEE002FBFF1 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
  63
+		B1175C8615E3FBEE002FBFF1 /* popoverTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = popoverTests.h; sourceTree = "<group>"; };
  64
+		B1175C8715E3FBEE002FBFF1 /* popoverTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = popoverTests.m; sourceTree = "<group>"; };
  65
+		B1175C9115E3FC07002FBFF1 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
  66
+		B1175C9315E3FC13002FBFF1 /* PopoverView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PopoverView.h; sourceTree = "<group>"; };
  67
+		B1175C9415E3FC13002FBFF1 /* PopoverView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PopoverView.m; sourceTree = "<group>"; };
  68
+		B14F47541603A267003EC4FF /* error.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = error.png; path = popover/Images/error.png; sourceTree = SOURCE_ROOT; };
  69
+		B14F47551603A267003EC4FF /* error@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "error@2x.png"; path = "popover/Images/error@2x.png"; sourceTree = SOURCE_ROOT; };
  70
+		B14F47561603A267003EC4FF /* success.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = success.png; path = popover/Images/success.png; sourceTree = SOURCE_ROOT; };
  71
+		B14F47571603A267003EC4FF /* success@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "success@2x.png"; path = "popover/Images/success@2x.png"; sourceTree = SOURCE_ROOT; };
  72
+		B1ACBE961603859A006F8461 /* OCDaysView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCDaysView.h; sourceTree = "<group>"; };
  73
+		B1ACBE971603859A006F8461 /* OCDaysView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OCDaysView.m; sourceTree = "<group>"; };
  74
+/* End PBXFileReference section */
  75
+
  76
+/* Begin PBXFrameworksBuildPhase section */
  77
+		B1175C5215E3FBEE002FBFF1 /* Frameworks */ = {
  78
+			isa = PBXFrameworksBuildPhase;
  79
+			buildActionMask = 2147483647;
  80
+			files = (
  81
+				B1175C9215E3FC07002FBFF1 /* QuartzCore.framework in Frameworks */,
  82
+				B1175C5A15E3FBEE002FBFF1 /* UIKit.framework in Frameworks */,
  83
+				B1175C5C15E3FBEE002FBFF1 /* Foundation.framework in Frameworks */,
  84
+				B1175C5E15E3FBEE002FBFF1 /* CoreGraphics.framework in Frameworks */,
  85
+			);
  86
+			runOnlyForDeploymentPostprocessing = 0;
  87
+		};
  88
+		B1175C7515E3FBEE002FBFF1 /* Frameworks */ = {
  89
+			isa = PBXFrameworksBuildPhase;
  90
+			buildActionMask = 2147483647;
  91
+			files = (
  92
+				B1175C7B15E3FBEE002FBFF1 /* SenTestingKit.framework in Frameworks */,
  93
+				B1175C7C15E3FBEE002FBFF1 /* UIKit.framework in Frameworks */,
  94
+				B1175C7D15E3FBEE002FBFF1 /* Foundation.framework in Frameworks */,
  95
+			);
  96
+			runOnlyForDeploymentPostprocessing = 0;
  97
+		};
  98
+/* End PBXFrameworksBuildPhase section */
  99
+
  100
+/* Begin PBXGroup section */
  101
+		B1175C4A15E3FBEE002FBFF1 = {
  102
+			isa = PBXGroup;
  103
+			children = (
  104
+				B1175C9115E3FC07002FBFF1 /* QuartzCore.framework */,
  105
+				B1175C5F15E3FBEE002FBFF1 /* popover */,
  106
+				B1175C8015E3FBEE002FBFF1 /* popoverTests */,
  107
+				B1175C5815E3FBEE002FBFF1 /* Frameworks */,
  108
+				B1175C5615E3FBEE002FBFF1 /* Products */,
  109
+			);
  110
+			sourceTree = "<group>";
  111
+		};
  112
+		B1175C5615E3FBEE002FBFF1 /* Products */ = {
  113
+			isa = PBXGroup;
  114
+			children = (
  115
+				B1175C5515E3FBEE002FBFF1 /* popover.app */,
  116
+				B1175C7915E3FBEE002FBFF1 /* popoverTests.octest */,
  117
+			);
  118
+			name = Products;
  119
+			sourceTree = "<group>";
  120
+		};
  121
+		B1175C5815E3FBEE002FBFF1 /* Frameworks */ = {
  122
+			isa = PBXGroup;
  123
+			children = (
  124
+				B1175C5915E3FBEE002FBFF1 /* UIKit.framework */,
  125
+				B1175C5B15E3FBEE002FBFF1 /* Foundation.framework */,
  126
+				B1175C5D15E3FBEE002FBFF1 /* CoreGraphics.framework */,
  127
+				B1175C7A15E3FBEE002FBFF1 /* SenTestingKit.framework */,
  128
+			);
  129
+			name = Frameworks;
  130
+			sourceTree = "<group>";
  131
+		};
  132
+		B1175C5F15E3FBEE002FBFF1 /* popover */ = {
  133
+			isa = PBXGroup;
  134
+			children = (
  135
+				B1ACBE941603858D006F8461 /* Demo Calendar View - Not Important */,
  136
+				B1C7262515EE822B008C4D05 /* PopoverView */,
  137
+				B1ACBE991603A040006F8461 /* Demo */,
  138
+				B1175C6015E3FBEE002FBFF1 /* Supporting Files */,
  139
+			);
  140
+			path = popover;
  141
+			sourceTree = "<group>";
  142
+		};
  143
+		B1175C6015E3FBEE002FBFF1 /* Supporting Files */ = {
  144
+			isa = PBXGroup;
  145
+			children = (
  146
+				B1C7262415EE8222008C4D05 /* Images */,
  147
+				B1175C6115E3FBEE002FBFF1 /* popover-Info.plist */,
  148
+				B1175C6515E3FBEE002FBFF1 /* main.m */,
  149
+				B1175C6715E3FBEE002FBFF1 /* popover-Prefix.pch */,
  150
+				B1175C6215E3FBEE002FBFF1 /* InfoPlist.strings */,
  151
+			);
  152
+			name = "Supporting Files";
  153
+			path = Demo;
  154
+			sourceTree = "<group>";
  155
+		};
  156
+		B1175C8015E3FBEE002FBFF1 /* popoverTests */ = {
  157
+			isa = PBXGroup;
  158
+			children = (
  159
+				B1175C8615E3FBEE002FBFF1 /* popoverTests.h */,
  160
+				B1175C8715E3FBEE002FBFF1 /* popoverTests.m */,
  161
+				B1175C8115E3FBEE002FBFF1 /* Supporting Files */,
  162
+			);
  163
+			path = popoverTests;
  164
+			sourceTree = "<group>";
  165
+		};
  166
+		B1175C8115E3FBEE002FBFF1 /* Supporting Files */ = {
  167
+			isa = PBXGroup;
  168
+			children = (
  169
+				B1175C8215E3FBEE002FBFF1 /* popoverTests-Info.plist */,
  170
+				B1175C8315E3FBEE002FBFF1 /* InfoPlist.strings */,
  171
+			);
  172
+			name = "Supporting Files";
  173
+			sourceTree = "<group>";
  174
+		};
  175
+		B1ACBE941603858D006F8461 /* Demo Calendar View - Not Important */ = {
  176
+			isa = PBXGroup;
  177
+			children = (
  178
+				B1ACBE961603859A006F8461 /* OCDaysView.h */,
  179
+				B1ACBE971603859A006F8461 /* OCDaysView.m */,
  180
+			);
  181
+			name = "Demo Calendar View - Not Important";
  182
+			path = "Demo/Calendar View";
  183
+			sourceTree = "<group>";
  184
+		};
  185
+		B1ACBE991603A040006F8461 /* Demo */ = {
  186
+			isa = PBXGroup;
  187
+			children = (
  188
+				B1175C6815E3FBEE002FBFF1 /* AppDelegate.h */,
  189
+				B1175C6915E3FBEE002FBFF1 /* AppDelegate.m */,
  190
+				B1175C6B15E3FBEE002FBFF1 /* MainStoryboard_iPhone.storyboard */,
  191
+				B1175C6E15E3FBEE002FBFF1 /* MainStoryboard_iPad.storyboard */,
  192
+				B1175C7115E3FBEE002FBFF1 /* ViewController.h */,
  193
+				B1175C7215E3FBEE002FBFF1 /* ViewController.m */,
  194
+			);
  195
+			path = Demo;
  196
+			sourceTree = "<group>";
  197
+		};
  198
+		B1C7262415EE8222008C4D05 /* Images */ = {
  199
+			isa = PBXGroup;
  200
+			children = (
  201
+				B14F47541603A267003EC4FF /* error.png */,
  202
+				B14F47551603A267003EC4FF /* error@2x.png */,
  203
+				B14F47561603A267003EC4FF /* success.png */,
  204
+				B14F47571603A267003EC4FF /* success@2x.png */,
  205
+			);
  206
+			path = Images;
  207
+			sourceTree = "<group>";
  208
+		};
  209
+		B1C7262515EE822B008C4D05 /* PopoverView */ = {
  210
+			isa = PBXGroup;
  211
+			children = (
  212
+				B1175C9315E3FC13002FBFF1 /* PopoverView.h */,
  213
+				B1175C9415E3FC13002FBFF1 /* PopoverView.m */,
  214
+			);
  215
+			name = PopoverView;
  216
+			sourceTree = "<group>";
  217
+		};
  218
+/* End PBXGroup section */
  219
+
  220
+/* Begin PBXNativeTarget section */
  221
+		B1175C5415E3FBEE002FBFF1 /* popover */ = {
  222
+			isa = PBXNativeTarget;
  223
+			buildConfigurationList = B1175C8B15E3FBEE002FBFF1 /* Build configuration list for PBXNativeTarget "popover" */;
  224
+			buildPhases = (
  225
+				B1175C5115E3FBEE002FBFF1 /* Sources */,
  226
+				B1175C5215E3FBEE002FBFF1 /* Frameworks */,
  227
+				B1175C5315E3FBEE002FBFF1 /* Resources */,
  228
+			);
  229
+			buildRules = (
  230
+			);
  231
+			dependencies = (
  232
+			);
  233
+			name = popover;
  234
+			productName = popover;
  235
+			productReference = B1175C5515E3FBEE002FBFF1 /* popover.app */;
  236
+			productType = "com.apple.product-type.application";
  237
+		};
  238
+		B1175C7815E3FBEE002FBFF1 /* popoverTests */ = {
  239
+			isa = PBXNativeTarget;
  240
+			buildConfigurationList = B1175C8E15E3FBEE002FBFF1 /* Build configuration list for PBXNativeTarget "popoverTests" */;
  241
+			buildPhases = (
  242
+				B1175C7415E3FBEE002FBFF1 /* Sources */,
  243
+				B1175C7515E3FBEE002FBFF1 /* Frameworks */,
  244
+				B1175C7615E3FBEE002FBFF1 /* Resources */,
  245
+				B1175C7715E3FBEE002FBFF1 /* ShellScript */,
  246
+			);
  247
+			buildRules = (
  248
+			);
  249
+			dependencies = (
  250
+				B1175C7F15E3FBEE002FBFF1 /* PBXTargetDependency */,
  251
+			);
  252
+			name = popoverTests;
  253
+			productName = popoverTests;
  254
+			productReference = B1175C7915E3FBEE002FBFF1 /* popoverTests.octest */;
  255
+			productType = "com.apple.product-type.bundle";
  256
+		};
  257
+/* End PBXNativeTarget section */
  258
+
  259
+/* Begin PBXProject section */
  260
+		B1175C4C15E3FBEE002FBFF1 /* Project object */ = {
  261
+			isa = PBXProject;
  262
+			attributes = {
  263
+				LastUpgradeCheck = 0440;
  264
+				ORGANIZATIONNAME = "Oliver Rickard";
  265
+			};
  266
+			buildConfigurationList = B1175C4F15E3FBEE002FBFF1 /* Build configuration list for PBXProject "popover" */;
  267
+			compatibilityVersion = "Xcode 3.2";
  268
+			developmentRegion = English;
  269
+			hasScannedForEncodings = 0;
  270
+			knownRegions = (
  271
+				en,
  272
+			);
  273
+			mainGroup = B1175C4A15E3FBEE002FBFF1;
  274
+			productRefGroup = B1175C5615E3FBEE002FBFF1 /* Products */;
  275
+			projectDirPath = "";
  276
+			projectRoot = "";
  277
+			targets = (
  278
+				B1175C5415E3FBEE002FBFF1 /* popover */,
  279
+				B1175C7815E3FBEE002FBFF1 /* popoverTests */,
  280
+			);
  281
+		};
  282
+/* End PBXProject section */
  283
+
  284
+/* Begin PBXResourcesBuildPhase section */
  285
+		B1175C5315E3FBEE002FBFF1 /* Resources */ = {
  286
+			isa = PBXResourcesBuildPhase;
  287
+			buildActionMask = 2147483647;
  288
+			files = (
  289
+				B1175C6415E3FBEE002FBFF1 /* InfoPlist.strings in Resources */,
  290
+				B1175C6D15E3FBEE002FBFF1 /* MainStoryboard_iPhone.storyboard in Resources */,
  291
+				B1175C7015E3FBEE002FBFF1 /* MainStoryboard_iPad.storyboard in Resources */,
  292
+				B14F47581603A267003EC4FF /* error.png in Resources */,
  293
+				B14F47591603A267003EC4FF /* error@2x.png in Resources */,
  294
+				B14F475A1603A267003EC4FF /* success.png in Resources */,
  295
+				B14F475B1603A267003EC4FF /* success@2x.png in Resources */,
  296
+			);
  297
+			runOnlyForDeploymentPostprocessing = 0;
  298
+		};
  299
+		B1175C7615E3FBEE002FBFF1 /* Resources */ = {
  300
+			isa = PBXResourcesBuildPhase;
  301
+			buildActionMask = 2147483647;
  302
+			files = (
  303
+				B1175C8515E3FBEE002FBFF1 /* InfoPlist.strings in Resources */,
  304
+			);
  305
+			runOnlyForDeploymentPostprocessing = 0;
  306
+		};
  307
+/* End PBXResourcesBuildPhase section */
  308
+
  309
+/* Begin PBXShellScriptBuildPhase section */
  310
+		B1175C7715E3FBEE002FBFF1 /* ShellScript */ = {
  311
+			isa = PBXShellScriptBuildPhase;
  312
+			buildActionMask = 2147483647;
  313
+			files = (
  314
+			);
  315
+			inputPaths = (
  316
+			);
  317
+			outputPaths = (
  318
+			);
  319
+			runOnlyForDeploymentPostprocessing = 0;
  320
+			shellPath = /bin/sh;
  321
+			shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
  322
+		};
  323
+/* End PBXShellScriptBuildPhase section */
  324
+
  325
+/* Begin PBXSourcesBuildPhase section */
  326
+		B1175C5115E3FBEE002FBFF1 /* Sources */ = {
  327
+			isa = PBXSourcesBuildPhase;
  328
+			buildActionMask = 2147483647;
  329
+			files = (
  330
+				B1175C6615E3FBEE002FBFF1 /* main.m in Sources */,
  331
+				B1175C6A15E3FBEE002FBFF1 /* AppDelegate.m in Sources */,
  332
+				B1175C7315E3FBEE002FBFF1 /* ViewController.m in Sources */,
  333
+				B1175C9515E3FC13002FBFF1 /* PopoverView.m in Sources */,
  334
+				B1ACBE981603859A006F8461 /* OCDaysView.m in Sources */,
  335
+			);
  336
+			runOnlyForDeploymentPostprocessing = 0;
  337
+		};
  338
+		B1175C7415E3FBEE002FBFF1 /* Sources */ = {
  339
+			isa = PBXSourcesBuildPhase;
  340
+			buildActionMask = 2147483647;
  341
+			files = (
  342
+				B1175C8815E3FBEE002FBFF1 /* popoverTests.m in Sources */,
  343
+				B1175C9615E3FC13002FBFF1 /* PopoverView.m in Sources */,
  344
+			);
  345
+			runOnlyForDeploymentPostprocessing = 0;
  346
+		};
  347
+/* End PBXSourcesBuildPhase section */
  348
+
  349
+/* Begin PBXTargetDependency section */
  350
+		B1175C7F15E3FBEE002FBFF1 /* PBXTargetDependency */ = {
  351
+			isa = PBXTargetDependency;
  352
+			target = B1175C5415E3FBEE002FBFF1 /* popover */;
  353
+			targetProxy = B1175C7E15E3FBEE002FBFF1 /* PBXContainerItemProxy */;
  354
+		};
  355
+/* End PBXTargetDependency section */
  356
+
  357
+/* Begin PBXVariantGroup section */
  358
+		B1175C6215E3FBEE002FBFF1 /* InfoPlist.strings */ = {
  359
+			isa = PBXVariantGroup;
  360
+			children = (
  361
+				B1175C6315E3FBEE002FBFF1 /* en */,
  362
+			);
  363
+			name = InfoPlist.strings;
  364
+			sourceTree = "<group>";
  365
+		};
  366
+		B1175C6B15E3FBEE002FBFF1 /* MainStoryboard_iPhone.storyboard */ = {
  367
+			isa = PBXVariantGroup;
  368
+			children = (
  369
+				B1175C6C15E3FBEE002FBFF1 /* en */,
  370
+			);
  371
+			name = MainStoryboard_iPhone.storyboard;
  372
+			sourceTree = "<group>";
  373
+		};
  374
+		B1175C6E15E3FBEE002FBFF1 /* MainStoryboard_iPad.storyboard */ = {
  375
+			isa = PBXVariantGroup;
  376
+			children = (
  377
+				B1175C6F15E3FBEE002FBFF1 /* en */,
  378
+			);
  379
+			name = MainStoryboard_iPad.storyboard;
  380
+			sourceTree = "<group>";
  381
+		};
  382
+		B1175C8315E3FBEE002FBFF1 /* InfoPlist.strings */ = {
  383
+			isa = PBXVariantGroup;
  384
+			children = (
  385
+				B1175C8415E3FBEE002FBFF1 /* en */,
  386
+			);
  387
+			name = InfoPlist.strings;
  388
+			sourceTree = "<group>";
  389
+		};
  390
+/* End PBXVariantGroup section */
  391
+
  392
+/* Begin XCBuildConfiguration section */
  393
+		B1175C8915E3FBEE002FBFF1 /* Debug */ = {
  394
+			isa = XCBuildConfiguration;
  395
+			buildSettings = {
  396
+				ALWAYS_SEARCH_USER_PATHS = NO;
  397
+				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
  398
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
  399
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
  400
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
  401
+				COPY_PHASE_STRIP = NO;
  402
+				GCC_C_LANGUAGE_STANDARD = gnu99;
  403
+				GCC_DYNAMIC_NO_PIC = NO;
  404
+				GCC_OPTIMIZATION_LEVEL = 0;
  405
+				GCC_PREPROCESSOR_DEFINITIONS = (
  406
+					"DEBUG=1",
  407
+					"$(inherited)",
  408
+				);
  409
+				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
  410
+				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
  411
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
  412
+				GCC_WARN_UNINITIALIZED_AUTOS = YES;
  413
+				GCC_WARN_UNUSED_VARIABLE = YES;
  414
+				IPHONEOS_DEPLOYMENT_TARGET = 5.1;
  415
+				SDKROOT = iphoneos;
  416
+				TARGETED_DEVICE_FAMILY = "1,2";
  417
+			};
  418
+			name = Debug;
  419
+		};
  420
+		B1175C8A15E3FBEE002FBFF1 /* Release */ = {
  421
+			isa = XCBuildConfiguration;
  422
+			buildSettings = {
  423
+				ALWAYS_SEARCH_USER_PATHS = NO;
  424
+				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
  425
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
  426
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
  427
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
  428
+				COPY_PHASE_STRIP = YES;
  429
+				GCC_C_LANGUAGE_STANDARD = gnu99;
  430
+				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
  431
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
  432
+				GCC_WARN_UNINITIALIZED_AUTOS = YES;
  433
+				GCC_WARN_UNUSED_VARIABLE = YES;
  434
+				IPHONEOS_DEPLOYMENT_TARGET = 5.1;
  435
+				OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
  436
+				SDKROOT = iphoneos;
  437
+				TARGETED_DEVICE_FAMILY = "1,2";
  438
+				VALIDATE_PRODUCT = YES;
  439
+			};
  440
+			name = Release;
  441
+		};
  442
+		B1175C8C15E3FBEE002FBFF1 /* Debug */ = {
  443
+			isa = XCBuildConfiguration;
  444
+			buildSettings = {
  445
+				CODE_SIGN_IDENTITY = "iPhone Developer: Oliver Rickard (M2X353B497)";
  446
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Oliver Rickard (M2X353B497)";
  447
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
  448
+				GCC_PREFIX_HEADER = "popover/Demo/popover-Prefix.pch";
  449
+				INFOPLIST_FILE = "popover/Demo/popover-Info.plist";
  450
+				PRODUCT_NAME = "$(TARGET_NAME)";
  451
+				PROVISIONING_PROFILE = "C183E71C-4BA9-4B64-B7E5-BA551FF1F744";
  452
+				"PROVISIONING_PROFILE[sdk=iphoneos*]" = "C183E71C-4BA9-4B64-B7E5-BA551FF1F744";
  453
+				WRAPPER_EXTENSION = app;
  454
+			};
  455
+			name = Debug;
  456
+		};
  457
+		B1175C8D15E3FBEE002FBFF1 /* Release */ = {
  458
+			isa = XCBuildConfiguration;
  459
+			buildSettings = {
  460
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
  461
+				GCC_PREFIX_HEADER = "popover/Demo/popover-Prefix.pch";
  462
+				INFOPLIST_FILE = "popover/Demo/popover-Info.plist";
  463
+				PRODUCT_NAME = "$(TARGET_NAME)";
  464
+				WRAPPER_EXTENSION = app;
  465
+			};
  466
+			name = Release;
  467
+		};
  468
+		B1175C8F15E3FBEE002FBFF1 /* Debug */ = {
  469
+			isa = XCBuildConfiguration;
  470
+			buildSettings = {
  471
+				BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/popover.app/popover";
  472
+				FRAMEWORK_SEARCH_PATHS = (
  473
+					"\"$(SDKROOT)/Developer/Library/Frameworks\"",
  474
+					"\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
  475
+				);
  476
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
  477
+				GCC_PREFIX_HEADER = "popover/popover-Prefix.pch";
  478
+				INFOPLIST_FILE = "popoverTests/popoverTests-Info.plist";
  479
+				PRODUCT_NAME = "$(TARGET_NAME)";
  480
+				TEST_HOST = "$(BUNDLE_LOADER)";
  481
+				WRAPPER_EXTENSION = octest;
  482
+			};
  483
+			name = Debug;
  484
+		};
  485
+		B1175C9015E3FBEE002FBFF1 /* Release */ = {
  486
+			isa = XCBuildConfiguration;
  487
+			buildSettings = {
  488
+				BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/popover.app/popover";
  489
+				FRAMEWORK_SEARCH_PATHS = (
  490
+					"\"$(SDKROOT)/Developer/Library/Frameworks\"",
  491
+					"\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
  492
+				);
  493
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
  494
+				GCC_PREFIX_HEADER = "popover/popover-Prefix.pch";
  495
+				INFOPLIST_FILE = "popoverTests/popoverTests-Info.plist";
  496
+				PRODUCT_NAME = "$(TARGET_NAME)";
  497
+				TEST_HOST = "$(BUNDLE_LOADER)";
  498
+				WRAPPER_EXTENSION = octest;
  499
+			};
  500
+			name = Release;
  501
+		};
  502
+/* End XCBuildConfiguration section */
  503
+
  504
+/* Begin XCConfigurationList section */
  505
+		B1175C4F15E3FBEE002FBFF1 /* Build configuration list for PBXProject "popover" */ = {
  506
+			isa = XCConfigurationList;
  507
+			buildConfigurations = (
  508
+				B1175C8915E3FBEE002FBFF1 /* Debug */,
  509
+				B1175C8A15E3FBEE002FBFF1 /* Release */,
  510
+			);
  511
+			defaultConfigurationIsVisible = 0;
  512
+			defaultConfigurationName = Release;
  513
+		};
  514
+		B1175C8B15E3FBEE002FBFF1 /* Build configuration list for PBXNativeTarget "popover" */ = {
  515
+			isa = XCConfigurationList;
  516
+			buildConfigurations = (
  517
+				B1175C8C15E3FBEE002FBFF1 /* Debug */,
  518
+				B1175C8D15E3FBEE002FBFF1 /* Release */,
  519
+			);
  520
+			defaultConfigurationIsVisible = 0;
  521
+			defaultConfigurationName = Release;
  522
+		};
  523
+		B1175C8E15E3FBEE002FBFF1 /* Build configuration list for PBXNativeTarget "popoverTests" */ = {
  524
+			isa = XCConfigurationList;
  525
+			buildConfigurations = (
  526
+				B1175C8F15E3FBEE002FBFF1 /* Debug */,
  527
+				B1175C9015E3FBEE002FBFF1 /* Release */,
  528
+			);
  529
+			defaultConfigurationIsVisible = 0;
  530
+			defaultConfigurationName = Release;
  531
+		};
  532
+/* End XCConfigurationList section */
  533
+	};
  534
+	rootObject = B1175C4C15E3FBEE002FBFF1 /* Project object */;
  535
+}
7  popover.xcodeproj/project.xcworkspace/contents.xcworkspacedata
... ...
@@ -0,0 +1,7 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<Workspace
  3
+   version = "1.0">
  4
+   <FileRef
  5
+      location = "self:popover.xcodeproj">
  6
+   </FileRef>
  7
+</Workspace>
BIN  popover.xcodeproj/project.xcworkspace/xcuserdata/ocrickard.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
96  popover.xcodeproj/xcuserdata/ocrickard.xcuserdatad/xcschemes/popover.xcscheme
... ...
@@ -0,0 +1,96 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<Scheme
  3
+   LastUpgradeVersion = "0440"
  4
+   version = "1.3">
  5
+   <BuildAction
  6
+      parallelizeBuildables = "YES"
  7
+      buildImplicitDependencies = "YES">
  8
+      <BuildActionEntries>
  9
+         <BuildActionEntry
  10
+            buildForTesting = "YES"
  11
+            buildForRunning = "YES"
  12
+            buildForProfiling = "YES"
  13
+            buildForArchiving = "YES"
  14
+            buildForAnalyzing = "YES">
  15
+            <BuildableReference
  16
+               BuildableIdentifier = "primary"
  17
+               BlueprintIdentifier = "B1175C5415E3FBEE002FBFF1"
  18
+               BuildableName = "popover.app"
  19
+               BlueprintName = "popover"
  20
+               ReferencedContainer = "container:popover.xcodeproj">
  21
+            </BuildableReference>
  22
+         </BuildActionEntry>
  23
+      </BuildActionEntries>
  24
+   </BuildAction>
  25
+   <TestAction
  26
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
  27
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
  28
+      shouldUseLaunchSchemeArgsEnv = "YES"
  29
+      buildConfiguration = "Debug">
  30
+      <Testables>
  31
+         <TestableReference
  32
+            skipped = "NO">
  33
+            <BuildableReference
  34
+               BuildableIdentifier = "primary"
  35
+               BlueprintIdentifier = "B1175C7815E3FBEE002FBFF1"
  36
+               BuildableName = "popoverTests.octest"
  37
+               BlueprintName = "popoverTests"
  38
+               ReferencedContainer = "container:popover.xcodeproj">
  39
+            </BuildableReference>
  40
+         </TestableReference>
  41
+      </Testables>
  42
+      <MacroExpansion>
  43
+         <BuildableReference
  44
+            BuildableIdentifier = "primary"
  45
+            BlueprintIdentifier = "B1175C5415E3FBEE002FBFF1"
  46
+            BuildableName = "popover.app"
  47
+            BlueprintName = "popover"
  48
+            ReferencedContainer = "container:popover.xcodeproj">
  49
+         </BuildableReference>
  50
+      </MacroExpansion>
  51
+   </TestAction>
  52
+   <LaunchAction
  53
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
  54
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
  55
+      launchStyle = "0"
  56
+      useCustomWorkingDirectory = "NO"
  57
+      buildConfiguration = "Debug"
  58
+      ignoresPersistentStateOnLaunch = "NO"
  59
+      debugDocumentVersioning = "YES"
  60
+      allowLocationSimulation = "YES">
  61
+      <BuildableProductRunnable>
  62
+         <BuildableReference
  63
+            BuildableIdentifier = "primary"
  64
+            BlueprintIdentifier = "B1175C5415E3FBEE002FBFF1"
  65
+            BuildableName = "popover.app"
  66
+            BlueprintName = "popover"
  67
+            ReferencedContainer = "container:popover.xcodeproj">
  68
+         </BuildableReference>
  69
+      </BuildableProductRunnable>
  70
+      <AdditionalOptions>
  71
+      </AdditionalOptions>
  72
+   </LaunchAction>
  73
+   <ProfileAction
  74
+      shouldUseLaunchSchemeArgsEnv = "YES"
  75
+      savedToolIdentifier = ""
  76
+      useCustomWorkingDirectory = "NO"
  77
+      buildConfiguration = "Release"
  78
+      debugDocumentVersioning = "YES">
  79
+      <BuildableProductRunnable>
  80
+         <BuildableReference
  81
+            BuildableIdentifier = "primary"
  82
+            BlueprintIdentifier = "B1175C5415E3FBEE002FBFF1"
  83
+            BuildableName = "popover.app"
  84
+            BlueprintName = "popover"
  85
+            ReferencedContainer = "container:popover.xcodeproj">
  86
+         </BuildableReference>
  87
+      </BuildableProductRunnable>
  88
+   </ProfileAction>
  89
+   <AnalyzeAction
  90
+      buildConfiguration = "Debug">
  91
+   </AnalyzeAction>
  92
+   <ArchiveAction
  93
+      buildConfiguration = "Release"
  94
+      revealArchiveInOrganizer = "YES">
  95
+   </ArchiveAction>
  96
+</Scheme>
27  popover.xcodeproj/xcuserdata/ocrickard.xcuserdatad/xcschemes/xcschememanagement.plist
... ...
@@ -0,0 +1,27 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3
+<plist version="1.0">
  4
+<dict>
  5
+	<key>SchemeUserState</key>
  6
+	<dict>
  7
+		<key>popover.xcscheme</key>
  8
+		<dict>
  9
+			<key>orderHint</key>
  10
+			<integer>0</integer>
  11
+		</dict>
  12
+	</dict>
  13
+	<key>SuppressBuildableAutocreation</key>
  14
+	<dict>
  15
+		<key>B1175C5415E3FBEE002FBFF1</key>
  16
+		<dict>
  17
+			<key>primary</key>
  18
+			<true/>
  19
+		</dict>
  20
+		<key>B1175C7815E3FBEE002FBFF1</key>
  21
+		<dict>
  22
+			<key>primary</key>
  23
+			<true/>
  24
+		</dict>
  25
+	</dict>
  26
+</dict>
  27
+</plist>
15  popover/Demo/AppDelegate.h
... ...
@@ -0,0 +1,15 @@
  1
+//
  2
+//  AppDelegate.h
  3
+//  popover
  4
+//
  5
+//  Created by Oliver Rickard on 21/08/2012.
  6
+//  Copyright (c) 2012 Oliver Rickard. All rights reserved.
  7
+//
  8
+
  9
+#import <UIKit/UIKit.h>
  10
+
  11
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
  12
+
  13
+@property (strong, nonatomic) UIWindow *window;
  14
+
  15
+@end
52  popover/Demo/AppDelegate.m
... ...
@@ -0,0 +1,52 @@
  1
+//
  2
+//  AppDelegate.m
  3
+//  popover
  4
+//
  5
+//  Created by Oliver Rickard on 21/08/2012.
  6
+//  Copyright (c) 2012 Oliver Rickard. All rights reserved.
  7
+//
  8
+
  9
+#import "AppDelegate.h"
  10
+
  11
+@implementation AppDelegate
  12
+
  13
+- (void)dealloc
  14
+{
  15
+    [_window release];
  16
+    [super dealloc];
  17
+}
  18
+
  19
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  20
+{
  21
+    // Override point for customization after application launch.
  22
+    return YES;
  23
+}
  24
+							
  25
+- (void)applicationWillResignActive:(UIApplication *)application
  26
+{
  27
+    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
  28
+    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
  29
+}
  30
+
  31
+- (void)applicationDidEnterBackground:(UIApplication *)application
  32
+{
  33
+    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
  34
+    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
  35
+}
  36
+
  37
+- (void)applicationWillEnterForeground:(UIApplication *)application
  38
+{
  39
+    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
  40
+}
  41
+
  42
+- (void)applicationDidBecomeActive:(UIApplication *)application
  43
+{
  44
+    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
  45
+}
  46
+
  47
+- (void)applicationWillTerminate:(UIApplication *)application
  48
+{
  49
+    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
  50
+}
  51
+
  52
+@end
36  popover/Demo/Calendar View/OCDaysView.h
... ...
@@ -0,0 +1,36 @@
  1
+//
  2
+//  OCDaysView.h
  3
+//  OCCalendar
  4
+//
  5
+//  Created by Oliver Rickard on 3/30/12.
  6
+//  Copyright (c) 2012 UC Berkeley. All rights reserved.
  7
+//
  8
+
  9
+#import <UIKit/UIKit.h>
  10
+
  11
+@interface OCDaysView : UIView {
  12
+    int startCellX;
  13
+    int startCellY;
  14
+    int endCellX;
  15
+    int endCellY;
  16
+    
  17
+    float xOffset;
  18
+    float yOffset;
  19
+    
  20
+    float hDiff;
  21
+    float vDiff;
  22
+    
  23
+    int currentMonth;
  24
+    int currentYear;
  25
+    
  26
+    BOOL didAddExtraRow;
  27
+}
  28
+
  29
+- (void)setMonth:(int)month;
  30
+- (void)setYear:(int)year;
  31
+
  32
+- (void)resetRows;
  33
+
  34
+- (BOOL)addExtraRow;
  35
+
  36
+@end
223  popover/Demo/Calendar View/OCDaysView.m
... ...
@@ -0,0 +1,223 @@
  1
+//
  2
+//  OCDaysView.m
  3
+//  OCCalendar
  4
+//
  5
+//  Created by Oliver Rickard on 3/30/12.
  6
+//  Copyright (c) 2012 UC Berkeley. All rights reserved.
  7
+//
  8
+
  9
+#import "OCDaysView.h"
  10
+#import <QuartzCore/QuartzCore.h>
  11
+
  12
+@implementation OCDaysView
  13
+
  14
+- (id)initWithFrame:(CGRect)frame
  15
+{
  16
+    self = [super initWithFrame:frame];
  17
+    if (self) {
  18
+        self.userInteractionEnabled = NO;
  19
+        
  20
+        startCellX = 3;
  21
+        startCellY = 0;
  22
+        endCellX = 3;
  23
+        endCellY = 0;
  24
+        
  25
+        hDiff = floorf(frame.size.width / 7.f);
  26
+        vDiff = floorf(frame.size.height / 4.f);
  27
+        
  28
+        self.backgroundColor = [UIColor clearColor];
  29
+    }
  30
+    return self;
  31
+}
  32
+
  33
+
  34
+// Only override drawRect: if you perform custom drawing.
  35
+// An empty implementation adversely affects performance during animation.
  36
+- (void)drawRect:(CGRect)rect
  37
+{
  38
+    
  39
+//    CGSize shadow2Offset = CGSizeMake(1, 1);
  40
+//    CGFloat shadow2BlurRadius = 1;
  41
+//    CGColorRef shadow2 = [UIColor blackColor].CGColor;
  42
+    
  43
+    NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
  44
+    
  45
+    int month = currentMonth;
  46
+    int year = currentYear;
  47
+	
  48
+	//Get the first day of the month
  49
+	NSDateComponents *dateParts = [[NSDateComponents alloc] init];
  50
+	[dateParts setMonth:month];
  51
+	[dateParts setYear:year];
  52
+	[dateParts setDay:1];
  53
+	NSDate *dateOnFirst = [calendar dateFromComponents:dateParts];
  54
+	[dateParts release];
  55
+	NSDateComponents *weekdayComponents = [calendar components:NSWeekdayCalendarUnit fromDate:dateOnFirst];
  56
+	int weekdayOfFirst = [weekdayComponents weekday];	
  57
+    
  58
+    //NSLog(@"weekdayOfFirst:%d", weekdayOfFirst);
  59
+
  60
+	int numDaysInMonth = [calendar rangeOfUnit:NSDayCalendarUnit 
  61
+										inUnit:NSMonthCalendarUnit 
  62
+                                       forDate:dateOnFirst].length;
  63
+    
  64
+    //NSLog(@"month:%d, numDaysInMonth:%d", currentMonth, numDaysInMonth);
  65
+    
  66
+    CGContextRef context = UIGraphicsGetCurrentContext();
  67
+    
  68
+    didAddExtraRow = NO;
  69
+    
  70
+    
  71
+    
  72
+    //Find number of days in previous month
  73
+    NSDateComponents *prevDateParts = [[NSDateComponents alloc] init];
  74
+	[prevDateParts setMonth:month-1];
  75
+	[prevDateParts setYear:year];
  76
+	[prevDateParts setDay:1];
  77
+    
  78
+    NSDate *prevDateOnFirst = [calendar dateFromComponents:prevDateParts];
  79
+    
  80
+    [prevDateParts release];
  81
+    
  82
+    int numDaysInPrevMonth = [calendar rangeOfUnit:NSDayCalendarUnit 
  83
+										inUnit:NSMonthCalendarUnit 
  84
+                                       forDate:prevDateOnFirst].length;
  85
+    
  86
+    NSDateComponents *today = [[NSCalendar currentCalendar] components:NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit fromDate:[NSDate date]];
  87
+    
  88
+    //Draw the text for each of those days.
  89
+    for(int i = 0; i <= weekdayOfFirst-2; i++) {
  90
+        int day = numDaysInPrevMonth - weekdayOfFirst + 2 + i;
  91
+        
  92
+        NSString *str = [NSString stringWithFormat:@"%d", day];
  93
+        
  94
+        
  95
+        
  96
+        CGContextSaveGState(context);
  97
+//        CGContextSetShadowWithColor(context, shadow2Offset, shadow2BlurRadius, shadow2);
  98
+        CGRect dayHeader2Frame = CGRectMake((i)*hDiff, 0, 21, 14);
  99
+        [[UIColor colorWithWhite:0.6f alpha:1.0f] setFill];
  100
+        [str drawInRect: dayHeader2Frame withFont: [UIFont fontWithName: @"Helvetica" size: 12] lineBreakMode: UILineBreakModeWordWrap alignment: UITextAlignmentCenter];
  101
+        CGContextRestoreGState(context);
  102
+    }
  103
+    
  104
+    
  105
+    BOOL endedOnSat = NO;
  106
+	int finalRow = 0;
  107
+	int day = 1;
  108
+	for (int i = 0; i < 6; i++) {
  109
+		for(int j = 0; j < 7; j++) {
  110
+			int dayNumber = i * 7 + j;
  111
+			
  112
+			if(dayNumber >= (weekdayOfFirst-1) && day <= numDaysInMonth) {
  113
+                NSString *str = [NSString stringWithFormat:@"%d", day];
  114
+                
  115
+                CGContextSaveGState(context);
  116
+//                CGContextSetShadowWithColor(context, shadow2Offset, shadow2BlurRadius, shadow2);
  117
+                CGRect dayHeader2Frame = CGRectMake(j*hDiff, i*vDiff, 21, 14);
  118
+                if([today day] == day && [today month] == month && [today year] == year) {
  119
+                    [[UIColor colorWithRed: 0.98 green: 0.24 blue: 0.09 alpha: 1] setFill];
  120
+                } else {
  121
+                    [[UIColor colorWithWhite:0.2f alpha:1.f] setFill];
  122
+                }
  123
+                [str drawInRect: dayHeader2Frame withFont: [UIFont fontWithName: @"Helvetica" size: 12] lineBreakMode: UILineBreakModeWordWrap alignment: UITextAlignmentCenter];
  124
+                CGContextRestoreGState(context);
  125
+                
  126
+                finalRow = i;
  127
+                
  128
+                if(day == numDaysInMonth && j == 6) {
  129
+                    endedOnSat = YES;
  130
+                }
  131
+                
  132
+                if(i == 5) {
  133
+                    didAddExtraRow = YES;
  134
+                    //NSLog(@"didAddExtraRow");
  135
+                }
  136
+                
  137
+				++day;
  138
+			}
  139
+		}
  140
+	}
  141
+    
  142
+    //Find number of days in previous month
  143
+    NSDateComponents *nextDateParts = [[NSDateComponents alloc] init];
  144
+	[nextDateParts setMonth:month+1];
  145
+	[nextDateParts setYear:year];
  146
+	[nextDateParts setDay:1];
  147
+    
  148
+    NSDate *nextDateOnFirst = [calendar dateFromComponents:nextDateParts];
  149
+    
  150
+    [nextDateParts release];
  151
+    
  152
+    NSDateComponents *nextWeekdayComponents = [calendar components:NSWeekdayCalendarUnit fromDate:nextDateOnFirst];
  153
+	int weekdayOfNextFirst = [nextWeekdayComponents weekday];
  154
+    
  155
+    if(!endedOnSat) {
  156
+        //Draw the text for each of those days.
  157
+        for(int i = weekdayOfNextFirst - 1; i < 7; i++) {
  158
+            int day = i - weekdayOfNextFirst + 2;
  159
+            
  160
+            NSString *str = [NSString stringWithFormat:@"%d", day];
  161
+            
  162
+            CGContextSaveGState(context);
  163
+//            CGContextSetShadowWithColor(context, shadow2Offset, shadow2BlurRadius, shadow2);
  164
+            CGRect dayHeader2Frame = CGRectMake((i)*hDiff, finalRow * vDiff, 21, 14);
  165
+            [[UIColor colorWithWhite:0.6f alpha:1.0f] setFill];
  166
+            [str drawInRect: dayHeader2Frame withFont: [UIFont fontWithName: @"Helvetica" size: 12] lineBreakMode: UILineBreakModeWordWrap alignment: UITextAlignmentCenter];
  167
+            CGContextRestoreGState(context);
  168
+        }
  169
+    }
  170
+}
  171
+
  172
+- (void)setMonth:(int)month {
  173
+    currentMonth = month;
  174
+    [self setNeedsDisplay];
  175
+}
  176
+
  177
+- (void)setYear:(int)year {
  178
+    currentYear = year;
  179
+    [self setNeedsDisplay];
  180
+}
  181
+
  182
+- (void)resetRows {
  183
+    NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
  184
+    
  185
+    int month = currentMonth;
  186
+    int year = currentYear;
  187
+	
  188
+	//Get the first day of the month
  189
+	NSDateComponents *dateParts = [[NSDateComponents alloc] init];
  190
+	[dateParts setMonth:month];
  191
+	[dateParts setYear:year];
  192
+	[dateParts setDay:1];
  193
+	NSDate *dateOnFirst = [calendar dateFromComponents:dateParts];
  194
+	[dateParts release];
  195
+	NSDateComponents *weekdayComponents = [calendar components:NSWeekdayCalendarUnit fromDate:dateOnFirst];
  196
+	int weekdayOfFirst = [weekdayComponents weekday];	
  197
+    
  198
+	int numDaysInMonth = [calendar rangeOfUnit:NSDayCalendarUnit 
  199
+										inUnit:NSMonthCalendarUnit 
  200
+                                       forDate:dateOnFirst].length;
  201
+    didAddExtraRow = NO;
  202
+	
  203
+	int day = 1;
  204
+	for (int i = 0; i < 6; i++) {
  205
+		for(int j = 0; j < 7; j++) {
  206
+			int dayNumber = i * 7 + j;
  207
+			if(dayNumber >= (weekdayOfFirst - 1) && day <= numDaysInMonth) {
  208
+                if(i == 5) {
  209
+                    didAddExtraRow = YES;
  210
+                    //NSLog(@"didAddExtraRow");
  211
+                }
  212
+				++day;
  213
+			}
  214
+		}
  215
+	}
  216
+}
  217
+
  218
+- (BOOL)addExtraRow {
  219
+    return didAddExtraRow;
  220
+}
  221
+
  222
+
  223
+@end
14  popover/Demo/ViewController.h
... ...
@@ -0,0 +1,14 @@
  1
+//
  2
+//  ViewController.h
  3
+//  popover
  4
+//
  5
+//  Created by Oliver Rickard on 21/08/2012.
  6
+//  Copyright (c) 2012 Oliver Rickard. All rights reserved.
  7
+//
  8
+
  9
+#import <UIKit/UIKit.h>
  10
+#import "PopoverView.h"
  11
+
  12
+@interface ViewController : UIViewController <PopoverViewDelegate>
  13
+
  14
+@end
110  popover/Demo/ViewController.m
... ...
@@ -0,0 +1,110 @@
  1
+//
  2
+//  ViewController.m
  3
+//  popover
  4
+//
  5
+//  Created by Oliver Rickard on 21/08/2012.
  6
+//  Copyright (c) 2012 Oliver Rickard. All rights reserved.
  7
+//
  8
+
  9
+#import "ViewController.h"
  10
+#import "PopoverView.h"
  11
+#import "OCDaysView.h"
  12
+#import <QuartzCore/QuartzCore.h> //This is just for the daysView where I call "daysView.layer" not necessary normally.
  13
+
  14
+#define kStringArray [NSArray arrayWithObjects:@"Definitely!", @"Kind of", @"Nope", nil]
  15
+
  16
+@interface ViewController ()
  17
+
  18
+@end
  19
+
  20
+@implementation ViewController
  21
+
  22
+
  23
+
  24
+#pragma mark - Setup Methods
  25
+
  26
+- (void)viewDidLoad
  27
+{
  28
+    [super viewDidLoad];
  29
+	// Do any additional setup after loading the view, typically from a nib.
  30
+    
  31
+    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)];
  32
+    [self.view addGestureRecognizer:[tap autorelease]];
  33
+    
  34
+    //Create a label centered on the screen
  35
+    UILabel *tapAnywhereLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMidX(self.view.bounds) - 200.f*0.5f, CGRectGetMidY(self.view.bounds) - 30.f*0.5f, 200.f, 30.f)];
  36
+    tapAnywhereLabel.text = @"Tap Anywhere";
  37
+    tapAnywhereLabel.textAlignment = UITextAlignmentCenter;
  38
+    [self.view addSubview:[tapAnywhereLabel autorelease]];
  39
+}
  40
+
  41
+
  42
+
  43
+#pragma mark - User Interaction Methods
  44
+
  45
+#pragma mark EXAMPLE CODE IS HERE
  46
+
  47
+- (void)tapped:(UITapGestureRecognizer *)tap {
  48
+    CGPoint point = [tap locationInView:self.view];
  49
+    
  50
+    //Here are a couple of different options for how to display the Popover
  51
+    
  52
+//    [PopoverView showPopoverAtPoint:point inView:self.view withText:@"This is a very long popover box.  As you can see, it goes to multiple lines in size." delegate:self]; //Show text wrapping popover with long string
  53
+    
  54
+//    [PopoverView showPopoverAtPoint:point inView:self.view withTitle:@"This is a title" withText:@"This is text" delegate:self]; //Show text with title
  55
+    
  56
+//    [PopoverView showPopoverAtPoint:point inView:self.view withStringArray:kStringArray delegate:self]; //Show the string array defined at top of this file
  57
+    
  58
+//    [PopoverView showPopoverAtPoint:point inView:self.view withTitle:@"Was this helpful?" withStringArray:kStringArray delegate:self]; //Show string array defined at top of this file with title.
  59
+    
  60
+    //Here's a little bit more advanced sample.  I create a custom view, and hand it off to the PopoverView to display for me.  I round the corners
  61
+    OCDaysView *daysView = [[OCDaysView alloc] initWithFrame:CGRectMake(0, 0, 150, 100)];
  62
+    [daysView setMonth:10];
  63
+    [daysView setYear:2012];
  64
+    daysView.backgroundColor = [UIColor colorWithWhite:0.95f alpha:1.f]; //Give it a background color
  65
+    daysView.layer.borderColor = [UIColor colorWithWhite:0.9f alpha:1.f].CGColor; //Add a border
  66
+    daysView.layer.borderWidth = 0.5f; //One retina pixel width
  67