• This repository has been archived on 02/Jul/2023
  • Stars
    star
    118
  • Rank 299,923 (Top 6 %)
  • Language
    Swift
  • License
    MIT License
  • Created about 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

https://dribbble.com/shots/2114816-Trello-Navigation

TrelloNavigation

https://dribbble.com/shots/2114816-Trello-Navigation

很喜欢 SergioChan 用 Objective-C 写的 SCTrelloNavigation ,所以我尝试着用 Swift 写了一遍。

Preview

Environment

  • Xcode 10 +
  • iOS 8 +

Intro & Usage

API 和 代码结构和 SCTrelloNavigation 有一定区别,定制化好一些,所以使用的时候代码写的会多一些~但使用起来仍然是 Easy Easy Easy,就像使用 UITableView 。

CocoaPods

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'TrelloNavigation', '~> 0.10.0'

初始化

trelloView = TrelloView(frame: CGRect(x: 0, y: 0, width: ScreenWidth, height: ScreenHeight), tabCount: 5, trelloTabCells: { () -> [UIView] in
    return [
        TrelloListTabViewModel.tabView(title: "BACKLOG", level: 3),
        TrelloListTabViewModel.tabView(title: "BRIEFS", level: 5),
        TrelloListTabViewModel.tabView(title: "DESIGN", level: 2),
        TrelloListTabViewModel.tabView(title: "USER TESTING", level: 4),
        TrelloListTabViewModel.tabView(title: "USER TESTIN", level: 1)
    ]
})

只需要多设置 tab 的数量和对应 tab 的 view 。

注意:tabCount 要和 tabCell 数量一致。

设置 delegate 和 dataSource

trelloView.delegate = self
trelloView.dataSource = self

就和使用 UITableView 一样,和 UITableView 一样实现对应的协议即可~

将数据挂在 tableView 上

因为用了多个 tableView ,所以为了区别不同 tab 的数据,我这里将数据放在了对应的 tableView 上。当然,你也可以用自己喜欢的其他方法,如果有更好的想法,欢迎给我提 PR 。

Tips

项目中 TrelloAnimate 、 TrelloDefine 、 TrelloFunction 、 TrelloListTableView 、 TrelloListTabView 、TrelloListView 、 TrelloView 、 UIViewExt 是必要文件。

为了安全性,挂在 tableView 的数据必须声明数组中的类型,最好不要直接改为 AnyObject 。:]

如果你对 Swift 或者函数式编程很感兴趣,欢迎阅读源码一起学习。:]

License

MIT

More Repositories

1

TransitionTreasury

Easier way to push your viewController.
Swift
2,088
star
2

Flix

iOS reusable form library in Swift.
Swift
727
star
3

LearnRxSwift

Swift
492
star
4

DQKFreezeWindowView

A freeze window effect view for iOS
Objective-C
360
star
5

rx-sample-code

Swift
165
star
6

uuplugin

UU 加速插件 docker 版本
Dockerfile
87
star
7

GroupTableSeparatorFix

Swift
65
star
8

DevOnPods

Ruby
61
star
9

HybridDemo

A hybrid project for iOS, Vue and React.
Swift
40
star
10

RouterBuilder

Swift
33
star
11

Sketch2Code

Swift
24
star
12

magisk-wireguard-auto-connect

Auto turn on and off WireGuard by using the ip monitor command. Turn it off when you are home and on when you are away.
Shell
19
star
13

LTOGlobalMachineOutliner

Ruby
13
star
14

FuckKeyboard

Deal the fuck keyboard
Objective-C
13
star
15

Router

Swift
12
star
16

ruslin-android

A simple notes application that supports syncing notes using a self-hosted Joplin server.
Kotlin
11
star
17

rx-redux-sample-code

Swift
9
star
18

RxSwiftTreeSelect

Swift
9
star
19

RxLogger

Swift
8
star
20

MeetRxSwift

Swift
8
star
21

wechat-archive

微信归档
Rust
7
star
22

StuQ-RxSwift

Swift
7
star
23

debug-ipa

Shell
6
star
24

RxExtensions

Swift
6
star
25

UploadImageDemo

Swift
6
star
26

openconnect-snell

Dockerfile
5
star
27

miui_push_device_fake

Shell
4
star
28

RefreshSingleCell

Swift
4
star
29

ld64-build

Makefile
4
star
30

SwiftDebug

打造一个愉快的 Swift Debug 控制台
Swift
4
star
31

Use-popToViewController

Swift
4
star
32

change-mach-o-symbol

C
4
star
33

Expandable

http://7xokf3.com1.z0.glb.clouddn.com/Demo.mov
Swift
3
star
34

UMengAnalytics-NO-IDFA-Module

Ruby
3
star
35

HAP-IR-Demo

Swift
3
star
36

my_slack_bot_demo

Python
3
star
37

nix-on-termux-bootstrap

Shell
2
star
38

ft9201fingerprint-nix

Nix
2
star
39

dianqk.blog

2
star
40

StudyUnwindSegue

Swift
2
star
41

TwoWayBind

Swift
1
star
42

errorOnNil

Swift
1
star
43

SectionSelect

Swift
1
star
44

GMTC-Swift-on-Pi

Swift
1
star
45

unseenmail

Notify via ntfy when unseen new emails arrive
Rust
1
star
46

DianQK

1
star
47

UseStaticFramework

Ruby
1
star
48

reproduce_outlined_function_use_live_x0

https://reviews.llvm.org/D112911
Objective-C
1
star
49

Happy-Hacking-Web

JavaScript
1
star