Browse files

Added example to load view from xib. Restructured folder to clearly d…

…elineate the UAModalPanel files.
  • Loading branch information...
1 parent 1c9a87a commit 72920b86b2541847444ac9332a092eb74ec75f5b @coneybeare coneybeare committed Jan 24, 2012
Showing with 11,543 additions and 100 deletions.
  1. +158 −100 UAModalPanel.xcodeproj/project.pbxproj
  2. BIN ...el.xcodeproj/project.xcworkspace/xcuserdata/coneybeare.xcuserdatad/UserInterfaceState.xcuserstate
  3. +19 −0 UAModalPanel/Example Project/UAAppDelegate.h
  4. +78 −0 UAModalPanel/Example Project/UAAppDelegate.m
  5. +21 −0 UAModalPanel/Example Project/UAExampleModalPanel.h
  6. +149 −0 UAModalPanel/Example Project/UAExampleModalPanel.m
  7. +297 −0 UAModalPanel/Example Project/UAExampleView.xib
  8. +47 −0 UAModalPanel/Example Project/UAModalPanel-Info.plist
  9. +14 −0 UAModalPanel/Example Project/UAModalPanel-Prefix.pch
  10. +17 −0 UAModalPanel/Example Project/UAViewController.h
  11. +112 −0 UAModalPanel/Example Project/UAViewController.m
  12. BIN UAModalPanel/Example Project/UrbanApps.png
  13. +2 −0 UAModalPanel/Example Project/en.lproj/InfoPlist.strings
  14. +4,726 −0 UAModalPanel/Example Project/en.lproj/UAViewController_iPad.xib
  15. +4,726 −0 UAModalPanel/Example Project/en.lproj/UAViewController_iPhone.xib
  16. +18 −0 UAModalPanel/Example Project/main.m
  17. +21 −0 UAModalPanel/Panel/Categories/UIView+JMNoise.h
  18. +143 −0 UAModalPanel/Panel/Categories/UIView+JMNoise.m
  19. BIN UAModalPanel/Panel/Images/close.png
  20. BIN UAModalPanel/Panel/Images/close@2x.png
  21. +86 −0 UAModalPanel/Panel/Panels/UAModalPanel.h
  22. +306 −0 UAModalPanel/Panel/Panels/UAModalPanel.m
  23. +30 −0 UAModalPanel/Panel/Panels/UATitledModalPanel.h
  24. +106 −0 UAModalPanel/Panel/Panels/UATitledModalPanel.m
  25. +46 −0 UAModalPanel/Panel/Views/UAGradientBackground.h
  26. +142 −0 UAModalPanel/Panel/Views/UAGradientBackground.m
  27. +28 −0 UAModalPanel/Panel/Views/UANoisyGradientBackground.h
  28. +76 −0 UAModalPanel/Panel/Views/UANoisyGradientBackground.m
  29. +21 −0 UAModalPanel/Panel/Views/UARoundedRectView.h
  30. +57 −0 UAModalPanel/Panel/Views/UARoundedRectView.m
  31. +97 −0 UAModalPanel/UAExampleView.xib
