├── demo.gif ├── README.md ├── WSDItemViewDemo ├── Images.xcassets │ ├── add.imageset │ │ ├── add-circle@2x.png │ │ ├── add-circle@3x.png │ │ └── Contents.json │ ├── arrow.imageset │ │ ├── chevron-right@2x.png │ │ ├── chevron-right@3x.png │ │ └── Contents.json │ ├── delete.imageset │ │ ├── delete-circle@2x.png │ │ ├── delete-circle@3x.png │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── ViewController.h ├── AppDelegate.h ├── main.m ├── WSDSelectItem │ ├── WSDInputViewController.h │ ├── WSDSelectionViewController.h │ ├── WSDSelectionViewController.m │ ├── WSDSelectionViewController.xib │ ├── WSDItemView.h │ ├── WSDInputViewController.m │ ├── WSDInputViewController.xib │ └── WSDItemView.m ├── Info.plist ├── AppDelegate.m ├── Base.lproj │ ├── Main.storyboard │ └── LaunchScreen.xib └── ViewController.m └── WSDItemViewDemo.xcodeproj ├── xcuserdata └── wangshudao.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── xcschememanagement.plist │ └── WSDSelectItemDemo.xcscheme ├── project.xcworkspace ├── xcuserdata │ └── wangshudao.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── WorkspaceSettings.xcsettings └── contents.xcworkspacedata └── project.pbxproj /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vulgur/WSDItemView/HEAD/demo.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WSDItemView 2 | Demo for three kinds of items, add, input and delete. 3 | 4 | 5 | ![](demo.gif) -------------------------------------------------------------------------------- /WSDItemViewDemo/Images.xcassets/add.imageset/add-circle@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vulgur/WSDItemView/HEAD/WSDItemViewDemo/Images.xcassets/add.imageset/add-circle@2x.png -------------------------------------------------------------------------------- /WSDItemViewDemo/Images.xcassets/add.imageset/add-circle@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vulgur/WSDItemView/HEAD/WSDItemViewDemo/Images.xcassets/add.imageset/add-circle@3x.png -------------------------------------------------------------------------------- /WSDItemViewDemo/Images.xcassets/arrow.imageset/chevron-right@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vulgur/WSDItemView/HEAD/WSDItemViewDemo/Images.xcassets/arrow.imageset/chevron-right@2x.png -------------------------------------------------------------------------------- /WSDItemViewDemo/Images.xcassets/arrow.imageset/chevron-right@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vulgur/WSDItemView/HEAD/WSDItemViewDemo/Images.xcassets/arrow.imageset/chevron-right@3x.png -------------------------------------------------------------------------------- /WSDItemViewDemo/Images.xcassets/delete.imageset/delete-circle@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vulgur/WSDItemView/HEAD/WSDItemViewDemo/Images.xcassets/delete.imageset/delete-circle@2x.png -------------------------------------------------------------------------------- /WSDItemViewDemo/Images.xcassets/delete.imageset/delete-circle@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vulgur/WSDItemView/HEAD/WSDItemViewDemo/Images.xcassets/delete.imageset/delete-circle@3x.png -------------------------------------------------------------------------------- /WSDItemViewDemo.xcodeproj/xcuserdata/wangshudao.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /WSDItemViewDemo.xcodeproj/project.xcworkspace/xcuserdata/wangshudao.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vulgur/WSDItemView/HEAD/WSDItemViewDemo.xcodeproj/project.xcworkspace/xcuserdata/wangshudao.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /WSDItemViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WSDItemViewDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // WSDSelectItemDemo 4 | // 5 | // Created by Wang Shudao on 9/14/15. 6 | // Copyright (c) 2015 WSD. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /WSDItemViewDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // WSDSelectItemDemo 4 | // 5 | // Created by Wang Shudao on 9/14/15. 6 | // Copyright (c) 2015 WSD. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /WSDItemViewDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // WSDSelectItemDemo 4 | // 5 | // Created by Wang Shudao on 9/14/15. 6 | // Copyright (c) 2015 WSD. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /WSDItemViewDemo.xcodeproj/project.xcworkspace/xcuserdata/wangshudao.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /WSDItemViewDemo/Images.xcassets/add.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "add-circle@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x", 15 | "filename" : "add-circle@3x.png" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /WSDItemViewDemo/Images.xcassets/arrow.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "chevron-right@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x", 15 | "filename" : "chevron-right@3x.png" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /WSDItemViewDemo/Images.xcassets/delete.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "delete-circle@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x", 15 | "filename" : "delete-circle@3x.png" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /WSDItemViewDemo/WSDSelectItem/WSDInputViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // WSDInputViewController.h 3 | // WSDSelectItemDemo 4 | // 5 | // Created by Wang Shudao on 9/15/15. 6 | // Copyright (c) 2015 WSD. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @protocol WSDInputViewControllerDelegate 12 | 13 | - (void)didInput:(NSString *)string; 14 | 15 | @end 16 | 17 | @interface WSDInputViewController : UIViewController 18 | 19 | @property (nonatomic, weak) id delegate; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /WSDItemViewDemo/WSDSelectItem/WSDSelectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // WSDSelectionViewController.h 3 | // WSDSelectItemDemo 4 | // 5 | // Created by Wang Shudao on 9/16/15. 6 | // Copyright (c) 2015 WSD. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @protocol WSDSelectionViewControllerDelegate 12 | 13 | - (void)didSelect:(NSString *)string; 14 | 15 | @end 16 | 17 | @interface WSDSelectionViewController : UIViewController 18 | 19 | @property(nonatomic, weak) id delegate; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /WSDItemViewDemo.xcodeproj/xcuserdata/wangshudao.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | WSDSelectItemDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | D2FB6F571BA6CC1700C6B394 16 | 17 | primary 18 | 19 | 20 | D2FB6F701BA6CC1700C6B394 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /WSDItemViewDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /WSDItemViewDemo/WSDSelectItem/WSDSelectionViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // WSDSelectionViewController.m 3 | // WSDSelectItemDemo 4 | // 5 | // Created by Wang Shudao on 9/16/15. 6 | // Copyright (c) 2015 WSD. All rights reserved. 7 | // 8 | 9 | #import "WSDSelectionViewController.h" 10 | 11 | @interface WSDSelectionViewController () 12 | 13 | @end 14 | 15 | @implementation WSDSelectionViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view from its nib. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | /* 28 | #pragma mark - Navigation 29 | 30 | // In a storyboard-based application, you will often want to do a little preparation before navigation 31 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 32 | // Get the new view controller using [segue destinationViewController]. 33 | // Pass the selected object to the new view controller. 34 | } 35 | */ 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /WSDItemViewDemo/WSDSelectItem/WSDSelectionViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /WSDItemViewDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.wsd.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /WSDItemViewDemo/WSDSelectItem/WSDItemView.h: -------------------------------------------------------------------------------- 1 | // 2 | // WSDItemView.h 3 | // WSDSelectItemDemo 4 | // 5 | // Created by Wang Shudao on 9/14/15. 6 | // Copyright (c) 2015 WSD. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSUInteger, WSDItemViewType) { 12 | WSDItemViewTypeDelete, 13 | WSDItemViewTypeADD, 14 | WSDItemViewTypeInput, 15 | }; 16 | 17 | @class WSDItemView; 18 | 19 | @protocol WSDItemViewDelegate 20 | 21 | @optional 22 | - (void)didTapItemViewRightIcon:(WSDItemView *)itemView; 23 | -(void)didRemove:(WSDItemView *)itemView; 24 | 25 | @end 26 | 27 | @interface WSDItemView : UIView 28 | 29 | @property(nonatomic, strong) NSString *itemTitle; 30 | @property(nonatomic, strong) NSString *itemContent; 31 | @property(nonatomic, assign, readonly) WSDItemViewType itemType; 32 | @property(nonatomic, weak) id delegate; 33 | 34 | - (instancetype)initWithTitle:(NSString *)title 35 | titleColor:(UIColor *)titleColor 36 | titleFont:(UIFont *)titleFont 37 | content:(NSString *)content 38 | contentColor:(UIColor *)contentColor 39 | contentFont:(UIFont *)contentFont 40 | leftMargin:(CGFloat)leftMargin 41 | rightMargin:(CGFloat)rightMargin 42 | width:(CGFloat)width 43 | height:(CGFloat)height 44 | backgroundColor:(UIColor *)backgroundColor 45 | type:(WSDItemViewType)type; 46 | 47 | - (void)remove; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /WSDItemViewDemo/WSDSelectItem/WSDInputViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // WSDInputViewController.m 3 | // WSDSelectItemDemo 4 | // 5 | // Created by Wang Shudao on 9/15/15. 6 | // Copyright (c) 2015 WSD. All rights reserved. 7 | // 8 | 9 | #import "WSDInputViewController.h" 10 | 11 | @interface WSDInputViewController () 12 | 13 | @property(weak, nonatomic) IBOutlet UITextView *inputTextView; 14 | 15 | @end 16 | 17 | @implementation WSDInputViewController 18 | 19 | static NSString *kTextViewPlaceholder = @"Type Something Here"; 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | // Do any additional setup after loading the view from its nib. 24 | self.navigationItem.title = @"Input"; 25 | self.navigationItem.rightBarButtonItem = 26 | [[UIBarButtonItem alloc] initWithTitle:@"Done" 27 | style:UIBarButtonItemStyleDone 28 | target:self 29 | action:@selector(didTapDone)]; 30 | self.inputTextView.delegate = self; 31 | } 32 | 33 | - (void)didReceiveMemoryWarning { 34 | [super didReceiveMemoryWarning]; 35 | // Dispose of any resources that can be recreated. 36 | } 37 | 38 | - (void)didTapDone { 39 | [self.delegate didInput:self.inputTextView.text]; 40 | [self.navigationController popViewControllerAnimated:YES]; 41 | } 42 | 43 | #pragma mark - UITextViewDelegate 44 | 45 | -(void)textViewDidBeginEditing:(UITextView *)textView { 46 | if ([textView.text isEqualToString:kTextViewPlaceholder]) { 47 | textView.text = @""; 48 | } 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /WSDItemViewDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // WSDSelectItemDemo 4 | // 5 | // Created by Wang Shudao on 9/14/15. 6 | // Copyright (c) 2015 WSD. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /WSDItemViewDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /WSDItemViewDemo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /WSDItemViewDemo.xcodeproj/xcuserdata/wangshudao.xcuserdatad/xcschemes/WSDSelectItemDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /WSDItemViewDemo/WSDSelectItem/WSDInputViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /WSDItemViewDemo/WSDSelectItem/WSDItemView.m: -------------------------------------------------------------------------------- 1 | // 2 | // WSDItemView.m 3 | // WSDSelectItemDemo 4 | // 5 | // Created by Wang Shudao on 9/14/15. 6 | // Copyright (c) 2015 WSD. All rights reserved. 7 | // 8 | 9 | #import "WSDItemView.h" 10 | 11 | @interface WSDItemView () 12 | 13 | @property (nonatomic, strong) UIImageView *rightIconImageView; 14 | @property (nonatomic, strong) UIView *rightView; 15 | @property (nonatomic, strong) UILabel *titleLabel; 16 | @property (nonatomic, strong) UILabel *contentLabel; 17 | 18 | @end 19 | 20 | @implementation WSDItemView 21 | 22 | - (instancetype)initWithTitle:(NSString *)title 23 | titleColor:(UIColor *)titleColor 24 | titleFont:(UIFont *)titleFont 25 | content:(NSString *)content 26 | contentColor:(UIColor *)contentColor 27 | contentFont:(UIFont *)contentFont 28 | leftMargin:(CGFloat)leftMargin 29 | rightMargin:(CGFloat)rightMargin 30 | width:(CGFloat)width 31 | height:(CGFloat)height 32 | backgroundColor:(UIColor *)backgroundColor 33 | type:(WSDItemViewType)type { 34 | self = [WSDItemView new]; 35 | if (self) { 36 | self.backgroundColor = backgroundColor; 37 | self.translatesAutoresizingMaskIntoConstraints = NO; 38 | 39 | _itemTitle = title; 40 | _itemContent = content; 41 | _itemType = type; 42 | 43 | // Set size of the item 44 | NSLayoutConstraint *widthConstraint = 45 | [NSLayoutConstraint constraintWithItem:self 46 | attribute:NSLayoutAttributeWidth 47 | relatedBy:NSLayoutRelationEqual 48 | toItem:nil 49 | attribute:NSLayoutAttributeNotAnAttribute 50 | multiplier:1.0 51 | constant:width]; 52 | NSLayoutConstraint *heightConstraint = 53 | [NSLayoutConstraint constraintWithItem:self 54 | attribute:NSLayoutAttributeHeight 55 | relatedBy:NSLayoutRelationEqual 56 | toItem:nil 57 | attribute:NSLayoutAttributeNotAnAttribute 58 | multiplier:1.0 59 | constant:height]; 60 | [self addConstraint:widthConstraint]; 61 | [self addConstraint:heightConstraint]; 62 | 63 | // Label for title 64 | _titleLabel = [UILabel new]; 65 | _titleLabel.translatesAutoresizingMaskIntoConstraints = NO; 66 | _titleLabel.text = title; 67 | _titleLabel.textColor = titleColor; 68 | _titleLabel.font = titleFont; 69 | _titleLabel.textAlignment = NSTextAlignmentLeft; 70 | [_titleLabel sizeToFit]; 71 | 72 | // Label for content 73 | _contentLabel = [UILabel new]; 74 | _contentLabel.translatesAutoresizingMaskIntoConstraints = NO; 75 | _contentLabel.text = content; 76 | _contentLabel.textColor = contentColor; 77 | _contentLabel.font = contentFont; 78 | _contentLabel.textAlignment = NSTextAlignmentRight; 79 | _contentLabel.lineBreakMode = NSLineBreakByTruncatingTail; 80 | 81 | // ImageView for right icon 82 | _rightIconImageView = [UIImageView new]; 83 | _rightIconImageView.translatesAutoresizingMaskIntoConstraints = NO; 84 | _rightView = [UIView new]; 85 | _rightView.backgroundColor = [UIColor clearColor]; 86 | _rightView.translatesAutoresizingMaskIntoConstraints = NO; 87 | [_rightView addSubview:_rightIconImageView]; 88 | 89 | switch (type) { 90 | case WSDItemViewTypeDelete: 91 | _rightIconImageView.image = [UIImage imageNamed:@"delete"]; 92 | break; 93 | case WSDItemViewTypeADD: 94 | _rightIconImageView.image = [UIImage imageNamed:@"add"]; 95 | break; 96 | case WSDItemViewTypeInput: 97 | _rightIconImageView.image = [UIImage imageNamed:@"arrow"]; 98 | } 99 | 100 | // Autolayouts 101 | [self addSubview:_titleLabel]; 102 | [self addSubview:_contentLabel]; 103 | [self addSubview:_rightView]; 104 | 105 | NSDictionary *views = NSDictionaryOfVariableBindings( 106 | self, _titleLabel, _contentLabel, _rightView); 107 | 108 | [self addConstraint:[NSLayoutConstraint 109 | constraintWithItem:_contentLabel 110 | attribute:NSLayoutAttributeWidth 111 | relatedBy:NSLayoutRelationEqual 112 | toItem:nil 113 | attribute:NSLayoutAttributeNotAnAttribute 114 | multiplier:1.0f 115 | constant:120]]; 116 | 117 | [self addConstraint:[NSLayoutConstraint 118 | constraintWithItem:_rightView 119 | attribute:NSLayoutAttributeWidth 120 | relatedBy:NSLayoutRelationEqual 121 | toItem:nil 122 | attribute:NSLayoutAttributeNotAnAttribute 123 | multiplier:1.0f 124 | constant:height]]; 125 | 126 | [self addConstraint:[NSLayoutConstraint 127 | constraintWithItem:_rightView 128 | attribute:NSLayoutAttributeHeight 129 | relatedBy:NSLayoutRelationEqual 130 | toItem:nil 131 | attribute:NSLayoutAttributeNotAnAttribute 132 | multiplier:1.0f 133 | constant:height]]; 134 | [self addConstraints:[NSLayoutConstraint 135 | constraintsWithVisualFormat: 136 | [NSString 137 | stringWithFormat:@"|-%f-[_titleLabel]", leftMargin] 138 | options: 139 | NSLayoutFormatDirectionLeadingToTrailing 140 | metrics:nil 141 | views:views]]; 142 | 143 | [self addConstraints:[NSLayoutConstraint 144 | constraintsWithVisualFormat:@"V:|-[_titleLabel]-|" 145 | options: 146 | NSLayoutFormatDirectionLeadingToTrailing 147 | metrics:nil 148 | views:views]]; 149 | 150 | [self addConstraints:[NSLayoutConstraint 151 | constraintsWithVisualFormat:@"V:|-[_contentLabel]-|" 152 | options: 153 | NSLayoutFormatDirectionLeadingToTrailing 154 | metrics:nil 155 | views:views]]; 156 | 157 | [self addConstraints:[NSLayoutConstraint 158 | constraintsWithVisualFormat:@"V:|[_rightView]|" 159 | options: 160 | NSLayoutFormatDirectionLeadingToTrailing 161 | metrics:nil 162 | views:views]]; 163 | 164 | [self addConstraints:[NSLayoutConstraint 165 | constraintsWithVisualFormat:@"[_contentLabel]-[_rightView]|" 166 | options: 167 | NSLayoutFormatDirectionLeadingToTrailing 168 | metrics:nil 169 | views:views]]; 170 | 171 | [_rightView addConstraints:[NSLayoutConstraint 172 | constraintsWithVisualFormat: 173 | [NSString stringWithFormat:@"[_rightIconImageView]-%f-|", 174 | rightMargin] 175 | options: 176 | NSLayoutFormatDirectionLeadingToTrailing 177 | metrics:nil 178 | views:NSDictionaryOfVariableBindings( 179 | _rightView, 180 | _rightIconImageView)]]; 181 | 182 | [_rightView addConstraint:[NSLayoutConstraint 183 | constraintWithItem:_rightIconImageView 184 | attribute:NSLayoutAttributeCenterY 185 | relatedBy:NSLayoutRelationEqual 186 | toItem:_rightView 187 | attribute:NSLayoutAttributeCenterY 188 | multiplier:1.0f 189 | constant:0]]; 190 | // Gestures 191 | UITapGestureRecognizer *tapIcon = [[UITapGestureRecognizer alloc] 192 | initWithTarget:self 193 | action:@selector(didTapRightIcon)]; 194 | [_rightView addGestureRecognizer:tapIcon]; 195 | } 196 | 197 | return self; 198 | } 199 | 200 | - (void)didTapRightIcon { 201 | [self.delegate didTapItemViewRightIcon:self]; 202 | } 203 | 204 | #pragma mark - Setters 205 | - (void)setItemTitle:(NSString *)title { 206 | _itemTitle = title; 207 | _titleLabel.text = title; 208 | [self setNeedsDisplay]; 209 | } 210 | 211 | - (void)setItemContent:(NSString *)content { 212 | _itemContent = content; 213 | _contentLabel.text = content; 214 | [self setNeedsDisplay]; 215 | } 216 | 217 | - (void)remove { 218 | CGRect frame = self.frame; 219 | CGFloat width = frame.size.width; 220 | [UIView animateWithDuration:0.3 221 | animations:^{ 222 | self.frame = CGRectMake(frame.origin.x + width, frame.origin.y, width, 223 | frame.size.height); 224 | } 225 | completion:^(BOOL finished) { 226 | [self removeFromSuperview]; 227 | [self.delegate didRemove:self]; 228 | }]; 229 | } 230 | 231 | @end 232 | -------------------------------------------------------------------------------- /WSDItemViewDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // WSDSelectItemDemo 4 | // 5 | // Created by Wang Shudao on 9/14/15. 6 | // Copyright (c) 2015 WSD. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "WSDItemView.h" 11 | #import "WSDInputViewController.h" 12 | #import "WSDSelectionViewController.h" 13 | 14 | @interface ViewController () 16 | 17 | @property (nonatomic, strong) WSDItemView *itemView1; 18 | @property (nonatomic, strong) WSDItemView *itemView2; 19 | @property (nonatomic, strong) WSDItemView *itemView3; 20 | @property (nonatomic, strong) id lastItem; 21 | @property (nonatomic, strong) NSMutableArray *addedItems; 22 | @property (nonatomic, strong) NSLayoutConstraint *constraintForItemView2; 23 | 24 | @end 25 | 26 | @implementation ViewController 27 | 28 | - (void)viewDidLoad { 29 | [super viewDidLoad]; 30 | // Do any additional setup after loading the view, typically from a nib. 31 | CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width; 32 | self.addedItems = [NSMutableArray new]; 33 | 34 | self.itemView1 = 35 | [[WSDItemView alloc] initWithTitle:@"111" 36 | titleColor:[UIColor blueColor] 37 | titleFont:[UIFont systemFontOfSize:18] 38 | content:@"tap to add" 39 | contentColor:[UIColor redColor] 40 | contentFont:[UIFont systemFontOfSize:18] 41 | leftMargin:10 42 | rightMargin:10 43 | width:screenWidth 44 | height:50 45 | backgroundColor:[UIColor yellowColor] 46 | type:WSDItemViewTypeADD]; 47 | self.itemView2 = 48 | [[WSDItemView alloc] initWithTitle:@"222" 49 | titleColor:[UIColor blueColor] 50 | titleFont:[UIFont systemFontOfSize:18] 51 | content:@"go to input" 52 | contentColor:[UIColor redColor] 53 | contentFont:[UIFont systemFontOfSize:18] 54 | leftMargin:10 55 | rightMargin:10 56 | width:screenWidth 57 | height:50 58 | backgroundColor:[UIColor yellowColor] 59 | type:WSDItemViewTypeInput]; 60 | self.itemView3 = 61 | [[WSDItemView alloc] initWithTitle:@"333" 62 | titleColor:[UIColor blueColor] 63 | titleFont:[UIFont systemFontOfSize:18] 64 | content:@"tap to delete" 65 | contentColor:[UIColor redColor] 66 | contentFont:[UIFont systemFontOfSize:18] 67 | leftMargin:10 68 | rightMargin:10 69 | width:screenWidth 70 | height:50 71 | backgroundColor:[UIColor yellowColor] 72 | type:WSDItemViewTypeDelete]; 73 | 74 | self.itemView1.delegate = self; 75 | self.itemView2.delegate = self; 76 | self.itemView3.delegate = self; 77 | self.lastItem = self.itemView1; 78 | 79 | [self.view addSubview:self.itemView1]; 80 | [self.view addSubview:self.itemView2]; 81 | [self.view addSubview:self.itemView3]; 82 | 83 | [self.view 84 | addConstraint:[NSLayoutConstraint constraintWithItem:self.itemView1 85 | attribute:NSLayoutAttributeLeft 86 | relatedBy:NSLayoutRelationEqual 87 | toItem:self.view 88 | attribute:NSLayoutAttributeLeft 89 | multiplier:1.f 90 | constant:0]]; 91 | 92 | [self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.itemView2 93 | attribute:NSLayoutAttributeLeft 94 | relatedBy:NSLayoutRelationEqual 95 | toItem:self.view 96 | attribute:NSLayoutAttributeLeft 97 | multiplier:1.f 98 | constant:0]]; 99 | 100 | [self.view 101 | addConstraint:[NSLayoutConstraint constraintWithItem:self.itemView3 102 | attribute:NSLayoutAttributeLeft 103 | relatedBy:NSLayoutRelationEqual 104 | toItem:self.view 105 | attribute:NSLayoutAttributeLeft 106 | multiplier:1.f 107 | constant:0]]; 108 | 109 | [self.view addConstraints: 110 | [NSLayoutConstraint constraintsWithVisualFormat: 111 | @"V:|-100-[_itemView1]" 112 | options:NSLayoutFormatAlignAllCenterX 113 | metrics:nil 114 | views:NSDictionaryOfVariableBindings( 115 | self.view, _itemView1, 116 | _itemView2, _itemView3)]]; 117 | 118 | self.constraintForItemView2 = [NSLayoutConstraint constraintWithItem:self.itemView2 attribute:NSLayoutAttributeTop 119 | relatedBy:NSLayoutRelationEqual 120 | toItem:self.itemView1 121 | attribute:NSLayoutAttributeBottom 122 | multiplier:1.f 123 | constant:30]; 124 | [self.view addConstraint:self.constraintForItemView2]; 125 | 126 | [self.view addConstraints: 127 | [NSLayoutConstraint constraintsWithVisualFormat: 128 | @"V:[_itemView2]-30-[_itemView3]" 129 | options:NSLayoutFormatAlignAllCenterX 130 | metrics:nil 131 | views:NSDictionaryOfVariableBindings( 132 | self.view, _itemView1, 133 | _itemView2, _itemView3)]]; 134 | } 135 | 136 | - (void)didReceiveMemoryWarning { 137 | [super didReceiveMemoryWarning]; 138 | // Dispose of any resources that can be recreated. 139 | } 140 | 141 | #pragma mark - WSDInputViewControllerDelegate 142 | 143 | - (void)didInput:(NSString *)string { 144 | self.itemView2.itemContent = string; 145 | } 146 | 147 | #pragma mark - WSDItemViewDelegate 148 | 149 | - (void)didTapItemViewRightIcon:(WSDItemView *)itemView { 150 | if ([itemView isEqual:self.itemView1]) { 151 | // WSDSelectionViewController *selectionVC = 152 | // [[WSDSelectionViewController alloc] init]; 153 | // selectionVC.view.backgroundColor = [UIColor whiteColor]; 154 | // selectionVC.delegate = self; 155 | // [self.navigationController pushViewController:selectionVC animated:YES]; 156 | [self didSelect:@"test"]; 157 | } else if ([itemView isEqual:self.itemView2]) { 158 | WSDInputViewController *inputVC = [WSDInputViewController new]; 159 | inputVC.delegate = self; 160 | [self.navigationController pushViewController:inputVC animated:YES]; 161 | } else if ([itemView isEqual:self.itemView3]) { 162 | [itemView remove]; 163 | } else { 164 | [self.addedItems removeObject:itemView]; 165 | [itemView remove]; 166 | } 167 | } 168 | 169 | - (void)didRemove:(WSDItemView *)itemView { 170 | [self reloadView]; 171 | } 172 | 173 | #pragma mark - WSDSelectionViewControllerDelegate 174 | 175 | - (void)didSelect:(NSString *)string { 176 | CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width; 177 | WSDItemView *newItem = [[WSDItemView alloc] initWithTitle:string 178 | titleColor:[UIColor blueColor] 179 | titleFont:[UIFont systemFontOfSize:12] 180 | content:nil 181 | contentColor:nil 182 | contentFont:nil 183 | leftMargin:10 184 | rightMargin:10 185 | width:screenWidth 186 | height:30 187 | backgroundColor:[UIColor grayColor] 188 | type:WSDItemViewTypeDelete]; 189 | newItem.delegate = self; 190 | [self.view addSubview:newItem]; 191 | [self.view addConstraint:[NSLayoutConstraint constraintWithItem:newItem 192 | attribute:NSLayoutAttributeTop 193 | relatedBy:NSLayoutRelationEqual 194 | toItem:self.lastItem 195 | attribute:NSLayoutAttributeBottom 196 | multiplier:1.f 197 | constant:15]]; 198 | 199 | [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"|[newItem]" 200 | options:NSLayoutFormatDirectionLeftToRight 201 | metrics:nil 202 | views:NSDictionaryOfVariableBindings(self.view, newItem)]]; 203 | 204 | [self.addedItems addObject:newItem]; 205 | [self reloadView]; 206 | } 207 | 208 | #pragma mark - Private methods 209 | - (void)reloadView { 210 | [self.view removeConstraint:self.constraintForItemView2]; 211 | self.lastItem = self.itemView1; 212 | for (WSDItemView *itemView in self.addedItems) { 213 | [self.view addConstraint:[NSLayoutConstraint constraintWithItem:itemView 214 | attribute:NSLayoutAttributeTop 215 | relatedBy:NSLayoutRelationEqual 216 | toItem:self.lastItem 217 | attribute:NSLayoutAttributeBottom 218 | multiplier:1.f 219 | constant:15]]; 220 | self.lastItem = itemView; 221 | } 222 | 223 | self.constraintForItemView2 = [NSLayoutConstraint constraintWithItem:self.itemView2 attribute:NSLayoutAttributeTop 224 | relatedBy:NSLayoutRelationEqual 225 | toItem:self.lastItem 226 | attribute:NSLayoutAttributeBottom 227 | multiplier:1.f 228 | constant:30]; 229 | [self.view addConstraint:self.constraintForItemView2]; 230 | [self.view updateConstraintsIfNeeded]; 231 | } 232 | 233 | @end 234 | -------------------------------------------------------------------------------- /WSDItemViewDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | D204281A1BAA61420045E722 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D20428071BAA61420045E722 /* AppDelegate.m */; }; 11 | D204281B1BAA61420045E722 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = D20428081BAA61420045E722 /* LaunchScreen.xib */; }; 12 | D204281C1BAA61420045E722 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D204280A1BAA61420045E722 /* Main.storyboard */; }; 13 | D204281D1BAA61420045E722 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D204280C1BAA61420045E722 /* Images.xcassets */; }; 14 | D204281E1BAA61420045E722 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = D204280D1BAA61420045E722 /* Info.plist */; }; 15 | D204281F1BAA61420045E722 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D204280E1BAA61420045E722 /* main.m */; }; 16 | D20428201BAA61420045E722 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D20428101BAA61420045E722 /* ViewController.m */; }; 17 | D20428211BAA61420045E722 /* WSDInputViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D20428131BAA61420045E722 /* WSDInputViewController.m */; }; 18 | D20428221BAA61420045E722 /* WSDInputViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D20428141BAA61420045E722 /* WSDInputViewController.xib */; }; 19 | D20428231BAA61420045E722 /* WSDItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = D20428161BAA61420045E722 /* WSDItemView.m */; }; 20 | D20428241BAA61420045E722 /* WSDSelectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D20428181BAA61420045E722 /* WSDSelectionViewController.m */; }; 21 | D20428251BAA61420045E722 /* WSDSelectionViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D20428191BAA61420045E722 /* WSDSelectionViewController.xib */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXFileReference section */ 25 | D20428061BAA61420045E722 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 26 | D20428071BAA61420045E722 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 27 | D20428091BAA61420045E722 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 28 | D204280B1BAA61420045E722 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 29 | D204280C1BAA61420045E722 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 30 | D204280D1BAA61420045E722 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | D204280E1BAA61420045E722 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 32 | D204280F1BAA61420045E722 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 33 | D20428101BAA61420045E722 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 34 | D20428121BAA61420045E722 /* WSDInputViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WSDInputViewController.h; sourceTree = ""; }; 35 | D20428131BAA61420045E722 /* WSDInputViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WSDInputViewController.m; sourceTree = ""; }; 36 | D20428141BAA61420045E722 /* WSDInputViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WSDInputViewController.xib; sourceTree = ""; }; 37 | D20428151BAA61420045E722 /* WSDItemView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WSDItemView.h; sourceTree = ""; }; 38 | D20428161BAA61420045E722 /* WSDItemView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WSDItemView.m; sourceTree = ""; }; 39 | D20428171BAA61420045E722 /* WSDSelectionViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WSDSelectionViewController.h; sourceTree = ""; }; 40 | D20428181BAA61420045E722 /* WSDSelectionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WSDSelectionViewController.m; sourceTree = ""; }; 41 | D20428191BAA61420045E722 /* WSDSelectionViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WSDSelectionViewController.xib; sourceTree = ""; }; 42 | D2FB6F581BA6CC1700C6B394 /* WSDSelectItemDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WSDSelectItemDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | D2FB6F551BA6CC1700C6B394 /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | ); 51 | runOnlyForDeploymentPostprocessing = 0; 52 | }; 53 | /* End PBXFrameworksBuildPhase section */ 54 | 55 | /* Begin PBXGroup section */ 56 | 2F1512FF5AC0BB050A2ABF25 /* Frameworks */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | ); 60 | name = Frameworks; 61 | sourceTree = ""; 62 | }; 63 | D20428051BAA61420045E722 /* WSDItemViewDemo */ = { 64 | isa = PBXGroup; 65 | children = ( 66 | D20428061BAA61420045E722 /* AppDelegate.h */, 67 | D20428071BAA61420045E722 /* AppDelegate.m */, 68 | D20428081BAA61420045E722 /* LaunchScreen.xib */, 69 | D204280A1BAA61420045E722 /* Main.storyboard */, 70 | D204280C1BAA61420045E722 /* Images.xcassets */, 71 | D204280D1BAA61420045E722 /* Info.plist */, 72 | D204280E1BAA61420045E722 /* main.m */, 73 | D204280F1BAA61420045E722 /* ViewController.h */, 74 | D20428101BAA61420045E722 /* ViewController.m */, 75 | D20428111BAA61420045E722 /* WSDSelectItem */, 76 | ); 77 | path = WSDItemViewDemo; 78 | sourceTree = ""; 79 | }; 80 | D20428111BAA61420045E722 /* WSDSelectItem */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | D20428121BAA61420045E722 /* WSDInputViewController.h */, 84 | D20428131BAA61420045E722 /* WSDInputViewController.m */, 85 | D20428141BAA61420045E722 /* WSDInputViewController.xib */, 86 | D20428151BAA61420045E722 /* WSDItemView.h */, 87 | D20428161BAA61420045E722 /* WSDItemView.m */, 88 | D20428171BAA61420045E722 /* WSDSelectionViewController.h */, 89 | D20428181BAA61420045E722 /* WSDSelectionViewController.m */, 90 | D20428191BAA61420045E722 /* WSDSelectionViewController.xib */, 91 | ); 92 | path = WSDSelectItem; 93 | sourceTree = ""; 94 | }; 95 | D2FB6F4F1BA6CC1700C6B394 = { 96 | isa = PBXGroup; 97 | children = ( 98 | D20428051BAA61420045E722 /* WSDItemViewDemo */, 99 | D2FB6F591BA6CC1700C6B394 /* Products */, 100 | 2F1512FF5AC0BB050A2ABF25 /* Frameworks */, 101 | ); 102 | sourceTree = ""; 103 | }; 104 | D2FB6F591BA6CC1700C6B394 /* Products */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | D2FB6F581BA6CC1700C6B394 /* WSDSelectItemDemo.app */, 108 | ); 109 | name = Products; 110 | sourceTree = ""; 111 | }; 112 | /* End PBXGroup section */ 113 | 114 | /* Begin PBXNativeTarget section */ 115 | D2FB6F571BA6CC1700C6B394 /* WSDSelectItemDemo */ = { 116 | isa = PBXNativeTarget; 117 | buildConfigurationList = D2FB6F7B1BA6CC1700C6B394 /* Build configuration list for PBXNativeTarget "WSDSelectItemDemo" */; 118 | buildPhases = ( 119 | D2FB6F541BA6CC1700C6B394 /* Sources */, 120 | D2FB6F551BA6CC1700C6B394 /* Frameworks */, 121 | D2FB6F561BA6CC1700C6B394 /* Resources */, 122 | ); 123 | buildRules = ( 124 | ); 125 | dependencies = ( 126 | ); 127 | name = WSDSelectItemDemo; 128 | productName = WSDSelectItemDemo; 129 | productReference = D2FB6F581BA6CC1700C6B394 /* WSDSelectItemDemo.app */; 130 | productType = "com.apple.product-type.application"; 131 | }; 132 | /* End PBXNativeTarget section */ 133 | 134 | /* Begin PBXProject section */ 135 | D2FB6F501BA6CC1700C6B394 /* Project object */ = { 136 | isa = PBXProject; 137 | attributes = { 138 | LastUpgradeCheck = 0640; 139 | ORGANIZATIONNAME = WSD; 140 | TargetAttributes = { 141 | D2FB6F571BA6CC1700C6B394 = { 142 | CreatedOnToolsVersion = 6.4; 143 | }; 144 | }; 145 | }; 146 | buildConfigurationList = D2FB6F531BA6CC1700C6B394 /* Build configuration list for PBXProject "WSDItemViewDemo" */; 147 | compatibilityVersion = "Xcode 3.2"; 148 | developmentRegion = English; 149 | hasScannedForEncodings = 0; 150 | knownRegions = ( 151 | en, 152 | Base, 153 | ); 154 | mainGroup = D2FB6F4F1BA6CC1700C6B394; 155 | productRefGroup = D2FB6F591BA6CC1700C6B394 /* Products */; 156 | projectDirPath = ""; 157 | projectRoot = ""; 158 | targets = ( 159 | D2FB6F571BA6CC1700C6B394 /* WSDSelectItemDemo */, 160 | ); 161 | }; 162 | /* End PBXProject section */ 163 | 164 | /* Begin PBXResourcesBuildPhase section */ 165 | D2FB6F561BA6CC1700C6B394 /* Resources */ = { 166 | isa = PBXResourcesBuildPhase; 167 | buildActionMask = 2147483647; 168 | files = ( 169 | D204281C1BAA61420045E722 /* Main.storyboard in Resources */, 170 | D204281D1BAA61420045E722 /* Images.xcassets in Resources */, 171 | D204281E1BAA61420045E722 /* Info.plist in Resources */, 172 | D20428221BAA61420045E722 /* WSDInputViewController.xib in Resources */, 173 | D204281B1BAA61420045E722 /* LaunchScreen.xib in Resources */, 174 | D20428251BAA61420045E722 /* WSDSelectionViewController.xib in Resources */, 175 | ); 176 | runOnlyForDeploymentPostprocessing = 0; 177 | }; 178 | /* End PBXResourcesBuildPhase section */ 179 | 180 | /* Begin PBXSourcesBuildPhase section */ 181 | D2FB6F541BA6CC1700C6B394 /* Sources */ = { 182 | isa = PBXSourcesBuildPhase; 183 | buildActionMask = 2147483647; 184 | files = ( 185 | D20428211BAA61420045E722 /* WSDInputViewController.m in Sources */, 186 | D20428201BAA61420045E722 /* ViewController.m in Sources */, 187 | D20428231BAA61420045E722 /* WSDItemView.m in Sources */, 188 | D204281F1BAA61420045E722 /* main.m in Sources */, 189 | D20428241BAA61420045E722 /* WSDSelectionViewController.m in Sources */, 190 | D204281A1BAA61420045E722 /* AppDelegate.m in Sources */, 191 | ); 192 | runOnlyForDeploymentPostprocessing = 0; 193 | }; 194 | /* End PBXSourcesBuildPhase section */ 195 | 196 | /* Begin PBXVariantGroup section */ 197 | D20428081BAA61420045E722 /* LaunchScreen.xib */ = { 198 | isa = PBXVariantGroup; 199 | children = ( 200 | D20428091BAA61420045E722 /* Base */, 201 | ); 202 | name = LaunchScreen.xib; 203 | sourceTree = ""; 204 | }; 205 | D204280A1BAA61420045E722 /* Main.storyboard */ = { 206 | isa = PBXVariantGroup; 207 | children = ( 208 | D204280B1BAA61420045E722 /* Base */, 209 | ); 210 | name = Main.storyboard; 211 | sourceTree = ""; 212 | }; 213 | /* End PBXVariantGroup section */ 214 | 215 | /* Begin XCBuildConfiguration section */ 216 | D2FB6F791BA6CC1700C6B394 /* Debug */ = { 217 | isa = XCBuildConfiguration; 218 | buildSettings = { 219 | ALWAYS_SEARCH_USER_PATHS = NO; 220 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 221 | CLANG_CXX_LIBRARY = "libc++"; 222 | CLANG_ENABLE_MODULES = YES; 223 | CLANG_ENABLE_OBJC_ARC = YES; 224 | CLANG_WARN_BOOL_CONVERSION = YES; 225 | CLANG_WARN_CONSTANT_CONVERSION = YES; 226 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 227 | CLANG_WARN_EMPTY_BODY = YES; 228 | CLANG_WARN_ENUM_CONVERSION = YES; 229 | CLANG_WARN_INT_CONVERSION = YES; 230 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 231 | CLANG_WARN_UNREACHABLE_CODE = YES; 232 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 233 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 234 | COPY_PHASE_STRIP = NO; 235 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 236 | ENABLE_STRICT_OBJC_MSGSEND = YES; 237 | GCC_C_LANGUAGE_STANDARD = gnu99; 238 | GCC_DYNAMIC_NO_PIC = NO; 239 | GCC_NO_COMMON_BLOCKS = YES; 240 | GCC_OPTIMIZATION_LEVEL = 0; 241 | GCC_PREPROCESSOR_DEFINITIONS = ( 242 | "DEBUG=1", 243 | "$(inherited)", 244 | ); 245 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 246 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 247 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 248 | GCC_WARN_UNDECLARED_SELECTOR = YES; 249 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 250 | GCC_WARN_UNUSED_FUNCTION = YES; 251 | GCC_WARN_UNUSED_VARIABLE = YES; 252 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 253 | MTL_ENABLE_DEBUG_INFO = YES; 254 | ONLY_ACTIVE_ARCH = YES; 255 | SDKROOT = iphoneos; 256 | }; 257 | name = Debug; 258 | }; 259 | D2FB6F7A1BA6CC1700C6B394 /* Release */ = { 260 | isa = XCBuildConfiguration; 261 | buildSettings = { 262 | ALWAYS_SEARCH_USER_PATHS = NO; 263 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 264 | CLANG_CXX_LIBRARY = "libc++"; 265 | CLANG_ENABLE_MODULES = YES; 266 | CLANG_ENABLE_OBJC_ARC = YES; 267 | CLANG_WARN_BOOL_CONVERSION = YES; 268 | CLANG_WARN_CONSTANT_CONVERSION = YES; 269 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 270 | CLANG_WARN_EMPTY_BODY = YES; 271 | CLANG_WARN_ENUM_CONVERSION = YES; 272 | CLANG_WARN_INT_CONVERSION = YES; 273 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 274 | CLANG_WARN_UNREACHABLE_CODE = YES; 275 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 276 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 277 | COPY_PHASE_STRIP = NO; 278 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 279 | ENABLE_NS_ASSERTIONS = NO; 280 | ENABLE_STRICT_OBJC_MSGSEND = YES; 281 | GCC_C_LANGUAGE_STANDARD = gnu99; 282 | GCC_NO_COMMON_BLOCKS = YES; 283 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 284 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 285 | GCC_WARN_UNDECLARED_SELECTOR = YES; 286 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 287 | GCC_WARN_UNUSED_FUNCTION = YES; 288 | GCC_WARN_UNUSED_VARIABLE = YES; 289 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 290 | MTL_ENABLE_DEBUG_INFO = NO; 291 | SDKROOT = iphoneos; 292 | VALIDATE_PRODUCT = YES; 293 | }; 294 | name = Release; 295 | }; 296 | D2FB6F7C1BA6CC1700C6B394 /* Debug */ = { 297 | isa = XCBuildConfiguration; 298 | buildSettings = { 299 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 300 | INFOPLIST_FILE = "$(SRCROOT)/WSDItemViewDemo/Info.plist"; 301 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 302 | PRODUCT_NAME = "$(TARGET_NAME)"; 303 | }; 304 | name = Debug; 305 | }; 306 | D2FB6F7D1BA6CC1700C6B394 /* Release */ = { 307 | isa = XCBuildConfiguration; 308 | buildSettings = { 309 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 310 | INFOPLIST_FILE = "$(SRCROOT)/WSDItemViewDemo/Info.plist"; 311 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 312 | PRODUCT_NAME = "$(TARGET_NAME)"; 313 | }; 314 | name = Release; 315 | }; 316 | /* End XCBuildConfiguration section */ 317 | 318 | /* Begin XCConfigurationList section */ 319 | D2FB6F531BA6CC1700C6B394 /* Build configuration list for PBXProject "WSDItemViewDemo" */ = { 320 | isa = XCConfigurationList; 321 | buildConfigurations = ( 322 | D2FB6F791BA6CC1700C6B394 /* Debug */, 323 | D2FB6F7A1BA6CC1700C6B394 /* Release */, 324 | ); 325 | defaultConfigurationIsVisible = 0; 326 | defaultConfigurationName = Release; 327 | }; 328 | D2FB6F7B1BA6CC1700C6B394 /* Build configuration list for PBXNativeTarget "WSDSelectItemDemo" */ = { 329 | isa = XCConfigurationList; 330 | buildConfigurations = ( 331 | D2FB6F7C1BA6CC1700C6B394 /* Debug */, 332 | D2FB6F7D1BA6CC1700C6B394 /* Release */, 333 | ); 334 | defaultConfigurationIsVisible = 0; 335 | defaultConfigurationName = Release; 336 | }; 337 | /* End XCConfigurationList section */ 338 | }; 339 | rootObject = D2FB6F501BA6CC1700C6B394 /* Project object */; 340 | } 341 | --------------------------------------------------------------------------------