Skip to content

Commit 0369187

Browse files
authored
Merge pull request #22 from trading-point/michael/older-ios-usage
Add documentation about usage with OSes that don't support SwiftUI and Combine
2 parents ffd31c9 + a7638a8 commit 0369187

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,18 @@ You can add ComposableArchitecture to an Xcode project by adding it as a package
431431
- If you have a single application target that needs access to the library, then add **ComposableArchitecture** directly to your application.
432432
- If you want to use this library from multiple targets you must create a shared framework that depends on **ComposableArchitecture** and then depend on that framework in all of your targets. For an example of this, check out the [Tic-Tac-Toe](./Examples/TicTacToe) demo application, which splits lots of features into modules and consumes the static library in this fashion using the **TicTacToeCommon** framework.
433433

434+
### Using with older OS versions that don't support Combine and SwiftUI
435+
436+
This fork is compatible with ealier versions of iOS and macOS that don't support Combine or SwiftUI (eg iOS 11.x, 12.x and macOS 10.14.x). However, it still supports SwiftUI and maintains all the SwiftUI specific code from the original library. This also includes some references to Combine (mainly for `ObservableObject` support).
437+
438+
If you want to use this library in a target built for an OS that doesn't support SwiftUI or Combine, you will need to add the following linker options to force SwiftUI and Combine to be weakly linked, in order to avoid having a runtime crash when dyld attemps to resolve the linkage and cannot find the frameworks:
439+
440+
```
441+
OTHER_LDFLAGS = -weak_framework Combine -weak_framework SwiftUI
442+
```
443+
444+
In Xcode, add these options to the `Other Linker Flags` section of `Build Settings`.
445+
434446
## Documentation
435447
436448
The latest documentation for the Composable Architecture APIs is available [here](https://trading-point.github.io/reactiveswift-composable-architecture/).

Sources/ComposableArchitecture/ViewStore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public final class ViewStore<State, Action>: ObservableObject {
9393
}
9494

9595
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
96-
public lazy var objectWillChange: ObservableObjectPublisher = ObjectWillChangePublisher()
96+
public lazy var objectWillChange = ObservableObjectPublisher()
9797

9898
let _send: (Action) -> Void
9999

Tests/ComposableArchitectureTests/MemoryManagementTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import Combine
21
import ComposableArchitecture
32
import XCTest
43

0 commit comments

Comments
 (0)