• This repository has been archived on 14/Feb/2019
  • Stars
    star
    360
  • Rank 118,230 (Top 3 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 8 years ago

Reviews

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

Repository Details

A freeze window effect view for iOS

DQKFreezeWindowView

A freeze window effect view for iOS.
Just like Office Excel.

![Demo](https://raw.githubusercontent.com/DianQK/DQKFreezeWindowView/master/Screenshots/DemoVideo.gif)

Note:
If this GIF(3.7 MB) looks not well, please refresh.

Usage

Install

Just add pod 'DQKFreezeWindowView', '~> 0.9.1' to your Podfile and pod install.

Use

Use DQKFreezeWindowView just like UITableView,it's similar but also powerful.

#import "DQKFreezeWindowView.h" anywhere you want to use.
Initialize the freezeWindowView:

DQKFreezeWindowView *freezeWindowView = [[DQKFreezeWindowView alloc] initWithFrame:frame];
    [self.view addSubview:freezeWindowView];
    freezeWindowView.dataSource = self;
    freezeWindowView.delegate = self;

Note:
sectionCell at the top, rowCell at the left.

![](https://raw.githubusercontent.com/DianQK/DQKFreezeWindowView/master/Screenshots/ScrollViewPosition.png)

Incomplete implementation (dataSource):

- (NSInteger)numberOfSectionsInFreezeWindowView:(DQKFreezeWindowView *)freezeWindowView {
    return 100;
}

- (NSInteger)numberOfRowsInFreezeWindowView:(DQKFreezeWindowView *)freezeWindowView {
    return 100;
}

- (DQKMainViewCell *)freezeWindowView:(DQKFreezeWindowView *)freezeWindowView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *mainCell = @"mainCell";
    DQKMainViewCell *mainCell = [freezeWindowView dequeueReusableMainCellWithIdentifier:mainCell forIndexPath:indexPath];
    if (mainCell == nil) {
        mainCell = [[DQKMainViewCell alloc] initWithStyle:DQKMainViewCellStyleDefault reuseIdentifier:calendarCell];
        mainCell.title = @"mainCell";
    }
    return mainCell;
}

- (DQKSectionViewCell *)freezeWindowView:(DQKFreezeWindowView *)freezeWindowView cellAtSection:(NSInteger)section {
    static NSString *sectionCell = @"sectionCell";
    DQKSectionViewCell *sectionCell = [freezeWindowView dequeueReusableSectionCellWithIdentifier:dayCell forSection:section];
    if (sectionCell == nil) {
        sectionCell = [[DQKSectionViewCell alloc] initWithStyle:DQKSectionViewCellStyleDefault reuseIdentifier:dayCell];
        sectionCell.title = @"sectionCell";
    }
    return sectionCell;
}

- (DQKRowViewCell *)freezeWindowView:(DQKFreezeWindowView *)freezeWindowView cellAtRow:(NSInteger)row {
    static NSString *rowCell = @"rowCell";
    DQKRowViewCell *rowCell = [freezeWindowView dequeueReusableRowCellWithIdentifier:timeCell forRow:row];
    if (rowCell == nil) {
        rowCell = [[DQKRowViewCell alloc] initWithStyle:DQKRowViewCellStyleDefault reuseIdentifier:timeCell];
        rowCell.title = @"rowCell";
    }
    return rowCell;
}

Incomplete implementation (delegate):

- (void)freezeWindowView:(DQKFreezeWindowView *)freezeWindowView didSelectIndexPath:(NSIndexPath *)indexPath {
    NSString *message = [NSString stringWithFormat:@"Click at section: %ld row: %ld",(long)indexPath.section,(long)indexPath.row];
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"You did a click!" message:message delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
    [alertView show];
}

Note: For more information, you can see DQKFreezeWindowViewExample and DQKFreezeWindowViewDemo. I prefer to DQKFreezeWindowViewDemo, it's interesting.

Other

When You Should Use DQKFreezeWindowView

You can use it for:

  • Calendar
  • Show Data
  • Syllabus
  • To Do Lists
  • ...

Why You should Try DQKFreezeWindowView

  1. Physical
    Look follow this picture:

The right picture is Calendar screenshot. When you use Calendar, you can't scroll view to horizontal direction after scrolling view to vertical direction instantly, which like a bug.

  1. Powerful
    Also can use for many datas to show

  2. Multiplex
    You can set DQKFreezeWindowView.bounceStyle.

More style you can see the project *.h file.

Beta Function

  • Tap Section to Top / Tap Row to Left
  • Detect A Cell Position
  • A Delegate -- When A Cell at A Key Position

Implementation

If you are interesting my project, you can see OtherSource . I put a part of Implementation.

An Article in Chinese.

Release Note

  • 0.9.1 Add AutoAligning
    You can set autoHorizontalAligning or autoVerticalAligning is YES.
    You can see the autoHorizontalAligning effect on DQKFreezeWindowViewDemo.

To Do

  • Expand cell function
  • Fix some cell miss when you scroll fast
  • Fix Beta some bug
  • Add more style

Talk

If you have some advice or problem, please put issues or chat with Weibo @靛青K. I need you help ^_^.

License

This code is distributed under the terms and conditions of the MIT license.

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

rx-sample-code

Swift
165
star
5

TrelloNavigation

https://dribbble.com/shots/2114816-Trello-Navigation
Swift
118
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