//
// TITokenFieldView.h
// TITokenFieldView
//
// Created by Tom Irving on 16/02/2010.
// Copyright 2010 Tom Irving. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
//
// 2. 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.
//
// THIS SOFTWARE IS PROVIDED BY TOM IRVING "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 TOM IRVING OR
// CONTRIBUTORS 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.
//
#import <UIKit/UIKit.h>
@class TITokenField, TIToken, TITokenFieldShadow;
//==========================================================
// - Delegate Methods
//==========================================================
@protocol TITokenFieldViewDelegate <NSObject>
@optional
- (BOOL)tokenFieldShouldReturn:(TITokenField *)tokenField;
- (void)tokenField:(TITokenField *)tokenField didChangeToFrame:(CGRect)frame;
- (void)tokenFieldTextDidChange:(TITokenField *)tokenField;
- (void)tokenField:(TITokenField *)tokenField didFinishSearch:(NSArray *)matches;
- (UITableViewCell *)tokenField:(TITokenField *)tokenField resultsTableView:(UITableView *)tableView cellForObject:(id)object;
- (CGFloat)tokenField:(TITokenField *)tokenField resultsTableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
@end
@protocol TITokenDelegate <NSObject>
@optional
- (void)tokenGotFocus:(TIToken *)token;
- (void)tokenLostFocus:(TIToken *)token;
@end
//==========================================================
// - TITokenFieldView
//==========================================================
@interface TITokenFieldView : UIScrollView <UITextFieldDelegate, UITableViewDelegate, UITableViewDataSource> {
BOOL showAlreadyTokenized;
id <TITokenFieldViewDelegate> delegate;
TITokenFieldShadow * textFieldShadow;
UIView * separator;
UITableView * resultsTable;
UIView * contentView;
NSArray * sourceArray;
NSMutableArray * resultsArray;
NSArray * tokenTitles;
TITokenField * tokenField;
}
@property (nonatomic, assign) BOOL showAlreadyTokenized;
@property (nonatomic, assign) id <TITokenFieldViewDelegate> delegate;
@property (nonatomic, readonly) TITokenFieldShadow * textFieldShadow;
@property (nonatomic, readonly) UIView * separator;
@property (nonatomic, readonly) UITableView * resultsTable;
@property (nonatomic, readonly) UIView * contentView;
@property (nonatomic, copy) NSArray * sourceArray;
@property (nonatomic, readonly, retain) NSArray * tokenTitles;
@property (nonatomic, readonly) TITokenField * tokenField;
- (void)updateContentSize;
@end
//==========================================================
// - TITokenField
//==========================================================
@interface TITokenField : UITextField <TITokenDelegate> {
NSMutableArray * tokensArray;
CGPoint cursorLocation;
int numberOfLines;
UIButton * addButton;
id addButtonTarget;
SEL addButtonSelector;
}
@property (nonatomic, retain) NSMutableArray * tokensArray;
@property (nonatomic, readonly) int numberOfLines;
@property (nonatomic, retain) UIButton * addButton;
@property (nonatomic, assign) id addButtonTarget;
@property (nonatomic, assign) SEL addButtonSelector;
- (void)addToken:(NSString *)title;
- (void)removeToken:(TIToken *)token;
- (CGFloat)layoutTokens;
- (void)setAddButtonAction:(SEL)action target:(id)sender;
- (void)setPromptText:(NSString *)aText;
@end
//==========================================================
// - TIToken
//==========================================================
@interface TIToken : UIView {
id <TITokenDelegate> delegate;
BOOL highlighted;
NSString * title;
NSString * croppedTitle;
}
@property (nonatomic, getter=isHighlighted) BOOL highlighted;
@property (nonatomic, retain) NSString * title;
@property (nonatomic, retain) NSString * croppedTitle;
@property (nonatomic, assign) id <TITokenDelegate> delegate;
- (id)initWithTitle:(NSString *)aTitle;
@end
【类库与框架】-TISwipeableTableView.7z
版权申诉
96 浏览量
2022-07-07
07:54:50
上传
评论
收藏 90KB 7Z 举报
BryanDing
- 粉丝: 299
- 资源: 5583
最新资源
- 基于Java的本科探索学习项目设计源码 - 本科探索
- 基于Javascript和Python的微商城项目设计源码 - MicroMall
- 基于Java的网上订餐系统设计源码 - online ordering system
- 基于Javascript的超级美眉网络资源管理应用模块设计源码
- 基于Typescript和PHP的编程知识储备库设计源码 - study-php
- Screenshot_2024-05-28-11-40-58-177_com.tencent.mm.jpg
- 基于Dart的Flutter小提琴调音器APP设计源码 - violinhelper
- 基于JavaScript和CSS的随寻订购网页设计源码 - web-order
- 基于MATLAB的声纹识别系统设计源码 - VoiceprintRecognition
- 基于Java的微服务插件集合设计源码 - wsy-plugins
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0