Skip to content

Commit

Permalink
Merge pull request #6 from FidelityWires/feature/ver0.8.4
Browse files Browse the repository at this point in the history
update for ver 0.8.4
  • Loading branch information
ushios committed Nov 11, 2020
2 parents c785d13 + e08fa37 commit b207739
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Example/Example.xcodeproj/project.pbxproj
Expand Up @@ -343,7 +343,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 8V8NF64UP2;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
Expand All @@ -368,7 +368,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 8V8NF64UP2;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
Expand Down
5 changes: 3 additions & 2 deletions Example/Example/DebugSettingViewController.swift
Expand Up @@ -56,14 +56,15 @@ extension DebugSettingViewController: UITableViewDataSource {
for: indexPath) as! DebugSettingCell
let setting = settings[indexPath.row]
cell.delegate = self
cell.configure(name: setting.service.rawValue, isOn: setting.isAvailable, at: indexPath)
cell.configure(name: setting.service.rawValue, isOn: setting.status == .green, at: indexPath)
return cell
}
}

extension DebugSettingViewController: DebugSettingCellDelegate {

func switchValueDidChange(to newValue: Bool, at indexPath: IndexPath) {
settings[indexPath.row] = .init(service: settings[indexPath.row].service, isAvailable: newValue)
let status: ServiceStatusInfo.Status = newValue ? .green : .red
settings[indexPath.row] = .init(service: settings[indexPath.row].service, status: status)
}
}
12 changes: 6 additions & 6 deletions Example/Example/ViewController.swift
Expand Up @@ -20,10 +20,10 @@ final class ViewController: UIViewController {
@IBOutlet private weak var label: UILabel!

private var currentSettings: [ServiceStatusInspector.DebugSetting] = [
.init(service: .googleAnalytics, isAvailable: true),
.init(service: .googleConsole, isAvailable: true),
.init(service: .googleMaps, isAvailable: false),
.init(service: .googleDrive, isAvailable: false)
.init(service: .googleAnalytics, status: .green),
.init(service: .googleConsole, status: .green),
.init(service: .googleMaps, status: .red),
.init(service: .googleDrive, status: .red)
]

private var services: [Service] {
Expand Down Expand Up @@ -95,8 +95,8 @@ extension Sequence where Element == ServiceStatus {

func unavailableServices() -> String {
self.compactMap { (serviceStatus) -> String? in
if !serviceStatus.isAvailable {
return serviceStatus.service.service?.rawValue
if !serviceStatus.info.isAvailable {
return serviceStatus.info.service.service?.rawValue
}
return nil
}.joined(separator: "\n")
Expand Down
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -6,7 +6,7 @@ Stawm SDK for iOS
### 1. Add a line to `Cartfile`

```Cartfile
git "git@github.com:FidelityWires/stawm-sdk-ios.git" "v0.7.6"
git "git@github.com:FidelityWires/stawm-sdk-ios.git" "v0.8.4"
```

### 2. Add frameworks to setting
Expand Down Expand Up @@ -45,9 +45,9 @@ let serviceStatusInspector = ServiceStatusInspector()
let _ = serviceStatusInspector
.setDebug(settings: [
.init(service: .googlePlus, isAvailable: false),
.init(service: .googleCalendar, isAvailable: false),
.init(service: .googleMaps, isAvailable: false),
.init(service: .googlePlus, status: .red),
.init(service: .googleCalendar, status: .red),
.init(service: .googleMaps, status: .red),
])
```

Expand All @@ -57,4 +57,4 @@ let _ = serviceStatusInspector
2. Run `$ unzip Stawm.framework.zip # output Carthage directory`
3. Run `$ mv Carthage path/to/stawm-sdk-ios/Example/`
4. Open `Example.xcodeproj`
5. Build and run the project
5. Build and run the project

0 comments on commit b207739

Please sign in to comment.