├── .DS_Store ├── .gitignore ├── .swift-version ├── IMKLine.podspec ├── IMKLine ├── Config │ ├── IMKLineConfig.swift │ ├── IMKLineParamters.swift │ └── IMKLineTheme.swift ├── Model │ ├── BOLL介绍.md │ ├── IMKLine.swift │ ├── IMKLineCalculator.swift │ ├── IMKLineGroup.swift │ ├── IMKLineSubStruct.swift │ ├── KDJ介绍.md │ ├── MA-EMA-MACD介绍.md │ └── RSI介绍.md ├── Tool │ ├── IMColor.swift │ └── IMKLineTool.swift └── View │ ├── AccessoryView │ ├── IMKLineAccessoryMAView.swift │ ├── IMKLineAccessoryView.swift │ └── Painter │ │ └── IMKLineAccessoryPainter.swift │ ├── CrossLine │ └── IMKLineCrossLine.swift │ ├── IMKLineContainerView.swift │ ├── IMKLineScrollView.swift │ ├── KLineView │ ├── IMKLineMAView.swift │ ├── IMKLineValueView.swift │ ├── IMKLineView.swift │ └── Painter │ │ ├── IMKLineMAPainter.swift │ │ └── IMKLinePainter.swift │ ├── RightYView │ └── IMKLineRightYView.swift │ ├── TimeView │ └── IMKLineTimeView.swift │ └── VolumeView │ ├── IMKLineVolumeMAView.swift │ ├── IMKLineVolumeView.swift │ └── Painter │ ├── IMKLineVolumeMAPainter.swift │ └── IMKLineVolumePainter.swift ├── IMKLineDemo ├── IMKLineDemo.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── wantao.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── wantao.xcuserdatad │ │ └── xcschemes │ │ ├── IMKLineDemo.xcscheme │ │ └── xcschememanagement.plist ├── IMKLineDemo.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── wantao.xcuserdatad │ │ └── UserInterfaceState.xcuserstate ├── IMKLineDemo │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── k-1.png │ │ │ ├── k-2.png │ │ │ ├── k-3.png │ │ │ ├── k-4.png │ │ │ ├── k-5.png │ │ │ ├── k-6.png │ │ │ ├── k-7.png │ │ │ ├── k-8.png │ │ │ └── k.png │ │ ├── Contents.json │ │ ├── kline_curve.imageset │ │ │ ├── Contents.json │ │ │ ├── kline_curve.png │ │ │ ├── kline_curve@2x.png │ │ │ └── kline_curve@3x.png │ │ ├── kline_hollow.imageset │ │ │ ├── Contents.json │ │ │ ├── kline_hollow.png │ │ │ ├── kline_hollow@2x.png │ │ │ └── kline_hollow@3x.png │ │ ├── kline_line.imageset │ │ │ ├── Contents.json │ │ │ ├── kline_line.png │ │ │ ├── kline_line@2x.png │ │ │ └── kline_line@3x.png │ │ └── kline_standard.imageset │ │ │ ├── Contents.json │ │ │ ├── kline_standard.png │ │ │ ├── kline_standard@2x.png │ │ │ └── kline_standard@3x.png │ ├── Base.lproj │ │ └── Main.storyboard │ ├── IMKLineChartViewController.swift │ ├── IMKLineDataParser.swift │ ├── Info.plist │ ├── R.generated.swift │ ├── ViewController.swift │ └── data.json ├── Podfile ├── Podfile.lock └── Pods │ ├── IMKLine │ ├── IMKLine │ │ ├── Config │ │ │ ├── IMKLineConfig.swift │ │ │ ├── IMKLineParamters.swift │ │ │ └── IMKLineTheme.swift │ │ ├── Model │ │ │ ├── IMKLine.swift │ │ │ ├── IMKLineCalculator.swift │ │ │ ├── IMKLineGroup.swift │ │ │ └── IMKLineSubStruct.swift │ │ ├── Tool │ │ │ ├── IMColor.swift │ │ │ └── IMKLineTool.swift │ │ └── View │ │ │ ├── AccessoryView │ │ │ ├── IMKLineAccessoryMAView.swift │ │ │ ├── IMKLineAccessoryView.swift │ │ │ └── Painter │ │ │ │ └── IMKLineAccessoryPainter.swift │ │ │ ├── CrossLine │ │ │ └── IMKLineCrossLine.swift │ │ │ ├── IMKLineContainerView.swift │ │ │ ├── IMKLineScrollView.swift │ │ │ ├── KLineView │ │ │ ├── IMKLineMAView.swift │ │ │ ├── IMKLineValueView.swift │ │ │ ├── IMKLineView.swift │ │ │ └── Painter │ │ │ │ ├── IMKLineMAPainter.swift │ │ │ │ └── IMKLinePainter.swift │ │ │ ├── RightYView │ │ │ └── IMKLineRightYView.swift │ │ │ ├── TimeView │ │ │ └── IMKLineTimeView.swift │ │ │ └── VolumeView │ │ │ ├── IMKLineVolumeMAView.swift │ │ │ ├── IMKLineVolumeView.swift │ │ │ └── Painter │ │ │ ├── IMKLineVolumeMAPainter.swift │ │ │ └── IMKLineVolumePainter.swift │ ├── LICENSE │ └── README.md │ ├── Manifest.lock │ ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── wantao.xcuserdatad │ │ └── xcschemes │ │ ├── IMKLine.xcscheme │ │ ├── Pods-IMKLineDemo.xcscheme │ │ ├── R.swift.Library.xcscheme │ │ ├── SnapKit.xcscheme │ │ ├── SwiftyBeaver.xcscheme │ │ ├── SwiftyJSON.xcscheme │ │ └── xcschememanagement.plist │ ├── R.swift.Library │ ├── Library │ │ ├── Core │ │ │ ├── ColorPaletteItemResource.swift │ │ │ ├── ColorResource.swift │ │ │ ├── FileResource.swift │ │ │ ├── FontResource.swift │ │ │ ├── Identifier.swift │ │ │ ├── ImageResource.swift │ │ │ ├── NibResource.swift │ │ │ ├── ReuseIdentifierProtocol.swift │ │ │ ├── StoryboardResource.swift │ │ │ ├── StoryboardSegueIdentifierProtocol.swift │ │ │ ├── StoryboardViewControllerResource.swift │ │ │ ├── StringResource.swift │ │ │ └── Validatable.swift │ │ ├── Foundation │ │ │ ├── Bundle+FileResource.swift │ │ │ └── Data+FileResource.swift │ │ └── UIKit │ │ │ ├── ColorPaletteItemResource+UIKit.swift │ │ │ ├── NibResource+UIKit.swift │ │ │ ├── StoryboardResourceWithInitialController+UIKit.swift │ │ │ ├── TypedStoryboardSegueInfo+UIStoryboardSegue.swift │ │ │ ├── UICollectionView+ReuseIdentifierProtocol.swift │ │ │ ├── UIColor+ColorResource.swift │ │ │ ├── UIFont+FontResource.swift │ │ │ ├── UIImage+ImageResource.swift │ │ │ ├── UINib+NibResource.swift │ │ │ ├── UIStoryboard+StoryboardResource.swift │ │ │ ├── UIStoryboard+StoryboardViewControllerResource.swift │ │ │ ├── UITableView+ReuseIdentifierProtocol.swift │ │ │ ├── UIViewController+NibResource.swift │ │ │ └── UIViewController+StoryboardSegueIdentifierProtocol.swift │ ├── License │ └── Readme.md │ ├── R.swift │ ├── License │ └── rswift │ ├── SnapKit │ ├── LICENSE │ ├── README.md │ └── Source │ │ ├── Constraint.swift │ │ ├── ConstraintAttributes.swift │ │ ├── ConstraintConfig.swift │ │ ├── ConstraintConstantTarget.swift │ │ ├── ConstraintDSL.swift │ │ ├── ConstraintDescription.swift │ │ ├── ConstraintInsetTarget.swift │ │ ├── ConstraintInsets.swift │ │ ├── ConstraintItem.swift │ │ ├── ConstraintLayoutGuide+Extensions.swift │ │ ├── ConstraintLayoutGuide.swift │ │ ├── ConstraintLayoutGuideDSL.swift │ │ ├── ConstraintLayoutSupport.swift │ │ ├── ConstraintLayoutSupportDSL.swift │ │ ├── ConstraintMaker.swift │ │ ├── ConstraintMakerEditable.swift │ │ ├── ConstraintMakerExtendable.swift │ │ ├── ConstraintMakerFinalizable.swift │ │ ├── ConstraintMakerPriortizable.swift │ │ ├── ConstraintMakerRelatable.swift │ │ ├── ConstraintMultiplierTarget.swift │ │ ├── ConstraintOffsetTarget.swift │ │ ├── ConstraintPriority.swift │ │ ├── ConstraintPriorityTarget.swift │ │ ├── ConstraintRelatableTarget.swift │ │ ├── ConstraintRelation.swift │ │ ├── ConstraintView+Extensions.swift │ │ ├── ConstraintView.swift │ │ ├── ConstraintViewDSL.swift │ │ ├── Debugging.swift │ │ ├── LayoutConstraint.swift │ │ ├── LayoutConstraintItem.swift │ │ ├── Typealiases.swift │ │ └── UILayoutSupport+Extensions.swift │ ├── SwiftyBeaver │ ├── LICENSE │ ├── README.md │ └── Sources │ │ ├── AES256CBC.swift │ │ ├── Base64.swift │ │ ├── BaseDestination.swift │ │ ├── ConsoleDestination.swift │ │ ├── Extensions.swift │ │ ├── FileDestination.swift │ │ ├── Filter.swift │ │ ├── GoogleCloudDestination.swift │ │ ├── SBPlatformDestination.swift │ │ └── SwiftyBeaver.swift │ ├── SwiftyJSON │ ├── LICENSE │ ├── README.md │ └── Source │ │ └── SwiftyJSON.swift │ └── Target Support Files │ ├── IMKLine │ ├── IMKLine-dummy.m │ ├── IMKLine-prefix.pch │ ├── IMKLine-umbrella.h │ ├── IMKLine.modulemap │ ├── IMKLine.xcconfig │ └── Info.plist │ ├── Pods-IMKLineDemo │ ├── Info.plist │ ├── Pods-IMKLineDemo-acknowledgements.markdown │ ├── Pods-IMKLineDemo-acknowledgements.plist │ ├── Pods-IMKLineDemo-dummy.m │ ├── Pods-IMKLineDemo-frameworks.sh │ ├── Pods-IMKLineDemo-resources.sh │ ├── Pods-IMKLineDemo-umbrella.h │ ├── Pods-IMKLineDemo.debug.xcconfig │ ├── Pods-IMKLineDemo.modulemap │ └── Pods-IMKLineDemo.release.xcconfig │ ├── R.swift.Library │ ├── Info.plist │ ├── R.swift.Library-dummy.m │ ├── R.swift.Library-prefix.pch │ ├── R.swift.Library-umbrella.h │ ├── R.swift.Library.modulemap │ └── R.swift.Library.xcconfig │ ├── SnapKit │ ├── Info.plist │ ├── SnapKit-dummy.m │ ├── SnapKit-prefix.pch │ ├── SnapKit-umbrella.h │ ├── SnapKit.modulemap │ └── SnapKit.xcconfig │ ├── SwiftyBeaver │ ├── Info.plist │ ├── SwiftyBeaver-dummy.m │ ├── SwiftyBeaver-prefix.pch │ ├── SwiftyBeaver-umbrella.h │ ├── SwiftyBeaver.modulemap │ └── SwiftyBeaver.xcconfig │ └── SwiftyJSON │ ├── Info.plist │ ├── SwiftyJSON-dummy.m │ ├── SwiftyJSON-prefix.pch │ ├── SwiftyJSON-umbrella.h │ ├── SwiftyJSON.modulemap │ └── SwiftyJSON.xcconfig ├── LICENSE ├── Picture ├── composite_demo.gif ├── screen_shot0.png ├── screen_shot1.png ├── screen_shot2.png └── screen_shot3.png └── README.md /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 4.0 2 | -------------------------------------------------------------------------------- /IMKLine.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'IMKLine' 3 | s.version = '1.0.2' 4 | s.summary = 'Swift K-Line Professional' 5 | s.homepage = 'https://github.com/GitHub-Life/IMKLine' 6 | s.license = 'MIT' 7 | s.authors = {'iMoon' => 'wantao1993@vip.qq.com'} 8 | s.platform = :ios, '9.0' 9 | s.source = {:git => 'https://github.com/GitHub-Life/IMKLine.git', :tag => s.version} 10 | s.source_files = 'IMKLine', 'IMKLine/**/*.swift' 11 | s.requires_arc = true 12 | s.dependency 'SnapKit' 13 | end 14 | -------------------------------------------------------------------------------- /IMKLine/Config/IMKLineTheme.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IMKLineTheme.swift 3 | // IMKLine 4 | // 5 | // Created by iMoon on 2017/12/19. 6 | // Copyright © 2017年 iMoon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public struct IMKLineTheme { 12 | 13 | public static let KLineChartBgColor = UIColor.init(white: 0, alpha: 0) 14 | 15 | public static let LineColor = UIColor.blue 16 | 17 | public static let BorderColor = UIColor.init(rgbHex: 0x444444) 18 | 19 | public static let KLineValueBgColor = UIColor.init(rgbaHex: 0x1E1E1EAA) 20 | 21 | public static let AccessoryTextColor = UIColor.init(rgbHex: 0x9A9A9A) 22 | 23 | public static let AccessoryTextFontSize = CGFloat(10) 24 | 25 | public static let TipTextColor = UIColor.init(rgbHex: 0xFFFFFF) 26 | 27 | public static let TipBgColor = UIColor.init(rgbHex: 0x1E1E1E) 28 | 29 | public static let TipTextFontSize = CGFloat(10) 30 | 31 | public static let HLTextColor = UIColor.init(rgbHex: 0xFFFFFF) 32 | 33 | public static let IndexSetBgColor = UIColor.init(rgbHex: 0x101010) 34 | 35 | public static let BtnNormalColor = UIColor.init(rgbHex: 0x888888) 36 | 37 | public static let BtnSelectedColor = UIColor.init(rgbHex: 0x2880F0) 38 | 39 | public static let BtnFontSize = CGFloat(10) 40 | 41 | public static let MAColors = [ 42 | UIColor.init(rgbHex: 0xFFFFFF), 43 | UIColor.init(rgbHex: 0x9A9A9A), 44 | UIColor.init(rgbHex: 0xF09632), 45 | UIColor.init(rgbHex: 0x115Bf2), 46 | UIColor.init(rgbHex: 0xE52027), 47 | UIColor.init(rgbHex: 0x453BCD), 48 | UIColor.init(rgbHex: 0x57D653), 49 | UIColor.init(rgbHex: 0xE52141), 50 | UIColor.init(rgbHex: 0x48B0E8) 51 | ] 52 | 53 | 54 | // static var RiseColor: UIColor { 55 | // get { 56 | // return XTThemeManager.shared.riseColor() 57 | // } 58 | // } 59 | // 60 | // static var DownColor: UIColor { 61 | // get { 62 | // return XTThemeManager.shared.downColor() 63 | // } 64 | // } 65 | 66 | public static let RiseColor = UIColor.red 67 | 68 | public static let DownColor = UIColor.green 69 | 70 | public static var CrossLineColor = UIColor.init(rgbHex: 0x888888) 71 | 72 | 73 | } 74 | -------------------------------------------------------------------------------- /IMKLine/Model/BOLL介绍.md: -------------------------------------------------------------------------------- 1 | 2 | //移动平均数分为MA(简单移动平均数)和EMA(指数移动平均数),其计算公式如下:[C为收盘价,N为周期数]: 3 | //MA(N)=(C1+C2+……CN)/N 4 | 5 | 6 | //MA(7)=(C1+C2+……CN)/7 7 | 8 | //MA(30)=(C1+C2+……CN)/30 9 | 10 | // EMA(N)=2/(N+1)*(C-昨日EMA)+昨日EMA; 11 | 12 | 13 | //12日EMA的算式为 14 | //EMA(12)=昨日EMA(12)*11/13+C*2/13=(C-昨日的EMA)×0.1538+昨日的EMA; 即为MACD指标中的快线-快速平滑移动平均线; 15 | //26日EMA的算式为 16 | //EMA(26)=昨日EMA(26)*25/27+C*2/27; 即为MACD指标中的慢线-慢速平滑移动平均线; 17 | 18 | //今日的DEA值(即MACD值)=前一日DEA*8/10+今日DIF*2/10. 19 | 20 | 关键的一点是:新股上市首日,其DIFF,DEA以及MACD都为0,因为当日不存在前一日,无法做迭代。而计算新股上市第二日的EMA时,前一日的EMA需要用收盘价(而非0)来计算。另外,需要注意,计算过程小数点后四舍五入保留4位小数,最后显示的时候四舍五入保留3位小数。 21 | 22 | 具体计算公式及例子如下: 23 | EMA(12)= 前一日EMA(12)×11/13+今日收盘价×2/13 24 | EMA(26)= 前一日EMA(26)×25/27+今日收盘价×2/27 25 | DIFF=今日EMA(12)- 今日EMA(26) 26 | DEA(MACD)= 前一日DEA×8/10+今日DIF×2/10 27 | BAR=2×(DIFF-DEA) 28 | 对理工检测: 29 | 20091218日: 30 | 新股上市,DIFF=0, DEA=0, MACD=0,收盘价55.01 31 | 20091219日: 32 | 收盘价53.7 33 | EMA(12)=55.01+(53.7-55.01)×2/13=54.8085 34 | EMA(26)=55.01+(53.7-55.01)×2/27=54.913 35 | DIFF=EMA(12)- EMA(26)= 54.8085 - 54.913 = -0.1045 (-0.104?) 36 | DEA=0+(-0.1045)X2/10=-0.0209 37 | BAR=2*((-0.1045)-(-0.0209))=-0.1672 38 | 对法因数控: 39 | 20080905日: 40 | 新股上市,DIFF=0, DEA=0, MACD=0,收盘价12.34 41 | 20080908日: 42 | 收盘价11.11 43 | EMA(12)=12.34+(11.11-12.34)×2/13=12.1508 44 | EMA(26)=12.34+(11.11-12.34)×2/27=12.2489 45 | DIFF=EMA(12)- EMA(26)= 12.1508 - 12.2489 = -0.0981 46 | DEA=0+(-0.0981)X2/10=-0.01962 47 | BAR=2*((-0.0981)-(-0.01962))=-0.15696 48 | 49 | 50 | //KDJ(9,3.3),下面以该参数为例说明计算方法。 51 | //9,3,3代表指标分析周期为9天,K值D值为3天 52 | //第一天的K,D通常初始化为50 53 | //RSV(9)=(今日收盘价-9日内最低价)÷(9日内最高价-9日内最低价)×100 54 | //K(3日)=(当日RSV值+2*前一日K值)÷3 55 | //D(3日)=(当日K值+2*前一日D值)÷3 56 | //J=3K-2D 57 | 58 | 59 | BOLL: 60 | 61 | 62 | 定义:布林线指标,即BOLL指标,其英文全称是“Bollinger Bands”. 63 | 64 | 描述:其利用统计原理,求出股价的标准差及其信赖区间,从而确定股价的波动范围及未来走势,利用波带显示股价的安全高低价位,因而也被称为布林带。其上下限范围不固定,随股价的滚动而变化。布林指标和麦克指标MIKE一样同属路径指标,股价波动在上限和下限的区间之内,这条带状区的宽窄,随着股价波动幅度的大小而变化,股价涨跌幅度加大时,带状区变宽,涨跌幅度狭小盘整时,带状区则变窄。 65 | 66 | 公式:中轨线=N日的移动平均线 67 | 上轨线=中轨线+两倍的标准差 68 | 下轨线=中轨线-两倍的标准差 69 | 70 | 计算过程: 71 | 72 | (1)计算MA 73 | MA=N日内的收盘价之和÷N 74 | (2)计算标准差MD 75 | MD=平方根(N-1)日的(C-MA)的两次方之和除以N 76 | (3)计算MB、UP、DN线 77 | MB=(N-1)日的MA 78 | UP=MB+k×MD 79 | DN=MB-k×MD 80 | (K为参数,可根据股票的特性来做相应的调整,一般默认为2) 81 | (N一般选择20天) 82 | 83 | 84 | 85 | 应用:布林口由缩口变张口,那么可以往着张口的趋势布局。趋势分两种,一种是下跌,一种是上涨。当K线站上中轨,并且伴随着成交量放量增长,则出现买点。 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /IMKLine/Model/IMKLine.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IMKLine.swift 3 | // IMKLine 4 | // 5 | // Created by iMoon on 2017/12/20. 6 | // Copyright © 2017年 iMoon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class IMKLine: NSObject { 12 | 13 | public var timeStamp: Double = Double(0) 14 | public var open: Double = Double(0) 15 | public var close: Double = Double(0) 16 | public var low: Double = Double(0) 17 | public var high: Double = Double(0) 18 | public var volume: Double = Double(0) 19 | 20 | /* 此方法在项目中根据返回的数据结构实现 21 | convenience init(json: JSON) { 22 | self.init() 23 | self.timeStamp = json["timestamp"].doubleValue 24 | self.open = json["open"].doubleValue 25 | self.close = json["close"].doubleValue 26 | self.low = json["low"].doubleValue 27 | self.high = json["high"].doubleValue 28 | self.volume = json["volume"].doubleValue 29 | } 30 | */ 31 | 32 | public var prevKline: IMKLine! 33 | public var index = 0 34 | public weak var klineGroup: IMKLineGroup! 35 | 36 | public var sumLastClose = Double(0) 37 | public var sumLastVolume = Double(0) 38 | public var klineMAs = [Int : Double]() 39 | public var volumeMAs = [Int : Double]() 40 | public var klineEMAs = [Int : Double]() 41 | 42 | public var klinePosition = IMKLinePosition() 43 | public var volumePosition = IMKLineVolumePosition() 44 | public var klineMAPositions = [Int : CGPoint]() 45 | public var volumeMAPositions = [Int : CGPoint]() 46 | public var klineEMAPositions = [Int : CGPoint]() 47 | 48 | public var klineBoll: IMKLineBoll? 49 | public var sumC_MA_Square = Double(0) 50 | 51 | public var klineMACD = IMKLineMACD() 52 | 53 | public var klineKDJ = IMKLineKDJ() 54 | 55 | public var klineRSI = IMKLineRSI() 56 | } 57 | -------------------------------------------------------------------------------- /IMKLine/Model/IMKLineGroup.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IMKLineGroup.swift 3 | // IMKLine 4 | // 5 | // Created by iMoon on 2017/12/20. 6 | // Copyright © 2017年 iMoon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class IMKLineGroup: NSObject { 12 | 13 | public var klineArray = [IMKLine]() 14 | 15 | /* 此方法在项目中根据返回的数据结构实现 16 | static func klineArray(klineJsonArray: [JSON]) -> [IMKLine] { 17 | var klineArray = [IMKLine]() 18 | for klineJson in klineJsonArray { 19 | let kline = IMKLine.init(json: klineJson) 20 | klineArray.insert(kline, at: 0) 21 | } 22 | return klineArray 23 | } 24 | */ 25 | 26 | public func insert(klineArray: [IMKLine]) { 27 | self.klineArray = klineArray + self.klineArray 28 | self.enumerateKlines() 29 | } 30 | 31 | public func insert(klineGroup: IMKLineGroup) { 32 | self.klineArray = klineGroup.klineArray + self.klineArray 33 | self.enumerateKlines() 34 | } 35 | 36 | public func enumerateKlines() { 37 | if self.klineArray.count == 0 { 38 | return 39 | } 40 | var prevKline = self.klineArray[0] 41 | prevKline.index = -1 42 | for kline in self.klineArray { 43 | kline.klineGroup = self 44 | kline.reset(prevKline: prevKline) 45 | prevKline = kline 46 | } 47 | } 48 | 49 | public func minTimeStamp() -> Double { 50 | if self.klineArray.count > 0 { 51 | return self.klineArray.first!.timeStamp 52 | } 53 | return Date().timeIntervalSince1970 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /IMKLine/Model/IMKLineSubStruct.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IMKLineSubStruct.swift 3 | // IMKLine 4 | // 5 | // Created by iMoon on 2017/12/22. 6 | // Copyright © 2017年 iMoon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public struct IMKLinePosition { 12 | public var openPoint = CGPoint.zero 13 | public var closePoint = CGPoint.zero 14 | public var highPoint = CGPoint.zero 15 | public var lowPoint = CGPoint.zero 16 | } 17 | 18 | public struct IMKLineVolumePosition { 19 | var zeroPoint = CGPoint.zero 20 | var volumePoint = CGPoint.zero 21 | } 22 | 23 | public struct IMKLineBoll { 24 | public var MB = Double(0) 25 | public var UP = Double(0) 26 | public var DN = Double(0) 27 | public var MBPoint = CGPoint.zero 28 | public var UPPoint = CGPoint.zero 29 | public var DNPoint = CGPoint.zero 30 | 31 | public init(MB: Double, UP: Double, DN: Double) { 32 | self.MB = MB 33 | self.UP = UP 34 | self.DN = DN 35 | } 36 | } 37 | 38 | public struct IMKLineMACD { 39 | public var EMA1 = Double(0) 40 | public var EMA2 = Double(0) 41 | public var DIFF = Double(0) 42 | public var DEA = Double(0) 43 | public var BAR = Double(0) 44 | public var zeroPoint = CGPoint.zero 45 | public var DIFFPoint = CGPoint.zero 46 | public var DEAPoint = CGPoint.zero 47 | public var BARPoint = CGPoint.zero 48 | } 49 | 50 | public struct IMKLineKDJ { 51 | var k = Double(50) 52 | var d = Double(50) 53 | var j = Double(0) 54 | var kPoint = CGPoint.zero 55 | var dPoint = CGPoint.zero 56 | var jPoint = CGPoint.zero 57 | } 58 | 59 | public struct IMKLineRSI { 60 | var klineRSIs = [Int : Double]() 61 | var bothRSI: (low: Double, high: Double)? 62 | var klineRSIPositions = [Int : CGPoint]() 63 | } 64 | -------------------------------------------------------------------------------- /IMKLine/Model/RSI介绍.md: -------------------------------------------------------------------------------- 1 | 2 | 公式代码 3 | RSI:= SMA(MAX(Close-LastClose,0),N,1)/SMA(ABS(Close-LastClose),N,1)*100 4 | 5 | 指标计算 6 | RSI6一般是6日相对强弱指标 7 | RSI12 一般是12日相对强弱指标 8 | RSI24一般是24日相对强弱指标 9 | 强弱指标的计算公式如下: 10 | RSI=100×RS/(1+RS) 或者,RSI=100-100÷(1+RS) 11 | RS=X天的平均上涨点数/X天的平均下跌点数 12 | 其中 RS=14天内收市价上涨数之和的平均值/14天内收市价下跌数之和的平均值 13 | 公式化简:RSI=100×14天内收市价上涨数之和的平均值÷(14天内收市价上涨数之和的平均值+14天内收市价下跌数之和的平均值)=100×14天内收市价上涨数之和÷(14天内收市价上涨数之和+14天内收市价下跌数之和)。 14 | 举例说明: 15 | 如果最近14天涨跌情形是: 16 | 第一天升2元,第二天跌2元,第三至第五天各升3元;第六天跌4元 第七天升2元,第八天跌5元;第九天跌6元,第十至十二天各升1元;第十三至十四天各跌3元。 17 | 那么,计算RSI的步骤如下: 18 | (一)将14天上升的数目相加,除以14,上例中总共上升16元除以14得1.143(精确到小数点后三位); 19 | (二)将14天下跌的数目相加,除以14,上例中总共下跌23元除以14得1.643(精确到小数点后三位); 20 | (三)求出相对强度RS,即RS=1.143/1.643=0.696(精确到小数点后三位); 21 | (四)1+RS=1+0.696=1.696; 22 | RS/(1+RS)=0.696/(1+0.696)=0.41038 23 | (五)RSI=100*0.41028=41.038. 24 | 结果14天的强弱指标RS1为41.038。 25 | 不同日期的14天RSI值当然是不同的,连接不同的点,即成RSI的轨迹。 26 | -------------------------------------------------------------------------------- /IMKLine/Tool/IMColor.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IMColor.swift 3 | // IMKLine 4 | // 5 | // Created by iMoon on 2018/3/7. 6 | // Copyright © 2018年 iMoon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public extension UIColor { 12 | 13 | public convenience init(rgbaHex: UInt) { 14 | self.init(red: CGFloat(((rgbaHex & 0xff000000) >> 16) >> 8) / 255.0, green: CGFloat((rgbaHex & 0xff0000) >> 16) / 255.0, blue: CGFloat((rgbaHex & 0xff00) >> 8) / 255.0, alpha: CGFloat(rgbaHex & 0xff) / 255.0) 15 | } 16 | 17 | public convenience init(rgbHex: UInt, alpha: CGFloat = 1.0) { 18 | self.init(red: CGFloat((rgbHex & 0xff0000) >> 16) / 255.0, green: CGFloat((rgbHex & 0xff00) >> 8) / 255.0, blue: CGFloat(rgbHex & 0xff) / 255.0, alpha: alpha) 19 | } 20 | 21 | public convenience init(red: Int, green: Int, blue: Int, alpha: Int = 255) { 22 | self.init(red: CGFloat(red) / 255, green: CGFloat(green) / 255, blue: CGFloat(blue) / 255, alpha: CGFloat(alpha) / 255) 23 | } 24 | 25 | public convenience init(rgbaHexStr: String) { 26 | var rgba = rgbaHexStr.replacingOccurrences(of: "0x", with: "") 27 | rgba = rgba.replacingOccurrences(of: "0X", with: "") 28 | rgba = rgba.replacingOccurrences(of: "#", with: "") 29 | if rgba.count != 6 && rgba.count != 8 { 30 | self.init(rgbHex: 0xFFFFFF) 31 | return 32 | } 33 | func number(withHexStr hexStr: String) -> UInt32 { 34 | var hexNumber: UInt32 = 0 35 | Scanner.init(string: hexStr).scanHexInt32(&hexNumber) 36 | return hexNumber 37 | } 38 | let rgbaStr = NSMutableString.init(string: rgba) 39 | let red = number(withHexStr: rgbaStr.substring(to: 2)) & 0xFF 40 | let green = number(withHexStr: rgbaStr.substring(with: NSRange.init(location: 2, length: 2))) & 0xFF 41 | let blue = number(withHexStr: rgbaStr.substring(with: NSRange.init(location: 4, length: 2))) & 0xFF 42 | var alpha = 255 43 | if rgba.count > 6 { 44 | alpha = Int(number(withHexStr: rgbaStr.substring(from: 6)) & 0xFF) 45 | } 46 | self.init(red: Int(red), green: Int(green), blue: Int(blue), alpha: alpha) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /IMKLine/Tool/IMKLineTool.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IMKLineTool.swift 3 | // XToken 4 | // 5 | // Created by iMoon on 2017/12/30. 6 | // Copyright © 2017年 iMoon. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public struct IMKLineTool { 12 | 13 | public static func dataDecimals(_ v1: Double, _ v2: Double) -> Int { 14 | let mv = (v1 + v2) / 2 15 | if mv < 1 { 16 | return IMKLineConfig.DataDecimals 17 | } else if mv < 10 && IMKLineConfig.DataDecimals > 1 { 18 | return IMKLineConfig.DataDecimals - 1 19 | } else if mv < 100 && IMKLineConfig.DataDecimals > 2 { 20 | return IMKLineConfig.DataDecimals - 2 21 | } else if mv < 1000 && IMKLineConfig.DataDecimals > 3 { 22 | return IMKLineConfig.DataDecimals - 3 23 | } else if mv < 10000 && IMKLineConfig.DataDecimals > 4 { 24 | return IMKLineConfig.DataDecimals - 4 25 | } else if mv < 100000 && IMKLineConfig.DataDecimals > 5 { 26 | return IMKLineConfig.DataDecimals - 5 27 | } else if mv < 1000000 && IMKLineConfig.DataDecimals > 6 { 28 | return IMKLineConfig.DataDecimals - 6 29 | } 30 | return 0 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /IMKLine/View/CrossLine/IMKLineCrossLine.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IMKLineCrossLine.swift 3 | // IMKLine 4 | // 5 | // Created by iMoon on 2017/12/21. 6 | // Copyright © 2017年 iMoon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SnapKit 11 | 12 | public enum LineOrientation: Int { 13 | case portrait, landscape 14 | } 15 | 16 | public class IMKLineCrossLine: UIView { 17 | 18 | lazy var label: UILabel = { 19 | let label = UILabel() 20 | label.textColor = IMKLineTheme.TipTextColor 21 | label.font = UIFont.systemFont(ofSize: IMKLineTheme.TipTextFontSize) 22 | label.backgroundColor = IMKLineTheme.TipBgColor 23 | label.adjustsFontSizeToFitWidth = true 24 | return label 25 | }() 26 | lazy var line: UIView = { 27 | let line = UILabel() 28 | line.backgroundColor = IMKLineTheme.CrossLineColor 29 | return line 30 | }() 31 | 32 | private var orientation: LineOrientation! 33 | 34 | required public init?(coder aDecoder: NSCoder) { 35 | fatalError("init(coder:) has not been implemented") 36 | } 37 | 38 | private convenience init() { 39 | self.init(frame: CGRect.zero) 40 | } 41 | 42 | public convenience init(orientation: LineOrientation) { 43 | self.init(frame: CGRect.zero) 44 | self.orientation = orientation 45 | self.setupView() 46 | } 47 | 48 | private override init(frame: CGRect) { 49 | super.init(frame: frame) 50 | } 51 | 52 | public func setupView() { 53 | self.addSubview(self.label) 54 | self.addSubview(self.line) 55 | if self.orientation == .portrait { 56 | self.label.snp.makeConstraints({ (maker) in 57 | maker.leading.equalToSuperview() 58 | maker.trailing.equalToSuperview() 59 | maker.bottom.equalToSuperview() 60 | maker.height.equalTo(IMKLineTheme.TipTextFontSize + 3) 61 | }) 62 | self.line.snp.makeConstraints({ (maker) in 63 | maker.width.equalTo(1) 64 | maker.centerX.equalToSuperview() 65 | maker.top.equalToSuperview() 66 | maker.bottom.equalTo(self.label.snp.top) 67 | }) 68 | } else { 69 | self.label.snp.makeConstraints({ (maker) in 70 | maker.trailing.equalToSuperview() 71 | maker.top.equalToSuperview() 72 | maker.bottom.equalToSuperview() 73 | maker.width.equalTo(IMKLineConfig.RightYViewWidth) 74 | }) 75 | self.line.snp.makeConstraints({ (maker) in 76 | maker.height.equalTo(1) 77 | maker.centerY.equalToSuperview() 78 | maker.leading.equalToSuperview() 79 | maker.trailing.equalTo(self.label.snp.leading) 80 | }) 81 | } 82 | } 83 | 84 | public func update(value: String) { 85 | self.label.text = " \(value) " 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /IMKLine/View/KLineView/IMKLineMAView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IMKLineMAView.swift 3 | // IMKLine 4 | // 5 | // Created by iMoon on 2017/12/20. 6 | // Copyright © 2017年 iMoon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class IMKLineMAView: UIView { 12 | 13 | public func update(kline: IMKLine) { 14 | for subv in self.subviews { 15 | subv.removeFromSuperview() 16 | } 17 | switch IMKLineParamters.KLineMAType { 18 | case .MA: 19 | var index = 0 20 | for key in kline.klineMAs.keys.sorted() { 21 | let text = String.init(format: "MA\(key):%.\(IMKLineParamters.KLineDataDecimals)f", kline.klineMAs[key]!) 22 | self.addLabel(index: index, text: text, offset: 1) 23 | index += 1 24 | } 25 | case .EMA: 26 | var index = 0 27 | for key in kline.klineEMAs.keys.sorted() { 28 | let text = String.init(format: "EMA\(key):%.\(IMKLineParamters.KLineDataDecimals)f", kline.klineEMAs[key]!) 29 | self.addLabel(index: index, text: text, offset: 1) 30 | index += 1 31 | } 32 | case .BOLL: 33 | let bollText = "BOLL(\(IMKLineParamters.KLineBollPramas["N"]!), \(IMKLineParamters.KLineBollPramas["P"]!))" 34 | self.addLabel(index: 0, text: bollText) 35 | if let klineBoll = kline.klineBoll { 36 | let midText = String.init(format: "MID:%.\(IMKLineParamters.KLineDataDecimals)f", klineBoll.MB) 37 | self.addLabel(index: 1, text: midText) 38 | let upperText = String.init(format: "UPPER:%.\(IMKLineParamters.KLineDataDecimals)f", klineBoll.UP) 39 | self.addLabel(index: 2, text: upperText) 40 | let lowerText = String.init(format: "LOWER:%.\(IMKLineParamters.KLineDataDecimals)f", klineBoll.DN) 41 | self.addLabel(index: 3, text: lowerText) 42 | } 43 | default: break 44 | } 45 | } 46 | 47 | private func addLabel(index: Int, text: String, offset: Int = 0) { 48 | let label = UILabel() 49 | label.textColor = IMKLineTheme.MAColors[index + offset] 50 | label.font = UIFont.systemFont(ofSize: IMKLineTheme.AccessoryTextFontSize) 51 | self.addSubview(label) 52 | label.snp.makeConstraints({ [weak self] (maker) in 53 | if index == 0 { 54 | maker.leading.equalToSuperview().offset(1) 55 | } else { 56 | maker.leading.equalTo((self?.subviews[index - 1].snp.trailing)!).offset(5) 57 | } 58 | maker.top.equalToSuperview() 59 | maker.bottom.equalToSuperview() 60 | }) 61 | label.text = text 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /IMKLine/View/KLineView/IMKLineValueView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IMKLineValueView.swift 3 | // IMKLine 4 | // 5 | // Created by iMoon on 2017/12/20. 6 | // Copyright © 2017年 iMoon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class IMKLineValueView: UIView { 12 | 13 | required public init?(coder aDecoder: NSCoder) { 14 | fatalError("init(coder:) has not been implemented") 15 | } 16 | 17 | public convenience init() { 18 | self.init(frame: CGRect.zero) 19 | } 20 | 21 | private override init(frame: CGRect) { 22 | super.init(frame: frame) 23 | self.setupView() 24 | } 25 | 26 | private func setupView() { 27 | self.backgroundColor = IMKLineTheme.KLineValueBgColor 28 | for index in 0.. 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo.xcodeproj/project.xcworkspace/xcuserdata/wantao.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo.xcodeproj/project.xcworkspace/xcuserdata/wantao.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo.xcodeproj/xcuserdata/wantao.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | IMKLineDemo.xcscheme 8 | 9 | orderHint 10 | 6 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | B754699E2052782F008E5656 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo.xcworkspace/xcuserdata/wantao.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo.xcworkspace/xcuserdata/wantao.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // IMKLineDemo 4 | // 5 | // Created by 万涛 on 2018/3/9. 6 | // Copyright © 2018年 iMoon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | var interfaceOrientation = UIInterfaceOrientationMask.landscape 17 | 18 | func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { 19 | return self.interfaceOrientation 20 | } 21 | 22 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 23 | // Override point for customization after application launch. 24 | 25 | initAppService() 26 | 27 | return true 28 | } 29 | 30 | } 31 | 32 | 33 | import SwiftyBeaver 34 | 35 | let log = SwiftyBeaver.self 36 | 37 | extension AppDelegate { 38 | 39 | func initAppService() { 40 | let console = ConsoleDestination() // log to Xcode Console 41 | let file = FileDestination() // log to default swiftybeaver.log file 42 | log.addDestination(console) 43 | log.addDestination(file) 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "k-8.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "k-6.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "k-7.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "k-4.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "k-5.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "k-3.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "k-2.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "k-1.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "size" : "1024x1024", 53 | "idiom" : "ios-marketing", 54 | "filename" : "k.png", 55 | "scale" : "1x" 56 | } 57 | ], 58 | "info" : { 59 | "version" : 1, 60 | "author" : "xcode" 61 | } 62 | } -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/AppIcon.appiconset/k-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/AppIcon.appiconset/k-1.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/AppIcon.appiconset/k-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/AppIcon.appiconset/k-2.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/AppIcon.appiconset/k-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/AppIcon.appiconset/k-3.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/AppIcon.appiconset/k-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/AppIcon.appiconset/k-4.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/AppIcon.appiconset/k-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/AppIcon.appiconset/k-5.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/AppIcon.appiconset/k-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/AppIcon.appiconset/k-6.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/AppIcon.appiconset/k-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/AppIcon.appiconset/k-7.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/AppIcon.appiconset/k-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/AppIcon.appiconset/k-8.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/AppIcon.appiconset/k.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/AppIcon.appiconset/k.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_curve.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "kline_curve.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "kline_curve@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "kline_curve@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_curve.imageset/kline_curve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_curve.imageset/kline_curve.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_curve.imageset/kline_curve@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_curve.imageset/kline_curve@2x.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_curve.imageset/kline_curve@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_curve.imageset/kline_curve@3x.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_hollow.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "kline_hollow.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "kline_hollow@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "kline_hollow@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_hollow.imageset/kline_hollow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_hollow.imageset/kline_hollow.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_hollow.imageset/kline_hollow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_hollow.imageset/kline_hollow@2x.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_hollow.imageset/kline_hollow@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_hollow.imageset/kline_hollow@3x.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_line.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "kline_line.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "kline_line@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "kline_line@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_line.imageset/kline_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_line.imageset/kline_line.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_line.imageset/kline_line@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_line.imageset/kline_line@2x.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_line.imageset/kline_line@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_line.imageset/kline_line@3x.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_standard.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "kline_standard.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "kline_standard@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "kline_standard@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_standard.imageset/kline_standard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_standard.imageset/kline_standard.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_standard.imageset/kline_standard@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_standard.imageset/kline_standard@2x.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_standard.imageset/kline_standard@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/IMKLineDemo/Assets.xcassets/kline_standard.imageset/kline_standard@3x.png -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/IMKLineDataParser.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IMKLineDataParser.swift 3 | // X-Token 4 | // 5 | // Created by iMoon on 2018/3/3. 6 | // Copyright © 2018年 iMoon. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import IMKLine 11 | import SwiftyJSON 12 | 13 | extension IMKLine { 14 | 15 | convenience init(json: JSON) { 16 | self.init() 17 | self.timeStamp = json["timestamp"].doubleValue 18 | self.open = json["open"].doubleValue 19 | self.close = json["close"].doubleValue 20 | self.low = json["low"].doubleValue 21 | self.high = json["high"].doubleValue 22 | self.volume = json["volume"].doubleValue 23 | } 24 | 25 | } 26 | 27 | extension IMKLineGroup { 28 | 29 | static func klineArray(klineJsonArray: [JSON]) -> [IMKLine] { 30 | var klineArray = [IMKLine]() 31 | for klineJson in klineJsonArray { 32 | let kline = IMKLine.init(json: klineJson) 33 | klineArray.insert(kline, at: 0) 34 | } 35 | return klineArray 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | IMKLine 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | Main 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationLandscapeLeft 36 | UIInterfaceOrientationLandscapeRight 37 | 38 | UISupportedInterfaceOrientations~ipad 39 | 40 | UIInterfaceOrientationPortrait 41 | UIInterfaceOrientationPortraitUpsideDown 42 | UIInterfaceOrientationLandscapeLeft 43 | UIInterfaceOrientationLandscapeRight 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /IMKLineDemo/IMKLineDemo/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // IMKLineDemo 4 | // 5 | // Created by 万涛 on 2018/3/9. 6 | // Copyright © 2018年 iMoon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import IMKLine 11 | import SnapKit 12 | 13 | class ViewController: UIViewController { 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | // Do any additional setup after loading the view. 18 | } 19 | 20 | override func didReceiveMemoryWarning() { 21 | super.didReceiveMemoryWarning() 22 | // Dispose of any resources that can be recreated. 23 | } 24 | 25 | 26 | /* 27 | // MARK: - Navigation 28 | 29 | // In a storyboard-based application, you will often want to do a little preparation before navigation 30 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 31 | // Get the new view controller using segue.destinationViewController. 32 | // Pass the selected object to the new view controller. 33 | } 34 | */ 35 | 36 | } 37 | -------------------------------------------------------------------------------- /IMKLineDemo/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '9.0' 2 | inhibit_all_warnings! 3 | 4 | target 'IMKLineDemo' do 5 | use_frameworks! 6 | 7 | pod 'IMKLine' 8 | pod 'R.swift' 9 | pod 'SwiftyJSON' 10 | pod 'SwiftyBeaver' 11 | 12 | end 13 | -------------------------------------------------------------------------------- /IMKLineDemo/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - IMKLine (1.0.2): 3 | - SnapKit 4 | - R.swift (4.0.0): 5 | - R.swift.Library (~> 4.0.0) 6 | - R.swift.Library (4.0.0) 7 | - SnapKit (4.0.0) 8 | - SwiftyBeaver (1.5.1) 9 | - SwiftyJSON (4.0.0) 10 | 11 | DEPENDENCIES: 12 | - IMKLine 13 | - R.swift 14 | - SwiftyBeaver 15 | - SwiftyJSON 16 | 17 | SPEC CHECKSUMS: 18 | IMKLine: bc73bab39380c8fb24b542ee378a2ace9c2563fb 19 | R.swift: d6a5ec2f55a8441dc0ed9f1f8b37d7d11ae85c66 20 | R.swift.Library: c3af34921024333546e23b70e70d0b4e0cffca75 21 | SnapKit: a42d492c16e80209130a3379f73596c3454b7694 22 | SwiftyBeaver: 4f74563624b2c1e821c522c54142b5dd5ebb0f30 23 | SwiftyJSON: 070dabdcb1beb81b247c65ffa3a79dbbfb3b48aa 24 | 25 | PODFILE CHECKSUM: 53d324947d314d0d7e97dae15ddc86675f6c4fb4 26 | 27 | COCOAPODS: 1.4.0 28 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/IMKLine/IMKLine/Config/IMKLineTheme.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IMKLineTheme.swift 3 | // IMKLine 4 | // 5 | // Created by iMoon on 2017/12/19. 6 | // Copyright © 2017年 iMoon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public struct IMKLineTheme { 12 | 13 | public static let KLineChartBgColor = UIColor.init(white: 0, alpha: 0) 14 | 15 | public static let LineColor = UIColor.blue 16 | 17 | public static let BorderColor = UIColor.init(rgbHex: 0x444444) 18 | 19 | public static let KLineValueBgColor = UIColor.init(rgbaHex: 0x1E1E1EAA) 20 | 21 | public static let AccessoryTextColor = UIColor.init(rgbHex: 0x9A9A9A) 22 | 23 | public static let AccessoryTextFontSize = CGFloat(10) 24 | 25 | public static let TipTextColor = UIColor.init(rgbHex: 0xFFFFFF) 26 | 27 | public static let TipBgColor = UIColor.init(rgbHex: 0x1E1E1E) 28 | 29 | public static let TipTextFontSize = CGFloat(10) 30 | 31 | public static let HLTextColor = UIColor.init(rgbHex: 0xFFFFFF) 32 | 33 | public static let IndexSetBgColor = UIColor.init(rgbHex: 0x101010) 34 | 35 | public static let BtnNormalColor = UIColor.init(rgbHex: 0x888888) 36 | 37 | public static let BtnSelectedColor = UIColor.init(rgbHex: 0x2880F0) 38 | 39 | public static let BtnFontSize = CGFloat(10) 40 | 41 | public static let MAColors = [ 42 | UIColor.init(rgbHex: 0xFFFFFF), 43 | UIColor.init(rgbHex: 0x9A9A9A), 44 | UIColor.init(rgbHex: 0xF09632), 45 | UIColor.init(rgbHex: 0x115Bf2), 46 | UIColor.init(rgbHex: 0xE52027), 47 | UIColor.init(rgbHex: 0x453BCD), 48 | UIColor.init(rgbHex: 0x57D653), 49 | UIColor.init(rgbHex: 0xE52141), 50 | UIColor.init(rgbHex: 0x48B0E8) 51 | ] 52 | 53 | 54 | // static var RiseColor: UIColor { 55 | // get { 56 | // return XTThemeManager.shared.riseColor() 57 | // } 58 | // } 59 | // 60 | // static var DownColor: UIColor { 61 | // get { 62 | // return XTThemeManager.shared.downColor() 63 | // } 64 | // } 65 | 66 | public static let RiseColor = UIColor.red 67 | 68 | public static let DownColor = UIColor.green 69 | 70 | public static var CrossLineColor = UIColor.init(rgbHex: 0x888888) 71 | 72 | 73 | } 74 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/IMKLine/IMKLine/Model/IMKLine.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IMKLine.swift 3 | // IMKLine 4 | // 5 | // Created by iMoon on 2017/12/20. 6 | // Copyright © 2017年 iMoon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class IMKLine: NSObject { 12 | 13 | public var timeStamp: Double = Double(0) 14 | public var open: Double = Double(0) 15 | public var close: Double = Double(0) 16 | public var low: Double = Double(0) 17 | public var high: Double = Double(0) 18 | public var volume: Double = Double(0) 19 | 20 | /* 此方法在项目中根据返回的数据结构实现 21 | convenience init(json: JSON) { 22 | self.init() 23 | self.timeStamp = json["timestamp"].doubleValue 24 | self.open = json["open"].doubleValue 25 | self.close = json["close"].doubleValue 26 | self.low = json["low"].doubleValue 27 | self.high = json["high"].doubleValue 28 | self.volume = json["volume"].doubleValue 29 | } 30 | */ 31 | 32 | public var prevKline: IMKLine! 33 | public var index = 0 34 | public weak var klineGroup: IMKLineGroup! 35 | 36 | public var sumLastClose = Double(0) 37 | public var sumLastVolume = Double(0) 38 | public var klineMAs = [Int : Double]() 39 | public var volumeMAs = [Int : Double]() 40 | public var klineEMAs = [Int : Double]() 41 | 42 | public var klinePosition = IMKLinePosition() 43 | public var volumePosition = IMKLineVolumePosition() 44 | public var klineMAPositions = [Int : CGPoint]() 45 | public var volumeMAPositions = [Int : CGPoint]() 46 | public var klineEMAPositions = [Int : CGPoint]() 47 | 48 | public var klineBoll: IMKLineBoll? 49 | public var sumC_MA_Square = Double(0) 50 | 51 | public var klineMACD = IMKLineMACD() 52 | 53 | public var klineKDJ = IMKLineKDJ() 54 | 55 | public var klineRSI = IMKLineRSI() 56 | } 57 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/IMKLine/IMKLine/Model/IMKLineGroup.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IMKLineGroup.swift 3 | // IMKLine 4 | // 5 | // Created by iMoon on 2017/12/20. 6 | // Copyright © 2017年 iMoon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class IMKLineGroup: NSObject { 12 | 13 | public var klineArray = [IMKLine]() 14 | 15 | /* 此方法在项目中根据返回的数据结构实现 16 | static func klineArray(klineJsonArray: [JSON]) -> [IMKLine] { 17 | var klineArray = [IMKLine]() 18 | for klineJson in klineJsonArray { 19 | let kline = IMKLine.init(json: klineJson) 20 | klineArray.insert(kline, at: 0) 21 | } 22 | return klineArray 23 | } 24 | */ 25 | 26 | public func insert(klineArray: [IMKLine]) { 27 | self.klineArray = klineArray + self.klineArray 28 | self.enumerateKlines() 29 | } 30 | 31 | public func insert(klineGroup: IMKLineGroup) { 32 | self.klineArray = klineGroup.klineArray + self.klineArray 33 | self.enumerateKlines() 34 | } 35 | 36 | public func enumerateKlines() { 37 | if self.klineArray.count == 0 { 38 | return 39 | } 40 | var prevKline = self.klineArray[0] 41 | prevKline.index = -1 42 | for kline in self.klineArray { 43 | kline.klineGroup = self 44 | kline.reset(prevKline: prevKline) 45 | prevKline = kline 46 | } 47 | } 48 | 49 | public func minTimeStamp() -> Double { 50 | if self.klineArray.count > 0 { 51 | return self.klineArray.first!.timeStamp 52 | } 53 | return Date().timeIntervalSince1970 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/IMKLine/IMKLine/Model/IMKLineSubStruct.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IMKLineSubStruct.swift 3 | // IMKLine 4 | // 5 | // Created by iMoon on 2017/12/22. 6 | // Copyright © 2017年 iMoon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public struct IMKLinePosition { 12 | public var openPoint = CGPoint.zero 13 | public var closePoint = CGPoint.zero 14 | public var highPoint = CGPoint.zero 15 | public var lowPoint = CGPoint.zero 16 | } 17 | 18 | public struct IMKLineVolumePosition { 19 | var zeroPoint = CGPoint.zero 20 | var volumePoint = CGPoint.zero 21 | } 22 | 23 | public struct IMKLineBoll { 24 | public var MB = Double(0) 25 | public var UP = Double(0) 26 | public var DN = Double(0) 27 | public var MBPoint = CGPoint.zero 28 | public var UPPoint = CGPoint.zero 29 | public var DNPoint = CGPoint.zero 30 | 31 | public init(MB: Double, UP: Double, DN: Double) { 32 | self.MB = MB 33 | self.UP = UP 34 | self.DN = DN 35 | } 36 | } 37 | 38 | public struct IMKLineMACD { 39 | public var EMA1 = Double(0) 40 | public var EMA2 = Double(0) 41 | public var DIFF = Double(0) 42 | public var DEA = Double(0) 43 | public var BAR = Double(0) 44 | public var zeroPoint = CGPoint.zero 45 | public var DIFFPoint = CGPoint.zero 46 | public var DEAPoint = CGPoint.zero 47 | public var BARPoint = CGPoint.zero 48 | } 49 | 50 | public struct IMKLineKDJ { 51 | var k = Double(50) 52 | var d = Double(50) 53 | var j = Double(0) 54 | var kPoint = CGPoint.zero 55 | var dPoint = CGPoint.zero 56 | var jPoint = CGPoint.zero 57 | } 58 | 59 | public struct IMKLineRSI { 60 | var klineRSIs = [Int : Double]() 61 | var bothRSI: (low: Double, high: Double)? 62 | var klineRSIPositions = [Int : CGPoint]() 63 | } 64 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/IMKLine/IMKLine/Tool/IMColor.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IMColor.swift 3 | // IMKLine 4 | // 5 | // Created by iMoon on 2018/3/7. 6 | // Copyright © 2018年 iMoon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public extension UIColor { 12 | 13 | public convenience init(rgbaHex: UInt) { 14 | self.init(red: CGFloat(((rgbaHex & 0xff000000) >> 16) >> 8) / 255.0, green: CGFloat((rgbaHex & 0xff0000) >> 16) / 255.0, blue: CGFloat((rgbaHex & 0xff00) >> 8) / 255.0, alpha: CGFloat(rgbaHex & 0xff) / 255.0) 15 | } 16 | 17 | public convenience init(rgbHex: UInt, alpha: CGFloat = 1.0) { 18 | self.init(red: CGFloat((rgbHex & 0xff0000) >> 16) / 255.0, green: CGFloat((rgbHex & 0xff00) >> 8) / 255.0, blue: CGFloat(rgbHex & 0xff) / 255.0, alpha: alpha) 19 | } 20 | 21 | public convenience init(red: Int, green: Int, blue: Int, alpha: Int = 255) { 22 | self.init(red: CGFloat(red) / 255, green: CGFloat(green) / 255, blue: CGFloat(blue) / 255, alpha: CGFloat(alpha) / 255) 23 | } 24 | 25 | public convenience init(rgbaHexStr: String) { 26 | var rgba = rgbaHexStr.replacingOccurrences(of: "0x", with: "") 27 | rgba = rgba.replacingOccurrences(of: "0X", with: "") 28 | rgba = rgba.replacingOccurrences(of: "#", with: "") 29 | if rgba.count != 6 && rgba.count != 8 { 30 | self.init(rgbHex: 0xFFFFFF) 31 | return 32 | } 33 | func number(withHexStr hexStr: String) -> UInt32 { 34 | var hexNumber: UInt32 = 0 35 | Scanner.init(string: hexStr).scanHexInt32(&hexNumber) 36 | return hexNumber 37 | } 38 | let rgbaStr = NSMutableString.init(string: rgba) 39 | let red = number(withHexStr: rgbaStr.substring(to: 2)) & 0xFF 40 | let green = number(withHexStr: rgbaStr.substring(with: NSRange.init(location: 2, length: 2))) & 0xFF 41 | let blue = number(withHexStr: rgbaStr.substring(with: NSRange.init(location: 4, length: 2))) & 0xFF 42 | var alpha = 255 43 | if rgba.count > 6 { 44 | alpha = Int(number(withHexStr: rgbaStr.substring(from: 6)) & 0xFF) 45 | } 46 | self.init(red: Int(red), green: Int(green), blue: Int(blue), alpha: alpha) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/IMKLine/IMKLine/Tool/IMKLineTool.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IMKLineTool.swift 3 | // XToken 4 | // 5 | // Created by iMoon on 2017/12/30. 6 | // Copyright © 2017年 iMoon. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public struct IMKLineTool { 12 | 13 | public static func dataDecimals(_ v1: Double, _ v2: Double) -> Int { 14 | let mv = (v1 + v2) / 2 15 | if mv < 1 { 16 | return IMKLineConfig.DataDecimals 17 | } else if mv < 10 && IMKLineConfig.DataDecimals > 1 { 18 | return IMKLineConfig.DataDecimals - 1 19 | } else if mv < 100 && IMKLineConfig.DataDecimals > 2 { 20 | return IMKLineConfig.DataDecimals - 2 21 | } else if mv < 1000 && IMKLineConfig.DataDecimals > 3 { 22 | return IMKLineConfig.DataDecimals - 3 23 | } else if mv < 10000 && IMKLineConfig.DataDecimals > 4 { 24 | return IMKLineConfig.DataDecimals - 4 25 | } else if mv < 100000 && IMKLineConfig.DataDecimals > 5 { 26 | return IMKLineConfig.DataDecimals - 5 27 | } else if mv < 1000000 && IMKLineConfig.DataDecimals > 6 { 28 | return IMKLineConfig.DataDecimals - 6 29 | } 30 | return 0 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/IMKLine/IMKLine/View/CrossLine/IMKLineCrossLine.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IMKLineCrossLine.swift 3 | // IMKLine 4 | // 5 | // Created by iMoon on 2017/12/21. 6 | // Copyright © 2017年 iMoon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SnapKit 11 | 12 | public enum LineOrientation: Int { 13 | case portrait, landscape 14 | } 15 | 16 | public class IMKLineCrossLine: UIView { 17 | 18 | lazy var label: UILabel = { 19 | let label = UILabel() 20 | label.textColor = IMKLineTheme.TipTextColor 21 | label.font = UIFont.systemFont(ofSize: IMKLineTheme.TipTextFontSize) 22 | label.backgroundColor = IMKLineTheme.TipBgColor 23 | label.adjustsFontSizeToFitWidth = true 24 | return label 25 | }() 26 | lazy var line: UIView = { 27 | let line = UILabel() 28 | line.backgroundColor = IMKLineTheme.CrossLineColor 29 | return line 30 | }() 31 | 32 | private var orientation: LineOrientation! 33 | 34 | required public init?(coder aDecoder: NSCoder) { 35 | fatalError("init(coder:) has not been implemented") 36 | } 37 | 38 | private convenience init() { 39 | self.init(frame: CGRect.zero) 40 | } 41 | 42 | public convenience init(orientation: LineOrientation) { 43 | self.init(frame: CGRect.zero) 44 | self.orientation = orientation 45 | self.setupView() 46 | } 47 | 48 | private override init(frame: CGRect) { 49 | super.init(frame: frame) 50 | } 51 | 52 | public func setupView() { 53 | self.addSubview(self.label) 54 | self.addSubview(self.line) 55 | if self.orientation == .portrait { 56 | self.label.snp.makeConstraints({ (maker) in 57 | maker.leading.equalToSuperview() 58 | maker.trailing.equalToSuperview() 59 | maker.bottom.equalToSuperview() 60 | maker.height.equalTo(IMKLineTheme.TipTextFontSize + 3) 61 | }) 62 | self.line.snp.makeConstraints({ (maker) in 63 | maker.width.equalTo(1) 64 | maker.centerX.equalToSuperview() 65 | maker.top.equalToSuperview() 66 | maker.bottom.equalTo(self.label.snp.top) 67 | }) 68 | } else { 69 | self.label.snp.makeConstraints({ (maker) in 70 | maker.trailing.equalToSuperview() 71 | maker.top.equalToSuperview() 72 | maker.bottom.equalToSuperview() 73 | maker.width.equalTo(IMKLineConfig.RightYViewWidth) 74 | }) 75 | self.line.snp.makeConstraints({ (maker) in 76 | maker.height.equalTo(1) 77 | maker.centerY.equalToSuperview() 78 | maker.leading.equalToSuperview() 79 | maker.trailing.equalTo(self.label.snp.leading) 80 | }) 81 | } 82 | } 83 | 84 | public func update(value: String) { 85 | self.label.text = " \(value) " 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/IMKLine/IMKLine/View/KLineView/IMKLineMAView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IMKLineMAView.swift 3 | // IMKLine 4 | // 5 | // Created by iMoon on 2017/12/20. 6 | // Copyright © 2017年 iMoon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class IMKLineMAView: UIView { 12 | 13 | public func update(kline: IMKLine) { 14 | for subv in self.subviews { 15 | subv.removeFromSuperview() 16 | } 17 | switch IMKLineParamters.KLineMAType { 18 | case .MA: 19 | var index = 0 20 | for key in kline.klineMAs.keys.sorted() { 21 | let text = String.init(format: "MA\(key):%.\(IMKLineParamters.KLineDataDecimals)f", kline.klineMAs[key]!) 22 | self.addLabel(index: index, text: text, offset: 1) 23 | index += 1 24 | } 25 | case .EMA: 26 | var index = 0 27 | for key in kline.klineEMAs.keys.sorted() { 28 | let text = String.init(format: "EMA\(key):%.\(IMKLineParamters.KLineDataDecimals)f", kline.klineEMAs[key]!) 29 | self.addLabel(index: index, text: text, offset: 1) 30 | index += 1 31 | } 32 | case .BOLL: 33 | let bollText = "BOLL(\(IMKLineParamters.KLineBollPramas["N"]!), \(IMKLineParamters.KLineBollPramas["P"]!))" 34 | self.addLabel(index: 0, text: bollText) 35 | if let klineBoll = kline.klineBoll { 36 | let midText = String.init(format: "MID:%.\(IMKLineParamters.KLineDataDecimals)f", klineBoll.MB) 37 | self.addLabel(index: 1, text: midText) 38 | let upperText = String.init(format: "UPPER:%.\(IMKLineParamters.KLineDataDecimals)f", klineBoll.UP) 39 | self.addLabel(index: 2, text: upperText) 40 | let lowerText = String.init(format: "LOWER:%.\(IMKLineParamters.KLineDataDecimals)f", klineBoll.DN) 41 | self.addLabel(index: 3, text: lowerText) 42 | } 43 | default: break 44 | } 45 | } 46 | 47 | private func addLabel(index: Int, text: String, offset: Int = 0) { 48 | let label = UILabel() 49 | label.textColor = IMKLineTheme.MAColors[index + offset] 50 | label.font = UIFont.systemFont(ofSize: IMKLineTheme.AccessoryTextFontSize) 51 | self.addSubview(label) 52 | label.snp.makeConstraints({ [weak self] (maker) in 53 | if index == 0 { 54 | maker.leading.equalToSuperview().offset(1) 55 | } else { 56 | maker.leading.equalTo((self?.subviews[index - 1].snp.trailing)!).offset(5) 57 | } 58 | maker.top.equalToSuperview() 59 | maker.bottom.equalToSuperview() 60 | }) 61 | label.text = text 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/IMKLine/IMKLine/View/KLineView/IMKLineValueView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IMKLineValueView.swift 3 | // IMKLine 4 | // 5 | // Created by iMoon on 2017/12/20. 6 | // Copyright © 2017年 iMoon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class IMKLineValueView: UIView { 12 | 13 | required public init?(coder aDecoder: NSCoder) { 14 | fatalError("init(coder:) has not been implemented") 15 | } 16 | 17 | public convenience init() { 18 | self.init(frame: CGRect.zero) 19 | } 20 | 21 | private override init(frame: CGRect) { 22 | super.init(frame: frame) 23 | self.setupView() 24 | } 25 | 26 | private func setupView() { 27 | self.backgroundColor = IMKLineTheme.KLineValueBgColor 28 | for index in 0.. 4.0.0) 6 | - R.swift.Library (4.0.0) 7 | - SnapKit (4.0.0) 8 | - SwiftyBeaver (1.5.1) 9 | - SwiftyJSON (4.0.0) 10 | 11 | DEPENDENCIES: 12 | - IMKLine 13 | - R.swift 14 | - SwiftyBeaver 15 | - SwiftyJSON 16 | 17 | SPEC CHECKSUMS: 18 | IMKLine: bc73bab39380c8fb24b542ee378a2ace9c2563fb 19 | R.swift: d6a5ec2f55a8441dc0ed9f1f8b37d7d11ae85c66 20 | R.swift.Library: c3af34921024333546e23b70e70d0b4e0cffca75 21 | SnapKit: a42d492c16e80209130a3379f73596c3454b7694 22 | SwiftyBeaver: 4f74563624b2c1e821c522c54142b5dd5ebb0f30 23 | SwiftyJSON: 070dabdcb1beb81b247c65ffa3a79dbbfb3b48aa 24 | 25 | PODFILE CHECKSUM: 53d324947d314d0d7e97dae15ddc86675f6c4fb4 26 | 27 | COCOAPODS: 1.4.0 28 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Pods.xcodeproj/xcuserdata/wantao.xcuserdatad/xcschemes/IMKLine.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Pods.xcodeproj/xcuserdata/wantao.xcuserdatad/xcschemes/Pods-IMKLineDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 47 | 48 | 54 | 55 | 56 | 57 | 58 | 59 | 65 | 66 | 68 | 69 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Pods.xcodeproj/xcuserdata/wantao.xcuserdatad/xcschemes/R.swift.Library.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 47 | 48 | 54 | 55 | 56 | 57 | 58 | 59 | 65 | 66 | 68 | 69 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Pods.xcodeproj/xcuserdata/wantao.xcuserdatad/xcschemes/SnapKit.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Pods.xcodeproj/xcuserdata/wantao.xcuserdatad/xcschemes/SwiftyBeaver.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Pods.xcodeproj/xcuserdata/wantao.xcuserdatad/xcschemes/SwiftyJSON.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Pods.xcodeproj/xcuserdata/wantao.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | IMKLine.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Pods-IMKLineDemo.xcscheme 13 | 14 | isShown 15 | 16 | 17 | R.swift.Library.xcscheme 18 | 19 | isShown 20 | 21 | 22 | SnapKit.xcscheme 23 | 24 | isShown 25 | 26 | 27 | SwiftyBeaver.xcscheme 28 | 29 | isShown 30 | 31 | 32 | SwiftyJSON.xcscheme 33 | 34 | isShown 35 | 36 | 37 | 38 | SuppressBuildableAutocreation 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/Core/ColorPaletteItemResource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ColorPaletteItemResource.swift 3 | // R.swift.Library 4 | // 5 | // Created by Tom Lokhorst on 2016-03-13. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | 12 | public protocol ColorPaletteItemResourceType { 13 | 14 | /// Name of the color 15 | var name: String { get } 16 | 17 | /// Red componenent of color 18 | var red: CGFloat { get } 19 | 20 | /// Green componenent of color 21 | var green: CGFloat { get } 22 | 23 | /// Blue componenent of color 24 | var blue: CGFloat { get } 25 | 26 | /// Alpha componenent of color 27 | var alpha: CGFloat { get } 28 | } 29 | 30 | @available(*, deprecated: 11, message: "Use color assets instead") 31 | public struct ColorPaletteItemResource: ColorPaletteItemResourceType { 32 | 33 | /// Name of the color 34 | public let name: String 35 | 36 | /// Red componenent of color 37 | public let red: CGFloat 38 | 39 | /// Green componenent of color 40 | public let green: CGFloat 41 | 42 | /// Blue componenent of color 43 | public let blue: CGFloat 44 | 45 | /// Alpha componenent of color 46 | public let alpha: CGFloat 47 | 48 | public init(name: String, red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat) { 49 | self.name = name 50 | self.red = red 51 | self.green = green 52 | self.blue = blue 53 | self.alpha = alpha 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/Core/ColorResource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ColorResource.swift 3 | // R.swift.Library 4 | // 5 | // Created by Tom Lokhorst on 2016-03-13. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | 12 | public protocol ColorResourceType { 13 | 14 | /// Bundle this color is in 15 | var bundle: Bundle { get } 16 | 17 | /// Name of the color 18 | var name: String { get } 19 | } 20 | 21 | public struct ColorResource: ColorResourceType { 22 | 23 | /// Bundle this color is in 24 | public let bundle: Bundle 25 | 26 | /// Name of the color 27 | public let name: String 28 | 29 | public init(bundle: Bundle, name: String) { 30 | self.bundle = bundle 31 | self.name = name 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/Core/FileResource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FileResource.swift 3 | // R.swift.Library 4 | // 5 | // Created by Mathijs Kadijk on 06-01-16. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | 12 | public protocol FileResourceType { 13 | 14 | /// Bundle this file is in 15 | var bundle: Bundle { get } 16 | 17 | /// Name of the file file on disk 18 | var name: String { get } 19 | 20 | /// Extension of the file on disk 21 | var pathExtension: String { get } 22 | } 23 | 24 | public extension FileResourceType { 25 | /// Name of the file on disk with the pathExtension 26 | var fullName: String { 27 | return [name, pathExtension].joined(separator: ".") 28 | } 29 | 30 | /** 31 | Returns the full pathname for this resource. 32 | 33 | - returns: The full pathname for this resource or nil if the file could not be located. 34 | */ 35 | func path() -> String? { 36 | return bundle.path(forResource: self) 37 | } 38 | 39 | /** 40 | Returns the file URL for this resource. 41 | 42 | - returns: The file URL for this resource or nil if the file could not be located. 43 | */ 44 | func url() -> URL? { 45 | return bundle.url(forResource: self) 46 | } 47 | } 48 | 49 | public struct FileResource: FileResourceType { 50 | /// Bundle this file is in 51 | public let bundle: Bundle 52 | 53 | /// Name of the file on disk, without the pathExtension 54 | public let name: String 55 | 56 | /// Extension of the file on disk 57 | public let pathExtension: String 58 | 59 | public init(bundle: Bundle, name: String, pathExtension: String) { 60 | self.bundle = bundle 61 | self.name = name 62 | self.pathExtension = pathExtension 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/Core/FontResource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FontResource.swift 3 | // R.swift.Library 4 | // 5 | // Created by Mathijs Kadijk on 06-01-16. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | 12 | public protocol FontResourceType { 13 | /// Name of the font 14 | var fontName: String { get } 15 | } 16 | 17 | public struct FontResource: FontResourceType { 18 | /// Name of the font 19 | public let fontName: String 20 | 21 | public init(fontName: String) { 22 | self.fontName = fontName 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/Core/Identifier.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Identifier.swift 3 | // R.swift Library 4 | // 5 | // Created by Mathijs Kadijk on 06-12-15. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | 12 | /// Base protocol for all identifiers 13 | public protocol IdentifierType: CustomStringConvertible { 14 | /// Identifier string 15 | var identifier: String { get } 16 | } 17 | 18 | extension IdentifierType { 19 | /// CustomStringConvertible implementation, returns the identifier 20 | public var description: String { 21 | return identifier 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/Core/ImageResource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageResource.swift 3 | // R.swift.Library 4 | // 5 | // Created by Mathijs Kadijk on 11-01-16. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | 12 | public protocol ImageResourceType { 13 | 14 | /// Bundle this image is in 15 | var bundle: Bundle { get } 16 | 17 | /// Name of the image 18 | var name: String { get } 19 | } 20 | 21 | public struct ImageResource: ImageResourceType { 22 | 23 | /// Bundle this image is in 24 | public let bundle: Bundle 25 | 26 | /// Name of the image 27 | public let name: String 28 | 29 | public init(bundle: Bundle, name: String) { 30 | self.bundle = bundle 31 | self.name = name 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/Core/NibResource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NibResource.swift 3 | // R.swift Library 4 | // 5 | // Created by Mathijs Kadijk on 06-12-15. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | 12 | /// Represents a nib file on disk 13 | public protocol NibResourceType { 14 | 15 | /// Bundle this nib is in or nil for main bundle 16 | var bundle: Bundle { get } 17 | 18 | /// Name of the nib file on disk 19 | var name: String { get } 20 | } 21 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/Core/ReuseIdentifierProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ReuseIdentifierProtocol.swift 3 | // R.swift Library 4 | // 5 | // Created by Mathijs Kadijk on 06-12-15. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | 12 | /// Reuse identifier protocol 13 | public protocol ReuseIdentifierType: IdentifierType { 14 | /// Type of this reuseable 15 | associatedtype ReusableType 16 | } 17 | 18 | /// Reuse identifier 19 | public struct ReuseIdentifier: ReuseIdentifierType { 20 | /// Type of this reuseable 21 | public typealias ReusableType = Reusable 22 | 23 | /// String identifier of this reusable 24 | public let identifier: String 25 | 26 | /** 27 | Create a new ReuseIdentifier based on the string identifier 28 | 29 | - parameter identifier: The string identifier for this reusable 30 | 31 | - returns: A new ReuseIdentifier 32 | */ 33 | public init(identifier: String) { 34 | self.identifier = identifier 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/Core/StoryboardResource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StoryboardResource.swift 3 | // R.swift.Library 4 | // 5 | // Created by Mathijs Kadijk on 07-01-16. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | 12 | public protocol StoryboardResourceType { 13 | 14 | /// Bundle this storyboard is in 15 | var bundle: Bundle { get } 16 | 17 | /// Name of the storyboard file on disk 18 | var name: String { get } 19 | } 20 | 21 | public protocol StoryboardResourceWithInitialControllerType: StoryboardResourceType { 22 | 23 | /// Type of the inital controller 24 | associatedtype InitialController 25 | } 26 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/Core/StoryboardViewControllerResource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StoryboardViewControllerResource.swift 3 | // R.swift.Library 4 | // 5 | // Created by Mathijs Kadijk on 13-03-16. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | 12 | public protocol StoryboardViewControllerResourceType: IdentifierType { 13 | associatedtype ViewControllerType 14 | } 15 | 16 | public struct StoryboardViewControllerResource: StoryboardViewControllerResourceType { 17 | public typealias ViewControllerType = ViewController 18 | 19 | /// Storyboard identifier of this view controller 20 | public let identifier: String 21 | 22 | public init(identifier: String) { 23 | self.identifier = identifier 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/Core/StringResource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StringResource.swift 3 | // R.swift.Library 4 | // 5 | // Created by Tom Lokhorst on 2016-04-23. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | 12 | public protocol StringResourceType { 13 | 14 | /// Key for the string 15 | var key: String { get } 16 | 17 | /// File in containing the string 18 | var tableName: String { get } 19 | 20 | /// Bundle this string is in 21 | var bundle: Bundle { get } 22 | 23 | /// Locales of the a localizable string 24 | var locales: [String] { get } 25 | 26 | /// Comment directly before and/or after the string, if any 27 | var comment: String? { get } 28 | } 29 | 30 | public struct StringResource: StringResourceType { 31 | 32 | /// Key for the string 33 | public let key: String 34 | 35 | /// File in containing the string 36 | public let tableName: String 37 | 38 | /// Bundle this string is in 39 | public let bundle: Bundle 40 | 41 | /// Locales of the a localizable string 42 | public let locales: [String] 43 | 44 | /// Comment directly before and/or after the string, if any 45 | public let comment: String? 46 | 47 | public init(key: String, tableName: String, bundle: Bundle, locales: [String], comment: String?) { 48 | self.key = key 49 | self.tableName = tableName 50 | self.bundle = bundle 51 | self.locales = locales 52 | self.comment = comment 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/Core/Validatable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Validatable.swift 3 | // R.swift.Library 4 | // 5 | // Created by Mathijs Kadijk on 17-12-15. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | 12 | /// Error thrown during validation 13 | public struct ValidationError: Error, CustomStringConvertible { 14 | /// Human readable description 15 | public let description: String 16 | 17 | public init(description: String) { 18 | self.description = description 19 | } 20 | } 21 | 22 | public protocol Validatable { 23 | /** 24 | Validates this entity and throws if it encounters a invalid situation, a validatable should also validate it sub-validatables if it has any. 25 | 26 | - throws: If there the configuration error a ValidationError is thrown 27 | */ 28 | static func validate() throws 29 | } 30 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/Foundation/Bundle+FileResource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Bundle+FileResource.swift 3 | // R.swift.Library 4 | // 5 | // Created by Mathijs Kadijk on 10-01-16. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | 12 | public extension Bundle { 13 | /** 14 | Returns the file URL for the given resource (R.file.*). 15 | 16 | - parameter resource: The resource to get the file URL for (R.file.*). 17 | 18 | - returns: The file URL for the resource file (R.file.*) or nil if the file could not be located. 19 | */ 20 | public func url(forResource resource: FileResourceType) -> URL? { 21 | return url(forResource: resource.name, withExtension: resource.pathExtension) 22 | } 23 | 24 | /** 25 | Returns the full pathname for the resource (R.file.*). 26 | 27 | - parameter resource: The resource file to get the path for (R.file.*). 28 | 29 | - returns: The full pathname for the resource file (R.file.*) or nil if the file could not be located. 30 | */ 31 | public func path(forResource resource: FileResourceType) -> String? { 32 | return path(forResource: resource.name, ofType: resource.pathExtension) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/Foundation/Data+FileResource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Data+FileResource.swift 3 | // R.swift.Library 4 | // 5 | // Created by Tom Lokhorst on 2016-03-11. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | 12 | public struct NoUrlForResourceError: Error {} 13 | 14 | public extension Data { 15 | 16 | /** 17 | Creates and returns NSData with the contents of the specified file resource (R.file.*). 18 | 19 | - parameter resource: The file resource (R.file.*) 20 | 21 | - returns: A NSData object with the contents of the specified file. 22 | */ 23 | public init(resource: FileResourceType) throws { 24 | guard let url = resource.url() else { throw NoUrlForResourceError() } 25 | try self.init(contentsOf: url) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/UIKit/ColorPaletteItemResource+UIKit.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ColorPaletteItemResource+UIKit.swift 3 | // R.swift.Library 4 | // 5 | // Created by Tom Lokhorst on 2016-04-23. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import UIKit 11 | 12 | public extension ColorPaletteItemResourceType { 13 | /** 14 | Returns the a UIColor 15 | 16 | - returns: A UIColor for this color palette item resource 17 | */ 18 | func color() -> UIColor { 19 | return UIColor(red: red, green: green, blue: blue, alpha: alpha) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/UIKit/NibResource+UIKit.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NibResource+UIKit.swift 3 | // R.swift.Library 4 | // 5 | // Created by Mathijs Kadijk on 06-01-16. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | import UIKit 12 | 13 | public extension NibResourceType { 14 | /** 15 | Instantiate the nib to get the top-level objects from this nib 16 | 17 | - parameter ownerOrNil: The owner, if the owner parameter is nil, connections to File's Owner are not permitted. 18 | - parameter options: Options are identical to the options specified with -[NSBundle loadNibNamed:owner:options:] 19 | 20 | - returns: An array containing the top-level objects from the NIB 21 | */ 22 | public func instantiate(withOwner ownerOrNil: Any?, options optionsOrNil: [AnyHashable : Any]? = [:]) -> [Any] { 23 | return UINib(resource: self).instantiate(withOwner: ownerOrNil, options: optionsOrNil) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/UIKit/StoryboardResourceWithInitialController+UIKit.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StoryboardResourceWithInitialController+UIKit.swift 3 | // R.swift.Library 4 | // 5 | // Created by Mathijs Kadijk on 07-01-16. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | import UIKit 12 | 13 | public extension StoryboardResourceWithInitialControllerType { 14 | /** 15 | Instantiates and returns the initial view controller in the view controller graph. 16 | 17 | - returns: The initial view controller in the storyboard. 18 | */ 19 | public func instantiateInitialViewController() -> InitialController? { 20 | return UIStoryboard(resource: self).instantiateInitialViewController() as? InitialController 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/UIKit/TypedStoryboardSegueInfo+UIStoryboardSegue.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TypedStoryboardSegueInfo+UIStoryboardSegue.swift 3 | // R.swift Library 4 | // 5 | // Created by Mathijs Kadijk on 06-12-15. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | import UIKit 12 | 13 | extension TypedStoryboardSegueInfo { 14 | /** 15 | Returns typed information about the given segue, fails if the segue types don't exactly match types. 16 | 17 | - returns: A newly initialized TypedStoryboardSegueInfo object or nil. 18 | */ 19 | public init?(segueIdentifier: SegueIdentifier, segue: UIStoryboardSegue) 20 | where SegueIdentifier.SegueType == Segue, SegueIdentifier.SourceType == Source, SegueIdentifier.DestinationType == Destination 21 | { 22 | guard let identifier = segue.identifier, 23 | let source = segue.source as? SegueIdentifier.SourceType, 24 | let destination = segue.destination as? SegueIdentifier.DestinationType, 25 | let segue = segue as? SegueIdentifier.SegueType, identifier == segueIdentifier.identifier 26 | else { 27 | return nil 28 | } 29 | 30 | self.segue = segue 31 | self.identifier = identifier 32 | self.source = source 33 | self.destination = destination 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/UIKit/UIColor+ColorResource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+ColorResource.swift 3 | // R.swift.Library 4 | // 5 | // Created by Tom Lokhorst on 2017-06-06. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import UIKit 11 | 12 | @available(iOS 11.0, *) 13 | @available(tvOS 11.0, *) 14 | public extension UIColor { 15 | /** 16 | Returns the color from this resource (R.color.*) that is compatible with the trait collection. 17 | 18 | - parameter resource: The resource you want the image of (R.color.*) 19 | - parameter traitCollection: Traits that describe the desired color to retrieve, pass nil to use traits that describe the main screen. 20 | 21 | - returns: A color that exactly or best matches the desired traits with the given resource (R.color.*), or nil if no suitable color was found. 22 | */ 23 | public convenience init?(resource: ColorResourceType, compatibleWith traitCollection: UITraitCollection? = nil) { 24 | self.init(named: resource.name, in: resource.bundle, compatibleWith: traitCollection) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/UIKit/UIFont+FontResource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIFont+FontResource.swift 3 | // R.swift.Library 4 | // 5 | // Created by Mathijs Kadijk on 06-01-16. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | import UIKit 12 | 13 | public extension UIFont { 14 | /** 15 | Creates and returns a font object for the specified font resource (R.font.*) and size. 16 | 17 | - parameter resource: The font resource (R.font.*) for the specific font to load 18 | - parameter size: The size (in points) to which the font is scaled. This value must be greater than 0.0. 19 | 20 | - returns: A font object of the specified font resource and size. 21 | */ 22 | public convenience init?(resource: FontResourceType, size: CGFloat) { 23 | self.init(name: resource.fontName, size: size) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/UIKit/UIImage+ImageResource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+ImageResource.swift 3 | // R.swift.Library 4 | // 5 | // Created by Mathijs Kadijk on 11-01-16. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import UIKit 11 | 12 | public extension UIImage { 13 | /** 14 | Returns the image from this resource (R.image.*) that is compatible with the trait collection. 15 | 16 | - parameter resource: The resource you want the image of (R.image.*) 17 | - parameter traitCollection: Traits that describe the desired image to retrieve, pass nil to use traits that describe the main screen. 18 | 19 | - returns: An image that exactly or best matches the desired traits with the given resource (R.image.*), or nil if no suitable image was found. 20 | */ 21 | public convenience init?(resource: ImageResourceType, compatibleWith traitCollection: UITraitCollection? = nil) { 22 | self.init(named: resource.name, in: resource.bundle, compatibleWith: traitCollection) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/UIKit/UINib+NibResource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UINib+NibResource.swift 3 | // R.swift.Library 4 | // 5 | // Created by Mathijs Kadijk on 08-01-16. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import UIKit 11 | 12 | public extension UINib { 13 | /** 14 | Returns a UINib object initialized to the nib file of the specified resource (R.nib.*). 15 | 16 | - parameter resource: The resource (R.nib.*) to load 17 | 18 | - returns: The initialized UINib object. An exception is thrown if there were errors during initialization or the nib file could not be located. 19 | */ 20 | public convenience init(resource: NibResourceType) { 21 | self.init(nibName: resource.name, bundle: resource.bundle) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/UIKit/UIStoryboard+StoryboardResource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIStoryboard+StoryboardResource.swift 3 | // R.swift.Library 4 | // 5 | // Created by Mathijs Kadijk on 07-01-16. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import UIKit 11 | 12 | public extension UIStoryboard { 13 | /** 14 | Creates and returns a storyboard object for the specified storyboard resource (R.storyboard.*) file. 15 | 16 | - parameter resource: The storyboard resource (R.storyboard.*) for the specific storyboard to load 17 | 18 | - returns: A storyboard object for the specified file. If no storyboard resource file matching name exists, an exception is thrown with description: `Could not find a storyboard named 'XXXXXX' in bundle....` 19 | */ 20 | public convenience init(resource: StoryboardResourceType) { 21 | self.init(name: resource.name, bundle: resource.bundle) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/UIKit/UIStoryboard+StoryboardViewControllerResource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+StoryboardViewControllerResource.swift 3 | // R.swift.Library 4 | // 5 | // Created by Mathijs Kadijk on 13-03-16. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | import UIKit 12 | 13 | public extension UIStoryboard { 14 | /** 15 | Instantiates and returns the view controller with the specified resource (R.storyboard.*.*). 16 | 17 | - parameter resource: An resource (R.storyboard.*.*) that uniquely identifies the view controller in the storyboard file. If the specified resource does not exist in the storyboard file, this method raises an exception. 18 | 19 | - returns: The view controller corresponding to the specified resource (R.storyboard.*.*). If no view controller is associated, this method throws an exception. 20 | */ 21 | public func instantiateViewController(withResource resource: ViewControllerResource) -> ViewControllerResource.ViewControllerType? { 22 | return self.instantiateViewController(withIdentifier: resource.identifier) as? ViewControllerResource.ViewControllerType 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/UIKit/UIViewController+NibResource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+NibResource.swift 3 | // R.swift Library 4 | // 5 | // Created by Mathijs Kadijk on 06-12-15. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | import UIKit 12 | 13 | public extension UIViewController { 14 | /** 15 | Returns a newly initialized view controller with the nib resource (R.nib.*). 16 | 17 | - parameter nib: The nib resource (R.nib.*) to associate with the view controller. 18 | 19 | - returns: A newly initialized UIViewController object. 20 | */ 21 | public convenience init(nib: NibResourceType) { 22 | self.init(nibName: nib.name, bundle: nib.bundle) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Library/UIKit/UIViewController+StoryboardSegueIdentifierProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+StoryboardSegueIdentifierProtocol.swift 3 | // R.swift Library 4 | // 5 | // Created by Mathijs Kadijk on 06-12-15. 6 | // From: https://github.com/mac-cain13/R.swift.Library 7 | // License: MIT License 8 | // 9 | 10 | import Foundation 11 | import UIKit 12 | 13 | public protocol SeguePerformerType { 14 | func performSegue(withIdentifier identifier: String, sender: Any?) 15 | } 16 | 17 | extension UIViewController: SeguePerformerType {} 18 | 19 | public extension SeguePerformerType { 20 | /** 21 | Initiates the segue with the specified identifier (R.segue.*) from the current view controller's storyboard file. 22 | - parameter identifier: The R.segue.* that identifies the triggered segue. 23 | - parameter sender: The object that you want to use to initiate the segue. This object is made available for informational purposes during the actual segue. 24 | - SeeAlso: Library for typed block based segues: [tomlokhorst/SegueManager](https://github.com/tomlokhorst/SegueManager) 25 | */ 26 | public func performSegue(withIdentifier identifier: StoryboardSegueIdentifier, sender: Any?) { 27 | performSegue(withIdentifier: identifier.identifier, sender: sender) 28 | } 29 | } 30 | 31 | public extension StoryboardSegue where Source : UIViewController { 32 | /** 33 | Performs this segue on the source view controller 34 | - parameter sender: The object that you want to use to initiate the segue. This object is made available for informational purposes during the actual segue. 35 | */ 36 | public func performSegue(sender: Any? = nil) { 37 | source.performSegue(withIdentifier: identifier.identifier, sender: sender) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/License: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Mathijs Kadijk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift.Library/Readme.md: -------------------------------------------------------------------------------- 1 | # R.swift.Library [![Version](https://img.shields.io/cocoapods/v/R.swift.Library.svg?style=flat)](http://cocoapods.org/?q=R.swift.Library) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![License](https://img.shields.io/cocoapods/l/R.swift.Library.svg?style=flat)](blob/master/License) ![Platform](https://img.shields.io/cocoapods/p/R.swift.Library.svg?style=flat) 2 | 3 | _Library containing types supporting code generated by [R.swift](https://github.com/mac-cain13/R.swift)_ 4 | 5 | ## Why use this? 6 | 7 | Regular users probably want to include this library to use [R.swift](https://github.com/mac-cain13/R.swift). Developers of other libraries can use this library to extend upon the types and code R.swift generates and uses. 8 | 9 | ## Installation 10 | 11 | ### CocoaPods (recommended) 12 | 13 | _**Be aware:** If you just want to use R.swift follow the [installation instructions for R.swift](https://github.com/mac-cain13/R.swift#Installation)._ 14 | 15 | 1. Add `pod 'R.swift.Library'` to your [Podfile](http://cocoapods.org/#get_started) 16 | 2. Run `pod install` 17 | 18 | ### Carthage 19 | 20 | 1. Add `github "mac-cain13/R.swift.Library"` to your [Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile) 21 | 2. Run `carthage` 22 | 23 | ### Manually 24 | 25 | _As an embedded framework using git submodules._ 26 | 27 | 0. If your project is not yet a git repository, run `git init` 28 | 1. Add R.swift.Library as a submodule by running: `git submodule add https://github.com/mac-cain13/R.swift.Library.git` 29 | 3. Open the new `R.swift.Library` folder, and drag the `R.swift.Library.xcodeproj` into the Project Navigator of your application's Xcode project. 30 | 4. Select the `R.swift.Library.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target. 31 | 5. Select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar. 32 | 6. In the tab bar at the top of that window, open the "General" panel. 33 | 7. Click on the `+` button under the "Embedded Binaries" section. 34 | 8. Choose the `Rswift.framework` 35 | 36 | > The `Rswift.framework` is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device. 37 | 38 | ## License 39 | 40 | [R.swift](https://github.com/mac-cain13/R.swift) and [R.swift.Library](https://github.com/mac-cain13/R.swift.Library) are created by [Mathijs Kadijk](https://github.com/mac-cain13) and released under a [MIT License](License). 41 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift/License: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2017 Mathijs Kadijk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/R.swift/rswift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/IMKLineDemo/Pods/R.swift/rswift -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintConfig.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | public typealias ConstraintInterfaceLayoutDirection = UIUserInterfaceLayoutDirection 27 | #else 28 | import AppKit 29 | public typealias ConstraintInterfaceLayoutDirection = NSUserInterfaceLayoutDirection 30 | #endif 31 | 32 | 33 | public struct ConstraintConfig { 34 | 35 | public static var interfaceLayoutDirection: ConstraintInterfaceLayoutDirection = .leftToRight 36 | 37 | } 38 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintDescription.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public class ConstraintDescription { 32 | 33 | internal let item: LayoutConstraintItem 34 | internal var attributes: ConstraintAttributes 35 | internal var relation: ConstraintRelation? = nil 36 | internal var sourceLocation: (String, UInt)? = nil 37 | internal var label: String? = nil 38 | internal var related: ConstraintItem? = nil 39 | internal var multiplier: ConstraintMultiplierTarget = 1.0 40 | internal var constant: ConstraintConstantTarget = 0.0 41 | internal var priority: ConstraintPriorityTarget = 1000.0 42 | internal lazy var constraint: Constraint? = { 43 | guard let relation = self.relation, 44 | let related = self.related, 45 | let sourceLocation = self.sourceLocation else { 46 | return nil 47 | } 48 | let from = ConstraintItem(target: self.item, attributes: self.attributes) 49 | 50 | return Constraint( 51 | from: from, 52 | to: related, 53 | relation: relation, 54 | sourceLocation: sourceLocation, 55 | label: self.label, 56 | multiplier: self.multiplier, 57 | constant: self.constant, 58 | priority: self.priority 59 | ) 60 | }() 61 | 62 | // MARK: Initialization 63 | 64 | internal init(item: LayoutConstraintItem, attributes: ConstraintAttributes) { 65 | self.item = item 66 | self.attributes = attributes 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintInsetTarget.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public protocol ConstraintInsetTarget: ConstraintConstantTarget { 32 | } 33 | 34 | extension Int: ConstraintInsetTarget { 35 | } 36 | 37 | extension UInt: ConstraintInsetTarget { 38 | } 39 | 40 | extension Float: ConstraintInsetTarget { 41 | } 42 | 43 | extension Double: ConstraintInsetTarget { 44 | } 45 | 46 | extension CGFloat: ConstraintInsetTarget { 47 | } 48 | 49 | extension ConstraintInsets: ConstraintInsetTarget { 50 | } 51 | 52 | extension ConstraintInsetTarget { 53 | 54 | internal var constraintInsetTargetValue: ConstraintInsets { 55 | if let amount = self as? ConstraintInsets { 56 | return amount 57 | } else if let amount = self as? Float { 58 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount)) 59 | } else if let amount = self as? Double { 60 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount)) 61 | } else if let amount = self as? CGFloat { 62 | return ConstraintInsets(top: amount, left: amount, bottom: amount, right: amount) 63 | } else if let amount = self as? Int { 64 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount)) 65 | } else if let amount = self as? UInt { 66 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount)) 67 | } else { 68 | return ConstraintInsets(top: 0, left: 0, bottom: 0, right: 0) 69 | } 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintInsets.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | #if os(iOS) || os(tvOS) 32 | public typealias ConstraintInsets = UIEdgeInsets 33 | #else 34 | public typealias ConstraintInsets = NSEdgeInsets 35 | #endif 36 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public final class ConstraintItem { 32 | 33 | internal weak var target: AnyObject? 34 | internal let attributes: ConstraintAttributes 35 | 36 | internal init(target: AnyObject?, attributes: ConstraintAttributes) { 37 | self.target = target 38 | self.attributes = attributes 39 | } 40 | 41 | internal var layoutConstraintItem: LayoutConstraintItem? { 42 | return self.target as? LayoutConstraintItem 43 | } 44 | 45 | } 46 | 47 | public func ==(lhs: ConstraintItem, rhs: ConstraintItem) -> Bool { 48 | // pointer equality 49 | guard lhs !== rhs else { 50 | return true 51 | } 52 | 53 | // must both have valid targets and identical attributes 54 | guard let target1 = lhs.target, 55 | let target2 = rhs.target, 56 | target1 === target2 && lhs.attributes == rhs.attributes else { 57 | return false 58 | } 59 | 60 | return true 61 | } 62 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #endif 27 | 28 | 29 | @available(iOS 9.0, OSX 10.11, *) 30 | public extension ConstraintLayoutGuide { 31 | 32 | public var snp: ConstraintLayoutGuideDSL { 33 | return ConstraintLayoutGuideDSL(guide: self) 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintLayoutGuide.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | #if os(iOS) || os(tvOS) 32 | @available(iOS 9.0, *) 33 | public typealias ConstraintLayoutGuide = UILayoutGuide 34 | #else 35 | @available(OSX 10.11, *) 36 | public typealias ConstraintLayoutGuide = NSLayoutGuide 37 | #endif 38 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | @available(iOS 9.0, OSX 10.11, *) 32 | public struct ConstraintLayoutGuideDSL: ConstraintAttributesDSL { 33 | 34 | @discardableResult 35 | public func prepareConstraints(_ closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] { 36 | return ConstraintMaker.prepareConstraints(item: self.guide, closure: closure) 37 | } 38 | 39 | public func makeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { 40 | ConstraintMaker.makeConstraints(item: self.guide, closure: closure) 41 | } 42 | 43 | public func remakeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { 44 | ConstraintMaker.remakeConstraints(item: self.guide, closure: closure) 45 | } 46 | 47 | public func updateConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { 48 | ConstraintMaker.updateConstraints(item: self.guide, closure: closure) 49 | } 50 | 51 | public func removeConstraints() { 52 | ConstraintMaker.removeConstraints(item: self.guide) 53 | } 54 | 55 | public var target: AnyObject? { 56 | return self.guide 57 | } 58 | 59 | internal let guide: ConstraintLayoutGuide 60 | 61 | internal init(guide: ConstraintLayoutGuide) { 62 | self.guide = guide 63 | 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintLayoutSupport.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | #if os(iOS) || os(tvOS) 32 | @available(iOS 8.0, *) 33 | public typealias ConstraintLayoutSupport = UILayoutSupport 34 | #else 35 | public class ConstraintLayoutSupport {} 36 | #endif 37 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | @available(iOS 8.0, *) 32 | public struct ConstraintLayoutSupportDSL: ConstraintDSL { 33 | 34 | public var target: AnyObject? { 35 | return self.support 36 | } 37 | 38 | internal let support: ConstraintLayoutSupport 39 | 40 | internal init(support: ConstraintLayoutSupport) { 41 | self.support = support 42 | 43 | } 44 | 45 | public var top: ConstraintItem { 46 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.top) 47 | } 48 | 49 | public var bottom: ConstraintItem { 50 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.bottom) 51 | } 52 | 53 | public var height: ConstraintItem { 54 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.height) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintMakerEditable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public class ConstraintMakerEditable: ConstraintMakerPriortizable { 32 | 33 | @discardableResult 34 | public func multipliedBy(_ amount: ConstraintMultiplierTarget) -> ConstraintMakerEditable { 35 | self.description.multiplier = amount 36 | return self 37 | } 38 | 39 | @discardableResult 40 | public func dividedBy(_ amount: ConstraintMultiplierTarget) -> ConstraintMakerEditable { 41 | return self.multipliedBy(1.0 / amount.constraintMultiplierTargetValue) 42 | } 43 | 44 | @discardableResult 45 | public func offset(_ amount: ConstraintOffsetTarget) -> ConstraintMakerEditable { 46 | self.description.constant = amount.constraintOffsetTargetValue 47 | return self 48 | } 49 | 50 | @discardableResult 51 | public func inset(_ amount: ConstraintInsetTarget) -> ConstraintMakerEditable { 52 | self.description.constant = amount.constraintInsetTargetValue 53 | return self 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public class ConstraintMakerFinalizable { 32 | 33 | internal let description: ConstraintDescription 34 | 35 | internal init(_ description: ConstraintDescription) { 36 | self.description = description 37 | } 38 | 39 | @discardableResult 40 | public func labeled(_ label: String) -> ConstraintMakerFinalizable { 41 | self.description.label = label 42 | return self 43 | } 44 | 45 | public var constraint: Constraint { 46 | return self.description.constraint! 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public class ConstraintMakerPriortizable: ConstraintMakerFinalizable { 32 | 33 | @discardableResult 34 | public func priority(_ amount: ConstraintPriority) -> ConstraintMakerFinalizable { 35 | self.description.priority = amount.value 36 | return self 37 | } 38 | 39 | @discardableResult 40 | public func priority(_ amount: ConstraintPriorityTarget) -> ConstraintMakerFinalizable { 41 | self.description.priority = amount 42 | return self 43 | } 44 | 45 | @available(*, deprecated:3.0, message:"Use priority(.required) instead.") 46 | @discardableResult 47 | public func priorityRequired() -> ConstraintMakerFinalizable { 48 | return self.priority(.required) 49 | } 50 | 51 | @available(*, deprecated:3.0, message:"Use priority(.high) instead.") 52 | @discardableResult 53 | public func priorityHigh() -> ConstraintMakerFinalizable { 54 | return self.priority(.high) 55 | } 56 | 57 | @available(*, deprecated:3.0, message:"Use priority(.medium) instead.") 58 | @discardableResult 59 | public func priorityMedium() -> ConstraintMakerFinalizable { 60 | return self.priority(.medium) 61 | } 62 | 63 | @available(*, deprecated:3.0, message:"Use priority(.low) instead.") 64 | @discardableResult 65 | public func priorityLow() -> ConstraintMakerFinalizable { 66 | return self.priority(.low) 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public protocol ConstraintMultiplierTarget { 32 | 33 | var constraintMultiplierTargetValue: CGFloat { get } 34 | 35 | } 36 | 37 | extension Int: ConstraintMultiplierTarget { 38 | 39 | public var constraintMultiplierTargetValue: CGFloat { 40 | return CGFloat(self) 41 | } 42 | 43 | } 44 | 45 | extension UInt: ConstraintMultiplierTarget { 46 | 47 | public var constraintMultiplierTargetValue: CGFloat { 48 | return CGFloat(self) 49 | } 50 | 51 | } 52 | 53 | extension Float: ConstraintMultiplierTarget { 54 | 55 | public var constraintMultiplierTargetValue: CGFloat { 56 | return CGFloat(self) 57 | } 58 | 59 | } 60 | 61 | extension Double: ConstraintMultiplierTarget { 62 | 63 | public var constraintMultiplierTargetValue: CGFloat { 64 | return CGFloat(self) 65 | } 66 | 67 | } 68 | 69 | extension CGFloat: ConstraintMultiplierTarget { 70 | 71 | public var constraintMultiplierTargetValue: CGFloat { 72 | return self 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintOffsetTarget.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public protocol ConstraintOffsetTarget: ConstraintConstantTarget { 32 | } 33 | 34 | extension Int: ConstraintOffsetTarget { 35 | } 36 | 37 | extension UInt: ConstraintOffsetTarget { 38 | } 39 | 40 | extension Float: ConstraintOffsetTarget { 41 | } 42 | 43 | extension Double: ConstraintOffsetTarget { 44 | } 45 | 46 | extension CGFloat: ConstraintOffsetTarget { 47 | } 48 | 49 | extension ConstraintOffsetTarget { 50 | 51 | internal var constraintOffsetTargetValue: CGFloat { 52 | let offset: CGFloat 53 | if let amount = self as? Float { 54 | offset = CGFloat(amount) 55 | } else if let amount = self as? Double { 56 | offset = CGFloat(amount) 57 | } else if let amount = self as? CGFloat { 58 | offset = CGFloat(amount) 59 | } else if let amount = self as? Int { 60 | offset = CGFloat(amount) 61 | } else if let amount = self as? UInt { 62 | offset = CGFloat(amount) 63 | } else { 64 | offset = 0.0 65 | } 66 | return offset 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintPriority.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | public struct ConstraintPriority : ExpressibleByFloatLiteral, Equatable, Strideable { 31 | public typealias FloatLiteralType = Float 32 | 33 | public let value: Float 34 | 35 | public init(floatLiteral value: Float) { 36 | self.value = value 37 | } 38 | 39 | public init(_ value: Float) { 40 | self.value = value 41 | } 42 | 43 | public static var required: ConstraintPriority { 44 | return 1000.0 45 | } 46 | 47 | public static var high: ConstraintPriority { 48 | return 750.0 49 | } 50 | 51 | public static var medium: ConstraintPriority { 52 | #if os(OSX) 53 | return 501.0 54 | #else 55 | return 500.0 56 | #endif 57 | 58 | } 59 | 60 | public static var low: ConstraintPriority { 61 | return 250.0 62 | } 63 | 64 | public static func ==(lhs: ConstraintPriority, rhs: ConstraintPriority) -> Bool { 65 | return lhs.value == rhs.value 66 | } 67 | 68 | // MARK: Strideable 69 | 70 | public func advanced(by n: FloatLiteralType) -> ConstraintPriority { 71 | return ConstraintPriority(floatLiteral: value + n) 72 | } 73 | 74 | public func distance(to other: ConstraintPriority) -> FloatLiteralType { 75 | return other.value - value 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintPriorityTarget.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public protocol ConstraintPriorityTarget { 32 | 33 | var constraintPriorityTargetValue: Float { get } 34 | 35 | } 36 | 37 | extension Int: ConstraintPriorityTarget { 38 | 39 | public var constraintPriorityTargetValue: Float { 40 | return Float(self) 41 | } 42 | 43 | } 44 | 45 | extension UInt: ConstraintPriorityTarget { 46 | 47 | public var constraintPriorityTargetValue: Float { 48 | return Float(self) 49 | } 50 | 51 | } 52 | 53 | extension Float: ConstraintPriorityTarget { 54 | 55 | public var constraintPriorityTargetValue: Float { 56 | return self 57 | } 58 | 59 | } 60 | 61 | extension Double: ConstraintPriorityTarget { 62 | 63 | public var constraintPriorityTargetValue: Float { 64 | return Float(self) 65 | } 66 | 67 | } 68 | 69 | extension CGFloat: ConstraintPriorityTarget { 70 | 71 | public var constraintPriorityTargetValue: Float { 72 | return Float(self) 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintRelatableTarget.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public protocol ConstraintRelatableTarget { 32 | } 33 | 34 | extension Int: ConstraintRelatableTarget { 35 | } 36 | 37 | extension UInt: ConstraintRelatableTarget { 38 | } 39 | 40 | extension Float: ConstraintRelatableTarget { 41 | } 42 | 43 | extension Double: ConstraintRelatableTarget { 44 | } 45 | 46 | extension CGFloat: ConstraintRelatableTarget { 47 | } 48 | 49 | extension CGSize: ConstraintRelatableTarget { 50 | } 51 | 52 | extension CGPoint: ConstraintRelatableTarget { 53 | } 54 | 55 | extension ConstraintInsets: ConstraintRelatableTarget { 56 | } 57 | 58 | extension ConstraintItem: ConstraintRelatableTarget { 59 | } 60 | 61 | extension ConstraintView: ConstraintRelatableTarget { 62 | } 63 | 64 | @available(iOS 9.0, OSX 10.11, *) 65 | extension ConstraintLayoutGuide: ConstraintRelatableTarget { 66 | } 67 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintRelation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | internal enum ConstraintRelation : Int { 32 | case equal = 1 33 | case lessThanOrEqual 34 | case greaterThanOrEqual 35 | 36 | internal var layoutRelation: LayoutRelation { 37 | get { 38 | switch(self) { 39 | case .equal: 40 | return .equal 41 | case .lessThanOrEqual: 42 | return .lessThanOrEqual 43 | case .greaterThanOrEqual: 44 | return .greaterThanOrEqual 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/ConstraintView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | #if os(iOS) || os(tvOS) 32 | public typealias ConstraintView = UIView 33 | #else 34 | public typealias ConstraintView = NSView 35 | #endif 36 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/LayoutConstraint.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | 31 | public class LayoutConstraint : NSLayoutConstraint { 32 | 33 | public var label: String? { 34 | get { 35 | return self.identifier 36 | } 37 | set { 38 | self.identifier = newValue 39 | } 40 | } 41 | 42 | internal weak var constraint: Constraint? = nil 43 | 44 | } 45 | 46 | internal func ==(lhs: LayoutConstraint, rhs: LayoutConstraint) -> Bool { 47 | guard lhs.firstItem === rhs.firstItem && 48 | lhs.secondItem === rhs.secondItem && 49 | lhs.firstAttribute == rhs.firstAttribute && 50 | lhs.secondAttribute == rhs.secondAttribute && 51 | lhs.relation == rhs.relation && 52 | lhs.priority == rhs.priority && 53 | lhs.multiplier == rhs.multiplier else { 54 | return false 55 | } 56 | return true 57 | } 58 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/Typealiases.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | import Foundation 25 | 26 | #if os(iOS) || os(tvOS) 27 | import UIKit 28 | typealias LayoutRelation = NSLayoutRelation 29 | typealias LayoutAttribute = NSLayoutAttribute 30 | typealias LayoutPriority = UILayoutPriority 31 | #else 32 | import AppKit 33 | typealias LayoutRelation = NSLayoutConstraint.Relation 34 | typealias LayoutAttribute = NSLayoutConstraint.Attribute 35 | typealias LayoutPriority = NSLayoutConstraint.Priority 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #endif 27 | 28 | 29 | @available(iOS 8.0, *) 30 | public extension ConstraintLayoutSupport { 31 | 32 | public var snp: ConstraintLayoutSupportDSL { 33 | return ConstraintLayoutSupportDSL(support: self) 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SwiftyBeaver/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Sebastian Kreutzberger 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SwiftyBeaver/Sources/ConsoleDestination.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ConsoleDestination.swift 3 | // SwiftyBeaver 4 | // 5 | // Created by Sebastian Kreutzberger on 05.12.15. 6 | // Copyright © 2015 Sebastian Kreutzberger 7 | // Some rights reserved: http://opensource.org/licenses/MIT 8 | // 9 | 10 | import Foundation 11 | 12 | public class ConsoleDestination: BaseDestination { 13 | 14 | /// use NSLog instead of print, default is false 15 | public var useNSLog = false 16 | /// uses colors compatible to Terminal instead of Xcode, default is false 17 | public var useTerminalColors: Bool = false { 18 | didSet { 19 | if useTerminalColors { 20 | // use Terminal colors 21 | reset = "\u{001b}[0m" 22 | escape = "\u{001b}[38;5;" 23 | levelColor.verbose = "251m" // silver 24 | levelColor.debug = "35m" // green 25 | levelColor.info = "38m" // blue 26 | levelColor.warning = "178m" // yellow 27 | levelColor.error = "197m" // red 28 | 29 | } else { 30 | // use colored Emojis for better visual distinction 31 | // of log level for Xcode 8 32 | levelColor.verbose = "💜 " // silver 33 | levelColor.debug = "💚 " // green 34 | levelColor.info = "💙 " // blue 35 | levelColor.warning = "💛 " // yellow 36 | levelColor.error = "❤️ " // red 37 | 38 | } 39 | } 40 | } 41 | 42 | override public var defaultHashValue: Int { return 1 } 43 | 44 | public override init() { 45 | super.init() 46 | levelColor.verbose = "💜 " // silver 47 | levelColor.debug = "💚 " // green 48 | levelColor.info = "💙 " // blue 49 | levelColor.warning = "💛 " // yellow 50 | levelColor.error = "❤️ " // red 51 | } 52 | 53 | // print to Xcode Console. uses full base class functionality 54 | override public func send(_ level: SwiftyBeaver.Level, msg: String, thread: String, 55 | file: String, function: String, line: Int, context: Any? = nil) -> String? { 56 | let formattedString = super.send(level, msg: msg, thread: thread, file: file, function: function, line: line, context: context) 57 | 58 | if let str = formattedString { 59 | if useNSLog { 60 | #if os(Linux) 61 | print(str) 62 | #else 63 | NSLog("%@", str) 64 | #endif 65 | } else { 66 | print(str) 67 | } 68 | } 69 | return formattedString 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SwiftyBeaver/Sources/Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Extensions.swift 3 | // SwiftyBeaver 4 | // 5 | // Created by Sebastian Kreutzberger on 13.12.17. 6 | // Copyright © 2017 Sebastian Kreutzberger. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension String { 12 | /// cross-Swift compatible characters count 13 | var length: Int { 14 | #if swift(>=3.2) 15 | return self.count 16 | #else 17 | return self.characters.count 18 | #endif 19 | } 20 | 21 | /// cross-Swift-compatible first character 22 | var firstChar: Character? { 23 | #if swift(>=3.2) 24 | return self.first 25 | #else 26 | return self.characters.first 27 | #endif 28 | } 29 | 30 | /// cross-Swift-compatible last character 31 | var lastChar: Character? { 32 | #if swift(>=3.2) 33 | return self.last 34 | #else 35 | return self.characters.last 36 | #endif 37 | } 38 | 39 | /// cross-Swift-compatible index 40 | func find(_ char: Character) -> Index? { 41 | #if swift(>=3.2) 42 | return self.index(of: char) 43 | #else 44 | return self.characters.index(of: char) 45 | #endif 46 | } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/SwiftyJSON/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Ruoyu Fu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/IMKLine/IMKLine-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_IMKLine : NSObject 3 | @end 4 | @implementation PodsDummy_IMKLine 5 | @end 6 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/IMKLine/IMKLine-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/IMKLine/IMKLine-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double IMKLineVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char IMKLineVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/IMKLine/IMKLine.modulemap: -------------------------------------------------------------------------------- 1 | framework module IMKLine { 2 | umbrella header "IMKLine-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/IMKLine/IMKLine.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/IMKLine 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/R.swift" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" "-suppress-warnings" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/IMKLine 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/IMKLine/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/Pods-IMKLineDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/Pods-IMKLineDemo/Pods-IMKLineDemo-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_IMKLineDemo : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_IMKLineDemo 5 | @end 6 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/Pods-IMKLineDemo/Pods-IMKLineDemo-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_IMKLineDemoVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_IMKLineDemoVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/Pods-IMKLineDemo/Pods-IMKLineDemo.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/IMKLine" "${PODS_CONFIGURATION_BUILD_DIR}/R.swift.Library" "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyBeaver" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyJSON" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/R.swift" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/IMKLine/IMKLine.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/R.swift.Library/Rswift.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit/SnapKit.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyBeaver/SwiftyBeaver.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyJSON/SwiftyJSON.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/R.swift" 7 | OTHER_LDFLAGS = $(inherited) -framework "IMKLine" -framework "Rswift" -framework "SnapKit" -framework "SwiftyBeaver" -framework "SwiftyJSON" 8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 9 | PODS_BUILD_DIR = ${BUILD_DIR} 10 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 12 | PODS_ROOT = ${SRCROOT}/Pods 13 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/Pods-IMKLineDemo/Pods-IMKLineDemo.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_IMKLineDemo { 2 | umbrella header "Pods-IMKLineDemo-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/Pods-IMKLineDemo/Pods-IMKLineDemo.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/IMKLine" "${PODS_CONFIGURATION_BUILD_DIR}/R.swift.Library" "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyBeaver" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyJSON" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/R.swift" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/IMKLine/IMKLine.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/R.swift.Library/Rswift.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit/SnapKit.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyBeaver/SwiftyBeaver.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyJSON/SwiftyJSON.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/R.swift" 7 | OTHER_LDFLAGS = $(inherited) -framework "IMKLine" -framework "Rswift" -framework "SnapKit" -framework "SwiftyBeaver" -framework "SwiftyJSON" 8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 9 | PODS_BUILD_DIR = ${BUILD_DIR} 10 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 12 | PODS_ROOT = ${SRCROOT}/Pods 13 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/R.swift.Library/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 4.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/R.swift.Library/R.swift.Library-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_R_swift_Library : NSObject 3 | @end 4 | @implementation PodsDummy_R_swift_Library 5 | @end 6 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/R.swift.Library/R.swift.Library-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/R.swift.Library/R.swift.Library-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double RswiftVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char RswiftVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/R.swift.Library/R.swift.Library.modulemap: -------------------------------------------------------------------------------- 1 | framework module Rswift { 2 | umbrella header "R.swift.Library-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/R.swift.Library/R.swift.Library.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/R.swift.Library 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/R.swift" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" "-suppress-warnings" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/R.swift.Library 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/SnapKit/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 4.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/SnapKit/SnapKit-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SnapKit : NSObject 3 | @end 4 | @implementation PodsDummy_SnapKit 5 | @end 6 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/SnapKit/SnapKit-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/SnapKit/SnapKit-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double SnapKitVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char SnapKitVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/SnapKit/SnapKit.modulemap: -------------------------------------------------------------------------------- 1 | framework module SnapKit { 2 | umbrella header "SnapKit-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/SnapKit/SnapKit.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SnapKit 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/R.swift" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" "-suppress-warnings" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SnapKit 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/SwiftyBeaver/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.5.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/SwiftyBeaver/SwiftyBeaver-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SwiftyBeaver : NSObject 3 | @end 4 | @implementation PodsDummy_SwiftyBeaver 5 | @end 6 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/SwiftyBeaver/SwiftyBeaver-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/SwiftyBeaver/SwiftyBeaver-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double SwiftyBeaverVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char SwiftyBeaverVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/SwiftyBeaver/SwiftyBeaver.modulemap: -------------------------------------------------------------------------------- 1 | framework module SwiftyBeaver { 2 | umbrella header "SwiftyBeaver-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/SwiftyBeaver/SwiftyBeaver.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SwiftyBeaver 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/R.swift" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" "-suppress-warnings" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SwiftyBeaver 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/SwiftyJSON/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 4.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/SwiftyJSON/SwiftyJSON-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SwiftyJSON : NSObject 3 | @end 4 | @implementation PodsDummy_SwiftyJSON 5 | @end 6 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/SwiftyJSON/SwiftyJSON-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/SwiftyJSON/SwiftyJSON-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double SwiftyJSONVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char SwiftyJSONVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/SwiftyJSON/SwiftyJSON.modulemap: -------------------------------------------------------------------------------- 1 | framework module SwiftyJSON { 2 | umbrella header "SwiftyJSON-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /IMKLineDemo/Pods/Target Support Files/SwiftyJSON/SwiftyJSON.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SwiftyJSON 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/R.swift" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" "-suppress-warnings" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SwiftyJSON 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 iMoon 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Picture/composite_demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/Picture/composite_demo.gif -------------------------------------------------------------------------------- /Picture/screen_shot0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/Picture/screen_shot0.png -------------------------------------------------------------------------------- /Picture/screen_shot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/Picture/screen_shot1.png -------------------------------------------------------------------------------- /Picture/screen_shot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/Picture/screen_shot2.png -------------------------------------------------------------------------------- /Picture/screen_shot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitHub-Life/IMKLine/9dfba526b951d74a305b16522946dec90b6e2b85/Picture/screen_shot3.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IMKLine -- Swift K线图 2 | ### 欢迎加群讨论更多:83766186😊 3 | --- 4 | 5 | ## 普通K线 + MA线 + 成交量柱状图 + MACD 6 | ![普通K线 + MA线 + 成交量柱状图 + MACD](https://github.com/GitHub-Life/IMKLine/raw/master/Picture/screen_shot0.png) 7 | --- 8 | ## 空心K线 + EMA线 + 成交量柱状图 + KDJ 9 | ![空心K线 + EMA线 + 成交量柱状图 + KDJ](https://github.com/GitHub-Life/IMKLine/raw/master/Picture/screen_shot1.png) 10 | --- 11 | ## 简易K线 + BOLL线 + 成交量柱状图 + KDJ 12 | ![简易K线 + BOLL线 + 成交量柱状图 + KDJ](https://github.com/GitHub-Life/IMKLine/raw/master/Picture/screen_shot2.png) 13 | --- 14 | ## 分时图 + 成交量柱状图 15 | ![分时图 + 成交量柱状图](https://github.com/GitHub-Life/IMKLine/raw/master/Picture/screen_shot3.png) 16 | --- 17 | ## 综合演示 18 | ![综合演示](https://github.com/GitHub-Life/IMKLine/raw/master/Picture/composite_demo.gif) 19 | --- 20 | #### 导入项目方法: 21 | 1. git clone此项目到本机,将根目录下的 IMKLine 文件夹导入至项目即可使用; 22 | 2. 使用CocoaPods 23 | ```ruby 24 | pod 'IMKLine' 25 | ``` 26 | #### k线的使用: 27 | 由于鄙人项目赶紧,暂时无法脱身写文档,后续会补上,可以参考 IMKLineDemo 中的使用方法使用。 28 | 29 | 注:图中右上角有选择时间段的按钮,我在Demo中的数据是本地的数据文件,不是网络获取的,所以尚未使用此功能。但这并不影响您学习K线的绘制,因为时间段的选择只是改变数据的数量,不会影响数据格式及计算。 30 | 31 | ### 欢迎加群讨论更多:83766186😊 32 | 有什么问题或建议,咱们可以随时@我,咱们一起交流学习😊 33 | 34 | #### 这次K线的学习,我是参考同事的[OC版K线](https://github.com/WillkYang/Y_KLine)学习着绘制的,非常感谢他,和他一起同事,我学习到了很多东西😊 35 | 有兴趣的朋友还可以看看我的[OC版趋势图](https://github.com/GitHub-Life/IMChart)、[OC版饼状图](https://github.com/GitHub-Life/IMPieChart) 36 | --------------------------------------------------------------------------------