Skip to content

Commit

Permalink
-Swift 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wuchuanyu committed Oct 22, 2016
1 parent c323ea9 commit 8e956dd
Show file tree
Hide file tree
Showing 5 changed files with 294 additions and 280 deletions.
15 changes: 14 additions & 1 deletion WCYArrowRectView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,16 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0730;
LastUpgradeCheck = 0800;
ORGANIZATIONNAME = wuchuanyu;
TargetAttributes = {
C9E59EF31D014E4300618D24 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0800;
};
C9E59F071D014E4300618D24 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0800;
TestTargetID = C9E59EF31D014E4300618D24;
};
};
Expand Down Expand Up @@ -258,8 +260,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand Down Expand Up @@ -303,8 +307,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand All @@ -323,6 +329,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -335,6 +342,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = wuchuanyu.WCYArrowRectView;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -346,6 +354,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = wuchuanyu.WCYArrowRectView;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand All @@ -357,6 +366,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = wuchuanyu.WCYArrowRectViewTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WCYArrowRectView.app/WCYArrowRectView";
};
name = Debug;
Expand All @@ -369,6 +379,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = wuchuanyu.WCYArrowRectViewTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WCYArrowRectView.app/WCYArrowRectView";
};
name = Release;
Expand All @@ -392,6 +403,7 @@
C9E59F131D014E4300618D24 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C9E59F141D014E4300618D24 /* Build configuration list for PBXNativeTarget "WCYArrowRectViewTests" */ = {
isa = XCConfigurationList;
Expand All @@ -400,6 +412,7 @@
C9E59F161D014E4300618D24 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
12 changes: 6 additions & 6 deletions WCYArrowRectView/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}

