├── Resources └── Screen Shot.png ├── JZBorderedView.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── project.pbxproj ├── JZBorderedView ├── ViewController.h ├── AppDelegate.h ├── main.m ├── ViewController.m ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── AppDelegate.m ├── Classes │ ├── JZBorderedView.h │ └── JZBorderedView.m └── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── JZBorderedViewTests ├── Info.plist └── JZBorderedViewTests.m ├── README.md ├── .gitignore ├── LICENSE └── JZBorderedView.podspec /Resources/Screen Shot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jzcruiser/JZBorderedView/HEAD/Resources/Screen Shot.png -------------------------------------------------------------------------------- /JZBorderedView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /JZBorderedView/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // JZBorderedView 4 | // 5 | // Created by James Zhao on 7/13/15. 6 | // Copyright (c) 2015 James Zhao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /JZBorderedView/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // JZBorderedView 4 | // 5 | // Created by James Zhao on 7/13/15. 6 | // Copyright (c) 2015 James Zhao. 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 | -------------------------------------------------------------------------------- /JZBorderedView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // JZBorderedView 4 | // 5 | // Created by James Zhao on 7/13/15. 6 | // Copyright (c) 2015 James Zhao. 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 | -------------------------------------------------------------------------------- /JZBorderedView/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // JZBorderedView 4 | // 5 | // Created by James Zhao on 7/13/15. 6 | // Copyright (c) 2015 James Zhao. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /JZBorderedViewTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.jameszhao.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JZBorderedView ![License MIT](https://go-shields.herokuapp.com/license-MIT-blue.png) 2 | ================ 3 | 4 | [![CocoaPods](https://cocoapod-badges.herokuapp.com/v/JZBorderedView/badge.png)](http://cocoapods.org/?q=JZBorderedView) 5 | [![CocoaPods](https://cocoapod-badges.herokuapp.com/p/JZBorderedView/badge.png)](http://cocoapods.org/?q=JZBorderedView) 6 | A UIView subclass with four configurable borders and separators via storyboard. 7 | 8 | ## Alternative of static UITableView 9 | This might be the alternative solution you are looking for as static UITableView is only supported in a UITableViewController instance. 10 | 11 |

12 | 13 |

