Skip to content

Commit

Permalink
Remove Extra dependency from AppGuard
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Charles SORIN committed Mar 8, 2018
1 parent 7ab116d commit ac42f49
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 23 deletions.
3 changes: 1 addition & 2 deletions AppGuard.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'AppGuard'
s.version = '0.1.0-beta'
s.version = '0.1.0-beta2'
s.summary = 'AppGuard is a guard for your iOS app, to check / force users to update your app or show what changed.'
s.homepage = 'https://github.com/smartnsoft/AppGuard'
s.license = { :type => 'MIT', :file => 'LICENSE' }
Expand All @@ -18,7 +18,6 @@ Pod::Spec.new do |s|
]

s.frameworks = 'UIKit'
s.dependency 'Extra/UIKit', '~> 1.1'
s.dependency 'Jelly', '~> 1.2'

s.subspec 'FirebaseRemoteConfig' do |sp|
Expand Down
3 changes: 1 addition & 2 deletions AppGuard/Classes/UI/AppGuardUpdateViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
// SOFTWARE.

import UIKit
import Extra

public class AppGuardUpdateViewController: AppGuardViewController, AppGuardable {

Expand Down Expand Up @@ -57,7 +56,7 @@ public class AppGuardUpdateViewController: AppGuardViewController, AppGuardable
for: .normal)
self.ibLaterButton?.setTitleColor(AppGuard.default.graphicContext.laterButtonTitleColor,
for: .normal)
self.ibLaterButton?.setBackgroundImage(AppGuard.default.graphicContext.laterButtonBackgroundColor?.ex.toImage(),
self.ibLaterButton?.setBackgroundImage(AppGuard.default.graphicContext.laterButtonBackgroundColor?.toImage(),
for: .normal)

self.ibLaterButton?.isHidden = (self.coordinator?.contextType == .mandatoryUpdate)
Expand Down
2 changes: 1 addition & 1 deletion AppGuard/Classes/UI/AppGuardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class AppGuardViewController: UIViewController {
for: .normal)
self.ibActionButton?.setTitleColor(AppGuard.default.graphicContext.actionButtonTitleColor,
for: .normal)
self.ibActionButton?.setBackgroundImage(AppGuard.default.graphicContext.actionButtonBackgroundColor?.ex.toImage(),
self.ibActionButton?.setBackgroundImage(AppGuard.default.graphicContext.actionButtonBackgroundColor?.toImage(),
for: .normal)
if AppGuard.default.graphicContext.roundedButton {
self.ibActionButton?.layer.masksToBounds = true
Expand Down
40 changes: 40 additions & 0 deletions AppGuard/Classes/UI/UIColor+AppGuard.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// The MIT License (MIT)
//
// Copyright (c) 2018 Smart&Soft
//
// 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.

// See Extra for more extensions!
// https://github.com/smartnsoft/Extra

import Foundation

extension UIColor {
public func toImage(size: CGSize = CGSize(width: 10, height: 10)) -> UIImage? {

let rect = CGRect(x: 0, y: 0, width: size.width, height: size.height)
UIGraphicsBeginImageContextWithOptions(size, false, 0)
self.setFill()
UIRectFill(rect)

let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return image
}
}
1 change: 1 addition & 0 deletions Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ abstract_target 'AppGuardAbstract' do
pod 'lottie-ios'
pod 'SwiftLint'
pod 'Kingfisher'
pod 'Extra/UIKit'

target 'AppGuard_Example' do
end
Expand Down
31 changes: 15 additions & 16 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
PODS:
- AppGuard (0.1.0):
- AppGuard/FirebaseRemoteConfig (= 0.1.0)
- Extra/UIKit (~> 1.1)
- AppGuard (0.1.0-beta):
- AppGuard/FirebaseRemoteConfig (= 0.1.0-beta)
- Jelly (~> 1.2)
- AppGuard/FirebaseRemoteConfig (0.1.0):
- Extra/UIKit (~> 1.1)
- AppGuard/FirebaseRemoteConfig (0.1.0-beta):
- Firebase/RemoteConfig (~> 4.9)
- Jelly (~> 1.2)
- Extra/UIKit (1.1.1)
- Firebase/Core (4.9.0):
- FirebaseAnalytics (= 4.0.9)
- FirebaseCore (= 4.0.15)
- Firebase/RemoteConfig (4.9.0):
- Firebase/Core (4.10.0):
- FirebaseAnalytics (= 4.1.0)
- FirebaseCore (= 4.0.16)
- Firebase/RemoteConfig (4.10.0):
- Firebase/Core
- FirebaseRemoteConfig (= 2.1.2)
- FirebaseABTesting (1.0.0):
- FirebaseCore (~> 4.0)
- Protobuf (~> 3.1)
- FirebaseAnalytics (4.0.9):
- FirebaseAnalytics (4.1.0):
- FirebaseCore (~> 4.0)
- FirebaseInstanceID (~> 2.0)
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
- nanopb (~> 0.3)
- FirebaseCore (4.0.15):
- FirebaseCore (4.0.16):
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
- FirebaseInstanceID (2.0.9):
- FirebaseCore (~> 4.0)
Expand Down Expand Up @@ -51,6 +49,7 @@ PODS:
DEPENDENCIES:
- AppGuard (from `../`)
- AppGuard/FirebaseRemoteConfig (from `../`)
- Extra/UIKit
- Kingfisher
- lottie-ios
- SwiftDate (~> 4.5.1)
Expand All @@ -61,12 +60,12 @@ EXTERNAL SOURCES:
:path: ../

SPEC CHECKSUMS:
AppGuard: b667a7a536e312f39d35e26f8241bd66aa98d7c0
AppGuard: ced3bca0b917955c21e8923c6ff801d44fdb12a3
Extra: 7c4e5aff4904ecdadc615f63d4c2f0c20910c028
Firebase: 632216af3ed7f31e3be34776947fdc7546cfb572
Firebase: c98c8b1fbcbdccd82539a36c2b17a9b1bb0ee798
FirebaseABTesting: d07d0ee833b842d5153549e4c7e2e2cb1c23a3f9
FirebaseAnalytics: 388b630c15713f5dbf364071f5f3d6077fb52f4e
FirebaseCore: 3bd047463058fa6b5d312c97502c52e45401cdfb
FirebaseAnalytics: 3dfae28d4a5e06f86c4fae830efc2ad3fadb19bc
FirebaseCore: eb9e1a56733ff1094ecf3e28af9069c344b25239
FirebaseInstanceID: d2058a35e9bebda1b6dd42486b84917bde552a9d
FirebaseRemoteConfig: df64ce784a45e9b9d4988030a59da6baede8bdb0
GoogleToolboxForMac: 2501e2ad72a52eb3dfe7bd9aee7dad11b858bd20
Expand All @@ -78,6 +77,6 @@ SPEC CHECKSUMS:
SwiftDate: 7b56d42a221f582047287deb256b23fc5ed49a60
SwiftLint: e14651157288e9e01d6e1a71db7014fb5744a8ea

PODFILE CHECKSUM: 0d7c28d60444d3c3c60d359c6df5ff7b7d328b7e
PODFILE CHECKSUM: 447612fe8a372dd75878fbfac84837f88fc04cbf

COCOAPODS: 1.4.0
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ pod 'AppGuard'

Today we have third parties dependencies, but the purpose is to avoid them the most.

We also wan to have a quick available library and significant customization, we use 3 dependencies:
We also wan to have a quick available library and significant customization, we use one dependency:

- [Extra/UIKit](https://github.com/smartnsoft/Extra): our library to simplify UIKit operation code
- [Jelly](https://github.com/SebastianBoldt/Jelly): a simple UI component to simplify the rating transition display

## Description
Expand Down

0 comments on commit ac42f49

Please sign in to comment.