Skip to content

Commit

Permalink
- Support for Xcode 7, Swift 2.0
Browse files Browse the repository at this point in the history
- Increased control version
- Updated gitignore
  • Loading branch information
glenyi committed Sep 9, 2015
1 parent fc30e56 commit 34c88cd
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 220 deletions.
44 changes: 43 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
*.xcuserstate
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata

## Other
*.xccheckout
*.moved-aside
*.xcuserstate
*.xcscmblueprint

## Obj-C/Swift specific
*.hmap
*.ipa

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
#Pods/

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build
2 changes: 1 addition & 1 deletion FloatRatingView.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'FloatRatingView'
spec.version = '1.0.0'
spec.version = '1.0.1'
spec.summary = 'Whole, half or floating point ratings control written in Swift.'
spec.homepage = 'https://github.com/strekfus/FloatRatingView'
spec.license = 'MIT'
Expand Down
16 changes: 8 additions & 8 deletions FloatRatingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public class FloatRatingView: UIView {
self.initImageViews()
}

required public init(coder aDecoder: NSCoder) {
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)

self.initImageViews()
Expand Down Expand Up @@ -239,7 +239,7 @@ public class FloatRatingView: UIView {
}

// Add new image views
for i in 0..<self.maxRating {
for _ in 0..<self.maxRating {
let emptyImageView = UIImageView()
emptyImageView.contentMode = self.imageContentMode
emptyImageView.image = self.emptyImage
Expand All @@ -263,7 +263,7 @@ public class FloatRatingView: UIView {
}

var newRating: Float = 0
for i in stride(from: (self.maxRating-1), through: 0, by: -1) {
for i in (self.maxRating-1).stride(through: 0, by: -1) {
let imageView = self.emptyImageViews[i]
if touchLocation.x > imageView.frame.origin.x {
// Find touch point in image view
Expand Down Expand Up @@ -294,21 +294,21 @@ public class FloatRatingView: UIView {
}
}

override public func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {
if let touch = touches.first as? UITouch {
override public func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
if let touch = touches.first {
let touchLocation = touch.locationInView(self)
self.handleTouchAtLocation(touchLocation)
}
}

override public func touchesMoved(touches: Set<NSObject>, withEvent event: UIEvent) {
if let touch = touches.first as? UITouch {
override public func touchesMoved(touches: Set<UITouch>, withEvent event: UIEvent?) {
if let touch = touches.first {
let touchLocation = touch.locationInView(self)
self.handleTouchAtLocation(touchLocation)
}
}

override public func touchesEnded(touches: Set<NSObject>, withEvent event: UIEvent) {
override public func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) {
// Update delegate
if let delegate = self.delegate {
delegate.floatRatingView(self, didUpdate: self.rating)
Expand Down
19 changes: 10 additions & 9 deletions Rating Demo/Rating Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@
B275F3F919BA5E3600E6F169 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0600;
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = "On The Pursuit";
TargetAttributes = {
B275F40019BA5E3600E6F169 = {
Expand Down Expand Up @@ -275,6 +277,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand Down Expand Up @@ -340,6 +343,7 @@
INFOPLIST_FILE = "Rating Demo/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.onthepursuit.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
Expand All @@ -352,6 +356,7 @@
INFOPLIST_FILE = "Rating Demo/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.onthepursuit.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
Expand All @@ -360,16 +365,14 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = "Rating DemoTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.onthepursuit.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Rating Demo.app/Rating Demo";
};
Expand All @@ -379,12 +382,10 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "Rating DemoTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.onthepursuit.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Rating Demo.app/Rating Demo";
};
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 34c88cd

Please sign in to comment.