Skip to content

Swift 版好用的图片浏览器 单独封装 支持Kingfisher,支持WebP动画流畅,使用简单,更加符合Swift的风格

License

Notifications You must be signed in to change notification settings

AnRanScheme/MagiPhotoBrowser

Repository files navigation

MagiPhotoBrowser

PhotoBrowser is a highly customizable UI component, which is inherited from wechat.

Commit Bug . Commit Question



CI Status Version License Platform Email


With MagiPhotoBrowser, You can easily achieve these!

- Feature Description
1 Default style You can get system-like style by initializing the TabBar with MagiTabBarController directly.

UITabBarController style:

System native style

MagiTabBarController default style:

Magi system-like style
2 Default style with "More" item If the items are more than the maximum number of displays, there will be a "More" item.

UITabBarController with "More":

enter image description here

EMagiTabBarController with "More":

enter image description here
3 Mix UITabBarItem and MagiTabBarItem You can set any item as you want, including UITabBarItem and MagiTabBarItem.

MagiTabBar and UITabBar mixed style:

enter image description here

MagiTabBar and UITabBar mixed style with "More":

enter image description here
4 UIKit attributes MagiTabBarController is compatible with UITabBarController, UITabBar and UITabBarItem's most API attributes. You can migrate to MagiTabBarController without any modification of the origin code.

Compatible with UITabBarController's selectedIndex:

enter image description here
5 Any nesting with UINavigationController Developing withUITabBarController, there are two common ways to handle layers:

First :

├── UITabBarController

└──── UINavigationController

└────── UIViewController

└──────── SubviewControllers

Second :

├── UINavigationController

└──── UITabBarController

└────── UIViewController

└──────── SubviewControllers

In the first case, need to set hidesBottomBarWhenPushed = true when pushing subViews. The second is not.

In MagiTabBarController, add Container views to UITabBar to be compatible with these two ways。
6 Customizable style With MagiTabBarController, you can:

1. Customize selected item's color and style:

enter image description here

2. Add selecting animation:

enter image description here

3. Customize item's background color:

enter image description here

4. Add highlight animation:

enter image description here

5. Add animation to prompt users:

enter image description here

6. And much more ...

7 Customizable item's size

Customizable click event
You can easily customize item's size using MagiTabBarController.

When the button's frame is larger than TabBar, through the use of HitTest to achieve making outer TabBar area click valid.

In addition, MagiTabBarController can customize click event, and through a block to callback super-layer to handle.

With big item in the middle of TabBar:

enter image description here

With a special hint style:

enter image description here

Customize click event:

enter image description here
8 Default notification style You can get system-like notification style by initializing the TabBar with MagiTabBarController directly.

UITabBarController notification style:

enter image description here

MagiTabBarController system-like notification style:

enter image description here
9 Customizable notification style With MagiTabBarController, you can:

1. Customize notification animation:

enter image description here

enter image description here

2. Customize prompt style:

enter image description here

3. And much more ...

10 Lottie Through customizing ContentView, you are able to add Lottie's LAAnimationView to Item(s)

enter image description here

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Xcode 8 or later
  • iOS 8.0 or later
  • ARC
  • Swift 3 or later

Installation

MagiPhotoBrowser is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'MagiPhotoBrowser'

Manually

git clone https://github.com/AnRanScheme/MagiPhotoBrowser.git
open MagiPhotoBrowser

Author

AnRanScheme, 541437674@qq.com

License

The MIT License (MIT)

Copyright (c) 2013-2016 eggswift. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Swift 版好用的图片浏览器 单独封装 支持Kingfisher,支持WebP动画流畅,使用简单,更加符合Swift的风格

Resources

License

Stars

Watchers

Forks

Packages

No packages published