14 | 15 | ##Installation 16 | 17 | CocoaPods 18 | 19 | pod 'JZBorderedView', '~> 0.0.5' 20 | 21 | ## References 22 | Inspired by https://github.com/hedjirog/HJRSeparatableView 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | #Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright © 2015 James Zhao 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /JZBorderedViewTests/JZBorderedViewTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // JZBorderedViewTests.m 3 | // JZBorderedViewTests 4 | // 5 | // Created by James Zhao on 7/13/15. 6 | // Copyright (c) 2015 James Zhao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface JZBorderedViewTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation JZBorderedViewTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /JZBorderedView/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 | } -------------------------------------------------------------------------------- /JZBorderedView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.jameszhao.$(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 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /JZBorderedView/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // JZBorderedView 4 | // 5 | // Created by James Zhao on 7/13/15. 6 | // Copyright (c) 2015 James Zhao. 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 | -------------------------------------------------------------------------------- /JZBorderedView/Classes/JZBorderedView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JZBorderedView.h 3 | // JZBorderedView 4 | // 5 | // Created by James Zhao on 7/13/15. 6 | // Copyright (c) 2015 James Zhao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_OPTIONS(NSUInteger, JZSeparatorPosition) { 12 | JZSeparatorPositionNone = 1 << 0, 13 | JZSeparatorPositionTop = 1 << 1, 14 | JZSeparatorPositionLeft = 1 << 2, 15 | JZSeparatorPositionBottom = 1 << 3, 16 | JZSeparatorPositionRight = 1 << 4, 17 | }; 18 | 19 | @interface JZSeparator : UIView 20 | 21 | @property (nonatomic, strong) UIColor *color; 22 | @property (nonatomic, assign) CGFloat width; 23 | 24 | @property (nonatomic, assign) UIEdgeInsets insets; 25 | @property (nonatomic, assign) JZSeparatorPosition position; 26 | 27 | @end 28 | 29 | //IB_DESIGNABLE 30 | @interface JZBorderedView : UIView 31 | 32 | @property (nonatomic, strong) NSMutableArray *separators; 33 | 34 | @property (nonatomic, strong) JZSeparator *topSeparator; 35 | @property (nonatomic, strong) JZSeparator *leftSeparator; 36 | @property (nonatomic, strong) JZSeparator *bottomSeparator; 37 | @property (nonatomic, strong) JZSeparator *rightSeparator; 38 | 39 | @property (nonatomic, strong) IBInspectable UIColor *separatorColor; 40 | @property (nonatomic, assign) IBInspectable CGFloat separatorWidth; 41 | 42 | @property (nonatomic, assign) IBInspectable CGFloat topSeparatorLeftInset; 43 | @property (nonatomic, assign) IBInspectable CGFloat topSeparatorRightInset; 44 | 45 | @property (nonatomic, assign) IBInspectable CGFloat bottomSeparatorLeftInset; 46 | @property (nonatomic, assign) IBInspectable CGFloat bottomSeparatorRightInset; 47 | 48 | @property (nonatomic, assign) IBInspectable CGFloat leftSeparatorTopInset; 49 | @property (nonatomic, assign) IBInspectable CGFloat leftSeparatorBottomInset; 50 | @property (nonatomic, assign) IBInspectable CGFloat rightSeparatorTopInset; 51 | @property (nonatomic, assign) IBInspectable CGFloat rightSeparatorBottomInset; 52 | 53 | @property (nonatomic, assign) IBInspectable BOOL topSeparatorEnabled; 54 | @property (nonatomic, assign) IBInspectable BOOL leftSeparatorEnabled; 55 | @property (nonatomic, assign) IBInspectable BOOL bottomSeparatorEnabled; 56 | @property (nonatomic, assign) IBInspectable BOOL rightSeparatorEnabled; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /JZBorderedView/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 | -------------------------------------------------------------------------------- /JZBorderedView.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint JZBorderedView.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | 11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 12 | # 13 | # These will help people to find your library, and whilst it 14 | # can feel like a chore to fill in it's definitely to your advantage. The 15 | # summary should be tweet-length, and the description more in depth. 16 | # 17 | 18 | s.name = "JZBorderedView" 19 | s.version = "0.0.5" 20 | s.summary = "A UIView subclass with four configurable borders via storyboard" 21 | 22 | s.description = <<-DESC 23 | A longer description of JZBorderedView in Markdown format. 24 | 25 | * Think: Why did you write this? What is the focus? What does it do? 26 | * CocoaPods will be using this to generate tags, and improve search results. 27 | * Try to keep it short, snappy and to the point. 28 | * Finally, don't worry about the indent, CocoaPods strips it! 29 | DESC 30 | 31 | s.homepage = "https://github.com/jessiejames1116/JZBorderedView" 32 | # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif" 33 | 34 | 35 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 36 | # 37 | # Licensing your code is important. See http://choosealicense.com for more info. 38 | # CocoaPods will detect a license file if there is a named LICENSE* 39 | # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. 40 | # 41 | 42 | # s.license = "MIT (example)" 43 | s.license = { :type => "MIT", :file => "LICENSE" } 44 | 45 | 46 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 47 | # 48 | # Specify the authors of the library, with email addresses. Email addresses 49 | # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also 50 | # accepts just a name if you'd rather not provide an email address. 51 | # 52 | # Specify a social_media_url where others can refer to, for example a twitter 53 | # profile URL. 54 | # 55 | 56 | s.author = { "James Zhao" => "jameszhao1116@gmail.com" } 57 | # Or just: s.author = "jessiejames1116" 58 | # s.authors = { "jessiejames1116" => "email@address.com" } 59 | # s.social_media_url = "http://twitter.com/jessiejames1116" 60 | 61 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 62 | # 63 | # If this Pod runs only on iOS or OS X, then specify the platform and 64 | # the deployment target. You can optionally include the target after the platform. 65 | # 66 | 67 | # s.platform = :ios 68 | s.platform = :ios, "6.0" 69 | 70 | # When using multiple platforms 71 | # s.ios.deployment_target = "5.0" 72 | # s.osx.deployment_target = "10.7" 73 | 74 | 75 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 76 | # 77 | # Specify the location from where the source should be retrieved. 78 | # Supports git, hg, bzr, svn and HTTP. 79 | # 80 | 81 | s.source = { :git => "https://github.com/jessiejames1116/JZBorderedView.git", :tag => "0.0.5" } 82 | 83 | 84 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 85 | # 86 | # CocoaPods is smart about how it includes source code. For source files 87 | # giving a folder will include any swift, h, m, mm, c & cpp files. 88 | # For header files it will include any header in the folder. 89 | # Not including the public_header_files will make all headers public. 90 | # 91 | 92 | s.source_files = "JZBorderedView/Classes", "JZBorderedView/Classes/**/*.{h,m}" 93 | s.exclude_files = "Classes/Exclude" 94 | 95 | # s.public_header_files = "Classes/**/*.h" 96 | 97 | 98 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 99 | # 100 | # A list of resources included with the Pod. These are copied into the 101 | # target bundle with a build phase script. Anything else will be cleaned. 102 | # You can preserve files from being cleaned, please don't preserve 103 | # non-essential files like tests, examples and documentation. 104 | # 105 | 106 | # s.resource = "icon.png" 107 | # s.resources = "Resources/*.png" 108 | 109 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave" 110 | 111 | 112 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 113 | # 114 | # Link your library with frameworks, or libraries. Libraries do not include 115 | # the lib prefix of their name. 116 | # 117 | 118 | # s.framework = "SomeFramework" 119 | # s.frameworks = "SomeFramework", "AnotherFramework" 120 | 121 | # s.library = "iconv" 122 | # s.libraries = "iconv", "xml2" 123 | 124 | 125 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 126 | # 127 | # If your library depends on compiler flags you can set them in the xcconfig hash 128 | # where they will only apply to your library. If you depend on other Podspecs 129 | # you can include multiple dependencies to ensure it works. 130 | 131 | # s.requires_arc = true 132 | 133 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } 134 | # s.dependency "JSONKit", "~> 1.4" 135 | 136 | end 137 | -------------------------------------------------------------------------------- /JZBorderedView/Classes/JZBorderedView.m: -------------------------------------------------------------------------------- 1 | // 2 | // JZBorderedView.m 3 | // JZBorderedView 4 | // 5 | // Created by James Zhao on 7/13/15. 6 | // Copyright (c) 2015 James Zhao. All rights reserved. 7 | // 8 | 9 | #import "JZBorderedView.h" 10 | 11 | @implementation JZSeparator 12 | 13 | - (instancetype)initWithCoder:(NSCoder *)aDecoder 14 | { 15 | self = [super initWithCoder:aDecoder]; 16 | 17 | if (self) { 18 | [self commonInit]; 19 | } 20 | 21 | return self; 22 | } 23 | 24 | - (instancetype)initWithFrame:(CGRect)frame 25 | { 26 | self = [super initWithFrame:frame]; 27 | 28 | if (self) { 29 | [self commonInit]; 30 | } 31 | 32 | return self; 33 | } 34 | 35 | - (void)prepareForInterfaceBuilder 36 | { 37 | [self commonInit]; 38 | } 39 | 40 | - (void)commonInit 41 | { 42 | } 43 | 44 | - (void)setColor:(UIColor *)color 45 | { 46 | _color = color; 47 | self.backgroundColor = _color; 48 | } 49 | 50 | @end 51 | 52 | @implementation JZBorderedView 53 | 54 | - (instancetype)initWithCoder:(NSCoder *)aDecoder 55 | { 56 | self = [super initWithCoder:aDecoder]; 57 | 58 | if (self) { 59 | [self commonInit]; 60 | } 61 | 62 | return self; 63 | } 64 | 65 | - (instancetype)initWithFrame:(CGRect)frame 66 | { 67 | self = [super initWithFrame:frame]; 68 | 69 | if (self) { 70 | [self commonInit]; 71 | } 72 | 73 | return self; 74 | } 75 | 76 | - (void)prepareForInterfaceBuilder 77 | { 78 | } 79 | 80 | - (void)commonInit 81 | { 82 | self.topSeparator = [self instantiateNewSeparatorWithPosition:JZSeparatorPositionTop]; 83 | self.topSeparator.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin; 84 | self.leftSeparator = [self instantiateNewSeparatorWithPosition:JZSeparatorPositionLeft]; 85 | self.leftSeparator.autoresizingMask = UIViewAutoresizingFlexibleRightMargin; 86 | self.bottomSeparator = [self instantiateNewSeparatorWithPosition:JZSeparatorPositionBottom]; 87 | self.bottomSeparator.autoresizingMask = UIViewAutoresizingFlexibleTopMargin; 88 | self.rightSeparator = [self instantiateNewSeparatorWithPosition:JZSeparatorPositionRight]; 89 | self.rightSeparator.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin; 90 | self.separators = [@[self.topSeparator, self.leftSeparator, self.bottomSeparator, self.rightSeparator] mutableCopy]; 91 | self.separatorColor = [UIColor grayColor]; 92 | self.separatorWidth = .5f; 93 | } 94 | 95 | #pragma mark - Getters 96 | 97 | - (JZSeparator *)instantiateNewSeparatorWithPosition:(JZSeparatorPosition)position 98 | { 99 | JZSeparator *separator = [[JZSeparator alloc]init]; 100 | 101 | separator = [[JZSeparator alloc]init]; 102 | separator.position = position; 103 | separator.hidden = YES; 104 | [self addSubview:separator]; 105 | return separator; 106 | } 107 | 108 | #pragma mark - Setters 109 | 110 | - (void)setTopSeparatorEnabled:(BOOL)enabled 111 | { 112 | _topSeparatorEnabled = enabled; 113 | self.topSeparator.hidden = !enabled; 114 | } 115 | 116 | - (void)setLeftSeparatorEnabled:(BOOL)enabled 117 | { 118 | _leftSeparatorEnabled = enabled; 119 | self.leftSeparator.hidden = !enabled; 120 | } 121 | 122 | - (void)setBottomSeparatorEnabled:(BOOL)enabled 123 | { 124 | _bottomSeparatorEnabled = enabled; 125 | self.bottomSeparator.hidden = !enabled; 126 | } 127 | 128 | - (void)setRightSeparatorEnabled:(BOOL)enabled 129 | { 130 | _rightSeparatorEnabled = enabled; 131 | self.rightSeparator.hidden = !enabled; 132 | } 133 | 134 | - (void)setSeparatorWidth:(CGFloat)separatorWidth 135 | { 136 | _separatorWidth = separatorWidth; 137 | [self setNeedsLayout]; 138 | } 139 | 140 | - (void)setSeparatorColor:(UIColor *)separatorColor 141 | { 142 | _separatorColor = separatorColor; 143 | [self setNeedsLayout]; 144 | } 145 | 146 | - (void)setTopSeparatorLeftInset:(CGFloat)topSeparatorLeftInset 147 | { 148 | _topSeparatorLeftInset = topSeparatorLeftInset; 149 | UIEdgeInsets insets = self.topSeparator.insets; 150 | insets.left = topSeparatorLeftInset; 151 | self.topSeparator.insets = insets; 152 | [self setNeedsLayout]; 153 | } 154 | 155 | - (void)setTopSeparatorRightInset:(CGFloat)topSeparatorRightInset 156 | { 157 | _topSeparatorRightInset = topSeparatorRightInset; 158 | UIEdgeInsets insets = self.topSeparator.insets; 159 | insets.right = topSeparatorRightInset; 160 | self.topSeparator.insets = insets; 161 | [self setNeedsLayout]; 162 | } 163 | 164 | - (void)setBottomSeparatorLeftInset:(CGFloat)bottomSeparatorLeftInset 165 | { 166 | _bottomSeparatorLeftInset = bottomSeparatorLeftInset; 167 | UIEdgeInsets insets = self.topSeparator.insets; 168 | insets.left = bottomSeparatorLeftInset; 169 | self.bottomSeparator.insets = insets; 170 | [self setNeedsLayout]; 171 | } 172 | 173 | - (void)setBottomSeparatorRightInset:(CGFloat)bottomSeparatorRightInset 174 | { 175 | _bottomSeparatorRightInset = bottomSeparatorRightInset; 176 | UIEdgeInsets insets = self.topSeparator.insets; 177 | insets.right = bottomSeparatorRightInset; 178 | self.bottomSeparator.insets = insets; 179 | [self setNeedsLayout]; 180 | } 181 | 182 | - (void)setLeftSeparatorTopInset:(CGFloat)leftSeparatorTopInset 183 | { 184 | _leftSeparatorTopInset = leftSeparatorTopInset; 185 | UIEdgeInsets insets = self.leftSeparator.insets; 186 | insets.top = leftSeparatorTopInset; 187 | self.leftSeparator.insets = insets; 188 | [self setNeedsLayout]; 189 | } 190 | 191 | - (void)setLeftSeparatorBottomInset:(CGFloat)leftSeparatorBottomInset 192 | { 193 | _leftSeparatorBottomInset = leftSeparatorBottomInset; 194 | UIEdgeInsets insets = self.leftSeparator.insets; 195 | insets.bottom = leftSeparatorBottomInset; 196 | self.leftSeparator.insets = insets; 197 | [self setNeedsLayout]; 198 | } 199 | 200 | - (void)setRightSeparatorTopInset:(CGFloat)rightSeparatorTopInset 201 | { 202 | _rightSeparatorTopInset = rightSeparatorTopInset; 203 | UIEdgeInsets insets = self.rightSeparator.insets; 204 | insets.top = rightSeparatorTopInset; 205 | self.rightSeparator.insets = insets; 206 | [self setNeedsLayout]; 207 | } 208 | 209 | - (void)setRightSeparatorBottomInset:(CGFloat)rightSeparatorBottomInset 210 | { 211 | _rightSeparatorBottomInset = rightSeparatorBottomInset; 212 | UIEdgeInsets insets = self.rightSeparator.insets; 213 | insets.bottom = rightSeparatorBottomInset; 214 | self.rightSeparator.insets = insets; 215 | [self setNeedsLayout]; 216 | } 217 | 218 | #pragma mark - Layout 219 | 220 | - (void)layoutSubviews 221 | { 222 | [super layoutSubviews]; 223 | 224 | for (JZSeparator *separator in self.separators) { 225 | separator.color = self.separatorColor; 226 | separator.width = self.separatorWidth; 227 | separator.frame = [self separatorViewFrameForSeparator:separator]; 228 | } 229 | } 230 | 231 | - (UIEdgeInsets)adjustedSeparatorInset:(JZSeparatorPosition)position insets:(UIEdgeInsets)insets 232 | { 233 | switch (position) { 234 | case JZSeparatorPositionTop: 235 | case JZSeparatorPositionBottom: 236 | return (UIEdgeInsets) { 237 | .top = 0, 238 | .left = insets.left, 239 | .bottom = 0, 240 | .right = insets.right, 241 | }; 242 | 243 | case JZSeparatorPositionLeft: 244 | case JZSeparatorPositionRight: 245 | return (UIEdgeInsets) { 246 | .top = insets.top, 247 | .left = 0, 248 | .bottom = insets.bottom, 249 | .right = 0, 250 | }; 251 | 252 | default: 253 | return insets; 254 | } 255 | } 256 | 257 | - (CGRect)separatorViewFrameForSeparator:(JZSeparator *)separator 258 | { 259 | CGRect defaultFrame = [self defaultSeparatorViewFrame:separator.position width:separator.width]; 260 | UIEdgeInsets insets = [self adjustedSeparatorInset:separator.position insets:separator.insets]; 261 | CGRect frame = UIEdgeInsetsInsetRect(defaultFrame, insets); 262 | 263 | return frame; 264 | } 265 | 266 | - (CGRect)defaultSeparatorViewFrame:(JZSeparatorPosition)position width:(CGFloat)width 267 | { 268 | switch (position) { 269 | case JZSeparatorPositionTop: 270 | return (CGRect) { 271 | .origin.x = 0, 272 | .origin.y = 0, 273 | .size.width = CGRectGetWidth(self.bounds), 274 | .size.height = width, 275 | }; 276 | 277 | case JZSeparatorPositionBottom: 278 | return (CGRect) { 279 | .origin.x = 0, 280 | .origin.y = CGRectGetMaxY(self.bounds) - width, 281 | .size.width = CGRectGetWidth(self.bounds), 282 | .size.height = width, 283 | }; 284 | 285 | case JZSeparatorPositionLeft: 286 | return (CGRect) { 287 | .origin.x = 0, 288 | .origin.y = 0, 289 | .size.width = width, 290 | .size.height = CGRectGetHeight(self.bounds), 291 | }; 292 | 293 | case JZSeparatorPositionRight: 294 | return (CGRect) { 295 | .origin.x = CGRectGetMaxX(self.bounds) - width, 296 | .origin.y = 0, 297 | .size.width = width, 298 | .size.height = CGRectGetHeight(self.bounds), 299 | }; 300 | 301 | default: 302 | return CGRectZero; 303 | } 304 | } 305 | 306 | - (void)didAddSubview:(UIView *)subview 307 | { 308 | [super didAddSubview:subview]; 309 | 310 | if ([subview isKindOfClass:[JZSeparator class]]) { 311 | [self sendSubviewToBack:subview]; 312 | } 313 | } 314 | 315 | @end -------------------------------------------------------------------------------- /JZBorderedView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | E76EFF061B536F980049F00A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E76EFF051B536F980049F00A /* main.m */; }; 11 | E76EFF091B536F980049F00A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E76EFF081B536F980049F00A /* AppDelegate.m */; }; 12 | E76EFF0C1B536F980049F00A /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E76EFF0B1B536F980049F00A /* ViewController.m */; }; 13 | E76EFF0F1B536F980049F00A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E76EFF0D1B536F980049F00A /* Main.storyboard */; }; 14 | E76EFF111B536F980049F00A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E76EFF101B536F980049F00A /* Images.xcassets */; }; 15 | E76EFF141B536F980049F00A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = E76EFF121B536F980049F00A /* LaunchScreen.xib */; }; 16 | E76EFF201B536F980049F00A /* JZBorderedViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E76EFF1F1B536F980049F00A /* JZBorderedViewTests.m */; }; 17 | E76EFF351B539F3A0049F00A /* JZBorderedView.m in Sources */ = {isa = PBXBuildFile; fileRef = E76EFF341B539F3A0049F00A /* JZBorderedView.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | E76EFF1A1B536F980049F00A /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = E76EFEF81B536F980049F00A /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = E76EFEFF1B536F980049F00A; 26 | remoteInfo = JZBorderedView; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | E76EFF001B536F980049F00A /* JZBorderedView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JZBorderedView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | E76EFF041B536F980049F00A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 33 | E76EFF051B536F980049F00A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 34 | E76EFF071B536F980049F00A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 35 | E76EFF081B536F980049F00A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 36 | E76EFF0A1B536F980049F00A /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 37 | E76EFF0B1B536F980049F00A /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 38 | E76EFF0E1B536F980049F00A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 39 | E76EFF101B536F980049F00A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 40 | E76EFF131B536F980049F00A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 41 | E76EFF191B536F980049F00A /* JZBorderedViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JZBorderedViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | E76EFF1E1B536F980049F00A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 43 | E76EFF1F1B536F980049F00A /* JZBorderedViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JZBorderedViewTests.m; sourceTree = ""; }; 44 | E76EFF331B539F3A0049F00A /* JZBorderedView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JZBorderedView.h; sourceTree = ""; }; 45 | E76EFF341B539F3A0049F00A /* JZBorderedView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JZBorderedView.m; sourceTree = ""; }; 46 | /* End PBXFileReference section */ 47 | 48 | /* Begin PBXFrameworksBuildPhase section */ 49 | E76EFEFD1B536F980049F00A /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | ); 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | E76EFF161B536F980049F00A /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | ); 61 | runOnlyForDeploymentPostprocessing = 0; 62 | }; 63 | /* End PBXFrameworksBuildPhase section */ 64 | 65 | /* Begin PBXGroup section */ 66 | E76EFEF71B536F980049F00A = { 67 | isa = PBXGroup; 68 | children = ( 69 | E76EFF021B536F980049F00A /* JZBorderedView */, 70 | E76EFF1C1B536F980049F00A /* JZBorderedViewTests */, 71 | E76EFF011B536F980049F00A /* Products */, 72 | ); 73 | sourceTree = ""; 74 | }; 75 | E76EFF011B536F980049F00A /* Products */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | E76EFF001B536F980049F00A /* JZBorderedView.app */, 79 | E76EFF191B536F980049F00A /* JZBorderedViewTests.xctest */, 80 | ); 81 | name = Products; 82 | sourceTree = ""; 83 | }; 84 | E76EFF021B536F980049F00A /* JZBorderedView */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | E76EFF321B539F3A0049F00A /* Classes */, 88 | E76EFF071B536F980049F00A /* AppDelegate.h */, 89 | E76EFF081B536F980049F00A /* AppDelegate.m */, 90 | E76EFF0A1B536F980049F00A /* ViewController.h */, 91 | E76EFF0B1B536F980049F00A /* ViewController.m */, 92 | E76EFF0D1B536F980049F00A /* Main.storyboard */, 93 | E76EFF101B536F980049F00A /* Images.xcassets */, 94 | E76EFF121B536F980049F00A /* LaunchScreen.xib */, 95 | E76EFF031B536F980049F00A /* Supporting Files */, 96 | ); 97 | path = JZBorderedView; 98 | sourceTree = ""; 99 | }; 100 | E76EFF031B536F980049F00A /* Supporting Files */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | E76EFF041B536F980049F00A /* Info.plist */, 104 | E76EFF051B536F980049F00A /* main.m */, 105 | ); 106 | name = "Supporting Files"; 107 | sourceTree = ""; 108 | }; 109 | E76EFF1C1B536F980049F00A /* JZBorderedViewTests */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | E76EFF1F1B536F980049F00A /* JZBorderedViewTests.m */, 113 | E76EFF1D1B536F980049F00A /* Supporting Files */, 114 | ); 115 | path = JZBorderedViewTests; 116 | sourceTree = ""; 117 | }; 118 | E76EFF1D1B536F980049F00A /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | E76EFF1E1B536F980049F00A /* Info.plist */, 122 | ); 123 | name = "Supporting Files"; 124 | sourceTree = ""; 125 | }; 126 | E76EFF321B539F3A0049F00A /* Classes */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | E76EFF331B539F3A0049F00A /* JZBorderedView.h */, 130 | E76EFF341B539F3A0049F00A /* JZBorderedView.m */, 131 | ); 132 | path = Classes; 133 | sourceTree = ""; 134 | }; 135 | /* End PBXGroup section */ 136 | 137 | /* Begin PBXNativeTarget section */ 138 | E76EFEFF1B536F980049F00A /* JZBorderedView */ = { 139 | isa = PBXNativeTarget; 140 | buildConfigurationList = E76EFF231B536F980049F00A /* Build configuration list for PBXNativeTarget "JZBorderedView" */; 141 | buildPhases = ( 142 | E76EFEFC1B536F980049F00A /* Sources */, 143 | E76EFEFD1B536F980049F00A /* Frameworks */, 144 | E76EFEFE1B536F980049F00A /* Resources */, 145 | ); 146 | buildRules = ( 147 | ); 148 | dependencies = ( 149 | ); 150 | name = JZBorderedView; 151 | productName = JZBorderedView; 152 | productReference = E76EFF001B536F980049F00A /* JZBorderedView.app */; 153 | productType = "com.apple.product-type.application"; 154 | }; 155 | E76EFF181B536F980049F00A /* JZBorderedViewTests */ = { 156 | isa = PBXNativeTarget; 157 | buildConfigurationList = E76EFF261B536F980049F00A /* Build configuration list for PBXNativeTarget "JZBorderedViewTests" */; 158 | buildPhases = ( 159 | E76EFF151B536F980049F00A /* Sources */, 160 | E76EFF161B536F980049F00A /* Frameworks */, 161 | E76EFF171B536F980049F00A /* Resources */, 162 | ); 163 | buildRules = ( 164 | ); 165 | dependencies = ( 166 | E76EFF1B1B536F980049F00A /* PBXTargetDependency */, 167 | ); 168 | name = JZBorderedViewTests; 169 | productName = JZBorderedViewTests; 170 | productReference = E76EFF191B536F980049F00A /* JZBorderedViewTests.xctest */; 171 | productType = "com.apple.product-type.bundle.unit-test"; 172 | }; 173 | /* End PBXNativeTarget section */ 174 | 175 | /* Begin PBXProject section */ 176 | E76EFEF81B536F980049F00A /* Project object */ = { 177 | isa = PBXProject; 178 | attributes = { 179 | LastUpgradeCheck = 0640; 180 | ORGANIZATIONNAME = "James Zhao"; 181 | TargetAttributes = { 182 | E76EFEFF1B536F980049F00A = { 183 | CreatedOnToolsVersion = 6.4; 184 | }; 185 | E76EFF181B536F980049F00A = { 186 | CreatedOnToolsVersion = 6.4; 187 | TestTargetID = E76EFEFF1B536F980049F00A; 188 | }; 189 | }; 190 | }; 191 | buildConfigurationList = E76EFEFB1B536F980049F00A /* Build configuration list for PBXProject "JZBorderedView" */; 192 | compatibilityVersion = "Xcode 3.2"; 193 | developmentRegion = English; 194 | hasScannedForEncodings = 0; 195 | knownRegions = ( 196 | en, 197 | Base, 198 | ); 199 | mainGroup = E76EFEF71B536F980049F00A; 200 | productRefGroup = E76EFF011B536F980049F00A /* Products */; 201 | projectDirPath = ""; 202 | projectRoot = ""; 203 | targets = ( 204 | E76EFEFF1B536F980049F00A /* JZBorderedView */, 205 | E76EFF181B536F980049F00A /* JZBorderedViewTests */, 206 | ); 207 | }; 208 | /* End PBXProject section */ 209 | 210 | /* Begin PBXResourcesBuildPhase section */ 211 | E76EFEFE1B536F980049F00A /* Resources */ = { 212 | isa = PBXResourcesBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | E76EFF0F1B536F980049F00A /* Main.storyboard in Resources */, 216 | E76EFF141B536F980049F00A /* LaunchScreen.xib in Resources */, 217 | E76EFF111B536F980049F00A /* Images.xcassets in Resources */, 218 | ); 219 | runOnlyForDeploymentPostprocessing = 0; 220 | }; 221 | E76EFF171B536F980049F00A /* Resources */ = { 222 | isa = PBXResourcesBuildPhase; 223 | buildActionMask = 2147483647; 224 | files = ( 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | }; 228 | /* End PBXResourcesBuildPhase section */ 229 | 230 | /* Begin PBXSourcesBuildPhase section */ 231 | E76EFEFC1B536F980049F00A /* Sources */ = { 232 | isa = PBXSourcesBuildPhase; 233 | buildActionMask = 2147483647; 234 | files = ( 235 | E76EFF0C1B536F980049F00A /* ViewController.m in Sources */, 236 | E76EFF351B539F3A0049F00A /* JZBorderedView.m in Sources */, 237 | E76EFF091B536F980049F00A /* AppDelegate.m in Sources */, 238 | E76EFF061B536F980049F00A /* main.m in Sources */, 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | }; 242 | E76EFF151B536F980049F00A /* Sources */ = { 243 | isa = PBXSourcesBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | E76EFF201B536F980049F00A /* JZBorderedViewTests.m in Sources */, 247 | ); 248 | runOnlyForDeploymentPostprocessing = 0; 249 | }; 250 | /* End PBXSourcesBuildPhase section */ 251 | 252 | /* Begin PBXTargetDependency section */ 253 | E76EFF1B1B536F980049F00A /* PBXTargetDependency */ = { 254 | isa = PBXTargetDependency; 255 | target = E76EFEFF1B536F980049F00A /* JZBorderedView */; 256 | targetProxy = E76EFF1A1B536F980049F00A /* PBXContainerItemProxy */; 257 | }; 258 | /* End PBXTargetDependency section */ 259 | 260 | /* Begin PBXVariantGroup section */ 261 | E76EFF0D1B536F980049F00A /* Main.storyboard */ = { 262 | isa = PBXVariantGroup; 263 | children = ( 264 | E76EFF0E1B536F980049F00A /* Base */, 265 | ); 266 | name = Main.storyboard; 267 | sourceTree = ""; 268 | }; 269 | E76EFF121B536F980049F00A /* LaunchScreen.xib */ = { 270 | isa = PBXVariantGroup; 271 | children = ( 272 | E76EFF131B536F980049F00A /* Base */, 273 | ); 274 | name = LaunchScreen.xib; 275 | sourceTree = ""; 276 | }; 277 | /* End PBXVariantGroup section */ 278 | 279 | /* Begin XCBuildConfiguration section */ 280 | E76EFF211B536F980049F00A /* Debug */ = { 281 | isa = XCBuildConfiguration; 282 | buildSettings = { 283 | ALWAYS_SEARCH_USER_PATHS = NO; 284 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 285 | CLANG_CXX_LIBRARY = "libc++"; 286 | CLANG_ENABLE_MODULES = YES; 287 | CLANG_ENABLE_OBJC_ARC = YES; 288 | CLANG_WARN_BOOL_CONVERSION = YES; 289 | CLANG_WARN_CONSTANT_CONVERSION = YES; 290 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 291 | CLANG_WARN_EMPTY_BODY = YES; 292 | CLANG_WARN_ENUM_CONVERSION = YES; 293 | CLANG_WARN_INT_CONVERSION = YES; 294 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 295 | CLANG_WARN_UNREACHABLE_CODE = YES; 296 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 297 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 298 | COPY_PHASE_STRIP = NO; 299 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 300 | ENABLE_STRICT_OBJC_MSGSEND = YES; 301 | GCC_C_LANGUAGE_STANDARD = gnu99; 302 | GCC_DYNAMIC_NO_PIC = NO; 303 | GCC_NO_COMMON_BLOCKS = YES; 304 | GCC_OPTIMIZATION_LEVEL = 0; 305 | GCC_PREPROCESSOR_DEFINITIONS = ( 306 | "DEBUG=1", 307 | "$(inherited)", 308 | ); 309 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 310 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 311 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 312 | GCC_WARN_UNDECLARED_SELECTOR = YES; 313 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 314 | GCC_WARN_UNUSED_FUNCTION = YES; 315 | GCC_WARN_UNUSED_VARIABLE = YES; 316 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 317 | MTL_ENABLE_DEBUG_INFO = YES; 318 | ONLY_ACTIVE_ARCH = YES; 319 | SDKROOT = iphoneos; 320 | TARGETED_DEVICE_FAMILY = "1,2"; 321 | }; 322 | name = Debug; 323 | }; 324 | E76EFF221B536F980049F00A /* Release */ = { 325 | isa = XCBuildConfiguration; 326 | buildSettings = { 327 | ALWAYS_SEARCH_USER_PATHS = NO; 328 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 329 | CLANG_CXX_LIBRARY = "libc++"; 330 | CLANG_ENABLE_MODULES = YES; 331 | CLANG_ENABLE_OBJC_ARC = YES; 332 | CLANG_WARN_BOOL_CONVERSION = YES; 333 | CLANG_WARN_CONSTANT_CONVERSION = YES; 334 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 335 | CLANG_WARN_EMPTY_BODY = YES; 336 | CLANG_WARN_ENUM_CONVERSION = YES; 337 | CLANG_WARN_INT_CONVERSION = YES; 338 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 339 | CLANG_WARN_UNREACHABLE_CODE = YES; 340 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 341 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 342 | COPY_PHASE_STRIP = NO; 343 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 344 | ENABLE_NS_ASSERTIONS = NO; 345 | ENABLE_STRICT_OBJC_MSGSEND = YES; 346 | GCC_C_LANGUAGE_STANDARD = gnu99; 347 | GCC_NO_COMMON_BLOCKS = YES; 348 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 349 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 350 | GCC_WARN_UNDECLARED_SELECTOR = YES; 351 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 352 | GCC_WARN_UNUSED_FUNCTION = YES; 353 | GCC_WARN_UNUSED_VARIABLE = YES; 354 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 355 | MTL_ENABLE_DEBUG_INFO = NO; 356 | SDKROOT = iphoneos; 357 | TARGETED_DEVICE_FAMILY = "1,2"; 358 | VALIDATE_PRODUCT = YES; 359 | }; 360 | name = Release; 361 | }; 362 | E76EFF241B536F980049F00A /* Debug */ = { 363 | isa = XCBuildConfiguration; 364 | buildSettings = { 365 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 366 | INFOPLIST_FILE = JZBorderedView/Info.plist; 367 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 368 | PRODUCT_NAME = "$(TARGET_NAME)"; 369 | }; 370 | name = Debug; 371 | }; 372 | E76EFF251B536F980049F00A /* Release */ = { 373 | isa = XCBuildConfiguration; 374 | buildSettings = { 375 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 376 | INFOPLIST_FILE = JZBorderedView/Info.plist; 377 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 378 | PRODUCT_NAME = "$(TARGET_NAME)"; 379 | }; 380 | name = Release; 381 | }; 382 | E76EFF271B536F980049F00A /* Debug */ = { 383 | isa = XCBuildConfiguration; 384 | buildSettings = { 385 | BUNDLE_LOADER = "$(TEST_HOST)"; 386 | FRAMEWORK_SEARCH_PATHS = ( 387 | "$(SDKROOT)/Developer/Library/Frameworks", 388 | "$(inherited)", 389 | ); 390 | GCC_PREPROCESSOR_DEFINITIONS = ( 391 | "DEBUG=1", 392 | "$(inherited)", 393 | ); 394 | INFOPLIST_FILE = JZBorderedViewTests/Info.plist; 395 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 396 | PRODUCT_NAME = "$(TARGET_NAME)"; 397 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JZBorderedView.app/JZBorderedView"; 398 | }; 399 | name = Debug; 400 | }; 401 | E76EFF281B536F980049F00A /* Release */ = { 402 | isa = XCBuildConfiguration; 403 | buildSettings = { 404 | BUNDLE_LOADER = "$(TEST_HOST)"; 405 | FRAMEWORK_SEARCH_PATHS = ( 406 | "$(SDKROOT)/Developer/Library/Frameworks", 407 | "$(inherited)", 408 | ); 409 | INFOPLIST_FILE = JZBorderedViewTests/Info.plist; 410 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 411 | PRODUCT_NAME = "$(TARGET_NAME)"; 412 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JZBorderedView.app/JZBorderedView"; 413 | }; 414 | name = Release; 415 | }; 416 | /* End XCBuildConfiguration section */ 417 | 418 | /* Begin XCConfigurationList section */ 419 | E76EFEFB1B536F980049F00A /* Build configuration list for PBXProject "JZBorderedView" */ = { 420 | isa = XCConfigurationList; 421 | buildConfigurations = ( 422 | E76EFF211B536F980049F00A /* Debug */, 423 | E76EFF221B536F980049F00A /* Release */, 424 | ); 425 | defaultConfigurationIsVisible = 0; 426 | defaultConfigurationName = Release; 427 | }; 428 | E76EFF231B536F980049F00A /* Build configuration list for PBXNativeTarget "JZBorderedView" */ = { 429 | isa = XCConfigurationList; 430 | buildConfigurations = ( 431 | E76EFF241B536F980049F00A /* Debug */, 432 | E76EFF251B536F980049F00A /* Release */, 433 | ); 434 | defaultConfigurationIsVisible = 0; 435 | defaultConfigurationName = Release; 436 | }; 437 | E76EFF261B536F980049F00A /* Build configuration list for PBXNativeTarget "JZBorderedViewTests" */ = { 438 | isa = XCConfigurationList; 439 | buildConfigurations = ( 440 | E76EFF271B536F980049F00A /* Debug */, 441 | E76EFF281B536F980049F00A /* Release */, 442 | ); 443 | defaultConfigurationIsVisible = 0; 444 | defaultConfigurationName = Release; 445 | }; 446 | /* End XCConfigurationList section */ 447 | }; 448 | rootObject = E76EFEF81B536F980049F00A /* Project object */; 449 | } 450 | -------------------------------------------------------------------------------- /JZBorderedView/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 | 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 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | --------------------------------------------------------------------------------