func applicationWillResignActive(application: UIApplication) {
func applicationWillResignActive(_ application: UIApplication) {
// 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.
// 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.
}

func applicationDidEnterBackground(application: UIApplication) {
func applicationDidEnterBackground(_ application: UIApplication) {
// 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.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(application: UIApplication) {
func applicationWillEnterForeground(_ application: UIApplication) {
// 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.
}

func applicationDidBecomeActive(application: UIApplication) {
func applicationDidBecomeActive(_ application: UIApplication) {
// 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.
}

func applicationWillTerminate(application: UIApplication) {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

Expand Down
54 changes: 27 additions & 27 deletions WCYArrowRectView/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,57 +13,57 @@ class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let arrowRectView = WCYArrowRectView(frame: CGRectMake(20, 40, 80, 100))
arrowRectView.backgroundColor = UIColor.clearColor()
arrowRectView.layer.shadowOffset = CGSizeMake(5, 5)
arrowRectView.layer.shadowColor = UIColor(red: 0.3, green: 0.3, blue: 0.3, alpha: 1.0).CGColor
let arrowRectView = WCYArrowRectView(frame: CGRect(x: 20, y: 40, width: 80, height: 100))
arrowRectView.backgroundColor = UIColor.clear
arrowRectView.layer.shadowOffset = CGSize(width: 5, height: 5)
arrowRectView.layer.shadowColor = UIColor(red: 0.3, green: 0.3, blue: 0.3, alpha: 1.0).cgColor
arrowRectView.layer.shadowOpacity = 0.5
self.view.addSubview(arrowRectView)

let arrowRectView1 = WCYArrowRectView(frame: CGRectMake(140, 40, 80, 100))
arrowRectView1.arrowPos = .TopRight
let arrowRectView1 = WCYArrowRectView(frame: CGRect(x: 140, y: 40, width: 80, height: 100))
arrowRectView1.arrowPos = .topRight
arrowRectView1.arrowWidth = 16
arrowRectView1.arrowHeight = 10
arrowRectView1.backgroundColor = UIColor.clearColor()
arrowRectView1.layer.shadowOffset = CGSizeMake(5, 5)
arrowRectView1.layer.shadowColor = UIColor(red: 0.3, green: 0.3, blue: 0.3, alpha: 1.0).CGColor
arrowRectView1.backgroundColor = UIColor.clear
arrowRectView1.layer.shadowOffset = CGSize(width: 5, height: 5)
arrowRectView1.layer.shadowColor = UIColor(red: 0.3, green: 0.3, blue: 0.3, alpha: 1.0).cgColor
arrowRectView1.layer.shadowOpacity = 0.5
self.view.addSubview(arrowRectView1)

let arrowRectView2 = WCYArrowRectView(frame: CGRectMake(20, 160, 80, 100))
arrowRectView2.arrowPos = .BottomLeft
let arrowRectView2 = WCYArrowRectView(frame: CGRect(x: 20, y: 160, width: 80, height: 100))
arrowRectView2.arrowPos = .bottomLeft
self.view.addSubview(arrowRectView2)

let arrowRectView3 = WCYArrowRectView(frame: CGRectMake(140, 160, 80, 100))
arrowRectView3.arrowPos = .BottomRight
let arrowRectView3 = WCYArrowRectView(frame: CGRect(x: 140, y: 160, width: 80, height: 100))
arrowRectView3.arrowPos = .bottomRight
self.view.addSubview(arrowRectView3)

let arrowRectView4 = WCYArrowRectView(frame: CGRectMake(20, 280, 80, 100))
arrowRectView4.arrowPos = .LeftTop
let arrowRectView4 = WCYArrowRectView(frame: CGRect(x: 20, y: 280, width: 80, height: 100))
arrowRectView4.arrowPos = .leftTop
arrowRectView4.arrowWidth = 25
arrowRectView4.arrowHeight = 10
self.view.addSubview(arrowRectView4)

let arrowRectView5 = WCYArrowRectView(frame: CGRectMake(140, 280, 80, 100))
arrowRectView5.arrowPos = .LeftBottom
let arrowRectView5 = WCYArrowRectView(frame: CGRect(x: 140, y: 280, width: 80, height: 100))
arrowRectView5.arrowPos = .leftBottom
arrowRectView5.arrowWidth = 25
arrowRectView5.arrowHeight = 10
arrowRectView5.fillColor = UIColor.grayColor()
arrowRectView5.fillColor = UIColor.gray
self.view.addSubview(arrowRectView5)

let arrowRectView6 = WCYArrowRectView(frame: CGRectMake(20, 400, 80, 100))
arrowRectView6.arrowPos = .RightTop
let arrowRectView6 = WCYArrowRectView(frame: CGRect(x: 20, y: 400, width: 80, height: 100))
arrowRectView6.arrowPos = .rightTop
arrowRectView6.arrowWidth = 25
arrowRectView6.arrowHeight = 10
arrowRectView6.corner = 10
arrowRectView6.dotLineSpace = 0
arrowRectView6.strokeWidth = 6
arrowRectView6.strokeColor = UIColor.redColor()
arrowRectView6.strokeColor = UIColor.red
arrowRectView6.fillColor = UIColor(red: 219/255.0, green: 249/255.0, blue: 149/255.0, alpha: 1.0)
self.view.addSubview(arrowRectView6)

let arrowRectView7 = WCYArrowRectView(frame: CGRectMake(140, 400, 150, 100))
arrowRectView7.arrowPos = .RightBottom
let arrowRectView7 = WCYArrowRectView(frame: CGRect(x: 140, y: 400, width: 150, height: 100))
arrowRectView7.arrowPos = .rightBottom
arrowRectView7.arrowWidth = 25
arrowRectView7.arrowHeight = 10
arrowRectView7.arrowOffset = 37.5
Expand All @@ -74,14 +74,14 @@ class ViewController: UIViewController {
arrowRectView7.fillColor = UIColor(red: 55/255.0, green: 55/255.0, blue: 55/255.0, alpha: 1.0)
self.view.addSubview(arrowRectView7)

let arrowRectView8 = WCYArrowRectView(frame: CGRectMake(20, 520, 80, 100))
arrowRectView8.arrowPos = .LeftMiddle
let arrowRectView8 = WCYArrowRectView(frame: CGRect(x: 20, y: 520, width: 80, height: 100))
arrowRectView8.arrowPos = .leftMiddle
arrowRectView8.arrowWidth = 20
arrowRectView8.arrowHeight = 10
self.view.addSubview(arrowRectView8)

let arrowRectView9 = WCYArrowRectView(frame: CGRectMake(140, 520, 80, 100))
arrowRectView9.arrowPos = .RightMiddle
let arrowRectView9 = WCYArrowRectView(frame: CGRect(x: 140, y: 520, width: 80, height: 100))
arrowRectView9.arrowPos = .rightMiddle
arrowRectView9.arrowWidth = 20
arrowRectView9.arrowHeight = 10
self.view.addSubview(arrowRectView9)
Expand Down
Loading

0 comments on commit 8e956dd

Please sign in to comment.