From 7006e6bd07fc346c357fbbe4b9c49af2dff47636 Mon Sep 17 00:00:00 2001 From: Eugen Pirogoff Date: Fri, 21 Aug 2015 16:53:13 +0200 Subject: [PATCH] swift 2.0 beta syntax update --- .../DOFavoriteButton-DEMO.xcodeproj/project.pbxproj | 9 ++++++++- .../xcschemes/DOFavoriteButton.xcscheme | 13 ++++++++----- .../DOFavoriteButton-DEMO/Info.plist | 2 +- DOFavoriteButton-DEMO/DOFavoriteButton/Info.plist | 2 +- DOFavoriteButton/DOFavoriteButton.swift | 10 +++++----- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/DOFavoriteButton-DEMO/DOFavoriteButton-DEMO.xcodeproj/project.pbxproj b/DOFavoriteButton-DEMO/DOFavoriteButton-DEMO.xcodeproj/project.pbxproj index 1bf6279..870b57b 100644 --- a/DOFavoriteButton-DEMO/DOFavoriteButton-DEMO.xcodeproj/project.pbxproj +++ b/DOFavoriteButton-DEMO/DOFavoriteButton-DEMO.xcodeproj/project.pbxproj @@ -173,7 +173,9 @@ 4FBAA6F51B4D807F00C8657F /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0640; + LastSwiftMigration = 0700; + LastSwiftUpdateCheck = 0700; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = "Daiki Okumura"; TargetAttributes = { 4F60711A1B6366ED0058F570 = { @@ -280,6 +282,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "co.devlog.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -301,6 +304,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "co.devlog.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -329,6 +333,7 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -398,6 +403,7 @@ INFOPLIST_FILE = "DOFavoriteButton-DEMO/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "co.devlog.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -409,6 +415,7 @@ INFOPLIST_FILE = "DOFavoriteButton-DEMO/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "co.devlog.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; diff --git a/DOFavoriteButton-DEMO/DOFavoriteButton-DEMO.xcodeproj/xcshareddata/xcschemes/DOFavoriteButton.xcscheme b/DOFavoriteButton-DEMO/DOFavoriteButton-DEMO.xcodeproj/xcshareddata/xcschemes/DOFavoriteButton.xcscheme index 8c4e220..ab1a5ab 100644 --- a/DOFavoriteButton-DEMO/DOFavoriteButton-DEMO.xcodeproj/xcshareddata/xcschemes/DOFavoriteButton.xcscheme +++ b/DOFavoriteButton-DEMO/DOFavoriteButton-DEMO.xcodeproj/xcshareddata/xcschemes/DOFavoriteButton.xcscheme @@ -1,6 +1,6 @@ + shouldUseLaunchSchemeArgsEnv = "YES"> + + CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - co.devlog.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/DOFavoriteButton-DEMO/DOFavoriteButton/Info.plist b/DOFavoriteButton-DEMO/DOFavoriteButton/Info.plist index 03e9718..d3de8ee 100644 --- a/DOFavoriteButton-DEMO/DOFavoriteButton/Info.plist +++ b/DOFavoriteButton-DEMO/DOFavoriteButton/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - co.devlog.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/DOFavoriteButton/DOFavoriteButton.swift b/DOFavoriteButton/DOFavoriteButton.swift index 210e9a0..0b68c2c 100644 --- a/DOFavoriteButton/DOFavoriteButton.swift +++ b/DOFavoriteButton/DOFavoriteButton.swift @@ -97,13 +97,13 @@ public class DOFavoriteButton: UIButton { addTargets() } - public required init(coder aDecoder: NSCoder) { + public required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) createLayers(image: UIImage()) addTargets() } - private func createLayers(#image: UIImage!) { + private func createLayers(image image: UIImage!) { self.layer.sublayers = nil let imageFrame = CGRectMake(frame.size.width / 2 - frame.size.width / 4, frame.size.height / 2 - frame.size.height / 4, frame.size.width / 2, frame.size.height / 2) @@ -172,9 +172,9 @@ public class DOFavoriteButton: UIButton { self.layer.addSublayer(imageShape) imageShape.mask = CALayer() - imageShape.mask.contents = image.CGImage - imageShape.mask.bounds = imageFrame - imageShape.mask.position = imgCenterPoint + imageShape.mask!.contents = image.CGImage + imageShape.mask!.bounds = imageFrame + imageShape.mask!.position = imgCenterPoint //============================== // circle transform animation