• Stars
    star
    436
  • Rank 99,877 (Top 2 %)
  • Language
    Swift
  • License
    MIT License
  • Created almost 9 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

loading views

STLoadingGroup

A Group of Loading Animations.

STLoadingGroup

ScreenShot

Usage

let loadingGroup = let loadingGroup = STLoadingGroup(side: side, style: style)
loadingGroup.show(inView: view)
loadingGroup.startLoading()
// stop:  loadnigGroup.stopLoading()

Custom

If you want to add your own loading:

​ 1.Comfirm STLoadingable and STLoadingConfigable protocol and implement required functions (there is a isLoading property left)

protocol STLoadingable {
    var isLoading: Bool { get }
    
    func startLoading()
    func stopLoading()
}

protocol STLoadingConfig {
    var animationDuration: TimeInterval { get }
    var lineWidth: CGFloat { get }
    var loadingTintColor: UIColor { get }
}

​ 2.Append your loading style to STLoadingStyle in STLoadingGroup.swift file

enum STLoadingStyle: String {
    case submit = "submit"
    case glasses = "glasses"
    case walk = "walk"
    case arch = "arch"
    case bouncyPreloader = "bouncyPreloader"
    case zhihu = "zhihu"
    case triangle = "triangle"
    case pacMan = "pac man"
}

​ 3.Add initializer for your loading: case .yourStyle: in STLoadingGroup

class STLoadingGroup {
    fileprivate let loadingView: STLoadingable
    
    init(side: CGFloat, style: STLoadingStyle) {
        
        let bounds = CGRect(origin: .zero, size: CGSize(width: side, height: side))
        switch style {
        case .submit:
            loadingView = STSubmitLoading(frame: bounds)
        case .glasses:
            loadingView = STGlassesLoading(frame: bounds)
        case .walk:
            loadingView = STWalkLoading(frame: bounds)
        case .arch:
            loadingView = STArchLoading(frame: bounds)
        case .bouncyPreloader:
            loadingView = STBouncyPreloaderLoading(frame: bounds)
        case .zhihu:
            loadingView = STZhiHuLoading(frame: bounds)
        case .triangle:
            loadingView = STTriangleLoading(frame: bounds)
        case .pacMan:
            loadingView = STPacManLoading(frame: bounds)
        // insert your code here
        }
    }
}

Thanks

.glasses

Designed by : bingbing. Dribbble link : click me !

.walk

Designed by : sandeep virk. Dribbble link : click me !

.arch

Designed by : John LaPrime. Dribbble link : click me !

.bouncyPreloader

Designed by : Joash Berkeley. Dribbble link : click me !

.submit

Loading animation in submit button.

.zhiHu

Designed by : ZhiHu daily.

.triangle

I found on web.

.pacMan

Designed by : Dave Whyte

MIT LICENSE


The MIT License (MIT)

Copyright (c) 2016 saitjr

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.

More Repositories

1

STColorfulTabBar

彩色的TabBar,加平滑的切换动画
Objective-C
170
star
2

STLoopProgressView

环形渐变进度条
Objective-C
152
star
3

ReactiveCocoa-MVVM-AFNetworking-FMDB

ReactiveCocoa-MVVM-AFNetworking-FMDB小项目框架设计
Objective-C
151
star
4

C-Toturials

C语言教程
HTML
73
star
5

WKWebViewSimpleDemo

iOS8中WebKit库中的WKWebView简单使用方法,包括初始化,最基础的代理方法,以及JS加载。
Objective-C
64
star
6

10000-Animations

10000 Animations
Swift
62
star
7

STTinyPNG-Python

TinyPNG 批量压缩图片脚本
Python
61
star
8

STBLETool

Bluetooth Low Energy Tool
Objective-C
33
star
9

HappyLayerFriends

HappyLayerFriends
Swift
24
star
10

MasonryDemo

自动布局Masonry案例
Objective-C
24
star
11

STShareTool

常见的社会化分享,包含(QQ、QQ控件、微信好友、微信朋友圈、新浪微博)
Objective-C
24
star
12

ReactiveCocoaUtilityDemo

ReactiveCocoa实用案例
Objective-C
22
star
13

wordpress-api

wordpress的api接口
PHP
21
star
14

STFakeLabel

A 3D transform UILabel
Objective-C
20
star
15

Objective-C-Tutorials

Objective-C教程
HTML
16
star
16

STCardsMenu

Cards Menu Concept
Objective-C
11
star
17

BigHead

照片大头效果实现
Objective-C
10
star
18

WaterFlowLayoutDemo

瀑布流Demo
Objective-C
9
star
19

WebViewLoadHTMLImageAdaptiveDemo

Webview加载HTML代码时,图片尺寸自适应demo
Objective-C
9
star
20

C-Toturials-Demo

C语言教程Demo
8
star
21

STTool

Objective-C
7
star
22

POPDemo

用面向协议的思想打造菜单按钮
Swift
5
star
23

web2pdf

HTML
5
star
24

WeChatImagePickerDemo

微信选择图片demo
Objective-C
5
star
25

TJRNetworkConnection

自己封装的网络请求以及网络请求框架
Objective-C
4
star
26

hhhhh

hhhhh
Ruby
4
star
27

UILocalNotificationDemo

本地推送通知Demo,实现一个闹钟
Objective-C
3
star
28

AutolayoutKeyboardDemo

自动布局之键盘弹出动画
Objective-C
2
star
29

STMusicTool

Local music player
Objective-C
2
star
30

STAnimationTips

A little tips about animation
Swift
2
star
31

AsyncCallbackHell

Swift
2
star
32

Swift-Algorithms

《Manning Grokking Algorithms》
Swift
1
star
33

tiny-hexo-theme

Hexo Theme
CSS
1
star
34

STLoginAnimation

a smooth and cool animation of login
1
star
35

STConvertLL2MC

用于百度坐标拾取器,将经纬度转为MC坐标
Objective-C
1
star
36

alfred-wordflows

Ruby
1
star
37

STGIFTool

handle gif
Objective-C
1
star
38

STImageTool

handle image
Objective-C
1
star
39

LazyJun

1
star
40

STGalaxyView

A particle effects just like galaxy
Objective-C
1
star
41

LazyJunCore

An image tool box in Swift
Swift
1
star