-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from immobiliare/1.2.0
Release 1.2.0
- Loading branch information
Showing
18 changed files
with
275 additions
and
74 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,22 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
name: "RealFlags CI" | ||
on: [push, pull_request] | ||
|
||
concurrency: | ||
group: ci | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
Build: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/cache@v2 | ||
with: | ||
path: .build | ||
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} | ||
restore-keys: | | ||
${{ runner.os }}-spm- | ||
- uses: actions/checkout@v2 | ||
- name: Build & Run Tests | ||
run: xcodebuild -scheme RealFlags-Package test -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12' | ||
|
||
SwiftLint: | ||
runs-on: ubuntu-latest | ||
iOS: | ||
name: Unit Tests (iOS 15.0, Xcode 13.0) | ||
runs-on: macOS-11 | ||
env: | ||
DEVELOPER_DIR: /Applications/Xcode_13.0.app/Contents/Developer | ||
timeout-minutes: 15 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
xcode_version: ["13.2.1"] | ||
steps: | ||
- name: Get file changes | ||
id: get_file_changes | ||
uses: trilom/file-changes-action@v1.2.3 | ||
with: | ||
output: ' ' | ||
- name: Echo file changes | ||
run: | | ||
echo Changed files: ${{ steps.get_file_changes.outputs.files }} | ||
- uses: actions/checkout@v1 | ||
- name: GitHub Action for SwiftLint (Only files changed in the PR) | ||
uses: norio-nomura/action-swiftlint@3.1.0 | ||
env: | ||
changedFiles: ${{ steps.get_file_changes.outputs.files }} | ||
- uses: actions/checkout@v2 | ||
- name: Build & Run Tests | ||
run: xcodebuild -scheme RealFlags-Package test -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12 Pro' |
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
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
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
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
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
34 changes: 34 additions & 0 deletions
34
RealFlags/Sources/RealFlags/Classes/Browser/Cells/FlagsBrowserToggleCell.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// RealFlags | ||
// Easily manage Feature Flags in Swift | ||
// | ||
// Created by the Mobile Team @ ImmobiliareLabs | ||
// Email: mobile@immobiliare.it | ||
// Web: http://labs.immobiliare.it | ||
// | ||
// Copyright ©2021 Immobiliare.it SpA. All rights reserved. | ||
// Licensed under MIT License. | ||
// | ||
|
||
import UIKit | ||
|
||
public class FlagsBrowserToggleCell: FlagsBrowserDefaultCell { //, Reusable, NibType { | ||
|
||
// MARK: - IBOutlets | ||
|
||
@IBOutlet public var switchButton: UISwitch! | ||
|
||
// MARK: - Public Properties | ||
|
||
/// Callback to listen and react to event. If return `false` the previous value will be restored. | ||
public var onChangeSwitchValue: ((Bool) -> Bool)? | ||
|
||
// MARK: - IBAction | ||
|
||
@IBAction public func didChangeSwitchValue(_ sender: UISwitch) { | ||
if onChangeSwitchValue?(switchButton.isOn) == false { | ||
switchButton.isOn = !switchButton.isOn // restore previous value | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.