|
|
@@ -3,5 +3,25 @@ target 'LoopFollow' do
|
|
|
|
|
|
pod 'Charts'
|
|
|
pod 'ShareClient', :git => 'https://github.com/loopandlearn/dexcom-share-client-swift.git', :branch => 'loopfollow'
|
|
|
-
|
|
|
+
|
|
|
+end
|
|
|
+
|
|
|
+post_install do |installer|
|
|
|
+ # Patch Charts Transformer to avoid "CGAffineTransformInvert: singular matrix"
|
|
|
+ # warnings when chart views have zero dimensions (before layout).
|
|
|
+ transformer = 'Pods/Charts/Source/Charts/Utils/Transformer.swift'
|
|
|
+ if File.exist?(transformer)
|
|
|
+ code = File.read(transformer)
|
|
|
+ original = 'return valueToPixelMatrix.inverted()'
|
|
|
+ patched = <<~SWIFT.chomp
|
|
|
+ let matrix = valueToPixelMatrix
|
|
|
+ guard matrix.a * matrix.d - matrix.b * matrix.c != 0 else {
|
|
|
+ return .identity
|
|
|
+ }
|
|
|
+ return matrix.inverted()
|
|
|
+ SWIFT
|
|
|
+ if code.include?(original)
|
|
|
+ File.write(transformer, code.sub(original, patched))
|
|
|
+ end
|
|
|
+ end
|
|
|
end
|