├── Screenshots ├── Screenshot.png └── Interface Builder.png ├── TagListObjC.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── project.pbxproj ├── TagListView_Demo ├── ViewController.h ├── AppDelegate.h ├── main.m ├── ViewController.m ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── AppDelegate.m └── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── .travis.yml ├── .gitignore ├── LICENSE ├── TagListView ├── TagView.h ├── TagListView.h ├── TagView.m └── TagListView.m ├── TagListView-ObjC.podspec └── README.md /Screenshots/Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulimento/TagListView-ObjC/HEAD/Screenshots/Screenshot.png -------------------------------------------------------------------------------- /Screenshots/Interface Builder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pulimento/TagListView-ObjC/HEAD/Screenshots/Interface Builder.png -------------------------------------------------------------------------------- /TagListObjC.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TagListView_Demo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // TagObjc 4 | // 5 | // Created by Javi Pulido on 16/7/15. 6 | // Copyright (c) 2015 Javi Pulido. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode8.3 3 | 4 | before_install: 5 | - env 6 | - gem install xcpretty --no-rdoc --no-ri --no-document --quiet 7 | - xcpretty --version 8 | 9 | script: 10 | - xcodebuild clean build -project TagListObjC.xcodeproj -scheme TagObjc -sdk iphonesimulator -configuration Debug | xcpretty -c 11 | -------------------------------------------------------------------------------- /TagListView_Demo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // TagObjc 4 | // 5 | // Created by Javi Pulido on 16/7/15. 6 | // Copyright (c) 2015 Javi Pulido. 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 | -------------------------------------------------------------------------------- /TagListView_Demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TagObjc 4 | // 5 | // Created by Javi Pulido on 16/7/15. 6 | // Copyright (c) 2015 Javi Pulido. 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 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Build generated 2 | build/ 3 | DerivedData 4 | 5 | ## Various settings 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata 15 | 16 | ## Other 17 | *.xccheckout 18 | *.moved-aside 19 | *.xcuserstate 20 | *.xcscmblueprint 21 | 22 | ## Obj-C/Swift specific 23 | *.hmap 24 | *.ipa 25 | 26 | # CocoaPods 27 | # 28 | # We recommend against adding the Pods directory to your .gitignore. However 29 | # you should judge for yourself, the pros and cons are mentioned at: 30 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 31 | # 32 | #Pods/ 33 | 34 | # Carthage 35 | # 36 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 37 | # Carthage/Checkouts 38 | 39 | Carthage/Build 40 | 41 | 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Javi Pulido 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /TagListView/TagView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TagView.h 3 | // TagObjc 4 | // 5 | // Created by Javi Pulido on 16/7/15. 6 | // Copyright (c) 2015 Javi Pulido. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | IB_DESIGNABLE 12 | 13 | @interface TagView : UIButton 14 | 15 | - (instancetype) initWithTitle:(NSString *)title; 16 | 17 | @property (nonatomic) IBInspectable CGFloat cornerRadius; 18 | @property (nonatomic) IBInspectable CGFloat borderWidth; 19 | @property (nonatomic) IBInspectable CGFloat paddingY; 20 | @property (nonatomic) IBInspectable CGFloat paddingX; 21 | @property (nonatomic, strong) IBInspectable UIColor *borderColor; 22 | @property (nonatomic, strong) IBInspectable UIColor *textColor; 23 | @property (nonatomic, strong) IBInspectable UIColor *selectedTextColor; 24 | @property (nonatomic, strong) IBInspectable UIColor *tagBackgroundColor; 25 | @property (nonatomic, strong) IBInspectable UIColor *highlightedBackgroundColor; 26 | @property (nonatomic, strong) IBInspectable UIColor *selectedBackgroundColor; 27 | @property (nonatomic, strong) IBInspectable UIColor *selectedBorderColor; 28 | @property (nonatomic, assign) BOOL isHighlighted; 29 | @property (nonatomic, assign) BOOL isSelected; 30 | @property (nonatomic, strong) UIFont *textFont; 31 | 32 | @property (nonatomic, copy) void (^onTap)(TagView *); 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /TagListView_Demo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // TagObjc 4 | // 5 | // Created by Javi Pulido on 16/7/15. 6 | // Copyright (c) 2015 Javi Pulido. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "TagListView.h" 11 | #import "TagView.h" 12 | 13 | @interface ViewController () 14 | @property (weak, nonatomic) IBOutlet TagListView *tagListView; 15 | 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | 23 | // Add tags programmatically 24 | [[self.tagListView addTag:@"Those"] setOnTap:^(TagView *tagView) { 25 | NSLog(@"on tap tagView:%@", tagView); 26 | }]; 27 | [self.tagListView addTag:@"are"]; 28 | [self.tagListView addTag:@"some"]; 29 | [self.tagListView addTag:@"example"]; 30 | [self.tagListView addTag:@"tags"]; 31 | [self.tagListView addTagsAccordingToDataSourceArray:@[@"from", @"array", @"too"] withOnTapForEach:^(TagView *tagView) { 32 | tagView.backgroundColor = [UIColor blueColor]; 33 | }]; 34 | 35 | UIGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(listPressed)]; 36 | [self.tagListView addGestureRecognizer:recognizer]; 37 | } 38 | 39 | - (void)listPressed { 40 | [[self tagListView] addTag:[NSString stringWithFormat:@"%@",[NSDate date]]]; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /TagListView_Demo/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 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /TagListView/TagListView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TagListView.h 3 | // TagObjc 4 | // 5 | // Created by Javi Pulido on 16/7/15. 6 | // Copyright (c) 2015 Javi Pulido. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TagView; 12 | 13 | IB_DESIGNABLE 14 | 15 | @interface TagListView : UIView 16 | 17 | typedef NS_ENUM(NSUInteger, TagListAlignment) { 18 | alignLeft = 0, 19 | alignCenter, 20 | alignRight 21 | }; 22 | 23 | @property (nonatomic) IBInspectable UIColor *textColor; 24 | @property (nonatomic) IBInspectable UIColor *tagBackgroundColor; 25 | @property (nonatomic) IBInspectable CGFloat cornerRadius; 26 | @property (nonatomic) IBInspectable CGFloat borderWidth; 27 | @property (nonatomic) IBInspectable UIColor *borderColor; 28 | @property (nonatomic) IBInspectable CGFloat paddingY; 29 | @property (nonatomic) IBInspectable CGFloat paddingX; 30 | @property (nonatomic) IBInspectable CGFloat marginY; 31 | @property (nonatomic) IBInspectable CGFloat marginX; 32 | @property (nonatomic) TagListAlignment alignment; 33 | @property (nonatomic) UIFont *textFont; 34 | 35 | 36 | // Delegate variables 37 | @property (nonatomic) CGFloat tagViewHeight; 38 | @property (nonatomic) NSMutableArray *tagViews; 39 | @property (nonatomic) NSInteger rows; 40 | 41 | - (void)addTagsAccordingToDataSourceArray:(NSArray *)dataSourceArray withOnTapForEach:(void(^)(TagView *tagView))onTapBlock; 42 | - (TagView *)addTag:(NSString *)title; 43 | - (void)removeTag:(NSString *)title; 44 | - (void)removeAllTags; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /TagListView-ObjC.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint TagListView-ObjC.podspec' to ensure this is a 3 | # valid spec and remove all comments before submitting the spec. 4 | # 5 | # Any lines starting with a # are optional, but encouraged 6 | # 7 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 8 | # 9 | 10 | Pod::Spec.new do |s| 11 | s.name = "TagListView-ObjC" 12 | s.version = "0.1.1" 13 | s.summary = "Simple but highly customizable iOS tag list view, in Objective-C." 14 | s.description = <<-DESC 15 | "Simple but highly customizable iOS tag list view, in Objective-C. Based on Swift version by XHacker" 16 | DESC 17 | s.homepage = "https://github.com/pulimento/TagListView-ObjC" 18 | # s.screenshots = "https://raw.githubusercontent.com/pulimento/TagListView-ObjC/master/Screenshots/Interface%20Builder.png", "https://raw.githubusercontent.com/pulimento/TagListView-ObjC/master/Screenshots/Screenshot.png" 19 | s.license = 'MIT' 20 | s.author = { "Javi Pulido" => "pulimento+github@gmail.com" } 21 | s.source = { :git => "https://github.com/pulimento/TagListView-ObjC.git", :tag => s.version.to_s } 22 | # s.social_media_url = 'https://twitter.com/' 23 | 24 | s.platform = :ios, '7.0' 25 | s.requires_arc = true 26 | 27 | s.source_files = 'TagListView/{*.h,*.m}' 28 | s.resource_bundles = { 29 | 'TagListView-ObjC' => ['Pod/Assets/*.png'] 30 | } 31 | 32 | # s.public_header_files = 'Pod/Classes/**/*.h' 33 | # s.frameworks = 'UIKit', 'MapKit' 34 | # s.dependency 'AFNetworking', '~> 2.3' 35 | end 36 | -------------------------------------------------------------------------------- /TagListView_Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 0.1.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 170411 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 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /TagListView_Demo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // TagObjc 4 | // 5 | // Created by Javi Pulido on 16/7/15. 6 | // Copyright (c) 2015 Javi Pulido. 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TagListView-ObjC 2 | 3 | [![Version](https://img.shields.io/cocoapods/v/TagListView-ObjC.svg?style=flat)](http://cocoapods.org/pods/TagListView-ObjC) 4 | [![License](https://img.shields.io/cocoapods/l/TagListView-ObjC.svg?style=flat)](http://cocoapods.org/pods/TagListView-ObjC) 5 | 6 | Simple but highly customizable iOS tag list view, in Objective-C. The APIs are *not* stable before 1.0. Use it if you don't want to use the Swift version. 7 | 8 | Supports Storyboard, Auto Layout, and @IBDesignable. 9 | 10 | Screenshot 11 | 12 | This project is a port to ObjC from XHacker's [TagListView](https://github.com/xhacker/TagListView) library, I tried to remain as compatible as possible. This README itself (and the images/screenshots) are from XHacker's too. 13 | 14 | My motivation to do this: At work, I had an ObjC-written project, and want to use that library. I didn't like at all that my app increases 3MB on size (because Swift libs) for only a few code files. Using this version, the increase in size is very tiny (<5kb). 15 | 16 | ## Usage 17 | 18 | The most convinient way is to use Storyboard, where you can set the attributes right in the Interface Builder. With [@IBDesignable](http://nshipster.com/ibinspectable-ibdesignable/), you can see the preview in real time. 19 | 20 | Interface Builder 21 | 22 | You can add tag to the tag list view, or set custom font through code: 23 | 24 | ```Objective-C 25 | tagListView.textFont = [UIFont systemFontOfSize:24]; 26 | 27 | [tagListView addTag:@"meow"]; 28 | 29 | [tagListView removeTag:@"meow"]; // all tags with title “meow” will be removed 30 | [tagListView removeAllTags]; 31 | ``` 32 | 33 | 34 | You can also customize a particular tag: 35 | 36 | ```Objective-C 37 | TagView *tagView = [tagListView addTag:@"blue"]; 38 | tagView.tagBackgroundColor = [UIColor blueColor]; 39 | ``` 40 | 41 | Be aware that if you update a property (e.g. `tagBackgroundColor`) for a `TagListView`, all the inner `TagView`s will be updated. 42 | 43 | ## Installation 44 | 45 | Turns out that installation via CocoaPods may be buggy. If you can't make it work from Interface Builder, please check this [Stack Overflow answer](http://stackoverflow.com/questions/26567650/live-rendering-a-custom-component-using-ib-designable-from-a-pod-dependency/28108248#28108248). Using it without CocoaPods seems to work perfectly, though. 46 | 47 | TagListView-ObjC is available through [CocoaPods](http://cocoapods.org). To install 48 | it, simply add the following line to your Podfile: 49 | 50 | ```ruby 51 | pod "TagListView-ObjC" 52 | ``` 53 | 54 | Instead, if you don't want to use CocoaPods, you can simply checkout the sample project. Library files are in the **"TagListView/"** folder, simply drag it into your project. 55 | 56 | ## Contribution 57 | 58 | Pull requests are welcome! If you want to do something big, please open an issue to let me know first. 59 | 60 | ## License 61 | 62 | TagListView-ObjC is available under the MIT license. See the LICENSE file for more info. 63 | -------------------------------------------------------------------------------- /TagListView_Demo/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 | -------------------------------------------------------------------------------- /TagListView/TagView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TagView.m 3 | // TagObjc 4 | // 5 | // Created by Javi Pulido on 16/7/15. 6 | // Copyright (c) 2015 Javi Pulido. All rights reserved. 7 | // 8 | 9 | #import "TagView.h" 10 | 11 | @implementation TagView 12 | 13 | @synthesize textColor =_textColor; 14 | @synthesize textFont = _textFont; 15 | 16 | - (instancetype) initWithCoder:(NSCoder *)aDecoder { 17 | self = [super initWithCoder:aDecoder]; 18 | if(self) { 19 | [self setupView]; 20 | } 21 | return self; 22 | } 23 | 24 | - (instancetype) initWithTitle:(NSString *)title { 25 | self = [super init]; 26 | if(self) { 27 | [self setTitle:title forState:UIControlStateNormal]; 28 | [self setupView]; 29 | } 30 | return self; 31 | } 32 | 33 | - (void)setupView { 34 | CGSize intrinsicSize = [self intrinsicContentSize]; 35 | self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, intrinsicSize.width, intrinsicSize.height); 36 | } 37 | 38 | # pragma mark - Getters (default values) 39 | 40 | - (UIColor *)textColor { 41 | if(!_textColor) { 42 | _textColor = [UIColor whiteColor]; 43 | } 44 | return _textColor; 45 | } 46 | 47 | - (UIFont *)textFont { 48 | if(!_textFont) { 49 | _textFont = [UIFont systemFontOfSize:12]; 50 | } 51 | return _textFont; 52 | } 53 | 54 | # pragma mark - Setters 55 | 56 | - (void)setCornerRadius:(CGFloat)cornerRadius { 57 | _cornerRadius = cornerRadius; 58 | self.layer.cornerRadius = cornerRadius; 59 | self.layer.masksToBounds = self.cornerRadius > 0; 60 | } 61 | 62 | - (void)setBorderWidth:(CGFloat)borderWidth { 63 | _borderWidth = borderWidth; 64 | self.layer.borderWidth = borderWidth; 65 | } 66 | 67 | - (void)setBorderColor:(UIColor *)borderColor { 68 | _borderColor = borderColor; 69 | self.layer.borderColor = borderColor.CGColor; 70 | [self reloadStyles]; 71 | } 72 | 73 | - (void)setTextColor:(UIColor *)textColor { 74 | _textColor = textColor; 75 | [self setTitleColor:textColor forState:UIControlStateNormal]; 76 | [self reloadStyles]; 77 | } 78 | 79 | - (void)selectedTextColor:(UIColor *)selectedTextColor { 80 | _selectedTextColor = selectedTextColor; 81 | [self setTitleColor:selectedTextColor forState:UIControlStateSelected]; 82 | [self reloadStyles]; 83 | } 84 | 85 | - (void)setPaddingY:(CGFloat)paddingY { 86 | _paddingY = paddingY; 87 | UIEdgeInsets insets = [self titleEdgeInsets]; 88 | insets.top = paddingY; 89 | insets.bottom = paddingY; 90 | [self setTitleEdgeInsets:insets]; 91 | } 92 | 93 | - (void)setPaddingX:(CGFloat)paddingX { 94 | _paddingX = paddingX; 95 | UIEdgeInsets insets = [self titleEdgeInsets]; 96 | insets.left = paddingX; 97 | insets.right = paddingX; 98 | [self setTitleEdgeInsets:insets]; 99 | } 100 | 101 | - (void)setTextFont:(UIFont *)textFont { 102 | _textFont = textFont; 103 | [self.titleLabel setFont:textFont]; 104 | } 105 | 106 | - (void)setTagBackgroundColor:(UIColor *)tagBackgroundColor { 107 | _tagBackgroundColor = tagBackgroundColor; 108 | [self setBackgroundColor:tagBackgroundColor]; 109 | [self reloadStyles]; 110 | } 111 | 112 | - (void)setHighlightedBackgroundColor:(UIColor *)highlightedBackgroundColor { 113 | _highlightedBackgroundColor = highlightedBackgroundColor; 114 | [self reloadStyles]; 115 | } 116 | 117 | - (void)setSelectedBackgroundColor:(UIColor *)selectedBackgroundColor { 118 | _selectedBackgroundColor = selectedBackgroundColor; 119 | [self reloadStyles]; 120 | } 121 | 122 | - (void)setSelectedBorderColor:(UIColor *)selectedBorderColor { 123 | _selectedBorderColor = selectedBorderColor; 124 | [self reloadStyles]; 125 | } 126 | 127 | 128 | - (void)setIsHighlighted:(BOOL)isHighlighted{ 129 | _isHighlighted = isHighlighted; 130 | [self reloadStyles]; 131 | } 132 | 133 | - (void)setIsSelected:(BOOL)isSelected{ 134 | _isSelected = isSelected; 135 | [self reloadStyles]; 136 | } 137 | 138 | 139 | 140 | # pragma mark - Methods 141 | 142 | - (CGSize) intrinsicContentSize { 143 | CGSize size = [self.titleLabel.text sizeWithAttributes:@{NSFontAttributeName: self.titleLabel.font}]; 144 | 145 | size.height = self.titleLabel.font.pointSize + self.paddingY * 2; 146 | size.width += self.paddingX * 2; 147 | 148 | if(size.width < size.height) { 149 | size.width = size.height; 150 | } 151 | 152 | return size; 153 | } 154 | 155 | - (void)reloadStyles { 156 | if(self.isHighlighted) { 157 | if([self highlightedBackgroundColor]) { 158 | [self setBackgroundColor:[self highlightedBackgroundColor]]; 159 | } 160 | } else if (self.isSelected) { 161 | if([self selectedBackgroundColor]) { 162 | [self setBackgroundColor:[self selectedBackgroundColor]]; 163 | } else { 164 | [self setTagBackgroundColor:[self tagBackgroundColor]]; 165 | } 166 | if([self selectedBorderColor]) { 167 | [[self layer] setBorderColor:[[self selectedBorderColor] CGColor]]; 168 | } else { 169 | [[self layer] setBorderColor:[[self borderColor] CGColor]]; 170 | } 171 | [self setTitleColor:[self selectedTextColor] forState:UIControlStateNormal]; 172 | } else { 173 | [self setBackgroundColor:[self tagBackgroundColor]]; 174 | [[self layer] setBorderColor:[[self borderColor] CGColor]]; 175 | [self setTitleColor:[self textColor] forState:UIControlStateNormal]; 176 | } 177 | } 178 | 179 | @end 180 | -------------------------------------------------------------------------------- /TagListView_Demo/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 | 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 | -------------------------------------------------------------------------------- /TagListView/TagListView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TagListView.m 3 | // TagObjc 4 | // 5 | // Created by Javi Pulido on 16/7/15. 6 | // Copyright (c) 2015 Javi Pulido. All rights reserved. 7 | // 8 | 9 | #import "TagListView.h" 10 | #import "TagView.h" 11 | 12 | @interface TagListView () 13 | 14 | @end 15 | 16 | @implementation TagListView 17 | 18 | // Required by Interface Builder 19 | #if TARGET_INTERFACE_BUILDER 20 | -(instancetype)initWithFrame:(CGRect)frame { 21 | self = [super initWithFrame:frame]; 22 | return self; 23 | } 24 | #endif 25 | 26 | - (NSMutableArray *)tagViews { 27 | if(!_tagViews) { 28 | [self setTagViews:[[NSMutableArray alloc] init]]; 29 | } 30 | return _tagViews; 31 | } 32 | 33 | - (void)setTextColor:(UIColor *)textColor { 34 | _textColor = textColor; 35 | for(TagView *tagView in [self tagViews]) { 36 | [tagView setTextColor:textColor]; 37 | } 38 | } 39 | 40 | - (void)setTagBackgroundColor:(UIColor *)tagBackgroundColor { 41 | _tagBackgroundColor = tagBackgroundColor; 42 | for(TagView *tagView in [self tagViews]) { 43 | [tagView setBackgroundColor:tagBackgroundColor]; 44 | } 45 | } 46 | 47 | - (void)setCornerRadius:(CGFloat)cornerRadius { 48 | _cornerRadius = cornerRadius; 49 | for(TagView *tagView in [self tagViews]) { 50 | [tagView setCornerRadius:cornerRadius]; 51 | } 52 | } 53 | 54 | - (void)setBorderWidth:(CGFloat)borderWidth { 55 | _borderWidth = borderWidth; 56 | for(TagView *tagView in [self tagViews]) { 57 | [tagView setBorderWidth:borderWidth]; 58 | } 59 | } 60 | 61 | - (void)setBorderColor:(UIColor *)borderColor { 62 | _borderColor = borderColor; 63 | for(TagView *tagView in [self tagViews]) { 64 | [tagView setBorderColor:borderColor]; 65 | } 66 | } 67 | 68 | - (void)setPaddingY:(CGFloat)paddingY { 69 | _paddingY = paddingY; 70 | for(TagView *tagView in [self tagViews]) { 71 | [tagView setPaddingY:paddingY]; 72 | } 73 | } 74 | 75 | - (void)setPaddingX:(CGFloat)paddingX { 76 | _paddingX = paddingX; 77 | for(TagView *tagView in [self tagViews]) { 78 | [tagView setPaddingX:paddingX]; 79 | } 80 | } 81 | 82 | - (void)setMarginY:(CGFloat)marginY { 83 | _marginY = marginY; 84 | [self rearrangeViews]; 85 | } 86 | 87 | - (void)setMarginX:(CGFloat)marginX { 88 | _marginX = marginX; 89 | [self rearrangeViews]; 90 | } 91 | 92 | - (void)setRows:(int)rows { 93 | _rows = rows; 94 | [self invalidateIntrinsicContentSize]; 95 | } 96 | 97 | - (void)setAlignment:(TagListAlignment)alignment { 98 | _alignment = alignment; 99 | [self rearrangeViews]; 100 | } 101 | 102 | # pragma mark - Interface builder 103 | 104 | - (void)prepareForInterfaceBuilder { 105 | [self addTag:@"Thanks"]; 106 | [self addTag:@"for"]; 107 | [self addTag:@"using"]; 108 | [self addTag:@"TagListView"]; 109 | } 110 | 111 | # pragma mark - Layout 112 | 113 | - (void)layoutSubviews { 114 | [super layoutSubviews]; 115 | [self rearrangeViews]; 116 | } 117 | 118 | - (void)rearrangeViews { 119 | for(TagView *tagView in [self tagViews]) { 120 | [tagView removeFromSuperview]; 121 | } 122 | 123 | int currentRow = 0; 124 | int currentRowTagCount = 0; 125 | CGFloat currentRowWidth = 0; 126 | for(TagView *tagView in [self tagViews]) { 127 | CGRect tagViewFrame = [tagView frame]; 128 | tagViewFrame.size = [tagView intrinsicContentSize]; 129 | [tagView setFrame:tagViewFrame]; 130 | self.tagViewHeight = tagViewFrame.size.height; 131 | 132 | if (currentRowTagCount == 0 || (currentRowWidth + tagView.frame.size.width + [self marginX]) > self.frame.size.width) { 133 | currentRow += 1; 134 | CGRect tempFrame = [tagView frame]; 135 | tempFrame.origin.x = 0; 136 | tempFrame.origin.y = (currentRow - 1) * ([self tagViewHeight] + [self marginY]); 137 | [tagView setFrame:tempFrame]; 138 | 139 | currentRowTagCount = 1; 140 | currentRowWidth = tagView.frame.size.width + [self marginX]; 141 | } else { 142 | CGRect tempFrame = [tagView frame]; 143 | tempFrame.origin.x = currentRowWidth; 144 | tempFrame.origin.y = (currentRow - 1) * ([self tagViewHeight] + [self marginY]); 145 | [tagView setFrame:tempFrame]; 146 | 147 | currentRowTagCount += 1; 148 | currentRowWidth += tagView.frame.size.width + [self marginX]; 149 | } 150 | 151 | [self addSubview:tagView]; 152 | } 153 | self.rows = currentRow; 154 | } 155 | 156 | # pragma mark - Manage tags 157 | 158 | - (CGSize) intrinsicContentSize { 159 | CGFloat height = [self rows] * ([self tagViewHeight] + [self marginY]); 160 | if([self rows] > 0) { 161 | height -= [self marginY]; 162 | } 163 | return CGSizeMake(self.frame.size.width, height); 164 | } 165 | 166 | - (TagView *)addTag:(NSString *)title { 167 | TagView *tagView = [[TagView alloc] initWithTitle:title]; 168 | 169 | [tagView setTextColor: [self textColor]]; 170 | [tagView setBackgroundColor: [self tagBackgroundColor]]; 171 | [tagView setCornerRadius: [self cornerRadius]]; 172 | [tagView setBorderWidth: [self borderWidth]]; 173 | [tagView setBorderColor: [self borderColor]]; 174 | [tagView setPaddingY: [self paddingY]]; 175 | [tagView setPaddingX: [self paddingX]]; 176 | [tagView setTextFont: [self textFont]]; 177 | 178 | [tagView addTarget:self action:@selector(tagPressed:) forControlEvents:UIControlEventTouchUpInside]; 179 | 180 | [self addTagView: tagView]; 181 | 182 | return tagView; 183 | } 184 | 185 | - (void) addTagView:(TagView *)tagView { 186 | [[self tagViews] insertObject:tagView atIndex:[self.tagViews count]]; 187 | [self rearrangeViews]; 188 | } 189 | 190 | - (void)addTagsAccordingToDataSourceArray:(NSArray *)dataSourceArray withOnTapForEach:(void(^)(TagView *tagView))onTapBlock 191 | { 192 | for (NSString *tagName in dataSourceArray) { 193 | TagView *tagView = [self addTag:tagName]; 194 | 195 | if (onTapBlock) 196 | tagView.onTap = onTapBlock; 197 | } 198 | } 199 | 200 | - (void)removeTag:(NSString *)title { 201 | // Author's note: Loop the array in reversed order to remove items during loop 202 | for(int index = (int)[[self tagViews] count] - 1 ; index <= 0; index--) { 203 | TagView *tagView = [[self tagViews] objectAtIndex:index]; 204 | if([[tagView currentTitle] isEqualToString:title]) { 205 | [tagView removeFromSuperview]; 206 | [[self tagViews] removeObjectAtIndex:index]; 207 | } 208 | } 209 | } 210 | 211 | - (void)removeAllTags { 212 | for(TagView *tagView in [self tagViews]) { 213 | [tagView removeFromSuperview]; 214 | } 215 | [self setTagViews:[[NSMutableArray alloc] init]]; 216 | [self rearrangeViews]; 217 | } 218 | 219 | - (void)tagPressed:(TagView *)sender { 220 | if (sender.onTap) { 221 | sender.onTap(sender); 222 | } 223 | } 224 | 225 | @end 226 | -------------------------------------------------------------------------------- /TagListObjC.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 47; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1506AF7F1B7C9586004812B0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1506AF751B7C9586004812B0 /* AppDelegate.m */; }; 11 | 1506AF801B7C9586004812B0 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1506AF761B7C9586004812B0 /* LaunchScreen.xib */; }; 12 | 1506AF811B7C9586004812B0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1506AF781B7C9586004812B0 /* Main.storyboard */; }; 13 | 1506AF821B7C9586004812B0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1506AF7A1B7C9586004812B0 /* Images.xcassets */; }; 14 | 1506AF841B7C9586004812B0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1506AF7C1B7C9586004812B0 /* main.m */; }; 15 | 1506AF851B7C9586004812B0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1506AF7E1B7C9586004812B0 /* ViewController.m */; }; 16 | 15F097271B7B75A900D7E1B3 /* .gitignore in Resources */ = {isa = PBXBuildFile; fileRef = 15F097261B7B75A900D7E1B3 /* .gitignore */; }; 17 | 15F097341B7B798A00D7E1B3 /* TagListView.m in Sources */ = {isa = PBXBuildFile; fileRef = 15F097311B7B798A00D7E1B3 /* TagListView.m */; }; 18 | 15F097351B7B798A00D7E1B3 /* TagView.m in Sources */ = {isa = PBXBuildFile; fileRef = 15F097331B7B798A00D7E1B3 /* TagView.m */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | 1506AF741B7C9586004812B0 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 23 | 1506AF751B7C9586004812B0 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 24 | 1506AF771B7C9586004812B0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 25 | 1506AF791B7C9586004812B0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 26 | 1506AF7A1B7C9586004812B0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 27 | 1506AF7B1B7C9586004812B0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 28 | 1506AF7C1B7C9586004812B0 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29 | 1506AF7D1B7C9586004812B0 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 30 | 1506AF7E1B7C9586004812B0 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 31 | 1518196C1B57BE89006A1000 /* TagObjc.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TagObjc.app; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | 15F097261B7B75A900D7E1B3 /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitignore; sourceTree = ""; }; 33 | 15F097301B7B798A00D7E1B3 /* TagListView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TagListView.h; sourceTree = ""; }; 34 | 15F097311B7B798A00D7E1B3 /* TagListView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TagListView.m; sourceTree = ""; }; 35 | 15F097321B7B798A00D7E1B3 /* TagView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TagView.h; sourceTree = ""; }; 36 | 15F097331B7B798A00D7E1B3 /* TagView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TagView.m; sourceTree = ""; }; 37 | /* End PBXFileReference section */ 38 | 39 | /* Begin PBXFrameworksBuildPhase section */ 40 | 151819691B57BE89006A1000 /* Frameworks */ = { 41 | isa = PBXFrameworksBuildPhase; 42 | buildActionMask = 2147483647; 43 | files = ( 44 | ); 45 | runOnlyForDeploymentPostprocessing = 0; 46 | }; 47 | /* End PBXFrameworksBuildPhase section */ 48 | 49 | /* Begin PBXGroup section */ 50 | 1506AF731B7C9586004812B0 /* TagListView_Demo */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | 1506AF7D1B7C9586004812B0 /* ViewController.h */, 54 | 1506AF7E1B7C9586004812B0 /* ViewController.m */, 55 | 1506AF781B7C9586004812B0 /* Main.storyboard */, 56 | 1506AF861B7C95B7004812B0 /* Supporting Files */, 57 | ); 58 | path = TagListView_Demo; 59 | sourceTree = ""; 60 | }; 61 | 1506AF861B7C95B7004812B0 /* Supporting Files */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | 1506AF741B7C9586004812B0 /* AppDelegate.h */, 65 | 1506AF751B7C9586004812B0 /* AppDelegate.m */, 66 | 1506AF761B7C9586004812B0 /* LaunchScreen.xib */, 67 | 1506AF7A1B7C9586004812B0 /* Images.xcassets */, 68 | 1506AF7B1B7C9586004812B0 /* Info.plist */, 69 | 1506AF7C1B7C9586004812B0 /* main.m */, 70 | ); 71 | name = "Supporting Files"; 72 | sourceTree = ""; 73 | }; 74 | 151819631B57BE88006A1000 = { 75 | isa = PBXGroup; 76 | children = ( 77 | 15F0972F1B7B798A00D7E1B3 /* TagListView */, 78 | 1506AF731B7C9586004812B0 /* TagListView_Demo */, 79 | 1518196D1B57BE89006A1000 /* Products */, 80 | 15F097261B7B75A900D7E1B3 /* .gitignore */, 81 | ); 82 | sourceTree = ""; 83 | }; 84 | 1518196D1B57BE89006A1000 /* Products */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 1518196C1B57BE89006A1000 /* TagObjc.app */, 88 | ); 89 | name = Products; 90 | sourceTree = ""; 91 | }; 92 | 15F0972F1B7B798A00D7E1B3 /* TagListView */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 15F097301B7B798A00D7E1B3 /* TagListView.h */, 96 | 15F097311B7B798A00D7E1B3 /* TagListView.m */, 97 | 15F097321B7B798A00D7E1B3 /* TagView.h */, 98 | 15F097331B7B798A00D7E1B3 /* TagView.m */, 99 | ); 100 | path = TagListView; 101 | sourceTree = ""; 102 | }; 103 | /* End PBXGroup section */ 104 | 105 | /* Begin PBXNativeTarget section */ 106 | 1518196B1B57BE89006A1000 /* TagObjc */ = { 107 | isa = PBXNativeTarget; 108 | buildConfigurationList = 1518198F1B57BE89006A1000 /* Build configuration list for PBXNativeTarget "TagObjc" */; 109 | buildPhases = ( 110 | 151819681B57BE89006A1000 /* Sources */, 111 | 151819691B57BE89006A1000 /* Frameworks */, 112 | 1518196A1B57BE89006A1000 /* Resources */, 113 | ); 114 | buildRules = ( 115 | ); 116 | dependencies = ( 117 | ); 118 | name = TagObjc; 119 | productName = TagObjc; 120 | productReference = 1518196C1B57BE89006A1000 /* TagObjc.app */; 121 | productType = "com.apple.product-type.application"; 122 | }; 123 | /* End PBXNativeTarget section */ 124 | 125 | /* Begin PBXProject section */ 126 | 151819641B57BE89006A1000 /* Project object */ = { 127 | isa = PBXProject; 128 | attributes = { 129 | LastUpgradeCheck = 0830; 130 | ORGANIZATIONNAME = Guadaltech; 131 | TargetAttributes = { 132 | 1518196B1B57BE89006A1000 = { 133 | CreatedOnToolsVersion = 6.4; 134 | }; 135 | }; 136 | }; 137 | buildConfigurationList = 151819671B57BE89006A1000 /* Build configuration list for PBXProject "TagListObjC" */; 138 | compatibilityVersion = "Xcode 6.3"; 139 | developmentRegion = English; 140 | hasScannedForEncodings = 0; 141 | knownRegions = ( 142 | en, 143 | Base, 144 | ); 145 | mainGroup = 151819631B57BE88006A1000; 146 | productRefGroup = 1518196D1B57BE89006A1000 /* Products */; 147 | projectDirPath = ""; 148 | projectRoot = ""; 149 | targets = ( 150 | 1518196B1B57BE89006A1000 /* TagObjc */, 151 | ); 152 | }; 153 | /* End PBXProject section */ 154 | 155 | /* Begin PBXResourcesBuildPhase section */ 156 | 1518196A1B57BE89006A1000 /* Resources */ = { 157 | isa = PBXResourcesBuildPhase; 158 | buildActionMask = 2147483647; 159 | files = ( 160 | 1506AF811B7C9586004812B0 /* Main.storyboard in Resources */, 161 | 1506AF821B7C9586004812B0 /* Images.xcassets in Resources */, 162 | 1506AF801B7C9586004812B0 /* LaunchScreen.xib in Resources */, 163 | 15F097271B7B75A900D7E1B3 /* .gitignore in Resources */, 164 | ); 165 | runOnlyForDeploymentPostprocessing = 0; 166 | }; 167 | /* End PBXResourcesBuildPhase section */ 168 | 169 | /* Begin PBXSourcesBuildPhase section */ 170 | 151819681B57BE89006A1000 /* Sources */ = { 171 | isa = PBXSourcesBuildPhase; 172 | buildActionMask = 2147483647; 173 | files = ( 174 | 15F097351B7B798A00D7E1B3 /* TagView.m in Sources */, 175 | 15F097341B7B798A00D7E1B3 /* TagListView.m in Sources */, 176 | 1506AF841B7C9586004812B0 /* main.m in Sources */, 177 | 1506AF7F1B7C9586004812B0 /* AppDelegate.m in Sources */, 178 | 1506AF851B7C9586004812B0 /* ViewController.m in Sources */, 179 | ); 180 | runOnlyForDeploymentPostprocessing = 0; 181 | }; 182 | /* End PBXSourcesBuildPhase section */ 183 | 184 | /* Begin PBXVariantGroup section */ 185 | 1506AF761B7C9586004812B0 /* LaunchScreen.xib */ = { 186 | isa = PBXVariantGroup; 187 | children = ( 188 | 1506AF771B7C9586004812B0 /* Base */, 189 | ); 190 | name = LaunchScreen.xib; 191 | sourceTree = ""; 192 | }; 193 | 1506AF781B7C9586004812B0 /* Main.storyboard */ = { 194 | isa = PBXVariantGroup; 195 | children = ( 196 | 1506AF791B7C9586004812B0 /* Base */, 197 | ); 198 | name = Main.storyboard; 199 | sourceTree = ""; 200 | }; 201 | /* End PBXVariantGroup section */ 202 | 203 | /* Begin XCBuildConfiguration section */ 204 | 1518198D1B57BE89006A1000 /* Debug */ = { 205 | isa = XCBuildConfiguration; 206 | buildSettings = { 207 | ALWAYS_SEARCH_USER_PATHS = NO; 208 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 209 | CLANG_CXX_LIBRARY = "libc++"; 210 | CLANG_ENABLE_MODULES = YES; 211 | CLANG_ENABLE_OBJC_ARC = YES; 212 | CLANG_WARN_BOOL_CONVERSION = YES; 213 | CLANG_WARN_CONSTANT_CONVERSION = YES; 214 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 215 | CLANG_WARN_EMPTY_BODY = YES; 216 | CLANG_WARN_ENUM_CONVERSION = YES; 217 | CLANG_WARN_INFINITE_RECURSION = YES; 218 | CLANG_WARN_INT_CONVERSION = YES; 219 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 220 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 221 | CLANG_WARN_UNREACHABLE_CODE = YES; 222 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 223 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 224 | COPY_PHASE_STRIP = NO; 225 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 226 | ENABLE_STRICT_OBJC_MSGSEND = YES; 227 | ENABLE_TESTABILITY = YES; 228 | GCC_C_LANGUAGE_STANDARD = gnu99; 229 | GCC_DYNAMIC_NO_PIC = NO; 230 | GCC_NO_COMMON_BLOCKS = YES; 231 | GCC_OPTIMIZATION_LEVEL = 0; 232 | GCC_PREPROCESSOR_DEFINITIONS = ( 233 | "DEBUG=1", 234 | "$(inherited)", 235 | ); 236 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 237 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 238 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 239 | GCC_WARN_UNDECLARED_SELECTOR = YES; 240 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 241 | GCC_WARN_UNUSED_FUNCTION = YES; 242 | GCC_WARN_UNUSED_VARIABLE = YES; 243 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 244 | MTL_ENABLE_DEBUG_INFO = YES; 245 | ONLY_ACTIVE_ARCH = YES; 246 | SDKROOT = iphoneos; 247 | TARGETED_DEVICE_FAMILY = "1,2"; 248 | }; 249 | name = Debug; 250 | }; 251 | 1518198E1B57BE89006A1000 /* Release */ = { 252 | isa = XCBuildConfiguration; 253 | buildSettings = { 254 | ALWAYS_SEARCH_USER_PATHS = NO; 255 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 256 | CLANG_CXX_LIBRARY = "libc++"; 257 | CLANG_ENABLE_MODULES = YES; 258 | CLANG_ENABLE_OBJC_ARC = YES; 259 | CLANG_WARN_BOOL_CONVERSION = YES; 260 | CLANG_WARN_CONSTANT_CONVERSION = YES; 261 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 262 | CLANG_WARN_EMPTY_BODY = YES; 263 | CLANG_WARN_ENUM_CONVERSION = YES; 264 | CLANG_WARN_INFINITE_RECURSION = YES; 265 | CLANG_WARN_INT_CONVERSION = YES; 266 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 267 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 268 | CLANG_WARN_UNREACHABLE_CODE = YES; 269 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 270 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 271 | COPY_PHASE_STRIP = NO; 272 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 273 | ENABLE_NS_ASSERTIONS = NO; 274 | ENABLE_STRICT_OBJC_MSGSEND = YES; 275 | GCC_C_LANGUAGE_STANDARD = gnu99; 276 | GCC_NO_COMMON_BLOCKS = YES; 277 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 278 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 279 | GCC_WARN_UNDECLARED_SELECTOR = YES; 280 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 281 | GCC_WARN_UNUSED_FUNCTION = YES; 282 | GCC_WARN_UNUSED_VARIABLE = YES; 283 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 284 | MTL_ENABLE_DEBUG_INFO = NO; 285 | SDKROOT = iphoneos; 286 | TARGETED_DEVICE_FAMILY = "1,2"; 287 | VALIDATE_PRODUCT = YES; 288 | }; 289 | name = Release; 290 | }; 291 | 151819901B57BE89006A1000 /* Debug */ = { 292 | isa = XCBuildConfiguration; 293 | buildSettings = { 294 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 295 | INFOPLIST_FILE = "$(SRCROOT)/TagListView_Demo/Info.plist"; 296 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 297 | PRODUCT_BUNDLE_IDENTIFIER = "es.pulimento.$(PRODUCT_NAME:rfc1034identifier)"; 298 | PRODUCT_NAME = "$(TARGET_NAME)"; 299 | }; 300 | name = Debug; 301 | }; 302 | 151819911B57BE89006A1000 /* Release */ = { 303 | isa = XCBuildConfiguration; 304 | buildSettings = { 305 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 306 | INFOPLIST_FILE = "$(SRCROOT)/TagListView_Demo/Info.plist"; 307 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 308 | PRODUCT_BUNDLE_IDENTIFIER = "es.pulimento.$(PRODUCT_NAME:rfc1034identifier)"; 309 | PRODUCT_NAME = "$(TARGET_NAME)"; 310 | }; 311 | name = Release; 312 | }; 313 | /* End XCBuildConfiguration section */ 314 | 315 | /* Begin XCConfigurationList section */ 316 | 151819671B57BE89006A1000 /* Build configuration list for PBXProject "TagListObjC" */ = { 317 | isa = XCConfigurationList; 318 | buildConfigurations = ( 319 | 1518198D1B57BE89006A1000 /* Debug */, 320 | 1518198E1B57BE89006A1000 /* Release */, 321 | ); 322 | defaultConfigurationIsVisible = 0; 323 | defaultConfigurationName = Release; 324 | }; 325 | 1518198F1B57BE89006A1000 /* Build configuration list for PBXNativeTarget "TagObjc" */ = { 326 | isa = XCConfigurationList; 327 | buildConfigurations = ( 328 | 151819901B57BE89006A1000 /* Debug */, 329 | 151819911B57BE89006A1000 /* Release */, 330 | ); 331 | defaultConfigurationIsVisible = 0; 332 | defaultConfigurationName = Release; 333 | }; 334 | /* End XCConfigurationList section */ 335 | }; 336 | rootObject = 151819641B57BE89006A1000 /* Project object */; 337 | } 338 | --------------------------------------------------------------------------------