Skip to content

Commit

Permalink
specified code language
Browse files Browse the repository at this point in the history
  • Loading branch information
SensehacK committed Apr 16, 2023
1 parent 40ce8e8 commit 3915874
Show file tree
Hide file tree
Showing 15 changed files with 120 additions and 68 deletions.
105 changes: 74 additions & 31 deletions .obsidian/workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,50 @@
},
"pinned": true
}
},
{
"id": "1d718930367ce401",
"type": "leaf",
"pinned": true,
"state": {
"type": "markdown",
"state": {
"file": "ios/lifecycle/dark_mode.md",
"mode": "source",
"backlinks": true,
"source": false
},
"pinned": true
}
},
{
"id": "7363c745dbdc2dde",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "ios/lifecycle/README_lifecycle.md",
"mode": "source",
"backlinks": true,
"source": false
}
}
},
{
"id": "a0c51758c119d80c",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "ios/rxSwift/rough_work.md",
"mode": "source",
"backlinks": true,
"source": false
}
}
}
]
],
"currentTab": 3
},
{
"id": "dd4a158ffe1a15b2",
Expand Down Expand Up @@ -60,7 +102,8 @@
"pinned": true
}
}
]
],
"currentTab": 1
}
],
"direction": "vertical"
Expand Down Expand Up @@ -126,7 +169,7 @@
"state": {
"type": "backlink",
"state": {
"file": "ios/README_iOS.md",
"file": "ios/rxSwift/rough_work.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
Expand All @@ -143,7 +186,7 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "ios/README_iOS.md",
"file": "ios/rxSwift/rough_work.md",
"linksCollapsed": true,
"unlinkedCollapsed": true
}
Expand All @@ -166,7 +209,7 @@
"state": {
"type": "outline",
"state": {
"file": "ios/README_iOS.md"
"file": "ios/rxSwift/rough_work.md"
}
}
}
Expand All @@ -187,34 +230,34 @@
"command-palette:Open command palette": false
}
},
"active": "dc344770f7335760",
"active": "a0c51758c119d80c",
"lastOpenFiles": [
"SUMMARY.md",
"ios/lifecycle/README_lifecycle.md",
"ios/config/best_practices.md",
"ios/README_iOS.md",
"ios/rxSwift/resources.md",
"ios/rxSwift/relays.md",
"ios/rxSwift/README_rxSwift.md",
"frontend/README_frontend.md",
"frontend/javascript/README_javascript.md",
"README.md",
"ios/swiftUI/README_swiftUI.mdREADME_swiftUI.md",
"ios/swift/README_swift.md",
"ios/combine/ReadMe_combine.md",
"ios/concurrency/Readme_concurrency.md",
"ios/library/README_library.md",
"ios/automation/README_automation.md",
"ios/README_combine.md",
"tools/terminal/README_terminal.md",
"mobile/ionic/ionic 1.md",
"mobile/ionic/commands.md",
"tools/git/README_git.md",
"ios/xcode/README_xcode.md",
"tools/terminal/terminal.md",
"tools/terminal/shell_alias.md",
"tools/terminal/result_from_CLI.md",
"process/search.md",
"process/release.md",
"process/peer_review.md",
"ios/rxSwift/prerequisites.md",
"ios/rxSwift/playground.md",
"ios/rxSwift/pain_points.md",
"ios/rxSwift/observe.md",
"ios/rxSwift/merge.md",
"ios/rxSwift/map.md",
"ios/rxSwift/flatMap.md",
"ios/rxSwift/error_handling.md",
"ios/rxSwift/doubts.md",
"ios/rxSwift/distinct.md",
"ios/rxSwift/documentation.md",
"ios/rxSwift/disposeBag.md",
"ios/rxSwift/conversionRxObservableConcrete.md",
"ios/rxSwift/concurrency_rxSwift.md",
"ios/rxSwift/completion.md",
"ios/rxSwift/combination.md",
"ios/rxSwift/binder.md",
"ios/rxSwift/bind_vs_subscribe.md",
"ios/rxSwift/autoComplete.md",
"ios/rxSwift/asObserver_vs_asObservable.md",
"ios/rxSwift/additional_links.md",
"ios/library/wildcard_checks.md",
"ios/library/webkit.md",
"dev_cheatsheet",
"ios/Canvas.canvas",
"ios/concurrency",
Expand Down
2 changes: 1 addition & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

### [swift](ios/swift/README_swift.md)

### [swiftUI](ios/swiftUI/README_swiftUI.mdREADME_swiftUI.md)
### [swiftUI](ios/swiftUI/README_swiftUI.md)

### [test](ios/test/README_test.md)

Expand Down
4 changes: 2 additions & 2 deletions ios/library/cocoapods.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ https://guides.cocoapods.org/using/getting-started.html

You could try the following: Clearing CocoaPods' cache:

```text
```bash
> rm -rf "${HOME}/Library/Caches/CocoaPods"
> rm -rf "`pwd`/Pods/" (while in your project's dir)
> pod update
Expand All @@ -29,7 +29,7 @@ If you are using 0.38.0.beta1, you can just use pod cache clean
Regenerate everything:
```text
```bash
> rm -rf ~/Library/Caches/CocoaPods
> rm -rf Pods
> rm -rf ~/Library/Developer/Xcode/DerivedData/*
Expand Down
3 changes: 3 additions & 0 deletions ios/library/jailbreak.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ Getting started with Mobile Substrate tweaking.
## Update packages

In terminal type (after loging with su):
```bash
mkdir -p var/cache/apt/archives/partial
apt-get update
```

2 changes: 0 additions & 2 deletions ios/lifecycle/README_lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@

[[lifecycle/extensions]]

[[dark_mode]]

[inheritance](inheritance.md)

[logging](logging.md)
8 changes: 7 additions & 1 deletion ios/lifecycle/dark_mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@

## Checking User Style

switch UIScreen.main.traitCollection.userInterfaceStyle { case .light: //light mode case .dark: //dark mode case .unspecified: //the user interface style is not specified }
```swift
switch UIScreen.main.traitCollection.userInterfaceStyle {
case .light: //light mode
case .dark: //dark mode
case .unspecified: //the user interface style is not specified
}
```

## Override the App user style

Expand Down
11 changes: 5 additions & 6 deletions ios/rxSwift/asObserver_vs_asObservable.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ Only access control would be granted access if they are in that authorized state



```
```swift
otherAccountsSelected
.debugLane("AccountList")
.map { $0.account }
.bind(to: context.switchAccount)
.disposed(by: disposeBag)`
.debugLane("AccountList")
.map { $0.account }
.bind(to: context.switchAccount)
.disposed(by: disposeBag)`
```

So bind -> Subscribe
Expand Down
8 changes: 4 additions & 4 deletions ios/rxSwift/autoComplete.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ Eg.

```swift
let (showSyncAlert, noSyncAlert) = accountRequestSubject
.mapToVoid()
.flatMap { _ in
return Observable<Bool>.of(true)
}
.mapToVoid()
.flatMap { _ in
return Observable<Bool>.of(true)
}
```
The `showSyncAlert` & `noSyncAlert` won't be able to parse properly since it is not a tuple. So we need to assign back to just one variable `syncStatus`.
After that we could do a `split()` which
9 changes: 4 additions & 5 deletions ios/rxSwift/bind_vs_subscribe.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Bind vs Subscribe

```swift

.bind(to: dashboardNavigationContextSubject)
.bind(to: dashboardNavigationContextSubject)

vs
//vs

.subscribe(onNext: { data in
dashboardNavigationContextSubject.onNext(data)
.subscribe(onNext: { data in
dashboardNavigationContextSubject.onNext(data)
```


Expand Down
3 changes: 3 additions & 0 deletions ios/rxSwift/conversionRxObservableConcrete.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
Conversion from Rx Observable to Concrete type

```swift
originalTypedObject.map { object -> Observable<NewType>
// object is a non-rx type
// Mutate the type any way you want here in normal Swift code
// Return a new type to sent it back to the observable sequence as the new type/object
}
```


2 changes: 1 addition & 1 deletion ios/rxSwift/doubts.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Why convert to observable for RxCocoa UI elements

```
```swift
// Button
let button = closeButtonItem
.rx
Expand Down
12 changes: 6 additions & 6 deletions ios/rxSwift/flatMap.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ Think of it as an 2D array flat mapping into a 1D array
# Traditional
Flat Map 2D => 1D Array of Int values

```
```swift
[
1,2,3,
4,5,6,
7,8,9
] ====> [1,2,3,4,5,6,7,8,9]
1,2,3,
4,5,6,
7,8,9
] ====> [1,2,3,4,5,6,7,8,9]

```



## Reactive

// Imagine the variables as observable without the appropriate syntax.
Imagine the variables as observable without the appropriate syntax.

```swift

Expand Down
16 changes: 8 additions & 8 deletions ios/rxSwift/map.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ sessionNotExpired

```swift
// Not present? Optional ?
let (isSSOEnabled, isSSODisabled) = sessionEntry
.filter { session in
return session == nil
}
.mapToVoid()
.split { _ in context.account.onlySSO }
.map { _ in context.account.onlySSO }
.split{$0}
let (isSSOEnabled, isSSODisabled) = sessionEntry
.filter { session in
return session == nil
}
.mapToVoid()
.split { _ in context.account.onlySSO }
.map { _ in context.account.onlySSO }
.split{$0}
```


Expand Down
1 change: 0 additions & 1 deletion ios/rxSwift/merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,4 @@ JERSH 4 minutes ago
Observable
.of(37) // Observable<Int>
.withLatestFrom(.of("thirty seven")) { $1 } // Observable<String>
```
2 changes: 2 additions & 0 deletions ios/rxSwift/rough_work.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Rough work

This reverts commit 592da3f4c5ecb4ddb19bfdb208ccb05e7ab5b2b1.

```swift

//
// Mock.swift
Expand Down Expand Up @@ -39,3 +40,4 @@ extension Mock {
}
}
}
```

0 comments on commit 3915874

Please sign in to comment.