Skip to content

Commit 241938d

Browse files
committed
Init project
0 parents  commit 241938d

22 files changed

+1181
-0
lines changed

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.DS_Store
2+
*.swp
3+
*~.nib
4+
5+
build/
6+
xcuserdata/
7+
*.pbxuser
8+
*.perspective
9+
*.perspectivev3

DDDashLine.xcodeproj/project.pbxproj

+538
Large diffs are not rendered by default.

DDDashLine.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DDDashLine/AppDelegate.h

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// AppDelegate.h
3+
// DDDashLine
4+
//
5+
// Created by liuyi on 15/11/10.
6+
// Copyright © 2015年 DeepDevelop. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@interface AppDelegate : UIResponder <UIApplicationDelegate>
12+
13+
@property (strong, nonatomic) UIWindow *window;
14+
15+
16+
@end
17+

DDDashLine/AppDelegate.m

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
//
2+
// AppDelegate.m
3+
// DDDashLine
4+
//
5+
// Created by liuyi on 15/11/10.
6+
// Copyright © 2015年 DeepDevelop. 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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
5+
</dependencies>
6+
<scenes>
7+
<!--View Controller-->
8+
<scene sceneID="EHf-IW-A2E">
9+
<objects>
10+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
11+
<layoutGuides>
12+
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
13+
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
14+
</layoutGuides>
15+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
16+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
17+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18+
<animations/>
19+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
20+
</view>
21+
</viewController>
22+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
23+
</objects>
24+
<point key="canvasLocation" x="53" y="375"/>
25+
</scene>
26+
</scenes>
27+
</document>

DDDashLine/Base.lproj/Main.storyboard

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
3+
<dependencies>
4+
<deployment identifier="iOS"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
6+
</dependencies>
7+
<scenes>
8+
<!--View Controller-->
9+
<scene sceneID="tne-QT-ifu">
10+
<objects>
11+
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
12+
<layoutGuides>
13+
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
14+
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
15+
</layoutGuides>
16+
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
17+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
18+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19+
<subviews>
20+
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2pT-NX-pMv" customClass="DDDashLine">
21+
<rect key="frame" x="0.0" y="225" width="600" height="1"/>
22+
<animations/>
23+
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
24+
<constraints>
25+
<constraint firstAttribute="height" constant="1" id="YU6-KR-8c8"/>
26+
</constraints>
27+
<userDefinedRuntimeAttributes>
28+
<userDefinedRuntimeAttribute type="color" keyPath="dashColor">
29+
<color key="value" red="0.83921568629999999" green="0.32281395499999999" blue="0.36436665039999999" alpha="1" colorSpace="calibratedRGB"/>
30+
</userDefinedRuntimeAttribute>
31+
<userDefinedRuntimeAttribute type="number" keyPath="dashWidth">
32+
<real key="value" value="3"/>
33+
</userDefinedRuntimeAttribute>
34+
<userDefinedRuntimeAttribute type="number" keyPath="dashPadding">
35+
<real key="value" value="4"/>
36+
</userDefinedRuntimeAttribute>
37+
</userDefinedRuntimeAttributes>
38+
</view>
39+
</subviews>
40+
<animations/>
41+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
42+
<constraints>
43+
<constraint firstAttribute="trailing" secondItem="2pT-NX-pMv" secondAttribute="trailing" id="J1k-Qy-nL7"/>
44+
<constraint firstItem="2pT-NX-pMv" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="205" id="os6-TI-cZ9"/>
45+
<constraint firstItem="2pT-NX-pMv" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="xRs-Ku-nMZ"/>
46+
</constraints>
47+
</view>
48+
</viewController>
49+
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
50+
</objects>
51+
<point key="canvasLocation" x="231" y="337"/>
52+
</scene>
53+
</scenes>
54+
</document>

DDDashLine/Info.plist

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>APPL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>1</string>
23+
<key>LSRequiresIPhoneOS</key>
24+
<true/>
25+
<key>UILaunchStoryboardName</key>
26+
<string>LaunchScreen</string>
27+
<key>UIMainStoryboardFile</key>
28+
<string>Main</string>
29+
<key>UIRequiredDeviceCapabilities</key>
30+
<array>
31+
<string>armv7</string>
32+
</array>
33+
<key>UISupportedInterfaceOrientations</key>
34+
<array>
35+
<string>UIInterfaceOrientationPortrait</string>
36+
<string>UIInterfaceOrientationLandscapeLeft</string>
37+
<string>UIInterfaceOrientationLandscapeRight</string>
38+
</array>
39+
<key>UISupportedInterfaceOrientations~ipad</key>
40+
<array>
41+
<string>UIInterfaceOrientationPortrait</string>
42+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
43+
<string>UIInterfaceOrientationLandscapeLeft</string>
44+
<string>UIInterfaceOrientationLandscapeRight</string>
45+
</array>
46+
</dict>
47+
</plist>

DDDashLine/SRC/DDDashLine.h

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// DDDashLine.h
3+
// DDDashLine
4+
//
5+
// Created by 61 on 15/11/10.
6+
// Copyright (c) 2015年 DeepDevelop. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
IB_DESIGNABLE
12+
@interface DDDashLine : UIView
13+
14+
@property (nonatomic, assign) IBInspectable CGFloat dashWidth;
15+
@property (nonatomic, assign) IBInspectable CGFloat dashPadding;
16+
@property (nonatomic, strong) IBInspectable UIColor *dashColor;
17+
18+
@end

DDDashLine/SRC/DDDashLine.m

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
//
2+
// DDDashLine.m
3+
// DDDashLine
4+
//
5+
// Created by 61 on 15/11/10.
6+
// Copyright (c) 2015年 DeepDevelop. All rights reserved.
7+
//
8+
9+
#import "DDDashLine.h"
10+
11+
@interface DDDashLine ()
12+
13+
@property (nonatomic, strong) UIBezierPath *dashPath;
14+
15+
@end
16+
17+
18+
@implementation DDDashLine
19+
20+
+ (Class)layerClass {
21+
return [CAShapeLayer class];
22+
}
23+
24+
- (void)layoutSubviews {
25+
[self drawDash];
26+
}
27+
28+
- (void)drawDash {
29+
self.dashWidth = self.dashWidth ? : 1;
30+
self.dashPadding = self.dashPadding ? : 1;
31+
self.dashColor = self.dashColor ? : [UIColor grayColor];
32+
33+
CAShapeLayer *shapeLayer = (CAShapeLayer *)self.layer;
34+
shapeLayer.strokeColor = self.dashColor.CGColor;
35+
shapeLayer.fillColor = [UIColor clearColor].CGColor;
36+
shapeLayer.lineWidth = self.frame.size.height;
37+
shapeLayer.geometryFlipped = YES;
38+
39+
shapeLayer.lineDashPattern = @[@(self.dashWidth), @(self.dashPadding)];
40+
[self.dashPath moveToPoint:CGPointZero];
41+
[self.dashPath addLineToPoint:CGPointMake(CGRectGetWidth(self.frame), 0)];
42+
43+
shapeLayer.path = self.dashPath.CGPath;
44+
}
45+
46+
- (UIBezierPath *)dashPath {
47+
if (!_dashPath) {
48+
_dashPath = [UIBezierPath new];
49+
}
50+
51+
return _dashPath;
52+
}
53+
54+
@end

DDDashLine/ViewController.h

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// ViewController.h
3+
// DDDashLine
4+
//
5+
// Created by liuyi on 15/11/10.
6+
// Copyright © 2015年 DeepDevelop. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@interface ViewController : UIViewController
12+
13+
14+
@end
15+

0 commit comments

Comments
 (0)