This is a curated list of iOS (Swift & ObjC) frameworks which are inspired by React and Elm.
- ReactSwift by @ColinEberhardt
- https://github.com/ColinEberhardt/ReactSwift
| class Number /* class cluser */ { | |
| class Int8: Number { | |
| var value: Swift.Int8 | |
| init(_ value: Swift.Int8) { self.value = value } | |
| } | |
| class Int: Number { | |
| var value: Swift.Int | |
| init(_ value: Swift.Int) { self.value = value } | |
| } |
| # Running CPD | |
| pmd cpd --files ${EXECUTABLE_NAME} --minimum-tokens 50 --language swift --encoding UTF-8 --format net.sourceforge.pmd.cpd.XMLRenderer > cpd-output.xml --failOnViolation true | |
| # Running script | |
| php ./common_strings/cpd_script.php -cpd-xml cpd-output.xml |
This is a curated list of iOS (Swift & ObjC) frameworks which are inspired by React and Elm.
| #! /bin/bash | |
| curl http://releases.llvm.org/6.0.0/llvm-6.0.0.src.tar.xz -O | |
| tar xvzf llvm-6.0.0.src.tar.xz | |
| rm llvm-6.0.0.src.tar.xz | |
| cd llvm-6.0.0.src | |
| # get clang | |
| pushd tools | |
| curl http://releases.llvm.org/6.0.0/cfe-6.0.0.src.tar.xz -O |
| import Foundation | |
| import Swifter | |
| public func fileHttpResponseWithRange(r: HttpRequest, data: Data) -> HttpResponse { | |
| powerRanger:if let rangeHeader = r.headers["range"] { | |
| let rangeExpression = try! NSRegularExpression(pattern: "bytes=(\\d*)-(\\d*)", options: .caseInsensitive) | |
| let matches = rangeExpression.matches(in: rangeHeader, options: .anchored, range: NSRange(location: 0, length: rangeHeader.characters.count)) | |
| guard let match = matches.first, match.numberOfRanges == 3 else { | |
| break powerRanger |
| import JavaScriptCore | |
| extension JSContext { | |
| subscript(key: String) -> Any { | |
| get { | |
| return self.objectForKeyedSubscript(key) as Any | |
| } | |
| set{ | |
| self.setObject(newValue, forKeyedSubscript: key as NSCopying & NSObjectProtocol) | |
| } |
| // The MIT License (MIT) | |
| // Copyright (c) 2018 cmf028 | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
| // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
| // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH |
| // Douglas Hill, December 2018 | |
| // Made for https://douglashill.co/reading-app/ | |
| // Find the latest version of this file at https://github.com/douglashill/KeyboardKit | |
| import UIKit | |
| /// A table view that allows navigation and selection using a hardware keyboard. | |
| /// Only supports a single section. | |
| class KeyboardTableView: UITableView { | |
| // These properties may be set or overridden to provide discoverability titles for key commands. |