Cover image
Try Now
2014-08-25

具有模糊背景和屏幕边缘激活手势的iOS的插入面板控制。

3 years

Works with Finder

21

Github Watches

25

Github Forks

322

Github Stars

MCPanelViewController

Drop-in panel control for iOS with blurring background and screen-edge activation gestures.

##Screenshot Screenshot

Installation

Add the following to your CocoaPods Podfile

pod 'MCPanelViewController'

or clone as a git submodule,

or just copy files in the MCPanelViewController folder into your project.

Using MCPanelViewController

First, setup your view controller to display within the panel view controller, then instantiate MCPanelViewController like this:

UIViewController *controller = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"LightPanelViewControllerInNavigationController"];

MCPanelViewController *panelController = [[MCPanelViewController alloc] initWithRootViewController:controller];

or using the convenience method on UIViewController:

MCPanelViewController *panelController = [controller viewControllerInPanelViewController];

Adjust preferredContentSize on your view controller to set the desired width of the panel (default is 320 points). The height is ignored:

controller.preferredContentSize = CGSizeMake(440, 0);

To open the panel programatically, such as from a button:

[panelController presentInViewController:self.navigationController withDirection:MCPanelAnimationDirectionRight];

or using the convenience method on UIViewController:

[self.navigationController presentPanelViewController:panelController withDirection:MCPanelAnimationDirectionRight];

You may also use MCPanelAnimationDirectionLeft. Present the controller in a full-screen view controller, such as a top-level navigation controller.

Dismiss from the presented view controller like this:

[self.panelViewController dismiss];

Optional Configuration

Turn off the background masking effect:

panelController.masking = NO;

Turn off pan gesture on the panel:

panelController.panningEnabled = NO;

Adjust background style of the panel:

panelController.backgroundStyle = MCPanelBackgroundStyleTinted;
panelController.tintColor = [UIColor colorWithRed:0.7 green:0.7 blue:1 alpha:1];

You can also use background styles MCPanelBackgroundStyleLight, MCPanelBackgroundStyleExtraLight and MCPanelBackgroundStyleDark to match iOS 7 built-in styles. tintColor property is ignored if style is not MCPanelBackgroundStyleTinted.

Screen Edge Gestures

To configure a screen-edge gesture on your top-level view controller, use the following convenience methods on UIViewController:

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];

    [self.navigationController addGestureRecognizerToViewForScreenEdgeGestureWithPanelViewController:panelController withDirection:MCPanelAnimationDirectionRight];
}

- (void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];

    [self.navigationController removeGestureRecognizersFromViewForScreenEdgeGestureWithPanelViewController:panelController];
}

License

MCPanelViewController is under the MIT license.

相关推荐

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • Beria Joey
  • 你的职业规划师,不走弯路就问我。Sponsor:小红书“ ItsJoe就出行 ”

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • GeyserMC
  • 与Minecraft客户端/服务器通信的库。

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • awslabs
  • AWS MCP服务器 - 将AWS最佳实践直接带入您的开发工作流程的专门MCP服务器

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • appcypher
  • 很棒的MCP服务器 - 模型上下文协议服务器的策划列表

  • GLips
  • MCP服务器向像光标这样的AI编码代理提供FIGMA布局信息

  • idosal
  • 结束幻觉! GITMCP是任何GitHub项目的免费,开源的远程MCP服务器

    Reviews

    5 (1)
    Avatar
    user_CMrYnZvE
    2025-04-17

    I've been using MCPanelViewController and it's fantastic. The seamless integration and the ease-of-use it offers are incredible. Kudos to Matthew Cheok for creating such a powerful tool. If you're looking for a reliable and efficient view controller, this is it. Highly recommended!