mirror of
https://github.com/fxm90/GradientLoadingBar.git
synced 2026-06-16 12:24:31 +00:00
➕ :: Added LightweightObservable dependency
This commit is contained in:
@@ -355,10 +355,12 @@
|
||||
inputPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-GradientLoadingBar_Example/Pods-GradientLoadingBar_Example-frameworks.sh",
|
||||
"${BUILT_PRODUCTS_DIR}/GradientLoadingBar/GradientLoadingBar.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/LightweightObservable/LightweightObservable.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GradientLoadingBar.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/LightweightObservable.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
PODS:
|
||||
- GradientLoadingBar (1.1.16)
|
||||
- GradientLoadingBar (1.1.16):
|
||||
- LightweightObservable (~> 1.0)
|
||||
- LightweightObservable (1.0.0)
|
||||
- SwiftFormat/CLI (0.40.4)
|
||||
- SwiftLint (0.31.0)
|
||||
|
||||
@@ -10,6 +12,7 @@ DEPENDENCIES:
|
||||
|
||||
SPEC REPOS:
|
||||
https://github.com/cocoapods/specs.git:
|
||||
- LightweightObservable
|
||||
- SwiftFormat
|
||||
- SwiftLint
|
||||
|
||||
@@ -18,7 +21,8 @@ EXTERNAL SOURCES:
|
||||
:path: "../"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
GradientLoadingBar: 4f62a8302125a90f3e3eca4612f28d2928a8b693
|
||||
GradientLoadingBar: cd8ff33f9057a346e57b39a583efc36ac27bffd5
|
||||
LightweightObservable: 4d3baddc9949ce29327fab825e48fad8b41502e7
|
||||
SwiftFormat: cc36377840cffa5d0634782875dccf34dc02ff39
|
||||
SwiftLint: 7a0227733d786395817373b2d0ca799fd0093ff3
|
||||
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2019 Felix Mau <me@felix.hamburg>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// Disposable.swift
|
||||
// LightweightObservable
|
||||
//
|
||||
// Created by Felix Mau on 11/02/19.
|
||||
// Copyright © 2019 Felix Mau. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Helper to allow storing multiple disposables (and matching name from RxSwift).
|
||||
public typealias DisposeBag = [Disposable]
|
||||
|
||||
/// Executes a given closure on deallocation.
|
||||
public final class Disposable {
|
||||
// MARK: - Types
|
||||
|
||||
/// Type for closure to be executed on deallocation.
|
||||
public typealias Dispose = () -> Void
|
||||
|
||||
// MARK: - Private properties
|
||||
|
||||
/// Closure to be executed on deallocation.
|
||||
private let dispose: Dispose
|
||||
|
||||
// MARK: - Initializer
|
||||
|
||||
/// Creates a new instance.
|
||||
///
|
||||
/// - Parameter dispose: The closure that is executed on deallocation.
|
||||
public init(_ dispose: @escaping Dispose) {
|
||||
self.dispose = dispose
|
||||
}
|
||||
|
||||
/// Executes our closure.
|
||||
deinit {
|
||||
dispose()
|
||||
}
|
||||
|
||||
// MARK: - Public methods
|
||||
|
||||
/// Adds the current disposable to an array of disposables.
|
||||
public func disposed(by bag: inout DisposeBag) {
|
||||
bag.append(self)
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// Observable+Equatable.swift
|
||||
// LightweightObservable
|
||||
//
|
||||
// Created by Felix Mau on 01/05/19.
|
||||
// Copyright © 2019 Felix Mau. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Additonal helper methods for an observable that can be compared for equality.
|
||||
public extension Observable where T: Equatable {
|
||||
// MARK: - Types
|
||||
|
||||
/// The type for the filter closure.
|
||||
typealias Filter = (NewValue, OldValue) -> Bool
|
||||
|
||||
// MARK: - Public methods
|
||||
|
||||
/// Informs the given observer on changes to our `value`, only if the given filter matches.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - filter: The filer-closure, that must return `true` in order for the observer to be notified.
|
||||
/// - observer: The observer-closure that is notified on changes.
|
||||
func subscribe(filter: @escaping Filter, observer: @escaping Observer) -> Disposable {
|
||||
return subscribe { nextValue, prevValue in
|
||||
guard filter(nextValue, prevValue) else { return }
|
||||
|
||||
observer(nextValue, prevValue)
|
||||
}
|
||||
}
|
||||
|
||||
/// Informs the given observer on **distinct** changes to our `value`.
|
||||
///
|
||||
/// - Parameter observer: The observer-closure that is notified on changes.
|
||||
func subscribeDistinct(_ observer: @escaping Observer) -> Disposable {
|
||||
return subscribe(filter: { $0 != $1 },
|
||||
observer: observer)
|
||||
}
|
||||
}
|
||||
Generated
+109
@@ -0,0 +1,109 @@
|
||||
//
|
||||
// Observable.swift
|
||||
// LightweightObservable
|
||||
//
|
||||
// Created by Felix Mau on 11/02/19.
|
||||
// Copyright © 2019 Felix Mau. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// An observable sequence that you can subscribe to. Any of the subscriber will receive the most
|
||||
/// recent element and everything that is emitted by that sequence after the subscription happened.
|
||||
///
|
||||
/// - Note: Implementation based on [roberthein/Observable](https://github.com/roberthein/Observable).
|
||||
public class Observable<T> {
|
||||
// MARK: - Types
|
||||
|
||||
/// The type for the new value of the observable.
|
||||
public typealias NewValue = T
|
||||
|
||||
/// The type for the previous value of the observable.
|
||||
public typealias OldValue = T?
|
||||
|
||||
/// The type for the closure to executed on change of the observable.
|
||||
public typealias Observer = (NewValue, OldValue) -> Void
|
||||
|
||||
/// We store all observers within a dictionary, for which this is the type of the key.
|
||||
private typealias Index = UInt
|
||||
|
||||
// MARK: - Public properties
|
||||
|
||||
/// The current (readonly) value of the observable.
|
||||
fileprivate(set) var value: T {
|
||||
didSet {
|
||||
for (_, observer) in observers {
|
||||
observer(value, oldValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Private properties
|
||||
|
||||
/// The index of the last inserted observer.
|
||||
private var lastIndex: Index = 0
|
||||
|
||||
/// Map with all active observers.
|
||||
private var observers = [Index: Observer]()
|
||||
|
||||
// MARK: - Initalizer
|
||||
|
||||
/// Initializes a new observable with the given value.
|
||||
///
|
||||
/// - Note: Declared `fileprivate` in order to prevent directly initializing an observable, which can not be updated.
|
||||
fileprivate init(_ value: T) {
|
||||
self.value = value
|
||||
}
|
||||
|
||||
// MARK: - Public methods
|
||||
|
||||
/// Informs the given observer on changes to our `value`.
|
||||
///
|
||||
/// - Parameter observer: The observer-closure that is notified on changes.
|
||||
public func subscribe(_ observer: @escaping Observer) -> Disposable {
|
||||
let currentIndex = lastIndex + 1
|
||||
observers[currentIndex] = observer
|
||||
|
||||
lastIndex = currentIndex
|
||||
|
||||
// Inform observer with initial value.
|
||||
observer(value, nil)
|
||||
|
||||
// Return a disposable, that removes the entry for this observer on it's deallocation.
|
||||
return Disposable { [weak self] in
|
||||
self?.observers[currentIndex] = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A special form of an observable sequence, that you can subscribe to AND dynamically add elements.
|
||||
///
|
||||
/// - Note: Has to be declared in the same file as `Observable`, to overwrite `fileprivate` setter for property `value`.
|
||||
/// (Workaround for a "protected" property).
|
||||
public final class Variable<T>: Observable<T> {
|
||||
// MARK: - Public properties
|
||||
|
||||
/// The current variable converted to an (readonly) `Observable`.
|
||||
public var asObservable: Observable<T> {
|
||||
return self as Observable
|
||||
}
|
||||
|
||||
/// The current value of the observable.
|
||||
public override var value: T {
|
||||
get {
|
||||
return super.value
|
||||
}
|
||||
set {
|
||||
super.value = newValue
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Initializer
|
||||
|
||||
/// Initializes a new variable with the given value.
|
||||
///
|
||||
/// - Note: As we've made the initializer to the super class `Observable` fileprivate, we must override it here with public access.
|
||||
public override init(_ value: T) {
|
||||
super.init(value)
|
||||
}
|
||||
}
|
||||
+132
@@ -0,0 +1,132 @@
|
||||

|
||||
|
||||
<p align="center">
|
||||
<img src="https://img.shields.io/badge/Swift-5.0-green.svg?style=flat" alt="Swift Version" />
|
||||
<img src="http://img.shields.io/travis/com/fxm90/LightweightObservable.svg?style=flat" alt="CI Status" />
|
||||
<img src="https://img.shields.io/cocoapods/v/LightweightObservable.svg?style=flat" alt="Version" />
|
||||
<img src="https://img.shields.io/cocoapods/l/LightweightObservable.svg?style=flat" alt="License" />
|
||||
<img src="https://img.shields.io/cocoapods/p/LightweightObservable.svg?style=flat" alt="Platform" />
|
||||
</p>
|
||||
|
||||
## Features
|
||||
|
||||
Lightweight Obserservable is a simple implementation of an observable sequence that you can subscribe to. The framework is designed to be minimal meanwhile convenient. The entire code is only ~80 lines (excluding comments). With Lightweight Observable you can easily set up UI-Bindings in an MVVM application, handle asynchronous network calls and a lot more.
|
||||
|
||||
**Credits:** The code was heavily influenced by [roberthein/observable](https://github.com/roberthein/Observable). However I needed something that was syntactically closer to [RxSwift](https://github.com/ReactiveX/RxSwift), which is why I came up with this code, and for reusability reasons afterwards moved it into a CocoaPod.
|
||||
|
||||
### Example
|
||||
To run the example project, clone the repo, and open the workspace from the Example directory.
|
||||
|
||||
### Integration
|
||||
##### CocoaPods
|
||||
LightweightObservable can be added to your project using [CocoaPods](https://cocoapods.org/) by adding the following line to your Podfile:
|
||||
```
|
||||
pod 'LightweightObservable', '~> 1.0'
|
||||
```
|
||||
|
||||
##### Carthage
|
||||
To integrate LightweightObservable into your Xcode project using [Carthage](https://github.com/Carthage/Carthage), specify it in your Cartfile:
|
||||
```
|
||||
github "fxm90/LightweightObservable" ~> 1.0
|
||||
```
|
||||
Run carthage update to build the framework and drag the built `LightweightObservable.framework` into your Xcode project.
|
||||
|
||||
### How to use
|
||||
The framework provides two classes `Observable` and `Variable`:
|
||||
- `Observable`: Contains an immutable value, you only can subscribe to. This is useful in order to avoid side-effects on an internal API.
|
||||
- `Variable`: Subclass of `Observable`, where you can modify the value as well.
|
||||
|
||||
Feel free to check out the example application for a better understanding of this approach.
|
||||
|
||||
#### – Create a variable
|
||||
```swift
|
||||
let formattedTimeSubject = Variable("")
|
||||
|
||||
// ...
|
||||
|
||||
formattedTimeSubject.value = "4:20 PM"
|
||||
```
|
||||
|
||||
#### – Create an observable
|
||||
Initializing an observable directly is not possible, as this would lead to a sequence that will never change. Instead, use the computed property `asObservable` from `Variable` to cast the instance to an observable.
|
||||
```swift
|
||||
var formattedTime: Observable<String> {
|
||||
return formattedTimeSubject.asObservable
|
||||
}
|
||||
```
|
||||
|
||||
#### – Subscribe to changes
|
||||
Every subscriber gets initialized with the current value and updated on all further changes to the observable value.
|
||||
|
||||
```swift
|
||||
formattedTime.subscribe { [weak self] newFormattedTime, oldFormattedTime in
|
||||
self?.timeLabel.text = newFormattedTime
|
||||
}
|
||||
```
|
||||
|
||||
Please notice that the old value (`oldFormattedTime`) is an optional of the underlying type, as we don't have this value on the initial call to the subscriber.
|
||||
|
||||
**Important:** To avoid retain cycles and/or crashes, **always** use `[weak self]` when self is needed by an observer.
|
||||
|
||||
#### – Memory Management (`Disposable` / `DisposeBag`)
|
||||
|
||||
When you subscribe to an `Observable` the method returns a `Disposable`, which is basically a reference to the new subscription.
|
||||
|
||||
We need to maintain it, in order to properly control the lifecycle of that subscription.
|
||||
|
||||
Let me explain you why in a little example:
|
||||
|
||||
> Imagine having a MVVM application using a service layer for network calls. A service is used as a singleton across the entire app.
|
||||
>
|
||||
> The view-model has a reference to a service and subscribes to an observable property. The subscription-closure is now saved inside the observable property on the service.
|
||||
>
|
||||
> If the view-model gets deallocated (e.g. due to a dismissed view-controller), without noticing the observable property somehow, the subscription-closure would continue to be alive.
|
||||
>
|
||||
> As a workaround, we store the returned disposable from the subscription on the view-model. On deallocation of the disposable, it automatically informs the observable property to remove the referenced subscription closure.
|
||||
|
||||
In case you only use a single subscriber you can store the returned `Disposable` to a variable:
|
||||
```swift
|
||||
let disposable = formattedTime.subscribe { [weak self] newFormattedTime, oldFormattedTime in
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
In case you're having multiple observers, you can store all returned `Disposable` in an array of `Disposable`. (To match the syntax from [RxSwift](https://github.com/ReactiveX/RxSwift), this pod contains a typealias called `DisposeBag`, which is an array of `Disposable`).
|
||||
```swift
|
||||
var disposeBag = DisposeBag()
|
||||
|
||||
formattedTime.subscribe { [weak self] newFormattedTime, oldFormattedTime in
|
||||
// ...
|
||||
}.disposed(by: &disposeBag)
|
||||
|
||||
formattedDate.subscribe { [weak self] newFormattedDate, oldFormattedDate in
|
||||
// ...
|
||||
}.disposed(by: &disposeBag)
|
||||
```
|
||||
|
||||
A `DisposeBag` is exactly what it says it is, a bag (or array) of disposables.
|
||||
|
||||
#### – Observing `Equatable` values
|
||||
If you create an Observable which underlying type conforms to `Equtable` you can subscribe to changes using a specific filter. Therefore this pod contains the method:
|
||||
```swift
|
||||
typealias Filter = (NewValue, OldValue) -> Bool
|
||||
|
||||
func subscribe(filter: @escaping Filter, observer: @escaping Observer) -> Disposable {}
|
||||
```
|
||||
|
||||
Using this method, the observer will only be notified on changes if the corresponding filter matches.
|
||||
|
||||
This pod comes with one predefined filter method, called `subscribeDistinct`. Subscribing to an observable using this method, will only notify the observer if the new value is different from the old value. This is useful to prevent unnecessary UI-Updates.
|
||||
|
||||
Feel free to add more filters, by extending the `Observable` like this:
|
||||
```swift
|
||||
extension Observable where T: Equatable {}
|
||||
```
|
||||
|
||||
### Author
|
||||
|
||||
Felix Mau, me@felix.hamburg
|
||||
|
||||
### License
|
||||
|
||||
LightweightObservable is available under the MIT license. See the LICENSE file for more info.
|
||||
+7
-2
@@ -4,7 +4,7 @@
|
||||
"summary": "A customizable animated gradient loading bar.",
|
||||
"description": "A customizable animated gradient loading bar.\nInspired by https://codepen.io/marcobiedermann/pen/LExXWW",
|
||||
"homepage": "https://github.com/fxm90/GradientLoadingBar",
|
||||
"screenshots": "http://felix.hamburg/files/github/gradient-loading-bar/screen.gif",
|
||||
"screenshots": "https://felix.hamburg/files/github/gradient-loading-bar/screen.gif",
|
||||
"license": {
|
||||
"type": "MIT",
|
||||
"file": "LICENSE"
|
||||
@@ -20,5 +20,10 @@
|
||||
"platforms": {
|
||||
"ios": "9.0"
|
||||
},
|
||||
"source_files": "GradientLoadingBar/Classes/**/*"
|
||||
"source_files": "GradientLoadingBar/Classes/**/*",
|
||||
"dependencies": {
|
||||
"LightweightObservable": [
|
||||
"~> 1.0"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+6
-2
@@ -1,5 +1,7 @@
|
||||
PODS:
|
||||
- GradientLoadingBar (1.1.16)
|
||||
- GradientLoadingBar (1.1.16):
|
||||
- LightweightObservable (~> 1.0)
|
||||
- LightweightObservable (1.0.0)
|
||||
- SwiftFormat/CLI (0.40.4)
|
||||
- SwiftLint (0.31.0)
|
||||
|
||||
@@ -10,6 +12,7 @@ DEPENDENCIES:
|
||||
|
||||
SPEC REPOS:
|
||||
https://github.com/cocoapods/specs.git:
|
||||
- LightweightObservable
|
||||
- SwiftFormat
|
||||
- SwiftLint
|
||||
|
||||
@@ -18,7 +21,8 @@ EXTERNAL SOURCES:
|
||||
:path: "../"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
GradientLoadingBar: 4f62a8302125a90f3e3eca4612f28d2928a8b693
|
||||
GradientLoadingBar: cd8ff33f9057a346e57b39a583efc36ac27bffd5
|
||||
LightweightObservable: 4d3baddc9949ce29327fab825e48fad8b41502e7
|
||||
SwiftFormat: cc36377840cffa5d0634782875dccf34dc02ff39
|
||||
SwiftLint: 7a0227733d786395817373b2d0ca799fd0093ff3
|
||||
|
||||
|
||||
+478
-277
File diff suppressed because it is too large
Load Diff
+1
@@ -1,4 +1,5 @@
|
||||
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/GradientLoadingBar
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LightweightObservable"
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
|
||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
@interface PodsDummy_LightweightObservable : NSObject
|
||||
@end
|
||||
@implementation PodsDummy_LightweightObservable
|
||||
@end
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#else
|
||||
#ifndef FOUNDATION_EXPORT
|
||||
#if defined(__cplusplus)
|
||||
#define FOUNDATION_EXPORT extern "C"
|
||||
#else
|
||||
#define FOUNDATION_EXPORT extern
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#else
|
||||
#ifndef FOUNDATION_EXPORT
|
||||
#if defined(__cplusplus)
|
||||
#define FOUNDATION_EXPORT extern "C"
|
||||
#else
|
||||
#define FOUNDATION_EXPORT extern
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
FOUNDATION_EXPORT double LightweightObservableVersionNumber;
|
||||
FOUNDATION_EXPORT const unsigned char LightweightObservableVersionString[];
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
framework module LightweightObservable {
|
||||
umbrella header "LightweightObservable-umbrella.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/LightweightObservable
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
|
||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_ROOT = ${SRCROOT}
|
||||
PODS_TARGET_SRCROOT = ${PODS_ROOT}/LightweightObservable
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
||||
SKIP_INSTALL = YES
|
||||
+23
@@ -24,6 +24,29 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
## LightweightObservable
|
||||
|
||||
Copyright (c) 2019 Felix Mau <me@felix.hamburg>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
## SwiftFormat
|
||||
|
||||
MIT License
|
||||
|
||||
+29
@@ -41,6 +41,35 @@ THE SOFTWARE.
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>Copyright (c) 2019 Felix Mau <me@felix.hamburg>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
</string>
|
||||
<key>License</key>
|
||||
<string>MIT</string>
|
||||
<key>Title</key>
|
||||
<string>LightweightObservable</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>MIT License
|
||||
|
||||
+2
@@ -154,9 +154,11 @@ strip_invalid_archs() {
|
||||
|
||||
if [[ "$CONFIGURATION" == "Debug" ]]; then
|
||||
install_framework "${BUILT_PRODUCTS_DIR}/GradientLoadingBar/GradientLoadingBar.framework"
|
||||
install_framework "${BUILT_PRODUCTS_DIR}/LightweightObservable/LightweightObservable.framework"
|
||||
fi
|
||||
if [[ "$CONFIGURATION" == "Release" ]]; then
|
||||
install_framework "${BUILT_PRODUCTS_DIR}/GradientLoadingBar/GradientLoadingBar.framework"
|
||||
install_framework "${BUILT_PRODUCTS_DIR}/LightweightObservable/LightweightObservable.framework"
|
||||
fi
|
||||
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
|
||||
wait
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GradientLoadingBar"
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GradientLoadingBar" "${PODS_CONFIGURATION_BUILD_DIR}/LightweightObservable"
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GradientLoadingBar/GradientLoadingBar.framework/Headers"
|
||||
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GradientLoadingBar/GradientLoadingBar.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/LightweightObservable/LightweightObservable.framework/Headers"
|
||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||
OTHER_LDFLAGS = $(inherited) -framework "GradientLoadingBar"
|
||||
OTHER_LDFLAGS = $(inherited) -framework "GradientLoadingBar" -framework "LightweightObservable"
|
||||
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
|
||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GradientLoadingBar"
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GradientLoadingBar" "${PODS_CONFIGURATION_BUILD_DIR}/LightweightObservable"
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GradientLoadingBar/GradientLoadingBar.framework/Headers"
|
||||
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GradientLoadingBar/GradientLoadingBar.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/LightweightObservable/LightweightObservable.framework/Headers"
|
||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||
OTHER_LDFLAGS = $(inherited) -framework "GradientLoadingBar"
|
||||
OTHER_LDFLAGS = $(inherited) -framework "GradientLoadingBar" -framework "LightweightObservable"
|
||||
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
|
||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GradientLoadingBar"
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GradientLoadingBar" "${PODS_CONFIGURATION_BUILD_DIR}/LightweightObservable"
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GradientLoadingBar/GradientLoadingBar.framework/Headers"
|
||||
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GradientLoadingBar/GradientLoadingBar.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/LightweightObservable/LightweightObservable.framework/Headers"
|
||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||
OTHER_LDFLAGS = $(inherited) -framework "GradientLoadingBar"
|
||||
OTHER_LDFLAGS = $(inherited) -framework "GradientLoadingBar" -framework "LightweightObservable"
|
||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GradientLoadingBar"
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GradientLoadingBar" "${PODS_CONFIGURATION_BUILD_DIR}/LightweightObservable"
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GradientLoadingBar/GradientLoadingBar.framework/Headers"
|
||||
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GradientLoadingBar/GradientLoadingBar.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/LightweightObservable/LightweightObservable.framework/Headers"
|
||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||
OTHER_LDFLAGS = $(inherited) -framework "GradientLoadingBar"
|
||||
OTHER_LDFLAGS = $(inherited) -framework "GradientLoadingBar" -framework "LightweightObservable"
|
||||
PODS_BUILD_DIR = ${BUILD_DIR}
|
||||
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
|
||||
|
||||
@@ -39,6 +39,6 @@ Inspired by https://codepen.io/marcobiedermann/pen/LExXWW
|
||||
|
||||
# s.public_header_files = 'Pod/Classes/**/*.h'
|
||||
# s.frameworks = 'UIKit', 'MapKit'
|
||||
# s.dependency 'AFNetworking', '~> 2.3'
|
||||
s.dependency 'LightweightObservable', '~> 1.0'
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user