Skip to content

Commit

Permalink
should release colorspace.
Browse files Browse the repository at this point in the history
  • Loading branch information
jianpx committed Jul 31, 2013
1 parent cca09e5 commit 130a790
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 76 deletions.
27 changes: 16 additions & 11 deletions JXBarChartView/JXBarChartViewExample/JXBarChartView.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,22 @@ - (id)initWithFrame:(CGRect)frame
_textColor = textColor ? textColor : [UIColor orangeColor];
_barHeight = barHeight;
_barMaxWidth = barMaxWidth;
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
//blue gradient
CGFloat locations[] = {0.0, 0.5, 1.0};
CGFloat colorComponents[] = {
0.254, 0.599, 0.82, 1.0, //red, green, blue, alpha
0.192, 0.525, 0.75, 1.0,
0.096, 0.415, 0.686, 1.0
};
size_t count = 3;
CGGradientRef defaultGradient = CGGradientCreateWithColorComponents(colorSpace, colorComponents, locations, count);
_gradient = gradient ? gradient : defaultGradient;
if (gradient) {
_gradient = gradient;
} else {
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
//blue gradient
CGFloat locations[] = {0.0, 0.5, 1.0};
CGFloat colorComponents[] = {
0.254, 0.599, 0.82, 1.0, //red, green, blue, alpha
0.192, 0.525, 0.75, 1.0,
0.096, 0.415, 0.686, 1.0
};
size_t count = 3;
CGGradientRef defaultGradient = CGGradientCreateWithColorComponents(colorSpace, colorComponents, locations, count);
_gradient = defaultGradient;
CGColorSpaceRelease(colorSpace);
}
self.backgroundColor = [UIColor whiteColor];
}
return self;
Expand Down
65 changes: 0 additions & 65 deletions PagedImageScrollView/PagedImageScrollView.podspec
Original file line number Diff line number Diff line change
@@ -1,77 +1,12 @@
#
# Be sure to run `pod spec lint PagedImageScrollView.podspec' to ensure this is a
# valid spec and remove all comments before submitting the spec.
#
# To learn more about the attributes see http://docs.cocoapods.org/specification.html
#
Pod::Spec.new do |s|
s.name = "PagedImageScrollView"
s.version = "0.0.1"
s.summary = "It can easily generate imagescrollview with pagecontrol, swipe two fingers can switch the image."
s.homepage = "https://github.com/jianpx/ios-cabin/tree/master/PagedImageScrollView"
# s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2"

# Specify the license type. CocoaPods detects automatically the license file if it is named
# 'LICENCE*.*' or 'LICENSE*.*', however if the name is different, specify it.
s.license = 'MIT'
# s.license = { :type => 'MIT (example)', :file => 'FILE_LICENSE' }
s.author = { "jianpx" => "[email protected]" }
s.source = { :git => "https://github.com/jianpx/ios-cabin.git", :tag => "0.0.1" }


# If this Pod runs only on iOS or OS X, then specify the platform and
# the deployment target.
#
s.platform = :ios, '5.0'

# If this Pod runs on both platforms, then specify the deployment
# targets.
#
# s.ios.deployment_target = '5.0'
# s.osx.deployment_target = '10.7'

# A list of file patterns which select the source files that should be
# added to the Pods project. If the pattern is a directory then the
# path will automatically have '*.{h,m,mm,c,cpp}' appended.
#
s.source_files = 'PagedImageScrollView/*.{h,m}'
#s.exclude_files = 'Classes/Exclude'

# A list of file patterns which select the header files that should be
# made available to the application. If the pattern is a directory then the
# path will automatically have '*.h' appended.
#
# If you do not explicitly set the list of public header files,
# all headers of source_files will be made public.
#
# s.public_header_files = 'Classes/**/*.h'

# A list of resources included with the Pod. These are copied into the
# target bundle with a build phase script.
#
# s.resource = "icon.png"
# s.resources = "Resources/*.png"

# A list of paths to preserve after installing the Pod.
# CocoaPods cleans by default any file that is not used.
# Please don't include documentation, example, and test files.
#
# s.preserve_paths = "FilesToSave", "MoreFilesToSave"

# Specify a list of frameworks that the application needs to link
# against for this Pod to work.
#
# s.framework = 'SomeFramework'
# s.frameworks = 'SomeFramework', 'AnotherFramework'

# Specify a list of libraries that the application needs to link
# against for this Pod to work.
#
# s.library = 'iconv'
# s.libraries = 'iconv', 'xml2'

# If this Pod uses ARC, specify it like so.
#
s.requires_arc = true

end

0 comments on commit 130a790

Please sign in to comment.