One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| # Uncomment the next line to define a global platform for your project | |
| # platform :ios, '9.0' | |
| target '%TargetName%' do | |
| # Comment the next line if you're not using Swift and don't want to use dynamic frameworks | |
| use_frameworks! | |
| # Pods for %TargetName% | |
| # pod 'FBSDKCoreKit' | |
| end |
| public protocol RichTextEditorDelegate: class { | |
| func textDidChange(text: String) | |
| func heightDidChange() | |
| } | |
| fileprivate class WeakScriptMessageHandler: NSObject, WKScriptMessageHandler { | |
| weak var delegate: WKScriptMessageHandler? | |
| init(delegate: WKScriptMessageHandler) { | |
| self.delegate = delegate |
| @IBDesignable class GridView: UIView { | |
| var numberOfColumns: Int = 2 | |
| var numberOfRows: Int = 2 | |
| var lineWidth: CGFloat = 1.0 | |
| var lineColor: UIColor = UIColor.white | |
| override func draw(_ rect: CGRect) { | |
| if let context = UIGraphicsGetCurrentContext() { | |
| extension UIView { | |
| func blur() { | |
| let blurEffect = UIBlurEffect(style: UIBlurEffectStyle.light) | |
| let blurEffectView = UIVisualEffectView(effect: blurEffect) | |
| blurEffectView.frame = self.bounds | |
| blurEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight] | |
| self.addSubview(blurEffectView) | |
| } | |
| func unBlur() { |
| func imageByNormalizingOrientation() -> UIImage { | |
| if imageOrientation == .up { | |
| return self | |
| } | |
| UIGraphicsBeginImageContextWithOptions(size, false, scale) | |
| draw(in: CGRect(origin: CGPoint.zero, size: size)) | |
| let normalizedImage: UIImage? = UIGraphicsGetImageFromCurrentImageContext() | |
| UIGraphicsEndImageContext() | |
| return normalizedImage! | |
| } |
| class SpinView: UIView { | |
| private var animating: Bool = false | |
| private func spin(with options: UIViewAnimationOptions) { | |
| // this spin completes 360 degrees every 2 seconds | |
| UIView.animate(withDuration: 0.5, delay: 0, options: options, animations: {() -> Void in | |
| self.transform = self.transform.rotated(by: .pi / 2) | |
| }, completion: {(_ finished: Bool) -> Void in | |
| if finished { | |
| if self.animating { |
| // MARK: - KVO | |
| var observedPaths: [String] = [] | |
| // Usage - observeKVO(keyPath: #keyPath(camera.inputCamera.whiteBalanceMode)) | |
| func observeKVO(keyPath: String) -> Bool { | |
| if shouldObserveKVO { | |
| if self.classForCoder.automaticallyNotifiesObservers(forKey: keyPath) { | |
| observedPaths.append(keyPath) | |
| addObserver(self, forKeyPath: keyPath, options: [.old, .new], context: nil) |
| #!/bin/bash | |
| set -e | |
| set -u | |
| altool="$(dirname "$(xcode-select -p)")/Applications/Application Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool" | |
| ipa="path/to/foo.ipa" | |
| echo "Validating app..." | |
| time "$altool" --validate-app --type ios --file "$ipa" --username "$ITC_USER" --password "$ITC_PASSWORD" |