├── CQMFloatingController
├── en.lproj
│ └── InfoPlist.strings
├── CQMFloatingController-Prefix.pch
├── CQMFloatingController-Info.plist
├── Demo
│ ├── DemoViewController.h
│ ├── DemoTableViewController.h
│ ├── CQMAppDelegate.h
│ ├── DemoDetailViewController.h
│ ├── main.m
│ ├── DemoViewController.m
│ ├── CQMAppDelegate.m
│ ├── DemoDetailViewController.m
│ └── DemoTableViewController.m
└── Classes
│ ├── CQMFloatingNavigationBar.h
│ ├── CQMFloatingFrameView.h
│ ├── CQMFloatingMaskControl.h
│ ├── CQMFloatingContentOverlayView.h
│ ├── CQMFloatingMaskControlDelegate.h
│ ├── CQMPathUtilities.h
│ ├── CQMFloatingMaskControl.m
│ ├── CQMFloatingNavigationBar.m
│ ├── CQMFloatingController.h
│ ├── CQMFloatingContentOverlayView.m
│ ├── CQMPathUtilities.m
│ ├── CQMFloatingFrameView.m
│ └── CQMFloatingController.m
├── Default-568h@2x.png
├── CQMFloatingControllerTests
├── en.lproj
│ └── InfoPlist.strings
├── CQMFloatingControllerTests.h
├── CQMFloatingControllerTests.m
└── CQMFloatingControllerTests-Info.plist
├── CQMFloatingController.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── hiroki.xcuserdatad
│ │ └── WorkspaceSettings.xcsettings
├── xcuserdata
│ └── hiroki.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints.xcbkptlist
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── CQMFloatingController.xcscheme
└── project.pbxproj
├── .gitignore
├── LICENSE.txt
└── README.markdown
/CQMFloatingController/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cocopon/CQMFloatingController/HEAD/Default-568h@2x.png
--------------------------------------------------------------------------------
/CQMFloatingControllerTests/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/CQMFloatingController.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | .DS_Store
3 | build/
4 | *.pbxuser
5 | !default.pbxuser
6 | *.mode1v3
7 | !default.mode1v3
8 | *.mode2v3
9 | !default.mode2v3
10 | *.perspectivev3
11 | !default.perspectivev3
12 | *.xcworkspace
13 | !default.xcworkspace
14 | xcuserdata
15 | profile
16 | *.moved-aside
17 | DerivedData
18 |
--------------------------------------------------------------------------------
/CQMFloatingControllerTests/CQMFloatingControllerTests.h:
--------------------------------------------------------------------------------
1 | //
2 | // CQMFloatingControllerTests.h
3 | // CQMFloatingControllerTests
4 | //
5 | // Created by Hiroki Kokubun on 12/05/14.
6 | // Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CQMFloatingControllerTests : SenTestCase
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/CQMFloatingController/CQMFloatingController-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'CQMFloatingController' target in the 'CQMFloatingController' project
3 | //
4 |
5 | #import
6 |
7 | #ifndef __IPHONE_3_0
8 | #warning "This project uses features only available in iOS SDK 3.0 and later."
9 | #endif
10 |
11 | #ifdef __OBJC__
12 | #import
13 | #import
14 | #endif
15 |
--------------------------------------------------------------------------------
/CQMFloatingController.xcodeproj/project.xcworkspace/xcuserdata/hiroki.xcuserdatad/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges
6 |
7 | SnapshotAutomaticallyBeforeSignificantChanges
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/CQMFloatingController.xcodeproj/xcuserdata/hiroki.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/CQMFloatingControllerTests/CQMFloatingControllerTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // CQMFloatingControllerTests.m
3 | // CQMFloatingControllerTests
4 | //
5 | // Created by Hiroki Kokubun on 12/05/14.
6 | // Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
7 | //
8 |
9 | #import "CQMFloatingControllerTests.h"
10 |
11 | @implementation CQMFloatingControllerTests
12 |
13 | - (void)setUp
14 | {
15 | [super setUp];
16 |
17 | // Set-up code here.
18 | }
19 |
20 | - (void)tearDown
21 | {
22 | // Tear-down code here.
23 |
24 | [super tearDown];
25 | }
26 |
27 | - (void)testExample
28 | {
29 | STFail(@"Unit tests are not implemented yet in CQMFloatingControllerTests");
30 | }
31 |
32 | @end
33 |
--------------------------------------------------------------------------------
/CQMFloatingController.xcodeproj/xcuserdata/hiroki.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | CQMFloatingController.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | F5C4223E1560BF2300F7E3EE
16 |
17 | primary
18 |
19 |
20 | F5C422591560BF2400F7E3EE
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/CQMFloatingControllerTests/CQMFloatingControllerTests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | jp.ne.sakura.dotapon.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2012 cocopon
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | SOFTWARE.
20 |
21 |
--------------------------------------------------------------------------------
/CQMFloatingController/CQMFloatingController-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIdentifier
12 | jp.ne.sakura.dotapon.${PRODUCT_NAME:rfc1034identifier}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1.0
25 | LSRequiresIPhoneOS
26 |
27 | UISupportedInterfaceOrientations
28 |
29 | UIInterfaceOrientationPortrait
30 | UIInterfaceOrientationLandscapeLeft
31 | UIInterfaceOrientationLandscapeRight
32 |
33 | NSMainNibFile
34 | MainWindow
35 |
36 |
37 |
--------------------------------------------------------------------------------
/CQMFloatingController/Demo/DemoViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // DemoViewController.m
3 | // Created by cocopon on 2012/06/02.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import
27 |
28 |
29 | @interface DemoViewController : UIViewController
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/CQMFloatingController/Classes/CQMFloatingNavigationBar.h:
--------------------------------------------------------------------------------
1 | //
2 | // CQMFloatingNavigationBar.h
3 | // Created by cocopon on 2011/09/23.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import
27 |
28 |
29 | @interface CQMFloatingNavigationBar : UINavigationBar
30 | @end
31 |
--------------------------------------------------------------------------------
/CQMFloatingController/Demo/DemoTableViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // DemoTableViewController.h
3 | // Created by cocopon on 2012/05/15.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import
27 |
28 |
29 | @interface DemoTableViewController : UITableViewController
30 | @end
31 |
--------------------------------------------------------------------------------
/CQMFloatingController/Demo/CQMAppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // CQMAppDelegate.h
3 | // Created by cocopon on 2012/05/14.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import
27 |
28 |
29 | @interface CQMAppDelegate : UIResponder
30 |
31 | @property (strong, nonatomic) IBOutlet UIWindow *window;
32 |
33 | @end
34 |
--------------------------------------------------------------------------------
/CQMFloatingController/Demo/DemoDetailViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // DemoDetailViewController.h
3 | // Created by cocopon on 2012/05/15.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import
27 |
28 |
29 | @interface DemoDetailViewController : UIViewController
30 |
31 | @property (nonatomic, copy) NSString *text;
32 |
33 | @end
34 |
--------------------------------------------------------------------------------
/CQMFloatingController/Demo/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // Created by cocopon on 2012/05/14.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import
27 |
28 | #import "CQMAppDelegate.h"
29 |
30 | int main(int argc, char *argv[]) {
31 | @autoreleasepool {
32 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([CQMAppDelegate class]));
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/CQMFloatingController/Classes/CQMFloatingFrameView.h:
--------------------------------------------------------------------------------
1 | //
2 | // CQMFloatingFrameView.h
3 | // Created by cocopon on 2012/05/14.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import
27 |
28 |
29 | @interface CQMFloatingFrameView : UIView
30 |
31 | @property (nonatomic, strong) UIColor *baseColor;
32 | @property (nonatomic) CGFloat cornerRadius;
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/CQMFloatingController/Classes/CQMFloatingMaskControl.h:
--------------------------------------------------------------------------------
1 | //
2 | // CQMFloatingMaskControl.h
3 | // Created by cocopon on 2012/06/03.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import
27 | #import "CQMFloatingMaskControlDelegate.h"
28 |
29 |
30 | @interface CQMFloatingMaskControl : UIControl
31 |
32 | @property (nonatomic, weak) id resizeDelegate;
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/CQMFloatingController/Classes/CQMFloatingContentOverlayView.h:
--------------------------------------------------------------------------------
1 | //
2 | // CQMFloatingContentOverlayView.h
3 | // Created by cocopon on 2012/05/15.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import
27 |
28 |
29 | @interface CQMFloatingContentOverlayView : UIView
30 |
31 | @property (nonatomic) CGFloat cornerRadius;
32 | @property (nonatomic, strong) UIColor *edgeColor;
33 |
34 | + (CGFloat)frameWidth;
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/CQMFloatingController/Classes/CQMFloatingMaskControlDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // CQMFloatingMaskControlDelegate.h
3 | // Created by cocopon on 2013/07/13.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import
27 |
28 |
29 | @class CQMFloatingMaskControl;
30 |
31 |
32 | @protocol CQMFloatingMaskControlDelegate
33 |
34 | @optional
35 | - (void)floatingMaskControlDidResize:(CQMFloatingMaskControl*)maskControl;
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/CQMFloatingController/Classes/CQMPathUtilities.h:
--------------------------------------------------------------------------------
1 | //
2 | // CQMPathUtilities.h
3 | // Created by cocopon on 2012/05/15.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import
27 |
28 |
29 | CGPathRef CQMPathCreateRoundingRect(CGRect rect, CGFloat blRadius, CGFloat brRadius, CGFloat trRadius, CGFloat tlRadius);
30 | CGPathRef CQMPathCreateInvertedRoundingRect(CGRect rect, CGFloat blRadius, CGFloat brRadius, CGFloat trRadius, CGFloat tlRadius);
31 |
--------------------------------------------------------------------------------
/CQMFloatingController/Demo/DemoViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // DemoViewController.m
3 | // Created by cocopon on 2012/06/02.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import "DemoViewController.h"
27 |
28 |
29 | @implementation DemoViewController
30 |
31 |
32 | #pragma mark -
33 | #pragma mark UIViewController
34 |
35 |
36 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
37 | return YES;
38 | }
39 |
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/README.markdown:
--------------------------------------------------------------------------------
1 | CQMFloatingController
2 | =====================
3 |
4 |
5 | Overview
6 | --------
7 | CQMFloatingController is a floating UI component with navigation bar.
8 | You can push/pop a content view controller on it.
9 |
10 | This component is ported from [Calqum](http://www.dotapon.sakura.ne.jp/apps/calqum2/index_en.html), customizable calculator for iPhone.
11 |
12 |
13 | Features
14 | --------
15 | - The appearance looks good in UIKit standard
16 | - Customizable frame color
17 |
18 |
19 | Screenshots
20 | -----------
21 | 
22 | 
23 |
24 |
25 | How to Use
26 | ----------
27 | 1. Add all files in `CQMFloatingController/Classes` to your project
28 | 2. Write code as below:
29 |
30 | ```Objective-C
31 | // Import a required class
32 | #import "CQMFloatingController.h"
33 |
34 | - (void)show {
35 | // Prepare content view controller
36 | SomeViewController *viewController = [[[SomeViewController alloc] init] autorelease];
37 |
38 | // Get shared floating controller, and customize if needed
39 | CQMFloatingController *floatingController = [CQMFloatingController sharedFloatingController];
40 | [floatingController setFrameColor:[UIColor orangeColor]];
41 |
42 | // Show floating controller with content
43 | UIWindow *window = [[UIApplication sharedApplication] keyWindow];
44 | UIView *rootView = [window.rootViewController view];
45 | [floatingController showInView:rootView
46 | withContentViewController:viewController
47 | animated:YES];
48 | }
49 | ```
50 |
51 |
52 | License
53 | -------
54 | MIT License.
55 | See LICENSE.txt for more information.
56 |
57 |
--------------------------------------------------------------------------------
/CQMFloatingController/Classes/CQMFloatingMaskControl.m:
--------------------------------------------------------------------------------
1 | //
2 | // CQMFloatingMaskControl.m
3 | // Created by cocopon on 2011/06/03.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import "CQMFloatingMaskControl.h"
27 |
28 |
29 | @implementation CQMFloatingMaskControl
30 |
31 |
32 | - (void)dealloc {
33 | [self setResizeDelegate:nil];
34 | }
35 |
36 |
37 | #pragma mark -
38 | #pragma mark Property
39 |
40 |
41 | - (void)setFrame:(CGRect)frame {
42 | [super setFrame:frame];
43 |
44 | SEL selector = @selector(floatingMaskControlDidResize:);
45 | if ([self.resizeDelegate respondsToSelector:selector]) {
46 | [self.resizeDelegate floatingMaskControlDidResize:self];
47 | }
48 | }
49 |
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/CQMFloatingController/Classes/CQMFloatingNavigationBar.m:
--------------------------------------------------------------------------------
1 | //
2 | // CQMFloatingNavigationBar.m
3 | // Created by cocopon on 2011/09/23.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import "CQMFloatingNavigationBar.h"
27 |
28 |
29 | @implementation CQMFloatingNavigationBar
30 |
31 |
32 | - (id)init {
33 | if (self = [super init]) {
34 | [self setBackgroundColor:[UIColor clearColor]];
35 | }
36 | return self;
37 | }
38 |
39 |
40 | - (id)initWithCoder:(NSCoder*)aDecoder {
41 | if (self = [super initWithCoder:aDecoder]) {
42 | [self setBackgroundColor:[UIColor clearColor]];
43 | }
44 | return self;
45 | }
46 |
47 |
48 | #pragma mark -
49 | #pragma mark UIView
50 |
51 |
52 | - (void)drawRect:(CGRect)rect {
53 | // Draw nothing (transparent background)
54 | }
55 |
56 |
57 | @end
58 |
--------------------------------------------------------------------------------
/CQMFloatingController/Classes/CQMFloatingController.h:
--------------------------------------------------------------------------------
1 | //
2 | // CQMFloatingController.h
3 | // Created by cocopon on 2011/05/19.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import
27 | #import "CQMFloatingMaskControlDelegate.h"
28 |
29 |
30 | @class CQMFloatingFrameView;
31 | @class CQMFloatingNavigationBar;
32 |
33 |
34 | @interface CQMFloatingController : UIViewController
35 |
36 | @property (nonatomic) CGSize landscapeFrameSize;
37 | @property (nonatomic) CGSize portraitFrameSize;
38 | @property (nonatomic, strong) UIColor *frameColor;
39 |
40 | + (CQMFloatingController*)sharedFloatingController;
41 |
42 | - (void)showInView:(UIView*)view withContentViewController:(UIViewController*)contentViewController animated:(BOOL)animated;
43 | - (void)dismissAnimated:(BOOL)animated;
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/CQMFloatingController/Demo/CQMAppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // CQMAppDelegate.m
3 | // Created by cocopon on 2012/05/14.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import "CQMAppDelegate.h"
27 | #import "CQMFloatingController.h"
28 | #import "DemoTableViewController.h"
29 |
30 |
31 | @implementation CQMAppDelegate
32 |
33 |
34 |
35 |
36 | #pragma mark -
37 | #pragma mark Property
38 |
39 |
40 | @synthesize window = window_;
41 |
42 |
43 | #pragma mark -
44 | #pragma mark Actions
45 |
46 |
47 | - (IBAction)showButtonAction:(id)sender {
48 | // To use CQMFloatingController:
49 |
50 | // 1. Prepare a content view controller
51 | DemoTableViewController *demoViewController = [[DemoTableViewController alloc] init];
52 |
53 | // 2. Get shared floating controller
54 | CQMFloatingController *floatingController = [CQMFloatingController sharedFloatingController];
55 |
56 | // 3. Show floating controller with specified content
57 | UIViewController *rootViewController = [[[UIApplication sharedApplication] keyWindow] rootViewController];
58 | [floatingController showInView:[rootViewController view]
59 | withContentViewController:demoViewController
60 | animated:YES];
61 | }
62 |
63 |
64 | #pragma mark -
65 | #pragma mark UIApplicationDelegate
66 |
67 |
68 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
69 | [self.window makeKeyAndVisible];
70 | return YES;
71 | }
72 |
73 |
74 | @end
75 |
--------------------------------------------------------------------------------
/CQMFloatingController/Demo/DemoDetailViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // DemoDetailViewController.m
3 | // Created by cocopon on 2012/05/15.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import "DemoDetailViewController.h"
27 |
28 |
29 | #define kBackgroundColor [UIColor colorWithWhite:0.8f alpha:1.0f]
30 | #define kLabelFont [UIFont boldSystemFontOfSize:30.0f]
31 | #define kShadowOffset CGSizeMake(0, 1.0f)
32 | #define kTextColor [UIColor blackColor]
33 | #define kTextShadowColor [UIColor colorWithWhite:1.0f alpha:0.5f]
34 |
35 |
36 | @interface DemoDetailViewController()
37 |
38 | @property (nonatomic, readonly, strong) UILabel *textLabel;
39 |
40 | @end
41 |
42 |
43 | @implementation DemoDetailViewController {
44 | @private
45 | // View
46 | UILabel *label_;
47 | }
48 |
49 |
50 |
51 | #pragma mark -
52 | #pragma mark Property
53 |
54 |
55 | - (NSString*)text {
56 | return [self.textLabel text];
57 | }
58 | - (void)setText:(NSString*)text {
59 | [self.textLabel setText:text];
60 | [self.navigationItem setTitle:text];
61 | }
62 |
63 |
64 | - (UILabel*)textLabel {
65 | if (label_ == nil) {
66 | label_ = [[UILabel alloc] init];
67 | [label_ setBackgroundColor:[UIColor clearColor]];
68 | [label_ setFont:kLabelFont];
69 | [label_ setShadowColor:kTextShadowColor];
70 | [label_ setShadowOffset:kShadowOffset];
71 | [label_ setTextAlignment:UITextAlignmentCenter];
72 | [label_ setTextColor:kTextColor];
73 | }
74 | return label_;
75 | }
76 |
77 |
78 | #pragma mark -
79 | #pragma mark UIViewController
80 |
81 |
82 | - (void)viewDidLoad {
83 | [super viewDidLoad];
84 |
85 | [self.view setBackgroundColor:kBackgroundColor];
86 |
87 | UILabel *label = [self textLabel];
88 | CGSize viewSize = [self.view frame].size;
89 | [label setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
90 | [label setFrame:CGRectMake(0, 0, viewSize.width, viewSize.height)];
91 | [self.view addSubview:label];
92 | }
93 |
94 |
95 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
96 | return YES;
97 | }
98 |
99 |
100 | @end
101 |
--------------------------------------------------------------------------------
/CQMFloatingController/Classes/CQMFloatingContentOverlayView.m:
--------------------------------------------------------------------------------
1 | //
2 | // CQMFloatingContentOverlayView.m
3 | // Created by cocopon on 2012/05/15.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import "CQMFloatingContentOverlayView.h"
27 | #import "CQMPathUtilities.h"
28 |
29 |
30 | #define kDefaultCornerRadius 5.0f
31 | #define kShadowOffset CGSizeMake(0, 1.0f)
32 | #define kShadowBlur 2.0f
33 | #define kShadowColor [UIColor colorWithWhite:0 alpha:0.8f]
34 |
35 |
36 | @implementation CQMFloatingContentOverlayView {
37 | @private
38 | CGFloat cornerRadius_;
39 | UIColor *edgeColor_;
40 | }
41 |
42 |
43 | - (id)init {
44 | if (self = [super init]) {
45 | [self setBackgroundColor:[UIColor clearColor]];
46 | [self setCornerRadius:kDefaultCornerRadius];
47 | }
48 | return self;
49 | }
50 |
51 |
52 |
53 |
54 | #pragma mark -
55 | #pragma mark Property
56 |
57 |
58 | + (CGFloat)frameWidth {
59 | return kShadowBlur;
60 | }
61 |
62 |
63 | - (CGFloat)cornerRadius {
64 | return cornerRadius_;
65 | }
66 | - (void)setCornerRadius:(CGFloat)cornerRadius {
67 | cornerRadius_ = cornerRadius;
68 | [self setNeedsDisplay];
69 | }
70 |
71 |
72 | - (UIColor*)edgeColor {
73 | return edgeColor_;
74 | }
75 | - (void)setEdgeColor:(UIColor*)edgeColor {
76 | edgeColor_ = edgeColor;
77 | [self setNeedsDisplay];
78 | }
79 |
80 |
81 | #pragma mark -
82 | #pragma mark UIView
83 |
84 |
85 | - (void)drawRect:(CGRect)rect {
86 | [super drawRect:rect];
87 |
88 | CGContextRef context = UIGraphicsGetCurrentContext();
89 | CGSize viewSize = [self frame].size;
90 | CGFloat radius = [self cornerRadius];
91 | CGPathRef path;
92 |
93 | CGContextSaveGState(context);
94 | CGFloat frameWidth = [CQMFloatingContentOverlayView frameWidth];
95 | path = CQMPathCreateRoundingRect(CGRectMake(frameWidth, frameWidth,
96 | viewSize.width - frameWidth * 2,
97 | viewSize.height - frameWidth * 2),
98 | radius, radius, radius, radius);
99 | CGContextAddRect(context, CGRectMake(0, 0,
100 | viewSize.width, viewSize.height));
101 | CGContextAddPath(context, path);
102 | CGContextSetFillColorWithColor(context, [self.edgeColor CGColor]);
103 | CGContextSetShadowWithColor(context, kShadowOffset, kShadowBlur, [kShadowColor CGColor]);
104 | CGContextEOFillPath(context);
105 | CGContextDrawPath(context, 0);
106 | CGPathRelease(path);
107 | CGContextRestoreGState(context);
108 | }
109 |
110 |
111 | @end
112 |
--------------------------------------------------------------------------------
/CQMFloatingController/Demo/DemoTableViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // DemoTableViewController.m
3 | // Created by cocopon on 2012/05/15.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import "DemoTableViewController.h"
27 | #import "DemoDetailViewController.h"
28 |
29 |
30 | #define kCellIdentifier @"UITableViewCell"
31 | #define kNavigationTitle @"Demo"
32 |
33 |
34 | @interface DemoTableViewController()
35 |
36 | @property (nonatomic, readonly, strong) NSArray *texts;
37 |
38 | + (NSArray*)testData;
39 |
40 | @end
41 |
42 |
43 | @implementation DemoTableViewController {
44 | @private
45 | NSArray *texts_;
46 | }
47 |
48 |
49 |
50 |
51 | #pragma mark -
52 | #pragma mark Property
53 |
54 |
55 | - (NSArray*)texts {
56 | if (texts_ == nil) {
57 | texts_ = [DemoTableViewController testData];
58 | }
59 | return texts_;
60 | }
61 |
62 |
63 | #pragma mark -
64 |
65 |
66 | + (NSArray*)testData {
67 | NSMutableArray *data = [[NSMutableArray alloc] init];
68 |
69 | for (unichar ch = 'A'; ch <= 'Z'; ch++) {
70 | [data addObject:[NSString stringWithFormat:@"%C%C%C", ch, ch, ch]];
71 | }
72 |
73 | return data;
74 | }
75 |
76 |
77 | #pragma mark -
78 | #pragma mark UITableViewController
79 |
80 |
81 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
82 | return [self.texts count];
83 | }
84 |
85 |
86 | - (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath {
87 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier];
88 | if (cell == nil) {
89 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
90 | reuseIdentifier:kCellIdentifier];
91 | }
92 |
93 | NSString *text = [self.texts objectAtIndex:[indexPath row]];
94 | [cell.textLabel setText:text];
95 | [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
96 |
97 | return cell;
98 | }
99 |
100 |
101 | - (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath {
102 | [tableView deselectRowAtIndexPath:indexPath
103 | animated:YES];
104 |
105 | DemoDetailViewController *detailViewController = [[DemoDetailViewController alloc] init];
106 | NSString *text = [self.texts objectAtIndex:[indexPath row]];
107 | [detailViewController setText:text];
108 | [self.navigationController pushViewController:detailViewController
109 | animated:YES];
110 | }
111 |
112 |
113 | #pragma mark -
114 | #pragma mark UIViewController
115 |
116 |
117 | - (void)viewDidLoad {
118 | [super viewDidLoad];
119 | [self.navigationItem setTitle:kNavigationTitle];
120 | }
121 |
122 |
123 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
124 | return YES;
125 | }
126 |
127 |
128 | @end
129 |
--------------------------------------------------------------------------------
/CQMFloatingController/Classes/CQMPathUtilities.m:
--------------------------------------------------------------------------------
1 | //
2 | // CQMPathUtilities.m
3 | // Created by cocopon on 2012/05/15.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import "CQMPathUtilities.h"
27 |
28 |
29 | CGPathRef CQMPathCreateRoundingRect(CGRect rect, CGFloat blRadius, CGFloat brRadius, CGFloat trRadius, CGFloat tlRadius) {
30 | CGPoint tlPoint = rect.origin;
31 | CGPoint brPoint = CGPointMake(rect.origin.x + rect.size.width,
32 | rect.origin.y + rect.size.height);
33 | CGMutablePathRef path = CGPathCreateMutable();
34 |
35 | CGPathMoveToPoint(path, NULL, tlPoint.x + tlRadius, tlPoint.y);
36 | CGPathAddArcToPoint(path, NULL,
37 | brPoint.x, tlPoint.y,
38 | brPoint.x, tlPoint.y + trRadius,
39 | trRadius);
40 | CGPathAddArcToPoint(path, NULL,
41 | brPoint.x, brPoint.y,
42 | brPoint.x - brRadius, brPoint.y,
43 | brRadius);
44 | CGPathAddArcToPoint(path, NULL,
45 | tlPoint.x, brPoint.y,
46 | tlPoint.x, brPoint.y - blRadius,
47 | blRadius);
48 | CGPathAddArcToPoint(path, NULL,
49 | tlPoint.x, tlPoint.y,
50 | tlPoint.x + tlRadius, tlPoint.y,
51 | tlRadius);
52 | CGPathCloseSubpath(path);
53 |
54 | return path;
55 | }
56 |
57 |
58 | CGPathRef CQMPathCreateInvertedRoundingRect(CGRect rect, CGFloat blRadius, CGFloat brRadius, CGFloat trRadius, CGFloat tlRadius) {
59 | CGPoint tlPoint = rect.origin;
60 | CGPoint brPoint = CGPointMake(rect.origin.x + rect.size.width,
61 | rect.origin.y + rect.size.height);
62 | CGMutablePathRef path = CGPathCreateMutable();
63 |
64 | // Top left
65 | CGPathMoveToPoint(path, NULL, tlPoint.x, tlPoint.y);
66 | CGPathAddLineToPoint(path, NULL,
67 | tlPoint.x + tlRadius, tlPoint.y);
68 | CGPathAddArcToPoint(path, NULL,
69 | tlPoint.x, tlPoint.y,
70 | tlPoint.x, tlPoint.y + tlRadius,
71 | tlRadius);
72 | CGPathCloseSubpath(path);
73 |
74 | // Top right
75 | CGPathMoveToPoint(path, NULL, brPoint.x, tlPoint.y);
76 | CGPathAddLineToPoint(path, NULL,
77 | brPoint.x, tlPoint.y + trRadius);
78 | CGPathAddArcToPoint(path, NULL,
79 | brPoint.x, tlPoint.y,
80 | brPoint.x - trRadius, tlPoint.y,
81 | trRadius);
82 | CGPathCloseSubpath(path);
83 |
84 | // Bottom right
85 | CGPathMoveToPoint(path, NULL, brPoint.x, brPoint.y);
86 | CGPathAddLineToPoint(path, NULL,
87 | brPoint.x - brRadius, brPoint.y);
88 | CGPathAddArcToPoint(path, NULL,
89 | brPoint.x, brPoint.y,
90 | brPoint.x, brPoint.y - brRadius,
91 | brRadius);
92 | CGPathCloseSubpath(path);
93 |
94 | // Bottom left
95 | CGPathMoveToPoint(path, NULL, tlPoint.x, brPoint.y);
96 | CGPathAddLineToPoint(path, NULL, tlPoint.x, brPoint.y - blRadius);
97 | CGPathAddArcToPoint(path, NULL,
98 | tlPoint.x, brPoint.y,
99 | tlPoint.x + blRadius, brPoint.y,
100 | blRadius);
101 | CGPathCloseSubpath(path);
102 |
103 | return path;
104 | }
105 |
106 |
--------------------------------------------------------------------------------
/CQMFloatingController.xcodeproj/xcuserdata/hiroki.xcuserdatad/xcschemes/CQMFloatingController.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
8 |
14 |
20 |
21 |
22 |
23 |
24 |
29 |
30 |
32 |
38 |
39 |
40 |
41 |
42 |
48 |
49 |
50 |
51 |
60 |
61 |
67 |
68 |
69 |
70 |
71 |
72 |
78 |
79 |
85 |
86 |
87 |
88 |
90 |
91 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/CQMFloatingController/Classes/CQMFloatingFrameView.m:
--------------------------------------------------------------------------------
1 | //
2 | // CQMFloatingFrameView.m
3 | // Created by cocopon on 2012/05/14.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import "CQMFloatingFrameView.h"
27 | #import "CQMPathUtilities.h"
28 |
29 |
30 | #define kLightBorderWidth 1.0f
31 | #define kHighlightHeight 22.0f
32 | #define kHighlightMargin 1.0f
33 | #define kLightBorderColor [UIColor colorWithWhite:1.00f alpha:0.10f]
34 | #define kStartHighlightColor [UIColor colorWithWhite:1.00f alpha:0.40f]
35 | #define kEndHighlightColor [UIColor colorWithWhite:1.00f alpha:0.05f]
36 | #define kDefaultCornerRadius 8.0f
37 |
38 |
39 | @implementation CQMFloatingFrameView {
40 | @private
41 | CGFloat cornerRadius_;
42 | UIColor *baseColor_;
43 | }
44 |
45 |
46 | - (id)init {
47 | if (self = [super init]) {
48 | [self setBackgroundColor:[UIColor clearColor]];
49 | [self setCornerRadius:kDefaultCornerRadius];
50 | }
51 | return self;
52 | }
53 |
54 |
55 |
56 |
57 | #pragma mark -
58 | #pragma mark Property
59 |
60 |
61 | - (UIColor*)baseColor {
62 | return baseColor_;
63 | }
64 | - (void)setBaseColor:(UIColor*)baseColor {
65 | if (baseColor_ != baseColor) {
66 | baseColor_ = baseColor;
67 | }
68 | [self setNeedsDisplay];
69 | }
70 |
71 |
72 | - (CGFloat)cornerRadius {
73 | return cornerRadius_;
74 | }
75 | - (void)setCornerRadius:(CGFloat)cornerRadius {
76 | cornerRadius_ = cornerRadius;
77 | [self setNeedsDisplay];
78 | }
79 |
80 |
81 | #pragma mark -
82 | #pragma mark UIView
83 |
84 |
85 | - (void)drawRect:(CGRect)rect {
86 | [super drawRect:rect];
87 |
88 | CGContextRef context = UIGraphicsGetCurrentContext();
89 | CGFloat radius = [self cornerRadius];
90 | CGSize viewSize = [self frame].size;
91 | CGPathRef path;
92 |
93 | // Light border
94 | CGContextSaveGState(context);
95 | CGFloat borderRadius = radius + kLightBorderWidth;
96 | path = CQMPathCreateRoundingRect(CGRectMake(0, 0,
97 | viewSize.width, viewSize.height),
98 | borderRadius, borderRadius, borderRadius, borderRadius);
99 | CGContextAddPath(context, path);
100 | CGContextSetFillColorWithColor(context, [kLightBorderColor CGColor]);
101 | CGContextFillPath(context);
102 | CGPathRelease(path);
103 | CGContextRestoreGState(context);
104 |
105 | // Base
106 | CGContextSaveGState(context);
107 | path = CQMPathCreateRoundingRect(CGRectMake(kLightBorderWidth, kLightBorderWidth,
108 | viewSize.width - kLightBorderWidth * 2,
109 | viewSize.height - kLightBorderWidth * 2),
110 | radius, radius, radius, radius);
111 | CGContextAddPath(context, path);
112 | CGContextSetFillColorWithColor(context, [self.baseColor CGColor]);
113 | CGContextFillPath(context);
114 | CGPathRelease(path);
115 | CGContextRestoreGState(context);
116 |
117 | // Highlight
118 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
119 | NSArray *colors = [[NSArray alloc] initWithObjects:
120 | (id)[kStartHighlightColor CGColor],
121 | (id)[kEndHighlightColor CGColor],
122 | nil];
123 | CGFloat locations[] = {0, 1.0f};
124 | CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, (__bridge CFArrayRef)colors, locations);
125 | CGFloat highlightMargin = kLightBorderWidth + kHighlightMargin;
126 | CGRect highlightRect = CGRectMake(highlightMargin, highlightMargin,
127 | viewSize.width - highlightMargin * 2,
128 | kHighlightHeight);
129 | CGFloat highlightRadius = radius - kHighlightMargin;
130 | CGContextSaveGState(context);
131 | path = CQMPathCreateRoundingRect(highlightRect,
132 | 0, 0, highlightRadius, highlightRadius);
133 | CGContextAddPath(context, path);
134 | CGContextClip(context);
135 | CGContextDrawLinearGradient(context, gradient,
136 | CGPointMake(0, 0),
137 | CGPointMake(0, kHighlightHeight),
138 | 0);
139 | CGGradientRelease(gradient);
140 | CGColorSpaceRelease(colorSpace);
141 | CGPathRelease(path);
142 | CGContextRestoreGState(context);
143 | }
144 |
145 |
146 | @end
147 |
--------------------------------------------------------------------------------
/CQMFloatingController/Classes/CQMFloatingController.m:
--------------------------------------------------------------------------------
1 | //
2 | // CQMFloatingController.m
3 | // Created by cocopon on 2011/05/19.
4 | //
5 | // Copyright (c) 2012 cocopon
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to
9 | // deal in the Software without restriction, including without limitation the
10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 | // sell copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | // SOFTWARE.
24 | //
25 |
26 | #import
27 | #import "CQMFloatingController.h"
28 | #import "CQMFloatingContentOverlayView.h"
29 | #import "CQMFloatingFrameView.h"
30 | #import "CQMFloatingMaskControl.h"
31 | #import "CQMFloatingNavigationBar.h"
32 | #import "CQMPathUtilities.h"
33 |
34 |
35 | #define kDefaultMaskColor [UIColor colorWithWhite:0 alpha:0.5]
36 | #define kDefaultFrameColor [UIColor colorWithRed:0.10f green:0.12f blue:0.16f alpha:1.00f]
37 | #define kDefaultPortraitFrameSize CGSizeMake(320 - 66, 460 - 66)
38 | #define kDefaultLandscapeFrameSize CGSizeMake(480 - 66, 300 - 66)
39 | #define kFramePadding 5.0f
40 | #define kRootKey @"root"
41 | #define kShadowColor [UIColor blackColor]
42 | #define kShadowOffset CGSizeMake(0, 2.0f)
43 | #define kShadowOpacity 0.70f
44 | #define kShadowRadius 10.0f
45 | #define kAnimationDuration 0.3f
46 |
47 |
48 | @interface CQMFloatingController()
49 |
50 | @property (nonatomic, readonly, strong) UIControl *maskControl;
51 | @property (nonatomic, readonly, strong) CQMFloatingFrameView *frameView;
52 | @property (nonatomic, readonly, strong) UIView *contentView;
53 | @property (nonatomic, readonly, strong) CQMFloatingContentOverlayView *contentOverlayView;
54 | @property (nonatomic, readonly, strong) UINavigationController *navigationController;
55 | @property (nonatomic, strong) UIImageView *shadowView;
56 |
57 | - (void)layoutFrameView;
58 | // Actions
59 | - (void)maskControlDidTouchUpInside:(id)sender;
60 |
61 | @end
62 |
63 |
64 | @implementation CQMFloatingController {
65 | @private
66 | BOOL presented_;
67 | CGSize landscapeFrameSize_;
68 | CGSize portraitFrameSize_;
69 | // View
70 | CQMFloatingMaskControl *maskControl_;
71 | CQMFloatingFrameView *frameView_;
72 | UIView *contentView_;
73 | CQMFloatingContentOverlayView *contentOverlayView_;
74 | UINavigationController *navController_;
75 | UIViewController *contentViewController_;
76 | }
77 |
78 |
79 | - (id)init {
80 | if (self = [super init]) {
81 | [self setPortraitFrameSize:kDefaultPortraitFrameSize];
82 | [self setLandscapeFrameSize:kDefaultLandscapeFrameSize];
83 | [self setFrameColor:kDefaultFrameColor];
84 | }
85 | return self;
86 | }
87 |
88 |
89 |
90 |
91 | #pragma mark -
92 | #pragma mark Property
93 |
94 |
95 | - (CGSize)portraitFrameSize {
96 | return portraitFrameSize_;
97 | }
98 | - (void)setPortraitFrameSize:(CGSize)portraitFrameSize {
99 | portraitFrameSize_ = portraitFrameSize;
100 | [self layoutFrameView];
101 | }
102 |
103 |
104 | - (CGSize)landscapeFrameSize {
105 | return landscapeFrameSize_;
106 | }
107 | - (void)setLandscapeFrameSize:(CGSize)landscapeFrameSize {
108 | landscapeFrameSize_ = landscapeFrameSize;
109 | [self layoutFrameView];
110 | }
111 |
112 |
113 | - (UIColor*)frameColor {
114 | return [self.frameView baseColor];
115 | }
116 | - (void)setFrameColor:(UIColor*)frameColor {
117 | [self.frameView setBaseColor:frameColor];
118 | [self.contentOverlayView setEdgeColor:frameColor];
119 | [self.navigationController.navigationBar setTintColor:frameColor];
120 | }
121 |
122 |
123 | - (CQMFloatingMaskControl*)maskControl {
124 | if (maskControl_ == nil) {
125 | maskControl_ = [[CQMFloatingMaskControl alloc] init];
126 | [maskControl_ setBackgroundColor:kDefaultMaskColor];
127 | [maskControl_ setResizeDelegate:self];
128 | [maskControl_ addTarget:self
129 | action:@selector(maskControlDidTouchUpInside:)
130 | forControlEvents:UIControlEventTouchUpInside];
131 | }
132 | return maskControl_;
133 | }
134 |
135 |
136 | - (UIView*)frameView {
137 | if (frameView_ == nil) {
138 | frameView_ = [[CQMFloatingFrameView alloc] init];
139 | [frameView_.layer setShadowColor:[kShadowColor CGColor]];
140 | [frameView_.layer setShadowOffset:kShadowOffset];
141 | [frameView_.layer setShadowOpacity:kShadowOpacity];
142 | [frameView_.layer setShadowRadius:kShadowRadius];
143 | }
144 | return frameView_;
145 | }
146 |
147 |
148 | - (UIView*)contentView {
149 | if (contentView_ == nil) {
150 | contentView_ = [[UIView alloc] init];
151 | [contentView_ setClipsToBounds:YES];
152 | }
153 | return contentView_;
154 | }
155 |
156 |
157 | - (CQMFloatingContentOverlayView*)contentOverlayView {
158 | if (contentOverlayView_ == nil) {
159 | contentOverlayView_ = [[CQMFloatingContentOverlayView alloc] init];
160 | [contentOverlayView_ setUserInteractionEnabled:NO];
161 | }
162 | return contentOverlayView_;
163 | }
164 |
165 |
166 | - (UINavigationController*)navigationController {
167 | if (navController_ == nil) {
168 | UIViewController *dummy = [[UIViewController alloc] init];
169 | UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:dummy];
170 |
171 | // Archive navigation controller for changing navigationbar class
172 | [navController navigationBar];
173 | NSMutableData *data = [[NSMutableData alloc] init];
174 | NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
175 | [archiver encodeObject:navController forKey:kRootKey];
176 | [archiver finishEncoding];
177 |
178 | // Unarchive it with changing navigationbar class
179 | NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
180 | [unarchiver setClass:[CQMFloatingNavigationBar class]
181 | forClassName:NSStringFromClass([UINavigationBar class])];
182 | navController_ = [unarchiver decodeObjectForKey:kRootKey];
183 |
184 | }
185 | return navController_;
186 | }
187 |
188 |
189 | @synthesize shadowView = shadowView_;
190 |
191 |
192 | #pragma mark -
193 | #pragma mark Singleton
194 |
195 |
196 | + (CQMFloatingController*)sharedFloatingController {
197 | static CQMFloatingController *instance;
198 | static dispatch_once_t onceToken;
199 | dispatch_once(&onceToken, ^ {
200 | instance = [[CQMFloatingController alloc] init];
201 | });
202 | return instance;
203 | }
204 |
205 |
206 | #pragma mark -
207 |
208 |
209 | - (void)showInView:(UIView*)view withContentViewController:(UIViewController*)viewController animated:(BOOL)animated {
210 | @synchronized(self) {
211 | if (presented_) {
212 | return;
213 | }
214 | presented_ = YES;
215 | }
216 |
217 | [self.view setAlpha:0];
218 |
219 | if (contentViewController_ != viewController) {
220 | [[contentViewController_ view] removeFromSuperview];
221 | contentViewController_ = viewController;
222 |
223 | NSArray *viewControllers = [NSArray arrayWithObject:contentViewController_];
224 | [self.navigationController setViewControllers:viewControllers];
225 | }
226 |
227 | [self.view setFrame:[view bounds]];
228 | [view addSubview:[self view]];
229 |
230 | [self layoutFrameView];
231 |
232 | __block CQMFloatingController *me = self;
233 | [UIView animateWithDuration:(animated ? kAnimationDuration : 0)
234 | animations:
235 | ^(void) {
236 | [me.view setAlpha:1.0f];
237 | }];
238 | }
239 |
240 |
241 | - (void)dismissAnimated:(BOOL)animated {
242 | if (animated) {
243 | __block CQMFloatingController *me = self;
244 | [UIView animateWithDuration: kAnimationDuration
245 | animations:
246 | ^(void) {
247 | [me.view setAlpha:0];
248 | }
249 | completion:
250 | ^(BOOL finished) {
251 | if (finished) {
252 | [me.view removeFromSuperview];
253 | presented_ = NO;
254 | }
255 | }];
256 |
257 | } else {
258 | [self.view removeFromSuperview];
259 | presented_ = NO;
260 | }
261 | }
262 |
263 |
264 | - (void)layoutFrameView {
265 | // Frame
266 | CGSize maskSize = [self.maskControl frame].size;
267 | BOOL isPortrait = (maskSize.width <= maskSize.height);
268 | CGSize frameSize = isPortrait ? [self portraitFrameSize] : [self landscapeFrameSize];
269 | CGSize viewSize = [self.view frame].size;
270 | UIView *frameView = [self frameView];
271 | [frameView setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
272 | [frameView setFrame:CGRectMake(round((viewSize.width - frameSize.width) / 2),
273 | round((viewSize.height - frameSize.height) / 2),
274 | frameSize.width,
275 | frameSize.height)];
276 | [frameView setNeedsDisplay];
277 |
278 | // Content
279 | UIView *contentView = [self contentView];
280 | CGRect contentFrame = CGRectMake(kFramePadding, 0,
281 | frameSize.width - kFramePadding * 2,
282 | frameSize.height - kFramePadding);
283 | CGSize contentSize = contentFrame.size;
284 | [contentView setFrame:contentFrame];
285 |
286 | // Navigation
287 | UIView *navView = [self.navigationController view];
288 | CGFloat navBarHeight = [self.navigationController.navigationBar sizeThatFits:[contentView bounds].size].height;
289 | [navView setFrame:CGRectMake(0, 0,
290 | contentSize.width, contentSize.height)];
291 | [self.navigationController.navigationBar setFrame:CGRectMake(0, 0,
292 | contentSize.width, navBarHeight)];
293 |
294 | // Content overlay
295 | UIView *contentOverlay = [self contentOverlayView];
296 | CGFloat contentFrameWidth = [CQMFloatingContentOverlayView frameWidth];
297 | [contentOverlay setFrame:CGRectMake(contentFrame.origin.x - contentFrameWidth,
298 | contentFrame.origin.y + navBarHeight - contentFrameWidth,
299 | contentSize.width + contentFrameWidth * 2,
300 | contentSize.height - navBarHeight + contentFrameWidth * 2)];
301 | [contentOverlay setNeedsDisplay];
302 | [contentOverlay.superview bringSubviewToFront:contentOverlay];
303 |
304 | // Shadow
305 | CGFloat radius = [self.frameView cornerRadius];
306 | CGPathRef shadowPath = CQMPathCreateRoundingRect(CGRectMake(0, 0,
307 | frameSize.width, frameSize.height),
308 | radius, radius, radius, radius);
309 | [frameView.layer setShadowPath:shadowPath];
310 | CGPathRelease(shadowPath);
311 | }
312 |
313 |
314 | #pragma mark -
315 | #pragma mark Actions
316 |
317 |
318 | - (void)maskControlDidTouchUpInside:(id)sender {
319 | [self dismissAnimated:YES];
320 | }
321 |
322 |
323 | #pragma mark -
324 | #pragma mark Delegates
325 |
326 |
327 | - (void)floatingMaskControlDidResize:(CQMFloatingMaskControl*)maskControl {
328 | [self layoutFrameView];
329 | }
330 |
331 |
332 | #pragma mark -
333 | #pragma mark UIViewController
334 |
335 |
336 | - (void)viewDidLoad {
337 | [super viewDidLoad];
338 |
339 | [self.view setBackgroundColor:[UIColor clearColor]];
340 |
341 | UIView *maskControl = [self maskControl];
342 | CGSize viewSize = [self.view frame].size;
343 | [maskControl setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
344 | [maskControl setFrame:CGRectMake(0, 0,
345 | viewSize.width, viewSize.height)];
346 | [self.view addSubview:maskControl];
347 |
348 | [self.view addSubview:[self frameView]];
349 | [self.frameView addSubview:[self contentView]];
350 | [self.contentView addSubview:[self.navigationController view]];
351 | [self.frameView addSubview:[self contentOverlayView]];
352 | }
353 |
354 |
355 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
356 | return YES;
357 | }
358 |
359 |
360 | @end
361 |
--------------------------------------------------------------------------------
/CQMFloatingController.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 63BD792417910DC4005C4E33 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 63BD792317910DC4005C4E33 /* Default-568h@2x.png */; };
11 | F5455C8E156465C3009DD74D /* CQMFloatingNavigationBar.m in Sources */ = {isa = PBXBuildFile; fileRef = F5455C8B156465C3009DD74D /* CQMFloatingNavigationBar.m */; };
12 | F5455C8F156465C3009DD74D /* CQMPathUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = F5455C8D156465C3009DD74D /* CQMPathUtilities.m */; };
13 | F54E32A615620EE70057A34F /* CQMFloatingFrameView.m in Sources */ = {isa = PBXBuildFile; fileRef = F54E329B15620EE70057A34F /* CQMFloatingFrameView.m */; };
14 | F54E32A715620EE70057A34F /* CQMFloatingController.m in Sources */ = {isa = PBXBuildFile; fileRef = F54E329D15620EE70057A34F /* CQMFloatingController.m */; };
15 | F54E32AD15620F2F0057A34F /* CQMFloatingContentOverlayView.m in Sources */ = {isa = PBXBuildFile; fileRef = F54E32AC15620F2F0057A34F /* CQMFloatingContentOverlayView.m */; };
16 | F54E32B0156271030057A34F /* DemoTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F54E32AF156271030057A34F /* DemoTableViewController.m */; };
17 | F54E32B3156273780057A34F /* DemoDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F54E32B2156273780057A34F /* DemoDetailViewController.m */; };
18 | F5C422441560BF2300F7E3EE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C422431560BF2300F7E3EE /* UIKit.framework */; };
19 | F5C422461560BF2300F7E3EE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C422451560BF2300F7E3EE /* Foundation.framework */; };
20 | F5C422481560BF2300F7E3EE /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C422471560BF2300F7E3EE /* CoreGraphics.framework */; };
21 | F5C4224E1560BF2300F7E3EE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F5C4224C1560BF2300F7E3EE /* InfoPlist.strings */; };
22 | F5C4225C1560BF2400F7E3EE /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C4225B1560BF2400F7E3EE /* SenTestingKit.framework */; };
23 | F5C4225D1560BF2400F7E3EE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C422431560BF2300F7E3EE /* UIKit.framework */; };
24 | F5C4225E1560BF2400F7E3EE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C422451560BF2300F7E3EE /* Foundation.framework */; };
25 | F5C422661560BF2400F7E3EE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F5C422641560BF2400F7E3EE /* InfoPlist.strings */; };
26 | F5C422691560BF2400F7E3EE /* CQMFloatingControllerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F5C422681560BF2400F7E3EE /* CQMFloatingControllerTests.m */; };
27 | F5D47AF3157AEBD40064B7AF /* CQMFloatingMaskControl.m in Sources */ = {isa = PBXBuildFile; fileRef = F5D47AF2157AEBD40064B7AF /* CQMFloatingMaskControl.m */; };
28 | F5EB409B1579C0640033C162 /* DemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F5EB409A1579C0640033C162 /* DemoViewController.m */; };
29 | F5ED3EA315620A810058C7F1 /* CQMAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F5ED3EA015620A810058C7F1 /* CQMAppDelegate.m */; };
30 | F5ED3EA415620A810058C7F1 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F5ED3EA115620A810058C7F1 /* main.m */; };
31 | F5ED3EA515620A810058C7F1 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = F5ED3EA215620A810058C7F1 /* MainWindow.xib */; };
32 | /* End PBXBuildFile section */
33 |
34 | /* Begin PBXContainerItemProxy section */
35 | F5C4225F1560BF2400F7E3EE /* PBXContainerItemProxy */ = {
36 | isa = PBXContainerItemProxy;
37 | containerPortal = F5C422361560BF2300F7E3EE /* Project object */;
38 | proxyType = 1;
39 | remoteGlobalIDString = F5C4223E1560BF2300F7E3EE;
40 | remoteInfo = CQMFloatingController;
41 | };
42 | /* End PBXContainerItemProxy section */
43 |
44 | /* Begin PBXFileReference section */
45 | 63BD792317910DC4005C4E33 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; };
46 | 63BD792517910E4A005C4E33 /* CQMFloatingMaskControlDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CQMFloatingMaskControlDelegate.h; sourceTree = ""; };
47 | F5455C8A156465C3009DD74D /* CQMFloatingNavigationBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CQMFloatingNavigationBar.h; sourceTree = ""; };
48 | F5455C8B156465C3009DD74D /* CQMFloatingNavigationBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CQMFloatingNavigationBar.m; sourceTree = ""; };
49 | F5455C8C156465C3009DD74D /* CQMPathUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CQMPathUtilities.h; sourceTree = ""; };
50 | F5455C8D156465C3009DD74D /* CQMPathUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CQMPathUtilities.m; sourceTree = ""; };
51 | F54E329A15620EE70057A34F /* CQMFloatingFrameView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CQMFloatingFrameView.h; sourceTree = ""; };
52 | F54E329B15620EE70057A34F /* CQMFloatingFrameView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CQMFloatingFrameView.m; sourceTree = ""; };
53 | F54E329C15620EE70057A34F /* CQMFloatingController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CQMFloatingController.h; sourceTree = ""; };
54 | F54E329D15620EE70057A34F /* CQMFloatingController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CQMFloatingController.m; sourceTree = ""; };
55 | F54E32AB15620F2F0057A34F /* CQMFloatingContentOverlayView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CQMFloatingContentOverlayView.h; sourceTree = ""; };
56 | F54E32AC15620F2F0057A34F /* CQMFloatingContentOverlayView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CQMFloatingContentOverlayView.m; sourceTree = ""; };
57 | F54E32AE156271030057A34F /* DemoTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoTableViewController.h; sourceTree = ""; };
58 | F54E32AF156271030057A34F /* DemoTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoTableViewController.m; sourceTree = ""; };
59 | F54E32B1156273780057A34F /* DemoDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoDetailViewController.h; sourceTree = ""; };
60 | F54E32B2156273780057A34F /* DemoDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoDetailViewController.m; sourceTree = ""; };
61 | F5C4223F1560BF2300F7E3EE /* CQMFloatingController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CQMFloatingController.app; sourceTree = BUILT_PRODUCTS_DIR; };
62 | F5C422431560BF2300F7E3EE /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
63 | F5C422451560BF2300F7E3EE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
64 | F5C422471560BF2300F7E3EE /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
65 | F5C4224B1560BF2300F7E3EE /* CQMFloatingController-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CQMFloatingController-Info.plist"; sourceTree = ""; };
66 | F5C4224D1560BF2300F7E3EE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
67 | F5C422511560BF2300F7E3EE /* CQMFloatingController-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CQMFloatingController-Prefix.pch"; sourceTree = ""; };
68 | F5C4225A1560BF2400F7E3EE /* CQMFloatingControllerTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CQMFloatingControllerTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
69 | F5C4225B1560BF2400F7E3EE /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
70 | F5C422631560BF2400F7E3EE /* CQMFloatingControllerTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CQMFloatingControllerTests-Info.plist"; sourceTree = ""; };
71 | F5C422651560BF2400F7E3EE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
72 | F5C422671560BF2400F7E3EE /* CQMFloatingControllerTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CQMFloatingControllerTests.h; sourceTree = ""; };
73 | F5C422681560BF2400F7E3EE /* CQMFloatingControllerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CQMFloatingControllerTests.m; sourceTree = ""; };
74 | F5D47AF1157AEBD40064B7AF /* CQMFloatingMaskControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CQMFloatingMaskControl.h; sourceTree = ""; };
75 | F5D47AF2157AEBD40064B7AF /* CQMFloatingMaskControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CQMFloatingMaskControl.m; sourceTree = ""; };
76 | F5EB40991579C0640033C162 /* DemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoViewController.h; sourceTree = ""; };
77 | F5EB409A1579C0640033C162 /* DemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoViewController.m; sourceTree = ""; };
78 | F5ED3E9F15620A810058C7F1 /* CQMAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CQMAppDelegate.h; sourceTree = ""; };
79 | F5ED3EA015620A810058C7F1 /* CQMAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CQMAppDelegate.m; sourceTree = ""; };
80 | F5ED3EA115620A810058C7F1 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
81 | F5ED3EA215620A810058C7F1 /* MainWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; };
82 | /* End PBXFileReference section */
83 |
84 | /* Begin PBXFrameworksBuildPhase section */
85 | F5C4223C1560BF2300F7E3EE /* Frameworks */ = {
86 | isa = PBXFrameworksBuildPhase;
87 | buildActionMask = 2147483647;
88 | files = (
89 | F5C422441560BF2300F7E3EE /* UIKit.framework in Frameworks */,
90 | F5C422461560BF2300F7E3EE /* Foundation.framework in Frameworks */,
91 | F5C422481560BF2300F7E3EE /* CoreGraphics.framework in Frameworks */,
92 | );
93 | runOnlyForDeploymentPostprocessing = 0;
94 | };
95 | F5C422561560BF2400F7E3EE /* Frameworks */ = {
96 | isa = PBXFrameworksBuildPhase;
97 | buildActionMask = 2147483647;
98 | files = (
99 | F5C4225C1560BF2400F7E3EE /* SenTestingKit.framework in Frameworks */,
100 | F5C4225D1560BF2400F7E3EE /* UIKit.framework in Frameworks */,
101 | F5C4225E1560BF2400F7E3EE /* Foundation.framework in Frameworks */,
102 | );
103 | runOnlyForDeploymentPostprocessing = 0;
104 | };
105 | /* End PBXFrameworksBuildPhase section */
106 |
107 | /* Begin PBXGroup section */
108 | F54E329915620EE70057A34F /* Classes */ = {
109 | isa = PBXGroup;
110 | children = (
111 | F5455C8C156465C3009DD74D /* CQMPathUtilities.h */,
112 | F5455C8D156465C3009DD74D /* CQMPathUtilities.m */,
113 | F54E329A15620EE70057A34F /* CQMFloatingFrameView.h */,
114 | F54E329B15620EE70057A34F /* CQMFloatingFrameView.m */,
115 | F5455C8A156465C3009DD74D /* CQMFloatingNavigationBar.h */,
116 | F5455C8B156465C3009DD74D /* CQMFloatingNavigationBar.m */,
117 | F54E32AB15620F2F0057A34F /* CQMFloatingContentOverlayView.h */,
118 | F54E32AC15620F2F0057A34F /* CQMFloatingContentOverlayView.m */,
119 | F54E329C15620EE70057A34F /* CQMFloatingController.h */,
120 | F54E329D15620EE70057A34F /* CQMFloatingController.m */,
121 | F5D47AF1157AEBD40064B7AF /* CQMFloatingMaskControl.h */,
122 | F5D47AF2157AEBD40064B7AF /* CQMFloatingMaskControl.m */,
123 | 63BD792517910E4A005C4E33 /* CQMFloatingMaskControlDelegate.h */,
124 | );
125 | path = Classes;
126 | sourceTree = "";
127 | };
128 | F5C422341560BF2300F7E3EE = {
129 | isa = PBXGroup;
130 | children = (
131 | 63BD792317910DC4005C4E33 /* Default-568h@2x.png */,
132 | F5C422491560BF2300F7E3EE /* CQMFloatingController */,
133 | F5C422611560BF2400F7E3EE /* CQMFloatingControllerTests */,
134 | F5C422421560BF2300F7E3EE /* Frameworks */,
135 | F5C422401560BF2300F7E3EE /* Products */,
136 | );
137 | sourceTree = "";
138 | };
139 | F5C422401560BF2300F7E3EE /* Products */ = {
140 | isa = PBXGroup;
141 | children = (
142 | F5C4223F1560BF2300F7E3EE /* CQMFloatingController.app */,
143 | F5C4225A1560BF2400F7E3EE /* CQMFloatingControllerTests.octest */,
144 | );
145 | name = Products;
146 | sourceTree = "";
147 | };
148 | F5C422421560BF2300F7E3EE /* Frameworks */ = {
149 | isa = PBXGroup;
150 | children = (
151 | F5C422431560BF2300F7E3EE /* UIKit.framework */,
152 | F5C422451560BF2300F7E3EE /* Foundation.framework */,
153 | F5C422471560BF2300F7E3EE /* CoreGraphics.framework */,
154 | F5C4225B1560BF2400F7E3EE /* SenTestingKit.framework */,
155 | );
156 | name = Frameworks;
157 | sourceTree = "";
158 | };
159 | F5C422491560BF2300F7E3EE /* CQMFloatingController */ = {
160 | isa = PBXGroup;
161 | children = (
162 | F54E329915620EE70057A34F /* Classes */,
163 | F5ED3E9E15620A810058C7F1 /* Demo */,
164 | F5C4224A1560BF2300F7E3EE /* Supporting Files */,
165 | );
166 | path = CQMFloatingController;
167 | sourceTree = "";
168 | };
169 | F5C4224A1560BF2300F7E3EE /* Supporting Files */ = {
170 | isa = PBXGroup;
171 | children = (
172 | F5C4224B1560BF2300F7E3EE /* CQMFloatingController-Info.plist */,
173 | F5C4224C1560BF2300F7E3EE /* InfoPlist.strings */,
174 | F5C422511560BF2300F7E3EE /* CQMFloatingController-Prefix.pch */,
175 | );
176 | name = "Supporting Files";
177 | sourceTree = "";
178 | };
179 | F5C422611560BF2400F7E3EE /* CQMFloatingControllerTests */ = {
180 | isa = PBXGroup;
181 | children = (
182 | F5C422671560BF2400F7E3EE /* CQMFloatingControllerTests.h */,
183 | F5C422681560BF2400F7E3EE /* CQMFloatingControllerTests.m */,
184 | F5C422621560BF2400F7E3EE /* Supporting Files */,
185 | );
186 | path = CQMFloatingControllerTests;
187 | sourceTree = "";
188 | };
189 | F5C422621560BF2400F7E3EE /* Supporting Files */ = {
190 | isa = PBXGroup;
191 | children = (
192 | F5C422631560BF2400F7E3EE /* CQMFloatingControllerTests-Info.plist */,
193 | F5C422641560BF2400F7E3EE /* InfoPlist.strings */,
194 | );
195 | name = "Supporting Files";
196 | sourceTree = "";
197 | };
198 | F5ED3E9E15620A810058C7F1 /* Demo */ = {
199 | isa = PBXGroup;
200 | children = (
201 | F5ED3E9F15620A810058C7F1 /* CQMAppDelegate.h */,
202 | F5ED3EA015620A810058C7F1 /* CQMAppDelegate.m */,
203 | F5ED3EA115620A810058C7F1 /* main.m */,
204 | F5ED3EA215620A810058C7F1 /* MainWindow.xib */,
205 | F54E32AE156271030057A34F /* DemoTableViewController.h */,
206 | F54E32AF156271030057A34F /* DemoTableViewController.m */,
207 | F54E32B1156273780057A34F /* DemoDetailViewController.h */,
208 | F54E32B2156273780057A34F /* DemoDetailViewController.m */,
209 | F5EB40991579C0640033C162 /* DemoViewController.h */,
210 | F5EB409A1579C0640033C162 /* DemoViewController.m */,
211 | );
212 | path = Demo;
213 | sourceTree = "";
214 | };
215 | /* End PBXGroup section */
216 |
217 | /* Begin PBXNativeTarget section */
218 | F5C4223E1560BF2300F7E3EE /* CQMFloatingController */ = {
219 | isa = PBXNativeTarget;
220 | buildConfigurationList = F5C4226C1560BF2400F7E3EE /* Build configuration list for PBXNativeTarget "CQMFloatingController" */;
221 | buildPhases = (
222 | F5C4223B1560BF2300F7E3EE /* Sources */,
223 | F5C4223C1560BF2300F7E3EE /* Frameworks */,
224 | F5C4223D1560BF2300F7E3EE /* Resources */,
225 | );
226 | buildRules = (
227 | );
228 | dependencies = (
229 | );
230 | name = CQMFloatingController;
231 | productName = CQMFloatingController;
232 | productReference = F5C4223F1560BF2300F7E3EE /* CQMFloatingController.app */;
233 | productType = "com.apple.product-type.application";
234 | };
235 | F5C422591560BF2400F7E3EE /* CQMFloatingControllerTests */ = {
236 | isa = PBXNativeTarget;
237 | buildConfigurationList = F5C4226F1560BF2400F7E3EE /* Build configuration list for PBXNativeTarget "CQMFloatingControllerTests" */;
238 | buildPhases = (
239 | F5C422551560BF2400F7E3EE /* Sources */,
240 | F5C422561560BF2400F7E3EE /* Frameworks */,
241 | F5C422571560BF2400F7E3EE /* Resources */,
242 | F5C422581560BF2400F7E3EE /* ShellScript */,
243 | );
244 | buildRules = (
245 | );
246 | dependencies = (
247 | F5C422601560BF2400F7E3EE /* PBXTargetDependency */,
248 | );
249 | name = CQMFloatingControllerTests;
250 | productName = CQMFloatingControllerTests;
251 | productReference = F5C4225A1560BF2400F7E3EE /* CQMFloatingControllerTests.octest */;
252 | productType = "com.apple.product-type.bundle";
253 | };
254 | /* End PBXNativeTarget section */
255 |
256 | /* Begin PBXProject section */
257 | F5C422361560BF2300F7E3EE /* Project object */ = {
258 | isa = PBXProject;
259 | attributes = {
260 | CLASSPREFIX = CQM;
261 | LastUpgradeCheck = 0430;
262 | };
263 | buildConfigurationList = F5C422391560BF2300F7E3EE /* Build configuration list for PBXProject "CQMFloatingController" */;
264 | compatibilityVersion = "Xcode 3.2";
265 | developmentRegion = English;
266 | hasScannedForEncodings = 0;
267 | knownRegions = (
268 | en,
269 | );
270 | mainGroup = F5C422341560BF2300F7E3EE;
271 | productRefGroup = F5C422401560BF2300F7E3EE /* Products */;
272 | projectDirPath = "";
273 | projectRoot = "";
274 | targets = (
275 | F5C4223E1560BF2300F7E3EE /* CQMFloatingController */,
276 | F5C422591560BF2400F7E3EE /* CQMFloatingControllerTests */,
277 | );
278 | };
279 | /* End PBXProject section */
280 |
281 | /* Begin PBXResourcesBuildPhase section */
282 | F5C4223D1560BF2300F7E3EE /* Resources */ = {
283 | isa = PBXResourcesBuildPhase;
284 | buildActionMask = 2147483647;
285 | files = (
286 | F5C4224E1560BF2300F7E3EE /* InfoPlist.strings in Resources */,
287 | F5ED3EA515620A810058C7F1 /* MainWindow.xib in Resources */,
288 | 63BD792417910DC4005C4E33 /* Default-568h@2x.png in Resources */,
289 | );
290 | runOnlyForDeploymentPostprocessing = 0;
291 | };
292 | F5C422571560BF2400F7E3EE /* Resources */ = {
293 | isa = PBXResourcesBuildPhase;
294 | buildActionMask = 2147483647;
295 | files = (
296 | F5C422661560BF2400F7E3EE /* InfoPlist.strings in Resources */,
297 | );
298 | runOnlyForDeploymentPostprocessing = 0;
299 | };
300 | /* End PBXResourcesBuildPhase section */
301 |
302 | /* Begin PBXShellScriptBuildPhase section */
303 | F5C422581560BF2400F7E3EE /* ShellScript */ = {
304 | isa = PBXShellScriptBuildPhase;
305 | buildActionMask = 2147483647;
306 | files = (
307 | );
308 | inputPaths = (
309 | );
310 | outputPaths = (
311 | );
312 | runOnlyForDeploymentPostprocessing = 0;
313 | shellPath = /bin/sh;
314 | shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
315 | };
316 | /* End PBXShellScriptBuildPhase section */
317 |
318 | /* Begin PBXSourcesBuildPhase section */
319 | F5C4223B1560BF2300F7E3EE /* Sources */ = {
320 | isa = PBXSourcesBuildPhase;
321 | buildActionMask = 2147483647;
322 | files = (
323 | F5ED3EA315620A810058C7F1 /* CQMAppDelegate.m in Sources */,
324 | F5ED3EA415620A810058C7F1 /* main.m in Sources */,
325 | F54E32A615620EE70057A34F /* CQMFloatingFrameView.m in Sources */,
326 | F54E32A715620EE70057A34F /* CQMFloatingController.m in Sources */,
327 | F54E32AD15620F2F0057A34F /* CQMFloatingContentOverlayView.m in Sources */,
328 | F54E32B0156271030057A34F /* DemoTableViewController.m in Sources */,
329 | F54E32B3156273780057A34F /* DemoDetailViewController.m in Sources */,
330 | F5455C8E156465C3009DD74D /* CQMFloatingNavigationBar.m in Sources */,
331 | F5455C8F156465C3009DD74D /* CQMPathUtilities.m in Sources */,
332 | F5EB409B1579C0640033C162 /* DemoViewController.m in Sources */,
333 | F5D47AF3157AEBD40064B7AF /* CQMFloatingMaskControl.m in Sources */,
334 | );
335 | runOnlyForDeploymentPostprocessing = 0;
336 | };
337 | F5C422551560BF2400F7E3EE /* Sources */ = {
338 | isa = PBXSourcesBuildPhase;
339 | buildActionMask = 2147483647;
340 | files = (
341 | F5C422691560BF2400F7E3EE /* CQMFloatingControllerTests.m in Sources */,
342 | );
343 | runOnlyForDeploymentPostprocessing = 0;
344 | };
345 | /* End PBXSourcesBuildPhase section */
346 |
347 | /* Begin PBXTargetDependency section */
348 | F5C422601560BF2400F7E3EE /* PBXTargetDependency */ = {
349 | isa = PBXTargetDependency;
350 | target = F5C4223E1560BF2300F7E3EE /* CQMFloatingController */;
351 | targetProxy = F5C4225F1560BF2400F7E3EE /* PBXContainerItemProxy */;
352 | };
353 | /* End PBXTargetDependency section */
354 |
355 | /* Begin PBXVariantGroup section */
356 | F5C4224C1560BF2300F7E3EE /* InfoPlist.strings */ = {
357 | isa = PBXVariantGroup;
358 | children = (
359 | F5C4224D1560BF2300F7E3EE /* en */,
360 | );
361 | name = InfoPlist.strings;
362 | sourceTree = "";
363 | };
364 | F5C422641560BF2400F7E3EE /* InfoPlist.strings */ = {
365 | isa = PBXVariantGroup;
366 | children = (
367 | F5C422651560BF2400F7E3EE /* en */,
368 | );
369 | name = InfoPlist.strings;
370 | sourceTree = "";
371 | };
372 | /* End PBXVariantGroup section */
373 |
374 | /* Begin XCBuildConfiguration section */
375 | F5C4226A1560BF2400F7E3EE /* Debug */ = {
376 | isa = XCBuildConfiguration;
377 | buildSettings = {
378 | ALWAYS_SEARCH_USER_PATHS = NO;
379 | ARCHS = "$(ARCHS_STANDARD_32_BIT)";
380 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
381 | COPY_PHASE_STRIP = NO;
382 | GCC_C_LANGUAGE_STANDARD = gnu99;
383 | GCC_DYNAMIC_NO_PIC = NO;
384 | GCC_OPTIMIZATION_LEVEL = 0;
385 | GCC_PREPROCESSOR_DEFINITIONS = (
386 | "DEBUG=1",
387 | "$(inherited)",
388 | );
389 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
390 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
391 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
392 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
393 | GCC_WARN_UNUSED_VARIABLE = YES;
394 | IPHONEOS_DEPLOYMENT_TARGET = 5.1;
395 | SDKROOT = iphoneos;
396 | };
397 | name = Debug;
398 | };
399 | F5C4226B1560BF2400F7E3EE /* Release */ = {
400 | isa = XCBuildConfiguration;
401 | buildSettings = {
402 | ALWAYS_SEARCH_USER_PATHS = NO;
403 | ARCHS = "$(ARCHS_STANDARD_32_BIT)";
404 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
405 | COPY_PHASE_STRIP = YES;
406 | GCC_C_LANGUAGE_STANDARD = gnu99;
407 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
408 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
409 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
410 | GCC_WARN_UNUSED_VARIABLE = YES;
411 | IPHONEOS_DEPLOYMENT_TARGET = 5.1;
412 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
413 | SDKROOT = iphoneos;
414 | VALIDATE_PRODUCT = YES;
415 | };
416 | name = Release;
417 | };
418 | F5C4226D1560BF2400F7E3EE /* Debug */ = {
419 | isa = XCBuildConfiguration;
420 | buildSettings = {
421 | ARCHS = (
422 | armv6,
423 | armv7,
424 | );
425 | CLANG_ENABLE_OBJC_ARC = YES;
426 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
427 | GCC_PREFIX_HEADER = "CQMFloatingController/CQMFloatingController-Prefix.pch";
428 | INFOPLIST_FILE = "CQMFloatingController/CQMFloatingController-Info.plist";
429 | IPHONEOS_DEPLOYMENT_TARGET = 5.1;
430 | PRODUCT_NAME = "$(TARGET_NAME)";
431 | WRAPPER_EXTENSION = app;
432 | };
433 | name = Debug;
434 | };
435 | F5C4226E1560BF2400F7E3EE /* Release */ = {
436 | isa = XCBuildConfiguration;
437 | buildSettings = {
438 | ARCHS = (
439 | armv6,
440 | armv7,
441 | );
442 | CLANG_ENABLE_OBJC_ARC = YES;
443 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
444 | GCC_PREFIX_HEADER = "CQMFloatingController/CQMFloatingController-Prefix.pch";
445 | INFOPLIST_FILE = "CQMFloatingController/CQMFloatingController-Info.plist";
446 | IPHONEOS_DEPLOYMENT_TARGET = 5.1;
447 | PRODUCT_NAME = "$(TARGET_NAME)";
448 | WRAPPER_EXTENSION = app;
449 | };
450 | name = Release;
451 | };
452 | F5C422701560BF2400F7E3EE /* Debug */ = {
453 | isa = XCBuildConfiguration;
454 | buildSettings = {
455 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/CQMFloatingController.app/CQMFloatingController";
456 | CLANG_ENABLE_OBJC_ARC = YES;
457 | FRAMEWORK_SEARCH_PATHS = (
458 | "$(SDKROOT)/Developer/Library/Frameworks",
459 | "$(DEVELOPER_LIBRARY_DIR)/Frameworks",
460 | );
461 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
462 | GCC_PREFIX_HEADER = "CQMFloatingController/CQMFloatingController-Prefix.pch";
463 | INFOPLIST_FILE = "CQMFloatingControllerTests/CQMFloatingControllerTests-Info.plist";
464 | PRODUCT_NAME = "$(TARGET_NAME)";
465 | TEST_HOST = "$(BUNDLE_LOADER)";
466 | WRAPPER_EXTENSION = octest;
467 | };
468 | name = Debug;
469 | };
470 | F5C422711560BF2400F7E3EE /* Release */ = {
471 | isa = XCBuildConfiguration;
472 | buildSettings = {
473 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/CQMFloatingController.app/CQMFloatingController";
474 | CLANG_ENABLE_OBJC_ARC = YES;
475 | FRAMEWORK_SEARCH_PATHS = (
476 | "$(SDKROOT)/Developer/Library/Frameworks",
477 | "$(DEVELOPER_LIBRARY_DIR)/Frameworks",
478 | );
479 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
480 | GCC_PREFIX_HEADER = "CQMFloatingController/CQMFloatingController-Prefix.pch";
481 | INFOPLIST_FILE = "CQMFloatingControllerTests/CQMFloatingControllerTests-Info.plist";
482 | PRODUCT_NAME = "$(TARGET_NAME)";
483 | TEST_HOST = "$(BUNDLE_LOADER)";
484 | WRAPPER_EXTENSION = octest;
485 | };
486 | name = Release;
487 | };
488 | /* End XCBuildConfiguration section */
489 |
490 | /* Begin XCConfigurationList section */
491 | F5C422391560BF2300F7E3EE /* Build configuration list for PBXProject "CQMFloatingController" */ = {
492 | isa = XCConfigurationList;
493 | buildConfigurations = (
494 | F5C4226A1560BF2400F7E3EE /* Debug */,
495 | F5C4226B1560BF2400F7E3EE /* Release */,
496 | );
497 | defaultConfigurationIsVisible = 0;
498 | defaultConfigurationName = Release;
499 | };
500 | F5C4226C1560BF2400F7E3EE /* Build configuration list for PBXNativeTarget "CQMFloatingController" */ = {
501 | isa = XCConfigurationList;
502 | buildConfigurations = (
503 | F5C4226D1560BF2400F7E3EE /* Debug */,
504 | F5C4226E1560BF2400F7E3EE /* Release */,
505 | );
506 | defaultConfigurationIsVisible = 0;
507 | defaultConfigurationName = Release;
508 | };
509 | F5C4226F1560BF2400F7E3EE /* Build configuration list for PBXNativeTarget "CQMFloatingControllerTests" */ = {
510 | isa = XCConfigurationList;
511 | buildConfigurations = (
512 | F5C422701560BF2400F7E3EE /* Debug */,
513 | F5C422711560BF2400F7E3EE /* Release */,
514 | );
515 | defaultConfigurationIsVisible = 0;
516 | defaultConfigurationName = Release;
517 | };
518 | /* End XCConfigurationList section */
519 | };
520 | rootObject = F5C422361560BF2300F7E3EE /* Project object */;
521 | }
522 |
--------------------------------------------------------------------------------