View
258 UAModalPanel.xcodeproj/project.pbxproj
@@ -7,61 +7,64 @@
objects = {
/* Begin PBXBuildFile section */
- E617700C14BA9E2F00694D1F /* UIView+JMNoise.m in Sources */ = {isa = PBXBuildFile; fileRef = E617700714BA9E2F00694D1F /* UIView+JMNoise.m */; };
- E617700D14BA9E2F00694D1F /* UAGradientBackground.m in Sources */ = {isa = PBXBuildFile; fileRef = E617700914BA9E2F00694D1F /* UAGradientBackground.m */; };
- E617700E14BA9E2F00694D1F /* UANoisyGradientBackground.m in Sources */ = {isa = PBXBuildFile; fileRef = E617700B14BA9E2F00694D1F /* UANoisyGradientBackground.m */; };
E617701114BA9ED600694D1F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E617701014BA9ED600694D1F /* QuartzCore.framework */; };
E64F520614BA98FA009CB18D /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E64F520514BA98FA009CB18D /* UIKit.framework */; };
E64F520814BA98FA009CB18D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E64F520714BA98FA009CB18D /* Foundation.framework */; };
E64F520A14BA98FA009CB18D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E64F520914BA98FA009CB18D /* CoreGraphics.framework */; };
- E64F521014BA98FA009CB18D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E64F520E14BA98FA009CB18D /* InfoPlist.strings */; };
- E64F521214BA98FA009CB18D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E64F521114BA98FA009CB18D /* main.m */; };
- E64F521614BA98FA009CB18D /* UAAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E64F521514BA98FA009CB18D /* UAAppDelegate.m */; };
- E64F521914BA98FA009CB18D /* UAViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E64F521814BA98FA009CB18D /* UAViewController.m */; };
- E64F521C14BA98FA009CB18D /* UAViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = E64F521A14BA98FA009CB18D /* UAViewController_iPhone.xib */; };
- E64F521F14BA98FA009CB18D /* UAViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = E64F521D14BA98FA009CB18D /* UAViewController_iPad.xib */; };
- E64F522C14BA9AC1009CB18D /* UARoundedRectView.m in Sources */ = {isa = PBXBuildFile; fileRef = E64F522714BA9AC1009CB18D /* UARoundedRectView.m */; };
- E64F522D14BA9AC1009CB18D /* UAModalPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = E64F522914BA9AC1009CB18D /* UAModalPanel.m */; };
- E64F522E14BA9AC1009CB18D /* UATitledModalPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = E64F522B14BA9AC1009CB18D /* UATitledModalPanel.m */; };
- E64F523114BA9B1F009CB18D /* UAExampleModalPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = E64F523014BA9B1F009CB18D /* UAExampleModalPanel.m */; };
- E64F523414BA9B6C009CB18D /* close.png in Resources */ = {isa = PBXBuildFile; fileRef = E64F523214BA9B6C009CB18D /* close.png */; };
- E64F523514BA9B6C009CB18D /* close@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E64F523314BA9B6C009CB18D /* close@2x.png */; };
- E6CCD30C14BB85EE0031E09A /* UrbanApps.png in Resources */ = {isa = PBXBuildFile; fileRef = E6CCD30B14BB85EE0031E09A /* UrbanApps.png */; };
+ E65CAB1914CFB930004F3776 /* UIView+JMNoise.m in Sources */ = {isa = PBXBuildFile; fileRef = E65CAB0914CFB930004F3776 /* UIView+JMNoise.m */; };
+ E65CAB1A14CFB930004F3776 /* close.png in Resources */ = {isa = PBXBuildFile; fileRef = E65CAB0B14CFB930004F3776 /* close.png */; };
+ E65CAB1B14CFB930004F3776 /* close@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E65CAB0C14CFB930004F3776 /* close@2x.png */; };
+ E65CAB1C14CFB930004F3776 /* UAModalPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = E65CAB0F14CFB930004F3776 /* UAModalPanel.m */; };
+ E65CAB1D14CFB930004F3776 /* UATitledModalPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = E65CAB1114CFB930004F3776 /* UATitledModalPanel.m */; };
+ E65CAB1E14CFB930004F3776 /* UAGradientBackground.m in Sources */ = {isa = PBXBuildFile; fileRef = E65CAB1414CFB930004F3776 /* UAGradientBackground.m */; };
+ E65CAB1F14CFB930004F3776 /* UANoisyGradientBackground.m in Sources */ = {isa = PBXBuildFile; fileRef = E65CAB1614CFB930004F3776 /* UANoisyGradientBackground.m */; };
+ E65CAB2014CFB930004F3776 /* UARoundedRectView.m in Sources */ = {isa = PBXBuildFile; fileRef = E65CAB1814CFB930004F3776 /* UARoundedRectView.m */; };
+ E65CAB3314CFB98C004F3776 /* UAExampleModalPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = E65CAB2114CFB98C004F3776 /* UAExampleModalPanel.m */; };
+ E65CAB3414CFB98C004F3776 /* UAExampleView.xib in Resources */ = {isa = PBXBuildFile; fileRef = E65CAB2314CFB98C004F3776 /* UAExampleView.xib */; };
+ E65CAB3514CFB98C004F3776 /* UAViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E65CAB2414CFB98C004F3776 /* UAViewController.m */; };
+ E65CAB3614CFB98C004F3776 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E65CAB2614CFB98C004F3776 /* main.m */; };
+ E65CAB3A14CFB98C004F3776 /* UAAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E65CAB2F14CFB98C004F3776 /* UAAppDelegate.m */; };
+ E65CAB3B14CFB98C004F3776 /* UAModalPanel-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = E65CAB3014CFB98C004F3776 /* UAModalPanel-Info.plist */; };
+ E65CAB3C14CFB98C004F3776 /* UrbanApps.png in Resources */ = {isa = PBXBuildFile; fileRef = E65CAB3214CFB98C004F3776 /* UrbanApps.png */; };
+ E65CAB4314CFB9A8004F3776 /* UAViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = E65CAB3D14CFB9A8004F3776 /* UAViewController_iPhone.xib */; };
+ E65CAB4414CFB9A8004F3776 /* UAViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = E65CAB3F14CFB9A8004F3776 /* UAViewController_iPad.xib */; };
+ E65CAB4514CFB9A8004F3776 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E65CAB4114CFB9A8004F3776 /* InfoPlist.strings */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
- E617700614BA9E2F00694D1F /* UIView+JMNoise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+JMNoise.h"; sourceTree = "<group>"; };
- E617700714BA9E2F00694D1F /* UIView+JMNoise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+JMNoise.m"; sourceTree = "<group>"; };
- E617700814BA9E2F00694D1F /* UAGradientBackground.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UAGradientBackground.h; sourceTree = "<group>"; };
- E617700914BA9E2F00694D1F /* UAGradientBackground.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UAGradientBackground.m; sourceTree = "<group>"; };
- E617700A14BA9E2F00694D1F /* UANoisyGradientBackground.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UANoisyGradientBackground.h; sourceTree = "<group>"; };
- E617700B14BA9E2F00694D1F /* UANoisyGradientBackground.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UANoisyGradientBackground.m; sourceTree = "<group>"; };
E617701014BA9ED600694D1F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
E64F520114BA98FA009CB18D /* UAModalPanel.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UAModalPanel.app; sourceTree = BUILT_PRODUCTS_DIR; };
E64F520514BA98FA009CB18D /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
E64F520714BA98FA009CB18D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
E64F520914BA98FA009CB18D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
- E64F520D14BA98FA009CB18D /* UAModalPanel-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "UAModalPanel-Info.plist"; sourceTree = "<group>"; };
- E64F520F14BA98FA009CB18D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- E64F521114BA98FA009CB18D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
- E64F521314BA98FA009CB18D /* UAModalPanel-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UAModalPanel-Prefix.pch"; sourceTree = "<group>"; };
- E64F521414BA98FA009CB18D /* UAAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UAAppDelegate.h; sourceTree = "<group>"; };
- E64F521514BA98FA009CB18D /* UAAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UAAppDelegate.m; sourceTree = "<group>"; };
- E64F521714BA98FA009CB18D /* UAViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UAViewController.h; sourceTree = "<group>"; };
- E64F521814BA98FA009CB18D /* UAViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UAViewController.m; sourceTree = "<group>"; };
- E64F521B14BA98FA009CB18D /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/UAViewController_iPhone.xib; sourceTree = "<group>"; };
- E64F521E14BA98FA009CB18D /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/UAViewController_iPad.xib; sourceTree = "<group>"; };
- E64F522614BA9AC1009CB18D /* UARoundedRectView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UARoundedRectView.h; sourceTree = "<group>"; };
- E64F522714BA9AC1009CB18D /* UARoundedRectView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UARoundedRectView.m; sourceTree = "<group>"; };
- E64F522814BA9AC1009CB18D /* UAModalPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UAModalPanel.h; sourceTree = "<group>"; };
- E64F522914BA9AC1009CB18D /* UAModalPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UAModalPanel.m; sourceTree = "<group>"; };
- E64F522A14BA9AC1009CB18D /* UATitledModalPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UATitledModalPanel.h; sourceTree = "<group>"; };
- E64F522B14BA9AC1009CB18D /* UATitledModalPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UATitledModalPanel.m; sourceTree = "<group>"; };
- E64F522F14BA9B1F009CB18D /* UAExampleModalPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UAExampleModalPanel.h; sourceTree = "<group>"; };
- E64F523014BA9B1F009CB18D /* UAExampleModalPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UAExampleModalPanel.m; sourceTree = "<group>"; };
- E64F523214BA9B6C009CB18D /* close.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = close.png; sourceTree = "<group>"; };
- E64F523314BA9B6C009CB18D /* close@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "close@2x.png"; sourceTree = "<group>"; };
- E6CCD30B14BB85EE0031E09A /* UrbanApps.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = UrbanApps.png; sourceTree = "<group>"; };
+ E65CAB0814CFB930004F3776 /* UIView+JMNoise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+JMNoise.h"; sourceTree = "<group>"; };
+ E65CAB0914CFB930004F3776 /* UIView+JMNoise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+JMNoise.m"; sourceTree = "<group>"; };
+ E65CAB0B14CFB930004F3776 /* close.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = close.png; sourceTree = "<group>"; };
+ E65CAB0C14CFB930004F3776 /* close@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "close@2x.png"; sourceTree = "<group>"; };
+ E65CAB0E14CFB930004F3776 /* UAModalPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UAModalPanel.h; sourceTree = "<group>"; };
+ E65CAB0F14CFB930004F3776 /* UAModalPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UAModalPanel.m; sourceTree = "<group>"; };
+ E65CAB1014CFB930004F3776 /* UATitledModalPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UATitledModalPanel.h; sourceTree = "<group>"; };
+ E65CAB1114CFB930004F3776 /* UATitledModalPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UATitledModalPanel.m; sourceTree = "<group>"; };
+ E65CAB1314CFB930004F3776 /* UAGradientBackground.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UAGradientBackground.h; sourceTree = "<group>"; };
+ E65CAB1414CFB930004F3776 /* UAGradientBackground.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UAGradientBackground.m; sourceTree = "<group>"; };
+ E65CAB1514CFB930004F3776 /* UANoisyGradientBackground.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UANoisyGradientBackground.h; sourceTree = "<group>"; };
+ E65CAB1614CFB930004F3776 /* UANoisyGradientBackground.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UANoisyGradientBackground.m; sourceTree = "<group>"; };
+ E65CAB1714CFB930004F3776 /* UARoundedRectView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UARoundedRectView.h; sourceTree = "<group>"; };
+ E65CAB1814CFB930004F3776 /* UARoundedRectView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UARoundedRectView.m; sourceTree = "<group>"; };
+ E65CAB2114CFB98C004F3776 /* UAExampleModalPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UAExampleModalPanel.m; path = "Example Project/UAExampleModalPanel.m"; sourceTree = "<group>"; };
+ E65CAB2214CFB98C004F3776 /* UAExampleModalPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UAExampleModalPanel.h; path = "Example Project/UAExampleModalPanel.h"; sourceTree = "<group>"; };
+ E65CAB2314CFB98C004F3776 /* UAExampleView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = UAExampleView.xib; path = "Example Project/UAExampleView.xib"; sourceTree = "<group>"; };
+ E65CAB2414CFB98C004F3776 /* UAViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UAViewController.m; path = "Example Project/UAViewController.m"; sourceTree = "<group>"; };
+ E65CAB2514CFB98C004F3776 /* UAViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UAViewController.h; path = "Example Project/UAViewController.h"; sourceTree = "<group>"; };
+ E65CAB2614CFB98C004F3776 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = "Example Project/main.m"; sourceTree = "<group>"; };
+ E65CAB2E14CFB98C004F3776 /* UAAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UAAppDelegate.h; path = "Example Project/UAAppDelegate.h"; sourceTree = "<group>"; };
+ E65CAB2F14CFB98C004F3776 /* UAAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UAAppDelegate.m; path = "Example Project/UAAppDelegate.m"; sourceTree = "<group>"; };
+ E65CAB3014CFB98C004F3776 /* UAModalPanel-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "UAModalPanel-Info.plist"; path = "Example Project/UAModalPanel-Info.plist"; sourceTree = "<group>"; };
+ E65CAB3114CFB98C004F3776 /* UAModalPanel-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UAModalPanel-Prefix.pch"; path = "Example Project/UAModalPanel-Prefix.pch"; sourceTree = "<group>"; };
+ E65CAB3214CFB98C004F3776 /* UrbanApps.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = UrbanApps.png; path = "Example Project/UrbanApps.png"; sourceTree = "<group>"; };
+ E65CAB3E14CFB9A8004F3776 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = "Example Project/en.lproj/UAViewController_iPhone.xib"; sourceTree = "<group>"; };
+ E65CAB4014CFB9A8004F3776 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = "Example Project/en.lproj/UAViewController_iPad.xib"; sourceTree = "<group>"; };
+ E65CAB4214CFB9A8004F3776 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = "Example Project/en.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -111,50 +114,103 @@
E64F520C14BA98FA009CB18D /* Supporting Files */ = {
isa = PBXGroup;
children = (
- E64F520D14BA98FA009CB18D /* UAModalPanel-Info.plist */,
- E64F520E14BA98FA009CB18D /* InfoPlist.strings */,
- E64F521114BA98FA009CB18D /* main.m */,
- E64F521314BA98FA009CB18D /* UAModalPanel-Prefix.pch */,
+ E65CAB2614CFB98C004F3776 /* main.m */,
+ E65CAB3014CFB98C004F3776 /* UAModalPanel-Info.plist */,
+ E65CAB3114CFB98C004F3776 /* UAModalPanel-Prefix.pch */,
+ E65CAB4114CFB9A8004F3776 /* InfoPlist.strings */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
E64F522514BA9A90009CB18D /* UAModalPanel */ = {
isa = PBXGroup;
children = (
- E64F523214BA9B6C009CB18D /* close.png */,
- E64F523314BA9B6C009CB18D /* close@2x.png */,
- E617700614BA9E2F00694D1F /* UIView+JMNoise.h */,
- E617700714BA9E2F00694D1F /* UIView+JMNoise.m */,
- E617700814BA9E2F00694D1F /* UAGradientBackground.h */,
- E617700914BA9E2F00694D1F /* UAGradientBackground.m */,
- E617700A14BA9E2F00694D1F /* UANoisyGradientBackground.h */,
- E617700B14BA9E2F00694D1F /* UANoisyGradientBackground.m */,
- E64F522614BA9AC1009CB18D /* UARoundedRectView.h */,
- E64F522714BA9AC1009CB18D /* UARoundedRectView.m */,
- E64F522814BA9AC1009CB18D /* UAModalPanel.h */,
- E64F522914BA9AC1009CB18D /* UAModalPanel.m */,
- E64F522A14BA9AC1009CB18D /* UATitledModalPanel.h */,
- E64F522B14BA9AC1009CB18D /* UATitledModalPanel.m */,
+ E65CAB0714CFB930004F3776 /* Categories */,
+ E65CAB0A14CFB930004F3776 /* Images */,
+ E65CAB0D14CFB930004F3776 /* Panels */,
+ E65CAB1214CFB930004F3776 /* Views */,
);
path = UAModalPanel;
sourceTree = "<group>";
};
+ E65CAB0714CFB930004F3776 /* Categories */ = {
+ isa = PBXGroup;
+ children = (
+ E65CAB0814CFB930004F3776 /* UIView+JMNoise.h */,
+ E65CAB0914CFB930004F3776 /* UIView+JMNoise.m */,
+ );
+ name = Categories;
+ path = Panel/Categories;
+ sourceTree = "<group>";
+ };
+ E65CAB0A14CFB930004F3776 /* Images */ = {
+ isa = PBXGroup;
+ children = (
+ E65CAB0B14CFB930004F3776 /* close.png */,
+ E65CAB0C14CFB930004F3776 /* close@2x.png */,
+ );
+ name = Images;
+ path = Panel/Images;
+ sourceTree = "<group>";
+ };
+ E65CAB0D14CFB930004F3776 /* Panels */ = {
+ isa = PBXGroup;
+ children = (
+ E65CAB0E14CFB930004F3776 /* UAModalPanel.h */,
+ E65CAB0F14CFB930004F3776 /* UAModalPanel.m */,
+ E65CAB1014CFB930004F3776 /* UATitledModalPanel.h */,
+ E65CAB1114CFB930004F3776 /* UATitledModalPanel.m */,
+ );
+ name = Panels;
+ path = Panel/Panels;
+ sourceTree = "<group>";
+ };
+ E65CAB1214CFB930004F3776 /* Views */ = {
+ isa = PBXGroup;
+ children = (
+ E65CAB1314CFB930004F3776 /* UAGradientBackground.h */,
+ E65CAB1414CFB930004F3776 /* UAGradientBackground.m */,
+ E65CAB1514CFB930004F3776 /* UANoisyGradientBackground.h */,
+ E65CAB1614CFB930004F3776 /* UANoisyGradientBackground.m */,
+ E65CAB1714CFB930004F3776 /* UARoundedRectView.h */,
+ E65CAB1814CFB930004F3776 /* UARoundedRectView.m */,
+ );
+ name = Views;
+ path = Panel/Views;
+ sourceTree = "<group>";
+ };
+ E65CAB4614CFB9C1004F3776 /* Images */ = {
+ isa = PBXGroup;
+ children = (
+ E65CAB3214CFB98C004F3776 /* UrbanApps.png */,
+ );
+ name = Images;
+ sourceTree = "<group>";
+ };
+ E65CAB4714CFB9D5004F3776 /* XIBs */ = {
+ isa = PBXGroup;
+ children = (
+ E65CAB3D14CFB9A8004F3776 /* UAViewController_iPhone.xib */,
+ E65CAB3F14CFB9A8004F3776 /* UAViewController_iPad.xib */,
+ E65CAB2314CFB98C004F3776 /* UAExampleView.xib */,
+ );
+ name = XIBs;
+ sourceTree = "<group>";
+ };
E6CCD30E14BB8B0B0031E09A /* Example Project Files */ = {
isa = PBXGroup;
children = (
+ E65CAB2E14CFB98C004F3776 /* UAAppDelegate.h */,
+ E65CAB2F14CFB98C004F3776 /* UAAppDelegate.m */,
+ E65CAB2414CFB98C004F3776 /* UAViewController.m */,
+ E65CAB2514CFB98C004F3776 /* UAViewController.h */,
+ E65CAB2114CFB98C004F3776 /* UAExampleModalPanel.m */,
+ E65CAB2214CFB98C004F3776 /* UAExampleModalPanel.h */,
+ E65CAB4614CFB9C1004F3776 /* Images */,
+ E65CAB4714CFB9D5004F3776 /* XIBs */,
+ E64F520C14BA98FA009CB18D /* Supporting Files */,
E64F520414BA98FA009CB18D /* Frameworks */,
E64F520214BA98FA009CB18D /* Products */,
- E64F520C14BA98FA009CB18D /* Supporting Files */,
- E64F521414BA98FA009CB18D /* UAAppDelegate.h */,
- E64F521514BA98FA009CB18D /* UAAppDelegate.m */,
- E64F521714BA98FA009CB18D /* UAViewController.h */,
- E64F521814BA98FA009CB18D /* UAViewController.m */,
- E64F522F14BA9B1F009CB18D /* UAExampleModalPanel.h */,
- E64F523014BA9B1F009CB18D /* UAExampleModalPanel.m */,
- E64F521A14BA98FA009CB18D /* UAViewController_iPhone.xib */,
- E64F521D14BA98FA009CB18D /* UAViewController_iPad.xib */,
- E6CCD30B14BB85EE0031E09A /* UrbanApps.png */,
);
name = "Example Project Files";
path = UAModalPanel;
@@ -211,12 +267,14 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- E64F521014BA98FA009CB18D /* InfoPlist.strings in Resources */,
- E64F521C14BA98FA009CB18D /* UAViewController_iPhone.xib in Resources */,
- E64F521F14BA98FA009CB18D /* UAViewController_iPad.xib in Resources */,
- E64F523414BA9B6C009CB18D /* close.png in Resources */,
- E64F523514BA9B6C009CB18D /* close@2x.png in Resources */,
- E6CCD30C14BB85EE0031E09A /* UrbanApps.png in Resources */,
+ E65CAB1A14CFB930004F3776 /* close.png in Resources */,
+ E65CAB1B14CFB930004F3776 /* close@2x.png in Resources */,
+ E65CAB3414CFB98C004F3776 /* UAExampleView.xib in Resources */,
+ E65CAB3B14CFB98C004F3776 /* UAModalPanel-Info.plist in Resources */,
+ E65CAB3C14CFB98C004F3776 /* UrbanApps.png in Resources */,
+ E65CAB4314CFB9A8004F3776 /* UAViewController_iPhone.xib in Resources */,
+ E65CAB4414CFB9A8004F3776 /* UAViewController_iPad.xib in Resources */,
+ E65CAB4514CFB9A8004F3776 /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -227,44 +285,44 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- E64F521214BA98FA009CB18D /* main.m in Sources */,
- E64F521614BA98FA009CB18D /* UAAppDelegate.m in Sources */,
- E64F521914BA98FA009CB18D /* UAViewController.m in Sources */,
- E64F522C14BA9AC1009CB18D /* UARoundedRectView.m in Sources */,
- E64F522D14BA9AC1009CB18D /* UAModalPanel.m in Sources */,
- E64F522E14BA9AC1009CB18D /* UATitledModalPanel.m in Sources */,
- E64F523114BA9B1F009CB18D /* UAExampleModalPanel.m in Sources */,
- E617700C14BA9E2F00694D1F /* UIView+JMNoise.m in Sources */,
- E617700D14BA9E2F00694D1F /* UAGradientBackground.m in Sources */,
- E617700E14BA9E2F00694D1F /* UANoisyGradientBackground.m in Sources */,
+ E65CAB1914CFB930004F3776 /* UIView+JMNoise.m in Sources */,
+ E65CAB1C14CFB930004F3776 /* UAModalPanel.m in Sources */,
+ E65CAB1D14CFB930004F3776 /* UATitledModalPanel.m in Sources */,
+ E65CAB1E14CFB930004F3776 /* UAGradientBackground.m in Sources */,
+ E65CAB1F14CFB930004F3776 /* UANoisyGradientBackground.m in Sources */,
+ E65CAB2014CFB930004F3776 /* UARoundedRectView.m in Sources */,
+ E65CAB3314CFB98C004F3776 /* UAExampleModalPanel.m in Sources */,
+ E65CAB3514CFB98C004F3776 /* UAViewController.m in Sources */,
+ E65CAB3614CFB98C004F3776 /* main.m in Sources */,
+ E65CAB3A14CFB98C004F3776 /* UAAppDelegate.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
- E64F520E14BA98FA009CB18D /* InfoPlist.strings */ = {
+ E65CAB3D14CFB9A8004F3776 /* UAViewController_iPhone.xib */ = {
isa = PBXVariantGroup;
children = (
- E64F520F14BA98FA009CB18D /* en */,
+ E65CAB3E14CFB9A8004F3776 /* en */,
);
- name = InfoPlist.strings;
+ name = UAViewController_iPhone.xib;
sourceTree = "<group>";
};
- E64F521A14BA98FA009CB18D /* UAViewController_iPhone.xib */ = {
+ E65CAB3F14CFB9A8004F3776 /* UAViewController_iPad.xib */ = {
isa = PBXVariantGroup;
children = (
- E64F521B14BA98FA009CB18D /* en */,
+ E65CAB4014CFB9A8004F3776 /* en */,
);
- name = UAViewController_iPhone.xib;
+ name = UAViewController_iPad.xib;
sourceTree = "<group>";
};
- E64F521D14BA98FA009CB18D /* UAViewController_iPad.xib */ = {
+ E65CAB4114CFB9A8004F3776 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
- E64F521E14BA98FA009CB18D /* en */,
+ E65CAB4214CFB9A8004F3776 /* en */,
);
- name = UAViewController_iPad.xib;
+ name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
@@ -319,13 +377,13 @@
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "UAModalPanel/UAModalPanel-Prefix.pch";
+ GCC_PREFIX_HEADER = "UAModalPanel/Example Project/UAModalPanel-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
UAMODALVIEW_DEBUG,
"DEBUG=1",
"$(inherited)",
);
- INFOPLIST_FILE = "UAModalPanel/UAModalPanel-Info.plist";
+ INFOPLIST_FILE = "UAModalPanel/Example Project/UAModalPanel-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
@@ -337,8 +395,8 @@
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "UAModalPanel/UAModalPanel-Prefix.pch";
- INFOPLIST_FILE = "UAModalPanel/UAModalPanel-Info.plist";
+ GCC_PREFIX_HEADER = "UAModalPanel/Example Project/UAModalPanel-Prefix.pch";
+ INFOPLIST_FILE = "UAModalPanel/Example Project/UAModalPanel-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
View
BIN ...proj/project.xcworkspace/xcuserdata/coneybeare.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
View
19 UAModalPanel/Example Project/UAAppDelegate.h
@@ -0,0 +1,19 @@
+//
+// UAAppDelegate.h
+// UAModalPanel
+//
+// Created by Matt Coneybeare on 1/8/12.
+// Copyright (c) 2012 Urban Apps. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class UAViewController;
+
+@interface UAAppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@property (strong, nonatomic) UAViewController *viewController;
+
+@end
View
78 UAModalPanel/Example Project/UAAppDelegate.m
@@ -0,0 +1,78 @@
+//
+// UAAppDelegate.m
+// UAModalPanel
+//
+// Created by Matt Coneybeare on 1/8/12.
+// Copyright (c) 2012 Urban Apps. All rights reserved.
+//
+
+#import "UAAppDelegate.h"
+
+#import "UAViewController.h"
+
+@implementation UAAppDelegate
+
+@synthesize window = _window;
+@synthesize viewController = _viewController;
+
+- (void)dealloc
+{
+ [_window release];
+ [_viewController release];
+ [super dealloc];
+}
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
+ // Override point for customization after application launch.
+ if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
+ self.viewController = [[[UAViewController alloc] initWithNibName:@"UAViewController_iPhone" bundle:nil] autorelease];
+ } else {
+ self.viewController = [[[UAViewController alloc] initWithNibName:@"UAViewController_iPad" bundle:nil] autorelease];
+ }
+ self.window.rootViewController = self.viewController;
+ [self.window makeKeyAndVisible];
+ return YES;
+}
+
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+ /*
+ 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.
+ 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.
+ */
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+ /*
+ 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.
+ If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+ */
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+ /*
+ 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.
+ */
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+ /*
+ 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.
+ */
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+ /*
+ Called when the application is about to terminate.
+ Save data if appropriate.
+ See also applicationDidEnterBackground:.
+ */
+}
+
+@end
View
21 UAModalPanel/Example Project/UAExampleModalPanel.h
@@ -0,0 +1,21 @@
+//
+// UAModalExampleView.h
+// UAModalPanel
+//
+// Created by Matt Coneybeare on 1/8/12.
+// Copyright (c) 2012 Urban Apps. All rights reserved.
+//
+
+#import "UATitledModalPanel.h"
+
+@interface UAExampleModalPanel : UATitledModalPanel <UITableViewDataSource> {
+ UIView *v;
+ IBOutlet UIView *viewLoadedFromXib;
+}
+
+@property (nonatomic, retain) IBOutlet UIView *viewLoadedFromXib;
+
+- (id)initWithFrame:(CGRect)frame title:(NSString *)title;
+- (IBAction)buttonPressed:(id)sender;
+
+@end
View
149 UAModalPanel/Example Project/UAExampleModalPanel.m
@@ -0,0 +1,149 @@
+//
+// UAModalExampleView.m
+// UAModalPanel
+//
+// Created by Matt Coneybeare on 1/8/12.
+// Copyright (c) 2012 Urban Apps. All rights reserved.
+//
+
+#import "UAExampleModalPanel.h"
+
+#define BLACK_BAR_COMPONENTS { 0.22, 0.22, 0.22, 1.0, 0.07, 0.07, 0.07, 1.0 }
+
+@implementation UAExampleModalPanel
+
+@synthesize viewLoadedFromXib;
+
+- (id)initWithFrame:(CGRect)frame title:(NSString *)title {
+ if ((self = [super initWithFrame:frame])) {
+
+ CGFloat colors[8] = BLACK_BAR_COMPONENTS;
+ [self.titleBar setColorComponents:colors];
+ self.headerLabel.text = title;
+
+
+ ////////////////////////////////////
+ // RANDOMLY CUSTOMIZE IT
+ ////////////////////////////////////
+ // Show the defaults mostly, but once in awhile show a completely random funky one
+ if (arc4random() % 4 == 0) {
+ // Funky time.
+ UADebugLog(@"Showing a randomized panel for modalPanel: %@", self);
+
+ // Margin between edge of container frame and panel. Default = 20.0
+ self.outerMargin = ((arc4random() % 4) + 1) * 20.0f;
+
+ // Margin between edge of panel and the content area. Default = 20.0
+ self.innerMargin = ((arc4random() % 4) + 1) * 10.0f;
+
+ // Border color of the panel. Default = [UIColor whiteColor]
+ self.borderColor = [UIColor colorWithRed:(arc4random() % 2) green:(arc4random() % 2) blue:(arc4random() % 2) alpha:1.0];
+
+ // Border width of the panel. Default = 1.5f;
+ self.borderWidth = ((arc4random() % 21)) * 0.5f;
+
+ // Corner radius of the panel. Default = 4.0f
+ self.cornerRadius = (arc4random() % 21);
+
+ // Color of the panel itself. Default = [UIColor colorWithWhite:0.0 alpha:0.8]
+ self.contentColor = [UIColor colorWithRed:(arc4random() % 2) green:(arc4random() % 2) blue:(arc4random() % 2) alpha:1.0];
+
+ // Shows the bounce animation. Default = YES
+ self.shouldBounce = (arc4random() % 2);
+
+ // Height of the title view. Default = 40.0f
+ [self setTitleBarHeight:((arc4random() % 5) + 2) * 20.0f];
+
+ // The background color gradient of the title
+ CGFloat colors[8] = {
+ (arc4random() % 2), (arc4random() % 2), (arc4random() % 2), 1,
+ (arc4random() % 2), (arc4random() % 2), (arc4random() % 2), 1
+ };
+ [[self titleBar] setColorComponents:colors];
+
+ // The gradient style (Linear, linear reversed, radial, radial reversed, center highlight). Default = UAGradientBackgroundStyleLinear
+ [[self titleBar] setGradientStyle:(arc4random() % 5)];
+
+ // The line mode of the gradient view (top, bottom, both, none). Top is a white line, bottom is a black line.
+ [[self titleBar] setLineMode: pow(2, (arc4random() % 3))];
+
+ // The noise layer opacity. Default = 0.4
+ [[self titleBar] setNoiseOpacity:(((arc4random() % 10) + 1) * 0.1)];
+
+ // The header label, a UILabel with the same frame as the titleBar
+ [self headerLabel].font = [UIFont boldSystemFontOfSize:floor(self.titleBarHeight / 2.0)];
+ }
+
+
+ //////////////////////////////////////
+ // SETUP RANDOM CONTENT
+ //////////////////////////////////////
+ UIWebView *wv = [[[UIWebView alloc] initWithFrame:CGRectZero] autorelease];
+ [wv loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://urbanapps.com/product_list"]]];
+
+ UITableView *tv = [[[UITableView alloc] initWithFrame:CGRectZero] autorelease];
+ [tv setDataSource:self];
+
+ UIImageView *iv = [[[UIImageView alloc] initWithFrame:CGRectZero] autorelease];
+ [iv setImage:[UIImage imageNamed:@"UrbanApps.png"]];
+ [iv setContentMode:UIViewContentModeScaleAspectFit];
+
+ [[NSBundle mainBundle] loadNibNamed:@"UAExampleView" owner:self options:nil];
+
+ NSArray *contentArray = [NSArray arrayWithObjects:wv, tv, iv, viewLoadedFromXib, nil];
+
+ int i = arc4random() % [contentArray count];
+ v = [[contentArray objectAtIndex:i] retain];
+ [self.contentView addSubview:v];
+
+ }
+ return self;
+}
+
+- (void)dealloc {
+ [v release];
+ [viewLoadedFromXib release];
+ [super dealloc];
+}
+
+- (void)layoutSubviews {
+ [super layoutSubviews];
+
+ [v setFrame:self.contentView.bounds];
+}
+
+#pragma mark - TableView
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+ return 100;
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+
+ NSString *cellIdentifier = @"UAModalPanelCell";
+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
+ if (cell == nil) {
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];
+ }
+
+ [cell.textLabel setText:[NSString stringWithFormat:@"Row %d", indexPath.row]];
+
+ return cell;
+}
+
+#pragma mark - Actions
+- (IBAction)buttonPressed:(id)sender {
+ // The button was pressed. Lets do something with it.
+
+ // Maybe the delegate wants something to do with it...
+ if ([delegate respondsToSelector:@selector(superAwesomeButtonPressed:)]) {
+ [delegate performSelector:@selector(superAwesomeButtonPressed:) withObject:sender];
+
+ // Or perhaps someone is listening for notifications
+ } else {
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"SuperAwesomeButtonPressed" object:sender];
+ }
+
+ NSLog(@"Super Awesome Button pressed!");
+}
+
+@end
View
297 UAModalPanel/Example Project/UAExampleView.xib
@@ -0,0 +1,297 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
+ <data>
+ <int key="IBDocument.SystemTarget">1280</int>
+ <string key="IBDocument.SystemVersion">11D36</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1938</string>
+ <string key="IBDocument.AppKitVersion">1138.29</string>
+ <string key="IBDocument.HIToolboxVersion">568.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">933</string>
+ </object>
+ <array key="IBDocument.IntegratedClassDependencies">
+ <string>IBUISlider</string>
+ <string>IBUISwitch</string>
+ <string>IBUIButton</string>
+ <string>IBUIView</string>
+ <string>IBUILabel</string>
+ <string>IBProxyObject</string>
+ </array>
+ <array key="IBDocument.PluginDependencies">
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </array>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+ <integer value="1" key="NS.object.0"/>
+ </object>
+ <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <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="635546188">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <array class="NSMutableArray" key="NSSubviews">
+ <object class="IBUILabel" id="848008211">
+ <reference key="NSNextResponder" ref="635546188"/>
+ <int key="NSvFlags">290</int>
+ <string key="NSFrame">{{20, 106}, {240, 21}}</string>
+ <reference key="NSSuperview" ref="635546188"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
+ <string key="NSReuseIdentifierKey">_NS:328</string>
+ <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">Loaded from UAExampleView.xib</string>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MCAwIDAAA</bytes>
+ </object>
+ <nil key="IBUIHighlightedColor"/>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">10</float>
+ <int key="IBUITextAlignment">1</int>
+ <object class="IBUIFontDescription" key="IBUIFontDescription">
+ <int key="type">1</int>
+ <double key="pointSize">12</double>
+ </object>
+ <object class="NSFont" key="IBUIFont">
+ <string key="NSName">Helvetica</string>
+ <double key="NSSize">12</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ </object>
+ <object class="IBUISwitch" id="910839561">
+ <reference key="NSNextResponder" ref="635546188"/>
+ <int key="NSvFlags">289</int>
+ <string key="NSFrame">{{166, 20}, {94, 27}}</string>
+ <reference key="NSSuperview" ref="635546188"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
+ <string key="NSReuseIdentifierKey">_NS:606</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <bool key="IBUIOn">YES</bool>
+ </object>
+ <object class="IBUISlider" id="847514147">
+ <reference key="NSNextResponder" ref="635546188"/>
+ <int key="NSvFlags">290</int>
+ <string key="NSFrame">{{18, 20}, {157, 23}}</string>
+ <reference key="NSSuperview" ref="635546188"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="910839561"/>
+ <string key="NSReuseIdentifierKey">_NS:623</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <float key="IBUIValue">0.5</float>
+ </object>
+ <object class="IBUIButton" id="604767979">
+ <reference key="NSNextResponder" ref="635546188"/>
+ <int key="NSvFlags">290</int>
+ <string key="NSFrame">{{20, 61}, {240, 37}}</string>
+ <reference key="NSSuperview" ref="635546188"/>
+ <reference key="NSWindow"/>
+ <string key="NSReuseIdentifierKey">_NS:225</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <int key="IBUIButtonType">1</int>
+ <string key="IBUINormalTitle">Super Awesome</string>
+ <object class="NSColor" key="IBUIHighlightedTitleColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <object class="NSColor" key="IBUINormalTitleColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
+ </object>
+ <object class="NSColor" key="IBUINormalTitleShadowColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC41AA</bytes>
+ </object>
+ <object class="IBUIFontDescription" key="IBUIFontDescription">
+ <int key="type">2</int>
+ <double key="pointSize">15</double>
+ </object>
+ <object class="NSFont" key="IBUIFont">
+ <string key="NSName">Helvetica-Bold</string>
+ <double key="NSSize">15</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ </object>
+ </array>
+ <string key="NSFrameSize">{280, 147}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="847514147"/>
+ <string key="NSReuseIdentifierKey">_NS:196</string>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </array>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <array class="NSMutableArray" key="connectionRecords">
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">viewLoadedFromXib</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="635546188"/>
+ </object>
+ <int key="connectionID">9</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchEventConnection" key="connection">
+ <string key="label">buttonPressed:</string>
+ <reference key="source" ref="604767979"/>
+ <reference key="destination" ref="372490531"/>
+ <int key="IBEventType">7</int>
+ </object>
+ <int key="connectionID">11</int>
+ </object>
+ </array>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <array key="orderedObjects">
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <array key="object" id="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </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="635546188"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="910839561"/>
+ <reference ref="847514147"/>
+ <reference ref="848008211"/>
+ <reference ref="604767979"/>
+ </array>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="848008211"/>
+ <reference key="parent" ref="635546188"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5</int>
+ <reference key="object" ref="910839561"/>
+ <reference key="parent" ref="635546188"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6</int>
+ <reference key="object" ref="847514147"/>
+ <reference key="parent" ref="635546188"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">10</int>
+ <reference key="object" ref="604767979"/>
+ <reference key="parent" ref="635546188"/>
+ </object>
+ </array>
+ </object>
+ <dictionary class="NSMutableDictionary" key="flattenedProperties">
+ <string key="-1.CustomClassName">UAExampleModalPanel</string>
+ <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="-2.CustomClassName">UIResponder</string>
+ <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="10.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="3.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="5.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
+ <nil key="activeLocalization"/>
+ <dictionary class="NSMutableDictionary" key="localizations"/>
+ <nil key="sourceID"/>
+ <int key="maxID">11</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <array class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <object class="IBPartialClassDescription">
+ <string key="className">UAExampleModalPanel</string>
+ <string key="superclassName">UATitledModalPanel</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">buttonPressed:</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <string key="NS.key.0">buttonPressed:</string>
+ <object class="IBActionInfo" key="NS.object.0">
+ <string key="name">buttonPressed:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">viewLoadedFromXib</string>
+ <string key="NS.object.0">UIView</string>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <string key="NS.key.0">viewLoadedFromXib</string>
+ <object class="IBToOneOutletInfo" key="NS.object.0">
+ <string key="name">viewLoadedFromXib</string>
+ <string key="candidateClassName">UIView</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/UAExampleModalPanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UAModalPanel</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/UAModalPanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UATitledModalPanel</string>
+ <string key="superclassName">UAModalPanel</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/UATitledModalPanel.h</string>
+ </object>
+ </object>
+ </array>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">933</string>
+ </data>
+</archive>
View
47 UAModalPanel/Example Project/UAModalPanel-Info.plist
@@ -0,0 +1,47 @@
+<?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>CFBundleIconFiles</key>
+ <array/>
+ <key>CFBundleIdentifier</key>
+ <string>com.foobar.jones.${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>
+ <key>UISupportedInterfaceOrientations~ipad</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
View
14 UAModalPanel/Example Project/UAModalPanel-Prefix.pch
@@ -0,0 +1,14 @@
+//
+// Prefix header for all source files of the 'UAModalPanel' target in the 'UAModalPanel' project
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_4_0
+#warning "This project uses features only available in iOS SDK 4.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
View
17 UAModalPanel/Example Project/UAViewController.h
@@ -0,0 +1,17 @@
+//
+// UAViewController.h
+// UAModalPanel
+//
+// Created by Matt Coneybeare on 1/8/12.
+// Copyright (c) 2012 Urban Apps. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+#import "UAModalPanel.h"
+
+@interface UAViewController : UIViewController<UAModalPanelDelegate>;
+
+- (IBAction)showModalPanel:(id)sender;
+
+@end
View
112 UAModalPanel/Example Project/UAViewController.m
@@ -0,0 +1,112 @@
+//
+// UAViewController.m
+// UAModalPanel
+//
+// Created by Matt Coneybeare on 1/8/12.
+// Copyright (c) 2012 Urban Apps. All rights reserved.
+//
+
+#import "UAViewController.h"
+
+#import "UAExampleModalPanel.h"
+#import "UANoisyGradientBackground.h"
+#import "UAGradientBackground.h"
+
+@implementation UAViewController
+
+#pragma mark - View lifecycle
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ return YES;
+}
+
+
+- (IBAction)showModalPanel:(id)sender {
+
+ UAExampleModalPanel *modalPanel = [[[UAExampleModalPanel alloc] initWithFrame:self.view.bounds title:[(UIButton *)sender titleForState:UIControlStateNormal]] autorelease];
+
+ /////////////////////////////////
+ // Randomly use the blocks method, delgate methods, or neither of them
+ int blocksDelegateOrNone = arc4random() % 3;
+
+
+ ////////////////////////
+ // USE BLOCKS
+ if (0 == blocksDelegateOrNone) {
+ ///////////////////////////////////////////
+ // The block is responsible for closing the panel,
+ // either with -[UAModalPanel hide] or -[UAModalPanel hideWithOnComplete:]
+ // Panel is a reference to the modalPanel
+ modalPanel.onClosePressed = ^(UAModalPanel* panel) {
+ // [panel hide];
+ [panel hideWithOnComplete:^(BOOL finished) {
+ [panel removeFromSuperview];
+ }];
+ };
+
+ UADebugLog(@"UAModalView will display using blocks: %@", modalPanel);
+
+ ////////////////////////
+ // USE DELEGATE
+ } else if (1 == blocksDelegateOrNone) {
+ ///////////////////////////////////
+ // Add self as the delegate so we know how to close the panel
+ modalPanel.delegate = self;
+
+ UADebugLog(@"UAModalView will display using delegate methods: %@", modalPanel);
+
+ ////////////////////////
+ // USE NOTHING
+ } else {
+ // no-op. No delegate or blocks
+ UADebugLog(@"UAModalView will display without blocks or delegate methods: %@", modalPanel);
+ }
+
+
+ ///////////////////////////////////
+ // Add the panel to our view
+ [self.view addSubview:modalPanel];
+
+ ///////////////////////////////////
+ // Show the panel from the center of the button that was pressed
+ [modalPanel showFromPoint:[sender center]];
+}
+
+
+#pragma mark - UAModalDisplayPanelViewDelegate
+
+// Optional: This is called before the open animations.
+// Only used if delegate is set.
+- (void)willShowModalPanel:(UAModalPanel *)modalPanel {
+ UADebugLog(@"willShowModalPanel called with modalPanel: %@", modalPanel);
+}
+
+// Optional: This is called after the open animations.
+// Only used if delegate is set.
+- (void)didShowModalPanel:(UAModalPanel *)modalPanel {
+ UADebugLog(@"didShowModalPanel called with modalPanel: %@", modalPanel);
+}
+
+// Optional: This is called when the close button is pressed
+// You can use it to perform validations
+// Return YES to close the panel, otherwise NO
+// Only used if delegate is set.
+- (BOOL)shouldCloseModalPanel:(UAModalPanel *)modalPanel {
+ UADebugLog(@"shouldCloseModalPanel called with modalPanel: %@", modalPanel);
+ return YES;
+}
+
+// Optional: This is called before the close animations.
+// Only used if delegate is set.
+- (void)willCloseModalPanel:(UAModalPanel *)modalPanel {
+ UADebugLog(@"willCloseModalPanel called with modalPanel: %@", modalPanel);
+}
+
+// Optional: This is called after the close animations.
+// Only used if delegate is set.
+- (void)didCloseModalPanel:(UAModalPanel *)modalPanel {
+ UADebugLog(@"didCloseModalPanel called with modalPanel: %@", modalPanel);
+}
+
+
+@end
View
BIN UAModalPanel/Example Project/UrbanApps.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2 UAModalPanel/Example Project/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
View
4,726 UAModalPanel/Example Project/en.lproj/UAViewController_iPad.xib
4,726 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
4,726 UAModalPanel/Example Project/en.lproj/UAViewController_iPhone.xib
4,726 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
18 UAModalPanel/Example Project/main.m
@@ -0,0 +1,18 @@
+//
+// main.m
+// UAModalPanel
+//
+// Created by Matt Coneybeare on 1/8/12.
+// Copyright (c) 2012 Urban Apps. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+#import "UAAppDelegate.h"
+
+int main(int argc, char *argv[])
+{
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([UAAppDelegate class]));
+ }
+}
View
21 UAModalPanel/Panel/Categories/UIView+JMNoise.h
@@ -0,0 +1,21 @@
+// UAModalPanel
+//
+// Created by Matt Coneybeare on 1/8/12.
+// Copyright (c) 2012 Urban Apps. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface UIView (JMNoise)
+
+// Can be used directly on UIView
+- (void)applyNoise;
+- (void)applyNoiseWithOpacity:(CGFloat)opacity atLayerIndex:(NSUInteger) layerIndex;
+- (void)applyNoiseWithOpacity:(CGFloat)opacity;
+
+// Can be invoked from a drawRect() method
+- (void)drawCGNoise;
+- (void)drawCGNoiseWithOpacity:(CGFloat)opacity;
+- (void)drawCGNoiseWithOpacity:(CGFloat)opacity blendMode:(CGBlendMode)blendMode;
+
+@end
View
143 UAModalPanel/Panel/Categories/UIView+JMNoise.m
@@ -0,0 +1,143 @@
+// Created by Jason Morrissey
+
+#import <QuartzCore/QuartzCore.h>
+#import "UIView+JMNoise.h"
+#include <stdlib.h>
+
+#define kNoiseTileDimension 50
+#define kNoiseIntensity 250
+#define kNoiseDefaultOpacity 0.4
+#define kNoisePixelWidth 0.3
+
+#define JM_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
+
+#pragma Mark -
+#pragma Mark - Noise Layer
+
+@interface NoiseLayer : CALayer
++ (UIImage *)noiseTileImage;
++ (void)drawPixelInContext:(CGContextRef)context point:(CGPoint)point width:(CGFloat)width opacity:(CGFloat)opacity whiteLevel:(CGFloat)whiteLevel;
+@end
+
+@implementation NoiseLayer
+
+static UIImage * JMNoiseImage;
+
+- (void)setFrame:(CGRect)frame;
+{
+ [super setFrame:frame];
+ [self setNeedsDisplay];
+}
+
++ (void)drawPixelInContext:(CGContextRef)context point:(CGPoint)point width:(CGFloat)width opacity:(CGFloat)opacity whiteLevel:(CGFloat)whiteLevel;
+{
+ CGColorRef fillColor = [UIColor colorWithWhite:whiteLevel alpha:opacity].CGColor;
+ CGContextSetFillColor(context, CGColorGetComponents(fillColor));
+ CGRect pointRect = CGRectMake(point.x - (width/2), point.y - (width/2), width, width);
+ CGContextFillEllipseInRect(context, pointRect);
+}
+
++ (UIImage *)noiseTileImage;
+{
+ if (!JMNoiseImage)
+ {
+ #ifndef __clang_analyzer__
+ CGFloat imageScale;
+
+ if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
+ {
+ imageScale = [[UIScreen mainScreen] scale];
+ }
+ else
+ {
+ imageScale = 1;
+ }
+
+ NSUInteger imageDimension = imageScale * kNoiseTileDimension;
+
+ CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
+ CGContextRef context = CGBitmapContextCreate(nil,imageDimension,imageDimension,8,0,
+ colorSpace,kCGImageAlphaPremultipliedLast);
+ CFRelease(colorSpace);
+
+ for (int i=0; i<(kNoiseTileDimension * kNoiseIntensity); i++)
+ {
+ int x = arc4random() % (imageDimension + 1);
+ int y = arc4random() % (imageDimension + 1);
+ int opacity = arc4random() % 100;
+ CGFloat whiteLevel = arc4random() % 100;
+ [NoiseLayer drawPixelInContext:context point:CGPointMake(x, y) width:(kNoisePixelWidth * imageScale) opacity:(opacity) whiteLevel:(whiteLevel / 100.)];
+ }
+
+ CGImageRef imageRef = CGBitmapContextCreateImage(context);
+ CGContextRelease(context);
+ if (JM_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"4.0"))
+ {
+ JMNoiseImage = [[UIImage alloc] initWithCGImage:imageRef scale:imageScale orientation:UIImageOrientationUp];
+ }
+ else
+ {
+ JMNoiseImage = [[UIImage alloc] initWithCGImage:imageRef];
+ }
+ #endif
+ }
+ return JMNoiseImage;
+}
+
+- (void)drawInContext:(CGContextRef)ctx;
+{
+ UIGraphicsPushContext(ctx);
+ [[NoiseLayer noiseTileImage] drawAsPatternInRect:self.bounds];
+ UIGraphicsPopContext();
+}
+
+@end
+
+#pragma Mark -
+#pragma Mark - UIView implementations
+
+@implementation UIView (JMNoise)
+
+- (void)applyNoise;
+{
+ [self applyNoiseWithOpacity:kNoiseDefaultOpacity];
+}
+
+- (void)applyNoiseWithOpacity:(CGFloat)opacity atLayerIndex:(NSUInteger) layerIndex;
+{
+ NoiseLayer * noiseLayer = [[[NoiseLayer alloc] init] autorelease];
+ [noiseLayer setFrame:self.bounds];
+ noiseLayer.masksToBounds = YES;
+ noiseLayer.opacity = opacity;
+ [self.layer insertSublayer:noiseLayer atIndex:layerIndex];
+}
+
+- (void)applyNoiseWithOpacity:(CGFloat)opacity;
+{
+ [self applyNoiseWithOpacity:opacity atLayerIndex:0];
+}
+
+- (void)drawCGNoise;
+{
+ [self drawCGNoiseWithOpacity:kNoiseDefaultOpacity];
+}
+
+- (void)drawCGNoiseWithOpacity:(CGFloat)opacity;
+{
+ [self drawCGNoiseWithOpacity:opacity blendMode:kCGBlendModeNormal];
+}
+
+- (void)drawCGNoiseWithOpacity:(CGFloat)opacity blendMode:(CGBlendMode)blendMode;
+{
+ CGContextRef context = UIGraphicsGetCurrentContext();
+ CGContextSaveGState(context);
+ UIBezierPath * path = [UIBezierPath bezierPathWithRect:self.bounds];
+ CGContextAddPath(context, [path CGPath]);
+ CGContextClip(context);
+ CGContextSetBlendMode(context, blendMode);
+ CGContextSetAlpha(context, opacity);
+ [[NoiseLayer noiseTileImage] drawAsPatternInRect:self.bounds];
+ CGContextRestoreGState(context);
+}
+
+@end
View
BIN UAModalPanel/Panel/Images/close.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN UAModalPanel/Panel/Images/close@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
86 UAModalPanel/Panel/Panels/UAModalPanel.h
@@ -0,0 +1,86 @@
+//
+// UAModalDisplayPanelView.h
+// UAModalPanel
+//
+// Created by Matt Coneybeare on 1/8/12.
+// Copyright (c) 2012 Urban Apps. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "UARoundedRectView.h"
+
+// Logging Helpers
+#ifdef UAMODALVIEW_DEBUG
+#define UADebugLog( s, ... ) NSLog( @"<%@:%d> %@", [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
+#else
+#define UADebugLog( s, ... )
+#endif
+
+@class UAModalPanel;
+
+@protocol UAModalPanelDelegate
+@optional
+- (void)willShowModalPanel:(UAModalPanel *)modalPanel;
+- (void)didShowModalPanel:(UAModalPanel *)modalPanel;
+- (BOOL)shouldCloseModalPanel:(UAModalPanel *)modalPanel;
+- (void)willCloseModalPanel:(UAModalPanel *)modalPanel;
+- (void)didCloseModalPanel:(UAModalPanel *)modalPanel;
+@end
+
+typedef void (^UAModalDisplayPanelEvent)(UAModalPanel* panel);
+typedef void (^UAModalDisplayPanelAnimationComplete)(BOOL finished);
+
+@interface UAModalPanel : UIView {
+ NSObject<UAModalPanelDelegate> *delegate;
+
+ UIView *contentContainer;
+ UIView *roundedRect;
+ UIButton *closeButton;
+ UIView *contentView;
+
+ CGPoint startEndPoint;
+
+ CGFloat outerMargin;
+ CGFloat innerMargin;
+ UIColor *borderColor;
+ CGFloat borderWidth;
+ CGFloat cornerRadius;
+ UIColor *contentColor;
+ BOOL shouldBounce;
+
+}
+
+@property (nonatomic, assign) NSObject<UAModalPanelDelegate> *delegate;
+
+@property (nonatomic, retain) UIView *contentContainer;
+@property (nonatomic, retain) UIView *roundedRect;
+@property (nonatomic, retain) UIButton *closeButton;
+@property (nonatomic, retain) UIView *contentView;
+
+// Margin between edge of container frame and panel. Default = 20.0
+@property (nonatomic, assign) CGFloat outerMargin;
+// Margin between edge of panel and the content area. Default = 20.0
+@property (nonatomic, assign) CGFloat innerMargin;
+// Border color of the panel. Default = [UIColor whiteColor]
+@property (nonatomic, retain) UIColor *borderColor;
+// Border width of the panel. Default = 1.5f
+@property (nonatomic, assign) CGFloat borderWidth;
+// Corner radius of the panel. Default = 4.0f
+@property (nonatomic, assign) CGFloat cornerRadius;
+// Color of the panel itself. Default = [UIColor colorWithWhite:0.0 alpha:0.8]
+@property (nonatomic, retain) UIColor *contentColor;
+// Shows the bounce animation. Default = YES
+@property (nonatomic, assign) BOOL shouldBounce;
+
+@property (readwrite, copy) UAModalDisplayPanelEvent onClosePressed;
+
+- (void)show;
+- (void)showFromPoint:(CGPoint)point;
+- (void)hide;
+- (void)hideWithOnComplete:(UAModalDisplayPanelAnimationComplete)onComplete;
+
+- (CGRect)roundedRectFrame;
+- (CGRect)closeButtonFrame;
+- (CGRect)contentViewFrame;
+
+@end
View
306 UAModalPanel/Panel/Panels/UAModalPanel.m
@@ -0,0 +1,306 @@
+//
+// UACategoryDetailsViewController.m
+// UAModalPanel
+//
+// Created by Matt Coneybeare on 1/8/12.
+// Copyright (c) 2012 Urban Apps. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import <QuartzCore/QuartzCore.h>
+
+#import "UAModalPanel.h"
+#import "UARoundedRectView.h"
+
+#define DEFAULT_MARGIN 20.0f
+#define DEFAULT_BACKGROUND_COLOR [UIColor colorWithWhite:0.0 alpha:0.8]
+#define DEFAULT_CORNER_RADIUS 4.0f
+#define DEFAULT_BORDER_WIDTH 1.5f
+#define DEFAULT_BORDER_COLOR [UIColor whiteColor]
+#define DEFAULT_BOUNCE YES
+
+@implementation UAModalPanel
+
+@synthesize roundedRect, closeButton, delegate, contentView, contentContainer;
+@synthesize innerMargin, outerMargin, cornerRadius, borderWidth, borderColor, contentColor, shouldBounce;
+@synthesize onClosePressed;
+
+
+- (id)initWithFrame:(CGRect)frame {
+ self = [super initWithFrame:frame];
+ if (self != nil) {
+ delegate = nil;
+ roundedRect = nil;
+ closeButton = nil;
+ contentView = nil;
+ startEndPoint = CGPointZero;
+
+ outerMargin = DEFAULT_MARGIN;
+ innerMargin = DEFAULT_MARGIN;
+ cornerRadius = DEFAULT_CORNER_RADIUS;
+ borderWidth = DEFAULT_BORDER_WIDTH;
+ borderColor = [DEFAULT_BORDER_COLOR retain];
+ contentColor = [DEFAULT_BACKGROUND_COLOR retain];
+ shouldBounce = DEFAULT_BOUNCE;
+
+ self.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
+ self.autoresizesSubviews = YES;
+
+ self.contentContainer = [[[UIView alloc] initWithFrame:self.bounds] autorelease];
+ self.contentContainer.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
+ self.contentContainer.autoresizesSubviews = YES;
+ [self addSubview:self.contentContainer];
+
+ [self setBackgroundColor:[UIColor colorWithWhite:0.0 alpha:0.5]]; // Fixed value, the bacground mask.
+
+ [self.contentView setBackgroundColor:[UIColor clearColor]];
+ self.delegate = nil;
+
+ self.tag = (arc4random() % 32768);
+
+ }
+ return self;
+}
+
+- (void)dealloc {
+ self.roundedRect = nil;
+ self.closeButton = nil;
+ self.contentContainer = nil;
+ self.borderColor = nil;
+ self.contentColor = nil;
+ delegate = nil;
+ [super dealloc];
+}
+
+#pragma mark - Description
+
+- (NSString *)description {
+ return [NSString stringWithFormat:@"<%@ %d>", [[self class] description], self.tag];
+}
+
+#pragma mark - Accessors
+
+- (void)setCornerRadius:(CGFloat)newRadius {
+ cornerRadius = newRadius;
+ self.roundedRect.layer.cornerRadius = cornerRadius;
+}
+- (void)setBorderWidth:(CGFloat)newWidth {
+ borderWidth = newWidth;
+ self.roundedRect.layer.borderWidth = borderWidth;
+}
+- (void)setBorderColor:(UIColor *)newColor {
+ [newColor retain];
+ [borderColor release];
+ borderColor = newColor;
+
+ self.roundedRect.layer.borderColor = [borderColor CGColor];
+}
+- (void)setContentColor:(UIColor *)newColor {
+ [newColor retain];
+ [contentColor release];
+ contentColor = newColor;
+
+ self.roundedRect.backgroundColor = contentColor;
+}
+
+- (UIView *)roundedRect {
+ if (!roundedRect) {
+ self.roundedRect = [[[UIView alloc] initWithFrame:CGRectZero] autorelease];
+ roundedRect.layer.masksToBounds = YES;
+ roundedRect.backgroundColor = self.contentColor;
+ roundedRect.layer.borderColor = [self.borderColor CGColor];
+ roundedRect.layer.borderWidth = self.borderWidth;
+ roundedRect.layer.cornerRadius = self.cornerRadius;
+
+ [self.contentContainer insertSubview:roundedRect atIndex:0];
+ }
+ return roundedRect;
+}
+- (UIButton*)closeButton {
+ if (!closeButton) {
+ self.closeButton = [UIButton buttonWithType:UIButtonTypeCustom];
+ [self.closeButton setImage:[UIImage imageNamed:@"close.png"] forState:UIControlStateNormal];
+ [self.closeButton setFrame:CGRectMake(0, 0, 44, 44)];
+ self.closeButton.layer.shadowColor = [[UIColor blackColor] CGColor];
+ self.closeButton.layer.shadowOffset = CGSizeMake(0,4);
+ self.closeButton.layer.shadowOpacity = 0.3;
+
+ [closeButton addTarget:self action:@selector(closePressed:) forControlEvents:UIControlEventTouchUpInside];
+ [self.contentContainer insertSubview:closeButton aboveSubview:self.roundedRect];
+ }
+ return closeButton;
+}
+- (UIView *)contentView {
+ if (!contentView) {
+ self.contentView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease];
+ self.contentView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
+ self.contentView.autoresizesSubviews = YES;
+ [self.contentContainer addSubview:contentView];
+ }
+ return contentView;
+}
+
+- (CGRect)roundedRectFrame {
+
+ return CGRectMake(self.outerMargin + self.frame.origin.x,
+ self.outerMargin + self.frame.origin.y,
+ self.frame.size.width - 2*self.outerMargin,
+ self.frame.size.height - 2*self.outerMargin);
+}
+
+- (CGRect)closeButtonFrame {
+ CGRect f = [self roundedRectFrame];
+ return CGRectMake(f.origin.x - floor(closeButton.frame.size.width*0.5),
+ f.origin.y - floor(closeButton.frame.size.height*0.5),
+ closeButton.frame.size.width,
+ closeButton.frame.size.height);
+}
+
+- (CGRect)contentViewFrame {
+ CGRect rect = CGRectInset([self roundedRectFrame], self.innerMargin, self.innerMargin);
+ return rect;
+}
+
+
+- (void)layoutSubviews {
+ [super layoutSubviews];
+
+ self.roundedRect.frame = [self roundedRectFrame];
+ self.closeButton.frame = [self closeButtonFrame];
+ self.contentView.frame = [self contentViewFrame];
+
+// UADebugLog(@"roundedRect frame: %@", NSStringFromCGRect(self.roundedRect.frame));
+// UADebugLog(@"contentView frame: %@", NSStringFromCGRect(self.contentView.frame));
+}
+
+- (void)closePressed:(id)sender {
+
+ // Using Delegates
+ if ([delegate respondsToSelector:@selector(shouldCloseModalPanel:)]) {
+ if ([delegate shouldCloseModalPanel:self]) {
+ UADebugLog(@"Closing using delegates for modalPanel: %@", self);
+ [self hide];
+ }
+
+
+ // Using blocks
+ } else if (self.onClosePressed) {
+ UADebugLog(@"Closing using blocks for modalPanel: %@", self);
+ self.onClosePressed(self);
+
+ // No delegate or blocks. Just close myself
+ } else {
+ UADebugLog(@"Closing modalPanel: %@", self);
+ [self hide];
+ }
+}
+
+- (void)showAnimationStarting {}; //subcalsses override
+- (void)showAnimationPart1Finished {}; //subcalsses override
+- (void)showAnimationPart2Finished {}; //subcalsses override
+- (void)showAnimationPart3Finished {}; //subcalsses override
+- (void)showAnimationFinished {}; //subcalsses override
+- (void)show {
+
+ if ([delegate respondsToSelector:@selector(willShowModalPanel:)])
+ [delegate willShowModalPanel:self];
+
+ [self showAnimationStarting];
+ self.alpha = 0.0;
+ self.contentContainer.transform = CGAffineTransformMakeScale(0.00001, 0.00001);
+
+
+ void (^animationBlock)(BOOL) = ^(BOOL finished) {
+ [self showAnimationPart1Finished];
+ // Wait one second and then fade in the view
+ [UIView animateWithDuration:0.1
+ animations:^{
+ self.contentContainer.transform = CGAffineTransformMakeScale(0.95, 0.95);
+ }
+ completion:^(BOOL finished){
+
+ [self showAnimationPart2Finished];
+ // Wait one second and then fade in the view
+ [UIView animateWithDuration:0.1
+ animations:^{
+ self.contentContainer.transform = CGAffineTransformMakeScale(1.02, 1.02);
+ }
+ completion:^(BOOL finished){
+
+ [self showAnimationPart3Finished];
+ // Wait one second and then fade in the view
+ [UIView animateWithDuration:0.1
+ animations:^{
+ self.contentContainer.transform = CGAffineTransformIdentity;
+ }
+ completion:^(BOOL finished){
+ [self showAnimationFinished];
+ if ([delegate respondsToSelector:@selector(didShowModalPanel:)])
+ [delegate didShowModalPanel:self];
+ }];
+ }];
+ }];
+ };
+
+ // Show the view right away
+ [UIView animateWithDuration:0.3
+ delay:0.0
+ options:UIViewAnimationCurveEaseOut
+ animations:^{
+ self.alpha = 1.0;
+ self.contentContainer.center = self.center;
+ self.contentContainer.transform = CGAffineTransformMakeScale((shouldBounce ? 1.05 : 1.0), (shouldBounce ? 1.05 : 1.0));
+ }
+ completion:(shouldBounce ? animationBlock : ^(BOOL finished) {
+ [self showAnimationFinished];
+ if ([delegate respondsToSelector:@selector(didShowModalPanel:)])
+ [delegate didShowModalPanel:self];
+ })];
+
+}
+- (void)showFromPoint:(CGPoint)point {
+ startEndPoint = point;
+ self.contentContainer.center = point;
+ [self show];
+}
+
+- (void)hide {
+ // Hide the view right away
+ if ([delegate respondsToSelector:@selector(willCloseModalPanel:)])
+ [delegate willCloseModalPanel:self];
+
+ [UIView animateWithDuration:0.3
+ animations:^{
+ self.alpha = 0;
+ if (startEndPoint.x != CGPointZero.x || startEndPoint.y != CGPointZero.y) {
+ self.contentContainer.center = startEndPoint;
+ }
+ self.contentContainer.transform = CGAffineTransformMakeScale(0.0001, 0.0001);
+ }
+ completion:^(BOOL finished){
+ if ([delegate respondsToSelector:@selector(didCloseModalPanel:)]) {
+ [delegate didCloseModalPanel:self];
+ }
+ [self removeFromSuperview];
+ }];
+}
+
+
+- (void)hideWithOnComplete:(UAModalDisplayPanelAnimationComplete)onComplete {
+ // Hide the view right away
+ [UIView animateWithDuration:0.3
+ animations:^{
+ self.alpha = 0;
+ if (startEndPoint.x != CGPointZero.x || startEndPoint.y != CGPointZero.y) {
+ self.contentContainer.center = startEndPoint;
+ }
+ self.contentContainer.transform = CGAffineTransformMakeScale(0.0001, 0.0001);
+ }
+ completion:^(BOOL finished){
+ if (onComplete)
+ onComplete(finished);
+ }];
+}
+
+
+@end
View
30 UAModalPanel/Panel/Panels/UATitledModalPanel.h
@@ -0,0 +1,30 @@
+//
+// UAModalTitledDisplayPanelView.h
+// UAModalPanel
+//
+// Created by Matt Coneybeare on 1/8/12.
+// Copyright (c) 2012 Urban Apps. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "UAModalPanel.h"
+#import "UANoisyGradientBackground.h"
+
+@interface UATitledModalPanel : UAModalPanel {
+
+ CGFloat titleBarHeight;
+ UANoisyGradientBackground *titleBar;
+ UILabel *headerLabel;
+
+}
+
+// Height of the title view. Default = 40.0f
+@property (nonatomic, assign) CGFloat titleBarHeight;
+// The gradient bacground of the title
+@property (nonatomic, retain) UANoisyGradientBackground *titleBar;
+// The title label
+@property (nonatomic, retain) UILabel *headerLabel;
+
+- (CGRect)titleBarFrame;
+
+@end
View
106 UAModalPanel/Panel/Panels/UATitledModalPanel.m
@@ -0,0 +1,106 @@
+//
+// UAModalTitledDisplayPanelView.m
+// UAModalPanel
+//
+// Created by Matt Coneybeare on 1/8/12.
+// Copyright (c) 2012 Urban Apps. All rights reserved.
+//
+
+#import "UATitledModalPanel.h"
+#import <QuartzCore/QuartzCore.h>
+
+#define DEFAULT_TITLE_BAR_HEIGHT 40.0f
+
+@implementation UATitledModalPanel
+
+@synthesize titleBarHeight, titleBar, headerLabel;
+
+- (void)dealloc {
+ self.titleBar = nil;
+ self.headerLabel = nil;
+ [super dealloc];
+}
+
+- (id)initWithFrame:(CGRect)frame {
+ self = [super initWithFrame:frame];
+ if (self) {
+
+ self.titleBarHeight = DEFAULT_TITLE_BAR_HEIGHT;
+
+ CGFloat colors[8] = { 1, 1, 1, 1, 0, 0, 0, 1 };
+ self.titleBar = [UANoisyGradientBackground gradientWithFrame:CGRectZero
+ style:UAGradientBackgroundStyleLinear
+ color:colors
+ lineMode:UAGradientLineModeTopAndBottom
+ noiseOpacity:0.2
+ blendMode:kCGBlendModeNormal];
+
+ [self.roundedRect addSubview:self.titleBar];
+
+ self.headerLabel = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease];
+ self.headerLabel.font = [UIFont systemFontOfSize:24];
+ self.headerLabel.backgroundColor = [UIColor clearColor];
+ self.headerLabel.textColor = [UIColor whiteColor];
+ self.headerLabel.shadowColor = [UIColor blackColor];
+ self.headerLabel.shadowOffset = CGSizeMake(0, -1);
+ self.headerLabel.textAlignment = UITextAlignmentCenter;
+ [self.titleBar addSubview:self.headerLabel];
+
+
+ }
+ return self;
+}
+
+
+
+- (CGRect)titleBarFrame {
+ CGRect frame = [self.roundedRect bounds];
+ return CGRectMake(frame.origin.x,
+ frame.origin.y + self.roundedRect.layer.borderWidth,
+ frame.size.width,
+ self.titleBarHeight - self.roundedRect.layer.borderWidth);
+}
+
+
+// overriding the subclass to make room for the title bar
+- (CGRect)contentViewFrame {
+ CGRect titleBarFrame = [self titleBarFrame];
+ CGRect roundedRectFrame = [self roundedRectFrame];
+ CGFloat y = titleBarFrame.origin.y + titleBarFrame.size.height;
+ CGRect rect = CGRectMake(self.outerMargin + self.innerMargin,
+ self.outerMargin + self.innerMargin + y,
+ roundedRectFrame.size.width - 2*self.innerMargin,
+ roundedRectFrame.size.height - y - 2*self.innerMargin);
+ return rect;
+}
+
+
+- (void)layoutSubviews {
+ [super layoutSubviews];
+
+ self.titleBar.frame = [self titleBarFrame];
+ self.headerLabel.frame = self.titleBar.bounds;
+}
+
+
+// Overrides
+
+- (void)showAnimationStarting {
+ self.contentView.alpha = 0.0;
+ self.titleBar.alpha = 0.0;
+}
+
+- (void)showAnimationFinished {
+ UADebugLog(@"Fading in content for modalPanel: %@", self);
+ [UIView animateWithDuration:0.2
+ delay:0.0
+ options:UIViewAnimationCurveEaseIn
+ animations:^{
+ self.contentView.alpha = 1.0;
+ self.titleBar.alpha = 1.0;
+ }
+ completion:nil];
+}
+
+
+@end
View
46 UAModalPanel/Panel/Views/UAGradientBackground.h
@@ -0,0 +1,46 @@
+//
+// UAGradientBackground.h
+// UAModalPanel
+//
+// Created by Matt Coneybeare on 1/8/12.
+// Copyright (c) 2012 Urban Apps. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+typedef enum {
+ UAGradientBackgroundStyleRadial = 0,
+ UAGradientBackgroundStyleRadialReversed,
+ UAGradientBackgroundStyleLinear,
+ UAGradientBackgroundStyleLinearReversed,
+ UAGradientBackgroundStyleCenterHighlight,
+} UAGradientBackgroundStyle;
+
+typedef enum {
+ UAGradientLineModeNone = 0,
+ UAGradientLineModeTop = 2,
+ UAGradientLineModeBottom = 4,
+ UAGradientLineModeTopAndBottom = 8
+} UAGradientLineMode;
+
+@interface UAGradientBackground : UIView {
+ UAGradientBackgroundStyle gradientStyle;
+ UAGradientLineMode lineMode;
+ CGFloat *colorComponents;
+}
+
+@property (nonatomic, assign) UAGradientBackgroundStyle gradientStyle;
+@property (nonatomic, assign) UAGradientLineMode lineMode;
+
+- (id)initWithFrame:(CGRect)frame style:(UAGradientBackgroundStyle)aStyle color:(CGFloat *)components lineMode:(UAGradientLineMode)lineModes;
+- (id)initWithFrame:(CGRect)frame color:(CGFloat *)components;
+- (id)initWithFrame:(CGRect)frame style:(UAGradientBackgroundStyle)aStyle;
+- (id)initWithFrame:(CGRect)frame;
+
+- (void)setColorComponents:(CGFloat *)components;
+
++ (id)gradientWithFrame:(CGRect)frame style:(UAGradientBackgroundStyle)aStyle color:(CGFloat *)components lineMode:(UAGradientLineMode)lineModes;
++ (id)gradientWithFrame:(CGRect)frame color:(CGFloat *)components;
++ (id)gradientWithFrame:(CGRect)frame style:(UAGradientBackgroundStyle)aStyle;
++ (id)gradientWithFrame:(CGRect)frame;
+@end
View
142 UAModalPanel/Panel/Views/UAGradientBackground.m
@@ -0,0 +1,142 @@
+//
+// UAGradientBackground.m
+// UAModalPanel
+//
+// Created by Matt Coneybeare on 1/8/12.
+// Copyright (c) 2012 Urban Apps. All rights reserved.
+//
+
+#import "UAGradientBackground.h"
+
+@implementation UAGradientBackground
+
+@synthesize gradientStyle, lineMode;
+
+- (id)initWithFrame:(CGRect)frame style:(UAGradientBackgroundStyle)aStyle color:(CGFloat *)components lineMode:(UAGradientLineMode)lineModes {
+ if ((self = [super initWithFrame:frame])) {
+ // Initialization code
+ self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+ self.autoresizesSubviews = YES;
+ self.backgroundColor = [UIColor clearColor];
+ gradientStyle = aStyle;
+ lineMode = lineModes;
+ colorComponents = NSZoneMalloc(NSDefaultMallocZone(), 8*sizeof(CGFloat));
+ for (int i = 0; i < 8; i++) {
+ //DebugLog(@"%f", components[i]);
+ colorComponents[i] = components[i];
+ }
+ }
+ return self;
+}
+- (id)initWithFrame:(CGRect)frame color:(CGFloat *)components {
+ return [self initWithFrame:frame style:UAGradientBackgroundStyleLinear color:components lineMode:NO];
+}
+- (id)initWithFrame:(CGRect)frame style:(UAGradientBackgroundStyle)aStyle {
+ CGFloat components[8] = { 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0 };
+ return [self initWithFrame:frame style:aStyle color:components lineMode:UAGradientLineModeNone];
+}
+- (id)initWithFrame:(CGRect)frame {
+ return [self initWithFrame:frame style:UAGradientBackgroundStyleLinear];
+}
+
+
+
++ (id)gradientWithFrame:(CGRect)frame style:(UAGradientBackgroundStyle)aStyle color:(CGFloat *)components lineMode:(UAGradientLineMode)lineModes {
+ return [[[UAGradientBackground alloc] initWithFrame:frame style:aStyle color:components lineMode:lineModes] autorelease];
+}
++ (id)gradientWithFrame:(CGRect)frame color:(CGFloat *)components {
+ return [[(UAGradientBackground *)[UAGradientBackground alloc] initWithFrame:frame color:components] autorelease];
+}
++ (id)gradientWithFrame:(CGRect)frame style:(UAGradientBackgroundStyle)aStyle {
+ return [[[UAGradientBackground alloc] initWithFrame:frame style:aStyle] autorelease];
+}
++ (id)gradientWithFrame:(CGRect)frame; {
+ return [[[UAGradientBackground alloc] initWithFrame:frame] autorelease];
+}
+
+
+- (void)setColorComponents:(CGFloat *)components {
+ for (int i = 0; i < 8; i++) {
+ colorComponents[i] = components[i];
+ }
+}
+
+- (void)drawRect:(CGRect)rect {
+ CGContextRef context = UIGraphicsGetCurrentContext();
+ CGFloat locations[2] = { 0.0, 1.0 };
+ CGColorSpaceRef myColorspace = CGColorSpaceCreateDeviceRGB();
+ CGPoint start = CGPointMake(rect.size.width/2, rect.size.height/2);
+
+ switch (gradientStyle) {
+ case UAGradientBackgroundStyleRadial: {
+ CGGradientRef myGradient = CGGradientCreateWithColorComponents(myColorspace, colorComponents, locations, 2);
+ double a = rect.size.width/2.0;
+ double b = rect.size.height/2.0;
+ double h = sqrt(a*a + b*b);
+ CGContextDrawRadialGradient(context, myGradient, start, 0, start, h, 0);
+ CGGradientRelease(myGradient);
+ break;
+ }
+ case UAGradientBackgroundStyleRadialReversed: {
+ CGFloat reversed[8] = { colorComponents[4], colorComponents[5], colorComponents[6], colorComponents[7], colorComponents[0], colorComponents[1], colorComponents[2], colorComponents[3] };
+ CGGradientRef myGradient = CGGradientCreateWithColorComponents (myColorspace, reversed, locations, 2);
+ double a = rect.size.width/2.0;
+ double b = rect.size.height/2.0;
+ double h = sqrt(a*a + b*b);
+ CGContextDrawRadialGradient(context, myGradient, start, 0, start, h, 0);
+ CGGradientRelease(myGradient);
+ break;
+ }
+ case UAGradientBackgroundStyleLinear: {
+ CGGradientRef myGradient = CGGradientCreateWithColorComponents (myColorspace, colorComponents, locations, 2);
+ CGContextDrawLinearGradient(context, myGradient, CGPointMake(0.0,0.0), CGPointMake(0.0,rect.size.height+1), 0);
+ CGGradientRelease(myGradient);
+ break;
+ }
+ case UAGradientBackgroundStyleLinearReversed: {
+ CGGradientRef myGradient = CGGradientCreateWithColorComponents (myColorspace, colorComponents, locations, 2);
+ CGContextDrawLinearGradient(context, myGradient, CGPointMake(0.0,rect.size.height+1), CGPointMake(0.0,0.0), 0);
+ CGGradientRelease(myGradient);
+ break;
+ }
+ case UAGradientBackgroundStyleCenterHighlight: {
+ CGFloat myLocations[3] = { 0.0, 0.5, 1.0 };
+ CGFloat myColorComponents[12] = { colorComponents[0], colorComponents[1], colorComponents[2], colorComponents[3], colorComponents[4], colorComponents[5], colorComponents[6], colorComponents[7], colorComponents[0], colorComponents[1], colorComponents[2], colorComponents[3] };
+ CGGradientRef myGradient = CGGradientCreateWithColorComponents (myColorspace, myColorComponents, myLocations, 3);
+ CGContextDrawLinearGradient(context, myGradient, CGPointMake(0.0,0.0), CGPointMake(0.0,rect.size.height+1), 0);
+ CGGradientRelease(myGradient);
+ break;
+ }
+ default:
+ break;
+ }
+ CGColorSpaceRelease(myColorspace);
+
+ if (lineMode & UAGradientLineModeTop ||
+ lineMode & UAGradientLineModeTopAndBottom) {
+ // top Line
+ CGContextSetRGBStrokeColor(context, 1, 1, 1, 1.0);
+ CGContextMoveToPoint(context, 0, 0);
+ CGContextAddLineToPoint(context, self.frame.size.width, 0);
+ CGContextStrokePath(context);
+ }
+ if (lineMode & UAGradientLineModeBottom ||
+ lineMode & UAGradientLineModeTopAndBottom) {
+ // bottom line
+ CGContextSetRGBStrokeColor(context, 0, 0, 0, 1.0);
+ CGContextMoveToPoint(context, 0, self.frame.size.height);
+ CGContextAddLineToPoint(context, self.frame.size.width, self.frame.size.height);
+ CGContextStrokePath(context);
+ }
+}
+
+
+- (void)dealloc {
+ NSZoneFree(NSDefaultMallocZone(), colorComponents);
+ [super dealloc];
+}
+
+
+@end
+
+
View
28 UAModalPanel/Panel/Views/UANoisyGradientBackground.h
@@ -0,0 +1,28 @@
+//
+// UANoisyGradientBackground.h
+// UAModalPanel
+//
+// Created by Matt Coneybeare on 1/8/12.
+// Copyright (c) 2012 Urban Apps. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "UAGradientBackground.h"
+
+@interface UANoisyGradientBackground : UAGradientBackground {
+ CGFloat noiseOpacity;
+ CGBlendMode blendMode;
+}
+
+@property (nonatomic, assign) CGFloat noiseOpacity;
+@property (nonatomic, assign) CGBlendMode blendMode;
+
+- (id)initWithFrame:(CGRect)frame style:(UAGradientBackgroundStyle)aStyle color:(CGFloat *)components lineMode:(UAGradientLineMode)lineModes noiseOpacity:(CGFloat)opacity blendMode:(CGBlendMode)mode;
+- (id)initWithFrame:(CGRect)frame noiseOpacity:(CGFloat)opacity;
+- (id)initWithFrame:(CGRect)frame blendMode:(CGFloat)mode;
+
++ (id)gradientWithFrame:(CGRect)frame style:(UAGradientBackgroundStyle)aStyle color:(CGFloat *)components lineMode:(UAGradientLineMode)lineModes noiseOpacity:(CGFloat)opacity blendMode:(CGBlendMode)mode;
++ (id)gradientWithFrame:(CGRect)frame noiseOpacity:(CGFloat)opacity;
++ (id)gradientWithFrame:(CGRect)frame blendMode:(CGFloat)mode;
+
+@end
View
76 UAModalPanel/Panel/Views/UANoisyGradientBackground.m
@@ -0,0 +1,76 @@
+//
+// UANoisyGradientBackground.m
+// UAModalPanel
+//
+// Created by Matt Coneybeare on 1/8/12.
+// Copyright (c) 2012 Urban Apps. All rights reserved.
+//
+
+#import "UANoisyGradientBackground.h"
+#import "UIView+JMNoise.h"
+
+//#import <QuartzCore/QuartzCore.h>
+
+#define NOISE_DEFAULT_OPACITY 0.4
+
+@implementation UANoisyGradientBackground
+
+@synthesize noiseOpacity, blendMode;
+
+
+- (id)initWithFrame:(CGRect)frame style:(UAGradientBackgroundStyle)aStyle color:(CGFloat *)components lineMode:(UAGradientLineMode)lineModes noiseOpacity:(CGFloat)opacity blendMode:(CGBlendMode)mode {
+ if ((self = [self initWithFrame:frame style:aStyle color:components lineMode:lineModes])) {
+ self.noiseOpacity = opacity;
+ self.blendMode = mode;
+ }
+ return self;
+}
+- (id)initWithFrame:(CGRect)frame noiseOpacity:(CGFloat)opacity {
+ if (self = [self initWithFrame:frame]) {
+ self.noiseOpacity = opacity;
+ }
+ return self;
+}
+- (id)initWithFrame:(CGRect)frame blendMode:(CGFloat)mode {
+ if ((self = [self initWithFrame:frame])) {
+ self.blendMode = blendMode;
+ }
+ return self;
+}
+
+- (id)initWithFrame:(CGRect)frame {
+ self = [super initWithFrame:frame];
+ if (self) {
+ self.noiseOpacity = NOISE_DEFAULT_OPACITY;
+ self.blendMode = kCGBlendModeNormal;
+ }
+ return self;
+}
+
+
+
++ (id)gradientWithFrame:(CGRect)frame style:(UAGradientBackgroundStyle)aStyle color:(CGFloat *)components lineMode:(UAGradientLineMode)lineModes noiseOpacity:(CGFloat)opacity blendMode:(CGBlendMode)mode {
+ return [[[UANoisyGradientBackground alloc] initWithFrame:frame
+ style:aStyle
+ color:components
+ lineMode:lineModes
+ noiseOpacity:opacity
+ blendMode:mode] autorelease];
+}
++ (id)gradientWithFrame:(CGRect)frame noiseOpacity:(CGFloat)noiseOpacity {
+ return [[[UANoisyGradientBackground alloc] initWithFrame:frame noiseOpacity:noiseOpacity] autorelease];
+}
++ (id)gradientWithFrame:(CGRect)frame blendMode:(CGFloat)mode {
+ return [[[UANoisyGradientBackground alloc] initWithFrame:frame blendMode:mode] autorelease];
+}
+
+
+
+- (void)drawRect:(CGRect)rect {
+ [super drawRect:rect];
+
+ [self drawCGNoiseWithOpacity:self.noiseOpacity blendMode:self.blendMode];
+}
+
+@end
+
View
21 UAModalPanel/Panel/Views/UARoundedRectView.h
@@ -0,0 +1,21 @@
+//
+// UARoundedRectView.h
+// UAModalPanel
+//
+// Created by Matt Coneybeare on 1/8/12.
+// Copyright (c) 2012 Urban Apps. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+
+@interface UARoundedRectView : UIView {
+ NSInteger radius;
+ CGFloat *colorComponents;
+}
+
+@property (nonatomic, assign) NSInteger radius;
+
+- (void)setColors:(CGFloat *)components;
+
+@end
View
57 UAModalPanel/Panel/Views/UARoundedRectView.m
@@ -0,0 +1,57 @@
+//
+// UARoundedRectView.m
+// UAModalPanel
+//
+// Created by Matt Coneybeare on 1/8/12.
+// Copyright (c) 2012 Urban Apps. All rights reserved.
+//
+
+#import "UARoundedRectView.h"
+#import <QuartzCore/QuartzCore.h>
+
+@implementation UARoundedRectView
+
+@synthesize radius;
+
++ (Class)layerClass {
+ return [CAGradientLayer class];
+}
+- (id)initWithFrame:(CGRect)frame {
+ if ((self = [super initWithFrame:frame])) {
+ self.backgroundColor = [UIColor clearColor];
+
+ colorComponents = NSZoneMalloc(NSDefaultMallocZone(), 8*sizeof(CGFloat));
+ for (int i = 0; i < 8; i++) {