Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ios 9 - xcode 7 #400

Closed
donaldking opened this issue Sep 20, 2015 · 6 comments
Closed

ios 9 - xcode 7 #400

donaldking opened this issue Sep 20, 2015 · 6 comments

Comments

@donaldking
Copy link

Any branch with the updated Swift changes? This version currently on Master doesn't compile

@danielgindi
Copy link
Collaborator

It compiles well. On Xcode 7.0, final version.

@camin153
Copy link

How can I update with podfile? I try to use pod update, but Xcode suggest me to convert swift files. Thank you.

@tijee
Copy link

tijee commented Sep 21, 2015

+1 An update of the pods would be great, thanks guys! 👍

@christosc
Copy link

I'm not sure if it relates to the issues that @donaldking reported, but in order to make the library compile using Xcode 7 stable, I had to make the following changes:

diff --git a/Charts/Classes/Charts/ChartViewBase.swift b/Charts/Classes/Charts/ChartViewBase.swift
index 975357b..3e30a3b 100755
--- a/Charts/Classes/Charts/ChartViewBase.swift
+++ b/Charts/Classes/Charts/ChartViewBase.swift
@@ -776,7 +776,7 @@ public class ChartViewBase: UIView, ChartAnimatorDelegate
             }
         }

-        layer.renderInOptionalContext(context)
+        layer.renderInContext(context!)

         let image = UIGraphicsGetImageFromCurrentImageContext()

diff --git a/Charts/Classes/Components/ChartMarker.swift b/Charts/Classes/Components/ChartMarker.swift
index a91435a..e8261eb 100644
--- a/Charts/Classes/Components/ChartMarker.swift
+++ b/Charts/Classes/Components/ChartMarker.swift
@@ -44,7 +44,7 @@ public class ChartMarker: ChartComponentBase

         let rect = CGRect(x: point.x + offset.x, y: point.y + offset.y, width: size.width, height: size.height)

-        UIGraphicsPushContext(context)
+        UIGraphicsPushContext(context!)
         image!.drawInRect(rect)
         UIGraphicsPopContext()
     }
diff --git a/Charts/Classes/Utils/ChartUtils.swift b/Charts/Classes/Utils/ChartUtils.swift
index 19acd44..f6d5b5d 100755
--- a/Charts/Classes/Utils/ChartUtils.swift
+++ b/Charts/Classes/Utils/ChartUtils.swift
@@ -129,7 +129,7 @@ internal class ChartUtils
             point.x -= text.sizeWithAttributes(attributes).width
         }

-        UIGraphicsPushContext(context)
+        UIGraphicsPushContext(context!)
         (text as NSString).drawAtPoint(point, withAttributes: attributes)
         UIGraphicsPopContext()
     }
@@ -149,7 +149,7 @@ internal class ChartUtils
             rect.origin.x -= rect.size.width
         }

-        UIGraphicsPushContext(context)
+        UIGraphicsPushContext(context!)
         (text as NSString).drawWithRect(rect, options: .UsesLineFragmentOrigin, attributes: attributes, context: nil)
         UIGraphicsPopContext()
     }

@danielgindi
Copy link
Collaborator

@christosc Your issue is different. For some reason you haven't compiled the CALayer+Extensions.swift flile

@christosc
Copy link

@danielgindi Thank you very much. That was indeed the problem; the missing CALayer+Extensions.swift file. Probably that was due to the fact that I had imported the files into the project from an older version of the library, that didn't contain that file. Reimporting all the files of the library solved my issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants