Skip to content

Instantly share code, notes, and snippets.

@rsaenzi
Last active July 22, 2019 13:58
Show Gist options
  • Select an option

  • Save rsaenzi/fab75dce9d15cd059a499f1ecea51745 to your computer and use it in GitHub Desktop.

Select an option

Save rsaenzi/fab75dce9d15cd059a499f1ecea51745 to your computer and use it in GitHub Desktop.
List of common iOS libraries that can be installed using Cocoapods
#
# podfile
#
# Created by Rigoberto Sáenz Imbacuán (https:#www.linkedin.com/in/rsaenzi/)
# Copyright © 2019. All rights reserved.
#
# Uncomment the next line to define a global platform for your project
platform :ios, '13.0'
# Pods for AppName
target 'AppName' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# ReactiveX
pod 'RxSwift' # , '~> 5'
pod 'RxCocoa' # , '~> 5'
# Networking
pod 'Moya' # , '~> 10'
pod 'ReachabilitySwift' # , '~> 4'
pod 'XMLMapper', '~> 1.5.3'
# Image
pod 'Kingfisher' # , '~> 4'
pod 'ImageViewer' # , '~> 5'
# UI Management
pod 'DZNEmptyDataSet' # , '~> 1'
pod 'SnapKit' # , '~> 4'
pod 'TPKeyboardAvoiding' # , '~> 1'
pod 'TextFieldEffects' # , '~> 1'
pod 'CountryPickerView'
pod 'ActionSheetPicker-3.0'
# Alerts & Animation
pod 'Hero'
pod 'KVNProgress' # , '~> 2'
pod 'NVActivityIndicatorView' # , '~> 4'
# Formatting & Validation
pod 'AKMaskField'
pod 'SwiftMaskTextfield'
pod 'SwiftValidator', :git => 'https://github.com/jpotts18/SwiftValidator.git', :branch => 'master'
# Localization
pod 'PolyglotLocalization'
# Security
pod 'CryptoSwift'
pod 'KeychainAccess' # , '~> 3'
pod 'UAObfuscatedString', :git => 'https://github.com/rsaenzi/UAObfuscatedString.git', :branch => 'master'
# Project Obfuscation: https://github.com/rockbruno/swiftshield
# Crash Reporting
pod 'Fabric'
pod 'Crashlytics'
pod 'SwiftTryCatch', '~> 0.0.1'
# Util
pod 'SwiftLint'
pod 'DeviceKit' # , '~> 1'
# Persistence
pod 'RealmSwift'
pod 'MagicalRecord', '~> 2.3.2'
# Credit Cards
pod 'CardIO'
# Google Services
pod 'Firebase/Core' # , '~> 5.15.0'
pod 'Firebase/Firestore' # , '~> 5.15.0'
pod 'FirebaseUI/Auth' # , '~> 5.2.2'
pod 'FirebaseUI/Google' # , '~> 5.2.2'
pod 'GoogleSignIn' # , '~> 4.4.0'
# Pods for unit testing
target 'AppNameTests' do
inherit! :search_paths
# Reactive
pod 'RxBlocking' # , '~> 4'
pod 'RxTest' # , '~> 4'
# Networking
pod 'OHHTTPStubs' # , '~> 6'
end
# Pods for UI testing
target 'AppNameUITests' do
inherit! :search_paths
# Networking
pod 'OHHTTPStubs' # , '~> 6'
end
# Disable Code Coverage for Pods projects
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['CLANG_ENABLE_CODE_COVERAGE'] = 'NO'
end
end
sharedLibrary = installer.aggregate_targets.find { |aggregate_target| aggregate_target.name == 'Pods-Core' }
installer.aggregate_targets.each do |aggregate_target|
if aggregate_target.name == 'Pods-AppName'
aggregate_target.xcconfigs.each do |config_name, config_file|
sharedLibraryPodTargets = sharedLibrary.pod_targets
aggregate_target.pod_targets.select { |pod_target| sharedLibraryPodTargets.include?(pod_target) }.each do |pod_target|
pod_target.specs.each do |spec|
frameworkPaths = unless spec.attributes_hash['ios'].nil? then spec.attributes_hash['ios']['vendored_frameworks'] else spec.attributes_hash['vendored_frameworks'] end || Set.new
frameworkNames = Array(frameworkPaths).map(&:to_s).map do |filename|
extension = File.extname filename
File.basename filename, extension
end
frameworkNames.each do |name|
puts "Removing #{name} from OTHER_LDFLAGS"
config_file.frameworks.delete(name)
end
end
end
xcconfig_path = aggregate_target.xcconfig_path(config_name)
config_file.save_as(xcconfig_path)
end
end
end
end
post_install do |installer|
project = installer.pods_project
# prevent frameworks which they are already linked with a module from being linked with the main target again
installer.aggregate_targets.each do |target|
project.build_configurations.each do |build_configuration|
configFilePath = target.xcconfig_path(build_configuration.name)
configFile = File.read(configFilePath)
configFile = configFile.gsub(/-framework "Firebase" /, '')
configFile = configFile.gsub(/-framework "FirebaseCore" /, '')
configFile = configFile.gsub(/-framework "FirebaseFirestore" /, '')
File.open(configFilePath, 'w') { |file| file << configFile }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment