This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in 0..<5 { | |
let startTime: CFAbsoluteTime = CFAbsoluteTimeGetCurrent(); | |
for _ in 0..<100 { | |
let task = Task<Float, String, NSError> { p, f, r, c in } | |
//let signal = Signal<Int>.never() | |
} | |
let elapsedTime: CFAbsoluteTime = CFAbsoluteTimeGetCurrent() - startTime; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)testExample { | |
MyObject* obj = [[MyObject alloc] init]; | |
obj.array = @[]; | |
NSMutableArray* array = [obj mutableArrayValueForKey:@"array"]; | |
// NSMutableArray* array = @[].mutableCopy; // using this will pass test | |
__weak NSMutableArray* weakArray = array; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@7093981bc8fc:~/PackageTest# swift build | |
Compiling Swift Module 'SwiftState' (14 sources) | |
swift: /home/buildslave/jenkins/workspace/oss-swift-linux-packages-ubuntu_14_04-one-off-build/swift/lib/SILPasses/IPO/CapturePromotion.cpp:831: swift::SILFunction *constructClonedFunction(swift::PartialApplyInst *, swift::FunctionRefInst *, IndicesSet &): Assertion `!genericSig && "Function type has Unexpected generic signature!"' failed. | |
0 swift 0x0000000002f15268 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40 | |
1 swift 0x0000000002f13a36 llvm::sys::RunSignalHandlers() + 54 | |
2 swift 0x0000000002f15d9a | |
3 libpthread.so.0 0x00007f1e39e14340 | |
4 libc.so.6 0x00007f1e3903ccc9 gsignal + 57 | |
5 libc.so.6 0x00007f1e390400d8 abort + 328 | |
6 libc.so.6 0x00007f1e39035b86 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension String | |
{ | |
// https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore%E2%80%93Horspool_algorithm | |
// http://www.cin.br/~paguso/courses/if767/bib/Horspool_1980.pdf | |
public func indexOf_horspool(pattern: String) -> String.Index? | |
{ | |
let patternLength = pattern.characters.count | |
assert(patternLength > 0) | |
assert(patternLength <= self.characters.count) |
2016/08/20 13:00 Track A Speaker: 稲見 泰宏 (@inamiy)
ここ1, 2年のSwiftの登場とFunctional Reactive Programming (FRP)の普及によって、iOSアプリ開発の現場では劇的なパラダイムシフトが起きています。しかし一方で、副作用を伴うアプリの状態管理に苦労する点が未だ多くあり、バグの温床となっています。このプレゼンでは、状態管理の基礎理論であるオートマトン(ステートマシン)を基に、Reduxなどのフレームワークとの対比も交えながら、FRPでの効率的な設計手法について探ります。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// # Bug description | |
// `@discardableResult` won't work when: | |
// 1. optional chaining | |
// 2. function returns Optional + non-Void value | |
// | |
// ## See also | |
// - https://bugs.swift.org/browse/SR-1052 | |
// - https://bugs.swift.org/browse/SR-1681 | |
// - https://bugs.swift.org/browse/SR-1929 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git Tests/ReactiveSwiftTests/SignalProducerSpec.swift Tests/ReactiveSwiftTests/SignalProducerSpec.swift | |
index 21362e7..a363327 100644 | |
--- Tests/ReactiveSwiftTests/SignalProducerSpec.swift | |
+++ Tests/ReactiveSwiftTests/SignalProducerSpec.swift | |
@@ -1413,13 +1413,14 @@ class SignalProducerSpec: QuickSpec { | |
} | |
} | |
- describe("disposal") { | |
+ fdescribe("disposal") { |
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func test<T>(_ f: (T) -> Void) {} | |
let intF: (Int) -> Void = { _ in } | |
let voidF: () -> Void = { } | |
test(intF) // works | |
//test(voidF) // error: cannot convert value of type '() -> Void' to expected argument type '(_) -> Void' | |
//: # Workaround for zero-argument func to be passed into `test` |