PAPlaceholder 0.3

PAPlaceholder 0.3

测试已测试
语言语言 Obj-CObjective C
许可证 BSD
发布上次发布2014年12月

Denis HennessyDenis Hennessy维护。



  • 作者
  • Denis Hennessy

当您在开发新的应用程序时,有时候从占位视图开始然后逐渐替换它们更容易。而不是使用简单的UIView,PAPlaceholder提供了一个看起来更好的占位视图,可以显示其尺寸和可选标题。

它还提供了一个占位视图控制器,它将自动创建占位视图。当您使用视图容器,如UITabBarControllerUISplitViewController时,这很有用。

screen1 screen2

在iOS 7的早期阶段使用这个尤其有用,因为在iOS 7中,许多系统视图(如导航栏或标签栏)实际上是透明的,内容视图延伸到它们后面。PAPlaceholderView上的箭头显示了视图的边缘,您可以根据需要确定边缘。

将PAPlaceholder添加到您的项目中

将PAPlaceholder添加到项目的最简单方法就是使用CocoaPods。只需将以下行添加到您的Podfile中

    pod 'PAPlaceholder'

如果您更喜欢手动集成,只需将PAPlaceholder/*.{m,h}复制到您的项目中。

使用代码创建占位视图

您可以在可以使用UIView的地方使用PAPlaceholderView。例如,在loadView

- (void)loadView {
    self.view = [[PAPlaceholderView alloc] initWithFrame:[UIScreen mainScreen].bounds];
}

在Storyboard或XIB中创建占位视图

只需将UIView拖动到视图中,然后将类更改为PAPlaceholderView。或者拖动到UIViewController上,然后将类更改为PAPlaceholderViewController。包含的示例项目在Storyboard中展示了这一点。

变更日志

0.2

  • 为PAPlaceholderView.*添加了Mac OS X支持

0.1

  • 初始发布

联系

想要了解此库和其他库的更新,请关注我的Twitter(@denishennessy)或App.net(@denishennessy)。

如果您遇到错误,或者想到了一个极好的新功能,那么在GitHub上打开一个问题可能是分享的最佳方式。实际上,最佳方式是向我发送一个pull request...

对于其他任何事情,电子邮件始终有效: [email protected]

许可证(BSD)

Copyright (c) 2014, Denis Hennessy (Peer Assembly - http://peerassembly.com)
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of Peer Assembly, Denis Hennessy nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL PEER ASSEMBLY OR DENIS HENNESSY BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.