diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..a5d6b88 Binary files /dev/null and b/.DS_Store differ diff --git a/README.md b/README.md index 503a8f9..76aff2d 100644 --- a/README.md +++ b/README.md @@ -1 +1,9 @@ -# passion-project \ No newline at end of file +# Grub Monitor + +###Description +Grub Monitor is an iOS app that helps you keep track of your groceries. This will prevent the waste of expired food and give you recipes to utilize soon to be expired food. + +###Basic Functionalities +* add groceries to a list +* get notifications of expired food +* get recipes with ingredients diff --git a/grocery-api/.gitignore b/grocery-api/.gitignore new file mode 100644 index 0000000..050c9d9 --- /dev/null +++ b/grocery-api/.gitignore @@ -0,0 +1,17 @@ +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile '~/.gitignore_global' + +# Ignore bundler config. +/.bundle + +# Ignore the default SQLite database. +/db/*.sqlite3 +/db/*.sqlite3-journal + +# Ignore all logfiles and tempfiles. +/log/* +!/log/.keep +/tmp diff --git a/grocery-api/Gemfile b/grocery-api/Gemfile new file mode 100644 index 0000000..85624d9 --- /dev/null +++ b/grocery-api/Gemfile @@ -0,0 +1,47 @@ +source 'https://rubygems.org' + + +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '4.2.5.1' +# Use sqlite3 as the database for Active Record +gem 'sqlite3' +# Use SCSS for stylesheets +gem 'sass-rails', '~> 5.0' +# Use Uglifier as compressor for JavaScript assets +gem 'uglifier', '>= 1.3.0' +# Use CoffeeScript for .coffee assets and views +gem 'coffee-rails', '~> 4.1.0' +# See https://github.com/rails/execjs#readme for more supported runtimes +# gem 'therubyracer', platforms: :ruby + +# Use jquery as the JavaScript library +gem 'jquery-rails' +# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks +gem 'turbolinks' +# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder +gem 'jbuilder', '~> 2.0' +# bundle exec rake doc:rails generates the API under doc/api. +gem 'sdoc', '~> 0.4.0', group: :doc + +# Use ActiveModel has_secure_password +# gem 'bcrypt', '~> 3.1.7' + +# Use Unicorn as the app server +# gem 'unicorn' + +# Use Capistrano for deployment +# gem 'capistrano-rails', group: :development + +group :development, :test do + # Call 'byebug' anywhere in the code to stop execution and get a debugger console + gem 'byebug' +end + +group :development do + # Access an IRB console on exception pages or by using <%= console %> in views + gem 'web-console', '~> 2.0' + + # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring + gem 'spring' +end + diff --git a/grocery-api/Gemfile.lock b/grocery-api/Gemfile.lock new file mode 100644 index 0000000..5ab2ca9 --- /dev/null +++ b/grocery-api/Gemfile.lock @@ -0,0 +1,159 @@ +GEM + remote: https://rubygems.org/ + specs: + actionmailer (4.2.5.1) + actionpack (= 4.2.5.1) + actionview (= 4.2.5.1) + activejob (= 4.2.5.1) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.5.1) + actionview (= 4.2.5.1) + activesupport (= 4.2.5.1) + rack (~> 1.6) + rack-test (~> 0.6.2) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (4.2.5.1) + activesupport (= 4.2.5.1) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + activejob (4.2.5.1) + activesupport (= 4.2.5.1) + globalid (>= 0.3.0) + activemodel (4.2.5.1) + activesupport (= 4.2.5.1) + builder (~> 3.1) + activerecord (4.2.5.1) + activemodel (= 4.2.5.1) + activesupport (= 4.2.5.1) + arel (~> 6.0) + activesupport (4.2.5.1) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + arel (6.0.3) + binding_of_caller (0.7.2) + debug_inspector (>= 0.0.1) + builder (3.2.2) + byebug (8.2.2) + coffee-rails (4.1.1) + coffee-script (>= 2.2.0) + railties (>= 4.0.0, < 5.1.x) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.10.0) + concurrent-ruby (1.0.0) + debug_inspector (0.0.2) + erubis (2.7.0) + execjs (2.6.0) + globalid (0.3.6) + activesupport (>= 4.1.0) + i18n (0.7.0) + jbuilder (2.4.1) + activesupport (>= 3.0.0, < 5.1) + multi_json (~> 1.2) + jquery-rails (4.1.0) + rails-dom-testing (~> 1.0) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + json (1.8.3) + loofah (2.0.3) + nokogiri (>= 1.5.9) + mail (2.6.3) + mime-types (>= 1.16, < 3) + mime-types (2.99) + mini_portile2 (2.0.0) + minitest (5.8.4) + multi_json (1.11.2) + nokogiri (1.6.7.2) + mini_portile2 (~> 2.0.0.rc2) + rack (1.6.4) + rack-test (0.6.3) + rack (>= 1.0) + rails (4.2.5.1) + actionmailer (= 4.2.5.1) + actionpack (= 4.2.5.1) + actionview (= 4.2.5.1) + activejob (= 4.2.5.1) + activemodel (= 4.2.5.1) + activerecord (= 4.2.5.1) + activesupport (= 4.2.5.1) + bundler (>= 1.3.0, < 2.0) + railties (= 4.2.5.1) + sprockets-rails + rails-deprecated_sanitizer (1.0.3) + activesupport (>= 4.2.0.alpha) + rails-dom-testing (1.0.7) + activesupport (>= 4.2.0.beta, < 5.0) + nokogiri (~> 1.6.0) + rails-deprecated_sanitizer (>= 1.0.1) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) + railties (4.2.5.1) + actionpack (= 4.2.5.1) + activesupport (= 4.2.5.1) + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (10.5.0) + rdoc (4.2.2) + json (~> 1.4) + sass (3.4.21) + sass-rails (5.0.4) + railties (>= 4.0.0, < 5.0) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + sdoc (0.4.1) + json (~> 1.7, >= 1.7.7) + rdoc (~> 4.0) + spring (1.6.3) + sprockets (3.5.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.0.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.3.11) + thor (0.19.1) + thread_safe (0.3.5) + tilt (2.0.2) + turbolinks (2.5.3) + coffee-rails + tzinfo (1.2.2) + thread_safe (~> 0.1) + uglifier (2.7.2) + execjs (>= 0.3.0) + json (>= 1.8.0) + web-console (2.3.0) + activemodel (>= 4.0) + binding_of_caller (>= 0.7.2) + railties (>= 4.0) + sprockets-rails (>= 2.0, < 4.0) + +PLATFORMS + ruby + +DEPENDENCIES + byebug + coffee-rails (~> 4.1.0) + jbuilder (~> 2.0) + jquery-rails + rails (= 4.2.5.1) + sass-rails (~> 5.0) + sdoc (~> 0.4.0) + spring + sqlite3 + turbolinks + uglifier (>= 1.3.0) + web-console (~> 2.0) + +BUNDLED WITH + 1.10.6 diff --git a/grocery-api/README.rdoc b/grocery-api/README.rdoc new file mode 100644 index 0000000..dd4e97e --- /dev/null +++ b/grocery-api/README.rdoc @@ -0,0 +1,28 @@ +== README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... + + +Please feel free to use a different markup language if you do not plan to run +rake doc:app. diff --git a/grocery-api/Rakefile b/grocery-api/Rakefile new file mode 100644 index 0000000..ba6b733 --- /dev/null +++ b/grocery-api/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require File.expand_path('../config/application', __FILE__) + +Rails.application.load_tasks diff --git a/grocery-api/app/assets/images/.keep b/grocery-api/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/grocery-api/app/assets/javascripts/application.js b/grocery-api/app/assets/javascripts/application.js new file mode 100644 index 0000000..e07c5a8 --- /dev/null +++ b/grocery-api/app/assets/javascripts/application.js @@ -0,0 +1,16 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// compiled file. +// +// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details +// about supported directives. +// +//= require jquery +//= require jquery_ujs +//= require turbolinks +//= require_tree . diff --git a/grocery-api/app/assets/javascripts/foods.coffee b/grocery-api/app/assets/javascripts/foods.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/grocery-api/app/assets/javascripts/foods.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/grocery-api/app/assets/stylesheets/application.css b/grocery-api/app/assets/stylesheets/application.css new file mode 100644 index 0000000..f9cd5b3 --- /dev/null +++ b/grocery-api/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any styles + * defined in the other CSS/SCSS files in this directory. It is generally better to create a new + * file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/grocery-api/app/assets/stylesheets/foods.scss b/grocery-api/app/assets/stylesheets/foods.scss new file mode 100644 index 0000000..d792bb1 --- /dev/null +++ b/grocery-api/app/assets/stylesheets/foods.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the foods controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/grocery-api/app/controllers/application_controller.rb b/grocery-api/app/controllers/application_controller.rb new file mode 100644 index 0000000..d83690e --- /dev/null +++ b/grocery-api/app/controllers/application_controller.rb @@ -0,0 +1,5 @@ +class ApplicationController < ActionController::Base + # Prevent CSRF attacks by raising an exception. + # For APIs, you may want to use :null_session instead. + protect_from_forgery with: :exception +end diff --git a/grocery-api/app/controllers/concerns/.keep b/grocery-api/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/grocery-api/app/controllers/foods_controller.rb b/grocery-api/app/controllers/foods_controller.rb new file mode 100644 index 0000000..97b5eaa --- /dev/null +++ b/grocery-api/app/controllers/foods_controller.rb @@ -0,0 +1,5 @@ +class FoodsController < ApplicationController + def index + @foods = Food.all + end +end diff --git a/grocery-api/app/helpers/application_helper.rb b/grocery-api/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/grocery-api/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/grocery-api/app/helpers/foods_helper.rb b/grocery-api/app/helpers/foods_helper.rb new file mode 100644 index 0000000..4bad757 --- /dev/null +++ b/grocery-api/app/helpers/foods_helper.rb @@ -0,0 +1,2 @@ +module FoodsHelper +end diff --git a/grocery-api/app/mailers/.keep b/grocery-api/app/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/grocery-api/app/models/.keep b/grocery-api/app/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/grocery-api/app/models/concerns/.keep b/grocery-api/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/grocery-api/app/models/food.rb b/grocery-api/app/models/food.rb new file mode 100644 index 0000000..3f58467 --- /dev/null +++ b/grocery-api/app/models/food.rb @@ -0,0 +1,2 @@ +class Food < ActiveRecord::Base +end diff --git a/grocery-api/app/views/foods/index.html.erb b/grocery-api/app/views/foods/index.html.erb new file mode 100644 index 0000000..f84ff7e --- /dev/null +++ b/grocery-api/app/views/foods/index.html.erb @@ -0,0 +1,2 @@ +

Foods#index

+

Find me in app/views/foods/index.html.erb

diff --git a/grocery-api/app/views/foods/index.json.jbuilder b/grocery-api/app/views/foods/index.json.jbuilder new file mode 100644 index 0000000..a5d0d32 --- /dev/null +++ b/grocery-api/app/views/foods/index.json.jbuilder @@ -0,0 +1,4 @@ +json.foods @foods do |food| + json.name food.name + json.expiration_date food.duration_seconds.seconds.from_now +end \ No newline at end of file diff --git a/grocery-api/app/views/layouts/application.html.erb b/grocery-api/app/views/layouts/application.html.erb new file mode 100644 index 0000000..501b0be --- /dev/null +++ b/grocery-api/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + GroceryApi + <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> + <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> + <%= csrf_meta_tags %> + + + +<%= yield %> + + + diff --git a/grocery-api/bin/bundle b/grocery-api/bin/bundle new file mode 100755 index 0000000..66e9889 --- /dev/null +++ b/grocery-api/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/grocery-api/bin/rails b/grocery-api/bin/rails new file mode 100755 index 0000000..0138d79 --- /dev/null +++ b/grocery-api/bin/rails @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/grocery-api/bin/rake b/grocery-api/bin/rake new file mode 100755 index 0000000..d87d5f5 --- /dev/null +++ b/grocery-api/bin/rake @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/grocery-api/bin/setup b/grocery-api/bin/setup new file mode 100755 index 0000000..acdb2c1 --- /dev/null +++ b/grocery-api/bin/setup @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +Dir.chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file: + + puts "== Installing dependencies ==" + system "gem install bundler --conservative" + system "bundle check || bundle install" + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # system "cp config/database.yml.sample config/database.yml" + # end + + puts "\n== Preparing database ==" + system "bin/rake db:setup" + + puts "\n== Removing old logs and tempfiles ==" + system "rm -f log/*" + system "rm -rf tmp/cache" + + puts "\n== Restarting application server ==" + system "touch tmp/restart.txt" +end diff --git a/grocery-api/bin/spring b/grocery-api/bin/spring new file mode 100755 index 0000000..62ec28f --- /dev/null +++ b/grocery-api/bin/spring @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby + +# This file loads spring without using Bundler, in order to be fast. +# It gets overwritten when you run the `spring binstub` command. + +unless defined?(Spring) + require 'rubygems' + require 'bundler' + + if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)) + Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq } + gem 'spring', match[1] + require 'spring/binstub' + end +end diff --git a/grocery-api/config.ru b/grocery-api/config.ru new file mode 100644 index 0000000..bd83b25 --- /dev/null +++ b/grocery-api/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run Rails.application diff --git a/grocery-api/config/application.rb b/grocery-api/config/application.rb new file mode 100644 index 0000000..cb70da7 --- /dev/null +++ b/grocery-api/config/application.rb @@ -0,0 +1,26 @@ +require File.expand_path('../boot', __FILE__) + +require 'rails/all' + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module GroceryApi + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + + # Do not swallow errors in after_commit/after_rollback callbacks. + config.active_record.raise_in_transactional_callbacks = true + end +end diff --git a/grocery-api/config/boot.rb b/grocery-api/config/boot.rb new file mode 100644 index 0000000..6b750f0 --- /dev/null +++ b/grocery-api/config/boot.rb @@ -0,0 +1,3 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/grocery-api/config/database.yml b/grocery-api/config/database.yml new file mode 100644 index 0000000..1c1a37c --- /dev/null +++ b/grocery-api/config/database.yml @@ -0,0 +1,25 @@ +# SQLite version 3.x +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem 'sqlite3' +# +default: &default + adapter: sqlite3 + pool: 5 + timeout: 5000 + +development: + <<: *default + database: db/development.sqlite3 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: db/test.sqlite3 + +production: + <<: *default + database: db/production.sqlite3 diff --git a/grocery-api/config/environment.rb b/grocery-api/config/environment.rb new file mode 100644 index 0000000..ee8d90d --- /dev/null +++ b/grocery-api/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require File.expand_path('../application', __FILE__) + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/grocery-api/config/environments/development.rb b/grocery-api/config/environments/development.rb new file mode 100644 index 0000000..b55e214 --- /dev/null +++ b/grocery-api/config/environments/development.rb @@ -0,0 +1,41 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. + config.assets.debug = true + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/grocery-api/config/environments/production.rb b/grocery-api/config/environments/production.rb new file mode 100644 index 0000000..5c1b32e --- /dev/null +++ b/grocery-api/config/environments/production.rb @@ -0,0 +1,79 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Enable Rack::Cache to put a simple HTTP cache in front of your application + # Add `rack-cache` to your Gemfile before enabling this. + # For large-scale production use, consider using a caching reverse proxy like + # NGINX, varnish or squid. + # config.action_dispatch.rack_cache = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? + + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug + + # Prepend all log lines with the following tags. + # config.log_tags = [ :subdomain, :uuid ] + + # Use a different logger for distributed setups. + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/grocery-api/config/environments/test.rb b/grocery-api/config/environments/test.rb new file mode 100644 index 0000000..1c19f08 --- /dev/null +++ b/grocery-api/config/environments/test.rb @@ -0,0 +1,42 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + + # Configure static file server for tests with Cache-Control for performance. + config.serve_static_files = true + config.static_cache_control = 'public, max-age=3600' + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Randomize the order test cases are executed. + config.active_support.test_order = :random + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/grocery-api/config/initializers/assets.rb b/grocery-api/config/initializers/assets.rb new file mode 100644 index 0000000..01ef3e6 --- /dev/null +++ b/grocery-api/config/initializers/assets.rb @@ -0,0 +1,11 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Add additional assets to the asset load path +# Rails.application.config.assets.paths << Emoji.images_path + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. +# Rails.application.config.assets.precompile += %w( search.js ) diff --git a/grocery-api/config/initializers/backtrace_silencers.rb b/grocery-api/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000..59385cd --- /dev/null +++ b/grocery-api/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/grocery-api/config/initializers/cookies_serializer.rb b/grocery-api/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..7f70458 --- /dev/null +++ b/grocery-api/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/grocery-api/config/initializers/filter_parameter_logging.rb b/grocery-api/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..4a994e1 --- /dev/null +++ b/grocery-api/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/grocery-api/config/initializers/inflections.rb b/grocery-api/config/initializers/inflections.rb new file mode 100644 index 0000000..ac033bf --- /dev/null +++ b/grocery-api/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/grocery-api/config/initializers/mime_types.rb b/grocery-api/config/initializers/mime_types.rb new file mode 100644 index 0000000..dc18996 --- /dev/null +++ b/grocery-api/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf diff --git a/grocery-api/config/initializers/session_store.rb b/grocery-api/config/initializers/session_store.rb new file mode 100644 index 0000000..d5c0566 --- /dev/null +++ b/grocery-api/config/initializers/session_store.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.session_store :cookie_store, key: '_grocery-api_session' diff --git a/grocery-api/config/initializers/wrap_parameters.rb b/grocery-api/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..33725e9 --- /dev/null +++ b/grocery-api/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] if respond_to?(:wrap_parameters) +end + +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/grocery-api/config/locales/en.yml b/grocery-api/config/locales/en.yml new file mode 100644 index 0000000..0653957 --- /dev/null +++ b/grocery-api/config/locales/en.yml @@ -0,0 +1,23 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t 'hello' +# +# In views, this is aliased to just `t`: +# +# <%= t('hello') %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more, please read the Rails Internationalization guide +# available at http://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/grocery-api/config/routes.rb b/grocery-api/config/routes.rb new file mode 100644 index 0000000..13b3fbb --- /dev/null +++ b/grocery-api/config/routes.rb @@ -0,0 +1,60 @@ +Rails.application.routes.draw do + #get 'foods/index' + + resources :foods, only: [:index] + + # The priority is based upon order of creation: first created -> highest priority. + # See how all your routes lay out with "rake routes". + + # You can have the root of your site routed with "root" + # root 'welcome#index' + + # Example of regular route: + # get 'products/:id' => 'catalog#view' + + # Example of named route that can be invoked with purchase_url(id: product.id) + # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase + + # Example resource route (maps HTTP verbs to controller actions automatically): + # resources :products + + # Example resource route with options: + # resources :products do + # member do + # get 'short' + # post 'toggle' + # end + # + # collection do + # get 'sold' + # end + # end + + # Example resource route with sub-resources: + # resources :products do + # resources :comments, :sales + # resource :seller + # end + + # Example resource route with more complex sub-resources: + # resources :products do + # resources :comments + # resources :sales do + # get 'recent', on: :collection + # end + # end + + # Example resource route with concerns: + # concern :toggleable do + # post 'toggle' + # end + # resources :posts, concerns: :toggleable + # resources :photos, concerns: :toggleable + + # Example resource route within a namespace: + # namespace :admin do + # # Directs /admin/products/* to Admin::ProductsController + # # (app/controllers/admin/products_controller.rb) + # resources :products + # end +end diff --git a/grocery-api/config/secrets.yml b/grocery-api/config/secrets.yml new file mode 100644 index 0000000..cad3991 --- /dev/null +++ b/grocery-api/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: 89c0d0b93551c4843a7b893907344e91dd3ec4410622e084e1247b2555ddacb34a0b581d4ab567d665e585bba88be927f04e2bf1b98b52d8e2181d597e74d945 + +test: + secret_key_base: 48ae636823ab7e0874900f0b1344b47ea7fe18189c25319ae3c82d2ed07535c4918d451162d349f45d3b6d583a974b0949a0ba178363dd449705fa7d565b37c2 + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/grocery-api/db/migrate/20160215224837_create_foods.rb b/grocery-api/db/migrate/20160215224837_create_foods.rb new file mode 100644 index 0000000..2f766ed --- /dev/null +++ b/grocery-api/db/migrate/20160215224837_create_foods.rb @@ -0,0 +1,10 @@ +class CreateFoods < ActiveRecord::Migration + def change + create_table :foods do |t| + t.string :name + t.integer :duration_seconds + + t.timestamps null: false + end + end +end diff --git a/grocery-api/db/schema.rb b/grocery-api/db/schema.rb new file mode 100644 index 0000000..c0565b8 --- /dev/null +++ b/grocery-api/db/schema.rb @@ -0,0 +1,23 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20160215224837) do + + create_table "foods", force: :cascade do |t| + t.string "name" + t.integer "duration_seconds" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + +end diff --git a/grocery-api/db/seeds.rb b/grocery-api/db/seeds.rb new file mode 100644 index 0000000..6f28840 --- /dev/null +++ b/grocery-api/db/seeds.rb @@ -0,0 +1,17 @@ +# This file should contain all the record creation needed to seed the database with its default values. +# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). +# +# Examples: +# +# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) +# Mayor.create(name: 'Emanuel', city: cities.first) + +Food.delete_all + +Food.create!([ + {id: 1, name: "Banana", duration_seconds: 432000}, + {id: 2, name: "Orange", duration_seconds: 604800}, + {id: 3, name: "Apple", duration_seconds: 172800}, + {id: 4, name: "Kale", duration_seconds: 604800}, + {id: 5, name: "Spinach", duration_seconds: 604800} +]) \ No newline at end of file diff --git a/grocery-api/lib/assets/.keep b/grocery-api/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/grocery-api/lib/tasks/.keep b/grocery-api/lib/tasks/.keep new file mode 100644 index 0000000..e69de29 diff --git a/grocery-api/log/.keep b/grocery-api/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/grocery-api/node_modules/heroku-cli-util/.jshintignore b/grocery-api/node_modules/heroku-cli-util/.jshintignore new file mode 100644 index 0000000..7b2d046 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/.jshintignore @@ -0,0 +1,2 @@ +node_modules +lib/linewrap.js diff --git a/grocery-api/node_modules/heroku-cli-util/.jshintrc b/grocery-api/node_modules/heroku-cli-util/.jshintrc new file mode 100644 index 0000000..fa85849 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/.jshintrc @@ -0,0 +1,38 @@ +{ + "asi": false, + "bitwise": true, + "curly": false, + "eqeqeq": true, + "esnext": true, + "forin": true, + "freeze": true, + "immed": true, + "indent": 2, + "latedef": true, + "laxcomma": true, + "maxcomplexity": 10, + "maxdepth": 5, + "maxparams": 5, + "maxstatements": 25, + "multistr": true, + "newcap": true, + "noarg": true, + "node": true, + "noempty": true, + "nonbsp": true, + "nonew": true, + "trailing": true, + "undef": true, + "unused": true, + "globals": { + "cli": true, + "nock": true + }, + "predef": [ + "afterEach", + "beforeEach", + "describe", + "it", + "sinon" + ] +} diff --git a/grocery-api/node_modules/heroku-cli-util/.npmignore b/grocery-api/node_modules/heroku-cli-util/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/grocery-api/node_modules/heroku-cli-util/LICENSE b/grocery-api/node_modules/heroku-cli-util/LICENSE new file mode 100644 index 0000000..817adf1 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/LICENSE @@ -0,0 +1,3 @@ +Copyright (c) 2015, Heroku +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/grocery-api/node_modules/heroku-cli-util/README.md b/grocery-api/node_modules/heroku-cli-util/README.md new file mode 100644 index 0000000..0a819bb --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/README.md @@ -0,0 +1,263 @@ +# heroku-cli-util + +[![Circle CI](https://circleci.com/gh/heroku/heroku-cli-util/tree/master.svg?style=svg)](https://circleci.com/gh/heroku/heroku-cli-util/tree/master) +[![npm version](https://badge.fury.io/js/heroku-cli-util.svg)](http://badge.fury.io/js/heroku-cli-util) +[![License](https://img.shields.io/npm/l/heroku-cli-util.svg)](./LICENSE) +[![Inline docs](http://inch-ci.org/github/heroku/heroku-cli-util.svg?branch=master)](http://inch-ci.org/github/heroku/heroku-cli-util) + +Set of helpful CLI utilities + +## Installation + +```sh +npm install heroku-cli-util --save +``` + +## Action + +```js +let cli = require('heroku-cli-util'); +let promise = heroku.apps(appname).info(); +let app = yield cli.action('getting apps', promise); +console.log(`app name: ${app.name}`); + +// getting apps... done +// app name: appname +``` + +Note: to use `yield` you need to wrap this in a [co](https://github.com/tj/co) block. + +## Prompt + +Callback style + +```js +let cli = require('heroku-cli-util'); +cli.prompt('email', {}, function (_, email) { + console.log(`your email is: ${email}`); +}); +``` + +Promise style + +```js +let cli = require('heroku-cli-util'); +cli.prompt('email', {}).then(function (email) { + console.log(`your email is: ${email}`); +}); +``` + +Generator style (must be wrapped in a [co](https://github.com/tj/co) block) + +```js +let cli = require('heroku-cli-util'); +let email = yield cli.prompt('email', {}); +console.log(`your email is: ${email}`); +``` + +**cli.prompt options** + +```js +cli.prompt('email', { + mask: true, // mask input field after submitting + hide: true // mask characters while entering +}); +``` + +## Confirm App + +Supports the same async styles as `prompt()`. Errors if not confirmed. + +Basic + +```js +let cli = require('heroku-cli-util'); +yield cli.confirmApp('appname', context.flags.confirm); + +// ! WARNING: Destructive Action +// ! This command will affect the app appname +// ! To proceed, type appname or re-run this command with --confirm appname + +> appname +``` + +Custom message + +```js +let cli = require('heroku-cli-util'); +yield cli.confirmApp('appname', context.flags.confirm, 'foo'); + +// ! foo +// ! To proceed, type appname or re-run this command with --confirm appname + +> appname +``` + +## Errors + +```js +let cli = require('heroku-cli-util'); +cli.error("App not found"); +// ! App not found +``` + +## Warnings + +```js +let cli = require('heroku-cli-util'); +cli.warn("App not found"); +// ! App not found +``` + +## Dates + +```js +let cli = require('heroku-cli-util'); +let d = new Date(); +console.log(cli.formatDate(d)); +// 2001-01-01T08:00:00.000Z +``` + +## Hush + +Use hush for verbose logging when `HEROKU_DEBUG=1`. + +```js +let cli = require('heroku-cli-util'); +cli.hush('foo'); +// only prints if HEROKU_DEBUG is set +``` + +## Debug + +Pretty print an object. + +```js +let cli = require('heroku-cli-util'); +cli.debug({foo: [1,2,3]}); +// { foo: [ 1, 2, 3 ] } +``` + +## Stylized output + +Pretty print a header and hash +```js +let cli = require('heroku-cli-util'); +cli.styledHeader("MyApp"); +cli.styledHash({name: "myapp", collaborators: ["user1@example.com", "user2@example.com"]}); +``` + +Produces + +``` +=== MyApp +Collaborators: user1@example.com + user1@example.com +Name: myapp +``` + +## Table + +```js +cli.table([ + {app: 'first-app', language: 'ruby', dyno_count: 3}, + {app: 'second-app', language: 'node', dyno_count: 2}, +], { + columns: [ + {key: 'app'}, + {key: 'dyno_count', label: 'Dyno Count'}, + {key: 'language', format: language => cli.color.red(language)}, + ] +}); +``` + +Produces: + +``` +app Dyno Count language +────────── ────────── ──────── +first-app 3 ruby +second-app 2 node +``` + +## Open Web Browser + +```js +yield cli.open('https://github.com'); +``` + +## Mocking + +Mock stdout and stderr by using `cli.log()` and `cli.error()`. + +```js +let cli = require('heroku-cli-util'); +cli.log('message 1'); // prints 'message 1' +cli.mockConsole(); +cli.log('message 2'); // prints nothing +cli.stdout.should.eq('message 2\n'); +``` + +## Command + +Used for initializing a plugin command. +give you an auth'ed instance of `heroku-client` and cleanly handle API exceptions. + +It expects you to return a promise chain. This is usually done with [co](https://github.com/tj/co). + +```js +let cli = require('heroku-cli-util'); +let co = require('co'); +module.exports.commands = [ + { + topic: 'apps', + command: 'info', + needsAuth: true, + needsApp: true, + run: cli.command(function (context, heroku) { + return co(function* () { + let app = yield heroku.apps(context.app).info(); + console.dir(app); + }); + }) + } +]; +``` + +With options: + +```js +let cli = require('heroku-cli-util'); +let co = require('co'); +module.exports.commands = [ + { + topic: 'apps', + command: 'info', + needsAuth: true, + needsApp: true, + run: cli.command( + {preauth: true}, + function (context, heroku) { + return co(function* () { + let app = yield heroku.apps(context.app).info(); + console.dir(app); + }); + } + ) + } +]; +``` + +If the command has a `two_factor` API error, it will ask the user for a 2fa code and retry. +If you set `preauth: true` it will preauth against the current app instead of just setting the header on an app. (This is necessary if you need to do more than 1 API call that will require 2fa) + +## Tests + +```sh +npm install +npm test +``` + +## License + +ISC diff --git a/grocery-api/node_modules/heroku-cli-util/circle.yml b/grocery-api/node_modules/heroku-cli-util/circle.yml new file mode 100644 index 0000000..7d7725c --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/circle.yml @@ -0,0 +1,3 @@ +machine: + node: + version: 5.0.0 diff --git a/grocery-api/node_modules/heroku-cli-util/index.js b/grocery-api/node_modules/heroku-cli-util/index.js new file mode 100644 index 0000000..37f4163 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/index.js @@ -0,0 +1,32 @@ +'use strict'; +var console = require('./lib/console'); +var errors = require('./lib/errors'); +var prompt = require('./lib/prompt'); +var styled = require('./lib/styled'); + +exports.hush = console.hush; +exports.log = console.log.bind(console); +exports.formatDate = require('./lib/date').formatDate; +exports.error = errors.error; +exports.warn = errors.warn; +exports.errorHandler = errors.errorHandler; +exports.console = console; +exports.yubikey = require('./lib/yubikey'); +exports.prompt = prompt.prompt; +exports.confirmApp = prompt.confirmApp; +exports.preauth = require('./lib/preauth'); +exports.command = require('./lib/command'); +exports.color = require('./lib/color'); +exports.action = require('./lib/action'); +exports.extend = require('./lib/extend'); +exports.debug = console.debug; +exports.mockConsole = console.mock; +exports.table = require('./lib/table'); +exports.stdout = ''; +exports.stderr = ''; +exports.styledHeader = styled.styledHeader; +exports.styledObject = styled.styledObject; +exports.styledHash = styled.styledObject; +exports.styledNameValues = styled.styledNameValues; +exports.rollbar = require('./lib/rollbar'); +exports.open = require('./lib/open'); diff --git a/grocery-api/node_modules/heroku-cli-util/lib/action.js b/grocery-api/node_modules/heroku-cli-util/lib/action.js new file mode 100644 index 0000000..29210db --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/lib/action.js @@ -0,0 +1,28 @@ +'use strict'; + +let cli = require('..'); + +function action (message, options, promise) { + if (options.then) { + let swap = promise; + promise = options; + options = swap; + } + options = options || {}; + cli.console.writeError(message + '... '); + return promise.then(function (result) { + if (options.success !== false) { + cli.console.error(options.success || 'done'); + } + return result; + }).catch(function (err) { + if (err.body && err.body.id === 'two_factor') { + cli.console.error(cli.color.yellow.bold('!')); + } else { + cli.console.error(cli.color.red.bold('!!!')); + } + throw err; + }); +} + +module.exports = action; diff --git a/grocery-api/node_modules/heroku-cli-util/lib/color.js b/grocery-api/node_modules/heroku-cli-util/lib/color.js new file mode 100644 index 0000000..1d98ff6 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/lib/color.js @@ -0,0 +1,22 @@ +'use strict'; + +let _ = require('lodash'); +let chalk = require('chalk'); + +let colors = { + app: 'cyan', + attachment: 'green', + addon: 'magenta', +}; + +let definedColors = _.pickBy(colors, function(value) { + return typeof(chalk[value]) === 'function'; +}); + +let boundColors = _.mapValues(definedColors, function(value) { + return function(s) { + return chalk[value](s); + }; +}); + +module.exports = Object.assign(chalk, boundColors); diff --git a/grocery-api/node_modules/heroku-cli-util/lib/command.js b/grocery-api/node_modules/heroku-cli-util/lib/command.js new file mode 100644 index 0000000..bd45d89 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/lib/command.js @@ -0,0 +1,146 @@ +'use strict'; + +let co = require('co'); +let Heroku = require('heroku-client'); +let cli = require('..'); +let url = require('url'); +let spawn = require('child_process').spawn; +let exec = require('child_process').exec; + +function apiMiddleware (response, cb) { + let warning = response.headers['warning-message']; + if (warning) cli.warn(warning); + cb(); +} + +function heroku (context) { + let host = context.apiUrl || 'https://api.heroku.com'; + let opts = { + userAgent: context.version, + debug: context.debug, + debugHeaders: context.debugHeaders, + token: context.auth ? context.auth.password : null, + host: host, + headers: {}, + rejectUnauthorized: !(process.env.HEROKU_SSL_VERIFY === 'disable' || host.endsWith('herokudev.com')), + middleware: apiMiddleware, + }; + if (process.env.HEROKU_HEADERS) { + opts.headers = cli.extend(opts.headers, JSON.parse(process.env.HEROKU_HEADERS)); + } + if (context.secondFactor) { + opts.headers = cli.extend(opts.headers, {'Heroku-Two-Factor-Code': context.secondFactor}); + } + if (context.reason) { + opts.headers = cli.extend(opts.headers, {'X-Heroku-Sudo-Reason': context.reason}); + } + return new Heroku(opts); +} + +let httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy; + +function setupHttpProxy() { + cli.hush(`proxy set to ${httpsProxy}`); + let proxy = url.parse(httpsProxy); + process.env.HEROKU_HTTP_PROXY_HOST = proxy.hostname; + process.env.HEROKU_HTTP_PROXY_PORT = proxy.port; +} + +function errHandlerOpts (rollbar, context) { + rollbar = rollbar || {}; + let cmd = null; + if (context.command) cmd = context.command.command ? `${context.command.topic}:${context.command.command}` : context.command.topic; + return { + debug: context.debug, + dev: context.dev, + logPath: context.herokuDir ? context.herokuDir+'/error.log' : null, + rollbar: cli.rollbar(rollbar.cred, { + version: context.version, + context: cmd, + }) + }; +} + +function login () { + return new Promise(function (fulfill, error) { + spawn('heroku', ['login'], {stdio: 'inherit'}) + .on('close', function (e) { + if (e === 0) fulfill(); + else error(new Error('Authorization failed.')); + }); + }); +} + +function getNewAPIKey () { + return new Promise(function (fulfill, reject) { + exec('heroku auth:token', function (error, stdout, stderr) { + if (stderr) console.error(stderr); + if (error) reject(error); + fulfill(stdout.trim()); + }); + }); +} + +function relogin () { + if (process.env.HEROKU_API_KEY) { + cli.error(`API key is currently set by the HEROKU_API_KEY environment variable. +Ensure this is set to a correct value or unset it to use the netrc file.`); + process.exit(1); + } + return login().then(getNewAPIKey); +} + +function twoFactorPrompt(options, context) { + cli.yubikey.enable(); + return cli.prompt('Two-factor code', {mask: true}) + .then(function (secondFactor) { + cli.yubikey.disable(); + return secondFactor; + }) + .then(function (secondFactor) { + if (options.preauth) { + return cli.preauth(context.app, heroku(context), secondFactor); + } else { + context.secondFactor = secondFactor; + } + }); +} + +function reasonPrompt(context) { + return cli.prompt('Reason') + .then(function (reason) { + context.reason = reason; + }); +} + +module.exports = function command (options, fn) { + return function (context) { + if (typeof options === 'function') { + fn = options; + options = {}; + } + if (httpsProxy) { setupHttpProxy(); } + cli.color.enabled = context.supportsColor; + let handleErr = cli.errorHandler(errHandlerOpts(options.rollbar, context)); + let run = function () { + return co.wrap(fn)(context, heroku(context)) + .catch(function (err) { + if (err && err.body && err.body.id === 'unauthorized') { + cli.error(err.body.message || 'Unauthorized'); + relogin() + .then(apiKey => context.auth = {password: apiKey}) + .then(run) + .catch(handleErr); + } + else if (err && err.body && err.body.id === 'sudo_reason_required') { + cli.warn(err.body.message); + reasonPrompt(context).then(run).catch(handleErr); + } + else if (err && err.body && err.body.id === 'two_factor') { + twoFactorPrompt(options, context).then(run).catch(handleErr); + } else throw err; + }).catch(handleErr); + }; + return run(); + }; +}; diff --git a/grocery-api/node_modules/heroku-cli-util/lib/console.js b/grocery-api/node_modules/heroku-cli-util/lib/console.js new file mode 100644 index 0000000..cd80d82 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/lib/console.js @@ -0,0 +1,99 @@ +'use strict'; + +var cli = require('..'); + +var mocking; + +function concatArguments(args) { + return Array.prototype.map.call(args, function(arg) { + return arg + ''; + }).join(' '); +} + +/** + * log is a wrapper for console.log() but can be mocked + * + * @param {...Object} obj - objects to be printed to stdout + */ +function log () { + if (mocking) { + cli.stdout += concatArguments(arguments) + '\n'; + } else { + console.log.apply(null, arguments); + } +} + +/** + * writeLog is a wrapper for process.stdout.write() but can be mocked + * + * @param {...Object} obj - objects to be printed to stdout + */ +function writeLog () { + if (mocking) { + cli.stdout += concatArguments(arguments); + } else { + process.stdout.write.apply(process.stdout, arguments); + } +} + +function hush () { + let debug = process.env.HEROKU_DEBUG; + if (debug && (debug === '1' || debug.toUpperCase() === 'TRUE')) { + console.error.apply(null, arguments); + } +} + +/** + * error is a wrapper for console.error() but can be mocked + * + * @param {...Object} obj - objects to be printed to stderr + */ +function error () { + if (mocking) { + cli.stderr += concatArguments(arguments) + '\n'; + } else { + console.error.apply(null, arguments); + } +} + +/** + * writeError is a wrapper for process.stderr.write() but can be mocked + * + * @param {...Object} obj - objects to be printed to stderr + */ +function writeError () { + if (mocking) { + cli.stderr += concatArguments(arguments); + } else { + process.stderr.write.apply(process.stderr, arguments); + } +} + +/** + * mock will make {@link log} and {@link error} + * stop printing to stdout and stderr and start writing to the + * stdout and stderr strings. + */ +function mock () { + mocking = true; + cli.stderr = ''; + cli.stdout = ''; +} + +/** + * debug pretty prints an object. + * It simply calls console.dir with color enabled. + * + * @param {Object} obj - object to be printed + */ +function debug (obj) { + console.dir(obj, {colors: true}); +} + +exports.hush = hush; +exports.log = log; +exports.writeLog = writeLog; +exports.error = error; +exports.writeError = writeError; +exports.mock = mock; +exports.debug = debug; diff --git a/grocery-api/node_modules/heroku-cli-util/lib/date.js b/grocery-api/node_modules/heroku-cli-util/lib/date.js new file mode 100644 index 0000000..67d24d5 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/lib/date.js @@ -0,0 +1,18 @@ +'use strict'; + +/** + * formatDate will format a date in a standard Heroku format + * + * @example + * let cli = require('heroku-cli-util'); + * var d = new Date(); + * cli.formatDate(d); // '2015-05-14T18:03:10.034Z' + * + * @param {Date} date the date to format + * @return {String} string representing the date + */ +function formatDate (date) { + return date.toISOString(); +} + +exports.formatDate = formatDate; diff --git a/grocery-api/node_modules/heroku-cli-util/lib/errors.js b/grocery-api/node_modules/heroku-cli-util/lib/errors.js new file mode 100644 index 0000000..930ebed --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/lib/errors.js @@ -0,0 +1,102 @@ +'use strict'; + +let cli = require('..'); +let console = require('./console'); +let linewrap = require('./linewrap'); + +function errtermwidth() { + if (!process.stderr.isTTY) return 80; + return process.stderr.getWindowSize()[0]; +} + +function wrap (msg) { + return linewrap(6, + errtermwidth(), { + skipScheme: 'ansi-color' + })(msg || ''); +} + +function bangify (msg, c) { + let lines = msg.split('\n'); + for(let i=0; i]*)>/gi; +var lineBreakSchemeMap = { + 'unix': [/\n/g, '\n'], + 'dos': [/\r\n/g, '\r\n'], + 'mac': [/\r/g, '\r'], + 'html': [brPat, '
'], + 'xhtml': [brPat, '
'] +}; + +// skip Schemes +var skipSchemeMap = { + 'ansi-color': /\x1B\[[^m]*m/g, + 'html': /<[^>]*>/g, + 'bbcode': /\[[^]]*\]/g +}; + +var modeMap = { + 'soft': 1, + 'hard': 1 +}; + +var wsMap = { + 'collapse': 1, + 'default': 1, + 'line': 1, + 'all': 1 +}; + +var rlbMap = { + 'all': 1, + 'multi': 1, + 'none': 1 +}; +var rlbSMPat = /([sm])(\d+)/; + +var escapePat = /[-/\\^$*+?.()|[\]{}]/g; +function escapeRegExp(s) { + return s.replace(escapePat, '\\$&'); +} + +var linewrap = module.exports = function (start, stop, params) { + if (typeof start === 'object') { + params = start; + start = params.start; + stop = params.stop; + } + + if (typeof stop === 'object') { + params = stop; + start = start || params.start; + stop = undefined; + } + + if (!stop) { + stop = start; + start = 0; + } + + if (!params) { params = {}; } + // Supported options and default values. + var preset, + mode = 'soft', + whitespace = 'default', + tabWidth = 4, + skip, skipScheme, lineBreak, lineBreakScheme, + respectLineBreaks = 'all', + respectNum, + preservedLineIndent, + wrapLineIndent, wrapLineIndentBase; + + var skipPat; + var lineBreakPat, lineBreakStr; + var multiLineBreakPat; + var preservedLinePrefix = ''; + var wrapLineIndentPat, wrapLineInitPrefix = ''; + var tabRepl; + var item, flags; + var i; + + // First process presets, because these settings can be overwritten later. + preset = params.preset; + if (preset) { + if (!(preset instanceof Array)) { + preset = [preset]; + } + for (i = 0; i < preset.length; i++) { + item = presetMap[preset[i]]; + if (item) { + if (item.mode) { + mode = item.mode; + } + if (item.whitespace) { + whitespace = item.whitespace; + } + if (item.tabWidth !== undefined) { + tabWidth = item.tabWidth; + } + if (item.skip) { + skip = item.skip; + } + if (item.skipScheme) { + skipScheme = item.skipScheme; + } + if (item.lineBreak) { + lineBreak = item.lineBreak; + } + if (item.lineBreakScheme) { + lineBreakScheme = item.lineBreakScheme; + } + if (item.respectLineBreaks) { + respectLineBreaks = item.respectLineBreaks; + } + if (item.preservedLineIndent !== undefined) { + preservedLineIndent = item.preservedLineIndent; + } + if (item.wrapLineIndent !== undefined) { + wrapLineIndent = item.wrapLineIndent; + } + if (item.wrapLineIndentBase) { + wrapLineIndentBase = item.wrapLineIndentBase; + } + } else { + throw new TypeError('preset must be one of "' + Object.keys(presetMap).join('", "') + '"'); + } + } + } + + if (params.mode) { + if (modeMap[params.mode]) { + mode = params.mode; + } else { + throw new TypeError('mode must be one of "' + Object.keys(modeMap).join('", "') + '"'); + } + } + // Available options: 'collapse', 'default', 'line', and 'all' + if (params.whitespace) { + if (wsMap[params.whitespace]) { + whitespace = params.whitespace; + } else { + throw new TypeError('whitespace must be one of "' + Object.keys(wsMap).join('", "') + '"'); + } + } + + if (params.tabWidth !== undefined) { + if (parseInt(params.tabWidth, 10) >= 0) { + tabWidth = parseInt(params.tabWidth, 10); + } else { + throw new TypeError('tabWidth must be a non-negative integer'); + } + } + tabRepl = new Array(tabWidth + 1).join(' '); + + // Available options: 'all', 'multi', 'm\d+', 's\d+', 'none' + if (params.respectLineBreaks) { + if (rlbMap[params.respectLineBreaks] || rlbSMPat.test(params.respectLineBreaks)) { + respectLineBreaks = params.respectLineBreaks; + } else { + throw new TypeError('respectLineBreaks must be one of "' + Object.keys(rlbMap).join('", "') + + '", "m", "s"'); + } + } + // After these conversions, now we have 4 options in `respectLineBreaks`: + // 'all', 'none', 'm' and 's'. + // `respectNum` is applicable iff `respectLineBreaks` is either 'm' or 's'. + if (respectLineBreaks === 'multi') { + respectLineBreaks = 'm'; + respectNum = 2; + } else if (!rlbMap[respectLineBreaks]) { + var match = rlbSMPat.exec(respectLineBreaks); + respectLineBreaks = match[1]; + respectNum = parseInt(match[2], 10); + } + + if (params.preservedLineIndent !== undefined) { + if (parseInt(params.preservedLineIndent, 10) >= 0) { + preservedLineIndent = parseInt(params.preservedLineIndent, 10); + } else { + throw new TypeError('preservedLineIndent must be a non-negative integer'); + } + } + + if (preservedLineIndent > 0) { + preservedLinePrefix = new Array(preservedLineIndent + 1).join(' '); + } + + if (params.wrapLineIndent !== undefined) { + if (!isNaN(parseInt(params.wrapLineIndent, 10))) { + wrapLineIndent = parseInt(params.wrapLineIndent, 10); + } else { + throw new TypeError('wrapLineIndent must be an integer'); + } + } + if (params.wrapLineIndentBase) { + wrapLineIndentBase = params.wrapLineIndentBase; + } + + if (wrapLineIndentBase) { + if (wrapLineIndent === undefined) { + throw new TypeError('wrapLineIndent must be specified when wrapLineIndentBase is specified'); + } + if (wrapLineIndentBase instanceof RegExp) { + wrapLineIndentPat = wrapLineIndentBase; + } else if (typeof wrapLineIndentBase === 'string') { + wrapLineIndentPat = new RegExp(escapeRegExp(wrapLineIndentBase)); + } else { + throw new TypeError('wrapLineIndentBase must be either a RegExp object or a string'); + } + } else if (wrapLineIndent > 0) { + wrapLineInitPrefix = new Array(wrapLineIndent + 1).join(' '); + } else if (wrapLineIndent < 0) { + throw new TypeError('wrapLineIndent must be non-negative when a base is not specified'); + } + + // NOTE: For the two RegExps `skipPat` and `lineBreakPat` that can be specified + // by the user: + // 1. We require them to be "global", so we have to convert them to global + // if the user specifies a non-global regex. + // 2. We cannot call `split()` on them, because they may or may not contain + // capturing parentheses which affect the output of `split()`. + + // Precedence: Regex = Str > Scheme + if (params.skipScheme) { + if (skipSchemeMap[params.skipScheme]) { + skipScheme = params.skipScheme; + } else { + throw new TypeError('skipScheme must be one of "' + Object.keys(skipSchemeMap).join('", "') + '"'); + } + } + if (params.skip) { + skip = params.skip; + } + + if (skip) { + if (skip instanceof RegExp) { + skipPat = skip; + if (!skipPat.global) { + flags = 'g'; + if (skipPat.ignoreCase) { flags += 'i'; } + if (skipPat.multiline) { flags += 'm'; } + skipPat = new RegExp(skipPat.source, flags); + } + } else if (typeof skip === 'string') { + skipPat = new RegExp(escapeRegExp(skip), 'g'); + } else { + throw new TypeError('skip must be either a RegExp object or a string'); + } + } + if (!skipPat && skipScheme) { + skipPat = skipSchemeMap[skipScheme]; + } + + // Precedence: + // - for lineBreakPat: Regex > Scheme > Str + // - for lineBreakStr: Str > Scheme > Regex + if (params.lineBreakScheme) { + if (lineBreakSchemeMap[params.lineBreakScheme]) { + lineBreakScheme = params.lineBreakScheme; + } else { + throw new TypeError('lineBreakScheme must be one of "' + Object.keys(lineBreakSchemeMap).join('", "') + '"'); + } + } + if (params.lineBreak) { + lineBreak = params.lineBreak; + } + + if (lineBreakScheme) { + // Supported schemes: 'unix', 'dos', 'mac', 'html', 'xhtml' + item = lineBreakSchemeMap[lineBreakScheme]; + if (item) { + lineBreakPat = item[0]; + lineBreakStr = item[1]; + } + } + if (lineBreak) { + if (lineBreak instanceof Array) { + if (lineBreak.length === 1) { + lineBreak = lineBreak[0]; + } else if (lineBreak.length >= 2) { + if (lineBreak[0] instanceof RegExp) { + lineBreakPat = lineBreak[0]; + if (typeof lineBreak[1] === 'string') { + lineBreakStr = lineBreak[1]; + } + } else if (lineBreak[1] instanceof RegExp) { + lineBreakPat = lineBreak[1]; + if (typeof lineBreak[0] === 'string') { + lineBreakStr = lineBreak[0]; + } + } else if (typeof lineBreak[0] === 'string' && typeof lineBreak[1] === 'string') { + lineBreakPat = new RegExp(escapeRegExp(lineBreak[0]), 'g'); + lineBreakStr = lineBreak[1]; + } else { + lineBreak = lineBreak[0]; + } + } + } + if (typeof lineBreak === 'string') { + lineBreakStr = lineBreak; + if (!lineBreakPat) { + lineBreakPat = new RegExp(escapeRegExp(lineBreak), 'g'); + } + } else if (lineBreak instanceof RegExp) { + lineBreakPat = lineBreak; + } else if (!(lineBreak instanceof Array)) { + throw new TypeError('lineBreak must be a RegExp object, a string, or an array consisted of a RegExp object and a string'); + } + } + // Only assign defaults when `lineBreakPat` is not assigned. + // So if `params.lineBreak` is a RegExp, we don't have a value in `lineBreakStr` + // yet. We will try to get the value from the input string, and if failed, we + // will throw an exception. + if (!lineBreakPat) { + lineBreakPat = /\n/g; + lineBreakStr = '\n'; + } + + // Create `multiLineBreakPat` based on `lineBreakPat`, that matches strings + // consisted of one or more line breaks and zero or more whitespaces. + // Also convert `lineBreakPat` to global if not already so. + flags = 'g'; + if (lineBreakPat.ignoreCase) { flags += 'i'; } + if (lineBreakPat.multiline) { flags += 'm'; } + multiLineBreakPat = new RegExp('\\s*(?:' + lineBreakPat.source + ')(?:' + + lineBreakPat.source + '|\\s)*', flags); + if (!lineBreakPat.global) { + lineBreakPat = new RegExp(lineBreakPat.source, flags); + } + + // Initialize other useful variables. + var re = mode === 'hard' ? /\b/ : /(\S+\s+)/; + var prefix = new Array(start + 1).join(' '); + var wsStrip = (whitespace === 'default' || whitespace === 'collapse'), + wsCollapse = (whitespace === 'collapse'), + wsLine = (whitespace === 'line'), + wsAll = (whitespace === 'all'); + var tabPat = /\t/g, + collapsePat = / +/g, + pPat = /^\s+/, + tPat = /\s+$/, + nonWsPat = /\S/, + wsPat = /\s/; + var wrapLen = stop - start; + + return function (text) { + text = text.toString().replace(tabPat, tabRepl); + + var match; + if (!lineBreakStr) { + // Try to get lineBreakStr from `text` + lineBreakPat.lastIndex = 0; + match = lineBreakPat.exec(text); + if (match) { + lineBreakStr = match[0]; + } else { + throw new TypeError('Line break string for the output not specified'); + } + } + + // text -> blocks; each bloc -> segments; each segment -> chunks + var blocks, base = 0; + var mo, arr, b, res; + // Split `text` by line breaks. + blocks = []; + multiLineBreakPat.lastIndex = 0; + match = multiLineBreakPat.exec(text); + while(match) { + blocks.push(text.substring(base, match.index)); + + if (respectLineBreaks !== 'none') { + arr = []; + b = 0; + lineBreakPat.lastIndex = 0; + mo = lineBreakPat.exec(match[0]); + while(mo) { + arr.push(match[0].substring(b, mo.index)); + b = mo.index + mo[0].length; + mo = lineBreakPat.exec(match[0]); + } + arr.push(match[0].substring(b)); + blocks.push({type: 'break', breaks: arr}); + } else { + // Strip line breaks and insert spaces when necessary. + if (wsCollapse) { + res = ' '; + } else { + res = match[0].replace(lineBreakPat, ''); + } + blocks.push({type: 'break', remaining: res}); + } + + base = match.index + match[0].length; + match = multiLineBreakPat.exec(text); + } + blocks.push(text.substring(base)); + + var i, j, k; + var segments; + if (skipPat) { + segments = []; + for (i = 0; i < blocks.length; i++) { + var bloc = blocks[i]; + if (typeof bloc !== 'string') { + // This is an object. + segments.push(bloc); + } else { + base = 0; + skipPat.lastIndex = 0; + match = skipPat.exec(bloc); + while(match) { + segments.push(bloc.substring(base, match.index)); + segments.push({type: 'skip', value: match[0]}); + base = match.index + match[0].length; + match = skipPat.exec(bloc); + } + segments.push(bloc.substring(base)); + } + } + } else { + segments = blocks; + } + + var chunks = []; + for (i = 0; i < segments.length; i++) { + var segment = segments[i]; + if (typeof segment !== 'string') { + // This is an object. + chunks.push(segment); + } else { + if (wsCollapse) { + segment = segment.replace(collapsePat, ' '); + } + + var parts = segment.split(re), + acc = []; + + for (j = 0; j < parts.length; j++) { + var x = parts[j]; + if (mode === 'hard') { + for (k = 0; k < x.length; k += wrapLen) { + acc.push(x.slice(k, k + wrapLen)); + } + } + else { acc.push(x); } + } + chunks = chunks.concat(acc); + } + } + + var curLine = 0, + curLineLength = start + preservedLinePrefix.length, + lines = [ prefix + preservedLinePrefix ], + // Holds the "real length" (excluding trailing whitespaces) of the + // current line if it exceeds `stop`, otherwise 0. + // ONLY USED when `wsAll` is true, in `finishOffCurLine()`. + bulge = 0, + // `cleanLine` is true iff we are at the beginning of an output line. By + // "beginning" we mean it doesn't contain any non-whitespace char yet. + // But its `curLineLength` can be greater than `start`, or even possibly + // be greater than `stop`, if `wsStrip` is false. + // + // Note that a "clean" line can still contain skip strings, in addition + // to whitespaces. + // + // This variable is used to allow us strip preceding whitespaces when + // `wsStrip` is true, or `wsLine` is true and `preservedLine` is false. + cleanLine = true, + // `preservedLine` is true iff we are in a preserved input line. + // + // It's used when `wsLine` is true to (combined with `cleanLine`) decide + // whether a whitespace is at the beginning of a preserved input line and + // should not be stripped. + preservedLine = true, + // The current indent prefix for wrapped lines. + wrapLinePrefix = wrapLineInitPrefix, + remnant; + + // Always returns '' if `beforeHardBreak` is true. + // + // Assumption: Each call of this function is always followed by a `lines.push()` call. + // + // This function can change the status of `cleanLine`, but we don't modify the value of + // `cleanLine` in this function. It's fine because `cleanLine` will be set to the correct + // value after the `lines.push()` call following this function call. We also don't update + // `curLineLength` when pushing a new line and it's safe for the same reason. + function finishOffCurLine(beforeHardBreak) { + var str = lines[curLine], + idx, ln, rBase; + + if (!wsAll) { + // Strip all trailing whitespaces past `start`. + idx = str.length - 1; + while (idx >= start && str[idx] === ' ') { idx--; } + while (idx >= start && wsPat.test(str[idx])) { idx--; } + idx++; + + if (idx !== str.length) { + lines[curLine] = str.substring(0, idx); + } + + if (preservedLine && cleanLine && wsLine && curLineLength > stop) { + // Add the remnants to the next line, just like when `wsAll` is true. + rBase = str.length - (curLineLength - stop); + if (rBase < idx) { + // We didn't reach `stop` when stripping due to a bulge. + rBase = idx; + } + } + } else { + // Strip trailing whitespaces exceeding stop. + if (curLineLength > stop) { + bulge = bulge || stop; + rBase = str.length - (curLineLength - bulge); + lines[curLine] = str.substring(0, rBase); + } + bulge = 0; + } + + // Bug: the current implementation of `wrapLineIndent` is buggy: we are not + // taking the extra space occupied by the additional indentation into account + // when wrapping the line. For example, in "hard" mode, we should hard-wrap + // long words at `wrapLen - wrapLinePrefix.length` instead of `wrapLen`; + // and remnants should also be wrapped at `wrapLen - wrapLinePrefix.length`. + if (preservedLine) { + // This is a preserved line, and the next output line isn't a + // preserved line. + preservedLine = false; + if (wrapLineIndentPat) { + idx = lines[curLine].substring(start).search(wrapLineIndentPat); + if (idx >= 0 && idx + wrapLineIndent > 0) { + wrapLinePrefix = new Array(idx + wrapLineIndent + 1).join(' '); + } else { + wrapLinePrefix = ''; + } + } + } + + // Some remnants are left to the next line. + if (rBase) { + while (rBase + wrapLen < str.length) { + if (wsAll) { + ln = str.substring(rBase, rBase + wrapLen); + lines.push(prefix + wrapLinePrefix + ln); + } else { + lines.push(prefix + wrapLinePrefix); + } + rBase += wrapLen; + curLine++; + } + if (beforeHardBreak) { + if (wsAll) { + ln = str.substring(rBase); + lines.push(prefix + wrapLinePrefix + ln); + } else { + lines.push(prefix + wrapLinePrefix); + } + curLine++; + } else { + ln = str.substring(rBase); + return wrapLinePrefix + ln; + } + } + + return ''; + } + + for (i = 0; i < chunks.length; i++) { + var chunk = chunks[i]; + + if (chunk === '') { continue; } + + if (typeof chunk !== 'string') { + if (chunk.type === 'break') { + // This is one or more line breaks. + // Each entry in `breaks` is just zero or more whitespaces. + if (respectLineBreaks !== 'none') { + // Note that if `whitespace` is "collapse", we still need + // to collapse whitespaces in entries of `breaks`. + var breaks = chunk.breaks; + var num = breaks.length - 1; + + if (respectLineBreaks === 's') { + // This is the most complex scenario. We have to check + // the line breaks one by one. + for (j = 0; j < num; j++) { + if (breaks[j+1].length < respectNum) { + // This line break should be stripped. + if (wsCollapse) { + breaks[j+1] = ' '; + } else { + breaks[j+1] = breaks[j] + breaks[j+1]; + } + } else { + // This line break should be preserved. + // First finish off the current line. + if (wsAll) { + lines[curLine] += breaks[j]; + curLineLength += breaks[j].length; + } + finishOffCurLine(true); + + lines.push(prefix + preservedLinePrefix); + curLine++; + curLineLength = start + preservedLinePrefix.length; + + preservedLine = cleanLine = true; + } + } + // We are adding to either the existing line (if no line break + // is qualified for preservance) or a "new" line. + if (!cleanLine || wsAll || (wsLine && preservedLine)) { + if (wsCollapse || (!cleanLine && breaks[num] === '')) { + breaks[num] = ' '; + } + lines[curLine] += breaks[num]; + curLineLength += breaks[num].length; + } + } else if (respectLineBreaks === 'm' && num < respectNum) { + // These line breaks should be stripped. + if (!cleanLine || wsAll || (wsLine && preservedLine)) { + if (wsCollapse) { + chunk = ' '; + } else { + chunk = breaks.join(''); + if (!cleanLine && chunk === '') { + chunk = ' '; + } + } + lines[curLine] += chunk; + curLineLength += chunk.length; + } + } else { // 'all' || ('m' && num >= respectNum) + // These line breaks should be preserved. + if (wsStrip) { + // Finish off the current line. + finishOffCurLine(true); + + for (j = 0; j < num; j++) { + lines.push(prefix + preservedLinePrefix); + curLine++; + } + + curLineLength = start + preservedLinePrefix.length; + preservedLine = cleanLine = true; + + } else { + if (wsAll || (preservedLine && cleanLine)) { + lines[curLine] += breaks[0]; + curLineLength += breaks[0].length; + } + + for (j = 0; j < num; j++) { + // Finish off the current line. + finishOffCurLine(true); + + lines.push(prefix + preservedLinePrefix + breaks[j+1]); + curLine++; + curLineLength = start + preservedLinePrefix.length + breaks[j+1].length; + + preservedLine = cleanLine = true; + } + } + } + } else { + // These line breaks should be stripped. + if (!cleanLine || wsAll || (wsLine && preservedLine)) { + chunk = chunk.remaining; + + // Bug: If `wsAll` is true, `cleanLine` is false, and `chunk` + // is '', we insert a space to replace the line break. This + // space will be preserved even if we are at the end of an + // output line, which is wrong behavior. However, I'm not + // sure it's worth it to fix this edge case. + if (wsCollapse || (!cleanLine && chunk === '')) { + chunk = ' '; + } + lines[curLine] += chunk; + curLineLength += chunk.length; + } + } + } else if (chunk.type === 'skip') { + // This is a skip string. + // Assumption: skip strings don't end with whitespaces. + if (curLineLength > stop) { + remnant = finishOffCurLine(false); + + lines.push(prefix + wrapLinePrefix); + curLine++; + curLineLength = start + wrapLinePrefix.length; + + if (remnant) { + lines[curLine] += remnant; + curLineLength += remnant.length; + } + + cleanLine = true; + } + lines[curLine] += chunk.value; + } + continue; + } + + var chunk2; + while (1) { + chunk2 = undefined; + if (curLineLength + chunk.length > stop && + curLineLength + (chunk2 = chunk.replace(tPat, '')).length > stop && + chunk2 !== '' && + curLineLength > start) { + // This line is full, add `chunk` to the next line + remnant = finishOffCurLine(false); + + lines.push(prefix + wrapLinePrefix); + curLine++; + curLineLength = start + wrapLinePrefix.length; + + if (remnant) { + lines[curLine] += remnant; + curLineLength += remnant.length; + cleanLine = true; + continue; + } + + if (wsStrip || (wsLine && !(preservedLine && cleanLine))) { + chunk = chunk.replace(pPat, ''); + } + cleanLine = false; + + } else { + // Add `chunk` to this line + if (cleanLine) { + if (wsStrip || (wsLine && !(preservedLine && cleanLine))) { + chunk = chunk.replace(pPat, ''); + if (chunk !== '') { + cleanLine = false; + } + } else { + if (nonWsPat.test(chunk)) { + cleanLine = false; + } + } + } + } + break; + } + if (wsAll && chunk2 && curLineLength + chunk2.length > stop) { + bulge = curLineLength + chunk2.length; + } + lines[curLine] += chunk; + curLineLength += chunk.length; + } + // Finally, finish off the last line. + finishOffCurLine(true); + return lines.join(lineBreakStr); + }; +}; + +linewrap.soft = linewrap; + +linewrap.hard = function (/*start, stop, params*/) { + var args = [].slice.call(arguments); + var last = args.length - 1; + if (typeof args[last] === 'object') { + args[last].mode = 'hard'; + } else { + args.push({ mode : 'hard' }); + } + return linewrap.apply(null, args); +}; + +linewrap.wrap = function(text/*, start, stop, params*/) { + var args = [].slice.call(arguments); + args.shift(); + return linewrap.apply(null, args)(text); +}; diff --git a/grocery-api/node_modules/heroku-cli-util/lib/open.js b/grocery-api/node_modules/heroku-cli-util/lib/open.js new file mode 100644 index 0000000..d57d75b --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/lib/open.js @@ -0,0 +1,19 @@ +'use strict'; + +let color = require('./color'); + +function open (url) { + let opn = require('opn'); + return new Promise((fulfill, reject) => { + opn(url, {wait: false}, err => { + if (err) reject(new Error( +`Error opening web browser. +${err} + +Manually visit ${color.cyan(url)} in your browser.`)); + else fulfill(err); + }); + }); +} + +module.exports = open; diff --git a/grocery-api/node_modules/heroku-cli-util/lib/preauth.js b/grocery-api/node_modules/heroku-cli-util/lib/preauth.js new file mode 100644 index 0000000..d91335e --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/lib/preauth.js @@ -0,0 +1,26 @@ +'use strict'; +let util = require('./util'); + +/** + * preauth will make an API call to preauth a user for an app + * this makes it so the user will not have to enter a 2fa code + * for the next few minutes on the specified app. + * + * You need this if your command is going to make multiple API calls + * since otherwise the secondFactor key would only work one time for + * yubikeys. + * + * @param {String} app the app to preauth against + * @param {Heroku} heroku a heroku api client + * @param {String} secondFactor a second factor code + * @return {Promise} A promise fulfilled when the preauth is complete + */ +function preauth (app, heroku, secondFactor) { + return heroku.request({ + method: 'PUT', + path: `/apps/${app}/pre-authorizations`, + headers: { 'Heroku-Two-Factor-Code': secondFactor } + }); +} + +module.exports = util.promiseOrCallback(preauth); diff --git a/grocery-api/node_modules/heroku-cli-util/lib/process.js b/grocery-api/node_modules/heroku-cli-util/lib/process.js new file mode 100644 index 0000000..fd472e0 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/lib/process.js @@ -0,0 +1,14 @@ +function Process() { + this.env = process.env; +} +Process.prototype.mock = function () { + this.mocking = true; +}; +Process.prototype.exit = function (code) { + if (this.mocking) { + this.exitCode = code; + } else { + process.exit(code); + } +}; +module.exports = new Process(); diff --git a/grocery-api/node_modules/heroku-cli-util/lib/prompt.js b/grocery-api/node_modules/heroku-cli-util/lib/prompt.js new file mode 100644 index 0000000..1ec0014 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/lib/prompt.js @@ -0,0 +1,102 @@ +'use strict'; + +let cli = require('../'); +let errors = require('./errors'); +let util = require('./util'); + +function promptMasked (options) { + function refresh (input, mask) { + process.stderr.clearLine(); + process.stderr.cursorTo(0); + process.stderr.write(options.prompt + (mask ? input.replace(/./g, '*') : input)); + } + + function start () { + process.stdin.setEncoding('utf8'); + process.stderr.write(options.prompt); + process.stdin.resume(); + if (!process.stdin.isTTY) { + throw new Error(`need to prompt for ${options.name || options.prompt} but stdin is not a tty`); + } + process.stdin.setRawMode(true); + } + + function stop () { + console.error(); + process.stdin.setRawMode(false); + process.stdin.pause(); + } + + return new Promise(function (fulfill, reject) { + start(); + let input = ''; + let fn = function (c) { + switch(c) { + case "\u0004": // Ctrl-d + case "\r": + case "\n": + if (input.length === 0) return; + refresh(input, true); + stop(); + process.stdin.removeListener('data', fn); + fulfill(input); + return; + case "\u0003": + // Ctrl-c + reject(''); + stop(); + process.stdin.removeListener('data', fn); + return; + default: + // backspace + if (c.charCodeAt(0) === 127) input = input.substr(0, input.length-1); + else input += c; + refresh(input, options.hide); + return; + } + }; + process.stdin.on('data', fn); + }); +} + +function prompt (name, options) { + options = options || {}; + options.prompt = name ? name + ': ' : '> '; + if (options.mask || options.hide) return promptMasked(options); + return new Promise(function (fulfill) { + process.stdin.setEncoding('utf8'); + process.stderr.write(options.prompt); + process.stdin.resume(); + process.stdin.once('data', function (data) { + process.stdin.pause(); + data = data.trim(); + if (data === '') { + fulfill(prompt(name)); + } else { + fulfill(data); + } + }); + }); +} + +function confirmApp (app, confirm, message) { + return new Promise(function (fulfill, reject) { + if (confirm) { + if (confirm === app) return fulfill(); + return reject(`Confirmation ${cli.color.bold.red(confirm)} did not match ${cli.color.bold.red(app)}. Aborted.`); + } + if (!message) message = `WARNING: Destructive Action\nThis command will affect the app ${cli.color.bold.red(app)}`; + errors.warn(message); + errors.warn(`To proceed, type ${cli.color.bold.red(app)} or re-run this command with ${cli.color.bold.red('--confirm', app)}`); + console.error(); + prompt().then(function (confirm) { + if (confirm === app) { + return fulfill(); + } + return reject(`Confirmation did not match ${cli.color.bold.red(app)}. Aborted.`); + }); + }); +} + +exports.prompt = util.promiseOrCallback(prompt); +exports.confirmApp = util.promiseOrCallback(confirmApp); diff --git a/grocery-api/node_modules/heroku-cli-util/lib/rollbar.js b/grocery-api/node_modules/heroku-cli-util/lib/rollbar.js new file mode 100644 index 0000000..f85ab40 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/lib/rollbar.js @@ -0,0 +1,80 @@ +'use strict'; + +let https = require('https'); +let parseUrl = require('url').parse; + +const GLOBAL_CRED = 'b66ca6f60fe049d6bedfe3e2ccb28d8c'; +const ROLLBAR_URL = 'https://api.rollbar.com/api/1/item/'; + +function concat (stream, callback) { + var strings = []; + stream.on('data', function (data) { + strings.push(data); + }); + stream.on('end', function () { + callback(strings.join('')); + }); +} + +function request (method, url, payload) { + return new Promise(function (fulfill, reject) { + let body = JSON.stringify(payload); + url = parseUrl(url); + let req = https.request({ + hostname: url.hostname, + path: url.path, + method: method + }, function (res) { + concat(res, function (data) { + if (res.statusCode >= 200 && res.statusCode < 300) + fulfill(data); + else + reject(data); + }); + }); + req.setHeader('Content-Length', Buffer.byteLength(body)); + req.write(body); + }); +} + +module.exports = function (cred, opts) { + if (!cred) cred = GLOBAL_CRED; + + function error (err) { + const regex = /^\s*at (?:([^(]+(?: \[\w\s+\])?) )?\(?(.+?)(?::(\d+):(\d+)(?:, :(\d+):(\d+))?)?\)?$/; + let frames = (err.stack || '').split('\n').map(function (line) { + let r = line.match(regex); + if (!r) { return; } + return { + method: r[1], + filename: r[2], + lineno: r[3], + colno: r[4] + }; + }); + frames.shift(); // discard first line + return request('POST', ROLLBAR_URL, { + access_token: cred, + data: { + code_version: opts.version, + context: opts.context, + platform: 'client', + environment: 'production', + framework: 'node', + body: { + trace: { + exception: { + class: err.name, + message: err.message || err, + }, + frames + } + } + } + }); + } + + return { + error + }; +}; diff --git a/grocery-api/node_modules/heroku-cli-util/lib/styled.js b/grocery-api/node_modules/heroku-cli-util/lib/styled.js new file mode 100644 index 0000000..79ced99 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/lib/styled.js @@ -0,0 +1,108 @@ +'use strict'; + +let cli = require('..'); +let util = require('util'); + +/** + * styledHeader logs in a consistent header style + * + * @example + * styledHeader('MyApp') # Outputs === MyApp + * + * @param {header} header text + * @returns {null} + */ +function styledHeader(header) { + cli.log(cli.color.gray('=== ') + cli.color.bold(header)); +} + +/** + * styledObject logs an object in a consistent columnar style + * + * @example + * styledObject({name: "myapp", collaborators: ["user1@example.com", "user2@example.com"]}) + * Collaborators: user1@example.com + * user2@example.com + * Name: myapp + * + * @param {obj} object data to print + * @param {keys} optional array of keys to sort/filter output + * @returns {null} + */ +function styledObject(obj, keys) { + let keyLengths = Object.keys(obj).map(function(key) { return key.toString().length; }); + let maxKeyLength = Math.max.apply(Math, keyLengths) + 2; + function pp(obj) { + if (typeof obj === 'string' || typeof obj === 'number') { + return obj; + } else if (typeof obj === 'object') { + return Object.keys(obj).map(k => k + ': ' + util.inspect(obj[k])).join(', '); + } else { + return util.inspect(obj); + } + } + function logKeyValue(key, value) { + cli.log(`${key}:`+' '.repeat(maxKeyLength - key.length-1)+pp(value)); + } + for (var key of (keys || Object.keys(obj).sort())) { + let value = obj[key]; + if (Array.isArray(value)) { + if (value.length > 0) { + logKeyValue(key, value[0]); + for (var e of value.slice(1)) { + cli.log(" ".repeat(maxKeyLength) + pp(e)); + } + } + } else if (value !== null && value !== undefined) { + logKeyValue(key, value); + } + } +} + +/** + * styledNameValues logs an array of {name: '', values: ['']} objects in a consistent style + * + * @example + * styledNameValues([{name: "Collaborators", values: ["user1@example.com", "user2@example.com"]}, + * {name: "Name", values: ["myapp"]}]) + * Collaborators: user1@example.com + * user2@example.com + * Name: myapp + * + * @param {nameValues} nameValues + * @returns {null} + */ +function styledNameValues(nameValues) { + let keys = nameValues.map(function(nameValue) { return nameValue.name; }); + let keyLengths = keys.map(function(name) { return name.toString().length; }); + let maxKeyLength = Math.max.apply(Math, keyLengths) + 2; + function pp(obj) { + if (typeof obj === 'string' || typeof obj === 'number') { + return obj; + } else if (typeof obj === 'object') { + return Object.keys(obj).map(k => k + ': ' + cli.inspect(obj[k])).join(', '); + } else { + return cli.inspect(obj); + } + } + function logKeyValue(key, value) { + cli.log(`${key}:`+' '.repeat(maxKeyLength - key.length-1)+pp(value)); + } + for (var nameValue of nameValues) { + let value = nameValue.values; + if (Array.isArray(value)) { + if (value.length > 0) { + logKeyValue(nameValue.name, value[0]); + for (var e of value.slice(1)) { + cli.log(" ".repeat(maxKeyLength) + pp(e)); + } + } + } else if (value !== null && value !== undefined) { + logKeyValue(nameValue.name, value); + } + } +} + +module.exports.styledHeader = styledHeader; +module.exports.styledObject = styledObject; +module.exports.styledNameValues = styledNameValues; diff --git a/grocery-api/node_modules/heroku-cli-util/lib/table.js b/grocery-api/node_modules/heroku-cli-util/lib/table.js new file mode 100644 index 0000000..a362062 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/lib/table.js @@ -0,0 +1,128 @@ +'use strict'; + +let stripAnsi = require('..').color.stripColor; +let _ = require('lodash'); +let cli = require('..'); + +let defaults = { + colSep: ' ', + after: _.noop, + headerAnsi: _.identity, + printLine: cli.log, + printRow: function(cells) { + this.printLine(cells.join(this.colSep).trimRight()); + }, + printHeader: function(cells) { + this.printRow(cells.map(_.ary(this.headerAnsi, 1))); + this.printRow(cells.map(function(hdr) { return hdr.replace(/./g, '─'); })); + } +}; + +let colDefaults = { + format: value => value ? value.toString() : '', + width: 0, + label: function() { return this.key.toString(); }, + + get: function(row) { + let value; + let path = _.result(this, 'key'); + + if(!path) { + value = row; + } else { + value = _.get(row, path); + } + + return this.format(value, row); + }, +}; + +function calcWidth(cell) { + let lines = stripAnsi(cell).split(/[\r\n]+/); + let lineLengths = lines.map(_.property('length')); + return Math.max.apply(Math, lineLengths); +} + +function pad(string, length) { + let visibleLength = stripAnsi(string).length; + let diff = length - visibleLength; + + return string + _.repeat(' ', Math.max(0, diff)); +} + +/** + * Generates a Unicode table and feeds it into configured printer. + * + * Top-level arguments: + * + * @arg {Object[]} data - the records to format as a table. + * @arg {Object} options - configuration for the table. + * + * @arg {Object[]} [options.columns] - Options for formatting and finding values for table columns. + * @arg {function(string)} [options.headerAnsi] - Zero-width formattter for entire header. + * @arg {string} [options.colSep] - Separator between columns. + * @arg {function(row, options)} [options.after] - Function called after each row is printed. + * @arg {function(string)} [options.printLine] - Function responsible for printing to terminal. + * @arg {function(cells)} [options.printHeader] - Function to print header cells as a row. + * @arg {function(cells)} [options.printRow] - Function to print cells as a row. + * + * @arg {function(row)|string} [options.columns[].key] - Path to the value in the row or function to retrieve the pre-formatted value for the cell. + * @arg {function(string)} [options.columns[].label] - Header name for column. + * @arg {function(string, row)} [options.columns[].format] - Formatter function for column value. + * @arg {function(row)} [options.columns[].get] - Function to return a value to be presented in cell without formatting. + * + */ +function table(data, options) { + _.defaults(options, defaults); + + let columns = options.columns || _.keys(data[0] || {}); + + if(typeof columns[0] === 'string') { + columns = columns.map(function(k) { return {key: k}; }); + } + + let defaultsApplied = false; + for(let row of data) { + row.height = 1; + for(let col of columns) { + if(!defaultsApplied) { _.defaults(col, colDefaults); } + + let cell = col.get(row); + + col.width = Math.max( + col.label.length, + col.width, + calcWidth(cell) + ); + + row.height = Math.max( + row.height, + cell.split(/[\r\n]+/).length + ); + } + defaultsApplied = true; + } + + if (options.printHeader) { + options.printHeader(columns.map(function(col) { + let label = _.result(col, 'label'); + return pad(label, col.width || label.length ); + })); + } + + function getNthLineOfCell(n, row, col) { + // TODO memoize this + let lines = col.get(row).split(/[\r\n]+/); + return pad(lines[n] || '', col.width); + } + + for(let row of data) { + for(let i = 0; i < row.height; i++) { + let cells = columns.map(_.partial(getNthLineOfCell, i, row)); + options.printRow(cells); + } + options.after(row, options); + } +} + +module.exports = table; diff --git a/grocery-api/node_modules/heroku-cli-util/lib/util.js b/grocery-api/node_modules/heroku-cli-util/lib/util.js new file mode 100644 index 0000000..d084760 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/lib/util.js @@ -0,0 +1,38 @@ +'use strict'; + +/** + * promiseOrCallback will convert a function that returns a promise + * into one that will either make a node-style callback or return a promise + * based on whether or not a callback is passed in. + * + * @example + * prompt('input? ').then(function (input) { + * // deal with input + * }); + * var prompt2 = promiseOrCallback(prompt); + * prompt('input? ', function (err, input) { + * // deal with input + * }); + * + * @param {Function} fn a promise returning function to wrap + * @returns {Function} a function that behaves like before unless called with a callback + */ +function promiseOrCallback(fn) { + return function () { + if (typeof arguments[arguments.length-1] === 'function') { + let args = Array.prototype.slice.call(arguments); + let callback = args.pop(); + fn.apply(null, args).then(function () { + let args = Array.prototype.slice.call(arguments); + args.unshift(null); + callback.apply(null, args); + }).catch(function (err) { + callback.call(null, err); + }); + } else { + return fn.apply(null, arguments); + } + }; +} + +exports.promiseOrCallback = promiseOrCallback; diff --git a/grocery-api/node_modules/heroku-cli-util/lib/yubikey.js b/grocery-api/node_modules/heroku-cli-util/lib/yubikey.js new file mode 100644 index 0000000..62d78db --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/lib/yubikey.js @@ -0,0 +1,22 @@ +'use strict'; + +let execSync = require('child_process').execSync; + +function enable () { + if (process.platform !== 'darwin') return; + try { + execSync(`osascript -e 'if application "yubiswitch" is running then tell application "yubiswitch" to KeyOn'`, {stdio: 'inherit'}); + } catch (err) { } +} + +function disable () { + if (process.platform !== 'darwin') return; + try { + execSync(`osascript -e 'if application "yubiswitch" is running then tell application "yubiswitch" to KeyOff'`, {stdio: 'inherit'}); + } catch (err) { } +} + +module.exports = { + enable, + disable, +}; diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/index.js b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/index.js new file mode 100644 index 0000000..2d85a91 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/index.js @@ -0,0 +1,116 @@ +'use strict'; +var escapeStringRegexp = require('escape-string-regexp'); +var ansiStyles = require('ansi-styles'); +var stripAnsi = require('strip-ansi'); +var hasAnsi = require('has-ansi'); +var supportsColor = require('supports-color'); +var defineProps = Object.defineProperties; +var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM); + +function Chalk(options) { + // detect mode if not set manually + this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled; +} + +// use bright blue on Windows as the normal blue color is illegible +if (isSimpleWindowsTerm) { + ansiStyles.blue.open = '\u001b[94m'; +} + +var styles = (function () { + var ret = {}; + + Object.keys(ansiStyles).forEach(function (key) { + ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); + + ret[key] = { + get: function () { + return build.call(this, this._styles.concat(key)); + } + }; + }); + + return ret; +})(); + +var proto = defineProps(function chalk() {}, styles); + +function build(_styles) { + var builder = function () { + return applyStyle.apply(builder, arguments); + }; + + builder._styles = _styles; + builder.enabled = this.enabled; + // __proto__ is used because we must return a function, but there is + // no way to create a function with a different prototype. + /* eslint-disable no-proto */ + builder.__proto__ = proto; + + return builder; +} + +function applyStyle() { + // support varags, but simply cast to string in case there's only one arg + var args = arguments; + var argsLen = args.length; + var str = argsLen !== 0 && String(arguments[0]); + + if (argsLen > 1) { + // don't slice `arguments`, it prevents v8 optimizations + for (var a = 1; a < argsLen; a++) { + str += ' ' + args[a]; + } + } + + if (!this.enabled || !str) { + return str; + } + + var nestedStyles = this._styles; + var i = nestedStyles.length; + + // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, + // see https://github.com/chalk/chalk/issues/58 + // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. + var originalDim = ansiStyles.dim.open; + if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) { + ansiStyles.dim.open = ''; + } + + while (i--) { + var code = ansiStyles[nestedStyles[i]]; + + // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + str = code.open + str.replace(code.closeRe, code.open) + code.close; + } + + // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue. + ansiStyles.dim.open = originalDim; + + return str; +} + +function init() { + var ret = {}; + + Object.keys(styles).forEach(function (name) { + ret[name] = { + get: function () { + return build.call(this, [name]); + } + }; + }); + + return ret; +} + +defineProps(Chalk.prototype, init()); + +module.exports = new Chalk(); +module.exports.styles = ansiStyles; +module.exports.hasColor = hasAnsi; +module.exports.stripColor = stripAnsi; +module.exports.supportsColor = supportsColor; diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/license b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/ansi-styles/index.js b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/ansi-styles/index.js new file mode 100644 index 0000000..7894527 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/ansi-styles/index.js @@ -0,0 +1,65 @@ +'use strict'; + +function assembleStyles () { + var styles = { + modifiers: { + reset: [0, 0], + bold: [1, 22], // 21 isn't widely supported and 22 does the same thing + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + colors: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39] + }, + bgColors: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49] + } + }; + + // fix humans + styles.colors.grey = styles.colors.gray; + + Object.keys(styles).forEach(function (groupName) { + var group = styles[groupName]; + + Object.keys(group).forEach(function (styleName) { + var style = group[styleName]; + + styles[styleName] = group[styleName] = { + open: '\u001b[' + style[0] + 'm', + close: '\u001b[' + style[1] + 'm' + }; + }); + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + }); + + return styles; +} + +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/ansi-styles/license b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/ansi-styles/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/ansi-styles/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/ansi-styles/package.json b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/ansi-styles/package.json new file mode 100644 index 0000000..b6a9cea --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/ansi-styles/package.json @@ -0,0 +1,80 @@ +{ + "name": "ansi-styles", + "version": "2.1.0", + "description": "ANSI escape codes for styling strings in the terminal", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-styles.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "devDependencies": { + "mocha": "*" + }, + "gitHead": "18421cbe4a2d93359ec2599a894f704be126d066", + "bugs": { + "url": "https://github.com/chalk/ansi-styles/issues" + }, + "homepage": "https://github.com/chalk/ansi-styles", + "_id": "ansi-styles@2.1.0", + "_shasum": "990f747146927b559a932bf92959163d60c0d0e2", + "_from": "ansi-styles@>=2.1.0 <3.0.0", + "_npmVersion": "2.10.1", + "_nodeVersion": "0.12.4", + "_npmUser": { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + }, + "dist": { + "shasum": "990f747146927b559a932bf92959163d60c0d0e2", + "tarball": "http://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/ansi-styles/readme.md b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/ansi-styles/readme.md new file mode 100644 index 0000000..3f933f6 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/ansi-styles/readme.md @@ -0,0 +1,86 @@ +# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) + +> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. + +![](screenshot.png) + + +## Install + +``` +$ npm install --save ansi-styles +``` + + +## Usage + +```js +var ansi = require('ansi-styles'); + +console.log(ansi.green.open + 'Hello world!' + ansi.green.close); +``` + + +## API + +Each style has an `open` and `close` property. + + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `gray` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` + + +## Advanced usage + +By default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `ansi.modifiers` +- `ansi.colors` +- `ansi.bgColors` + + +###### Example + +```js +console.log(ansi.colors.green.open); +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/escape-string-regexp/index.js b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/escape-string-regexp/index.js new file mode 100644 index 0000000..7834bf9 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/escape-string-regexp/index.js @@ -0,0 +1,11 @@ +'use strict'; + +var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; + +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + return str.replace(matchOperatorsRe, '\\$&'); +}; diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/escape-string-regexp/license b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/escape-string-regexp/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/escape-string-regexp/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/escape-string-regexp/package.json b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/escape-string-regexp/package.json new file mode 100644 index 0000000..dacd1fe --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/escape-string-regexp/package.json @@ -0,0 +1,70 @@ +{ + "name": "escape-string-regexp", + "version": "1.0.4", + "description": "Escape RegExp special characters", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/sindresorhus/escape-string-regexp" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "engines": { + "node": ">=0.8.0" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "escape", + "regex", + "regexp", + "re", + "regular", + "expression", + "string", + "str", + "special", + "characters" + ], + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "gitHead": "e9ca6832a9506ca26402cb0e6dc95efcf35b0b97", + "bugs": { + "url": "https://github.com/sindresorhus/escape-string-regexp/issues" + }, + "homepage": "https://github.com/sindresorhus/escape-string-regexp", + "_id": "escape-string-regexp@1.0.4", + "_shasum": "b85e679b46f72d03fbbe8a3bf7259d535c21b62f", + "_from": "escape-string-regexp@>=1.0.2 <2.0.0", + "_npmVersion": "2.14.7", + "_nodeVersion": "4.2.1", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "b85e679b46f72d03fbbe8a3bf7259d535c21b62f", + "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.4.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.4.tgz" +} diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/escape-string-regexp/readme.md b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/escape-string-regexp/readme.md new file mode 100644 index 0000000..87ac82d --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/escape-string-regexp/readme.md @@ -0,0 +1,27 @@ +# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp) + +> Escape RegExp special characters + + +## Install + +``` +$ npm install --save escape-string-regexp +``` + + +## Usage + +```js +const escapeStringRegexp = require('escape-string-regexp'); + +const escapedString = escapeStringRegexp('how much $ for a unicorn?'); +//=> 'how much \$ for a unicorn\?' + +new RegExp(escapedString); +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/index.js b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/index.js new file mode 100644 index 0000000..98fae06 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +var ansiRegex = require('ansi-regex'); +var re = new RegExp(ansiRegex().source); // remove the `g` flag +module.exports = re.test.bind(re); diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/license b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/index.js b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/index.js new file mode 100644 index 0000000..4906755 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = function () { + return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; +}; diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/license b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json new file mode 100644 index 0000000..7fc0767 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json @@ -0,0 +1,86 @@ +{ + "name": "ansi-regex", + "version": "2.0.0", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/ansi-regex.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha test/test.js", + "view-supported": "node test/viewCodes.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "mocha": "*" + }, + "gitHead": "57c3f2941a73079fa8b081e02a522e3d29913e2f", + "bugs": { + "url": "https://github.com/sindresorhus/ansi-regex/issues" + }, + "homepage": "https://github.com/sindresorhus/ansi-regex", + "_id": "ansi-regex@2.0.0", + "_shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", + "_from": "ansi-regex@>=2.0.0 <3.0.0", + "_npmVersion": "2.11.2", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", + "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/readme.md b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/readme.md new file mode 100644 index 0000000..1a4894e --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/readme.md @@ -0,0 +1,31 @@ +# ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-regex) + +> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save ansi-regex +``` + + +## Usage + +```js +var ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001b[4mcake\u001b[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001b[4mcake\u001b[0m'.match(ansiRegex()); +//=> ['\u001b[4m', '\u001b[0m'] +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/package.json b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/package.json new file mode 100644 index 0000000..d39a62e --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/package.json @@ -0,0 +1,85 @@ +{ + "name": "has-ansi", + "version": "2.0.0", + "description": "Check if a string has ANSI escape codes", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/has-ansi.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern", + "has" + ], + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "devDependencies": { + "ava": "0.0.4" + }, + "gitHead": "0722275e1bef139fcd09137da6e5550c3cd368b9", + "bugs": { + "url": "https://github.com/sindresorhus/has-ansi/issues" + }, + "homepage": "https://github.com/sindresorhus/has-ansi", + "_id": "has-ansi@2.0.0", + "_shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", + "_from": "has-ansi@>=2.0.0 <3.0.0", + "_npmVersion": "2.11.2", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", + "tarball": "http://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/readme.md b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/readme.md new file mode 100644 index 0000000..02bc7c2 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/has-ansi/readme.md @@ -0,0 +1,36 @@ +# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi) + +> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save has-ansi +``` + + +## Usage + +```js +var hasAnsi = require('has-ansi'); + +hasAnsi('\u001b[4mcake\u001b[0m'); +//=> true + +hasAnsi('cake'); +//=> false +``` + + +## Related + +- [has-ansi-cli](https://github.com/sindresorhus/has-ansi-cli) - CLI for this module +- [strip-ansi](https://github.com/sindresorhus/strip-ansi) - Strip ANSI escape codes +- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/index.js b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/index.js new file mode 100644 index 0000000..099480f --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/index.js @@ -0,0 +1,6 @@ +'use strict'; +var ansiRegex = require('ansi-regex')(); + +module.exports = function (str) { + return typeof str === 'string' ? str.replace(ansiRegex, '') : str; +}; diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/license b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/index.js b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/index.js new file mode 100644 index 0000000..4906755 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = function () { + return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; +}; diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/license b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json new file mode 100644 index 0000000..7fc0767 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json @@ -0,0 +1,86 @@ +{ + "name": "ansi-regex", + "version": "2.0.0", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/ansi-regex.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha test/test.js", + "view-supported": "node test/viewCodes.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "mocha": "*" + }, + "gitHead": "57c3f2941a73079fa8b081e02a522e3d29913e2f", + "bugs": { + "url": "https://github.com/sindresorhus/ansi-regex/issues" + }, + "homepage": "https://github.com/sindresorhus/ansi-regex", + "_id": "ansi-regex@2.0.0", + "_shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", + "_from": "ansi-regex@>=2.0.0 <3.0.0", + "_npmVersion": "2.11.2", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", + "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/readme.md b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/readme.md new file mode 100644 index 0000000..1a4894e --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/readme.md @@ -0,0 +1,31 @@ +# ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-regex) + +> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save ansi-regex +``` + + +## Usage + +```js +var ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001b[4mcake\u001b[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001b[4mcake\u001b[0m'.match(ansiRegex()); +//=> ['\u001b[4m', '\u001b[0m'] +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/package.json b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/package.json new file mode 100644 index 0000000..2871d03 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/package.json @@ -0,0 +1,85 @@ +{ + "name": "strip-ansi", + "version": "3.0.0", + "description": "Strip ANSI escape codes", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/strip-ansi.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "devDependencies": { + "ava": "0.0.4" + }, + "gitHead": "3f05b9810e1438f946e2eb84ee854cc00b972e9e", + "bugs": { + "url": "https://github.com/sindresorhus/strip-ansi/issues" + }, + "homepage": "https://github.com/sindresorhus/strip-ansi", + "_id": "strip-ansi@3.0.0", + "_shasum": "7510b665567ca914ccb5d7e072763ac968be3724", + "_from": "strip-ansi@>=3.0.0 <4.0.0", + "_npmVersion": "2.11.2", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "7510b665567ca914ccb5d7e072763ac968be3724", + "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/readme.md b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/readme.md new file mode 100644 index 0000000..7609151 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/strip-ansi/readme.md @@ -0,0 +1,33 @@ +# strip-ansi [![Build Status](https://travis-ci.org/sindresorhus/strip-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-ansi) + +> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save strip-ansi +``` + + +## Usage + +```js +var stripAnsi = require('strip-ansi'); + +stripAnsi('\u001b[4mcake\u001b[0m'); +//=> 'cake' +``` + + +## Related + +- [strip-ansi-cli](https://github.com/sindresorhus/strip-ansi-cli) - CLI for this module +- [has-ansi](https://github.com/sindresorhus/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/supports-color/index.js b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/supports-color/index.js new file mode 100644 index 0000000..4346e27 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/supports-color/index.js @@ -0,0 +1,50 @@ +'use strict'; +var argv = process.argv; + +var terminator = argv.indexOf('--'); +var hasFlag = function (flag) { + flag = '--' + flag; + var pos = argv.indexOf(flag); + return pos !== -1 && (terminator !== -1 ? pos < terminator : true); +}; + +module.exports = (function () { + if ('FORCE_COLOR' in process.env) { + return true; + } + + if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false')) { + return false; + } + + if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + return true; + } + + if (process.stdout && !process.stdout.isTTY) { + return false; + } + + if (process.platform === 'win32') { + return true; + } + + if ('COLORTERM' in process.env) { + return true; + } + + if (process.env.TERM === 'dumb') { + return false; + } + + if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { + return true; + } + + return false; +})(); diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/supports-color/license b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/supports-color/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/supports-color/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/supports-color/package.json b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/supports-color/package.json new file mode 100644 index 0000000..38a1ecb --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/supports-color/package.json @@ -0,0 +1,79 @@ +{ + "name": "supports-color", + "version": "2.0.0", + "description": "Detect whether a terminal supports color", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/supports-color.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "engines": { + "node": ">=0.8.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect" + ], + "devDependencies": { + "mocha": "*", + "require-uncached": "^1.0.2" + }, + "gitHead": "8400d98ade32b2adffd50902c06d9e725a5c6588", + "bugs": { + "url": "https://github.com/chalk/supports-color/issues" + }, + "homepage": "https://github.com/chalk/supports-color", + "_id": "supports-color@2.0.0", + "_shasum": "535d045ce6b6363fa40117084629995e9df324c7", + "_from": "supports-color@>=2.0.0 <3.0.0", + "_npmVersion": "2.11.2", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "535d045ce6b6363fa40117084629995e9df324c7", + "tarball": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/supports-color/readme.md b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/supports-color/readme.md new file mode 100644 index 0000000..b4761f1 --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/node_modules/supports-color/readme.md @@ -0,0 +1,36 @@ +# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) + +> Detect whether a terminal supports color + + +## Install + +``` +$ npm install --save supports-color +``` + + +## Usage + +```js +var supportsColor = require('supports-color'); + +if (supportsColor) { + console.log('Terminal supports color'); +} +``` + +It obeys the `--color` and `--no-color` CLI flags. + +For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`. + + +## Related + +- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/package.json b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/package.json new file mode 100644 index 0000000..46844bd --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/package.json @@ -0,0 +1,102 @@ +{ + "name": "chalk", + "version": "1.1.1", + "description": "Terminal string styling done right. Much color.", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/chalk.git" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + }, + { + "name": "unicorn", + "email": "sindresorhus+unicorn@gmail.com" + } + ], + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && mocha", + "bench": "matcha benchmark.js", + "coverage": "nyc npm test && nyc report", + "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls" + }, + "files": [ + "index.js" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-styles": "^2.1.0", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "devDependencies": { + "coveralls": "^2.11.2", + "matcha": "^0.6.0", + "mocha": "*", + "nyc": "^3.0.0", + "require-uncached": "^1.0.2", + "resolve-from": "^1.0.0", + "semver": "^4.3.3", + "xo": "*" + }, + "xo": { + "envs": [ + "node", + "mocha" + ] + }, + "gitHead": "8b554e254e89c85c1fd04dcc444beeb15824e1a5", + "bugs": { + "url": "https://github.com/chalk/chalk/issues" + }, + "homepage": "https://github.com/chalk/chalk#readme", + "_id": "chalk@1.1.1", + "_shasum": "509afb67066e7499f7eb3535c77445772ae2d019", + "_from": "chalk@1.1.1", + "_npmVersion": "2.13.5", + "_nodeVersion": "0.12.7", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "509afb67066e7499f7eb3535c77445772ae2d019", + "tarball": "http://registry.npmjs.org/chalk/-/chalk-1.1.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.1.tgz" +} diff --git a/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/readme.md b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/readme.md new file mode 100644 index 0000000..5cf111e --- /dev/null +++ b/grocery-api/node_modules/heroku-cli-util/node_modules/chalk/readme.md @@ -0,0 +1,213 @@ +

+
+
+ chalk +
+
+
+

+ +> Terminal string styling done right + +[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) +[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master) +[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) + + +[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough. + +**Chalk is a clean and focused alternative.** + +![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png) + + +## Why + +- Highly performant +- Doesn't extend `String.prototype` +- Expressive API +- Ability to nest styles +- Clean and focused +- Auto-detects color support +- Actively maintained +- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015 + + +## Install + +``` +$ npm install --save chalk +``` + + +## Usage + +Chalk comes with an easy to use composable API where you just chain and nest the styles you want. + +```js +var chalk = require('chalk'); + +// style a string +chalk.blue('Hello world!'); + +// combine styled and normal strings +chalk.blue('Hello') + 'World' + chalk.red('!'); + +// compose multiple styles using the chainable API +chalk.blue.bgRed.bold('Hello world!'); + +// pass in multiple arguments +chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'); + +// nest styles +chalk.red('Hello', chalk.underline.bgBlue('world') + '!'); + +// nest styles of the same type even (color, underline, background) +chalk.green( + 'I am a green line ' + + chalk.blue.underline.bold('with a blue substring') + + ' that becomes green again!' +); +``` + +Easily define your own themes. + +```js +var chalk = require('chalk'); +var error = chalk.bold.red; +console.log(error('Error!')); +``` + +Take advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data). + +```js +var name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> Hello Sindre +``` + + +## API + +### chalk.` + + + + +
+
+

The page you were looking for doesn't exist.

+

You may have mistyped the address or the page may have moved.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/grocery-api/public/422.html b/grocery-api/public/422.html new file mode 100644 index 0000000..a21f82b --- /dev/null +++ b/grocery-api/public/422.html @@ -0,0 +1,67 @@ + + + + The change you wanted was rejected (422) + + + + + + +
+
+

The change you wanted was rejected.

+

Maybe you tried to change something you didn't have access to.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/grocery-api/public/500.html b/grocery-api/public/500.html new file mode 100644 index 0000000..061abc5 --- /dev/null +++ b/grocery-api/public/500.html @@ -0,0 +1,66 @@ + + + + We're sorry, but something went wrong (500) + + + + + + +
+
+

We're sorry, but something went wrong.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/grocery-api/public/favicon.ico b/grocery-api/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/grocery-api/public/robots.txt b/grocery-api/public/robots.txt new file mode 100644 index 0000000..3c9c7c0 --- /dev/null +++ b/grocery-api/public/robots.txt @@ -0,0 +1,5 @@ +# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file +# +# To ban all spiders from the entire site uncomment the next two lines: +# User-agent: * +# Disallow: / diff --git a/grocery-api/test/controllers/.keep b/grocery-api/test/controllers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/grocery-api/test/controllers/foods_controller_test.rb b/grocery-api/test/controllers/foods_controller_test.rb new file mode 100644 index 0000000..26d10a5 --- /dev/null +++ b/grocery-api/test/controllers/foods_controller_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +class FoodsControllerTest < ActionController::TestCase + test "should get index" do + get :index + assert_response :success + end + +end diff --git a/grocery-api/test/fixtures/.keep b/grocery-api/test/fixtures/.keep new file mode 100644 index 0000000..e69de29 diff --git a/grocery-api/test/fixtures/foods.yml b/grocery-api/test/fixtures/foods.yml new file mode 100644 index 0000000..aa92a90 --- /dev/null +++ b/grocery-api/test/fixtures/foods.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + duration_seconds: 1 + +two: + name: MyString + duration_seconds: 1 diff --git a/grocery-api/test/helpers/.keep b/grocery-api/test/helpers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/grocery-api/test/integration/.keep b/grocery-api/test/integration/.keep new file mode 100644 index 0000000..e69de29 diff --git a/grocery-api/test/mailers/.keep b/grocery-api/test/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/grocery-api/test/models/.keep b/grocery-api/test/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/grocery-api/test/models/food_test.rb b/grocery-api/test/models/food_test.rb new file mode 100644 index 0000000..8ad7dff --- /dev/null +++ b/grocery-api/test/models/food_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class FoodTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/grocery-api/test/test_helper.rb b/grocery-api/test/test_helper.rb new file mode 100644 index 0000000..92e39b2 --- /dev/null +++ b/grocery-api/test/test_helper.rb @@ -0,0 +1,10 @@ +ENV['RAILS_ENV'] ||= 'test' +require File.expand_path('../../config/environment', __FILE__) +require 'rails/test_help' + +class ActiveSupport::TestCase + # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. + fixtures :all + + # Add more helper methods to be used by all tests here... +end diff --git a/grocery-api/vendor/assets/javascripts/.keep b/grocery-api/vendor/assets/javascripts/.keep new file mode 100644 index 0000000..e69de29 diff --git a/grocery-api/vendor/assets/stylesheets/.keep b/grocery-api/vendor/assets/stylesheets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/grocery-objc/.DS_Store b/grocery-objc/.DS_Store new file mode 100644 index 0000000..a2e7b1e Binary files /dev/null and b/grocery-objc/.DS_Store differ diff --git a/grocery-objc/Podfile b/grocery-objc/Podfile new file mode 100644 index 0000000..6ec7513 --- /dev/null +++ b/grocery-objc/Podfile @@ -0,0 +1,9 @@ +pod 'Unirest', '~> 1.1.4' +pod 'Firebase', '>= 2.5.0' +pod 'NSDate+RelativeTime', '~> 1.0' +pod 'HSDatePickerViewController', '~> 1.0' +pod 'AFNetworking', '~> 3.0' +pod 'FoldingTabBar', '~> 1.0' +pod 'SDWebImage', '~> 3.7' +pod 'RSBarcodes', '~> 0.1.4' +pod 'SIAlertView', '~> 1.3' \ No newline at end of file diff --git a/grocery-objc/Podfile.lock b/grocery-objc/Podfile.lock new file mode 100644 index 0000000..0e7fbbe --- /dev/null +++ b/grocery-objc/Podfile.lock @@ -0,0 +1,50 @@ +PODS: + - AFNetworking (3.0.4): + - AFNetworking/NSURLSession (= 3.0.4) + - AFNetworking/Reachability (= 3.0.4) + - AFNetworking/Security (= 3.0.4) + - AFNetworking/Serialization (= 3.0.4) + - AFNetworking/UIKit (= 3.0.4) + - AFNetworking/NSURLSession (3.0.4): + - AFNetworking/Reachability + - AFNetworking/Security + - AFNetworking/Serialization + - AFNetworking/Reachability (3.0.4) + - AFNetworking/Security (3.0.4) + - AFNetworking/Serialization (3.0.4) + - AFNetworking/UIKit (3.0.4): + - AFNetworking/NSURLSession + - Firebase (2.5.1) + - FoldingTabBar (1.0.2) + - HSDatePickerViewController (1.0.4) + - NSDate+RelativeTime (1.0.1) + - RSBarcodes (0.1.4) + - SDWebImage (3.7.5): + - SDWebImage/Core (= 3.7.5) + - SDWebImage/Core (3.7.5) + - SIAlertView (1.3) + - Unirest (1.1.4) + +DEPENDENCIES: + - AFNetworking (~> 3.0) + - Firebase (>= 2.5.0) + - FoldingTabBar (~> 1.0) + - HSDatePickerViewController (~> 1.0) + - NSDate+RelativeTime (~> 1.0) + - RSBarcodes (~> 0.1.4) + - SDWebImage (~> 3.7) + - SIAlertView (~> 1.3) + - Unirest (~> 1.1.4) + +SPEC CHECKSUMS: + AFNetworking: a0075feb321559dc78d9d85b55d11caa19eabb93 + Firebase: 3565ea88b830f28f2c77ecc524622bc71a20d085 + FoldingTabBar: 79df76dfd5a84c0a369beaa378a31c07aa53b6b2 + HSDatePickerViewController: 5a72b71f8c3b10e76f2c28a898f8572b551432a6 + NSDate+RelativeTime: 1b03a562615a4496a826e322096e5792e6706612 + RSBarcodes: 6b062b5aba3e75a5e889b2465ef1bb256215fbd0 + SDWebImage: 69c6303e3348fba97e03f65d65d4fbc26740f461 + SIAlertView: 20c794b55eaf44d888773ea51647cf8907723919 + Unirest: 5e4d93eaf32463bf619a4ecd3bbc8c32acf21eac + +COCOAPODS: 0.39.0 diff --git a/grocery-objc/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.h b/grocery-objc/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.h new file mode 100644 index 0000000..55ed92e --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.h @@ -0,0 +1,295 @@ +// AFHTTPSessionManager.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import +#if !TARGET_OS_WATCH +#import +#endif +#import + +#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV +#import +#else +#import +#endif + +#import "AFURLSessionManager.h" + +/** + `AFHTTPSessionManager` is a subclass of `AFURLSessionManager` with convenience methods for making HTTP requests. When a `baseURL` is provided, requests made with the `GET` / `POST` / et al. convenience methods can be made with relative paths. + + ## Subclassing Notes + + Developers targeting iOS 7 or Mac OS X 10.9 or later that deal extensively with a web service are encouraged to subclass `AFHTTPSessionManager`, providing a class method that returns a shared singleton object on which authentication and other configuration can be shared across the application. + + For developers targeting iOS 6 or Mac OS X 10.8 or earlier, `AFHTTPRequestOperationManager` may be used to similar effect. + + ## Methods to Override + + To change the behavior of all data task operation construction, which is also used in the `GET` / `POST` / et al. convenience methods, override `dataTaskWithRequest:completionHandler:`. + + ## Serialization + + Requests created by an HTTP client will contain default headers and encode parameters according to the `requestSerializer` property, which is an object conforming to ``. + + Responses received from the server are automatically validated and serialized by the `responseSerializers` property, which is an object conforming to `` + + ## URL Construction Using Relative Paths + + For HTTP convenience methods, the request serializer constructs URLs from the path relative to the `-baseURL`, using `NSURL +URLWithString:relativeToURL:`, when provided. If `baseURL` is `nil`, `path` needs to resolve to a valid `NSURL` object using `NSURL +URLWithString:`. + + Below are a few examples of how `baseURL` and relative paths interact: + + NSURL *baseURL = [NSURL URLWithString:@"http://example.com/v1/"]; + [NSURL URLWithString:@"foo" relativeToURL:baseURL]; // http://example.com/v1/foo + [NSURL URLWithString:@"foo?bar=baz" relativeToURL:baseURL]; // http://example.com/v1/foo?bar=baz + [NSURL URLWithString:@"/foo" relativeToURL:baseURL]; // http://example.com/foo + [NSURL URLWithString:@"foo/" relativeToURL:baseURL]; // http://example.com/v1/foo + [NSURL URLWithString:@"/foo/" relativeToURL:baseURL]; // http://example.com/foo/ + [NSURL URLWithString:@"http://example2.com/" relativeToURL:baseURL]; // http://example2.com/ + + Also important to note is that a trailing slash will be added to any `baseURL` without one. This would otherwise cause unexpected behavior when constructing URLs using paths without a leading slash. + + @warning Managers for background sessions must be owned for the duration of their use. This can be accomplished by creating an application-wide or shared singleton instance. + */ + +NS_ASSUME_NONNULL_BEGIN + +@interface AFHTTPSessionManager : AFURLSessionManager + +/** + The URL used to construct requests from relative paths in methods like `requestWithMethod:URLString:parameters:`, and the `GET` / `POST` / et al. convenience methods. + */ +@property (readonly, nonatomic, strong, nullable) NSURL *baseURL; + +/** + Requests created with `requestWithMethod:URLString:parameters:` & `multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:` are constructed with a set of default headers using a parameter serialization specified by this property. By default, this is set to an instance of `AFHTTPRequestSerializer`, which serializes query string parameters for `GET`, `HEAD`, and `DELETE` requests, or otherwise URL-form-encodes HTTP message bodies. + + @warning `requestSerializer` must not be `nil`. + */ +@property (nonatomic, strong) AFHTTPRequestSerializer * requestSerializer; + +/** + Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to an instance of `AFJSONResponseSerializer`. + + @warning `responseSerializer` must not be `nil`. + */ +@property (nonatomic, strong) AFHTTPResponseSerializer * responseSerializer; + +///--------------------- +/// @name Initialization +///--------------------- + +/** + Creates and returns an `AFHTTPSessionManager` object. + */ ++ (instancetype)manager; + +/** + Initializes an `AFHTTPSessionManager` object with the specified base URL. + + @param url The base URL for the HTTP client. + + @return The newly-initialized HTTP client + */ +- (instancetype)initWithBaseURL:(nullable NSURL *)url; + +/** + Initializes an `AFHTTPSessionManager` object with the specified base URL. + + This is the designated initializer. + + @param url The base URL for the HTTP client. + @param configuration The configuration used to create the managed session. + + @return The newly-initialized HTTP client + */ +- (instancetype)initWithBaseURL:(nullable NSURL *)url + sessionConfiguration:(nullable NSURLSessionConfiguration *)configuration NS_DESIGNATED_INITIALIZER; + +///--------------------------- +/// @name Making HTTP Requests +///--------------------------- + +/** + Creates and runs an `NSURLSessionDataTask` with a `GET` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; + + +/** + Creates and runs an `NSURLSessionDataTask` with a `GET` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param progress A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler: + */ +- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString + parameters:(nullable id)parameters + progress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgress + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +/** + Creates and runs an `NSURLSessionDataTask` with a `HEAD` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes a single arguments: the data task. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)HEAD:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(NSURLSessionDataTask *task))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +/** + Creates and runs an `NSURLSessionDataTask` with a `POST` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; + +/** + Creates and runs an `NSURLSessionDataTask` with a `POST` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param progress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler: + */ +- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(nullable id)parameters + progress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgress + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +/** + Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(nullable id)parameters + constructingBodyWithBlock:(nullable void (^)(id formData))block + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; + +/** + Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol. + @param progress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler: + */ +- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(nullable id)parameters + constructingBodyWithBlock:(nullable void (^)(id formData))block + progress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgress + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +/** + Creates and runs an `NSURLSessionDataTask` with a `PUT` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)PUT:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +/** + Creates and runs an `NSURLSessionDataTask` with a `PATCH` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)PATCH:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +/** + Creates and runs an `NSURLSessionDataTask` with a `DELETE` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)DELETE:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +@end + +NS_ASSUME_NONNULL_END diff --git a/grocery-objc/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m b/grocery-objc/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m new file mode 100644 index 0000000..a28cc6e --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m @@ -0,0 +1,361 @@ +// AFHTTPSessionManager.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "AFHTTPSessionManager.h" + +#import "AFURLRequestSerialization.h" +#import "AFURLResponseSerialization.h" + +#import +#import +#import + +#import +#import +#import +#import +#import + +#if TARGET_OS_IOS || TARGET_OS_TV +#import +#elif TARGET_OS_WATCH +#import +#endif + +@interface AFHTTPSessionManager () +@property (readwrite, nonatomic, strong) NSURL *baseURL; +@end + +@implementation AFHTTPSessionManager +@dynamic responseSerializer; + ++ (instancetype)manager { + return [[[self class] alloc] initWithBaseURL:nil]; +} + +- (instancetype)init { + return [self initWithBaseURL:nil]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url { + return [self initWithBaseURL:url sessionConfiguration:nil]; +} + +- (instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)configuration { + return [self initWithBaseURL:nil sessionConfiguration:configuration]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url + sessionConfiguration:(NSURLSessionConfiguration *)configuration +{ + self = [super initWithSessionConfiguration:configuration]; + if (!self) { + return nil; + } + + // Ensure terminal slash for baseURL path, so that NSURL +URLWithString:relativeToURL: works as expected + if ([[url path] length] > 0 && ![[url absoluteString] hasSuffix:@"/"]) { + url = [url URLByAppendingPathComponent:@""]; + } + + self.baseURL = url; + + self.requestSerializer = [AFHTTPRequestSerializer serializer]; + self.responseSerializer = [AFJSONResponseSerializer serializer]; + + return self; +} + +#pragma mark - + +- (void)setRequestSerializer:(AFHTTPRequestSerializer *)requestSerializer { + NSParameterAssert(requestSerializer); + + _requestSerializer = requestSerializer; +} + +- (void)setResponseSerializer:(AFHTTPResponseSerializer *)responseSerializer { + NSParameterAssert(responseSerializer); + + [super setResponseSerializer:responseSerializer]; +} + +#pragma mark - + +- (NSURLSessionDataTask *)GET:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure +{ + + return [self GET:URLString parameters:parameters progress:nil success:success failure:failure]; +} + +- (NSURLSessionDataTask *)GET:(NSString *)URLString + parameters:(id)parameters + progress:(void (^)(NSProgress * _Nonnull))downloadProgress + success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success + failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure +{ + + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"GET" + URLString:URLString + parameters:parameters + uploadProgress:nil + downloadProgress:downloadProgress + success:success + failure:failure]; + + [dataTask resume]; + + return dataTask; +} + +- (NSURLSessionDataTask *)HEAD:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(NSURLSessionDataTask *task))success + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure +{ + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"HEAD" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:^(NSURLSessionDataTask *task, __unused id responseObject) { + if (success) { + success(task); + } + } failure:failure]; + + [dataTask resume]; + + return dataTask; +} + +- (NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure +{ + return [self POST:URLString parameters:parameters progress:nil success:success failure:failure]; +} + +- (NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(id)parameters + progress:(void (^)(NSProgress * _Nonnull))uploadProgress + success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success + failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure +{ + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"POST" URLString:URLString parameters:parameters uploadProgress:uploadProgress downloadProgress:nil success:success failure:failure]; + + [dataTask resume]; + + return dataTask; +} + +- (NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(nullable id)parameters + constructingBodyWithBlock:(nullable void (^)(id _Nonnull))block + success:(nullable void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure +{ + return [self POST:URLString parameters:parameters constructingBodyWithBlock:block progress:nil success:success failure:failure]; +} + +- (NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(id)parameters + constructingBodyWithBlock:(void (^)(id formData))block + progress:(nullable void (^)(NSProgress * _Nonnull))uploadProgress + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure +{ + NSError *serializationError = nil; + NSMutableURLRequest *request = [self.requestSerializer multipartFormRequestWithMethod:@"POST" URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters constructingBodyWithBlock:block error:&serializationError]; + if (serializationError) { + if (failure) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{ + failure(nil, serializationError); + }); +#pragma clang diagnostic pop + } + + return nil; + } + + __block NSURLSessionDataTask *task = [self uploadTaskWithStreamedRequest:request progress:uploadProgress completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) { + if (error) { + if (failure) { + failure(task, error); + } + } else { + if (success) { + success(task, responseObject); + } + } + }]; + + [task resume]; + + return task; +} + +- (NSURLSessionDataTask *)PUT:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure +{ + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PUT" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure]; + + [dataTask resume]; + + return dataTask; +} + +- (NSURLSessionDataTask *)PATCH:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure +{ + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PATCH" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure]; + + [dataTask resume]; + + return dataTask; +} + +- (NSURLSessionDataTask *)DELETE:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure +{ + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"DELETE" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure]; + + [dataTask resume]; + + return dataTask; +} + +- (NSURLSessionDataTask *)dataTaskWithHTTPMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(id)parameters + uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgress + downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgress + success:(void (^)(NSURLSessionDataTask *, id))success + failure:(void (^)(NSURLSessionDataTask *, NSError *))failure +{ + NSError *serializationError = nil; + NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:method URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters error:&serializationError]; + if (serializationError) { + if (failure) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{ + failure(nil, serializationError); + }); +#pragma clang diagnostic pop + } + + return nil; + } + + __block NSURLSessionDataTask *dataTask = nil; + dataTask = [self dataTaskWithRequest:request + uploadProgress:uploadProgress + downloadProgress:downloadProgress + completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) { + if (error) { + if (failure) { + failure(dataTask, error); + } + } else { + if (success) { + success(dataTask, responseObject); + } + } + }]; + + return dataTask; +} + +#pragma mark - NSObject + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@: %p, baseURL: %@, session: %@, operationQueue: %@>", NSStringFromClass([self class]), self, [self.baseURL absoluteString], self.session, self.operationQueue]; +} + +#pragma mark - NSSecureCoding + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (instancetype)initWithCoder:(NSCoder *)decoder { + NSURL *baseURL = [decoder decodeObjectOfClass:[NSURL class] forKey:NSStringFromSelector(@selector(baseURL))]; + NSURLSessionConfiguration *configuration = [decoder decodeObjectOfClass:[NSURLSessionConfiguration class] forKey:@"sessionConfiguration"]; + if (!configuration) { + NSString *configurationIdentifier = [decoder decodeObjectOfClass:[NSString class] forKey:@"identifier"]; + if (configurationIdentifier) { +#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1100) + configuration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:configurationIdentifier]; +#else + configuration = [NSURLSessionConfiguration backgroundSessionConfiguration:configurationIdentifier]; +#endif + } + } + + self = [self initWithBaseURL:baseURL sessionConfiguration:configuration]; + if (!self) { + return nil; + } + + self.requestSerializer = [decoder decodeObjectOfClass:[AFHTTPRequestSerializer class] forKey:NSStringFromSelector(@selector(requestSerializer))]; + self.responseSerializer = [decoder decodeObjectOfClass:[AFHTTPResponseSerializer class] forKey:NSStringFromSelector(@selector(responseSerializer))]; + AFSecurityPolicy *decodedPolicy = [decoder decodeObjectOfClass:[AFSecurityPolicy class] forKey:NSStringFromSelector(@selector(securityPolicy))]; + if (decodedPolicy) { + self.securityPolicy = decodedPolicy; + } + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [super encodeWithCoder:coder]; + + [coder encodeObject:self.baseURL forKey:NSStringFromSelector(@selector(baseURL))]; + if ([self.session.configuration conformsToProtocol:@protocol(NSCoding)]) { + [coder encodeObject:self.session.configuration forKey:@"sessionConfiguration"]; + } else { + [coder encodeObject:self.session.configuration.identifier forKey:@"identifier"]; + } + [coder encodeObject:self.requestSerializer forKey:NSStringFromSelector(@selector(requestSerializer))]; + [coder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))]; + [coder encodeObject:self.securityPolicy forKey:NSStringFromSelector(@selector(securityPolicy))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFHTTPSessionManager *HTTPClient = [[[self class] allocWithZone:zone] initWithBaseURL:self.baseURL sessionConfiguration:self.session.configuration]; + + HTTPClient.requestSerializer = [self.requestSerializer copyWithZone:zone]; + HTTPClient.responseSerializer = [self.responseSerializer copyWithZone:zone]; + HTTPClient.securityPolicy = [self.securityPolicy copyWithZone:zone]; + return HTTPClient; +} + +@end diff --git a/grocery-objc/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h b/grocery-objc/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h new file mode 100644 index 0000000..4cf0496 --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h @@ -0,0 +1,206 @@ +// AFNetworkReachabilityManager.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#if !TARGET_OS_WATCH +#import + +typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) { + AFNetworkReachabilityStatusUnknown = -1, + AFNetworkReachabilityStatusNotReachable = 0, + AFNetworkReachabilityStatusReachableViaWWAN = 1, + AFNetworkReachabilityStatusReachableViaWiFi = 2, +}; + +NS_ASSUME_NONNULL_BEGIN + +/** + `AFNetworkReachabilityManager` monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces. + + Reachability can be used to determine background information about why a network operation failed, or to trigger a network operation retrying when a connection is established. It should not be used to prevent a user from initiating a network request, as it's possible that an initial request may be required to establish reachability. + + See Apple's Reachability Sample Code (https://developer.apple.com/library/ios/samplecode/reachability/) + + @warning Instances of `AFNetworkReachabilityManager` must be started with `-startMonitoring` before reachability status can be determined. + */ +@interface AFNetworkReachabilityManager : NSObject + +/** + The current network reachability status. + */ +@property (readonly, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus; + +/** + Whether or not the network is currently reachable. + */ +@property (readonly, nonatomic, assign, getter = isReachable) BOOL reachable; + +/** + Whether or not the network is currently reachable via WWAN. + */ +@property (readonly, nonatomic, assign, getter = isReachableViaWWAN) BOOL reachableViaWWAN; + +/** + Whether or not the network is currently reachable via WiFi. + */ +@property (readonly, nonatomic, assign, getter = isReachableViaWiFi) BOOL reachableViaWiFi; + +///--------------------- +/// @name Initialization +///--------------------- + +/** + Returns the shared network reachability manager. + */ ++ (instancetype)sharedManager; + +/** + Creates and returns a network reachability manager with the default socket address. + + @return An initialized network reachability manager, actively monitoring the default socket address. + */ ++ (instancetype)manager; + +/** + Creates and returns a network reachability manager for the specified domain. + + @param domain The domain used to evaluate network reachability. + + @return An initialized network reachability manager, actively monitoring the specified domain. + */ ++ (instancetype)managerForDomain:(NSString *)domain; + +/** + Creates and returns a network reachability manager for the socket address. + + @param address The socket address (`sockaddr_in6`) used to evaluate network reachability. + + @return An initialized network reachability manager, actively monitoring the specified socket address. + */ ++ (instancetype)managerForAddress:(const void *)address; + +/** + Initializes an instance of a network reachability manager from the specified reachability object. + + @param reachability The reachability object to monitor. + + @return An initialized network reachability manager, actively monitoring the specified reachability. + */ +- (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER; + +///-------------------------------------------------- +/// @name Starting & Stopping Reachability Monitoring +///-------------------------------------------------- + +/** + Starts monitoring for changes in network reachability status. + */ +- (void)startMonitoring; + +/** + Stops monitoring for changes in network reachability status. + */ +- (void)stopMonitoring; + +///------------------------------------------------- +/// @name Getting Localized Reachability Description +///------------------------------------------------- + +/** + Returns a localized string representation of the current network reachability status. + */ +- (NSString *)localizedNetworkReachabilityStatusString; + +///--------------------------------------------------- +/// @name Setting Network Reachability Change Callback +///--------------------------------------------------- + +/** + Sets a callback to be executed when the network availability of the `baseURL` host changes. + + @param block A block object to be executed when the network availability of the `baseURL` host changes.. This block has no return value and takes a single argument which represents the various reachability states from the device to the `baseURL`. + */ +- (void)setReachabilityStatusChangeBlock:(nullable void (^)(AFNetworkReachabilityStatus status))block; + +@end + +///---------------- +/// @name Constants +///---------------- + +/** + ## Network Reachability + + The following constants are provided by `AFNetworkReachabilityManager` as possible network reachability statuses. + + enum { + AFNetworkReachabilityStatusUnknown, + AFNetworkReachabilityStatusNotReachable, + AFNetworkReachabilityStatusReachableViaWWAN, + AFNetworkReachabilityStatusReachableViaWiFi, + } + + `AFNetworkReachabilityStatusUnknown` + The `baseURL` host reachability is not known. + + `AFNetworkReachabilityStatusNotReachable` + The `baseURL` host cannot be reached. + + `AFNetworkReachabilityStatusReachableViaWWAN` + The `baseURL` host can be reached via a cellular connection, such as EDGE or GPRS. + + `AFNetworkReachabilityStatusReachableViaWiFi` + The `baseURL` host can be reached via a Wi-Fi connection. + + ### Keys for Notification UserInfo Dictionary + + Strings that are used as keys in a `userInfo` dictionary in a network reachability status change notification. + + `AFNetworkingReachabilityNotificationStatusItem` + A key in the userInfo dictionary in a `AFNetworkingReachabilityDidChangeNotification` notification. + The corresponding value is an `NSNumber` object representing the `AFNetworkReachabilityStatus` value for the current reachability status. + */ + +///-------------------- +/// @name Notifications +///-------------------- + +/** + Posted when network reachability changes. + This notification assigns no notification object. The `userInfo` dictionary contains an `NSNumber` object under the `AFNetworkingReachabilityNotificationStatusItem` key, representing the `AFNetworkReachabilityStatus` value for the current network reachability. + + @warning In order for network reachability to be monitored, include the `SystemConfiguration` framework in the active target's "Link Binary With Library" build phase, and add `#import ` to the header prefix of the project (`Prefix.pch`). + */ +FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityDidChangeNotification; +FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityNotificationStatusItem; + +///-------------------- +/// @name Functions +///-------------------- + +/** + Returns a localized string representation of an `AFNetworkReachabilityStatus` value. + */ +FOUNDATION_EXPORT NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status); + +NS_ASSUME_NONNULL_END +#endif diff --git a/grocery-objc/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m b/grocery-objc/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m new file mode 100644 index 0000000..5fba0f7 --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m @@ -0,0 +1,260 @@ +// AFNetworkReachabilityManager.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "AFNetworkReachabilityManager.h" +#if !TARGET_OS_WATCH + +#import +#import +#import +#import +#import + +NSString * const AFNetworkingReachabilityDidChangeNotification = @"com.alamofire.networking.reachability.change"; +NSString * const AFNetworkingReachabilityNotificationStatusItem = @"AFNetworkingReachabilityNotificationStatusItem"; + +typedef void (^AFNetworkReachabilityStatusBlock)(AFNetworkReachabilityStatus status); + +NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status) { + switch (status) { + case AFNetworkReachabilityStatusNotReachable: + return NSLocalizedStringFromTable(@"Not Reachable", @"AFNetworking", nil); + case AFNetworkReachabilityStatusReachableViaWWAN: + return NSLocalizedStringFromTable(@"Reachable via WWAN", @"AFNetworking", nil); + case AFNetworkReachabilityStatusReachableViaWiFi: + return NSLocalizedStringFromTable(@"Reachable via WiFi", @"AFNetworking", nil); + case AFNetworkReachabilityStatusUnknown: + default: + return NSLocalizedStringFromTable(@"Unknown", @"AFNetworking", nil); + } +} + +static AFNetworkReachabilityStatus AFNetworkReachabilityStatusForFlags(SCNetworkReachabilityFlags flags) { + BOOL isReachable = ((flags & kSCNetworkReachabilityFlagsReachable) != 0); + BOOL needsConnection = ((flags & kSCNetworkReachabilityFlagsConnectionRequired) != 0); + BOOL canConnectionAutomatically = (((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) || ((flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0)); + BOOL canConnectWithoutUserInteraction = (canConnectionAutomatically && (flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0); + BOOL isNetworkReachable = (isReachable && (!needsConnection || canConnectWithoutUserInteraction)); + + AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusUnknown; + if (isNetworkReachable == NO) { + status = AFNetworkReachabilityStatusNotReachable; + } +#if TARGET_OS_IPHONE + else if ((flags & kSCNetworkReachabilityFlagsIsWWAN) != 0) { + status = AFNetworkReachabilityStatusReachableViaWWAN; + } +#endif + else { + status = AFNetworkReachabilityStatusReachableViaWiFi; + } + + return status; +} + +/** + * Queue a status change notification for the main thread. + * + * This is done to ensure that the notifications are received in the same order + * as they are sent. If notifications are sent directly, it is possible that + * a queued notification (for an earlier status condition) is processed after + * the later update, resulting in the listener being left in the wrong state. + */ +static void AFPostReachabilityStatusChange(SCNetworkReachabilityFlags flags, AFNetworkReachabilityStatusBlock block) { + AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags); + dispatch_async(dispatch_get_main_queue(), ^{ + if (block) { + block(status); + } + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + NSDictionary *userInfo = @{ AFNetworkingReachabilityNotificationStatusItem: @(status) }; + [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:userInfo]; + }); +} + +static void AFNetworkReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNetworkReachabilityFlags flags, void *info) { + AFPostReachabilityStatusChange(flags, (__bridge AFNetworkReachabilityStatusBlock)info); +} + + +static const void * AFNetworkReachabilityRetainCallback(const void *info) { + return Block_copy(info); +} + +static void AFNetworkReachabilityReleaseCallback(const void *info) { + if (info) { + Block_release(info); + } +} + +@interface AFNetworkReachabilityManager () +@property (readwrite, nonatomic, strong) id networkReachability; +@property (readwrite, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus; +@property (readwrite, nonatomic, copy) AFNetworkReachabilityStatusBlock networkReachabilityStatusBlock; +@end + +@implementation AFNetworkReachabilityManager + ++ (instancetype)sharedManager { + static AFNetworkReachabilityManager *_sharedManager = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _sharedManager = [self manager]; + }); + + return _sharedManager; +} + +#ifndef __clang_analyzer__ ++ (instancetype)managerForDomain:(NSString *)domain { + SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, [domain UTF8String]); + + AFNetworkReachabilityManager *manager = [[self alloc] initWithReachability:reachability]; + + return manager; +} +#endif + +#ifndef __clang_analyzer__ ++ (instancetype)managerForAddress:(const void *)address { + SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr *)address); + AFNetworkReachabilityManager *manager = [[self alloc] initWithReachability:reachability]; + + return manager; +} +#endif + ++ (instancetype)manager +{ +#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) + struct sockaddr_in6 address; + bzero(&address, sizeof(address)); + address.sin6_len = sizeof(address); + address.sin6_family = AF_INET6; +#else + struct sockaddr_in address; + bzero(&address, sizeof(address)); + address.sin_len = sizeof(address); + address.sin_family = AF_INET; +#endif + return [self managerForAddress:&address]; +} + +- (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability { + self = [super init]; + if (!self) { + return nil; + } + + self.networkReachability = CFBridgingRelease(reachability); + self.networkReachabilityStatus = AFNetworkReachabilityStatusUnknown; + + return self; +} + +- (instancetype)init NS_UNAVAILABLE +{ + return nil; +} + +- (void)dealloc { + [self stopMonitoring]; +} + +#pragma mark - + +- (BOOL)isReachable { + return [self isReachableViaWWAN] || [self isReachableViaWiFi]; +} + +- (BOOL)isReachableViaWWAN { + return self.networkReachabilityStatus == AFNetworkReachabilityStatusReachableViaWWAN; +} + +- (BOOL)isReachableViaWiFi { + return self.networkReachabilityStatus == AFNetworkReachabilityStatusReachableViaWiFi; +} + +#pragma mark - + +- (void)startMonitoring { + [self stopMonitoring]; + + if (!self.networkReachability) { + return; + } + + __weak __typeof(self)weakSelf = self; + AFNetworkReachabilityStatusBlock callback = ^(AFNetworkReachabilityStatus status) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + + strongSelf.networkReachabilityStatus = status; + if (strongSelf.networkReachabilityStatusBlock) { + strongSelf.networkReachabilityStatusBlock(status); + } + + }; + + id networkReachability = self.networkReachability; + SCNetworkReachabilityContext context = {0, (__bridge void *)callback, AFNetworkReachabilityRetainCallback, AFNetworkReachabilityReleaseCallback, NULL}; + SCNetworkReachabilitySetCallback((__bridge SCNetworkReachabilityRef)networkReachability, AFNetworkReachabilityCallback, &context); + SCNetworkReachabilityScheduleWithRunLoop((__bridge SCNetworkReachabilityRef)networkReachability, CFRunLoopGetMain(), kCFRunLoopCommonModes); + + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0),^{ + SCNetworkReachabilityFlags flags; + if (SCNetworkReachabilityGetFlags((__bridge SCNetworkReachabilityRef)networkReachability, &flags)) { + AFPostReachabilityStatusChange(flags, callback); + } + }); +} + +- (void)stopMonitoring { + if (!self.networkReachability) { + return; + } + + SCNetworkReachabilityUnscheduleFromRunLoop((__bridge SCNetworkReachabilityRef)self.networkReachability, CFRunLoopGetMain(), kCFRunLoopCommonModes); +} + +#pragma mark - + +- (NSString *)localizedNetworkReachabilityStatusString { + return AFStringFromNetworkReachabilityStatus(self.networkReachabilityStatus); +} + +#pragma mark - + +- (void)setReachabilityStatusChangeBlock:(void (^)(AFNetworkReachabilityStatus status))block { + self.networkReachabilityStatusBlock = block; +} + +#pragma mark - NSKeyValueObserving + ++ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key { + if ([key isEqualToString:@"reachable"] || [key isEqualToString:@"reachableViaWWAN"] || [key isEqualToString:@"reachableViaWiFi"]) { + return [NSSet setWithObject:@"networkReachabilityStatus"]; + } + + return [super keyPathsForValuesAffectingValueForKey:key]; +} + +@end +#endif diff --git a/grocery-objc/Pods/AFNetworking/AFNetworking/AFNetworking.h b/grocery-objc/Pods/AFNetworking/AFNetworking/AFNetworking.h new file mode 100644 index 0000000..e2fb2f4 --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/AFNetworking/AFNetworking.h @@ -0,0 +1,41 @@ +// AFNetworking.h +// +// Copyright (c) 2013 AFNetworking (http://afnetworking.com/) +// +// 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. + +#import +#import +#import + +#ifndef _AFNETWORKING_ + #define _AFNETWORKING_ + + #import "AFURLRequestSerialization.h" + #import "AFURLResponseSerialization.h" + #import "AFSecurityPolicy.h" + +#if !TARGET_OS_WATCH + #import "AFNetworkReachabilityManager.h" +#endif + + #import "AFURLSessionManager.h" + #import "AFHTTPSessionManager.h" + +#endif /* _AFNETWORKING_ */ diff --git a/grocery-objc/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h b/grocery-objc/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h new file mode 100644 index 0000000..90fa212 --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h @@ -0,0 +1,154 @@ +// AFSecurityPolicy.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import +#import + +typedef NS_ENUM(NSUInteger, AFSSLPinningMode) { + AFSSLPinningModeNone, + AFSSLPinningModePublicKey, + AFSSLPinningModeCertificate, +}; + +/** + `AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections. + + Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled. + */ + +NS_ASSUME_NONNULL_BEGIN + +@interface AFSecurityPolicy : NSObject + +/** + The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`. + */ +@property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode; + +/** + The certificates used to evaluate server trust according to the SSL pinning mode. + + By default, this property is set to any (`.cer`) certificates included in the target compiling AFNetworking. Note that if you are using AFNetworking as embedded framework, no certificates will be pinned by default. Use `certificatesInBundle` to load certificates from your target, and then create a new policy by calling `policyWithPinningMode:withPinnedCertificates`. + + Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches. + */ +@property (nonatomic, strong, nullable) NSSet *pinnedCertificates; + +/** + Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`. + */ +@property (nonatomic, assign) BOOL allowInvalidCertificates; + +/** + Whether or not to validate the domain name in the certificate's CN field. Defaults to `YES`. + */ +@property (nonatomic, assign) BOOL validatesDomainName; + +///----------------------------------------- +/// @name Getting Certificates from the Bundle +///----------------------------------------- + +/** + Returns any certificates included in the bundle. If you are using AFNetworking as an embedded framework, you must use this method to find the certificates you have included in your app bundle, and use them when creating your security policy by calling `policyWithPinningMode:withPinnedCertificates`. + + @return The certificates included in the given bundle. + */ ++ (NSSet *)certificatesInBundle:(NSBundle *)bundle; + +///----------------------------------------- +/// @name Getting Specific Security Policies +///----------------------------------------- + +/** + Returns the shared default security policy, which does not allow invalid certificates, validates domain name, and does not validate against pinned certificates or public keys. + + @return The default security policy. + */ ++ (instancetype)defaultPolicy; + +///--------------------- +/// @name Initialization +///--------------------- + +/** + Creates and returns a security policy with the specified pinning mode. + + @param pinningMode The SSL pinning mode. + + @return A new security policy. + */ ++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode; + +/** + Creates and returns a security policy with the specified pinning mode. + + @param pinningMode The SSL pinning mode. + @param pinnedCertificates The certificates to pin against. + + @return A new security policy. + */ ++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates; + +///------------------------------ +/// @name Evaluating Server Trust +///------------------------------ + +/** + Whether or not the specified server trust should be accepted, based on the security policy. + + This method should be used when responding to an authentication challenge from a server. + + @param serverTrust The X.509 certificate trust of the server. + @param domain The domain of serverTrust. If `nil`, the domain will not be validated. + + @return Whether or not to trust the server. + */ +- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust + forDomain:(nullable NSString *)domain; + +@end + +NS_ASSUME_NONNULL_END + +///---------------- +/// @name Constants +///---------------- + +/** + ## SSL Pinning Modes + + The following constants are provided by `AFSSLPinningMode` as possible SSL pinning modes. + + enum { + AFSSLPinningModeNone, + AFSSLPinningModePublicKey, + AFSSLPinningModeCertificate, + } + + `AFSSLPinningModeNone` + Do not used pinned certificates to validate servers. + + `AFSSLPinningModePublicKey` + Validate host certificates against public keys of pinned certificates. + + `AFSSLPinningModeCertificate` + Validate host certificates against pinned certificates. +*/ diff --git a/grocery-objc/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m b/grocery-objc/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m new file mode 100644 index 0000000..3704cca --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m @@ -0,0 +1,353 @@ +// AFSecurityPolicy.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "AFSecurityPolicy.h" + +#import + +#if !TARGET_OS_IOS && !TARGET_OS_WATCH && !TARGET_OS_TV +static NSData * AFSecKeyGetData(SecKeyRef key) { + CFDataRef data = NULL; + + __Require_noErr_Quiet(SecItemExport(key, kSecFormatUnknown, kSecItemPemArmour, NULL, &data), _out); + + return (__bridge_transfer NSData *)data; + +_out: + if (data) { + CFRelease(data); + } + + return nil; +} +#endif + +static BOOL AFSecKeyIsEqualToKey(SecKeyRef key1, SecKeyRef key2) { +#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV + return [(__bridge id)key1 isEqual:(__bridge id)key2]; +#else + return [AFSecKeyGetData(key1) isEqual:AFSecKeyGetData(key2)]; +#endif +} + +static id AFPublicKeyForCertificate(NSData *certificate) { + id allowedPublicKey = nil; + SecCertificateRef allowedCertificate; + SecCertificateRef allowedCertificates[1]; + CFArrayRef tempCertificates = nil; + SecPolicyRef policy = nil; + SecTrustRef allowedTrust = nil; + SecTrustResultType result; + + allowedCertificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificate); + __Require_Quiet(allowedCertificate != NULL, _out); + + allowedCertificates[0] = allowedCertificate; + tempCertificates = CFArrayCreate(NULL, (const void **)allowedCertificates, 1, NULL); + + policy = SecPolicyCreateBasicX509(); + __Require_noErr_Quiet(SecTrustCreateWithCertificates(tempCertificates, policy, &allowedTrust), _out); + __Require_noErr_Quiet(SecTrustEvaluate(allowedTrust, &result), _out); + + allowedPublicKey = (__bridge_transfer id)SecTrustCopyPublicKey(allowedTrust); + +_out: + if (allowedTrust) { + CFRelease(allowedTrust); + } + + if (policy) { + CFRelease(policy); + } + + if (tempCertificates) { + CFRelease(tempCertificates); + } + + if (allowedCertificate) { + CFRelease(allowedCertificate); + } + + return allowedPublicKey; +} + +static BOOL AFServerTrustIsValid(SecTrustRef serverTrust) { + BOOL isValid = NO; + SecTrustResultType result; + __Require_noErr_Quiet(SecTrustEvaluate(serverTrust, &result), _out); + + isValid = (result == kSecTrustResultUnspecified || result == kSecTrustResultProceed); + +_out: + return isValid; +} + +static NSArray * AFCertificateTrustChainForServerTrust(SecTrustRef serverTrust) { + CFIndex certificateCount = SecTrustGetCertificateCount(serverTrust); + NSMutableArray *trustChain = [NSMutableArray arrayWithCapacity:(NSUInteger)certificateCount]; + + for (CFIndex i = 0; i < certificateCount; i++) { + SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, i); + [trustChain addObject:(__bridge_transfer NSData *)SecCertificateCopyData(certificate)]; + } + + return [NSArray arrayWithArray:trustChain]; +} + +static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) { + SecPolicyRef policy = SecPolicyCreateBasicX509(); + CFIndex certificateCount = SecTrustGetCertificateCount(serverTrust); + NSMutableArray *trustChain = [NSMutableArray arrayWithCapacity:(NSUInteger)certificateCount]; + for (CFIndex i = 0; i < certificateCount; i++) { + SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, i); + + SecCertificateRef someCertificates[] = {certificate}; + CFArrayRef certificates = CFArrayCreate(NULL, (const void **)someCertificates, 1, NULL); + + SecTrustRef trust; + __Require_noErr_Quiet(SecTrustCreateWithCertificates(certificates, policy, &trust), _out); + + SecTrustResultType result; + __Require_noErr_Quiet(SecTrustEvaluate(trust, &result), _out); + + [trustChain addObject:(__bridge_transfer id)SecTrustCopyPublicKey(trust)]; + + _out: + if (trust) { + CFRelease(trust); + } + + if (certificates) { + CFRelease(certificates); + } + + continue; + } + CFRelease(policy); + + return [NSArray arrayWithArray:trustChain]; +} + +#pragma mark - + +@interface AFSecurityPolicy() +@property (readwrite, nonatomic, assign) AFSSLPinningMode SSLPinningMode; +@property (readwrite, nonatomic, strong) NSSet *pinnedPublicKeys; +@end + +@implementation AFSecurityPolicy + ++ (NSSet *)certificatesInBundle:(NSBundle *)bundle { + NSArray *paths = [bundle pathsForResourcesOfType:@"cer" inDirectory:@"."]; + + NSMutableSet *certificates = [NSMutableSet setWithCapacity:[paths count]]; + for (NSString *path in paths) { + NSData *certificateData = [NSData dataWithContentsOfFile:path]; + [certificates addObject:certificateData]; + } + + return [NSSet setWithSet:certificates]; +} + ++ (NSSet *)defaultPinnedCertificates { + static NSSet *_defaultPinnedCertificates = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + NSBundle *bundle = [NSBundle bundleForClass:[self class]]; + _defaultPinnedCertificates = [self certificatesInBundle:bundle]; + }); + + return _defaultPinnedCertificates; +} + ++ (instancetype)defaultPolicy { + AFSecurityPolicy *securityPolicy = [[self alloc] init]; + securityPolicy.SSLPinningMode = AFSSLPinningModeNone; + + return securityPolicy; +} + ++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode { + return [self policyWithPinningMode:pinningMode withPinnedCertificates:[self defaultPinnedCertificates]]; +} + ++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates { + AFSecurityPolicy *securityPolicy = [[self alloc] init]; + securityPolicy.SSLPinningMode = pinningMode; + + [securityPolicy setPinnedCertificates:pinnedCertificates]; + + return securityPolicy; +} + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + self.validatesDomainName = YES; + + return self; +} + +- (void)setPinnedCertificates:(NSSet *)pinnedCertificates { + _pinnedCertificates = pinnedCertificates; + + if (self.pinnedCertificates) { + NSMutableSet *mutablePinnedPublicKeys = [NSMutableSet setWithCapacity:[self.pinnedCertificates count]]; + for (NSData *certificate in self.pinnedCertificates) { + id publicKey = AFPublicKeyForCertificate(certificate); + if (!publicKey) { + continue; + } + [mutablePinnedPublicKeys addObject:publicKey]; + } + self.pinnedPublicKeys = [NSSet setWithSet:mutablePinnedPublicKeys]; + } else { + self.pinnedPublicKeys = nil; + } +} + +#pragma mark - + +- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust + forDomain:(NSString *)domain +{ + if (domain && self.allowInvalidCertificates && self.validatesDomainName && (self.SSLPinningMode == AFSSLPinningModeNone || [self.pinnedCertificates count] == 0)) { + // https://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/NetworkingTopics/Articles/OverridingSSLChainValidationCorrectly.html + // According to the docs, you should only trust your provided certs for evaluation. + // Pinned certificates are added to the trust. Without pinned certificates, + // there is nothing to evaluate against. + // + // From Apple Docs: + // "Do not implicitly trust self-signed certificates as anchors (kSecTrustOptionImplicitAnchors). + // Instead, add your own (self-signed) CA certificate to the list of trusted anchors." + NSLog(@"In order to validate a domain name for self signed certificates, you MUST use pinning."); + return NO; + } + + NSMutableArray *policies = [NSMutableArray array]; + if (self.validatesDomainName) { + [policies addObject:(__bridge_transfer id)SecPolicyCreateSSL(true, (__bridge CFStringRef)domain)]; + } else { + [policies addObject:(__bridge_transfer id)SecPolicyCreateBasicX509()]; + } + + SecTrustSetPolicies(serverTrust, (__bridge CFArrayRef)policies); + + if (self.SSLPinningMode == AFSSLPinningModeNone) { + return self.allowInvalidCertificates || AFServerTrustIsValid(serverTrust); + } else if (!AFServerTrustIsValid(serverTrust) && !self.allowInvalidCertificates) { + return NO; + } + + switch (self.SSLPinningMode) { + case AFSSLPinningModeNone: + default: + return NO; + case AFSSLPinningModeCertificate: { + NSMutableArray *pinnedCertificates = [NSMutableArray array]; + for (NSData *certificateData in self.pinnedCertificates) { + [pinnedCertificates addObject:(__bridge_transfer id)SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificateData)]; + } + SecTrustSetAnchorCertificates(serverTrust, (__bridge CFArrayRef)pinnedCertificates); + + if (!AFServerTrustIsValid(serverTrust)) { + return NO; + } + + // obtain the chain after being validated, which *should* contain the pinned certificate in the last position (if it's the Root CA) + NSArray *serverCertificates = AFCertificateTrustChainForServerTrust(serverTrust); + + for (NSData *trustChainCertificate in [serverCertificates reverseObjectEnumerator]) { + if ([self.pinnedCertificates containsObject:trustChainCertificate]) { + return YES; + } + } + + return NO; + } + case AFSSLPinningModePublicKey: { + NSUInteger trustedPublicKeyCount = 0; + NSArray *publicKeys = AFPublicKeyTrustChainForServerTrust(serverTrust); + + for (id trustChainPublicKey in publicKeys) { + for (id pinnedPublicKey in self.pinnedPublicKeys) { + if (AFSecKeyIsEqualToKey((__bridge SecKeyRef)trustChainPublicKey, (__bridge SecKeyRef)pinnedPublicKey)) { + trustedPublicKeyCount += 1; + } + } + } + return trustedPublicKeyCount > 0; + } + } + + return NO; +} + +#pragma mark - NSKeyValueObserving + ++ (NSSet *)keyPathsForValuesAffectingPinnedPublicKeys { + return [NSSet setWithObject:@"pinnedCertificates"]; +} + +#pragma mark - NSSecureCoding + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (instancetype)initWithCoder:(NSCoder *)decoder { + + self = [self init]; + if (!self) { + return nil; + } + + self.SSLPinningMode = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(SSLPinningMode))] unsignedIntegerValue]; + self.allowInvalidCertificates = [decoder decodeBoolForKey:NSStringFromSelector(@selector(allowInvalidCertificates))]; + self.validatesDomainName = [decoder decodeBoolForKey:NSStringFromSelector(@selector(validatesDomainName))]; + self.pinnedCertificates = [decoder decodeObjectOfClass:[NSArray class] forKey:NSStringFromSelector(@selector(pinnedCertificates))]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [coder encodeObject:[NSNumber numberWithUnsignedInteger:self.SSLPinningMode] forKey:NSStringFromSelector(@selector(SSLPinningMode))]; + [coder encodeBool:self.allowInvalidCertificates forKey:NSStringFromSelector(@selector(allowInvalidCertificates))]; + [coder encodeBool:self.validatesDomainName forKey:NSStringFromSelector(@selector(validatesDomainName))]; + [coder encodeObject:self.pinnedCertificates forKey:NSStringFromSelector(@selector(pinnedCertificates))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFSecurityPolicy *securityPolicy = [[[self class] allocWithZone:zone] init]; + securityPolicy.SSLPinningMode = self.SSLPinningMode; + securityPolicy.allowInvalidCertificates = self.allowInvalidCertificates; + securityPolicy.validatesDomainName = self.validatesDomainName; + securityPolicy.pinnedCertificates = [self.pinnedCertificates copyWithZone:zone]; + + return securityPolicy; +} + +@end diff --git a/grocery-objc/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h b/grocery-objc/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h new file mode 100644 index 0000000..134b7dd --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h @@ -0,0 +1,454 @@ +// AFURLRequestSerialization.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import +#import + +#if TARGET_OS_IOS || TARGET_OS_TV +#import +#elif TARGET_OS_WATCH +#import +#endif + +NS_ASSUME_NONNULL_BEGIN + +/** + The `AFURLRequestSerialization` protocol is adopted by an object that encodes parameters for a specified HTTP requests. Request serializers may encode parameters as query strings, HTTP bodies, setting the appropriate HTTP header fields as necessary. + + For example, a JSON request serializer may set the HTTP body of the request to a JSON representation, and set the `Content-Type` HTTP header field value to `application/json`. + */ +@protocol AFURLRequestSerialization + +/** + Returns a request with the specified parameters encoded into a copy of the original request. + + @param request The original request. + @param parameters The parameters to be encoded. + @param error The error that occurred while attempting to encode the request parameters. + + @return A serialized request. + */ +- (nullable NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request + withParameters:(nullable id)parameters + error:(NSError * _Nullable __autoreleasing *)error NS_SWIFT_NOTHROW; + +@end + +#pragma mark - + +/** + + */ +typedef NS_ENUM(NSUInteger, AFHTTPRequestQueryStringSerializationStyle) { + AFHTTPRequestQueryStringDefaultStyle = 0, +}; + +@protocol AFMultipartFormData; + +/** + `AFHTTPRequestSerializer` conforms to the `AFURLRequestSerialization` & `AFURLResponseSerialization` protocols, offering a concrete base implementation of query string / URL form-encoded parameter serialization and default request headers, as well as response status code and content type validation. + + Any request or response serializer dealing with HTTP is encouraged to subclass `AFHTTPRequestSerializer` in order to ensure consistent default behavior. + */ +@interface AFHTTPRequestSerializer : NSObject + +/** + The string encoding used to serialize parameters. `NSUTF8StringEncoding` by default. + */ +@property (nonatomic, assign) NSStringEncoding stringEncoding; + +/** + Whether created requests can use the device’s cellular radio (if present). `YES` by default. + + @see NSMutableURLRequest -setAllowsCellularAccess: + */ +@property (nonatomic, assign) BOOL allowsCellularAccess; + +/** + The cache policy of created requests. `NSURLRequestUseProtocolCachePolicy` by default. + + @see NSMutableURLRequest -setCachePolicy: + */ +@property (nonatomic, assign) NSURLRequestCachePolicy cachePolicy; + +/** + Whether created requests should use the default cookie handling. `YES` by default. + + @see NSMutableURLRequest -setHTTPShouldHandleCookies: + */ +@property (nonatomic, assign) BOOL HTTPShouldHandleCookies; + +/** + Whether created requests can continue transmitting data before receiving a response from an earlier transmission. `NO` by default + + @see NSMutableURLRequest -setHTTPShouldUsePipelining: + */ +@property (nonatomic, assign) BOOL HTTPShouldUsePipelining; + +/** + The network service type for created requests. `NSURLNetworkServiceTypeDefault` by default. + + @see NSMutableURLRequest -setNetworkServiceType: + */ +@property (nonatomic, assign) NSURLRequestNetworkServiceType networkServiceType; + +/** + The timeout interval, in seconds, for created requests. The default timeout interval is 60 seconds. + + @see NSMutableURLRequest -setTimeoutInterval: + */ +@property (nonatomic, assign) NSTimeInterval timeoutInterval; + +///--------------------------------------- +/// @name Configuring HTTP Request Headers +///--------------------------------------- + +/** + Default HTTP header field values to be applied to serialized requests. By default, these include the following: + + - `Accept-Language` with the contents of `NSLocale +preferredLanguages` + - `User-Agent` with the contents of various bundle identifiers and OS designations + + @discussion To add or remove default request headers, use `setValue:forHTTPHeaderField:`. + */ +@property (readonly, nonatomic, strong) NSDictionary *HTTPRequestHeaders; + +/** + Creates and returns a serializer with default configuration. + */ ++ (instancetype)serializer; + +/** + Sets the value for the HTTP headers set in request objects made by the HTTP client. If `nil`, removes the existing value for that header. + + @param field The HTTP header to set a default value for + @param value The value set as default for the specified header, or `nil` + */ +- (void)setValue:(nullable NSString *)value +forHTTPHeaderField:(NSString *)field; + +/** + Returns the value for the HTTP headers set in the request serializer. + + @param field The HTTP header to retrieve the default value for + + @return The value set as default for the specified header, or `nil` + */ +- (nullable NSString *)valueForHTTPHeaderField:(NSString *)field; + +/** + Sets the "Authorization" HTTP header set in request objects made by the HTTP client to a basic authentication value with Base64-encoded username and password. This overwrites any existing value for this header. + + @param username The HTTP basic auth username + @param password The HTTP basic auth password + */ +- (void)setAuthorizationHeaderFieldWithUsername:(NSString *)username + password:(NSString *)password; + +/** + Clears any existing value for the "Authorization" HTTP header. + */ +- (void)clearAuthorizationHeader; + +///------------------------------------------------------- +/// @name Configuring Query String Parameter Serialization +///------------------------------------------------------- + +/** + HTTP methods for which serialized requests will encode parameters as a query string. `GET`, `HEAD`, and `DELETE` by default. + */ +@property (nonatomic, strong) NSSet *HTTPMethodsEncodingParametersInURI; + +/** + Set the method of query string serialization according to one of the pre-defined styles. + + @param style The serialization style. + + @see AFHTTPRequestQueryStringSerializationStyle + */ +- (void)setQueryStringSerializationWithStyle:(AFHTTPRequestQueryStringSerializationStyle)style; + +/** + Set the a custom method of query string serialization according to the specified block. + + @param block A block that defines a process of encoding parameters into a query string. This block returns the query string and takes three arguments: the request, the parameters to encode, and the error that occurred when attempting to encode parameters for the given request. + */ +- (void)setQueryStringSerializationWithBlock:(nullable NSString * (^)(NSURLRequest *request, id parameters, NSError * __autoreleasing *error))block; + +///------------------------------- +/// @name Creating Request Objects +///------------------------------- + +/** + Creates an `NSMutableURLRequest` object with the specified HTTP method and URL string. + + If the HTTP method is `GET`, `HEAD`, or `DELETE`, the parameters will be used to construct a url-encoded query string that is appended to the request's URL. Otherwise, the parameters will be encoded according to the value of the `parameterEncoding` property, and set as the request body. + + @param method The HTTP method for the request, such as `GET`, `POST`, `PUT`, or `DELETE`. This parameter must not be `nil`. + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be either set as a query string for `GET` requests, or the request HTTP body. + @param error The error that occurred while constructing the request. + + @return An `NSMutableURLRequest` object. + */ +- (NSMutableURLRequest *)requestWithMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(nullable id)parameters + error:(NSError * _Nullable __autoreleasing *)error; + +/** + Creates an `NSMutableURLRequest` object with the specified HTTP method and URLString, and constructs a `multipart/form-data` HTTP body, using the specified parameters and multipart form data block. See http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.2 + + Multipart form requests are automatically streamed, reading files directly from disk along with in-memory data in a single HTTP body. The resulting `NSMutableURLRequest` object has an `HTTPBodyStream` property, so refrain from setting `HTTPBodyStream` or `HTTPBody` on this request object, as it will clear out the multipart form body stream. + + @param method The HTTP method for the request. This parameter must not be `GET` or `HEAD`, or `nil`. + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded and set in the request HTTP body. + @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol. + @param error The error that occurred while constructing the request. + + @return An `NSMutableURLRequest` object + */ +- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(nullable NSDictionary *)parameters + constructingBodyWithBlock:(nullable void (^)(id formData))block + error:(NSError * _Nullable __autoreleasing *)error; + +/** + Creates an `NSMutableURLRequest` by removing the `HTTPBodyStream` from a request, and asynchronously writing its contents into the specified file, invoking the completion handler when finished. + + @param request The multipart form request. The `HTTPBodyStream` property of `request` must not be `nil`. + @param fileURL The file URL to write multipart form contents to. + @param handler A handler block to execute. + + @discussion There is a bug in `NSURLSessionTask` that causes requests to not send a `Content-Length` header when streaming contents from an HTTP body, which is notably problematic when interacting with the Amazon S3 webservice. As a workaround, this method takes a request constructed with `multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:error:`, or any other request with an `HTTPBodyStream`, writes the contents to the specified file and returns a copy of the original request with the `HTTPBodyStream` property set to `nil`. From here, the file can either be passed to `AFURLSessionManager -uploadTaskWithRequest:fromFile:progress:completionHandler:`, or have its contents read into an `NSData` that's assigned to the `HTTPBody` property of the request. + + @see https://github.com/AFNetworking/AFNetworking/issues/1398 + */ +- (NSMutableURLRequest *)requestWithMultipartFormRequest:(NSURLRequest *)request + writingStreamContentsToFile:(NSURL *)fileURL + completionHandler:(nullable void (^)(NSError * _Nullable error))handler; + +@end + +#pragma mark - + +/** + The `AFMultipartFormData` protocol defines the methods supported by the parameter in the block argument of `AFHTTPRequestSerializer -multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:`. + */ +@protocol AFMultipartFormData + +/** + Appends the HTTP header `Content-Disposition: file; filename=#{generated filename}; name=#{name}"` and `Content-Type: #{generated mimeType}`, followed by the encoded file data and the multipart form boundary. + + The filename and MIME type for this data in the form will be automatically generated, using the last path component of the `fileURL` and system associated MIME type for the `fileURL` extension, respectively. + + @param fileURL The URL corresponding to the file whose content will be appended to the form. This parameter must not be `nil`. + @param name The name to be associated with the specified data. This parameter must not be `nil`. + @param error If an error occurs, upon return contains an `NSError` object that describes the problem. + + @return `YES` if the file data was successfully appended, otherwise `NO`. + */ +- (BOOL)appendPartWithFileURL:(NSURL *)fileURL + name:(NSString *)name + error:(NSError * _Nullable __autoreleasing *)error; + +/** + Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the encoded file data and the multipart form boundary. + + @param fileURL The URL corresponding to the file whose content will be appended to the form. This parameter must not be `nil`. + @param name The name to be associated with the specified data. This parameter must not be `nil`. + @param fileName The file name to be used in the `Content-Disposition` header. This parameter must not be `nil`. + @param mimeType The declared MIME type of the file data. This parameter must not be `nil`. + @param error If an error occurs, upon return contains an `NSError` object that describes the problem. + + @return `YES` if the file data was successfully appended otherwise `NO`. + */ +- (BOOL)appendPartWithFileURL:(NSURL *)fileURL + name:(NSString *)name + fileName:(NSString *)fileName + mimeType:(NSString *)mimeType + error:(NSError * _Nullable __autoreleasing *)error; + +/** + Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the data from the input stream and the multipart form boundary. + + @param inputStream The input stream to be appended to the form data + @param name The name to be associated with the specified input stream. This parameter must not be `nil`. + @param fileName The filename to be associated with the specified input stream. This parameter must not be `nil`. + @param length The length of the specified input stream in bytes. + @param mimeType The MIME type of the specified data. (For example, the MIME type for a JPEG image is image/jpeg.) For a list of valid MIME types, see http://www.iana.org/assignments/media-types/. This parameter must not be `nil`. + */ +- (void)appendPartWithInputStream:(nullable NSInputStream *)inputStream + name:(NSString *)name + fileName:(NSString *)fileName + length:(int64_t)length + mimeType:(NSString *)mimeType; + +/** + Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the encoded file data and the multipart form boundary. + + @param data The data to be encoded and appended to the form data. + @param name The name to be associated with the specified data. This parameter must not be `nil`. + @param fileName The filename to be associated with the specified data. This parameter must not be `nil`. + @param mimeType The MIME type of the specified data. (For example, the MIME type for a JPEG image is image/jpeg.) For a list of valid MIME types, see http://www.iana.org/assignments/media-types/. This parameter must not be `nil`. + */ +- (void)appendPartWithFileData:(NSData *)data + name:(NSString *)name + fileName:(NSString *)fileName + mimeType:(NSString *)mimeType; + +/** + Appends the HTTP headers `Content-Disposition: form-data; name=#{name}"`, followed by the encoded data and the multipart form boundary. + + @param data The data to be encoded and appended to the form data. + @param name The name to be associated with the specified data. This parameter must not be `nil`. + */ + +- (void)appendPartWithFormData:(NSData *)data + name:(NSString *)name; + + +/** + Appends HTTP headers, followed by the encoded data and the multipart form boundary. + + @param headers The HTTP headers to be appended to the form data. + @param body The data to be encoded and appended to the form data. This parameter must not be `nil`. + */ +- (void)appendPartWithHeaders:(nullable NSDictionary *)headers + body:(NSData *)body; + +/** + Throttles request bandwidth by limiting the packet size and adding a delay for each chunk read from the upload stream. + + When uploading over a 3G or EDGE connection, requests may fail with "request body stream exhausted". Setting a maximum packet size and delay according to the recommended values (`kAFUploadStream3GSuggestedPacketSize` and `kAFUploadStream3GSuggestedDelay`) lowers the risk of the input stream exceeding its allocated bandwidth. Unfortunately, there is no definite way to distinguish between a 3G, EDGE, or LTE connection over `NSURLConnection`. As such, it is not recommended that you throttle bandwidth based solely on network reachability. Instead, you should consider checking for the "request body stream exhausted" in a failure block, and then retrying the request with throttled bandwidth. + + @param numberOfBytes Maximum packet size, in number of bytes. The default packet size for an input stream is 16kb. + @param delay Duration of delay each time a packet is read. By default, no delay is set. + */ +- (void)throttleBandwidthWithPacketSize:(NSUInteger)numberOfBytes + delay:(NSTimeInterval)delay; + +@end + +#pragma mark - + +/** + `AFJSONRequestSerializer` is a subclass of `AFHTTPRequestSerializer` that encodes parameters as JSON using `NSJSONSerialization`, setting the `Content-Type` of the encoded request to `application/json`. + */ +@interface AFJSONRequestSerializer : AFHTTPRequestSerializer + +/** + Options for writing the request JSON data from Foundation objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONWritingOptions". `0` by default. + */ +@property (nonatomic, assign) NSJSONWritingOptions writingOptions; + +/** + Creates and returns a JSON serializer with specified reading and writing options. + + @param writingOptions The specified JSON writing options. + */ ++ (instancetype)serializerWithWritingOptions:(NSJSONWritingOptions)writingOptions; + +@end + +#pragma mark - + +/** + `AFPropertyListRequestSerializer` is a subclass of `AFHTTPRequestSerializer` that encodes parameters as JSON using `NSPropertyListSerializer`, setting the `Content-Type` of the encoded request to `application/x-plist`. + */ +@interface AFPropertyListRequestSerializer : AFHTTPRequestSerializer + +/** + The property list format. Possible values are described in "NSPropertyListFormat". + */ +@property (nonatomic, assign) NSPropertyListFormat format; + +/** + @warning The `writeOptions` property is currently unused. + */ +@property (nonatomic, assign) NSPropertyListWriteOptions writeOptions; + +/** + Creates and returns a property list serializer with a specified format, read options, and write options. + + @param format The property list format. + @param writeOptions The property list write options. + + @warning The `writeOptions` property is currently unused. + */ ++ (instancetype)serializerWithFormat:(NSPropertyListFormat)format + writeOptions:(NSPropertyListWriteOptions)writeOptions; + +@end + +#pragma mark - + +///---------------- +/// @name Constants +///---------------- + +/** + ## Error Domains + + The following error domain is predefined. + + - `NSString * const AFURLRequestSerializationErrorDomain` + + ### Constants + + `AFURLRequestSerializationErrorDomain` + AFURLRequestSerializer errors. Error codes for `AFURLRequestSerializationErrorDomain` correspond to codes in `NSURLErrorDomain`. + */ +FOUNDATION_EXPORT NSString * const AFURLRequestSerializationErrorDomain; + +/** + ## User info dictionary keys + + These keys may exist in the user info dictionary, in addition to those defined for NSError. + + - `NSString * const AFNetworkingOperationFailingURLRequestErrorKey` + + ### Constants + + `AFNetworkingOperationFailingURLRequestErrorKey` + The corresponding value is an `NSURLRequest` containing the request of the operation associated with an error. This key is only present in the `AFURLRequestSerializationErrorDomain`. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLRequestErrorKey; + +/** + ## Throttling Bandwidth for HTTP Request Input Streams + + @see -throttleBandwidthWithPacketSize:delay: + + ### Constants + + `kAFUploadStream3GSuggestedPacketSize` + Maximum packet size, in number of bytes. Equal to 16kb. + + `kAFUploadStream3GSuggestedDelay` + Duration of delay each time a packet is read. Equal to 0.2 seconds. + */ +FOUNDATION_EXPORT NSUInteger const kAFUploadStream3GSuggestedPacketSize; +FOUNDATION_EXPORT NSTimeInterval const kAFUploadStream3GSuggestedDelay; + +NS_ASSUME_NONNULL_END diff --git a/grocery-objc/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m b/grocery-objc/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m new file mode 100644 index 0000000..bbab7c4 --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m @@ -0,0 +1,1376 @@ +// AFURLRequestSerialization.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "AFURLRequestSerialization.h" + +#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV +#import +#else +#import +#endif + +NSString * const AFURLRequestSerializationErrorDomain = @"com.alamofire.error.serialization.request"; +NSString * const AFNetworkingOperationFailingURLRequestErrorKey = @"com.alamofire.serialization.request.error.response"; + +typedef NSString * (^AFQueryStringSerializationBlock)(NSURLRequest *request, id parameters, NSError *__autoreleasing *error); + +/** + Returns a percent-escaped string following RFC 3986 for a query string key or value. + RFC 3986 states that the following characters are "reserved" characters. + - General Delimiters: ":", "#", "[", "]", "@", "?", "/" + - Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" + + In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow + query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/" + should be percent-escaped in the query string. + - parameter string: The string to be percent-escaped. + - returns: The percent-escaped string. + */ +static NSString * AFPercentEscapedStringFromString(NSString *string) { + static NSString * const kAFCharactersGeneralDelimitersToEncode = @":#[]@"; // does not include "?" or "/" due to RFC 3986 - Section 3.4 + static NSString * const kAFCharactersSubDelimitersToEncode = @"!$&'()*+,;="; + + NSMutableCharacterSet * allowedCharacterSet = [[NSCharacterSet URLQueryAllowedCharacterSet] mutableCopy]; + [allowedCharacterSet removeCharactersInString:[kAFCharactersGeneralDelimitersToEncode stringByAppendingString:kAFCharactersSubDelimitersToEncode]]; + + // FIXME: https://github.com/AFNetworking/AFNetworking/pull/3028 + // return [string stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacterSet]; + + static NSUInteger const batchSize = 50; + + NSUInteger index = 0; + NSMutableString *escaped = @"".mutableCopy; + + while (index < string.length) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu" + NSUInteger length = MIN(string.length - index, batchSize); +#pragma GCC diagnostic pop + NSRange range = NSMakeRange(index, length); + + // To avoid breaking up character sequences such as 👴🏻👮🏽 + range = [string rangeOfComposedCharacterSequencesForRange:range]; + + NSString *substring = [string substringWithRange:range]; + NSString *encoded = [substring stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacterSet]; + [escaped appendString:encoded]; + + index += range.length; + } + + return escaped; +} + +#pragma mark - + +@interface AFQueryStringPair : NSObject +@property (readwrite, nonatomic, strong) id field; +@property (readwrite, nonatomic, strong) id value; + +- (instancetype)initWithField:(id)field value:(id)value; + +- (NSString *)URLEncodedStringValue; +@end + +@implementation AFQueryStringPair + +- (instancetype)initWithField:(id)field value:(id)value { + self = [super init]; + if (!self) { + return nil; + } + + self.field = field; + self.value = value; + + return self; +} + +- (NSString *)URLEncodedStringValue { + if (!self.value || [self.value isEqual:[NSNull null]]) { + return AFPercentEscapedStringFromString([self.field description]); + } else { + return [NSString stringWithFormat:@"%@=%@", AFPercentEscapedStringFromString([self.field description]), AFPercentEscapedStringFromString([self.value description])]; + } +} + +@end + +#pragma mark - + +FOUNDATION_EXPORT NSArray * AFQueryStringPairsFromDictionary(NSDictionary *dictionary); +FOUNDATION_EXPORT NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value); + +static NSString * AFQueryStringFromParameters(NSDictionary *parameters) { + NSMutableArray *mutablePairs = [NSMutableArray array]; + for (AFQueryStringPair *pair in AFQueryStringPairsFromDictionary(parameters)) { + [mutablePairs addObject:[pair URLEncodedStringValue]]; + } + + return [mutablePairs componentsJoinedByString:@"&"]; +} + +NSArray * AFQueryStringPairsFromDictionary(NSDictionary *dictionary) { + return AFQueryStringPairsFromKeyAndValue(nil, dictionary); +} + +NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value) { + NSMutableArray *mutableQueryStringComponents = [NSMutableArray array]; + + NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"description" ascending:YES selector:@selector(compare:)]; + + if ([value isKindOfClass:[NSDictionary class]]) { + NSDictionary *dictionary = value; + // Sort dictionary keys to ensure consistent ordering in query string, which is important when deserializing potentially ambiguous sequences, such as an array of dictionaries + for (id nestedKey in [dictionary.allKeys sortedArrayUsingDescriptors:@[ sortDescriptor ]]) { + id nestedValue = dictionary[nestedKey]; + if (nestedValue) { + [mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue((key ? [NSString stringWithFormat:@"%@[%@]", key, nestedKey] : nestedKey), nestedValue)]; + } + } + } else if ([value isKindOfClass:[NSArray class]]) { + NSArray *array = value; + for (id nestedValue in array) { + [mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue([NSString stringWithFormat:@"%@[]", key], nestedValue)]; + } + } else if ([value isKindOfClass:[NSSet class]]) { + NSSet *set = value; + for (id obj in [set sortedArrayUsingDescriptors:@[ sortDescriptor ]]) { + [mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue(key, obj)]; + } + } else { + [mutableQueryStringComponents addObject:[[AFQueryStringPair alloc] initWithField:key value:value]]; + } + + return mutableQueryStringComponents; +} + +#pragma mark - + +@interface AFStreamingMultipartFormData : NSObject +- (instancetype)initWithURLRequest:(NSMutableURLRequest *)urlRequest + stringEncoding:(NSStringEncoding)encoding; + +- (NSMutableURLRequest *)requestByFinalizingMultipartFormData; +@end + +#pragma mark - + +static NSArray * AFHTTPRequestSerializerObservedKeyPaths() { + static NSArray *_AFHTTPRequestSerializerObservedKeyPaths = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _AFHTTPRequestSerializerObservedKeyPaths = @[NSStringFromSelector(@selector(allowsCellularAccess)), NSStringFromSelector(@selector(cachePolicy)), NSStringFromSelector(@selector(HTTPShouldHandleCookies)), NSStringFromSelector(@selector(HTTPShouldUsePipelining)), NSStringFromSelector(@selector(networkServiceType)), NSStringFromSelector(@selector(timeoutInterval))]; + }); + + return _AFHTTPRequestSerializerObservedKeyPaths; +} + +static void *AFHTTPRequestSerializerObserverContext = &AFHTTPRequestSerializerObserverContext; + +@interface AFHTTPRequestSerializer () +@property (readwrite, nonatomic, strong) NSMutableSet *mutableObservedChangedKeyPaths; +@property (readwrite, nonatomic, strong) NSMutableDictionary *mutableHTTPRequestHeaders; +@property (readwrite, nonatomic, assign) AFHTTPRequestQueryStringSerializationStyle queryStringSerializationStyle; +@property (readwrite, nonatomic, copy) AFQueryStringSerializationBlock queryStringSerialization; +@end + +@implementation AFHTTPRequestSerializer + ++ (instancetype)serializer { + return [[self alloc] init]; +} + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + self.stringEncoding = NSUTF8StringEncoding; + + self.mutableHTTPRequestHeaders = [NSMutableDictionary dictionary]; + + // Accept-Language HTTP Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4 + NSMutableArray *acceptLanguagesComponents = [NSMutableArray array]; + [[NSLocale preferredLanguages] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + float q = 1.0f - (idx * 0.1f); + [acceptLanguagesComponents addObject:[NSString stringWithFormat:@"%@;q=%0.1g", obj, q]]; + *stop = q <= 0.5f; + }]; + [self setValue:[acceptLanguagesComponents componentsJoinedByString:@", "] forHTTPHeaderField:@"Accept-Language"]; + + NSString *userAgent = nil; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" +#if TARGET_OS_IOS + // User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43 + userAgent = [NSString stringWithFormat:@"%@/%@ (%@; iOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], [[UIScreen mainScreen] scale]]; +#elif TARGET_OS_WATCH + // User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43 + userAgent = [NSString stringWithFormat:@"%@/%@ (%@; watchOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[WKInterfaceDevice currentDevice] model], [[WKInterfaceDevice currentDevice] systemVersion], [[WKInterfaceDevice currentDevice] screenScale]]; +#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) + userAgent = [NSString stringWithFormat:@"%@/%@ (Mac OS X %@)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[NSProcessInfo processInfo] operatingSystemVersionString]]; +#endif +#pragma clang diagnostic pop + if (userAgent) { + if (![userAgent canBeConvertedToEncoding:NSASCIIStringEncoding]) { + NSMutableString *mutableUserAgent = [userAgent mutableCopy]; + if (CFStringTransform((__bridge CFMutableStringRef)(mutableUserAgent), NULL, (__bridge CFStringRef)@"Any-Latin; Latin-ASCII; [:^ASCII:] Remove", false)) { + userAgent = mutableUserAgent; + } + } + [self setValue:userAgent forHTTPHeaderField:@"User-Agent"]; + } + + // HTTP Method Definitions; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html + self.HTTPMethodsEncodingParametersInURI = [NSSet setWithObjects:@"GET", @"HEAD", @"DELETE", nil]; + + self.mutableObservedChangedKeyPaths = [NSMutableSet set]; + for (NSString *keyPath in AFHTTPRequestSerializerObservedKeyPaths()) { + if ([self respondsToSelector:NSSelectorFromString(keyPath)]) { + [self addObserver:self forKeyPath:keyPath options:NSKeyValueObservingOptionNew context:AFHTTPRequestSerializerObserverContext]; + } + } + + return self; +} + +- (void)dealloc { + for (NSString *keyPath in AFHTTPRequestSerializerObservedKeyPaths()) { + if ([self respondsToSelector:NSSelectorFromString(keyPath)]) { + [self removeObserver:self forKeyPath:keyPath context:AFHTTPRequestSerializerObserverContext]; + } + } +} + +#pragma mark - + +// Workarounds for crashing behavior using Key-Value Observing with XCTest +// See https://github.com/AFNetworking/AFNetworking/issues/2523 + +- (void)setAllowsCellularAccess:(BOOL)allowsCellularAccess { + [self willChangeValueForKey:NSStringFromSelector(@selector(allowsCellularAccess))]; + _allowsCellularAccess = allowsCellularAccess; + [self didChangeValueForKey:NSStringFromSelector(@selector(allowsCellularAccess))]; +} + +- (void)setCachePolicy:(NSURLRequestCachePolicy)cachePolicy { + [self willChangeValueForKey:NSStringFromSelector(@selector(cachePolicy))]; + _cachePolicy = cachePolicy; + [self didChangeValueForKey:NSStringFromSelector(@selector(cachePolicy))]; +} + +- (void)setHTTPShouldHandleCookies:(BOOL)HTTPShouldHandleCookies { + [self willChangeValueForKey:NSStringFromSelector(@selector(HTTPShouldHandleCookies))]; + _HTTPShouldHandleCookies = HTTPShouldHandleCookies; + [self didChangeValueForKey:NSStringFromSelector(@selector(HTTPShouldHandleCookies))]; +} + +- (void)setHTTPShouldUsePipelining:(BOOL)HTTPShouldUsePipelining { + [self willChangeValueForKey:NSStringFromSelector(@selector(HTTPShouldUsePipelining))]; + _HTTPShouldUsePipelining = HTTPShouldUsePipelining; + [self didChangeValueForKey:NSStringFromSelector(@selector(HTTPShouldUsePipelining))]; +} + +- (void)setNetworkServiceType:(NSURLRequestNetworkServiceType)networkServiceType { + [self willChangeValueForKey:NSStringFromSelector(@selector(networkServiceType))]; + _networkServiceType = networkServiceType; + [self didChangeValueForKey:NSStringFromSelector(@selector(networkServiceType))]; +} + +- (void)setTimeoutInterval:(NSTimeInterval)timeoutInterval { + [self willChangeValueForKey:NSStringFromSelector(@selector(timeoutInterval))]; + _timeoutInterval = timeoutInterval; + [self didChangeValueForKey:NSStringFromSelector(@selector(timeoutInterval))]; +} + +#pragma mark - + +- (NSDictionary *)HTTPRequestHeaders { + return [NSDictionary dictionaryWithDictionary:self.mutableHTTPRequestHeaders]; +} + +- (void)setValue:(NSString *)value +forHTTPHeaderField:(NSString *)field +{ + [self.mutableHTTPRequestHeaders setValue:value forKey:field]; +} + +- (NSString *)valueForHTTPHeaderField:(NSString *)field { + return [self.mutableHTTPRequestHeaders valueForKey:field]; +} + +- (void)setAuthorizationHeaderFieldWithUsername:(NSString *)username + password:(NSString *)password +{ + NSData *basicAuthCredentials = [[NSString stringWithFormat:@"%@:%@", username, password] dataUsingEncoding:NSUTF8StringEncoding]; + NSString *base64AuthCredentials = [basicAuthCredentials base64EncodedStringWithOptions:(NSDataBase64EncodingOptions)0]; + [self setValue:[NSString stringWithFormat:@"Basic %@", base64AuthCredentials] forHTTPHeaderField:@"Authorization"]; +} + +- (void)clearAuthorizationHeader { + [self.mutableHTTPRequestHeaders removeObjectForKey:@"Authorization"]; +} + +#pragma mark - + +- (void)setQueryStringSerializationWithStyle:(AFHTTPRequestQueryStringSerializationStyle)style { + self.queryStringSerializationStyle = style; + self.queryStringSerialization = nil; +} + +- (void)setQueryStringSerializationWithBlock:(NSString *(^)(NSURLRequest *, id, NSError *__autoreleasing *))block { + self.queryStringSerialization = block; +} + +#pragma mark - + +- (NSMutableURLRequest *)requestWithMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(id)parameters + error:(NSError *__autoreleasing *)error +{ + NSParameterAssert(method); + NSParameterAssert(URLString); + + NSURL *url = [NSURL URLWithString:URLString]; + + NSParameterAssert(url); + + NSMutableURLRequest *mutableRequest = [[NSMutableURLRequest alloc] initWithURL:url]; + mutableRequest.HTTPMethod = method; + + for (NSString *keyPath in AFHTTPRequestSerializerObservedKeyPaths()) { + if ([self.mutableObservedChangedKeyPaths containsObject:keyPath]) { + [mutableRequest setValue:[self valueForKeyPath:keyPath] forKey:keyPath]; + } + } + + mutableRequest = [[self requestBySerializingRequest:mutableRequest withParameters:parameters error:error] mutableCopy]; + + return mutableRequest; +} + +- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(NSDictionary *)parameters + constructingBodyWithBlock:(void (^)(id formData))block + error:(NSError *__autoreleasing *)error +{ + NSParameterAssert(method); + NSParameterAssert(![method isEqualToString:@"GET"] && ![method isEqualToString:@"HEAD"]); + + NSMutableURLRequest *mutableRequest = [self requestWithMethod:method URLString:URLString parameters:nil error:error]; + + __block AFStreamingMultipartFormData *formData = [[AFStreamingMultipartFormData alloc] initWithURLRequest:mutableRequest stringEncoding:NSUTF8StringEncoding]; + + if (parameters) { + for (AFQueryStringPair *pair in AFQueryStringPairsFromDictionary(parameters)) { + NSData *data = nil; + if ([pair.value isKindOfClass:[NSData class]]) { + data = pair.value; + } else if ([pair.value isEqual:[NSNull null]]) { + data = [NSData data]; + } else { + data = [[pair.value description] dataUsingEncoding:self.stringEncoding]; + } + + if (data) { + [formData appendPartWithFormData:data name:[pair.field description]]; + } + } + } + + if (block) { + block(formData); + } + + return [formData requestByFinalizingMultipartFormData]; +} + +- (NSMutableURLRequest *)requestWithMultipartFormRequest:(NSURLRequest *)request + writingStreamContentsToFile:(NSURL *)fileURL + completionHandler:(void (^)(NSError *error))handler +{ + NSParameterAssert(request.HTTPBodyStream); + NSParameterAssert([fileURL isFileURL]); + + NSInputStream *inputStream = request.HTTPBodyStream; + NSOutputStream *outputStream = [[NSOutputStream alloc] initWithURL:fileURL append:NO]; + __block NSError *error = nil; + + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + [inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; + [outputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; + + [inputStream open]; + [outputStream open]; + + while ([inputStream hasBytesAvailable] && [outputStream hasSpaceAvailable]) { + uint8_t buffer[1024]; + + NSInteger bytesRead = [inputStream read:buffer maxLength:1024]; + if (inputStream.streamError || bytesRead < 0) { + error = inputStream.streamError; + break; + } + + NSInteger bytesWritten = [outputStream write:buffer maxLength:(NSUInteger)bytesRead]; + if (outputStream.streamError || bytesWritten < 0) { + error = outputStream.streamError; + break; + } + + if (bytesRead == 0 && bytesWritten == 0) { + break; + } + } + + [outputStream close]; + [inputStream close]; + + if (handler) { + dispatch_async(dispatch_get_main_queue(), ^{ + handler(error); + }); + } + }); + + NSMutableURLRequest *mutableRequest = [request mutableCopy]; + mutableRequest.HTTPBodyStream = nil; + + return mutableRequest; +} + +#pragma mark - AFURLRequestSerialization + +- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request + withParameters:(id)parameters + error:(NSError *__autoreleasing *)error +{ + NSParameterAssert(request); + + NSMutableURLRequest *mutableRequest = [request mutableCopy]; + + [self.HTTPRequestHeaders enumerateKeysAndObjectsUsingBlock:^(id field, id value, BOOL * __unused stop) { + if (![request valueForHTTPHeaderField:field]) { + [mutableRequest setValue:value forHTTPHeaderField:field]; + } + }]; + + NSString *query = nil; + if (parameters) { + if (self.queryStringSerialization) { + NSError *serializationError; + query = self.queryStringSerialization(request, parameters, &serializationError); + + if (serializationError) { + if (error) { + *error = serializationError; + } + + return nil; + } + } else { + switch (self.queryStringSerializationStyle) { + case AFHTTPRequestQueryStringDefaultStyle: + query = AFQueryStringFromParameters(parameters); + break; + } + } + } + + if ([self.HTTPMethodsEncodingParametersInURI containsObject:[[request HTTPMethod] uppercaseString]]) { + if (query) { + mutableRequest.URL = [NSURL URLWithString:[[mutableRequest.URL absoluteString] stringByAppendingFormat:mutableRequest.URL.query ? @"&%@" : @"?%@", query]]; + } + } else { + // #2864: an empty string is a valid x-www-form-urlencoded payload + if (!query) { + query = @""; + } + if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) { + [mutableRequest setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; + } + [mutableRequest setHTTPBody:[query dataUsingEncoding:self.stringEncoding]]; + } + + return mutableRequest; +} + +#pragma mark - NSKeyValueObserving + ++ (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key { + if ([AFHTTPRequestSerializerObservedKeyPaths() containsObject:key]) { + return NO; + } + + return [super automaticallyNotifiesObserversForKey:key]; +} + +- (void)observeValueForKeyPath:(NSString *)keyPath + ofObject:(__unused id)object + change:(NSDictionary *)change + context:(void *)context +{ + if (context == AFHTTPRequestSerializerObserverContext) { + if ([change[NSKeyValueChangeNewKey] isEqual:[NSNull null]]) { + [self.mutableObservedChangedKeyPaths removeObject:keyPath]; + } else { + [self.mutableObservedChangedKeyPaths addObject:keyPath]; + } + } +} + +#pragma mark - NSSecureCoding + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (instancetype)initWithCoder:(NSCoder *)decoder { + self = [self init]; + if (!self) { + return nil; + } + + self.mutableHTTPRequestHeaders = [[decoder decodeObjectOfClass:[NSDictionary class] forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))] mutableCopy]; + self.queryStringSerializationStyle = (AFHTTPRequestQueryStringSerializationStyle)[[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))] unsignedIntegerValue]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [coder encodeObject:self.mutableHTTPRequestHeaders forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))]; + [coder encodeInteger:self.queryStringSerializationStyle forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFHTTPRequestSerializer *serializer = [[[self class] allocWithZone:zone] init]; + serializer.mutableHTTPRequestHeaders = [self.mutableHTTPRequestHeaders mutableCopyWithZone:zone]; + serializer.queryStringSerializationStyle = self.queryStringSerializationStyle; + serializer.queryStringSerialization = self.queryStringSerialization; + + return serializer; +} + +@end + +#pragma mark - + +static NSString * AFCreateMultipartFormBoundary() { + return [NSString stringWithFormat:@"Boundary+%08X%08X", arc4random(), arc4random()]; +} + +static NSString * const kAFMultipartFormCRLF = @"\r\n"; + +static inline NSString * AFMultipartFormInitialBoundary(NSString *boundary) { + return [NSString stringWithFormat:@"--%@%@", boundary, kAFMultipartFormCRLF]; +} + +static inline NSString * AFMultipartFormEncapsulationBoundary(NSString *boundary) { + return [NSString stringWithFormat:@"%@--%@%@", kAFMultipartFormCRLF, boundary, kAFMultipartFormCRLF]; +} + +static inline NSString * AFMultipartFormFinalBoundary(NSString *boundary) { + return [NSString stringWithFormat:@"%@--%@--%@", kAFMultipartFormCRLF, boundary, kAFMultipartFormCRLF]; +} + +static inline NSString * AFContentTypeForPathExtension(NSString *extension) { + NSString *UTI = (__bridge_transfer NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)extension, NULL); + NSString *contentType = (__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)UTI, kUTTagClassMIMEType); + if (!contentType) { + return @"application/octet-stream"; + } else { + return contentType; + } +} + +NSUInteger const kAFUploadStream3GSuggestedPacketSize = 1024 * 16; +NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2; + +@interface AFHTTPBodyPart : NSObject +@property (nonatomic, assign) NSStringEncoding stringEncoding; +@property (nonatomic, strong) NSDictionary *headers; +@property (nonatomic, copy) NSString *boundary; +@property (nonatomic, strong) id body; +@property (nonatomic, assign) unsigned long long bodyContentLength; +@property (nonatomic, strong) NSInputStream *inputStream; + +@property (nonatomic, assign) BOOL hasInitialBoundary; +@property (nonatomic, assign) BOOL hasFinalBoundary; + +@property (readonly, nonatomic, assign, getter = hasBytesAvailable) BOOL bytesAvailable; +@property (readonly, nonatomic, assign) unsigned long long contentLength; + +- (NSInteger)read:(uint8_t *)buffer + maxLength:(NSUInteger)length; +@end + +@interface AFMultipartBodyStream : NSInputStream +@property (nonatomic, assign) NSUInteger numberOfBytesInPacket; +@property (nonatomic, assign) NSTimeInterval delay; +@property (nonatomic, strong) NSInputStream *inputStream; +@property (readonly, nonatomic, assign) unsigned long long contentLength; +@property (readonly, nonatomic, assign, getter = isEmpty) BOOL empty; + +- (instancetype)initWithStringEncoding:(NSStringEncoding)encoding; +- (void)setInitialAndFinalBoundaries; +- (void)appendHTTPBodyPart:(AFHTTPBodyPart *)bodyPart; +@end + +#pragma mark - + +@interface AFStreamingMultipartFormData () +@property (readwrite, nonatomic, copy) NSMutableURLRequest *request; +@property (readwrite, nonatomic, assign) NSStringEncoding stringEncoding; +@property (readwrite, nonatomic, copy) NSString *boundary; +@property (readwrite, nonatomic, strong) AFMultipartBodyStream *bodyStream; +@end + +@implementation AFStreamingMultipartFormData + +- (instancetype)initWithURLRequest:(NSMutableURLRequest *)urlRequest + stringEncoding:(NSStringEncoding)encoding +{ + self = [super init]; + if (!self) { + return nil; + } + + self.request = urlRequest; + self.stringEncoding = encoding; + self.boundary = AFCreateMultipartFormBoundary(); + self.bodyStream = [[AFMultipartBodyStream alloc] initWithStringEncoding:encoding]; + + return self; +} + +- (BOOL)appendPartWithFileURL:(NSURL *)fileURL + name:(NSString *)name + error:(NSError * __autoreleasing *)error +{ + NSParameterAssert(fileURL); + NSParameterAssert(name); + + NSString *fileName = [fileURL lastPathComponent]; + NSString *mimeType = AFContentTypeForPathExtension([fileURL pathExtension]); + + return [self appendPartWithFileURL:fileURL name:name fileName:fileName mimeType:mimeType error:error]; +} + +- (BOOL)appendPartWithFileURL:(NSURL *)fileURL + name:(NSString *)name + fileName:(NSString *)fileName + mimeType:(NSString *)mimeType + error:(NSError * __autoreleasing *)error +{ + NSParameterAssert(fileURL); + NSParameterAssert(name); + NSParameterAssert(fileName); + NSParameterAssert(mimeType); + + if (![fileURL isFileURL]) { + NSDictionary *userInfo = @{NSLocalizedFailureReasonErrorKey: NSLocalizedStringFromTable(@"Expected URL to be a file URL", @"AFNetworking", nil)}; + if (error) { + *error = [[NSError alloc] initWithDomain:AFURLRequestSerializationErrorDomain code:NSURLErrorBadURL userInfo:userInfo]; + } + + return NO; + } else if ([fileURL checkResourceIsReachableAndReturnError:error] == NO) { + NSDictionary *userInfo = @{NSLocalizedFailureReasonErrorKey: NSLocalizedStringFromTable(@"File URL not reachable.", @"AFNetworking", nil)}; + if (error) { + *error = [[NSError alloc] initWithDomain:AFURLRequestSerializationErrorDomain code:NSURLErrorBadURL userInfo:userInfo]; + } + + return NO; + } + + NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[fileURL path] error:error]; + if (!fileAttributes) { + return NO; + } + + NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary]; + [mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"; filename=\"%@\"", name, fileName] forKey:@"Content-Disposition"]; + [mutableHeaders setValue:mimeType forKey:@"Content-Type"]; + + AFHTTPBodyPart *bodyPart = [[AFHTTPBodyPart alloc] init]; + bodyPart.stringEncoding = self.stringEncoding; + bodyPart.headers = mutableHeaders; + bodyPart.boundary = self.boundary; + bodyPart.body = fileURL; + bodyPart.bodyContentLength = [fileAttributes[NSFileSize] unsignedLongLongValue]; + [self.bodyStream appendHTTPBodyPart:bodyPart]; + + return YES; +} + +- (void)appendPartWithInputStream:(NSInputStream *)inputStream + name:(NSString *)name + fileName:(NSString *)fileName + length:(int64_t)length + mimeType:(NSString *)mimeType +{ + NSParameterAssert(name); + NSParameterAssert(fileName); + NSParameterAssert(mimeType); + + NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary]; + [mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"; filename=\"%@\"", name, fileName] forKey:@"Content-Disposition"]; + [mutableHeaders setValue:mimeType forKey:@"Content-Type"]; + + AFHTTPBodyPart *bodyPart = [[AFHTTPBodyPart alloc] init]; + bodyPart.stringEncoding = self.stringEncoding; + bodyPart.headers = mutableHeaders; + bodyPart.boundary = self.boundary; + bodyPart.body = inputStream; + + bodyPart.bodyContentLength = (unsigned long long)length; + + [self.bodyStream appendHTTPBodyPart:bodyPart]; +} + +- (void)appendPartWithFileData:(NSData *)data + name:(NSString *)name + fileName:(NSString *)fileName + mimeType:(NSString *)mimeType +{ + NSParameterAssert(name); + NSParameterAssert(fileName); + NSParameterAssert(mimeType); + + NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary]; + [mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"; filename=\"%@\"", name, fileName] forKey:@"Content-Disposition"]; + [mutableHeaders setValue:mimeType forKey:@"Content-Type"]; + + [self appendPartWithHeaders:mutableHeaders body:data]; +} + +- (void)appendPartWithFormData:(NSData *)data + name:(NSString *)name +{ + NSParameterAssert(name); + + NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary]; + [mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"", name] forKey:@"Content-Disposition"]; + + [self appendPartWithHeaders:mutableHeaders body:data]; +} + +- (void)appendPartWithHeaders:(NSDictionary *)headers + body:(NSData *)body +{ + NSParameterAssert(body); + + AFHTTPBodyPart *bodyPart = [[AFHTTPBodyPart alloc] init]; + bodyPart.stringEncoding = self.stringEncoding; + bodyPart.headers = headers; + bodyPart.boundary = self.boundary; + bodyPart.bodyContentLength = [body length]; + bodyPart.body = body; + + [self.bodyStream appendHTTPBodyPart:bodyPart]; +} + +- (void)throttleBandwidthWithPacketSize:(NSUInteger)numberOfBytes + delay:(NSTimeInterval)delay +{ + self.bodyStream.numberOfBytesInPacket = numberOfBytes; + self.bodyStream.delay = delay; +} + +- (NSMutableURLRequest *)requestByFinalizingMultipartFormData { + if ([self.bodyStream isEmpty]) { + return self.request; + } + + // Reset the initial and final boundaries to ensure correct Content-Length + [self.bodyStream setInitialAndFinalBoundaries]; + [self.request setHTTPBodyStream:self.bodyStream]; + + [self.request setValue:[NSString stringWithFormat:@"multipart/form-data; boundary=%@", self.boundary] forHTTPHeaderField:@"Content-Type"]; + [self.request setValue:[NSString stringWithFormat:@"%llu", [self.bodyStream contentLength]] forHTTPHeaderField:@"Content-Length"]; + + return self.request; +} + +@end + +#pragma mark - + +@interface NSStream () +@property (readwrite) NSStreamStatus streamStatus; +@property (readwrite, copy) NSError *streamError; +@end + +@interface AFMultipartBodyStream () +@property (readwrite, nonatomic, assign) NSStringEncoding stringEncoding; +@property (readwrite, nonatomic, strong) NSMutableArray *HTTPBodyParts; +@property (readwrite, nonatomic, strong) NSEnumerator *HTTPBodyPartEnumerator; +@property (readwrite, nonatomic, strong) AFHTTPBodyPart *currentHTTPBodyPart; +@property (readwrite, nonatomic, strong) NSOutputStream *outputStream; +@property (readwrite, nonatomic, strong) NSMutableData *buffer; +@end + +@implementation AFMultipartBodyStream +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wimplicit-atomic-properties" +#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1100) +@synthesize delegate; +#endif +@synthesize streamStatus; +@synthesize streamError; +#pragma clang diagnostic pop + +- (instancetype)initWithStringEncoding:(NSStringEncoding)encoding { + self = [super init]; + if (!self) { + return nil; + } + + self.stringEncoding = encoding; + self.HTTPBodyParts = [NSMutableArray array]; + self.numberOfBytesInPacket = NSIntegerMax; + + return self; +} + +- (void)setInitialAndFinalBoundaries { + if ([self.HTTPBodyParts count] > 0) { + for (AFHTTPBodyPart *bodyPart in self.HTTPBodyParts) { + bodyPart.hasInitialBoundary = NO; + bodyPart.hasFinalBoundary = NO; + } + + [[self.HTTPBodyParts firstObject] setHasInitialBoundary:YES]; + [[self.HTTPBodyParts lastObject] setHasFinalBoundary:YES]; + } +} + +- (void)appendHTTPBodyPart:(AFHTTPBodyPart *)bodyPart { + [self.HTTPBodyParts addObject:bodyPart]; +} + +- (BOOL)isEmpty { + return [self.HTTPBodyParts count] == 0; +} + +#pragma mark - NSInputStream + +- (NSInteger)read:(uint8_t *)buffer + maxLength:(NSUInteger)length +{ + if ([self streamStatus] == NSStreamStatusClosed) { + return 0; + } + + NSInteger totalNumberOfBytesRead = 0; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + while ((NSUInteger)totalNumberOfBytesRead < MIN(length, self.numberOfBytesInPacket)) { + if (!self.currentHTTPBodyPart || ![self.currentHTTPBodyPart hasBytesAvailable]) { + if (!(self.currentHTTPBodyPart = [self.HTTPBodyPartEnumerator nextObject])) { + break; + } + } else { + NSUInteger maxLength = MIN(length, self.numberOfBytesInPacket) - (NSUInteger)totalNumberOfBytesRead; + NSInteger numberOfBytesRead = [self.currentHTTPBodyPart read:&buffer[totalNumberOfBytesRead] maxLength:maxLength]; + if (numberOfBytesRead == -1) { + self.streamError = self.currentHTTPBodyPart.inputStream.streamError; + break; + } else { + totalNumberOfBytesRead += numberOfBytesRead; + + if (self.delay > 0.0f) { + [NSThread sleepForTimeInterval:self.delay]; + } + } + } + } +#pragma clang diagnostic pop + + return totalNumberOfBytesRead; +} + +- (BOOL)getBuffer:(__unused uint8_t **)buffer + length:(__unused NSUInteger *)len +{ + return NO; +} + +- (BOOL)hasBytesAvailable { + return [self streamStatus] == NSStreamStatusOpen; +} + +#pragma mark - NSStream + +- (void)open { + if (self.streamStatus == NSStreamStatusOpen) { + return; + } + + self.streamStatus = NSStreamStatusOpen; + + [self setInitialAndFinalBoundaries]; + self.HTTPBodyPartEnumerator = [self.HTTPBodyParts objectEnumerator]; +} + +- (void)close { + self.streamStatus = NSStreamStatusClosed; +} + +- (id)propertyForKey:(__unused NSString *)key { + return nil; +} + +- (BOOL)setProperty:(__unused id)property + forKey:(__unused NSString *)key +{ + return NO; +} + +- (void)scheduleInRunLoop:(__unused NSRunLoop *)aRunLoop + forMode:(__unused NSString *)mode +{} + +- (void)removeFromRunLoop:(__unused NSRunLoop *)aRunLoop + forMode:(__unused NSString *)mode +{} + +- (unsigned long long)contentLength { + unsigned long long length = 0; + for (AFHTTPBodyPart *bodyPart in self.HTTPBodyParts) { + length += [bodyPart contentLength]; + } + + return length; +} + +#pragma mark - Undocumented CFReadStream Bridged Methods + +- (void)_scheduleInCFRunLoop:(__unused CFRunLoopRef)aRunLoop + forMode:(__unused CFStringRef)aMode +{} + +- (void)_unscheduleFromCFRunLoop:(__unused CFRunLoopRef)aRunLoop + forMode:(__unused CFStringRef)aMode +{} + +- (BOOL)_setCFClientFlags:(__unused CFOptionFlags)inFlags + callback:(__unused CFReadStreamClientCallBack)inCallback + context:(__unused CFStreamClientContext *)inContext { + return NO; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFMultipartBodyStream *bodyStreamCopy = [[[self class] allocWithZone:zone] initWithStringEncoding:self.stringEncoding]; + + for (AFHTTPBodyPart *bodyPart in self.HTTPBodyParts) { + [bodyStreamCopy appendHTTPBodyPart:[bodyPart copy]]; + } + + [bodyStreamCopy setInitialAndFinalBoundaries]; + + return bodyStreamCopy; +} + +@end + +#pragma mark - + +typedef enum { + AFEncapsulationBoundaryPhase = 1, + AFHeaderPhase = 2, + AFBodyPhase = 3, + AFFinalBoundaryPhase = 4, +} AFHTTPBodyPartReadPhase; + +@interface AFHTTPBodyPart () { + AFHTTPBodyPartReadPhase _phase; + NSInputStream *_inputStream; + unsigned long long _phaseReadOffset; +} + +- (BOOL)transitionToNextPhase; +- (NSInteger)readData:(NSData *)data + intoBuffer:(uint8_t *)buffer + maxLength:(NSUInteger)length; +@end + +@implementation AFHTTPBodyPart + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + [self transitionToNextPhase]; + + return self; +} + +- (void)dealloc { + if (_inputStream) { + [_inputStream close]; + _inputStream = nil; + } +} + +- (NSInputStream *)inputStream { + if (!_inputStream) { + if ([self.body isKindOfClass:[NSData class]]) { + _inputStream = [NSInputStream inputStreamWithData:self.body]; + } else if ([self.body isKindOfClass:[NSURL class]]) { + _inputStream = [NSInputStream inputStreamWithURL:self.body]; + } else if ([self.body isKindOfClass:[NSInputStream class]]) { + _inputStream = self.body; + } else { + _inputStream = [NSInputStream inputStreamWithData:[NSData data]]; + } + } + + return _inputStream; +} + +- (NSString *)stringForHeaders { + NSMutableString *headerString = [NSMutableString string]; + for (NSString *field in [self.headers allKeys]) { + [headerString appendString:[NSString stringWithFormat:@"%@: %@%@", field, [self.headers valueForKey:field], kAFMultipartFormCRLF]]; + } + [headerString appendString:kAFMultipartFormCRLF]; + + return [NSString stringWithString:headerString]; +} + +- (unsigned long long)contentLength { + unsigned long long length = 0; + + NSData *encapsulationBoundaryData = [([self hasInitialBoundary] ? AFMultipartFormInitialBoundary(self.boundary) : AFMultipartFormEncapsulationBoundary(self.boundary)) dataUsingEncoding:self.stringEncoding]; + length += [encapsulationBoundaryData length]; + + NSData *headersData = [[self stringForHeaders] dataUsingEncoding:self.stringEncoding]; + length += [headersData length]; + + length += _bodyContentLength; + + NSData *closingBoundaryData = ([self hasFinalBoundary] ? [AFMultipartFormFinalBoundary(self.boundary) dataUsingEncoding:self.stringEncoding] : [NSData data]); + length += [closingBoundaryData length]; + + return length; +} + +- (BOOL)hasBytesAvailable { + // Allows `read:maxLength:` to be called again if `AFMultipartFormFinalBoundary` doesn't fit into the available buffer + if (_phase == AFFinalBoundaryPhase) { + return YES; + } + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcovered-switch-default" + switch (self.inputStream.streamStatus) { + case NSStreamStatusNotOpen: + case NSStreamStatusOpening: + case NSStreamStatusOpen: + case NSStreamStatusReading: + case NSStreamStatusWriting: + return YES; + case NSStreamStatusAtEnd: + case NSStreamStatusClosed: + case NSStreamStatusError: + default: + return NO; + } +#pragma clang diagnostic pop +} + +- (NSInteger)read:(uint8_t *)buffer + maxLength:(NSUInteger)length +{ + NSInteger totalNumberOfBytesRead = 0; + + if (_phase == AFEncapsulationBoundaryPhase) { + NSData *encapsulationBoundaryData = [([self hasInitialBoundary] ? AFMultipartFormInitialBoundary(self.boundary) : AFMultipartFormEncapsulationBoundary(self.boundary)) dataUsingEncoding:self.stringEncoding]; + totalNumberOfBytesRead += [self readData:encapsulationBoundaryData intoBuffer:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)]; + } + + if (_phase == AFHeaderPhase) { + NSData *headersData = [[self stringForHeaders] dataUsingEncoding:self.stringEncoding]; + totalNumberOfBytesRead += [self readData:headersData intoBuffer:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)]; + } + + if (_phase == AFBodyPhase) { + NSInteger numberOfBytesRead = 0; + + numberOfBytesRead = [self.inputStream read:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)]; + if (numberOfBytesRead == -1) { + return -1; + } else { + totalNumberOfBytesRead += numberOfBytesRead; + + if ([self.inputStream streamStatus] >= NSStreamStatusAtEnd) { + [self transitionToNextPhase]; + } + } + } + + if (_phase == AFFinalBoundaryPhase) { + NSData *closingBoundaryData = ([self hasFinalBoundary] ? [AFMultipartFormFinalBoundary(self.boundary) dataUsingEncoding:self.stringEncoding] : [NSData data]); + totalNumberOfBytesRead += [self readData:closingBoundaryData intoBuffer:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)]; + } + + return totalNumberOfBytesRead; +} + +- (NSInteger)readData:(NSData *)data + intoBuffer:(uint8_t *)buffer + maxLength:(NSUInteger)length +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + NSRange range = NSMakeRange((NSUInteger)_phaseReadOffset, MIN([data length] - ((NSUInteger)_phaseReadOffset), length)); + [data getBytes:buffer range:range]; +#pragma clang diagnostic pop + + _phaseReadOffset += range.length; + + if (((NSUInteger)_phaseReadOffset) >= [data length]) { + [self transitionToNextPhase]; + } + + return (NSInteger)range.length; +} + +- (BOOL)transitionToNextPhase { + if (![[NSThread currentThread] isMainThread]) { + dispatch_sync(dispatch_get_main_queue(), ^{ + [self transitionToNextPhase]; + }); + return YES; + } + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcovered-switch-default" + switch (_phase) { + case AFEncapsulationBoundaryPhase: + _phase = AFHeaderPhase; + break; + case AFHeaderPhase: + [self.inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; + [self.inputStream open]; + _phase = AFBodyPhase; + break; + case AFBodyPhase: + [self.inputStream close]; + _phase = AFFinalBoundaryPhase; + break; + case AFFinalBoundaryPhase: + default: + _phase = AFEncapsulationBoundaryPhase; + break; + } + _phaseReadOffset = 0; +#pragma clang diagnostic pop + + return YES; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFHTTPBodyPart *bodyPart = [[[self class] allocWithZone:zone] init]; + + bodyPart.stringEncoding = self.stringEncoding; + bodyPart.headers = self.headers; + bodyPart.bodyContentLength = self.bodyContentLength; + bodyPart.body = self.body; + bodyPart.boundary = self.boundary; + + return bodyPart; +} + +@end + +#pragma mark - + +@implementation AFJSONRequestSerializer + ++ (instancetype)serializer { + return [self serializerWithWritingOptions:(NSJSONWritingOptions)0]; +} + ++ (instancetype)serializerWithWritingOptions:(NSJSONWritingOptions)writingOptions +{ + AFJSONRequestSerializer *serializer = [[self alloc] init]; + serializer.writingOptions = writingOptions; + + return serializer; +} + +#pragma mark - AFURLRequestSerialization + +- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request + withParameters:(id)parameters + error:(NSError *__autoreleasing *)error +{ + NSParameterAssert(request); + + if ([self.HTTPMethodsEncodingParametersInURI containsObject:[[request HTTPMethod] uppercaseString]]) { + return [super requestBySerializingRequest:request withParameters:parameters error:error]; + } + + NSMutableURLRequest *mutableRequest = [request mutableCopy]; + + [self.HTTPRequestHeaders enumerateKeysAndObjectsUsingBlock:^(id field, id value, BOOL * __unused stop) { + if (![request valueForHTTPHeaderField:field]) { + [mutableRequest setValue:value forHTTPHeaderField:field]; + } + }]; + + if (parameters) { + if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) { + [mutableRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; + } + + [mutableRequest setHTTPBody:[NSJSONSerialization dataWithJSONObject:parameters options:self.writingOptions error:error]]; + } + + return mutableRequest; +} + +#pragma mark - NSSecureCoding + +- (instancetype)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (!self) { + return nil; + } + + self.writingOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(writingOptions))] unsignedIntegerValue]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [super encodeWithCoder:coder]; + + [coder encodeInteger:self.writingOptions forKey:NSStringFromSelector(@selector(writingOptions))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFJSONRequestSerializer *serializer = [super copyWithZone:zone]; + serializer.writingOptions = self.writingOptions; + + return serializer; +} + +@end + +#pragma mark - + +@implementation AFPropertyListRequestSerializer + ++ (instancetype)serializer { + return [self serializerWithFormat:NSPropertyListXMLFormat_v1_0 writeOptions:0]; +} + ++ (instancetype)serializerWithFormat:(NSPropertyListFormat)format + writeOptions:(NSPropertyListWriteOptions)writeOptions +{ + AFPropertyListRequestSerializer *serializer = [[self alloc] init]; + serializer.format = format; + serializer.writeOptions = writeOptions; + + return serializer; +} + +#pragma mark - AFURLRequestSerializer + +- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request + withParameters:(id)parameters + error:(NSError *__autoreleasing *)error +{ + NSParameterAssert(request); + + if ([self.HTTPMethodsEncodingParametersInURI containsObject:[[request HTTPMethod] uppercaseString]]) { + return [super requestBySerializingRequest:request withParameters:parameters error:error]; + } + + NSMutableURLRequest *mutableRequest = [request mutableCopy]; + + [self.HTTPRequestHeaders enumerateKeysAndObjectsUsingBlock:^(id field, id value, BOOL * __unused stop) { + if (![request valueForHTTPHeaderField:field]) { + [mutableRequest setValue:value forHTTPHeaderField:field]; + } + }]; + + if (parameters) { + if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) { + [mutableRequest setValue:@"application/x-plist" forHTTPHeaderField:@"Content-Type"]; + } + + [mutableRequest setHTTPBody:[NSPropertyListSerialization dataWithPropertyList:parameters format:self.format options:self.writeOptions error:error]]; + } + + return mutableRequest; +} + +#pragma mark - NSSecureCoding + +- (instancetype)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (!self) { + return nil; + } + + self.format = (NSPropertyListFormat)[[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(format))] unsignedIntegerValue]; + self.writeOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(writeOptions))] unsignedIntegerValue]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [super encodeWithCoder:coder]; + + [coder encodeInteger:self.format forKey:NSStringFromSelector(@selector(format))]; + [coder encodeObject:@(self.writeOptions) forKey:NSStringFromSelector(@selector(writeOptions))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFPropertyListRequestSerializer *serializer = [super copyWithZone:zone]; + serializer.format = self.format; + serializer.writeOptions = self.writeOptions; + + return serializer; +} + +@end diff --git a/grocery-objc/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h b/grocery-objc/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h new file mode 100644 index 0000000..f9e14c6 --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h @@ -0,0 +1,311 @@ +// AFURLResponseSerialization.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + The `AFURLResponseSerialization` protocol is adopted by an object that decodes data into a more useful object representation, according to details in the server response. Response serializers may additionally perform validation on the incoming response and data. + + For example, a JSON response serializer may check for an acceptable status code (`2XX` range) and content type (`application/json`), decoding a valid JSON response into an object. + */ +@protocol AFURLResponseSerialization + +/** + The response object decoded from the data associated with a specified response. + + @param response The response to be processed. + @param data The response data to be decoded. + @param error The error that occurred while attempting to decode the response data. + + @return The object decoded from the specified response data. + */ +- (nullable id)responseObjectForResponse:(nullable NSURLResponse *)response + data:(nullable NSData *)data + error:(NSError * _Nullable __autoreleasing *)error NS_SWIFT_NOTHROW; + +@end + +#pragma mark - + +/** + `AFHTTPResponseSerializer` conforms to the `AFURLRequestSerialization` & `AFURLResponseSerialization` protocols, offering a concrete base implementation of query string / URL form-encoded parameter serialization and default request headers, as well as response status code and content type validation. + + Any request or response serializer dealing with HTTP is encouraged to subclass `AFHTTPResponseSerializer` in order to ensure consistent default behavior. + */ +@interface AFHTTPResponseSerializer : NSObject + +- (instancetype)init; + +/** + The string encoding used to serialize data received from the server, when no string encoding is specified by the response. `NSUTF8StringEncoding` by default. + */ +@property (nonatomic, assign) NSStringEncoding stringEncoding; + +/** + Creates and returns a serializer with default configuration. + */ ++ (instancetype)serializer; + +///----------------------------------------- +/// @name Configuring Response Serialization +///----------------------------------------- + +/** + The acceptable HTTP status codes for responses. When non-`nil`, responses with status codes not contained by the set will result in an error during validation. + + See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html + */ +@property (nonatomic, copy, nullable) NSIndexSet *acceptableStatusCodes; + +/** + The acceptable MIME types for responses. When non-`nil`, responses with a `Content-Type` with MIME types that do not intersect with the set will result in an error during validation. + */ +@property (nonatomic, copy, nullable) NSSet *acceptableContentTypes; + +/** + Validates the specified response and data. + + In its base implementation, this method checks for an acceptable status code and content type. Subclasses may wish to add other domain-specific checks. + + @param response The response to be validated. + @param data The data associated with the response. + @param error The error that occurred while attempting to validate the response. + + @return `YES` if the response is valid, otherwise `NO`. + */ +- (BOOL)validateResponse:(nullable NSHTTPURLResponse *)response + data:(nullable NSData *)data + error:(NSError * _Nullable __autoreleasing *)error; + +@end + +#pragma mark - + + +/** + `AFJSONResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes JSON responses. + + By default, `AFJSONResponseSerializer` accepts the following MIME types, which includes the official standard, `application/json`, as well as other commonly-used types: + + - `application/json` + - `text/json` + - `text/javascript` + */ +@interface AFJSONResponseSerializer : AFHTTPResponseSerializer + +- (instancetype)init; + +/** + Options for reading the response JSON data and creating the Foundation objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default. + */ +@property (nonatomic, assign) NSJSONReadingOptions readingOptions; + +/** + Whether to remove keys with `NSNull` values from response JSON. Defaults to `NO`. + */ +@property (nonatomic, assign) BOOL removesKeysWithNullValues; + +/** + Creates and returns a JSON serializer with specified reading and writing options. + + @param readingOptions The specified JSON reading options. + */ ++ (instancetype)serializerWithReadingOptions:(NSJSONReadingOptions)readingOptions; + +@end + +#pragma mark - + +/** + `AFXMLParserResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLParser` objects. + + By default, `AFXMLParserResponseSerializer` accepts the following MIME types, which includes the official standard, `application/xml`, as well as other commonly-used types: + + - `application/xml` + - `text/xml` + */ +@interface AFXMLParserResponseSerializer : AFHTTPResponseSerializer + +@end + +#pragma mark - + +#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED + +/** + `AFXMLDocumentResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLDocument` objects. + + By default, `AFXMLDocumentResponseSerializer` accepts the following MIME types, which includes the official standard, `application/xml`, as well as other commonly-used types: + + - `application/xml` + - `text/xml` + */ +@interface AFXMLDocumentResponseSerializer : AFHTTPResponseSerializer + +- (instancetype)init; + +/** + Input and output options specifically intended for `NSXMLDocument` objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default. + */ +@property (nonatomic, assign) NSUInteger options; + +/** + Creates and returns an XML document serializer with the specified options. + + @param mask The XML document options. + */ ++ (instancetype)serializerWithXMLDocumentOptions:(NSUInteger)mask; + +@end + +#endif + +#pragma mark - + +/** + `AFPropertyListResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLDocument` objects. + + By default, `AFPropertyListResponseSerializer` accepts the following MIME types: + + - `application/x-plist` + */ +@interface AFPropertyListResponseSerializer : AFHTTPResponseSerializer + +- (instancetype)init; + +/** + The property list format. Possible values are described in "NSPropertyListFormat". + */ +@property (nonatomic, assign) NSPropertyListFormat format; + +/** + The property list reading options. Possible values are described in "NSPropertyListMutabilityOptions." + */ +@property (nonatomic, assign) NSPropertyListReadOptions readOptions; + +/** + Creates and returns a property list serializer with a specified format, read options, and write options. + + @param format The property list format. + @param readOptions The property list reading options. + */ ++ (instancetype)serializerWithFormat:(NSPropertyListFormat)format + readOptions:(NSPropertyListReadOptions)readOptions; + +@end + +#pragma mark - + +/** + `AFImageResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes image responses. + + By default, `AFImageResponseSerializer` accepts the following MIME types, which correspond to the image formats supported by UIImage or NSImage: + + - `image/tiff` + - `image/jpeg` + - `image/gif` + - `image/png` + - `image/ico` + - `image/x-icon` + - `image/bmp` + - `image/x-bmp` + - `image/x-xbitmap` + - `image/x-win-bitmap` + */ +@interface AFImageResponseSerializer : AFHTTPResponseSerializer + +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH +/** + The scale factor used when interpreting the image data to construct `responseImage`. Specifying a scale factor of 1.0 results in an image whose size matches the pixel-based dimensions of the image. Applying a different scale factor changes the size of the image as reported by the size property. This is set to the value of scale of the main screen by default, which automatically scales images for retina displays, for instance. + */ +@property (nonatomic, assign) CGFloat imageScale; + +/** + Whether to automatically inflate response image data for compressed formats (such as PNG or JPEG). Enabling this can significantly improve drawing performance on iOS when used with `setCompletionBlockWithSuccess:failure:`, as it allows a bitmap representation to be constructed in the background rather than on the main thread. `YES` by default. + */ +@property (nonatomic, assign) BOOL automaticallyInflatesResponseImage; +#endif + +@end + +#pragma mark - + +/** + `AFCompoundSerializer` is a subclass of `AFHTTPResponseSerializer` that delegates the response serialization to the first `AFHTTPResponseSerializer` object that returns an object for `responseObjectForResponse:data:error:`, falling back on the default behavior of `AFHTTPResponseSerializer`. This is useful for supporting multiple potential types and structures of server responses with a single serializer. + */ +@interface AFCompoundResponseSerializer : AFHTTPResponseSerializer + +/** + The component response serializers. + */ +@property (readonly, nonatomic, copy) NSArray > *responseSerializers; + +/** + Creates and returns a compound serializer comprised of the specified response serializers. + + @warning Each response serializer specified must be a subclass of `AFHTTPResponseSerializer`, and response to `-validateResponse:data:error:`. + */ ++ (instancetype)compoundSerializerWithResponseSerializers:(NSArray > *)responseSerializers; + +@end + +///---------------- +/// @name Constants +///---------------- + +/** + ## Error Domains + + The following error domain is predefined. + + - `NSString * const AFURLResponseSerializationErrorDomain` + + ### Constants + + `AFURLResponseSerializationErrorDomain` + AFURLResponseSerializer errors. Error codes for `AFURLResponseSerializationErrorDomain` correspond to codes in `NSURLErrorDomain`. + */ +FOUNDATION_EXPORT NSString * const AFURLResponseSerializationErrorDomain; + +/** + ## User info dictionary keys + + These keys may exist in the user info dictionary, in addition to those defined for NSError. + + - `NSString * const AFNetworkingOperationFailingURLResponseErrorKey` + - `NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey` + + ### Constants + + `AFNetworkingOperationFailingURLResponseErrorKey` + The corresponding value is an `NSURLResponse` containing the response of the operation associated with an error. This key is only present in the `AFURLResponseSerializationErrorDomain`. + + `AFNetworkingOperationFailingURLResponseDataErrorKey` + The corresponding value is an `NSData` containing the original data of the operation associated with an error. This key is only present in the `AFURLResponseSerializationErrorDomain`. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLResponseErrorKey; + +FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey; + +NS_ASSUME_NONNULL_END diff --git a/grocery-objc/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m b/grocery-objc/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m new file mode 100755 index 0000000..ef5e334 --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m @@ -0,0 +1,828 @@ +// AFURLResponseSerialization.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "AFURLResponseSerialization.h" + +#import + +#if TARGET_OS_IOS +#import +#elif TARGET_OS_WATCH +#import +#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) +#import +#endif + +NSString * const AFURLResponseSerializationErrorDomain = @"com.alamofire.error.serialization.response"; +NSString * const AFNetworkingOperationFailingURLResponseErrorKey = @"com.alamofire.serialization.response.error.response"; +NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey = @"com.alamofire.serialization.response.error.data"; + +static NSError * AFErrorWithUnderlyingError(NSError *error, NSError *underlyingError) { + if (!error) { + return underlyingError; + } + + if (!underlyingError || error.userInfo[NSUnderlyingErrorKey]) { + return error; + } + + NSMutableDictionary *mutableUserInfo = [error.userInfo mutableCopy]; + mutableUserInfo[NSUnderlyingErrorKey] = underlyingError; + + return [[NSError alloc] initWithDomain:error.domain code:error.code userInfo:mutableUserInfo]; +} + +static BOOL AFErrorOrUnderlyingErrorHasCodeInDomain(NSError *error, NSInteger code, NSString *domain) { + if ([error.domain isEqualToString:domain] && error.code == code) { + return YES; + } else if (error.userInfo[NSUnderlyingErrorKey]) { + return AFErrorOrUnderlyingErrorHasCodeInDomain(error.userInfo[NSUnderlyingErrorKey], code, domain); + } + + return NO; +} + +static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions readingOptions) { + if ([JSONObject isKindOfClass:[NSArray class]]) { + NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:[(NSArray *)JSONObject count]]; + for (id value in (NSArray *)JSONObject) { + [mutableArray addObject:AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions)]; + } + + return (readingOptions & NSJSONReadingMutableContainers) ? mutableArray : [NSArray arrayWithArray:mutableArray]; + } else if ([JSONObject isKindOfClass:[NSDictionary class]]) { + NSMutableDictionary *mutableDictionary = [NSMutableDictionary dictionaryWithDictionary:JSONObject]; + for (id key in [(NSDictionary *)JSONObject allKeys]) { + id value = (NSDictionary *)JSONObject[key]; + if (!value || [value isEqual:[NSNull null]]) { + [mutableDictionary removeObjectForKey:key]; + } else if ([value isKindOfClass:[NSArray class]] || [value isKindOfClass:[NSDictionary class]]) { + mutableDictionary[key] = AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions); + } + } + + return (readingOptions & NSJSONReadingMutableContainers) ? mutableDictionary : [NSDictionary dictionaryWithDictionary:mutableDictionary]; + } + + return JSONObject; +} + +@implementation AFHTTPResponseSerializer + ++ (instancetype)serializer { + return [[self alloc] init]; +} + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + self.stringEncoding = NSUTF8StringEncoding; + + self.acceptableStatusCodes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(200, 100)]; + self.acceptableContentTypes = nil; + + return self; +} + +#pragma mark - + +- (BOOL)validateResponse:(NSHTTPURLResponse *)response + data:(NSData *)data + error:(NSError * __autoreleasing *)error +{ + BOOL responseIsValid = YES; + NSError *validationError = nil; + + if (response && [response isKindOfClass:[NSHTTPURLResponse class]]) { + if (self.acceptableContentTypes && ![self.acceptableContentTypes containsObject:[response MIMEType]]) { + if ([data length] > 0 && [response URL]) { + NSMutableDictionary *mutableUserInfo = [@{ + NSLocalizedDescriptionKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Request failed: unacceptable content-type: %@", @"AFNetworking", nil), [response MIMEType]], + NSURLErrorFailingURLErrorKey:[response URL], + AFNetworkingOperationFailingURLResponseErrorKey: response, + } mutableCopy]; + if (data) { + mutableUserInfo[AFNetworkingOperationFailingURLResponseDataErrorKey] = data; + } + + validationError = AFErrorWithUnderlyingError([NSError errorWithDomain:AFURLResponseSerializationErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:mutableUserInfo], validationError); + } + + responseIsValid = NO; + } + + if (self.acceptableStatusCodes && ![self.acceptableStatusCodes containsIndex:(NSUInteger)response.statusCode] && [response URL]) { + NSMutableDictionary *mutableUserInfo = [@{ + NSLocalizedDescriptionKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Request failed: %@ (%ld)", @"AFNetworking", nil), [NSHTTPURLResponse localizedStringForStatusCode:response.statusCode], (long)response.statusCode], + NSURLErrorFailingURLErrorKey:[response URL], + AFNetworkingOperationFailingURLResponseErrorKey: response, + } mutableCopy]; + + if (data) { + mutableUserInfo[AFNetworkingOperationFailingURLResponseDataErrorKey] = data; + } + + validationError = AFErrorWithUnderlyingError([NSError errorWithDomain:AFURLResponseSerializationErrorDomain code:NSURLErrorBadServerResponse userInfo:mutableUserInfo], validationError); + + responseIsValid = NO; + } + } + + if (error && !responseIsValid) { + *error = validationError; + } + + return responseIsValid; +} + +#pragma mark - AFURLResponseSerialization + +- (id)responseObjectForResponse:(NSURLResponse *)response + data:(NSData *)data + error:(NSError *__autoreleasing *)error +{ + [self validateResponse:(NSHTTPURLResponse *)response data:data error:error]; + + return data; +} + +#pragma mark - NSSecureCoding + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (instancetype)initWithCoder:(NSCoder *)decoder { + self = [self init]; + if (!self) { + return nil; + } + + self.acceptableStatusCodes = [decoder decodeObjectOfClass:[NSIndexSet class] forKey:NSStringFromSelector(@selector(acceptableStatusCodes))]; + self.acceptableContentTypes = [decoder decodeObjectOfClass:[NSIndexSet class] forKey:NSStringFromSelector(@selector(acceptableContentTypes))]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [coder encodeObject:self.acceptableStatusCodes forKey:NSStringFromSelector(@selector(acceptableStatusCodes))]; + [coder encodeObject:self.acceptableContentTypes forKey:NSStringFromSelector(@selector(acceptableContentTypes))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFHTTPResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; + serializer.acceptableStatusCodes = [self.acceptableStatusCodes copyWithZone:zone]; + serializer.acceptableContentTypes = [self.acceptableContentTypes copyWithZone:zone]; + + return serializer; +} + +@end + +#pragma mark - + +@implementation AFJSONResponseSerializer + ++ (instancetype)serializer { + return [self serializerWithReadingOptions:(NSJSONReadingOptions)0]; +} + ++ (instancetype)serializerWithReadingOptions:(NSJSONReadingOptions)readingOptions { + AFJSONResponseSerializer *serializer = [[self alloc] init]; + serializer.readingOptions = readingOptions; + + return serializer; +} + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", nil]; + + return self; +} + +#pragma mark - AFURLResponseSerialization + +- (id)responseObjectForResponse:(NSURLResponse *)response + data:(NSData *)data + error:(NSError *__autoreleasing *)error +{ + if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) { + if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) { + return nil; + } + } + + // Workaround for behavior of Rails to return a single space for `head :ok` (a workaround for a bug in Safari), which is not interpreted as valid input by NSJSONSerialization. + // See https://github.com/rails/rails/issues/1742 + NSStringEncoding stringEncoding = self.stringEncoding; + if (response.textEncodingName) { + CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName); + if (encoding != kCFStringEncodingInvalidId) { + stringEncoding = CFStringConvertEncodingToNSStringEncoding(encoding); + } + } + + id responseObject = nil; + NSError *serializationError = nil; + @autoreleasepool { + NSString *responseString = [[NSString alloc] initWithData:data encoding:stringEncoding]; + if (responseString && ![responseString isEqualToString:@" "]) { + // Workaround for a bug in NSJSONSerialization when Unicode character escape codes are used instead of the actual character + // See http://stackoverflow.com/a/12843465/157142 + data = [responseString dataUsingEncoding:NSUTF8StringEncoding]; + + if (data) { + if ([data length] > 0) { + responseObject = [NSJSONSerialization JSONObjectWithData:data options:self.readingOptions error:&serializationError]; + } else { + return nil; + } + } else { + NSDictionary *userInfo = @{ + NSLocalizedDescriptionKey: NSLocalizedStringFromTable(@"Data failed decoding as a UTF-8 string", @"AFNetworking", nil), + NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Could not decode string: %@", @"AFNetworking", nil), responseString] + }; + + serializationError = [NSError errorWithDomain:AFURLResponseSerializationErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:userInfo]; + } + } + } + + if (self.removesKeysWithNullValues && responseObject) { + responseObject = AFJSONObjectByRemovingKeysWithNullValues(responseObject, self.readingOptions); + } + + if (error) { + *error = AFErrorWithUnderlyingError(serializationError, *error); + } + + return responseObject; +} + +#pragma mark - NSSecureCoding + +- (instancetype)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (!self) { + return nil; + } + + self.readingOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(readingOptions))] unsignedIntegerValue]; + self.removesKeysWithNullValues = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(removesKeysWithNullValues))] boolValue]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [super encodeWithCoder:coder]; + + [coder encodeObject:@(self.readingOptions) forKey:NSStringFromSelector(@selector(readingOptions))]; + [coder encodeObject:@(self.removesKeysWithNullValues) forKey:NSStringFromSelector(@selector(removesKeysWithNullValues))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFJSONResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; + serializer.readingOptions = self.readingOptions; + serializer.removesKeysWithNullValues = self.removesKeysWithNullValues; + + return serializer; +} + +@end + +#pragma mark - + +@implementation AFXMLParserResponseSerializer + ++ (instancetype)serializer { + AFXMLParserResponseSerializer *serializer = [[self alloc] init]; + + return serializer; +} + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"application/xml", @"text/xml", nil]; + + return self; +} + +#pragma mark - AFURLResponseSerialization + +- (id)responseObjectForResponse:(NSHTTPURLResponse *)response + data:(NSData *)data + error:(NSError *__autoreleasing *)error +{ + if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) { + if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) { + return nil; + } + } + + return [[NSXMLParser alloc] initWithData:data]; +} + +@end + +#pragma mark - + +#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED + +@implementation AFXMLDocumentResponseSerializer + ++ (instancetype)serializer { + return [self serializerWithXMLDocumentOptions:0]; +} + ++ (instancetype)serializerWithXMLDocumentOptions:(NSUInteger)mask { + AFXMLDocumentResponseSerializer *serializer = [[self alloc] init]; + serializer.options = mask; + + return serializer; +} + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"application/xml", @"text/xml", nil]; + + return self; +} + +#pragma mark - AFURLResponseSerialization + +- (id)responseObjectForResponse:(NSURLResponse *)response + data:(NSData *)data + error:(NSError *__autoreleasing *)error +{ + if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) { + if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) { + return nil; + } + } + + NSError *serializationError = nil; + NSXMLDocument *document = [[NSXMLDocument alloc] initWithData:data options:self.options error:&serializationError]; + + if (error) { + *error = AFErrorWithUnderlyingError(serializationError, *error); + } + + return document; +} + +#pragma mark - NSSecureCoding + +- (instancetype)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (!self) { + return nil; + } + + self.options = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(options))] unsignedIntegerValue]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [super encodeWithCoder:coder]; + + [coder encodeObject:@(self.options) forKey:NSStringFromSelector(@selector(options))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFXMLDocumentResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; + serializer.options = self.options; + + return serializer; +} + +@end + +#endif + +#pragma mark - + +@implementation AFPropertyListResponseSerializer + ++ (instancetype)serializer { + return [self serializerWithFormat:NSPropertyListXMLFormat_v1_0 readOptions:0]; +} + ++ (instancetype)serializerWithFormat:(NSPropertyListFormat)format + readOptions:(NSPropertyListReadOptions)readOptions +{ + AFPropertyListResponseSerializer *serializer = [[self alloc] init]; + serializer.format = format; + serializer.readOptions = readOptions; + + return serializer; +} + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"application/x-plist", nil]; + + return self; +} + +#pragma mark - AFURLResponseSerialization + +- (id)responseObjectForResponse:(NSURLResponse *)response + data:(NSData *)data + error:(NSError *__autoreleasing *)error +{ + if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) { + if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) { + return nil; + } + } + + id responseObject; + NSError *serializationError = nil; + + if (data) { + responseObject = [NSPropertyListSerialization propertyListWithData:data options:self.readOptions format:NULL error:&serializationError]; + } + + if (error) { + *error = AFErrorWithUnderlyingError(serializationError, *error); + } + + return responseObject; +} + +#pragma mark - NSSecureCoding + +- (instancetype)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (!self) { + return nil; + } + + self.format = (NSPropertyListFormat)[[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(format))] unsignedIntegerValue]; + self.readOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(readOptions))] unsignedIntegerValue]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [super encodeWithCoder:coder]; + + [coder encodeObject:@(self.format) forKey:NSStringFromSelector(@selector(format))]; + [coder encodeObject:@(self.readOptions) forKey:NSStringFromSelector(@selector(readOptions))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFPropertyListResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; + serializer.format = self.format; + serializer.readOptions = self.readOptions; + + return serializer; +} + +@end + +#pragma mark - + +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH +#import +#import + +@interface UIImage (AFNetworkingSafeImageLoading) ++ (UIImage *)af_safeImageWithData:(NSData *)data; +@end + +static NSLock* imageLock = nil; + +@implementation UIImage (AFNetworkingSafeImageLoading) + ++ (UIImage *)af_safeImageWithData:(NSData *)data { + UIImage* image = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + imageLock = [[NSLock alloc] init]; + }); + + [imageLock lock]; + image = [UIImage imageWithData:data]; + [imageLock unlock]; + return image; +} + +@end + +static UIImage * AFImageWithDataAtScale(NSData *data, CGFloat scale) { + UIImage *image = [UIImage af_safeImageWithData:data]; + if (image.images) { + return image; + } + + return [[UIImage alloc] initWithCGImage:[image CGImage] scale:scale orientation:image.imageOrientation]; +} + +static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *response, NSData *data, CGFloat scale) { + if (!data || [data length] == 0) { + return nil; + } + + CGImageRef imageRef = NULL; + CGDataProviderRef dataProvider = CGDataProviderCreateWithCFData((__bridge CFDataRef)data); + + if ([response.MIMEType isEqualToString:@"image/png"]) { + imageRef = CGImageCreateWithPNGDataProvider(dataProvider, NULL, true, kCGRenderingIntentDefault); + } else if ([response.MIMEType isEqualToString:@"image/jpeg"]) { + imageRef = CGImageCreateWithJPEGDataProvider(dataProvider, NULL, true, kCGRenderingIntentDefault); + + if (imageRef) { + CGColorSpaceRef imageColorSpace = CGImageGetColorSpace(imageRef); + CGColorSpaceModel imageColorSpaceModel = CGColorSpaceGetModel(imageColorSpace); + + // CGImageCreateWithJPEGDataProvider does not properly handle CMKY, so fall back to AFImageWithDataAtScale + if (imageColorSpaceModel == kCGColorSpaceModelCMYK) { + CGImageRelease(imageRef); + imageRef = NULL; + } + } + } + + CGDataProviderRelease(dataProvider); + + UIImage *image = AFImageWithDataAtScale(data, scale); + if (!imageRef) { + if (image.images || !image) { + return image; + } + + imageRef = CGImageCreateCopy([image CGImage]); + if (!imageRef) { + return nil; + } + } + + size_t width = CGImageGetWidth(imageRef); + size_t height = CGImageGetHeight(imageRef); + size_t bitsPerComponent = CGImageGetBitsPerComponent(imageRef); + + if (width * height > 1024 * 1024 || bitsPerComponent > 8) { + CGImageRelease(imageRef); + + return image; + } + + // CGImageGetBytesPerRow() calculates incorrectly in iOS 5.0, so defer to CGBitmapContextCreate + size_t bytesPerRow = 0; + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CGColorSpaceModel colorSpaceModel = CGColorSpaceGetModel(colorSpace); + CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef); + + if (colorSpaceModel == kCGColorSpaceModelRGB) { + uint32_t alpha = (bitmapInfo & kCGBitmapAlphaInfoMask); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wassign-enum" + if (alpha == kCGImageAlphaNone) { + bitmapInfo &= ~kCGBitmapAlphaInfoMask; + bitmapInfo |= kCGImageAlphaNoneSkipFirst; + } else if (!(alpha == kCGImageAlphaNoneSkipFirst || alpha == kCGImageAlphaNoneSkipLast)) { + bitmapInfo &= ~kCGBitmapAlphaInfoMask; + bitmapInfo |= kCGImageAlphaPremultipliedFirst; + } +#pragma clang diagnostic pop + } + + CGContextRef context = CGBitmapContextCreate(NULL, width, height, bitsPerComponent, bytesPerRow, colorSpace, bitmapInfo); + + CGColorSpaceRelease(colorSpace); + + if (!context) { + CGImageRelease(imageRef); + + return image; + } + + CGContextDrawImage(context, CGRectMake(0.0f, 0.0f, width, height), imageRef); + CGImageRef inflatedImageRef = CGBitmapContextCreateImage(context); + + CGContextRelease(context); + + UIImage *inflatedImage = [[UIImage alloc] initWithCGImage:inflatedImageRef scale:scale orientation:image.imageOrientation]; + + CGImageRelease(inflatedImageRef); + CGImageRelease(imageRef); + + return inflatedImage; +} +#endif + + +@implementation AFImageResponseSerializer + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"image/tiff", @"image/jpeg", @"image/gif", @"image/png", @"image/ico", @"image/x-icon", @"image/bmp", @"image/x-bmp", @"image/x-xbitmap", @"image/x-win-bitmap", nil]; + +#if TARGET_OS_IOS || TARGET_OS_TV + self.imageScale = [[UIScreen mainScreen] scale]; + self.automaticallyInflatesResponseImage = YES; +#elif TARGET_OS_WATCH + self.imageScale = [[WKInterfaceDevice currentDevice] screenScale]; + self.automaticallyInflatesResponseImage = YES; +#endif + + return self; +} + +#pragma mark - AFURLResponseSerializer + +- (id)responseObjectForResponse:(NSURLResponse *)response + data:(NSData *)data + error:(NSError *__autoreleasing *)error +{ + if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) { + if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) { + return nil; + } + } + +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH + if (self.automaticallyInflatesResponseImage) { + return AFInflatedImageFromResponseWithDataAtScale((NSHTTPURLResponse *)response, data, self.imageScale); + } else { + return AFImageWithDataAtScale(data, self.imageScale); + } +#else + // Ensure that the image is set to it's correct pixel width and height + NSBitmapImageRep *bitimage = [[NSBitmapImageRep alloc] initWithData:data]; + NSImage *image = [[NSImage alloc] initWithSize:NSMakeSize([bitimage pixelsWide], [bitimage pixelsHigh])]; + [image addRepresentation:bitimage]; + + return image; +#endif + + return nil; +} + +#pragma mark - NSSecureCoding + +- (instancetype)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (!self) { + return nil; + } + +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH + NSNumber *imageScale = [decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(imageScale))]; +#if CGFLOAT_IS_DOUBLE + self.imageScale = [imageScale doubleValue]; +#else + self.imageScale = [imageScale floatValue]; +#endif + + self.automaticallyInflatesResponseImage = [decoder decodeBoolForKey:NSStringFromSelector(@selector(automaticallyInflatesResponseImage))]; +#endif + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [super encodeWithCoder:coder]; + +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH + [coder encodeObject:@(self.imageScale) forKey:NSStringFromSelector(@selector(imageScale))]; + [coder encodeBool:self.automaticallyInflatesResponseImage forKey:NSStringFromSelector(@selector(automaticallyInflatesResponseImage))]; +#endif +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFImageResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; + +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH + serializer.imageScale = self.imageScale; + serializer.automaticallyInflatesResponseImage = self.automaticallyInflatesResponseImage; +#endif + + return serializer; +} + +@end + +#pragma mark - + +@interface AFCompoundResponseSerializer () +@property (readwrite, nonatomic, copy) NSArray *responseSerializers; +@end + +@implementation AFCompoundResponseSerializer + ++ (instancetype)compoundSerializerWithResponseSerializers:(NSArray *)responseSerializers { + AFCompoundResponseSerializer *serializer = [[self alloc] init]; + serializer.responseSerializers = responseSerializers; + + return serializer; +} + +#pragma mark - AFURLResponseSerialization + +- (id)responseObjectForResponse:(NSURLResponse *)response + data:(NSData *)data + error:(NSError *__autoreleasing *)error +{ + for (id serializer in self.responseSerializers) { + if (![serializer isKindOfClass:[AFHTTPResponseSerializer class]]) { + continue; + } + + NSError *serializerError = nil; + id responseObject = [serializer responseObjectForResponse:response data:data error:&serializerError]; + if (responseObject) { + if (error) { + *error = AFErrorWithUnderlyingError(serializerError, *error); + } + + return responseObject; + } + } + + return [super responseObjectForResponse:response data:data error:error]; +} + +#pragma mark - NSSecureCoding + +- (instancetype)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (!self) { + return nil; + } + + self.responseSerializers = [decoder decodeObjectOfClass:[NSArray class] forKey:NSStringFromSelector(@selector(responseSerializers))]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [super encodeWithCoder:coder]; + + [coder encodeObject:self.responseSerializers forKey:NSStringFromSelector(@selector(responseSerializers))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFCompoundResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; + serializer.responseSerializers = self.responseSerializers; + + return serializer; +} + +@end diff --git a/grocery-objc/Pods/AFNetworking/AFNetworking/AFURLSessionManager.h b/grocery-objc/Pods/AFNetworking/AFNetworking/AFURLSessionManager.h new file mode 100644 index 0000000..be91828 --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/AFNetworking/AFURLSessionManager.h @@ -0,0 +1,499 @@ +// AFURLSessionManager.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + + +#import + +#import "AFURLResponseSerialization.h" +#import "AFURLRequestSerialization.h" +#import "AFSecurityPolicy.h" +#if !TARGET_OS_WATCH +#import "AFNetworkReachabilityManager.h" +#endif + +/** + `AFURLSessionManager` creates and manages an `NSURLSession` object based on a specified `NSURLSessionConfiguration` object, which conforms to ``, ``, ``, and ``. + + ## Subclassing Notes + + This is the base class for `AFHTTPSessionManager`, which adds functionality specific to making HTTP requests. If you are looking to extend `AFURLSessionManager` specifically for HTTP, consider subclassing `AFHTTPSessionManager` instead. + + ## NSURLSession & NSURLSessionTask Delegate Methods + + `AFURLSessionManager` implements the following delegate methods: + + ### `NSURLSessionDelegate` + + - `URLSession:didBecomeInvalidWithError:` + - `URLSession:didReceiveChallenge:completionHandler:` + - `URLSessionDidFinishEventsForBackgroundURLSession:` + + ### `NSURLSessionTaskDelegate` + + - `URLSession:willPerformHTTPRedirection:newRequest:completionHandler:` + - `URLSession:task:didReceiveChallenge:completionHandler:` + - `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:` + - `URLSession:task:didCompleteWithError:` + + ### `NSURLSessionDataDelegate` + + - `URLSession:dataTask:didReceiveResponse:completionHandler:` + - `URLSession:dataTask:didBecomeDownloadTask:` + - `URLSession:dataTask:didReceiveData:` + - `URLSession:dataTask:willCacheResponse:completionHandler:` + + ### `NSURLSessionDownloadDelegate` + + - `URLSession:downloadTask:didFinishDownloadingToURL:` + - `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesWritten:totalBytesExpectedToWrite:` + - `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:` + + If any of these methods are overridden in a subclass, they _must_ call the `super` implementation first. + + ## Network Reachability Monitoring + + Network reachability status and change monitoring is available through the `reachabilityManager` property. Applications may choose to monitor network reachability conditions in order to prevent or suspend any outbound requests. See `AFNetworkReachabilityManager` for more details. + + ## NSCoding Caveats + + - Encoded managers do not include any block properties. Be sure to set delegate callback blocks when using `-initWithCoder:` or `NSKeyedUnarchiver`. + + ## NSCopying Caveats + + - `-copy` and `-copyWithZone:` return a new manager with a new `NSURLSession` created from the configuration of the original. + - Operation copies do not include any delegate callback blocks, as they often strongly captures a reference to `self`, which would otherwise have the unintuitive side-effect of pointing to the _original_ session manager when copied. + + @warning Managers for background sessions must be owned for the duration of their use. This can be accomplished by creating an application-wide or shared singleton instance. + */ + +NS_ASSUME_NONNULL_BEGIN + +@interface AFURLSessionManager : NSObject + +/** + The managed session. + */ +@property (readonly, nonatomic, strong) NSURLSession *session; + +/** + The operation queue on which delegate callbacks are run. + */ +@property (readonly, nonatomic, strong) NSOperationQueue *operationQueue; + +/** + Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to an instance of `AFJSONResponseSerializer`. + + @warning `responseSerializer` must not be `nil`. + */ +@property (nonatomic, strong) id responseSerializer; + +///------------------------------- +/// @name Managing Security Policy +///------------------------------- + +/** + The security policy used by created session to evaluate server trust for secure connections. `AFURLSessionManager` uses the `defaultPolicy` unless otherwise specified. + */ +@property (nonatomic, strong) AFSecurityPolicy *securityPolicy; + +#if !TARGET_OS_WATCH +///-------------------------------------- +/// @name Monitoring Network Reachability +///-------------------------------------- + +/** + The network reachability manager. `AFURLSessionManager` uses the `sharedManager` by default. + */ +@property (readwrite, nonatomic, strong) AFNetworkReachabilityManager *reachabilityManager; +#endif + +///---------------------------- +/// @name Getting Session Tasks +///---------------------------- + +/** + The data, upload, and download tasks currently run by the managed session. + */ +@property (readonly, nonatomic, strong) NSArray *tasks; + +/** + The data tasks currently run by the managed session. + */ +@property (readonly, nonatomic, strong) NSArray *dataTasks; + +/** + The upload tasks currently run by the managed session. + */ +@property (readonly, nonatomic, strong) NSArray *uploadTasks; + +/** + The download tasks currently run by the managed session. + */ +@property (readonly, nonatomic, strong) NSArray *downloadTasks; + +///------------------------------- +/// @name Managing Callback Queues +///------------------------------- + +/** + The dispatch queue for `completionBlock`. If `NULL` (default), the main queue is used. + */ +@property (nonatomic, strong, nullable) dispatch_queue_t completionQueue; + +/** + The dispatch group for `completionBlock`. If `NULL` (default), a private dispatch group is used. + */ +@property (nonatomic, strong, nullable) dispatch_group_t completionGroup; + +///--------------------------------- +/// @name Working Around System Bugs +///--------------------------------- + +/** + Whether to attempt to retry creation of upload tasks for background sessions when initial call returns `nil`. `NO` by default. + + @bug As of iOS 7.0, there is a bug where upload tasks created for background tasks are sometimes `nil`. As a workaround, if this property is `YES`, AFNetworking will follow Apple's recommendation to try creating the task again. + + @see https://github.com/AFNetworking/AFNetworking/issues/1675 + */ +@property (nonatomic, assign) BOOL attemptsToRecreateUploadTasksForBackgroundSessions; + +///--------------------- +/// @name Initialization +///--------------------- + +/** + Creates and returns a manager for a session created with the specified configuration. This is the designated initializer. + + @param configuration The configuration used to create the managed session. + + @return A manager for a newly-created session. + */ +- (instancetype)initWithSessionConfiguration:(nullable NSURLSessionConfiguration *)configuration NS_DESIGNATED_INITIALIZER; + +/** + Invalidates the managed session, optionally canceling pending tasks. + + @param cancelPendingTasks Whether or not to cancel pending tasks. + */ +- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks; + +///------------------------- +/// @name Running Data Tasks +///------------------------- + +/** + Creates an `NSURLSessionDataTask` with the specified request. + + @param request The HTTP request for the request. + @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. + */ +- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request + completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; + +/** + Creates an `NSURLSessionDataTask` with the specified request. + + @param request The HTTP request for the request. + @param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. + @param downloadProgress A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue. + @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. + */ +- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request + uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgressBlock + downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgressBlock + completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; + +///--------------------------- +/// @name Running Upload Tasks +///--------------------------- + +/** + Creates an `NSURLSessionUploadTask` with the specified request for a local file. + + @param request The HTTP request for the request. + @param fileURL A URL to the local file to be uploaded. + @param progress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. + @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. + + @see `attemptsToRecreateUploadTasksForBackgroundSessions` + */ +- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request + fromFile:(NSURL *)fileURL + progress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgressBlock + completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; + +/** + Creates an `NSURLSessionUploadTask` with the specified request for an HTTP body. + + @param request The HTTP request for the request. + @param bodyData A data object containing the HTTP body to be uploaded. + @param progress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. + @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. + */ +- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request + fromData:(nullable NSData *)bodyData + progress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgressBlock + completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; + +/** + Creates an `NSURLSessionUploadTask` with the specified streaming request. + + @param request The HTTP request for the request. + @param progress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. + @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. + */ +- (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request + progress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgressBlock + completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; + +///----------------------------- +/// @name Running Download Tasks +///----------------------------- + +/** + Creates an `NSURLSessionDownloadTask` with the specified request. + + @param request The HTTP request for the request. + @param progress A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue. + @param destination A block object to be executed in order to determine the destination of the downloaded file. This block takes two arguments, the target path & the server response, and returns the desired file URL of the resulting download. The temporary file used during the download will be automatically deleted after being moved to the returned URL. + @param completionHandler A block to be executed when a task finishes. This block has no return value and takes three arguments: the server response, the path of the downloaded file, and the error describing the network or parsing error that occurred, if any. + + @warning If using a background `NSURLSessionConfiguration` on iOS, these blocks will be lost when the app is terminated. Background sessions may prefer to use `-setDownloadTaskDidFinishDownloadingBlock:` to specify the URL for saving the downloaded file, rather than the destination block of this method. + */ +- (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request + progress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgressBlock + destination:(nullable NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination + completionHandler:(nullable void (^)(NSURLResponse *response, NSURL * _Nullable filePath, NSError * _Nullable error))completionHandler; + +/** + Creates an `NSURLSessionDownloadTask` with the specified resume data. + + @param resumeData The data used to resume downloading. + @param progress A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue. + @param destination A block object to be executed in order to determine the destination of the downloaded file. This block takes two arguments, the target path & the server response, and returns the desired file URL of the resulting download. The temporary file used during the download will be automatically deleted after being moved to the returned URL. + @param completionHandler A block to be executed when a task finishes. This block has no return value and takes three arguments: the server response, the path of the downloaded file, and the error describing the network or parsing error that occurred, if any. + */ +- (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData + progress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgressBlock + destination:(nullable NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination + completionHandler:(nullable void (^)(NSURLResponse *response, NSURL * _Nullable filePath, NSError * _Nullable error))completionHandler; + +///--------------------------------- +/// @name Getting Progress for Tasks +///--------------------------------- + +/** + Returns the upload progress of the specified task. + + @param task The session task. Must not be `nil`. + + @return An `NSProgress` object reporting the upload progress of a task, or `nil` if the progress is unavailable. + */ +- (nullable NSProgress *)uploadProgressForTask:(NSURLSessionTask *)task; + +/** + Returns the download progress of the specified task. + + @param task The session task. Must not be `nil`. + + @return An `NSProgress` object reporting the download progress of a task, or `nil` if the progress is unavailable. + */ +- (nullable NSProgress *)downloadProgressForTask:(NSURLSessionTask *)task; + +///----------------------------------------- +/// @name Setting Session Delegate Callbacks +///----------------------------------------- + +/** + Sets a block to be executed when the managed session becomes invalid, as handled by the `NSURLSessionDelegate` method `URLSession:didBecomeInvalidWithError:`. + + @param block A block object to be executed when the managed session becomes invalid. The block has no return value, and takes two arguments: the session, and the error related to the cause of invalidation. + */ +- (void)setSessionDidBecomeInvalidBlock:(nullable void (^)(NSURLSession *session, NSError *error))block; + +/** + Sets a block to be executed when a connection level authentication challenge has occurred, as handled by the `NSURLSessionDelegate` method `URLSession:didReceiveChallenge:completionHandler:`. + + @param block A block object to be executed when a connection level authentication challenge has occurred. The block returns the disposition of the authentication challenge, and takes three arguments: the session, the authentication challenge, and a pointer to the credential that should be used to resolve the challenge. + */ +- (void)setSessionDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * _Nullable __autoreleasing * _Nullable credential))block; + +///-------------------------------------- +/// @name Setting Task Delegate Callbacks +///-------------------------------------- + +/** + Sets a block to be executed when a task requires a new request body stream to send to the remote server, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:needNewBodyStream:`. + + @param block A block object to be executed when a task requires a new request body stream. + */ +- (void)setTaskNeedNewBodyStreamBlock:(nullable NSInputStream * (^)(NSURLSession *session, NSURLSessionTask *task))block; + +/** + Sets a block to be executed when an HTTP request is attempting to perform a redirection to a different URL, as handled by the `NSURLSessionTaskDelegate` method `URLSession:willPerformHTTPRedirection:newRequest:completionHandler:`. + + @param block A block object to be executed when an HTTP request is attempting to perform a redirection to a different URL. The block returns the request to be made for the redirection, and takes four arguments: the session, the task, the redirection response, and the request corresponding to the redirection response. + */ +- (void)setTaskWillPerformHTTPRedirectionBlock:(nullable NSURLRequest * (^)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request))block; + +/** + Sets a block to be executed when a session task has received a request specific authentication challenge, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didReceiveChallenge:completionHandler:`. + + @param block A block object to be executed when a session task has received a request specific authentication challenge. The block returns the disposition of the authentication challenge, and takes four arguments: the session, the task, the authentication challenge, and a pointer to the credential that should be used to resolve the challenge. + */ +- (void)setTaskDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * _Nullable __autoreleasing * _Nullable credential))block; + +/** + Sets a block to be executed periodically to track upload progress, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`. + + @param block A block object to be called when an undetermined number of bytes have been uploaded to the server. This block has no return value and takes five arguments: the session, the task, the number of bytes written since the last time the upload progress block was called, the total bytes written, and the total bytes expected to be written during the request, as initially determined by the length of the HTTP body. This block may be called multiple times, and will execute on the main thread. + */ +- (void)setTaskDidSendBodyDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend))block; + +/** + Sets a block to be executed as the last message related to a specific task, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didCompleteWithError:`. + + @param block A block object to be executed when a session task is completed. The block has no return value, and takes three arguments: the session, the task, and any error that occurred in the process of executing the task. + */ +- (void)setTaskDidCompleteBlock:(nullable void (^)(NSURLSession *session, NSURLSessionTask *task, NSError * _Nullable error))block; + +///------------------------------------------- +/// @name Setting Data Task Delegate Callbacks +///------------------------------------------- + +/** + Sets a block to be executed when a data task has received a response, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:didReceiveResponse:completionHandler:`. + + @param block A block object to be executed when a data task has received a response. The block returns the disposition of the session response, and takes three arguments: the session, the data task, and the received response. + */ +- (void)setDataTaskDidReceiveResponseBlock:(nullable NSURLSessionResponseDisposition (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response))block; + +/** + Sets a block to be executed when a data task has become a download task, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:didBecomeDownloadTask:`. + + @param block A block object to be executed when a data task has become a download task. The block has no return value, and takes three arguments: the session, the data task, and the download task it has become. + */ +- (void)setDataTaskDidBecomeDownloadTaskBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLSessionDownloadTask *downloadTask))block; + +/** + Sets a block to be executed when a data task receives data, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:didReceiveData:`. + + @param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the session, the data task, and the data received. This block may be called multiple times, and will execute on the session manager operation queue. + */ +- (void)setDataTaskDidReceiveDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSData *data))block; + +/** + Sets a block to be executed to determine the caching behavior of a data task, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:willCacheResponse:completionHandler:`. + + @param block A block object to be executed to determine the caching behavior of a data task. The block returns the response to cache, and takes three arguments: the session, the data task, and the proposed cached URL response. + */ +- (void)setDataTaskWillCacheResponseBlock:(nullable NSCachedURLResponse * (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSCachedURLResponse *proposedResponse))block; + +/** + Sets a block to be executed once all messages enqueued for a session have been delivered, as handled by the `NSURLSessionDataDelegate` method `URLSessionDidFinishEventsForBackgroundURLSession:`. + + @param block A block object to be executed once all messages enqueued for a session have been delivered. The block has no return value and takes a single argument: the session. + */ +- (void)setDidFinishEventsForBackgroundURLSessionBlock:(nullable void (^)(NSURLSession *session))block; + +///----------------------------------------------- +/// @name Setting Download Task Delegate Callbacks +///----------------------------------------------- + +/** + Sets a block to be executed when a download task has completed a download, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didFinishDownloadingToURL:`. + + @param block A block object to be executed when a download task has completed. The block returns the URL the download should be moved to, and takes three arguments: the session, the download task, and the temporary location of the downloaded file. If the file manager encounters an error while attempting to move the temporary file to the destination, an `AFURLSessionDownloadTaskDidFailToMoveFileNotification` will be posted, with the download task as its object, and the user info of the error. + */ +- (void)setDownloadTaskDidFinishDownloadingBlock:(nullable NSURL * _Nullable (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location))block; + +/** + Sets a block to be executed periodically to track download progress, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesWritten:totalBytesExpectedToWrite:`. + + @param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes five arguments: the session, the download task, the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the session manager operation queue. + */ +- (void)setDownloadTaskDidWriteDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite))block; + +/** + Sets a block to be executed when a download task has been resumed, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:`. + + @param block A block object to be executed when a download task has been resumed. The block has no return value and takes four arguments: the session, the download task, the file offset of the resumed download, and the total number of bytes expected to be downloaded. + */ +- (void)setDownloadTaskDidResumeBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t fileOffset, int64_t expectedTotalBytes))block; + +@end + +///-------------------- +/// @name Notifications +///-------------------- + +/** + Posted when a task resumes. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidResumeNotification; + +/** + Posted when a task finishes executing. Includes a userInfo dictionary with additional information about the task. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteNotification; + +/** + Posted when a task suspends its execution. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidSuspendNotification; + +/** + Posted when a session is invalidated. + */ +FOUNDATION_EXPORT NSString * const AFURLSessionDidInvalidateNotification; + +/** + Posted when a session download task encountered an error when moving the temporary download file to a specified destination. + */ +FOUNDATION_EXPORT NSString * const AFURLSessionDownloadTaskDidFailToMoveFileNotification; + +/** + The raw response data of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if response data exists for the task. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteResponseDataKey; + +/** + The serialized response object of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if the response was serialized. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteSerializedResponseKey; + +/** + The response serializer used to serialize the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if the task has an associated response serializer. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteResponseSerializerKey; + +/** + The file path associated with the download task. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if an the response data has been stored directly to disk. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteAssetPathKey; + +/** + Any error associated with the task, or the serialization of the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if an error exists. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteErrorKey; + +NS_ASSUME_NONNULL_END diff --git a/grocery-objc/Pods/AFNetworking/AFNetworking/AFURLSessionManager.m b/grocery-objc/Pods/AFNetworking/AFNetworking/AFURLSessionManager.m new file mode 100644 index 0000000..de447ae --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/AFNetworking/AFURLSessionManager.m @@ -0,0 +1,1244 @@ +// AFURLSessionManager.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "AFURLSessionManager.h" +#import + +#ifndef NSFoundationVersionNumber_iOS_8_0 +#define NSFoundationVersionNumber_With_Fixed_5871104061079552_bug 1140.11 +#else +#define NSFoundationVersionNumber_With_Fixed_5871104061079552_bug NSFoundationVersionNumber_iOS_8_0 +#endif + +static dispatch_queue_t url_session_manager_creation_queue() { + static dispatch_queue_t af_url_session_manager_creation_queue; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + af_url_session_manager_creation_queue = dispatch_queue_create("com.alamofire.networking.session.manager.creation", DISPATCH_QUEUE_SERIAL); + }); + + return af_url_session_manager_creation_queue; +} + +static void url_session_manager_create_task_safely(dispatch_block_t block) { + if (NSFoundationVersionNumber < NSFoundationVersionNumber_With_Fixed_5871104061079552_bug) { + // Fix of bug + // Open Radar:http://openradar.appspot.com/radar?id=5871104061079552 (status: Fixed in iOS8) + // Issue about:https://github.com/AFNetworking/AFNetworking/issues/2093 + dispatch_sync(url_session_manager_creation_queue(), block); + } else { + block(); + } +} + +static dispatch_queue_t url_session_manager_processing_queue() { + static dispatch_queue_t af_url_session_manager_processing_queue; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + af_url_session_manager_processing_queue = dispatch_queue_create("com.alamofire.networking.session.manager.processing", DISPATCH_QUEUE_CONCURRENT); + }); + + return af_url_session_manager_processing_queue; +} + +static dispatch_group_t url_session_manager_completion_group() { + static dispatch_group_t af_url_session_manager_completion_group; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + af_url_session_manager_completion_group = dispatch_group_create(); + }); + + return af_url_session_manager_completion_group; +} + +NSString * const AFNetworkingTaskDidResumeNotification = @"com.alamofire.networking.task.resume"; +NSString * const AFNetworkingTaskDidCompleteNotification = @"com.alamofire.networking.task.complete"; +NSString * const AFNetworkingTaskDidSuspendNotification = @"com.alamofire.networking.task.suspend"; +NSString * const AFURLSessionDidInvalidateNotification = @"com.alamofire.networking.session.invalidate"; +NSString * const AFURLSessionDownloadTaskDidFailToMoveFileNotification = @"com.alamofire.networking.session.download.file-manager-error"; + +NSString * const AFNetworkingTaskDidCompleteSerializedResponseKey = @"com.alamofire.networking.task.complete.serializedresponse"; +NSString * const AFNetworkingTaskDidCompleteResponseSerializerKey = @"com.alamofire.networking.task.complete.responseserializer"; +NSString * const AFNetworkingTaskDidCompleteResponseDataKey = @"com.alamofire.networking.complete.finish.responsedata"; +NSString * const AFNetworkingTaskDidCompleteErrorKey = @"com.alamofire.networking.task.complete.error"; +NSString * const AFNetworkingTaskDidCompleteAssetPathKey = @"com.alamofire.networking.task.complete.assetpath"; + +static NSString * const AFURLSessionManagerLockName = @"com.alamofire.networking.session.manager.lock"; + +static NSUInteger const AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask = 3; + +static void * AFTaskStateChangedContext = &AFTaskStateChangedContext; + +typedef void (^AFURLSessionDidBecomeInvalidBlock)(NSURLSession *session, NSError *error); +typedef NSURLSessionAuthChallengeDisposition (^AFURLSessionDidReceiveAuthenticationChallengeBlock)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential); + +typedef NSURLRequest * (^AFURLSessionTaskWillPerformHTTPRedirectionBlock)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request); +typedef NSURLSessionAuthChallengeDisposition (^AFURLSessionTaskDidReceiveAuthenticationChallengeBlock)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential); +typedef void (^AFURLSessionDidFinishEventsForBackgroundURLSessionBlock)(NSURLSession *session); + +typedef NSInputStream * (^AFURLSessionTaskNeedNewBodyStreamBlock)(NSURLSession *session, NSURLSessionTask *task); +typedef void (^AFURLSessionTaskDidSendBodyDataBlock)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend); +typedef void (^AFURLSessionTaskDidCompleteBlock)(NSURLSession *session, NSURLSessionTask *task, NSError *error); + +typedef NSURLSessionResponseDisposition (^AFURLSessionDataTaskDidReceiveResponseBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response); +typedef void (^AFURLSessionDataTaskDidBecomeDownloadTaskBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLSessionDownloadTask *downloadTask); +typedef void (^AFURLSessionDataTaskDidReceiveDataBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSData *data); +typedef NSCachedURLResponse * (^AFURLSessionDataTaskWillCacheResponseBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSCachedURLResponse *proposedResponse); + +typedef NSURL * (^AFURLSessionDownloadTaskDidFinishDownloadingBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location); +typedef void (^AFURLSessionDownloadTaskDidWriteDataBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite); +typedef void (^AFURLSessionDownloadTaskDidResumeBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t fileOffset, int64_t expectedTotalBytes); +typedef void (^AFURLSessionTaskProgressBlock)(NSProgress *); + +typedef void (^AFURLSessionTaskCompletionHandler)(NSURLResponse *response, id responseObject, NSError *error); + + +#pragma mark - + +@interface AFURLSessionManagerTaskDelegate : NSObject +@property (nonatomic, weak) AFURLSessionManager *manager; +@property (nonatomic, strong) NSMutableData *mutableData; +@property (nonatomic, strong) NSProgress *uploadProgress; +@property (nonatomic, strong) NSProgress *downloadProgress; +@property (nonatomic, copy) NSURL *downloadFileURL; +@property (nonatomic, copy) AFURLSessionDownloadTaskDidFinishDownloadingBlock downloadTaskDidFinishDownloading; +@property (nonatomic, copy) AFURLSessionTaskProgressBlock uploadProgressBlock; +@property (nonatomic, copy) AFURLSessionTaskProgressBlock downloadProgressBlock; +@property (nonatomic, copy) AFURLSessionTaskCompletionHandler completionHandler; +@end + +@implementation AFURLSessionManagerTaskDelegate + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + self.mutableData = [NSMutableData data]; + self.uploadProgress = [[NSProgress alloc] initWithParent:nil userInfo:nil]; + self.uploadProgress.totalUnitCount = NSURLSessionTransferSizeUnknown; + + self.downloadProgress = [[NSProgress alloc] initWithParent:nil userInfo:nil]; + self.downloadProgress.totalUnitCount = NSURLSessionTransferSizeUnknown; + return self; +} + +#pragma mark - NSProgress Tracking + +- (void)setupProgressForTask:(NSURLSessionTask *)task { + __weak __typeof__(task) weakTask = task; + + self.uploadProgress.totalUnitCount = task.countOfBytesExpectedToSend; + self.downloadProgress.totalUnitCount = task.countOfBytesExpectedToReceive; + [self.uploadProgress setCancellable:YES]; + [self.uploadProgress setCancellationHandler:^{ + __typeof__(weakTask) strongTask = weakTask; + [strongTask cancel]; + }]; + [self.uploadProgress setPausable:YES]; + [self.uploadProgress setPausingHandler:^{ + __typeof__(weakTask) strongTask = weakTask; + [strongTask suspend]; + }]; + if ([self.uploadProgress respondsToSelector:@selector(setResumingHandler:)]) { + [self.uploadProgress setResumingHandler:^{ + __typeof__(weakTask) strongTask = weakTask; + [strongTask resume]; + }]; + } + + [self.downloadProgress setCancellable:YES]; + [self.downloadProgress setCancellationHandler:^{ + __typeof__(weakTask) strongTask = weakTask; + [strongTask cancel]; + }]; + [self.downloadProgress setPausable:YES]; + [self.downloadProgress setPausingHandler:^{ + __typeof__(weakTask) strongTask = weakTask; + [strongTask suspend]; + }]; + + if ([self.downloadProgress respondsToSelector:@selector(setResumingHandler:)]) { + [self.downloadProgress setResumingHandler:^{ + __typeof__(weakTask) strongTask = weakTask; + [strongTask resume]; + }]; + } + + [task addObserver:self + forKeyPath:NSStringFromSelector(@selector(countOfBytesReceived)) + options:NSKeyValueObservingOptionNew + context:NULL]; + [task addObserver:self + forKeyPath:NSStringFromSelector(@selector(countOfBytesExpectedToReceive)) + options:NSKeyValueObservingOptionNew + context:NULL]; + + [task addObserver:self + forKeyPath:NSStringFromSelector(@selector(countOfBytesSent)) + options:NSKeyValueObservingOptionNew + context:NULL]; + [task addObserver:self + forKeyPath:NSStringFromSelector(@selector(countOfBytesExpectedToSend)) + options:NSKeyValueObservingOptionNew + context:NULL]; + + [self.downloadProgress addObserver:self + forKeyPath:NSStringFromSelector(@selector(fractionCompleted)) + options:NSKeyValueObservingOptionNew + context:NULL]; + [self.uploadProgress addObserver:self + forKeyPath:NSStringFromSelector(@selector(fractionCompleted)) + options:NSKeyValueObservingOptionNew + context:NULL]; +} + +- (void)cleanUpProgressForTask:(NSURLSessionTask *)task { + [task removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesReceived))]; + [task removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesExpectedToReceive))]; + [task removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesSent))]; + [task removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesExpectedToSend))]; + [self.downloadProgress removeObserver:self forKeyPath:NSStringFromSelector(@selector(fractionCompleted))]; + [self.uploadProgress removeObserver:self forKeyPath:NSStringFromSelector(@selector(fractionCompleted))]; +} + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { + if ([object isKindOfClass:[NSURLSessionTask class]]) { + if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesReceived))]) { + self.downloadProgress.completedUnitCount = [change[@"new"] longLongValue]; + } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesExpectedToReceive))]) { + self.downloadProgress.totalUnitCount = [change[@"new"] longLongValue]; + } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesSent))]) { + self.uploadProgress.completedUnitCount = [change[@"new"] longLongValue]; + } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesExpectedToSend))]) { + self.uploadProgress.totalUnitCount = [change[@"new"] longLongValue]; + } + } + else if ([object isEqual:self.downloadProgress]) { + if (self.downloadProgressBlock) { + self.downloadProgressBlock(object); + } + } + else if ([object isEqual:self.uploadProgress]) { + if (self.uploadProgressBlock) { + self.uploadProgressBlock(object); + } + } +} + +#pragma mark - NSURLSessionTaskDelegate + +- (void)URLSession:(__unused NSURLSession *)session + task:(NSURLSessionTask *)task +didCompleteWithError:(NSError *)error +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + __strong AFURLSessionManager *manager = self.manager; + + __block id responseObject = nil; + + __block NSMutableDictionary *userInfo = [NSMutableDictionary dictionary]; + userInfo[AFNetworkingTaskDidCompleteResponseSerializerKey] = manager.responseSerializer; + + //Performance Improvement from #2672 + NSData *data = nil; + if (self.mutableData) { + data = [self.mutableData copy]; + //We no longer need the reference, so nil it out to gain back some memory. + self.mutableData = nil; + } + + if (self.downloadFileURL) { + userInfo[AFNetworkingTaskDidCompleteAssetPathKey] = self.downloadFileURL; + } else if (data) { + userInfo[AFNetworkingTaskDidCompleteResponseDataKey] = data; + } + + if (error) { + userInfo[AFNetworkingTaskDidCompleteErrorKey] = error; + + dispatch_group_async(manager.completionGroup ?: url_session_manager_completion_group(), manager.completionQueue ?: dispatch_get_main_queue(), ^{ + if (self.completionHandler) { + self.completionHandler(task.response, responseObject, error); + } + + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidCompleteNotification object:task userInfo:userInfo]; + }); + }); + } else { + dispatch_async(url_session_manager_processing_queue(), ^{ + NSError *serializationError = nil; + responseObject = [manager.responseSerializer responseObjectForResponse:task.response data:data error:&serializationError]; + + if (self.downloadFileURL) { + responseObject = self.downloadFileURL; + } + + if (responseObject) { + userInfo[AFNetworkingTaskDidCompleteSerializedResponseKey] = responseObject; + } + + if (serializationError) { + userInfo[AFNetworkingTaskDidCompleteErrorKey] = serializationError; + } + + dispatch_group_async(manager.completionGroup ?: url_session_manager_completion_group(), manager.completionQueue ?: dispatch_get_main_queue(), ^{ + if (self.completionHandler) { + self.completionHandler(task.response, responseObject, serializationError); + } + + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidCompleteNotification object:task userInfo:userInfo]; + }); + }); + }); + } +#pragma clang diagnostic pop +} + +#pragma mark - NSURLSessionDataTaskDelegate + +- (void)URLSession:(__unused NSURLSession *)session + dataTask:(__unused NSURLSessionDataTask *)dataTask + didReceiveData:(NSData *)data +{ + [self.mutableData appendData:data]; +} + +#pragma mark - NSURLSessionDownloadTaskDelegate + +- (void)URLSession:(NSURLSession *)session + downloadTask:(NSURLSessionDownloadTask *)downloadTask +didFinishDownloadingToURL:(NSURL *)location +{ + NSError *fileManagerError = nil; + self.downloadFileURL = nil; + + if (self.downloadTaskDidFinishDownloading) { + self.downloadFileURL = self.downloadTaskDidFinishDownloading(session, downloadTask, location); + if (self.downloadFileURL) { + [[NSFileManager defaultManager] moveItemAtURL:location toURL:self.downloadFileURL error:&fileManagerError]; + + if (fileManagerError) { + [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidFailToMoveFileNotification object:downloadTask userInfo:fileManagerError.userInfo]; + } + } + } +} + +@end + +#pragma mark - + +/** + * A workaround for issues related to key-value observing the `state` of an `NSURLSessionTask`. + * + * See: + * - https://github.com/AFNetworking/AFNetworking/issues/1477 + * - https://github.com/AFNetworking/AFNetworking/issues/2638 + * - https://github.com/AFNetworking/AFNetworking/pull/2702 + */ + +static inline void af_swizzleSelector(Class theClass, SEL originalSelector, SEL swizzledSelector) { + Method originalMethod = class_getInstanceMethod(theClass, originalSelector); + Method swizzledMethod = class_getInstanceMethod(theClass, swizzledSelector); + method_exchangeImplementations(originalMethod, swizzledMethod); +} + +static inline BOOL af_addMethod(Class theClass, SEL selector, Method method) { + return class_addMethod(theClass, selector, method_getImplementation(method), method_getTypeEncoding(method)); +} + +static NSString * const AFNSURLSessionTaskDidResumeNotification = @"com.alamofire.networking.nsurlsessiontask.resume"; +static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofire.networking.nsurlsessiontask.suspend"; + +@interface _AFURLSessionTaskSwizzling : NSObject + +@end + +@implementation _AFURLSessionTaskSwizzling + ++ (void)load { + /** + WARNING: Trouble Ahead + https://github.com/AFNetworking/AFNetworking/pull/2702 + */ + + if (NSClassFromString(@"NSURLSessionTask")) { + /** + iOS 7 and iOS 8 differ in NSURLSessionTask implementation, which makes the next bit of code a bit tricky. + Many Unit Tests have been built to validate as much of this behavior has possible. + Here is what we know: + - NSURLSessionTasks are implemented with class clusters, meaning the class you request from the API isn't actually the type of class you will get back. + - Simply referencing `[NSURLSessionTask class]` will not work. You need to ask an `NSURLSession` to actually create an object, and grab the class from there. + - On iOS 7, `localDataTask` is a `__NSCFLocalDataTask`, which inherits from `__NSCFLocalSessionTask`, which inherits from `__NSCFURLSessionTask`. + - On iOS 8, `localDataTask` is a `__NSCFLocalDataTask`, which inherits from `__NSCFLocalSessionTask`, which inherits from `NSURLSessionTask`. + - On iOS 7, `__NSCFLocalSessionTask` and `__NSCFURLSessionTask` are the only two classes that have their own implementations of `resume` and `suspend`, and `__NSCFLocalSessionTask` DOES NOT CALL SUPER. This means both classes need to be swizzled. + - On iOS 8, `NSURLSessionTask` is the only class that implements `resume` and `suspend`. This means this is the only class that needs to be swizzled. + - Because `NSURLSessionTask` is not involved in the class hierarchy for every version of iOS, its easier to add the swizzled methods to a dummy class and manage them there. + + Some Assumptions: + - No implementations of `resume` or `suspend` call super. If this were to change in a future version of iOS, we'd need to handle it. + - No background task classes override `resume` or `suspend` + + The current solution: + 1) Grab an instance of `__NSCFLocalDataTask` by asking an instance of `NSURLSession` for a data task. + 2) Grab a pointer to the original implementation of `af_resume` + 3) Check to see if the current class has an implementation of resume. If so, continue to step 4. + 4) Grab the super class of the current class. + 5) Grab a pointer for the current class to the current implementation of `resume`. + 6) Grab a pointer for the super class to the current implementation of `resume`. + 7) If the current class implementation of `resume` is not equal to the super class implementation of `resume` AND the current implementation of `resume` is not equal to the original implementation of `af_resume`, THEN swizzle the methods + 8) Set the current class to the super class, and repeat steps 3-8 + */ + NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration ephemeralSessionConfiguration]; + NSURLSession * session = [NSURLSession sessionWithConfiguration:configuration]; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wnonnull" + NSURLSessionDataTask *localDataTask = [session dataTaskWithURL:nil]; +#pragma clang diagnostic pop + IMP originalAFResumeIMP = method_getImplementation(class_getInstanceMethod([self class], @selector(af_resume))); + Class currentClass = [localDataTask class]; + + while (class_getInstanceMethod(currentClass, @selector(resume))) { + Class superClass = [currentClass superclass]; + IMP classResumeIMP = method_getImplementation(class_getInstanceMethod(currentClass, @selector(resume))); + IMP superclassResumeIMP = method_getImplementation(class_getInstanceMethod(superClass, @selector(resume))); + if (classResumeIMP != superclassResumeIMP && + originalAFResumeIMP != classResumeIMP) { + [self swizzleResumeAndSuspendMethodForClass:currentClass]; + } + currentClass = [currentClass superclass]; + } + + [localDataTask cancel]; + [session finishTasksAndInvalidate]; + } +} + ++ (void)swizzleResumeAndSuspendMethodForClass:(Class)theClass { + Method afResumeMethod = class_getInstanceMethod(self, @selector(af_resume)); + Method afSuspendMethod = class_getInstanceMethod(self, @selector(af_suspend)); + + if (af_addMethod(theClass, @selector(af_resume), afResumeMethod)) { + af_swizzleSelector(theClass, @selector(resume), @selector(af_resume)); + } + + if (af_addMethod(theClass, @selector(af_suspend), afSuspendMethod)) { + af_swizzleSelector(theClass, @selector(suspend), @selector(af_suspend)); + } +} + +- (NSURLSessionTaskState)state { + NSAssert(NO, @"State method should never be called in the actual dummy class"); + return NSURLSessionTaskStateCanceling; +} + +- (void)af_resume { + NSAssert([self respondsToSelector:@selector(state)], @"Does not respond to state"); + NSURLSessionTaskState state = [self state]; + [self af_resume]; + + if (state != NSURLSessionTaskStateRunning) { + [[NSNotificationCenter defaultCenter] postNotificationName:AFNSURLSessionTaskDidResumeNotification object:self]; + } +} + +- (void)af_suspend { + NSAssert([self respondsToSelector:@selector(state)], @"Does not respond to state"); + NSURLSessionTaskState state = [self state]; + [self af_suspend]; + + if (state != NSURLSessionTaskStateSuspended) { + [[NSNotificationCenter defaultCenter] postNotificationName:AFNSURLSessionTaskDidSuspendNotification object:self]; + } +} +@end + +#pragma mark - + +@interface AFURLSessionManager () +@property (readwrite, nonatomic, strong) NSURLSessionConfiguration *sessionConfiguration; +@property (readwrite, nonatomic, strong) NSOperationQueue *operationQueue; +@property (readwrite, nonatomic, strong) NSURLSession *session; +@property (readwrite, nonatomic, strong) NSMutableDictionary *mutableTaskDelegatesKeyedByTaskIdentifier; +@property (readonly, nonatomic, copy) NSString *taskDescriptionForSessionTasks; +@property (readwrite, nonatomic, strong) NSLock *lock; +@property (readwrite, nonatomic, copy) AFURLSessionDidBecomeInvalidBlock sessionDidBecomeInvalid; +@property (readwrite, nonatomic, copy) AFURLSessionDidReceiveAuthenticationChallengeBlock sessionDidReceiveAuthenticationChallenge; +@property (readwrite, nonatomic, copy) AFURLSessionDidFinishEventsForBackgroundURLSessionBlock didFinishEventsForBackgroundURLSession; +@property (readwrite, nonatomic, copy) AFURLSessionTaskWillPerformHTTPRedirectionBlock taskWillPerformHTTPRedirection; +@property (readwrite, nonatomic, copy) AFURLSessionTaskDidReceiveAuthenticationChallengeBlock taskDidReceiveAuthenticationChallenge; +@property (readwrite, nonatomic, copy) AFURLSessionTaskNeedNewBodyStreamBlock taskNeedNewBodyStream; +@property (readwrite, nonatomic, copy) AFURLSessionTaskDidSendBodyDataBlock taskDidSendBodyData; +@property (readwrite, nonatomic, copy) AFURLSessionTaskDidCompleteBlock taskDidComplete; +@property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidReceiveResponseBlock dataTaskDidReceiveResponse; +@property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidBecomeDownloadTaskBlock dataTaskDidBecomeDownloadTask; +@property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidReceiveDataBlock dataTaskDidReceiveData; +@property (readwrite, nonatomic, copy) AFURLSessionDataTaskWillCacheResponseBlock dataTaskWillCacheResponse; +@property (readwrite, nonatomic, copy) AFURLSessionDownloadTaskDidFinishDownloadingBlock downloadTaskDidFinishDownloading; +@property (readwrite, nonatomic, copy) AFURLSessionDownloadTaskDidWriteDataBlock downloadTaskDidWriteData; +@property (readwrite, nonatomic, copy) AFURLSessionDownloadTaskDidResumeBlock downloadTaskDidResume; +@end + +@implementation AFURLSessionManager + +- (instancetype)init { + return [self initWithSessionConfiguration:nil]; +} + +- (instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)configuration { + self = [super init]; + if (!self) { + return nil; + } + + if (!configuration) { + configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; + } + + self.sessionConfiguration = configuration; + + self.operationQueue = [[NSOperationQueue alloc] init]; + self.operationQueue.maxConcurrentOperationCount = 1; + + self.session = [NSURLSession sessionWithConfiguration:self.sessionConfiguration delegate:self delegateQueue:self.operationQueue]; + + self.responseSerializer = [AFJSONResponseSerializer serializer]; + + self.securityPolicy = [AFSecurityPolicy defaultPolicy]; + +#if !TARGET_OS_WATCH + self.reachabilityManager = [AFNetworkReachabilityManager sharedManager]; +#endif + + self.mutableTaskDelegatesKeyedByTaskIdentifier = [[NSMutableDictionary alloc] init]; + + self.lock = [[NSLock alloc] init]; + self.lock.name = AFURLSessionManagerLockName; + + [self.session getTasksWithCompletionHandler:^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) { + for (NSURLSessionDataTask *task in dataTasks) { + [self addDelegateForDataTask:task uploadProgress:nil downloadProgress:nil completionHandler:nil]; + } + + for (NSURLSessionUploadTask *uploadTask in uploadTasks) { + [self addDelegateForUploadTask:uploadTask progress:nil completionHandler:nil]; + } + + for (NSURLSessionDownloadTask *downloadTask in downloadTasks) { + [self addDelegateForDownloadTask:downloadTask progress:nil destination:nil completionHandler:nil]; + } + }]; + + return self; +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +#pragma mark - + +- (NSString *)taskDescriptionForSessionTasks { + return [NSString stringWithFormat:@"%p", self]; +} + +- (void)taskDidResume:(NSNotification *)notification { + NSURLSessionTask *task = notification.object; + if ([task respondsToSelector:@selector(taskDescription)]) { + if ([task.taskDescription isEqualToString:self.taskDescriptionForSessionTasks]) { + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidResumeNotification object:task]; + }); + } + } +} + +- (void)taskDidSuspend:(NSNotification *)notification { + NSURLSessionTask *task = notification.object; + if ([task respondsToSelector:@selector(taskDescription)]) { + if ([task.taskDescription isEqualToString:self.taskDescriptionForSessionTasks]) { + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidSuspendNotification object:task]; + }); + } + } +} + +#pragma mark - + +- (AFURLSessionManagerTaskDelegate *)delegateForTask:(NSURLSessionTask *)task { + NSParameterAssert(task); + + AFURLSessionManagerTaskDelegate *delegate = nil; + [self.lock lock]; + delegate = self.mutableTaskDelegatesKeyedByTaskIdentifier[@(task.taskIdentifier)]; + [self.lock unlock]; + + return delegate; +} + +- (void)setDelegate:(AFURLSessionManagerTaskDelegate *)delegate + forTask:(NSURLSessionTask *)task +{ + NSParameterAssert(task); + NSParameterAssert(delegate); + + [self.lock lock]; + self.mutableTaskDelegatesKeyedByTaskIdentifier[@(task.taskIdentifier)] = delegate; + [delegate setupProgressForTask:task]; + [self addNotificationObserverForTask:task]; + [self.lock unlock]; +} + +- (void)addDelegateForDataTask:(NSURLSessionDataTask *)dataTask + uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgressBlock + downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgressBlock + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler +{ + AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] init]; + delegate.manager = self; + delegate.completionHandler = completionHandler; + + dataTask.taskDescription = self.taskDescriptionForSessionTasks; + [self setDelegate:delegate forTask:dataTask]; + + delegate.uploadProgressBlock = uploadProgressBlock; + delegate.downloadProgressBlock = downloadProgressBlock; +} + +- (void)addDelegateForUploadTask:(NSURLSessionUploadTask *)uploadTask + progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler +{ + AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] init]; + delegate.manager = self; + delegate.completionHandler = completionHandler; + + uploadTask.taskDescription = self.taskDescriptionForSessionTasks; + + [self setDelegate:delegate forTask:uploadTask]; + + delegate.uploadProgressBlock = uploadProgressBlock; +} + +- (void)addDelegateForDownloadTask:(NSURLSessionDownloadTask *)downloadTask + progress:(void (^)(NSProgress *downloadProgress)) downloadProgressBlock + destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination + completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler +{ + AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] init]; + delegate.manager = self; + delegate.completionHandler = completionHandler; + + if (destination) { + delegate.downloadTaskDidFinishDownloading = ^NSURL * (NSURLSession * __unused session, NSURLSessionDownloadTask *task, NSURL *location) { + return destination(location, task.response); + }; + } + + downloadTask.taskDescription = self.taskDescriptionForSessionTasks; + + [self setDelegate:delegate forTask:downloadTask]; + + delegate.downloadProgressBlock = downloadProgressBlock; +} + +- (void)removeDelegateForTask:(NSURLSessionTask *)task { + NSParameterAssert(task); + + AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:task]; + [self.lock lock]; + [delegate cleanUpProgressForTask:task]; + [self removeNotificationObserverForTask:task]; + [self.mutableTaskDelegatesKeyedByTaskIdentifier removeObjectForKey:@(task.taskIdentifier)]; + [self.lock unlock]; +} + +#pragma mark - + +- (NSArray *)tasksForKeyPath:(NSString *)keyPath { + __block NSArray *tasks = nil; + dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); + [self.session getTasksWithCompletionHandler:^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) { + if ([keyPath isEqualToString:NSStringFromSelector(@selector(dataTasks))]) { + tasks = dataTasks; + } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(uploadTasks))]) { + tasks = uploadTasks; + } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(downloadTasks))]) { + tasks = downloadTasks; + } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(tasks))]) { + tasks = [@[dataTasks, uploadTasks, downloadTasks] valueForKeyPath:@"@unionOfArrays.self"]; + } + + dispatch_semaphore_signal(semaphore); + }]; + + dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); + + return tasks; +} + +- (NSArray *)tasks { + return [self tasksForKeyPath:NSStringFromSelector(_cmd)]; +} + +- (NSArray *)dataTasks { + return [self tasksForKeyPath:NSStringFromSelector(_cmd)]; +} + +- (NSArray *)uploadTasks { + return [self tasksForKeyPath:NSStringFromSelector(_cmd)]; +} + +- (NSArray *)downloadTasks { + return [self tasksForKeyPath:NSStringFromSelector(_cmd)]; +} + +#pragma mark - + +- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks { + dispatch_async(dispatch_get_main_queue(), ^{ + if (cancelPendingTasks) { + [self.session invalidateAndCancel]; + } else { + [self.session finishTasksAndInvalidate]; + } + }); +} + +#pragma mark - + +- (void)setResponseSerializer:(id )responseSerializer { + NSParameterAssert(responseSerializer); + + _responseSerializer = responseSerializer; +} + +#pragma mark - +- (void)addNotificationObserverForTask:(NSURLSessionTask *)task { + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskDidResume:) name:AFNSURLSessionTaskDidResumeNotification object:task]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskDidSuspend:) name:AFNSURLSessionTaskDidSuspendNotification object:task]; +} + +- (void)removeNotificationObserverForTask:(NSURLSessionTask *)task { + [[NSNotificationCenter defaultCenter] removeObserver:self name:AFNSURLSessionTaskDidSuspendNotification object:task]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:AFNSURLSessionTaskDidResumeNotification object:task]; +} + +#pragma mark - + +- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler +{ + return [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:completionHandler]; +} + +- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request + uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgressBlock + downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgressBlock + completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler { + + __block NSURLSessionDataTask *dataTask = nil; + url_session_manager_create_task_safely(^{ + dataTask = [self.session dataTaskWithRequest:request]; + }); + + [self addDelegateForDataTask:dataTask uploadProgress:uploadProgressBlock downloadProgress:downloadProgressBlock completionHandler:completionHandler]; + + return dataTask; +} + +#pragma mark - + +- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request + fromFile:(NSURL *)fileURL + progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler +{ + __block NSURLSessionUploadTask *uploadTask = nil; + url_session_manager_create_task_safely(^{ + uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL]; + }); + + if (!uploadTask && self.attemptsToRecreateUploadTasksForBackgroundSessions && self.session.configuration.identifier) { + for (NSUInteger attempts = 0; !uploadTask && attempts < AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask; attempts++) { + uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL]; + } + } + + [self addDelegateForUploadTask:uploadTask progress:uploadProgressBlock completionHandler:completionHandler]; + + return uploadTask; +} + +- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request + fromData:(NSData *)bodyData + progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler +{ + __block NSURLSessionUploadTask *uploadTask = nil; + url_session_manager_create_task_safely(^{ + uploadTask = [self.session uploadTaskWithRequest:request fromData:bodyData]; + }); + + [self addDelegateForUploadTask:uploadTask progress:uploadProgressBlock completionHandler:completionHandler]; + + return uploadTask; +} + +- (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request + progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler +{ + __block NSURLSessionUploadTask *uploadTask = nil; + url_session_manager_create_task_safely(^{ + uploadTask = [self.session uploadTaskWithStreamedRequest:request]; + }); + + [self addDelegateForUploadTask:uploadTask progress:uploadProgressBlock completionHandler:completionHandler]; + + return uploadTask; +} + +#pragma mark - + +- (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request + progress:(void (^)(NSProgress *downloadProgress)) downloadProgressBlock + destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination + completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler +{ + __block NSURLSessionDownloadTask *downloadTask = nil; + url_session_manager_create_task_safely(^{ + downloadTask = [self.session downloadTaskWithRequest:request]; + }); + + [self addDelegateForDownloadTask:downloadTask progress:downloadProgressBlock destination:destination completionHandler:completionHandler]; + + return downloadTask; +} + +- (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData + progress:(void (^)(NSProgress *downloadProgress)) downloadProgressBlock + destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination + completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler +{ + __block NSURLSessionDownloadTask *downloadTask = nil; + url_session_manager_create_task_safely(^{ + downloadTask = [self.session downloadTaskWithResumeData:resumeData]; + }); + + [self addDelegateForDownloadTask:downloadTask progress:downloadProgressBlock destination:destination completionHandler:completionHandler]; + + return downloadTask; +} + +#pragma mark - +- (NSProgress *)uploadProgressForTask:(NSURLSessionTask *)task { + return [[self delegateForTask:task] uploadProgress]; +} + +- (NSProgress *)downloadProgressForTask:(NSURLSessionTask *)task { + return [[self delegateForTask:task] downloadProgress]; +} + +#pragma mark - + +- (void)setSessionDidBecomeInvalidBlock:(void (^)(NSURLSession *session, NSError *error))block { + self.sessionDidBecomeInvalid = block; +} + +- (void)setSessionDidReceiveAuthenticationChallengeBlock:(NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential))block { + self.sessionDidReceiveAuthenticationChallenge = block; +} + +- (void)setDidFinishEventsForBackgroundURLSessionBlock:(void (^)(NSURLSession *session))block { + self.didFinishEventsForBackgroundURLSession = block; +} + +#pragma mark - + +- (void)setTaskNeedNewBodyStreamBlock:(NSInputStream * (^)(NSURLSession *session, NSURLSessionTask *task))block { + self.taskNeedNewBodyStream = block; +} + +- (void)setTaskWillPerformHTTPRedirectionBlock:(NSURLRequest * (^)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request))block { + self.taskWillPerformHTTPRedirection = block; +} + +- (void)setTaskDidReceiveAuthenticationChallengeBlock:(NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential))block { + self.taskDidReceiveAuthenticationChallenge = block; +} + +- (void)setTaskDidSendBodyDataBlock:(void (^)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend))block { + self.taskDidSendBodyData = block; +} + +- (void)setTaskDidCompleteBlock:(void (^)(NSURLSession *session, NSURLSessionTask *task, NSError *error))block { + self.taskDidComplete = block; +} + +#pragma mark - + +- (void)setDataTaskDidReceiveResponseBlock:(NSURLSessionResponseDisposition (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response))block { + self.dataTaskDidReceiveResponse = block; +} + +- (void)setDataTaskDidBecomeDownloadTaskBlock:(void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLSessionDownloadTask *downloadTask))block { + self.dataTaskDidBecomeDownloadTask = block; +} + +- (void)setDataTaskDidReceiveDataBlock:(void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSData *data))block { + self.dataTaskDidReceiveData = block; +} + +- (void)setDataTaskWillCacheResponseBlock:(NSCachedURLResponse * (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSCachedURLResponse *proposedResponse))block { + self.dataTaskWillCacheResponse = block; +} + +#pragma mark - + +- (void)setDownloadTaskDidFinishDownloadingBlock:(NSURL * (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location))block { + self.downloadTaskDidFinishDownloading = block; +} + +- (void)setDownloadTaskDidWriteDataBlock:(void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite))block { + self.downloadTaskDidWriteData = block; +} + +- (void)setDownloadTaskDidResumeBlock:(void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t fileOffset, int64_t expectedTotalBytes))block { + self.downloadTaskDidResume = block; +} + +#pragma mark - NSObject + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@: %p, session: %@, operationQueue: %@>", NSStringFromClass([self class]), self, self.session, self.operationQueue]; +} + +- (BOOL)respondsToSelector:(SEL)selector { + if (selector == @selector(URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:)) { + return self.taskWillPerformHTTPRedirection != nil; + } else if (selector == @selector(URLSession:dataTask:didReceiveResponse:completionHandler:)) { + return self.dataTaskDidReceiveResponse != nil; + } else if (selector == @selector(URLSession:dataTask:willCacheResponse:completionHandler:)) { + return self.dataTaskWillCacheResponse != nil; + } else if (selector == @selector(URLSessionDidFinishEventsForBackgroundURLSession:)) { + return self.didFinishEventsForBackgroundURLSession != nil; + } + + return [[self class] instancesRespondToSelector:selector]; +} + +#pragma mark - NSURLSessionDelegate + +- (void)URLSession:(NSURLSession *)session +didBecomeInvalidWithError:(NSError *)error +{ + if (self.sessionDidBecomeInvalid) { + self.sessionDidBecomeInvalid(session, error); + } + + [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDidInvalidateNotification object:session]; +} + +- (void)URLSession:(NSURLSession *)session +didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge + completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler +{ + NSURLSessionAuthChallengeDisposition disposition = NSURLSessionAuthChallengePerformDefaultHandling; + __block NSURLCredential *credential = nil; + + if (self.sessionDidReceiveAuthenticationChallenge) { + disposition = self.sessionDidReceiveAuthenticationChallenge(session, challenge, &credential); + } else { + if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { + if ([self.securityPolicy evaluateServerTrust:challenge.protectionSpace.serverTrust forDomain:challenge.protectionSpace.host]) { + credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]; + if (credential) { + disposition = NSURLSessionAuthChallengeUseCredential; + } else { + disposition = NSURLSessionAuthChallengePerformDefaultHandling; + } + } else { + disposition = NSURLSessionAuthChallengeRejectProtectionSpace; + } + } else { + disposition = NSURLSessionAuthChallengePerformDefaultHandling; + } + } + + if (completionHandler) { + completionHandler(disposition, credential); + } +} + +#pragma mark - NSURLSessionTaskDelegate + +- (void)URLSession:(NSURLSession *)session + task:(NSURLSessionTask *)task +willPerformHTTPRedirection:(NSHTTPURLResponse *)response + newRequest:(NSURLRequest *)request + completionHandler:(void (^)(NSURLRequest *))completionHandler +{ + NSURLRequest *redirectRequest = request; + + if (self.taskWillPerformHTTPRedirection) { + redirectRequest = self.taskWillPerformHTTPRedirection(session, task, response, request); + } + + if (completionHandler) { + completionHandler(redirectRequest); + } +} + +- (void)URLSession:(NSURLSession *)session + task:(NSURLSessionTask *)task +didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge + completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler +{ + NSURLSessionAuthChallengeDisposition disposition = NSURLSessionAuthChallengePerformDefaultHandling; + __block NSURLCredential *credential = nil; + + if (self.taskDidReceiveAuthenticationChallenge) { + disposition = self.taskDidReceiveAuthenticationChallenge(session, task, challenge, &credential); + } else { + if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { + if ([self.securityPolicy evaluateServerTrust:challenge.protectionSpace.serverTrust forDomain:challenge.protectionSpace.host]) { + disposition = NSURLSessionAuthChallengeUseCredential; + credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]; + } else { + disposition = NSURLSessionAuthChallengeRejectProtectionSpace; + } + } else { + disposition = NSURLSessionAuthChallengePerformDefaultHandling; + } + } + + if (completionHandler) { + completionHandler(disposition, credential); + } +} + +- (void)URLSession:(NSURLSession *)session + task:(NSURLSessionTask *)task + needNewBodyStream:(void (^)(NSInputStream *bodyStream))completionHandler +{ + NSInputStream *inputStream = nil; + + if (self.taskNeedNewBodyStream) { + inputStream = self.taskNeedNewBodyStream(session, task); + } else if (task.originalRequest.HTTPBodyStream && [task.originalRequest.HTTPBodyStream conformsToProtocol:@protocol(NSCopying)]) { + inputStream = [task.originalRequest.HTTPBodyStream copy]; + } + + if (completionHandler) { + completionHandler(inputStream); + } +} + +- (void)URLSession:(NSURLSession *)session + task:(NSURLSessionTask *)task + didSendBodyData:(int64_t)bytesSent + totalBytesSent:(int64_t)totalBytesSent +totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend +{ + + int64_t totalUnitCount = totalBytesExpectedToSend; + if(totalUnitCount == NSURLSessionTransferSizeUnknown) { + NSString *contentLength = [task.originalRequest valueForHTTPHeaderField:@"Content-Length"]; + if(contentLength) { + totalUnitCount = (int64_t) [contentLength longLongValue]; + } + } + + if (self.taskDidSendBodyData) { + self.taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalUnitCount); + } +} + +- (void)URLSession:(NSURLSession *)session + task:(NSURLSessionTask *)task +didCompleteWithError:(NSError *)error +{ + AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:task]; + + // delegate may be nil when completing a task in the background + if (delegate) { + [delegate URLSession:session task:task didCompleteWithError:error]; + + [self removeDelegateForTask:task]; + } + + if (self.taskDidComplete) { + self.taskDidComplete(session, task, error); + } +} + +#pragma mark - NSURLSessionDataDelegate + +- (void)URLSession:(NSURLSession *)session + dataTask:(NSURLSessionDataTask *)dataTask +didReceiveResponse:(NSURLResponse *)response + completionHandler:(void (^)(NSURLSessionResponseDisposition disposition))completionHandler +{ + NSURLSessionResponseDisposition disposition = NSURLSessionResponseAllow; + + if (self.dataTaskDidReceiveResponse) { + disposition = self.dataTaskDidReceiveResponse(session, dataTask, response); + } + + if (completionHandler) { + completionHandler(disposition); + } +} + +- (void)URLSession:(NSURLSession *)session + dataTask:(NSURLSessionDataTask *)dataTask +didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask +{ + AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:dataTask]; + if (delegate) { + [self removeDelegateForTask:dataTask]; + [self setDelegate:delegate forTask:downloadTask]; + } + + if (self.dataTaskDidBecomeDownloadTask) { + self.dataTaskDidBecomeDownloadTask(session, dataTask, downloadTask); + } +} + +- (void)URLSession:(NSURLSession *)session + dataTask:(NSURLSessionDataTask *)dataTask + didReceiveData:(NSData *)data +{ + + AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:dataTask]; + [delegate URLSession:session dataTask:dataTask didReceiveData:data]; + + if (self.dataTaskDidReceiveData) { + self.dataTaskDidReceiveData(session, dataTask, data); + } +} + +- (void)URLSession:(NSURLSession *)session + dataTask:(NSURLSessionDataTask *)dataTask + willCacheResponse:(NSCachedURLResponse *)proposedResponse + completionHandler:(void (^)(NSCachedURLResponse *cachedResponse))completionHandler +{ + NSCachedURLResponse *cachedResponse = proposedResponse; + + if (self.dataTaskWillCacheResponse) { + cachedResponse = self.dataTaskWillCacheResponse(session, dataTask, proposedResponse); + } + + if (completionHandler) { + completionHandler(cachedResponse); + } +} + +- (void)URLSessionDidFinishEventsForBackgroundURLSession:(NSURLSession *)session { + if (self.didFinishEventsForBackgroundURLSession) { + dispatch_async(dispatch_get_main_queue(), ^{ + self.didFinishEventsForBackgroundURLSession(session); + }); + } +} + +#pragma mark - NSURLSessionDownloadDelegate + +- (void)URLSession:(NSURLSession *)session + downloadTask:(NSURLSessionDownloadTask *)downloadTask +didFinishDownloadingToURL:(NSURL *)location +{ + AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:downloadTask]; + if (self.downloadTaskDidFinishDownloading) { + NSURL *fileURL = self.downloadTaskDidFinishDownloading(session, downloadTask, location); + if (fileURL) { + delegate.downloadFileURL = fileURL; + NSError *error = nil; + [[NSFileManager defaultManager] moveItemAtURL:location toURL:fileURL error:&error]; + if (error) { + [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidFailToMoveFileNotification object:downloadTask userInfo:error.userInfo]; + } + + return; + } + } + + if (delegate) { + [delegate URLSession:session downloadTask:downloadTask didFinishDownloadingToURL:location]; + } +} + +- (void)URLSession:(NSURLSession *)session + downloadTask:(NSURLSessionDownloadTask *)downloadTask + didWriteData:(int64_t)bytesWritten + totalBytesWritten:(int64_t)totalBytesWritten +totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite +{ + if (self.downloadTaskDidWriteData) { + self.downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite); + } +} + +- (void)URLSession:(NSURLSession *)session + downloadTask:(NSURLSessionDownloadTask *)downloadTask + didResumeAtOffset:(int64_t)fileOffset +expectedTotalBytes:(int64_t)expectedTotalBytes +{ + if (self.downloadTaskDidResume) { + self.downloadTaskDidResume(session, downloadTask, fileOffset, expectedTotalBytes); + } +} + +#pragma mark - NSSecureCoding + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (instancetype)initWithCoder:(NSCoder *)decoder { + NSURLSessionConfiguration *configuration = [decoder decodeObjectOfClass:[NSURLSessionConfiguration class] forKey:@"sessionConfiguration"]; + + self = [self initWithSessionConfiguration:configuration]; + if (!self) { + return nil; + } + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [coder encodeObject:self.session.configuration forKey:@"sessionConfiguration"]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[[self class] allocWithZone:zone] initWithSessionConfiguration:self.session.configuration]; +} + +@end diff --git a/grocery-objc/Pods/AFNetworking/LICENSE b/grocery-objc/Pods/AFNetworking/LICENSE new file mode 100644 index 0000000..91f125b --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) + +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. diff --git a/grocery-objc/Pods/AFNetworking/README.md b/grocery-objc/Pods/AFNetworking/README.md new file mode 100644 index 0000000..f784681 --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/README.md @@ -0,0 +1,320 @@ +

+ AFNetworking +

+ +[![Build Status](https://travis-ci.org/AFNetworking/AFNetworking.svg)](https://travis-ci.org/AFNetworking/AFNetworking) +[![codecov.io](https://codecov.io/github/AFNetworking/AFNetworking/coverage.svg?branch=master)](https://codecov.io/github/AFNetworking/AFNetworking?branch=master) +[![Cocoapods Compatible](https://img.shields.io/cocoapods/v/AFNetworking.svg)](https://img.shields.io/cocoapods/v/AFNetworking.svg) +[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) +[![Platform](https://img.shields.io/cocoapods/p/AFNetworking.svg?style=flat)](http://cocoadocs.org/docsets/AFNetworking) +[![Twitter](https://img.shields.io/badge/twitter-@AFNetworking-blue.svg?style=flat)](http://twitter.com/AFNetworking) + +AFNetworking is a delightful networking library for iOS and Mac OS X. It's built on top of the [Foundation URL Loading System](http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html), extending the powerful high-level networking abstractions built into Cocoa. It has a modular architecture with well-designed, feature-rich APIs that are a joy to use. + +Perhaps the most important feature of all, however, is the amazing community of developers who use and contribute to AFNetworking every day. AFNetworking powers some of the most popular and critically-acclaimed apps on the iPhone, iPad, and Mac. + +Choose AFNetworking for your next project, or migrate over your existing projects—you'll be happy you did! + +## How To Get Started + +- [Download AFNetworking](https://github.com/AFNetworking/AFNetworking/archive/master.zip) and try out the included Mac and iPhone example apps +- Read the ["Getting Started" guide](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking), [FAQ](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-FAQ), or [other articles on the Wiki](https://github.com/AFNetworking/AFNetworking/wiki) +- Check out the [documentation](http://cocoadocs.org/docsets/AFNetworking/) for a comprehensive look at all of the APIs available in AFNetworking +- Read the [AFNetworking 3.0 Migration Guide](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-3.0-Migration-Guide) for an overview of the architectural changes from 2.0. + +## Communication + +- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/afnetworking). (Tag 'afnetworking') +- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/afnetworking). +- If you **found a bug**, _and can provide steps to reliably reproduce it_, open an issue. +- If you **have a feature request**, open an issue. +- If you **want to contribute**, submit a pull request. + +## Installation +AFNetworking supports multiple methods for installing the library in a project. + +## Installation with CocoaPods + +[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like AFNetworking in your projects. See the ["Getting Started" guide for more information](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking). You can install it with the following command: + +```bash +$ gem install cocoapods +``` + +> CocoaPods 0.39.0+ is required to build AFNetworking 3.0.0+. + +#### Podfile + +To integrate AFNetworking into your Xcode project using CocoaPods, specify it in your `Podfile`: + +```ruby +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '8.0' + +pod 'AFNetworking', '~> 3.0' +``` + +Then, run the following command: + +```bash +$ pod install +``` + +### Installation with Carthage + +[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. + +You can install Carthage with [Homebrew](http://brew.sh/) using the following command: + +```bash +$ brew update +$ brew install carthage +``` + +To integrate AFNetworking into your Xcode project using Carthage, specify it in your `Cartfile`: + +```ogdl +github "AFNetworking/AFNetworking" ~> 3.0 +``` + +Run `carthage` to build the framework and drag the built `AFNetworking.framework` into your Xcode project. + +## Requirements + +| AFNetworking Version | Minimum iOS Target | Minimum OS X Target | Minimum watchOS Target | Minimum tvOS Target | Notes | +|:--------------------:|:---------------------------:|:----------------------------:|:----------------------------:|:----------------------------:|:-------------------------------------------------------------------------:| +| 3.x | iOS 7 | OS X 10.9 | watchOS 2.0 | tvOS 9.0 | Xcode 7+ is required. `NSURLConnectionOperation` support has been removed. | +| 2.6 -> 2.6.3 | iOS 7 | OS X 10.9 | watchOS 2.0 | n/a | Xcode 7+ is required. | +| 2.0 -> 2.5.4 | iOS 6 | OS X 10.8 | n/a | n/a | Xcode 5+ is required. `NSURLSession` subspec requires iOS 7 or OS X 10.9. | +| 1.x | iOS 5 | Mac OS X 10.7 | n/a | n/a | +| 0.10.x | iOS 4 | Mac OS X 10.6 | n/a | n/a | + +(OS X projects must support [64-bit with modern Cocoa runtime](https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtVersionsPlatforms.html)). + +> Programming in Swift? Try [Alamofire](https://github.com/Alamofire/Alamofire) for a more conventional set of APIs. + +## Architecture + +### NSURLSession + +- `AFURLSessionManager` +- `AFHTTPSessionManager` + +### Serialization + +* `` + - `AFHTTPRequestSerializer` + - `AFJSONRequestSerializer` + - `AFPropertyListRequestSerializer` +* `` + - `AFHTTPResponseSerializer` + - `AFJSONResponseSerializer` + - `AFXMLParserResponseSerializer` + - `AFXMLDocumentResponseSerializer` _(Mac OS X)_ + - `AFPropertyListResponseSerializer` + - `AFImageResponseSerializer` + - `AFCompoundResponseSerializer` + +### Additional Functionality + +- `AFSecurityPolicy` +- `AFNetworkReachabilityManager` + +## Usage + +### AFURLSessionManager + +`AFURLSessionManager` creates and manages an `NSURLSession` object based on a specified `NSURLSessionConfiguration` object, which conforms to ``, ``, ``, and ``. + +#### Creating a Download Task + +```objective-c +NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; +AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration]; + +NSURL *URL = [NSURL URLWithString:@"http://example.com/download.zip"]; +NSURLRequest *request = [NSURLRequest requestWithURL:URL]; + +NSURLSessionDownloadTask *downloadTask = [manager downloadTaskWithRequest:request progress:nil destination:^NSURL *(NSURL *targetPath, NSURLResponse *response) { + NSURL *documentsDirectoryURL = [[NSFileManager defaultManager] URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil]; + return [documentsDirectoryURL URLByAppendingPathComponent:[response suggestedFilename]]; +} completionHandler:^(NSURLResponse *response, NSURL *filePath, NSError *error) { + NSLog(@"File downloaded to: %@", filePath); +}]; +[downloadTask resume]; +``` + +#### Creating an Upload Task + +```objective-c +NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; +AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration]; + +NSURL *URL = [NSURL URLWithString:@"http://example.com/upload"]; +NSURLRequest *request = [NSURLRequest requestWithURL:URL]; + +NSURL *filePath = [NSURL fileURLWithPath:@"file://path/to/image.png"]; +NSURLSessionUploadTask *uploadTask = [manager uploadTaskWithRequest:request fromFile:filePath progress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { + if (error) { + NSLog(@"Error: %@", error); + } else { + NSLog(@"Success: %@ %@", response, responseObject); + } +}]; +[uploadTask resume]; +``` + +#### Creating an Upload Task for a Multi-Part Request, with Progress + +```objective-c +NSMutableURLRequest *request = [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:@"POST" URLString:@"http://example.com/upload" parameters:nil constructingBodyWithBlock:^(id formData) { + [formData appendPartWithFileURL:[NSURL fileURLWithPath:@"file://path/to/image.jpg"] name:@"file" fileName:@"filename.jpg" mimeType:@"image/jpeg" error:nil]; + } error:nil]; + +AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]]; + +NSURLSessionUploadTask *uploadTask; +uploadTask = [manager + uploadTaskWithStreamedRequest:request + progress:^(NSProgress * _Nonnull uploadProgress) { + // This is not called back on the main queue. + // You are responsible for dispatching to the main queue for UI updates + dispatch_async(dispatch_get_main_queue(), ^{ + //Update the progress view + [progressView setProgress:uploadProgress.fractionCompleted]; + }); + } + completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { + if (error) { + NSLog(@"Error: %@", error); + } else { + NSLog(@"%@ %@", response, responseObject); + } + }]; + +[uploadTask resume]; +``` + +#### Creating a Data Task + +```objective-c +NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; +AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration]; + +NSURL *URL = [NSURL URLWithString:@"http://example.com/upload"]; +NSURLRequest *request = [NSURLRequest requestWithURL:URL]; + +NSURLSessionDataTask *dataTask = [manager dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { + if (error) { + NSLog(@"Error: %@", error); + } else { + NSLog(@"%@ %@", response, responseObject); + } +}]; +[dataTask resume]; +``` + +--- + +### Request Serialization + +Request serializers create requests from URL strings, encoding parameters as either a query string or HTTP body. + +```objective-c +NSString *URLString = @"http://example.com"; +NSDictionary *parameters = @{@"foo": @"bar", @"baz": @[@1, @2, @3]}; +``` + +#### Query String Parameter Encoding + +```objective-c +[[AFHTTPRequestSerializer serializer] requestWithMethod:@"GET" URLString:URLString parameters:parameters error:nil]; +``` + + GET http://example.com?foo=bar&baz[]=1&baz[]=2&baz[]=3 + +#### URL Form Parameter Encoding + +```objective-c +[[AFHTTPRequestSerializer serializer] requestWithMethod:@"POST" URLString:URLString parameters:parameters]; +``` + + POST http://example.com/ + Content-Type: application/x-www-form-urlencoded + + foo=bar&baz[]=1&baz[]=2&baz[]=3 + +#### JSON Parameter Encoding + +```objective-c +[[AFJSONRequestSerializer serializer] requestWithMethod:@"POST" URLString:URLString parameters:parameters]; +``` + + POST http://example.com/ + Content-Type: application/json + + {"foo": "bar", "baz": [1,2,3]} + +--- + +### Network Reachability Manager + +`AFNetworkReachabilityManager` monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces. + +* Do not use Reachability to determine if the original request should be sent. + * You should try to send it. +* You can use Reachability to determine when a request should be automatically retried. + * Although it may still fail, a Reachability notification that the connectivity is available is a good time to retry something. +* Network reachability is a useful tool for determining why a request might have failed. + * After a network request has failed, telling the user they're offline is better than giving them a more technical but accurate error, such as "request timed out." + +See also [WWDC 2012 session 706, "Networking Best Practices."](https://developer.apple.com/videos/play/wwdc2012-706/). + +#### Shared Network Reachability + +```objective-c +[[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) { + NSLog(@"Reachability: %@", AFStringFromNetworkReachabilityStatus(status)); +}]; + +[[AFNetworkReachabilityManager sharedManager] startMonitoring]; +``` + +--- + +### Security Policy + +`AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections. + +Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled. + +#### Allowing Invalid SSL Certificates + +```objective-c +AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; +manager.securityPolicy.allowInvalidCertificates = YES; // not recommended for production +``` + +--- + +## Unit Tests + +AFNetworking includes a suite of unit tests within the Tests subdirectory. These tests can be run simply be executed the test action on the platform framework you would like to test. + +## Credits + +AFNetworking is owned and maintained by the [Alamofire Software Foundation](http://alamofire.org). + +AFNetworking was originally created by [Scott Raymond](https://github.com/sco/) and [Mattt Thompson](https://github.com/mattt/) in the development of [Gowalla for iPhone](http://en.wikipedia.org/wiki/Gowalla). + +AFNetworking's logo was designed by [Alan Defibaugh](http://www.alandefibaugh.com/). + +And most of all, thanks to AFNetworking's [growing list of contributors](https://github.com/AFNetworking/AFNetworking/contributors). + +### Security Disclosure + +If you believe you have identified a security vulnerability with AFNetworking, you should report it as soon as possible via email to security@alamofire.org. Please do not post it to a public issue tracker. + +## License + +AFNetworking is released under the MIT license. See LICENSE for details. diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h new file mode 100644 index 0000000..e89b951 --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h @@ -0,0 +1,149 @@ +// AFAutoPurgingImageCache.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import +#import + +#if TARGET_OS_IOS || TARGET_OS_TV +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + The `AFImageCache` protocol defines a set of APIs for adding, removing and fetching images from a cache synchronously. + */ +@protocol AFImageCache + +/** + Adds the image to the cache with the given identifier. + + @param image The image to cache. + @param identifier The unique identifier for the image in the cache. + */ +- (void)addImage:(UIImage *)image withIdentifier:(NSString *)identifier; + +/** + Removes the image from the cache matching the given identifier. + + @param identifier The unique identifier for the image in the cache. + + @return A BOOL indicating whether or not the image was removed from the cache. + */ +- (BOOL)removeImageWithIdentifier:(NSString *)identifier; + +/** + Removes all images from the cache. + + @return A BOOL indicating whether or not all images were removed from the cache. + */ +- (BOOL)removeAllImages; + +/** + Returns the image in the cache associated with the given identifier. + + @param identifier The unique identifier for the image in the cache. + + @return An image for the matching identifier, or nil. + */ +- (nullable UIImage *)imageWithIdentifier:(NSString *)identifier; +@end + + +/** + The `ImageRequestCache` protocol extends the `ImageCache` protocol by adding methods for adding, removing and fetching images from a cache given an `NSURLRequest` and additional identifier. + */ +@protocol AFImageRequestCache + +/** + Adds the image to the cache using an identifier created from the request and additional identifier. + + @param image The image to cache. + @param request The unique URL request identifing the image asset. + @param identifier The additional identifier to apply to the URL request to identify the image. + */ +- (void)addImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; + +/** + Removes the image from the cache using an identifier created from the request and additional identifier. + + @param request The unique URL request identifing the image asset. + @param identifier The additional identifier to apply to the URL request to identify the image. + + @return A BOOL indicating whether or not all images were removed from the cache. + */ +- (BOOL)removeImageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; + +/** + Returns the image from the cache associated with an identifier created from the request and additional identifier. + + @param request The unique URL request identifing the image asset. + @param identifier The additional identifier to apply to the URL request to identify the image. + + @return An image for the matching request and identifier, or nil. + */ +- (nullable UIImage *)imageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; + +@end + +/** + The `AutoPurgingImageCache` in an in-memory image cache used to store images up to a given memory capacity. When the memory capacity is reached, the image cache is sorted by last access date, then the oldest image is continuously purged until the preferred memory usage after purge is met. Each time an image is accessed through the cache, the internal access date of the image is updated. + */ +@interface AFAutoPurgingImageCache : NSObject + +/** + The total memory capacity of the cache in bytes. + */ +@property (nonatomic, assign) UInt64 memoryCapacity; + +/** + The preferred memory usage after purge in bytes. During a purge, images will be purged until the memory capacity drops below this limit. + */ +@property (nonatomic, assign) UInt64 preferredMemoryUsageAfterPurge; + +/** + The current total memory usage in bytes of all images stored within the cache. + */ +@property (nonatomic, assign, readonly) UInt64 memoryUsage; + +/** + Initialies the `AutoPurgingImageCache` instance with default values for memory capacity and preferred memory usage after purge limit. `memoryCapcity` defaults to `100 MB`. `preferredMemoryUsageAfterPurge` defaults to `60 MB`. + + @return The new `AutoPurgingImageCache` instance. + */ +- (instancetype)init; + +/** + Initialies the `AutoPurgingImageCache` instance with the given memory capacity and preferred memory usage + after purge limit. + + @param memoryCapacity The total memory capacity of the cache in bytes. + @param preferredMemoryUsageAfterPurge The preferred memory usage after purge in bytes. + + @return The new `AutoPurgingImageCache` instance. + */ +- (instancetype)initWithMemoryCapacity:(UInt64)memoryCapacity preferredMemoryCapacity:(UInt64)preferredMemoryCapacity; + +@end + +NS_ASSUME_NONNULL_END + +#endif + diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.m b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.m new file mode 100644 index 0000000..326fe4f --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.m @@ -0,0 +1,201 @@ +// AFAutoPurgingImageCache.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import "AFAutoPurgingImageCache.h" + +@interface AFCachedImage : NSObject + +@property (nonatomic, strong) UIImage *image; +@property (nonatomic, strong) NSString *identifier; +@property (nonatomic, assign) UInt64 totalBytes; +@property (nonatomic, strong) NSDate *lastAccessDate; +@property (nonatomic, assign) UInt64 currentMemoryUsage; + +@end + +@implementation AFCachedImage + +-(instancetype)initWithImage:(UIImage *)image identifier:(NSString *)identifier { + if (self = [self init]) { + self.image = image; + self.identifier = identifier; + + CGSize imageSize = CGSizeMake(image.size.width * image.scale, image.size.height * image.scale); + CGFloat bytesPerPixel = 4.0; + CGFloat bytesPerRow = imageSize.width * bytesPerPixel; + self.totalBytes = (UInt64)bytesPerPixel * (UInt64)bytesPerRow; + self.lastAccessDate = [NSDate date]; + } + return self; +} + +- (UIImage*)accessImage { + self.lastAccessDate = [NSDate date]; + return self.image; +} + +- (NSString *)description { + NSString *descriptionString = [NSString stringWithFormat:@"Idenfitier: %@ lastAccessDate: %@ ", self.identifier, self.lastAccessDate]; + return descriptionString; + +} + +@end + +@interface AFAutoPurgingImageCache () +@property (nonatomic, strong) NSMutableDictionary *cachedImages; +@property (nonatomic, assign) UInt64 currentMemoryUsage; +@property (nonatomic, strong) dispatch_queue_t synchronizationQueue; +@end + +@implementation AFAutoPurgingImageCache + +- (instancetype)init { + return [self initWithMemoryCapacity:100 * 1024 * 1024 preferredMemoryCapacity:60 * 1024 * 1024]; +} + +- (instancetype)initWithMemoryCapacity:(UInt64)memoryCapacity preferredMemoryCapacity:(UInt64)preferredMemoryCapacity { + if (self = [super init]) { + self.memoryCapacity = memoryCapacity; + self.preferredMemoryUsageAfterPurge = preferredMemoryCapacity; + self.cachedImages = [[NSMutableDictionary alloc] init]; + + NSString *queueName = [NSString stringWithFormat:@"com.alamofire.autopurgingimagecache-%@", [[NSUUID UUID] UUIDString]]; + self.synchronizationQueue = dispatch_queue_create([queueName cStringUsingEncoding:NSASCIIStringEncoding], DISPATCH_QUEUE_CONCURRENT); + + [[NSNotificationCenter defaultCenter] + addObserver:self + selector:@selector(removeAllImages) + name:UIApplicationDidReceiveMemoryWarningNotification + object:nil]; + + } + return self; +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +- (UInt64)memoryUsage { + __block UInt64 result = 0; + dispatch_sync(self.synchronizationQueue, ^{ + result = self.currentMemoryUsage; + }); + return result; +} + +- (void)addImage:(UIImage *)image withIdentifier:(NSString *)identifier { + dispatch_barrier_async(self.synchronizationQueue, ^{ + AFCachedImage *cacheImage = [[AFCachedImage alloc] initWithImage:image identifier:identifier]; + + AFCachedImage *previousCachedImage = self.cachedImages[identifier]; + if (previousCachedImage != nil) { + self.currentMemoryUsage -= previousCachedImage.totalBytes; + } + + self.cachedImages[identifier] = cacheImage; + self.currentMemoryUsage += cacheImage.totalBytes; + }); + + dispatch_barrier_async(self.synchronizationQueue, ^{ + if (self.currentMemoryUsage > self.memoryCapacity) { + UInt64 bytesToPurge = self.currentMemoryUsage - self.preferredMemoryUsageAfterPurge; + NSMutableArray *sortedImages = [NSMutableArray arrayWithArray:self.cachedImages.allValues]; + NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"lastAccessDate" + ascending:YES]; + [sortedImages sortUsingDescriptors:@[sortDescriptor]]; + + UInt64 bytesPurged = 0; + + for (AFCachedImage *cachedImage in sortedImages) { + [self.cachedImages removeObjectForKey:cachedImage.identifier]; + bytesPurged += cachedImage.totalBytes; + if (bytesPurged >= bytesToPurge) { + break ; + } + } + self.currentMemoryUsage -= bytesPurged; + } + }); +} + +- (BOOL)removeImageWithIdentifier:(NSString *)identifier { + __block BOOL removed = NO; + dispatch_barrier_sync(self.synchronizationQueue, ^{ + AFCachedImage *cachedImage = self.cachedImages[identifier]; + if (cachedImage != nil) { + [self.cachedImages removeObjectForKey:identifier]; + self.currentMemoryUsage -= cachedImage.totalBytes; + removed = YES; + } + }); + return removed; +} + +- (BOOL)removeAllImages { + __block BOOL removed = NO; + dispatch_barrier_sync(self.synchronizationQueue, ^{ + if (self.cachedImages.count > 0) { + [self.cachedImages removeAllObjects]; + self.currentMemoryUsage = 0; + removed = YES; + } + }); + return removed; +} + +- (nullable UIImage *)imageWithIdentifier:(NSString *)identifier { + __block UIImage *image = nil; + dispatch_sync(self.synchronizationQueue, ^{ + AFCachedImage *cachedImage = self.cachedImages[identifier]; + image = [cachedImage accessImage]; + }); + return image; +} + +- (void)addImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)identifier { + [self addImage:image withIdentifier:[self imageCacheKeyFromURLRequest:request withAdditionalIdentifier:identifier]]; +} + +- (BOOL)removeImageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)identifier { + return [self removeImageWithIdentifier:[self imageCacheKeyFromURLRequest:request withAdditionalIdentifier:identifier]]; +} + +- (nullable UIImage *)imageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)identifier { + return [self imageWithIdentifier:[self imageCacheKeyFromURLRequest:request withAdditionalIdentifier:identifier]]; +} + +- (NSString *)imageCacheKeyFromURLRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)additionalIdentifier { + NSString *key = request.URL.absoluteString; + if (additionalIdentifier != nil) { + key = [key stringByAppendingString:additionalIdentifier]; + } + return key; +} + +@end + +#endif diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.h b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.h new file mode 100644 index 0000000..b35e185 --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.h @@ -0,0 +1,157 @@ +// AFImageDownloader.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import +#import "AFAutoPurgingImageCache.h" +#import "AFHTTPSessionManager.h" + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSInteger, AFImageDownloadPrioritization) { + AFImageDownloadPrioritizationFIFO, + AFImageDownloadPrioritizationLIFO +}; + +/** + The `AFImageDownloadReceipt` is an object vended by the `AFImageDownloader` when starting a data task. It can be used to cancel active tasks running on the `AFImageDownloader` session. As a general rule, image data tasks should be cancelled using the `AFImageDownloadReceipt` instead of calling `cancel` directly on the `task` itself. The `AFImageDownloader` is optimized to handle duplicate task scenarios as well as pending versus active downloads. + */ +@interface AFImageDownloadReceipt : NSObject + +/** + The data task created by the `AFImageDownloader`. +*/ +@property (nonatomic, strong) NSURLSessionDataTask *task; + +/** + The unique identifier for the success and failure blocks when duplicate requests are made. + */ +@property (nonatomic, strong) NSUUID *receiptID; +@end + +/** The `AFImageDownloader` class is responsible for downloading images in parallel on a prioritized queue. Incoming downloads are added to the front or back of the queue depending on the download prioritization. Each downloaded image is cached in the underlying `NSURLCache` as well as the in-memory image cache. By default, any download request with a cached image equivalent in the image cache will automatically be served the cached image representation. + */ +@interface AFImageDownloader : NSObject + +/** + The image cache used to store all downloaded images in. `AFAutoPurgingImageCache` by default. + */ +@property (nonatomic, strong, nullable) id imageCache; + +/** + The `AFHTTPSessionManager` used to download images. By default, this is configured with an `AFImageResponseSerializer`, and a shared `NSURLCache` for all image downloads. + */ +@property (nonatomic, strong) AFHTTPSessionManager *sessionManager; + +/** + Defines the order prioritization of incoming download requests being inserted into the queue. `AFImageDownloadPrioritizationFIFO` by default. + */ +@property (nonatomic, assign) AFImageDownloadPrioritization downloadPrioritizaton; + +/** + The shared default instance of `AFImageDownloader` initialized with default values. + */ ++ (instancetype)defaultInstance; + +/** + Creates a default `NSURLCache` with common usage parameter values. + + @returns The default `NSURLCache` instance. + */ ++ (NSURLCache *)defaultURLCache; + +/** + Default initializer + + @return An instance of `AFImageDownloader` initialized with default values. + */ +- (instancetype)init; + +/** + Initializes the `AFImageDownloader` instance with the given session manager, download prioritization, maximum active download count and image cache. + + @param sessionManager The session manager to use to download images. + @param downloadPrioritization The download prioritization of the download queue. + @param maximumActiveDownloads The maximum number of active downloads allowed at any given time. Recommend `4`. + @param imageCache The image cache used to store all downloaded images in. + + @return The new `AFImageDownloader` instance. + */ +- (instancetype)initWithSessionManager:(AFHTTPSessionManager *)sessionManager + downloadPrioritization:(AFImageDownloadPrioritization)downloadPrioritization + maximumActiveDownloads:(NSInteger)maximumActiveDownloads + imageCache:(nullable id )imageCache; + +/** + Creates a data task using the `sessionManager` instance for the specified URL request. + + If the same data task is already in the queue or currently being downloaded, the success and failure blocks are + appended to the already existing task. Once the task completes, all success or failure blocks attached to the + task are executed in the order they were added. + + @param request The URL request. + @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. + @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. + + @return The image download receipt for the data task if available. `nil` if the image is stored in the cache. + cache and the URL request cache policy allows the cache to be used. + */ +- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *responseObject))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; + +/** + Creates a data task using the `sessionManager` instance for the specified URL request. + + If the same data task is already in the queue or currently being downloaded, the success and failure blocks are + appended to the already existing task. Once the task completes, all success or failure blocks attached to the + task are executed in the order they were added. + + @param request The URL request. + @param request The identifier to use for the download receipt that will be created for this request. This must be a unique identifier that does not represent any other request. + @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. + @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. + + @return The image download receipt for the data task if available. `nil` if the image is stored in the cache. + cache and the URL request cache policy allows the cache to be used. + */ +- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request + withReceiptID:(NSUUID *)receiptID + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *responseObject))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; + +/** + Cancels the data task in the receipt by removing the corresponding success and failure blocks and cancelling the data task if necessary. + + If the data task is pending in the queue, it will be cancelled if no other success and failure blocks are registered with the data task. If the data task is currently executing or is already completed, the success and failure blocks are removed and will not be called when the task finishes. + + @param imageDownloadReceipt The image download receipt to cancel. + */ +- (void)cancelTaskForImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt; + +@end + +#endif + +NS_ASSUME_NONNULL_END diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.m b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.m new file mode 100644 index 0000000..e87082a --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.m @@ -0,0 +1,369 @@ +// AFImageDownloader.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import "AFImageDownloader.h" +#import "AFHTTPSessionManager.h" + +@interface AFImageDownloaderResponseHandler : NSObject +@property (nonatomic, strong) NSUUID *uuid; +@property (nonatomic, copy) void (^successBlock)(NSURLRequest*, NSHTTPURLResponse*, UIImage*); +@property (nonatomic, copy) void (^failureBlock)(NSURLRequest*, NSHTTPURLResponse*, NSError*); +@end + +@implementation AFImageDownloaderResponseHandler + +- (instancetype)initWithUUID:(NSUUID *)uuid + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *responseObject))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure { + if (self = [self init]) { + self.uuid = uuid; + self.successBlock = success; + self.failureBlock = failure; + } + return self; +} + +- (NSString *)description { + return [NSString stringWithFormat: @"UUID: %@", [self.uuid UUIDString]]; +} + +@end + +@interface AFImageDownloaderMergedTask : NSObject +@property (nonatomic, strong) NSString *identifier; +@property (nonatomic, strong) NSURLSessionDataTask *task; +@property (nonatomic, strong) NSMutableArray *responseHandlers; + +@end + +@implementation AFImageDownloaderMergedTask + +- (instancetype)initWithIdentifier:(NSString *)identifier task:(NSURLSessionDataTask *)task { + if (self = [self init]) { + self.identifier = identifier; + self.task = task; + self.responseHandlers = [[NSMutableArray alloc] init]; + } + return self; +} + +- (void)addResponseHandler:(AFImageDownloaderResponseHandler*)handler { + [self.responseHandlers addObject:handler]; +} + +- (void)removeResponseHandler:(AFImageDownloaderResponseHandler*)handler { + [self.responseHandlers removeObject:handler]; +} + +@end + +@implementation AFImageDownloadReceipt + +- (instancetype)initWithReceiptID:(NSUUID *)receiptID task:(NSURLSessionDataTask *)task { + if (self = [self init]) { + self.receiptID = receiptID; + self.task = task; + } + return self; +} + +@end + +@interface AFImageDownloader () + +@property (nonatomic, strong) dispatch_queue_t synchronizationQueue; +@property (nonatomic, strong) dispatch_queue_t responseQueue; + +@property (nonatomic, assign) NSInteger maximumActiveDownloads; +@property (nonatomic, assign) NSInteger activeRequestCount; + +@property (nonatomic, strong) NSMutableArray *queuedMergedTasks; +@property (nonatomic, strong) NSMutableDictionary *mergedTasks; + +@end + + +@implementation AFImageDownloader + ++ (NSURLCache *)defaultURLCache { + return [[NSURLCache alloc] initWithMemoryCapacity:20 * 1024 * 1024 + diskCapacity:150 * 1024 * 1024 + diskPath:@"com.alamofire.imagedownloader"]; +} + ++ (NSURLSessionConfiguration *)defaultURLSessionConfiguration { + NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; + + //TODO set the default HTTP headers + + configuration.HTTPShouldSetCookies = YES; + configuration.HTTPShouldUsePipelining = NO; + + configuration.requestCachePolicy = NSURLRequestUseProtocolCachePolicy; + configuration.allowsCellularAccess = YES; + configuration.timeoutIntervalForRequest = 60.0; + configuration.URLCache = [AFImageDownloader defaultURLCache]; + + return configuration; +} + +- (instancetype)init { + NSURLSessionConfiguration *defaultConfiguration = [self.class defaultURLSessionConfiguration]; + AFHTTPSessionManager *sessionManager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:defaultConfiguration]; + sessionManager.responseSerializer = [AFImageResponseSerializer serializer]; + + return [self initWithSessionManager:sessionManager + downloadPrioritization:AFImageDownloadPrioritizationFIFO + maximumActiveDownloads:4 + imageCache:[[AFAutoPurgingImageCache alloc] init]]; +} + +- (instancetype)initWithSessionManager:(AFHTTPSessionManager *)sessionManager + downloadPrioritization:(AFImageDownloadPrioritization)downloadPrioritization + maximumActiveDownloads:(NSInteger)maximumActiveDownloads + imageCache:(id )imageCache { + if (self = [super init]) { + self.sessionManager = sessionManager; + + self.downloadPrioritizaton = downloadPrioritization; + self.maximumActiveDownloads = maximumActiveDownloads; + self.imageCache = imageCache; + + self.queuedMergedTasks = [[NSMutableArray alloc] init]; + self.mergedTasks = [[NSMutableDictionary alloc] init]; + self.activeRequestCount = 0; + + NSString *name = [NSString stringWithFormat:@"com.alamofire.imagedownloader.synchronizationqueue-%@", [[NSUUID UUID] UUIDString]]; + self.synchronizationQueue = dispatch_queue_create([name cStringUsingEncoding:NSASCIIStringEncoding], DISPATCH_QUEUE_SERIAL); + + name = [NSString stringWithFormat:@"com.alamofire.imagedownloader.responsequeue-%@", [[NSUUID UUID] UUIDString]]; + self.responseQueue = dispatch_queue_create([name cStringUsingEncoding:NSASCIIStringEncoding], DISPATCH_QUEUE_CONCURRENT); + } + + return self; +} + ++ (instancetype)defaultInstance { + static AFImageDownloader *sharedInstance = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedInstance = [[self alloc] init]; + }); + return sharedInstance; +} + +- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request + success:(void (^)(NSURLRequest * _Nonnull, NSHTTPURLResponse * _Nullable, UIImage * _Nonnull))success + failure:(void (^)(NSURLRequest * _Nonnull, NSHTTPURLResponse * _Nullable, NSError * _Nonnull))failure { + return [self downloadImageForURLRequest:request withReceiptID:[NSUUID UUID] success:success failure:failure]; +} + +- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request + withReceiptID:(nonnull NSUUID *)receiptID + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *responseObject))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure { + __block NSURLSessionDataTask *task = nil; + dispatch_sync(self.synchronizationQueue, ^{ + NSString *identifier = request.URL.absoluteString; + + // 1) Append the success and failure blocks to a pre-existing request if it already exists + AFImageDownloaderMergedTask *existingMergedTask = self.mergedTasks[identifier]; + if (existingMergedTask != nil) { + AFImageDownloaderResponseHandler *handler = [[AFImageDownloaderResponseHandler alloc] initWithUUID:receiptID success:success failure:failure]; + [existingMergedTask addResponseHandler:handler]; + task = existingMergedTask.task; + return; + } + + // 2) Attempt to load the image from the image cache if the cache policy allows it + switch (request.cachePolicy) { + case NSURLRequestUseProtocolCachePolicy: + case NSURLRequestReturnCacheDataElseLoad: + case NSURLRequestReturnCacheDataDontLoad: { + UIImage *cachedImage = [self.imageCache imageforRequest:request withAdditionalIdentifier:nil]; + if (cachedImage != nil) { + if (success) { + dispatch_async(dispatch_get_main_queue(), ^{ + success(request, nil, cachedImage); + }); + } + return; + } + break; + } + default: + break; + } + + // 3) Create the request and set up authentication, validation and response serialization + NSURLSessionDataTask *createdTask; + __weak __typeof__(self) weakSelf = self; + + createdTask = [self.sessionManager + dataTaskWithRequest:request + completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { + dispatch_async(self.responseQueue, ^{ + __strong __typeof__(weakSelf) strongSelf = weakSelf; + AFImageDownloaderMergedTask *mergedTask = [strongSelf safelyRemoveMergedTaskWithIdentifier:identifier]; + if (error) { + for (AFImageDownloaderResponseHandler *handler in mergedTask.responseHandlers) { + if (handler.failureBlock) { + dispatch_async(dispatch_get_main_queue(), ^{ + handler.failureBlock(request, (NSHTTPURLResponse*)response, error); + }); + } + } + } else { + [strongSelf.imageCache addImage:responseObject forRequest:request withAdditionalIdentifier:nil]; + + for (AFImageDownloaderResponseHandler *handler in mergedTask.responseHandlers) { + if (handler.successBlock) { + dispatch_async(dispatch_get_main_queue(), ^{ + handler.successBlock(request, (NSHTTPURLResponse*)response, responseObject); + }); + } + } + + } + [strongSelf safelyDecrementActiveTaskCount]; + [strongSelf safelyStartNextTaskIfNecessary]; + }); + }]; + + // 4) Store the response handler for use when the request completes + AFImageDownloaderResponseHandler *handler = [[AFImageDownloaderResponseHandler alloc] initWithUUID:receiptID + success:success + failure:failure]; + AFImageDownloaderMergedTask *mergedTask = [[AFImageDownloaderMergedTask alloc] + initWithIdentifier:identifier + task:createdTask]; + [mergedTask addResponseHandler:handler]; + self.mergedTasks[identifier] = mergedTask; + + // 5) Either start the request or enqueue it depending on the current active request count + if ([self isActiveRequestCountBelowMaximumLimit]) { + [self startMergedTask:mergedTask]; + } else { + [self enqueueMergedTask:mergedTask]; + } + + task = mergedTask.task; + }); + if (task) { + return [[AFImageDownloadReceipt alloc] initWithReceiptID:receiptID task:task]; + } else { + return nil; + } +} + +- (void)cancelTaskForImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt { + dispatch_sync(self.synchronizationQueue, ^{ + NSString *identifier = imageDownloadReceipt.task.originalRequest.URL.absoluteString; + AFImageDownloaderMergedTask *mergedTask = self.mergedTasks[identifier]; + NSUInteger index = [mergedTask.responseHandlers indexOfObjectPassingTest:^BOOL(AFImageDownloaderResponseHandler * _Nonnull handler, __unused NSUInteger idx, __unused BOOL * _Nonnull stop) { + return handler.uuid == imageDownloadReceipt.receiptID; + }]; + + if (index != NSNotFound) { + AFImageDownloaderResponseHandler *handler = mergedTask.responseHandlers[index]; + [mergedTask removeResponseHandler:handler]; + NSString *failureReason = [NSString stringWithFormat:@"ImageDownloader cancelled URL request: %@",imageDownloadReceipt.task.originalRequest.URL.absoluteString]; + NSDictionary *userInfo = @{NSLocalizedFailureReasonErrorKey:failureReason}; + NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled userInfo:userInfo]; + if (handler.failureBlock) { + dispatch_async(dispatch_get_main_queue(), ^{ + handler.failureBlock(imageDownloadReceipt.task.originalRequest, nil, error); + }); + } + } + + if (mergedTask.responseHandlers.count == 0 && mergedTask.task.state == NSURLSessionTaskStateSuspended) { + [mergedTask.task cancel]; + } + }); +} + +- (AFImageDownloaderMergedTask*)safelyRemoveMergedTaskWithIdentifier:(NSString *)identifier { + __block AFImageDownloaderMergedTask *mergedTask = nil; + dispatch_sync(self.synchronizationQueue, ^{ + mergedTask = self.mergedTasks[identifier]; + [self.mergedTasks removeObjectForKey:identifier]; + + }); + return mergedTask; +} + +- (void)safelyDecrementActiveTaskCount { + dispatch_sync(self.synchronizationQueue, ^{ + if (self.activeRequestCount > 0) { + self.activeRequestCount -= 1; + } + }); +} + +- (void)safelyStartNextTaskIfNecessary { + dispatch_sync(self.synchronizationQueue, ^{ + if ([self isActiveRequestCountBelowMaximumLimit]) { + while (self.queuedMergedTasks.count > 0) { + AFImageDownloaderMergedTask *mergedTask = [self dequeueMergedTask]; + if (mergedTask.task.state == NSURLSessionTaskStateSuspended) { + [self startMergedTask:mergedTask]; + break; + } + } + } + }); +} + +- (void)startMergedTask:(AFImageDownloaderMergedTask *)mergedTask { + [mergedTask.task resume]; + ++self.activeRequestCount; +} + +- (void)enqueueMergedTask:(AFImageDownloaderMergedTask *)mergedTask { + switch (self.downloadPrioritizaton) { + case AFImageDownloadPrioritizationFIFO: + [self.queuedMergedTasks addObject:mergedTask]; + break; + case AFImageDownloadPrioritizationLIFO: + [self.queuedMergedTasks insertObject:mergedTask atIndex:0]; + break; + } +} + +- (AFImageDownloaderMergedTask *)dequeueMergedTask { + AFImageDownloaderMergedTask *mergedTask = nil; + mergedTask = [self.queuedMergedTasks firstObject]; + [self.queuedMergedTasks removeObject:mergedTask]; + return mergedTask; +} + +- (BOOL)isActiveRequestCountBelowMaximumLimit { + return self.activeRequestCount < self.maximumActiveDownloads; +} + +@end + +#endif diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h new file mode 100644 index 0000000..a627a6d --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h @@ -0,0 +1,103 @@ +// AFNetworkActivityIndicatorManager.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#import + +#if TARGET_OS_IOS + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + `AFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. When enabled, it will listen for notifications indicating that a session task has started or finished, and start or stop animating the indicator accordingly. The number of active requests is incremented and decremented much like a stack or a semaphore, and the activity indicator will animate so long as that number is greater than zero. + + You should enable the shared instance of `AFNetworkActivityIndicatorManager` when your application finishes launching. In `AppDelegate application:didFinishLaunchingWithOptions:` you can do so with the following code: + + [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES]; + + By setting `enabled` to `YES` for `sharedManager`, the network activity indicator will show and hide automatically as requests start and finish. You should not ever need to call `incrementActivityCount` or `decrementActivityCount` yourself. + + See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information: + http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44 + */ +NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead.") +@interface AFNetworkActivityIndicatorManager : NSObject + +/** + A Boolean value indicating whether the manager is enabled. + + If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO. + */ +@property (nonatomic, assign, getter = isEnabled) BOOL enabled; + +/** + A Boolean value indicating whether the network activity indicator manager is currently active. +*/ +@property (readonly, nonatomic, assign, getter=isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible; + +/** + A time interval indicating the minimum duration of networking activity that should occur before the activity indicator is displayed. The default value 1 second. If the network activity indicator should be displayed immediately when network activity occurs, this value should be set to 0 seconds. + + Apple's HIG describes the following: + + > Display the network activity indicator to provide feedback when your app accesses the network for more than a couple of seconds. If the operation finishes sooner than that, you don’t have to show the network activity indicator, because the indicator is likely to disappear before users notice its presence. + + */ +@property (nonatomic, assign) NSTimeInterval activationDelay; + +/** + A time interval indicating the duration of time of no networking activity required before the activity indicator is disabled. This allows for continuous display of the network activity indicator across multiple requests. The default value is 0.17 seconds. + */ + +@property (nonatomic, assign) NSTimeInterval completionDelay; + +/** + Returns the shared network activity indicator manager object for the system. + + @return The systemwide network activity indicator manager. + */ ++ (instancetype)sharedManager; + +/** + Increments the number of active network requests. If this number was zero before incrementing, this will start animating the status bar network activity indicator. + */ +- (void)incrementActivityCount; + +/** + Decrements the number of active network requests. If this number becomes zero after decrementing, this will stop animating the status bar network activity indicator. + */ +- (void)decrementActivityCount; + +/** + Set the a custom method to be executed when the network activity indicator manager should be hidden/shown. By default, this is null, and the UIApplication Network Activity Indicator will be managed automatically. If this block is set, it is the responsiblity of the caller to manager the network activity indicator going forward. + + @param block A block to be executed when the network activity indicator status changes. + */ +- (void)setNetworkingActivityActionWithBlock:(nullable void (^)(BOOL networkActivityIndicatorVisible))block; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m new file mode 100644 index 0000000..0615fa9 --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m @@ -0,0 +1,261 @@ +// AFNetworkActivityIndicatorManager.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "AFNetworkActivityIndicatorManager.h" + +#if TARGET_OS_IOS +#import "AFURLSessionManager.h" + +typedef NS_ENUM(NSInteger, AFNetworkActivityManagerState) { + AFNetworkActivityManagerStateNotActive, + AFNetworkActivityManagerStateDelayingStart, + AFNetworkActivityManagerStateActive, + AFNetworkActivityManagerStateDelayingEnd +}; + +static NSTimeInterval const kDefaultAFNetworkActivityManagerActivationDelay = 1.0; +static NSTimeInterval const kDefaultAFNetworkActivityManagerCompletionDelay = 0.17; + +static NSURLRequest * AFNetworkRequestFromNotification(NSNotification *notification) { + if ([[notification object] respondsToSelector:@selector(originalRequest)]) { + return [(NSURLSessionTask *)[notification object] originalRequest]; + } else { + return nil; + } +} + +typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisible); + +@interface AFNetworkActivityIndicatorManager () +@property (readwrite, nonatomic, assign) NSInteger activityCount; +@property (readwrite, nonatomic, strong) NSTimer *activationDelayTimer; +@property (readwrite, nonatomic, strong) NSTimer *completionDelayTimer; +@property (readonly, nonatomic, getter = isNetworkActivityOccurring) BOOL networkActivityOccurring; +@property (nonatomic, copy) AFNetworkActivityActionBlock networkActivityActionBlock; +@property (nonatomic, assign) AFNetworkActivityManagerState currentState; +@property (nonatomic, assign, getter=isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible; + +- (void)updateCurrentStateForNetworkActivityChange; +@end + +@implementation AFNetworkActivityIndicatorManager + ++ (instancetype)sharedManager { + static AFNetworkActivityIndicatorManager *_sharedManager = nil; + static dispatch_once_t oncePredicate; + dispatch_once(&oncePredicate, ^{ + _sharedManager = [[self alloc] init]; + }); + + return _sharedManager; +} + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + self.currentState = AFNetworkActivityManagerStateNotActive; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidStart:) name:AFNetworkingTaskDidResumeNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidSuspendNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidCompleteNotification object:nil]; + self.activationDelay = kDefaultAFNetworkActivityManagerActivationDelay; + self.completionDelay = kDefaultAFNetworkActivityManagerCompletionDelay; + + return self; +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + [_activationDelayTimer invalidate]; + [_completionDelayTimer invalidate]; +} + +- (void)setEnabled:(BOOL)enabled { + _enabled = enabled; + if (enabled == NO) { + [self setCurrentState:AFNetworkActivityManagerStateNotActive]; + } +} + +- (void)setNetworkingActivityActionWithBlock:(void (^)(BOOL networkActivityIndicatorVisible))block { + self.networkActivityActionBlock = block; +} + +- (BOOL)isNetworkActivityOccurring { + @synchronized(self) { + return self.activityCount > 0; + } +} + +- (void)setNetworkActivityIndicatorVisible:(BOOL)networkActivityIndicatorVisible { + if (_networkActivityIndicatorVisible != networkActivityIndicatorVisible) { + [self willChangeValueForKey:@"networkActivityIndicatorVisible"]; + @synchronized(self) { + _networkActivityIndicatorVisible = networkActivityIndicatorVisible; + } + [self didChangeValueForKey:@"networkActivityIndicatorVisible"]; + if (self.networkActivityActionBlock) { + self.networkActivityActionBlock(networkActivityIndicatorVisible); + } else { + [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:networkActivityIndicatorVisible]; + } + } +} + +- (void)setActivityCount:(NSInteger)activityCount { + @synchronized(self) { + _activityCount = activityCount; + } + + dispatch_async(dispatch_get_main_queue(), ^{ + [self updateCurrentStateForNetworkActivityChange]; + }); +} + +- (void)incrementActivityCount { + [self willChangeValueForKey:@"activityCount"]; + @synchronized(self) { + _activityCount++; + } + [self didChangeValueForKey:@"activityCount"]; + + dispatch_async(dispatch_get_main_queue(), ^{ + [self updateCurrentStateForNetworkActivityChange]; + }); +} + +- (void)decrementActivityCount { + [self willChangeValueForKey:@"activityCount"]; + @synchronized(self) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + _activityCount = MAX(_activityCount - 1, 0); +#pragma clang diagnostic pop + } + [self didChangeValueForKey:@"activityCount"]; + + dispatch_async(dispatch_get_main_queue(), ^{ + [self updateCurrentStateForNetworkActivityChange]; + }); +} + +- (void)networkRequestDidStart:(NSNotification *)notification { + if ([AFNetworkRequestFromNotification(notification) URL]) { + [self incrementActivityCount]; + } +} + +- (void)networkRequestDidFinish:(NSNotification *)notification { + if ([AFNetworkRequestFromNotification(notification) URL]) { + [self decrementActivityCount]; + } +} + +#pragma mark - Internal State Management +- (void)setCurrentState:(AFNetworkActivityManagerState)currentState { + @synchronized(self) { + if (_currentState != currentState) { + [self willChangeValueForKey:@"currentState"]; + _currentState = currentState; + switch (currentState) { + case AFNetworkActivityManagerStateNotActive: + [self cancelActivationDelayTimer]; + [self cancelCompletionDelayTimer]; + [self setNetworkActivityIndicatorVisible:NO]; + break; + case AFNetworkActivityManagerStateDelayingStart: + [self startActivationDelayTimer]; + break; + case AFNetworkActivityManagerStateActive: + [self cancelCompletionDelayTimer]; + [self setNetworkActivityIndicatorVisible:YES]; + break; + case AFNetworkActivityManagerStateDelayingEnd: + [self startCompletionDelayTimer]; + break; + } + } + [self didChangeValueForKey:@"currentState"]; + } +} + +- (void)updateCurrentStateForNetworkActivityChange { + if (self.enabled) { + switch (self.currentState) { + case AFNetworkActivityManagerStateNotActive: + if (self.isNetworkActivityOccurring) { + [self setCurrentState:AFNetworkActivityManagerStateDelayingStart]; + } + break; + case AFNetworkActivityManagerStateDelayingStart: + //No op. Let the delay timer finish out. + break; + case AFNetworkActivityManagerStateActive: + if (!self.isNetworkActivityOccurring) { + [self setCurrentState:AFNetworkActivityManagerStateDelayingEnd]; + } + break; + case AFNetworkActivityManagerStateDelayingEnd: + if (self.isNetworkActivityOccurring) { + [self setCurrentState:AFNetworkActivityManagerStateActive]; + } + break; + } + } +} + +- (void)startActivationDelayTimer { + self.activationDelayTimer = [NSTimer + timerWithTimeInterval:self.activationDelay target:self selector:@selector(activationDelayTimerFired) userInfo:nil repeats:NO]; + [[NSRunLoop mainRunLoop] addTimer:self.activationDelayTimer forMode:NSRunLoopCommonModes]; +} + +- (void)activationDelayTimerFired { + if (self.networkActivityOccurring) { + [self setCurrentState:AFNetworkActivityManagerStateActive]; + } else { + [self setCurrentState:AFNetworkActivityManagerStateNotActive]; + } +} + +- (void)startCompletionDelayTimer { + [self.completionDelayTimer invalidate]; + self.completionDelayTimer = [NSTimer timerWithTimeInterval:self.completionDelay target:self selector:@selector(completionDelayTimerFired) userInfo:nil repeats:NO]; + [[NSRunLoop mainRunLoop] addTimer:self.completionDelayTimer forMode:NSRunLoopCommonModes]; +} + +- (void)completionDelayTimerFired { + [self setCurrentState:AFNetworkActivityManagerStateNotActive]; +} + +- (void)cancelActivationDelayTimer { + [self.activationDelayTimer invalidate]; +} + +- (void)cancelCompletionDelayTimer { + [self.completionDelayTimer invalidate]; +} + +@end + +#endif diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h new file mode 100644 index 0000000..b6ef044 --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h @@ -0,0 +1,48 @@ +// UIActivityIndicatorView+AFNetworking.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import + +/** + This category adds methods to the UIKit framework's `UIActivityIndicatorView` class. The methods in this category provide support for automatically starting and stopping animation depending on the loading state of a session task. + */ +@interface UIActivityIndicatorView (AFNetworking) + +///---------------------------------- +/// @name Animating for Session Tasks +///---------------------------------- + +/** + Binds the animating state to the state of the specified task. + + @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. + */ +- (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task; + +@end + +#endif diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m new file mode 100644 index 0000000..fcf1c0c --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m @@ -0,0 +1,124 @@ +// UIActivityIndicatorView+AFNetworking.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "UIActivityIndicatorView+AFNetworking.h" +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import "AFURLSessionManager.h" + +@interface AFActivityIndicatorViewNotificationObserver : NSObject +@property (readonly, nonatomic, weak) UIActivityIndicatorView *activityIndicatorView; +- (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView; + +- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task; + +@end + +@implementation UIActivityIndicatorView (AFNetworking) + +- (AFActivityIndicatorViewNotificationObserver *)af_notificationObserver { + AFActivityIndicatorViewNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver)); + if (notificationObserver == nil) { + notificationObserver = [[AFActivityIndicatorViewNotificationObserver alloc] initWithActivityIndicatorView:self]; + objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + } + return notificationObserver; +} + +- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task { + [[self af_notificationObserver] setAnimatingWithStateOfTask:task]; +} + +@end + +@implementation AFActivityIndicatorViewNotificationObserver + +- (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView +{ + self = [super init]; + if (self) { + _activityIndicatorView = activityIndicatorView; + } + return self; +} + +- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task { + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + + [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; + + if (task) { + if (task.state != NSURLSessionTaskStateCompleted) { + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreceiver-is-weak" +#pragma clang diagnostic ignored "-Warc-repeated-use-of-weak" + if (task.state == NSURLSessionTaskStateRunning) { + [self.activityIndicatorView startAnimating]; + } else { + [self.activityIndicatorView stopAnimating]; + } +#pragma clang diagnostic pop + + [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingTaskDidResumeNotification object:task]; + [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidCompleteNotification object:task]; + [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidSuspendNotification object:task]; + } + } +} + +#pragma mark - + +- (void)af_startAnimating { + dispatch_async(dispatch_get_main_queue(), ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreceiver-is-weak" + [self.activityIndicatorView startAnimating]; +#pragma clang diagnostic pop + }); +} + +- (void)af_stopAnimating { + dispatch_async(dispatch_get_main_queue(), ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreceiver-is-weak" + [self.activityIndicatorView stopAnimating]; +#pragma clang diagnostic pop + }); +} + +#pragma mark - + +- (void)dealloc { + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + + [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; +} + +@end + +#endif diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h new file mode 100644 index 0000000..98b911e --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h @@ -0,0 +1,175 @@ +// UIButton+AFNetworking.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class AFImageDownloader; + +/** + This category adds methods to the UIKit framework's `UIButton` class. The methods in this category provide support for loading remote images and background images asynchronously from a URL. + + @warning Compound values for control `state` (such as `UIControlStateHighlighted | UIControlStateDisabled`) are unsupported. + */ +@interface UIButton (AFNetworking) + +///------------------------------------ +/// @name Accessing the Image Downloader +///------------------------------------ + +/** + Set the shared image downloader used to download images. + + @param imageDownloader The shared image downloader used to download images. +*/ ++ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader; + +/** + The shared image downloader used to download images. + */ ++ (AFImageDownloader *)sharedImageDownloader; + +///-------------------- +/// @name Setting Image +///-------------------- + +/** + Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + @param state The control state. + @param url The URL used for the image request. + */ +- (void)setImageForState:(UIControlState)state + withURL:(NSURL *)url; + +/** + Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + @param state The control state. + @param url The URL used for the image request. + @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes. + */ +- (void)setImageForState:(UIControlState)state + withURL:(NSURL *)url + placeholderImage:(nullable UIImage *)placeholderImage; + +/** + Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setImage:forState:` is applied. + + @param state The control state. + @param urlRequest The URL request used for the image request. + @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes. + @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. + @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. + */ +- (void)setImageForState:(UIControlState)state + withURLRequest:(NSURLRequest *)urlRequest + placeholderImage:(nullable UIImage *)placeholderImage + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; + + +///------------------------------- +/// @name Setting Background Image +///------------------------------- + +/** + Asynchronously downloads an image from the specified URL, and sets it as the background image for the specified state once the request is finished. Any previous background image request for the receiver will be cancelled. + + If the background image is cached locally, the background image is set immediately, otherwise the specified placeholder background image will be set immediately, and then the remote background image will be set once the request is finished. + + @param state The control state. + @param url The URL used for the background image request. + */ +- (void)setBackgroundImageForState:(UIControlState)state + withURL:(NSURL *)url; + +/** + Asynchronously downloads an image from the specified URL, and sets it as the background image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + @param state The control state. + @param url The URL used for the background image request. + @param placeholderImage The background image to be set initially, until the background image request finishes. If `nil`, the button will not change its background image until the background image request finishes. + */ +- (void)setBackgroundImageForState:(UIControlState)state + withURL:(NSURL *)url + placeholderImage:(nullable UIImage *)placeholderImage; + +/** + Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setBackgroundImage:forState:` is applied. + + @param state The control state. + @param urlRequest The URL request used for the image request. + @param placeholderImage The background image to be set initially, until the background image request finishes. If `nil`, the button will not change its background image until the background image request finishes. + @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. + @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. + */ +- (void)setBackgroundImageForState:(UIControlState)state + withURLRequest:(NSURLRequest *)urlRequest + placeholderImage:(nullable UIImage *)placeholderImage + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; + + +///------------------------------ +/// @name Canceling Image Loading +///------------------------------ + +/** + Cancels any executing image task for the specified control state of the receiver, if one exists. + + @param state The control state. + */ +- (void)cancelImageDownloadTaskForState:(UIControlState)state; + +/** + Cancels any executing background image task for the specified control state of the receiver, if one exists. + + @param state The control state. + */ +- (void)cancelBackgroundImageDownloadTaskForState:(UIControlState)state; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m new file mode 100644 index 0000000..ceb6ebc --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m @@ -0,0 +1,305 @@ +// UIButton+AFNetworking.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "UIButton+AFNetworking.h" + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import "UIImageView+AFNetworking.h" +#import "AFImageDownloader.h" + +@interface UIButton (_AFNetworking) +@end + +@implementation UIButton (_AFNetworking) + +#pragma mark - + +static char AFImageDownloadReceiptNormal; +static char AFImageDownloadReceiptHighlighted; +static char AFImageDownloadReceiptSelected; +static char AFImageDownloadReceiptDisabled; + +static const char * af_imageDownloadReceiptKeyForState(UIControlState state) { + switch (state) { + case UIControlStateHighlighted: + return &AFImageDownloadReceiptHighlighted; + case UIControlStateSelected: + return &AFImageDownloadReceiptSelected; + case UIControlStateDisabled: + return &AFImageDownloadReceiptDisabled; + case UIControlStateNormal: + default: + return &AFImageDownloadReceiptNormal; + } +} + +- (AFImageDownloadReceipt *)af_imageDownloadReceiptForState:(UIControlState)state { + return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, af_imageDownloadReceiptKeyForState(state)); +} + +- (void)af_setImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt + forState:(UIControlState)state +{ + objc_setAssociatedObject(self, af_imageDownloadReceiptKeyForState(state), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +#pragma mark - + +static char AFBackgroundImageDownloadReceiptNormal; +static char AFBackgroundImageDownloadReceiptHighlighted; +static char AFBackgroundImageDownloadReceiptSelected; +static char AFBackgroundImageDownloadReceiptDisabled; + +static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState state) { + switch (state) { + case UIControlStateHighlighted: + return &AFBackgroundImageDownloadReceiptHighlighted; + case UIControlStateSelected: + return &AFBackgroundImageDownloadReceiptSelected; + case UIControlStateDisabled: + return &AFBackgroundImageDownloadReceiptDisabled; + case UIControlStateNormal: + default: + return &AFBackgroundImageDownloadReceiptNormal; + } +} + +- (AFImageDownloadReceipt *)af_backgroundImageDownloadReceiptForState:(UIControlState)state { + return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, af_backgroundImageDownloadReceiptKeyForState(state)); +} + +- (void)af_setBackgroundImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt + forState:(UIControlState)state +{ + objc_setAssociatedObject(self, af_backgroundImageDownloadReceiptKeyForState(state), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +@end + +#pragma mark - + +@implementation UIButton (AFNetworking) + ++ (AFImageDownloader *)sharedImageDownloader { + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance]; +#pragma clang diagnostic pop +} + ++ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader { + objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +#pragma mark - + +- (void)setImageForState:(UIControlState)state + withURL:(NSURL *)url +{ + [self setImageForState:state withURL:url placeholderImage:nil]; +} + +- (void)setImageForState:(UIControlState)state + withURL:(NSURL *)url + placeholderImage:(UIImage *)placeholderImage +{ + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; + [request addValue:@"image/*" forHTTPHeaderField:@"Accept"]; + + [self setImageForState:state withURLRequest:request placeholderImage:placeholderImage success:nil failure:nil]; +} + +- (void)setImageForState:(UIControlState)state + withURLRequest:(NSURLRequest *)urlRequest + placeholderImage:(nullable UIImage *)placeholderImage + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure +{ + if ([self isActiveTaskURLEqualToURLRequest:urlRequest forState:state]) { + return; + } + + [self cancelImageDownloadTaskForState:state]; + + AFImageDownloader *downloader = [[self class] sharedImageDownloader]; + id imageCache = downloader.imageCache; + + //Use the image from the image cache if it exists + UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil]; + if (cachedImage) { + if (success) { + success(urlRequest, nil, cachedImage); + } else { + [self setImage:cachedImage forState:state]; + } + [self af_setImageDownloadReceipt:nil forState:state]; + } else { + if (placeholderImage) { + [self setImage:placeholderImage forState:state]; + } + + __weak __typeof(self)weakSelf = self; + NSUUID *downloadID = [NSUUID UUID]; + AFImageDownloadReceipt *receipt; + receipt = [downloader + downloadImageForURLRequest:urlRequest + withReceiptID:downloadID + success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + if ([[strongSelf af_imageDownloadReceiptForState:state].receiptID isEqual:downloadID]) { + if (success) { + success(request, response, responseObject); + } else if(responseObject) { + [strongSelf setImage:responseObject forState:state]; + } + [strongSelf af_setImageDownloadReceipt:nil forState:state]; + } + + } + failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + if ([[strongSelf af_imageDownloadReceiptForState:state].receiptID isEqual:downloadID]) { + if (failure) { + failure(request, response, error); + } + [strongSelf af_setImageDownloadReceipt:nil forState:state]; + } + }]; + + [self af_setImageDownloadReceipt:receipt forState:state]; + } +} + +#pragma mark - + +- (void)setBackgroundImageForState:(UIControlState)state + withURL:(NSURL *)url +{ + [self setBackgroundImageForState:state withURL:url placeholderImage:nil]; +} + +- (void)setBackgroundImageForState:(UIControlState)state + withURL:(NSURL *)url + placeholderImage:(nullable UIImage *)placeholderImage +{ + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; + [request addValue:@"image/*" forHTTPHeaderField:@"Accept"]; + + [self setBackgroundImageForState:state withURLRequest:request placeholderImage:placeholderImage success:nil failure:nil]; +} + +- (void)setBackgroundImageForState:(UIControlState)state + withURLRequest:(NSURLRequest *)urlRequest + placeholderImage:(nullable UIImage *)placeholderImage + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure +{ + if ([self isActiveBackgroundTaskURLEqualToURLRequest:urlRequest forState:state]) { + return; + } + + [self cancelImageDownloadTaskForState:state]; + + AFImageDownloader *downloader = [[self class] sharedImageDownloader]; + id imageCache = downloader.imageCache; + + //Use the image from the image cache if it exists + UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil]; + if (cachedImage) { + if (success) { + success(urlRequest, nil, cachedImage); + } else { + [self setBackgroundImage:cachedImage forState:state]; + } + [self af_setBackgroundImageDownloadReceipt:nil forState:state]; + } else { + if (placeholderImage) { + [self setBackgroundImage:placeholderImage forState:state]; + } + + __weak __typeof(self)weakSelf = self; + NSUUID *downloadID = [NSUUID UUID]; + AFImageDownloadReceipt *receipt; + receipt = [downloader + downloadImageForURLRequest:urlRequest + withReceiptID:downloadID + success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + if ([[strongSelf af_backgroundImageDownloadReceiptForState:state].receiptID isEqual:downloadID]) { + if (success) { + success(request, response, responseObject); + } else if(responseObject) { + [strongSelf setBackgroundImage:responseObject forState:state]; + } + [strongSelf af_setImageDownloadReceipt:nil forState:state]; + } + + } + failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + if ([[strongSelf af_backgroundImageDownloadReceiptForState:state].receiptID isEqual:downloadID]) { + if (failure) { + failure(request, response, error); + } + [strongSelf af_setBackgroundImageDownloadReceipt:nil forState:state]; + } + }]; + + [self af_setBackgroundImageDownloadReceipt:receipt forState:state]; + } +} + +#pragma mark - + +- (void)cancelImageDownloadTaskForState:(UIControlState)state { + AFImageDownloadReceipt *receipt = [self af_imageDownloadReceiptForState:state]; + if (receipt != nil) { + [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:receipt]; + [self af_setImageDownloadReceipt:nil forState:state]; + } +} + +- (void)cancelBackgroundImageDownloadTaskForState:(UIControlState)state { + AFImageDownloadReceipt *receipt = [self af_backgroundImageDownloadReceiptForState:state]; + if (receipt != nil) { + [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:receipt]; + [self af_setBackgroundImageDownloadReceipt:nil forState:state]; + } +} + +- (BOOL)isActiveTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest forState:(UIControlState)state { + AFImageDownloadReceipt *receipt = [self af_imageDownloadReceiptForState:state]; + return [receipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString]; +} + +- (BOOL)isActiveBackgroundTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest forState:(UIControlState)state { + AFImageDownloadReceipt *receipt = [self af_backgroundImageDownloadReceiptForState:state]; + return [receipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString]; +} + + +@end + +#endif diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h new file mode 100644 index 0000000..14744cd --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h @@ -0,0 +1,35 @@ +// +// UIImage+AFNetworking.h +// +// +// Created by Paulo Ferreira on 08/07/15. +// +// 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. + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import + +@interface UIImage (AFNetworking) + ++ (UIImage*) safeImageWithData:(NSData*)data; + +@end + +#endif diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h new file mode 100644 index 0000000..ce9ae2e --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h @@ -0,0 +1,109 @@ +// UIImageView+AFNetworking.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class AFImageDownloader; + +/** + This category adds methods to the UIKit framework's `UIImageView` class. The methods in this category provide support for loading remote images asynchronously from a URL. + */ +@interface UIImageView (AFNetworking) + +///------------------------------------ +/// @name Accessing the Image Downloader +///------------------------------------ + +/** + Set the shared image downloader used to download images. + + @param imageDownloader The shared image downloader used to download images. + */ ++ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader; + +/** + The shared image downloader used to download images. + */ ++ (AFImageDownloader *)sharedImageDownloader; + +///-------------------- +/// @name Setting Image +///-------------------- + +/** + Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:` + + @param url The URL used for the image request. + */ +- (void)setImageWithURL:(NSURL *)url; + +/** + Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:` + + @param url The URL used for the image request. + @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes. + */ +- (void)setImageWithURL:(NSURL *)url + placeholderImage:(nullable UIImage *)placeholderImage; + +/** + Asynchronously downloads an image from the specified URL request, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + If a success block is specified, it is the responsibility of the block to set the image of the image view before returning. If no success block is specified, the default behavior of setting the image with `self.image = image` is applied. + + @param urlRequest The URL request used for the image request. + @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes. + @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. + @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. + */ +- (void)setImageWithURLRequest:(NSURLRequest *)urlRequest + placeholderImage:(nullable UIImage *)placeholderImage + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; + +/** + Cancels any executing image operation for the receiver, if one exists. + */ +- (void)cancelImageDownloadTask; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m new file mode 100644 index 0000000..a97d5cc --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m @@ -0,0 +1,161 @@ +// UIImageView+AFNetworking.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "UIImageView+AFNetworking.h" + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import "AFImageDownloader.h" + +@interface UIImageView (_AFNetworking) +@property (readwrite, nonatomic, strong, setter = af_setActiveImageDownloadReceipt:) AFImageDownloadReceipt *af_activeImageDownloadReceipt; +@end + +@implementation UIImageView (_AFNetworking) + +- (AFImageDownloadReceipt *)af_activeImageDownloadReceipt { + return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, @selector(af_activeImageDownloadReceipt)); +} + +- (void)af_setActiveImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt { + objc_setAssociatedObject(self, @selector(af_activeImageDownloadReceipt), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +@end + +#pragma mark - + +@implementation UIImageView (AFNetworking) + ++ (AFImageDownloader *)sharedImageDownloader { + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance]; +#pragma clang diagnostic pop +} + ++ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader { + objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +#pragma mark - + +- (void)setImageWithURL:(NSURL *)url { + [self setImageWithURL:url placeholderImage:nil]; +} + +- (void)setImageWithURL:(NSURL *)url + placeholderImage:(UIImage *)placeholderImage +{ + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; + [request addValue:@"image/*" forHTTPHeaderField:@"Accept"]; + + [self setImageWithURLRequest:request placeholderImage:placeholderImage success:nil failure:nil]; +} + +- (void)setImageWithURLRequest:(NSURLRequest *)urlRequest + placeholderImage:(UIImage *)placeholderImage + success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success + failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure +{ + + if ([urlRequest URL] == nil) { + [self cancelImageDownloadTask]; + self.image = placeholderImage; + return; + } + + if ([self isActiveTaskURLEqualToURLRequest:urlRequest]){ + return; + } + + [self cancelImageDownloadTask]; + + AFImageDownloader *downloader = [[self class] sharedImageDownloader]; + id imageCache = downloader.imageCache; + + //Use the image from the image cache if it exists + UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil]; + if (cachedImage) { + if (success) { + success(urlRequest, nil, cachedImage); + } else { + self.image = cachedImage; + } + [self clearActiveDownloadInformation]; + } else { + if (placeholderImage) { + self.image = placeholderImage; + } + + __weak __typeof(self)weakSelf = self; + NSUUID *downloadID = [NSUUID UUID]; + AFImageDownloadReceipt *receipt; + receipt = [downloader + downloadImageForURLRequest:urlRequest + withReceiptID:downloadID + success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) { + if (success) { + success(request, response, responseObject); + } else if(responseObject) { + strongSelf.image = responseObject; + } + [strongSelf clearActiveDownloadInformation]; + } + + } + failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) { + if (failure) { + failure(request, response, error); + } + [strongSelf clearActiveDownloadInformation]; + } + }]; + + self.af_activeImageDownloadReceipt = receipt; + } +} + +- (void)cancelImageDownloadTask { + if (self.af_activeImageDownloadReceipt != nil) { + [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:self.af_activeImageDownloadReceipt]; + [self clearActiveDownloadInformation]; + } +} + +- (void)clearActiveDownloadInformation { + self.af_activeImageDownloadReceipt = nil; +} + +- (BOOL)isActiveTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest { + return [self.af_activeImageDownloadReceipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString]; +} + +@end + +#endif diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h new file mode 100644 index 0000000..b36ee0c --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h @@ -0,0 +1,42 @@ +// UIKit+AFNetworking.h +// +// Copyright (c) 2013 AFNetworking (http://afnetworking.com/) +// +// 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. + +#if TARGET_OS_IOS || TARGET_OS_TV +#import + +#ifndef _UIKIT_AFNETWORKING_ + #define _UIKIT_AFNETWORKING_ + +#if TARGET_OS_IOS + #import "AFAutoPurgingImageCache.h" + #import "AFImageDownloader.h" + #import "AFNetworkActivityIndicatorManager.h" + #import "UIRefreshControl+AFNetworking.h" + #import "UIWebView+AFNetworking.h" +#endif + + #import "UIActivityIndicatorView+AFNetworking.h" + #import "UIButton+AFNetworking.h" + #import "UIImageView+AFNetworking.h" + #import "UIProgressView+AFNetworking.h" +#endif /* _UIKIT_AFNETWORKING_ */ +#endif diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h new file mode 100644 index 0000000..a0c463b --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h @@ -0,0 +1,64 @@ +// UIProgressView+AFNetworking.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import + +NS_ASSUME_NONNULL_BEGIN + + +/** + This category adds methods to the UIKit framework's `UIProgressView` class. The methods in this category provide support for binding the progress to the upload and download progress of a session task. + */ +@interface UIProgressView (AFNetworking) + +///------------------------------------ +/// @name Setting Session Task Progress +///------------------------------------ + +/** + Binds the progress to the upload progress of the specified session task. + + @param task The session task. + @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. + */ +- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task + animated:(BOOL)animated; + +/** + Binds the progress to the download progress of the specified session task. + + @param task The session task. + @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. + */ +- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task + animated:(BOOL)animated; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m new file mode 100644 index 0000000..6680bac --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m @@ -0,0 +1,118 @@ +// UIProgressView+AFNetworking.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "UIProgressView+AFNetworking.h" + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import "AFURLSessionManager.h" + +static void * AFTaskCountOfBytesSentContext = &AFTaskCountOfBytesSentContext; +static void * AFTaskCountOfBytesReceivedContext = &AFTaskCountOfBytesReceivedContext; + +#pragma mark - + +@implementation UIProgressView (AFNetworking) + +- (BOOL)af_uploadProgressAnimated { + return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_uploadProgressAnimated)) boolValue]; +} + +- (void)af_setUploadProgressAnimated:(BOOL)animated { + objc_setAssociatedObject(self, @selector(af_uploadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +- (BOOL)af_downloadProgressAnimated { + return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_downloadProgressAnimated)) boolValue]; +} + +- (void)af_setDownloadProgressAnimated:(BOOL)animated { + objc_setAssociatedObject(self, @selector(af_downloadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +#pragma mark - + +- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task + animated:(BOOL)animated +{ + [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext]; + [task addObserver:self forKeyPath:@"countOfBytesSent" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext]; + + [self af_setUploadProgressAnimated:animated]; +} + +- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task + animated:(BOOL)animated +{ + [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext]; + [task addObserver:self forKeyPath:@"countOfBytesReceived" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext]; + + [self af_setDownloadProgressAnimated:animated]; +} + +#pragma mark - NSKeyValueObserving + +- (void)observeValueForKeyPath:(NSString *)keyPath + ofObject:(id)object + change:(__unused NSDictionary *)change + context:(void *)context +{ + if (context == AFTaskCountOfBytesSentContext || context == AFTaskCountOfBytesReceivedContext) { + if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesSent))]) { + if ([object countOfBytesExpectedToSend] > 0) { + dispatch_async(dispatch_get_main_queue(), ^{ + [self setProgress:[object countOfBytesSent] / ([object countOfBytesExpectedToSend] * 1.0f) animated:self.af_uploadProgressAnimated]; + }); + } + } + + if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesReceived))]) { + if ([object countOfBytesExpectedToReceive] > 0) { + dispatch_async(dispatch_get_main_queue(), ^{ + [self setProgress:[object countOfBytesReceived] / ([object countOfBytesExpectedToReceive] * 1.0f) animated:self.af_downloadProgressAnimated]; + }); + } + } + + if ([keyPath isEqualToString:NSStringFromSelector(@selector(state))]) { + if ([(NSURLSessionTask *)object state] == NSURLSessionTaskStateCompleted) { + @try { + [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(state))]; + + if (context == AFTaskCountOfBytesSentContext) { + [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesSent))]; + } + + if (context == AFTaskCountOfBytesReceivedContext) { + [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesReceived))]; + } + } + @catch (NSException * __unused exception) {} + } + } + } +} + +@end + +#endif diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h new file mode 100644 index 0000000..f6930a9 --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h @@ -0,0 +1,53 @@ +// UIRefreshControl+AFNetworking.m +// +// Copyright (c) 2014 AFNetworking (http://afnetworking.com) +// +// 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. + +#import + +#import + +#if TARGET_OS_IOS + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically beginning and ending refreshing depending on the loading state of a session task. + */ +@interface UIRefreshControl (AFNetworking) + +///----------------------------------- +/// @name Refreshing for Session Tasks +///----------------------------------- + +/** + Binds the refreshing state to the state of the specified task. + + @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. + */ +- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m new file mode 100644 index 0000000..ddc033b --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m @@ -0,0 +1,122 @@ +// UIRefreshControl+AFNetworking.m +// +// Copyright (c) 2014 AFNetworking (http://afnetworking.com) +// +// 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. + +#import "UIRefreshControl+AFNetworking.h" +#import + +#if TARGET_OS_IOS + +#import "AFURLSessionManager.h" + +@interface AFRefreshControlNotificationObserver : NSObject +@property (readonly, nonatomic, weak) UIRefreshControl *refreshControl; +- (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl; + +- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; + +@end + +@implementation UIRefreshControl (AFNetworking) + +- (AFRefreshControlNotificationObserver *)af_notificationObserver { + AFRefreshControlNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver)); + if (notificationObserver == nil) { + notificationObserver = [[AFRefreshControlNotificationObserver alloc] initWithActivityRefreshControl:self]; + objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + } + return notificationObserver; +} + +- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task { + [[self af_notificationObserver] setRefreshingWithStateOfTask:task]; +} + +@end + +@implementation AFRefreshControlNotificationObserver + +- (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl +{ + self = [super init]; + if (self) { + _refreshControl = refreshControl; + } + return self; +} + +- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task { + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + + [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; + + if (task) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreceiver-is-weak" +#pragma clang diagnostic ignored "-Warc-repeated-use-of-weak" + if (task.state == NSURLSessionTaskStateRunning) { + [self.refreshControl beginRefreshing]; + + [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingTaskDidResumeNotification object:task]; + [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidCompleteNotification object:task]; + [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidSuspendNotification object:task]; + } else { + [self.refreshControl endRefreshing]; + } +#pragma clang diagnostic pop + } +} + +#pragma mark - + +- (void)af_beginRefreshing { + dispatch_async(dispatch_get_main_queue(), ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreceiver-is-weak" + [self.refreshControl beginRefreshing]; +#pragma clang diagnostic pop + }); +} + +- (void)af_endRefreshing { + dispatch_async(dispatch_get_main_queue(), ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreceiver-is-weak" + [self.refreshControl endRefreshing]; +#pragma clang diagnostic pop + }); +} + +#pragma mark - + +- (void)dealloc { + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + + [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; +} + +@end + +#endif diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h new file mode 100644 index 0000000..777dce2 --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h @@ -0,0 +1,80 @@ +// UIWebView+AFNetworking.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#import + +#if TARGET_OS_IOS + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class AFHTTPSessionManager; + +/** + This category adds methods to the UIKit framework's `UIWebView` class. The methods in this category provide increased control over the request cycle, including progress monitoring and success / failure handling. + + @discussion When using these category methods, make sure to assign `delegate` for the web view, which implements `–webView:shouldStartLoadWithRequest:navigationType:` appropriately. This allows for tapped links to be loaded through AFNetworking, and can ensure that `canGoBack` & `canGoForward` update their values correctly. + */ +@interface UIWebView (AFNetworking) + +/** + The session manager used to download all requests. + */ +@property (nonatomic, strong) AFHTTPSessionManager *sessionManager; + +/** + Asynchronously loads the specified request. + + @param request A URL request identifying the location of the content to load. This must not be `nil`. + @param progress A progress object monitoring the current download progress. + @param success A block object to be executed when the request finishes loading successfully. This block returns the HTML string to be loaded by the web view, and takes two arguments: the response, and the response string. + @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. + */ +- (void)loadRequest:(NSURLRequest *)request + progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress + success:(nullable NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success + failure:(nullable void (^)(NSError *error))failure; + +/** + Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding. + + @param request A URL request identifying the location of the content to load. This must not be `nil`. + @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified. + @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified. +@param progress A progress object monitoring the current download progress. + @param success A block object to be executed when the request finishes loading successfully. This block returns the data to be loaded by the web view and takes two arguments: the response, and the downloaded data. + @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. + */ +- (void)loadRequest:(NSURLRequest *)request + MIMEType:(nullable NSString *)MIMEType + textEncodingName:(nullable NSString *)textEncodingName + progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress + success:(nullable NSData * (^)(NSHTTPURLResponse *response, NSData *data))success + failure:(nullable void (^)(NSError *error))failure; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m new file mode 100644 index 0000000..ac089da --- /dev/null +++ b/grocery-objc/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m @@ -0,0 +1,160 @@ +// UIWebView+AFNetworking.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "UIWebView+AFNetworking.h" + +#import + +#if TARGET_OS_IOS + +#import "AFHTTPSessionManager.h" +#import "AFURLResponseSerialization.h" +#import "AFURLRequestSerialization.h" + +@interface UIWebView (_AFNetworking) +@property (readwrite, nonatomic, strong, setter = af_setURLSessionTask:) NSURLSessionDataTask *af_URLSessionTask; +@end + +@implementation UIWebView (_AFNetworking) + +- (NSURLSessionDataTask *)af_URLSessionTask { + return (NSURLSessionDataTask *)objc_getAssociatedObject(self, @selector(af_URLSessionTask)); +} + +- (void)af_setURLSessionTask:(NSURLSessionDataTask *)af_URLSessionTask { + objc_setAssociatedObject(self, @selector(af_URLSessionTask), af_URLSessionTask, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +@end + +#pragma mark - + +@implementation UIWebView (AFNetworking) + +- (AFHTTPSessionManager *)sessionManager { + static AFHTTPSessionManager *_af_defaultHTTPSessionManager = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _af_defaultHTTPSessionManager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]]; + _af_defaultHTTPSessionManager.requestSerializer = [AFHTTPRequestSerializer serializer]; + _af_defaultHTTPSessionManager.responseSerializer = [AFHTTPResponseSerializer serializer]; + }); + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + return objc_getAssociatedObject(self, @selector(sessionManager)) ?: _af_defaultHTTPSessionManager; +#pragma clang diagnostic pop +} + +- (void)setSessionManager:(AFHTTPSessionManager *)sessionManager { + objc_setAssociatedObject(self, @selector(sessionManager), sessionManager, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +- (AFHTTPResponseSerializer *)responseSerializer { + static AFHTTPResponseSerializer *_af_defaultResponseSerializer = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _af_defaultResponseSerializer = [AFHTTPResponseSerializer serializer]; + }); + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + return objc_getAssociatedObject(self, @selector(responseSerializer)) ?: _af_defaultResponseSerializer; +#pragma clang diagnostic pop +} + +- (void)setResponseSerializer:(AFHTTPResponseSerializer *)responseSerializer { + objc_setAssociatedObject(self, @selector(responseSerializer), responseSerializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +#pragma mark - + +- (void)loadRequest:(NSURLRequest *)request + progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress + success:(NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success + failure:(void (^)(NSError *error))failure +{ + [self loadRequest:request MIMEType:nil textEncodingName:nil progress:progress success:^NSData *(NSHTTPURLResponse *response, NSData *data) { + NSStringEncoding stringEncoding = NSUTF8StringEncoding; + if (response.textEncodingName) { + CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName); + if (encoding != kCFStringEncodingInvalidId) { + stringEncoding = CFStringConvertEncodingToNSStringEncoding(encoding); + } + } + + NSString *string = [[NSString alloc] initWithData:data encoding:stringEncoding]; + if (success) { + string = success(response, string); + } + + return [string dataUsingEncoding:stringEncoding]; + } failure:failure]; +} + +- (void)loadRequest:(NSURLRequest *)request + MIMEType:(NSString *)MIMEType + textEncodingName:(NSString *)textEncodingName + progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress + success:(NSData * (^)(NSHTTPURLResponse *response, NSData *data))success + failure:(void (^)(NSError *error))failure +{ + NSParameterAssert(request); + + if (self.af_URLSessionTask.state == NSURLSessionTaskStateRunning || self.af_URLSessionTask.state == NSURLSessionTaskStateSuspended) { + [self.af_URLSessionTask cancel]; + } + self.af_URLSessionTask = nil; + + __weak __typeof(self)weakSelf = self; + NSURLSessionDataTask *dataTask; + dataTask = [self.sessionManager + GET:request.URL.absoluteString + parameters:nil + progress:nil + success:^(NSURLSessionDataTask * _Nonnull task, id _Nonnull responseObject) { + __strong __typeof(weakSelf) strongSelf = weakSelf; + if (success) { + success((NSHTTPURLResponse *)task.response, responseObject); + } + [strongSelf loadData:responseObject MIMEType:MIMEType textEncodingName:textEncodingName baseURL:[task.currentRequest URL]]; + + if ([strongSelf.delegate respondsToSelector:@selector(webViewDidStartLoad:)]) { + [strongSelf.delegate webViewDidFinishLoad:strongSelf]; + } + } + failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) { + if (failure) { + failure(error); + } + }]; + self.af_URLSessionTask = dataTask; + *progress = [self.sessionManager downloadProgressForTask:dataTask]; + [self.af_URLSessionTask resume]; + + if ([self.delegate respondsToSelector:@selector(webViewDidStartLoad:)]) { + [self.delegate webViewDidStartLoad:self]; + } +} + +@end + +#endif \ No newline at end of file diff --git a/grocery-objc/Pods/Firebase/Empty.m b/grocery-objc/Pods/Firebase/Empty.m new file mode 100644 index 0000000..e69de29 diff --git a/grocery-objc/Pods/Firebase/FAuthData.h b/grocery-objc/Pods/Firebase/FAuthData.h new file mode 100644 index 0000000..0ef1d85 --- /dev/null +++ b/grocery-objc/Pods/Firebase/FAuthData.h @@ -0,0 +1,54 @@ +// +// FAuthData.h +// Firebase +// +// Created by Katherine Fang on 7/30/14. +// + +#import "FAuthType.h" + + +/** +* The FAuthData class is a wrapper around the user metadata returned from the Firebase auth server. +* It includes the provider authenticated against, a uid (with the possible exception of authenticating against a custom +* backend), and a token used to authenticate with Firebase. +* +* It may include other metadata about the user, depending on the provider used to do the authentication. +*/ +@interface FAuthData : NSObject + +/** +* @return Raw authentication token payload returned by the server +*/ +@property (nonatomic, strong, readonly) NSDictionary *auth; + +/** + * @return Authentication token expiration timestamp (seconds since epoch) returned by the server + */ +@property (nonatomic, strong, readonly) NSNumber *expires; + +/** +* @return A uid for this user. It is unique across all auth providers. +*/ +@property (nonatomic, strong, readonly) NSString *uid; + + +/** +* @return The provider that authenticated this user +*/ +@property (nonatomic, readonly) NSString *provider; + + +/** +* @return The token that was used to authenticate this user with Firebase +*/ +@property (nonatomic, strong, readonly) NSString *token; + + +/** +* @return Provider data keyed by provider. Includes cached data from third-party providers +*/ +@property (nonatomic, strong, readonly) NSDictionary *providerData; + + +@end diff --git a/grocery-objc/Pods/Firebase/FAuthType.h b/grocery-objc/Pods/Firebase/FAuthType.h new file mode 100644 index 0000000..0f772b1 --- /dev/null +++ b/grocery-objc/Pods/Firebase/FAuthType.h @@ -0,0 +1,41 @@ +// +// FAuthType.h +// Firebase +// +// Created by Katherine Fang on 7/30/14. +// +// All public-facing auth enums. +// + +#ifndef Firebase_FAuthenticationTypes_h +#define Firebase_FAuthenticationTypes_h + +typedef NS_ENUM(NSInteger, FAuthenticationError) { + // Developer / Config Errors + FAuthenticationErrorProviderDisabled = -1, + FAuthenticationErrorInvalidConfiguration = -2, + FAuthenticationErrorInvalidOrigin = -3, + FAuthenticationErrorInvalidProvider = -4, + + // User Errors (Email / Password) + FAuthenticationErrorInvalidEmail = -5, + FAuthenticationErrorInvalidPassword = -6, + FAuthenticationErrorInvalidToken = -7, + FAuthenticationErrorUserDoesNotExist = -8, + FAuthenticationErrorEmailTaken = -9, + + // User Errors (Facebook / Twitter / Github / Google) + FAuthenticationErrorDeniedByUser = -10, + FAuthenticationErrorInvalidCredentials = -11, + FAuthenticationErrorInvalidArguments = -12, + FAuthenticationErrorProviderError = -13, + FAuthenticationErrorLimitsExceeded = -14, + + // Client side errors + FAuthenticationErrorNetworkError = -15, + FAuthenticationErrorPreempted = -16, + + FAuthenticationErrorUnknown = -9999 +}; + +#endif \ No newline at end of file diff --git a/grocery-objc/Pods/Firebase/FConfig.h b/grocery-objc/Pods/Firebase/FConfig.h new file mode 100644 index 0000000..dcfdefa --- /dev/null +++ b/grocery-objc/Pods/Firebase/FConfig.h @@ -0,0 +1,69 @@ +/* + * Firebase iOS Client Library + * + * Copyright © 2015 Firebase - All Rights Reserved + * https://www.firebase.com + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binaryform must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY FIREBASE AS IS AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL FIREBASE BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +/** + * Configuration object for Firebase. You can get the default FConfig object via + * `[Firebase defaultConfig]` and modify it. You must make all changes to it before + * you create your first Firebase instance. + */ +@interface FConfig : NSObject + +/** + * By default the Firebase client will keep data in memory while your application is running, but not + * when it is restarted. By setting this value to YES, the data will be persisted to on-device (disk) + * storage and will thus be available again when the app is restarted (even when there is no network + * connectivity at that time). Note that this property must be set before creating your first Firebase + * reference and only needs to be called once per application. + * + * If your app uses Firebase Authentication, the client will automatically persist the user's authentication + * token across restarts, even without persistence enabled. But if the auth token expired while offline and + * you've enabled persistence, the client will pause write operations until you successfully re-authenticate + * (or explicitly unauthenticate) to prevent your writes from being sent unauthenticated and failing due to + * security rules. + */ +@property (nonatomic) BOOL persistenceEnabled; + +/** + * By default Firebase will use up to 10MB of disk space to cache data. If the cache grows beyond this size, + * Firebase will start removing data that hasn't been recently used. If you find that your application caches too + * little or too much data, call this method to change the cache size. This property must be set before creating + * your first Firebase reference and only needs to be called once per application. + * + * Note that the specified cache size is only an approximation and the size on disk may temporarily exceed it + * at times. + */ +@property (nonatomic) NSUInteger persistenceCacheSizeBytes; + +/** + * Sets the dispatch queue on which all events are raised. The default queue is the main queue. + */ +@property (nonatomic, strong) dispatch_queue_t callbackQueue; + +@end diff --git a/grocery-objc/Pods/Firebase/FDataSnapshot.h b/grocery-objc/Pods/Firebase/FDataSnapshot.h new file mode 100644 index 0000000..fc794ac --- /dev/null +++ b/grocery-objc/Pods/Firebase/FDataSnapshot.h @@ -0,0 +1,154 @@ +/* + * Firebase iOS Client Library + * + * Copyright © 2013 Firebase - All Rights Reserved + * https://www.firebase.com + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binaryform must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY FIREBASE AS IS AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL FIREBASE BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +@class Firebase; + +/** + * An FDataSnapshot contains data from a Firebase location. Any time you read + * Firebase data, you receive the data as an FDataSnapshot. + * + * FDataSnapshots are passed to the blocks you attach with observeEventType:withBlock: or observeSingleEvent:withBlock:. + * They are efficiently-generated immutable copies of the data at a Firebase location. + * They can't be modified and will never change. To modify data at a location, + * use a Firebase reference (e.g. with setValue:). + */ +@interface FDataSnapshot : NSObject + + +/** @name Navigating and inspecting a snapshot */ + +/** + * Get an FDataSnapshot for the location at the specified relative path. + * The relative path can either be a simple child key (e.g. 'fred') + * or a deeper slash-separated path (e.g. 'fred/name/first'). If the child + * location has no data, an empty FDataSnapshot is returned. + * + * @param childPathString A relative path to the location of child data. + * @return The FDataSnapshot for the child location. + */ +- (FDataSnapshot *) childSnapshotForPath:(NSString *)childPathString; + + +/** + * Return YES if the specified child exists. + * + * @param childPathString A relative path to the location of a potential child. + * @return YES if data exists at the specified childPathString, else false. + */ +- (BOOL) hasChild:(NSString *)childPathString; + + +/** + * Return YES if the DataSnapshot has any children. + * + * @return YES if this snapshot has any children, else NO. + */ +- (BOOL) hasChildren; + + +/** + * Return YES if the DataSnapshot contains a non-null value. + * + * @return YES if this snapshot contains a non-null value, otherwise NO. + */ +- (BOOL) exists; + + +/** @name Data export */ + +/** + * Returns the raw value at this location, coupled with any metadata, such as priority. + * + * Priorities, where they exist, are accessible under the ".priority" key in instances of NSDictionary. + * For leaf locations with priorities, the value will be under the ".value" key. + */ +- (id) valueInExportFormat; + + +/** @name Properties */ + +/** + * Returns the contents of this data snapshot as native types. + * + * Data types returned: + * * NSDictionary + * * NSArray + * * NSNumber (also includes booleans) + * * NSString + * + * @return The data as a native object. + */ +@property (strong, readonly, nonatomic) id value; + + +/** + * Get the number of children for this DataSnapshot. + * + * @return An integer indicating the number of children. + */ +@property (readonly, nonatomic) NSUInteger childrenCount; + + +/** + * Get a Firebase reference for the location that this data came from + * + * @return A Firebase instance for the location of this data + */ +@property (nonatomic, readonly, strong) Firebase* ref; + + +/** + * The key of the location that generated this FDataSnapshot. + * + * @return An NSString containing the key for the location of this FDataSnapshot. + */ +@property (strong, readonly, nonatomic) NSString* key; + + +/** + * An iterator for snapshots of the child nodes in this snapshot. + * You can use the native for..in syntax: + * + * for (FDataSnapshot* child in snapshot.children) { + * ... + * } + * + * @return An NSEnumerator of the children + */ +@property (strong, readonly, nonatomic) NSEnumerator* children; + +/** + * The priority of the data in this FDataSnapshot. + * + * @return The priority as a string, or nil if no priority was set. + */ +@property (strong, readonly, nonatomic) id priority; + +@end diff --git a/grocery-objc/Pods/Firebase/FEventType.h b/grocery-objc/Pods/Firebase/FEventType.h new file mode 100644 index 0000000..6d672bd --- /dev/null +++ b/grocery-objc/Pods/Firebase/FEventType.h @@ -0,0 +1,43 @@ +/* + * Firebase iOS Client Library + * + * Copyright © 2013 Firebase - All Rights Reserved + * https://www.firebase.com + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binaryform must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY FIREBASE AS IS AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL FIREBASE BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef Firebase_FEventType_h +#define Firebase_FEventType_h + +/** + * This enum is the set of events that you can observe at a Firebase location. + */ +typedef NS_ENUM(NSInteger, FEventType) { + FEventTypeChildAdded, // 0, fired when a new child node is added to a location + FEventTypeChildRemoved, // 1, fired when a child node is removed from a location + FEventTypeChildChanged, // 2, fired when a child node at a location changes + FEventTypeChildMoved, // 3, fired when a child node moves relative to the other child nodes at a location + FEventTypeValue // 4, fired when any data changes at a location and, recursively, any children +}; + +#endif diff --git a/grocery-objc/Pods/Firebase/FMutableData.h b/grocery-objc/Pods/Firebase/FMutableData.h new file mode 100644 index 0000000..4dbefca --- /dev/null +++ b/grocery-objc/Pods/Firebase/FMutableData.h @@ -0,0 +1,143 @@ +/* + * Firebase iOS Client Library + * + * Copyright © 2013 Firebase - All Rights Reserved + * https://www.firebase.com + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binaryform must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY FIREBASE AS IS AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL FIREBASE BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +/** + * An FMutableData instance is populated with data from a Firebase location. + * When you are using runTransactionBlock:, you will be given an instance containing the current + * data at that location. Your block will be responsible for updating that instance to the data + * you wish to save at that location, and then returning using [FTransactionResult successWithValue:]. + * + * To modify the data, set its value property to any of the native types support by Firebase: + * * NSNumber (includes BOOL) + * * NSDictionary + * * NSArray + * * NSString + * * nil / NSNull to remove the data + * + * Note that changes made to a child FMutableData instance will be visible to the parent. + */ +@interface FMutableData : NSObject + + +/** @name Inspecting and navigating the data */ + + +/** + * Returns boolean indicating whether this mutable data has children. + * + * @return YES if this data contains child nodes. + */ +- (BOOL) hasChildren; + + +/** + * Indicates whether this mutable data has a child at the given path. + * + * @param path A path string, consisting either of a single segment, like 'child', or multiple segments, 'a/deeper/child' + * @return YES if this data contains a child at the specified relative path + */ +- (BOOL) hasChildAtPath:(NSString *)path; + + +/** + * Used to obtain an FMutableData instance that encapsulates the data at the given relative path. + * Note that changes made to the child will be visible to the parent. + * + * @param path A path string, consisting either of a single segment, like 'child', or multiple segments, 'a/deeper/child' + * @return An FMutableData instance containing the data at the given path + */ +- (FMutableData *) childDataByAppendingPath:(NSString *)path; + + +/** @name Properties */ + + +/** + * This method is deprecated. + * + * @return An FMutableData instance containing the data at the parent location, or nil if this is the top-most location + */ +@property (strong, readonly, nonatomic) FMutableData* parent __attribute__((deprecated("Deprecated. Do not use.")));; + + +/** + * To modify the data contained by this instance of FMutableData, set this to any of the native types support by Firebase: + * + * * NSNumber (includes BOOL) + * * NSDictionary + * * NSArray + * * NSString + * * nil / NSNull to remove the data + * + * Note that setting the value will override the priority at this location. + * + * @return The current data at this location as a native object + */ +@property (strong, nonatomic) id value; + + +/** + * Set this property to update the priority of the data at this location. Can be set to the following types: + * + * * NSNumber + * * NSString + * * nil / NSNull to remove the priority + * + * @return The priority of the data at this location + */ +@property (strong, nonatomic) id priority; + + +/** + * @return The number of child nodes at this location + */ +@property (readonly, nonatomic) NSUInteger childrenCount; + + +/** + * Used to iterate over the children at this location. You can use the native for .. in syntax: + * + * for (FMutableData* child in data.children) { + * ... + * } + * + * Note that this enumerator operates on an immutable copy of the child list. So, you can modify the instance + * during iteration, but the new additions will not be visible until you get a new enumerator. + */ +@property (readonly, nonatomic, strong) NSEnumerator* children; + + +/** + * @return The key name of this node, or nil if it is the top-most location + */ +@property (readonly, nonatomic, strong) NSString* key; + + +@end diff --git a/grocery-objc/Pods/Firebase/FQuery.h b/grocery-objc/Pods/Firebase/FQuery.h new file mode 100644 index 0000000..f2588b9 --- /dev/null +++ b/grocery-objc/Pods/Firebase/FQuery.h @@ -0,0 +1,412 @@ +/* + * Firebase iOS Client Library + * + * Copyright © 2013 Firebase - All Rights Reserved + * https://www.firebase.com + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binaryform must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY FIREBASE AS IS AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL FIREBASE BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import +#import "FEventType.h" +#import "FDataSnapshot.h" + +typedef NSUInteger FirebaseHandle; + +/** + * An FQuery instance represents a query over the data at a particular location. + * + * You create one by calling one of the query methods (queryStartingAtPriority:, queryEndingAtPriority:, etc.) + * on a Firebase reference. The query methods can be chained to further specify the data you are interested in + * observing + */ +@interface FQuery : NSObject + + +/** @name Attaching observers to read data */ + +/** + * observeEventType:withBlock: is used to listen for data changes at a particular location. + * This is the primary way to read data from Firebase. Your block will be triggered + * for the initial data and again whenever the data changes. + * + * Use removeObserverWithHandle: to stop receiving updates. + * @param eventType The type of event to listen for. + * @param block The block that should be called with initial data and updates. It is passed the data as an FDataSnapshot. + * @return A handle used to unregister this block later using removeObserverWithHandle: + */ +- (FirebaseHandle) observeEventType:(FEventType)eventType withBlock:(void (^)(FDataSnapshot* snapshot))block; + + +/** + * observeEventType:andPreviousSiblingKeyWithBlock: is used to listen for data changes at a particular location. + * This is the primary way to read data from Firebase. Your block will be triggered + * for the initial data and again whenever the data changes. In addition, for FEventTypeChildAdded, FEventTypeChildMoved, and + * FEventTypeChildChanged events, your block will be passed the key of the previous node by priority order. + * + * Use removeObserverWithHandle: to stop receiving updates. + * + * @param eventType The type of event to listen for. + * @param block The block that should be called with initial data and updates. It is passed the data as an FDataSnapshot + * and the previous child's key. + * @return A handle used to unregister this block later using removeObserverWithHandle: + */ +- (FirebaseHandle) observeEventType:(FEventType)eventType andPreviousSiblingKeyWithBlock:(void (^)(FDataSnapshot* snapshot, NSString* prevKey))block; + + +/** + * observeEventType:withBlock: is used to listen for data changes at a particular location. + * This is the primary way to read data from Firebase. Your block will be triggered + * for the initial data and again whenever the data changes. + * + * The cancelBlock will be called if you will no longer receive new events due to no longer having permission. + * + * Use removeObserverWithHandle: to stop receiving updates. + * + * @param eventType The type of event to listen for. + * @param block The block that should be called with initial data and updates. It is passed the data as an FDataSnapshot. + * @param cancelBlock The block that should be called if this client no longer has permission to receive these events + * @return A handle used to unregister this block later using removeObserverWithHandle: + */ +- (FirebaseHandle) observeEventType:(FEventType)eventType withBlock:(void (^)(FDataSnapshot* snapshot))block withCancelBlock:(void (^)(NSError* error))cancelBlock; + + +/** + * observeEventType:andPreviousSiblingKeyWithBlock: is used to listen for data changes at a particular location. + * This is the primary way to read data from Firebase. Your block will be triggered + * for the initial data and again whenever the data changes. In addition, for FEventTypeChildAdded, FEventTypeChildMoved, and + * FEventTypeChildChanged events, your block will be passed the key of the previous node by priority order. + * + * The cancelBlock will be called if you will no longer receive new events due to no longer having permission. + * + * Use removeObserverWithHandle: to stop receiving updates. + * + * @param eventType The type of event to listen for. + * @param block The block that should be called with initial data and updates. It is passed the data as an FDataSnapshot + * and the previous child's key. + * @param cancelBlock The block that should be called if this client no longer has permission to receive these events + * @return A handle used to unregister this block later using removeObserverWithHandle: + */ +- (FirebaseHandle) observeEventType:(FEventType)eventType andPreviousSiblingKeyWithBlock:(void (^)(FDataSnapshot* snapshot, NSString* prevKey))block withCancelBlock:(void (^)(NSError* error))cancelBlock; + + +/** + * This is equivalent to observeEventType:withBlock:, except the block is immediately canceled after the initial data is returned. + * + * @param eventType The type of event to listen for. + * @param block The block that should be called. It is passed the data as an FDataSnapshot. + */ +- (void) observeSingleEventOfType:(FEventType)eventType withBlock:(void (^)(FDataSnapshot* snapshot))block; + + +/** + * This is equivalent to observeEventType:withBlock:, except the block is immediately canceled after the initial data is returned. In addition, for FEventTypeChildAdded, FEventTypeChildMoved, and + * FEventTypeChildChanged events, your block will be passed the key of the previous node by priority order. + * + * @param eventType The type of event to listen for. + * @param block The block that should be called. It is passed the data as an FDataSnapshot and the previous child's key. + */ +- (void) observeSingleEventOfType:(FEventType)eventType andPreviousSiblingKeyWithBlock:(void (^)(FDataSnapshot* snapshot, NSString* prevKey))block; + + +/** + * This is equivalent to observeEventType:withBlock:, except the block is immediately canceled after the initial data is returned. + * + * The cancelBlock will be called if you do not have permission to read data at this location. + * + * @param eventType The type of event to listen for. + * @param block The block that should be called. It is passed the data as an FDataSnapshot. + * @param cancelBlock The block that will be called if you don't have permission to access this data + */ +- (void) observeSingleEventOfType:(FEventType)eventType withBlock:(void (^)(FDataSnapshot* snapshot))block withCancelBlock:(void (^)(NSError* error))cancelBlock; + + +/** + * This is equivalent to observeEventType:withBlock:, except the block is immediately canceled after the initial data is returned. In addition, for FEventTypeChildAdded, FEventTypeChildMoved, and + * FEventTypeChildChanged events, your block will be passed the key of the previous node by priority order. + * + * The cancelBlock will be called if you do not have permission to read data at this location. + * + * @param eventType The type of event to listen for. + * @param block The block that should be called. It is passed the data as an FDataSnapshot and the previous child's key. + * @param cancelBlock The block that will be called if you don't have permission to access this data + */ +- (void) observeSingleEventOfType:(FEventType)eventType andPreviousSiblingKeyWithBlock:(void (^)(FDataSnapshot* snapshot, NSString* prevKey))block withCancelBlock:(void (^)(NSError* error))cancelBlock; + +/** @name Detaching observers */ + +/** + * Detach a block previously attached with observeEventType:withBlock:. + * + * @param handle The handle returned by the call to observeEventType:withBlock: which we are trying to remove. + */ +- (void) removeObserverWithHandle:(FirebaseHandle)handle; + + +/** + * Detach all blocks previously attached to this Firebase location with observeEventType:withBlock: + */ +- (void) removeAllObservers; + +/** + * By calling `keepSynced:YES` on a location, the data for that location will automatically be downloaded and + * kept in sync, even when no listeners are attached for that location. Additionally, while a location is kept + * synced, it will not be evicted from the persistent disk cache. + * + * @param keepSynced Pass YES to keep this location synchronized, pass NO to stop synchronization. +*/ + - (void) keepSynced:(BOOL)keepSynced; + + +/** @name Querying and limiting */ + + +/** +* This method is deprecated in favor of using queryStartingAtValue:. This can be used with queryOrderedByPriority +* to query by priority. +* + * queryStartingAtPriority: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryStartingAtPriority: will respond to events at nodes with a priority + * greater than or equal to startPriority + * + * @param startPriority The lower bound, inclusive, for the priority of data visible to the returned FQuery + * @return An FQuery instance, limited to data with priority greater than or equal to startPriority + */ +- (FQuery *) queryStartingAtPriority:(id)startPriority __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryStartingAtValue:] instead"))); + + +/** +* This method is deprecated in favor of using queryStartingAtValue:childKey:. This can be used with queryOrderedByPriority +* to query by priority. +* + * queryStartingAtPriority:andChildName: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryStartingAtPriority:andChildName will respond to events at nodes with a priority + * greater than startPriority, or equal to startPriority and with a name greater than or equal to childName + * + * @param startPriority The lower bound, inclusive, for the priority of data visible to the returned FQuery + * @param childName The lower bound, inclusive, for the name of nodes with priority equal to startPriority + * @return An FQuery instance, limited to data with priority greater than or equal to startPriority + */ +- (FQuery *) queryStartingAtPriority:(id)startPriority andChildName:(NSString *)childName __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryStartingAtValue:childKey:] instead"))); + +/** +* This method is deprecated in favor of using queryEndingAtValue:. This can be used with queryOrderedByPriority +* to query by priority. +* + * queryEndingAtPriority: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryEndingAtPriority: will respond to events at nodes with a priority + * less than or equal to startPriority and with a name greater than or equal to childName + * + * @param endPriority The upper bound, inclusive, for the priority of data visible to the returned FQuery + * @return An FQuery instance, limited to data with priority less than or equal to endPriority + */ +- (FQuery *) queryEndingAtPriority:(id)endPriority __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryEndingAtValue:] instead"))); + + +/** +* This method is deprecated in favor of using queryEndingAtValue:childKey:. This can be used with queryOrderedByPriority +* to query by priority. +* + * queryEndingAtPriority:andChildName: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryEndingAtPriority:andChildName will respond to events at nodes with a priority + * less than endPriority, or equal to endPriority and with a name less than or equal to childName + * + * @param endPriority The upper bound, inclusive, for the priority of data visible to the returned FQuery + * @param childName The upper bound, inclusive, for the name of nodes with priority equal to endPriority + * @return An FQuery instance, limited to data with priority less than endPriority or equal to endPriority and with a name less than or equal to childName + */ +- (FQuery *) queryEndingAtPriority:(id)endPriority andChildName:(NSString *)childName __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryEndingAtValue:childKey:] instead"))); + + +/** +* This method is deprecated in favor of using queryEqualToValue:. This can be used with queryOrderedByPriority +* to query by priority. +* +* queryEqualToPriority: is used to generate a reference to a limited view of the data at this location. +* The FQuery instance returned by queryEqualToPriority: will respond to events at nodes with a priority equal to +* supplied argument. +* +* @param priority The priority that the data returned by this FQuery will have +* @return An Fquery instance, limited to data with the supplied priority. +*/ +- (FQuery *) queryEqualToPriority:(id)priority __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryEqualToValue:] instead"))); + + +/** +* This method is deprecated in favor of using queryEqualAtValue:childKey:. This can be used with queryOrderedByPriority +* to query by priority. +* +* queryEqualToPriority:andChildName: is used to generate a reference to a limited view of the data at this location. +* The FQuery instance returned by queryEqualToPriority:andChildName will respond to events at nodes with a priority +* equal to the supplied argument with a name equal to childName. There will be at most one node that matches because +* child names are unique. +* +* @param priority The priority that the data returned by this FQuery will have +* @param childName The name of nodes with the right priority +* @return An FQuery instance, limited to data with the supplied priority and the name. +*/ +- (FQuery *) queryEqualToPriority:(id)priority andChildName:(NSString *)childName __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryEqualToValue:childKey:] instead"))); + +/** + * This method is deprecated in favor of using queryLimitedToFirst:limit or queryLimitedToLast:limit instead. + * + * queryLimitedToNumberOfChildren: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryLimitedToNumberOfChildren: will respond to events from at most limit child nodes. + * + * @param limit The upper bound, inclusive, for the number of child nodes to receive events for + * @return An FQuery instance, limited to at most limit child nodes. + */ +- (FQuery *) queryLimitedToNumberOfChildren:(NSUInteger)limit __attribute__((deprecated("Use [FQuery queryLimitedToFirst:limit] or [FQuery queryLimitedToLast:limit] instead"))); + + +/** +* queryLimitedToFirst: is used to generate a reference to a limited view of the data at this location. +* The FQuery instance returned by queryLimitedToFirst: will respond to at most the first limit child nodes. +* +* @param limit The upper bound, inclusive, for the number of child nodes to receive events for +* @return An FQuery instance, limited to at most limit child nodes. +*/ +- (FQuery *) queryLimitedToFirst:(NSUInteger)limit; + + +/** +* queryLimitedToLast: is used to generate a reference to a limited view of the data at this location. +* The FQuery instance returned by queryLimitedToLast: will respond to at most the last limit child nodes. +* +* @param limit The upper bound, inclusive, for the number of child nodes to receive events for +* @return An FQuery instance, limited to at most limit child nodes. +*/ +- (FQuery *) queryLimitedToLast:(NSUInteger)limit; + +/** +* queryOrderBy: is used to generate a reference to a view of the data that's been sorted by the values of +* a particular child key. This method is intended to be used in combination with queryStartingAtValue:, +* queryEndingAtValue:, or queryEqualToValue:. +* + * @param key The child key to use in ordering data visible to the returned FQuery + * @return An FQuery instance, ordered by the values of the specified child key. +*/ +- (FQuery *) queryOrderedByChild:(NSString *)key; + +/** + * queryOrderedByKey: is used to generate a reference to a view of the data that's been sorted by child key. + * This method is intended to be used in combination with queryStartingAtValue:, queryEndingAtValue:, + * or queryEqualToValue:. + * + * @return An FQuery instance, ordered by child keys. + */ +- (FQuery *) queryOrderedByKey; + +/** + * queryOrderedByValue: is used to generate a reference to a view of the data that's been sorted by child value. + * This method is intended to be used in combination with queryStartingAtValue:, queryEndingAtValue:, + * or queryEqualToValue:. + * + * @return An FQuery instance, ordered by child value. + */ +- (FQuery *) queryOrderedByValue; + +/** + * queryOrderedByPriority: is used to generate a reference to a view of the data that's been sorted by child + * priority. This method is intended to be used in combination with queryStartingAtValue:, queryEndingAtValue:, + * or queryEqualToValue:. + * + * @return An FQuery instance, ordered by child priorities. + */ +- (FQuery *) queryOrderedByPriority; + +/** + * queryStartingAtValue: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryStartingAtValue: will respond to events at nodes with a value + * greater than or equal to startValue. + * + * @param startValue The lower bound, inclusive, for the value of data visible to the returned FQuery + * @return An FQuery instance, limited to data with value greater than or equal to startValue + */ +- (FQuery *) queryStartingAtValue:(id)startValue; + +/** + * queryStartingAtValue:childKey: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryStartingAtValue:childKey will respond to events at nodes with a value + * greater than startValue, or equal to startValue and with a key greater than or equal to childKey. + * + * @param startValue The lower bound, inclusive, for the value of data visible to the returned FQuery + * @param childKey The lower bound, inclusive, for the key of nodes with value equal to startValue + * @return An FQuery instance, limited to data with value greater than or equal to startValue + */ +- (FQuery *) queryStartingAtValue:(id)startValue childKey:(NSString *)childKey; + +/** + * queryEndingAtValue: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryEndingAtValue: will respond to events at nodes with a value + * less than or equal to endValue. + * + * @param endValue The upper bound, inclusive, for the value of data visible to the returned FQuery + * @return An FQuery instance, limited to data with value less than or equal to endValue + */ +- (FQuery *) queryEndingAtValue:(id)endValue; + +/** + * queryEndingAtValue:childKey: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryEndingAtValue:childKey will respond to events at nodes with a value + * less than endValue, or equal to endValue and with a key less than or equal to childKey. + * + * @param endValue The upper bound, inclusive, for the value of data visible to the returned FQuery + * @param childKey The upper bound, inclusive, for the key of nodes with value equal to endValue + * @return An FQuery instance, limited to data with value less than or equal to endValue + */ +- (FQuery *) queryEndingAtValue:(id)endValue childKey:(NSString *)childKey; + +/** + * queryEqualToValue: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryEqualToValue: will respond to events at nodes with a value equal + * to the supplied argument. + * + * @param value The value that the data returned by this FQuery will have + * @return An Fquery instance, limited to data with the supplied value. + */ +- (FQuery *) queryEqualToValue:(id)value; + +/** + * queryEqualToValue:childKey: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryEqualToValue:childKey will respond to events at nodes with a value + * equal to the supplied argument with a name equal to childKey. There will be at most one node that matches because + * child keys are unique. + * + * @param value The value that the data returned by this FQuery will have + * @param childKey The name of nodes with the right value + * @return An FQuery instance, limited to data with the supplied value and the key. + */ +- (FQuery *) queryEqualToValue:(id)value childKey:(NSString *)childKey; + + +/** @name Properties */ + + +/** +* Get a Firebase reference for the location of this query. +* +* @return A Firebase instance for the location of this query. +*/ +@property (nonatomic, readonly, strong) Firebase* ref; + +@end diff --git a/grocery-objc/Pods/Firebase/FTransactionResult.h b/grocery-objc/Pods/Firebase/FTransactionResult.h new file mode 100644 index 0000000..a478f65 --- /dev/null +++ b/grocery-objc/Pods/Firebase/FTransactionResult.h @@ -0,0 +1,53 @@ +/* + * Firebase iOS Client Library + * + * Copyright © 2013 Firebase - All Rights Reserved + * https://www.firebase.com + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binaryform must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY FIREBASE AS IS AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL FIREBASE BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import +#import "FMutableData.h" + +/** + * Used for runTransactionBlock:. An FTransactionResult instance is a container for the results of the transaction. + */ +@interface FTransactionResult : NSObject + +/** + * Used for runTransactionBlock:. Indicates that the new value should be saved at this location + * + * @param value An FMutableData instance containing the new value to be set + * @return An FTransactionResult instance that can be used as a return value from the block given to runTransactionBlock: + */ ++ (FTransactionResult *) successWithValue:(FMutableData *)value; + + +/** + * Used for runTransactionBlock:. Indicates that the current transaction should no longer proceed. + * + * @return An FTransactionResult instance that can be used as a return value from the block given to runTransactionBlock: + */ ++ (FTransactionResult *) abort; + +@end diff --git a/grocery-objc/Pods/Firebase/Firebase.framework/Firebase b/grocery-objc/Pods/Firebase/Firebase.framework/Firebase new file mode 100644 index 0000000..1f5be1a Binary files /dev/null and b/grocery-objc/Pods/Firebase/Firebase.framework/Firebase differ diff --git a/grocery-objc/Pods/Firebase/Firebase.h b/grocery-objc/Pods/Firebase/Firebase.h new file mode 100644 index 0000000..7938d04 --- /dev/null +++ b/grocery-objc/Pods/Firebase/Firebase.h @@ -0,0 +1,1055 @@ +/* + * Firebase iOS Client Library + * + * Copyright © 2013 Firebase - All Rights Reserved + * https://www.firebase.com + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binaryform must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY FIREBASE AS IS AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL FIREBASE BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#import +#import "FQuery.h" +#import "FirebaseApp.h" +#import "FDataSnapshot.h" +#import "FMutableData.h" +#import "FTransactionResult.h" +#import "FAuthData.h" +#import "FAuthType.h" +#import "FirebaseServerValue.h" +#import "FConfig.h" + +/** + * A Firebase reference represents a particular location in your Firebase + * and can be used for reading or writing data to that Firebase location. + * + * This class is the starting point for all Firebase operations. After you've + * initialized it with initWithUrl: you can use it + * to read data (ie. observeEventType:withBlock:), write data (ie. setValue:), and to create new + * Firebase references (ie. child:). + */ +@interface Firebase : FQuery + + +/** @name Initializing a Firebase object */ + +/** + * Initialize this Firebase reference with an absolute URL. + * + * @param url The Firebase URL (ie: https://SampleChat.firebaseIO-demo.com) + */ +- (id)initWithUrl:(NSString *)url; + +/** @name Getting references to children locations */ + +/** + * Get a Firebase reference for the location at the specified relative path. + * The relative path can either be a simple child key (e.g. 'fred') or a + * deeper slash-separated path (e.g. 'fred/name/first'). + * + * @param pathString A relative path from this location to the desired child location. + * @return A Firebase reference for the specified relative path. + */ +- (Firebase *) childByAppendingPath:(NSString *)pathString; + + +/** + * childByAutoId generates a new child location using a unique key and returns a + * Firebase reference to it. This is useful when the children of a Firebase + * location represent a list of items. + * + * The unique key generated by childByAutoId: is prefixed with a client-generated + * timestamp so that the resulting list will be chronologically-sorted. + * + * @return A Firebase reference for the generated location. + */ +- (Firebase *) childByAutoId; + + +/** @name Writing data */ + +/*! Write data to this Firebase location. + +This will overwrite any data at this location and all child locations. + +Data types that can be set are: + +- NSString -- @"Hello World" +- NSNumber (also includes boolean) -- @YES, @43, @4.333 +- NSDictionary -- @{@"key": @"value", @"nested": @{@"another": @"value"} } +- NSArray + +The effect of the write will be visible immediately and the corresponding +events will be triggered. Synchronization of the data to the Firebase +servers will also be started. + +Passing null for the new value is equivalent to calling remove:; +all data at this location or any child location will be deleted. + +Note that setValue: will remove any priority stored at this location, so if priority +is meant to be preserved, you should use setValue:andPriority: instead. + + +**Server Values** - Placeholder values you may write into Firebase as a value or priority +that will automatically be populated by the Firebase Server. + +- kFirebaseServerValueTimestamp - The number of milliseconds since the Unix epoch + + +@param value The value to be written. + */ +- (void) setValue:(id)value; + + +#define kFirebaseServerValueTimestamp @{ @".sv": @"timestamp" } + +/** + * The same as setValue: with a block that gets triggered after the write operation has + * been committed to the Firebase servers. + * + * @param value The value to be written. + * @param block The block to be called after the write has been committed to the Firebase servers. + */ +- (void) setValue:(id)value withCompletionBlock:(void (^)(NSError* error, Firebase* ref))block; + + +/** + * The same as setValue: with an additional priority to be attached to the data being written. + * Priorities are used to order items. + * + * @param value The value to be written. + * @param priority The priority to be attached to that data. + */ +- (void) setValue:(id)value andPriority:(id)priority; + + +/** + * The same as setValue:andPriority: with a block that gets triggered after the write operation has + * been committed to the Firebase servers. + * + * @param value The value to be written. + * @param priority The priority to be attached to that data. + * @param block The block to be called after the write has been committed to the Firebase servers. + */ +- (void) setValue:(id)value andPriority:(id)priority withCompletionBlock:(void (^)(NSError* error, Firebase* ref))block; + + +/** + * Remove the data at this Firebase location. Any data at child locations will also be deleted. + * + * The effect of the delete will be visible immediately and the corresponding events + * will be triggered. Synchronization of the delete to the Firebase servers will + * also be started. + * + * remove: is equivalent to calling setValue:nil + */ +- (void) removeValue; + + +/** + * The same as remove: with a block that gets triggered after the remove operation has + * been committed to the Firebase servers. + * + * @param block The block to be called after the remove has been committed to the Firebase servers. + */ +- (void) removeValueWithCompletionBlock:(void (^)(NSError* error, Firebase* ref))block; + +/** + * Set a priority for the data at this Firebase location. + * Priorities can be used to provide a custom ordering for the children at a location + * (if no priorities are specified, the children are ordered by key). + * + * You cannot set a priority on an empty location. For this reason + * setValue:andPriority: should be used when setting initial data with a specific priority + * and setPriority: should be used when updating the priority of existing data. + * + * Children are sorted based on this priority using the following rules: + * + * Children with no priority come first. + * Children with a number as their priority come next. They are sorted numerically by priority (small to large). + * Children with a string as their priority come last. They are sorted lexicographically by priority. + * Whenever two children have the same priority (including no priority), they are sorted by key. Numeric + * keys come first (sorted numerically), followed by the remaining keys (sorted lexicographically). + * + * Note that priorities are parsed and ordered as IEEE 754 double-precision floating-point numbers. + * Keys are always stored as strings and are treated as numbers only when they can be parsed as a + * 32-bit integer + * + * @param priority The priority to set at the specified location. + */ +- (void) setPriority:(id)priority; + + +/** + * The same as setPriority: with a block block that is called once the priority has + * been committed to the Firebase servers. + * + * @param priority The priority to set at the specified location. + * @param block The block that is triggered after the priority has been written on the servers. + */ +- (void) setPriority:(id)priority withCompletionBlock:(void (^)(NSError* error, Firebase* ref))block; + +/** + * Update changes the values at the specified paths in the dictionary without overwriting other + * keys at this location. + * + * @param values A dictionary of the keys to change and their new values + */ +- (void) updateChildValues:(NSDictionary *)values; + +/** + * The same as update: with a block block that is called once the update has been committed to the + * Firebase servers + * + * @param values A dictionary of the keys to change and their new values + * @param block The block that is triggered after the update has been written on the Firebase servers + */ +- (void) updateChildValues:(NSDictionary *)values withCompletionBlock:(void (^)(NSError* error, Firebase* ref))block; + + +/** @name Attaching observers to read data */ + +/** + * observeEventType:withBlock: is used to listen for data changes at a particular location. + * This is the primary way to read data from Firebase. Your block will be triggered + * for the initial data and again whenever the data changes. + * + * Use removeObserverWithHandle: to stop receiving updates. + * @param eventType The type of event to listen for. + * @param block The block that should be called with initial data and updates. It is passed the data as an FDataSnapshot. + * @return A handle used to unregister this block later using removeObserverWithHandle: + */ +- (FirebaseHandle) observeEventType:(FEventType)eventType withBlock:(void (^)(FDataSnapshot* snapshot))block; + + +/** + * observeEventType:andPreviousSiblingKeyWithBlock: is used to listen for data changes at a particular location. + * This is the primary way to read data from Firebase. Your block will be triggered + * for the initial data and again whenever the data changes. In addition, for FEventTypeChildAdded, FEventTypeChildMoved, and + * FEventTypeChildChanged events, your block will be passed the key of the previous node by priority order. + * + * Use removeObserverWithHandle: to stop receiving updates. + * + * @param eventType The type of event to listen for. + * @param block The block that should be called with initial data and updates. It is passed the data as an FDataSnapshot + * and the previous child's key. + * @return A handle used to unregister this block later using removeObserverWithHandle: + */ +- (FirebaseHandle) observeEventType:(FEventType)eventType andPreviousSiblingKeyWithBlock:(void (^)(FDataSnapshot* snapshot, NSString* prevKey))block; + + +/** + * observeEventType:withBlock: is used to listen for data changes at a particular location. + * This is the primary way to read data from Firebase. Your block will be triggered + * for the initial data and again whenever the data changes. + * + * The cancelBlock will be called if you will no longer receive new events due to no longer having permission. + * + * Use removeObserverWithHandle: to stop receiving updates. + * + * @param eventType The type of event to listen for. + * @param block The block that should be called with initial data and updates. It is passed the data as an FDataSnapshot. + * @param cancelBlock The block that should be called if this client no longer has permission to receive these events + * @return A handle used to unregister this block later using removeObserverWithHandle: + */ +- (FirebaseHandle) observeEventType:(FEventType)eventType withBlock:(void (^)(FDataSnapshot* snapshot))block withCancelBlock:(void (^)(NSError* error))cancelBlock; + + +/** + * observeEventType:andPreviousSiblingKeyWithBlock: is used to listen for data changes at a particular location. + * This is the primary way to read data from Firebase. Your block will be triggered + * for the initial data and again whenever the data changes. In addition, for FEventTypeChildAdded, FEventTypeChildMoved, and + * FEventTypeChildChanged events, your block will be passed the key of the previous node by priority order. + * + * The cancelBlock will be called if you will no longer receive new events due to no longer having permission. + * + * Use removeObserverWithHandle: to stop receiving updates. + * + * @param eventType The type of event to listen for. + * @param block The block that should be called with initial data and updates. It is passed the data as an FDataSnapshot + * and the previous child's key. + * @param cancelBlock The block that should be called if this client no longer has permission to receive these events + * @return A handle used to unregister this block later using removeObserverWithHandle: + */ +- (FirebaseHandle) observeEventType:(FEventType)eventType andPreviousSiblingKeyWithBlock:(void (^)(FDataSnapshot* snapshot, NSString* prevKey))block withCancelBlock:(void (^)(NSError* error))cancelBlock; + + +/** + * This is equivalent to observeEventType:withBlock:, except the block is immediately canceled after the initial data is returned. + * + * @param eventType The type of event to listen for. + * @param block The block that should be called. It is passed the data as an FDataSnapshot. + */ +- (void) observeSingleEventOfType:(FEventType)eventType withBlock:(void (^)(FDataSnapshot* snapshot))block; + + +/** + * This is equivalent to observeEventType:withBlock:, except the block is immediately canceled after the initial data is returned. In addition, for FEventTypeChildAdded, FEventTypeChildMoved, and + * FEventTypeChildChanged events, your block will be passed the key of the previous node by priority order. + * + * @param eventType The type of event to listen for. + * @param block The block that should be called. It is passed the data as an FDataSnapshot and the previous child's key. + */ +- (void) observeSingleEventOfType:(FEventType)eventType andPreviousSiblingKeyWithBlock:(void (^)(FDataSnapshot* snapshot, NSString* prevKey))block; + + +/** + * This is equivalent to observeEventType:withBlock:, except the block is immediately canceled after the initial data is returned. + * + * The cancelBlock will be called if you do not have permission to read data at this location. + * + * @param eventType The type of event to listen for. + * @param block The block that should be called. It is passed the data as an FDataSnapshot. + * @param cancelBlock The block that will be called if you don't have permission to access this data + */ +- (void) observeSingleEventOfType:(FEventType)eventType withBlock:(void (^)(FDataSnapshot* snapshot))block withCancelBlock:(void (^)(NSError* error))cancelBlock; + + +/** + * This is equivalent to observeEventType:withBlock:, except the block is immediately canceled after the initial data is returned. In addition, for FEventTypeChildAdded, FEventTypeChildMoved, and + * FEventTypeChildChanged events, your block will be passed the key of the previous node by priority order. + * + * The cancelBlock will be called if you do not have permission to read data at this location. + * + * @param eventType The type of event to listen for. + * @param block The block that should be called. It is passed the data as an FDataSnapshot and the previous child's key. + * @param cancelBlock The block that will be called if you don't have permission to access this data + */ +- (void) observeSingleEventOfType:(FEventType)eventType andPreviousSiblingKeyWithBlock:(void (^)(FDataSnapshot* snapshot, NSString* prevKey))block withCancelBlock:(void (^)(NSError* error))cancelBlock; + +/** @name Detaching observers */ + +/** + * Detach a block previously attached with observeEventType:withBlock:. + * + * @param handle The handle returned by the call to observeEventType:withBlock: which we are trying to remove. + */ +- (void) removeObserverWithHandle:(FirebaseHandle)handle; + +/** + * By calling `keepSynced:YES` on a location, the data for that location will automatically be downloaded and + * kept in sync, even when no listeners are attached for that location. Additionally, while a location is kept + * synced, it will not be evicted from the persistent disk cache. + * + * @param keepSynced Pass YES to keep this location synchronized, pass NO to stop synchronization. + */ +- (void) keepSynced:(BOOL)keepSynced; + + +/** + * Calling removeAllObservers does not remove any observers at child references. + * removeAllObservers must be called again for each child reference where a listener was established to remove the observers. + */ +- (void) removeAllObservers; + +/** @name Querying and limiting */ + + +/** + * This method is deprecated in favor of using queryStartingAtValue:. This can be used with queryOrderedByPriority + * to query by priority. + * + * queryStartingAtPriority: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryStartingAtPriority: will respond to events at nodes with a priority + * greater than or equal to startPriority + * + * @param startPriority The lower bound, inclusive, for the priority of data visible to the returned FQuery + * @return An FQuery instance, limited to data with priority greater than or equal to startPriority + */ +- (FQuery *) queryStartingAtPriority:(id)startPriority __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryStartingAtValue:] instead"))); + + +/** + * This method is deprecated in favor of using queryStartingAtValue:childKey:. This can be used with queryOrderedByPriority + * to query by priority. + * + * queryStartingAtPriority:andChildName: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryStartingAtPriority:andChildName will respond to events at nodes with a priority + * greater than startPriority, or equal to startPriority and with a name greater than or equal to childName + * + * @param startPriority The lower bound, inclusive, for the priority of data visible to the returned FQuery + * @param childName The lower bound, inclusive, for the name of nodes with priority equal to startPriority + * @return An FQuery instance, limited to data with priority greater than or equal to startPriority + */ +- (FQuery *) queryStartingAtPriority:(id)startPriority andChildName:(NSString *)childName __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryStartingAtValue:childKey:] instead"))); + +/** + * This method is deprecated in favor of using queryEndingAtValue:. This can be used with queryOrderedByPriority + * to query by priority. + * + * queryEndingAtPriority: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryEndingAtPriority: will respond to events at nodes with a priority + * less than or equal to startPriority and with a name greater than or equal to childName + * + * @param endPriority The upper bound, inclusive, for the priority of data visible to the returned FQuery + * @return An FQuery instance, limited to data with priority less than or equal to endPriority + */ +- (FQuery *) queryEndingAtPriority:(id)endPriority __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryEndingAtValue:] instead"))); + + +/** + * This method is deprecated in favor of using queryEndingAtValue:childKey:. This can be used with queryOrderedByPriority + * to query by priority. + * + * queryEndingAtPriority:andChildName: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryEndingAtPriority:andChildName will respond to events at nodes with a priority + * less than endPriority, or equal to endPriority and with a name less than or equal to childName + * + * @param endPriority The upper bound, inclusive, for the priority of data visible to the returned FQuery + * @param childName The upper bound, inclusive, for the name of nodes with priority equal to endPriority + * @return An FQuery instance, limited to data with priority less than endPriority or equal to endPriority and with a name less than or equal to childName + */ +- (FQuery *) queryEndingAtPriority:(id)endPriority andChildName:(NSString *)childName __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryEndingAtValue:childKey:] instead"))); + + +/** + * This method is deprecated in favor of using queryEqualToValue:. This can be used with queryOrderedByPriority + * to query by priority. + * + * queryEqualToPriority: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryEqualToPriority: will respond to events at nodes with a priority equal to + * supplied argument. + * + * @param priority The priority that the data returned by this FQuery will have + * @return An Fquery instance, limited to data with the supplied priority. + */ +- (FQuery *) queryEqualToPriority:(id)priority __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryEqualToValue:] instead"))); + + +/** + * This method is deprecated in favor of using queryEqualAtValue:childKey:. This can be used with queryOrderedByPriority + * to query by priority. + * + * queryEqualToPriority:andChildName: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryEqualToPriority:andChildName will respond to events at nodes with a priority + * equal to the supplied argument with a name equal to childName. There will be at most one node that matches because + * child names are unique. + * + * @param priority The priority that the data returned by this FQuery will have + * @param childName The name of nodes with the right priority + * @return An FQuery instance, limited to data with the supplied priority and the name. + */ +- (FQuery *) queryEqualToPriority:(id)priority andChildName:(NSString *)childName __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryEqualToValue:childKey:] instead"))); + +/** + * This method is deprecated in favor of using queryLimitedToFirst:limit or queryLimitedToLast:limit instead. + * + * queryLimitedToNumberOfChildren: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryLimitedToNumberOfChildren: will respond to events from at most limit child nodes. + * + * @param limit The upper bound, inclusive, for the number of child nodes to receive events for + * @return An FQuery instance, limited to at most limit child nodes. + */ +- (FQuery *) queryLimitedToNumberOfChildren:(NSUInteger)limit __attribute__((deprecated("Use [FQuery queryLimitedToFirst:limit] or [FQuery queryLimitedToLast:limit] instead"))); + + +/** + * queryLimitedToFirst: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryLimitedToFirst: will respond to at most the first limit child nodes. + * + * @param limit The upper bound, inclusive, for the number of child nodes to receive events for + * @return An FQuery instance, limited to at most limit child nodes. + */ +- (FQuery *) queryLimitedToFirst:(NSUInteger)limit; + + +/** + * queryLimitedToLast: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryLimitedToLast: will respond to at most the last limit child nodes. + * + * @param limit The upper bound, inclusive, for the number of child nodes to receive events for + * @return An FQuery instance, limited to at most limit child nodes. + */ +- (FQuery *) queryLimitedToLast:(NSUInteger)limit; + +/** + * queryOrderBy: is used to generate a reference to a view of the data that's been sorted by the values of + * a particular child key. This method is intended to be used in combination with queryStartingAtValue:, + * queryEndingAtValue:, or queryEqualToValue:. + * + * @param key The child key to use in ordering data visible to the returned FQuery + * @return An FQuery instance, ordered by the values of the specified child key. + */ +- (FQuery *) queryOrderedByChild:(NSString *)key; + +/** + * queryOrderedByKey: is used to generate a reference to a view of the data that's been sorted by child key. + * This method is intended to be used in combination with queryStartingAtValue:, queryEndingAtValue:, + * or queryEqualToValue:. + * + * @return An FQuery instance, ordered by child keys. + */ +- (FQuery *) queryOrderedByKey; + +/** + * queryOrderedByPriority: is used to generate a reference to a view of the data that's been sorted by child + * priority. This method is intended to be used in combination with queryStartingAtValue:, queryEndingAtValue:, + * or queryEqualToValue:. + * + * @return An FQuery instance, ordered by child priorities. + */ +- (FQuery *) queryOrderedByPriority; + +/** + * queryStartingAtValue: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryStartingAtValue: will respond to events at nodes with a value + * greater than or equal to startValue. + * + * @param startValue The lower bound, inclusive, for the value of data visible to the returned FQuery + * @return An FQuery instance, limited to data with value greater than or equal to startValue + */ +- (FQuery *) queryStartingAtValue:(id)startValue; + +/** + * queryStartingAtValue:childKey: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryStartingAtValue:childKey will respond to events at nodes with a value + * greater than startValue, or equal to startValue and with a key greater than or equal to childKey. + * + * @param startValue The lower bound, inclusive, for the value of data visible to the returned FQuery + * @param childKey The lower bound, inclusive, for the key of nodes with value equal to startValue + * @return An FQuery instance, limited to data with value greater than or equal to startValue + */ +- (FQuery *) queryStartingAtValue:(id)startValue childKey:(NSString *)childKey; + +/** + * queryEndingAtValue: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryEndingAtValue: will respond to events at nodes with a value + * less than or equal to endValue. + * + * @param endValue The upper bound, inclusive, for the value of data visible to the returned FQuery + * @return An FQuery instance, limited to data with value less than or equal to endValue + */ +- (FQuery *) queryEndingAtValue:(id)endValue; + +/** + * queryEndingAtValue:childKey: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryEndingAtValue:childKey will respond to events at nodes with a value + * less than endValue, or equal to endValue and with a key less than or equal to childKey. + * + * @param endValue The upper bound, inclusive, for the value of data visible to the returned FQuery + * @param childKey The upper bound, inclusive, for the key of nodes with value equal to endValue + * @return An FQuery instance, limited to data with value less than or equal to endValue + */ +- (FQuery *) queryEndingAtValue:(id)endValue childKey:(NSString *)childKey; + +/** + * queryEqualToValue: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryEqualToValue: will respond to events at nodes with a value equal + * to the supplied argument. + * + * @param value The value that the data returned by this FQuery will have + * @return An Fquery instance, limited to data with the supplied value. + */ +- (FQuery *) queryEqualToValue:(id)value; + +/** + * queryEqualToValue:childKey: is used to generate a reference to a limited view of the data at this location. + * The FQuery instance returned by queryEqualToValue:childKey will respond to events at nodes with a value + * equal to the supplied argument with a key equal to childKey. There will be at most one node that matches because + * child keys are unique. + * + * @param value The value that the data returned by this FQuery will have + * @param childKey The key of nodes with the right value + * @return An FQuery instance, limited to data with the supplied value and the key. + */ +- (FQuery *) queryEqualToValue:(id)value childKey:(NSString *)childKey; + +/** @name Managing presence */ + +/** + * Ensure the data at this location is set to the specified value when + * the client is disconnected (due to closing the browser, navigating + * to a new page, or network issues). + * + * onDisconnectSetValue: is especially useful for implementing "presence" systems, + * where a value should be changed or cleared when a user disconnects + * so that he appears "offline" to other users. + * + * @param value The value to be set after the connection is lost. + */ +- (void) onDisconnectSetValue:(id)value; + + +/** + * Ensure the data at this location is set to the specified value when + * the client is disconnected (due to closing the browser, navigating + * to a new page, or network issues). + * + * The completion block will be triggered when the operation has been successfully queued up on the Firebase servers + * + * @param value The value to be set after the connection is lost. + * @param block Block to be triggered when the operation has been queued up on the Firebase servers + */ +- (void) onDisconnectSetValue:(id)value withCompletionBlock:(void (^)(NSError* error, Firebase* ref))block; + + +/** + * Ensure the data at this location is set to the specified value and priority when + * the client is disconnected (due to closing the browser, navigating + * to a new page, or network issues). + * + * @param value The value to be set after the connection is lost. + * @param priority The priority to be set after the connection is lost. + */ +- (void) onDisconnectSetValue:(id)value andPriority:(id)priority; + + +/** + * Ensure the data at this location is set to the specified value and priority when + * the client is disconnected (due to closing the browser, navigating + * to a new page, or network issues). + * + * The completion block will be triggered when the operation has been successfully queued up on the Firebase servers + * + * @param value The value to be set after the connection is lost. + * @param priority The priority to be set after the connection is lost. + * @param block Block to be triggered when the operation has been queued up on the Firebase servers + */ +- (void) onDisconnectSetValue:(id)value andPriority:(id)priority withCompletionBlock:(void (^)(NSError* error, Firebase* ref))block; + + +/** + * Ensure the data at this location is removed when + * the client is disconnected (due to closing the app, navigating + * to a new page, or network issues). + * + * onDisconnectRemoveValue is especially useful for implementing "presence" systems. + */ +- (void) onDisconnectRemoveValue; + + +/** + * Ensure the data at this location is removed when + * the client is disconnected (due to closing the app, navigating + * to a new page, or network issues). + * + * onDisconnectRemoveValueWithCompletionBlock: is especially useful for implementing "presence" systems. + * + * @param block Block to be triggered when the operation has been queued up on the Firebase servers + */ +- (void) onDisconnectRemoveValueWithCompletionBlock:(void (^)(NSError* error, Firebase* ref))block; + + + +/** + * Ensure the data has the specified child values updated when + * the client is disconnected (due to closing the browser, navigating + * to a new page, or network issues). + * + * + * @param values A dictionary of child node keys and the values to set them to after the connection is lost. + */ +- (void) onDisconnectUpdateChildValues:(NSDictionary *)values; + + +/** + * Ensure the data has the specified child values updated when + * the client is disconnected (due to closing the browser, navigating + * to a new page, or network issues). + * + * + * @param values A dictionary of child node keys and the values to set them to after the connection is lost. + * @param block A block that will be called once the operation has been queued up on the Firebase servers + */ +- (void) onDisconnectUpdateChildValues:(NSDictionary *)values withCompletionBlock:(void (^)(NSError* error, Firebase* ref))block; + + +/** + * Cancel any operations that are set to run on disconnect. If you previously called onDisconnectSetValue:, + * onDisconnectRemoveValue:, or onDisconnectUpdateChildValues:, and no longer want the values updated when the + * connection is lost, call cancelDisconnectOperations: + */ +- (void) cancelDisconnectOperations; + + +/** + * Cancel any operations that are set to run on disconnect. If you previously called onDisconnectSetValue:, + * onDisconnectRemoveValue:, or onDisconnectUpdateChildValues:, and no longer want the values updated when the + * connection is lost, call cancelDisconnectOperations: + * + * @param block A block that will be triggered once the Firebase servers have acknowledged the cancel request. + */ +- (void) cancelDisconnectOperationsWithCompletionBlock:(void (^)(NSError* error, Firebase* ref))block; + + +/** @name Reading and observing authentication data */ + +/** +* Get the authentication data of the current user. +* +* @return Authentication data of the current user. +*/ +@property (nonatomic, strong, readonly) FAuthData *authData; + + +/** +* Observer block will be triggered whenever a user gets authenticated or logged out. +* +* Authentication data is persisted across app restarts. If your have an old authentication, Firebase will attempt to +* resume your old session. This approach does not wait for a server roundtrip. Rather, it inspects the +* contents of the persisted JWT and assumes that the Firebase secret used to generate the token has not been revoked. +* +* In the event that the Firebase secret used to generate the token has been revoked, observers will likely see one +* flicker / rapid flip-flop of authentication state once the server rejects the token. +* +* Use removeAuthEventObserverWithHandle: to stop receiving updates. +* +* @param block The block that should be called with initial authentication data and future updates +* @return A handle used to unregister this block later with removeAuthEventObserverWithHandle: +*/ +- (FirebaseHandle) observeAuthEventWithBlock:(void (^)(FAuthData *authData))block; + + +/** +* Detach a block previously attached with observeAuthEventWithBlock:. +* +* @param handle The handle returned by the call to observeAuthEventWithBlock: which we are trying to remove. +*/ +- (void) removeAuthEventObserverWithHandle:(FirebaseHandle)handle; + +/** @name User creation and modification */ + +/** +* Used to create a new user account with the given email and password combo. The results will be passed to the given block. +* Note that this method will not log the new user in. +* +* @param email The email for the account to be created +* @param password The password for the account to be created +* @param block The block to be called with the results of the operation +*/ +- (void) createUser:(NSString *)email password:(NSString *)password withCompletionBlock:(void (^)(NSError *error))block; + +/** + * Used to create a new user account with the given email and password combo. The results will be passed + * to the given block. Note that this method will not log the new user in. On success, invokes the result + * block with an dictionary of user data, including the user id. + * + * @param email The email for the account to be created + * @param password The password for the account to be created + * @param block The block to be called with the results of the operation + */ +- (void) createUser:(NSString *)email password:(NSString *)password withValueCompletionBlock:(void (^)(NSError *error, NSDictionary *result))block; + +/** +* Remove a user account with the given email and password. +* +* @param email The email of the account to be removed +* @param password The password for the account to be removed +* @param block A block to receive the results of the operation +*/ +- (void) removeUser:(NSString *)email password:(NSString *)password withCompletionBlock:(void (^)(NSError *error))block; + + +/** +* Attempts to change the password for the account with the given credentials to the new password given. Results are reported to the supplied block. +* +* @param email The email for the account to be changed +* @param oldPassword The old password for the account to be changed +* @param newPassword The desired newPassword for the account +* @param block A block to receive the results of the operation +*/ +- (void) changePasswordForUser:(NSString *)email fromOld:(NSString *)oldPassword toNew:(NSString *)newPassword withCompletionBlock:(void (^)(NSError *error))block; + + +/** + * Attempts to change the email for the account with the given credentials to the new email given. Results are reported to the supplied block. + * + * @param email The email for the account to be changed + * @param password The password for the account to be changed + * @param newEmail The desired newEmail for the account + * @param block A block to receive the results of the operation + */ +- (void) changeEmailForUser:(NSString *)email password:(NSString *)password toNewEmail:(NSString *)newEmail withCompletionBlock:(void (^)(NSError *error))block; + + +/** +* Send a password reset email to the owner of the account with the given email. Results are reported to the supplied block. +* +* @param email The email of the account to be removed +* @param block A block to receive the results of the operation +*/ +- (void) resetPasswordForUser:(NSString *)email withCompletionBlock:(void (^)(NSError* error))block; + +/** @name Authenticating */ + +/** +* Attempts to log the user in anonymously. The block will receive the results of the attempt. +* +* @param block A block to receive the results of the authentication attempt. +*/ +- (void) authAnonymouslyWithCompletionBlock:(void (^)(NSError *error, FAuthData *authData))block; + +/** +* Attempts to authenticate to Firebase with the given credentials. The block will receive the results of the attempt. +* +* @param email The email of the account +* @param password The password for the account +* @param block A block to receive the results of the authentication attempt +*/ +- (void) authUser:(NSString *)email password:(NSString *)password withCompletionBlock:(void (^)(NSError *error, FAuthData *authData))block; + +/** +* Authenticate access to this Firebase using the provided credentials. +* +* The completion block will be called with the results of the authenticated attempt. Unlike +* authWithCredential:withCompletionBlock:withCancelBlock:, no block will be called when the credentials become invalid. +* +* Instead, please use observeAuthEventWithBlock: to observe if a user gets logged out. +* +* @param token The Firebase authentication JWT generated by a secure code on a remote server. +* @param block This block will be called with the results of the authentication attempt +*/ +- (void) authWithCustomToken:(NSString *)token withCompletionBlock:(void (^)(NSError *error, FAuthData *authData))block; + +/** +* Authenticate to Firebase with an OAuth token from a provider. +* +* This method works with current OAuth 2.0 providers such as Facebook, Google+, and Github. +* +* For other providers that Firebase supports which require additional parameters for login, such as Twitter, please use authWithOAuthProvider:parameters:withCompletionBlock:. +* +* @param provider The provider, all lower case with no spaces. +* @param oauthToken The OAuth Token to authenticate with the provider +* @param block A block to receive the results of the authentication attempt +*/ +- (void) authWithOAuthProvider:(NSString *)provider token:(NSString *)oauthToken withCompletionBlock:(void (^) (NSError *error, FAuthData *authData))block; + +/** +* Authenticate to Firebase with an OAuth token from a provider. +* +* This method is for OAuth providers that require extra parameters when authentication with the server, such as Twitter. +* The OAuth token should be included as a parameter. +* +* @param provider The provider, all lowercase with no spaces. +* @param parameters The parameters necessary to authenticate with the provider +* @param block A block to receive the results of the authentication attempt +*/ +- (void) authWithOAuthProvider:(NSString *)provider parameters:(NSDictionary *)parameters withCompletionBlock:(void (^) (NSError *error, FAuthData *authData))block; + +/** +* Make a reverse OAuth Request to a provider. +* +* This method is for OAuth providers that require a reverse request be made first. The json output of this block +* +* @param provider The provider, all lowercase with no spaces. +* @param block The block to receive the results of the reverse OAuth request. +*/ +- (void) makeReverseOAuthRequestTo:(NSString *)provider withCompletionBlock:(void (^)(NSError *error, NSDictionary *json))block; + +/** +* Removes any credentials associated with this Firebase. +*/ +- (void) unauth; + +/** +* This method is deprecated. Use authWithCustomToken:withCompletionBlock: instead. +* +* Authenticate access to this Firebase using the provided credentials. The completion block will be called with +* the results of the authenticated attempt, and the cancelBlock will be called if the credentials become invalid +* at some point after authentication has succeeded. +* +* @param credential The Firebase authentication JWT generated by a secure code on a remote server. +* @param block This block will be called with the results of the authentication attempt +* @param cancelBlock This block will be called if at any time in the future the credentials become invalid +*/ +- (void) authWithCredential:(NSString *)credential withCompletionBlock:(void (^) (NSError* error, id data))block withCancelBlock:(void (^)(NSError* error))cancelBlock __attribute__((deprecated("Use authWithCustomToken:withCompletionblock: instead"))); + +/** +* This method is deprecated. Use unauth: instead. +* +* Removes any credentials associated with this Firebase. The callback block will be triggered after this operation +* has been acknowledged by the Firebase servers. +* +* @param block This block will be called once the unauth has completed. +*/ +- (void) unauthWithCompletionBlock:(void (^)(NSError* error))block __attribute__((deprecated("Use unauth: instead"))); + + +/** @name Manual Connection Management */ + +/** + * Manually disconnect the Firebase client from the server and disable automatic reconnection. + * + * The Firebase client automatically maintains a persistent connection to the Firebase server, + * which will remain active indefinitely and reconnect when disconnected. However, the goOffline( ) + * and goOnline( ) methods may be used to manually control the client connection in cases where + * a persistent connection is undesirable. + * + * While offline, the Firebase client will no longer receive data updates from the server. However, + * all Firebase operations performed locally will continue to immediately fire events, allowing + * your application to continue behaving normally. Additionally, each operation performed locally + * will automatically be queued and retried upon reconnection to the Firebase server. + * + * To reconnect to the Firebase server and begin receiving remote events, see goOnline( ). + * Once the connection is reestablished, the Firebase client will transmit the appropriate data + * and fire the appropriate events so that your client "catches up" automatically. + * + * Note: Invoking this method will impact all Firebase connections. + */ ++ (void) goOffline; + +/** + * Manually reestablish a connection to the Firebase server and enable automatic reconnection. + * + * The Firebase client automatically maintains a persistent connection to the Firebase server, + * which will remain active indefinitely and reconnect when disconnected. However, the goOffline( ) + * and goOnline( ) methods may be used to manually control the client connection in cases where + * a persistent connection is undesirable. + * + * This method should be used after invoking goOffline( ) to disable the active connection. + * Once reconnected, the Firebase client will automatically transmit the proper data and fire + * the appropriate events so that your client "catches up" automatically. + * + * To disconnect from the Firebase server, see goOffline( ). + * + * Note: Invoking this method will impact all Firebase connections. + */ ++ (void) goOnline; + + +/** @name Transactions */ + +/** + * Performs an optimistic-concurrency transactional update to the data at this location. Your block will be called with an FMutableData + * instance that contains the current data at this location. Your block should update this data to the value you + * wish to write to this location, and then return an instance of FTransactionResult with the new data. + * + * If, when the operation reaches the server, it turns out that this client had stale data, your block will be run + * again with the latest data from the server. + * + * When your block is run, you may decide to abort the transaction by return [FTransactionResult abort]. + * + * @param block This block receives the current data at this location and must return an instance of FTransactionResult + */ +- (void) runTransactionBlock:(FTransactionResult* (^) (FMutableData* currentData))block; + + +/** + * Performs an optimistic-concurrency transactional update to the data at this location. Your block will be called with an FMutableData + * instance that contains the current data at this location. Your block should update this data to the value you + * wish to write to this location, and then return an instance of FTransactionResult with the new data. + * + * If, when the operation reaches the server, it turns out that this client had stale data, your block will be run + * again with the latest data from the server. + * + * When your block is run, you may decide to abort the transaction by return [FTransactionResult abort]. + * + * @param block This block receives the current data at this location and must return an instance of FTransactionResult + * @param completionBlock This block will be triggered once the transaction is complete, whether it was successful or not. It will indicate if there was an error, whether or not the data was committed, and what the current value of the data at this location is. + */ +- (void) runTransactionBlock:(FTransactionResult* (^) (FMutableData* currentData))block andCompletionBlock:(void (^) (NSError* error, BOOL committed, FDataSnapshot* snapshot))completionBlock; + + + +/** + * Performs an optimistic-concurrency transactional update to the data at this location. Your block will be called with an FMutableData + * instance that contains the current data at this location. Your block should update this data to the value you + * wish to write to this location, and then return an instance of FTransactionResult with the new data. + * + * If, when the operation reaches the server, it turns out that this client had stale data, your block will be run + * again with the latest data from the server. + * + * When your block is run, you may decide to abort the transaction by return [FTransactionResult abort]. + * + * Since your block may be run multiple times, this client could see several immediate states that don't exist on the server. You can suppress those immediate states until the server confirms the final state of the transaction. + * + * @param block This block receives the current data at this location and must return an instance of FTransactionResult + * @param completionBlock This block will be triggered once the transaction is complete, whether it was successful or not. It will indicate if there was an error, whether or not the data was committed, and what the current value of the data at this location is. + * @param localEvents Set this to NO to suppress events raised for intermediate states, and only get events based on the final state of the transaction. + */ +- (void) runTransactionBlock:(FTransactionResult* (^) (FMutableData* currentData))block andCompletionBlock:(void (^) (NSError* error, BOOL committed, FDataSnapshot* snapshot))completionBlock withLocalEvents:(BOOL)localEvents; + + +/** @name Retrieving String Representation */ + +/** + * Gets the absolute URL of this Firebase location. + * + * @return The absolute URL of the referenced Firebase location. + */ +- (NSString *) description; + +/** @name Properties */ + +/** + * Get a Firebase reference for the parent location. + * If this instance refers to the root of your Firebase, it has no parent, + * and therefore parent( ) will return null. + * + * @return A Firebase reference for the parent location. + */ +@property (strong, readonly, nonatomic) Firebase* parent; + + +/** + * Get a Firebase reference for the root location + * + * @return A new Firebase reference to root location. + */ +@property (strong, readonly, nonatomic) Firebase* root; + + +/** + * Gets last token in a Firebase location (e.g. 'fred' in https://SampleChat.firebaseIO-demo.com/users/fred) + * + * @return The key of the location this reference points to. + */ +@property (strong, readonly, nonatomic) NSString* key; + +/** + * Gets the FirebaseApp instance associated with this reference. + * + * @return The FirebaseApp object for this reference. + */ +@property (strong, readonly, nonatomic) FirebaseApp *app; + + +/** @name Global configuration and settings */ + +/** Set the default dispatch queue for event blocks. + * + * @param queue The queue to set as the default for running blocks for all Firebase event types. + * @deprecated This method is deprecated + * @note Please use [Firebase defaultConfig].callbackQueue instead +*/ ++ (void) setDispatchQueue:(dispatch_queue_t)queue __attribute__((deprecated)); + +/** Retrieve the Firebase SDK version. */ ++ (NSString *) sdkVersion; + ++ (void) setLoggingEnabled:(BOOL)enabled; + +/** + * Returns the default config object, used for configuring Firebase client behavior. + * + * This can be modified until you create your first `Firebase` instance. + */ ++ (FConfig *)defaultConfig; + +/** + * @deprecated This method is deprecated + * @note Please enable persistence by setting [Firebase defaultConfig].persistenceEnabled = YES instead. + * @param option Option to set. + * @param value Value to set. + */ ++ (void) setOption:(NSString*)option to:(id)value __attribute__((deprecated)); +@end diff --git a/grocery-objc/Pods/Firebase/FirebaseApp.h b/grocery-objc/Pods/Firebase/FirebaseApp.h new file mode 100644 index 0000000..b909cee --- /dev/null +++ b/grocery-objc/Pods/Firebase/FirebaseApp.h @@ -0,0 +1,34 @@ +#import + +/** + * All Firebase references to the same database share a connection, persistent cache, etc. FirebaseApp + * represents this shared state and can be accessed from any reference via its `app` property. + * It has methods for managing your Firebase connection, etc. + * + * There is a one-to-one relationship between a FirebaseApp instance and a connection to Firebase. + */ +@interface FirebaseApp : NSObject + +/** + * The Firebase client automatically queues writes and sends them to the server at the earliest opportunity, + * depending on network connectivity. In some cases (e.g. offline usage) there may be a large number of writes + * waiting to be sent. Calling this method will purge all outstanding writes so they are abandoned. + * + * All writes will be purged, including transactions and {@link Firebase#onDisconnect} writes. The writes will + * be rolled back locally, perhaps triggering events for affected event listeners, and the client will not + * (re-)send them to the Firebase backend. + */ +- (void)purgeOutstandingWrites; + + +/** + * Shuts down our connection to the Firebase backend until goOnline is called. + */ +- (void)goOffline; + +/** + * Resumes our connection to the Firebase backend after a previous goOffline call. + */ +- (void)goOnline; + +@end diff --git a/grocery-objc/Pods/Firebase/FirebaseServerValue.h b/grocery-objc/Pods/Firebase/FirebaseServerValue.h new file mode 100644 index 0000000..329ef11 --- /dev/null +++ b/grocery-objc/Pods/Firebase/FirebaseServerValue.h @@ -0,0 +1,5 @@ +@interface FirebaseServerValue : NSObject + ++ (NSDictionary *) timestamp; + +@end \ No newline at end of file diff --git a/grocery-objc/Pods/Firebase/libFirebaseStatic.a b/grocery-objc/Pods/Firebase/libFirebaseStatic.a new file mode 100644 index 0000000..1f5be1a Binary files /dev/null and b/grocery-objc/Pods/Firebase/libFirebaseStatic.a differ diff --git a/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Animation/YALSpringAnimation/YALSpringAnimation.h b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Animation/YALSpringAnimation/YALSpringAnimation.h new file mode 100644 index 0000000..93f0e62 --- /dev/null +++ b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Animation/YALSpringAnimation/YALSpringAnimation.h @@ -0,0 +1,20 @@ +// For License please refer to LICENSE file in the root of YALAnimatingTabBarController project + +#import + +@interface YALSpringAnimation : CAKeyframeAnimation + ++ (instancetype)animationWithKeyPath:(NSString *)keyPath + duration:(CFTimeInterval)duration + damping:(double)damping + velocity:(double)velocity + fromValue:(double)fromValue + toValue:(double)toValue; + ++ (instancetype)animationForRoundedRectPathWithduration:(CFTimeInterval)duration + damping:(double)damping + velocity:(double)velocity + fromValue:(CGRect)fromValue + toValue:(CGRect)toValue; + +@end diff --git a/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Animation/YALSpringAnimation/YALSpringAnimation.m b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Animation/YALSpringAnimation/YALSpringAnimation.m new file mode 100644 index 0000000..0030796 --- /dev/null +++ b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Animation/YALSpringAnimation/YALSpringAnimation.m @@ -0,0 +1,114 @@ +// For License please refer to LICENSE file in the root of YALAnimatingTabBarController project + +#import "YALSpringAnimation.h" +#import + +static const NSUInteger kNumberOfPoints = 500; +static const double kDampingMutiplier = 10; +static const double kVelocityMutiplier = 10; + +double yal_normalizeAnimationValue(double value, double damping, double velocity); + +@implementation YALSpringAnimation + ++ (instancetype)animationWithKeyPath:(NSString *)keyPath + duration:(CFTimeInterval)duration + damping:(double)damping + velocity:(double)velocity + fromValue:(double)fromValue + toValue:(double)toValue +{ + YALSpringAnimation *animation = [self.class animationWithKeyPath:keyPath]; + + animation.removedOnCompletion = NO; + animation.fillMode = kCAFillModeForwards; + animation.duration = duration; + animation.values = [self animationValuesFromValue:fromValue + toValue:toValue + withDamping:damping + andVelocity:velocity]; + return animation; +} + ++ (instancetype)animationForRoundedRectPathWithduration:(CFTimeInterval)duration + damping:(double)damping + velocity:(double)velocity + fromValue:(CGRect)fromValue + toValue:(CGRect)toValue +{ + YALSpringAnimation *animation = [self.class animationWithKeyPath:@"path"]; + + animation.removedOnCompletion = NO; + animation.fillMode = kCAFillModeForwards; + animation.duration = duration; + animation.values = [self animationValuesForPathFromValue:fromValue + toValue:toValue + withDamping:damping + andVelocity:velocity]; + return animation; +} + ++ (NSArray *)animationValuesForPathFromValue:(CGRect)fromValue + toValue:(CGRect)toValue + withDamping:(double)damping + andVelocity:(double)velocity +{ + NSArray *xValues = [self animationValuesFromValue:fromValue.origin.x + toValue:toValue.origin.x + withDamping:damping + andVelocity:velocity]; + NSArray *widthValues = [self animationValuesFromValue:fromValue.size.width + toValue:toValue.size.width + withDamping:damping + andVelocity:velocity]; + NSMutableArray *pathValues = [NSMutableArray new]; + CGFloat cornerRadius = fromValue.size.height / 2.f; + CGRect rect = fromValue; + + for (NSInteger i = 0; i < xValues.count; ++i) { + CGFloat x = [(NSNumber *)xValues[i] floatValue]; + CGFloat width = [(NSNumber *)widthValues[i] floatValue]; + + rect.origin.x = x; + rect.size.width = width; + + UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius]; + [pathValues addObject:(id)path.CGPath]; + } + + return [NSArray arrayWithArray:pathValues]; +} + +/* + * code below borrowed SpringAnimation.swift from:https://github.com/evgenyneu/SpringAnimationCALayer + */ + ++ (NSArray *)animationValuesFromValue:(double)fromValue + toValue:(double)toValue + withDamping:(double)damping + andVelocity:(double)velocity +{ + NSMutableArray *values = [NSMutableArray new]; + CGFloat distanceBetweenValues = toValue - fromValue; + velocity *= kVelocityMutiplier; + damping *= kDampingMutiplier; + + for (double i = 0; i < kNumberOfPoints; ++i) { + double x = i / kNumberOfPoints; + double normalizedValue = yal_normalizeAnimationValue(x, damping, velocity); + double value = toValue - distanceBetweenValues * normalizedValue; + [values addObject:@(value)]; + } + + // with different arguments alghorithm above produces values where + // last values not equal to toValue therefore line below is required(not a perfect fix for issue but will do for now) + [values addObject:@(toValue)]; + + return [NSArray arrayWithArray:values]; +} + +@end + +double yal_normalizeAnimationValue(double value, double damping, double velocity) { + return pow(M_E, -damping * value) * cos(velocity * value); +} diff --git a/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Category/CAAnimation/CAAnimation+YALTabBarViewAnimations/CAAnimation+YALTabBarViewAnimations.h b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Category/CAAnimation/CAAnimation+YALTabBarViewAnimations/CAAnimation+YALTabBarViewAnimations.h new file mode 100644 index 0000000..b68e135 --- /dev/null +++ b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Category/CAAnimation/CAAnimation+YALTabBarViewAnimations/CAAnimation+YALTabBarViewAnimations.h @@ -0,0 +1,16 @@ +// For License please refer to LICENSE file in the root of YALAnimatingTabBarController project + +#import + +@interface CAAnimation (YALTabBarViewAnimations) + ++ (CAAnimation *)animationForAdditionalButton; ++ (CAAnimation *)animationForExtraLeftBarItem; ++ (CAAnimation *)animationForExtraRightBarItem; ++ (CAAnimation *)animationForTabBarExpandFromRect:(CGRect)fromRect toRect:(CGRect)toRect; ++ (CAAnimation *)animationForTabBarCollapseFromRect:(CGRect)fromRect toRect:(CGRect)toRect; ++ (CAAnimation *)animationForCenterButtonExpand; ++ (CAAnimation *)animationForCenterButtonCollapse; ++ (CAAnimation *)showSelectedDotAnimation; + +@end diff --git a/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Category/CAAnimation/CAAnimation+YALTabBarViewAnimations/CAAnimation+YALTabBarViewAnimations.m b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Category/CAAnimation/CAAnimation+YALTabBarViewAnimations/CAAnimation+YALTabBarViewAnimations.m new file mode 100644 index 0000000..a427913 --- /dev/null +++ b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Category/CAAnimation/CAAnimation+YALTabBarViewAnimations/CAAnimation+YALTabBarViewAnimations.m @@ -0,0 +1,144 @@ +// For License please refer to LICENSE file in the root of YALAnimatingTabBarController project + +#import "CAAnimation+YALTabBarViewAnimations.h" +#import "YALSpringAnimation.h" +#import "YALAnimatingTabBarConstants.h" + +@implementation CAAnimation (YALTabBarViewAnimations) + +#pragma mark - Additional buttons animations + ++ (CAAnimation *)animationForAdditionalButton { + CABasicAnimation *scaleX = [CABasicAnimation animationWithKeyPath:@"transform.scale.x"]; + scaleX.fromValue = @(kYALAdditionalButtonsAnimationsParameters.scaleX.fromValue); + scaleX.toValue = @(kYALAdditionalButtonsAnimationsParameters.scaleX.toValue); + scaleX.duration = kYALAdditionalButtonsAnimationsParameters.scaleX.duration; + + CABasicAnimation *scaleY = [CABasicAnimation animationWithKeyPath:@"transform.scale.y"]; + scaleY.fromValue = @(kYALAdditionalButtonsAnimationsParameters.scaleY.fromValue); + scaleY.toValue = @(kYALAdditionalButtonsAnimationsParameters.scaleY.toValue); + scaleY.duration = kYALAdditionalButtonsAnimationsParameters.scaleY.duration; + + CABasicAnimation *rotation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; + rotation.fromValue = @(kYALAdditionalButtonsAnimationsParameters.rotation.fromValue); + rotation.toValue = @(kYALAdditionalButtonsAnimationsParameters.rotation.toValue); + rotation.duration = kYALAdditionalButtonsAnimationsParameters.rotation.duration; + rotation.fillMode = kCAFillModeForwards; + rotation.removedOnCompletion = NO; + + YALSpringAnimation *bouncedRotation = [self rotationBouncedAnimationFromValue:kYALAdditionalButtonsAnimationsParameters.bounce.fromValue + toValue:kYALAdditionalButtonsAnimationsParameters.bounce.toValue]; + bouncedRotation.beginTime = kYALAdditionalButtonsAnimationsParameters.bounce.beginTime; + + return [self groupWithAnimations:@[scaleX, scaleY, rotation, bouncedRotation] andDuration:kYALExpandAnimationDuration]; +} + +#pragma mark - Extra buttons animations + ++ (CAAnimation *)animationForExtraLeftBarItem { + return [YALSpringAnimation animationWithKeyPath:@"transform.rotation.z" + duration:kYALExtraLeftTabBarItemAnimationParameters.duration + damping:kYALExtraLeftTabBarItemAnimationParameters.damping + velocity:kYALExtraLeftTabBarItemAnimationParameters.velocity + fromValue:kYALExtraLeftTabBarItemAnimationParameters.fromValue + toValue:kYALExtraLeftTabBarItemAnimationParameters.toValue]; +} + ++ (CAAnimation *)animationForExtraRightBarItem { + return [YALSpringAnimation animationWithKeyPath:@"transform.rotation.z" + duration:kYALExtraRightTabBarItemAnimationParameters.duration + damping:kYALExtraRightTabBarItemAnimationParameters.damping + velocity:kYALExtraRightTabBarItemAnimationParameters.velocity + fromValue:kYALExtraRightTabBarItemAnimationParameters.fromValue + toValue:kYALExtraRightTabBarItemAnimationParameters.toValue]; +} + +#pragma mark - Tab bar view animations + ++ (CAAnimation *)animationForTabBarExpandFromRect:(CGRect)fromRect toRect:(CGRect)toRect { + return [YALSpringAnimation animationForRoundedRectPathWithduration:kYALTabBarExpandAnimationParameters.duration + damping:kYALTabBarExpandAnimationParameters.damping + velocity:kYALTabBarExpandAnimationParameters.velocity + fromValue:fromRect + toValue:toRect]; +} + ++ (CAAnimation *)animationForTabBarCollapseFromRect:(CGRect)fromRect toRect:(CGRect)toRect { + return [YALSpringAnimation animationForRoundedRectPathWithduration:kYALTabBarCollapseAnimationParameters.duration + damping:kYALTabBarCollapseAnimationParameters.damping + velocity:kYALTabBarCollapseAnimationParameters.velocity + fromValue:fromRect + toValue:toRect]; +} + +#pragma mark - Center button animation + ++ (CAAnimation *)animationForCenterButtonExpand { + CABasicAnimation *rotation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; + rotation.fromValue = @(kYALCenterButtonExpandAnimationParameters.rotation.fromValue); + rotation.toValue = @(kYALCenterButtonExpandAnimationParameters.rotation.toValue); + rotation.duration = kYALCenterButtonExpandAnimationParameters.rotation.duration; + rotation.fillMode = kCAFillModeForwards; + rotation.removedOnCompletion = NO; + + YALSpringAnimation *bouncedRotation = [self rotationBouncedAnimationFromValue:kYALCenterButtonExpandAnimationParameters.bounce.fromValue + toValue:kYALCenterButtonExpandAnimationParameters.bounce.toValue]; + bouncedRotation.beginTime = kYALCenterButtonExpandAnimationParameters.bounce.beginTime; + + return [self groupWithAnimations:@[rotation, bouncedRotation] andDuration:kYALExpandAnimationDuration]; +} + ++ (CAAnimation *)animationForCenterButtonCollapse { + CABasicAnimation *rotation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; + rotation.fromValue = @(kYALCenterButtonCollapseAnimationParameters.rotation.fromValue); + rotation.toValue = @(kYALCenterButtonCollapseAnimationParameters.rotation.toValue); + rotation.duration = kYALCenterButtonCollapseAnimationParameters.rotation.duration; + rotation.fillMode = kCAFillModeForwards; + rotation.removedOnCompletion = NO; + + YALSpringAnimation *bouncedRotation = [self rotationBouncedAnimationFromValue:kYALCenterButtonCollapseAnimationParameters.bounce.fromValue + toValue:kYALCenterButtonCollapseAnimationParameters.bounce.toValue]; + bouncedRotation.beginTime = kYALCenterButtonCollapseAnimationParameters.bounce.beginTime; + + return [self groupWithAnimations:@[rotation, bouncedRotation] andDuration:kYALExpandAnimationDuration]; +} + ++ (CAAnimation *)showSelectedDotAnimation { + CABasicAnimation *scaleX = [CABasicAnimation animationWithKeyPath:@"transform.scale.x"]; + scaleX.fromValue = @(kYALSelectedDotAnimationsParameters.scaleX.fromValue); + scaleX.toValue = @(kYALSelectedDotAnimationsParameters.scaleX.toValue); + scaleX.duration = kYALSelectedDotAnimationsParameters.scaleX.duration; + + CABasicAnimation *scaleY = [CABasicAnimation animationWithKeyPath:@"transform.scale.y"]; + scaleY.fromValue = @(kYALSelectedDotAnimationsParameters.scaleY.fromValue); + scaleY.toValue = @(kYALSelectedDotAnimationsParameters.scaleY.toValue); + scaleY.duration = kYALSelectedDotAnimationsParameters.scaleY.duration; + + return [self groupWithAnimations:@[scaleX, scaleY] andDuration:kYALExpandAnimationDuration / 2]; +} + +#pragma mark - Helpers - + +#pragma mark Group + ++ (CAAnimationGroup *)groupWithAnimations:(NSArray *)animations andDuration:(CFTimeInterval)duration { + CAAnimationGroup *group = [CAAnimationGroup animation]; + group.duration = duration; + group.animations = animations; + group.removedOnCompletion = NO; + group.fillMode = kCAFillModeForwards; + return group; +} + +#pragma mark Rotation bounce animation + ++ (YALSpringAnimation *)rotationBouncedAnimationFromValue:(double)fromValue toValue:(double)toValue { + return [YALSpringAnimation animationWithKeyPath:@"transform.rotation.z" + duration:kYALBounceAnimationParameters.duration + damping:kYALBounceAnimationParameters.damping + velocity:kYALBounceAnimationParameters.velocity + fromValue:fromValue + toValue:toValue]; +} + +@end diff --git a/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Category/CATransaction/CATransaction+TransactionWithAnimationsAndCompletion/CATransaction+TransactionWithAnimationsAndCompletion.h b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Category/CATransaction/CATransaction+TransactionWithAnimationsAndCompletion/CATransaction+TransactionWithAnimationsAndCompletion.h new file mode 100644 index 0000000..aa99ff0 --- /dev/null +++ b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Category/CATransaction/CATransaction+TransactionWithAnimationsAndCompletion/CATransaction+TransactionWithAnimationsAndCompletion.h @@ -0,0 +1,9 @@ +// For License please refer to LICENSE file in the root of YALAnimatingTabBarController project + +#import + +@interface CATransaction (TransactionWithAnimationsAndCompletion) + ++ (void)transactionWithAnimations:(void(^)(void))animations andCompletion:(void(^)(void))completion; + +@end diff --git a/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Category/CATransaction/CATransaction+TransactionWithAnimationsAndCompletion/CATransaction+TransactionWithAnimationsAndCompletion.m b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Category/CATransaction/CATransaction+TransactionWithAnimationsAndCompletion/CATransaction+TransactionWithAnimationsAndCompletion.m new file mode 100644 index 0000000..2bd8f31 --- /dev/null +++ b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Category/CATransaction/CATransaction+TransactionWithAnimationsAndCompletion/CATransaction+TransactionWithAnimationsAndCompletion.m @@ -0,0 +1,16 @@ +// For License please refer to LICENSE file in the root of YALAnimatingTabBarController project + +#import "CATransaction+TransactionWithAnimationsAndCompletion.h" + +@implementation CATransaction (TransactionWithAnimationsAndCompletion) + ++ (void)transactionWithAnimations:(void(^)(void))animations andCompletion:(void(^)(void))completion { + [CATransaction begin]; { + [CATransaction setCompletionBlock:completion]; + if (animations) { + animations(); + } + } [CATransaction commit]; +} + +@end diff --git a/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Constants/YALAnimatingTabBarConstants.h b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Constants/YALAnimatingTabBarConstants.h new file mode 100644 index 0000000..f6c1391 --- /dev/null +++ b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Constants/YALAnimatingTabBarConstants.h @@ -0,0 +1,60 @@ +// For License please refer to LICENSE file in the root of YALAnimatingTabBarController project + +#import + +extern CGFloat const YALBottomSelectedDotDefaultSize; +extern CGFloat const YALBottomSelectedDotOffset; +extern CGFloat const YALTabBarViewDefaultHeight; +extern CGFloat const YALExtraTabBarItemsDefaultHeight; +extern CGFloat const YALForExtraTabBarItemsDefaultOffset; +extern UIEdgeInsets const YALTabBarViewHDefaultEdgeInsets; +extern UIEdgeInsets const YALTabBarViewItemsDefaultEdgeInsets; + + +extern CFTimeInterval const kYALExpandAnimationDuration; + +typedef struct { + CFTimeInterval beginTime; + CFTimeInterval duration; + double fromValue; + double toValue; + double damping; + double velocity; +} YALAnimationParameters; + +typedef struct { + YALAnimationParameters scaleX; + YALAnimationParameters scaleY; + YALAnimationParameters rotation; + YALAnimationParameters bounce; +} YALAdditionalButtonsAnimationsParameters; + +typedef struct { + YALAnimationParameters rotation; + YALAnimationParameters bounce; +} YALCenterButtonAnimationsParameters; + +typedef struct { + NSTimeInterval duration; + NSTimeInterval delay; + CGFloat damping; + CGFloat velocity; + UIViewAnimationOptions options; +} YALExtraTabBarItemViewAnimationParameters; + +typedef struct { + YALAnimationParameters scaleX; + YALAnimationParameters scaleY; +} YALSelectedDotAnimationsParameters; + +extern YALAdditionalButtonsAnimationsParameters const kYALAdditionalButtonsAnimationsParameters; +extern YALSelectedDotAnimationsParameters const kYALSelectedDotAnimationsParameters; +extern YALAnimationParameters const kYALExtraLeftTabBarItemAnimationParameters; +extern YALAnimationParameters const kYALExtraRightTabBarItemAnimationParameters; +extern YALAnimationParameters const kYALTabBarExpandAnimationParameters; +extern YALAnimationParameters const kYALTabBarCollapseAnimationParameters; +extern YALCenterButtonAnimationsParameters const kYALCenterButtonExpandAnimationParameters; +extern YALCenterButtonAnimationsParameters const kYALCenterButtonCollapseAnimationParameters; +extern YALAnimationParameters const kYALBounceAnimationParameters; +extern YALExtraTabBarItemViewAnimationParameters const kYALShowExtraTabBarItemViewAnimationParameters; +extern YALExtraTabBarItemViewAnimationParameters const kYALHideExtraTabBarItemViewAnimationParameters; \ No newline at end of file diff --git a/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Constants/YALAnimatingTabBarConstants.m b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Constants/YALAnimatingTabBarConstants.m new file mode 100644 index 0000000..f61c2b7 --- /dev/null +++ b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Constants/YALAnimatingTabBarConstants.m @@ -0,0 +1,122 @@ +// For License please refer to LICENSE file in the root of YALAnimatingTabBarController project + +#import "YALAnimatingTabBarConstants.h" + +CGFloat const YALBottomSelectedDotDefaultSize = 4.f; +CGFloat const YALBottomSelectedDotOffset = 16.f; +CGFloat const YALTabBarViewDefaultHeight = 80.f; +CGFloat const YALExtraTabBarItemsDefaultHeight = 48.f; +CGFloat const YALForExtraTabBarItemsDefaultOffset = 15.f; +UIEdgeInsets const YALTabBarViewHDefaultEdgeInsets = {10.f, 14.f, 10.f, 14.f}; +UIEdgeInsets const YALTabBarViewItemsDefaultEdgeInsets = {0.f, 0.f, 0.f, 0.f}; + + +CFTimeInterval const kYALExpandAnimationDuration = 1.0; + +CGFloat const kDegreeToRadiansRatio = M_PI / 180.f; + +YALAnimationParameters const kYALBounceAnimationParameters = (YALAnimationParameters) { + .duration = kYALExpandAnimationDuration * 2.0 / 3.0, + .damping = 0.5, + .velocity = 3.0 +}; + +YALAnimationParameters const kYALExtraLeftTabBarItemAnimationParameters = (YALAnimationParameters) { + .duration = kYALExpandAnimationDuration * 3.0 / 4.0, + .damping = 0.74, + .velocity = 1.2, + .fromValue = 0.0, + .toValue = M_PI * 2.0 * 2.0 +}; + +YALAnimationParameters const kYALExtraRightTabBarItemAnimationParameters = (YALAnimationParameters) { + .duration = kYALExpandAnimationDuration * 3.0 / 4.0, + .damping = 0.74, + .velocity = 1.2, + .fromValue = 0.0, + .toValue = M_PI * 2.0 * -2.0 +}; + +YALAnimationParameters const kYALTabBarExpandAnimationParameters = (YALAnimationParameters) { + .duration = kYALExpandAnimationDuration / 2.0, + .damping = 0.5, + .velocity = 0.6 +}; + +YALAnimationParameters const kYALTabBarCollapseAnimationParameters = (YALAnimationParameters) { + .duration = kYALExpandAnimationDuration * 0.6, + .damping = 1, + .velocity = 0.2 +}; + +YALCenterButtonAnimationsParameters const kYALCenterButtonExpandAnimationParameters = (YALCenterButtonAnimationsParameters) { + .rotation = (YALAnimationParameters) { + .duration = kYALExpandAnimationDuration / 4.0, + .fromValue = 0.0, + .toValue = M_PI * 2.0 + 45.0 * kDegreeToRadiansRatio + }, + .bounce = (YALAnimationParameters) { + .beginTime = kYALExpandAnimationDuration / 4.0, + .fromValue = 45.0 * kDegreeToRadiansRatio + M_PI / 8.0, + .toValue = 45.0 * kDegreeToRadiansRatio + } +}; + +YALCenterButtonAnimationsParameters const kYALCenterButtonCollapseAnimationParameters = (YALCenterButtonAnimationsParameters) { + .rotation = (YALAnimationParameters) { + .duration = kYALExpandAnimationDuration / 4.0, + .fromValue = 0.0, + .toValue = 315.0 * kDegreeToRadiansRatio + }, + .bounce = (YALAnimationParameters) { + .beginTime = kYALExpandAnimationDuration / 4.0, + .fromValue = M_PI / 8.0, + .toValue = 0.0 + } +}; + +YALSelectedDotAnimationsParameters const kYALSelectedDotAnimationsParameters = +(YALSelectedDotAnimationsParameters) { + .scaleX = (YALAnimationParameters) { + .duration = kYALExpandAnimationDuration / 4.0, + .fromValue = 0.0, + .toValue = 1.0 + }, + .scaleY = (YALAnimationParameters) { + .duration = kYALExpandAnimationDuration / 4.0, + .fromValue = 0.0, + .toValue = 1.0 + } +}; + +YALAdditionalButtonsAnimationsParameters const kYALAdditionalButtonsAnimationsParameters = (YALAdditionalButtonsAnimationsParameters) { + .scaleX = (YALAnimationParameters) { + .duration = kYALExpandAnimationDuration / 4.0, + .fromValue = 0.0, + .toValue = 1.0 + }, + .scaleY = (YALAnimationParameters) { + .duration = kYALExpandAnimationDuration / 4.0, + .fromValue = 0.0, + .toValue = 1.0 + }, + .rotation = (YALAnimationParameters) { + .duration = kYALExpandAnimationDuration / 4.0, + .fromValue = 0.0, + .toValue = M_PI * 2.0 * 5.0 + }, + .bounce = (YALAnimationParameters) { + .beginTime = kYALExpandAnimationDuration / 4.0, + .fromValue = M_PI / 8.0, + .toValue = 0.0 + } +}; + +YALExtraTabBarItemViewAnimationParameters const kYALShowExtraTabBarItemViewAnimationParameters = (YALExtraTabBarItemViewAnimationParameters) { + .duration = kYALExpandAnimationDuration / 2.0, + .damping = 0.5f, +}; + +YALExtraTabBarItemViewAnimationParameters const kYALHideExtraTabBarItemViewAnimationParameters = (YALExtraTabBarItemViewAnimationParameters) { + .duration = kYALExpandAnimationDuration / 8.0, +}; diff --git a/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Controller/FoldingTabBarController/YALFoldingTabBarController.h b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Controller/FoldingTabBarController/YALFoldingTabBarController.h new file mode 100644 index 0000000..197fc00 --- /dev/null +++ b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Controller/FoldingTabBarController/YALFoldingTabBarController.h @@ -0,0 +1,18 @@ +// For License please refer to LICENSE file in the root of YALAnimatingTabBarController project + +#import + +//view +#import "YALFoldingTabBar.h" + +@interface YALFoldingTabBarController : UITabBarController + +@property (nonatomic, copy) NSArray *leftBarItems; +@property (nonatomic, copy) NSArray *rightBarItems; +@property (nonatomic, strong) UIImage *centerButtonImage; + +@property (nonatomic, assign) CGFloat tabBarViewHeight; + +@property (nonatomic, strong) YALFoldingTabBar *tabBarView; + +@end diff --git a/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Controller/FoldingTabBarController/YALFoldingTabBarController.m b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Controller/FoldingTabBarController/YALFoldingTabBarController.m new file mode 100644 index 0000000..481ce43 --- /dev/null +++ b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Controller/FoldingTabBarController/YALFoldingTabBarController.m @@ -0,0 +1,177 @@ +// For License please refer to LICENSE file in the root of YALAnimatingTabBarController project + +#import "YALFoldingTabBarController.h" + +//model +#import "YALTabBarItem.h" + +//protocol +#import "YALTabBarInteracting.h" + +#import "YALAnimatingTabBarConstants.h" + +@interface YALFoldingTabBarController () + +@property (nonatomic, assign) YALTabBarState state; + +@end + +@implementation YALFoldingTabBarController + +#pragma mark - Initialization + +- (instancetype)init { + self = [super init]; + if (self) { + [self setup]; + } + return self; +} + +- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + [self setup]; + } + return self; +} + +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + if (self) { + [self setup]; + } + return self; +} + +- (void)setup { + self.tabBarViewHeight = YALTabBarViewDefaultHeight; + + [self setupTabBarView]; +} + +#pragma mark - View & LifeCycle + +- (void)viewDidLoad { + [super viewDidLoad]; + + [self.tabBar setBackgroundImage:[[UIImage alloc] init]]; + [self.tabBar setShadowImage:[[UIImage alloc] init]]; + + self.tabBar.hidden = YES; +} + +- (void)viewWillLayoutSubviews { + [super viewWillLayoutSubviews]; + + CGRect tabFrame = self.tabBar.frame; + tabFrame.size.height = self.tabBarViewHeight; + tabFrame.origin.y = self.view.frame.size.height - self.tabBarViewHeight; + self.tabBar.frame = tabFrame; +} + +- (void)viewDidLayoutSubviews { + [super viewDidLayoutSubviews]; + + [self updateTabBarViewFrame]; +} + +- (void)setSelectedIndex:(NSUInteger)selectedIndex { + [super setSelectedIndex:selectedIndex]; + + self.tabBarView.selectedTabBarItemIndex = selectedIndex; + [self.tabBarView setNeedsLayout]; +} + +#pragma mark - Private + +- (void)updateTabBarViewFrame { + CGFloat tabBarViewOriginX = self.tabBar.frame.origin.x; + CGFloat tabBarViewOriginY = self.tabBar.frame.origin.y; + CGFloat tabBarViewSizeWidth = CGRectGetWidth(self.tabBar.frame); + + self.tabBarView.frame = CGRectMake(tabBarViewOriginX, tabBarViewOriginY, tabBarViewSizeWidth, self.tabBarViewHeight); + [self.tabBarView setNeedsLayout]; +} + +- (void)setupTabBarView { + self.tabBarView = [[YALFoldingTabBar alloc] initWithFrame:CGRectZero state:self.state]; + + self.tabBarView.dataSource = self; + self.tabBarView.delegate = self; + + [self.view addSubview:self.tabBarView]; +} + +- (id)currentInteractingViewController { + if ([self.selectedViewController isKindOfClass:[UINavigationController class]]) { + return (id)[(UINavigationController *)self.selectedViewController topViewController]; + } else { + return (id)self.selectedViewController; + } +} + +#pragma mark - YALTabBarViewDataSource + +- (NSArray *)leftTabBarItemsInTabBarView:(YALFoldingTabBar *)tabBarView { + return self.leftBarItems; +} + +- (NSArray *)rightTabBarItemsInTabBarView:(YALFoldingTabBar *)tabBarView { + return self.rightBarItems; +} + +- (UIImage *)centerImageInTabBarView:(YALFoldingTabBar *)tabBarView { + return self.centerButtonImage; +} + +#pragma mark - YALTabBarViewDelegate + +- (void)tabBarViewWillCollapse:(YALFoldingTabBar *)tabBarView { + idviewController = [self currentInteractingViewController]; + if ([viewController respondsToSelector:@selector(tabBarViewWillCollapse)]) { + [viewController tabBarViewWillCollapse]; + } +} + +- (void)tabBarViewDidCollapse:(YALFoldingTabBar *)tabBarView { + idviewController = [self currentInteractingViewController]; + if ([viewController respondsToSelector:@selector(tabBarViewDidCollapse)]) { + [viewController tabBarViewDidCollapse]; + } +} + +- (void)tabBarViewWillExpand:(YALFoldingTabBar *)tabBarView { + idviewController = [self currentInteractingViewController]; + if ([viewController respondsToSelector:@selector(tabBarViewWillExpand)]) { + [viewController tabBarViewWillExpand]; + } +} + +- (void)tabBarViewDidExpand:(YALFoldingTabBar *)tabBarView { + idviewController = [self currentInteractingViewController]; + if ([viewController respondsToSelector:@selector(tabBarViewDidExpand)]) { + [viewController tabBarViewDidExpand]; + } +} + +- (void)extraLeftItemDidPressInTabBarView:(YALFoldingTabBar *)tabBarView { + idviewController = [self currentInteractingViewController]; + if ([viewController respondsToSelector:@selector(extraLeftItemDidPress)]) { + [viewController extraLeftItemDidPress]; + } +} + +- (void)extraRightItemDidPressInTabBarView:(YALFoldingTabBar *)tabBarView { + idviewController = [self currentInteractingViewController]; + if ([viewController respondsToSelector:@selector(extraRightItemDidPress)]) { + [viewController extraRightItemDidPress]; + } +} + +- (void)itemInTabBarViewPressed:(YALFoldingTabBar *)tabBarView atIndex:(NSUInteger)index { + self.selectedViewController = [self.viewControllers objectAtIndex:index]; +} + + +@end diff --git a/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Model/TabBarItem/YALTabBarItem.h b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Model/TabBarItem/YALTabBarItem.h new file mode 100644 index 0000000..6253fb0 --- /dev/null +++ b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Model/TabBarItem/YALTabBarItem.h @@ -0,0 +1,16 @@ +// For License please refer to LICENSE file in the root of YALAnimatingTabBarController project + +#import +#import + +@interface YALTabBarItem : NSObject + +@property (nonatomic, strong) UIImage *itemImage; +@property (nonatomic, strong) UIImage *leftImage; +@property (nonatomic, strong) UIImage *rightImage; + +- (instancetype)initWithItemImage:(UIImage *)itemImage + leftItemImage:(UIImage *)leftItemImage + rightItemImage:(UIImage *)rightItemImage; + +@end diff --git a/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Model/TabBarItem/YALTabBarItem.m b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Model/TabBarItem/YALTabBarItem.m new file mode 100644 index 0000000..2f9b0da --- /dev/null +++ b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Model/TabBarItem/YALTabBarItem.m @@ -0,0 +1,25 @@ +// For License please refer to LICENSE file in the root of YALAnimatingTabBarController project + +#import "YALTabBarItem.h" + +@interface YALTabBarItem () + +@end + +@implementation YALTabBarItem + +#pragma mark - Initialization + +- (instancetype)initWithItemImage:(UIImage *)itemImage + leftItemImage:(UIImage *)leftItemImage + rightItemImage:(UIImage *)rightItemImage { + self = [super init]; + if (self) { + _itemImage = itemImage; + _leftImage = leftItemImage; + _rightImage = rightItemImage; + } + return self; +} + +@end diff --git a/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Protocol/TabBarInteracting/YALTabBarInteracting.h b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Protocol/TabBarInteracting/YALTabBarInteracting.h new file mode 100644 index 0000000..811121a --- /dev/null +++ b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/Protocol/TabBarInteracting/YALTabBarInteracting.h @@ -0,0 +1,20 @@ +// For License please refer to LICENSE file in the root of YALAnimatingTabBarController project + +#import + +@class YALFoldingTabBar; + +@protocol YALTabBarInteracting + +@optional + +- (void)tabBarViewWillCollapse; +- (void)tabBarViewWillExpand; + +- (void)tabBarViewDidCollapse; +- (void)tabBarViewDidExpand; + +- (void)extraLeftItemDidPress; +- (void)extraRightItemDidPress; + +@end diff --git a/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/View/FoldingTabBar/YALFoldingTabBar.h b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/View/FoldingTabBar/YALFoldingTabBar.h new file mode 100644 index 0000000..c79c17e --- /dev/null +++ b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/View/FoldingTabBar/YALFoldingTabBar.h @@ -0,0 +1,54 @@ +// For License please refer to LICENSE file in the root of YALAnimatingTabBarController project + +#import + +@class YALFoldingTabBar; + +@protocol YALTabBarViewDataSource + +@required +- (NSArray *)leftTabBarItemsInTabBarView:(YALFoldingTabBar *)tabBarView; +- (NSArray *)rightTabBarItemsInTabBarView:(YALFoldingTabBar *)tabBarView; +- (UIImage *)centerImageInTabBarView:(YALFoldingTabBar *)tabBarView; + +@end + +@protocol YALTabBarViewDelegate + +@optional +- (void)itemInTabBarViewPressed:(YALFoldingTabBar *)tabBarView atIndex:(NSUInteger)index; + +- (void)tabBarViewWillCollapse:(YALFoldingTabBar *)tabBarView; +- (void)tabBarViewWillExpand:(YALFoldingTabBar *)tabBarView; + +- (void)tabBarViewDidCollapse:(YALFoldingTabBar *)tabBarView; +- (void)tabBarViewDidExpand:(YALFoldingTabBar *)tabBarView; + +- (void)extraLeftItemDidPressInTabBarView:(YALFoldingTabBar *)tabBarView; +- (void)extraRightItemDidPressInTabBarView:(YALFoldingTabBar *)tabBarView; + +@end + +typedef NS_ENUM(NSUInteger, YALTabBarState) { + YALStateCollapsed, + YALStateExpanded +}; + +@interface YALFoldingTabBar : UIView + +- (instancetype)initWithFrame:(CGRect)frame state:(YALTabBarState)state; + +@property (nonatomic, weak) IBOutlet id dataSource; +@property (nonatomic, weak) IBOutlet id delegate; + +@property (nonatomic, assign, readonly) YALTabBarState state; +@property (nonatomic, assign) NSUInteger selectedTabBarItemIndex; + +@property (nonatomic, copy) UIColor *tabBarColor; +@property (nonatomic, copy) UIColor *dotColor; +@property (nonatomic, assign) UIEdgeInsets tabBarViewEdgeInsets; +@property (nonatomic, assign) UIEdgeInsets tabBarItemsEdgeInsets; +@property (nonatomic, assign) CGFloat extraTabBarItemHeight; +@property (nonatomic, assign) CGFloat offsetForExtraTabBarItems; + +@end diff --git a/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/View/FoldingTabBar/YALFoldingTabBar.m b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/View/FoldingTabBar/YALFoldingTabBar.m new file mode 100644 index 0000000..0d89083 --- /dev/null +++ b/grocery-objc/Pods/FoldingTabBar/FoldingTabBar/View/FoldingTabBar/YALFoldingTabBar.m @@ -0,0 +1,667 @@ +// For License please refer to LICENSE file in the root of YALAnimatingTabBarController project + +#import "YALFoldingTabBar.h" + +//model +#import "YALTabBarItem.h" + +#import "CAAnimation+YALTabBarViewAnimations.h" +#import "CATransaction+TransactionWithAnimationsAndCompletion.h" + +typedef NS_ENUM(NSUInteger, YALAnimatingState) { + YALAnimatingStateCollapsing, + YALAnimatingStateExpanding +}; + +#import "YALAnimatingTabBarConstants.h" + +@interface YALFoldingTabBar () + +@property (nonatomic, strong) NSArray *allBarItems; + +@property (nonatomic, assign) YALTabBarState state; +@property (nonatomic, assign) YALAnimatingState animatingState; +@property (nonatomic, assign) BOOL isFinishedCenterButtonAnimation; + +@property (nonatomic, strong) UIButton *centerButton; +@property (nonatomic, strong) UIView *mainView; + +@property (nonatomic, assign) BOOL isAnimated; + +@property (nonatomic, assign) CGRect collapsedFrame; +@property (nonatomic, assign) CGRect expandedFrame; + +@property (nonatomic, assign) CGRect collapsedBounds; +@property (nonatomic, assign) CGRect expandedBounds; + +@property (nonatomic, assign) NSUInteger counter; + +//buttons used instead of native tabBarItems to switch between controllers +@property (nonatomic, strong) NSArray *leftButtonsArray; +@property (nonatomic, strong) NSArray *rightButtonsArray; + +//extra buttons 'tabBarItems' for each 'tabBarItem' +@property (nonatomic, strong) UIButton *extraLeftButton; +@property (nonatomic, strong) UIButton *extraRightButton; + +//model representation of tabBarItems. also contains info for extraBarItems: image, color, etc +@property (nonatomic, strong) NSDictionary *leftTabBarItems; +@property (nonatomic, strong) NSDictionary *rightTabBarItems; + +//array of all buttons just for simple switching between controllers by index +@property (nonatomic, strong) NSArray *allAdditionalButtons; +@property (nonatomic, strong) NSMutableArray *allAdditionalButtonsBottomView; + +@end + +@implementation YALFoldingTabBar + +#pragma mark - Initialations + +- (instancetype)initWithFrame:(CGRect)frame state:(YALTabBarState)state { + self = [super initWithFrame:frame]; + if (self) { + _state = state; + _selectedTabBarItemIndex = 0; + _counter = 0; + } + return self; +} + +- (void)layoutSubviews { + [super layoutSubviews]; + + [self setupUI]; +} + +#pragma mark - Private + +- (void)setupUI { + [self removeViewsBeforeUpdateUI]; + + [self setupMainView]; + [self setupCenterButton]; + + //collapsed frame equals to frame of the centerButton + self.collapsedFrame = self.centerButton.frame; + + [self setupAdditionalTabBarItems]; + + [self updateMaskLayer]; + + [self setupExtraTabBarItems]; + [self setupTabBarItemsViewRepresentation]; + [self setupBarItemsModelRepresentation]; + [self prepareTabBarViewForInitialState]; +} + +- (void)removeViewsBeforeUpdateUI { + + if (self.mainView) { + [self.mainView removeFromSuperview]; + self.mainView = nil; + } + + if (self.extraLeftButton) { + [self.extraLeftButton removeFromSuperview]; + self.extraLeftButton = nil; + } + + if (self.extraRightButton) { + [self.extraRightButton removeFromSuperview]; + self.extraRightButton = nil; + } + + if (self.centerButton) { + [self.centerButton removeFromSuperview]; + self.centerButton = nil; + } +} + +- (void)setupCenterButton { + self.centerButton = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMidX(self.mainView.frame) - CGRectGetHeight(self.mainView.frame) / 2.0f, + CGRectGetMidY(self.mainView.frame) - CGRectGetHeight(self.mainView.frame) / 2.f, + CGRectGetHeight(self.mainView.frame), + CGRectGetHeight(self.mainView.frame))]; + + self.centerButton.layer.cornerRadius = CGRectGetHeight(self.mainView.bounds) / 2.f; + + if ([self.dataSource respondsToSelector:@selector(centerImageInTabBarView:)]) { + [self.centerButton setImage:[self.dataSource centerImageInTabBarView:self] forState:UIControlStateNormal]; + } + + [self.centerButton addTarget:self action:@selector(centerButtonPressed) forControlEvents:UIControlEventTouchUpInside]; + self.centerButton.adjustsImageWhenHighlighted = NO; + + [self addSubview:self.centerButton]; +} + +- (void)setupMainView { + self.mainView = [[UIView alloc] initWithFrame:UIEdgeInsetsInsetRect(self.bounds, self.tabBarViewEdgeInsets)]; + + self.expandedFrame = self.mainView.frame; + self.mainView.layer.cornerRadius = CGRectGetHeight(self.mainView.bounds) / 2.f; + self.mainView.layer.masksToBounds = YES; + self.mainView.backgroundColor = self.tabBarColor; + + [self addSubview:self.mainView]; +} + +- (void)setupAdditionalTabBarItems { + NSArray *leftTabBarItems = [self.dataSource leftTabBarItemsInTabBarView:self]; + NSArray *rightTabBarItems = [self.dataSource rightTabBarItemsInTabBarView:self]; + + NSUInteger numberOfLeftTabBarButtonItems = [leftTabBarItems count]; + NSUInteger numberOfRightTabBarButtonItems = [rightTabBarItems count]; + + //calculate available space for left and right side + CGFloat availableSpaceForAdditionalBarButtonItemLeft = CGRectGetWidth(self.mainView.frame) / 2.f - CGRectGetWidth(self.centerButton.frame) / 2.f - self.tabBarItemsEdgeInsets.left; + + CGFloat availableSpaceForAdditionalBarButtonItemRight = CGRectGetWidth(self.mainView.frame) / 2.f - CGRectGetWidth(self.centerButton.frame) / 2.f - self.tabBarItemsEdgeInsets.right; + + CGFloat maxWidthForLeftBarButonItem = availableSpaceForAdditionalBarButtonItemLeft / numberOfLeftTabBarButtonItems; + CGFloat maxWidthForRightBarButonItem = availableSpaceForAdditionalBarButtonItemRight / numberOfRightTabBarButtonItems; + + NSMutableArray * reverseArrayLeft = [NSMutableArray arrayWithCapacity:[self.leftButtonsArray count]]; + + for (id element in [leftTabBarItems reverseObjectEnumerator]) { + [reverseArrayLeft addObject:element]; + } + + NSMutableArray *mutableArray = [NSMutableArray array]; + NSMutableArray *mutableDotsArray = [NSMutableArray array]; + + CGFloat deltaLeft = 0.f; + if (maxWidthForLeftBarButonItem > CGRectGetWidth(self.centerButton.frame)) { + deltaLeft = maxWidthForLeftBarButonItem - CGRectGetWidth(self.centerButton.frame); + } + + CGFloat startPositionLeft = CGRectGetWidth(self.mainView.bounds) / 2.f - CGRectGetWidth(self.centerButton.frame) / 2.f - self.tabBarItemsEdgeInsets.left - deltaLeft / 2.f; + + for (int i = 0; i < numberOfLeftTabBarButtonItems; i++) { + CGFloat buttonOriginX = startPositionLeft - maxWidthForLeftBarButonItem * (i+1); + CGFloat buttonOriginY = 0.f; + + CGFloat buttonWidth = maxWidthForLeftBarButonItem; + CGFloat buttonHeight = CGRectGetHeight(self.mainView.frame); + + startPositionLeft -= self.tabBarItemsEdgeInsets.right; + + YALTabBarItem *item = reverseArrayLeft[i]; + UIImage *image = item.itemImage; + + UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(buttonOriginX, buttonOriginY, buttonWidth, buttonHeight)]; + + if (numberOfLeftTabBarButtonItems == 1) { + CGRect rect = button.frame; + rect.size.width = CGRectGetHeight(self.mainView.frame); + button.bounds = rect; + } + + [button setImage:image forState:UIControlStateNormal]; + [button addTarget:self action:@selector(barItemDidTapped:) forControlEvents:UIControlEventTouchUpInside]; + + if (self.state == YALStateCollapsed) { + button.hidden = YES; + } + + + [mutableArray addObject:button]; + button.adjustsImageWhenHighlighted = NO; + + [self.mainView addSubview:button]; + } + + NSMutableArray * reverseArrayLeftDotViews = [NSMutableArray arrayWithCapacity:[mutableDotsArray count]]; + + for (id element in [mutableDotsArray reverseObjectEnumerator]) { + [reverseArrayLeft addObject:element]; + } + mutableDotsArray = reverseArrayLeftDotViews; + + self.leftButtonsArray = [mutableArray copy]; + + [mutableArray removeAllObjects]; + + CGFloat rightDelta = 0.f; + if (maxWidthForRightBarButonItem > CGRectGetWidth(self.centerButton.frame)) { + rightDelta = maxWidthForRightBarButonItem - CGRectGetWidth(self.centerButton.frame); + } + + CGFloat rightOffset = self.tabBarItemsEdgeInsets.right; + CGFloat startPositionRight = CGRectGetWidth(self.mainView.bounds) / 2.f + CGRectGetWidth(self.centerButton.frame) / 2.f + self.tabBarItemsEdgeInsets.right + + rightDelta / 2.f; + + for (int i = 0; i < numberOfRightTabBarButtonItems; i++) { + CGFloat buttonOriginX = startPositionRight; + CGFloat buttonOriginY = 0.f; + CGFloat buttonWidth = maxWidthForRightBarButonItem; + CGFloat buttonHeight = CGRectGetHeight(self.mainView.frame); + + startPositionRight = buttonOriginX + maxWidthForRightBarButonItem + rightOffset; + + YALTabBarItem *item = rightTabBarItems [i]; + UIImage *image = item.itemImage; + + UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(buttonOriginX, buttonOriginY, buttonWidth, buttonHeight)]; + + if (numberOfLeftTabBarButtonItems == 1) { + CGRect rect = button.frame; + rect.size.width = CGRectGetHeight(self.mainView.frame); + button.bounds = rect; + } + + [button setImage:image forState:UIControlStateNormal]; + [button addTarget:self action:@selector(barItemDidTapped:) forControlEvents:UIControlEventTouchUpInside]; + + if (self.state == YALStateCollapsed) { + button.hidden = YES; + } + [mutableArray addObject:button]; + button.adjustsImageWhenHighlighted = NO; + [self.mainView addSubview:button]; + } + + self.rightButtonsArray = [mutableArray copy]; +} + +//collect all tabBarItems (models) to one array +- (void)setupBarItemsModelRepresentation { + NSMutableArray *tempMutableArrayOfBarItems = [NSMutableArray array]; + + NSArray *leftTabBarItems = [self.dataSource leftTabBarItemsInTabBarView:self]; + NSArray *rightTabBarItems = [self.dataSource rightTabBarItemsInTabBarView:self]; + + for (YALTabBarItem *item in leftTabBarItems) { + [tempMutableArrayOfBarItems addObject:item]; + } + + for (YALTabBarItem *item in rightTabBarItems) { + [tempMutableArrayOfBarItems addObject:item]; + } + + self.allBarItems = [tempMutableArrayOfBarItems copy]; +} + +- (void)setupExtraTabBarItems { + self.extraLeftButton = [[UIButton alloc] initWithFrame:CGRectMake(0.0f, CGRectGetMidY(self.mainView.frame) - CGRectGetHeight(self.mainView.frame) / 2.f, self.extraTabBarItemHeight, self.extraTabBarItemHeight)]; + self.extraLeftButton.center = CGPointMake( - CGRectGetWidth(self.extraLeftButton.frame) / 2, self.mainView.center.y); + self.extraLeftButton.backgroundColor = self.tabBarColor; + self.extraLeftButton.layer.cornerRadius = CGRectGetWidth(self.extraLeftButton.frame) / 2.f; + self.extraLeftButton.layer.masksToBounds = YES; + + [self.extraLeftButton addTarget:self action:@selector(extraLeftButtonDidPress) forControlEvents:UIControlEventTouchUpInside]; + self.extraLeftButton.hidden = YES; + + [self addSubview:self.extraLeftButton]; + + self.extraRightButton = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.frame) - CGRectGetWidth(self.centerButton.frame), CGRectGetMidY(self.mainView.frame) - CGRectGetHeight(self.mainView.frame) / 2.f, self.extraTabBarItemHeight, self.extraTabBarItemHeight)]; + self.extraRightButton.center = CGPointMake(self.extraRightButton.center.x + CGRectGetWidth(self.extraRightButton.frame) , self.mainView.center.y); + self.extraRightButton.layer.cornerRadius = CGRectGetWidth(self.extraLeftButton.frame) / 2.f; + self.extraLeftButton.layer.masksToBounds = YES; + + self.extraRightButton.backgroundColor = self.tabBarColor; + [self.extraRightButton addTarget:self action:@selector(extraRightButtonDidPress) forControlEvents:UIControlEventTouchUpInside]; + self.extraRightButton.hidden = YES; + + [self addSubview:self.extraRightButton]; +} + +- (void)setupTabBarItemsViewRepresentation { + NSMutableArray *tempArray = [NSMutableArray array]; + NSMutableArray *reverseArray = [NSMutableArray arrayWithCapacity:[self.leftButtonsArray count]]; + + for (id element in [self.leftButtonsArray reverseObjectEnumerator]) { + [reverseArray addObject:element]; + } + + for (UIButton *button in [reverseArray arrayByAddingObjectsFromArray:self.rightButtonsArray]) { + [tempArray addObject:button]; + } + + self.allAdditionalButtons = [tempArray copy]; + + self.allAdditionalButtonsBottomView = [[NSMutableArray alloc] init];; + for (UIButton *button in self.allAdditionalButtons) { + UIView *dotView = [[UIView alloc] initWithFrame:CGRectMake(0.f, 0.f, YALBottomSelectedDotDefaultSize,YALBottomSelectedDotDefaultSize)]; + dotView.center = CGPointMake(button.center.x, button.center.y + YALBottomSelectedDotOffset); + dotView.layer.cornerRadius = CGRectGetHeight(dotView.frame) / 2.f; + dotView.backgroundColor = self.dotColor ? self.dotColor : [UIColor blackColor]; + dotView.hidden = YES; + [self.mainView addSubview:dotView]; + [self.allAdditionalButtonsBottomView addObject:dotView]; + } +} + +- (void)prepareTabBarViewForInitialState { + + if (![self hasTabBarItems]) { + return ; + } + + //collapse mainView. tabBarItams are hidden. + if (self.state == YALStateExpanded) { + self.centerButton.transform = CGAffineTransformMakeRotation(M_PI_4); + } + self.mainView.frame = self.expandedFrame; + + //prepare current selected tabBarItem + NSUInteger index = self.selectedTabBarItemIndex; + + if (self.selectedTabBarItemIndex != index) { + UIView *previousSelectedDotView = self.allAdditionalButtonsBottomView [self.selectedTabBarItemIndex]; + previousSelectedDotView.hidden = YES; + [self.allAdditionalButtonsBottomView replaceObjectAtIndex:self.selectedTabBarItemIndex withObject:previousSelectedDotView]; + } + + if (self.state == YALStateExpanded) { + + UIView *previousSelectedDotView = self.allAdditionalButtonsBottomView [self.selectedTabBarItemIndex]; + previousSelectedDotView.hidden = NO; + [self.allAdditionalButtonsBottomView replaceObjectAtIndex:self.selectedTabBarItemIndex withObject:previousSelectedDotView]; + } + + if (self.state == YALStateExpanded && self.selectedTabBarItemIndex == index) { + [self hideExtraLeftTabBarItem]; + [self hideExtraRightTabBarItem]; + } + + self.selectedTabBarItemIndex = index; + + //check if selected view controller needs extraLeftButton or extraRightButton + YALTabBarItem *defaultSelectedTabBarItem = [self.allBarItems objectAtIndex:index]; + [self configureExtraTabBarItemWithModel:defaultSelectedTabBarItem]; + if (self.state == YALStateCollapsed) { + + + if (defaultSelectedTabBarItem.leftImage) { + self.extraLeftButton.center = CGPointMake(self.offsetForExtraTabBarItems + CGRectGetWidth(self.extraLeftButton.frame) / 2.f, self.extraLeftButton.center.y); + } + + if (defaultSelectedTabBarItem.rightImage) { + self.extraRightButton.center = CGPointMake(CGRectGetWidth(self.frame) - self.offsetForExtraTabBarItems - CGRectGetWidth(self.extraRightButton.frame) / 2.f, self.extraRightButton.center.y); + } + } +} + +- (void)configureExtraTabBarItemWithModel:(YALTabBarItem *)item { + if (item.leftImage) { + self.extraLeftButton.hidden = NO; + [self.extraLeftButton setImage:item.leftImage forState:UIControlStateNormal]; + } else { + self.extraLeftButton.hidden = YES; + } + if (item.rightImage) { + self.extraRightButton.hidden = NO; + [self.extraRightButton setImage:item.rightImage forState:UIControlStateNormal]; + } else { + self.extraRightButton.hidden = YES; + } +} + +- (BOOL)hasTabBarItems { + return (self.allBarItems.count); +} + +#pragma mark - Actions + +- (void)centerButtonPressed { + //we should wait until animation cycle is finished + + if (![self hasTabBarItems]) { + return ; + } + + self.counter ++; + + if (!self.isAnimated) { + if (self.state == YALStateCollapsed) { + [self expand]; + } else { + [self collapse]; + } + } else { + if (self.animatingState == YALAnimatingStateCollapsing) { + [self expand]; + } else if (self.animatingState == YALAnimatingStateExpanding) { + [self collapse]; + } + } +} + +- (IBAction)barItemDidTapped:(id)sender { + if (self.isAnimated) { + return; + } + + NSUInteger index = [self.allAdditionalButtons indexOfObject:sender]; + + if (self.selectedTabBarItemIndex != index) { + YALTabBarItem *item = [self.allBarItems objectAtIndex:index]; + [self configureExtraTabBarItemWithModel:item]; + + UIView *previousSelectedDotView = self.allAdditionalButtonsBottomView[self.selectedTabBarItemIndex]; + previousSelectedDotView.hidden = YES; + [self.allAdditionalButtonsBottomView replaceObjectAtIndex:self.selectedTabBarItemIndex withObject:previousSelectedDotView]; + } + + self.selectedTabBarItemIndex = index; + + if ([self.delegate respondsToSelector:@selector(tabBarViewWillCollapse:)]) { + [self.delegate tabBarViewWillCollapse:self]; + } + + [self collapse]; + + if ([self.delegate respondsToSelector:@selector(itemInTabBarViewPressed:atIndex:)]) { + [self.delegate itemInTabBarViewPressed:self atIndex:index]; + } +} + +- (void)extraLeftButtonDidPress { + if ([self.delegate respondsToSelector:@selector(extraLeftItemDidPressInTabBarView:)]) { + [self.delegate extraLeftItemDidPressInTabBarView:self]; + } +} + +- (void)extraRightButtonDidPress { + if ([self.delegate respondsToSelector:@selector(extraRightItemDidPressInTabBarView:)]) { + [self.delegate extraRightItemDidPressInTabBarView:self]; + } +} + +#pragma mark - expand/collapse + +- (void)expand { + self.isFinishedCenterButtonAnimation = NO; + self.animatingState = YALAnimatingStateExpanding; + self.state = YALStateExpanded; + + if ([self.delegate respondsToSelector:@selector(tabBarViewWillExpand:)]) { + [self.delegate tabBarViewWillExpand:self]; + } + + __block NSUInteger counterCurrentValue = self.counter; + + [CATransaction transactionWithAnimations:^{ + self.isAnimated = YES; + [self animateTabBarViewExpand]; + [self hideExtraLeftTabBarItem]; + [self hideExtraRightTabBarItem]; + [self animateCenterButtonExpand]; + [self animateAdditionalButtons]; + [self showSelectedDotView]; + } andCompletion:^{ + if (counterCurrentValue == self.counter) { + if ([self.delegate respondsToSelector:@selector(tabBarViewDidExpand:)]) { + [self.delegate tabBarViewDidExpand:self]; + } + self.isAnimated = NO; + } + }]; +} + +- (void)collapse { + self.isFinishedCenterButtonAnimation = NO; + self.animatingState = YALAnimatingStateCollapsing; + self.state = YALStateCollapsed; + + if ([self.delegate respondsToSelector:@selector(tabBarViewWillCollapse:)]) { + [self.delegate tabBarViewWillCollapse:self]; + } + + __block NSUInteger counterCurrentValue = self.counter; + + [CATransaction transactionWithAnimations:^{ + self.isAnimated = YES; + [self animateTabBarViewCollapse]; + [self showExtraLeftTabBarItem]; + [self showExtraRightTabBarItem]; + [self animateCenterButtonCollapse]; + [self hideSelectedDotView]; + [self animateAdditionalButtons]; + } andCompletion:^{ + if (counterCurrentValue == self.counter) { + if ([self.delegate respondsToSelector:@selector(tabBarViewDidCollapse:)]) { + [self.delegate tabBarViewDidCollapse:self]; + } + } + self.isAnimated = NO; + }]; +} + +- (void)hideSelectedDotView { + UIView *previousSelectedDotView = self.allAdditionalButtonsBottomView[self.selectedTabBarItemIndex]; + previousSelectedDotView.hidden = YES; + [self.allAdditionalButtonsBottomView replaceObjectAtIndex:self.selectedTabBarItemIndex withObject:previousSelectedDotView]; +} + +- (void)showSelectedDotView { + UIView *previousSelectedDotView = self.allAdditionalButtonsBottomView[self.selectedTabBarItemIndex]; + previousSelectedDotView.hidden = NO; + [previousSelectedDotView.layer addAnimation:[CAAnimation showSelectedDotAnimation] forKey:nil]; + [self.allAdditionalButtonsBottomView replaceObjectAtIndex:self.selectedTabBarItemIndex withObject:previousSelectedDotView]; +} + +#pragma mark - Animations + +- (void)animateAdditionalButtons { + for (UIView *button in self.allAdditionalButtons) { + if (button.hidden) { + [button.layer addAnimation:[CAAnimation animationForAdditionalButton] forKey:nil]; + } + + button.hidden = !button.hidden; + } +} + +- (void)animateTabBarViewExpand { + CAAnimation *animation = [CAAnimation animationForTabBarExpandFromRect:self.collapsedBounds toRect:self.expandedBounds]; + animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; + [self.mainView.layer.mask addAnimation:animation forKey:nil]; +} + +- (void)animateTabBarViewCollapse { + CAAnimation *animation = [CAAnimation animationForTabBarCollapseFromRect:self.expandedBounds toRect:self.collapsedBounds]; + animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; + [self.mainView.layer.mask addAnimation:animation forKey:nil]; +} + +- (void)showExtraLeftTabBarItem { + [UIView animateWithDuration:kYALShowExtraTabBarItemViewAnimationParameters.duration + delay:kYALShowExtraTabBarItemViewAnimationParameters.delay + usingSpringWithDamping:kYALShowExtraTabBarItemViewAnimationParameters.damping + initialSpringVelocity:kYALShowExtraTabBarItemViewAnimationParameters.velocity + options:kYALShowExtraTabBarItemViewAnimationParameters.options + animations:^{ + self.extraLeftButton.center = CGPointMake(CGRectGetWidth(self.extraLeftButton.frame) / 2.f + self.offsetForExtraTabBarItems, self.extraLeftButton.center.y); + } completion:NULL]; + + CAAnimation *animation = [CAAnimation animationForExtraLeftBarItem]; + [self.extraLeftButton.layer addAnimation:animation forKey:nil]; +} + +- (void)showExtraRightTabBarItem { + [UIView animateWithDuration:kYALShowExtraTabBarItemViewAnimationParameters.duration + delay:kYALShowExtraTabBarItemViewAnimationParameters.delay + usingSpringWithDamping:kYALShowExtraTabBarItemViewAnimationParameters.damping + initialSpringVelocity:kYALShowExtraTabBarItemViewAnimationParameters.velocity + options:kYALShowExtraTabBarItemViewAnimationParameters.options + animations:^{ + self.extraRightButton.center = CGPointMake(CGRectGetWidth(self.frame) - CGRectGetWidth(self.extraRightButton.frame) / 2.f - self.offsetForExtraTabBarItems, self.extraRightButton.center.y); + } completion:NULL]; + + CAAnimation *animation = [CAAnimation animationForExtraRightBarItem]; + [self.extraRightButton.layer addAnimation:animation forKey:nil]; +} + +- (void)hideExtraLeftTabBarItem { + [UIView animateWithDuration:kYALHideExtraTabBarItemViewAnimationParameters.duration + animations:^{ + self.extraLeftButton.center = CGPointMake( - CGRectGetWidth(self.extraLeftButton.frame) / 2.f, self.extraLeftButton.center.y); + }]; +} + +- (void)hideExtraRightTabBarItem { + [UIView animateWithDuration:kYALHideExtraTabBarItemViewAnimationParameters.duration + animations:^{ + self.extraRightButton.center = CGPointMake(self.extraRightButton.center.x + CGRectGetWidth(self.extraRightButton.frame) + self.offsetForExtraTabBarItems, self.extraRightButton.center.y); + }]; +} + +- (void)animateCenterButtonExpand { + CAAnimation *animation = [CAAnimation animationForCenterButtonExpand]; + [self.centerButton.layer addAnimation:animation forKey:nil]; +} + +- (void)animateCenterButtonCollapse { + CAAnimation *animation = [CAAnimation animationForCenterButtonCollapse]; + [self.centerButton.layer addAnimation:animation forKey:nil]; +} + +#pragma mark - Mutators + +- (void)setTabBarColor:(UIColor *)tabBarColor { + _tabBarColor = tabBarColor; + self.mainView.backgroundColor = self.tabBarColor; + self.extraLeftButton.backgroundColor = self.tabBarColor; + self.extraRightButton.backgroundColor = self.tabBarColor; +} + +- (void)setCollapsedFrame:(CGRect)collapsedFrame { + _collapsedFrame = collapsedFrame; + + self.collapsedBounds = ({ + CGRect collapsedBounds = collapsedFrame; + collapsedBounds.origin = CGPointZero; + collapsedBounds.origin.x = CGRectGetWidth(self.expandedFrame) / 2 - CGRectGetWidth(collapsedBounds) / 2; + collapsedBounds; + }); + [self updateMaskLayer]; +} + +- (void)setExpandedFrame:(CGRect)expandedFrame { + _expandedFrame = expandedFrame; + + self.expandedBounds = ({ + CGRect expandedBounds = expandedFrame; + expandedBounds.origin = CGPointZero; + expandedBounds; + }); + [self updateMaskLayer]; +} + +#pragma mark - Private + +- (void)updateMaskLayer { + self.mainView.layer.mask = ({ + CAShapeLayer *layer = [CAShapeLayer new]; + CGRect rect = (self.state == YALStateExpanded) ? self.expandedBounds : self.collapsedBounds; + + layer.path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:rect.size.height / 2].CGPath; + + layer; + }); +} + +@end diff --git a/LICENSE b/grocery-objc/Pods/FoldingTabBar/LICENSE similarity index 96% rename from LICENSE rename to grocery-objc/Pods/FoldingTabBar/LICENSE index 475e67f..01ace4b 100644 --- a/LICENSE +++ b/grocery-objc/Pods/FoldingTabBar/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 C4Q Access Code 2.2 +Copyright (c) 2015 Yalantis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,3 +19,4 @@ 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. + diff --git a/grocery-objc/Pods/FoldingTabBar/README.md b/grocery-objc/Pods/FoldingTabBar/README.md new file mode 100644 index 0000000..49808a8 --- /dev/null +++ b/grocery-objc/Pods/FoldingTabBar/README.md @@ -0,0 +1,160 @@ +# FoldingTabBar.iOS + +Folding Tab Bar and Tab Bar Controller + +Made in [![Yalantis](https://raw.githubusercontent.com/Yalantis/FoldingTabBar.iOS/master/Example/Example/Resources/Images/badge_orage_shadow.png)](https://yalantis.com/?utm_source=github) + +Inspired by [this project on Dribbble](https://dribbble.com/shots/2003376-Tab-Bar-Animation) + +Also, read how it was done in our [blog](https://yalantis.com/blog/how_we_created_tab_bar_animation_for_ios/?utm_source=github) + +![Preview](https://d13yacurqjgara.cloudfront.net/users/495792/screenshots/2003376/tab_bar_animation_fin-02.gif) + + +## Requirements +iOS 7.0 + +## Installation + +####[CocoaPods](http://cocoapods.org) +```ruby +pod 'FoldingTabBar', '~> 1.0.1' +``` + +####Manual Installation + +Alternatively you can directly add all the source files from FoldingTabBar folder to your project. + +1. Download the [latest code version](https://github.com/Yalantis/FoldingTabBar.iOS/archive/master.zip) or add the repository as a git submodule to your git-tracked project. +2. Open your project in Xcode, then drag and drop all the folder directories in FoldingTabBar folder onto your project (use the "Product Navigator view"). Make sure to select Copy items when asked if you extracted the code archive outside of your project. + + +##Introduction + +####YALFoldingTabBarController +`YALFoldingTabBarController` is a subclass of `UITabBarController` with custom animating `YALFoldingTabBar`. + +####YALFoldingTabBar +YALFoldingTabBar is a subclass of a standard UIView. We wanted to make this component expand and contract in response to a user tapping. When the component is closed you can only see a central button (“+”). When tapping on it, our custom Tab Bar expands letting other tabBarItems appear, so that the user can switch the controllers. + +Each separate tabBarItem can have two additional buttons on the left and right. These buttons can be used to let a user interact with a selected screen on the YALFoldingTabBarController without even having to leave it. + +####YALTabBarItem +`YALTabBarItem` is a model to configure your tab bar items with images. + + +##Usage + +Option 1: The simplest way is to use `YALFoldingTabBarController` as it is. You can also subclass it if you indend to change the default behaviour. + +Option 2: You can write your own implementation of `UITabBarController `and use `YALFoldingTabBar` or its subclass. + +Here is an instruction of how to use `YALFoldingTabBarController` in the Storyboard. + +1. Add native `UITabBarController` to the storyboard, establish relationships with its view controllers. +2. Choose `YALFoldingTabBarController` as custom class for `UITabBarController`. +3. In AppDelegate method take out an instance of `YALFoldingTabBarController` from the window.rootViewController and supply it with images for the left and right tabBarItems respectively. Also you can add your own image for the center button of `YALFoldingTabBar`. + +```objective-c + YALFoldingTabBarController *tabBarController = (YALFoldingTabBarController *) self.window.rootViewController; + + //prepare leftBarItems + YALTabBarItem *item1 = [[YALTabBarItem alloc] initWithItemImage:[UIImage imageNamed:@"nearby_icon"] + leftItemImage:nil + rightItemImage:nil]; + + + YALTabBarItem *item2 = [[YALTabBarItem alloc] initWithItemImage:[UIImage imageNamed:@"profile_icon"] + leftItemImage:[UIImage imageNamed:@"edit_icon"] + rightItemImage:nil]; + + tabBarController.leftBarItems = @[item1, item2]; + + //prepare rightBarItems + YALTabBarItem *item3 = [[YALTabBarItem alloc] initWithItemImage:[UIImage imageNamed:@"chats_icon"] + leftItemImage:[UIImage imageNamed:@"search_icon"] + rightItemImage:[UIImage imageNamed:@"new_chat_icon"]]; + + + YALTabBarItem *item4 = [[YALTabBarItem alloc] initWithItemImage:[UIImage imageNamed:@"settings_icon"] + leftItemImage:nil + rightItemImage:nil]; + +``` + +If you want to handle touches on extra tabBarItems import `YALTabBarInteracting` protocol to the subclass of the proper `UIVIewController` and implement these methods: + +```objective-c +- (void)extraLeftItemDidPressed; +- (void)extraRightItemDidPressed; +``` + If you want to observe contracting and expanding animation states in `YALFoldingTabBar` the following methods of `YALTabBarInteracting` protocol can be implemented: +```objective-c +- (void)tabBarViewWillCollapse; +- (void)tabBarViewWillExpand; + +- (void)tabBarViewDidCollapsed; +- (void)tabBarViewDidExpanded; +``` + +##Important notes +Because we changed the height of the default `UITabBar` you should adjust your content to the bottom of viewcontroller's superview, and ignore Bottom Layout Guide. You should also uncheck 'Under bottom bars' !['](http://i.stack.imgur.com/Owlcz.png) + +You can see how we did it on the example project. + +##Tips for customization +You can make the following configurations for custom tabBar: + +1) Specify height +```objective-c +tabBarController.tabBarViewHeight = YALTabBarViewDefaultHeight; +``` +2) Specify insets and offsets +```objective-c + tabBarController.tabBarView.tabBarViewEdgeInsets = YALTabBarViewHDefaultEdgeInsets; + tabBarController.tabBarView.tabBarItemsEdgeInsets = YALTabBarViewItemsDefaultEdgeInsets; + tabBarController.tabBarView.offsetForExtraTabBarItems = YALForExtraTabBarItemsDefaultOffset; + +``` +3) Specify colors +```objective-c + tabBarController.tabBarView.backgroundColor = [UIColor colorWithRed:94.0/255.0 green:91.0/255.0 blue:149.0/255.0 alpha:1]; + tabBarController.tabBarView.tabBarColor = [UIColor colorWithRed:72.0/255.0 green:211.0/255.0 blue:178.0/255.0 alpha:1]; +``` +4) Specify height for additional left and right buttons +```objective-c + tabBarController.tabBarView.extraTabBarItemHeight = YALExtraTabBarItemsDefaultHeight; +``` + +##License + + The MIT License (MIT) + + Copyright © 2015 Yalantis + + 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. + + + + + + + + + diff --git a/grocery-objc/Pods/HSDatePickerViewController/HSDatePickerViewControllerDemo/HSDatePickerViewController/HSDatePickerViewController.h b/grocery-objc/Pods/HSDatePickerViewController/HSDatePickerViewControllerDemo/HSDatePickerViewController/HSDatePickerViewController.h new file mode 100644 index 0000000..dbd26d1 --- /dev/null +++ b/grocery-objc/Pods/HSDatePickerViewController/HSDatePickerViewControllerDemo/HSDatePickerViewController/HSDatePickerViewController.h @@ -0,0 +1,101 @@ +// +// HSDatePickerViewController.h +// +// Created by Kamil Powałowski on 10.01.2015. +// Copyright (c) 2015 Hydra Softworks. +// Released under an MIT license: http://opensource.org/licenses/MIT +// + +#import + +typedef enum : NSUInteger { + QuitWithResult, //When confirm button is pressed + QuitWithBackButton, //When back button is pressed + QuitWithCancel, //when View outside date picker is pressed +} HSDatePickerQuitMethod; + +typedef enum : NSUInteger { + StepOneMinute = 1, + StepTwoMinutes = 2, + StepFiveMinutes = 5, + StepTenMinutes = 10, + StepFifteenMinutes = 15, + StepHalfAnHour = 30, +} HSDatePickerMinutesStep; + +/** + * Implement this protocol to take results from HSDatePickerViewController + */ +@protocol HSDatePickerViewControllerDelegate +/** + * This method is called when user touch confrim button. + * + * @param date selected date and time + */ +- (void)hsDatePickerPickedDate:(NSDate *)date; +@optional +/** + * This method is called when view will be dismissed. + * + * @param method of quit the view. + */ +- (void)hsDatePickerWillDismissWithQuitMethod:(HSDatePickerQuitMethod)method; +/** + * This method is called when view is dismissed. + * + * @param method of quit the view. + */ +- (void)hsDatePickerDidDismissWithQuitMethod:(HSDatePickerQuitMethod)method; + +@end + +/** + * Main class. Show it as modal view controller. All parameters below are optional, but remember to set choosed ones before call presentViewController. + */ +@interface HSDatePickerViewController : UIViewController +/** + * Register your delegate here + */ +@property (nonatomic, weak) id delegate; +/** + * Indidcate that ViewController should be dismiss when there is touch outside date picker. Default is YES. + */ +@property (nonatomic, assign, getter=shouldDismissOnCancelTouch) BOOL dismissOnCancelTouch; +/** + * Minute picker step value. Default StepFiveMinutes + */ +@property (nonatomic, assign) HSDatePickerMinutesStep minuteStep; +/** + * Color of interface elements + */ +@property (nonatomic, strong) UIColor *mainColor; +/** + * Selected date. Warning! Don't read selected date from this variable. User NSDatePickerViewControllerDelegate protocol instead. + */ +@property (nonatomic, strong) NSDate *date; +/** + * Minimum avaiable date on picker + */ +@property (nonatomic, strong) NSDate *minDate; +/** + * Maximum avaiable date on picker + */ +@property (nonatomic, strong) NSDate *maxDate; +/** + * Formater for date in picker. Default format is "ccc d MMM" + */ +@property (nonatomic, strong) NSDateFormatter *dateFormatter; +/** + * Format month and date label above date picker. Default format is "MMMM yyyy" + */ +@property (nonatomic, strong) NSDateFormatter *monthAndYearLabelDateFormater; +/** + * Title of picker confirm button + */ +@property (nonatomic, strong) NSString *confirmButtonTitle; +/** + * Back button title + */ +@property (nonatomic, strong) NSString *backButtonTitle; + +@end diff --git a/grocery-objc/Pods/HSDatePickerViewController/HSDatePickerViewControllerDemo/HSDatePickerViewController/HSDatePickerViewController.m b/grocery-objc/Pods/HSDatePickerViewController/HSDatePickerViewControllerDemo/HSDatePickerViewController/HSDatePickerViewController.m new file mode 100644 index 0000000..80a70ba --- /dev/null +++ b/grocery-objc/Pods/HSDatePickerViewController/HSDatePickerViewControllerDemo/HSDatePickerViewController/HSDatePickerViewController.m @@ -0,0 +1,510 @@ +// +// HSDatePickerViewController.m +// +// Created by Kamil Powałowski on 10.01.2015. +// Copyright (c) 2015 Hydra Softworks. +// Released under an MIT license: http://opensource.org/licenses/MIT +// + +#import "HSDatePickerViewController.h" + +typedef enum : NSUInteger { + DayPicker = 0, + HourPicker = 1, + MinutePicker = 2, +} HSDatePickerType; + +static NSInteger kRowsMultiplier = 200; +static NSInteger kBufforRows = 30; //Number of rows that are prevent by scroll picker to end + +@interface HSDatePickerViewController () +@property (weak, nonatomic) IBOutlet UIView *pickerBackgroundView; +@property (weak, nonatomic) IBOutlet UIView *separator1View; +@property (weak, nonatomic) IBOutlet UIView *separator2View; +@property (weak, nonatomic) IBOutlet UIView *separator3View; + +@property (weak, nonatomic) IBOutlet UIPickerView *pickerView; + +@property (weak, nonatomic) IBOutlet UILabel *monthAndYearLabel; + +@property (weak, nonatomic) IBOutlet UIButton *monthPreviousButton; +@property (weak, nonatomic) IBOutlet UIButton *monthNextButton; +@property (weak, nonatomic) IBOutlet UIButton *confirmButton; +@property (weak, nonatomic) IBOutlet UIButton *backButton; + +@property (nonatomic, assign) NSInteger maxRowIndex; +@property (nonatomic, assign) NSInteger minRowIndex; + +@property (nonatomic, assign) UIStatusBarStyle previousStatusBarStyle; +@end + +@implementation HSDatePickerViewController +@synthesize minDate = _minDate; +@synthesize maxDate = _maxDate; + +#pragma mark - Controller lifecycle + +-(instancetype)init { + if ( self = [super init] ) { + self.modalPresentationStyle = UIModalPresentationOverCurrentContext; + + //Set minRowIndex and maxRowIndex to -1, so in property getter we will know that to set it to proper values + self.minRowIndex = self.maxRowIndex = -1; + + self.dismissOnCancelTouch = YES; + self.minuteStep = StepFiveMinutes; + + //Min and max data test + //self.minDate = [NSDate dateWithTimeIntervalSinceNow:60*60*24*-60 + 3*60*60]; + //self.maxDate = [NSDate dateWithTimeIntervalSinceNow:60*60*24*60 - 3*60*60]; + } + return self; +} + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + NSBundle *podbundle = [NSBundle bundleForClass:[self class]]; + self = [super initWithNibName:nibNameOrNil bundle:podbundle]; + if (self) { + } + return self; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + //Set deafult values for pickers + for (NSUInteger i = 0; i < 3; i++) { + [self.pickerView selectRow:[self defaultRowValueForComponent:i] inComponent:i animated:NO]; + } + //Before call of this all parameters must be setted + [self pickerView:self.pickerView didSelectRow:[self defaultRowValueForComponent:DayPicker] inComponent:DayPicker]; + + self.pickerBackgroundView.layer.cornerRadius = 10.0; + self.pickerBackgroundView.layer.borderColor = self.mainColor.CGColor; + self.pickerBackgroundView.layer.borderWidth = 1.0; + + self.separator1View.backgroundColor = self.separator2View.backgroundColor = self.separator3View.backgroundColor = self.mainColor; + + self.monthAndYearLabel.textColor = self.mainColor; + + [self.monthNextButton setTitleColor:self.mainColor forState:UIControlStateNormal]; + [self.monthNextButton setTitleColor:[self.mainColor colorWithAlphaComponent:0.7] forState:UIControlStateHighlighted]; + [self.monthNextButton setTitleColor:[self.mainColor colorWithAlphaComponent:0.3] forState:UIControlStateDisabled]; + + [self.monthPreviousButton setTitleColor:self.mainColor forState:UIControlStateNormal]; + [self.monthPreviousButton setTitleColor:[self.mainColor colorWithAlphaComponent:0.7] forState:UIControlStateHighlighted]; + [self.monthPreviousButton setTitleColor:[self.mainColor colorWithAlphaComponent:0.3] forState:UIControlStateDisabled]; + + [self.confirmButton setTitle:self.confirmButtonTitle forState:UIControlStateNormal]; + [self.confirmButton setTitleColor:self.mainColor forState:UIControlStateNormal]; + [self.confirmButton setTitleColor:[self.mainColor colorWithAlphaComponent:0.7] forState:UIControlStateHighlighted]; + + [self.backButton setTitle:self.backButtonTitle forState:UIControlStateNormal]; + [self.backButton setTitleColor:self.mainColor forState:UIControlStateNormal]; + [self.backButton setTitleColor:[self.mainColor colorWithAlphaComponent:0.7] forState:UIControlStateHighlighted]; + + //Add gesture recognizer to superview... + UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(cancelTapGesture:)]; + [self.pickerBackgroundView.superview addGestureRecognizer:gestureRecognizer]; + //...but turn off gesture recognition on lower views + gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:nil]; + [self.pickerBackgroundView addGestureRecognizer:gestureRecognizer]; + + //Set hours and minutes to selected values + NSDateComponents *components = [[NSCalendar currentCalendar] components:(NSCalendarUnitHour | NSCalendarUnitMinute) fromDate:self.date]; + [self setPickerView:self.pickerView rowInComponent:HourPicker toIntagerValue:[components hour] decrementing:NO animated:NO]; + [self setPickerView:self.pickerView rowInComponent:MinutePicker toIntagerValue:[components minute] decrementing:NO animated:NO]; + +} + +-(void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + + //This option only works when "View controller-based status bar appearance" in .plist is set to NO + self.previousStatusBarStyle = [UIApplication sharedApplication].statusBarStyle; + [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:YES]; +} + +- (void)viewDidDisappear:(BOOL)animated { + [super viewDidDisappear:animated]; + [[UIApplication sharedApplication] setStatusBarStyle:self.previousStatusBarStyle animated:YES]; +} + +#pragma mark - Properties +- (UIColor *)mainColor { + if (!_mainColor) { + _mainColor = [UIColor whiteColor]; + } + return _mainColor; +} + +- (NSDate *)date { + if (!_date) { + _date = [NSDate date]; + } + return _date; +} + +- (void)setMinDate:(NSDate *)minDate { + if ([minDate compare:self.date] == NSOrderedDescending) { + NSLog(@"minDate=%@ is after date=%@. Value will not be set.", minDate, self.date); + } else { + _minDate = minDate; + } +} + +- (NSDate *)minDate { + if (!_minDate) { + _minDate = [self dateForRow:kBufforRows]; + } + return _minDate; +} + +- (void)setMaxDate:(NSDate *)maxDate { + if ([maxDate compare:self.date] == NSOrderedAscending) { + NSLog(@"maxDate=%@ is before date=%@. Value will not be set.", maxDate, self.date); + } else { + _maxDate = maxDate; + } +} + +- (NSDate *)maxDate { + if (!_maxDate) { + _maxDate = [self dateForRow:[self pickerView:self.pickerView numberOfRowsInComponent:DayPicker] - kBufforRows]; + } + return _maxDate; +} + +- (NSDateFormatter *)dateFormatter { + if (!_dateFormatter) { + _dateFormatter = [NSDateFormatter new]; + _dateFormatter.dateFormat = @"ccc d MMM"; + } + return _dateFormatter; +} + +- (NSDateFormatter *)monthAndYearLabelDateFormater { + if (!_monthAndYearLabelDateFormater) { + _monthAndYearLabelDateFormater = [NSDateFormatter new]; + _monthAndYearLabelDateFormater.dateFormat = @"MMMM yyyy"; + } + return _monthAndYearLabelDateFormater; +} + +- (NSString *)confirmButtonTitle { + if (!_confirmButtonTitle) { + _confirmButtonTitle = NSLocalizedString(@"Set date", @"HSDatePicker confirm button title"); + } + return _confirmButtonTitle; +} + +- (NSString *)backButtonTitle { + if (!_backButtonTitle) { + _backButtonTitle = NSLocalizedString(@"Back", @"HSDatePicker back button"); + } + return _backButtonTitle; +} + +- (NSInteger)maxRowIndex { + if (_maxRowIndex == -1) { + if ([self.maxDate compare:[self dateForRow:[self pickerView:self.pickerView numberOfRowsInComponent:DayPicker] - kBufforRows]] == NSOrderedAscending) { + _maxRowIndex = [self defaultRowValueForComponent:DayPicker] + [self daysBetweenDate:self.date andDate:self.maxDate]; + } + else { + _maxRowIndex = [self pickerView:self.pickerView numberOfRowsInComponent:DayPicker] - kBufforRows; + } + } + return _maxRowIndex; +} + +- (NSInteger)minRowIndex { + if (_minRowIndex == -1) { + if ([self.minDate compare:[self dateForRow:kBufforRows]] == NSOrderedDescending) { + _minRowIndex = [self defaultRowValueForComponent:DayPicker] + [self daysBetweenDate:self.date andDate:self.minDate]; + } + else { + _minRowIndex = kBufforRows; + } + } + return _minRowIndex; +} + +#pragma mark - UIPickerViewDataSource +- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView { + return 3; +} + +- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { + //To implement wrap around effect for components we return big number. + //Real number of components you can get from realNumberOfRowsInComponent + return [self realNumberOfRowsInComponent:component] * kRowsMultiplier; +} + +- (NSInteger)realNumberOfRowsInComponent:(NSInteger)component { + NSInteger numberOfRows = 0; + switch (component) { + case DayPicker: + numberOfRows = 30; + break; + case HourPicker: + numberOfRows = 24; + break; + case MinutePicker: + numberOfRows = 60 / self.minuteStep; + break; + } + + return numberOfRows; +} + +- (NSInteger)defaultRowValueForComponent:(NSInteger)component { + return [self realNumberOfRowsInComponent:component] * kRowsMultiplier / 2; +} + +#pragma mark - UIPickerViewDelegate + +- (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component { + CGFloat width = 0.0; + switch (component) { + case DayPicker: + width = 140; + break; + case HourPicker: + width = 40; + break; + case MinutePicker: + width = 40; + break; + } + + return width; +} + + +- (NSAttributedString *)pickerView:(UIPickerView *)pickerView attributedTitleForRow:(NSInteger)row forComponent:(NSInteger)component { + NSString *title = @""; + NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new]; + + switch (component) { + case DayPicker: + title = [self stringDateForRow:row]; + [paragraphStyle setAlignment:NSTextAlignmentRight]; + break; + case HourPicker: + title = [NSString stringWithFormat:@"%02ld", row % [self realNumberOfRowsInComponent:component]]; + [paragraphStyle setAlignment:NSTextAlignmentCenter]; + + break; + case MinutePicker: + title = [NSString stringWithFormat:@"%02lu", row % [self realNumberOfRowsInComponent:component] * self.minuteStep]; + [paragraphStyle setAlignment:NSTextAlignmentLeft]; + + break; + } + + + return [[NSAttributedString alloc] initWithString:title attributes: + @{NSForegroundColorAttributeName: self.mainColor, + NSParagraphStyleAttributeName: paragraphStyle}]; +} + +- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { + if (component == DayPicker) { + self.monthAndYearLabel.text = [self.monthAndYearLabelDateFormater stringFromDate:[self dateForRow:row]]; + + //If picker values are to close to bufforValue scroll it back + if (row < self.minRowIndex) { + [self.pickerView selectRow:self.minRowIndex inComponent:component animated:YES]; + [self pickerView:self.pickerView didSelectRow:self.minRowIndex inComponent:component]; + } + if (row > self.maxRowIndex) { + [self.pickerView selectRow:self.maxRowIndex inComponent:component animated:YES]; + [self pickerView:self.pickerView didSelectRow:self.maxRowIndex inComponent:component]; + } + + //Disable month change buttons + self.monthNextButton.enabled = YES; + self.monthPreviousButton.enabled = YES; + if (row <= self.minRowIndex) { + self.monthPreviousButton.enabled = NO; + } + if (row >= self.maxRowIndex) { + self.monthNextButton.enabled = NO; + } + } + + NSInteger firstComponentRowValue = [pickerView selectedRowInComponent:DayPicker]; + //If picker values are to close to bufforValue scroll it back + if (firstComponentRowValue <= self.minRowIndex) { + NSDateComponents *components = [[NSCalendar currentCalendar] components:(NSCalendarUnitHour | NSCalendarUnitMinute) fromDate:self.minDate]; + [self setPickerView:self.pickerView rowInComponent:HourPicker toIntagerValue:[components hour] decrementing:NO animated:YES]; + if ([pickerView selectedRowInComponent:HourPicker] <= [self defaultRowValueForComponent:HourPicker] + [components hour]) { + [self setPickerView:self.pickerView rowInComponent:MinutePicker toIntagerValue:[components minute] decrementing:NO animated:YES]; + } + } + if (firstComponentRowValue >= self.maxRowIndex) { + NSDateComponents *components = [[NSCalendar currentCalendar] components:(NSCalendarUnitHour | NSCalendarUnitMinute) fromDate:self.maxDate]; + [self setPickerView:self.pickerView rowInComponent:HourPicker toIntagerValue:[components hour] decrementing:YES animated:YES]; + if ([pickerView selectedRowInComponent:HourPicker] >= [self defaultRowValueForComponent:HourPicker] + [components hour]) { + [self setPickerView:self.pickerView rowInComponent:MinutePicker toIntagerValue:[components minute] decrementing:YES animated:YES]; + } + } +} + +- (void)setPickerView:(UIPickerView *)pickerView rowInComponent:(NSInteger)component toIntagerValue:(NSInteger)value decrementing:(BOOL)decrementing animated:(BOOL)animated { + if (decrementing) { + BOOL valueSetted = NO; + for (NSInteger i = 0; i < [self realNumberOfRowsInComponent:component]; i++) { + if ([[self pickerView:pickerView attributedTitleForRow:[pickerView selectedRowInComponent:component] - i forComponent:component].string integerValue] <= value) { + [pickerView selectRow:[pickerView selectedRowInComponent:component] - i inComponent:component animated:animated]; + valueSetted = YES; + break; + } + } + if (!valueSetted && component == MinutePicker) { + [pickerView selectRow:[pickerView selectedRowInComponent:HourPicker] - 1 inComponent:HourPicker animated:animated]; + if ([[self pickerView:pickerView attributedTitleForRow:[pickerView selectedRowInComponent:HourPicker] forComponent:HourPicker].string integerValue] == 0) { + [pickerView selectRow:[pickerView selectedRowInComponent:DayPicker] - 1 inComponent:DayPicker animated:animated]; + } + } + } else { + BOOL valueSetted = NO; + for (NSInteger i = 0; i < [self realNumberOfRowsInComponent:component]; i++) { + if ([[self pickerView:pickerView attributedTitleForRow:[pickerView selectedRowInComponent:component] + i forComponent:component].string integerValue] >= value) { + [pickerView selectRow:[pickerView selectedRowInComponent:component] + i inComponent:component animated:animated]; + valueSetted = YES; + break; + } + } + if (!valueSetted && component == MinutePicker) { + [pickerView selectRow:[pickerView selectedRowInComponent:HourPicker] + 1 inComponent:HourPicker animated:animated]; + if ([[self pickerView:pickerView attributedTitleForRow:[pickerView selectedRowInComponent:HourPicker] forComponent:HourPicker].string integerValue] == 0) { + [pickerView selectRow:[pickerView selectedRowInComponent:DayPicker] + 1 inComponent:DayPicker animated:animated]; + } + } + } +} + +#pragma mark - NSDate operations +-(BOOL)isDate:(NSDate*)date1 sameDayAsDate:(NSDate*)date2 { + NSCalendar* calendar = [NSCalendar currentCalendar]; + + unsigned unitFlags = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay; + NSDateComponents* comp1 = [calendar components:unitFlags fromDate:date1]; + NSDateComponents* comp2 = [calendar components:unitFlags fromDate:date2]; + + return [comp1 day] == [comp2 day] && + [comp1 month] == [comp2 month] && + [comp1 year] == [comp2 year]; +} + +- (NSInteger)daysInMonth:(NSDate *)date { + return [[NSCalendar currentCalendar] rangeOfUnit:NSCalendarUnitDay + inUnit:NSCalendarUnitMonth + forDate:date].length; +} + +- (NSDate *)dateForRow:(NSInteger)row { + row = row - [self defaultRowValueForComponent:DayPicker]; + NSDate * date = [self.date dateByAddingTimeInterval:60 * 60 * 24 * row]; + return [[NSCalendar currentCalendar] dateBySettingHour:0 minute:0 second:0 ofDate:date options:0]; +} + +- (NSString *)stringDateForRow:(NSUInteger)row { + NSDate *date = [self dateForRow:row]; + if ([self isDate:date sameDayAsDate:[NSDate date]]) { + return NSLocalizedString(@"Today", @"Current day indicator"); + } + return [self.dateFormatter stringFromDate:date]; +} + + +//http://stackoverflow.com/questions/4739483/number-of-days-between-two-nsdates +- (NSInteger)daysBetweenDate:(NSDate*)fromDateTime andDate:(NSDate*)toDateTime +{ + NSDate *fromDate; + NSDate *toDate; + + NSCalendar *calendar = [NSCalendar currentCalendar]; + + [calendar rangeOfUnit:NSCalendarUnitDay startDate:&fromDate + interval:NULL forDate:fromDateTime]; + [calendar rangeOfUnit:NSCalendarUnitDay startDate:&toDate + interval:NULL forDate:toDateTime]; + + NSDateComponents *difference = [calendar components:NSCalendarUnitDay + fromDate:fromDate toDate:toDate options:0]; + + return [difference day]; +} + +- (NSDate *)dateWithSelectedTime { + NSDate *date = [self dateForRow:[self.pickerView selectedRowInComponent:DayPicker]]; + NSInteger hour = [[self pickerView:self.pickerView attributedTitleForRow:[self.pickerView selectedRowInComponent:HourPicker] forComponent:HourPicker].string integerValue]; + NSInteger minute = [[self pickerView:self.pickerView attributedTitleForRow:[self.pickerView selectedRowInComponent:MinutePicker] forComponent:MinutePicker].string integerValue]; + return [[NSCalendar currentCalendar] dateBySettingHour:hour minute:minute second:0 ofDate:date options:0]; +} + +#pragma mark - Actions +- (IBAction)jumpToPreviousMonth:(id)sender { + NSDate *date = [self dateForRow:[self.pickerView selectedRowInComponent:DayPicker]]; + NSInteger row = [self.pickerView selectedRowInComponent:DayPicker] - [self daysInMonth:date]; + [self.pickerView selectRow:row inComponent:DayPicker animated:YES]; + [self pickerView:self.pickerView didSelectRow:row inComponent:DayPicker]; +} + +- (IBAction)jumpToNextMonth:(id)sender { + NSDate *date = [self dateForRow:[self.pickerView selectedRowInComponent:DayPicker]]; + NSInteger row = [self.pickerView selectedRowInComponent:DayPicker] + [self daysInMonth:date]; + [self.pickerView selectRow:row inComponent:DayPicker animated:YES]; + [self pickerView:self.pickerView didSelectRow:row inComponent:DayPicker]; +} + +- (IBAction)confirmDate:(id)sender { + //TODO: Set date + if ([self.delegate respondsToSelector:@selector(hsDatePickerPickedDate:)]) { + [self.delegate hsDatePickerPickedDate:[self dateWithSelectedTime]]; + } + + if ([self.delegate respondsToSelector:@selector(hsDatePickerWillDismissWithQuitMethod:)]) { + [self.delegate hsDatePickerWillDismissWithQuitMethod:QuitWithResult]; + } + void (^success)(void) = nil; + if ([self.delegate respondsToSelector:@selector(hsDatePickerDidDismissWithQuitMethod:)]) { + success = ^{ + [self.delegate hsDatePickerDidDismissWithQuitMethod:QuitWithResult]; + }; + } + [self dismissViewControllerAnimated:YES completion:success]; +} + +- (IBAction)quitPicking:(id)sender { + if ([self.delegate respondsToSelector:@selector(hsDatePickerWillDismissWithQuitMethod:)]) { + [self.delegate hsDatePickerWillDismissWithQuitMethod:QuitWithBackButton]; + } + void (^success)(void) = nil; + if ([self.delegate respondsToSelector:@selector(hsDatePickerDidDismissWithQuitMethod:)]) { + success = ^{ + [self.delegate hsDatePickerDidDismissWithQuitMethod:QuitWithBackButton]; + }; + } + [self dismissViewControllerAnimated:YES completion:success]; +} + +- (void)cancelTapGesture:(UITapGestureRecognizer *)sender { + if (self.shouldDismissOnCancelTouch) { + if ([self.delegate respondsToSelector:@selector(hsDatePickerWillDismissWithQuitMethod:)]) { + [self.delegate hsDatePickerWillDismissWithQuitMethod:QuitWithCancel]; + } + void (^success)(void) = nil; + if ([self.delegate respondsToSelector:@selector(hsDatePickerDidDismissWithQuitMethod:)]) { + success = ^{ + [self.delegate hsDatePickerDidDismissWithQuitMethod:QuitWithCancel]; + }; + } + [self dismissViewControllerAnimated:YES completion:success]; + } +} + +@end diff --git a/grocery-objc/Pods/HSDatePickerViewController/HSDatePickerViewControllerDemo/HSDatePickerViewController/HSDatePickerViewController.xib b/grocery-objc/Pods/HSDatePickerViewController/HSDatePickerViewControllerDemo/HSDatePickerViewController/HSDatePickerViewController.xib new file mode 100644 index 0000000..f419fef --- /dev/null +++ b/grocery-objc/Pods/HSDatePickerViewController/HSDatePickerViewControllerDemo/HSDatePickerViewController/HSDatePickerViewController.xib @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/HSDatePickerViewController/LICENSE b/grocery-objc/Pods/HSDatePickerViewController/LICENSE new file mode 100644 index 0000000..c50e129 --- /dev/null +++ b/grocery-objc/Pods/HSDatePickerViewController/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Kamil Powałowski + +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. + diff --git a/grocery-objc/Pods/HSDatePickerViewController/README.md b/grocery-objc/Pods/HSDatePickerViewController/README.md new file mode 100644 index 0000000..be021fe --- /dev/null +++ b/grocery-objc/Pods/HSDatePickerViewController/README.md @@ -0,0 +1,70 @@ +HSDatePickerViewController +========================== +`HSDatePickerViewController` is an iOS ViewController for date and time picking, based on awesome look&feel of Dropbox [Mailbox](http://www.mailboxapp.com/) application with some customization options. + +![HSDatePickerViewController screen](https://raw.githubusercontent.com/EmilYo/HSDatePickerViewController/master/screen1.png) +![HSDatePickerViewController screen](https://raw.githubusercontent.com/EmilYo/HSDatePickerViewController/master/screen2.png) + +Usage +===== +Use [CocoaPods](http://guides.cocoapods.org/using/using-cocoapods.html) +``` +pod 'HSDatePickerViewController', '~> 1.0' +``` +or add sources from `HSDatePickerViewControllerDemo/HSDatePickerViewController` subfolder to your project. + + + +Import main header: + +```objective-c +#import "HSDatePickerViewController.h" +``` + +When needed, create `HSDatePickerViewController` object: + +```objective-c +HSDatePickerViewController *hsdpvc = [[HSDatePickerViewController alloc] init]; +``` + +present it as modal view controller: +```objective-c +[self presentViewController:hsdpvc animated:YES completion:nil]; +``` + +To get returning values, you must conform to the protocol `HSDatePickerViewControllerDelegate`: + +```objective-c +@protocol HSDatePickerViewControllerDelegate +- (void)hsDatePickerPickedDate:(NSDate *)date; +@optional +- (void)hsDatePickerWillDismissWithQuitMethod:(HSDatePickerQuitMethod)method; +- (void)hsDatePickerDidDismissWithQuitMethod:(HSDatePickerQuitMethod)method; +@end +``` + +Also, **before** presenting `HSDatePickerViewController`, you can change default values of some properties (check `HSDatePickerViewController.h` file for longer description): + +```objective-c +@property (nonatomic, assign, getter=shouldDismissOnCancelTouch) BOOL dismissOnCancelTouch; + +@property (nonatomic, assign) HSDatePickerMinutesStep minuteStep; + +@property (nonatomic, strong) UIColor *mainColor; + +@property (nonatomic, strong) NSDate *date; +@property (nonatomic, strong) NSDate *minDate; +@property (nonatomic, strong) NSDate *maxDate; + +@property (nonatomic, strong) NSDateFormatter *dateFormatter; +@property (nonatomic, strong) NSDateFormatter *monthAndYearLabelDateFormater; + +@property (nonatomic, strong) NSString *confirmButtonTitle; +@property (nonatomic, strong) NSString *backButtonTitle; +``` + +Licence (MIT) +======= +Copyright (c) 2015 Kamil Powałowski [@kamilpowalowski](https://twitter.com/kamilpowalowski) + +For whole licence see LICENCE file. diff --git a/grocery-objc/Pods/Headers/Private/AFNetworking/AFAutoPurgingImageCache.h b/grocery-objc/Pods/Headers/Private/AFNetworking/AFAutoPurgingImageCache.h new file mode 120000 index 0000000..f9dc7db --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/AFNetworking/AFAutoPurgingImageCache.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h b/grocery-objc/Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h new file mode 120000 index 0000000..56feb9f --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/AFNetworking/AFImageDownloader.h b/grocery-objc/Pods/Headers/Private/AFNetworking/AFImageDownloader.h new file mode 120000 index 0000000..ce47c92 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/AFNetworking/AFImageDownloader.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/AFImageDownloader.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/AFNetworking/AFNetworkActivityIndicatorManager.h b/grocery-objc/Pods/Headers/Private/AFNetworking/AFNetworkActivityIndicatorManager.h new file mode 120000 index 0000000..67519d9 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/AFNetworking/AFNetworkActivityIndicatorManager.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h b/grocery-objc/Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h new file mode 120000 index 0000000..68fc774 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/AFNetworking/AFNetworking.h b/grocery-objc/Pods/Headers/Private/AFNetworking/AFNetworking.h new file mode 120000 index 0000000..a5a38da --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/AFNetworking/AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFNetworking.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h b/grocery-objc/Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h new file mode 120000 index 0000000..fd1322d --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFSecurityPolicy.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h b/grocery-objc/Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h new file mode 120000 index 0000000..ca8209b --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h b/grocery-objc/Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h new file mode 120000 index 0000000..e36a765 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/AFNetworking/AFURLSessionManager.h b/grocery-objc/Pods/Headers/Private/AFNetworking/AFURLSessionManager.h new file mode 120000 index 0000000..835101d --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/AFNetworking/AFURLSessionManager.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFURLSessionManager.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/AFNetworking/UIActivityIndicatorView+AFNetworking.h b/grocery-objc/Pods/Headers/Private/AFNetworking/UIActivityIndicatorView+AFNetworking.h new file mode 120000 index 0000000..c534ebf --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/AFNetworking/UIActivityIndicatorView+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/AFNetworking/UIButton+AFNetworking.h b/grocery-objc/Pods/Headers/Private/AFNetworking/UIButton+AFNetworking.h new file mode 120000 index 0000000..8f2e221 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/AFNetworking/UIButton+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/AFNetworking/UIImage+AFNetworking.h b/grocery-objc/Pods/Headers/Private/AFNetworking/UIImage+AFNetworking.h new file mode 120000 index 0000000..74f6649 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/AFNetworking/UIImage+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/AFNetworking/UIImageView+AFNetworking.h b/grocery-objc/Pods/Headers/Private/AFNetworking/UIImageView+AFNetworking.h new file mode 120000 index 0000000..a95d673 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/AFNetworking/UIImageView+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/AFNetworking/UIKit+AFNetworking.h b/grocery-objc/Pods/Headers/Private/AFNetworking/UIKit+AFNetworking.h new file mode 120000 index 0000000..95017cc --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/AFNetworking/UIKit+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/AFNetworking/UIProgressView+AFNetworking.h b/grocery-objc/Pods/Headers/Private/AFNetworking/UIProgressView+AFNetworking.h new file mode 120000 index 0000000..730b167 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/AFNetworking/UIProgressView+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/AFNetworking/UIRefreshControl+AFNetworking.h b/grocery-objc/Pods/Headers/Private/AFNetworking/UIRefreshControl+AFNetworking.h new file mode 120000 index 0000000..8efd826 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/AFNetworking/UIRefreshControl+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/AFNetworking/UIWebView+AFNetworking.h b/grocery-objc/Pods/Headers/Private/AFNetworking/UIWebView+AFNetworking.h new file mode 120000 index 0000000..c8df6ef --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/AFNetworking/UIWebView+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Firebase/FAuthData.h b/grocery-objc/Pods/Headers/Private/Firebase/FAuthData.h new file mode 120000 index 0000000..7489b45 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Firebase/FAuthData.h @@ -0,0 +1 @@ +../../../Firebase/FAuthData.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Firebase/FAuthType.h b/grocery-objc/Pods/Headers/Private/Firebase/FAuthType.h new file mode 120000 index 0000000..502e35b --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Firebase/FAuthType.h @@ -0,0 +1 @@ +../../../Firebase/FAuthType.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Firebase/FConfig.h b/grocery-objc/Pods/Headers/Private/Firebase/FConfig.h new file mode 120000 index 0000000..763c99a --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Firebase/FConfig.h @@ -0,0 +1 @@ +../../../Firebase/FConfig.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Firebase/FDataSnapshot.h b/grocery-objc/Pods/Headers/Private/Firebase/FDataSnapshot.h new file mode 120000 index 0000000..8d3d769 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Firebase/FDataSnapshot.h @@ -0,0 +1 @@ +../../../Firebase/FDataSnapshot.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Firebase/FEventType.h b/grocery-objc/Pods/Headers/Private/Firebase/FEventType.h new file mode 120000 index 0000000..4339807 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Firebase/FEventType.h @@ -0,0 +1 @@ +../../../Firebase/FEventType.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Firebase/FMutableData.h b/grocery-objc/Pods/Headers/Private/Firebase/FMutableData.h new file mode 120000 index 0000000..56ea28f --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Firebase/FMutableData.h @@ -0,0 +1 @@ +../../../Firebase/FMutableData.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Firebase/FQuery.h b/grocery-objc/Pods/Headers/Private/Firebase/FQuery.h new file mode 120000 index 0000000..f1006c6 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Firebase/FQuery.h @@ -0,0 +1 @@ +../../../Firebase/FQuery.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Firebase/FTransactionResult.h b/grocery-objc/Pods/Headers/Private/Firebase/FTransactionResult.h new file mode 120000 index 0000000..dd01b82 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Firebase/FTransactionResult.h @@ -0,0 +1 @@ +../../../Firebase/FTransactionResult.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Firebase/Firebase.h b/grocery-objc/Pods/Headers/Private/Firebase/Firebase.h new file mode 120000 index 0000000..a9b6765 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Firebase/Firebase.h @@ -0,0 +1 @@ +../../../Firebase/Firebase.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Firebase/FirebaseApp.h b/grocery-objc/Pods/Headers/Private/Firebase/FirebaseApp.h new file mode 120000 index 0000000..af4c17e --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Firebase/FirebaseApp.h @@ -0,0 +1 @@ +../../../Firebase/FirebaseApp.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Firebase/FirebaseServerValue.h b/grocery-objc/Pods/Headers/Private/Firebase/FirebaseServerValue.h new file mode 120000 index 0000000..c0392db --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Firebase/FirebaseServerValue.h @@ -0,0 +1 @@ +../../../Firebase/FirebaseServerValue.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/FoldingTabBar/CAAnimation+YALTabBarViewAnimations.h b/grocery-objc/Pods/Headers/Private/FoldingTabBar/CAAnimation+YALTabBarViewAnimations.h new file mode 120000 index 0000000..4300617 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/FoldingTabBar/CAAnimation+YALTabBarViewAnimations.h @@ -0,0 +1 @@ +../../../FoldingTabBar/FoldingTabBar/Category/CAAnimation/CAAnimation+YALTabBarViewAnimations/CAAnimation+YALTabBarViewAnimations.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/FoldingTabBar/CATransaction+TransactionWithAnimationsAndCompletion.h b/grocery-objc/Pods/Headers/Private/FoldingTabBar/CATransaction+TransactionWithAnimationsAndCompletion.h new file mode 120000 index 0000000..6645404 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/FoldingTabBar/CATransaction+TransactionWithAnimationsAndCompletion.h @@ -0,0 +1 @@ +../../../FoldingTabBar/FoldingTabBar/Category/CATransaction/CATransaction+TransactionWithAnimationsAndCompletion/CATransaction+TransactionWithAnimationsAndCompletion.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/FoldingTabBar/YALAnimatingTabBarConstants.h b/grocery-objc/Pods/Headers/Private/FoldingTabBar/YALAnimatingTabBarConstants.h new file mode 120000 index 0000000..59a4e5b --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/FoldingTabBar/YALAnimatingTabBarConstants.h @@ -0,0 +1 @@ +../../../FoldingTabBar/FoldingTabBar/Constants/YALAnimatingTabBarConstants.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/FoldingTabBar/YALFoldingTabBar.h b/grocery-objc/Pods/Headers/Private/FoldingTabBar/YALFoldingTabBar.h new file mode 120000 index 0000000..7c9c72a --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/FoldingTabBar/YALFoldingTabBar.h @@ -0,0 +1 @@ +../../../FoldingTabBar/FoldingTabBar/View/FoldingTabBar/YALFoldingTabBar.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/FoldingTabBar/YALFoldingTabBarController.h b/grocery-objc/Pods/Headers/Private/FoldingTabBar/YALFoldingTabBarController.h new file mode 120000 index 0000000..8fb6aca --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/FoldingTabBar/YALFoldingTabBarController.h @@ -0,0 +1 @@ +../../../FoldingTabBar/FoldingTabBar/Controller/FoldingTabBarController/YALFoldingTabBarController.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/FoldingTabBar/YALSpringAnimation.h b/grocery-objc/Pods/Headers/Private/FoldingTabBar/YALSpringAnimation.h new file mode 120000 index 0000000..3059fd1 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/FoldingTabBar/YALSpringAnimation.h @@ -0,0 +1 @@ +../../../FoldingTabBar/FoldingTabBar/Animation/YALSpringAnimation/YALSpringAnimation.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/FoldingTabBar/YALTabBarInteracting.h b/grocery-objc/Pods/Headers/Private/FoldingTabBar/YALTabBarInteracting.h new file mode 120000 index 0000000..87b5470 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/FoldingTabBar/YALTabBarInteracting.h @@ -0,0 +1 @@ +../../../FoldingTabBar/FoldingTabBar/Protocol/TabBarInteracting/YALTabBarInteracting.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/FoldingTabBar/YALTabBarItem.h b/grocery-objc/Pods/Headers/Private/FoldingTabBar/YALTabBarItem.h new file mode 120000 index 0000000..d2b7d0a --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/FoldingTabBar/YALTabBarItem.h @@ -0,0 +1 @@ +../../../FoldingTabBar/FoldingTabBar/Model/TabBarItem/YALTabBarItem.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/HSDatePickerViewController/HSDatePickerViewController.h b/grocery-objc/Pods/Headers/Private/HSDatePickerViewController/HSDatePickerViewController.h new file mode 120000 index 0000000..f503e15 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/HSDatePickerViewController/HSDatePickerViewController.h @@ -0,0 +1 @@ +../../../HSDatePickerViewController/HSDatePickerViewControllerDemo/HSDatePickerViewController/HSDatePickerViewController.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/NSDate+RelativeTime/NSDate+RelativeTime.h b/grocery-objc/Pods/Headers/Private/NSDate+RelativeTime/NSDate+RelativeTime.h new file mode 120000 index 0000000..b403166 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/NSDate+RelativeTime/NSDate+RelativeTime.h @@ -0,0 +1 @@ +../../../NSDate+RelativeTime/NSDate+RelativeTime.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSBarcodes.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSBarcodes.h new file mode 120000 index 0000000..3f60fbc --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSBarcodes.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSBarcodes.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCode128Generator.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCode128Generator.h new file mode 120000 index 0000000..f815c6a --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCode128Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSCode128Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCode39Generator.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCode39Generator.h new file mode 120000 index 0000000..f5b16e9 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCode39Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSCode39Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCode39Mod43Generator.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCode39Mod43Generator.h new file mode 120000 index 0000000..14b655d --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCode39Mod43Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSCode39Mod43Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCode93Generator.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCode93Generator.h new file mode 120000 index 0000000..9d25d53 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCode93Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSCode93Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCodeGen.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCodeGen.h new file mode 120000 index 0000000..38f11dd --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCodeGen.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSCodeGen.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCodeGenerator.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCodeGenerator.h new file mode 120000 index 0000000..b491380 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCodeGenerator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSCodeGenerator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCodeView.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCodeView.h new file mode 120000 index 0000000..3b44575 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCodeView.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSCodeView.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCornersView.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCornersView.h new file mode 120000 index 0000000..cb23205 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSCornersView.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSCornersView.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSEAN13Generator.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSEAN13Generator.h new file mode 120000 index 0000000..197cb1b --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSEAN13Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSEAN13Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSEAN8Generator.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSEAN8Generator.h new file mode 120000 index 0000000..8d6441e --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSEAN8Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSEAN8Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSEANGenerator.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSEANGenerator.h new file mode 120000 index 0000000..0ad452a --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSEANGenerator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSEANGenerator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSExtendedCode39Generator.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSExtendedCode39Generator.h new file mode 120000 index 0000000..18a39d9 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSExtendedCode39Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSExtendedCode39Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSISBN13Generator.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSISBN13Generator.h new file mode 120000 index 0000000..958b577 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSISBN13Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSISBN13Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSISSN13Generator.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSISSN13Generator.h new file mode 120000 index 0000000..db86856 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSISSN13Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSISSN13Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSITF14Generator.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSITF14Generator.h new file mode 120000 index 0000000..5195aa6 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSITF14Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSITF14Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSITFGenerator.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSITFGenerator.h new file mode 120000 index 0000000..b2813b0 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSITFGenerator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSITFGenerator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSScannerViewController.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSScannerViewController.h new file mode 120000 index 0000000..3da0efa --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSScannerViewController.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSScannerViewController.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSUPCEGenerator.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSUPCEGenerator.h new file mode 120000 index 0000000..9967527 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSUPCEGenerator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSUPCEGenerator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/RSBarcodes/RSUnifiedCodeGenerator.h b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSUnifiedCodeGenerator.h new file mode 120000 index 0000000..d345e81 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/RSBarcodes/RSUnifiedCodeGenerator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSUnifiedCodeGenerator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/SDWebImage/NSData+ImageContentType.h b/grocery-objc/Pods/Headers/Private/SDWebImage/NSData+ImageContentType.h new file mode 120000 index 0000000..8457498 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/SDWebImage/NSData+ImageContentType.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/NSData+ImageContentType.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/SDWebImage/SDImageCache.h b/grocery-objc/Pods/Headers/Private/SDWebImage/SDImageCache.h new file mode 120000 index 0000000..0040b06 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/SDWebImage/SDImageCache.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDImageCache.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImageCompat.h b/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImageCompat.h new file mode 120000 index 0000000..6ca2478 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImageCompat.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImageCompat.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImageDecoder.h b/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImageDecoder.h new file mode 120000 index 0000000..a2f3a68 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImageDecoder.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImageDecoder.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImageDownloader.h b/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImageDownloader.h new file mode 120000 index 0000000..303b03b --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImageDownloader.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImageDownloader.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImageDownloaderOperation.h b/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImageDownloaderOperation.h new file mode 120000 index 0000000..99441c4 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImageDownloaderOperation.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImageManager.h b/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImageManager.h new file mode 120000 index 0000000..1b81848 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImageManager.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImageManager.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImageOperation.h b/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImageOperation.h new file mode 120000 index 0000000..20e5b89 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImageOperation.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImageOperation.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImagePrefetcher.h b/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImagePrefetcher.h new file mode 120000 index 0000000..50585c6 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/SDWebImage/SDWebImagePrefetcher.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/SDWebImage/UIButton+WebCache.h b/grocery-objc/Pods/Headers/Private/SDWebImage/UIButton+WebCache.h new file mode 120000 index 0000000..19d2d8e --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/SDWebImage/UIButton+WebCache.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/UIButton+WebCache.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/SDWebImage/UIImage+GIF.h b/grocery-objc/Pods/Headers/Private/SDWebImage/UIImage+GIF.h new file mode 120000 index 0000000..14d5aad --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/SDWebImage/UIImage+GIF.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/UIImage+GIF.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/SDWebImage/UIImage+MultiFormat.h b/grocery-objc/Pods/Headers/Private/SDWebImage/UIImage+MultiFormat.h new file mode 120000 index 0000000..1fb9650 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/SDWebImage/UIImage+MultiFormat.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/SDWebImage/UIImageView+HighlightedWebCache.h b/grocery-objc/Pods/Headers/Private/SDWebImage/UIImageView+HighlightedWebCache.h new file mode 120000 index 0000000..fd4dea4 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/SDWebImage/UIImageView+HighlightedWebCache.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/SDWebImage/UIImageView+WebCache.h b/grocery-objc/Pods/Headers/Private/SDWebImage/UIImageView+WebCache.h new file mode 120000 index 0000000..0c53a47 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/SDWebImage/UIImageView+WebCache.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/UIImageView+WebCache.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/SDWebImage/UIView+WebCacheOperation.h b/grocery-objc/Pods/Headers/Private/SDWebImage/UIView+WebCacheOperation.h new file mode 120000 index 0000000..f9890c4 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/SDWebImage/UIView+WebCacheOperation.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/SIAlertView/SIAlertView.h b/grocery-objc/Pods/Headers/Private/SIAlertView/SIAlertView.h new file mode 120000 index 0000000..630cc31 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/SIAlertView/SIAlertView.h @@ -0,0 +1 @@ +../../../SIAlertView/SIAlertView/SIAlertView.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Unirest/Base64.h b/grocery-objc/Pods/Headers/Private/Unirest/Base64.h new file mode 120000 index 0000000..2779320 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Unirest/Base64.h @@ -0,0 +1 @@ +../../../Unirest/Unirest/Base64.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Unirest/HttpRequest/UNIBaseRequest.h b/grocery-objc/Pods/Headers/Private/Unirest/HttpRequest/UNIBaseRequest.h new file mode 120000 index 0000000..7fa0b42 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Unirest/HttpRequest/UNIBaseRequest.h @@ -0,0 +1 @@ +../../../../Unirest/Unirest/HttpRequest/UNIBaseRequest.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Unirest/HttpRequest/UNIBodyRequest.h b/grocery-objc/Pods/Headers/Private/Unirest/HttpRequest/UNIBodyRequest.h new file mode 120000 index 0000000..4f6e4c1 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Unirest/HttpRequest/UNIBodyRequest.h @@ -0,0 +1 @@ +../../../../Unirest/Unirest/HttpRequest/UNIBodyRequest.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Unirest/HttpRequest/UNISimpleRequest.h b/grocery-objc/Pods/Headers/Private/Unirest/HttpRequest/UNISimpleRequest.h new file mode 120000 index 0000000..17fabab --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Unirest/HttpRequest/UNISimpleRequest.h @@ -0,0 +1 @@ +../../../../Unirest/Unirest/HttpRequest/UNISimpleRequest.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Unirest/HttpResponse/UNIHTTPBinaryResponse.h b/grocery-objc/Pods/Headers/Private/Unirest/HttpResponse/UNIHTTPBinaryResponse.h new file mode 120000 index 0000000..ece7c0b --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Unirest/HttpResponse/UNIHTTPBinaryResponse.h @@ -0,0 +1 @@ +../../../../Unirest/Unirest/HttpResponse/UNIHTTPBinaryResponse.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Unirest/HttpResponse/UNIHTTPJsonResponse.h b/grocery-objc/Pods/Headers/Private/Unirest/HttpResponse/UNIHTTPJsonResponse.h new file mode 120000 index 0000000..cfffec1 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Unirest/HttpResponse/UNIHTTPJsonResponse.h @@ -0,0 +1 @@ +../../../../Unirest/Unirest/HttpResponse/UNIHTTPJsonResponse.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Unirest/HttpResponse/UNIHTTPResponse.h b/grocery-objc/Pods/Headers/Private/Unirest/HttpResponse/UNIHTTPResponse.h new file mode 120000 index 0000000..487ac88 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Unirest/HttpResponse/UNIHTTPResponse.h @@ -0,0 +1 @@ +../../../../Unirest/Unirest/HttpResponse/UNIHTTPResponse.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Unirest/HttpResponse/UNIHTTPStringResponse.h b/grocery-objc/Pods/Headers/Private/Unirest/HttpResponse/UNIHTTPStringResponse.h new file mode 120000 index 0000000..3b07217 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Unirest/HttpResponse/UNIHTTPStringResponse.h @@ -0,0 +1 @@ +../../../../Unirest/Unirest/HttpResponse/UNIHTTPStringResponse.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Unirest/HttpResponse/UNIJsonNode.h b/grocery-objc/Pods/Headers/Private/Unirest/HttpResponse/UNIJsonNode.h new file mode 120000 index 0000000..a8f7724 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Unirest/HttpResponse/UNIJsonNode.h @@ -0,0 +1 @@ +../../../../Unirest/Unirest/HttpResponse/UNIJsonNode.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Unirest/UNIHTTPClientHelper.h b/grocery-objc/Pods/Headers/Private/Unirest/UNIHTTPClientHelper.h new file mode 120000 index 0000000..6c043bd --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Unirest/UNIHTTPClientHelper.h @@ -0,0 +1 @@ +../../../Unirest/Unirest/UNIHTTPClientHelper.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Unirest/UNIHTTPRequest.h b/grocery-objc/Pods/Headers/Private/Unirest/UNIHTTPRequest.h new file mode 120000 index 0000000..c490ec4 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Unirest/UNIHTTPRequest.h @@ -0,0 +1 @@ +../../../Unirest/Unirest/UNIHTTPRequest.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Unirest/UNIHTTPRequestWithBody.h b/grocery-objc/Pods/Headers/Private/Unirest/UNIHTTPRequestWithBody.h new file mode 120000 index 0000000..6751043 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Unirest/UNIHTTPRequestWithBody.h @@ -0,0 +1 @@ +../../../Unirest/Unirest/UNIHTTPRequestWithBody.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Unirest/UNIRest.h b/grocery-objc/Pods/Headers/Private/Unirest/UNIRest.h new file mode 120000 index 0000000..1795471 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Unirest/UNIRest.h @@ -0,0 +1 @@ +../../../Unirest/Unirest/UNIRest.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Private/Unirest/UNIUrlConnection.h b/grocery-objc/Pods/Headers/Private/Unirest/UNIUrlConnection.h new file mode 120000 index 0000000..d961761 --- /dev/null +++ b/grocery-objc/Pods/Headers/Private/Unirest/UNIUrlConnection.h @@ -0,0 +1 @@ +../../../Unirest/Unirest/UNIUrlConnection.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/AFNetworking/AFAutoPurgingImageCache.h b/grocery-objc/Pods/Headers/Public/AFNetworking/AFAutoPurgingImageCache.h new file mode 120000 index 0000000..f9dc7db --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/AFNetworking/AFAutoPurgingImageCache.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/AFNetworking/AFHTTPSessionManager.h b/grocery-objc/Pods/Headers/Public/AFNetworking/AFHTTPSessionManager.h new file mode 120000 index 0000000..56feb9f --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/AFNetworking/AFHTTPSessionManager.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/AFNetworking/AFImageDownloader.h b/grocery-objc/Pods/Headers/Public/AFNetworking/AFImageDownloader.h new file mode 120000 index 0000000..ce47c92 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/AFNetworking/AFImageDownloader.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/AFImageDownloader.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/AFNetworking/AFNetworkActivityIndicatorManager.h b/grocery-objc/Pods/Headers/Public/AFNetworking/AFNetworkActivityIndicatorManager.h new file mode 120000 index 0000000..67519d9 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/AFNetworking/AFNetworkActivityIndicatorManager.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/AFNetworking/AFNetworkReachabilityManager.h b/grocery-objc/Pods/Headers/Public/AFNetworking/AFNetworkReachabilityManager.h new file mode 120000 index 0000000..68fc774 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/AFNetworking/AFNetworkReachabilityManager.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/AFNetworking/AFNetworking.h b/grocery-objc/Pods/Headers/Public/AFNetworking/AFNetworking.h new file mode 120000 index 0000000..a5a38da --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/AFNetworking/AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFNetworking.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/AFNetworking/AFSecurityPolicy.h b/grocery-objc/Pods/Headers/Public/AFNetworking/AFSecurityPolicy.h new file mode 120000 index 0000000..fd1322d --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/AFNetworking/AFSecurityPolicy.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFSecurityPolicy.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/AFNetworking/AFURLRequestSerialization.h b/grocery-objc/Pods/Headers/Public/AFNetworking/AFURLRequestSerialization.h new file mode 120000 index 0000000..ca8209b --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/AFNetworking/AFURLRequestSerialization.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/AFNetworking/AFURLResponseSerialization.h b/grocery-objc/Pods/Headers/Public/AFNetworking/AFURLResponseSerialization.h new file mode 120000 index 0000000..e36a765 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/AFNetworking/AFURLResponseSerialization.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/AFNetworking/AFURLSessionManager.h b/grocery-objc/Pods/Headers/Public/AFNetworking/AFURLSessionManager.h new file mode 120000 index 0000000..835101d --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/AFNetworking/AFURLSessionManager.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFURLSessionManager.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/AFNetworking/UIActivityIndicatorView+AFNetworking.h b/grocery-objc/Pods/Headers/Public/AFNetworking/UIActivityIndicatorView+AFNetworking.h new file mode 120000 index 0000000..c534ebf --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/AFNetworking/UIActivityIndicatorView+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/AFNetworking/UIButton+AFNetworking.h b/grocery-objc/Pods/Headers/Public/AFNetworking/UIButton+AFNetworking.h new file mode 120000 index 0000000..8f2e221 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/AFNetworking/UIButton+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/AFNetworking/UIImage+AFNetworking.h b/grocery-objc/Pods/Headers/Public/AFNetworking/UIImage+AFNetworking.h new file mode 120000 index 0000000..74f6649 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/AFNetworking/UIImage+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/AFNetworking/UIImageView+AFNetworking.h b/grocery-objc/Pods/Headers/Public/AFNetworking/UIImageView+AFNetworking.h new file mode 120000 index 0000000..a95d673 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/AFNetworking/UIImageView+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/AFNetworking/UIKit+AFNetworking.h b/grocery-objc/Pods/Headers/Public/AFNetworking/UIKit+AFNetworking.h new file mode 120000 index 0000000..95017cc --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/AFNetworking/UIKit+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/AFNetworking/UIProgressView+AFNetworking.h b/grocery-objc/Pods/Headers/Public/AFNetworking/UIProgressView+AFNetworking.h new file mode 120000 index 0000000..730b167 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/AFNetworking/UIProgressView+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/AFNetworking/UIRefreshControl+AFNetworking.h b/grocery-objc/Pods/Headers/Public/AFNetworking/UIRefreshControl+AFNetworking.h new file mode 120000 index 0000000..8efd826 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/AFNetworking/UIRefreshControl+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/AFNetworking/UIWebView+AFNetworking.h b/grocery-objc/Pods/Headers/Public/AFNetworking/UIWebView+AFNetworking.h new file mode 120000 index 0000000..c8df6ef --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/AFNetworking/UIWebView+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Firebase/FAuthData.h b/grocery-objc/Pods/Headers/Public/Firebase/FAuthData.h new file mode 120000 index 0000000..7489b45 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Firebase/FAuthData.h @@ -0,0 +1 @@ +../../../Firebase/FAuthData.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Firebase/FAuthType.h b/grocery-objc/Pods/Headers/Public/Firebase/FAuthType.h new file mode 120000 index 0000000..502e35b --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Firebase/FAuthType.h @@ -0,0 +1 @@ +../../../Firebase/FAuthType.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Firebase/FConfig.h b/grocery-objc/Pods/Headers/Public/Firebase/FConfig.h new file mode 120000 index 0000000..763c99a --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Firebase/FConfig.h @@ -0,0 +1 @@ +../../../Firebase/FConfig.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Firebase/FDataSnapshot.h b/grocery-objc/Pods/Headers/Public/Firebase/FDataSnapshot.h new file mode 120000 index 0000000..8d3d769 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Firebase/FDataSnapshot.h @@ -0,0 +1 @@ +../../../Firebase/FDataSnapshot.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Firebase/FEventType.h b/grocery-objc/Pods/Headers/Public/Firebase/FEventType.h new file mode 120000 index 0000000..4339807 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Firebase/FEventType.h @@ -0,0 +1 @@ +../../../Firebase/FEventType.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Firebase/FMutableData.h b/grocery-objc/Pods/Headers/Public/Firebase/FMutableData.h new file mode 120000 index 0000000..56ea28f --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Firebase/FMutableData.h @@ -0,0 +1 @@ +../../../Firebase/FMutableData.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Firebase/FQuery.h b/grocery-objc/Pods/Headers/Public/Firebase/FQuery.h new file mode 120000 index 0000000..f1006c6 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Firebase/FQuery.h @@ -0,0 +1 @@ +../../../Firebase/FQuery.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Firebase/FTransactionResult.h b/grocery-objc/Pods/Headers/Public/Firebase/FTransactionResult.h new file mode 120000 index 0000000..dd01b82 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Firebase/FTransactionResult.h @@ -0,0 +1 @@ +../../../Firebase/FTransactionResult.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Firebase/Firebase.h b/grocery-objc/Pods/Headers/Public/Firebase/Firebase.h new file mode 120000 index 0000000..a9b6765 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Firebase/Firebase.h @@ -0,0 +1 @@ +../../../Firebase/Firebase.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Firebase/FirebaseApp.h b/grocery-objc/Pods/Headers/Public/Firebase/FirebaseApp.h new file mode 120000 index 0000000..af4c17e --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Firebase/FirebaseApp.h @@ -0,0 +1 @@ +../../../Firebase/FirebaseApp.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Firebase/FirebaseServerValue.h b/grocery-objc/Pods/Headers/Public/Firebase/FirebaseServerValue.h new file mode 120000 index 0000000..c0392db --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Firebase/FirebaseServerValue.h @@ -0,0 +1 @@ +../../../Firebase/FirebaseServerValue.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/FoldingTabBar/CAAnimation+YALTabBarViewAnimations.h b/grocery-objc/Pods/Headers/Public/FoldingTabBar/CAAnimation+YALTabBarViewAnimations.h new file mode 120000 index 0000000..4300617 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/FoldingTabBar/CAAnimation+YALTabBarViewAnimations.h @@ -0,0 +1 @@ +../../../FoldingTabBar/FoldingTabBar/Category/CAAnimation/CAAnimation+YALTabBarViewAnimations/CAAnimation+YALTabBarViewAnimations.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/FoldingTabBar/CATransaction+TransactionWithAnimationsAndCompletion.h b/grocery-objc/Pods/Headers/Public/FoldingTabBar/CATransaction+TransactionWithAnimationsAndCompletion.h new file mode 120000 index 0000000..6645404 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/FoldingTabBar/CATransaction+TransactionWithAnimationsAndCompletion.h @@ -0,0 +1 @@ +../../../FoldingTabBar/FoldingTabBar/Category/CATransaction/CATransaction+TransactionWithAnimationsAndCompletion/CATransaction+TransactionWithAnimationsAndCompletion.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/FoldingTabBar/YALAnimatingTabBarConstants.h b/grocery-objc/Pods/Headers/Public/FoldingTabBar/YALAnimatingTabBarConstants.h new file mode 120000 index 0000000..59a4e5b --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/FoldingTabBar/YALAnimatingTabBarConstants.h @@ -0,0 +1 @@ +../../../FoldingTabBar/FoldingTabBar/Constants/YALAnimatingTabBarConstants.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/FoldingTabBar/YALFoldingTabBar.h b/grocery-objc/Pods/Headers/Public/FoldingTabBar/YALFoldingTabBar.h new file mode 120000 index 0000000..7c9c72a --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/FoldingTabBar/YALFoldingTabBar.h @@ -0,0 +1 @@ +../../../FoldingTabBar/FoldingTabBar/View/FoldingTabBar/YALFoldingTabBar.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/FoldingTabBar/YALFoldingTabBarController.h b/grocery-objc/Pods/Headers/Public/FoldingTabBar/YALFoldingTabBarController.h new file mode 120000 index 0000000..8fb6aca --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/FoldingTabBar/YALFoldingTabBarController.h @@ -0,0 +1 @@ +../../../FoldingTabBar/FoldingTabBar/Controller/FoldingTabBarController/YALFoldingTabBarController.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/FoldingTabBar/YALSpringAnimation.h b/grocery-objc/Pods/Headers/Public/FoldingTabBar/YALSpringAnimation.h new file mode 120000 index 0000000..3059fd1 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/FoldingTabBar/YALSpringAnimation.h @@ -0,0 +1 @@ +../../../FoldingTabBar/FoldingTabBar/Animation/YALSpringAnimation/YALSpringAnimation.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/FoldingTabBar/YALTabBarInteracting.h b/grocery-objc/Pods/Headers/Public/FoldingTabBar/YALTabBarInteracting.h new file mode 120000 index 0000000..87b5470 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/FoldingTabBar/YALTabBarInteracting.h @@ -0,0 +1 @@ +../../../FoldingTabBar/FoldingTabBar/Protocol/TabBarInteracting/YALTabBarInteracting.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/FoldingTabBar/YALTabBarItem.h b/grocery-objc/Pods/Headers/Public/FoldingTabBar/YALTabBarItem.h new file mode 120000 index 0000000..d2b7d0a --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/FoldingTabBar/YALTabBarItem.h @@ -0,0 +1 @@ +../../../FoldingTabBar/FoldingTabBar/Model/TabBarItem/YALTabBarItem.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/HSDatePickerViewController/HSDatePickerViewController.h b/grocery-objc/Pods/Headers/Public/HSDatePickerViewController/HSDatePickerViewController.h new file mode 120000 index 0000000..f503e15 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/HSDatePickerViewController/HSDatePickerViewController.h @@ -0,0 +1 @@ +../../../HSDatePickerViewController/HSDatePickerViewControllerDemo/HSDatePickerViewController/HSDatePickerViewController.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/NSDate+RelativeTime/NSDate+RelativeTime.h b/grocery-objc/Pods/Headers/Public/NSDate+RelativeTime/NSDate+RelativeTime.h new file mode 120000 index 0000000..b403166 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/NSDate+RelativeTime/NSDate+RelativeTime.h @@ -0,0 +1 @@ +../../../NSDate+RelativeTime/NSDate+RelativeTime.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSBarcodes.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSBarcodes.h new file mode 120000 index 0000000..3f60fbc --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSBarcodes.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSBarcodes.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCode128Generator.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCode128Generator.h new file mode 120000 index 0000000..f815c6a --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCode128Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSCode128Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCode39Generator.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCode39Generator.h new file mode 120000 index 0000000..f5b16e9 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCode39Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSCode39Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCode39Mod43Generator.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCode39Mod43Generator.h new file mode 120000 index 0000000..14b655d --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCode39Mod43Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSCode39Mod43Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCode93Generator.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCode93Generator.h new file mode 120000 index 0000000..9d25d53 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCode93Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSCode93Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCodeGen.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCodeGen.h new file mode 120000 index 0000000..38f11dd --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCodeGen.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSCodeGen.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCodeGenerator.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCodeGenerator.h new file mode 120000 index 0000000..b491380 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCodeGenerator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSCodeGenerator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCodeView.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCodeView.h new file mode 120000 index 0000000..3b44575 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCodeView.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSCodeView.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCornersView.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCornersView.h new file mode 120000 index 0000000..cb23205 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSCornersView.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSCornersView.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSEAN13Generator.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSEAN13Generator.h new file mode 120000 index 0000000..197cb1b --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSEAN13Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSEAN13Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSEAN8Generator.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSEAN8Generator.h new file mode 120000 index 0000000..8d6441e --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSEAN8Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSEAN8Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSEANGenerator.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSEANGenerator.h new file mode 120000 index 0000000..0ad452a --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSEANGenerator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSEANGenerator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSExtendedCode39Generator.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSExtendedCode39Generator.h new file mode 120000 index 0000000..18a39d9 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSExtendedCode39Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSExtendedCode39Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSISBN13Generator.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSISBN13Generator.h new file mode 120000 index 0000000..958b577 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSISBN13Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSISBN13Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSISSN13Generator.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSISSN13Generator.h new file mode 120000 index 0000000..db86856 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSISSN13Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSISSN13Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSITF14Generator.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSITF14Generator.h new file mode 120000 index 0000000..5195aa6 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSITF14Generator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSITF14Generator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSITFGenerator.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSITFGenerator.h new file mode 120000 index 0000000..b2813b0 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSITFGenerator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSITFGenerator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSScannerViewController.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSScannerViewController.h new file mode 120000 index 0000000..3da0efa --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSScannerViewController.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSScannerViewController.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSUPCEGenerator.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSUPCEGenerator.h new file mode 120000 index 0000000..9967527 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSUPCEGenerator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSUPCEGenerator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/RSBarcodes/RSUnifiedCodeGenerator.h b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSUnifiedCodeGenerator.h new file mode 120000 index 0000000..d345e81 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/RSBarcodes/RSUnifiedCodeGenerator.h @@ -0,0 +1 @@ +../../../RSBarcodes/RSBarcodes/RSUnifiedCodeGenerator.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/SDWebImage/NSData+ImageContentType.h b/grocery-objc/Pods/Headers/Public/SDWebImage/NSData+ImageContentType.h new file mode 120000 index 0000000..8457498 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/SDWebImage/NSData+ImageContentType.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/NSData+ImageContentType.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/SDWebImage/SDImageCache.h b/grocery-objc/Pods/Headers/Public/SDWebImage/SDImageCache.h new file mode 120000 index 0000000..0040b06 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/SDWebImage/SDImageCache.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDImageCache.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImageCompat.h b/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImageCompat.h new file mode 120000 index 0000000..6ca2478 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImageCompat.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImageCompat.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImageDecoder.h b/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImageDecoder.h new file mode 120000 index 0000000..a2f3a68 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImageDecoder.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImageDecoder.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImageDownloader.h b/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImageDownloader.h new file mode 120000 index 0000000..303b03b --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImageDownloader.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImageDownloader.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImageDownloaderOperation.h b/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImageDownloaderOperation.h new file mode 120000 index 0000000..99441c4 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImageDownloaderOperation.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImageManager.h b/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImageManager.h new file mode 120000 index 0000000..1b81848 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImageManager.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImageManager.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImageOperation.h b/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImageOperation.h new file mode 120000 index 0000000..20e5b89 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImageOperation.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImageOperation.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImagePrefetcher.h b/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImagePrefetcher.h new file mode 120000 index 0000000..50585c6 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/SDWebImage/SDWebImagePrefetcher.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/SDWebImage/UIButton+WebCache.h b/grocery-objc/Pods/Headers/Public/SDWebImage/UIButton+WebCache.h new file mode 120000 index 0000000..19d2d8e --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/SDWebImage/UIButton+WebCache.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/UIButton+WebCache.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/SDWebImage/UIImage+GIF.h b/grocery-objc/Pods/Headers/Public/SDWebImage/UIImage+GIF.h new file mode 120000 index 0000000..14d5aad --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/SDWebImage/UIImage+GIF.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/UIImage+GIF.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/SDWebImage/UIImage+MultiFormat.h b/grocery-objc/Pods/Headers/Public/SDWebImage/UIImage+MultiFormat.h new file mode 120000 index 0000000..1fb9650 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/SDWebImage/UIImage+MultiFormat.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/SDWebImage/UIImageView+HighlightedWebCache.h b/grocery-objc/Pods/Headers/Public/SDWebImage/UIImageView+HighlightedWebCache.h new file mode 120000 index 0000000..fd4dea4 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/SDWebImage/UIImageView+HighlightedWebCache.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/SDWebImage/UIImageView+WebCache.h b/grocery-objc/Pods/Headers/Public/SDWebImage/UIImageView+WebCache.h new file mode 120000 index 0000000..0c53a47 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/SDWebImage/UIImageView+WebCache.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/UIImageView+WebCache.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/SDWebImage/UIView+WebCacheOperation.h b/grocery-objc/Pods/Headers/Public/SDWebImage/UIView+WebCacheOperation.h new file mode 120000 index 0000000..f9890c4 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/SDWebImage/UIView+WebCacheOperation.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/SIAlertView/SIAlertView.h b/grocery-objc/Pods/Headers/Public/SIAlertView/SIAlertView.h new file mode 120000 index 0000000..630cc31 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/SIAlertView/SIAlertView.h @@ -0,0 +1 @@ +../../../SIAlertView/SIAlertView/SIAlertView.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Unirest/Base64.h b/grocery-objc/Pods/Headers/Public/Unirest/Base64.h new file mode 120000 index 0000000..2779320 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Unirest/Base64.h @@ -0,0 +1 @@ +../../../Unirest/Unirest/Base64.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Unirest/HttpRequest/UNIBaseRequest.h b/grocery-objc/Pods/Headers/Public/Unirest/HttpRequest/UNIBaseRequest.h new file mode 120000 index 0000000..7fa0b42 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Unirest/HttpRequest/UNIBaseRequest.h @@ -0,0 +1 @@ +../../../../Unirest/Unirest/HttpRequest/UNIBaseRequest.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Unirest/HttpRequest/UNIBodyRequest.h b/grocery-objc/Pods/Headers/Public/Unirest/HttpRequest/UNIBodyRequest.h new file mode 120000 index 0000000..4f6e4c1 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Unirest/HttpRequest/UNIBodyRequest.h @@ -0,0 +1 @@ +../../../../Unirest/Unirest/HttpRequest/UNIBodyRequest.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Unirest/HttpRequest/UNISimpleRequest.h b/grocery-objc/Pods/Headers/Public/Unirest/HttpRequest/UNISimpleRequest.h new file mode 120000 index 0000000..17fabab --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Unirest/HttpRequest/UNISimpleRequest.h @@ -0,0 +1 @@ +../../../../Unirest/Unirest/HttpRequest/UNISimpleRequest.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Unirest/HttpResponse/UNIHTTPBinaryResponse.h b/grocery-objc/Pods/Headers/Public/Unirest/HttpResponse/UNIHTTPBinaryResponse.h new file mode 120000 index 0000000..ece7c0b --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Unirest/HttpResponse/UNIHTTPBinaryResponse.h @@ -0,0 +1 @@ +../../../../Unirest/Unirest/HttpResponse/UNIHTTPBinaryResponse.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Unirest/HttpResponse/UNIHTTPJsonResponse.h b/grocery-objc/Pods/Headers/Public/Unirest/HttpResponse/UNIHTTPJsonResponse.h new file mode 120000 index 0000000..cfffec1 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Unirest/HttpResponse/UNIHTTPJsonResponse.h @@ -0,0 +1 @@ +../../../../Unirest/Unirest/HttpResponse/UNIHTTPJsonResponse.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Unirest/HttpResponse/UNIHTTPResponse.h b/grocery-objc/Pods/Headers/Public/Unirest/HttpResponse/UNIHTTPResponse.h new file mode 120000 index 0000000..487ac88 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Unirest/HttpResponse/UNIHTTPResponse.h @@ -0,0 +1 @@ +../../../../Unirest/Unirest/HttpResponse/UNIHTTPResponse.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Unirest/HttpResponse/UNIHTTPStringResponse.h b/grocery-objc/Pods/Headers/Public/Unirest/HttpResponse/UNIHTTPStringResponse.h new file mode 120000 index 0000000..3b07217 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Unirest/HttpResponse/UNIHTTPStringResponse.h @@ -0,0 +1 @@ +../../../../Unirest/Unirest/HttpResponse/UNIHTTPStringResponse.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Unirest/HttpResponse/UNIJsonNode.h b/grocery-objc/Pods/Headers/Public/Unirest/HttpResponse/UNIJsonNode.h new file mode 120000 index 0000000..a8f7724 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Unirest/HttpResponse/UNIJsonNode.h @@ -0,0 +1 @@ +../../../../Unirest/Unirest/HttpResponse/UNIJsonNode.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Unirest/UNIHTTPClientHelper.h b/grocery-objc/Pods/Headers/Public/Unirest/UNIHTTPClientHelper.h new file mode 120000 index 0000000..6c043bd --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Unirest/UNIHTTPClientHelper.h @@ -0,0 +1 @@ +../../../Unirest/Unirest/UNIHTTPClientHelper.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Unirest/UNIHTTPRequest.h b/grocery-objc/Pods/Headers/Public/Unirest/UNIHTTPRequest.h new file mode 120000 index 0000000..c490ec4 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Unirest/UNIHTTPRequest.h @@ -0,0 +1 @@ +../../../Unirest/Unirest/UNIHTTPRequest.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Unirest/UNIHTTPRequestWithBody.h b/grocery-objc/Pods/Headers/Public/Unirest/UNIHTTPRequestWithBody.h new file mode 120000 index 0000000..6751043 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Unirest/UNIHTTPRequestWithBody.h @@ -0,0 +1 @@ +../../../Unirest/Unirest/UNIHTTPRequestWithBody.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Unirest/UNIRest.h b/grocery-objc/Pods/Headers/Public/Unirest/UNIRest.h new file mode 120000 index 0000000..1795471 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Unirest/UNIRest.h @@ -0,0 +1 @@ +../../../Unirest/Unirest/UNIRest.h \ No newline at end of file diff --git a/grocery-objc/Pods/Headers/Public/Unirest/UNIUrlConnection.h b/grocery-objc/Pods/Headers/Public/Unirest/UNIUrlConnection.h new file mode 120000 index 0000000..d961761 --- /dev/null +++ b/grocery-objc/Pods/Headers/Public/Unirest/UNIUrlConnection.h @@ -0,0 +1 @@ +../../../Unirest/Unirest/UNIUrlConnection.h \ No newline at end of file diff --git a/grocery-objc/Pods/Manifest.lock b/grocery-objc/Pods/Manifest.lock new file mode 100644 index 0000000..0e7fbbe --- /dev/null +++ b/grocery-objc/Pods/Manifest.lock @@ -0,0 +1,50 @@ +PODS: + - AFNetworking (3.0.4): + - AFNetworking/NSURLSession (= 3.0.4) + - AFNetworking/Reachability (= 3.0.4) + - AFNetworking/Security (= 3.0.4) + - AFNetworking/Serialization (= 3.0.4) + - AFNetworking/UIKit (= 3.0.4) + - AFNetworking/NSURLSession (3.0.4): + - AFNetworking/Reachability + - AFNetworking/Security + - AFNetworking/Serialization + - AFNetworking/Reachability (3.0.4) + - AFNetworking/Security (3.0.4) + - AFNetworking/Serialization (3.0.4) + - AFNetworking/UIKit (3.0.4): + - AFNetworking/NSURLSession + - Firebase (2.5.1) + - FoldingTabBar (1.0.2) + - HSDatePickerViewController (1.0.4) + - NSDate+RelativeTime (1.0.1) + - RSBarcodes (0.1.4) + - SDWebImage (3.7.5): + - SDWebImage/Core (= 3.7.5) + - SDWebImage/Core (3.7.5) + - SIAlertView (1.3) + - Unirest (1.1.4) + +DEPENDENCIES: + - AFNetworking (~> 3.0) + - Firebase (>= 2.5.0) + - FoldingTabBar (~> 1.0) + - HSDatePickerViewController (~> 1.0) + - NSDate+RelativeTime (~> 1.0) + - RSBarcodes (~> 0.1.4) + - SDWebImage (~> 3.7) + - SIAlertView (~> 1.3) + - Unirest (~> 1.1.4) + +SPEC CHECKSUMS: + AFNetworking: a0075feb321559dc78d9d85b55d11caa19eabb93 + Firebase: 3565ea88b830f28f2c77ecc524622bc71a20d085 + FoldingTabBar: 79df76dfd5a84c0a369beaa378a31c07aa53b6b2 + HSDatePickerViewController: 5a72b71f8c3b10e76f2c28a898f8572b551432a6 + NSDate+RelativeTime: 1b03a562615a4496a826e322096e5792e6706612 + RSBarcodes: 6b062b5aba3e75a5e889b2465ef1bb256215fbd0 + SDWebImage: 69c6303e3348fba97e03f65d65d4fbc26740f461 + SIAlertView: 20c794b55eaf44d888773ea51647cf8907723919 + Unirest: 5e4d93eaf32463bf619a4ecd3bbc8c32acf21eac + +COCOAPODS: 0.39.0 diff --git a/grocery-objc/Pods/NSDate+RelativeTime/LICENSE b/grocery-objc/Pods/NSDate+RelativeTime/LICENSE new file mode 100644 index 0000000..bdf72a1 --- /dev/null +++ b/grocery-objc/Pods/NSDate+RelativeTime/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2013 Bart van Zon + +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. diff --git a/grocery-objc/Pods/NSDate+RelativeTime/NSDate+RelativeTime.bundle/en.lproj/NSDate+RelativeTime.strings b/grocery-objc/Pods/NSDate+RelativeTime/NSDate+RelativeTime.bundle/en.lproj/NSDate+RelativeTime.strings new file mode 100644 index 0000000..a3bcd26 --- /dev/null +++ b/grocery-objc/Pods/NSDate+RelativeTime/NSDate+RelativeTime.bundle/en.lproj/NSDate+RelativeTime.strings @@ -0,0 +1,27 @@ +"Now" = "Now"; +"%d seconds ago" = "%d seconds ago"; +"%d seconds from now" = "%d seconds from now"; +"A minute ago" = "A minute ago"; +"A minute from now" = "A minute from now"; +"%d minutes ago" = "%d minutes ago"; +"%d minutes from now" = "%d minutes from now"; +"An hour ago" = "An hour ago"; +"An hour from now" = "An hour from now"; +"%d hours ago" = "%d hours ago"; +"%d hours from now" = "%d hours from now"; +"A day ago" = "A day ago"; +"A day from now" = "A day from now"; +"%d days ago" = "%d days ago"; +"%d days from now" = "%d days from now"; +"A week ago" = "A week ago"; +"A week from now" = "A week from now"; +"%d weeks ago" = "%d weeks ago"; +"%d weeks from now" = "%d weeks from now"; +"A month ago" = "A month ago"; +"A month from now" = "A month from now"; +"%d months ago" = "%d months ago"; +"%d months from now" = "%d months from now"; +"A year ago" = "A year ago"; +"A year from now" = "A year from now"; +"%d years ago" = "%d years ago"; +"%d years from now" = "%d years from now"; \ No newline at end of file diff --git a/grocery-objc/Pods/NSDate+RelativeTime/NSDate+RelativeTime.bundle/nl.lproj/NSDate+RelativeTime.strings b/grocery-objc/Pods/NSDate+RelativeTime/NSDate+RelativeTime.bundle/nl.lproj/NSDate+RelativeTime.strings new file mode 100644 index 0000000..d169266 --- /dev/null +++ b/grocery-objc/Pods/NSDate+RelativeTime/NSDate+RelativeTime.bundle/nl.lproj/NSDate+RelativeTime.strings @@ -0,0 +1,27 @@ +"Now" = "Nu"; +"%d seconds ago" = "%d seconden geleden"; +"%d seconds from now" = "%d seconden vanaf nu"; +"A minute ago" = "Een minuut geleden"; +"A minute from now" = "Een minuut vanaf nu"; +"%d minutes ago" = "%d minuten geleden"; +"%d minutes from now" = "%d minuten vanaf nu"; +"An hour ago" = "Een uur geleden"; +"An hour from now" = "Een uur vanaf nu"; +"%d hours ago" = "%d uur geleden"; +"%d hours from now" = "%d uur vanaf nu"; +"A day ago" = "Een dag geleden"; +"A day from now" = "Een dag vanaf nu"; +"%d days ago" = "%d dagen geleden"; +"%d days from now" = "%d dagen vanaf nu"; +"A week ago" = "Een week geleden"; +"A week from now" = "Een week vanaf nu"; +"%d weeks ago" = "%d weken geleden"; +"%d weeks from now" = "%d weken vanaf nu"; +"A month ago" = "Een maand geleden"; +"A month from now" = "Een maand vanaf nu"; +"%d months ago" = "%d maanden geleden"; +"%d months from now" = "%d maanden vanaf nu"; +"A year ago" = "Een jaar geleden"; +"A year from now" = "Een jaar vanaf nu"; +"%d years ago" = "%d jaar geleden"; +"%d years from now" = "%d jaar vanaf nu"; \ No newline at end of file diff --git a/grocery-objc/Pods/NSDate+RelativeTime/NSDate+RelativeTime.h b/grocery-objc/Pods/NSDate+RelativeTime/NSDate+RelativeTime.h new file mode 100644 index 0000000..288fbc5 --- /dev/null +++ b/grocery-objc/Pods/NSDate+RelativeTime/NSDate+RelativeTime.h @@ -0,0 +1,15 @@ +// +// NSDate+RelativeTime.h +// NSDate-RelativeTime +// +// Created by Bart van Zon on 10/20/13. +// Copyright (c) 2013 Bart van Zon. All rights reserved. +// + +#import + +@interface NSDate (RelativeTime) + +-(NSString *)relativeTime; + +@end diff --git a/grocery-objc/Pods/NSDate+RelativeTime/NSDate+RelativeTime.m b/grocery-objc/Pods/NSDate+RelativeTime/NSDate+RelativeTime.m new file mode 100644 index 0000000..f4e80cb --- /dev/null +++ b/grocery-objc/Pods/NSDate+RelativeTime/NSDate+RelativeTime.m @@ -0,0 +1,78 @@ +// +// NSDate+RelativeTime.m +// NSDate-RelativeTime +// +// Created by Bart van Zon on 10/20/13. +// Copyright (c) 2013 Bart van Zon. All rights reserved. +// + +#import "NSDate+RelativeTime.h" + +@implementation NSDate (RelativeTime) + +const int SECOND = 1; +const int MINUTE = 60*SECOND; +const int HOUR = 60*MINUTE; +const int DAY = HOUR*24; +const int WEEK = DAY*7; +const int MONTH = WEEK*4; +const int YEAR = DAY*365; + +-(NSString *)relativeTime +{ + NSDate *currentDate = [NSDate date]; + int deltaSeconds = fabs(lroundf([self timeIntervalSinceDate:currentDate])); + BOOL dateInFuture = ([self timeIntervalSinceDate:currentDate] > 0); + + if(deltaSeconds < 2*SECOND) { + return [self NSDateRelativeTimeLocalizedStrings: @"Now"]; + } else if(deltaSeconds < MINUTE) { + return [self formattedStringForCurrentDate:currentDate count:deltaSeconds past:@"%d seconds ago" future:@"%d seconds from now"]; + } else if(deltaSeconds < 1.5*MINUTE) { + return !dateInFuture ? [self NSDateRelativeTimeLocalizedStrings: @"A minute ago"] : [self NSDateRelativeTimeLocalizedStrings: @"A minute from now"]; + } else if(deltaSeconds < HOUR) { + int minutes = (int)lroundf((float)deltaSeconds/(float)MINUTE); + return [self formattedStringForCurrentDate:currentDate count:minutes past:@"%d minutes ago" future:@"%d minutes from now"]; + } else if(deltaSeconds < 1.5*HOUR) { + return !dateInFuture ? [self NSDateRelativeTimeLocalizedStrings: @"An hour ago"] : [self NSDateRelativeTimeLocalizedStrings: @"An hour from now"]; + } else if(deltaSeconds < DAY) { + int hours = (int)lroundf((float)deltaSeconds/(float)HOUR); + return [self formattedStringForCurrentDate:currentDate count:hours past:@"%d hours ago" future:@"%d hours from now"]; + } else if(deltaSeconds < 1.5*DAY) { + return !dateInFuture ? [self NSDateRelativeTimeLocalizedStrings: @"A day ago"] : [self NSDateRelativeTimeLocalizedStrings: @"A day from now"]; + } else if(deltaSeconds < WEEK) { + int days = (int)lroundf((float)deltaSeconds/(float)DAY); + return [self formattedStringForCurrentDate:currentDate count:days past:@"%d days ago" future:@"%d days from now"]; + } else if(deltaSeconds < 1.5*WEEK) { + return !dateInFuture ? [self NSDateRelativeTimeLocalizedStrings: @"A week ago"] : [self NSDateRelativeTimeLocalizedStrings: @"A week from now"]; + } else if(deltaSeconds < MONTH) { + int weeks = (int)lroundf((float)deltaSeconds/(float)WEEK); + return [self formattedStringForCurrentDate:currentDate count:weeks past:@"%d weeks ago" future:@"%d weeks from now"]; + } else if(deltaSeconds < 1.5*MONTH) { + return !dateInFuture ? [self NSDateRelativeTimeLocalizedStrings: @"A month ago"] : [self NSDateRelativeTimeLocalizedStrings: @"A month from now"]; + } else if(deltaSeconds < YEAR) { + int months = (int)lroundf((float)deltaSeconds/(float)MONTH); + return [self formattedStringForCurrentDate:currentDate count:months past:@"%d months ago" future:@"%d months from now"]; + } else if(deltaSeconds < 1.5*YEAR) { + return !dateInFuture ? [self NSDateRelativeTimeLocalizedStrings: @"A year ago"] : [self NSDateRelativeTimeLocalizedStrings: @"A year from now"]; + } else { + int years = (int)lroundf((float)deltaSeconds/(float)YEAR); + return [self formattedStringForCurrentDate:currentDate count:years past:@"%d years ago" future:@"%d years from now"]; + } +} + +-(NSString *)formattedStringForCurrentDate:(NSDate *)currentDate count:(int)count past:(NSString *)past future:(NSString *)future +{ + if ([self timeIntervalSinceDate:currentDate] > 0) { + return [NSString stringWithFormat: [self NSDateRelativeTimeLocalizedStrings: future], count]; + } else { + return [NSString stringWithFormat: [self NSDateRelativeTimeLocalizedStrings: past], count]; + } +} + +-(NSString *)NSDateRelativeTimeLocalizedStrings:(NSString *)key +{ + return NSLocalizedStringFromTableInBundle(key, @"NSDate+RelativeTime", [NSBundle bundleWithPath:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"NSDate+RelativeTime.bundle"]], nil); +} + +@end diff --git a/grocery-objc/Pods/NSDate+RelativeTime/README.md b/grocery-objc/Pods/NSDate+RelativeTime/README.md new file mode 100644 index 0000000..0bfc461 --- /dev/null +++ b/grocery-objc/Pods/NSDate+RelativeTime/README.md @@ -0,0 +1,36 @@ +NSDate+RelativeTime +=================== + +NSDate+RelativeTime is an `NSDate` category to generate relative time (or fuzzy +time) strings from dates. NSDate's are parsed to strings like for example +'Now', 'A day ago' or '3 months from now'. NSDate+RelativeTime seperates +itself from other alike categories in the fact that it handles not only past +dates but future dates as well. + +## Usage +* Add the files to your project manually or via +(Cocoapods)[http://cocoapods.org] (`pod 'NSDate+RelativeTime', '~> 1.0'`) +* Import `NSDate+RelativeTime.h` into the class. +* Call the `relativeTime` method on an NSDate to get the relative time. + +## Tests +The tests are in `NSDate+RelativeTimeTests.m` and require Kiwi to run. + +There's a couple of things missing in the tests and I'd love a pullrequest if +you know how to fix one of them: +* A (Travis)[https://travis-ci.org] config file for continuous integration. +* Proper tests for the localization. +* A way to run the tests in a cleaner way (not an entire generated project for +just one file of tests). + + +## Contributions +There are plenty of possibilities for contributions to this category, there's +a lot of optimalizations to be done about the readability of the code and/or +the performance. Also the tests are a bit meager and there's only a few +localizations. If you're not sure about a new feature just create an issue and +lets discuss it! + +## License +AFNetworking is available under the MIT license. See the LICENSE file for more +info. diff --git a/grocery-objc/Pods/Pods.xcodeproj/project.pbxproj b/grocery-objc/Pods/Pods.xcodeproj/project.pbxproj new file mode 100644 index 0000000..3c25c54 --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/project.pbxproj @@ -0,0 +1,2222 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 006E7EF663C6DBB175923E1C137C1FF4 /* RSUnifiedCodeGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = BBA22650F447C08B82B4CE5A67520947 /* RSUnifiedCodeGenerator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 00F09DB5E05D1208F27161E2F016FE36 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C635976F9474E33E8CE76263D7B45F0C /* MobileCoreServices.framework */; }; + 00F8DED37CC833980AEAD7E7BD46C99E /* YALAnimatingTabBarConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 001ABBF0FE9A55B72CFF9812E6E35FAC /* YALAnimatingTabBarConstants.m */; }; + 022B549F10007177A43FAB1DD5114F7D /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A21DA7CC174E0A310C46E2403C6EBFC /* Security.framework */; }; + 05C947CFA1C307C4BEAC8343F0D119C3 /* RSCode93Generator.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D548BDD924117B71137E5A4392B4B96 /* RSCode93Generator.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 06084AD9120FF151ADF37E92A8CDBE83 /* YALFoldingTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D1DC5B65019D76224E732989A66A808 /* YALFoldingTabBar.m */; }; + 075979D6A80AA907E8C15434C532C221 /* FAuthData.h in Headers */ = {isa = PBXBuildFile; fileRef = 094876CBE3DC3F2584054A81EE765E6C /* FAuthData.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0A08FC71C4E3B8E0F8734BCDA7CCA7CB /* AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D223199765615D5B851AFFBE312F34A /* AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0B7B178B2AF6424DB2F950FF61B5A615 /* UNIHTTPBinaryResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 0831A7D277CC97F9CF52DCC6FD2DCE3B /* UNIHTTPBinaryResponse.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 0CDCE7E7AAF38B8C43E7B80BAB98C656 /* RSITF14Generator.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B6017F1989CB7FC5582BB073D4F805 /* RSITF14Generator.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 0FAECEAB5A8F74E9F3EB99F09C01C916 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1BCC847252D74278DD90C79310F62927 /* Foundation.framework */; }; + 10D22A78A018D2158C332B67ADD39BC7 /* RSCodeGen.h in Headers */ = {isa = PBXBuildFile; fileRef = 251F8EE915F35949E70FC9A2011796EA /* RSCodeGen.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 12BA90D4862B705A390B0766659D4C3B /* UIImage+MultiFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A87AF7D56DD134FE694270A462EC478 /* UIImage+MultiFormat.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 134D86030A31C8C7FEF96EC576626444 /* UIImage+MultiFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = C89436DC00C436261C4B9F3FB3CB415B /* UIImage+MultiFormat.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 13C35E84B24CE09AB05530E70BFC78FC /* RSScannerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AEE0BD6A5798D83DF0A2DCCC07FF2AB8 /* RSScannerViewController.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 14CD3DFB4A25BAEFB205730FA6750025 /* AFAutoPurgingImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = F1C4437900180A86D8794856359A1440 /* AFAutoPurgingImageCache.m */; }; + 15460ABD372C937E2A07A2FCDF98C473 /* UIActivityIndicatorView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B27CC87C7D3EDBA929BDAD7BB6BD2F9 /* UIActivityIndicatorView+AFNetworking.m */; }; + 17BBF70528341AAEC35F8EC77512E1A8 /* RSISSN13Generator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0CBC134457BA9A8B0F13A2A89D43F6EA /* RSISSN13Generator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 19E6319F6ECED7539AABBD9A211F7AEC /* AFAutoPurgingImageCache.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C9C2456628641414A48CFE24F27A9B /* AFAutoPurgingImageCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1B80FE40AEB5ECD2017EB51E27A56666 /* NSDate+RelativeTime-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 33D062A8B1E0866C1936D631C803173F /* NSDate+RelativeTime-dummy.m */; }; + 1C06B2E948FFD4A1738D558575ED5BD4 /* UNIHTTPClientHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B3D9465151745C319BEDDB1068F541E /* UNIHTTPClientHelper.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 1C6B2203B329862B0E0AC457977C9098 /* Pods-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 272643F56613CA0D336AE3DBF19DC404 /* Pods-dummy.m */; }; + 1E92974E7DF7F3D13D4273BEF0751853 /* UIButton+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D590461924D689D4654FCD00E564F62 /* UIButton+WebCache.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 1F0C7AB2EFABBBA5F0E53CB862EEFC4A /* UNIHTTPBinaryResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ECA43448BA3C510FC67D5BC421AC8BD /* UNIHTTPBinaryResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2021EAC29409DBF68EF43E9001FD6FFD /* RSBarcodes.h in Headers */ = {isa = PBXBuildFile; fileRef = BE1704DB78F591CCE5894E0B6026D972 /* RSBarcodes.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2053D71CF543C3A3CC47C5409D61923C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8596D8DDEB82BED0AA242B009C963E49 /* CoreGraphics.framework */; }; + 2086289033B670D4FFE18F8578E911F2 /* CATransaction+TransactionWithAnimationsAndCompletion.h in Headers */ = {isa = PBXBuildFile; fileRef = BF247C42914A52BC160DCCB331BB46D3 /* CATransaction+TransactionWithAnimationsAndCompletion.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 23415204AA48A02959E4E5245CF96037 /* AFHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D5F717EFB9A12BAA3D01CEBC32B98D4 /* AFHTTPSessionManager.m */; }; + 2359387620C5E815BF0594BC40311734 /* AFURLRequestSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D3CE1AEF798655FC20331AB6002212 /* AFURLRequestSerialization.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 24AB951C9372D081ADD9D4EFA32CB2B1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1BCC847252D74278DD90C79310F62927 /* Foundation.framework */; }; + 25581EFDD7B61E460F53258C6577767D /* UNIHTTPStringResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 20FF519E57D42753EBB1BBCC08680E5C /* UNIHTTPStringResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 25A3CA8FCDBC9842E5E263BD35798094 /* RSCodeGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8DA6D7A22B07B8D3291B259A5DD81A /* RSCodeGenerator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2690A0FD8106D00EFC2DB5F800B5F419 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2050D0C1B75539ED060A0255620B4AE7 /* AVFoundation.framework */; }; + 28BC86C2B764E67C8AAADA5F30C1E636 /* Unirest-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EB9CF551F8BE58477E8AEAD71720322 /* Unirest-dummy.m */; }; + 2A28E6BCCCA18DD4BECA5792EAAE5FBE /* RSISBN13Generator.h in Headers */ = {isa = PBXBuildFile; fileRef = 98F04AB4F1588387E6CB7A0B3EBD0DB9 /* RSISBN13Generator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2B7D271EE80D6E6AAD7387D222E2F2F8 /* UNIRest.h in Headers */ = {isa = PBXBuildFile; fileRef = E2E3BE833993FD6B71EFD77240FEDEFD /* UNIRest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2D8855CDA875AC8AD7AE0DFCC4250493 /* YALSpringAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 32FA4A3F419A164C42020735FA8EC90B /* YALSpringAnimation.m */; }; + 2DCEC640F134A5D953C2A3C14D38F8C0 /* UIImage+GIF.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E2D95497BEFB8A764C3837B63842BC7 /* UIImage+GIF.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 2E84C28542CB41B4880B17BFE8FDB669 /* SDImageCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 67BF7EDAE1E08F687624C87EE20C05C1 /* SDImageCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2F50E533C734AEA1875D96E8EE739B46 /* UNIBaseRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C0BCBC41BD29F201E1BDB31BA7EAC1E /* UNIBaseRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 311A9FA99DF0294FAECF88C6459BED5E /* UNIBaseRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = C3FDE2B49BA225D9D6DAE1013C697FAE /* UNIBaseRequest.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 311E5200832E4AE174A193851A2C6317 /* AFSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = 264120AEF1933D492DE3C2CB43FDA1EB /* AFSecurityPolicy.m */; }; + 326A543AD4E39A2DAECA1CD385E3AEA2 /* AFImageDownloader.h in Headers */ = {isa = PBXBuildFile; fileRef = E9999FD6944BBF804A9A834FECECAA11 /* AFImageDownloader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 33E1C69B9E6358BD89C10593E483AF05 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53877185B4DAB43F4EA27CE096CE8A27 /* ImageIO.framework */; }; + 343BA26395BFBF73CFC3F42871C03BB9 /* YALFoldingTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B427D418ADD74F918CC6B583037B99B /* YALFoldingTabBarController.m */; }; + 3511AE7ADBB71D05565854F0E70B7D08 /* AFURLSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F3AD86CCBBB5959F94A66EA00829F9F /* AFURLSessionManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3725BBDB6008FC08F7EAAD30051B31EA /* NSData+ImageContentType.h in Headers */ = {isa = PBXBuildFile; fileRef = DDFFB63C5B7AB4BCAF75FF1017028A88 /* NSData+ImageContentType.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 38EEA9ED6B922946C54AD6BAC93B73AD /* UIProgressView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 290A7F705B8C5BDB01249D54F0F4E8C6 /* UIProgressView+AFNetworking.m */; }; + 3939531EB270B4145C7ADFBAB2E5695F /* AFNetworkActivityIndicatorManager.h in Headers */ = {isa = PBXBuildFile; fileRef = B60A4B1045E81E81624EE0B3A6E7C5EF /* AFNetworkActivityIndicatorManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3BC5621A2DA38E302E4D3A891CAD35CE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1BCC847252D74278DD90C79310F62927 /* Foundation.framework */; }; + 3BF789DD91B049645722960CC51287EB /* CATransaction+TransactionWithAnimationsAndCompletion.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BCAF5BAB1ACA33540167929113B0FB1 /* CATransaction+TransactionWithAnimationsAndCompletion.m */; }; + 3D54C50D0E2395DED1B3A7FF341DD8B7 /* SIAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = C20D15D79B151ABCD35AC6FCDC0C3E5A /* SIAlertView.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 3D9C6D8D9075C09C12E53E0D5B06F15E /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2C4E468528F21BE2931AC7445D97066 /* CFNetwork.framework */; }; + 3ECE2EF97A88A20FBFCFB183128F34CD /* SDWebImageOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 26A363E7B60C2EB63EE8A0BFD1C6E5DE /* SDWebImageOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3F22F066A00A290FC204C43694862179 /* SDWebImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = D51656B33C989C68356771805D5111E2 /* SDWebImageDownloader.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 3FD61871A384128BD423ECB516B54AC8 /* FEventType.h in Headers */ = {isa = PBXBuildFile; fileRef = 78A66B919E4EE937716B7E0BCF924D7D /* FEventType.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 40E5ECD182BA38CF8409F77D17BFDFAB /* SDWebImagePrefetcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 2683523293DBB34AB2D13922DE6D2D03 /* SDWebImagePrefetcher.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4177C09FD15C6A223F21AEBA1678CCC5 /* UNIUrlConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = FE5DBB2C258D9C4CA6E27F03133FF308 /* UNIUrlConnection.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 41951BD7B30766A40C99BD78BF04542A /* SDWebImageCompat.m in Sources */ = {isa = PBXBuildFile; fileRef = 20F8DC1818E3E8A3AFBB623D06B3BA0D /* SDWebImageCompat.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 42B95931934DA29AFD168258602A8D6F /* UNIHTTPRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = AC67FD8B88DA781BE1BD48DE6E599C71 /* UNIHTTPRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 43098B12DF5546CB576986E68DBCAFCA /* AFNetworkReachabilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D05C3CE8F1AFB523C406EFA1E3AE0E02 /* AFNetworkReachabilityManager.m */; }; + 45D720843880BBEA904686790D88C1D9 /* RSEAN13Generator.m in Sources */ = {isa = PBXBuildFile; fileRef = 271AA58899855FD4CF74E630DEF80208 /* RSEAN13Generator.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 4776EC0DDD37C8DB7C31DB7F8FA0F24C /* UNISimpleRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 4347DB64B832F5B70F97042C311D43B2 /* UNISimpleRequest.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 47964FB9BAEBC58939B41205A6D1F938 /* UIImageView+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 5096454D954F0B14600B105A06389966 /* UIImageView+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4AE637307423E63FDF2450FEC69E02D7 /* UNIHTTPRequestWithBody.m in Sources */ = {isa = PBXBuildFile; fileRef = 91A1AA65B3AB397EA1CB5FFAF930E490 /* UNIHTTPRequestWithBody.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 4BA19F7DD8F9FDA648137B2CE89E7588 /* AFNetworkActivityIndicatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D24855FD252EFDC1131CBFC56A7BA78A /* AFNetworkActivityIndicatorManager.m */; }; + 4BB0B162D330C81EF66E4DC89BB5A43C /* RSUnifiedCodeGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FF7E9BB928F857D5247ECE330161B08 /* RSUnifiedCodeGenerator.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 4EB32C5270AEE37A31B3B8CF0BF5CF3D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1BCC847252D74278DD90C79310F62927 /* Foundation.framework */; }; + 509B0CDE59DE54A4BD578E58DFB09E5F /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C27954D5024C2307071D22A24854938 /* CoreImage.framework */; }; + 521665982DB6EF44C5F391B652D46F0B /* SDWebImage-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = E39D4C26946BF8FDBA32CD7ED9F7FC1F /* SDWebImage-dummy.m */; }; + 537A40F2C8C55B233C338EA879919B0B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1BCC847252D74278DD90C79310F62927 /* Foundation.framework */; }; + 539E16706942EEFF57B9C22B40A29B56 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1BCC847252D74278DD90C79310F62927 /* Foundation.framework */; }; + 53D0B973380E281E22C7EA6ADD0D0103 /* UNIBodyRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = C0D56BBCEE184C0308B4FA598F05DA1C /* UNIBodyRequest.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 565365EA7F73C65562A3FC4459E770B5 /* YALSpringAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 1BD0BA6AD2DEF0AA3A81F7205F1B3F8F /* YALSpringAnimation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 56D864FDD6BB32F4CE658A73E3BF64A1 /* RSEAN8Generator.m in Sources */ = {isa = PBXBuildFile; fileRef = 20CCFEDD30275219129E7FBD60F07D4F /* RSEAN8Generator.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 583B061655246530AF4CD201AE9E8026 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1BCC847252D74278DD90C79310F62927 /* Foundation.framework */; }; + 587B9A01E181D485939E054CC43116D4 /* SDWebImageDownloader.h in Headers */ = {isa = PBXBuildFile; fileRef = 8FBD09F2E9A90C80DF50A40C3B26A683 /* SDWebImageDownloader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5D52DB6DF2E6C24CECB0015A9177A2E1 /* UIProgressView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B62E4165E44A39AFB7FDC89097F992D /* UIProgressView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5DECB1B57E660AAA21B13271D1871ACC /* SDWebImageDecoder.h in Headers */ = {isa = PBXBuildFile; fileRef = D8CD89FD27B567D503C27A5FEE9EC60A /* SDWebImageDecoder.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5EA196683EECD4C532DACB29CF8EFF1E /* RSScannerViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 89D7A507EFEEC6E842426A507C5A9806 /* RSScannerViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5FEFAACB09AFFD53C3AF63DC273BD3F1 /* UNIHTTPStringResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 7C6A206080C5403BBA7DABCCE047A51A /* UNIHTTPStringResponse.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 602BE62AF8FB782622693A50934CF0C5 /* RSCode39Generator.h in Headers */ = {isa = PBXBuildFile; fileRef = 93A004983F765896561A4F740AD58450 /* RSCode39Generator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6083F51989A0009C740D92767F4DC1FC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1BCC847252D74278DD90C79310F62927 /* Foundation.framework */; }; + 62A7EAB2D4F1E19A68365D70FE1D61CD /* RSCode39Mod43Generator.m in Sources */ = {isa = PBXBuildFile; fileRef = FB4276173B37D4CC17AD924537B4DF06 /* RSCode39Mod43Generator.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 6457E1FF63C4479D2D4F288A209A7A19 /* NSDate+RelativeTime.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E7E9B6535A89643600F990CFD6A942E /* NSDate+RelativeTime.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 647E650A08B67B558A6C1A0041544B1D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C568BF7DC7405C1CA3A1FFEF70FAA641 /* QuartzCore.framework */; }; + 68849CE3E101FFDC9C2073D89C9BC023 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1BCC847252D74278DD90C79310F62927 /* Foundation.framework */; }; + 6A1B1829F5A55FB2979D58FB8F957AD7 /* FirebaseApp.h in Headers */ = {isa = PBXBuildFile; fileRef = 192EC3248E86EBE521A5049404973024 /* FirebaseApp.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6A73740FE15149B793B5B6679B12EC39 /* SDWebImageDownloaderOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 175A13F9014370BB99A72287694B964C /* SDWebImageDownloaderOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6DFB846C756551ECD366F5AC7B189C2C /* YALTabBarInteracting.h in Headers */ = {isa = PBXBuildFile; fileRef = D97C19939DF3C769754C3A6D9CC6A5F0 /* YALTabBarInteracting.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6EC97BDB3FC508526F9E388095A7DDCC /* UIImageView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 820EF46A002155631B09AF5C382AFE12 /* UIImageView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6EE911B933800447253BC3935A13E65E /* FDataSnapshot.h in Headers */ = {isa = PBXBuildFile; fileRef = 84C17D603BDCDB9250A4E11B69121B5F /* FDataSnapshot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 71DF67850774658371D1DFD4DF5186E7 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A21DA7CC174E0A310C46E2403C6EBFC /* Security.framework */; }; + 730374C21770498C86DE74E46AACB026 /* SIAlertView-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = E7C2E4CB22000A0DC0CB9D91EF98CB6F /* SIAlertView-dummy.m */; }; + 7873F380EBB90D62BB98741912B517DE /* HSDatePickerViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = FEE1C814F6CB19DED2423986A88010E8 /* HSDatePickerViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 78940A6980F359C4304C695EF6E67C5D /* UIButton+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 6290D3809B774BA20314DA284EAC050D /* UIButton+AFNetworking.m */; }; + 7BFE02130009BBC706219DD0D68AE2AD /* RSEANGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = FFF4E9EE240A82DCA2B5603903F65C1B /* RSEANGenerator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7D61164DB76C41A575EFA4BEA1659195 /* UNIHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = A3E8834FB4B531356397417C965A7B95 /* UNIHTTPRequest.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 7E2DF08155A768C1FC56AD8B58731044 /* SIAlertView.h in Headers */ = {isa = PBXBuildFile; fileRef = D0E278A86A921938CCD886CA1129771D /* SIAlertView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7E89AB2599B4B2761F6196E486BFC012 /* UIView+WebCacheOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 882117FF9CC46BE0C573A483C559B51B /* UIView+WebCacheOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7EE9BE9884D5807EC2C980930CB99B06 /* YALFoldingTabBarController.h in Headers */ = {isa = PBXBuildFile; fileRef = 79E3FA8B2698537FD912E3914FAFA102 /* YALFoldingTabBarController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7F0578A0258E02384F6229C678E60D31 /* UIRefreshControl+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = CDC037FC7440648854AB6F642481ED5E /* UIRefreshControl+AFNetworking.m */; }; + 830050886B18F54E17F117FD8EFC717B /* UIActivityIndicatorView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 78D45F874FA117AF922CAA2BE89F3CBE /* UIActivityIndicatorView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 83126EA3B5E960F9A9C155CE3DACB9FB /* FConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 34584379769D592ED950BE5BE715A224 /* FConfig.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 84754CB255B272AFEFE1ECF132DE7E93 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1BCC847252D74278DD90C79310F62927 /* Foundation.framework */; }; + 853B842BC699077F4E8B81255BBC25D9 /* RSITFGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = E22BD309CDCA3AB530B13F9D9A49C714 /* RSITFGenerator.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 8595B032DDECA1D860BFEA53A6D6D2A6 /* UNIBodyRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 97B32F1E7FEBBE2258B99CCBE6D91B5A /* UNIBodyRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 85F33B42BE41674F5FA8A16002E02F8B /* UIImageView+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = D37CE45345B8EB22D82D8A02BBF84C23 /* UIImageView+WebCache.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 85FAB6F1D2FE0598BF2E61D7BB084B8D /* UIKit+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = DB5B56E6FD1B6DC58CEE9F312A7AC93F /* UIKit+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 88410794220AF1062177201E82FF9DBA /* YALTabBarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 116A3146C31454F60A224C6F6D54D43A /* YALTabBarItem.m */; }; + 8A8B2E7318F9A52B0C8DCF4991BD88E5 /* Empty.m in Sources */ = {isa = PBXBuildFile; fileRef = 72120211B201B79DC9136FC5131A74E2 /* Empty.m */; }; + 8E82178CC9BD8BE3DBF2C10E33807AEB /* AFURLRequestSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 10FAD1C42DCA0F20876A829D3EE2CD5A /* AFURLRequestSerialization.m */; }; + 8F4F6C91327C6D43B7C6A83EBDC6184B /* FirebaseServerValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 341656227DE44EE01D8B35942CA8F205 /* FirebaseServerValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 919C30BBC314E52FBF81D39D16547D74 /* Base64.h in Headers */ = {isa = PBXBuildFile; fileRef = CEA9160AD79D33BD4C7F993D2E5B9911 /* Base64.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 92B6A6C10EA3DC9D1CB2597060A5ABD4 /* RSCode128Generator.m in Sources */ = {isa = PBXBuildFile; fileRef = 517CB82BD1DF1B0646ADB42B1C6F591D /* RSCode128Generator.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 9508C00EC77A478ABFF00750086579A9 /* RSCodeGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = F27DEC81A766F040B3A8523B43CFE5D2 /* RSCodeGenerator.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 96F433015846F04297190A7D3630DF40 /* Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 08D4E341F74BB0BF078F68EFF4107697 /* Base64.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 981CE79ADCBDC4FF4D3C68FE43F2B140 /* SDWebImageDownloaderOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D95CE1C0964CDF43EEA68D1D4A11642C /* SDWebImageDownloaderOperation.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 9A9F70CFB3E75F1135E39FD443A6DC6D /* RSCornersView.m in Sources */ = {isa = PBXBuildFile; fileRef = D23AB232781077BBAF26E517F4A92F19 /* RSCornersView.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 9B0541696EE15108DCFF61C402206E42 /* UNIHTTPJsonResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 7CE34CDC5A7F37E8F7807EE096CBFA4A /* UNIHTTPJsonResponse.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 9B12A05451D14B5E75D50E37EF2FBB85 /* NSData+ImageContentType.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E47006C1108E3CCC2C2F7A0636E257 /* NSData+ImageContentType.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 9E1CC4F0553F4B8BBBCFEAC9AF64279D /* RSEAN13Generator.h in Headers */ = {isa = PBXBuildFile; fileRef = B717EE1084172410CE931F7FE8AEE352 /* RSEAN13Generator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9EF75898BB50BFC4514A38C85166CD85 /* SDWebImageCompat.h in Headers */ = {isa = PBXBuildFile; fileRef = E27A791BDEABCB66CEDA3ED57B0BB941 /* SDWebImageCompat.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A189ED004109E816D7C39A0D15774DED /* UIImage+GIF.h in Headers */ = {isa = PBXBuildFile; fileRef = 147F4A1B3181323D3B312C7C595799DF /* UIImage+GIF.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A3A65E51C9AA4520F3E237F79320529B /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C568BF7DC7405C1CA3A1FFEF70FAA641 /* QuartzCore.framework */; }; + A3B913AF833548248DA44E7054DB78FF /* RSCodeView.h in Headers */ = {isa = PBXBuildFile; fileRef = 07301CC24FF26A4CDFBBE43C5C913A42 /* RSCodeView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A5035EDCA2C178ABAC6CBF1C82D0C649 /* FMutableData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9516417C2FACD6488C658DBA2269E3D7 /* FMutableData.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A5843E8133D23D0032C893E2BB70FE4C /* UNIHTTPResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 976477CF56EACD5F7844A30BD1F0C85F /* UNIHTTPResponse.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + A5A2E68EC92D877AE2289A67BA94C9E7 /* CAAnimation+YALTabBarViewAnimations.m in Sources */ = {isa = PBXBuildFile; fileRef = E28347D0104F727CBF3C568CDCD5A58D /* CAAnimation+YALTabBarViewAnimations.m */; }; + A5EF7E6ADB37EC0A0DE6145812D8998D /* FoldingTabBar-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A88FCC1E5569FC622607028EF66EE48 /* FoldingTabBar-dummy.m */; }; + A6A403231A96C6C21C83BAEF0BB1093F /* CAAnimation+YALTabBarViewAnimations.h in Headers */ = {isa = PBXBuildFile; fileRef = DF51FD97A5279436D972E9E65EC0B233 /* CAAnimation+YALTabBarViewAnimations.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A7E77CDB17BC604B8C7EA430D4C29DC1 /* RSITF14Generator.h in Headers */ = {isa = PBXBuildFile; fileRef = C3BED2104CAE5F66DA333281006D1D3E /* RSITF14Generator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A8FC6A53F6C1CB4DEFD972664E1AF3B1 /* AFNetworking-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 15EA89E354E1B117B7D01F1B06ECBFD3 /* AFNetworking-dummy.m */; }; + AA014BBE493D0FC8B79F3019741877D9 /* UIImageView+HighlightedWebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 21006BD6CD96355B6514524F865FDAB7 /* UIImageView+HighlightedWebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA78F95D587393A44639A82E7DE0B168 /* RSCornersView.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C19E0E3BEE6DD238C3481DA7CC6FB2 /* RSCornersView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AAA04105CFAC750DDA1A4D1B0262C069 /* UIImageView+HighlightedWebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 985E6290EBECD97B0E13AD64D8F3D76D /* UIImageView+HighlightedWebCache.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + AAC90E0C31623FA8C638E736EAF76386 /* RSCode128Generator.h in Headers */ = {isa = PBXBuildFile; fileRef = EB73CD0499BCCA9C550D387C285F7347 /* RSCode128Generator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AC597FA8F18E8EAC034061B99CEC03DD /* RSUPCEGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = B12199D433256F98EFB89BFA17DE5825 /* RSUPCEGenerator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + ACE9C1A6E8D5121C6C5F907C7A9CFCC9 /* UIRefreshControl+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = BA2DF80F7B80DC52F46237758B8709BE /* UIRefreshControl+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AD0CAA400B7787C113247C747E682818 /* SDImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D09026E66AAFA7EF4A55FF0EE0B55C9 /* SDImageCache.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + AD359A96DD4AA2C962E50A5CD5524F54 /* UIWebView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 01B092702BDE33E0C5BB94171884DBAC /* UIWebView+AFNetworking.m */; }; + AE0F00B728BDB71F11CD84E02E820564 /* SDWebImageDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E0ED74D4CFD6C830083D7D5B4FB8D58 /* SDWebImageDecoder.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + B0BE398350F83A7B0102C3BBAFC51428 /* UIImageView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 7A73A69B29B977EDB682329D6C78AFB5 /* UIImageView+AFNetworking.m */; }; + B26745CB8E5F612261B65D77DFA204A8 /* UNIJsonNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 53C938307DD8D3CED378E270FAFD4C05 /* UNIJsonNode.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B2DB66509B953232772CC24828B2A2D6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EBA4E7C408540624004687482925CE1 /* UIKit.framework */; }; + B37D93A61F7D3E59C0072FD333FAD838 /* UNISimpleRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = AB6B4E8E3BEA16FCAA30C60C5BB95D5A /* UNISimpleRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B50EA8AB3CF7CF9162E24421784D4BAD /* YALFoldingTabBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F45E62A78431D3EAB50F7A9A1887A65 /* YALFoldingTabBar.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B51AA1F7701DCDBCC9B88A15320F9C2C /* AFURLResponseSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 515B96A0A7556AD7FEC6D2A8A9000800 /* AFURLResponseSerialization.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B5A80A9419F6B2761A85A883A1205F54 /* RSCode93Generator.h in Headers */ = {isa = PBXBuildFile; fileRef = BBCA0CCDCBB115486E3FAC9061EE9F36 /* RSCode93Generator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B5CF67F7870BAB70A76E57479B706B42 /* UIWebView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5D5053B9A456DABCA70A661CB0FC89 /* UIWebView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B682329EDE95117413AB34E604B70445 /* HSDatePickerViewController-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = ECA85143C85F24D200A165770136B0BE /* HSDatePickerViewController-dummy.m */; }; + B7B41E32FB4ADB6C44FB3797B9BB77AE /* Firebase-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F92E1C7996C02E7B526FFD37E172C5C1 /* Firebase-dummy.m */; }; + B89A4308CD40B0011195C7D370B4D8EF /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD6940EA22C3DC951575E9878F82F68C /* SystemConfiguration.framework */; }; + B8DB3FE2E2AEAFB48CBF36813E62B315 /* RSISSN13Generator.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FE66780CAA3E1B71613F84521A9B90D /* RSISSN13Generator.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + BC452DFE143921AED9DA09AD20B6861D /* RSExtendedCode39Generator.h in Headers */ = {isa = PBXBuildFile; fileRef = 269754542D2F230923B354C329C6211B /* RSExtendedCode39Generator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + BF41B9464EF9BB86E52FECBD9BB72C8D /* SDWebImageManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C036FDFB9C1A421C33ED3580EAB59AE /* SDWebImageManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + BFAC5988E6FC8D933FD7CE19DDC256C2 /* SDWebImageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 353720A9F9419765E927ED820CE36805 /* SDWebImageManager.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + C1B65C3D849FEE4FB5298A8135A765DA /* UIImage+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = D01CA6D092548B64AC210396E0B19B74 /* UIImage+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C2201E34603B014192F0967473518496 /* AFURLResponseSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = E18310A21D58804BEDB5F9ACAF430FD3 /* AFURLResponseSerialization.m */; }; + C3899AFB1B9509CBDD68B388CADF4A43 /* UNIHTTPRequestWithBody.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A25C4C4E66C69638F1DB24147DAC9FD /* UNIHTTPRequestWithBody.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C3E853EDE6315BFA624A6760EE65DA87 /* UIButton+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 105EB18DDECD31D945F8DF8D590C4E73 /* UIButton+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C700B372A513DADEE2DFE69E85D54DE6 /* RSEAN8Generator.h in Headers */ = {isa = PBXBuildFile; fileRef = 555D590EB2CB85EB7E74BF500925D21C /* RSEAN8Generator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C8A54E36FF34DCB9F1BDA74AEC53B3A6 /* RSCode39Generator.m in Sources */ = {isa = PBXBuildFile; fileRef = 18B6EE618778A621563CF3EB09FB7426 /* RSCode39Generator.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + C9B2789B5C77981D226512D3AFA94AC2 /* Firebase.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CB6EA6F905DD15AFBB41E1B6319B9BC /* Firebase.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CC8A58A1B4453A7EC869B1AE9A9F05B3 /* UNIHTTPClientHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = E3BDDCCD6FFCFD0E8115347FE92B15ED /* UNIHTTPClientHelper.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CC90184B2A2BA15775A6414A8215CC7C /* RSITFGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A064A6FBF820CF0E9E970012EA49943 /* RSITFGenerator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CE8965366A3B07A6C0615055A31B8B83 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD6940EA22C3DC951575E9878F82F68C /* SystemConfiguration.framework */; }; + D0B3C9199F1F5E1CC20F49DA4AF3A1C4 /* RSCodeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4308892AD0D1F7328FC8E446DCA72387 /* RSCodeView.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + D0DEBD2294022D8CFB829F12382449C0 /* RSCode39Mod43Generator.h in Headers */ = {isa = PBXBuildFile; fileRef = 284E064343257AE2A06B1DB383621958 /* RSCode39Mod43Generator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D2597C4AB8316CB430A3460C98D86D68 /* HSDatePickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AEBC205C40EB448E58CA2D55D53C07B /* HSDatePickerViewController.m */; }; + D29D86661B99C954E8301C4157961A40 /* FTransactionResult.h in Headers */ = {isa = PBXBuildFile; fileRef = BDBAFCF8B681ED3A551B91568643551A /* FTransactionResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D31FEE51AF4BE2A6CC059F80B983CD3B /* AFImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = B85FF85ACD829202BB751C53905D1325 /* AFImageDownloader.m */; }; + D483A846E759D80AF1F8A64D5E7610F9 /* RSISBN13Generator.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A549C931DE431DA222DAC5C831C051 /* RSISBN13Generator.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + D90B3B51F99FFC7123EA7A1B030A1B1A /* NSDate+RelativeTime.h in Headers */ = {isa = PBXBuildFile; fileRef = B66EB15C19225526D9A99A6E5540A763 /* NSDate+RelativeTime.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DC7FD5B33348C67C33ABCE00822B7BD0 /* UNIUrlConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C702EF29F18337061E4E25406760C13 /* UNIUrlConnection.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DCA6EB3FF23BD34E281E72549137BF6F /* SDWebImagePrefetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = A64F5BD2E96EF942744706EF319BD3A7 /* SDWebImagePrefetcher.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + DFDAC8245626953C4BCE5A2DA6BE2A5B /* AFSecurityPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = F62317544B3D725AA922F03A02C1B632 /* AFSecurityPolicy.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DFE5C0DC699187F83C1BB439838B7321 /* RSExtendedCode39Generator.m in Sources */ = {isa = PBXBuildFile; fileRef = A2D0A08CE80C08F40B0E4044757E24FB /* RSExtendedCode39Generator.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + E07426B6C4CDD56E8F5C14BD73A712DF /* UNIHTTPResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 3997C23D58D3AB88755F581402CCC112 /* UNIHTTPResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E212C2AA95E8F6EFB69A5F1455F291F8 /* UIButton+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = FA85CB34FEC4D83A2924122CCBED64D0 /* UIButton+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E288DE93014B057EC4C1871E17F3FA89 /* YALTabBarItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 49138BE9C7E6EC2FF6C05CE35202AA27 /* YALTabBarItem.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E2FAF6938051534ECC1EC84D8B45EA43 /* UIView+WebCacheOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = A7FA928277224EF0FFC145BAC1D30F74 /* UIView+WebCacheOperation.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + E3D0CEAADB7D1F8FB4ECC24556A88BF9 /* RSEANGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = B040F5342BC532FB65B515BC369B6F70 /* RSEANGenerator.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + E6117DB8A19163E7C2889993F85DC486 /* UNIJsonNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BC6D1B3B52B7D9F709889D0E48CC628 /* UNIJsonNode.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + E6E0B008759D9B3D9EE25FD2FE56E715 /* YALAnimatingTabBarConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E3EEAF15234BEA71BFB0C24FB77D631 /* YALAnimatingTabBarConstants.h */; settings = {ATTRIBUTES = (Public, ); }; }; + ED69D9B5A342FE9BD3F170D5CDDEC948 /* AFNetworkReachabilityManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EFF364058CC34E834A1C31988F5825B /* AFNetworkReachabilityManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EF9A4E1E75E79BAC9D90351A0FE04D04 /* RSUPCEGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = C363098EF7252057F7426C17E417883F /* RSUPCEGenerator.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + F06664877754422D6FB53A1D8E4FE448 /* FAuthType.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EC8F905FAA397DA3CE2DFFC7A57CCA1 /* FAuthType.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F215CEB8C27EE3A2675A994D6B2E109D /* RSBarcodes-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FF610949E922A7540FC67FC90A70E6A /* RSBarcodes-dummy.m */; }; + F3774B1449FCE5B3CA3E1B336E11D284 /* AFHTTPSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A8CD356250246A37F6C7AB628436D3A /* AFHTTPSessionManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F6BD22EBD6F7A829D765BC40C3CCDAF1 /* UNIHTTPJsonResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A5E771520E0AB4BE5BE1B0824CD248F /* UNIHTTPJsonResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F7F6EACE7A90D2577C6E99E0FBDF02B6 /* UNIRest.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E1C005255D42E6930F79B2FA2FA9CC4 /* UNIRest.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + FC18554D24943F3FEEBC7222C7FD8D10 /* FQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = 3782D172A4204AFC95257FE3C6E1A606 /* FQuery.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FCDDD3BC67EA205C87238A2A87D5C36C /* AFURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 33FF18ABC05ECFBB7A223BFD358FB2BC /* AFURLSessionManager.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 18EE988F850BA3A17BC7C0356EB970B7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6B0B9C928B05BA6346AB032DD0260C56; + remoteInfo = HSDatePickerViewController; + }; + 1EFC94EB2AF5394D6954FB188FBC8882 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 928353533005A4198EBDA5B700D37B64; + remoteInfo = AFNetworking; + }; + 452BEC923978AAB21FA439729059A4E1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 4FC57AD0A574066CF6D2C2D9857A50F7; + remoteInfo = "NSDate+RelativeTime"; + }; + 55A7D58EE48BFA38F194499735DBEDD2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 569735B422E0E4CEEFC5C6955AFDE3A5; + remoteInfo = Firebase; + }; + 73CA390F9F0BB877DEBD8463438FD2D1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 9145E070690055EA2D82D264E78B0F71; + remoteInfo = FoldingTabBar; + }; + 771EE832D75BA5A33C5384BE64106413 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = F86F3D4C7C4CF4BC533F12010483E3EB; + remoteInfo = SIAlertView; + }; + 92DF52EBA3EA4D46F6F6F98D93C6F150 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = A5620D90C319CE08C7E4BD86A7665AEF; + remoteInfo = RSBarcodes; + }; + E448A60F87342C5DAF95425F0FDC2DCA /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = DB01679F34E5831762A89315547D9445; + remoteInfo = Unirest; + }; + F66A9D55BCFA55E69CA1B4DACC020290 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 4EB392DBB5283EE08DA12AB8336D08CB; + remoteInfo = SDWebImage; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 001ABBF0FE9A55B72CFF9812E6E35FAC /* YALAnimatingTabBarConstants.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YALAnimatingTabBarConstants.m; path = FoldingTabBar/Constants/YALAnimatingTabBarConstants.m; sourceTree = ""; }; + 01A653C04F2D1061D83E9591AA3328B0 /* libRSBarcodes.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRSBarcodes.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 01B092702BDE33E0C5BB94171884DBAC /* UIWebView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIWebView+AFNetworking.m"; path = "UIKit+AFNetworking/UIWebView+AFNetworking.m"; sourceTree = ""; }; + 03C3EB1DD7F31115225CC05D9D3843B1 /* libFoldingTabBar.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFoldingTabBar.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 04D090868BD4313DB321CDA09AC2F7B5 /* AFNetworking-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "AFNetworking-prefix.pch"; sourceTree = ""; }; + 07301CC24FF26A4CDFBBE43C5C913A42 /* RSCodeView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSCodeView.h; path = RSBarcodes/RSCodeView.h; sourceTree = ""; }; + 0831A7D277CC97F9CF52DCC6FD2DCE3B /* UNIHTTPBinaryResponse.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = UNIHTTPBinaryResponse.m; path = Unirest/HttpResponse/UNIHTTPBinaryResponse.m; sourceTree = ""; }; + 08D4E341F74BB0BF078F68EFF4107697 /* Base64.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = Base64.m; path = Unirest/Base64.m; sourceTree = ""; }; + 094876CBE3DC3F2584054A81EE765E6C /* FAuthData.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = FAuthData.h; sourceTree = ""; }; + 0BE200E58E798E835F55E45CA9506F2F /* libSDWebImage.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDWebImage.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 0CBC134457BA9A8B0F13A2A89D43F6EA /* RSISSN13Generator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSISSN13Generator.h; path = RSBarcodes/RSISSN13Generator.h; sourceTree = ""; }; + 0D09026E66AAFA7EF4A55FF0EE0B55C9 /* SDImageCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDImageCache.m; path = SDWebImage/SDImageCache.m; sourceTree = ""; }; + 0EFF364058CC34E834A1C31988F5825B /* AFNetworkReachabilityManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFNetworkReachabilityManager.h; path = AFNetworking/AFNetworkReachabilityManager.h; sourceTree = ""; }; + 0F8DA6D7A22B07B8D3291B259A5DD81A /* RSCodeGenerator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSCodeGenerator.h; path = RSBarcodes/RSCodeGenerator.h; sourceTree = ""; }; + 105EB18DDECD31D945F8DF8D590C4E73 /* UIButton+WebCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIButton+WebCache.h"; path = "SDWebImage/UIButton+WebCache.h"; sourceTree = ""; }; + 10834806BD7B412BC24F347361FA2C8E /* Pods-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-acknowledgements.plist"; sourceTree = ""; }; + 10FAD1C42DCA0F20876A829D3EE2CD5A /* AFURLRequestSerialization.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFURLRequestSerialization.m; path = AFNetworking/AFURLRequestSerialization.m; sourceTree = ""; }; + 116A3146C31454F60A224C6F6D54D43A /* YALTabBarItem.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YALTabBarItem.m; path = FoldingTabBar/Model/TabBarItem/YALTabBarItem.m; sourceTree = ""; }; + 13A29F90377F32E889467A6EB11129FC /* FoldingTabBar-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FoldingTabBar-prefix.pch"; sourceTree = ""; }; + 13E47006C1108E3CCC2C2F7A0636E257 /* NSData+ImageContentType.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSData+ImageContentType.m"; path = "SDWebImage/NSData+ImageContentType.m"; sourceTree = ""; }; + 141852093744B16906752A3E1267A283 /* Unirest-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Unirest-prefix.pch"; sourceTree = ""; }; + 147F4A1B3181323D3B312C7C595799DF /* UIImage+GIF.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+GIF.h"; path = "SDWebImage/UIImage+GIF.h"; sourceTree = ""; }; + 15EA89E354E1B117B7D01F1B06ECBFD3 /* AFNetworking-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "AFNetworking-dummy.m"; sourceTree = ""; }; + 175A13F9014370BB99A72287694B964C /* SDWebImageDownloaderOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageDownloaderOperation.h; path = SDWebImage/SDWebImageDownloaderOperation.h; sourceTree = ""; }; + 18B6EE618778A621563CF3EB09FB7426 /* RSCode39Generator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RSCode39Generator.m; path = RSBarcodes/RSCode39Generator.m; sourceTree = ""; }; + 192EC3248E86EBE521A5049404973024 /* FirebaseApp.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = FirebaseApp.h; sourceTree = ""; }; + 1A064A6FBF820CF0E9E970012EA49943 /* RSITFGenerator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSITFGenerator.h; path = RSBarcodes/RSITFGenerator.h; sourceTree = ""; }; + 1A25C4C4E66C69638F1DB24147DAC9FD /* UNIHTTPRequestWithBody.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = UNIHTTPRequestWithBody.h; path = Unirest/UNIHTTPRequestWithBody.h; sourceTree = ""; }; + 1BCC847252D74278DD90C79310F62927 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 1BD0BA6AD2DEF0AA3A81F7205F1B3F8F /* YALSpringAnimation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YALSpringAnimation.h; path = FoldingTabBar/Animation/YALSpringAnimation/YALSpringAnimation.h; sourceTree = ""; }; + 1E3EEAF15234BEA71BFB0C24FB77D631 /* YALAnimatingTabBarConstants.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YALAnimatingTabBarConstants.h; path = FoldingTabBar/Constants/YALAnimatingTabBarConstants.h; sourceTree = ""; }; + 1ECA43448BA3C510FC67D5BC421AC8BD /* UNIHTTPBinaryResponse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = UNIHTTPBinaryResponse.h; path = Unirest/HttpResponse/UNIHTTPBinaryResponse.h; sourceTree = ""; }; + 1F3AD86CCBBB5959F94A66EA00829F9F /* AFURLSessionManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFURLSessionManager.h; path = AFNetworking/AFURLSessionManager.h; sourceTree = ""; }; + 1F45E62A78431D3EAB50F7A9A1887A65 /* YALFoldingTabBar.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YALFoldingTabBar.h; path = FoldingTabBar/View/FoldingTabBar/YALFoldingTabBar.h; sourceTree = ""; }; + 2050D0C1B75539ED060A0255620B4AE7 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/AVFoundation.framework; sourceTree = DEVELOPER_DIR; }; + 20CCFEDD30275219129E7FBD60F07D4F /* RSEAN8Generator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RSEAN8Generator.m; path = RSBarcodes/RSEAN8Generator.m; sourceTree = ""; }; + 20F8DC1818E3E8A3AFBB623D06B3BA0D /* SDWebImageCompat.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageCompat.m; path = SDWebImage/SDWebImageCompat.m; sourceTree = ""; }; + 20FF519E57D42753EBB1BBCC08680E5C /* UNIHTTPStringResponse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = UNIHTTPStringResponse.h; path = Unirest/HttpResponse/UNIHTTPStringResponse.h; sourceTree = ""; }; + 21006BD6CD96355B6514524F865FDAB7 /* UIImageView+HighlightedWebCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImageView+HighlightedWebCache.h"; path = "SDWebImage/UIImageView+HighlightedWebCache.h"; sourceTree = ""; }; + 251F8EE915F35949E70FC9A2011796EA /* RSCodeGen.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSCodeGen.h; path = RSBarcodes/RSCodeGen.h; sourceTree = ""; }; + 264120AEF1933D492DE3C2CB43FDA1EB /* AFSecurityPolicy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFSecurityPolicy.m; path = AFNetworking/AFSecurityPolicy.m; sourceTree = ""; }; + 2683523293DBB34AB2D13922DE6D2D03 /* SDWebImagePrefetcher.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImagePrefetcher.h; path = SDWebImage/SDWebImagePrefetcher.h; sourceTree = ""; }; + 269754542D2F230923B354C329C6211B /* RSExtendedCode39Generator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSExtendedCode39Generator.h; path = RSBarcodes/RSExtendedCode39Generator.h; sourceTree = ""; }; + 26A363E7B60C2EB63EE8A0BFD1C6E5DE /* SDWebImageOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageOperation.h; path = SDWebImage/SDWebImageOperation.h; sourceTree = ""; }; + 271AA58899855FD4CF74E630DEF80208 /* RSEAN13Generator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RSEAN13Generator.m; path = RSBarcodes/RSEAN13Generator.m; sourceTree = ""; }; + 272643F56613CA0D336AE3DBF19DC404 /* Pods-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-dummy.m"; sourceTree = ""; }; + 2773439856358BFBA1A94C6D1C9EC255 /* FoldingTabBar.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = FoldingTabBar.xcconfig; sourceTree = ""; }; + 284E064343257AE2A06B1DB383621958 /* RSCode39Mod43Generator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSCode39Mod43Generator.h; path = RSBarcodes/RSCode39Mod43Generator.h; sourceTree = ""; }; + 290A7F705B8C5BDB01249D54F0F4E8C6 /* UIProgressView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIProgressView+AFNetworking.m"; path = "UIKit+AFNetworking/UIProgressView+AFNetworking.m"; sourceTree = ""; }; + 2A87AF7D56DD134FE694270A462EC478 /* UIImage+MultiFormat.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImage+MultiFormat.m"; path = "SDWebImage/UIImage+MultiFormat.m"; sourceTree = ""; }; + 2B27CC87C7D3EDBA929BDAD7BB6BD2F9 /* UIActivityIndicatorView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIActivityIndicatorView+AFNetworking.m"; path = "UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m"; sourceTree = ""; }; + 2B427D418ADD74F918CC6B583037B99B /* YALFoldingTabBarController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YALFoldingTabBarController.m; path = FoldingTabBar/Controller/FoldingTabBarController/YALFoldingTabBarController.m; sourceTree = ""; }; + 2C3772FD8187DA7E88D21BBCD016D43D /* SIAlertView.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SIAlertView.xcconfig; sourceTree = ""; }; + 2D223199765615D5B851AFFBE312F34A /* AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFNetworking.h; path = AFNetworking/AFNetworking.h; sourceTree = ""; }; + 2E7E9B6535A89643600F990CFD6A942E /* NSDate+RelativeTime.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "NSDate+RelativeTime.m"; sourceTree = ""; }; + 32FA4A3F419A164C42020735FA8EC90B /* YALSpringAnimation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YALSpringAnimation.m; path = FoldingTabBar/Animation/YALSpringAnimation/YALSpringAnimation.m; sourceTree = ""; }; + 33D062A8B1E0866C1936D631C803173F /* NSDate+RelativeTime-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "NSDate+RelativeTime-dummy.m"; sourceTree = ""; }; + 33E8DD3D0CBFD1BC563919E4657B370B /* libUnirest.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libUnirest.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 33FF18ABC05ECFBB7A223BFD358FB2BC /* AFURLSessionManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFURLSessionManager.m; path = AFNetworking/AFURLSessionManager.m; sourceTree = ""; }; + 341656227DE44EE01D8B35942CA8F205 /* FirebaseServerValue.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = FirebaseServerValue.h; sourceTree = ""; }; + 34584379769D592ED950BE5BE715A224 /* FConfig.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = FConfig.h; sourceTree = ""; }; + 34B6017F1989CB7FC5582BB073D4F805 /* RSITF14Generator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RSITF14Generator.m; path = RSBarcodes/RSITF14Generator.m; sourceTree = ""; }; + 353720A9F9419765E927ED820CE36805 /* SDWebImageManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageManager.m; path = SDWebImage/SDWebImageManager.m; sourceTree = ""; }; + 3782D172A4204AFC95257FE3C6E1A606 /* FQuery.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = FQuery.h; sourceTree = ""; }; + 37C135FFCC6B32468DB23784635142D1 /* libHSDatePickerViewController.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libHSDatePickerViewController.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 37DB56D75062CC75FCB0966E1C6E8A8E /* Pods-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-acknowledgements.markdown"; sourceTree = ""; }; + 3997C23D58D3AB88755F581402CCC112 /* UNIHTTPResponse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = UNIHTTPResponse.h; path = Unirest/HttpResponse/UNIHTTPResponse.h; sourceTree = ""; }; + 3A88FCC1E5569FC622607028EF66EE48 /* FoldingTabBar-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "FoldingTabBar-dummy.m"; sourceTree = ""; }; + 3BA7704CB9C8519486AA859FF85B5511 /* HSDatePickerViewController.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = HSDatePickerViewController.xcconfig; sourceTree = ""; }; + 3C0BCBC41BD29F201E1BDB31BA7EAC1E /* UNIBaseRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = UNIBaseRequest.h; path = Unirest/HttpRequest/UNIBaseRequest.h; sourceTree = ""; }; + 3E1C005255D42E6930F79B2FA2FA9CC4 /* UNIRest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = UNIRest.m; path = Unirest/UNIRest.m; sourceTree = ""; }; + 3E2D95497BEFB8A764C3837B63842BC7 /* UIImage+GIF.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImage+GIF.m"; path = "SDWebImage/UIImage+GIF.m"; sourceTree = ""; }; + 3EBA4E7C408540624004687482925CE1 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + 3EC8F905FAA397DA3CE2DFFC7A57CCA1 /* FAuthType.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = FAuthType.h; sourceTree = ""; }; + 4308892AD0D1F7328FC8E446DCA72387 /* RSCodeView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RSCodeView.m; path = RSBarcodes/RSCodeView.m; sourceTree = ""; }; + 4347DB64B832F5B70F97042C311D43B2 /* UNISimpleRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = UNISimpleRequest.m; path = Unirest/HttpRequest/UNISimpleRequest.m; sourceTree = ""; }; + 490C1CDA195F15178CF561BE3158782C /* SDWebImage.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SDWebImage.xcconfig; sourceTree = ""; }; + 49138BE9C7E6EC2FF6C05CE35202AA27 /* YALTabBarItem.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YALTabBarItem.h; path = FoldingTabBar/Model/TabBarItem/YALTabBarItem.h; sourceTree = ""; }; + 4A21DA7CC174E0A310C46E2403C6EBFC /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; }; + 4A5E771520E0AB4BE5BE1B0824CD248F /* UNIHTTPJsonResponse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = UNIHTTPJsonResponse.h; path = Unirest/HttpResponse/UNIHTTPJsonResponse.h; sourceTree = ""; }; + 4E762F23EC34ED4A6FF3312D84E33A40 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.debug.xcconfig; sourceTree = ""; }; + 4FE66780CAA3E1B71613F84521A9B90D /* RSISSN13Generator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RSISSN13Generator.m; path = RSBarcodes/RSISSN13Generator.m; sourceTree = ""; }; + 5096454D954F0B14600B105A06389966 /* UIImageView+WebCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImageView+WebCache.h"; path = "SDWebImage/UIImageView+WebCache.h"; sourceTree = ""; }; + 515B96A0A7556AD7FEC6D2A8A9000800 /* AFURLResponseSerialization.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFURLResponseSerialization.h; path = AFNetworking/AFURLResponseSerialization.h; sourceTree = ""; }; + 51622DD1829E756C692BF1A822D765D2 /* libAFNetworking.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libAFNetworking.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 517CB82BD1DF1B0646ADB42B1C6F591D /* RSCode128Generator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RSCode128Generator.m; path = RSBarcodes/RSCode128Generator.m; sourceTree = ""; }; + 53877185B4DAB43F4EA27CE096CE8A27 /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/ImageIO.framework; sourceTree = DEVELOPER_DIR; }; + 53C938307DD8D3CED378E270FAFD4C05 /* UNIJsonNode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = UNIJsonNode.h; path = Unirest/HttpResponse/UNIJsonNode.h; sourceTree = ""; }; + 54704FEB81C296CCD6CF0C173935A558 /* Firebase.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Firebase.xcconfig; sourceTree = ""; }; + 555D590EB2CB85EB7E74BF500925D21C /* RSEAN8Generator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSEAN8Generator.h; path = RSBarcodes/RSEAN8Generator.h; sourceTree = ""; }; + 590FE50501C0366CD935278467E54BAB /* libFirebase.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFirebase.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 5C702EF29F18337061E4E25406760C13 /* UNIUrlConnection.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = UNIUrlConnection.h; path = Unirest/UNIUrlConnection.h; sourceTree = ""; }; + 5EB9CF551F8BE58477E8AEAD71720322 /* Unirest-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Unirest-dummy.m"; sourceTree = ""; }; + 5F0B73482E68333950B6BAFE7DEE0F59 /* NSDate+RelativeTime.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "NSDate+RelativeTime.xcconfig"; sourceTree = ""; }; + 609AC14EED4D48BF18F10AC8BF05A8EA /* libFirebaseStatic.a */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = archive.ar; path = libFirebaseStatic.a; sourceTree = ""; }; + 6290D3809B774BA20314DA284EAC050D /* UIButton+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIButton+AFNetworking.m"; path = "UIKit+AFNetworking/UIButton+AFNetworking.m"; sourceTree = ""; }; + 67BF7EDAE1E08F687624C87EE20C05C1 /* SDImageCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDImageCache.h; path = SDWebImage/SDImageCache.h; sourceTree = ""; }; + 6911BECA35E7518D864239B7E898EEF3 /* Pods-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-frameworks.sh"; sourceTree = ""; }; + 6AEBC205C40EB448E58CA2D55D53C07B /* HSDatePickerViewController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = HSDatePickerViewController.m; path = HSDatePickerViewControllerDemo/HSDatePickerViewController/HSDatePickerViewController.m; sourceTree = ""; }; + 6B3D9465151745C319BEDDB1068F541E /* UNIHTTPClientHelper.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = UNIHTTPClientHelper.m; path = Unirest/UNIHTTPClientHelper.m; sourceTree = ""; }; + 6B62E4165E44A39AFB7FDC89097F992D /* UIProgressView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIProgressView+AFNetworking.h"; path = "UIKit+AFNetworking/UIProgressView+AFNetworking.h"; sourceTree = ""; }; + 6D1DC5B65019D76224E732989A66A808 /* YALFoldingTabBar.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YALFoldingTabBar.m; path = FoldingTabBar/View/FoldingTabBar/YALFoldingTabBar.m; sourceTree = ""; }; + 6D548BDD924117B71137E5A4392B4B96 /* RSCode93Generator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RSCode93Generator.m; path = RSBarcodes/RSCode93Generator.m; sourceTree = ""; }; + 6D590461924D689D4654FCD00E564F62 /* UIButton+WebCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIButton+WebCache.m"; path = "SDWebImage/UIButton+WebCache.m"; sourceTree = ""; }; + 72120211B201B79DC9136FC5131A74E2 /* Empty.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = Empty.m; sourceTree = ""; }; + 760067039D9649A77629369AF144B665 /* HSDatePickerViewController-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "HSDatePickerViewController-prefix.pch"; sourceTree = ""; }; + 78A66B919E4EE937716B7E0BCF924D7D /* FEventType.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = FEventType.h; sourceTree = ""; }; + 78D45F874FA117AF922CAA2BE89F3CBE /* UIActivityIndicatorView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIActivityIndicatorView+AFNetworking.h"; path = "UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h"; sourceTree = ""; }; + 79E3FA8B2698537FD912E3914FAFA102 /* YALFoldingTabBarController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YALFoldingTabBarController.h; path = FoldingTabBar/Controller/FoldingTabBarController/YALFoldingTabBarController.h; sourceTree = ""; }; + 7A73A69B29B977EDB682329D6C78AFB5 /* UIImageView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImageView+AFNetworking.m"; path = "UIKit+AFNetworking/UIImageView+AFNetworking.m"; sourceTree = ""; }; + 7A8CD356250246A37F6C7AB628436D3A /* AFHTTPSessionManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFHTTPSessionManager.h; path = AFNetworking/AFHTTPSessionManager.h; sourceTree = ""; }; + 7BCAF5BAB1ACA33540167929113B0FB1 /* CATransaction+TransactionWithAnimationsAndCompletion.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "CATransaction+TransactionWithAnimationsAndCompletion.m"; path = "FoldingTabBar/Category/CATransaction/CATransaction+TransactionWithAnimationsAndCompletion/CATransaction+TransactionWithAnimationsAndCompletion.m"; sourceTree = ""; }; + 7C6A206080C5403BBA7DABCCE047A51A /* UNIHTTPStringResponse.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = UNIHTTPStringResponse.m; path = Unirest/HttpResponse/UNIHTTPStringResponse.m; sourceTree = ""; }; + 7CE34CDC5A7F37E8F7807EE096CBFA4A /* UNIHTTPJsonResponse.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = UNIHTTPJsonResponse.m; path = Unirest/HttpResponse/UNIHTTPJsonResponse.m; sourceTree = ""; }; + 7D5F717EFB9A12BAA3D01CEBC32B98D4 /* AFHTTPSessionManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFHTTPSessionManager.m; path = AFNetworking/AFHTTPSessionManager.m; sourceTree = ""; }; + 7E0ED74D4CFD6C830083D7D5B4FB8D58 /* SDWebImageDecoder.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageDecoder.m; path = SDWebImage/SDWebImageDecoder.m; sourceTree = ""; }; + 7E24074AC4A683DA3D04581462B842CD /* NSDate+RelativeTime.bundle */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "wrapper.plug-in"; path = "NSDate+RelativeTime.bundle"; sourceTree = ""; }; + 820EF46A002155631B09AF5C382AFE12 /* UIImageView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImageView+AFNetworking.h"; path = "UIKit+AFNetworking/UIImageView+AFNetworking.h"; sourceTree = ""; }; + 84C17D603BDCDB9250A4E11B69121B5F /* FDataSnapshot.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = FDataSnapshot.h; sourceTree = ""; }; + 8596D8DDEB82BED0AA242B009C963E49 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; }; + 87B9C55DC070D14E4C57B837CD1262AE /* Unirest.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Unirest.xcconfig; sourceTree = ""; }; + 882117FF9CC46BE0C573A483C559B51B /* UIView+WebCacheOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+WebCacheOperation.h"; path = "SDWebImage/UIView+WebCacheOperation.h"; sourceTree = ""; }; + 89D7A507EFEEC6E842426A507C5A9806 /* RSScannerViewController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSScannerViewController.h; path = RSBarcodes/RSScannerViewController.h; sourceTree = ""; }; + 8BF8DD77997B6DC12067D8DF6C4FD4E0 /* HSDatePickerViewController.xib */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = file.xib; name = HSDatePickerViewController.xib; path = HSDatePickerViewControllerDemo/HSDatePickerViewController/HSDatePickerViewController.xib; sourceTree = ""; }; + 8CB6EA6F905DD15AFBB41E1B6319B9BC /* Firebase.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = Firebase.h; sourceTree = ""; }; + 8FBD09F2E9A90C80DF50A40C3B26A683 /* SDWebImageDownloader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageDownloader.h; path = SDWebImage/SDWebImageDownloader.h; sourceTree = ""; }; + 8FF7E9BB928F857D5247ECE330161B08 /* RSUnifiedCodeGenerator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RSUnifiedCodeGenerator.m; path = RSBarcodes/RSUnifiedCodeGenerator.m; sourceTree = ""; }; + 91A1AA65B3AB397EA1CB5FFAF930E490 /* UNIHTTPRequestWithBody.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = UNIHTTPRequestWithBody.m; path = Unirest/UNIHTTPRequestWithBody.m; sourceTree = ""; }; + 93A004983F765896561A4F740AD58450 /* RSCode39Generator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSCode39Generator.h; path = RSBarcodes/RSCode39Generator.h; sourceTree = ""; }; + 9516417C2FACD6488C658DBA2269E3D7 /* FMutableData.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = FMutableData.h; sourceTree = ""; }; + 976477CF56EACD5F7844A30BD1F0C85F /* UNIHTTPResponse.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = UNIHTTPResponse.m; path = Unirest/HttpResponse/UNIHTTPResponse.m; sourceTree = ""; }; + 97B32F1E7FEBBE2258B99CCBE6D91B5A /* UNIBodyRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = UNIBodyRequest.h; path = Unirest/HttpRequest/UNIBodyRequest.h; sourceTree = ""; }; + 985E6290EBECD97B0E13AD64D8F3D76D /* UIImageView+HighlightedWebCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImageView+HighlightedWebCache.m"; path = "SDWebImage/UIImageView+HighlightedWebCache.m"; sourceTree = ""; }; + 98C98CDFB3F20F2925F6CD1F141BB14F /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.release.xcconfig; sourceTree = ""; }; + 98F04AB4F1588387E6CB7A0B3EBD0DB9 /* RSISBN13Generator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSISBN13Generator.h; path = RSBarcodes/RSISBN13Generator.h; sourceTree = ""; }; + 9B267014304EA99F4C75694F43C38EB8 /* RSBarcodes-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RSBarcodes-prefix.pch"; sourceTree = ""; }; + 9BC6D1B3B52B7D9F709889D0E48CC628 /* UNIJsonNode.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = UNIJsonNode.m; path = Unirest/HttpResponse/UNIJsonNode.m; sourceTree = ""; }; + 9C036FDFB9C1A421C33ED3580EAB59AE /* SDWebImageManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageManager.h; path = SDWebImage/SDWebImageManager.h; sourceTree = ""; }; + 9C27954D5024C2307071D22A24854938 /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/CoreImage.framework; sourceTree = DEVELOPER_DIR; }; + 9FC96CB33EFAFC96428A65448CC8164E /* AFNetworking.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = AFNetworking.xcconfig; sourceTree = ""; }; + 9FF610949E922A7540FC67FC90A70E6A /* RSBarcodes-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "RSBarcodes-dummy.m"; sourceTree = ""; }; + A1A36D34413696BE466E2CA0AFF194DA /* Pods-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-resources.sh"; sourceTree = ""; }; + A2D0A08CE80C08F40B0E4044757E24FB /* RSExtendedCode39Generator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RSExtendedCode39Generator.m; path = RSBarcodes/RSExtendedCode39Generator.m; sourceTree = ""; }; + A3E8834FB4B531356397417C965A7B95 /* UNIHTTPRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = UNIHTTPRequest.m; path = Unirest/UNIHTTPRequest.m; sourceTree = ""; }; + A64F5BD2E96EF942744706EF319BD3A7 /* SDWebImagePrefetcher.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImagePrefetcher.m; path = SDWebImage/SDWebImagePrefetcher.m; sourceTree = ""; }; + A7FA928277224EF0FFC145BAC1D30F74 /* UIView+WebCacheOperation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+WebCacheOperation.m"; path = "SDWebImage/UIView+WebCacheOperation.m"; sourceTree = ""; }; + AB6B4E8E3BEA16FCAA30C60C5BB95D5A /* UNISimpleRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = UNISimpleRequest.h; path = Unirest/HttpRequest/UNISimpleRequest.h; sourceTree = ""; }; + AC67FD8B88DA781BE1BD48DE6E599C71 /* UNIHTTPRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = UNIHTTPRequest.h; path = Unirest/UNIHTTPRequest.h; sourceTree = ""; }; + AD6940EA22C3DC951575E9878F82F68C /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = DEVELOPER_DIR; }; + AEE0BD6A5798D83DF0A2DCCC07FF2AB8 /* RSScannerViewController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RSScannerViewController.m; path = RSBarcodes/RSScannerViewController.m; sourceTree = ""; }; + B040F5342BC532FB65B515BC369B6F70 /* RSEANGenerator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RSEANGenerator.m; path = RSBarcodes/RSEANGenerator.m; sourceTree = ""; }; + B12199D433256F98EFB89BFA17DE5825 /* RSUPCEGenerator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSUPCEGenerator.h; path = RSBarcodes/RSUPCEGenerator.h; sourceTree = ""; }; + B2C4E468528F21BE2931AC7445D97066 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/CFNetwork.framework; sourceTree = DEVELOPER_DIR; }; + B2C9C2456628641414A48CFE24F27A9B /* AFAutoPurgingImageCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFAutoPurgingImageCache.h; path = "UIKit+AFNetworking/AFAutoPurgingImageCache.h"; sourceTree = ""; }; + B60A4B1045E81E81624EE0B3A6E7C5EF /* AFNetworkActivityIndicatorManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFNetworkActivityIndicatorManager.h; path = "UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h"; sourceTree = ""; }; + B66EB15C19225526D9A99A6E5540A763 /* NSDate+RelativeTime.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "NSDate+RelativeTime.h"; sourceTree = ""; }; + B717EE1084172410CE931F7FE8AEE352 /* RSEAN13Generator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSEAN13Generator.h; path = RSBarcodes/RSEAN13Generator.h; sourceTree = ""; }; + B85FF85ACD829202BB751C53905D1325 /* AFImageDownloader.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFImageDownloader.m; path = "UIKit+AFNetworking/AFImageDownloader.m"; sourceTree = ""; }; + B8D3CE1AEF798655FC20331AB6002212 /* AFURLRequestSerialization.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFURLRequestSerialization.h; path = AFNetworking/AFURLRequestSerialization.h; sourceTree = ""; }; + B973E05EF4C06F7D2102FD6EE7A96755 /* Firebase-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Firebase-prefix.pch"; sourceTree = ""; }; + BA2DF80F7B80DC52F46237758B8709BE /* UIRefreshControl+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIRefreshControl+AFNetworking.h"; path = "UIKit+AFNetworking/UIRefreshControl+AFNetworking.h"; sourceTree = ""; }; + BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + BBA22650F447C08B82B4CE5A67520947 /* RSUnifiedCodeGenerator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSUnifiedCodeGenerator.h; path = RSBarcodes/RSUnifiedCodeGenerator.h; sourceTree = ""; }; + BBCA0CCDCBB115486E3FAC9061EE9F36 /* RSCode93Generator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSCode93Generator.h; path = RSBarcodes/RSCode93Generator.h; sourceTree = ""; }; + BD5D5053B9A456DABCA70A661CB0FC89 /* UIWebView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIWebView+AFNetworking.h"; path = "UIKit+AFNetworking/UIWebView+AFNetworking.h"; sourceTree = ""; }; + BDBAFCF8B681ED3A551B91568643551A /* FTransactionResult.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = FTransactionResult.h; sourceTree = ""; }; + BE1704DB78F591CCE5894E0B6026D972 /* RSBarcodes.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSBarcodes.h; path = RSBarcodes/RSBarcodes.h; sourceTree = ""; }; + BF247C42914A52BC160DCCB331BB46D3 /* CATransaction+TransactionWithAnimationsAndCompletion.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "CATransaction+TransactionWithAnimationsAndCompletion.h"; path = "FoldingTabBar/Category/CATransaction/CATransaction+TransactionWithAnimationsAndCompletion/CATransaction+TransactionWithAnimationsAndCompletion.h"; sourceTree = ""; }; + C0D56BBCEE184C0308B4FA598F05DA1C /* UNIBodyRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = UNIBodyRequest.m; path = Unirest/HttpRequest/UNIBodyRequest.m; sourceTree = ""; }; + C1CE437A434112B993B71BA2BA88DC79 /* SIAlertView.bundle */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "wrapper.plug-in"; name = SIAlertView.bundle; path = SIAlertView/SIAlertView.bundle; sourceTree = ""; }; + C20D15D79B151ABCD35AC6FCDC0C3E5A /* SIAlertView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SIAlertView.m; path = SIAlertView/SIAlertView.m; sourceTree = ""; }; + C363098EF7252057F7426C17E417883F /* RSUPCEGenerator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RSUPCEGenerator.m; path = RSBarcodes/RSUPCEGenerator.m; sourceTree = ""; }; + C3A549C931DE431DA222DAC5C831C051 /* RSISBN13Generator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RSISBN13Generator.m; path = RSBarcodes/RSISBN13Generator.m; sourceTree = ""; }; + C3BED2104CAE5F66DA333281006D1D3E /* RSITF14Generator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSITF14Generator.h; path = RSBarcodes/RSITF14Generator.h; sourceTree = ""; }; + C3C19E0E3BEE6DD238C3481DA7CC6FB2 /* RSCornersView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSCornersView.h; path = RSBarcodes/RSCornersView.h; sourceTree = ""; }; + C3FDE2B49BA225D9D6DAE1013C697FAE /* UNIBaseRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = UNIBaseRequest.m; path = Unirest/HttpRequest/UNIBaseRequest.m; sourceTree = ""; }; + C568BF7DC7405C1CA3A1FFEF70FAA641 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; + C635976F9474E33E8CE76263D7B45F0C /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/MobileCoreServices.framework; sourceTree = DEVELOPER_DIR; }; + C89436DC00C436261C4B9F3FB3CB415B /* UIImage+MultiFormat.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+MultiFormat.h"; path = "SDWebImage/UIImage+MultiFormat.h"; sourceTree = ""; }; + CDC037FC7440648854AB6F642481ED5E /* UIRefreshControl+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIRefreshControl+AFNetworking.m"; path = "UIKit+AFNetworking/UIRefreshControl+AFNetworking.m"; sourceTree = ""; }; + CEA9160AD79D33BD4C7F993D2E5B9911 /* Base64.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Base64.h; path = Unirest/Base64.h; sourceTree = ""; }; + D01CA6D092548B64AC210396E0B19B74 /* UIImage+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+AFNetworking.h"; path = "UIKit+AFNetworking/UIImage+AFNetworking.h"; sourceTree = ""; }; + D05C3CE8F1AFB523C406EFA1E3AE0E02 /* AFNetworkReachabilityManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFNetworkReachabilityManager.m; path = AFNetworking/AFNetworkReachabilityManager.m; sourceTree = ""; }; + D0E278A86A921938CCD886CA1129771D /* SIAlertView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SIAlertView.h; path = SIAlertView/SIAlertView.h; sourceTree = ""; }; + D23AB232781077BBAF26E517F4A92F19 /* RSCornersView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RSCornersView.m; path = RSBarcodes/RSCornersView.m; sourceTree = ""; }; + D24855FD252EFDC1131CBFC56A7BA78A /* AFNetworkActivityIndicatorManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFNetworkActivityIndicatorManager.m; path = "UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m"; sourceTree = ""; }; + D329B2FFEA1386954A60598CA124C1D8 /* NSDate+RelativeTime-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "NSDate+RelativeTime-prefix.pch"; sourceTree = ""; }; + D37CE45345B8EB22D82D8A02BBF84C23 /* UIImageView+WebCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImageView+WebCache.m"; path = "SDWebImage/UIImageView+WebCache.m"; sourceTree = ""; }; + D51656B33C989C68356771805D5111E2 /* SDWebImageDownloader.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageDownloader.m; path = SDWebImage/SDWebImageDownloader.m; sourceTree = ""; }; + D8CD89FD27B567D503C27A5FEE9EC60A /* SDWebImageDecoder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageDecoder.h; path = SDWebImage/SDWebImageDecoder.h; sourceTree = ""; }; + D95CE1C0964CDF43EEA68D1D4A11642C /* SDWebImageDownloaderOperation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageDownloaderOperation.m; path = SDWebImage/SDWebImageDownloaderOperation.m; sourceTree = ""; }; + D97C19939DF3C769754C3A6D9CC6A5F0 /* YALTabBarInteracting.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YALTabBarInteracting.h; path = FoldingTabBar/Protocol/TabBarInteracting/YALTabBarInteracting.h; sourceTree = ""; }; + DB5B56E6FD1B6DC58CEE9F312A7AC93F /* UIKit+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIKit+AFNetworking.h"; path = "UIKit+AFNetworking/UIKit+AFNetworking.h"; sourceTree = ""; }; + DD5F275EAD09023527A3E4DA79C49BC9 /* SIAlertView-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SIAlertView-prefix.pch"; sourceTree = ""; }; + DDFFB63C5B7AB4BCAF75FF1017028A88 /* NSData+ImageContentType.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSData+ImageContentType.h"; path = "SDWebImage/NSData+ImageContentType.h"; sourceTree = ""; }; + DF51FD97A5279436D972E9E65EC0B233 /* CAAnimation+YALTabBarViewAnimations.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "CAAnimation+YALTabBarViewAnimations.h"; path = "FoldingTabBar/Category/CAAnimation/CAAnimation+YALTabBarViewAnimations/CAAnimation+YALTabBarViewAnimations.h"; sourceTree = ""; }; + E18310A21D58804BEDB5F9ACAF430FD3 /* AFURLResponseSerialization.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFURLResponseSerialization.m; path = AFNetworking/AFURLResponseSerialization.m; sourceTree = ""; }; + E22BD309CDCA3AB530B13F9D9A49C714 /* RSITFGenerator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RSITFGenerator.m; path = RSBarcodes/RSITFGenerator.m; sourceTree = ""; }; + E27A791BDEABCB66CEDA3ED57B0BB941 /* SDWebImageCompat.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageCompat.h; path = SDWebImage/SDWebImageCompat.h; sourceTree = ""; }; + E28347D0104F727CBF3C568CDCD5A58D /* CAAnimation+YALTabBarViewAnimations.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "CAAnimation+YALTabBarViewAnimations.m"; path = "FoldingTabBar/Category/CAAnimation/CAAnimation+YALTabBarViewAnimations/CAAnimation+YALTabBarViewAnimations.m"; sourceTree = ""; }; + E2E3BE833993FD6B71EFD77240FEDEFD /* UNIRest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = UNIRest.h; path = Unirest/UNIRest.h; sourceTree = ""; }; + E39D4C26946BF8FDBA32CD7ED9F7FC1F /* SDWebImage-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "SDWebImage-dummy.m"; sourceTree = ""; }; + E3BDDCCD6FFCFD0E8115347FE92B15ED /* UNIHTTPClientHelper.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = UNIHTTPClientHelper.h; path = Unirest/UNIHTTPClientHelper.h; sourceTree = ""; }; + E7C2E4CB22000A0DC0CB9D91EF98CB6F /* SIAlertView-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "SIAlertView-dummy.m"; sourceTree = ""; }; + E9999FD6944BBF804A9A834FECECAA11 /* AFImageDownloader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFImageDownloader.h; path = "UIKit+AFNetworking/AFImageDownloader.h"; sourceTree = ""; }; + E9F33DD306C313959B59FF06C120643D /* SDWebImage-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SDWebImage-prefix.pch"; sourceTree = ""; }; + EB73CD0499BCCA9C550D387C285F7347 /* RSCode128Generator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSCode128Generator.h; path = RSBarcodes/RSCode128Generator.h; sourceTree = ""; }; + EBFC5612B601E11A62CD47A581560911 /* libNSDate+RelativeTime.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libNSDate+RelativeTime.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + ECA85143C85F24D200A165770136B0BE /* HSDatePickerViewController-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "HSDatePickerViewController-dummy.m"; sourceTree = ""; }; + ED627D0023232F7C576871009D15F6D2 /* RSBarcodes.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RSBarcodes.xcconfig; sourceTree = ""; }; + F1C4437900180A86D8794856359A1440 /* AFAutoPurgingImageCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFAutoPurgingImageCache.m; path = "UIKit+AFNetworking/AFAutoPurgingImageCache.m"; sourceTree = ""; }; + F27DEC81A766F040B3A8523B43CFE5D2 /* RSCodeGenerator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RSCodeGenerator.m; path = RSBarcodes/RSCodeGenerator.m; sourceTree = ""; }; + F59D725FBFA071473C1D1FBE0C2F7CD3 /* libSIAlertView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSIAlertView.a; sourceTree = BUILT_PRODUCTS_DIR; }; + F62317544B3D725AA922F03A02C1B632 /* AFSecurityPolicy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFSecurityPolicy.h; path = AFNetworking/AFSecurityPolicy.h; sourceTree = ""; }; + F92E1C7996C02E7B526FFD37E172C5C1 /* Firebase-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Firebase-dummy.m"; sourceTree = ""; }; + FA85CB34FEC4D83A2924122CCBED64D0 /* UIButton+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIButton+AFNetworking.h"; path = "UIKit+AFNetworking/UIButton+AFNetworking.h"; sourceTree = ""; }; + FB4276173B37D4CC17AD924537B4DF06 /* RSCode39Mod43Generator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RSCode39Mod43Generator.m; path = RSBarcodes/RSCode39Mod43Generator.m; sourceTree = ""; }; + FE5DBB2C258D9C4CA6E27F03133FF308 /* UNIUrlConnection.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = UNIUrlConnection.m; path = Unirest/UNIUrlConnection.m; sourceTree = ""; }; + FEE1C814F6CB19DED2423986A88010E8 /* HSDatePickerViewController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = HSDatePickerViewController.h; path = HSDatePickerViewControllerDemo/HSDatePickerViewController/HSDatePickerViewController.h; sourceTree = ""; }; + FF6472A6002F01D417E629D2EED89772 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; + FFF4E9EE240A82DCA2B5603903F65C1B /* RSEANGenerator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RSEANGenerator.h; path = RSBarcodes/RSEANGenerator.h; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 3B315B3CA0ED15629CEBAEBA2212A314 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 583B061655246530AF4CD201AE9E8026 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 508C962B3E08E8DA04956BF349A3CDFD /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 2053D71CF543C3A3CC47C5409D61923C /* CoreGraphics.framework in Frameworks */, + 6083F51989A0009C740D92767F4DC1FC /* Foundation.framework in Frameworks */, + 00F09DB5E05D1208F27161E2F016FE36 /* MobileCoreServices.framework in Frameworks */, + 022B549F10007177A43FAB1DD5114F7D /* Security.framework in Frameworks */, + CE8965366A3B07A6C0615055A31B8B83 /* SystemConfiguration.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 517AD8D3904844B971845D1995E200D7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 3D9C6D8D9075C09C12E53E0D5B06F15E /* CFNetwork.framework in Frameworks */, + 84754CB255B272AFEFE1ECF132DE7E93 /* Foundation.framework in Frameworks */, + 71DF67850774658371D1DFD4DF5186E7 /* Security.framework in Frameworks */, + B89A4308CD40B0011195C7D370B4D8EF /* SystemConfiguration.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5D183ADE8FB7E6A5143263F66FD9DBBA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 68849CE3E101FFDC9C2073D89C9BC023 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7E3F8AE54CB368921D48708169A83AD0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 2690A0FD8106D00EFC2DB5F800B5F419 /* AVFoundation.framework in Frameworks */, + 509B0CDE59DE54A4BD578E58DFB09E5F /* CoreImage.framework in Frameworks */, + 24AB951C9372D081ADD9D4EFA32CB2B1 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8A591A6B686858C673453A34A582F72C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 0FAECEAB5A8F74E9F3EB99F09C01C916 /* Foundation.framework in Frameworks */, + 33E1C69B9E6358BD89C10593E483AF05 /* ImageIO.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9194CAC35E1F68ECCE818B03A9B8F29B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 539E16706942EEFF57B9C22B40A29B56 /* Foundation.framework in Frameworks */, + A3A65E51C9AA4520F3E237F79320529B /* QuartzCore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B2A00FB26E7DEEF4DFC5D2C20EE0C716 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4EB32C5270AEE37A31B3B8CF0BF5CF3D /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D646D2234B48B3EA5209C3F5B5365977 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 537A40F2C8C55B233C338EA879919B0B /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E3E27D1553990F260E018F2FD31F237C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 3BC5621A2DA38E302E4D3A891CAD35CE /* Foundation.framework in Frameworks */, + 647E650A08B67B558A6C1A0041544B1D /* QuartzCore.framework in Frameworks */, + B2DB66509B953232772CC24828B2A2D6 /* UIKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 024A3B508BC20259F16C137B69F4D586 /* NSURLSession */ = { + isa = PBXGroup; + children = ( + 7A8CD356250246A37F6C7AB628436D3A /* AFHTTPSessionManager.h */, + 7D5F717EFB9A12BAA3D01CEBC32B98D4 /* AFHTTPSessionManager.m */, + 1F3AD86CCBBB5959F94A66EA00829F9F /* AFURLSessionManager.h */, + 33FF18ABC05ECFBB7A223BFD358FB2BC /* AFURLSessionManager.m */, + ); + name = NSURLSession; + sourceTree = ""; + }; + 0301A385BF0B506301F02A5DF25B3CCC /* Support Files */ = { + isa = PBXGroup; + children = ( + 2C3772FD8187DA7E88D21BBCD016D43D /* SIAlertView.xcconfig */, + E7C2E4CB22000A0DC0CB9D91EF98CB6F /* SIAlertView-dummy.m */, + DD5F275EAD09023527A3E4DA79C49BC9 /* SIAlertView-prefix.pch */, + ); + name = "Support Files"; + path = "../Target Support Files/SIAlertView"; + sourceTree = ""; + }; + 037C0CA694176A3C0915F62C9D20B3E6 /* Targets Support Files */ = { + isa = PBXGroup; + children = ( + B3D1D13E0C6553800746CB8FD61CF946 /* Pods */, + ); + name = "Targets Support Files"; + sourceTree = ""; + }; + 2B3798722FBDC4D105C5DD1FF6260D01 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 609AC14EED4D48BF18F10AC8BF05A8EA /* libFirebaseStatic.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + 3395B597BA5ACBF276BF098B9FD4C2E0 /* HSDatePickerViewController */ = { + isa = PBXGroup; + children = ( + FEE1C814F6CB19DED2423986A88010E8 /* HSDatePickerViewController.h */, + 6AEBC205C40EB448E58CA2D55D53C07B /* HSDatePickerViewController.m */, + C92997D6A644102F285492864D6297B6 /* Resources */, + EEAE8E681E9F109940A8133DE0FB1AA0 /* Support Files */, + ); + path = HSDatePickerViewController; + sourceTree = ""; + }; + 4DFEA347F1408E0B929A167649E4F326 /* RSBarcodes */ = { + isa = PBXGroup; + children = ( + BE1704DB78F591CCE5894E0B6026D972 /* RSBarcodes.h */, + EB73CD0499BCCA9C550D387C285F7347 /* RSCode128Generator.h */, + 517CB82BD1DF1B0646ADB42B1C6F591D /* RSCode128Generator.m */, + 93A004983F765896561A4F740AD58450 /* RSCode39Generator.h */, + 18B6EE618778A621563CF3EB09FB7426 /* RSCode39Generator.m */, + 284E064343257AE2A06B1DB383621958 /* RSCode39Mod43Generator.h */, + FB4276173B37D4CC17AD924537B4DF06 /* RSCode39Mod43Generator.m */, + BBCA0CCDCBB115486E3FAC9061EE9F36 /* RSCode93Generator.h */, + 6D548BDD924117B71137E5A4392B4B96 /* RSCode93Generator.m */, + 251F8EE915F35949E70FC9A2011796EA /* RSCodeGen.h */, + 0F8DA6D7A22B07B8D3291B259A5DD81A /* RSCodeGenerator.h */, + F27DEC81A766F040B3A8523B43CFE5D2 /* RSCodeGenerator.m */, + 07301CC24FF26A4CDFBBE43C5C913A42 /* RSCodeView.h */, + 4308892AD0D1F7328FC8E446DCA72387 /* RSCodeView.m */, + C3C19E0E3BEE6DD238C3481DA7CC6FB2 /* RSCornersView.h */, + D23AB232781077BBAF26E517F4A92F19 /* RSCornersView.m */, + B717EE1084172410CE931F7FE8AEE352 /* RSEAN13Generator.h */, + 271AA58899855FD4CF74E630DEF80208 /* RSEAN13Generator.m */, + 555D590EB2CB85EB7E74BF500925D21C /* RSEAN8Generator.h */, + 20CCFEDD30275219129E7FBD60F07D4F /* RSEAN8Generator.m */, + FFF4E9EE240A82DCA2B5603903F65C1B /* RSEANGenerator.h */, + B040F5342BC532FB65B515BC369B6F70 /* RSEANGenerator.m */, + 269754542D2F230923B354C329C6211B /* RSExtendedCode39Generator.h */, + A2D0A08CE80C08F40B0E4044757E24FB /* RSExtendedCode39Generator.m */, + 98F04AB4F1588387E6CB7A0B3EBD0DB9 /* RSISBN13Generator.h */, + C3A549C931DE431DA222DAC5C831C051 /* RSISBN13Generator.m */, + 0CBC134457BA9A8B0F13A2A89D43F6EA /* RSISSN13Generator.h */, + 4FE66780CAA3E1B71613F84521A9B90D /* RSISSN13Generator.m */, + C3BED2104CAE5F66DA333281006D1D3E /* RSITF14Generator.h */, + 34B6017F1989CB7FC5582BB073D4F805 /* RSITF14Generator.m */, + 1A064A6FBF820CF0E9E970012EA49943 /* RSITFGenerator.h */, + E22BD309CDCA3AB530B13F9D9A49C714 /* RSITFGenerator.m */, + 89D7A507EFEEC6E842426A507C5A9806 /* RSScannerViewController.h */, + AEE0BD6A5798D83DF0A2DCCC07FF2AB8 /* RSScannerViewController.m */, + BBA22650F447C08B82B4CE5A67520947 /* RSUnifiedCodeGenerator.h */, + 8FF7E9BB928F857D5247ECE330161B08 /* RSUnifiedCodeGenerator.m */, + B12199D433256F98EFB89BFA17DE5825 /* RSUPCEGenerator.h */, + C363098EF7252057F7426C17E417883F /* RSUPCEGenerator.m */, + 908FD93B8A8240ABCA08AD863C490D9B /* Support Files */, + ); + path = RSBarcodes; + sourceTree = ""; + }; + 604E8DE430285A2047CBAB9F5F7C3739 /* Security */ = { + isa = PBXGroup; + children = ( + F62317544B3D725AA922F03A02C1B632 /* AFSecurityPolicy.h */, + 264120AEF1933D492DE3C2CB43FDA1EB /* AFSecurityPolicy.m */, + ); + name = Security; + sourceTree = ""; + }; + 691A148A6200BD3B355E6A46B22C3D51 /* Serialization */ = { + isa = PBXGroup; + children = ( + B8D3CE1AEF798655FC20331AB6002212 /* AFURLRequestSerialization.h */, + 10FAD1C42DCA0F20876A829D3EE2CD5A /* AFURLRequestSerialization.m */, + 515B96A0A7556AD7FEC6D2A8A9000800 /* AFURLResponseSerialization.h */, + E18310A21D58804BEDB5F9ACAF430FD3 /* AFURLResponseSerialization.m */, + ); + name = Serialization; + sourceTree = ""; + }; + 6C392A4F1BC382FE6DD712E70B605664 /* Unirest */ = { + isa = PBXGroup; + children = ( + CEA9160AD79D33BD4C7F993D2E5B9911 /* Base64.h */, + 08D4E341F74BB0BF078F68EFF4107697 /* Base64.m */, + 3C0BCBC41BD29F201E1BDB31BA7EAC1E /* UNIBaseRequest.h */, + C3FDE2B49BA225D9D6DAE1013C697FAE /* UNIBaseRequest.m */, + 97B32F1E7FEBBE2258B99CCBE6D91B5A /* UNIBodyRequest.h */, + C0D56BBCEE184C0308B4FA598F05DA1C /* UNIBodyRequest.m */, + 1ECA43448BA3C510FC67D5BC421AC8BD /* UNIHTTPBinaryResponse.h */, + 0831A7D277CC97F9CF52DCC6FD2DCE3B /* UNIHTTPBinaryResponse.m */, + E3BDDCCD6FFCFD0E8115347FE92B15ED /* UNIHTTPClientHelper.h */, + 6B3D9465151745C319BEDDB1068F541E /* UNIHTTPClientHelper.m */, + 4A5E771520E0AB4BE5BE1B0824CD248F /* UNIHTTPJsonResponse.h */, + 7CE34CDC5A7F37E8F7807EE096CBFA4A /* UNIHTTPJsonResponse.m */, + AC67FD8B88DA781BE1BD48DE6E599C71 /* UNIHTTPRequest.h */, + A3E8834FB4B531356397417C965A7B95 /* UNIHTTPRequest.m */, + 1A25C4C4E66C69638F1DB24147DAC9FD /* UNIHTTPRequestWithBody.h */, + 91A1AA65B3AB397EA1CB5FFAF930E490 /* UNIHTTPRequestWithBody.m */, + 3997C23D58D3AB88755F581402CCC112 /* UNIHTTPResponse.h */, + 976477CF56EACD5F7844A30BD1F0C85F /* UNIHTTPResponse.m */, + 20FF519E57D42753EBB1BBCC08680E5C /* UNIHTTPStringResponse.h */, + 7C6A206080C5403BBA7DABCCE047A51A /* UNIHTTPStringResponse.m */, + 53C938307DD8D3CED378E270FAFD4C05 /* UNIJsonNode.h */, + 9BC6D1B3B52B7D9F709889D0E48CC628 /* UNIJsonNode.m */, + E2E3BE833993FD6B71EFD77240FEDEFD /* UNIRest.h */, + 3E1C005255D42E6930F79B2FA2FA9CC4 /* UNIRest.m */, + AB6B4E8E3BEA16FCAA30C60C5BB95D5A /* UNISimpleRequest.h */, + 4347DB64B832F5B70F97042C311D43B2 /* UNISimpleRequest.m */, + 5C702EF29F18337061E4E25406760C13 /* UNIUrlConnection.h */, + FE5DBB2C258D9C4CA6E27F03133FF308 /* UNIUrlConnection.m */, + 83DDB476EF190C8D18659B894F09CF52 /* Support Files */, + ); + path = Unirest; + sourceTree = ""; + }; + 6F566AE87D186926998B36A2626C4353 /* UIKit */ = { + isa = PBXGroup; + children = ( + B2C9C2456628641414A48CFE24F27A9B /* AFAutoPurgingImageCache.h */, + F1C4437900180A86D8794856359A1440 /* AFAutoPurgingImageCache.m */, + E9999FD6944BBF804A9A834FECECAA11 /* AFImageDownloader.h */, + B85FF85ACD829202BB751C53905D1325 /* AFImageDownloader.m */, + B60A4B1045E81E81624EE0B3A6E7C5EF /* AFNetworkActivityIndicatorManager.h */, + D24855FD252EFDC1131CBFC56A7BA78A /* AFNetworkActivityIndicatorManager.m */, + 78D45F874FA117AF922CAA2BE89F3CBE /* UIActivityIndicatorView+AFNetworking.h */, + 2B27CC87C7D3EDBA929BDAD7BB6BD2F9 /* UIActivityIndicatorView+AFNetworking.m */, + FA85CB34FEC4D83A2924122CCBED64D0 /* UIButton+AFNetworking.h */, + 6290D3809B774BA20314DA284EAC050D /* UIButton+AFNetworking.m */, + D01CA6D092548B64AC210396E0B19B74 /* UIImage+AFNetworking.h */, + 820EF46A002155631B09AF5C382AFE12 /* UIImageView+AFNetworking.h */, + 7A73A69B29B977EDB682329D6C78AFB5 /* UIImageView+AFNetworking.m */, + DB5B56E6FD1B6DC58CEE9F312A7AC93F /* UIKit+AFNetworking.h */, + 6B62E4165E44A39AFB7FDC89097F992D /* UIProgressView+AFNetworking.h */, + 290A7F705B8C5BDB01249D54F0F4E8C6 /* UIProgressView+AFNetworking.m */, + BA2DF80F7B80DC52F46237758B8709BE /* UIRefreshControl+AFNetworking.h */, + CDC037FC7440648854AB6F642481ED5E /* UIRefreshControl+AFNetworking.m */, + BD5D5053B9A456DABCA70A661CB0FC89 /* UIWebView+AFNetworking.h */, + 01B092702BDE33E0C5BB94171884DBAC /* UIWebView+AFNetworking.m */, + ); + name = UIKit; + sourceTree = ""; + }; + 7478C8AF9562FA03755BF7C7E4843AF7 /* FoldingTabBar */ = { + isa = PBXGroup; + children = ( + DF51FD97A5279436D972E9E65EC0B233 /* CAAnimation+YALTabBarViewAnimations.h */, + E28347D0104F727CBF3C568CDCD5A58D /* CAAnimation+YALTabBarViewAnimations.m */, + BF247C42914A52BC160DCCB331BB46D3 /* CATransaction+TransactionWithAnimationsAndCompletion.h */, + 7BCAF5BAB1ACA33540167929113B0FB1 /* CATransaction+TransactionWithAnimationsAndCompletion.m */, + 1E3EEAF15234BEA71BFB0C24FB77D631 /* YALAnimatingTabBarConstants.h */, + 001ABBF0FE9A55B72CFF9812E6E35FAC /* YALAnimatingTabBarConstants.m */, + 1F45E62A78431D3EAB50F7A9A1887A65 /* YALFoldingTabBar.h */, + 6D1DC5B65019D76224E732989A66A808 /* YALFoldingTabBar.m */, + 79E3FA8B2698537FD912E3914FAFA102 /* YALFoldingTabBarController.h */, + 2B427D418ADD74F918CC6B583037B99B /* YALFoldingTabBarController.m */, + 1BD0BA6AD2DEF0AA3A81F7205F1B3F8F /* YALSpringAnimation.h */, + 32FA4A3F419A164C42020735FA8EC90B /* YALSpringAnimation.m */, + D97C19939DF3C769754C3A6D9CC6A5F0 /* YALTabBarInteracting.h */, + 49138BE9C7E6EC2FF6C05CE35202AA27 /* YALTabBarItem.h */, + 116A3146C31454F60A224C6F6D54D43A /* YALTabBarItem.m */, + F9B3B360FF06A6D08E32CF2D6695E329 /* Support Files */, + ); + path = FoldingTabBar; + sourceTree = ""; + }; + 75C0FE4BB6F31ACA69B0EF44C22996BF /* Firebase */ = { + isa = PBXGroup; + children = ( + 72120211B201B79DC9136FC5131A74E2 /* Empty.m */, + 094876CBE3DC3F2584054A81EE765E6C /* FAuthData.h */, + 3EC8F905FAA397DA3CE2DFFC7A57CCA1 /* FAuthType.h */, + 34584379769D592ED950BE5BE715A224 /* FConfig.h */, + 84C17D603BDCDB9250A4E11B69121B5F /* FDataSnapshot.h */, + 78A66B919E4EE937716B7E0BCF924D7D /* FEventType.h */, + 8CB6EA6F905DD15AFBB41E1B6319B9BC /* Firebase.h */, + 192EC3248E86EBE521A5049404973024 /* FirebaseApp.h */, + 341656227DE44EE01D8B35942CA8F205 /* FirebaseServerValue.h */, + 9516417C2FACD6488C658DBA2269E3D7 /* FMutableData.h */, + 3782D172A4204AFC95257FE3C6E1A606 /* FQuery.h */, + BDBAFCF8B681ED3A551B91568643551A /* FTransactionResult.h */, + 2B3798722FBDC4D105C5DD1FF6260D01 /* Frameworks */, + B26943219728E10AF68CDD4B55C70CA4 /* Support Files */, + ); + path = Firebase; + sourceTree = ""; + }; + 7DB346D0F39D3F0E887471402A8071AB = { + isa = PBXGroup; + children = ( + BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */, + EB57DDB3388FBC701046A1E93218737F /* Frameworks */, + C64CA5632FA5EE95AA29BDEC830676C5 /* Pods */, + C79FA9758D8E0D872371A2833CC90BDE /* Products */, + 037C0CA694176A3C0915F62C9D20B3E6 /* Targets Support Files */, + ); + sourceTree = ""; + }; + 83DDB476EF190C8D18659B894F09CF52 /* Support Files */ = { + isa = PBXGroup; + children = ( + 87B9C55DC070D14E4C57B837CD1262AE /* Unirest.xcconfig */, + 5EB9CF551F8BE58477E8AEAD71720322 /* Unirest-dummy.m */, + 141852093744B16906752A3E1267A283 /* Unirest-prefix.pch */, + ); + name = "Support Files"; + path = "../Target Support Files/Unirest"; + sourceTree = ""; + }; + 8C110B54F315F242268150482017CD17 /* Reachability */ = { + isa = PBXGroup; + children = ( + 0EFF364058CC34E834A1C31988F5825B /* AFNetworkReachabilityManager.h */, + D05C3CE8F1AFB523C406EFA1E3AE0E02 /* AFNetworkReachabilityManager.m */, + ); + name = Reachability; + sourceTree = ""; + }; + 908FD93B8A8240ABCA08AD863C490D9B /* Support Files */ = { + isa = PBXGroup; + children = ( + ED627D0023232F7C576871009D15F6D2 /* RSBarcodes.xcconfig */, + 9FF610949E922A7540FC67FC90A70E6A /* RSBarcodes-dummy.m */, + 9B267014304EA99F4C75694F43C38EB8 /* RSBarcodes-prefix.pch */, + ); + name = "Support Files"; + path = "../Target Support Files/RSBarcodes"; + sourceTree = ""; + }; + 90B05BBDA1EBCC3389A0112014CBF780 /* Core */ = { + isa = PBXGroup; + children = ( + DDFFB63C5B7AB4BCAF75FF1017028A88 /* NSData+ImageContentType.h */, + 13E47006C1108E3CCC2C2F7A0636E257 /* NSData+ImageContentType.m */, + 67BF7EDAE1E08F687624C87EE20C05C1 /* SDImageCache.h */, + 0D09026E66AAFA7EF4A55FF0EE0B55C9 /* SDImageCache.m */, + E27A791BDEABCB66CEDA3ED57B0BB941 /* SDWebImageCompat.h */, + 20F8DC1818E3E8A3AFBB623D06B3BA0D /* SDWebImageCompat.m */, + D8CD89FD27B567D503C27A5FEE9EC60A /* SDWebImageDecoder.h */, + 7E0ED74D4CFD6C830083D7D5B4FB8D58 /* SDWebImageDecoder.m */, + 8FBD09F2E9A90C80DF50A40C3B26A683 /* SDWebImageDownloader.h */, + D51656B33C989C68356771805D5111E2 /* SDWebImageDownloader.m */, + 175A13F9014370BB99A72287694B964C /* SDWebImageDownloaderOperation.h */, + D95CE1C0964CDF43EEA68D1D4A11642C /* SDWebImageDownloaderOperation.m */, + 9C036FDFB9C1A421C33ED3580EAB59AE /* SDWebImageManager.h */, + 353720A9F9419765E927ED820CE36805 /* SDWebImageManager.m */, + 26A363E7B60C2EB63EE8A0BFD1C6E5DE /* SDWebImageOperation.h */, + 2683523293DBB34AB2D13922DE6D2D03 /* SDWebImagePrefetcher.h */, + A64F5BD2E96EF942744706EF319BD3A7 /* SDWebImagePrefetcher.m */, + 105EB18DDECD31D945F8DF8D590C4E73 /* UIButton+WebCache.h */, + 6D590461924D689D4654FCD00E564F62 /* UIButton+WebCache.m */, + 147F4A1B3181323D3B312C7C595799DF /* UIImage+GIF.h */, + 3E2D95497BEFB8A764C3837B63842BC7 /* UIImage+GIF.m */, + C89436DC00C436261C4B9F3FB3CB415B /* UIImage+MultiFormat.h */, + 2A87AF7D56DD134FE694270A462EC478 /* UIImage+MultiFormat.m */, + 21006BD6CD96355B6514524F865FDAB7 /* UIImageView+HighlightedWebCache.h */, + 985E6290EBECD97B0E13AD64D8F3D76D /* UIImageView+HighlightedWebCache.m */, + 5096454D954F0B14600B105A06389966 /* UIImageView+WebCache.h */, + D37CE45345B8EB22D82D8A02BBF84C23 /* UIImageView+WebCache.m */, + 882117FF9CC46BE0C573A483C559B51B /* UIView+WebCacheOperation.h */, + A7FA928277224EF0FFC145BAC1D30F74 /* UIView+WebCacheOperation.m */, + ); + name = Core; + sourceTree = ""; + }; + 9787FF52C44CD868C462824364F35FF6 /* Resources */ = { + isa = PBXGroup; + children = ( + C1CE437A434112B993B71BA2BA88DC79 /* SIAlertView.bundle */, + ); + name = Resources; + sourceTree = ""; + }; + 9C34A45C24EBBAEBF9734070E1C315D5 /* Resources */ = { + isa = PBXGroup; + children = ( + 7E24074AC4A683DA3D04581462B842CD /* NSDate+RelativeTime.bundle */, + ); + name = Resources; + sourceTree = ""; + }; + A0F07387D9C40624D0028753073122BD /* iOS */ = { + isa = PBXGroup; + children = ( + 2050D0C1B75539ED060A0255620B4AE7 /* AVFoundation.framework */, + B2C4E468528F21BE2931AC7445D97066 /* CFNetwork.framework */, + 8596D8DDEB82BED0AA242B009C963E49 /* CoreGraphics.framework */, + 9C27954D5024C2307071D22A24854938 /* CoreImage.framework */, + 1BCC847252D74278DD90C79310F62927 /* Foundation.framework */, + 53877185B4DAB43F4EA27CE096CE8A27 /* ImageIO.framework */, + C635976F9474E33E8CE76263D7B45F0C /* MobileCoreServices.framework */, + C568BF7DC7405C1CA3A1FFEF70FAA641 /* QuartzCore.framework */, + 4A21DA7CC174E0A310C46E2403C6EBFC /* Security.framework */, + AD6940EA22C3DC951575E9878F82F68C /* SystemConfiguration.framework */, + 3EBA4E7C408540624004687482925CE1 /* UIKit.framework */, + ); + name = iOS; + sourceTree = ""; + }; + A803A36274AB46CC63F64CD978C89A14 /* Support Files */ = { + isa = PBXGroup; + children = ( + 490C1CDA195F15178CF561BE3158782C /* SDWebImage.xcconfig */, + E39D4C26946BF8FDBA32CD7ED9F7FC1F /* SDWebImage-dummy.m */, + E9F33DD306C313959B59FF06C120643D /* SDWebImage-prefix.pch */, + ); + name = "Support Files"; + path = "../Target Support Files/SDWebImage"; + sourceTree = ""; + }; + B26943219728E10AF68CDD4B55C70CA4 /* Support Files */ = { + isa = PBXGroup; + children = ( + 54704FEB81C296CCD6CF0C173935A558 /* Firebase.xcconfig */, + F92E1C7996C02E7B526FFD37E172C5C1 /* Firebase-dummy.m */, + B973E05EF4C06F7D2102FD6EE7A96755 /* Firebase-prefix.pch */, + ); + name = "Support Files"; + path = "../Target Support Files/Firebase"; + sourceTree = ""; + }; + B3D1D13E0C6553800746CB8FD61CF946 /* Pods */ = { + isa = PBXGroup; + children = ( + 37DB56D75062CC75FCB0966E1C6E8A8E /* Pods-acknowledgements.markdown */, + 10834806BD7B412BC24F347361FA2C8E /* Pods-acknowledgements.plist */, + 272643F56613CA0D336AE3DBF19DC404 /* Pods-dummy.m */, + 6911BECA35E7518D864239B7E898EEF3 /* Pods-frameworks.sh */, + A1A36D34413696BE466E2CA0AFF194DA /* Pods-resources.sh */, + 4E762F23EC34ED4A6FF3312D84E33A40 /* Pods.debug.xcconfig */, + 98C98CDFB3F20F2925F6CD1F141BB14F /* Pods.release.xcconfig */, + ); + name = Pods; + path = "Target Support Files/Pods"; + sourceTree = ""; + }; + BA52E311FB825CB3AF557577FA3D4320 /* NSDate+RelativeTime */ = { + isa = PBXGroup; + children = ( + B66EB15C19225526D9A99A6E5540A763 /* NSDate+RelativeTime.h */, + 2E7E9B6535A89643600F990CFD6A942E /* NSDate+RelativeTime.m */, + 9C34A45C24EBBAEBF9734070E1C315D5 /* Resources */, + F8448B282DCA61550041DDA7F69AAC6A /* Support Files */, + ); + path = "NSDate+RelativeTime"; + sourceTree = ""; + }; + BA59F79242AD633117ACA96409661632 /* SIAlertView */ = { + isa = PBXGroup; + children = ( + D0E278A86A921938CCD886CA1129771D /* SIAlertView.h */, + C20D15D79B151ABCD35AC6FCDC0C3E5A /* SIAlertView.m */, + 9787FF52C44CD868C462824364F35FF6 /* Resources */, + 0301A385BF0B506301F02A5DF25B3CCC /* Support Files */, + ); + path = SIAlertView; + sourceTree = ""; + }; + C388938541F2CE812D30EFA2137812E6 /* AFNetworking */ = { + isa = PBXGroup; + children = ( + 2D223199765615D5B851AFFBE312F34A /* AFNetworking.h */, + 024A3B508BC20259F16C137B69F4D586 /* NSURLSession */, + 8C110B54F315F242268150482017CD17 /* Reachability */, + 604E8DE430285A2047CBAB9F5F7C3739 /* Security */, + 691A148A6200BD3B355E6A46B22C3D51 /* Serialization */, + F874ABD1866A261A1135B479749BAFBD /* Support Files */, + 6F566AE87D186926998B36A2626C4353 /* UIKit */, + ); + path = AFNetworking; + sourceTree = ""; + }; + C64CA5632FA5EE95AA29BDEC830676C5 /* Pods */ = { + isa = PBXGroup; + children = ( + C388938541F2CE812D30EFA2137812E6 /* AFNetworking */, + 75C0FE4BB6F31ACA69B0EF44C22996BF /* Firebase */, + 7478C8AF9562FA03755BF7C7E4843AF7 /* FoldingTabBar */, + 3395B597BA5ACBF276BF098B9FD4C2E0 /* HSDatePickerViewController */, + BA52E311FB825CB3AF557577FA3D4320 /* NSDate+RelativeTime */, + 4DFEA347F1408E0B929A167649E4F326 /* RSBarcodes */, + F5B68F70930829425A9BCF7B8F5DCE1E /* SDWebImage */, + BA59F79242AD633117ACA96409661632 /* SIAlertView */, + 6C392A4F1BC382FE6DD712E70B605664 /* Unirest */, + ); + name = Pods; + sourceTree = ""; + }; + C79FA9758D8E0D872371A2833CC90BDE /* Products */ = { + isa = PBXGroup; + children = ( + 51622DD1829E756C692BF1A822D765D2 /* libAFNetworking.a */, + 590FE50501C0366CD935278467E54BAB /* libFirebase.a */, + 03C3EB1DD7F31115225CC05D9D3843B1 /* libFoldingTabBar.a */, + 37C135FFCC6B32468DB23784635142D1 /* libHSDatePickerViewController.a */, + EBFC5612B601E11A62CD47A581560911 /* libNSDate+RelativeTime.a */, + FF6472A6002F01D417E629D2EED89772 /* libPods.a */, + 01A653C04F2D1061D83E9591AA3328B0 /* libRSBarcodes.a */, + 0BE200E58E798E835F55E45CA9506F2F /* libSDWebImage.a */, + F59D725FBFA071473C1D1FBE0C2F7CD3 /* libSIAlertView.a */, + 33E8DD3D0CBFD1BC563919E4657B370B /* libUnirest.a */, + ); + name = Products; + sourceTree = ""; + }; + C92997D6A644102F285492864D6297B6 /* Resources */ = { + isa = PBXGroup; + children = ( + 8BF8DD77997B6DC12067D8DF6C4FD4E0 /* HSDatePickerViewController.xib */, + ); + name = Resources; + sourceTree = ""; + }; + EB57DDB3388FBC701046A1E93218737F /* Frameworks */ = { + isa = PBXGroup; + children = ( + A0F07387D9C40624D0028753073122BD /* iOS */, + ); + name = Frameworks; + sourceTree = ""; + }; + EEAE8E681E9F109940A8133DE0FB1AA0 /* Support Files */ = { + isa = PBXGroup; + children = ( + 3BA7704CB9C8519486AA859FF85B5511 /* HSDatePickerViewController.xcconfig */, + ECA85143C85F24D200A165770136B0BE /* HSDatePickerViewController-dummy.m */, + 760067039D9649A77629369AF144B665 /* HSDatePickerViewController-prefix.pch */, + ); + name = "Support Files"; + path = "../Target Support Files/HSDatePickerViewController"; + sourceTree = ""; + }; + F5B68F70930829425A9BCF7B8F5DCE1E /* SDWebImage */ = { + isa = PBXGroup; + children = ( + 90B05BBDA1EBCC3389A0112014CBF780 /* Core */, + A803A36274AB46CC63F64CD978C89A14 /* Support Files */, + ); + path = SDWebImage; + sourceTree = ""; + }; + F8448B282DCA61550041DDA7F69AAC6A /* Support Files */ = { + isa = PBXGroup; + children = ( + 5F0B73482E68333950B6BAFE7DEE0F59 /* NSDate+RelativeTime.xcconfig */, + 33D062A8B1E0866C1936D631C803173F /* NSDate+RelativeTime-dummy.m */, + D329B2FFEA1386954A60598CA124C1D8 /* NSDate+RelativeTime-prefix.pch */, + ); + name = "Support Files"; + path = "../Target Support Files/NSDate+RelativeTime"; + sourceTree = ""; + }; + F874ABD1866A261A1135B479749BAFBD /* Support Files */ = { + isa = PBXGroup; + children = ( + 9FC96CB33EFAFC96428A65448CC8164E /* AFNetworking.xcconfig */, + 15EA89E354E1B117B7D01F1B06ECBFD3 /* AFNetworking-dummy.m */, + 04D090868BD4313DB321CDA09AC2F7B5 /* AFNetworking-prefix.pch */, + ); + name = "Support Files"; + path = "../Target Support Files/AFNetworking"; + sourceTree = ""; + }; + F9B3B360FF06A6D08E32CF2D6695E329 /* Support Files */ = { + isa = PBXGroup; + children = ( + 2773439856358BFBA1A94C6D1C9EC255 /* FoldingTabBar.xcconfig */, + 3A88FCC1E5569FC622607028EF66EE48 /* FoldingTabBar-dummy.m */, + 13A29F90377F32E889467A6EB11129FC /* FoldingTabBar-prefix.pch */, + ); + name = "Support Files"; + path = "../Target Support Files/FoldingTabBar"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 11B07EDA26BA9DAE2415B87999509E89 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 075979D6A80AA907E8C15434C532C221 /* FAuthData.h in Headers */, + F06664877754422D6FB53A1D8E4FE448 /* FAuthType.h in Headers */, + 83126EA3B5E960F9A9C155CE3DACB9FB /* FConfig.h in Headers */, + 6EE911B933800447253BC3935A13E65E /* FDataSnapshot.h in Headers */, + 3FD61871A384128BD423ECB516B54AC8 /* FEventType.h in Headers */, + C9B2789B5C77981D226512D3AFA94AC2 /* Firebase.h in Headers */, + 6A1B1829F5A55FB2979D58FB8F957AD7 /* FirebaseApp.h in Headers */, + 8F4F6C91327C6D43B7C6A83EBDC6184B /* FirebaseServerValue.h in Headers */, + A5035EDCA2C178ABAC6CBF1C82D0C649 /* FMutableData.h in Headers */, + FC18554D24943F3FEEBC7222C7FD8D10 /* FQuery.h in Headers */, + D29D86661B99C954E8301C4157961A40 /* FTransactionResult.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 605ACC51F1240D8D7C854C2BED98A930 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 3725BBDB6008FC08F7EAAD30051B31EA /* NSData+ImageContentType.h in Headers */, + 2E84C28542CB41B4880B17BFE8FDB669 /* SDImageCache.h in Headers */, + 9EF75898BB50BFC4514A38C85166CD85 /* SDWebImageCompat.h in Headers */, + 5DECB1B57E660AAA21B13271D1871ACC /* SDWebImageDecoder.h in Headers */, + 587B9A01E181D485939E054CC43116D4 /* SDWebImageDownloader.h in Headers */, + 6A73740FE15149B793B5B6679B12EC39 /* SDWebImageDownloaderOperation.h in Headers */, + BF41B9464EF9BB86E52FECBD9BB72C8D /* SDWebImageManager.h in Headers */, + 3ECE2EF97A88A20FBFCFB183128F34CD /* SDWebImageOperation.h in Headers */, + 40E5ECD182BA38CF8409F77D17BFDFAB /* SDWebImagePrefetcher.h in Headers */, + C3E853EDE6315BFA624A6760EE65DA87 /* UIButton+WebCache.h in Headers */, + A189ED004109E816D7C39A0D15774DED /* UIImage+GIF.h in Headers */, + 134D86030A31C8C7FEF96EC576626444 /* UIImage+MultiFormat.h in Headers */, + AA014BBE493D0FC8B79F3019741877D9 /* UIImageView+HighlightedWebCache.h in Headers */, + 47964FB9BAEBC58939B41205A6D1F938 /* UIImageView+WebCache.h in Headers */, + 7E89AB2599B4B2761F6196E486BFC012 /* UIView+WebCacheOperation.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7BAB51A16596C67D638F977F2523AD29 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + A6A403231A96C6C21C83BAEF0BB1093F /* CAAnimation+YALTabBarViewAnimations.h in Headers */, + 2086289033B670D4FFE18F8578E911F2 /* CATransaction+TransactionWithAnimationsAndCompletion.h in Headers */, + E6E0B008759D9B3D9EE25FD2FE56E715 /* YALAnimatingTabBarConstants.h in Headers */, + B50EA8AB3CF7CF9162E24421784D4BAD /* YALFoldingTabBar.h in Headers */, + 7EE9BE9884D5807EC2C980930CB99B06 /* YALFoldingTabBarController.h in Headers */, + 565365EA7F73C65562A3FC4459E770B5 /* YALSpringAnimation.h in Headers */, + 6DFB846C756551ECD366F5AC7B189C2C /* YALTabBarInteracting.h in Headers */, + E288DE93014B057EC4C1871E17F3FA89 /* YALTabBarItem.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 878B3CA24749172DB1C9EA07D4132215 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 919C30BBC314E52FBF81D39D16547D74 /* Base64.h in Headers */, + 2F50E533C734AEA1875D96E8EE739B46 /* UNIBaseRequest.h in Headers */, + 8595B032DDECA1D860BFEA53A6D6D2A6 /* UNIBodyRequest.h in Headers */, + 1F0C7AB2EFABBBA5F0E53CB862EEFC4A /* UNIHTTPBinaryResponse.h in Headers */, + CC8A58A1B4453A7EC869B1AE9A9F05B3 /* UNIHTTPClientHelper.h in Headers */, + F6BD22EBD6F7A829D765BC40C3CCDAF1 /* UNIHTTPJsonResponse.h in Headers */, + 42B95931934DA29AFD168258602A8D6F /* UNIHTTPRequest.h in Headers */, + C3899AFB1B9509CBDD68B388CADF4A43 /* UNIHTTPRequestWithBody.h in Headers */, + E07426B6C4CDD56E8F5C14BD73A712DF /* UNIHTTPResponse.h in Headers */, + 25581EFDD7B61E460F53258C6577767D /* UNIHTTPStringResponse.h in Headers */, + B26745CB8E5F612261B65D77DFA204A8 /* UNIJsonNode.h in Headers */, + 2B7D271EE80D6E6AAD7387D222E2F2F8 /* UNIRest.h in Headers */, + B37D93A61F7D3E59C0072FD333FAD838 /* UNISimpleRequest.h in Headers */, + DC7FD5B33348C67C33ABCE00822B7BD0 /* UNIUrlConnection.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 881B388310A8514EF01AFCB60B5A730F /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 2021EAC29409DBF68EF43E9001FD6FFD /* RSBarcodes.h in Headers */, + AAC90E0C31623FA8C638E736EAF76386 /* RSCode128Generator.h in Headers */, + 602BE62AF8FB782622693A50934CF0C5 /* RSCode39Generator.h in Headers */, + D0DEBD2294022D8CFB829F12382449C0 /* RSCode39Mod43Generator.h in Headers */, + B5A80A9419F6B2761A85A883A1205F54 /* RSCode93Generator.h in Headers */, + 10D22A78A018D2158C332B67ADD39BC7 /* RSCodeGen.h in Headers */, + 25A3CA8FCDBC9842E5E263BD35798094 /* RSCodeGenerator.h in Headers */, + A3B913AF833548248DA44E7054DB78FF /* RSCodeView.h in Headers */, + AA78F95D587393A44639A82E7DE0B168 /* RSCornersView.h in Headers */, + 9E1CC4F0553F4B8BBBCFEAC9AF64279D /* RSEAN13Generator.h in Headers */, + C700B372A513DADEE2DFE69E85D54DE6 /* RSEAN8Generator.h in Headers */, + 7BFE02130009BBC706219DD0D68AE2AD /* RSEANGenerator.h in Headers */, + BC452DFE143921AED9DA09AD20B6861D /* RSExtendedCode39Generator.h in Headers */, + 2A28E6BCCCA18DD4BECA5792EAAE5FBE /* RSISBN13Generator.h in Headers */, + 17BBF70528341AAEC35F8EC77512E1A8 /* RSISSN13Generator.h in Headers */, + A7E77CDB17BC604B8C7EA430D4C29DC1 /* RSITF14Generator.h in Headers */, + CC90184B2A2BA15775A6414A8215CC7C /* RSITFGenerator.h in Headers */, + 5EA196683EECD4C532DACB29CF8EFF1E /* RSScannerViewController.h in Headers */, + 006E7EF663C6DBB175923E1C137C1FF4 /* RSUnifiedCodeGenerator.h in Headers */, + AC597FA8F18E8EAC034061B99CEC03DD /* RSUPCEGenerator.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B8B442D289EF674D2BFDC27EAFAB40DD /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E2DF08155A768C1FC56AD8B58731044 /* SIAlertView.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B981229135DBE9773A86BDB116C368D1 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 19E6319F6ECED7539AABBD9A211F7AEC /* AFAutoPurgingImageCache.h in Headers */, + F3774B1449FCE5B3CA3E1B336E11D284 /* AFHTTPSessionManager.h in Headers */, + 326A543AD4E39A2DAECA1CD385E3AEA2 /* AFImageDownloader.h in Headers */, + 3939531EB270B4145C7ADFBAB2E5695F /* AFNetworkActivityIndicatorManager.h in Headers */, + 0A08FC71C4E3B8E0F8734BCDA7CCA7CB /* AFNetworking.h in Headers */, + ED69D9B5A342FE9BD3F170D5CDDEC948 /* AFNetworkReachabilityManager.h in Headers */, + DFDAC8245626953C4BCE5A2DA6BE2A5B /* AFSecurityPolicy.h in Headers */, + 2359387620C5E815BF0594BC40311734 /* AFURLRequestSerialization.h in Headers */, + B51AA1F7701DCDBCC9B88A15320F9C2C /* AFURLResponseSerialization.h in Headers */, + 3511AE7ADBB71D05565854F0E70B7D08 /* AFURLSessionManager.h in Headers */, + 830050886B18F54E17F117FD8EFC717B /* UIActivityIndicatorView+AFNetworking.h in Headers */, + E212C2AA95E8F6EFB69A5F1455F291F8 /* UIButton+AFNetworking.h in Headers */, + C1B65C3D849FEE4FB5298A8135A765DA /* UIImage+AFNetworking.h in Headers */, + 6EC97BDB3FC508526F9E388095A7DDCC /* UIImageView+AFNetworking.h in Headers */, + 85FAB6F1D2FE0598BF2E61D7BB084B8D /* UIKit+AFNetworking.h in Headers */, + 5D52DB6DF2E6C24CECB0015A9177A2E1 /* UIProgressView+AFNetworking.h in Headers */, + ACE9C1A6E8D5121C6C5F907C7A9CFCC9 /* UIRefreshControl+AFNetworking.h in Headers */, + B5CF67F7870BAB70A76E57479B706B42 /* UIWebView+AFNetworking.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D5099957D846BBB31C3504C08E4C83B3 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + D90B3B51F99FFC7123EA7A1B030A1B1A /* NSDate+RelativeTime.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E0670F27B95AB1F2597B56E1D837731D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 7873F380EBB90D62BB98741912B517DE /* HSDatePickerViewController.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 4EB392DBB5283EE08DA12AB8336D08CB /* SDWebImage */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6E3F2EAC79123B00C6016DA2F0A8ADA6 /* Build configuration list for PBXNativeTarget "SDWebImage" */; + buildPhases = ( + D249BCD086F7A6CF08F6D1D866A80DA0 /* Sources */, + 8A591A6B686858C673453A34A582F72C /* Frameworks */, + 605ACC51F1240D8D7C854C2BED98A930 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SDWebImage; + productName = SDWebImage; + productReference = 0BE200E58E798E835F55E45CA9506F2F /* libSDWebImage.a */; + productType = "com.apple.product-type.library.static"; + }; + 4FC57AD0A574066CF6D2C2D9857A50F7 /* NSDate+RelativeTime */ = { + isa = PBXNativeTarget; + buildConfigurationList = 10B49BBE578F7DCC8DD48D6D822D09EF /* Build configuration list for PBXNativeTarget "NSDate+RelativeTime" */; + buildPhases = ( + 4B6495F7073BEB81FB328365001BC620 /* Sources */, + 5D183ADE8FB7E6A5143263F66FD9DBBA /* Frameworks */, + D5099957D846BBB31C3504C08E4C83B3 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "NSDate+RelativeTime"; + productName = "NSDate+RelativeTime"; + productReference = EBFC5612B601E11A62CD47A581560911 /* libNSDate+RelativeTime.a */; + productType = "com.apple.product-type.library.static"; + }; + 569735B422E0E4CEEFC5C6955AFDE3A5 /* Firebase */ = { + isa = PBXNativeTarget; + buildConfigurationList = 048D8D02C9F5F6B4FAB719C7488039B1 /* Build configuration list for PBXNativeTarget "Firebase" */; + buildPhases = ( + 4FDE5E0B37287615FB2FA4693FF4F294 /* Sources */, + 517AD8D3904844B971845D1995E200D7 /* Frameworks */, + 11B07EDA26BA9DAE2415B87999509E89 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Firebase; + productName = Firebase; + productReference = 590FE50501C0366CD935278467E54BAB /* libFirebase.a */; + productType = "com.apple.product-type.library.static"; + }; + 64652363A141271942BD6F746781173D /* Pods */ = { + isa = PBXNativeTarget; + buildConfigurationList = 99A785FA5A4A767DFE6B24EEFE688DFA /* Build configuration list for PBXNativeTarget "Pods" */; + buildPhases = ( + A2DEF4FFD05C7065BEB9E741191F54DA /* Sources */, + 3B315B3CA0ED15629CEBAEBA2212A314 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 6C1B30F28ECFB5F9ABBF08E2021EE278 /* PBXTargetDependency */, + 61A89E9FD074F2B4594FCE7DFBC7F7BB /* PBXTargetDependency */, + 6C635CB61681FB8DF44B9D7D89B74950 /* PBXTargetDependency */, + 173D4F5895DA3F200BEBAFB511D698FB /* PBXTargetDependency */, + ECA9D30219909D0AED00A29DD139CF95 /* PBXTargetDependency */, + FCC1F46BEA880CF3F40D59B2F455F45E /* PBXTargetDependency */, + E468387C42A7040699E08538D80B2FB5 /* PBXTargetDependency */, + A3EF203CCBDFF9677C6AF5BEBA3B1162 /* PBXTargetDependency */, + 7AA1D3BADCA66880FBFFCCA49DEB64E7 /* PBXTargetDependency */, + ); + name = Pods; + productName = Pods; + productReference = FF6472A6002F01D417E629D2EED89772 /* libPods.a */; + productType = "com.apple.product-type.library.static"; + }; + 6B0B9C928B05BA6346AB032DD0260C56 /* HSDatePickerViewController */ = { + isa = PBXNativeTarget; + buildConfigurationList = A3B0172AA86BBEA6BE600520E675E6A1 /* Build configuration list for PBXNativeTarget "HSDatePickerViewController" */; + buildPhases = ( + 17851A1483CC3597C82A5CAEA073B237 /* Sources */, + D646D2234B48B3EA5209C3F5B5365977 /* Frameworks */, + E0670F27B95AB1F2597B56E1D837731D /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = HSDatePickerViewController; + productName = HSDatePickerViewController; + productReference = 37C135FFCC6B32468DB23784635142D1 /* libHSDatePickerViewController.a */; + productType = "com.apple.product-type.library.static"; + }; + 9145E070690055EA2D82D264E78B0F71 /* FoldingTabBar */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3D9BA71030A144DE354FA087AE0AC89C /* Build configuration list for PBXNativeTarget "FoldingTabBar" */; + buildPhases = ( + 1B24A6DE00BF454C0B785A62F56A9B24 /* Sources */, + E3E27D1553990F260E018F2FD31F237C /* Frameworks */, + 7BAB51A16596C67D638F977F2523AD29 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = FoldingTabBar; + productName = FoldingTabBar; + productReference = 03C3EB1DD7F31115225CC05D9D3843B1 /* libFoldingTabBar.a */; + productType = "com.apple.product-type.library.static"; + }; + 928353533005A4198EBDA5B700D37B64 /* AFNetworking */ = { + isa = PBXNativeTarget; + buildConfigurationList = 77CF2A7107BC61A2E90025871305961D /* Build configuration list for PBXNativeTarget "AFNetworking" */; + buildPhases = ( + DE0BAD758C6F291CE7E10DA077987C62 /* Sources */, + 508C962B3E08E8DA04956BF349A3CDFD /* Frameworks */, + B981229135DBE9773A86BDB116C368D1 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = AFNetworking; + productName = AFNetworking; + productReference = 51622DD1829E756C692BF1A822D765D2 /* libAFNetworking.a */; + productType = "com.apple.product-type.library.static"; + }; + A5620D90C319CE08C7E4BD86A7665AEF /* RSBarcodes */ = { + isa = PBXNativeTarget; + buildConfigurationList = 93A9169A5D5F83E235D4B158F24F6063 /* Build configuration list for PBXNativeTarget "RSBarcodes" */; + buildPhases = ( + 68BC06D9947C632D71D0B08B22BE1837 /* Sources */, + 7E3F8AE54CB368921D48708169A83AD0 /* Frameworks */, + 881B388310A8514EF01AFCB60B5A730F /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = RSBarcodes; + productName = RSBarcodes; + productReference = 01A653C04F2D1061D83E9591AA3328B0 /* libRSBarcodes.a */; + productType = "com.apple.product-type.library.static"; + }; + DB01679F34E5831762A89315547D9445 /* Unirest */ = { + isa = PBXNativeTarget; + buildConfigurationList = CBF6780E5223076C6342449BF0ACE47B /* Build configuration list for PBXNativeTarget "Unirest" */; + buildPhases = ( + 8F2CC3E5C4B07BE4A643E41BE765F173 /* Sources */, + B2A00FB26E7DEEF4DFC5D2C20EE0C716 /* Frameworks */, + 878B3CA24749172DB1C9EA07D4132215 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Unirest; + productName = Unirest; + productReference = 33E8DD3D0CBFD1BC563919E4657B370B /* libUnirest.a */; + productType = "com.apple.product-type.library.static"; + }; + F86F3D4C7C4CF4BC533F12010483E3EB /* SIAlertView */ = { + isa = PBXNativeTarget; + buildConfigurationList = B46D1B9157CAC86166ADB1BD0B36EFEF /* Build configuration list for PBXNativeTarget "SIAlertView" */; + buildPhases = ( + 1F6BC0393A0B22BC82703E43BE936ACB /* Sources */, + 9194CAC35E1F68ECCE818B03A9B8F29B /* Frameworks */, + B8B442D289EF674D2BFDC27EAFAB40DD /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SIAlertView; + productName = SIAlertView; + productReference = F59D725FBFA071473C1D1FBE0C2F7CD3 /* libSIAlertView.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0700; + LastUpgradeCheck = 0700; + }; + buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 7DB346D0F39D3F0E887471402A8071AB; + productRefGroup = C79FA9758D8E0D872371A2833CC90BDE /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 928353533005A4198EBDA5B700D37B64 /* AFNetworking */, + 569735B422E0E4CEEFC5C6955AFDE3A5 /* Firebase */, + 9145E070690055EA2D82D264E78B0F71 /* FoldingTabBar */, + 6B0B9C928B05BA6346AB032DD0260C56 /* HSDatePickerViewController */, + 4FC57AD0A574066CF6D2C2D9857A50F7 /* NSDate+RelativeTime */, + 64652363A141271942BD6F746781173D /* Pods */, + A5620D90C319CE08C7E4BD86A7665AEF /* RSBarcodes */, + 4EB392DBB5283EE08DA12AB8336D08CB /* SDWebImage */, + F86F3D4C7C4CF4BC533F12010483E3EB /* SIAlertView */, + DB01679F34E5831762A89315547D9445 /* Unirest */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 17851A1483CC3597C82A5CAEA073B237 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B682329EDE95117413AB34E604B70445 /* HSDatePickerViewController-dummy.m in Sources */, + D2597C4AB8316CB430A3460C98D86D68 /* HSDatePickerViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1B24A6DE00BF454C0B785A62F56A9B24 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A5A2E68EC92D877AE2289A67BA94C9E7 /* CAAnimation+YALTabBarViewAnimations.m in Sources */, + 3BF789DD91B049645722960CC51287EB /* CATransaction+TransactionWithAnimationsAndCompletion.m in Sources */, + A5EF7E6ADB37EC0A0DE6145812D8998D /* FoldingTabBar-dummy.m in Sources */, + 00F8DED37CC833980AEAD7E7BD46C99E /* YALAnimatingTabBarConstants.m in Sources */, + 06084AD9120FF151ADF37E92A8CDBE83 /* YALFoldingTabBar.m in Sources */, + 343BA26395BFBF73CFC3F42871C03BB9 /* YALFoldingTabBarController.m in Sources */, + 2D8855CDA875AC8AD7AE0DFCC4250493 /* YALSpringAnimation.m in Sources */, + 88410794220AF1062177201E82FF9DBA /* YALTabBarItem.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1F6BC0393A0B22BC82703E43BE936ACB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 730374C21770498C86DE74E46AACB026 /* SIAlertView-dummy.m in Sources */, + 3D54C50D0E2395DED1B3A7FF341DD8B7 /* SIAlertView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4B6495F7073BEB81FB328365001BC620 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1B80FE40AEB5ECD2017EB51E27A56666 /* NSDate+RelativeTime-dummy.m in Sources */, + 6457E1FF63C4479D2D4F288A209A7A19 /* NSDate+RelativeTime.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4FDE5E0B37287615FB2FA4693FF4F294 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8A8B2E7318F9A52B0C8DCF4991BD88E5 /* Empty.m in Sources */, + B7B41E32FB4ADB6C44FB3797B9BB77AE /* Firebase-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 68BC06D9947C632D71D0B08B22BE1837 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F215CEB8C27EE3A2675A994D6B2E109D /* RSBarcodes-dummy.m in Sources */, + 92B6A6C10EA3DC9D1CB2597060A5ABD4 /* RSCode128Generator.m in Sources */, + C8A54E36FF34DCB9F1BDA74AEC53B3A6 /* RSCode39Generator.m in Sources */, + 62A7EAB2D4F1E19A68365D70FE1D61CD /* RSCode39Mod43Generator.m in Sources */, + 05C947CFA1C307C4BEAC8343F0D119C3 /* RSCode93Generator.m in Sources */, + 9508C00EC77A478ABFF00750086579A9 /* RSCodeGenerator.m in Sources */, + D0B3C9199F1F5E1CC20F49DA4AF3A1C4 /* RSCodeView.m in Sources */, + 9A9F70CFB3E75F1135E39FD443A6DC6D /* RSCornersView.m in Sources */, + 45D720843880BBEA904686790D88C1D9 /* RSEAN13Generator.m in Sources */, + 56D864FDD6BB32F4CE658A73E3BF64A1 /* RSEAN8Generator.m in Sources */, + E3D0CEAADB7D1F8FB4ECC24556A88BF9 /* RSEANGenerator.m in Sources */, + DFE5C0DC699187F83C1BB439838B7321 /* RSExtendedCode39Generator.m in Sources */, + D483A846E759D80AF1F8A64D5E7610F9 /* RSISBN13Generator.m in Sources */, + B8DB3FE2E2AEAFB48CBF36813E62B315 /* RSISSN13Generator.m in Sources */, + 0CDCE7E7AAF38B8C43E7B80BAB98C656 /* RSITF14Generator.m in Sources */, + 853B842BC699077F4E8B81255BBC25D9 /* RSITFGenerator.m in Sources */, + 13C35E84B24CE09AB05530E70BFC78FC /* RSScannerViewController.m in Sources */, + 4BB0B162D330C81EF66E4DC89BB5A43C /* RSUnifiedCodeGenerator.m in Sources */, + EF9A4E1E75E79BAC9D90351A0FE04D04 /* RSUPCEGenerator.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8F2CC3E5C4B07BE4A643E41BE765F173 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 96F433015846F04297190A7D3630DF40 /* Base64.m in Sources */, + 311A9FA99DF0294FAECF88C6459BED5E /* UNIBaseRequest.m in Sources */, + 53D0B973380E281E22C7EA6ADD0D0103 /* UNIBodyRequest.m in Sources */, + 0B7B178B2AF6424DB2F950FF61B5A615 /* UNIHTTPBinaryResponse.m in Sources */, + 1C06B2E948FFD4A1738D558575ED5BD4 /* UNIHTTPClientHelper.m in Sources */, + 9B0541696EE15108DCFF61C402206E42 /* UNIHTTPJsonResponse.m in Sources */, + 7D61164DB76C41A575EFA4BEA1659195 /* UNIHTTPRequest.m in Sources */, + 4AE637307423E63FDF2450FEC69E02D7 /* UNIHTTPRequestWithBody.m in Sources */, + A5843E8133D23D0032C893E2BB70FE4C /* UNIHTTPResponse.m in Sources */, + 5FEFAACB09AFFD53C3AF63DC273BD3F1 /* UNIHTTPStringResponse.m in Sources */, + E6117DB8A19163E7C2889993F85DC486 /* UNIJsonNode.m in Sources */, + 28BC86C2B764E67C8AAADA5F30C1E636 /* Unirest-dummy.m in Sources */, + F7F6EACE7A90D2577C6E99E0FBDF02B6 /* UNIRest.m in Sources */, + 4776EC0DDD37C8DB7C31DB7F8FA0F24C /* UNISimpleRequest.m in Sources */, + 4177C09FD15C6A223F21AEBA1678CCC5 /* UNIUrlConnection.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A2DEF4FFD05C7065BEB9E741191F54DA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1C6B2203B329862B0E0AC457977C9098 /* Pods-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D249BCD086F7A6CF08F6D1D866A80DA0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9B12A05451D14B5E75D50E37EF2FBB85 /* NSData+ImageContentType.m in Sources */, + AD0CAA400B7787C113247C747E682818 /* SDImageCache.m in Sources */, + 521665982DB6EF44C5F391B652D46F0B /* SDWebImage-dummy.m in Sources */, + 41951BD7B30766A40C99BD78BF04542A /* SDWebImageCompat.m in Sources */, + AE0F00B728BDB71F11CD84E02E820564 /* SDWebImageDecoder.m in Sources */, + 3F22F066A00A290FC204C43694862179 /* SDWebImageDownloader.m in Sources */, + 981CE79ADCBDC4FF4D3C68FE43F2B140 /* SDWebImageDownloaderOperation.m in Sources */, + BFAC5988E6FC8D933FD7CE19DDC256C2 /* SDWebImageManager.m in Sources */, + DCA6EB3FF23BD34E281E72549137BF6F /* SDWebImagePrefetcher.m in Sources */, + 1E92974E7DF7F3D13D4273BEF0751853 /* UIButton+WebCache.m in Sources */, + 2DCEC640F134A5D953C2A3C14D38F8C0 /* UIImage+GIF.m in Sources */, + 12BA90D4862B705A390B0766659D4C3B /* UIImage+MultiFormat.m in Sources */, + AAA04105CFAC750DDA1A4D1B0262C069 /* UIImageView+HighlightedWebCache.m in Sources */, + 85F33B42BE41674F5FA8A16002E02F8B /* UIImageView+WebCache.m in Sources */, + E2FAF6938051534ECC1EC84D8B45EA43 /* UIView+WebCacheOperation.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DE0BAD758C6F291CE7E10DA077987C62 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 14CD3DFB4A25BAEFB205730FA6750025 /* AFAutoPurgingImageCache.m in Sources */, + 23415204AA48A02959E4E5245CF96037 /* AFHTTPSessionManager.m in Sources */, + D31FEE51AF4BE2A6CC059F80B983CD3B /* AFImageDownloader.m in Sources */, + 4BA19F7DD8F9FDA648137B2CE89E7588 /* AFNetworkActivityIndicatorManager.m in Sources */, + A8FC6A53F6C1CB4DEFD972664E1AF3B1 /* AFNetworking-dummy.m in Sources */, + 43098B12DF5546CB576986E68DBCAFCA /* AFNetworkReachabilityManager.m in Sources */, + 311E5200832E4AE174A193851A2C6317 /* AFSecurityPolicy.m in Sources */, + 8E82178CC9BD8BE3DBF2C10E33807AEB /* AFURLRequestSerialization.m in Sources */, + C2201E34603B014192F0967473518496 /* AFURLResponseSerialization.m in Sources */, + FCDDD3BC67EA205C87238A2A87D5C36C /* AFURLSessionManager.m in Sources */, + 15460ABD372C937E2A07A2FCDF98C473 /* UIActivityIndicatorView+AFNetworking.m in Sources */, + 78940A6980F359C4304C695EF6E67C5D /* UIButton+AFNetworking.m in Sources */, + B0BE398350F83A7B0102C3BBAFC51428 /* UIImageView+AFNetworking.m in Sources */, + 38EEA9ED6B922946C54AD6BAC93B73AD /* UIProgressView+AFNetworking.m in Sources */, + 7F0578A0258E02384F6229C678E60D31 /* UIRefreshControl+AFNetworking.m in Sources */, + AD359A96DD4AA2C962E50A5CD5524F54 /* UIWebView+AFNetworking.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 173D4F5895DA3F200BEBAFB511D698FB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = HSDatePickerViewController; + target = 6B0B9C928B05BA6346AB032DD0260C56 /* HSDatePickerViewController */; + targetProxy = 18EE988F850BA3A17BC7C0356EB970B7 /* PBXContainerItemProxy */; + }; + 61A89E9FD074F2B4594FCE7DFBC7F7BB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Firebase; + target = 569735B422E0E4CEEFC5C6955AFDE3A5 /* Firebase */; + targetProxy = 55A7D58EE48BFA38F194499735DBEDD2 /* PBXContainerItemProxy */; + }; + 6C1B30F28ECFB5F9ABBF08E2021EE278 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = AFNetworking; + target = 928353533005A4198EBDA5B700D37B64 /* AFNetworking */; + targetProxy = 1EFC94EB2AF5394D6954FB188FBC8882 /* PBXContainerItemProxy */; + }; + 6C635CB61681FB8DF44B9D7D89B74950 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = FoldingTabBar; + target = 9145E070690055EA2D82D264E78B0F71 /* FoldingTabBar */; + targetProxy = 73CA390F9F0BB877DEBD8463438FD2D1 /* PBXContainerItemProxy */; + }; + 7AA1D3BADCA66880FBFFCCA49DEB64E7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Unirest; + target = DB01679F34E5831762A89315547D9445 /* Unirest */; + targetProxy = E448A60F87342C5DAF95425F0FDC2DCA /* PBXContainerItemProxy */; + }; + A3EF203CCBDFF9677C6AF5BEBA3B1162 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = SIAlertView; + target = F86F3D4C7C4CF4BC533F12010483E3EB /* SIAlertView */; + targetProxy = 771EE832D75BA5A33C5384BE64106413 /* PBXContainerItemProxy */; + }; + E468387C42A7040699E08538D80B2FB5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = SDWebImage; + target = 4EB392DBB5283EE08DA12AB8336D08CB /* SDWebImage */; + targetProxy = F66A9D55BCFA55E69CA1B4DACC020290 /* PBXContainerItemProxy */; + }; + ECA9D30219909D0AED00A29DD139CF95 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "NSDate+RelativeTime"; + target = 4FC57AD0A574066CF6D2C2D9857A50F7 /* NSDate+RelativeTime */; + targetProxy = 452BEC923978AAB21FA439729059A4E1 /* PBXContainerItemProxy */; + }; + FCC1F46BEA880CF3F40D59B2F455F45E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = RSBarcodes; + target = A5620D90C319CE08C7E4BD86A7665AEF /* RSBarcodes */; + targetProxy = 92DF52EBA3EA4D46F6F6F98D93C6F150 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 016A1ECA2C2CB37B8DDA748057090B52 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 54704FEB81C296CCD6CF0C173935A558 /* Firebase.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/Firebase/Firebase-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 09C20479414A269524FB5524CF2BB9B7 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 490C1CDA195F15178CF561BE3158782C /* SDWebImage.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/SDWebImage/SDWebImage-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 168F8756BCE2DA2DD5CA2B545D6D28AE /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = ED627D0023232F7C576871009D15F6D2 /* RSBarcodes.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/RSBarcodes/RSBarcodes-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 2BE6CF164F5B0DDD793309BAABE3656A /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9FC96CB33EFAFC96428A65448CC8164E /* AFNetworking.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/AFNetworking/AFNetworking-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 46AA13F5BF8BCBAF51D2660D07D0F59A /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5F0B73482E68333950B6BAFE7DEE0F59 /* NSDate+RelativeTime.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/NSDate+RelativeTime/NSDate+RelativeTime-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 4CE98F3A85931095FB99395A58A22D70 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2C3772FD8187DA7E88D21BBCD016D43D /* SIAlertView.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/SIAlertView/SIAlertView-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 52807819F0E222BAE39CFA5C413D841A /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 54704FEB81C296CCD6CF0C173935A558 /* Firebase.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/Firebase/Firebase-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 7711525188B750BE0E373B99528A1631 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5F0B73482E68333950B6BAFE7DEE0F59 /* NSDate+RelativeTime.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/NSDate+RelativeTime/NSDate+RelativeTime-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 80AA8AB56DF14E35F259D4CF2C6FCD23 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 4E762F23EC34ED4A6FF3312D84E33A40 /* Pods.debug.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MACH_O_TYPE = staticlib; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 839AC41B3F348C46A6221CB0FDF9E091 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2C3772FD8187DA7E88D21BBCD016D43D /* SIAlertView.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/SIAlertView/SIAlertView-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 9212FF2185E48C270E73D555EA04F825 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 490C1CDA195F15178CF561BE3158782C /* SDWebImage.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/SDWebImage/SDWebImage-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 9DAD6E0FF07F5702DBF0A4CF9EE42671 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9FC96CB33EFAFC96428A65448CC8164E /* AFNetworking.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/AFNetworking/AFNetworking-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + BCF391A73E9F3C8C62E0C1953016740C /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 98C98CDFB3F20F2925F6CD1F141BB14F /* Pods.release.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MACH_O_TYPE = staticlib; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Release; + }; + C074F63C9EE7CB4D8C618390A32CEC35 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + ONLY_ACTIVE_ARCH = YES; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Debug; + }; + C2663C28175DB2CA5F2B67EC787A081F /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 87B9C55DC070D14E4C57B837CD1262AE /* Unirest.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/Unirest/Unirest-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + C5C921DE71CB384FA32CC598FD14FFAF /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = ED627D0023232F7C576871009D15F6D2 /* RSBarcodes.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/RSBarcodes/RSBarcodes-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Release; + }; + D77299765AE01B4AC1F55F660D8633D4 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3BA7704CB9C8519486AA859FF85B5511 /* HSDatePickerViewController.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/HSDatePickerViewController/HSDatePickerViewController-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + E253AE373DEF6896E03B1ECD3508CBD9 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 87B9C55DC070D14E4C57B837CD1262AE /* Unirest.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/Unirest/Unirest-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Release; + }; + E29AE607EA10F1B02BDDD9B42A0B1453 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2773439856358BFBA1A94C6D1C9EC255 /* FoldingTabBar.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/FoldingTabBar/FoldingTabBar-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + E43846B588E1892F3093F3B7082B6DFB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PREPROCESSOR_DEFINITIONS = "RELEASE=1"; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + F083480B94725CDF1E8C0474D5BEAF65 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2773439856358BFBA1A94C6D1C9EC255 /* FoldingTabBar.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/FoldingTabBar/FoldingTabBar-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Release; + }; + FF2211EF689C0BFDD218C5085E41B73A /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3BA7704CB9C8519486AA859FF85B5511 /* HSDatePickerViewController.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/HSDatePickerViewController/HSDatePickerViewController-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 048D8D02C9F5F6B4FAB719C7488039B1 /* Build configuration list for PBXNativeTarget "Firebase" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 52807819F0E222BAE39CFA5C413D841A /* Debug */, + 016A1ECA2C2CB37B8DDA748057090B52 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 10B49BBE578F7DCC8DD48D6D822D09EF /* Build configuration list for PBXNativeTarget "NSDate+RelativeTime" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 46AA13F5BF8BCBAF51D2660D07D0F59A /* Debug */, + 7711525188B750BE0E373B99528A1631 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C074F63C9EE7CB4D8C618390A32CEC35 /* Debug */, + E43846B588E1892F3093F3B7082B6DFB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3D9BA71030A144DE354FA087AE0AC89C /* Build configuration list for PBXNativeTarget "FoldingTabBar" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E29AE607EA10F1B02BDDD9B42A0B1453 /* Debug */, + F083480B94725CDF1E8C0474D5BEAF65 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6E3F2EAC79123B00C6016DA2F0A8ADA6 /* Build configuration list for PBXNativeTarget "SDWebImage" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 09C20479414A269524FB5524CF2BB9B7 /* Debug */, + 9212FF2185E48C270E73D555EA04F825 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 77CF2A7107BC61A2E90025871305961D /* Build configuration list for PBXNativeTarget "AFNetworking" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9DAD6E0FF07F5702DBF0A4CF9EE42671 /* Debug */, + 2BE6CF164F5B0DDD793309BAABE3656A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 93A9169A5D5F83E235D4B158F24F6063 /* Build configuration list for PBXNativeTarget "RSBarcodes" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 168F8756BCE2DA2DD5CA2B545D6D28AE /* Debug */, + C5C921DE71CB384FA32CC598FD14FFAF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 99A785FA5A4A767DFE6B24EEFE688DFA /* Build configuration list for PBXNativeTarget "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 80AA8AB56DF14E35F259D4CF2C6FCD23 /* Debug */, + BCF391A73E9F3C8C62E0C1953016740C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A3B0172AA86BBEA6BE600520E675E6A1 /* Build configuration list for PBXNativeTarget "HSDatePickerViewController" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D77299765AE01B4AC1F55F660D8633D4 /* Debug */, + FF2211EF689C0BFDD218C5085E41B73A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B46D1B9157CAC86166ADB1BD0B36EFEF /* Build configuration list for PBXNativeTarget "SIAlertView" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4CE98F3A85931095FB99395A58A22D70 /* Debug */, + 839AC41B3F348C46A6221CB0FDF9E091 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CBF6780E5223076C6342449BF0ACE47B /* Build configuration list for PBXNativeTarget "Unirest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C2663C28175DB2CA5F2B67EC787A081F /* Debug */, + E253AE373DEF6896E03B1ECD3508CBD9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; +} diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/AFNetworking.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/AFNetworking.xcscheme new file mode 100644 index 0000000..165c77f --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/AFNetworking.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/Firebase.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/Firebase.xcscheme new file mode 100644 index 0000000..5661119 --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/Firebase.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/FoldingTabBar.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/FoldingTabBar.xcscheme new file mode 100644 index 0000000..5c2b62f --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/FoldingTabBar.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/HSDatePickerViewController.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/HSDatePickerViewController.xcscheme new file mode 100644 index 0000000..70067c1 --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/HSDatePickerViewController.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/NSDate+RelativeTime.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/NSDate+RelativeTime.xcscheme new file mode 100644 index 0000000..d97afe4 --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/NSDate+RelativeTime.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/Pods.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/Pods.xcscheme new file mode 100644 index 0000000..f65c023 --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/Pods.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/RSBarcodes.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/RSBarcodes.xcscheme new file mode 100644 index 0000000..93e5af2 --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/RSBarcodes.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/SDWebImage.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/SDWebImage.xcscheme new file mode 100644 index 0000000..8d102b9 --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/SDWebImage.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/SIAlertView.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/SIAlertView.xcscheme new file mode 100644 index 0000000..492906e --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/SIAlertView.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/Unirest.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/Unirest.xcscheme new file mode 100644 index 0000000..41670dc --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/Unirest.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/xcschememanagement.plist b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..6b20375 --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,112 @@ + + + + + SchemeUserState + + AFNetworking.xcscheme + + isShown + + + Firebase.xcscheme + + isShown + + + FoldingTabBar.xcscheme + + isShown + + + HSDatePickerViewController.xcscheme + + isShown + + + NSDate+RelativeTime.xcscheme + + isShown + + + Pods.xcscheme + + isShown + + + RSBarcodes.xcscheme + + isShown + + + SDWebImage.xcscheme + + isShown + + + SIAlertView.xcscheme + + isShown + + + Unirest.xcscheme + + isShown + + + + SuppressBuildableAutocreation + + 4EB392DBB5283EE08DA12AB8336D08CB + + primary + + + 4FC57AD0A574066CF6D2C2D9857A50F7 + + primary + + + 569735B422E0E4CEEFC5C6955AFDE3A5 + + primary + + + 64652363A141271942BD6F746781173D + + primary + + + 6B0B9C928B05BA6346AB032DD0260C56 + + primary + + + 9145E070690055EA2D82D264E78B0F71 + + primary + + + 928353533005A4198EBDA5B700D37B64 + + primary + + + A5620D90C319CE08C7E4BD86A7665AEF + + primary + + + DB01679F34E5831762A89315547D9445 + + primary + + + F86F3D4C7C4CF4BC533F12010483E3EB + + primary + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/AFNetworking.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/AFNetworking.xcscheme new file mode 100644 index 0000000..2391e7c --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/AFNetworking.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/Firebase.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/Firebase.xcscheme new file mode 100644 index 0000000..195ec8c --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/Firebase.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/FoldingTabBar.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/FoldingTabBar.xcscheme new file mode 100644 index 0000000..d296108 --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/FoldingTabBar.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/HSDatePickerViewController.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/HSDatePickerViewController.xcscheme new file mode 100644 index 0000000..3788f19 --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/HSDatePickerViewController.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/NSDate+RelativeTime.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/NSDate+RelativeTime.xcscheme new file mode 100644 index 0000000..84ba8ad --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/NSDate+RelativeTime.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/Pods.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/Pods.xcscheme new file mode 100644 index 0000000..021b8cf --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/Pods.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/RSBarcodes.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/RSBarcodes.xcscheme new file mode 100644 index 0000000..cf2c982 --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/RSBarcodes.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/SDWebImage.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/SDWebImage.xcscheme new file mode 100644 index 0000000..3901d43 --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/SDWebImage.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/SIAlertView.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/SIAlertView.xcscheme new file mode 100644 index 0000000..3cdfc5a --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/SIAlertView.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/TFBarcodeScanner.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/TFBarcodeScanner.xcscheme new file mode 100644 index 0000000..704bfd6 --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/TFBarcodeScanner.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/Unirest.xcscheme b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/Unirest.xcscheme new file mode 100644 index 0000000..996704d --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/Unirest.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/xcschememanagement.plist b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..31e6494 --- /dev/null +++ b/grocery-objc/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,161 @@ + + + + + SchemeUserState + + AFNetworking.xcscheme + + orderHint + 6 + + Firebase.xcscheme + + orderHint + 3 + + FoldingTabBar.xcscheme + + orderHint + 7 + + HSDatePickerViewController.xcscheme + + orderHint + 4 + + NSDate+RelativeTime.xcscheme + + orderHint + 5 + + Pods.xcscheme + + isShown + + orderHint + 1 + + RSBarcodes.xcscheme + + orderHint + 10 + + SDWebImage.xcscheme + + orderHint + 8 + + SIAlertView.xcscheme + + orderHint + 11 + + TFBarcodeScanner.xcscheme + + orderHint + 9 + + Unirest.xcscheme + + isShown + + orderHint + 2 + + + SuppressBuildableAutocreation + + 1820533B25A5682E2B3DDCBE6B35FED5 + + primary + + + 1E21AC36A85D48283C5B95AFB51211FE + + primary + + + 4BE08790DE00004E1ED3C0CFB6CE9370 + + primary + + + 4EB392DBB5283EE08DA12AB8336D08CB + + primary + + + 4FC57AD0A574066CF6D2C2D9857A50F7 + + primary + + + 569735B422E0E4CEEFC5C6955AFDE3A5 + + primary + + + 64652363A141271942BD6F746781173D + + primary + + + 6B0B9C928B05BA6346AB032DD0260C56 + + primary + + + 7300726BC287BAA299C777A9246E2671 + + primary + + + 7E3B9349B9F00257BC59BA86B7B0BDFF + + primary + + + 9145E070690055EA2D82D264E78B0F71 + + primary + + + 928353533005A4198EBDA5B700D37B64 + + primary + + + 98C445AE8FC6CABC41A4DB4D7F966BD2 + + primary + + + A5620D90C319CE08C7E4BD86A7665AEF + + primary + + + DB01679F34E5831762A89315547D9445 + + primary + + + EB2707AC41F952C9106551D1C3340BB8 + + primary + + + EC0AAC3690B197E00009BBD3D868A1EA + + primary + + + F86F3D4C7C4CF4BC533F12010483E3EB + + primary + + + + + diff --git a/grocery-objc/Pods/RSBarcodes/LICENSE.md b/grocery-objc/Pods/RSBarcodes/LICENSE.md new file mode 100644 index 0000000..b8583b7 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2012-2014 P.D.Q. + +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. diff --git a/grocery-objc/Pods/RSBarcodes/README.md b/grocery-objc/Pods/RSBarcodes/README.md new file mode 100644 index 0000000..56a4d89 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/README.md @@ -0,0 +1,153 @@ +RSBarcodes [![Build Status](https://travis-ci.org/yeahdongcn/RSBarcodes.png)](https://travis-ci.org/yeahdongcn/RSBarcodes) +========== +[![Total views](https://sourcegraph.com/api/repos/github.com/yeahdongcn/RSBarcodes/counters/views.png)](https://sourcegraph.com/github.com/yeahdongcn/RSBarcodes) +[![Views in the last 24 hours](https://sourcegraph.com/api/repos/github.com/yeahdongcn/RSBarcodes/counters/views-24h.png)](https://sourcegraph.com/github.com/yeahdongcn/RSBarcodes) + +* Now Swift. [RSBarcodes_Swift](https://github.com/yeahdongcn/RSBarcodes_Swift) + +RSBarcodes allows you to scan 1D and 2D barcodes using metadata scanning capabilities introduced with iOS7 and generate the same set of barcode images for displaying and sharing. PR from MacMannes has been merged to make a part of code generators working on iOS5.1 above. + +Current Status +------------ +###Barcode Scanner: + Multiple corners and border rectangles display view -- Done + Manually changing focus point -- Done + Focus mark drawing -- Done + +###Barcode Generators: + "org.gs1.UPC-E", -- Done + "org.iso.Code39", -- Done + "org.iso.Code39Mod43", -- Done + "org.gs1.EAN-13", -- Done by 张玺 (http://zhangxi.me) + "org.gs1.EAN-8", -- Done by 张玺 (http://zhangxi.me) + "com.intermec.Code93", -- Done + "org.iso.Code128", -- Done + "org.iso.PDF417", -- Done + "org.iso.QRCode", -- Done + "org.iso.Aztec", -- Done + "org.ansi.Interleaved2of5", -- Done + "org.gs1.ITF14", -- Done + // -------------------- + Extended Code 39, -- Done + ISBN13, -- Done + ISSN13, -- Done + ITF14, -- Done + + Code display view -- Done + +Installation +------------ +CocoaPods is the recommended method of installing RSBarcodes. + +Simply add the following line to your `Podfile`: + + pod 'RSBarcodes', '~> 0.1.3' + +Or you can use the **RSBarcodes framework** without import all headers files. + +Just imports these frameworks: + +RSBarcodes.framework (it's under the product folder of this project) :) +AVFoundation.framework +CoreImage.framework +CoreGraphics.framework + +When you use the framework you must import the headers like below: + + #import + +`RSCodeView.h` and `RSCodeGen.h` are already imported into the `RSBarcodes.h` so you can use directly + + #import + +Thanks to g8production [www.g8production.com](http://www.g8production.com) [github](https://github.com/gali8) for providing this. + +Usage +------------ +###Barcode Scanner: + +####Option 1: + +Create `RSScannerViewController` from code an present it. Use the callback block to process the barcode. + + (id)initWithCornerView:(BOOL)showCornerView controlView:(BOOL)showControlsView barcodesHandler:(RSBarcodesHandler)barcodesHandler; + (id)initWithCornerView:(BOOL)showCornerView controlView:(BOOL)showControlsView barcodesHandler:(RSBarcodesHandler)barcodesHandler preferredCameraPosition:(AVCaptureDevicePosition)cameraDevicePosition; + +You can add borders to the button with: `[scanner setIsButtonBordersVisible:YES];` +You can automatically stop the processing after the first vaild barcode with `[scanner setStopOnFirst:YES];` +After that you can either dismiss it, or restart it with `[scanner __startRunning]`; + +possible Device Positions: AVCaptureDevicePositionBack, AVCaptureDevicePositionFront + + RSScannerViewController *scanner = [[RSScannerViewController alloc] initWithCornerView:YES + controlView:YES + barcodesHandler:^(NSArray *barcodeObjects) { + } + preferredCameraPosition:AVCaptureDevicePositionBack]; + [self presentViewController:scanner animated:true completion:nil]; + +####Option 2: + +Place a `UIViewController` in storyboard and set `RSScannerViewController` based class as its custom class. If you want to use the corners view (for barcode corners and borders displaying), you can put a `UIView` onto the view controller’s view and set `RSCornersView` as its custom class then link the `highlightView` to it, make sure the view’s size is as large as the view controller’s view. + +In `RSScannerViewController` based class implements your own handler. + + - (id)initWithCoder:(NSCoder *)aDecoder + { + self = [super initWithCoder:aDecoder]; + if (self) { + __weak typeof(self) weakSelf = self; + self.barcodesHandler = ^(NSArray *barcodeObjects) { + }; + self.tapGestureHandler = ^(CGPoint tapPoint) { + }); + } + return self; + } + +###Barcode Generators: + +Import `RSCodeGen.h` into your source file and using `CodeGen` to generate barcode image. RSBarcodes provides 2 ways. + + @protocol RSCodeGenerator + + - (UIImage *)genCodeWithMachineReadableCodeObject:(AVMetadataMachineReadableCodeObject *)machineReadableCodeObject; + + - (UIImage *)genCodeWithContents:(NSString *)contents machineReadableCodeObjectType:(NSString *)type; + + @end + +Here are examples, the generated image could be used along with `RSCodeView` or `UIImageView`. + + [CodeGen genCodeWithContents:<#(NSString *)#> machineReadableCodeObjectType:<#(NSString *)#>] // Types are coming from AVMetadataObject.h and RSCodeGen.h + +or + + [CodeGen genCodeWithMachineReadableCodeObject:<#(AVMetadataMachineReadableCodeObject *)#>] + +License +------------ + The MIT License (MIT) + + Copyright (c) 2012-2014 P.D.Q. + + 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. + +------------ +[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/yeahdongcn/rsbarcodes/trend.png)](https://bitdeli.com/free "Bitdeli Badge") + diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSBarcodes.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSBarcodes.h new file mode 100644 index 0000000..6c6d26a --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSBarcodes.h @@ -0,0 +1,25 @@ +// +// RSBarCodes.h +// RSBarcodes +// +// Created by Daniele on 21/03/14. +// Copyright (c) 2014 P.D.Q. All rights reserved. +// + +/** + * Use this header file to import everything from RSBarcodes + */ + +#import + +#ifndef _RSBARCODES_ +#define _RSBARCODES_ + +#pragma mark - Generator +#import "RSCodeView.h" +#import "RSCodeGen.h" + +#pragma mark - Scanner +#import "RSCornersView.h" +#import "RSScannerViewController.h" +#endif /* _RSBARCODES_ */ \ No newline at end of file diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode128Generator.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode128Generator.h new file mode 100644 index 0000000..f7e2295 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode128Generator.h @@ -0,0 +1,28 @@ +// +// RSCode128Generator.h +// RSBarcodes +// +// Created by R0CKSTAR on 12/30/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import "RSCodeGenerator.h" + +typedef NS_ENUM(NSUInteger, RSCode128GeneratorCodeTable) { + RSCode128GeneratorCodeTableAuto = 0, + RSCode128GeneratorCodeTableA = 1, + RSCode128GeneratorCodeTableB = 2, + RSCode128GeneratorCodeTableC = 3 +}; + +/** + * http://www.barcodeisland.com/code128.phtml + * http://courses.cs.washington.edu/courses/cse370/01au/minirproject/BarcodeBattlers/barcodes.html + */ +@interface RSCode128Generator : RSAbstractCodeGenerator + +- (id)initWithContents:(NSString *)contents; + +@property(nonatomic) RSCode128GeneratorCodeTable codeTable; + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode128Generator.m b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode128Generator.m new file mode 100644 index 0000000..835f30e --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode128Generator.m @@ -0,0 +1,432 @@ +// +// RSCode128Generator.m +// RSBarcodes +// +// Created by R0CKSTAR on 12/30/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import "RSCode128Generator.h" + +static NSString *const CODE128_ALPHABET_STRING = +@" !\"#$%&'()*+,-./" +@"0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_'" +@"abcdefghijklmnopqrstuvwxyz{|}~"; + +static NSString *const CODE128_CHARACTER_ENCODINGS[107] = { + @"11011001100", @"11001101100", @"11001100110", @"10010011000", + @"10010001100", @"10001001100", @"10011001000", @"10011000100", + @"10001100100", @"11001001000", @"11001000100", @"11000100100", + @"10110011100", @"10011011100", @"10011001110", @"10111001100", + @"10011101100", @"10011100110", @"11001110010", @"11001011100", + @"11001001110", @"11011100100", @"11001110100", @"11101101110", + @"11101001100", @"11100101100", @"11100100110", @"11101100100", + @"11100110100", @"11100110010", @"11011011000", @"11011000110", + @"11000110110", @"10100011000", @"10001011000", @"10001000110", + @"10110001000", @"10001101000", @"10001100010", @"11010001000", + @"11000101000", @"11000100010", @"10110111000", @"10110001110", + @"10001101110", @"10111011000", @"10111000110", @"10001110110", + @"11101110110", @"11010001110", @"11000101110", @"11011101000", + @"11011100010", @"11011101110", @"11101011000", @"11101000110", + @"11100010110", @"11101101000", @"11101100010", @"11100011010", + @"11101111010", @"11001000010", @"11110001010", @"10100110000", // 64 + // Visible character encoding for code table A ended. + @"10100001100", @"10010110000", @"10010000110", @"10000101100", + @"10000100110", @"10110010000", @"10110000100", @"10011010000", + @"10011000010", @"10000110100", @"10000110010", @"11000010010", + @"11001010000", @"11110111010", @"11000010100", @"10001111010", + @"10100111100", @"10010111100", @"10010011110", @"10111100100", + @"10011110100", @"10011110010", @"11110100100", @"11110010100", + @"11110010010", @"11011011110", @"11011110110", @"11110110110", + @"10101111000", @"10100011110", @"10001011110", + // Visible character encoding for code table B ended. + @"10111101000", @"10111100010", @"11110101000", @"11110100010", + @"10111011110", // to C from A, B (size - 8) + @"10111101110", // to B from A, C (size - 7) + @"11101011110", // to A from B, C (size - 6) + @"11110101110", @"11010000100", // START A (size - 4) + @"11010010000", // START B (size - 3) + @"11010011100", // START C (size - 2) + @"11000111010" // STOP (size - 1) +}; + +@interface RSAutoCodeTable : NSObject + +@property(nonatomic) RSCode128GeneratorCodeTable startCodeTable; + +@property(nonatomic) NSMutableArray *sequence; + +@end + +@implementation RSAutoCodeTable + +- (NSMutableArray *)sequence { + if (!_sequence) { + _sequence = [[NSMutableArray alloc] init]; + } + return _sequence; +} + +@end + +@interface RSCode128Generator () + +@property(nonatomic) NSUInteger codeTableSize; + +@property(nonatomic, strong) RSAutoCodeTable *autoCodeTable; + +@end + +@implementation RSCode128Generator + +- (NSString *)__encodeCharacter:(NSString *)character { + return CODE128_CHARACTER_ENCODINGS[ + [CODE128_ALPHABET_STRING rangeOfString:character].location]; +} + +- (NSUInteger)__startCodeTableValue: +(RSCode128GeneratorCodeTable)startCodeTable { + NSUInteger codeTableValue = 0; + switch (self.autoCodeTable.startCodeTable) { + case RSCode128GeneratorCodeTableA: + codeTableValue = self.codeTableSize - 4; + break; + case RSCode128GeneratorCodeTableB: + codeTableValue = self.codeTableSize - 3; + break; + case RSCode128GeneratorCodeTableC: + codeTableValue = self.codeTableSize - 2; + break; + default: + break; + } + return codeTableValue; +} + +- (NSUInteger)__middleCodeTableValue:(RSCode128GeneratorCodeTable)codeTable { + NSUInteger codeTableValue = 0; + switch (codeTable) { + case RSCode128GeneratorCodeTableA: + codeTableValue = self.codeTableSize - 6; + break; + case RSCode128GeneratorCodeTableB: + codeTableValue = self.codeTableSize - 7; + break; + case RSCode128GeneratorCodeTableC: + codeTableValue = self.codeTableSize - 8; + break; + default: + break; + } + return codeTableValue; +} + +- (void)__calculateContinousDigitsWithContents:(NSString *)contents + defaultCodeTable: +(RSCode128GeneratorCodeTable)defaultCodeTable + continousDigitsRange:(NSRange)range { + NSUInteger currentIndex = range.location + range.length; + BOOL isFinished = NO; + if (currentIndex == contents.length) { + isFinished = YES; + } + + if ((range.location == 0 && range.length >= 4) || + ((range.location > 0 && range.length >= 6))) { + BOOL isOrphanDigitUsed = NO; + + // Use START C when continous digits are found from range.location == 0 + if (range.location == 0) { + self.autoCodeTable.startCodeTable = RSCode128GeneratorCodeTableC; + } else { + if (range.length % 2 == 1) { + NSUInteger digitValue = + [CODE128_ALPHABET_STRING + rangeOfString:[contents + substringWithRange:NSMakeRange(range.location, + 1)]].location; + [self.autoCodeTable.sequence + addObject:[NSNumber numberWithInteger:digitValue]]; + isOrphanDigitUsed = YES; + } + [self.autoCodeTable.sequence + addObject:[NSNumber numberWithInteger: + [self __middleCodeTableValue: + RSCode128GeneratorCodeTableC]]]; + } + + // Insert all xx combinations + for (int i = 0; i < range.length / 2; i++) { + NSUInteger startIndex = range.location + i * 2; + int digitValue = [[contents + substringWithRange:NSMakeRange(isOrphanDigitUsed ? startIndex + 1 + : startIndex, + 2)] intValue]; + [self.autoCodeTable.sequence + addObject:[NSNumber numberWithInt:digitValue]]; + } + + if ((range.length % 2 == 1 && !isOrphanDigitUsed) || !isFinished) { + [self.autoCodeTable.sequence + addObject:[NSNumber numberWithInteger:[self __middleCodeTableValue: + defaultCodeTable]]]; + } + + if (range.length % 2 == 1 && !isOrphanDigitUsed) { + NSUInteger digitValue = + [CODE128_ALPHABET_STRING + rangeOfString:[contents + substringWithRange:NSMakeRange(currentIndex - 1, + 1)]].location; + [self.autoCodeTable.sequence + addObject:[NSNumber numberWithInteger:digitValue]]; + } + + if (!isFinished) { + NSString *character = + [contents substringWithRange:NSMakeRange(currentIndex, 1)]; + NSUInteger characterValue = + [CODE128_ALPHABET_STRING rangeOfString:character].location; + [self.autoCodeTable.sequence + addObject:[NSNumber numberWithInteger:characterValue]]; + } + } else { + for (NSUInteger j = range.location; + j <= (isFinished ? currentIndex - 1 : currentIndex); j++) { + NSUInteger characterValue = + [CODE128_ALPHABET_STRING + rangeOfString:[contents substringWithRange:NSMakeRange(j, 1)]] + .location; + [self.autoCodeTable.sequence + addObject:[NSNumber numberWithInteger:characterValue]]; + } + } +} + +- (void)__calculateAutoCodeTableWithContents:(NSString *)contents { + if (self.codeTable == RSCode128GeneratorCodeTableAuto) { + // Init auto code table when the other code table has not been selected + self.autoCodeTable = [[RSAutoCodeTable alloc] init]; + + // Select the short code table A as default code table + RSCode128GeneratorCodeTable defaultCodeTable = RSCode128GeneratorCodeTableA; + + // Determine whether to use code table B + NSString *CODE128_ALPHABET_STRING_A = + [CODE128_ALPHABET_STRING substringToIndex:64]; + for (int i = 0; i < contents.length; i++) { + if ([CODE128_ALPHABET_STRING_A + rangeOfString:[contents substringWithRange:NSMakeRange(i, 1)]] + .location == NSNotFound && + defaultCodeTable == RSCode128GeneratorCodeTableA) { + defaultCodeTable = RSCode128GeneratorCodeTableB; + break; + } + } + + NSUInteger continousDigitsStartIndex = NSNotFound; + for (int i = 0; i < contents.length; i++) { + NSString *character = [contents substringWithRange:NSMakeRange(i, 1)]; + NSRange continousDigitsRange = NSMakeRange(0, 0); + if ([DIGITS_STRING rangeOfString:character].location == NSNotFound) { + // Non digit found + if (continousDigitsStartIndex != NSNotFound) { + continousDigitsRange = NSMakeRange(continousDigitsStartIndex, + i - continousDigitsStartIndex); + } else { + NSUInteger characterValue = + [CODE128_ALPHABET_STRING rangeOfString:character].location; + [self.autoCodeTable.sequence + addObject:[NSNumber numberWithInteger:characterValue]]; + } + } else { + // Digit found + if (continousDigitsStartIndex == NSNotFound) { + continousDigitsStartIndex = i; + } + if (continousDigitsStartIndex != NSNotFound && i == (contents.length - 1)) { + continousDigitsRange = NSMakeRange(continousDigitsStartIndex, + i - continousDigitsStartIndex + 1); + } + } + + if (continousDigitsRange.length != 0) { + [self __calculateContinousDigitsWithContents:contents + defaultCodeTable:defaultCodeTable + continousDigitsRange:continousDigitsRange]; + continousDigitsStartIndex = NSNotFound; + } else if (continousDigitsStartIndex == contents.length - 1 && continousDigitsRange.length == 0) { + NSUInteger characterValue = + [CODE128_ALPHABET_STRING rangeOfString:character].location; + [self.autoCodeTable.sequence + addObject:[NSNumber numberWithInteger:characterValue]]; + } + } + + if (self.autoCodeTable.startCodeTable == RSCode128GeneratorCodeTableAuto) { + self.autoCodeTable.startCodeTable = defaultCodeTable; + } + } +} + +- (id)initWithContents:(NSString *)contents { + self = [super init]; + if (self) { + self.codeTable = RSCode128GeneratorCodeTableAuto; + self.codeTableSize = + (NSUInteger)(sizeof(CODE128_CHARACTER_ENCODINGS) / sizeof(NSString *)); + } + return self; +} + +- (BOOL)isContentsValid:(NSString *)contents { + if (contents.length > 0) { + for (int i = 0; i < contents.length; i++) { + if ([CODE128_ALPHABET_STRING + rangeOfString:[contents substringWithRange:NSMakeRange(i, 1)]] + .location == NSNotFound) { + return NO; + } + } + switch (self.codeTable) { + case RSCode128GeneratorCodeTableAuto: + [self __calculateAutoCodeTableWithContents:contents]; + return YES; + case RSCode128GeneratorCodeTableA: { + NSString *CODE128_ALPHABET_STRING_A = + [CODE128_ALPHABET_STRING substringToIndex:64]; + for (int i = 0; i < contents.length; i++) { + if ([CODE128_ALPHABET_STRING_A + rangeOfString:[contents substringWithRange:NSMakeRange(i, 1)]] + .location == NSNotFound) { + return NO; + } + } + return YES; + } + case RSCode128GeneratorCodeTableB: + for (int i = 0; i < contents.length; i++) { + if ([CODE128_ALPHABET_STRING + rangeOfString:[contents substringWithRange:NSMakeRange(i, 1)]] + .location == NSNotFound) { + return NO; + } + } + return YES; + case RSCode128GeneratorCodeTableC: + // http://stackoverflow.com/questions/6644004/how-to-check-if-nsstring-is-contains-a-numeric-value + if (contents.length % 2 == 0 && + [contents rangeOfCharacterFromSet: + [[NSCharacterSet decimalDigitCharacterSet] invertedSet]] + .location == NSNotFound) { + return YES; + } + return NO; + default: + return NO; + } + } + return NO; +} + +- (NSString *)initiator { + NSString *initiator = nil; + switch (self.codeTable) { + case RSCode128GeneratorCodeTableAuto: + initiator = CODE128_CHARACTER_ENCODINGS[ + [self __startCodeTableValue:self.autoCodeTable.startCodeTable]]; + break; + case RSCode128GeneratorCodeTableA: + case RSCode128GeneratorCodeTableB: + case RSCode128GeneratorCodeTableC: + default: + initiator = CODE128_CHARACTER_ENCODINGS[ + [self __startCodeTableValue:self.codeTable]]; + break; + } + return initiator; +} + +- (NSString *)terminator { + return [NSString + stringWithFormat:@"%@%@", + CODE128_CHARACTER_ENCODINGS[self.codeTableSize - 1], + @"11"]; +} + +- (NSString *)barcode:(NSString *)contents { + NSMutableString *barcode = [[NSMutableString alloc] initWithString:@""]; + + switch (self.codeTable) { + case RSCode128GeneratorCodeTableAuto: + for (int i = 0; i < self.autoCodeTable.sequence.count; i++) { + [barcode appendString:CODE128_CHARACTER_ENCODINGS[ + [self.autoCodeTable.sequence[i] intValue]]]; + } + break; + case RSCode128GeneratorCodeTableA: + case RSCode128GeneratorCodeTableB: + for (int i = 0; i < contents.length; i++) { + [barcode appendString:[self __encodeCharacter: + [contents substringWithRange:NSMakeRange( + i, 1)]]]; + } + break; + case RSCode128GeneratorCodeTableC: + for (int i = 0; i < contents.length; i++) { + if (i % 2 == 1) { + continue; + } else { + int value = [[contents substringWithRange:NSMakeRange(i, 2)] intValue]; + [barcode appendString:CODE128_CHARACTER_ENCODINGS[value]]; + } + } + break; + } + if ([self respondsToSelector:@selector(checkDigit:)]) { + [barcode appendString:[self checkDigit:contents]]; + } + return [NSString stringWithString:barcode]; +} + +#pragma mark - RSCheckDigitGenerator + +- (NSString *)checkDigit:(NSString *)contents { + int sum = 0; + switch (self.codeTable) { + case RSCode128GeneratorCodeTableAuto: + sum += [self __startCodeTableValue:self.autoCodeTable.startCodeTable]; + for (int i = 0; i < self.autoCodeTable.sequence.count; i++) { + sum += [self.autoCodeTable.sequence[i] intValue] * (i + 1); + } + break; + case RSCode128GeneratorCodeTableA: + sum = -1; // START A = self.codeTableSize - 4 = START B - 1 + case RSCode128GeneratorCodeTableB: + sum += self.codeTableSize - 3; // START B + for (int i = 0; i < contents.length; i++) { + NSUInteger characterValue = + [CODE128_ALPHABET_STRING + rangeOfString:[contents substringWithRange:NSMakeRange(i, 1)]] + .location; + sum += characterValue * (i + 1); + } + break; + case RSCode128GeneratorCodeTableC: + sum += self.codeTableSize - 2; // START C + for (int i = 0; i < contents.length; i++) { + if (i % 2 == 1) { + continue; + } else { + int value = [[contents substringWithRange:NSMakeRange(i, 2)] intValue]; + sum += value * (i / 2 + 1); + } + } + break; + default: + break; + } + return CODE128_CHARACTER_ENCODINGS[sum % 103]; +} + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode39Generator.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode39Generator.h new file mode 100644 index 0000000..d7230a1 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode39Generator.h @@ -0,0 +1,21 @@ +// +// RSCode39Generator.h +// RSBarcodes +// +// Created by R0CKSTAR on 12/25/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import + +#import "RSCodeGenerator.h" + +extern NSString *const CODE39_ALPHABET_STRING; + +/** + * http://www.barcodesymbols.com/code39.htm + * http://www.barcodeisland.com/code39.phtml + */ +@interface RSCode39Generator : RSAbstractCodeGenerator + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode39Generator.m b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode39Generator.m new file mode 100644 index 0000000..76001d3 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode39Generator.m @@ -0,0 +1,67 @@ +// +// RSCode39Generator.m +// RSBarcodes +// +// Created by R0CKSTAR on 12/25/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import "RSCode39Generator.h" + +NSString *const CODE39_ALPHABET_STRING = +@"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%*"; + +static NSString *const CODE39_CHARACTER_ENCODINGS[44] = { + @"1010011011010", @"1101001010110", @"1011001010110", @"1101100101010", + @"1010011010110", @"1101001101010", @"1011001101010", @"1010010110110", + @"1101001011010", @"1011001011010", @"1101010010110", @"1011010010110", + @"1101101001010", @"1010110010110", @"1101011001010", @"1011011001010", + @"1010100110110", @"1101010011010", @"1011010011010", @"1010110011010", + @"1101010100110", @"1011010100110", @"1101101010010", @"1010110100110", + @"1101011010010", @"1011011010010", @"1010101100110", @"1101010110010", + @"1011010110010", @"1010110110010", @"1100101010110", @"1001101010110", + @"1100110101010", @"1001011010110", @"1100101101010", @"1001101101010", + @"1001010110110", @"1100101011010", @"1001101011010", @"1001001001010", + @"1001001010010", @"1001010010010", @"1010010010010", @"1001011011010"}; + +@implementation RSCode39Generator + +- (NSString *)__encodeCharacter:(NSString *)character { + return CODE39_CHARACTER_ENCODINGS[ + [CODE39_ALPHABET_STRING rangeOfString:character].location]; +} + +- (BOOL)isContentsValid:(NSString *)contents { + if (contents.length > 0 && + [contents isEqualToString:[contents uppercaseString]]) { + for (int i = 0; i < contents.length; i++) { + if ([CODE39_ALPHABET_STRING + rangeOfString:[contents substringWithRange:NSMakeRange(i, 1)]] + .location == NSNotFound) { + return NO; + } + } + return YES; + } + return NO; +} + +- (NSString *)initiator { + return [self __encodeCharacter:@"*"]; +} + +- (NSString *)terminator { + return [self __encodeCharacter:@"*"]; +} + +- (NSString *)barcode:(NSString *)contents { + NSMutableString *barcode = [[NSMutableString alloc] initWithString:@""]; + for (int i = 0; i < contents.length; i++) { + [barcode + appendString:[self __encodeCharacter:[contents substringWithRange: + NSMakeRange(i, 1)]]]; + } + return [NSString stringWithString:barcode]; +} + +@end \ No newline at end of file diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode39Mod43Generator.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode39Mod43Generator.h new file mode 100644 index 0000000..fda6c6b --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode39Mod43Generator.h @@ -0,0 +1,17 @@ +// +// RSCode39Mod43Generator.h +// RSBarcodes +// +// Created by R0CKSTAR on 12/26/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import "RSCode39Generator.h" + +/** + * http://www.barcodesymbols.com/code39.htm + * http://www.barcodeisland.com/code39.phtml + */ +@interface RSCode39Mod43Generator : RSCode39Generator + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode39Mod43Generator.m b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode39Mod43Generator.m new file mode 100644 index 0000000..1e7b786 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode39Mod43Generator.m @@ -0,0 +1,49 @@ +// +// RSCode39Mod43Generator.m +// RSBarcodes +// +// Created by R0CKSTAR on 12/26/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import "RSCode39Mod43Generator.h" + +@implementation RSCode39Mod43Generator + +- (NSString *)barcode:(NSString *)contents { + if ([self respondsToSelector:@selector(checkDigit:)]) { + return [super + barcode:[NSString stringWithFormat: + @"%@%@", contents, + [self checkDigit:[contents uppercaseString]]]]; + } else { + return [super barcode:contents]; + } +} + +#pragma mark - RSCheckDigitGenerator + +- (NSString *)checkDigit:(NSString *)contents { + /* + Step 1: From the table below, find the values of each character. + C O D E 3 9 <--Message characters + 12 24 13 14 38 3 9 <--Character values + Step 2: Sum the character values. + 12 + 24 + 13 + 14 + 38 + 3 + 9 = 113 + Step 3: Divide the result by 43. + 113 / 43 = 11 with remainder of 27. + Step 4: From the table, find the character with this value + 27 = R = Check Character + */ + int sum = 0; + for (int i = 0; i < contents.length; i++) { + NSString *character = [contents substringWithRange:NSMakeRange(i, 1)]; + sum += [CODE39_ALPHABET_STRING rangeOfString:character].location; + } + // 43 = CODE39_ALPHABET_STRING's length - 1 -- excludes asterisk + return [CODE39_ALPHABET_STRING + substringWithRange:NSMakeRange(sum % (CODE39_ALPHABET_STRING.length - 1), + 1)]; +} + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode93Generator.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode93Generator.h new file mode 100644 index 0000000..db4bc30 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode93Generator.h @@ -0,0 +1,16 @@ +// +// RSCode93Generator.h +// RSBarcodes +// +// Created by R0CKSTAR on 12/30/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import "RSCodeGenerator.h" + +/** + * http://www.barcodeisland.com/code93.phtml + */ +@interface RSCode93Generator : RSAbstractCodeGenerator + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode93Generator.m b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode93Generator.m new file mode 100644 index 0000000..be13863 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCode93Generator.m @@ -0,0 +1,115 @@ +// +// RSCode93Generator.m +// RSBarcodes +// +// Created by R0CKSTAR on 12/30/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import "RSCode93Generator.h" + +static NSString *const CODE93_ALPHABET_STRING = @"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*"; + +static NSString *const CODE93_PLACEHOLDER_STRING = @"abcd"; + +static NSString *const CODE93_CHARACTER_ENCODINGS[48] = { + @"100010100", @"101001000", @"101000100", @"101000010", @"100101000", + @"100100100", @"100100010", @"101010000", @"100010010", @"100001010", + @"110101000", @"110100100", @"110100010", @"110010100", @"110010010", + @"110001010", @"101101000", @"101100100", @"101100010", @"100110100", + @"100011010", @"101011000", @"101001100", @"101000110", @"100101100", + @"100010110", @"110110100", @"110110010", @"110101100", @"110100110", + @"110010110", @"110011010", @"101101100", @"101100110", @"100110110", + @"100111010", @"100101110", @"111010100", @"111010010", @"111001010", + @"101101110", @"101110110", @"110101110", @"100100110", @"111011010", + @"111010110", @"100110010", @"101011110"}; + +@implementation RSCode93Generator + +- (NSString *)__encodeCharacter:(NSString *)character { + return CODE93_CHARACTER_ENCODINGS[ + [CODE93_ALPHABET_STRING rangeOfString:character].location]; +} + +- (BOOL)isContentsValid:(NSString *)contents { + if (contents.length > 0 && + [contents isEqualToString:[contents uppercaseString]]) { + for (int i = 0; i < contents.length; i++) { + if ([CODE93_ALPHABET_STRING + rangeOfString:[contents substringWithRange:NSMakeRange(i, 1)]] + .location == NSNotFound) { + return NO; + } + if ([CODE93_PLACEHOLDER_STRING + rangeOfString:[contents substringWithRange:NSMakeRange(i, 1)]] + .location != NSNotFound) { + return NO; + } + } + return YES; + } + return NO; +} + +- (NSString *)initiator { + return [self __encodeCharacter:@"*"]; +} + +- (NSString *)terminator { + // With the termination bar: 1 + return + [NSString stringWithFormat:@"%@%@", [self __encodeCharacter:@"*"], @"1"]; +} + +- (NSString *)barcode:(NSString *)contents { + NSMutableString *barcode = [[NSMutableString alloc] initWithString:@""]; + for (int i = 0; i < contents.length; i++) { + [barcode + appendString:[self __encodeCharacter:[contents substringWithRange: + NSMakeRange(i, 1)]]]; + } + if ([self respondsToSelector:@selector(checkDigit:)]) { + NSString *checkDigits = [self checkDigit:contents]; + for (int i = 0; i < checkDigits.length; i++) { + [barcode + appendString:[self __encodeCharacter: + [checkDigits + substringWithRange:NSMakeRange(i, 1)]]]; + } + } + return [NSString stringWithString:barcode]; +} + +#pragma mark - RSCheckDigitGenerator + +- (NSString *)checkDigit:(NSString *)contents { + // Weighted sum += value * weight + + // The first character + int sum = 0; + for (int i = 0; i < contents.length; i++) { + NSString *character = [contents substringWithRange:NSMakeRange(contents.length - i - 1, 1)]; + NSUInteger characterValue = + [CODE93_ALPHABET_STRING rangeOfString:character].location; + sum += characterValue * (i % 20 + 1); + } + NSMutableString *checkDigits = [[NSMutableString alloc] init]; + [checkDigits appendString:[CODE93_ALPHABET_STRING + substringWithRange:NSMakeRange(sum % 47, 1)]]; + + // The second character + sum = 0; + NSString *newContents = + [NSString stringWithFormat:@"%@%@", contents, checkDigits]; + for (int i = 0; i < newContents.length; i++) { + NSString *character = [newContents substringWithRange:NSMakeRange(newContents.length - i - 1, 1)]; + NSUInteger characterValue = + [CODE93_ALPHABET_STRING rangeOfString:character].location; + sum += characterValue * (i % 15 + 1); + } + [checkDigits appendString:[CODE93_ALPHABET_STRING + substringWithRange:NSMakeRange(sum % 47, 1)]]; + return [NSString stringWithString:checkDigits]; +} + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCodeGen.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCodeGen.h new file mode 100644 index 0000000..bb7be2d --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCodeGen.h @@ -0,0 +1,21 @@ +// +// RSCodeGen.h +// RSBarcodes +// +// Created by R0CKSTAR on 12/25/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import + +#import "RSUnifiedCodeGenerator.h" + +#import "RSExtendedCode39Generator.h" + +#import "RSISBN13Generator.h" + +#import "RSISSN13Generator.h" + +#import "RSITF14Generator.h" + +#define CodeGen [RSUnifiedCodeGenerator codeGen] diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCodeGenerator.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCodeGenerator.h new file mode 100644 index 0000000..f8ce3b6 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCodeGenerator.h @@ -0,0 +1,145 @@ +// +// RSCodeGenerator.h +// RSBarcodes +// +// Created by R0CKSTAR on 12/25/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import + +#import + +/** + * Code generators are required to provide these two functions. + */ +@protocol RSCodeGenerator + +@required + +- (UIImage *)genCodeWithMachineReadableCodeObject: +(AVMetadataMachineReadableCodeObject *)machineReadableCodeObject; + +- (UIImage *)genCodeWithContents:(NSString *)contents + machineReadableCodeObjectType:(NSString *)type; + +/** The fill (background) color of the generated barcode. */ +@property (nonatomic, strong) UIColor *fillColor; + +/** The stroke color of the generated barcode. */ +@property (nonatomic, strong) UIColor *strokeColor; + +@end + +/** + * Check digit are not required for all code generators. + * UPC-E is using check digit to valid the contents to be encoded. + * Code39Mod43, Code93 and Code128 is using check digit to encode barcode. + */ +@protocol RSCheckDigitGenerator + +@optional + +- (NSString *)checkDigit:(NSString *)contents; + +@end + +extern NSString *const DIGITS_STRING; + +/** + * Abstract code generator, provides default functions for validations and + * generations. + */ +@interface RSAbstractCodeGenerator : NSObject + +/** + * Check whether the given contents are valid. + * + * @param contents Contents to be encoded. + * + * @return + */ +- (BOOL)isContentsValid:(NSString *)contents; + +/** + * Barcode initiator, subclass should return its own value. + * + * @return + */ +- (NSString *)initiator; + +/** + * Barcode terminator, subclass should return its own value. + * + * @return + */ +- (NSString *)terminator; + +/** + * Barcode content, subclass should return its own value. + * + * @return + */ +- (NSString *)barcode:(NSString *)contents; + +/** + * Composer for combining barcode initiator, contents, terminator together. + * + * @param barcode Encoded barcode contents + * + * @return Completed barcode + */ +- (NSString *)completeBarcode:(NSString *)barcode; + +/** + * Drawer for completed barcode + * + * @param code Completed barcode + * + * @return Encoded image. + */ +- (UIImage *)drawCompleteBarcode:(NSString *)code; + +@end + +static inline NSString *getFilterName(NSString *codeObjectType) { + if ([codeObjectType isEqualToString:AVMetadataObjectTypeQRCode]) { + return @"CIQRCodeGenerator"; + } else if ([codeObjectType isEqualToString:AVMetadataObjectTypePDF417Code]) { + return @"CIPDF417BarcodeGenerator"; + } else if ([codeObjectType isEqualToString:AVMetadataObjectTypeAztecCode]) { + return @"CIAztecCodeGenerator"; + } + return nil; +} + +static inline UIImage *genCode(NSString *contents, NSString *filterName) { + CIFilter *filter = [CIFilter filterWithName:filterName]; + [filter setDefaults]; + NSData *data = [contents dataUsingEncoding:NSUTF8StringEncoding]; + [filter setValue:data forKey:@"inputMessage"]; + + CIImage *outputImage = [filter outputImage]; + CIContext *context = [CIContext contextWithOptions:nil]; + CGImageRef cgImage = + [context createCGImage:outputImage fromRect:[outputImage extent]]; + UIImage *image = [UIImage imageWithCGImage:cgImage + scale:1 + orientation:UIImageOrientationUp]; + CGImageRelease(cgImage); + return image; +} + +static inline UIImage *resizeImage(UIImage *source, float scale) { + CGFloat width = source.size.width * scale; + CGFloat height = source.size.height * scale; + + UIGraphicsBeginImageContext(CGSizeMake(width, height)); + CGContextRef context = UIGraphicsGetCurrentContext(); + CGContextSetInterpolationQuality(context, kCGInterpolationNone); + [source drawInRect:CGRectMake(0, 0, width, height)]; + UIImage *target = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + + return target; +} diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCodeGenerator.m b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCodeGenerator.m new file mode 100644 index 0000000..c04345e --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCodeGenerator.m @@ -0,0 +1,113 @@ +// +// RSCodeGenerator.m +// RSBarcodes +// +// Created by R0CKSTAR on 12/25/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import "RSCodeGenerator.h" + +@implementation RSAbstractCodeGenerator + +@synthesize strokeColor = _strokeColor, fillColor = _fillColor; + +NSString *const DIGITS_STRING = @"0123456789"; + +- (BOOL)isContentsValid:(NSString *)contents { + if (contents.length > 0) { + for (int i = 0; i < contents.length; i++) { + if ([DIGITS_STRING + rangeOfString:[contents substringWithRange:NSMakeRange(i, 1)]] + .location == NSNotFound) { + return NO; + } + } + return YES; + } + return NO; +} + +- (NSString *)initiator { + return @""; +} + +- (NSString *)terminator { + return @""; +} + +- (NSString *)barcode:(NSString *)contents { + return @""; +} + +- (NSString *)completeBarcode:(NSString *)barcode { + return [NSString + stringWithFormat:@"%@%@%@", [self initiator], barcode, [self terminator]]; +} + +- (UIImage *)drawCompleteBarcode:(NSString *)code { + if (code.length <= 0) { + return nil; + } + + // Values taken from CIImage generated AVMetadataObjectTypePDF417Code type + // image + // Top spacing = 1.5 + // Bottom spacing = 2 + // Left & right spacing = 2 + // Height = 28 + CGSize size = CGSizeMake(code.length + 4, 28); + UIGraphicsBeginImageContextWithOptions(size, NO, 0); + CGContextRef context = UIGraphicsGetCurrentContext(); + + CGContextSetShouldAntialias(context, false); + + if (!self.fillColor) { + self.fillColor = [UIColor whiteColor]; + } + + if (!self.strokeColor) { + self.strokeColor = [UIColor blackColor]; + } + + [self.fillColor setFill]; + [self.strokeColor setStroke]; + + CGContextFillRect(context, CGRectMake(0, 0, size.width, size.height)); + CGContextSetLineWidth(context, 1); + + for (int i = 0; i < code.length; i++) { + NSString *character = [code substringWithRange:NSMakeRange(i, 1)]; + if ([character isEqualToString:@"1"]) { + CGContextMoveToPoint(context, i + (2 + 1), 1.5); + CGContextAddLineToPoint(context, i + (2 + 1), size.height - 2); + } + } + CGContextDrawPath(context, kCGPathFillStroke); + + UIImage *barcode = UIGraphicsGetImageFromCurrentImageContext(); + + UIGraphicsEndImageContext(); + + return barcode; +} + +#pragma mark - RSCodeGenerator + +- (UIImage *)genCodeWithContents:(NSString *)contents + machineReadableCodeObjectType:(NSString *)type { + if ([self isContentsValid:contents]) { + return [self + drawCompleteBarcode:[self completeBarcode:[self barcode:contents]]]; + } + return nil; +} + +- (UIImage *)genCodeWithMachineReadableCodeObject: +(AVMetadataMachineReadableCodeObject *) +machineReadableCodeObject { + return [self genCodeWithContents:[machineReadableCodeObject stringValue] + machineReadableCodeObjectType:[machineReadableCodeObject type]]; +} + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCodeView.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCodeView.h new file mode 100644 index 0000000..740a64e --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCodeView.h @@ -0,0 +1,17 @@ +// +// RSCodeView.h +// RSBarcodes +// +// Created by R0CKSTAR on 12/25/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import + +@interface RSCodeView : UIView + +@property(nonatomic, strong) UIImage *code; + +@property(nonatomic, strong) NSString *contents; + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCodeView.m b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCodeView.m new file mode 100644 index 0000000..4df512b --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCodeView.m @@ -0,0 +1,64 @@ +// +// RSCodeView.m +// RSBarcodes +// +// Created by R0CKSTAR on 12/25/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import "RSCodeView.h" + +@implementation RSCodeView + +- (void)__init { + self.backgroundColor = [UIColor clearColor]; + + self.layer.borderWidth = 1; + self.layer.borderColor = [[UIColor greenColor] CGColor]; +} + +- (id)init { + self = [super init]; + if (self) { + [self __init]; + } + return self; +} + +- (id)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self __init]; + } + return self; +} + +- (id)initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + if (self) { + [self __init]; + } + return self; +} + +- (void)setCode:(UIImage *)code { + _code = code; + + dispatch_async(dispatch_get_main_queue(), ^{ [self setNeedsDisplay]; }); +} + +- (void)drawRect:(CGRect)rect { + if (!_code) { + return; + } + + CGContextRef context = UIGraphicsGetCurrentContext(); + + CGContextSaveGState(context); + + CGContextDrawImage(context, self.bounds, [self.code CGImage]); + + CGContextRestoreGState(context); +} + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCornersView.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCornersView.h new file mode 100644 index 0000000..3af05a2 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCornersView.h @@ -0,0 +1,31 @@ +// +// RSCornersView.h +// RSBarcodes +// +// Created by R0CKSTAR on 12/19/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import + +@interface RSCornersView : UIView + +@property(nonatomic, strong) NSArray *cornersArray; + +@property(nonatomic, strong) NSArray *borderRectArray; + +@property(nonatomic, copy) UIColor *strokeColor; // Default is green + +@property(nonatomic) float strokeWidth; // Default is 2 + +@property(nonatomic) CGPoint focusPoint; + +@property(nonatomic) CGSize focusSize; // Default is CGSizeMake(100, 100) + +@property(nonatomic, copy) UIColor *focusStrokeColor; // Default is orange + +@property(nonatomic) float focusStrokeWidth; // Default is 1 + +@property(nonatomic) double focusMarkDisplayingDuration; // Default is 1 + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCornersView.m b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCornersView.m new file mode 100644 index 0000000..b42949f --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSCornersView.m @@ -0,0 +1,254 @@ +// +// RSCornersView.m +// RSBarcodes +// +// Created by R0CKSTAR on 12/19/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import "RSCornersView.h" + +@interface RSCornersView () + +@property(nonatomic) BOOL shouldDrawFocusMark; + +@end + +@implementation RSCornersView + +- (void)__init { + self.backgroundColor = [UIColor clearColor]; + + self.focusPoint = self.center; + self.focusSize = CGSizeMake(100.f, 100.f); + self.focusStrokeColor = [UIColor orangeColor]; + self.focusStrokeWidth = 1.f; + self.focusMarkDisplayingDuration = 1; + + self.strokeColor = [UIColor greenColor]; + self.strokeWidth = 2.f; +} + +- (void)__drawFocusMark { + if (!self.shouldDrawFocusMark) { + return; + } + + CGContextRef context = UIGraphicsGetCurrentContext(); + + CGContextSaveGState(context); + + [[UIColor clearColor] setFill]; + [self.focusStrokeColor setStroke]; + + CGContextSetLineWidth(context, self.focusStrokeWidth); + + // Draw rect + CGContextStrokeRect( + context, + CGRectMake(self.focusPoint.x - roundf(self.focusSize.width / 2.f), + self.focusPoint.y - roundf(self.focusSize.height / 2.f), + self.focusSize.width, self.focusSize.height)); + + for (int i = 0; i < 4; i++) { + CGPoint endPoint; + switch (i) { + case 0: + CGContextMoveToPoint( + context, self.focusPoint.x, + self.focusPoint.y - roundf(self.focusSize.height / 2.f)); + endPoint = CGPointMake( + self.focusPoint.x, + self.focusPoint.y - roundf(self.focusSize.height / 2.f) + 10); + break; + case 1: + CGContextMoveToPoint( + context, self.focusPoint.x, + self.focusPoint.y + roundf(self.focusSize.height / 2.f)); + endPoint = CGPointMake( + self.focusPoint.x, + self.focusPoint.y + roundf(self.focusSize.height / 2.f) - 10); + break; + case 2: + CGContextMoveToPoint( + context, self.focusPoint.x - roundf(self.focusSize.width / 2.f), + self.focusPoint.y); + endPoint = CGPointMake( + self.focusPoint.x - roundf(self.focusSize.width / 2.f) + 10, + self.focusPoint.y); + break; + case 3: + CGContextMoveToPoint( + context, self.focusPoint.x + roundf(self.focusSize.width / 2.f), + self.focusPoint.y); + endPoint = CGPointMake( + self.focusPoint.x + roundf(self.focusSize.width / 2.f) - 10, + self.focusPoint.y); + break; + } + CGContextAddLineToPoint(context, endPoint.x, endPoint.y); + } + + CGContextDrawPath(context, kCGPathFillStroke); + + CGContextRestoreGState(context); +} + +- (void)__drawCorners:(NSArray *)corners { + if (!corners) { + return; + } + + if (corners.count <= 1) { + return; + } + + CGContextRef context = UIGraphicsGetCurrentContext(); + + CGContextSaveGState(context); + + [[UIColor clearColor] setFill]; + [self.strokeColor setStroke]; + + CGContextSetLineWidth(context, self.strokeWidth); + + NSValue *startPointValue = corners[0]; + CGPoint startPoint = [startPointValue CGPointValue]; + CGContextMoveToPoint(context, startPoint.x, startPoint.y); + + for (int i = 1; i <= corners.count; i++) { + int index = i; + if (index == corners.count) { + index = 0; + } + NSValue *pointValue = corners[index]; + CGPoint point = [pointValue CGPointValue]; + CGContextAddLineToPoint(context, point.x, point.y); + } + + CGContextDrawPath(context, kCGPathFillStroke); + + CGContextRestoreGState(context); +} + +- (id)init { + self = [super init]; + if (self) { + [self __init]; + } + return self; +} + +- (id)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self __init]; + } + return self; +} + +- (id)initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + if (self) { + [self __init]; + } + return self; +} + +- (void)setFocusPoint:(CGPoint)focusPoint { + _focusPoint = focusPoint; + + dispatch_async(dispatch_get_main_queue(), ^{ + _shouldDrawFocusMark = YES; + [self setNeedsDisplay]; + }); + + dispatch_time_t popTime = + dispatch_time(DISPATCH_TIME_NOW, + (int64_t)(self.focusMarkDisplayingDuration * NSEC_PER_SEC)); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void) { + _shouldDrawFocusMark = NO; + [self setNeedsDisplay]; + }); +} + +- (void)setCornersArray:(NSArray *)cornersArray { + if (cornersArray.count > 0) { + NSMutableArray *outerArray = + [[NSMutableArray alloc] initWithCapacity:cornersArray.count]; + for (NSArray *corners in cornersArray) { + NSMutableArray *innerArray = [[NSMutableArray alloc] init]; + for (NSDictionary *corner in corners) { + [innerArray + addObject:[NSValue + valueWithCGPoint: + CGPointMake( + [[corner objectForKey:@"X"] floatValue], + [[corner objectForKey:@"Y"] floatValue])]]; + } + [outerArray addObject:[NSArray arrayWithArray:innerArray]]; + } + + _cornersArray = [NSArray arrayWithArray:outerArray]; + } else { + _cornersArray = nil; + } + + dispatch_async(dispatch_get_main_queue(), ^{ [self setNeedsDisplay]; }); +} + +- (void)setBorderRectArray:(NSArray *)borderRectArray { + if (borderRectArray.count > 0) { + NSMutableArray *outerArray = + [[NSMutableArray alloc] initWithCapacity:borderRectArray.count]; + for (NSValue *borderRectValue in borderRectArray) { + CGRect borderRect = [borderRectValue CGRectValue]; + if (!CGRectEqualToRect(borderRect, CGRectZero)) { + NSMutableArray *innerArray = + [[NSMutableArray alloc] initWithCapacity:4]; + for (int i = 0; i < 4; i++) { + CGPoint corner = CGPointZero; + if (i == 0) { + corner = CGPointMake(borderRect.origin.x, borderRect.origin.y); + } else if (i == 1) { + corner = CGPointMake(borderRect.origin.x + borderRect.size.width, + borderRect.origin.y); + } else if (i == 2) { + corner = CGPointMake(borderRect.origin.x + borderRect.size.width, + borderRect.origin.y + borderRect.size.height); + } else if (i == 3) { + corner = CGPointMake(borderRect.origin.x, + borderRect.origin.y + borderRect.size.height); + } + [innerArray + addObject:[NSValue + valueWithCGPoint:CGPointMake(corner.x, corner.y)]]; + } + [outerArray addObject:innerArray]; + } + } + _borderRectArray = [NSArray arrayWithArray:outerArray]; + } else { + _borderRectArray = nil; + } + + dispatch_async(dispatch_get_main_queue(), ^{ [self setNeedsDisplay]; }); +} + +- (void)drawRect:(CGRect)rect { + @synchronized(self.cornersArray) { + for (NSArray *corners in self.cornersArray) { + [self __drawCorners:corners]; + } + } + + @synchronized(self.borderRectArray) { + for (NSArray *borders in self.borderRectArray) { + [self __drawCorners:borders]; + } + } + + [self __drawFocusMark]; +} + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSEAN13Generator.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSEAN13Generator.h new file mode 100644 index 0000000..89657a3 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSEAN13Generator.h @@ -0,0 +1,17 @@ +// +// RSEAN13Generator.h +// RSBarcodes +// +// Created by zhangxi on 13-12-26. +// http://zhangxi.me +// Copyright (c) 2013年 P.D.Q. All rights reserved. +// + +#import "RSEANGenerator.h" + +/** + * http://blog.sina.com.cn/s/blog_4015406e0100bsqk.html + */ +@interface RSEAN13Generator : RSEANGenerator + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSEAN13Generator.m b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSEAN13Generator.m new file mode 100644 index 0000000..c0cc026 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSEAN13Generator.m @@ -0,0 +1,22 @@ +// +// RSEAN13Generator.m +// RSBarcodes +// +// Created by zhangxi on 13-12-26. +// http://zhangxi.me +// Copyright (c) 2013年 P.D.Q. All rights reserved. +// + +#import "RSEAN13Generator.h" + +@implementation RSEAN13Generator + +- (id)init { + self = [super init]; + if (self) { + self.length = 13; + } + return self; +} + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSEAN8Generator.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSEAN8Generator.h new file mode 100644 index 0000000..8bb30f9 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSEAN8Generator.h @@ -0,0 +1,14 @@ +// +// RSEAN8Generator.h +// RSBarcodes +// +// Created by zhangxi on 13-12-26. +// http://zhangxi.me +// Copyright (c) 2013年 P.D.Q. All rights reserved. +// + +#import "RSEANGenerator.h" + +@interface RSEAN8Generator : RSEANGenerator + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSEAN8Generator.m b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSEAN8Generator.m new file mode 100644 index 0000000..c875d3f --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSEAN8Generator.m @@ -0,0 +1,22 @@ +// +// RSEAN8Generator.m +// RSBarcodes +// +// Created by zhangxi on 13-12-26. +// http://zhangxi.me +// Copyright (c) 2013年 P.D.Q. All rights reserved. +// + +#import "RSEAN8Generator.h" + +@implementation RSEAN8Generator + +- (id)init { + self = [super init]; + if (self) { + self.length = 8; + } + return self; +} + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSEANGenerator.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSEANGenerator.h new file mode 100644 index 0000000..452cc4d --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSEANGenerator.h @@ -0,0 +1,23 @@ +// +// RSEANGenerator.h +// RSBarcodes +// +// Created by zhangxi on 14-1-6. +// http://zhangxi.me +// Copyright (c) 2014年 P.D.Q. All rights reserved. +// + +#import "RSCodeGenerator.h" + +/** + * Base class for EAN8 and EAN13 + */ +@interface RSEANGenerator : RSAbstractCodeGenerator + +@property(nonatomic) int length; + +@property(nonatomic, readonly) NSArray *lefthandParities; + +@property(nonatomic, readonly) NSArray *parityEncodingTable; + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSEANGenerator.m b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSEANGenerator.m new file mode 100644 index 0000000..d3cec01 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSEANGenerator.m @@ -0,0 +1,118 @@ +// +// RSEANGenerator.m +// RSEarcodes +// +// Created by zhangxi on 14-1-6. +// http://zhangxi.me +// Copyright (c) 2014年 P.D.Q. All rights reserved. +// + +#import "RSEANGenerator.h" + +@interface RSEANGenerator () + +@property(nonatomic, strong) NSArray *lefthandParities; + +@property(nonatomic, strong) NSArray *parityEncodingTable; + +@end + +@implementation RSEANGenerator + +- (NSString *)__centerGuardPattern { + return @"01010"; +} + +- (id)init { + self = [super init]; + if (self) { + // 'O' for odd and 'E' for even + self.lefthandParities = @[ + @"OOOOOO", + @"OOEOEE", + @"OOEEOE", + @"OOEEEO", + @"OEOOEE", + @"OEEOOE", + @"OEEEOO", + @"OEOEOE", + @"OEOEEO", + @"OEEOEO" + ]; + + // 'R' for right-hand + self.parityEncodingTable = @[ + @{@"O" : @"0001101", @"E" : @"0100111", @"R" : @"1110010"}, + @{@"O" : @"0011001", @"E" : @"0110011", @"R" : @"1100110"}, + @{@"O" : @"0010011", @"E" : @"0011011", @"R" : @"1101100"}, + @{@"O" : @"0111101", @"E" : @"0100001", @"R" : @"1000010"}, + @{@"O" : @"0100011", @"E" : @"0011101", @"R" : @"1011100"}, + @{@"O" : @"0110001", @"E" : @"0111001", @"R" : @"1001110"}, + @{@"O" : @"0101111", @"E" : @"0000101", @"R" : @"1010000"}, + @{@"O" : @"0111011", @"E" : @"0010001", @"R" : @"1000100"}, + @{@"O" : @"0110111", @"E" : @"0001001", @"R" : @"1001000"}, + @{@"O" : @"0001011", @"E" : @"0010111", @"R" : @"1110100"} + ]; + } + return self; +} + +- (BOOL)isContentsValid:(NSString *)contents { + if ([super isContentsValid:contents] && contents.length == self.length) { + int sum_odd = 0; + int sum_even = 0; + + for (int i = 0; i < (self.length - 1); i++) { + int digit = [[contents substringWithRange:NSMakeRange(i, 1)] intValue]; + if (i % 2 == (self.length == 13 ? 0 : 1)) { + sum_even += digit; + } else { + sum_odd += digit; + } + } + int checkDigit = (10 - (sum_even + sum_odd * 3) % 10) % 10; + return [[contents substringFromIndex:contents.length - 1] intValue] == + checkDigit; + } + return NO; +} + +- (NSString *)initiator { + return @"101"; +} + +- (NSString *)terminator { + return @"101"; +} + +- (NSString *)barcode:(NSString *)contents { + NSString *lefthandParity = @"OOOO"; + if (self.length == 13) { + lefthandParity = + self.lefthandParities[[[contents substringToIndex:1] intValue]]; + contents = [contents substringFromIndex:1]; + } + + NSMutableString *barcode = [[NSMutableString alloc] initWithString:@""]; + for (int i = 0; i < contents.length; i++) { + int digit = [[contents substringWithRange:NSMakeRange(i, 1)] intValue]; + if (i < lefthandParity.length) { + [barcode + appendString:[NSString + stringWithFormat: + @"%@", + self.parityEncodingTable[digit][[lefthandParity + substringWithRange:NSMakeRange(i, 1)]]]]; + if (i == lefthandParity.length - 1) { + [barcode appendString:[self __centerGuardPattern]]; + } + } else { + [barcode appendString:[NSString + stringWithFormat:@"%@", self.parityEncodingTable + [digit][@"R"]]]; + } + } + return [NSString stringWithString:barcode]; +} + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSExtendedCode39Generator.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSExtendedCode39Generator.h new file mode 100644 index 0000000..0f1d297 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSExtendedCode39Generator.h @@ -0,0 +1,19 @@ +// +// RSExtendedCode39Generator.h +// RSBarcodes +// +// Created by R0CKSTAR on 12/26/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import "RSCode39Generator.h" + +extern NSString *const RSMetadataObjectTypeExtendedCode39Code; + +/** + * http://www.barcodesymbols.com/code39.htm + * http://www.barcodeisland.com/code39.phtml + */ +@interface RSExtendedCode39Generator : RSCode39Generator + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSExtendedCode39Generator.m b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSExtendedCode39Generator.m new file mode 100644 index 0000000..600d86b --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSExtendedCode39Generator.m @@ -0,0 +1,210 @@ +// +// RSExtendedCode39Generator.m +// RSBarcodes +// +// Created by R0CKSTAR on 12/26/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import "RSExtendedCode39Generator.h" + +NSString *const RSMetadataObjectTypeExtendedCode39Code = +@"com.pdq.rsbarcodes.code39.ext"; + +@implementation RSExtendedCode39Generator + +- (NSString *)__encodeContents:(NSString *)contents { + NSMutableString *newContents = [[NSMutableString alloc] initWithString:@""]; + for (int i = 0; i < contents.length; i++) { + NSString *character = [contents substringWithRange:NSMakeRange(i, 1)]; + char ch = [character UTF8String][0]; + switch (ch) { + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + [newContents appendFormat:@"%@%@", @"+", [character uppercaseString]]; + break; + + case '!': + [newContents appendFormat:@"%@%@", @"/", @"A"]; + break; + case '"': + [newContents appendFormat:@"%@%@", @"/", @"B"]; + break; + case '#': + [newContents appendFormat:@"%@%@", @"/", @"C"]; + break; + case '$': + [newContents appendFormat:@"%@%@", @"/", @"D"]; + break; + case '%': + [newContents appendFormat:@"%@%@", @"/", @"E"]; + break; + case '&': + [newContents appendFormat:@"%@%@", @"/", @"F"]; + break; + case '\'': + [newContents appendFormat:@"%@%@", @"/", @"G"]; + break; + case '(': + [newContents appendFormat:@"%@%@", @"/", @"H"]; + break; + case ')': + [newContents appendFormat:@"%@%@", @"/", @"I"]; + break; + case '*': + [newContents appendFormat:@"%@%@", @"/", @"J"]; + break; + case '+': + [newContents appendFormat:@"%@%@", @"/", @"K"]; + break; + case ',': + [newContents appendFormat:@"%@%@", @"/", @"L"]; + break; + // - -> /M better to use - + // . -> /N better to use . + case '/': + [newContents appendFormat:@"%@%@", @"/", @"O"]; + break; + // 0 -> /P better to use 0 + // 1 -> /Q better to use 1 + // 2 -> /R better to use 2 + // 3 -> /S better to use 3 + // 4 -> /T better to use 4 + // 5 -> /U better to use 5 + // 6 -> /V better to use 6 + // 7 -> /W better to use 7 + // 8 -> /X better to use 8 + // 9 -> /Y better to use 9 + case ':': + [newContents appendFormat:@"%@%@", @"/", @"Z"]; + break; + + // ESC -> %A + // FS -> %B + // GS -> %C + // RS -> %D + // US -> %E + case ';': + [newContents appendFormat:@"%@%@", @"%", @"F"]; + break; + case '<': + [newContents appendFormat:@"%@%@", @"%", @"G"]; + break; + case '=': + [newContents appendFormat:@"%@%@", @"%", @"H"]; + break; + case '>': + [newContents appendFormat:@"%@%@", @"%", @"I"]; + break; + case '?': + [newContents appendFormat:@"%@%@", @"%", @"J"]; + break; + case '[': + [newContents appendFormat:@"%@%@", @"%", @"K"]; + break; + case '\\': + [newContents appendFormat:@"%@%@", @"%", @"L"]; + break; + case ']': + [newContents appendFormat:@"%@%@", @"%", @"M"]; + break; + case '^': + [newContents appendFormat:@"%@%@", @"%", @"N"]; + break; + case '_': + [newContents appendFormat:@"%@%@", @"%", @"O"]; + break; + case '{': + [newContents appendFormat:@"%@%@", @"%", @"P"]; + break; + case '|': + [newContents appendFormat:@"%@%@", @"%", @"Q"]; + break; + case '}': + [newContents appendFormat:@"%@%@", @"%", @"R"]; + break; + case '~': + [newContents appendFormat:@"%@%@", @"%", @"S"]; + break; + // DEL -> %T + // NUL -> %U + case '@': + [newContents appendFormat:@"%@%@", @"%", @"V"]; + break; + case '`': + [newContents appendFormat:@"%@%@", @"%", @"W"]; + break; + + // SOH -> $A + // STX -> $B + // ETX -> $C + // EOT -> $D + // ENQ -> $E + // ACK -> $F + // BEL -> $G + // BS -> $H + case '\t': + [newContents appendFormat:@"%@%@", @"$", @"I"]; + break; + // LF -> $J + // VT -> $K + // FF -> $L + case '\n': + [newContents appendFormat:@"%@%@", @"$", @"M"]; + break; + // SO -> $N + // SI -> $O + // DLE -> $P + // DC1 -> $Q + // DC2 -> $R + // DC3 -> $S + // DC4 -> $T + // NAK -> $U + // SYN -> $V + // ETB -> $W + // CAN -> $X + // EM -> $Y + // SUB -> $Z + + default: + [newContents appendString:character]; + break; + } + } + + return [NSString stringWithString:newContents]; +} + +- (BOOL)isContentsValid:(NSString *)contents { + return contents.length > 0; +} + +- (NSString *)barcode:(NSString *)contents { + return [super barcode:[self __encodeContents:contents]]; +} + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSISBN13Generator.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSISBN13Generator.h new file mode 100644 index 0000000..ad8b98f --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSISBN13Generator.h @@ -0,0 +1,15 @@ +// +// RSISBN13Generator.h +// RSBarcodes +// +// Created by R0CKSTAR on 14-1-18. +// Copyright (c) 2014年 P.D.Q. All rights reserved. +// + +#import "RSEAN13Generator.h" + +extern NSString *const RSMetadataObjectTypeISBN13Code; + +@interface RSISBN13Generator : RSEAN13Generator + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSISBN13Generator.m b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSISBN13Generator.m new file mode 100644 index 0000000..06a79b7 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSISBN13Generator.m @@ -0,0 +1,21 @@ +// +// RSISBN13Generator.m +// RSBarcodes +// +// Created by R0CKSTAR on 14-1-18. +// Copyright (c) 2014年 P.D.Q. All rights reserved. +// + +#import "RSISBN13Generator.h" + +NSString *const RSMetadataObjectTypeISBN13Code = @"com.pdq.rsbarcodes.isbn13"; + +@implementation RSISBN13Generator + +- (BOOL)isContentsValid:(NSString *)contents { + // http://www.appsbarcode.com/ISBN.php + return [super isContentsValid:contents] && + [[contents substringToIndex:3] isEqualToString:@"978"]; +} + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSISSN13Generator.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSISSN13Generator.h new file mode 100644 index 0000000..fecabad --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSISSN13Generator.h @@ -0,0 +1,15 @@ +// +// RSISSN13Generator.h +// RSBarcodes +// +// Created by R0CKSTAR on 14-1-18. +// Copyright (c) 2014年 P.D.Q. All rights reserved. +// + +#import "RSEAN13Generator.h" + +extern NSString *const RSMetadataObjectTypeISSN13Code; + +@interface RSISSN13Generator : RSEAN13Generator + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSISSN13Generator.m b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSISSN13Generator.m new file mode 100644 index 0000000..eb9e005 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSISSN13Generator.m @@ -0,0 +1,21 @@ +// +// RSISSN13Generator.m +// RSBarcodes +// +// Created by R0CKSTAR on 14-1-18. +// Copyright (c) 2014年 P.D.Q. All rights reserved. +// + +#import "RSISSN13Generator.h" + +NSString *const RSMetadataObjectTypeISSN13Code = @"com.pdq.rsbarcodes.issn13"; + +@implementation RSISSN13Generator + +- (BOOL)isContentsValid:(NSString *)contents { + // http://www.appsbarcode.com/ISSN.php + return [super isContentsValid:contents] && + [[contents substringToIndex:3] isEqualToString:@"977"]; +} + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSITF14Generator.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSITF14Generator.h new file mode 100644 index 0000000..f3cfa9a --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSITF14Generator.h @@ -0,0 +1,17 @@ +// +// RSITF14Generator.h +// RSBarcodesSample +// +// Created by R0CKSTAR on 3/17/14. +// Copyright (c) 2014 P.D.Q. All rights reserved. +// + +#import "RSITFGenerator.h" + +/** + * http://www.gs1au.org/assets/documents/info/user_manuals/barcode_technical_details/ITF_14_Barcode_Structure.pdf + * http://www.barcodeisland.com/int2of5.phtml + */ +@interface RSITF14Generator : RSITFGenerator + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSITF14Generator.m b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSITF14Generator.m new file mode 100644 index 0000000..1846895 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSITF14Generator.m @@ -0,0 +1,17 @@ +// +// RSITF14Generator.m +// RSBarcodesSample +// +// Created by R0CKSTAR on 3/17/14. +// Copyright (c) 2014 P.D.Q. All rights reserved. +// + +#import "RSITF14Generator.h" + +@implementation RSITF14Generator + +- (BOOL)isContentsValid:(NSString *)contents { + return ([super isContentsValid:contents] && [contents length] == 14); +} + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSITFGenerator.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSITFGenerator.h new file mode 100644 index 0000000..219cb3a --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSITFGenerator.h @@ -0,0 +1,14 @@ +// +// RSITFGenerator.h +// RSBarcodesSample +// +// Created by R0CKSTAR on 15/10/19. +// Copyright © 2015年 P.D.Q. All rights reserved. +// + +#import "RSCodeGenerator.h" + +// http://www.barcodeisland.com/int2of5.phtml +@interface RSITFGenerator : RSAbstractCodeGenerator + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSITFGenerator.m b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSITFGenerator.m new file mode 100644 index 0000000..2a5f60a --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSITFGenerator.m @@ -0,0 +1,56 @@ +// +// RSITFGenerator.m +// RSBarcodesSample +// +// Created by R0CKSTAR on 15/10/19. +// Copyright © 2015年 P.D.Q. All rights reserved. +// + +#import "RSITFGenerator.h" + +@implementation RSITFGenerator + +static NSString *const ITF_CHARACTER_ENCODINGS[10] = { + @"00110", @"10001", @"01001", @"11000", @"00101", + @"10100", @"01100", @"00011", @"10010", @"01010", }; + +- (NSString *)initiator { + return @"1010"; +} + +- (NSString *)terminator { + return @"1101"; +} + +- (BOOL)isContentsValid:(NSString *)contents { + return ([super isContentsValid:contents] && [contents length] % 2 == 0); +} + +- (NSString *)barcode:(NSString *)contents { + NSMutableString *barcode = [[NSMutableString alloc] initWithString:@""]; + for (int i = 0; i < contents.length / 2; i++) { + NSString *pair = [contents substringWithRange:NSMakeRange(i * 2, 2)]; + NSString *bars = ITF_CHARACTER_ENCODINGS[[[pair substringWithRange:NSMakeRange(0, 1)] intValue]]; + NSString *spaces = ITF_CHARACTER_ENCODINGS[[[pair substringWithRange:NSMakeRange(1, 1)] intValue]]; + for (int j = 0; j < 10; j++) { + if (j % 2 == 0) { + int bar = [[bars substringWithRange:NSMakeRange(j / 2, 1)] intValue]; + if (bar == 1) { + [barcode appendString:@"11"]; + } else { + [barcode appendString:@"1"]; + } + } else { + int space = [[spaces substringWithRange:NSMakeRange(j / 2, 1)] intValue]; + if (space == 1) { + [barcode appendString:@"00"]; + } else { + [barcode appendString:@"0"]; + } + } + } + } + return [NSString stringWithString:barcode]; +} + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSScannerViewController.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSScannerViewController.h new file mode 100644 index 0000000..c5f6304 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSScannerViewController.h @@ -0,0 +1,76 @@ +// +// RSScannerViewController.h +// RSBarcodes +// +// Created by R0CKSTAR on 12/19/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import +@import AVFoundation; + +#if __IPHONE_OS_VERSION_MIN_REQUIRED < 60000 + +extern NSString *const AVMetadataObjectTypeFace; + +#endif + +@class RSCornersView; + +typedef void (^RSBarcodesHandler)(NSArray *barcodeObjects); + +typedef void (^RSTapGestureHandler)(CGPoint tapPoint); + +@interface RSScannerViewController : UIViewController { +} + +@property(nonatomic) AVCaptureDevicePosition preferredCameraPosition; + +@property(nonatomic) BOOL torchState; + +@property(nonatomic) BOOL stopOnFirst; + +@property(nonatomic, strong) NSArray *barcodeObjectTypes; + +@property(nonatomic, strong) IBOutlet RSCornersView *highlightView; + +@property(nonatomic, strong) IBOutlet UIView *controlsView; + +@property(strong, nonatomic) IBOutlet UIButton *flipButton; + +@property(strong, nonatomic) IBOutlet UIButton *cancelButton; + +@property(strong, nonatomic) IBOutlet UIButton *torchButton; + +@property(strong, nonatomic) IBOutlet UIView *sidebarView; + +@property(nonatomic, copy) RSBarcodesHandler barcodesHandler; + +@property(nonatomic, copy) RSTapGestureHandler tapGestureHandler; + +@property(nonatomic) BOOL isCornersVisible; // Default is YES + +@property(nonatomic) BOOL isBorderRectsVisible; // Default is NO + +@property(nonatomic) BOOL isFocusMarkVisible; // Default is YES + +@property(nonatomic) BOOL isControlsVisible; // Default is YES + +@property(nonatomic) BOOL isButtonBordersVisible; // Default is YES + +- (id)initWithCornerView:(BOOL)showCornerView + controlView:(BOOL)showControlsView + barcodesHandler:(RSBarcodesHandler)barcodesHandler; + +- (id)initWithCornerView:(BOOL)showCornerView + controlView:(BOOL)showControlsView + barcodesHandler:(RSBarcodesHandler)barcodesHandler + preferredCameraPosition:(AVCaptureDevicePosition)cameraDevicePosition; + +- (void)updateView; +- (void)startRunning; +- (void)stopRunning; +- (void)toggleTorch; +- (void)switchCamera; + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSScannerViewController.m b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSScannerViewController.m new file mode 100644 index 0000000..41206ee --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSScannerViewController.m @@ -0,0 +1,611 @@ +// +// RSScannerViewController.m +// RSBarcodes +// +// Created by R0CKSTAR on 12/19/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import "RSScannerViewController.h" + +#import "RSCornersView.h" + +#import + +#if __IPHONE_OS_VERSION_MIN_REQUIRED < 60000 + +NSString *const AVMetadataObjectTypeFace = @"face"; + +#endif + +@interface RSScannerViewController () + +@property(nonatomic, strong) AVCaptureSession *session; +@property(nonatomic, strong) AVCaptureDevice *device; +@property(nonatomic, strong) AVCaptureDeviceInput *input; +@property(nonatomic, strong) AVCaptureVideoPreviewLayer *layer; +@property(nonatomic, strong) AVCaptureMetadataOutput *output; + +@end + +@implementation RSScannerViewController + +#pragma mark - Private + +- (AVCaptureVideoOrientation)__interfaceOrientationToVideoOrientation:(UIInterfaceOrientation)orientation { + switch (orientation) { + case UIInterfaceOrientationPortraitUpsideDown: + return AVCaptureVideoOrientationPortraitUpsideDown; + case UIInterfaceOrientationLandscapeLeft: + return AVCaptureVideoOrientationLandscapeLeft; + case UIInterfaceOrientationLandscapeRight: + return AVCaptureVideoOrientationLandscapeRight; + default: + return AVCaptureVideoOrientationPortrait; + } +} + +- (void)__applicationWillEnterForeground:(NSNotification *)notification { + [self startRunning]; +} + +- (void)__applicationDidEnterBackground:(NSNotification *)notification { + [self stopRunning]; +} + +- (void)__handleTapGesture:(UITapGestureRecognizer *)tapGestureRecognizer { + CGPoint tapPoint = [tapGestureRecognizer locationInView:self.view]; + CGPoint focusPoint = CGPointMake(tapPoint.x / self.view.bounds.size.width, + tapPoint.y / self.view.bounds.size.height); + + if (!self.device || ![self.device isFocusPointOfInterestSupported] || + ![self.device isFocusModeSupported:AVCaptureFocusModeAutoFocus]) { + return; + } else if ([self.device lockForConfiguration:nil]) { + [self.device setFocusPointOfInterest:focusPoint]; + [self.device setFocusMode:AVCaptureFocusModeAutoFocus]; + [self.device unlockForConfiguration]; + + if (self.isFocusMarkVisible) { + self.highlightView.focusPoint = tapPoint; + } + + if (self.tapGestureHandler) { + self.tapGestureHandler(tapPoint); + } + } +} + +- (void)__setup { + self.isCornersVisible = YES; + self.isBorderRectsVisible = NO; + self.isFocusMarkVisible = YES; + + if (self.session) { + return; + } + + if (self.preferredCameraPosition) { + NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; + for (AVCaptureDevice *device in devices) { + if ([device position] == self.preferredCameraPosition) { + self.device = device; + } + } + } else { + self.device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; + if (!self.device) { + NSLog(@"No video camera on this device!"); + return; + } + } + + self.session = [[AVCaptureSession alloc] init]; + NSError *error = nil; + self.input = + [[AVCaptureDeviceInput alloc] initWithDevice:self.device error:&error]; + if (error) { + NSLog(@"%@", error); + return; + } + + if ([self.session canAddInput:self.input]) { + [self.session addInput:self.input]; + } + + self.layer = + [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.session]; + self.layer.videoGravity = AVLayerVideoGravityResizeAspectFill; + self.layer.frame = self.view.bounds; + [self.view.layer addSublayer:self.layer]; + + self.output = [[AVCaptureMetadataOutput alloc] init]; + dispatch_queue_t queue = + dispatch_queue_create("com.pdq.RSBarcodes.metadata", 0); + [self.output setMetadataObjectsDelegate:self queue:queue]; + if ([self.session canAddOutput:self.output]) { + [self.session addOutput:self.output]; + if (!self.barcodeObjectTypes) { + NSMutableArray *codeObjectTypes = [NSMutableArray + arrayWithArray:self.output.availableMetadataObjectTypes]; + [codeObjectTypes removeObject:AVMetadataObjectTypeFace]; + self.barcodeObjectTypes = [NSArray arrayWithArray:codeObjectTypes]; + } + self.output.metadataObjectTypes = self.barcodeObjectTypes; + } + + [self.view bringSubviewToFront:self.highlightView]; + + UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] + initWithTarget:self + action:@selector(__handleTapGesture:)]; + [self.view addGestureRecognizer:tapGestureRecognizer]; +} + +- (BOOL)__isModal { + if ([self presentingViewController]) + return YES; + if ([[self presentingViewController] presentedViewController] == self) + return YES; + if ([[[self navigationController] presentingViewController] presentedViewController] == + [self navigationController]) + return YES; + if ([[[self tabBarController] presentingViewController] + isKindOfClass:[UITabBarController class]]) + return YES; + + return NO; +} + +- (void)__exit { + dispatch_async(dispatch_get_main_queue(), ^{ + [self dismissViewControllerAnimated:true completion:nil]; + }); +} + +#pragma mark - Setter + +- (void)setTorchState:(BOOL)torchState { + dispatch_async(dispatch_get_main_queue(), ^{ + // set button + // yellow when + // torch is on + [self.torchButton setTitleColor:(torchState ? [UIColor colorWithRed:1.0f + green:0.79f + blue:0.28f + alpha:1.0f] + : [UIColor whiteColor]) + forState:UIControlStateNormal]; + [self.torchButton.layer setBorderColor:(torchState ? [UIColor colorWithRed:1.0f + green:0.79f + blue:0.28f + alpha:1.0f].CGColor + : [UIColor whiteColor].CGColor)]; + }); + + AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; + if ([device hasTorch]) { + [device lockForConfiguration:nil]; + [device + setTorchMode:torchState ? AVCaptureTorchModeOn : AVCaptureTorchModeOff]; + [device unlockForConfiguration]; + } + + _torchState = torchState; +} + +#pragma mark - Initialization + +- (id)initWithCornerView:(BOOL)showCornerView + controlView:(BOOL)showControlsView + barcodesHandler:(RSBarcodesHandler)barcodesHandler { + if ((self = [super init])) { + if (!self.highlightView && showCornerView) { + RSCornersView *cornerView = + [[RSCornersView alloc] initWithFrame:self.view.frame]; + cornerView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + [self.view addSubview:cornerView]; + [self.view bringSubviewToFront:cornerView]; + + self.highlightView = cornerView; + + self.isControlsVisible = showCornerView; + } + + if (!self.controlsView && showControlsView) { + UIView *controlsView = [[UIView alloc] initWithFrame:self.view.frame]; + controlsView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + [self.view addSubview:controlsView]; + [self.view bringSubviewToFront:controlsView]; + + self.controlsView = controlsView; + self.isControlsVisible = showControlsView; + + self.isButtonBordersVisible = false; + + [self updateView]; + } + + self.barcodesHandler = barcodesHandler; + + self.tapGestureHandler = ^(CGPoint tapPoint) {}; + } + + return self; +} + +- (id)initWithCornerView:(BOOL)showCornerView + controlView:(BOOL)showControlsView + barcodesHandler:(RSBarcodesHandler)barcodesHandler + preferredCameraPosition:(AVCaptureDevicePosition)cameraDevicePosition { + self.preferredCameraPosition = cameraDevicePosition; + + return [self initWithCornerView:showCornerView + controlView:showControlsView + barcodesHandler:barcodesHandler]; +} + +#pragma mark - View lifecycle + +- (void)viewDidLayoutSubviews { + [super viewDidLayoutSubviews]; + + AVCaptureVideoOrientation target = [self __interfaceOrientationToVideoOrientation:[[UIApplication sharedApplication] statusBarOrientation]]; + AVCaptureVideoOrientation source = self.layer.connection.videoOrientation; + if (self.layer.connection.supportsVideoOrientation && source != target) { + self.layer.connection.videoOrientation = target; + } +} + +- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { + [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; + + CGRect frame = CGRectMake(0, 0, size.width, size.height); + self.layer.frame = frame; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + [self.view setBackgroundColor:[UIColor blackColor]]; + [self __setup]; +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(__applicationWillEnterForeground:) + name:UIApplicationWillEnterForegroundNotification + object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(__applicationDidEnterBackground:) + name:UIApplicationDidEnterBackgroundNotification + object:nil]; + + [self startRunning]; + [self updateView]; +} + +- (void)viewDidDisappear:(BOOL)animated { + [super viewDidDisappear:animated]; + + [[NSNotificationCenter defaultCenter] removeObserver:self + name:UIApplicationWillEnterForegroundNotification + object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self + name:UIApplicationDidEnterBackgroundNotification + object:nil]; + + [self stopRunning]; +} + +- (BOOL)shouldAutorotate { + [self updateView]; + return YES; +} + +- (UIStatusBarStyle)preferredStatusBarStyle { + return UIStatusBarStyleLightContent; +} + +#pragma mark - AVCaptureMetadataOutputObjectsDelegate + +- (void)captureOutput:(AVCaptureOutput *)captureOutput +didOutputMetadataObjects:(NSArray *)metadataObjects + fromConnection:(AVCaptureConnection *)connection { + if (self.stopOnFirst) { + [self stopRunning]; + } + + NSMutableArray *barcodeObjects = nil; + NSMutableArray *cornersArray = nil; + NSMutableArray *borderRectArray = nil; + + for (AVMetadataObject *metadataObject in metadataObjects) { + AVMetadataObject *transformedMetadataObject = + [self.layer transformedMetadataObjectForMetadataObject:metadataObject]; + if ([transformedMetadataObject + isKindOfClass:[AVMetadataMachineReadableCodeObject class]]) { + AVMetadataMachineReadableCodeObject *barcodeObject = + (AVMetadataMachineReadableCodeObject *)transformedMetadataObject; + if (!barcodeObjects) { + barcodeObjects = [[NSMutableArray alloc] init]; + } + [barcodeObjects addObject:barcodeObject]; + + if (self.isCornersVisible) { + if ([barcodeObject respondsToSelector:@selector(corners)]) { + if (!cornersArray) { + cornersArray = [[NSMutableArray alloc] init]; + } + [cornersArray addObject:barcodeObject.corners]; + } + } + + if (self.isBorderRectsVisible) { + if ([barcodeObject respondsToSelector:@selector(bounds)]) { + if (!borderRectArray) { + borderRectArray = [[NSMutableArray alloc] init]; + } + [borderRectArray + addObject:[NSValue valueWithCGRect:barcodeObject.bounds]]; + } + } + } + } + + if (self.isCornersVisible) { + self.highlightView.cornersArray = + cornersArray ? [NSArray arrayWithArray:cornersArray] : nil; + } + + if (self.isBorderRectsVisible) { + self.highlightView.borderRectArray = + borderRectArray ? [NSArray arrayWithArray:borderRectArray] : nil; + } + + if (self.barcodesHandler) { + self.barcodesHandler([NSArray arrayWithArray:barcodeObjects]); + } + + if (self.stopOnFirst) { + [self startRunning]; + } +} + +#pragma mark - Public + +- (void)startRunning { + if (self.session.isRunning) { + return; + } + [self.session startRunning]; +} + +- (void)stopRunning { + if (!self.session.isRunning) { + return; + } + [self.session stopRunning]; + + self.highlightView.cornersArray = nil; + self.highlightView.borderRectArray = nil; + [self.highlightView setNeedsDisplay]; +} + +- (void)updateView { + if (!self.isControlsVisible) { + return; + } + + UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; + + CGRect flipButtonRect; + CGRect cancelButtonRect; + CGRect torchButtonRect; + CGRect sidebarRect; + + CGFloat rotationAngle = 0; + + CGSize viewSize = self.view.frame.size; + + if (!self.sidebarView) { + self.sidebarView = [[UIView alloc] init]; + [self.sidebarView + setBackgroundColor: + [UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.9f]]; + + [self.controlsView addSubview:self.sidebarView]; + [self.controlsView bringSubviewToFront:self.sidebarView]; + } + + if (!self.cancelButton && [self __isModal]) { + self.cancelButton = [[UIButton alloc] init]; + [self.cancelButton setTitle:@" cancel " forState:UIControlStateNormal]; + [self.cancelButton + setTitleColor: + [UIColor colorWithRed:1.0f green:0.22f blue:0.22f alpha:1.0f] + forState:UIControlStateNormal]; + [self.cancelButton setContentHorizontalAlignment: + UIControlContentHorizontalAlignmentCenter]; + [self.cancelButton addTarget:self + action:@selector(__exit) + forControlEvents:UIControlEventTouchDown]; + + [self.controlsView addSubview:self.cancelButton]; + [self.controlsView bringSubviewToFront:self.cancelButton]; + } + + if (![self __isModal]) { + [self.cancelButton removeFromSuperview]; + } + + if (!self.flipButton && + ([UIImagePickerController + isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceFront] && + [UIImagePickerController + isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceRear])) { + self.flipButton = [[UIButton alloc] init]; + [self.flipButton setTitle:@" flip " forState:UIControlStateNormal]; + [self.flipButton setContentHorizontalAlignment: + UIControlContentHorizontalAlignmentCenter]; + + [self.flipButton addTarget:self + action:@selector(switchCamera) + forControlEvents:UIControlEventTouchDown]; + + [self.controlsView addSubview:self.flipButton]; + [self.controlsView bringSubviewToFront:self.flipButton]; + } + + if (!self.torchButton && [self.device hasTorch]) { + self.torchButton = [[UIButton alloc] init]; + [self.torchButton setTitle:@" torch " forState:UIControlStateNormal]; + [self.torchButton setContentHorizontalAlignment: + UIControlContentHorizontalAlignmentCenter]; + + [self.torchButton addTarget:self + action:@selector(toggleTorch) + forControlEvents:UIControlEventTouchDown]; + + [self.controlsView addSubview:self.torchButton]; + [self.controlsView bringSubviewToFront:self.torchButton]; + } + + if (self.isButtonBordersVisible) { + [self.cancelButton.layer setCornerRadius:8.0f]; + [self.cancelButton.layer setBorderColor:[UIColor redColor].CGColor]; + [self.cancelButton.layer setBorderWidth:1.5f]; + + [self.flipButton.layer setCornerRadius:8.0f]; + [self.flipButton.layer setBorderColor:[UIColor whiteColor].CGColor]; + [self.flipButton.layer setBorderWidth:1.5f]; + + [self.torchButton.layer setCornerRadius:8.0f]; + [self.torchButton.layer setBorderColor:[UIColor whiteColor].CGColor]; + [self.torchButton.layer setBorderWidth:1.5f]; + } else { + [self.cancelButton.layer setBorderWidth:0.f]; + + [self.flipButton.layer setBorderWidth:0.f]; + + [self.torchButton.layer setBorderWidth:0.f]; + } + + switch (UI_USER_INTERFACE_IDIOM()) { + case UIUserInterfaceIdiomPad: { + sidebarRect = CGRectMake(self.view.frame.size.width - 110, 0, 110, + self.view.frame.size.height); + flipButtonRect = CGRectMake(viewSize.width - 70, 30, 56, 20); + cancelButtonRect = CGRectMake(self.view.frame.size.width - 80, + viewSize.height - 40, 56, 30); + + if (orientation == 0) { // Default orientation + // failsafe + } else if (orientation == UIInterfaceOrientationPortrait) { + } else if (orientation == UIInterfaceOrientationPortraitUpsideDown) { + } else if (orientation == UIInterfaceOrientationLandscapeLeft || + orientation == UIInterfaceOrientationLandscapeRight) { + flipButtonRect = CGRectMake(viewSize.width - 80, 30, 56, 20); + cancelButtonRect = CGRectMake(self.view.frame.size.width - 80, + viewSize.height - 60, 56, 42); + } + } break; + + case UIUserInterfaceIdiomPhone: { + const int marginToTop = 22; + + sidebarRect = CGRectMake(0, 0, viewSize.width, marginToTop + 40); + flipButtonRect = CGRectMake(viewSize.width - 40, marginToTop, 30, 20); + torchButtonRect = CGRectMake(viewSize.width / 2 - 24, marginToTop, 30, 20); + cancelButtonRect = CGRectMake(5, marginToTop, 50, 30); + + if (orientation == 0) { // Default orientation + // failsafe + } else if (orientation == UIInterfaceOrientationPortrait) { + } else if (orientation == UIInterfaceOrientationPortraitUpsideDown) { + } else if (orientation == UIInterfaceOrientationLandscapeLeft || + orientation == UIInterfaceOrientationLandscapeRight) { + sidebarRect = CGRectMake(0, 0, viewSize.width, marginToTop + 70); + + const int rotateMargin = 15; + flipButtonRect = + CGRectMake(viewSize.width - 40, marginToTop + rotateMargin, 30, 20); + torchButtonRect = CGRectMake(viewSize.width / 2 - 16, + marginToTop + rotateMargin, 30, 30); + cancelButtonRect = CGRectMake(5, marginToTop + rotateMargin, 30, 30); + } + } break; + + default: + break; + } + + if (orientation == UIDeviceOrientationPortraitUpsideDown) + rotationAngle = M_PI; + else if (orientation == UIDeviceOrientationLandscapeLeft) + rotationAngle = M_PI_2; + else if (orientation == UIDeviceOrientationLandscapeRight) + rotationAngle = -M_PI_2; + [UIView animateWithDuration:0.5 + animations:^{ + [self.sidebarView setFrame:sidebarRect]; + [self.flipButton setFrame:flipButtonRect]; + [self.cancelButton setFrame:cancelButtonRect]; + if ([self __isModal]) { + [self.torchButton setFrame:torchButtonRect]; + } else { + [self.torchButton setFrame:cancelButtonRect]; + } + } + completion:nil]; + + [self.flipButton sizeToFit]; + [self.cancelButton sizeToFit]; + [self.torchButton sizeToFit]; +} + +- (void)switchCamera { + CATransition *animation = [CATransition animation]; + animation.duration = .5f; + animation.timingFunction = [CAMediaTimingFunction + functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; + animation.type = @"oglFlip"; + + for (AVCaptureDevice *d in + [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]) { + if (d.position != _device.position) { + [self stopRunning]; + _device = d; + + AVCaptureDeviceInput *oldInput = _input; + [_session removeInput:oldInput]; + + _input = [[AVCaptureDeviceInput alloc] initWithDevice:_device error:nil]; + + if ([_session canAddInput:_input]) { + [_session addInput:_input]; + + [self setTorchState:false]; + + if (self.device.position == AVCaptureDevicePositionFront) { + animation.subtype = kCATransitionFromRight; + } else if (self.device.position == AVCaptureDevicePositionBack) { + animation.subtype = kCATransitionFromLeft; + } + [self.layer addAnimation:animation forKey:nil]; + } else { + [_session addInput:oldInput]; + } + + [self startRunning]; + break; + } + } +} + +- (void)toggleTorch { + [self setTorchState:!self.torchState]; +} + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSUPCEGenerator.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSUPCEGenerator.h new file mode 100644 index 0000000..22ecc8c --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSUPCEGenerator.h @@ -0,0 +1,19 @@ +// +// RSUPCEGenerator.h +// RSBarcodes +// +// Created by R0CKSTAR on 12/27/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import "RSCodeGenerator.h" + +/** + * http://www.sly.com.tw/skill/know/new_page_6.htm + * http://mdn.morovia.com/kb/UPCE-Specification-10634.html + * http://mdn.morovia.com/kb/UPCA-Specification-10632.html + * http://www.barcodeisland.com/upce.phtml + */ +@interface RSUPCEGenerator : RSAbstractCodeGenerator + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSUPCEGenerator.m b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSUPCEGenerator.m new file mode 100644 index 0000000..1347720 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSUPCEGenerator.m @@ -0,0 +1,126 @@ +// +// RSUPCEGenerator.m +// RSBarcodes +// +// Created by R0CKSTAR on 12/27/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import "RSUPCEGenerator.h" + +@implementation RSUPCEGenerator + +static NSString *const UPCE_ODD_ENCODINGS[10] = { + @"0001101", @"0011001", @"0010011", @"0111101", @"0100011", + @"0110001", @"0101111", @"0111011", @"0110111", @"0001011"}; + +static NSString *const UPCE_EVEN_ENCODINGS[10] = { + @"0100111", @"0110011", @"0011011", @"0100001", @"0011101", + @"0111001", @"0000101", @"0010001", @"0001001", @"0010111"}; + +static NSString *const UPCE_SEQUENCES[10] = { + @"000111", @"001011", @"001101", @"001110", @"010011", + @"011001", @"011100", @"010101", @"010110", @"011010"}; + +- (NSString *)convert2UPC_A:(NSString *)upc_e { + NSString *code = [upc_e substringWithRange:NSMakeRange(1, upc_e.length - 2)]; + int lastDigit = + [[code substringWithRange:NSMakeRange(code.length - 1, 1)] intValue]; + NSString *insertDigits = @"0000"; + NSMutableString *upc_a = [[NSMutableString alloc] init]; + switch (lastDigit) { + case 0: + case 1: + case 2: + [upc_a appendString:[code substringWithRange:NSMakeRange(0, 2)]]; + [upc_a appendString:[NSString stringWithFormat:@"%d", lastDigit]]; + [upc_a appendString:insertDigits]; + [upc_a appendString:[code substringWithRange:NSMakeRange(2, 3)]]; + break; + case 3: + insertDigits = @"00000"; + [upc_a appendString:[code substringWithRange:NSMakeRange(0, 3)]]; + [upc_a appendString:insertDigits]; + [upc_a appendString:[code substringWithRange:NSMakeRange(3, 2)]]; + break; + case 4: + insertDigits = @"00000"; + [upc_a appendString:[code substringWithRange:NSMakeRange(0, 4)]]; + [upc_a appendString:insertDigits]; + [upc_a appendString:[code substringWithRange:NSMakeRange(4, 1)]]; + break; + default: + [upc_a appendString:[code substringWithRange:NSMakeRange(0, 5)]]; + [upc_a appendString:insertDigits]; + [upc_a appendString:[NSString stringWithFormat:@"%d", lastDigit]]; + break; + } + return [NSString stringWithFormat:@"%@%@", @"00", upc_a]; +} + +- (BOOL)isContentsValid:(NSString *)contents { + if ([super isContentsValid:contents] && + [self respondsToSelector:@selector(checkDigit:)]) { + if (contents.length == 8 && + [[contents substringWithRange:NSMakeRange(0, 1)] intValue] == 0 && + [[contents substringWithRange:NSMakeRange(contents.length - 1, 1)] + isEqualToString:[self checkDigit:contents]]) { + return YES; + } + } + return NO; +} + +- (NSString *)initiator { + return @"101"; +} + +- (NSString *)terminator { + return @"010101"; +} + +- (NSString *)barcode:(NSString *)contents { + int checkValue = [[contents + substringWithRange:NSMakeRange(contents.length - 1, 1)] intValue]; + NSString *sequence = UPCE_SEQUENCES[checkValue]; + NSMutableString *barcode = [[NSMutableString alloc] initWithString:@""]; + for (int i = 1; i < (contents.length - 1); i++) { + int digit = [[contents substringWithRange:NSMakeRange(i, 1)] intValue]; + if ([[sequence substringWithRange:NSMakeRange((i - 1), 1)] intValue] % 2 == + 0) { + [barcode appendString:UPCE_EVEN_ENCODINGS[digit]]; + } else { + [barcode appendString:UPCE_ODD_ENCODINGS[digit]]; + } + } + return [NSString stringWithString:barcode]; +} + +#pragma mark - RSCheckDigitGenerator + +- (NSString *)checkDigit:(NSString *)contents { + // UPC-A check digit is calculated using standard Mod10 method. Here + // outlines the steps to calculate UPC-A check digit: + // + // From the right to left, start with odd position, assign the odd/even + // position to each digit. + // Sum all digits in odd position and multiply the result by 3. + // Sum all digits in even position. + // Sum the results of step 3 and step 4. + // divide the result of step 4 by 10. The check digit is the number which + // adds the remainder to 10. + NSString *upc_a = [self convert2UPC_A:contents]; + int sum_odd = 0; + int sum_even = 0; + for (int i = 0; i < upc_a.length; i++) { + int digit = [[upc_a substringWithRange:NSMakeRange(i, 1)] intValue]; + if (i % 2 == 0) { + sum_even += digit; + } else { + sum_odd += digit; + } + } + return [NSString stringWithFormat:@"%d", 10 - (sum_even + sum_odd * 3) % 10]; +} + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSUnifiedCodeGenerator.h b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSUnifiedCodeGenerator.h new file mode 100644 index 0000000..86464e2 --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSUnifiedCodeGenerator.h @@ -0,0 +1,39 @@ +// +// RSUnifiedCodeGenerator.m +// RSBarcodes +// +// Created by R0CKSTAR on 12/25/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import + +#import "RSCodeGenerator.h" + +#if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000 + +extern NSString *const AVMetadataObjectTypeUPCECode; +extern NSString *const AVMetadataObjectTypeCode39Code; +extern NSString *const AVMetadataObjectTypeCode39Mod43Code; +extern NSString *const AVMetadataObjectTypeEAN13Code; +extern NSString *const AVMetadataObjectTypeEAN8Code; +extern NSString *const AVMetadataObjectTypeCode93Code; +extern NSString *const AVMetadataObjectTypeCode128Code; +extern NSString *const AVMetadataObjectTypePDF417Code; +extern NSString *const AVMetadataObjectTypeQRCode; +extern NSString *const AVMetadataObjectTypeAztecCode; + +#endif + +#if __IPHONE_OS_VERSION_MIN_REQUIRED < 80000 + +extern NSString *const AVMetadataObjectTypeInterleaved2of5Code; +extern NSString *const AVMetadataObjectTypeITF14Code; + +#endif + +@interface RSUnifiedCodeGenerator : NSObject + ++ (instancetype)codeGen; + +@end diff --git a/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSUnifiedCodeGenerator.m b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSUnifiedCodeGenerator.m new file mode 100644 index 0000000..2b5b8ef --- /dev/null +++ b/grocery-objc/Pods/RSBarcodes/RSBarcodes/RSUnifiedCodeGenerator.m @@ -0,0 +1,139 @@ +// +// RSUnifiedCodeGenerator.m +// RSBarcodes +// +// Created by R0CKSTAR on 12/25/13. +// Copyright (c) 2013 P.D.Q. All rights reserved. +// + +#import "RSUnifiedCodeGenerator.h" + +#import "RSCode39Generator.h" + +#import "RSCode39Mod43Generator.h" + +#import "RSExtendedCode39Generator.h" + +#import "RSEAN13Generator.h" + +#import "RSEAN8Generator.h" + +#import "RSUPCEGenerator.h" + +#import "RSCode93Generator.h" + +#import "RSCode128Generator.h" + +#import "RSISBN13Generator.h" + +#import "RSISSN13Generator.h" + +#import "RSITFGenerator.h" + +#import "RSITF14Generator.h" + +#if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000 + +NSString *const AVMetadataObjectTypeUPCECode = @"org.gs1.UPC-E"; +NSString *const AVMetadataObjectTypeCode39Code = @"org.iso.Code39"; +NSString *const AVMetadataObjectTypeCode39Mod43Code = @"org.iso.Code39Mod43"; +NSString *const AVMetadataObjectTypeEAN13Code = @"org.gs1.EAN-13"; +NSString *const AVMetadataObjectTypeEAN8Code = @"org.gs1.EAN-8"; +NSString *const AVMetadataObjectTypeCode93Code = @"com.intermec.Code93"; +NSString *const AVMetadataObjectTypeCode128Code = @"org.iso.Code128"; +NSString *const AVMetadataObjectTypePDF417Code = @"org.iso.PDF417"; +NSString *const AVMetadataObjectTypeQRCode = @"org.iso.QRCode"; +NSString *const AVMetadataObjectTypeAztecCode = @"org.iso.Aztec"; + +#endif + +#if __IPHONE_OS_VERSION_MIN_REQUIRED < 80000 + +NSString *const AVMetadataObjectTypeInterleaved2of5Code = @"org.ansi.Interleaved2of5"; +NSString *const AVMetadataObjectTypeITF14Code = @"org.gs1.ITF14"; + +#endif + +@implementation RSUnifiedCodeGenerator + +@synthesize strokeColor = _strokeColor, fillColor = _fillColor; + ++ (instancetype)codeGen { + static RSUnifiedCodeGenerator *codeGen = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ codeGen = [[self alloc] init]; }); + return codeGen; +} + +#pragma mark - RSCodeGenerator + +- (UIImage *)genCodeWithContents:(NSString *)contents + machineReadableCodeObjectType:(NSString *)type { + if ([type isEqualToString:AVMetadataObjectTypeQRCode] || + [type isEqualToString:AVMetadataObjectTypePDF417Code] || + [type isEqualToString:AVMetadataObjectTypeAztecCode]) { + if (([[[UIDevice currentDevice] systemVersion] compare:@"6.0" + options:NSNumericSearch] != + NSOrderedAscending)) { + return genCode(contents, getFilterName(type)); + } + } + + id codeGen = nil; + if ([type isEqualToString:AVMetadataObjectTypeCode39Code]) { + codeGen = [[RSCode39Generator alloc] init]; + + } else if ([type isEqualToString:AVMetadataObjectTypeCode39Mod43Code]) { + codeGen = [[RSCode39Mod43Generator alloc] init]; + + } else if ([type isEqualToString:AVMetadataObjectTypeEAN13Code]) { + codeGen = [[RSEAN13Generator alloc] init]; + + } else if ([type isEqualToString:AVMetadataObjectTypeEAN8Code]) { + codeGen = [[RSEAN8Generator alloc] init]; + + } else if ([type isEqualToString:AVMetadataObjectTypeUPCECode]) { + codeGen = [[RSUPCEGenerator alloc] init]; + + } else if ([type isEqualToString:AVMetadataObjectTypeCode93Code]) { + codeGen = [[RSCode93Generator alloc] init]; + + } else if ([type isEqualToString:AVMetadataObjectTypeCode128Code]) { + codeGen = [[RSCode128Generator alloc] initWithContents:contents]; + + } else if ([type isEqualToString:AVMetadataObjectTypeInterleaved2of5Code]) { + codeGen = [[RSITFGenerator alloc] init]; + + } else if ([type isEqualToString:AVMetadataObjectTypeITF14Code]) { + codeGen = [[RSITF14Generator alloc] init]; + + } else if ([type isEqualToString:RSMetadataObjectTypeExtendedCode39Code]) { + codeGen = [[RSExtendedCode39Generator alloc] init]; + + } else if ([type isEqualToString:RSMetadataObjectTypeISBN13Code]) { + codeGen = [[RSISBN13Generator alloc] init]; + + } else if ([type isEqualToString:RSMetadataObjectTypeISSN13Code]) { + codeGen = [[RSISSN13Generator alloc] init]; + + } + + if (codeGen) { + codeGen.fillColor = self.fillColor; + codeGen.strokeColor = self.strokeColor; + + return [codeGen genCodeWithContents:contents + machineReadableCodeObjectType:type]; + } else { + return nil; + } +} + +- (UIImage *)genCodeWithMachineReadableCodeObject: +(AVMetadataMachineReadableCodeObject *) +machineReadableCodeObject { + return [self genCodeWithContents:[machineReadableCodeObject stringValue] + machineReadableCodeObjectType:[machineReadableCodeObject type]]; +} + +@end diff --git a/grocery-objc/Pods/SDWebImage/LICENSE b/grocery-objc/Pods/SDWebImage/LICENSE new file mode 100644 index 0000000..ae783e1 --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2009 Olivier Poitrey + +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. + diff --git a/grocery-objc/Pods/SDWebImage/README.md b/grocery-objc/Pods/SDWebImage/README.md new file mode 100644 index 0000000..62628f9 --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/README.md @@ -0,0 +1,334 @@ +Web Image +========= +[![Build Status](http://img.shields.io/travis/rs/SDWebImage/master.svg?style=flat)](https://travis-ci.org/rs/SDWebImage) +[![Pod Version](http://img.shields.io/cocoapods/v/SDWebImage.svg?style=flat)](http://cocoadocs.org/docsets/SDWebImage/) +[![Pod Platform](http://img.shields.io/cocoapods/p/SDWebImage.svg?style=flat)](http://cocoadocs.org/docsets/SDWebImage/) +[![Pod License](http://img.shields.io/cocoapods/l/SDWebImage.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0.html) +[![Dependency Status](https://www.versioneye.com/objective-c/sdwebimage/3.3/badge.svg?style=flat)](https://www.versioneye.com/objective-c/sdwebimage/3.3) +[![Reference Status](https://www.versioneye.com/objective-c/sdwebimage/reference_badge.svg?style=flat)](https://www.versioneye.com/objective-c/sdwebimage/references) +[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/rs/SDWebImage) + +This library provides a category for UIImageView with support for remote images coming from the web. + +It provides: + +- An `UIImageView` category adding web image and cache management to the Cocoa Touch framework +- An asynchronous image downloader +- An asynchronous memory + disk image caching with automatic cache expiration handling +- Animated GIF support +- WebP format support +- A background image decompression +- A guarantee that the same URL won't be downloaded several times +- A guarantee that bogus URLs won't be retried again and again +- A guarantee that main thread will never be blocked +- Performances! +- Use GCD and ARC +- Arm64 support + +NOTE: The version 3.0 of SDWebImage isn't fully backward compatible with 2.0 and requires iOS 5.1.1 +minimum deployment version. If you need iOS < 5.0 support, please use the last [2.0 version](https://github.com/rs/SDWebImage/tree/2.0-compat). + +[How is SDWebImage better than X?](https://github.com/rs/SDWebImage/wiki/How-is-SDWebImage-better-than-X%3F) + +Who Use It +---------- + +Find out [who uses SDWebImage](https://github.com/rs/SDWebImage/wiki/Who-Uses-SDWebImage) and add your app to the list. + +How To Use +---------- + +API documentation is available at [CocoaDocs - SDWebImage](http://cocoadocs.org/docsets/SDWebImage/) + +### Using UIImageView+WebCache category with UITableView + +Just #import the UIImageView+WebCache.h header, and call the sd_setImageWithURL:placeholderImage: +method from the tableView:cellForRowAtIndexPath: UITableViewDataSource method. Everything will be +handled for you, from async downloads to caching management. + +```objective-c +#import + +... + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + static NSString *MyIdentifier = @"MyIdentifier"; + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier]; + if (cell == nil) { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault + reuseIdentifier:MyIdentifier] autorelease]; + } + + // Here we use the new provided sd_setImageWithURL: method to load the web image + [cell.imageView sd_setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"] + placeholderImage:[UIImage imageNamed:@"placeholder.png"]]; + + cell.textLabel.text = @"My Text"; + return cell; +} +``` + +### Using blocks + +With blocks, you can be notified about the image download progress and whenever the image retrieval +has completed with success or not: + +```objective-c +// Here we use the new provided sd_setImageWithURL: method to load the web image +[cell.imageView sd_setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"] + placeholderImage:[UIImage imageNamed:@"placeholder.png"] + completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + ... completion code here ... + }]; +``` + +Note: neither your success nor failure block will be call if your image request is canceled before completion. + +### Using SDWebImageManager + +The SDWebImageManager is the class behind the UIImageView+WebCache category. It ties the +asynchronous downloader with the image cache store. You can use this class directly to benefit +from web image downloading with caching in another context than a UIView (ie: with Cocoa). + +Here is a simple example of how to use SDWebImageManager: + +```objective-c +SDWebImageManager *manager = [SDWebImageManager sharedManager]; +[manager downloadImageWithURL:imageURL + options:0 + progress:^(NSInteger receivedSize, NSInteger expectedSize) { + // progression tracking code + } + completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (image) { + // do something with image + } + }]; +``` + +### Using Asynchronous Image Downloader Independently + +It's also possible to use the async image downloader independently: + +```objective-c +SDWebImageDownloader *downloader = [SDWebImageDownloader sharedDownloader]; +[downloader downloadImageWithURL:imageURL + options:0 + progress:^(NSInteger receivedSize, NSInteger expectedSize) { + // progression tracking code + } + completed:^(UIImage *image, NSData *data, NSError *error, BOOL finished) { + if (image && finished) { + // do something with image + } + }]; +``` + +### Using Asynchronous Image Caching Independently + +It is also possible to use the async based image cache store independently. SDImageCache +maintains a memory cache and an optional disk cache. Disk cache write operations are performed +asynchronous so it doesn't add unnecessary latency to the UI. + +The SDImageCache class provides a singleton instance for convenience but you can create your own +instance if you want to create separated cache namespace. + +To lookup the cache, you use the `queryDiskCacheForKey:done:` method. If the method returns nil, it means the cache +doesn't currently own the image. You are thus responsible for generating and caching it. The cache +key is an application unique identifier for the image to cache. It is generally the absolute URL of +the image. + +```objective-c +SDImageCache *imageCache = [[SDImageCache alloc] initWithNamespace:@"myNamespace"]; +[imageCache queryDiskCacheForKey:myCacheKey done:^(UIImage *image) { + // image is not nil if image was found +}]; +``` + +By default SDImageCache will lookup the disk cache if an image can't be found in the memory cache. +You can prevent this from happening by calling the alternative method `imageFromMemoryCacheForKey:`. + +To store an image into the cache, you use the storeImage:forKey: method: + +```objective-c +[[SDImageCache sharedImageCache] storeImage:myImage forKey:myCacheKey]; +``` + +By default, the image will be stored in memory cache as well as on disk cache (asynchronously). If +you want only the memory cache, use the alternative method storeImage:forKey:toDisk: with a negative +third argument. + +### Using cache key filter + +Sometime, you may not want to use the image URL as cache key because part of the URL is dynamic +(i.e.: for access control purpose). SDWebImageManager provides a way to set a cache key filter that +takes the NSURL as input, and output a cache key NSString. + +The following example sets a filter in the application delegate that will remove any query-string from +the URL before to use it as a cache key: + +```objective-c +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + SDWebImageManager.sharedManager.cacheKeyFilter = ^(NSURL *url) { + url = [[NSURL alloc] initWithScheme:url.scheme host:url.host path:url.path]; + return [url absoluteString]; + }; + + // Your app init code... + return YES; +} +``` + + +Common Problems +--------------- + +### Using dynamic image size with UITableViewCell + +UITableView determines the size of the image by the first image set for a cell. If your remote images +don't have the same size as your placeholder image, you may experience strange anamorphic scaling issue. +The following article gives a way to workaround this issue: + +[http://www.wrichards.com/blog/2011/11/sdwebimage-fixed-width-cell-images/](http://www.wrichards.com/blog/2011/11/sdwebimage-fixed-width-cell-images/) + + +### Handle image refresh + +SDWebImage does very aggressive caching by default. It ignores all kind of caching control header returned by the HTTP server and cache the returned images with no time restriction. It implies your images URLs are static URLs pointing to images that never change. If the pointed image happen to change, some parts of the URL should change accordingly. + +If you don't control the image server you're using, you may not be able to change the URL when its content is updated. This is the case for Facebook avatar URLs for instance. In such case, you may use the `SDWebImageRefreshCached` flag. This will slightly degrade the performance but will respect the HTTP caching control headers: + +``` objective-c +[imageView sd_setImageWithURL:[NSURL URLWithString:@"https://graph.facebook.com/olivier.poitrey/picture"] + placeholderImage:[UIImage imageNamed:@"avatar-placeholder.png"] + options:SDWebImageRefreshCached]; +``` + +### Add a progress indicator + +See this category: https://github.com/JJSaccolo/UIActivityIndicator-for-SDWebImage + +Installation +------------ + +There are three ways to use SDWebImage in your project: +- using Cocoapods +- copying all the files into your project +- importing the project as a static library + +### Installation with CocoaPods + +[CocoaPods](http://cocoapods.org/) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects. See the [Get Started](http://cocoapods.org/#get_started) section for more details. + +#### Podfile +``` +platform :ios, '6.1' +pod 'SDWebImage', '~>3.7' +``` + +If you are using Swift, be sure to add `use_frameworks!` and set your target to iOS 8+: +``` +platform :ios, '8.0' +use_frameworks! +``` + +#### Subspecs + +There are 3 subspecs available now: `Core`, `MapKit` and `WebP` (this means you can install only some of the SDWebImage modules. By default, you get just `Core`, so if you need `WebP`, you need to specify it). + +Podfile example: +``` +pod 'SDWebImage/WebP' +``` + +### Installation with Carthage (iOS 8+) + +[Carthage](https://github.com/Carthage/Carthage) is a lightweight dependency manager for Swift and Objective-C. It leverages CocoaTouch modules and is less invasive than CocoaPods. + +To install with carthage, follow the instruction on [Carthage](https://github.com/Carthage/Carthage) + +#### Cartfile +``` +github "rs/SDWebImage" +``` + +#### Usage +Swift + +If you installed using CocoaPods: +``` +import SDWebImage +``` + +If you installed manually: +``` +import WebImage +``` + +Objective-C + +``` +@import WebImage; +``` + +### Installation by cloning the repository + +In order to gain access to all the files from the repository, you should clone it. +``` +git clone --recursive https://github.com/rs/SDWebImage.git +``` + +### Add the SDWebImage project to your project + +- Download and unzip the last version of the framework from the [download page](https://github.com/rs/SDWebImage/releases) +- Right-click on the project navigator and select "Add Files to "Your Project": +- In the dialog, select SDWebImage.framework: +- Check the "Copy items into destination group's folder (if needed)" checkbox + +### Add dependencies + +- In you application project app’s target settings, find the "Build Phases" section and open the "Link Binary With Libraries" block: +- Click the "+" button again and select the "ImageIO.framework", this is needed by the progressive download feature: + +### Add Linker Flag + +Open the "Build Settings" tab, in the "Linking" section, locate the "Other Linker Flags" setting and add the "-ObjC" flag: + +![Other Linker Flags](http://dl.dropbox.com/u/123346/SDWebImage/10_other_linker_flags.jpg) + +Alternatively, if this causes compilation problems with frameworks that extend optional libraries, such as Parse, RestKit or opencv2, instead of the -ObjC flag use: +``` +-force_load SDWebImage.framework/Versions/Current/SDWebImage +``` + +If you're using Cocoa Pods and have any frameworks that extend optional libraries, such as Parsen RestKit or opencv2, instead of the -ObjC flag use: +``` +-force_load $(TARGET_BUILD_DIR)/libPods.a +``` +and this: +``` +$(inherited) +``` + +### Import headers in your source files + +In the source files where you need to use the library, import the header file: + +```objective-c +#import +``` + +### Build Project + +At this point your workspace should build without error. If you are having problem, post to the Issue and the +community can help you solve it. + +Future Enhancements +------------------- + +- LRU memory cache cleanup instead of reset on memory warning + +## Licenses + +All source code is licensed under the [MIT License](https://raw.github.com/rs/SDWebImage/master/LICENSE). diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h b/grocery-objc/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h new file mode 100644 index 0000000..69c76dc --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h @@ -0,0 +1,26 @@ +// +// Created by Fabrice Aneche on 06/01/14. +// Copyright (c) 2014 Dailymotion. All rights reserved. +// + +#import + +@interface NSData (ImageContentType) + +/** + * Compute the content type for an image data + * + * @param data the input data + * + * @return the content type as string (i.e. image/jpeg, image/gif) + */ ++ (NSString *)sd_contentTypeForImageData:(NSData *)data; + +@end + + +@interface NSData (ImageContentTypeDeprecated) + ++ (NSString *)contentTypeForImageData:(NSData *)data __deprecated_msg("Use `sd_contentTypeForImageData:`"); + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m b/grocery-objc/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m new file mode 100644 index 0000000..0941cfa --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m @@ -0,0 +1,49 @@ +// +// Created by Fabrice Aneche on 06/01/14. +// Copyright (c) 2014 Dailymotion. All rights reserved. +// + +#import "NSData+ImageContentType.h" + + +@implementation NSData (ImageContentType) + ++ (NSString *)sd_contentTypeForImageData:(NSData *)data { + uint8_t c; + [data getBytes:&c length:1]; + switch (c) { + case 0xFF: + return @"image/jpeg"; + case 0x89: + return @"image/png"; + case 0x47: + return @"image/gif"; + case 0x49: + case 0x4D: + return @"image/tiff"; + case 0x52: + // R as RIFF for WEBP + if ([data length] < 12) { + return nil; + } + + NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding]; + if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) { + return @"image/webp"; + } + + return nil; + } + return nil; +} + +@end + + +@implementation NSData (ImageContentTypeDeprecated) + ++ (NSString *)contentTypeForImageData:(NSData *)data { + return [self sd_contentTypeForImageData:data]; +} + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/SDImageCache.h b/grocery-objc/Pods/SDWebImage/SDWebImage/SDImageCache.h new file mode 100644 index 0000000..9577726 --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/SDImageCache.h @@ -0,0 +1,272 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageCompat.h" + +typedef NS_ENUM(NSInteger, SDImageCacheType) { + /** + * The image wasn't available the SDWebImage caches, but was downloaded from the web. + */ + SDImageCacheTypeNone, + /** + * The image was obtained from the disk cache. + */ + SDImageCacheTypeDisk, + /** + * The image was obtained from the memory cache. + */ + SDImageCacheTypeMemory +}; + +typedef void(^SDWebImageQueryCompletedBlock)(UIImage *image, SDImageCacheType cacheType); + +typedef void(^SDWebImageCheckCacheCompletionBlock)(BOOL isInCache); + +typedef void(^SDWebImageCalculateSizeBlock)(NSUInteger fileCount, NSUInteger totalSize); + +/** + * SDImageCache maintains a memory cache and an optional disk cache. Disk cache write operations are performed + * asynchronous so it doesn’t add unnecessary latency to the UI. + */ +@interface SDImageCache : NSObject + +/** + * Decompressing images that are downloaded and cached can improve performance but can consume lot of memory. + * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption. + */ +@property (assign, nonatomic) BOOL shouldDecompressImages; + +/** + * disable iCloud backup [defaults to YES] + */ +@property (assign, nonatomic) BOOL shouldDisableiCloud; + +/** + * use memory cache [defaults to YES] + */ +@property (assign, nonatomic) BOOL shouldCacheImagesInMemory; + +/** + * The maximum "total cost" of the in-memory image cache. The cost function is the number of pixels held in memory. + */ +@property (assign, nonatomic) NSUInteger maxMemoryCost; + +/** + * The maximum number of objects the cache should hold. + */ +@property (assign, nonatomic) NSUInteger maxMemoryCountLimit; + +/** + * The maximum length of time to keep an image in the cache, in seconds + */ +@property (assign, nonatomic) NSInteger maxCacheAge; + +/** + * The maximum size of the cache, in bytes. + */ +@property (assign, nonatomic) NSUInteger maxCacheSize; + +/** + * Returns global shared cache instance + * + * @return SDImageCache global instance + */ ++ (SDImageCache *)sharedImageCache; + +/** + * Init a new cache store with a specific namespace + * + * @param ns The namespace to use for this cache store + */ +- (id)initWithNamespace:(NSString *)ns; + +/** + * Init a new cache store with a specific namespace and directory + * + * @param ns The namespace to use for this cache store + * @param directory Directory to cache disk images in + */ +- (id)initWithNamespace:(NSString *)ns diskCacheDirectory:(NSString *)directory; + +-(NSString *)makeDiskCachePath:(NSString*)fullNamespace; + +/** + * Add a read-only cache path to search for images pre-cached by SDImageCache + * Useful if you want to bundle pre-loaded images with your app + * + * @param path The path to use for this read-only cache path + */ +- (void)addReadOnlyCachePath:(NSString *)path; + +/** + * Store an image into memory and disk cache at the given key. + * + * @param image The image to store + * @param key The unique image cache key, usually it's image absolute URL + */ +- (void)storeImage:(UIImage *)image forKey:(NSString *)key; + +/** + * Store an image into memory and optionally disk cache at the given key. + * + * @param image The image to store + * @param key The unique image cache key, usually it's image absolute URL + * @param toDisk Store the image to disk cache if YES + */ +- (void)storeImage:(UIImage *)image forKey:(NSString *)key toDisk:(BOOL)toDisk; + +/** + * Store an image into memory and optionally disk cache at the given key. + * + * @param image The image to store + * @param recalculate BOOL indicates if imageData can be used or a new data should be constructed from the UIImage + * @param imageData The image data as returned by the server, this representation will be used for disk storage + * instead of converting the given image object into a storable/compressed image format in order + * to save quality and CPU + * @param key The unique image cache key, usually it's image absolute URL + * @param toDisk Store the image to disk cache if YES + */ +- (void)storeImage:(UIImage *)image recalculateFromImage:(BOOL)recalculate imageData:(NSData *)imageData forKey:(NSString *)key toDisk:(BOOL)toDisk; + +/** + * Query the disk cache asynchronously. + * + * @param key The unique key used to store the wanted image + */ +- (NSOperation *)queryDiskCacheForKey:(NSString *)key done:(SDWebImageQueryCompletedBlock)doneBlock; + +/** + * Query the memory cache synchronously. + * + * @param key The unique key used to store the wanted image + */ +- (UIImage *)imageFromMemoryCacheForKey:(NSString *)key; + +/** + * Query the disk cache synchronously after checking the memory cache. + * + * @param key The unique key used to store the wanted image + */ +- (UIImage *)imageFromDiskCacheForKey:(NSString *)key; + +/** + * Remove the image from memory and disk cache synchronously + * + * @param key The unique image cache key + */ +- (void)removeImageForKey:(NSString *)key; + + +/** + * Remove the image from memory and disk cache asynchronously + * + * @param key The unique image cache key + * @param completion An block that should be executed after the image has been removed (optional) + */ +- (void)removeImageForKey:(NSString *)key withCompletion:(SDWebImageNoParamsBlock)completion; + +/** + * Remove the image from memory and optionally disk cache asynchronously + * + * @param key The unique image cache key + * @param fromDisk Also remove cache entry from disk if YES + */ +- (void)removeImageForKey:(NSString *)key fromDisk:(BOOL)fromDisk; + +/** + * Remove the image from memory and optionally disk cache asynchronously + * + * @param key The unique image cache key + * @param fromDisk Also remove cache entry from disk if YES + * @param completion An block that should be executed after the image has been removed (optional) + */ +- (void)removeImageForKey:(NSString *)key fromDisk:(BOOL)fromDisk withCompletion:(SDWebImageNoParamsBlock)completion; + +/** + * Clear all memory cached images + */ +- (void)clearMemory; + +/** + * Clear all disk cached images. Non-blocking method - returns immediately. + * @param completion An block that should be executed after cache expiration completes (optional) + */ +- (void)clearDiskOnCompletion:(SDWebImageNoParamsBlock)completion; + +/** + * Clear all disk cached images + * @see clearDiskOnCompletion: + */ +- (void)clearDisk; + +/** + * Remove all expired cached image from disk. Non-blocking method - returns immediately. + * @param completionBlock An block that should be executed after cache expiration completes (optional) + */ +- (void)cleanDiskWithCompletionBlock:(SDWebImageNoParamsBlock)completionBlock; + +/** + * Remove all expired cached image from disk + * @see cleanDiskWithCompletionBlock: + */ +- (void)cleanDisk; + +/** + * Get the size used by the disk cache + */ +- (NSUInteger)getSize; + +/** + * Get the number of images in the disk cache + */ +- (NSUInteger)getDiskCount; + +/** + * Asynchronously calculate the disk cache's size. + */ +- (void)calculateSizeWithCompletionBlock:(SDWebImageCalculateSizeBlock)completionBlock; + +/** + * Async check if image exists in disk cache already (does not load the image) + * + * @param key the key describing the url + * @param completionBlock the block to be executed when the check is done. + * @note the completion block will be always executed on the main queue + */ +- (void)diskImageExistsWithKey:(NSString *)key completion:(SDWebImageCheckCacheCompletionBlock)completionBlock; + +/** + * Check if image exists in disk cache already (does not load the image) + * + * @param key the key describing the url + * + * @return YES if an image exists for the given key + */ +- (BOOL)diskImageExistsWithKey:(NSString *)key; + +/** + * Get the cache path for a certain key (needs the cache path root folder) + * + * @param key the key (can be obtained from url using cacheKeyForURL) + * @param path the cache path root folder + * + * @return the cache path + */ +- (NSString *)cachePathForKey:(NSString *)key inPath:(NSString *)path; + +/** + * Get the default cache path for a certain key + * + * @param key the key (can be obtained from url using cacheKeyForURL) + * + * @return the default cache path + */ +- (NSString *)defaultCachePathForKey:(NSString *)key; + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/SDImageCache.m b/grocery-objc/Pods/SDWebImage/SDWebImage/SDImageCache.m new file mode 100644 index 0000000..aa0ff6c --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/SDImageCache.m @@ -0,0 +1,650 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDImageCache.h" +#import "SDWebImageDecoder.h" +#import "UIImage+MultiFormat.h" +#import + +// See https://github.com/rs/SDWebImage/pull/1141 for discussion +@interface AutoPurgeCache : NSCache +@end + +@implementation AutoPurgeCache + +- (id)init +{ + self = [super init]; + if (self) { + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(removeAllObjects) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; + } + return self; +} + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; + +} + +@end + +static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week +// PNG signature bytes and data (below) +static unsigned char kPNGSignatureBytes[8] = {0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A}; +static NSData *kPNGSignatureData = nil; + +BOOL ImageDataHasPNGPreffix(NSData *data); + +BOOL ImageDataHasPNGPreffix(NSData *data) { + NSUInteger pngSignatureLength = [kPNGSignatureData length]; + if ([data length] >= pngSignatureLength) { + if ([[data subdataWithRange:NSMakeRange(0, pngSignatureLength)] isEqualToData:kPNGSignatureData]) { + return YES; + } + } + + return NO; +} + +FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { + return image.size.height * image.size.width * image.scale * image.scale; +} + +@interface SDImageCache () + +@property (strong, nonatomic) NSCache *memCache; +@property (strong, nonatomic) NSString *diskCachePath; +@property (strong, nonatomic) NSMutableArray *customPaths; +@property (SDDispatchQueueSetterSementics, nonatomic) dispatch_queue_t ioQueue; + +@end + + +@implementation SDImageCache { + NSFileManager *_fileManager; +} + ++ (SDImageCache *)sharedImageCache { + static dispatch_once_t once; + static id instance; + dispatch_once(&once, ^{ + instance = [self new]; + }); + return instance; +} + +- (id)init { + return [self initWithNamespace:@"default"]; +} + +- (id)initWithNamespace:(NSString *)ns { + NSString *path = [self makeDiskCachePath:ns]; + return [self initWithNamespace:ns diskCacheDirectory:path]; +} + +- (id)initWithNamespace:(NSString *)ns diskCacheDirectory:(NSString *)directory { + if ((self = [super init])) { + NSString *fullNamespace = [@"com.hackemist.SDWebImageCache." stringByAppendingString:ns]; + + // initialise PNG signature data + kPNGSignatureData = [NSData dataWithBytes:kPNGSignatureBytes length:8]; + + // Create IO serial queue + _ioQueue = dispatch_queue_create("com.hackemist.SDWebImageCache", DISPATCH_QUEUE_SERIAL); + + // Init default values + _maxCacheAge = kDefaultCacheMaxCacheAge; + + // Init the memory cache + _memCache = [[AutoPurgeCache alloc] init]; + _memCache.name = fullNamespace; + + // Init the disk cache + if (directory != nil) { + _diskCachePath = [directory stringByAppendingPathComponent:fullNamespace]; + } else { + NSString *path = [self makeDiskCachePath:ns]; + _diskCachePath = path; + } + + // Set decompression to YES + _shouldDecompressImages = YES; + + // memory cache enabled + _shouldCacheImagesInMemory = YES; + + // Disable iCloud + _shouldDisableiCloud = YES; + + dispatch_sync(_ioQueue, ^{ + _fileManager = [NSFileManager new]; + }); + +#if TARGET_OS_IPHONE + // Subscribe to app events + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(clearMemory) + name:UIApplicationDidReceiveMemoryWarningNotification + object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(cleanDisk) + name:UIApplicationWillTerminateNotification + object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(backgroundCleanDisk) + name:UIApplicationDidEnterBackgroundNotification + object:nil]; +#endif + } + + return self; +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + SDDispatchQueueRelease(_ioQueue); +} + +- (void)addReadOnlyCachePath:(NSString *)path { + if (!self.customPaths) { + self.customPaths = [NSMutableArray new]; + } + + if (![self.customPaths containsObject:path]) { + [self.customPaths addObject:path]; + } +} + +- (NSString *)cachePathForKey:(NSString *)key inPath:(NSString *)path { + NSString *filename = [self cachedFileNameForKey:key]; + return [path stringByAppendingPathComponent:filename]; +} + +- (NSString *)defaultCachePathForKey:(NSString *)key { + return [self cachePathForKey:key inPath:self.diskCachePath]; +} + +#pragma mark SDImageCache (private) + +- (NSString *)cachedFileNameForKey:(NSString *)key { + const char *str = [key UTF8String]; + if (str == NULL) { + str = ""; + } + unsigned char r[CC_MD5_DIGEST_LENGTH]; + CC_MD5(str, (CC_LONG)strlen(str), r); + NSString *filename = [NSString stringWithFormat:@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%@", + r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10], + r[11], r[12], r[13], r[14], r[15], [[key pathExtension] isEqualToString:@""] ? @"" : [NSString stringWithFormat:@".%@", [key pathExtension]]]; + + return filename; +} + +#pragma mark ImageCache + +// Init the disk cache +-(NSString *)makeDiskCachePath:(NSString*)fullNamespace{ + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); + return [paths[0] stringByAppendingPathComponent:fullNamespace]; +} + +- (void)storeImage:(UIImage *)image recalculateFromImage:(BOOL)recalculate imageData:(NSData *)imageData forKey:(NSString *)key toDisk:(BOOL)toDisk { + if (!image || !key) { + return; + } + // if memory cache is enabled + if (self.shouldCacheImagesInMemory) { + NSUInteger cost = SDCacheCostForImage(image); + [self.memCache setObject:image forKey:key cost:cost]; + } + + if (toDisk) { + dispatch_async(self.ioQueue, ^{ + NSData *data = imageData; + + if (image && (recalculate || !data)) { +#if TARGET_OS_IPHONE + // We need to determine if the image is a PNG or a JPEG + // PNGs are easier to detect because they have a unique signature (http://www.w3.org/TR/PNG-Structure.html) + // The first eight bytes of a PNG file always contain the following (decimal) values: + // 137 80 78 71 13 10 26 10 + + // If the imageData is nil (i.e. if trying to save a UIImage directly or the image was transformed on download) + // and the image has an alpha channel, we will consider it PNG to avoid losing the transparency + int alphaInfo = CGImageGetAlphaInfo(image.CGImage); + BOOL hasAlpha = !(alphaInfo == kCGImageAlphaNone || + alphaInfo == kCGImageAlphaNoneSkipFirst || + alphaInfo == kCGImageAlphaNoneSkipLast); + BOOL imageIsPng = hasAlpha; + + // But if we have an image data, we will look at the preffix + if ([imageData length] >= [kPNGSignatureData length]) { + imageIsPng = ImageDataHasPNGPreffix(imageData); + } + + if (imageIsPng) { + data = UIImagePNGRepresentation(image); + } + else { + data = UIImageJPEGRepresentation(image, (CGFloat)1.0); + } +#else + data = [NSBitmapImageRep representationOfImageRepsInArray:image.representations usingType: NSJPEGFileType properties:nil]; +#endif + } + + if (data) { + if (![_fileManager fileExistsAtPath:_diskCachePath]) { + [_fileManager createDirectoryAtPath:_diskCachePath withIntermediateDirectories:YES attributes:nil error:NULL]; + } + + // get cache Path for image key + NSString *cachePathForKey = [self defaultCachePathForKey:key]; + // transform to NSUrl + NSURL *fileURL = [NSURL fileURLWithPath:cachePathForKey]; + + [_fileManager createFileAtPath:cachePathForKey contents:data attributes:nil]; + + // disable iCloud backup + if (self.shouldDisableiCloud) { + [fileURL setResourceValue:[NSNumber numberWithBool:YES] forKey:NSURLIsExcludedFromBackupKey error:nil]; + } + } + }); + } +} + +- (void)storeImage:(UIImage *)image forKey:(NSString *)key { + [self storeImage:image recalculateFromImage:YES imageData:nil forKey:key toDisk:YES]; +} + +- (void)storeImage:(UIImage *)image forKey:(NSString *)key toDisk:(BOOL)toDisk { + [self storeImage:image recalculateFromImage:YES imageData:nil forKey:key toDisk:toDisk]; +} + +- (BOOL)diskImageExistsWithKey:(NSString *)key { + BOOL exists = NO; + + // this is an exception to access the filemanager on another queue than ioQueue, but we are using the shared instance + // from apple docs on NSFileManager: The methods of the shared NSFileManager object can be called from multiple threads safely. + exists = [[NSFileManager defaultManager] fileExistsAtPath:[self defaultCachePathForKey:key]]; + + // fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name + // checking the key with and without the extension + if (!exists) { + exists = [[NSFileManager defaultManager] fileExistsAtPath:[[self defaultCachePathForKey:key] stringByDeletingPathExtension]]; + } + + return exists; +} + +- (void)diskImageExistsWithKey:(NSString *)key completion:(SDWebImageCheckCacheCompletionBlock)completionBlock { + dispatch_async(_ioQueue, ^{ + BOOL exists = [_fileManager fileExistsAtPath:[self defaultCachePathForKey:key]]; + + // fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name + // checking the key with and without the extension + if (!exists) { + exists = [_fileManager fileExistsAtPath:[[self defaultCachePathForKey:key] stringByDeletingPathExtension]]; + } + + if (completionBlock) { + dispatch_async(dispatch_get_main_queue(), ^{ + completionBlock(exists); + }); + } + }); +} + +- (UIImage *)imageFromMemoryCacheForKey:(NSString *)key { + return [self.memCache objectForKey:key]; +} + +- (UIImage *)imageFromDiskCacheForKey:(NSString *)key { + + // First check the in-memory cache... + UIImage *image = [self imageFromMemoryCacheForKey:key]; + if (image) { + return image; + } + + // Second check the disk cache... + UIImage *diskImage = [self diskImageForKey:key]; + if (diskImage && self.shouldCacheImagesInMemory) { + NSUInteger cost = SDCacheCostForImage(diskImage); + [self.memCache setObject:diskImage forKey:key cost:cost]; + } + + return diskImage; +} + +- (NSData *)diskImageDataBySearchingAllPathsForKey:(NSString *)key { + NSString *defaultPath = [self defaultCachePathForKey:key]; + NSData *data = [NSData dataWithContentsOfFile:defaultPath]; + if (data) { + return data; + } + + // fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name + // checking the key with and without the extension + data = [NSData dataWithContentsOfFile:[defaultPath stringByDeletingPathExtension]]; + if (data) { + return data; + } + + NSArray *customPaths = [self.customPaths copy]; + for (NSString *path in customPaths) { + NSString *filePath = [self cachePathForKey:key inPath:path]; + NSData *imageData = [NSData dataWithContentsOfFile:filePath]; + if (imageData) { + return imageData; + } + + // fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name + // checking the key with and without the extension + imageData = [NSData dataWithContentsOfFile:[filePath stringByDeletingPathExtension]]; + if (imageData) { + return imageData; + } + } + + return nil; +} + +- (UIImage *)diskImageForKey:(NSString *)key { + NSData *data = [self diskImageDataBySearchingAllPathsForKey:key]; + if (data) { + UIImage *image = [UIImage sd_imageWithData:data]; + image = [self scaledImageForKey:key image:image]; + if (self.shouldDecompressImages) { + image = [UIImage decodedImageWithImage:image]; + } + return image; + } + else { + return nil; + } +} + +- (UIImage *)scaledImageForKey:(NSString *)key image:(UIImage *)image { + return SDScaledImageForKey(key, image); +} + +- (NSOperation *)queryDiskCacheForKey:(NSString *)key done:(SDWebImageQueryCompletedBlock)doneBlock { + if (!doneBlock) { + return nil; + } + + if (!key) { + doneBlock(nil, SDImageCacheTypeNone); + return nil; + } + + // First check the in-memory cache... + UIImage *image = [self imageFromMemoryCacheForKey:key]; + if (image) { + doneBlock(image, SDImageCacheTypeMemory); + return nil; + } + + NSOperation *operation = [NSOperation new]; + dispatch_async(self.ioQueue, ^{ + if (operation.isCancelled) { + return; + } + + @autoreleasepool { + UIImage *diskImage = [self diskImageForKey:key]; + if (diskImage && self.shouldCacheImagesInMemory) { + NSUInteger cost = SDCacheCostForImage(diskImage); + [self.memCache setObject:diskImage forKey:key cost:cost]; + } + + dispatch_async(dispatch_get_main_queue(), ^{ + doneBlock(diskImage, SDImageCacheTypeDisk); + }); + } + }); + + return operation; +} + +- (void)removeImageForKey:(NSString *)key { + [self removeImageForKey:key withCompletion:nil]; +} + +- (void)removeImageForKey:(NSString *)key withCompletion:(SDWebImageNoParamsBlock)completion { + [self removeImageForKey:key fromDisk:YES withCompletion:completion]; +} + +- (void)removeImageForKey:(NSString *)key fromDisk:(BOOL)fromDisk { + [self removeImageForKey:key fromDisk:fromDisk withCompletion:nil]; +} + +- (void)removeImageForKey:(NSString *)key fromDisk:(BOOL)fromDisk withCompletion:(SDWebImageNoParamsBlock)completion { + + if (key == nil) { + return; + } + + if (self.shouldCacheImagesInMemory) { + [self.memCache removeObjectForKey:key]; + } + + if (fromDisk) { + dispatch_async(self.ioQueue, ^{ + [_fileManager removeItemAtPath:[self defaultCachePathForKey:key] error:nil]; + + if (completion) { + dispatch_async(dispatch_get_main_queue(), ^{ + completion(); + }); + } + }); + } else if (completion){ + completion(); + } + +} + +- (void)setMaxMemoryCost:(NSUInteger)maxMemoryCost { + self.memCache.totalCostLimit = maxMemoryCost; +} + +- (NSUInteger)maxMemoryCost { + return self.memCache.totalCostLimit; +} + +- (NSUInteger)maxMemoryCountLimit { + return self.memCache.countLimit; +} + +- (void)setMaxMemoryCountLimit:(NSUInteger)maxCountLimit { + self.memCache.countLimit = maxCountLimit; +} + +- (void)clearMemory { + [self.memCache removeAllObjects]; +} + +- (void)clearDisk { + [self clearDiskOnCompletion:nil]; +} + +- (void)clearDiskOnCompletion:(SDWebImageNoParamsBlock)completion +{ + dispatch_async(self.ioQueue, ^{ + [_fileManager removeItemAtPath:self.diskCachePath error:nil]; + [_fileManager createDirectoryAtPath:self.diskCachePath + withIntermediateDirectories:YES + attributes:nil + error:NULL]; + + if (completion) { + dispatch_async(dispatch_get_main_queue(), ^{ + completion(); + }); + } + }); +} + +- (void)cleanDisk { + [self cleanDiskWithCompletionBlock:nil]; +} + +- (void)cleanDiskWithCompletionBlock:(SDWebImageNoParamsBlock)completionBlock { + dispatch_async(self.ioQueue, ^{ + NSURL *diskCacheURL = [NSURL fileURLWithPath:self.diskCachePath isDirectory:YES]; + NSArray *resourceKeys = @[NSURLIsDirectoryKey, NSURLContentModificationDateKey, NSURLTotalFileAllocatedSizeKey]; + + // This enumerator prefetches useful properties for our cache files. + NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtURL:diskCacheURL + includingPropertiesForKeys:resourceKeys + options:NSDirectoryEnumerationSkipsHiddenFiles + errorHandler:NULL]; + + NSDate *expirationDate = [NSDate dateWithTimeIntervalSinceNow:-self.maxCacheAge]; + NSMutableDictionary *cacheFiles = [NSMutableDictionary dictionary]; + NSUInteger currentCacheSize = 0; + + // Enumerate all of the files in the cache directory. This loop has two purposes: + // + // 1. Removing files that are older than the expiration date. + // 2. Storing file attributes for the size-based cleanup pass. + NSMutableArray *urlsToDelete = [[NSMutableArray alloc] init]; + for (NSURL *fileURL in fileEnumerator) { + NSDictionary *resourceValues = [fileURL resourceValuesForKeys:resourceKeys error:NULL]; + + // Skip directories. + if ([resourceValues[NSURLIsDirectoryKey] boolValue]) { + continue; + } + + // Remove files that are older than the expiration date; + NSDate *modificationDate = resourceValues[NSURLContentModificationDateKey]; + if ([[modificationDate laterDate:expirationDate] isEqualToDate:expirationDate]) { + [urlsToDelete addObject:fileURL]; + continue; + } + + // Store a reference to this file and account for its total size. + NSNumber *totalAllocatedSize = resourceValues[NSURLTotalFileAllocatedSizeKey]; + currentCacheSize += [totalAllocatedSize unsignedIntegerValue]; + [cacheFiles setObject:resourceValues forKey:fileURL]; + } + + for (NSURL *fileURL in urlsToDelete) { + [_fileManager removeItemAtURL:fileURL error:nil]; + } + + // If our remaining disk cache exceeds a configured maximum size, perform a second + // size-based cleanup pass. We delete the oldest files first. + if (self.maxCacheSize > 0 && currentCacheSize > self.maxCacheSize) { + // Target half of our maximum cache size for this cleanup pass. + const NSUInteger desiredCacheSize = self.maxCacheSize / 2; + + // Sort the remaining cache files by their last modification time (oldest first). + NSArray *sortedFiles = [cacheFiles keysSortedByValueWithOptions:NSSortConcurrent + usingComparator:^NSComparisonResult(id obj1, id obj2) { + return [obj1[NSURLContentModificationDateKey] compare:obj2[NSURLContentModificationDateKey]]; + }]; + + // Delete files until we fall below our desired cache size. + for (NSURL *fileURL in sortedFiles) { + if ([_fileManager removeItemAtURL:fileURL error:nil]) { + NSDictionary *resourceValues = cacheFiles[fileURL]; + NSNumber *totalAllocatedSize = resourceValues[NSURLTotalFileAllocatedSizeKey]; + currentCacheSize -= [totalAllocatedSize unsignedIntegerValue]; + + if (currentCacheSize < desiredCacheSize) { + break; + } + } + } + } + if (completionBlock) { + dispatch_async(dispatch_get_main_queue(), ^{ + completionBlock(); + }); + } + }); +} + +- (void)backgroundCleanDisk { + Class UIApplicationClass = NSClassFromString(@"UIApplication"); + if(!UIApplicationClass || ![UIApplicationClass respondsToSelector:@selector(sharedApplication)]) { + return; + } + UIApplication *application = [UIApplication performSelector:@selector(sharedApplication)]; + __block UIBackgroundTaskIdentifier bgTask = [application beginBackgroundTaskWithExpirationHandler:^{ + // Clean up any unfinished task business by marking where you + // stopped or ending the task outright. + [application endBackgroundTask:bgTask]; + bgTask = UIBackgroundTaskInvalid; + }]; + + // Start the long-running task and return immediately. + [self cleanDiskWithCompletionBlock:^{ + [application endBackgroundTask:bgTask]; + bgTask = UIBackgroundTaskInvalid; + }]; +} + +- (NSUInteger)getSize { + __block NSUInteger size = 0; + dispatch_sync(self.ioQueue, ^{ + NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtPath:self.diskCachePath]; + for (NSString *fileName in fileEnumerator) { + NSString *filePath = [self.diskCachePath stringByAppendingPathComponent:fileName]; + NSDictionary *attrs = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil]; + size += [attrs fileSize]; + } + }); + return size; +} + +- (NSUInteger)getDiskCount { + __block NSUInteger count = 0; + dispatch_sync(self.ioQueue, ^{ + NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtPath:self.diskCachePath]; + count = [[fileEnumerator allObjects] count]; + }); + return count; +} + +- (void)calculateSizeWithCompletionBlock:(SDWebImageCalculateSizeBlock)completionBlock { + NSURL *diskCacheURL = [NSURL fileURLWithPath:self.diskCachePath isDirectory:YES]; + + dispatch_async(self.ioQueue, ^{ + NSUInteger fileCount = 0; + NSUInteger totalSize = 0; + + NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtURL:diskCacheURL + includingPropertiesForKeys:@[NSFileSize] + options:NSDirectoryEnumerationSkipsHiddenFiles + errorHandler:NULL]; + + for (NSURL *fileURL in fileEnumerator) { + NSNumber *fileSize; + [fileURL getResourceValue:&fileSize forKey:NSURLFileSizeKey error:NULL]; + totalSize += [fileSize unsignedIntegerValue]; + fileCount += 1; + } + + if (completionBlock) { + dispatch_async(dispatch_get_main_queue(), ^{ + completionBlock(fileCount, totalSize); + }); + } + }); +} + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageCompat.h b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageCompat.h new file mode 100644 index 0000000..3c21b41 --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageCompat.h @@ -0,0 +1,72 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * (c) Jamie Pinkham + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import + +#ifdef __OBJC_GC__ +#error SDWebImage does not support Objective-C Garbage Collection +#endif + +#if __IPHONE_OS_VERSION_MIN_REQUIRED != 20000 && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 +#error SDWebImage doesn't support Deployment Target version < 5.0 +#endif + +#if !TARGET_OS_IPHONE +#import +#ifndef UIImage +#define UIImage NSImage +#endif +#ifndef UIImageView +#define UIImageView NSImageView +#endif +#else + +#import + +#endif + +#ifndef NS_ENUM +#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type +#endif + +#ifndef NS_OPTIONS +#define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type +#endif + +#if OS_OBJECT_USE_OBJC + #undef SDDispatchQueueRelease + #undef SDDispatchQueueSetterSementics + #define SDDispatchQueueRelease(q) + #define SDDispatchQueueSetterSementics strong +#else +#undef SDDispatchQueueRelease +#undef SDDispatchQueueSetterSementics +#define SDDispatchQueueRelease(q) (dispatch_release(q)) +#define SDDispatchQueueSetterSementics assign +#endif + +extern UIImage *SDScaledImageForKey(NSString *key, UIImage *image); + +typedef void(^SDWebImageNoParamsBlock)(); + +extern NSString *const SDWebImageErrorDomain; + +#define dispatch_main_sync_safe(block)\ + if ([NSThread isMainThread]) {\ + block();\ + } else {\ + dispatch_sync(dispatch_get_main_queue(), block);\ + } + +#define dispatch_main_async_safe(block)\ + if ([NSThread isMainThread]) {\ + block();\ + } else {\ + dispatch_async(dispatch_get_main_queue(), block);\ + } diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m new file mode 100644 index 0000000..9a011bc --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m @@ -0,0 +1,51 @@ +// +// SDWebImageCompat.m +// SDWebImage +// +// Created by Olivier Poitrey on 11/12/12. +// Copyright (c) 2012 Dailymotion. All rights reserved. +// + +#import "SDWebImageCompat.h" + +#if !__has_feature(objc_arc) +#error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag +#endif + +inline UIImage *SDScaledImageForKey(NSString *key, UIImage *image) { + if (!image) { + return nil; + } + + if ([image.images count] > 0) { + NSMutableArray *scaledImages = [NSMutableArray array]; + + for (UIImage *tempImage in image.images) { + [scaledImages addObject:SDScaledImageForKey(key, tempImage)]; + } + + return [UIImage animatedImageWithImages:scaledImages duration:image.duration]; + } + else { + if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { + CGFloat scale = [UIScreen mainScreen].scale; + if (key.length >= 8) { + NSRange range = [key rangeOfString:@"@2x."]; + if (range.location != NSNotFound) { + scale = 2.0; + } + + range = [key rangeOfString:@"@3x."]; + if (range.location != NSNotFound) { + scale = 3.0; + } + } + + UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; + image = scaledImage; + } + return image; + } +} + +NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain"; diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.h b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.h new file mode 100644 index 0000000..0176a7b --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.h @@ -0,0 +1,18 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * Created by james on 9/28/11. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageCompat.h" + +@interface UIImage (ForceDecode) + ++ (UIImage *)decodedImageWithImage:(UIImage *)image; + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.m b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.m new file mode 100644 index 0000000..a7c0246 --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.m @@ -0,0 +1,69 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * Created by james on 9/28/11. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageDecoder.h" + +@implementation UIImage (ForceDecode) + ++ (UIImage *)decodedImageWithImage:(UIImage *)image { + // while downloading huge amount of images + // autorelease the bitmap context + // and all vars to help system to free memory + // when there are memory warning. + // on iOS7, do not forget to call + // [[SDImageCache sharedImageCache] clearMemory]; + @autoreleasepool{ + // do not decode animated images + if (image.images) { return image; } + + CGImageRef imageRef = image.CGImage; + + CGImageAlphaInfo alpha = CGImageGetAlphaInfo(imageRef); + BOOL anyAlpha = (alpha == kCGImageAlphaFirst || + alpha == kCGImageAlphaLast || + alpha == kCGImageAlphaPremultipliedFirst || + alpha == kCGImageAlphaPremultipliedLast); + + if (anyAlpha) { return image; } + + size_t width = CGImageGetWidth(imageRef); + size_t height = CGImageGetHeight(imageRef); + + // current + CGColorSpaceModel imageColorSpaceModel = CGColorSpaceGetModel(CGImageGetColorSpace(imageRef)); + CGColorSpaceRef colorspaceRef = CGImageGetColorSpace(imageRef); + + bool unsupportedColorSpace = (imageColorSpaceModel == 0 || imageColorSpaceModel == -1 || imageColorSpaceModel == kCGColorSpaceModelCMYK || imageColorSpaceModel == kCGColorSpaceModelIndexed); + if (unsupportedColorSpace) + colorspaceRef = CGColorSpaceCreateDeviceRGB(); + + CGContextRef context = CGBitmapContextCreate(NULL, width, + height, + CGImageGetBitsPerComponent(imageRef), + 0, + colorspaceRef, + kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedFirst); + + // Draw the image into the context and retrieve the new image, which will now have an alpha layer + CGContextDrawImage(context, CGRectMake(0, 0, width, height), imageRef); + CGImageRef imageRefWithAlpha = CGBitmapContextCreateImage(context); + UIImage *imageWithAlpha = [UIImage imageWithCGImage:imageRefWithAlpha scale:image.scale orientation:image.imageOrientation]; + + if (unsupportedColorSpace) + CGColorSpaceRelease(colorspaceRef); + + CGContextRelease(context); + CGImageRelease(imageRefWithAlpha); + + return imageWithAlpha; + } +} + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.h b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.h new file mode 100644 index 0000000..b64fb13 --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.h @@ -0,0 +1,191 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageCompat.h" +#import "SDWebImageOperation.h" + +typedef NS_OPTIONS(NSUInteger, SDWebImageDownloaderOptions) { + SDWebImageDownloaderLowPriority = 1 << 0, + SDWebImageDownloaderProgressiveDownload = 1 << 1, + + /** + * By default, request prevent the of NSURLCache. With this flag, NSURLCache + * is used with default policies. + */ + SDWebImageDownloaderUseNSURLCache = 1 << 2, + + /** + * Call completion block with nil image/imageData if the image was read from NSURLCache + * (to be combined with `SDWebImageDownloaderUseNSURLCache`). + */ + + SDWebImageDownloaderIgnoreCachedResponse = 1 << 3, + /** + * In iOS 4+, continue the download of the image if the app goes to background. This is achieved by asking the system for + * extra time in background to let the request finish. If the background task expires the operation will be cancelled. + */ + + SDWebImageDownloaderContinueInBackground = 1 << 4, + + /** + * Handles cookies stored in NSHTTPCookieStore by setting + * NSMutableURLRequest.HTTPShouldHandleCookies = YES; + */ + SDWebImageDownloaderHandleCookies = 1 << 5, + + /** + * Enable to allow untrusted SSL certificates. + * Useful for testing purposes. Use with caution in production. + */ + SDWebImageDownloaderAllowInvalidSSLCertificates = 1 << 6, + + /** + * Put the image in the high priority queue. + */ + SDWebImageDownloaderHighPriority = 1 << 7, +}; + +typedef NS_ENUM(NSInteger, SDWebImageDownloaderExecutionOrder) { + /** + * Default value. All download operations will execute in queue style (first-in-first-out). + */ + SDWebImageDownloaderFIFOExecutionOrder, + + /** + * All download operations will execute in stack style (last-in-first-out). + */ + SDWebImageDownloaderLIFOExecutionOrder +}; + +extern NSString *const SDWebImageDownloadStartNotification; +extern NSString *const SDWebImageDownloadStopNotification; + +typedef void(^SDWebImageDownloaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize); + +typedef void(^SDWebImageDownloaderCompletedBlock)(UIImage *image, NSData *data, NSError *error, BOOL finished); + +typedef NSDictionary *(^SDWebImageDownloaderHeadersFilterBlock)(NSURL *url, NSDictionary *headers); + +/** + * Asynchronous downloader dedicated and optimized for image loading. + */ +@interface SDWebImageDownloader : NSObject + +/** + * Decompressing images that are downloaded and cached can improve performance but can consume lot of memory. + * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption. + */ +@property (assign, nonatomic) BOOL shouldDecompressImages; + +@property (assign, nonatomic) NSInteger maxConcurrentDownloads; + +/** + * Shows the current amount of downloads that still need to be downloaded + */ +@property (readonly, nonatomic) NSUInteger currentDownloadCount; + + +/** + * The timeout value (in seconds) for the download operation. Default: 15.0. + */ +@property (assign, nonatomic) NSTimeInterval downloadTimeout; + + +/** + * Changes download operations execution order. Default value is `SDWebImageDownloaderFIFOExecutionOrder`. + */ +@property (assign, nonatomic) SDWebImageDownloaderExecutionOrder executionOrder; + +/** + * Singleton method, returns the shared instance + * + * @return global shared instance of downloader class + */ ++ (SDWebImageDownloader *)sharedDownloader; + +/** + * Set the default URL credential to be set for request operations. + */ +@property (strong, nonatomic) NSURLCredential *urlCredential; + +/** + * Set username + */ +@property (strong, nonatomic) NSString *username; + +/** + * Set password + */ +@property (strong, nonatomic) NSString *password; + +/** + * Set filter to pick headers for downloading image HTTP request. + * + * This block will be invoked for each downloading image request, returned + * NSDictionary will be used as headers in corresponding HTTP request. + */ +@property (nonatomic, copy) SDWebImageDownloaderHeadersFilterBlock headersFilter; + +/** + * Set a value for a HTTP header to be appended to each download HTTP request. + * + * @param value The value for the header field. Use `nil` value to remove the header. + * @param field The name of the header field to set. + */ +- (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)field; + +/** + * Returns the value of the specified HTTP header field. + * + * @return The value associated with the header field field, or `nil` if there is no corresponding header field. + */ +- (NSString *)valueForHTTPHeaderField:(NSString *)field; + +/** + * Sets a subclass of `SDWebImageDownloaderOperation` as the default + * `NSOperation` to be used each time SDWebImage constructs a request + * operation to download an image. + * + * @param operationClass The subclass of `SDWebImageDownloaderOperation` to set + * as default. Passing `nil` will revert to `SDWebImageDownloaderOperation`. + */ +- (void)setOperationClass:(Class)operationClass; + +/** + * Creates a SDWebImageDownloader async downloader instance with a given URL + * + * The delegate will be informed when the image is finish downloaded or an error has happen. + * + * @see SDWebImageDownloaderDelegate + * + * @param url The URL to the image to download + * @param options The options to be used for this download + * @param progressBlock A block called repeatedly while the image is downloading + * @param completedBlock A block called once the download is completed. + * If the download succeeded, the image parameter is set, in case of error, + * error parameter is set with the error. The last parameter is always YES + * if SDWebImageDownloaderProgressiveDownload isn't use. With the + * SDWebImageDownloaderProgressiveDownload option, this block is called + * repeatedly with the partial image object and the finished argument set to NO + * before to be called a last time with the full image and finished argument + * set to YES. In case of error, the finished argument is always YES. + * + * @return A cancellable SDWebImageOperation + */ +- (id )downloadImageWithURL:(NSURL *)url + options:(SDWebImageDownloaderOptions)options + progress:(SDWebImageDownloaderProgressBlock)progressBlock + completed:(SDWebImageDownloaderCompletedBlock)completedBlock; + +/** + * Sets the download queue suspension state + */ +- (void)setSuspended:(BOOL)suspended; + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.m b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.m new file mode 100644 index 0000000..1fdcfc9 --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.m @@ -0,0 +1,232 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageDownloader.h" +#import "SDWebImageDownloaderOperation.h" +#import + +static NSString *const kProgressCallbackKey = @"progress"; +static NSString *const kCompletedCallbackKey = @"completed"; + +@interface SDWebImageDownloader () + +@property (strong, nonatomic) NSOperationQueue *downloadQueue; +@property (weak, nonatomic) NSOperation *lastAddedOperation; +@property (assign, nonatomic) Class operationClass; +@property (strong, nonatomic) NSMutableDictionary *URLCallbacks; +@property (strong, nonatomic) NSMutableDictionary *HTTPHeaders; +// This queue is used to serialize the handling of the network responses of all the download operation in a single queue +@property (SDDispatchQueueSetterSementics, nonatomic) dispatch_queue_t barrierQueue; + +@end + +@implementation SDWebImageDownloader + ++ (void)initialize { + // Bind SDNetworkActivityIndicator if available (download it here: http://github.com/rs/SDNetworkActivityIndicator ) + // To use it, just add #import "SDNetworkActivityIndicator.h" in addition to the SDWebImage import + if (NSClassFromString(@"SDNetworkActivityIndicator")) { + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + id activityIndicator = [NSClassFromString(@"SDNetworkActivityIndicator") performSelector:NSSelectorFromString(@"sharedActivityIndicator")]; +#pragma clang diagnostic pop + + // Remove observer in case it was previously added. + [[NSNotificationCenter defaultCenter] removeObserver:activityIndicator name:SDWebImageDownloadStartNotification object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:activityIndicator name:SDWebImageDownloadStopNotification object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:activityIndicator + selector:NSSelectorFromString(@"startActivity") + name:SDWebImageDownloadStartNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:activityIndicator + selector:NSSelectorFromString(@"stopActivity") + name:SDWebImageDownloadStopNotification object:nil]; + } +} + ++ (SDWebImageDownloader *)sharedDownloader { + static dispatch_once_t once; + static id instance; + dispatch_once(&once, ^{ + instance = [self new]; + }); + return instance; +} + +- (id)init { + if ((self = [super init])) { + _operationClass = [SDWebImageDownloaderOperation class]; + _shouldDecompressImages = YES; + _executionOrder = SDWebImageDownloaderFIFOExecutionOrder; + _downloadQueue = [NSOperationQueue new]; + _downloadQueue.maxConcurrentOperationCount = 6; + _URLCallbacks = [NSMutableDictionary new]; +#ifdef SD_WEBP + _HTTPHeaders = [@{@"Accept": @"image/webp,image/*;q=0.8"} mutableCopy]; +#else + _HTTPHeaders = [@{@"Accept": @"image/*;q=0.8"} mutableCopy]; +#endif + _barrierQueue = dispatch_queue_create("com.hackemist.SDWebImageDownloaderBarrierQueue", DISPATCH_QUEUE_CONCURRENT); + _downloadTimeout = 15.0; + } + return self; +} + +- (void)dealloc { + [self.downloadQueue cancelAllOperations]; + SDDispatchQueueRelease(_barrierQueue); +} + +- (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)field { + if (value) { + self.HTTPHeaders[field] = value; + } + else { + [self.HTTPHeaders removeObjectForKey:field]; + } +} + +- (NSString *)valueForHTTPHeaderField:(NSString *)field { + return self.HTTPHeaders[field]; +} + +- (void)setMaxConcurrentDownloads:(NSInteger)maxConcurrentDownloads { + _downloadQueue.maxConcurrentOperationCount = maxConcurrentDownloads; +} + +- (NSUInteger)currentDownloadCount { + return _downloadQueue.operationCount; +} + +- (NSInteger)maxConcurrentDownloads { + return _downloadQueue.maxConcurrentOperationCount; +} + +- (void)setOperationClass:(Class)operationClass { + _operationClass = operationClass ?: [SDWebImageDownloaderOperation class]; +} + +- (id )downloadImageWithURL:(NSURL *)url options:(SDWebImageDownloaderOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageDownloaderCompletedBlock)completedBlock { + __block SDWebImageDownloaderOperation *operation; + __weak __typeof(self)wself = self; + + [self addProgressCallback:progressBlock completedBlock:completedBlock forURL:url createCallback:^{ + NSTimeInterval timeoutInterval = wself.downloadTimeout; + if (timeoutInterval == 0.0) { + timeoutInterval = 15.0; + } + + // In order to prevent from potential duplicate caching (NSURLCache + SDImageCache) we disable the cache for image requests if told otherwise + NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url cachePolicy:(options & SDWebImageDownloaderUseNSURLCache ? NSURLRequestUseProtocolCachePolicy : NSURLRequestReloadIgnoringLocalCacheData) timeoutInterval:timeoutInterval]; + request.HTTPShouldHandleCookies = (options & SDWebImageDownloaderHandleCookies); + request.HTTPShouldUsePipelining = YES; + if (wself.headersFilter) { + request.allHTTPHeaderFields = wself.headersFilter(url, [wself.HTTPHeaders copy]); + } + else { + request.allHTTPHeaderFields = wself.HTTPHeaders; + } + operation = [[wself.operationClass alloc] initWithRequest:request + options:options + progress:^(NSInteger receivedSize, NSInteger expectedSize) { + SDWebImageDownloader *sself = wself; + if (!sself) return; + __block NSArray *callbacksForURL; + dispatch_sync(sself.barrierQueue, ^{ + callbacksForURL = [sself.URLCallbacks[url] copy]; + }); + for (NSDictionary *callbacks in callbacksForURL) { + dispatch_async(dispatch_get_main_queue(), ^{ + SDWebImageDownloaderProgressBlock callback = callbacks[kProgressCallbackKey]; + if (callback) callback(receivedSize, expectedSize); + }); + } + } + completed:^(UIImage *image, NSData *data, NSError *error, BOOL finished) { + SDWebImageDownloader *sself = wself; + if (!sself) return; + __block NSArray *callbacksForURL; + dispatch_barrier_sync(sself.barrierQueue, ^{ + callbacksForURL = [sself.URLCallbacks[url] copy]; + if (finished) { + [sself.URLCallbacks removeObjectForKey:url]; + } + }); + for (NSDictionary *callbacks in callbacksForURL) { + SDWebImageDownloaderCompletedBlock callback = callbacks[kCompletedCallbackKey]; + if (callback) callback(image, data, error, finished); + } + } + cancelled:^{ + SDWebImageDownloader *sself = wself; + if (!sself) return; + dispatch_barrier_async(sself.barrierQueue, ^{ + [sself.URLCallbacks removeObjectForKey:url]; + }); + }]; + operation.shouldDecompressImages = wself.shouldDecompressImages; + + if (wself.urlCredential) { + operation.credential = wself.urlCredential; + } else if (wself.username && wself.password) { + operation.credential = [NSURLCredential credentialWithUser:wself.username password:wself.password persistence:NSURLCredentialPersistenceForSession]; + } + + if (options & SDWebImageDownloaderHighPriority) { + operation.queuePriority = NSOperationQueuePriorityHigh; + } else if (options & SDWebImageDownloaderLowPriority) { + operation.queuePriority = NSOperationQueuePriorityLow; + } + + [wself.downloadQueue addOperation:operation]; + if (wself.executionOrder == SDWebImageDownloaderLIFOExecutionOrder) { + // Emulate LIFO execution order by systematically adding new operations as last operation's dependency + [wself.lastAddedOperation addDependency:operation]; + wself.lastAddedOperation = operation; + } + }]; + + return operation; +} + +- (void)addProgressCallback:(SDWebImageDownloaderProgressBlock)progressBlock completedBlock:(SDWebImageDownloaderCompletedBlock)completedBlock forURL:(NSURL *)url createCallback:(SDWebImageNoParamsBlock)createCallback { + // The URL will be used as the key to the callbacks dictionary so it cannot be nil. If it is nil immediately call the completed block with no image or data. + if (url == nil) { + if (completedBlock != nil) { + completedBlock(nil, nil, nil, NO); + } + return; + } + + dispatch_barrier_sync(self.barrierQueue, ^{ + BOOL first = NO; + if (!self.URLCallbacks[url]) { + self.URLCallbacks[url] = [NSMutableArray new]; + first = YES; + } + + // Handle single download of simultaneous download request for the same URL + NSMutableArray *callbacksForURL = self.URLCallbacks[url]; + NSMutableDictionary *callbacks = [NSMutableDictionary new]; + if (progressBlock) callbacks[kProgressCallbackKey] = [progressBlock copy]; + if (completedBlock) callbacks[kCompletedCallbackKey] = [completedBlock copy]; + [callbacksForURL addObject:callbacks]; + self.URLCallbacks[url] = callbacksForURL; + + if (first) { + createCallback(); + } + }); +} + +- (void)setSuspended:(BOOL)suspended { + [self.downloadQueue setSuspended:suspended]; +} + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h new file mode 100644 index 0000000..dd48b22 --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h @@ -0,0 +1,78 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageDownloader.h" +#import "SDWebImageOperation.h" + +extern NSString *const SDWebImageDownloadStartNotification; +extern NSString *const SDWebImageDownloadReceiveResponseNotification; +extern NSString *const SDWebImageDownloadStopNotification; +extern NSString *const SDWebImageDownloadFinishNotification; + +@interface SDWebImageDownloaderOperation : NSOperation + +/** + * The request used by the operation's connection. + */ +@property (strong, nonatomic, readonly) NSURLRequest *request; + + +@property (assign, nonatomic) BOOL shouldDecompressImages; + +/** + * Whether the URL connection should consult the credential storage for authenticating the connection. `YES` by default. + * + * This is the value that is returned in the `NSURLConnectionDelegate` method `-connectionShouldUseCredentialStorage:`. + */ +@property (nonatomic, assign) BOOL shouldUseCredentialStorage; + +/** + * The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`. + * + * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present. + */ +@property (nonatomic, strong) NSURLCredential *credential; + +/** + * The SDWebImageDownloaderOptions for the receiver. + */ +@property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options; + +/** + * The expected size of data. + */ +@property (assign, nonatomic) NSInteger expectedSize; + +/** + * The response returned by the operation's connection. + */ +@property (strong, nonatomic) NSURLResponse *response; + +/** + * Initializes a `SDWebImageDownloaderOperation` object + * + * @see SDWebImageDownloaderOperation + * + * @param request the URL request + * @param options downloader options + * @param progressBlock the block executed when a new chunk of data arrives. + * @note the progress block is executed on a background queue + * @param completedBlock the block executed when the download is done. + * @note the completed block is executed on the main queue for success. If errors are found, there is a chance the block will be executed on a background queue + * @param cancelBlock the block executed if the download (operation) is cancelled + * + * @return the initialized instance + */ +- (id)initWithRequest:(NSURLRequest *)request + options:(SDWebImageDownloaderOptions)options + progress:(SDWebImageDownloaderProgressBlock)progressBlock + completed:(SDWebImageDownloaderCompletedBlock)completedBlock + cancelled:(SDWebImageNoParamsBlock)cancelBlock; + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.m b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.m new file mode 100644 index 0000000..5a8bd11 --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.m @@ -0,0 +1,466 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageDownloaderOperation.h" +#import "SDWebImageDecoder.h" +#import "UIImage+MultiFormat.h" +#import +#import "SDWebImageManager.h" + +NSString *const SDWebImageDownloadStartNotification = @"SDWebImageDownloadStartNotification"; +NSString *const SDWebImageDownloadReceiveResponseNotification = @"SDWebImageDownloadReceiveResponseNotification"; +NSString *const SDWebImageDownloadStopNotification = @"SDWebImageDownloadStopNotification"; +NSString *const SDWebImageDownloadFinishNotification = @"SDWebImageDownloadFinishNotification"; + +@interface SDWebImageDownloaderOperation () + +@property (copy, nonatomic) SDWebImageDownloaderProgressBlock progressBlock; +@property (copy, nonatomic) SDWebImageDownloaderCompletedBlock completedBlock; +@property (copy, nonatomic) SDWebImageNoParamsBlock cancelBlock; + +@property (assign, nonatomic, getter = isExecuting) BOOL executing; +@property (assign, nonatomic, getter = isFinished) BOOL finished; +@property (strong, nonatomic) NSMutableData *imageData; +@property (strong, nonatomic) NSURLConnection *connection; +@property (strong, atomic) NSThread *thread; + +#if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0 +@property (assign, nonatomic) UIBackgroundTaskIdentifier backgroundTaskId; +#endif + +@end + +@implementation SDWebImageDownloaderOperation { + size_t width, height; + UIImageOrientation orientation; + BOOL responseFromCached; +} + +@synthesize executing = _executing; +@synthesize finished = _finished; + +- (id)initWithRequest:(NSURLRequest *)request + options:(SDWebImageDownloaderOptions)options + progress:(SDWebImageDownloaderProgressBlock)progressBlock + completed:(SDWebImageDownloaderCompletedBlock)completedBlock + cancelled:(SDWebImageNoParamsBlock)cancelBlock { + if ((self = [super init])) { + _request = request; + _shouldDecompressImages = YES; + _shouldUseCredentialStorage = YES; + _options = options; + _progressBlock = [progressBlock copy]; + _completedBlock = [completedBlock copy]; + _cancelBlock = [cancelBlock copy]; + _executing = NO; + _finished = NO; + _expectedSize = 0; + responseFromCached = YES; // Initially wrong until `connection:willCacheResponse:` is called or not called + } + return self; +} + +- (void)start { + @synchronized (self) { + if (self.isCancelled) { + self.finished = YES; + [self reset]; + return; + } + +#if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0 + Class UIApplicationClass = NSClassFromString(@"UIApplication"); + BOOL hasApplication = UIApplicationClass && [UIApplicationClass respondsToSelector:@selector(sharedApplication)]; + if (hasApplication && [self shouldContinueWhenAppEntersBackground]) { + __weak __typeof__ (self) wself = self; + UIApplication * app = [UIApplicationClass performSelector:@selector(sharedApplication)]; + self.backgroundTaskId = [app beginBackgroundTaskWithExpirationHandler:^{ + __strong __typeof (wself) sself = wself; + + if (sself) { + [sself cancel]; + + [app endBackgroundTask:sself.backgroundTaskId]; + sself.backgroundTaskId = UIBackgroundTaskInvalid; + } + }]; + } +#endif + + self.executing = YES; + self.connection = [[NSURLConnection alloc] initWithRequest:self.request delegate:self startImmediately:NO]; + self.thread = [NSThread currentThread]; + } + + [self.connection start]; + + if (self.connection) { + if (self.progressBlock) { + self.progressBlock(0, NSURLResponseUnknownLength); + } + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStartNotification object:self]; + }); + + if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_5_1) { + // Make sure to run the runloop in our background thread so it can process downloaded data + // Note: we use a timeout to work around an issue with NSURLConnection cancel under iOS 5 + // not waking up the runloop, leading to dead threads (see https://github.com/rs/SDWebImage/issues/466) + CFRunLoopRunInMode(kCFRunLoopDefaultMode, 10, false); + } + else { + CFRunLoopRun(); + } + + if (!self.isFinished) { + [self.connection cancel]; + [self connection:self.connection didFailWithError:[NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorTimedOut userInfo:@{NSURLErrorFailingURLErrorKey : self.request.URL}]]; + } + } + else { + if (self.completedBlock) { + self.completedBlock(nil, nil, [NSError errorWithDomain:NSURLErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey : @"Connection can't be initialized"}], YES); + } + } + +#if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0 + Class UIApplicationClass = NSClassFromString(@"UIApplication"); + if(!UIApplicationClass || ![UIApplicationClass respondsToSelector:@selector(sharedApplication)]) { + return; + } + if (self.backgroundTaskId != UIBackgroundTaskInvalid) { + UIApplication * app = [UIApplication performSelector:@selector(sharedApplication)]; + [app endBackgroundTask:self.backgroundTaskId]; + self.backgroundTaskId = UIBackgroundTaskInvalid; + } +#endif +} + +- (void)cancel { + @synchronized (self) { + if (self.thread) { + [self performSelector:@selector(cancelInternalAndStop) onThread:self.thread withObject:nil waitUntilDone:NO]; + } + else { + [self cancelInternal]; + } + } +} + +- (void)cancelInternalAndStop { + if (self.isFinished) return; + [self cancelInternal]; + CFRunLoopStop(CFRunLoopGetCurrent()); +} + +- (void)cancelInternal { + if (self.isFinished) return; + [super cancel]; + if (self.cancelBlock) self.cancelBlock(); + + if (self.connection) { + [self.connection cancel]; + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:self]; + }); + + // As we cancelled the connection, its callback won't be called and thus won't + // maintain the isFinished and isExecuting flags. + if (self.isExecuting) self.executing = NO; + if (!self.isFinished) self.finished = YES; + } + + [self reset]; +} + +- (void)done { + self.finished = YES; + self.executing = NO; + [self reset]; +} + +- (void)reset { + self.cancelBlock = nil; + self.completedBlock = nil; + self.progressBlock = nil; + self.connection = nil; + self.imageData = nil; + self.thread = nil; +} + +- (void)setFinished:(BOOL)finished { + [self willChangeValueForKey:@"isFinished"]; + _finished = finished; + [self didChangeValueForKey:@"isFinished"]; +} + +- (void)setExecuting:(BOOL)executing { + [self willChangeValueForKey:@"isExecuting"]; + _executing = executing; + [self didChangeValueForKey:@"isExecuting"]; +} + +- (BOOL)isConcurrent { + return YES; +} + +#pragma mark NSURLConnection (delegate) + +- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { + + //'304 Not Modified' is an exceptional one + if (![response respondsToSelector:@selector(statusCode)] || ([((NSHTTPURLResponse *)response) statusCode] < 400 && [((NSHTTPURLResponse *)response) statusCode] != 304)) { + NSInteger expected = response.expectedContentLength > 0 ? (NSInteger)response.expectedContentLength : 0; + self.expectedSize = expected; + if (self.progressBlock) { + self.progressBlock(0, expected); + } + + self.imageData = [[NSMutableData alloc] initWithCapacity:expected]; + self.response = response; + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadReceiveResponseNotification object:self]; + }); + } + else { + NSUInteger code = [((NSHTTPURLResponse *)response) statusCode]; + + //This is the case when server returns '304 Not Modified'. It means that remote image is not changed. + //In case of 304 we need just cancel the operation and return cached image from the cache. + if (code == 304) { + [self cancelInternal]; + } else { + [self.connection cancel]; + } + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:self]; + }); + + if (self.completedBlock) { + self.completedBlock(nil, nil, [NSError errorWithDomain:NSURLErrorDomain code:[((NSHTTPURLResponse *)response) statusCode] userInfo:nil], YES); + } + CFRunLoopStop(CFRunLoopGetCurrent()); + [self done]; + } +} + +- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { + [self.imageData appendData:data]; + + if ((self.options & SDWebImageDownloaderProgressiveDownload) && self.expectedSize > 0 && self.completedBlock) { + // The following code is from http://www.cocoaintheshell.com/2011/05/progressive-images-download-imageio/ + // Thanks to the author @Nyx0uf + + // Get the total bytes downloaded + const NSInteger totalSize = self.imageData.length; + + // Update the data source, we must pass ALL the data, not just the new bytes + CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)self.imageData, NULL); + + if (width + height == 0) { + CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL); + if (properties) { + NSInteger orientationValue = -1; + CFTypeRef val = CFDictionaryGetValue(properties, kCGImagePropertyPixelHeight); + if (val) CFNumberGetValue(val, kCFNumberLongType, &height); + val = CFDictionaryGetValue(properties, kCGImagePropertyPixelWidth); + if (val) CFNumberGetValue(val, kCFNumberLongType, &width); + val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation); + if (val) CFNumberGetValue(val, kCFNumberNSIntegerType, &orientationValue); + CFRelease(properties); + + // When we draw to Core Graphics, we lose orientation information, + // which means the image below born of initWithCGIImage will be + // oriented incorrectly sometimes. (Unlike the image born of initWithData + // in connectionDidFinishLoading.) So save it here and pass it on later. + orientation = [[self class] orientationFromPropertyValue:(orientationValue == -1 ? 1 : orientationValue)]; + } + + } + + if (width + height > 0 && totalSize < self.expectedSize) { + // Create the image + CGImageRef partialImageRef = CGImageSourceCreateImageAtIndex(imageSource, 0, NULL); + +#ifdef TARGET_OS_IPHONE + // Workaround for iOS anamorphic image + if (partialImageRef) { + const size_t partialHeight = CGImageGetHeight(partialImageRef); + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CGContextRef bmContext = CGBitmapContextCreate(NULL, width, height, 8, width * 4, colorSpace, kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedFirst); + CGColorSpaceRelease(colorSpace); + if (bmContext) { + CGContextDrawImage(bmContext, (CGRect){.origin.x = 0.0f, .origin.y = 0.0f, .size.width = width, .size.height = partialHeight}, partialImageRef); + CGImageRelease(partialImageRef); + partialImageRef = CGBitmapContextCreateImage(bmContext); + CGContextRelease(bmContext); + } + else { + CGImageRelease(partialImageRef); + partialImageRef = nil; + } + } +#endif + + if (partialImageRef) { + UIImage *image = [UIImage imageWithCGImage:partialImageRef scale:1 orientation:orientation]; + NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:self.request.URL]; + UIImage *scaledImage = [self scaledImageForKey:key image:image]; + if (self.shouldDecompressImages) { + image = [UIImage decodedImageWithImage:scaledImage]; + } + else { + image = scaledImage; + } + CGImageRelease(partialImageRef); + dispatch_main_sync_safe(^{ + if (self.completedBlock) { + self.completedBlock(image, nil, nil, NO); + } + }); + } + } + + CFRelease(imageSource); + } + + if (self.progressBlock) { + self.progressBlock(self.imageData.length, self.expectedSize); + } +} + ++ (UIImageOrientation)orientationFromPropertyValue:(NSInteger)value { + switch (value) { + case 1: + return UIImageOrientationUp; + case 3: + return UIImageOrientationDown; + case 8: + return UIImageOrientationLeft; + case 6: + return UIImageOrientationRight; + case 2: + return UIImageOrientationUpMirrored; + case 4: + return UIImageOrientationDownMirrored; + case 5: + return UIImageOrientationLeftMirrored; + case 7: + return UIImageOrientationRightMirrored; + default: + return UIImageOrientationUp; + } +} + +- (UIImage *)scaledImageForKey:(NSString *)key image:(UIImage *)image { + return SDScaledImageForKey(key, image); +} + +- (void)connectionDidFinishLoading:(NSURLConnection *)aConnection { + SDWebImageDownloaderCompletedBlock completionBlock = self.completedBlock; + @synchronized(self) { + CFRunLoopStop(CFRunLoopGetCurrent()); + self.thread = nil; + self.connection = nil; + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:self]; + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadFinishNotification object:self]; + }); + } + + if (![[NSURLCache sharedURLCache] cachedResponseForRequest:_request]) { + responseFromCached = NO; + } + + if (completionBlock) { + if (self.options & SDWebImageDownloaderIgnoreCachedResponse && responseFromCached) { + completionBlock(nil, nil, nil, YES); + } else if (self.imageData) { + UIImage *image = [UIImage sd_imageWithData:self.imageData]; + NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:self.request.URL]; + image = [self scaledImageForKey:key image:image]; + + // Do not force decoding animated GIFs + if (!image.images) { + if (self.shouldDecompressImages) { + image = [UIImage decodedImageWithImage:image]; + } + } + if (CGSizeEqualToSize(image.size, CGSizeZero)) { + completionBlock(nil, nil, [NSError errorWithDomain:SDWebImageErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey : @"Downloaded image has 0 pixels"}], YES); + } + else { + completionBlock(image, self.imageData, nil, YES); + } + } else { + completionBlock(nil, nil, [NSError errorWithDomain:SDWebImageErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey : @"Image data is nil"}], YES); + } + } + self.completionBlock = nil; + [self done]; +} + +- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { + @synchronized(self) { + CFRunLoopStop(CFRunLoopGetCurrent()); + self.thread = nil; + self.connection = nil; + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:self]; + }); + } + + if (self.completedBlock) { + self.completedBlock(nil, nil, error, YES); + } + self.completionBlock = nil; + [self done]; +} + +- (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse { + responseFromCached = NO; // If this method is called, it means the response wasn't read from cache + if (self.request.cachePolicy == NSURLRequestReloadIgnoringLocalCacheData) { + // Prevents caching of responses + return nil; + } + else { + return cachedResponse; + } +} + +- (BOOL)shouldContinueWhenAppEntersBackground { + return self.options & SDWebImageDownloaderContinueInBackground; +} + +- (BOOL)connectionShouldUseCredentialStorage:(NSURLConnection __unused *)connection { + return self.shouldUseCredentialStorage; +} + +- (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge{ + if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { + if (!(self.options & SDWebImageDownloaderAllowInvalidSSLCertificates) && + [challenge.sender respondsToSelector:@selector(performDefaultHandlingForAuthenticationChallenge:)]) { + [challenge.sender performDefaultHandlingForAuthenticationChallenge:challenge]; + } else { + NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]; + [[challenge sender] useCredential:credential forAuthenticationChallenge:challenge]; + } + } else { + if ([challenge previousFailureCount] == 0) { + if (self.credential) { + [[challenge sender] useCredential:self.credential forAuthenticationChallenge:challenge]; + } else { + [[challenge sender] continueWithoutCredentialForAuthenticationChallenge:challenge]; + } + } else { + [[challenge sender] continueWithoutCredentialForAuthenticationChallenge:challenge]; + } + } +} + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageManager.h b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageManager.h new file mode 100644 index 0000000..18e578a --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageManager.h @@ -0,0 +1,299 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" +#import "SDWebImageOperation.h" +#import "SDWebImageDownloader.h" +#import "SDImageCache.h" + +typedef NS_OPTIONS(NSUInteger, SDWebImageOptions) { + /** + * By default, when a URL fail to be downloaded, the URL is blacklisted so the library won't keep trying. + * This flag disable this blacklisting. + */ + SDWebImageRetryFailed = 1 << 0, + + /** + * By default, image downloads are started during UI interactions, this flags disable this feature, + * leading to delayed download on UIScrollView deceleration for instance. + */ + SDWebImageLowPriority = 1 << 1, + + /** + * This flag disables on-disk caching + */ + SDWebImageCacheMemoryOnly = 1 << 2, + + /** + * This flag enables progressive download, the image is displayed progressively during download as a browser would do. + * By default, the image is only displayed once completely downloaded. + */ + SDWebImageProgressiveDownload = 1 << 3, + + /** + * Even if the image is cached, respect the HTTP response cache control, and refresh the image from remote location if needed. + * The disk caching will be handled by NSURLCache instead of SDWebImage leading to slight performance degradation. + * This option helps deal with images changing behind the same request URL, e.g. Facebook graph api profile pics. + * If a cached image is refreshed, the completion block is called once with the cached image and again with the final image. + * + * Use this flag only if you can't make your URLs static with embedded cache busting parameter. + */ + SDWebImageRefreshCached = 1 << 4, + + /** + * In iOS 4+, continue the download of the image if the app goes to background. This is achieved by asking the system for + * extra time in background to let the request finish. If the background task expires the operation will be cancelled. + */ + SDWebImageContinueInBackground = 1 << 5, + + /** + * Handles cookies stored in NSHTTPCookieStore by setting + * NSMutableURLRequest.HTTPShouldHandleCookies = YES; + */ + SDWebImageHandleCookies = 1 << 6, + + /** + * Enable to allow untrusted SSL certificates. + * Useful for testing purposes. Use with caution in production. + */ + SDWebImageAllowInvalidSSLCertificates = 1 << 7, + + /** + * By default, image are loaded in the order they were queued. This flag move them to + * the front of the queue and is loaded immediately instead of waiting for the current queue to be loaded (which + * could take a while). + */ + SDWebImageHighPriority = 1 << 8, + + /** + * By default, placeholder images are loaded while the image is loading. This flag will delay the loading + * of the placeholder image until after the image has finished loading. + */ + SDWebImageDelayPlaceholder = 1 << 9, + + /** + * We usually don't call transformDownloadedImage delegate method on animated images, + * as most transformation code would mangle it. + * Use this flag to transform them anyway. + */ + SDWebImageTransformAnimatedImage = 1 << 10, + + /** + * By default, image is added to the imageView after download. But in some cases, we want to + * have the hand before setting the image (apply a filter or add it with cross-fade animation for instance) + * Use this flag if you want to manually set the image in the completion when success + */ + SDWebImageAvoidAutoSetImage = 1 << 11 +}; + +typedef void(^SDWebImageCompletionBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL); + +typedef void(^SDWebImageCompletionWithFinishedBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL); + +typedef NSString *(^SDWebImageCacheKeyFilterBlock)(NSURL *url); + + +@class SDWebImageManager; + +@protocol SDWebImageManagerDelegate + +@optional + +/** + * Controls which image should be downloaded when the image is not found in the cache. + * + * @param imageManager The current `SDWebImageManager` + * @param imageURL The url of the image to be downloaded + * + * @return Return NO to prevent the downloading of the image on cache misses. If not implemented, YES is implied. + */ +- (BOOL)imageManager:(SDWebImageManager *)imageManager shouldDownloadImageForURL:(NSURL *)imageURL; + +/** + * Allows to transform the image immediately after it has been downloaded and just before to cache it on disk and memory. + * NOTE: This method is called from a global queue in order to not to block the main thread. + * + * @param imageManager The current `SDWebImageManager` + * @param image The image to transform + * @param imageURL The url of the image to transform + * + * @return The transformed image object. + */ +- (UIImage *)imageManager:(SDWebImageManager *)imageManager transformDownloadedImage:(UIImage *)image withURL:(NSURL *)imageURL; + +@end + +/** + * The SDWebImageManager is the class behind the UIImageView+WebCache category and likes. + * It ties the asynchronous downloader (SDWebImageDownloader) with the image cache store (SDImageCache). + * You can use this class directly to benefit from web image downloading with caching in another context than + * a UIView. + * + * Here is a simple example of how to use SDWebImageManager: + * + * @code + +SDWebImageManager *manager = [SDWebImageManager sharedManager]; +[manager downloadImageWithURL:imageURL + options:0 + progress:nil + completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (image) { + // do something with image + } + }]; + + * @endcode + */ +@interface SDWebImageManager : NSObject + +@property (weak, nonatomic) id delegate; + +@property (strong, nonatomic, readonly) SDImageCache *imageCache; +@property (strong, nonatomic, readonly) SDWebImageDownloader *imageDownloader; + +/** + * The cache filter is a block used each time SDWebImageManager need to convert an URL into a cache key. This can + * be used to remove dynamic part of an image URL. + * + * The following example sets a filter in the application delegate that will remove any query-string from the + * URL before to use it as a cache key: + * + * @code + +[[SDWebImageManager sharedManager] setCacheKeyFilter:^(NSURL *url) { + url = [[NSURL alloc] initWithScheme:url.scheme host:url.host path:url.path]; + return [url absoluteString]; +}]; + + * @endcode + */ +@property (nonatomic, copy) SDWebImageCacheKeyFilterBlock cacheKeyFilter; + +/** + * Returns global SDWebImageManager instance. + * + * @return SDWebImageManager shared instance + */ ++ (SDWebImageManager *)sharedManager; + +/** + * Downloads the image at the given URL if not present in cache or return the cached version otherwise. + * + * @param url The URL to the image + * @param options A mask to specify options to use for this request + * @param progressBlock A block called while image is downloading + * @param completedBlock A block called when operation has been completed. + * + * This parameter is required. + * + * This block has no return value and takes the requested UIImage as first parameter. + * In case of error the image parameter is nil and the second parameter may contain an NSError. + * + * The third parameter is an `SDImageCacheType` enum indicating if the image was retrieved from the local cache + * or from the memory cache or from the network. + * + * The last parameter is set to NO when the SDWebImageProgressiveDownload option is used and the image is + * downloading. This block is thus called repeatedly with a partial image. When image is fully downloaded, the + * block is called a last time with the full image and the last parameter set to YES. + * + * @return Returns an NSObject conforming to SDWebImageOperation. Should be an instance of SDWebImageDownloaderOperation + */ +- (id )downloadImageWithURL:(NSURL *)url + options:(SDWebImageOptions)options + progress:(SDWebImageDownloaderProgressBlock)progressBlock + completed:(SDWebImageCompletionWithFinishedBlock)completedBlock; + +/** + * Saves image to cache for given URL + * + * @param image The image to cache + * @param url The URL to the image + * + */ + +- (void)saveImageToCache:(UIImage *)image forURL:(NSURL *)url; + +/** + * Cancel all current operations + */ +- (void)cancelAll; + +/** + * Check one or more operations running + */ +- (BOOL)isRunning; + +/** + * Check if image has already been cached + * + * @param url image url + * + * @return if the image was already cached + */ +- (BOOL)cachedImageExistsForURL:(NSURL *)url; + +/** + * Check if image has already been cached on disk only + * + * @param url image url + * + * @return if the image was already cached (disk only) + */ +- (BOOL)diskImageExistsForURL:(NSURL *)url; + +/** + * Async check if image has already been cached + * + * @param url image url + * @param completionBlock the block to be executed when the check is finished + * + * @note the completion block is always executed on the main queue + */ +- (void)cachedImageExistsForURL:(NSURL *)url + completion:(SDWebImageCheckCacheCompletionBlock)completionBlock; + +/** + * Async check if image has already been cached on disk only + * + * @param url image url + * @param completionBlock the block to be executed when the check is finished + * + * @note the completion block is always executed on the main queue + */ +- (void)diskImageExistsForURL:(NSURL *)url + completion:(SDWebImageCheckCacheCompletionBlock)completionBlock; + + +/** + *Return the cache key for a given URL + */ +- (NSString *)cacheKeyForURL:(NSURL *)url; + +@end + + +#pragma mark - Deprecated + +typedef void(^SDWebImageCompletedBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType) __deprecated_msg("Block type deprecated. Use `SDWebImageCompletionBlock`"); +typedef void(^SDWebImageCompletedWithFinishedBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished) __deprecated_msg("Block type deprecated. Use `SDWebImageCompletionWithFinishedBlock`"); + + +@interface SDWebImageManager (Deprecated) + +/** + * Downloads the image at the given URL if not present in cache or return the cached version otherwise. + * + * @deprecated This method has been deprecated. Use `downloadImageWithURL:options:progress:completed:` + */ +- (id )downloadWithURL:(NSURL *)url + options:(SDWebImageOptions)options + progress:(SDWebImageDownloaderProgressBlock)progressBlock + completed:(SDWebImageCompletedWithFinishedBlock)completedBlock __deprecated_msg("Method deprecated. Use `downloadImageWithURL:options:progress:completed:`"); + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageManager.m b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageManager.m new file mode 100644 index 0000000..c804ee9 --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageManager.m @@ -0,0 +1,370 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageManager.h" +#import + +@interface SDWebImageCombinedOperation : NSObject + +@property (assign, nonatomic, getter = isCancelled) BOOL cancelled; +@property (copy, nonatomic) SDWebImageNoParamsBlock cancelBlock; +@property (strong, nonatomic) NSOperation *cacheOperation; + +@end + +@interface SDWebImageManager () + +@property (strong, nonatomic, readwrite) SDImageCache *imageCache; +@property (strong, nonatomic, readwrite) SDWebImageDownloader *imageDownloader; +@property (strong, nonatomic) NSMutableSet *failedURLs; +@property (strong, nonatomic) NSMutableArray *runningOperations; + +@end + +@implementation SDWebImageManager + ++ (id)sharedManager { + static dispatch_once_t once; + static id instance; + dispatch_once(&once, ^{ + instance = [self new]; + }); + return instance; +} + +- (id)init { + if ((self = [super init])) { + _imageCache = [self createCache]; + _imageDownloader = [SDWebImageDownloader sharedDownloader]; + _failedURLs = [NSMutableSet new]; + _runningOperations = [NSMutableArray new]; + } + return self; +} + +- (SDImageCache *)createCache { + return [SDImageCache sharedImageCache]; +} + +- (NSString *)cacheKeyForURL:(NSURL *)url { + if (self.cacheKeyFilter) { + return self.cacheKeyFilter(url); + } + else { + return [url absoluteString]; + } +} + +- (BOOL)cachedImageExistsForURL:(NSURL *)url { + NSString *key = [self cacheKeyForURL:url]; + if ([self.imageCache imageFromMemoryCacheForKey:key] != nil) return YES; + return [self.imageCache diskImageExistsWithKey:key]; +} + +- (BOOL)diskImageExistsForURL:(NSURL *)url { + NSString *key = [self cacheKeyForURL:url]; + return [self.imageCache diskImageExistsWithKey:key]; +} + +- (void)cachedImageExistsForURL:(NSURL *)url + completion:(SDWebImageCheckCacheCompletionBlock)completionBlock { + NSString *key = [self cacheKeyForURL:url]; + + BOOL isInMemoryCache = ([self.imageCache imageFromMemoryCacheForKey:key] != nil); + + if (isInMemoryCache) { + // making sure we call the completion block on the main queue + dispatch_async(dispatch_get_main_queue(), ^{ + if (completionBlock) { + completionBlock(YES); + } + }); + return; + } + + [self.imageCache diskImageExistsWithKey:key completion:^(BOOL isInDiskCache) { + // the completion block of checkDiskCacheForImageWithKey:completion: is always called on the main queue, no need to further dispatch + if (completionBlock) { + completionBlock(isInDiskCache); + } + }]; +} + +- (void)diskImageExistsForURL:(NSURL *)url + completion:(SDWebImageCheckCacheCompletionBlock)completionBlock { + NSString *key = [self cacheKeyForURL:url]; + + [self.imageCache diskImageExistsWithKey:key completion:^(BOOL isInDiskCache) { + // the completion block of checkDiskCacheForImageWithKey:completion: is always called on the main queue, no need to further dispatch + if (completionBlock) { + completionBlock(isInDiskCache); + } + }]; +} + +- (id )downloadImageWithURL:(NSURL *)url + options:(SDWebImageOptions)options + progress:(SDWebImageDownloaderProgressBlock)progressBlock + completed:(SDWebImageCompletionWithFinishedBlock)completedBlock { + // Invoking this method without a completedBlock is pointless + NSAssert(completedBlock != nil, @"If you mean to prefetch the image, use -[SDWebImagePrefetcher prefetchURLs] instead"); + + // Very common mistake is to send the URL using NSString object instead of NSURL. For some strange reason, XCode won't + // throw any warning for this type mismatch. Here we failsafe this error by allowing URLs to be passed as NSString. + if ([url isKindOfClass:NSString.class]) { + url = [NSURL URLWithString:(NSString *)url]; + } + + // Prevents app crashing on argument type error like sending NSNull instead of NSURL + if (![url isKindOfClass:NSURL.class]) { + url = nil; + } + + __block SDWebImageCombinedOperation *operation = [SDWebImageCombinedOperation new]; + __weak SDWebImageCombinedOperation *weakOperation = operation; + + BOOL isFailedUrl = NO; + @synchronized (self.failedURLs) { + isFailedUrl = [self.failedURLs containsObject:url]; + } + + if (url.absoluteString.length == 0 || (!(options & SDWebImageRetryFailed) && isFailedUrl)) { + dispatch_main_sync_safe(^{ + NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorFileDoesNotExist userInfo:nil]; + completedBlock(nil, error, SDImageCacheTypeNone, YES, url); + }); + return operation; + } + + @synchronized (self.runningOperations) { + [self.runningOperations addObject:operation]; + } + NSString *key = [self cacheKeyForURL:url]; + + operation.cacheOperation = [self.imageCache queryDiskCacheForKey:key done:^(UIImage *image, SDImageCacheType cacheType) { + if (operation.isCancelled) { + @synchronized (self.runningOperations) { + [self.runningOperations removeObject:operation]; + } + + return; + } + + if ((!image || options & SDWebImageRefreshCached) && (![self.delegate respondsToSelector:@selector(imageManager:shouldDownloadImageForURL:)] || [self.delegate imageManager:self shouldDownloadImageForURL:url])) { + if (image && options & SDWebImageRefreshCached) { + dispatch_main_sync_safe(^{ + // If image was found in the cache but SDWebImageRefreshCached is provided, notify about the cached image + // AND try to re-download it in order to let a chance to NSURLCache to refresh it from server. + completedBlock(image, nil, cacheType, YES, url); + }); + } + + // download if no image or requested to refresh anyway, and download allowed by delegate + SDWebImageDownloaderOptions downloaderOptions = 0; + if (options & SDWebImageLowPriority) downloaderOptions |= SDWebImageDownloaderLowPriority; + if (options & SDWebImageProgressiveDownload) downloaderOptions |= SDWebImageDownloaderProgressiveDownload; + if (options & SDWebImageRefreshCached) downloaderOptions |= SDWebImageDownloaderUseNSURLCache; + if (options & SDWebImageContinueInBackground) downloaderOptions |= SDWebImageDownloaderContinueInBackground; + if (options & SDWebImageHandleCookies) downloaderOptions |= SDWebImageDownloaderHandleCookies; + if (options & SDWebImageAllowInvalidSSLCertificates) downloaderOptions |= SDWebImageDownloaderAllowInvalidSSLCertificates; + if (options & SDWebImageHighPriority) downloaderOptions |= SDWebImageDownloaderHighPriority; + if (image && options & SDWebImageRefreshCached) { + // force progressive off if image already cached but forced refreshing + downloaderOptions &= ~SDWebImageDownloaderProgressiveDownload; + // ignore image read from NSURLCache if image if cached but force refreshing + downloaderOptions |= SDWebImageDownloaderIgnoreCachedResponse; + } + id subOperation = [self.imageDownloader downloadImageWithURL:url options:downloaderOptions progress:progressBlock completed:^(UIImage *downloadedImage, NSData *data, NSError *error, BOOL finished) { + __strong __typeof(weakOperation) strongOperation = weakOperation; + if (!strongOperation || strongOperation.isCancelled) { + // Do nothing if the operation was cancelled + // See #699 for more details + // if we would call the completedBlock, there could be a race condition between this block and another completedBlock for the same object, so if this one is called second, we will overwrite the new data + } + else if (error) { + dispatch_main_sync_safe(^{ + if (strongOperation && !strongOperation.isCancelled) { + completedBlock(nil, error, SDImageCacheTypeNone, finished, url); + } + }); + + if ( error.code != NSURLErrorNotConnectedToInternet + && error.code != NSURLErrorCancelled + && error.code != NSURLErrorTimedOut + && error.code != NSURLErrorInternationalRoamingOff + && error.code != NSURLErrorDataNotAllowed + && error.code != NSURLErrorCannotFindHost + && error.code != NSURLErrorCannotConnectToHost) { + @synchronized (self.failedURLs) { + [self.failedURLs addObject:url]; + } + } + } + else { + if ((options & SDWebImageRetryFailed)) { + @synchronized (self.failedURLs) { + [self.failedURLs removeObject:url]; + } + } + + BOOL cacheOnDisk = !(options & SDWebImageCacheMemoryOnly); + + if (options & SDWebImageRefreshCached && image && !downloadedImage) { + // Image refresh hit the NSURLCache cache, do not call the completion block + } + else if (downloadedImage && (!downloadedImage.images || (options & SDWebImageTransformAnimatedImage)) && [self.delegate respondsToSelector:@selector(imageManager:transformDownloadedImage:withURL:)]) { + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ + UIImage *transformedImage = [self.delegate imageManager:self transformDownloadedImage:downloadedImage withURL:url]; + + if (transformedImage && finished) { + BOOL imageWasTransformed = ![transformedImage isEqual:downloadedImage]; + [self.imageCache storeImage:transformedImage recalculateFromImage:imageWasTransformed imageData:(imageWasTransformed ? nil : data) forKey:key toDisk:cacheOnDisk]; + } + + dispatch_main_sync_safe(^{ + if (strongOperation && !strongOperation.isCancelled) { + completedBlock(transformedImage, nil, SDImageCacheTypeNone, finished, url); + } + }); + }); + } + else { + if (downloadedImage && finished) { + [self.imageCache storeImage:downloadedImage recalculateFromImage:NO imageData:data forKey:key toDisk:cacheOnDisk]; + } + + dispatch_main_sync_safe(^{ + if (strongOperation && !strongOperation.isCancelled) { + completedBlock(downloadedImage, nil, SDImageCacheTypeNone, finished, url); + } + }); + } + } + + if (finished) { + @synchronized (self.runningOperations) { + if (strongOperation) { + [self.runningOperations removeObject:strongOperation]; + } + } + } + }]; + operation.cancelBlock = ^{ + [subOperation cancel]; + + @synchronized (self.runningOperations) { + __strong __typeof(weakOperation) strongOperation = weakOperation; + if (strongOperation) { + [self.runningOperations removeObject:strongOperation]; + } + } + }; + } + else if (image) { + dispatch_main_sync_safe(^{ + __strong __typeof(weakOperation) strongOperation = weakOperation; + if (strongOperation && !strongOperation.isCancelled) { + completedBlock(image, nil, cacheType, YES, url); + } + }); + @synchronized (self.runningOperations) { + [self.runningOperations removeObject:operation]; + } + } + else { + // Image not in cache and download disallowed by delegate + dispatch_main_sync_safe(^{ + __strong __typeof(weakOperation) strongOperation = weakOperation; + if (strongOperation && !weakOperation.isCancelled) { + completedBlock(nil, nil, SDImageCacheTypeNone, YES, url); + } + }); + @synchronized (self.runningOperations) { + [self.runningOperations removeObject:operation]; + } + } + }]; + + return operation; +} + +- (void)saveImageToCache:(UIImage *)image forURL:(NSURL *)url { + if (image && url) { + NSString *key = [self cacheKeyForURL:url]; + [self.imageCache storeImage:image forKey:key toDisk:YES]; + } +} + +- (void)cancelAll { + @synchronized (self.runningOperations) { + NSArray *copiedOperations = [self.runningOperations copy]; + [copiedOperations makeObjectsPerformSelector:@selector(cancel)]; + [self.runningOperations removeObjectsInArray:copiedOperations]; + } +} + +- (BOOL)isRunning { + BOOL isRunning = NO; + @synchronized(self.runningOperations) { + isRunning = (self.runningOperations.count > 0); + } + return isRunning; +} + +@end + + +@implementation SDWebImageCombinedOperation + +- (void)setCancelBlock:(SDWebImageNoParamsBlock)cancelBlock { + // check if the operation is already cancelled, then we just call the cancelBlock + if (self.isCancelled) { + if (cancelBlock) { + cancelBlock(); + } + _cancelBlock = nil; // don't forget to nil the cancelBlock, otherwise we will get crashes + } else { + _cancelBlock = [cancelBlock copy]; + } +} + +- (void)cancel { + self.cancelled = YES; + if (self.cacheOperation) { + [self.cacheOperation cancel]; + self.cacheOperation = nil; + } + if (self.cancelBlock) { + self.cancelBlock(); + + // TODO: this is a temporary fix to #809. + // Until we can figure the exact cause of the crash, going with the ivar instead of the setter +// self.cancelBlock = nil; + _cancelBlock = nil; + } +} + +@end + + +@implementation SDWebImageManager (Deprecated) + +// deprecated method, uses the non deprecated method +// adapter for the completion block +- (id )downloadWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedWithFinishedBlock)completedBlock { + return [self downloadImageWithURL:url + options:options + progress:progressBlock + completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType, finished); + } + }]; +} + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h new file mode 100644 index 0000000..71094ee --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h @@ -0,0 +1,15 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import + +@protocol SDWebImageOperation + +- (void)cancel; + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h new file mode 100644 index 0000000..6c31b15 --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h @@ -0,0 +1,108 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageManager.h" + +@class SDWebImagePrefetcher; + +@protocol SDWebImagePrefetcherDelegate + +@optional + +/** + * Called when an image was prefetched. + * + * @param imagePrefetcher The current image prefetcher + * @param imageURL The image url that was prefetched + * @param finishedCount The total number of images that were prefetched (successful or not) + * @param totalCount The total number of images that were to be prefetched + */ +- (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount; + +/** + * Called when all images are prefetched. + * @param imagePrefetcher The current image prefetcher + * @param totalCount The total number of images that were prefetched (whether successful or not) + * @param skippedCount The total number of images that were skipped + */ +- (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount; + +@end + +typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls); +typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls); + +/** + * Prefetch some URLs in the cache for future use. Images are downloaded in low priority. + */ +@interface SDWebImagePrefetcher : NSObject + +/** + * The web image manager + */ +@property (strong, nonatomic, readonly) SDWebImageManager *manager; + +/** + * Maximum number of URLs to prefetch at the same time. Defaults to 3. + */ +@property (nonatomic, assign) NSUInteger maxConcurrentDownloads; + +/** + * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority. + */ +@property (nonatomic, assign) SDWebImageOptions options; + +/** + * Queue options for Prefetcher. Defaults to Main Queue. + */ +@property (nonatomic, assign) dispatch_queue_t prefetcherQueue; + +@property (weak, nonatomic) id delegate; + +/** + * Return the global image prefetcher instance. + */ ++ (SDWebImagePrefetcher *)sharedImagePrefetcher; + +/** + * Allows you to instantiate a prefetcher with any arbitrary image manager. + */ +- (id)initWithImageManager:(SDWebImageManager *)manager; + +/** + * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, + * currently one image is downloaded at a time, + * and skips images for failed downloads and proceed to the next image in the list + * + * @param urls list of URLs to prefetch + */ +- (void)prefetchURLs:(NSArray *)urls; + +/** + * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, + * currently one image is downloaded at a time, + * and skips images for failed downloads and proceed to the next image in the list + * + * @param urls list of URLs to prefetch + * @param progressBlock block to be called when progress updates; + * first parameter is the number of completed (successful or not) requests, + * second parameter is the total number of images originally requested to be prefetched + * @param completionBlock block to be called when prefetching is completed + * first param is the number of completed (successful or not) requests, + * second parameter is the number of skipped requests + */ +- (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock; + +/** + * Remove and cancel queued list + */ +- (void)cancelPrefetching; + + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.m b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.m new file mode 100644 index 0000000..f518d44 --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.m @@ -0,0 +1,140 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImagePrefetcher.h" + +@interface SDWebImagePrefetcher () + +@property (strong, nonatomic) SDWebImageManager *manager; +@property (strong, nonatomic) NSArray *prefetchURLs; +@property (assign, nonatomic) NSUInteger requestedCount; +@property (assign, nonatomic) NSUInteger skippedCount; +@property (assign, nonatomic) NSUInteger finishedCount; +@property (assign, nonatomic) NSTimeInterval startedTime; +@property (copy, nonatomic) SDWebImagePrefetcherCompletionBlock completionBlock; +@property (copy, nonatomic) SDWebImagePrefetcherProgressBlock progressBlock; + +@end + +@implementation SDWebImagePrefetcher + ++ (SDWebImagePrefetcher *)sharedImagePrefetcher { + static dispatch_once_t once; + static id instance; + dispatch_once(&once, ^{ + instance = [self new]; + }); + return instance; +} + +- (id)init { + return [self initWithImageManager:[SDWebImageManager new]]; +} + +- (id)initWithImageManager:(SDWebImageManager *)manager { + if ((self = [super init])) { + _manager = manager; + _options = SDWebImageLowPriority; + _prefetcherQueue = dispatch_get_main_queue(); + self.maxConcurrentDownloads = 3; + } + return self; +} + +- (void)setMaxConcurrentDownloads:(NSUInteger)maxConcurrentDownloads { + self.manager.imageDownloader.maxConcurrentDownloads = maxConcurrentDownloads; +} + +- (NSUInteger)maxConcurrentDownloads { + return self.manager.imageDownloader.maxConcurrentDownloads; +} + +- (void)startPrefetchingAtIndex:(NSUInteger)index { + if (index >= self.prefetchURLs.count) return; + self.requestedCount++; + [self.manager downloadImageWithURL:self.prefetchURLs[index] options:self.options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (!finished) return; + self.finishedCount++; + + if (image) { + if (self.progressBlock) { + self.progressBlock(self.finishedCount,[self.prefetchURLs count]); + } + } + else { + if (self.progressBlock) { + self.progressBlock(self.finishedCount,[self.prefetchURLs count]); + } + // Add last failed + self.skippedCount++; + } + if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didPrefetchURL:finishedCount:totalCount:)]) { + [self.delegate imagePrefetcher:self + didPrefetchURL:self.prefetchURLs[index] + finishedCount:self.finishedCount + totalCount:self.prefetchURLs.count + ]; + } + if (self.prefetchURLs.count > self.requestedCount) { + dispatch_async(self.prefetcherQueue, ^{ + [self startPrefetchingAtIndex:self.requestedCount]; + }); + } else if (self.finishedCount == self.requestedCount) { + [self reportStatus]; + if (self.completionBlock) { + self.completionBlock(self.finishedCount, self.skippedCount); + self.completionBlock = nil; + } + self.progressBlock = nil; + } + }]; +} + +- (void)reportStatus { + NSUInteger total = [self.prefetchURLs count]; + if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didFinishWithTotalCount:skippedCount:)]) { + [self.delegate imagePrefetcher:self + didFinishWithTotalCount:(total - self.skippedCount) + skippedCount:self.skippedCount + ]; + } +} + +- (void)prefetchURLs:(NSArray *)urls { + [self prefetchURLs:urls progress:nil completed:nil]; +} + +- (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock { + [self cancelPrefetching]; // Prevent duplicate prefetch request + self.startedTime = CFAbsoluteTimeGetCurrent(); + self.prefetchURLs = urls; + self.completionBlock = completionBlock; + self.progressBlock = progressBlock; + + if (urls.count == 0) { + if (completionBlock) { + completionBlock(0,0); + } + } else { + // Starts prefetching from the very first image on the list with the max allowed concurrency + NSUInteger listCount = self.prefetchURLs.count; + for (NSUInteger i = 0; i < self.maxConcurrentDownloads && self.requestedCount < listCount; i++) { + [self startPrefetchingAtIndex:i]; + } + } +} + +- (void)cancelPrefetching { + self.prefetchURLs = nil; + self.skippedCount = 0; + self.requestedCount = 0; + self.finishedCount = 0; + [self.manager cancelAll]; +} + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/UIButton+WebCache.h b/grocery-objc/Pods/SDWebImage/SDWebImage/UIButton+WebCache.h new file mode 100644 index 0000000..ecf5ced --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/UIButton+WebCache.h @@ -0,0 +1,229 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" +#import "SDWebImageManager.h" + +/** + * Integrates SDWebImage async downloading and caching of remote images with UIButtonView. + */ +@interface UIButton (WebCache) + +/** + * Get the current image URL. + */ +- (NSURL *)sd_currentImageURL; + +/** + * Get the image URL for a control state. + * + * @param state Which state you want to know the URL for. The values are described in UIControlState. + */ +- (NSURL *)sd_imageURLForState:(UIControlState)state; + +/** + * Set the imageView `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + */ +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state; + +/** + * Set the imageView `image` with an `url` and a placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @see sd_setImageWithURL:placeholderImage:options: + */ +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder; + +/** + * Set the imageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + */ +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options; + +/** + * Set the imageView `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the imageView `image` with an `url`, placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the imageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the backgroundImageView `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + */ +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state; + +/** + * Set the backgroundImageView `image` with an `url` and a placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @see sd_setImageWithURL:placeholderImage:options: + */ +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder; + +/** + * Set the backgroundImageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + */ +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options; + +/** + * Set the backgroundImageView `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the backgroundImageView `image` with an `url`, placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the backgroundImageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Cancel the current image download + */ +- (void)sd_cancelImageLoadForState:(UIControlState)state; + +/** + * Cancel the current backgroundImage download + */ +- (void)sd_cancelBackgroundImageLoadForState:(UIControlState)state; + +@end + + +@interface UIButton (WebCacheDeprecated) + +- (NSURL *)currentImageURL __deprecated_msg("Use `sd_currentImageURL`"); +- (NSURL *)imageURLForState:(UIControlState)state __deprecated_msg("Use `sd_imageURLForState:`"); + +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:forState:`"); +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:forState:placeholderImage:`"); +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:forState:placeholderImage:options:`"); + +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:forState:completed:`"); +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:forState:placeholderImage:completed:`"); +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:forState:placeholderImage:options:completed:`"); + +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:`"); +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:placeholderImage:`"); +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:placeholderImage:options:`"); + +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:completed:`"); +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:placeholderImage:completed:`"); +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:placeholderImage:options:completed:`"); + +- (void)cancelCurrentImageLoad __deprecated_msg("Use `sd_cancelImageLoadForState:`"); +- (void)cancelBackgroundImageLoadForState:(UIControlState)state __deprecated_msg("Use `sd_cancelBackgroundImageLoadForState:`"); + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/UIButton+WebCache.m b/grocery-objc/Pods/SDWebImage/SDWebImage/UIButton+WebCache.m new file mode 100644 index 0000000..ce2175d --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/UIButton+WebCache.m @@ -0,0 +1,270 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "UIButton+WebCache.h" +#import "objc/runtime.h" +#import "UIView+WebCacheOperation.h" + +static char imageURLStorageKey; + +@implementation UIButton (WebCache) + +- (NSURL *)sd_currentImageURL { + NSURL *url = self.imageURLStorage[@(self.state)]; + + if (!url) { + url = self.imageURLStorage[@(UIControlStateNormal)]; + } + + return url; +} + +- (NSURL *)sd_imageURLForState:(UIControlState)state { + return self.imageURLStorage[@(state)]; +} + +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state { + [self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil]; +} + +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder { + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil]; +} + +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil]; +} + +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:completedBlock]; +} + +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:completedBlock]; +} + +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { + + [self setImage:placeholder forState:state]; + [self sd_cancelImageLoadForState:state]; + + if (!url) { + [self.imageURLStorage removeObjectForKey:@(state)]; + + dispatch_main_async_safe(^{ + if (completedBlock) { + NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; + completedBlock(nil, error, SDImageCacheTypeNone, url); + } + }); + + return; + } + + self.imageURLStorage[@(state)] = url; + + __weak __typeof(self)wself = self; + id operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (!wself) return; + dispatch_main_sync_safe(^{ + __strong UIButton *sself = wself; + if (!sself) return; + if (image && (options & SDWebImageAvoidAutoSetImage) && completedBlock) + { + completedBlock(image, error, cacheType, url); + return; + } + else if (image) { + [sself setImage:image forState:state]; + } + if (completedBlock && finished) { + completedBlock(image, error, cacheType, url); + } + }); + }]; + [self sd_setImageLoadOperation:operation forState:state]; +} + +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil]; +} + +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil]; +} + +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil]; +} + +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:completedBlock]; +} + +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:completedBlock]; +} + +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_cancelBackgroundImageLoadForState:state]; + + [self setBackgroundImage:placeholder forState:state]; + + if (url) { + __weak __typeof(self)wself = self; + id operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (!wself) return; + dispatch_main_sync_safe(^{ + __strong UIButton *sself = wself; + if (!sself) return; + if (image && (options & SDWebImageAvoidAutoSetImage) && completedBlock) + { + completedBlock(image, error, cacheType, url); + return; + } + else if (image) { + [sself setBackgroundImage:image forState:state]; + } + if (completedBlock && finished) { + completedBlock(image, error, cacheType, url); + } + }); + }]; + [self sd_setBackgroundImageLoadOperation:operation forState:state]; + } else { + dispatch_main_async_safe(^{ + NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; + if (completedBlock) { + completedBlock(nil, error, SDImageCacheTypeNone, url); + } + }); + } +} + +- (void)sd_setImageLoadOperation:(id)operation forState:(UIControlState)state { + [self sd_setImageLoadOperation:operation forKey:[NSString stringWithFormat:@"UIButtonImageOperation%@", @(state)]]; +} + +- (void)sd_cancelImageLoadForState:(UIControlState)state { + [self sd_cancelImageLoadOperationWithKey:[NSString stringWithFormat:@"UIButtonImageOperation%@", @(state)]]; +} + +- (void)sd_setBackgroundImageLoadOperation:(id)operation forState:(UIControlState)state { + [self sd_setImageLoadOperation:operation forKey:[NSString stringWithFormat:@"UIButtonBackgroundImageOperation%@", @(state)]]; +} + +- (void)sd_cancelBackgroundImageLoadForState:(UIControlState)state { + [self sd_cancelImageLoadOperationWithKey:[NSString stringWithFormat:@"UIButtonBackgroundImageOperation%@", @(state)]]; +} + +- (NSMutableDictionary *)imageURLStorage { + NSMutableDictionary *storage = objc_getAssociatedObject(self, &imageURLStorageKey); + if (!storage) + { + storage = [NSMutableDictionary dictionary]; + objc_setAssociatedObject(self, &imageURLStorageKey, storage, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + } + + return storage; +} + +@end + + +@implementation UIButton (WebCacheDeprecated) + +- (NSURL *)currentImageURL { + return [self sd_currentImageURL]; +} + +- (NSURL *)imageURLForState:(UIControlState)state { + return [self sd_imageURLForState:state]; +} + +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state { + [self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil]; +} + +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder { + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil]; +} + +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil]; +} + +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil]; +} + +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil]; +} + +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil]; +} + +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)cancelCurrentImageLoad { + // in a backwards compatible manner, cancel for current state + [self sd_cancelImageLoadForState:self.state]; +} + +- (void)cancelBackgroundImageLoadForState:(UIControlState)state { + [self sd_cancelBackgroundImageLoadForState:state]; +} + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/UIImage+GIF.h b/grocery-objc/Pods/SDWebImage/SDWebImage/UIImage+GIF.h new file mode 100755 index 0000000..084f424 --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/UIImage+GIF.h @@ -0,0 +1,19 @@ +// +// UIImage+GIF.h +// LBGIFImage +// +// Created by Laurin Brandner on 06.01.12. +// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// + +#import + +@interface UIImage (GIF) + ++ (UIImage *)sd_animatedGIFNamed:(NSString *)name; + ++ (UIImage *)sd_animatedGIFWithData:(NSData *)data; + +- (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size; + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/UIImage+GIF.m b/grocery-objc/Pods/SDWebImage/SDWebImage/UIImage+GIF.m new file mode 100755 index 0000000..e1ded2a --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/UIImage+GIF.m @@ -0,0 +1,158 @@ +// +// UIImage+GIF.m +// LBGIFImage +// +// Created by Laurin Brandner on 06.01.12. +// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// + +#import "UIImage+GIF.h" +#import + +@implementation UIImage (GIF) + ++ (UIImage *)sd_animatedGIFWithData:(NSData *)data { + if (!data) { + return nil; + } + + CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL); + + size_t count = CGImageSourceGetCount(source); + + UIImage *animatedImage; + + if (count <= 1) { + animatedImage = [[UIImage alloc] initWithData:data]; + } + else { + NSMutableArray *images = [NSMutableArray array]; + + NSTimeInterval duration = 0.0f; + + for (size_t i = 0; i < count; i++) { + CGImageRef image = CGImageSourceCreateImageAtIndex(source, i, NULL); + + duration += [self sd_frameDurationAtIndex:i source:source]; + + [images addObject:[UIImage imageWithCGImage:image scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp]]; + + CGImageRelease(image); + } + + if (!duration) { + duration = (1.0f / 10.0f) * count; + } + + animatedImage = [UIImage animatedImageWithImages:images duration:duration]; + } + + CFRelease(source); + + return animatedImage; +} + ++ (float)sd_frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source { + float frameDuration = 0.1f; + CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil); + NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties; + NSDictionary *gifProperties = frameProperties[(NSString *)kCGImagePropertyGIFDictionary]; + + NSNumber *delayTimeUnclampedProp = gifProperties[(NSString *)kCGImagePropertyGIFUnclampedDelayTime]; + if (delayTimeUnclampedProp) { + frameDuration = [delayTimeUnclampedProp floatValue]; + } + else { + + NSNumber *delayTimeProp = gifProperties[(NSString *)kCGImagePropertyGIFDelayTime]; + if (delayTimeProp) { + frameDuration = [delayTimeProp floatValue]; + } + } + + // Many annoying ads specify a 0 duration to make an image flash as quickly as possible. + // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify + // a duration of <= 10 ms. See and + // for more information. + + if (frameDuration < 0.011f) { + frameDuration = 0.100f; + } + + CFRelease(cfFrameProperties); + return frameDuration; +} + ++ (UIImage *)sd_animatedGIFNamed:(NSString *)name { + CGFloat scale = [UIScreen mainScreen].scale; + + if (scale > 1.0f) { + NSString *retinaPath = [[NSBundle mainBundle] pathForResource:[name stringByAppendingString:@"@2x"] ofType:@"gif"]; + + NSData *data = [NSData dataWithContentsOfFile:retinaPath]; + + if (data) { + return [UIImage sd_animatedGIFWithData:data]; + } + + NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"gif"]; + + data = [NSData dataWithContentsOfFile:path]; + + if (data) { + return [UIImage sd_animatedGIFWithData:data]; + } + + return [UIImage imageNamed:name]; + } + else { + NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"gif"]; + + NSData *data = [NSData dataWithContentsOfFile:path]; + + if (data) { + return [UIImage sd_animatedGIFWithData:data]; + } + + return [UIImage imageNamed:name]; + } +} + +- (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size { + if (CGSizeEqualToSize(self.size, size) || CGSizeEqualToSize(size, CGSizeZero)) { + return self; + } + + CGSize scaledSize = size; + CGPoint thumbnailPoint = CGPointZero; + + CGFloat widthFactor = size.width / self.size.width; + CGFloat heightFactor = size.height / self.size.height; + CGFloat scaleFactor = (widthFactor > heightFactor) ? widthFactor : heightFactor; + scaledSize.width = self.size.width * scaleFactor; + scaledSize.height = self.size.height * scaleFactor; + + if (widthFactor > heightFactor) { + thumbnailPoint.y = (size.height - scaledSize.height) * 0.5; + } + else if (widthFactor < heightFactor) { + thumbnailPoint.x = (size.width - scaledSize.width) * 0.5; + } + + NSMutableArray *scaledImages = [NSMutableArray array]; + + for (UIImage *image in self.images) { + UIGraphicsBeginImageContextWithOptions(size, NO, 0.0); + + [image drawInRect:CGRectMake(thumbnailPoint.x, thumbnailPoint.y, scaledSize.width, scaledSize.height)]; + UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); + + [scaledImages addObject:newImage]; + + UIGraphicsEndImageContext(); + } + + return [UIImage animatedImageWithImages:scaledImages duration:self.duration]; +} + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h b/grocery-objc/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h new file mode 100644 index 0000000..186ebc0 --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h @@ -0,0 +1,15 @@ +// +// UIImage+MultiFormat.h +// SDWebImage +// +// Created by Olivier Poitrey on 07/06/13. +// Copyright (c) 2013 Dailymotion. All rights reserved. +// + +#import + +@interface UIImage (MultiFormat) + ++ (UIImage *)sd_imageWithData:(NSData *)data; + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m b/grocery-objc/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m new file mode 100644 index 0000000..a830754 --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m @@ -0,0 +1,118 @@ +// +// UIImage+MultiFormat.m +// SDWebImage +// +// Created by Olivier Poitrey on 07/06/13. +// Copyright (c) 2013 Dailymotion. All rights reserved. +// + +#import "UIImage+MultiFormat.h" +#import "UIImage+GIF.h" +#import "NSData+ImageContentType.h" +#import + +#ifdef SD_WEBP +#import "UIImage+WebP.h" +#endif + +@implementation UIImage (MultiFormat) + ++ (UIImage *)sd_imageWithData:(NSData *)data { + if (!data) { + return nil; + } + + UIImage *image; + NSString *imageContentType = [NSData sd_contentTypeForImageData:data]; + if ([imageContentType isEqualToString:@"image/gif"]) { + image = [UIImage sd_animatedGIFWithData:data]; + } +#ifdef SD_WEBP + else if ([imageContentType isEqualToString:@"image/webp"]) + { + image = [UIImage sd_imageWithWebPData:data]; + } +#endif + else { + image = [[UIImage alloc] initWithData:data]; + UIImageOrientation orientation = [self sd_imageOrientationFromImageData:data]; + if (orientation != UIImageOrientationUp) { + image = [UIImage imageWithCGImage:image.CGImage + scale:image.scale + orientation:orientation]; + } + } + + + return image; +} + + ++(UIImageOrientation)sd_imageOrientationFromImageData:(NSData *)imageData { + UIImageOrientation result = UIImageOrientationUp; + CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL); + if (imageSource) { + CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL); + if (properties) { + CFTypeRef val; + int exifOrientation; + val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation); + if (val) { + CFNumberGetValue(val, kCFNumberIntType, &exifOrientation); + result = [self sd_exifOrientationToiOSOrientation:exifOrientation]; + } // else - if it's not set it remains at up + CFRelease((CFTypeRef) properties); + } else { + //NSLog(@"NO PROPERTIES, FAIL"); + } + CFRelease(imageSource); + } + return result; +} + +#pragma mark EXIF orientation tag converter +// Convert an EXIF image orientation to an iOS one. +// reference see here: http://sylvana.net/jpegcrop/exif_orientation.html ++ (UIImageOrientation) sd_exifOrientationToiOSOrientation:(int)exifOrientation { + UIImageOrientation orientation = UIImageOrientationUp; + switch (exifOrientation) { + case 1: + orientation = UIImageOrientationUp; + break; + + case 3: + orientation = UIImageOrientationDown; + break; + + case 8: + orientation = UIImageOrientationLeft; + break; + + case 6: + orientation = UIImageOrientationRight; + break; + + case 2: + orientation = UIImageOrientationUpMirrored; + break; + + case 4: + orientation = UIImageOrientationDownMirrored; + break; + + case 5: + orientation = UIImageOrientationLeftMirrored; + break; + + case 7: + orientation = UIImageOrientationRightMirrored; + break; + default: + break; + } + return orientation; +} + + + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h b/grocery-objc/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h new file mode 100644 index 0000000..c1d8fea --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h @@ -0,0 +1,100 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageCompat.h" +#import "SDWebImageManager.h" + +/** + * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state. + */ +@interface UIImageView (HighlightedWebCache) + +/** + * Set the imageView `highlightedImage` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + */ +- (void)sd_setHighlightedImageWithURL:(NSURL *)url; + +/** + * Set the imageView `highlightedImage` with an `url` and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + */ +- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options; + +/** + * Set the imageView `highlightedImage` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the imageView `highlightedImage` with an `url` and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the imageView `highlightedImage` with an `url` and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param progressBlock A block called while image is downloading + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Cancel the current download + */ +- (void)sd_cancelCurrentHighlightedImageLoad; + +@end + + +@interface UIImageView (HighlightedWebCacheDeprecated) + +- (void)setHighlightedImageWithURL:(NSURL *)url __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:`"); +- (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:`"); +- (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:completed:`"); +- (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:completed:`"); +- (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:progress:completed:`"); + +- (void)cancelCurrentHighlightedImageLoad __deprecated_msg("Use `sd_cancelCurrentHighlightedImageLoad`"); + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m b/grocery-objc/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m new file mode 100644 index 0000000..921134e --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m @@ -0,0 +1,112 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "UIImageView+HighlightedWebCache.h" +#import "UIView+WebCacheOperation.h" + +#define UIImageViewHighlightedWebCacheOperationKey @"highlightedImage" + +@implementation UIImageView (HighlightedWebCache) + +- (void)sd_setHighlightedImageWithURL:(NSURL *)url { + [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; +} + +- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options { + [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; +} + +- (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock]; +} + +- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock]; +} + +- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_cancelCurrentHighlightedImageLoad]; + + if (url) { + __weak __typeof(self)wself = self; + id operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (!wself) return; + dispatch_main_sync_safe (^ + { + if (!wself) return; + if (image && (options & SDWebImageAvoidAutoSetImage) && completedBlock) + { + completedBlock(image, error, cacheType, url); + return; + } + else if (image) { + wself.highlightedImage = image; + [wself setNeedsLayout]; + } + if (completedBlock && finished) { + completedBlock(image, error, cacheType, url); + } + }); + }]; + [self sd_setImageLoadOperation:operation forKey:UIImageViewHighlightedWebCacheOperationKey]; + } else { + dispatch_main_async_safe(^{ + NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; + if (completedBlock) { + completedBlock(nil, error, SDImageCacheTypeNone, url); + } + }); + } +} + +- (void)sd_cancelCurrentHighlightedImageLoad { + [self sd_cancelImageLoadOperationWithKey:UIImageViewHighlightedWebCacheOperationKey]; +} + +@end + + +@implementation UIImageView (HighlightedWebCacheDeprecated) + +- (void)setHighlightedImageWithURL:(NSURL *)url { + [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; +} + +- (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options { + [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; +} + +- (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setHighlightedImageWithURL:url options:0 progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)cancelCurrentHighlightedImageLoad { + [self sd_cancelCurrentHighlightedImageLoad]; +} + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.h b/grocery-objc/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.h new file mode 100644 index 0000000..eeb7460 --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.h @@ -0,0 +1,213 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" +#import "SDWebImageManager.h" + +/** + * Integrates SDWebImage async downloading and caching of remote images with UIImageView. + * + * Usage with a UITableViewCell sub-class: + * + * @code + +#import + +... + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *MyIdentifier = @"MyIdentifier"; + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier]; + + if (cell == nil) { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier] + autorelease]; + } + + // Here we use the provided sd_setImageWithURL: method to load the web image + // Ensure you use a placeholder image otherwise cells will be initialized with no image + [cell.imageView sd_setImageWithURL:[NSURL URLWithString:@"http://example.com/image.jpg"] + placeholderImage:[UIImage imageNamed:@"placeholder"]]; + + cell.textLabel.text = @"My Text"; + return cell; +} + + * @endcode + */ +@interface UIImageView (WebCache) + +/** + * Get the current image URL. + * + * Note that because of the limitations of categories this property can get out of sync + * if you use sd_setImage: directly. + */ +- (NSURL *)sd_imageURL; + +/** + * Set the imageView `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + */ +- (void)sd_setImageWithURL:(NSURL *)url; + +/** + * Set the imageView `image` with an `url` and a placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @see sd_setImageWithURL:placeholderImage:options: + */ +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder; + +/** + * Set the imageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + */ +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options; + +/** + * Set the imageView `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the imageView `image` with an `url`, placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the imageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the imageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param progressBlock A block called while image is downloading + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the imageView `image` with an `url` and optionally a placeholder image. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param progressBlock A block called while image is downloading + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithPreviousCachedImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Download an array of images and starts them in an animation loop + * + * @param arrayOfURLs An array of NSURL + */ +- (void)sd_setAnimationImagesWithURLs:(NSArray *)arrayOfURLs; + +/** + * Cancel the current download + */ +- (void)sd_cancelCurrentImageLoad; + +- (void)sd_cancelCurrentAnimationImagesLoad; + +/** + * Show activity UIActivityIndicatorView + */ +- (void)setShowActivityIndicatorView:(BOOL)show; + +/** + * set desired UIActivityIndicatorViewStyle + * + * @param style The style of the UIActivityIndicatorView + */ +- (void)setIndicatorStyle:(UIActivityIndicatorViewStyle)style; + +@end + + +@interface UIImageView (WebCacheDeprecated) + +- (NSURL *)imageURL __deprecated_msg("Use `sd_imageURL`"); + +- (void)setImageWithURL:(NSURL *)url __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:`"); +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:`"); +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:options`"); + +- (void)setImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:completed:`"); +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:completed:`"); +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:options:completed:`"); +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:options:progress:completed:`"); + +- (void)setAnimationImagesWithURLs:(NSArray *)arrayOfURLs __deprecated_msg("Use `sd_setAnimationImagesWithURLs:`"); + +- (void)cancelCurrentArrayLoad __deprecated_msg("Use `sd_cancelCurrentAnimationImagesLoad`"); + +- (void)cancelCurrentImageLoad __deprecated_msg("Use `sd_cancelCurrentImageLoad`"); + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.m b/grocery-objc/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.m new file mode 100644 index 0000000..14f425c --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.m @@ -0,0 +1,277 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "UIImageView+WebCache.h" +#import "objc/runtime.h" +#import "UIView+WebCacheOperation.h" + +static char imageURLKey; +static char TAG_ACTIVITY_INDICATOR; +static char TAG_ACTIVITY_STYLE; +static char TAG_ACTIVITY_SHOW; + +@implementation UIImageView (WebCache) + +- (void)sd_setImageWithURL:(NSURL *)url { + [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:nil]; +} + +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder { + [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:nil]; +} + +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { + [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:nil]; +} + +- (void)sd_setImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:completedBlock]; +} + +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:completedBlock]; +} + +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock]; +} + +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_cancelCurrentImageLoad]; + objc_setAssociatedObject(self, &imageURLKey, url, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + + if (!(options & SDWebImageDelayPlaceholder)) { + dispatch_main_async_safe(^{ + self.image = placeholder; + }); + } + + if (url) { + + // check if activityView is enabled or not + if ([self showActivityIndicatorView]) { + [self addActivityIndicator]; + } + + __weak __typeof(self)wself = self; + id operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + [wself removeActivityIndicator]; + if (!wself) return; + dispatch_main_sync_safe(^{ + if (!wself) return; + if (image && (options & SDWebImageAvoidAutoSetImage) && completedBlock) + { + completedBlock(image, error, cacheType, url); + return; + } + else if (image) { + wself.image = image; + [wself setNeedsLayout]; + } else { + if ((options & SDWebImageDelayPlaceholder)) { + wself.image = placeholder; + [wself setNeedsLayout]; + } + } + if (completedBlock && finished) { + completedBlock(image, error, cacheType, url); + } + }); + }]; + [self sd_setImageLoadOperation:operation forKey:@"UIImageViewImageLoad"]; + } else { + dispatch_main_async_safe(^{ + [self removeActivityIndicator]; + if (completedBlock) { + NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; + completedBlock(nil, error, SDImageCacheTypeNone, url); + } + }); + } +} + +- (void)sd_setImageWithPreviousCachedImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock { + NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:url]; + UIImage *lastPreviousCachedImage = [[SDImageCache sharedImageCache] imageFromDiskCacheForKey:key]; + + [self sd_setImageWithURL:url placeholderImage:lastPreviousCachedImage ?: placeholder options:options progress:progressBlock completed:completedBlock]; +} + +- (NSURL *)sd_imageURL { + return objc_getAssociatedObject(self, &imageURLKey); +} + +- (void)sd_setAnimationImagesWithURLs:(NSArray *)arrayOfURLs { + [self sd_cancelCurrentAnimationImagesLoad]; + __weak __typeof(self)wself = self; + + NSMutableArray *operationsArray = [[NSMutableArray alloc] init]; + + for (NSURL *logoImageURL in arrayOfURLs) { + id operation = [SDWebImageManager.sharedManager downloadImageWithURL:logoImageURL options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (!wself) return; + dispatch_main_sync_safe(^{ + __strong UIImageView *sself = wself; + [sself stopAnimating]; + if (sself && image) { + NSMutableArray *currentImages = [[sself animationImages] mutableCopy]; + if (!currentImages) { + currentImages = [[NSMutableArray alloc] init]; + } + [currentImages addObject:image]; + + sself.animationImages = currentImages; + [sself setNeedsLayout]; + } + [sself startAnimating]; + }); + }]; + [operationsArray addObject:operation]; + } + + [self sd_setImageLoadOperation:[NSArray arrayWithArray:operationsArray] forKey:@"UIImageViewAnimationImages"]; +} + +- (void)sd_cancelCurrentImageLoad { + [self sd_cancelImageLoadOperationWithKey:@"UIImageViewImageLoad"]; +} + +- (void)sd_cancelCurrentAnimationImagesLoad { + [self sd_cancelImageLoadOperationWithKey:@"UIImageViewAnimationImages"]; +} + + +#pragma mark - +- (UIActivityIndicatorView *)activityIndicator { + return (UIActivityIndicatorView *)objc_getAssociatedObject(self, &TAG_ACTIVITY_INDICATOR); +} + +- (void)setActivityIndicator:(UIActivityIndicatorView *)activityIndicator { + objc_setAssociatedObject(self, &TAG_ACTIVITY_INDICATOR, activityIndicator, OBJC_ASSOCIATION_RETAIN); +} + +- (void)setShowActivityIndicatorView:(BOOL)show{ + objc_setAssociatedObject(self, &TAG_ACTIVITY_SHOW, [NSNumber numberWithBool:show], OBJC_ASSOCIATION_RETAIN); +} + +- (BOOL)showActivityIndicatorView{ + return [objc_getAssociatedObject(self, &TAG_ACTIVITY_SHOW) boolValue]; +} + +- (void)setIndicatorStyle:(UIActivityIndicatorViewStyle)style{ + objc_setAssociatedObject(self, &TAG_ACTIVITY_STYLE, [NSNumber numberWithInt:style], OBJC_ASSOCIATION_RETAIN); +} + +- (int)getIndicatorStyle{ + return [objc_getAssociatedObject(self, &TAG_ACTIVITY_STYLE) intValue]; +} + +- (void)addActivityIndicator { + if (!self.activityIndicator) { + self.activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:[self getIndicatorStyle]]; + self.activityIndicator.translatesAutoresizingMaskIntoConstraints = NO; + + dispatch_main_async_safe(^{ + [self addSubview:self.activityIndicator]; + + [self addConstraint:[NSLayoutConstraint constraintWithItem:self.activityIndicator + attribute:NSLayoutAttributeCenterX + relatedBy:NSLayoutRelationEqual + toItem:self + attribute:NSLayoutAttributeCenterX + multiplier:1.0 + constant:0.0]]; + [self addConstraint:[NSLayoutConstraint constraintWithItem:self.activityIndicator + attribute:NSLayoutAttributeCenterY + relatedBy:NSLayoutRelationEqual + toItem:self + attribute:NSLayoutAttributeCenterY + multiplier:1.0 + constant:0.0]]; + }); + } + + dispatch_main_async_safe(^{ + [self.activityIndicator startAnimating]; + }); + +} + +- (void)removeActivityIndicator { + if (self.activityIndicator) { + [self.activityIndicator removeFromSuperview]; + self.activityIndicator = nil; + } +} + +@end + + +@implementation UIImageView (WebCacheDeprecated) + +- (NSURL *)imageURL { + return [self sd_imageURL]; +} + +- (void)setImageWithURL:(NSURL *)url { + [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:nil]; +} + +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder { + [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:nil]; +} + +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { + [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:nil]; +} + +- (void)setImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)cancelCurrentArrayLoad { + [self sd_cancelCurrentAnimationImagesLoad]; +} + +- (void)cancelCurrentImageLoad { + [self sd_cancelCurrentImageLoad]; +} + +- (void)setAnimationImagesWithURLs:(NSArray *)arrayOfURLs { + [self sd_setAnimationImagesWithURLs:arrayOfURLs]; +} + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h b/grocery-objc/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h new file mode 100644 index 0000000..6719036 --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h @@ -0,0 +1,36 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageManager.h" + +@interface UIView (WebCacheOperation) + +/** + * Set the image load operation (storage in a UIView based dictionary) + * + * @param operation the operation + * @param key key for storing the operation + */ +- (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key; + +/** + * Cancel all operations for the current UIView and key + * + * @param key key for identifying the operations + */ +- (void)sd_cancelImageLoadOperationWithKey:(NSString *)key; + +/** + * Just remove the operations corresponding to the current UIView and key without cancelling them + * + * @param key key for identifying the operations + */ +- (void)sd_removeImageLoadOperationWithKey:(NSString *)key; + +@end diff --git a/grocery-objc/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m b/grocery-objc/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m new file mode 100644 index 0000000..9219478 --- /dev/null +++ b/grocery-objc/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m @@ -0,0 +1,55 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "UIView+WebCacheOperation.h" +#import "objc/runtime.h" + +static char loadOperationKey; + +@implementation UIView (WebCacheOperation) + +- (NSMutableDictionary *)operationDictionary { + NSMutableDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey); + if (operations) { + return operations; + } + operations = [NSMutableDictionary dictionary]; + objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + return operations; +} + +- (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key { + [self sd_cancelImageLoadOperationWithKey:key]; + NSMutableDictionary *operationDictionary = [self operationDictionary]; + [operationDictionary setObject:operation forKey:key]; +} + +- (void)sd_cancelImageLoadOperationWithKey:(NSString *)key { + // Cancel in progress downloader from queue + NSMutableDictionary *operationDictionary = [self operationDictionary]; + id operations = [operationDictionary objectForKey:key]; + if (operations) { + if ([operations isKindOfClass:[NSArray class]]) { + for (id operation in operations) { + if (operation) { + [operation cancel]; + } + } + } else if ([operations conformsToProtocol:@protocol(SDWebImageOperation)]){ + [(id) operations cancel]; + } + [operationDictionary removeObjectForKey:key]; + } +} + +- (void)sd_removeImageLoadOperationWithKey:(NSString *)key { + NSMutableDictionary *operationDictionary = [self operationDictionary]; + [operationDictionary removeObjectForKey:key]; +} + +@end diff --git a/grocery-objc/Pods/SIAlertView/LICENSE.md b/grocery-objc/Pods/SIAlertView/LICENSE.md new file mode 100644 index 0000000..38678c8 --- /dev/null +++ b/grocery-objc/Pods/SIAlertView/LICENSE.md @@ -0,0 +1,7 @@ +Copyright (c) 2013 Sumi Interactive + +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. \ No newline at end of file diff --git a/grocery-objc/Pods/SIAlertView/README.md b/grocery-objc/Pods/SIAlertView/README.md new file mode 100644 index 0000000..0447b1b --- /dev/null +++ b/grocery-objc/Pods/SIAlertView/README.md @@ -0,0 +1,87 @@ +SIAlertView +============= + +An UIAlertView replacement with block syntax and fancy transition styles. As seen in [Grid Diary](http://griddiaryapp.com/). + +[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=Sumi-Interactive&url=https://github.com/Sumi-Interactive/SIAlertView&title=SIAlertView&tags=github&category=software) + +## Preview + +![SIAlertView Screenshot](https://github.com/Sumi-Interactive/SIAlertView/raw/master/screenshot.png) + +## Features + +- use window to present +- happy with rotation +- block syntax +- styled transitions +- queue support +- UIAppearance support + +## Installation + +### Cocoapods(Recommended) + +1. Add `pod 'SIAlertView'` to your Podfile. +2. Run `pod install` + +### Manual + +1. Add all files under `SIAlertView/SIAlertView` to your project +2. Add `QuartzCore.framework` to your project + +## Requirements + +- iOS 5.0 and greater +- ARC + +(If you are having any problems, just select your project -> Build Phases -> Compile Sources, double-click the SIAlertView and add `-fobjc-arc`) + +## Examples + +**Code:** + +```objc +SIAlertView *alertView = [[SIAlertView alloc] initWithTitle:@"SIAlertView" andMessage:@"Sumi Interactive"]; + +[alertView addButtonWithTitle:@"Button1" + type:SIAlertViewButtonTypeDefault + handler:^(SIAlertView *alert) { + NSLog(@"Button1 Clicked"); + }]; +[alertView addButtonWithTitle:@"Button2" + type:SIAlertViewButtonTypeDestructive + handler:^(SIAlertView *alert) { + NSLog(@"Button2 Clicked"); + }]; +[alertView addButtonWithTitle:@"Button3" + type:SIAlertViewButtonTypeCancel + handler:^(SIAlertView *alert) { + NSLog(@"Button3 Clicked"); + }]; + +alertView.willShowHandler = ^(SIAlertView *alertView) { + NSLog(@"%@, willShowHandler", alertView); +}; +alertView.didShowHandler = ^(SIAlertView *alertView) { + NSLog(@"%@, didShowHandler", alertView); +}; +alertView.willDismissHandler = ^(SIAlertView *alertView) { + NSLog(@"%@, willDismissHandler", alertView); +}; +alertView.didDismissHandler = ^(SIAlertView *alertView) { + NSLog(@"%@, didDismissHandler", alertView); +}; + +alertView.transitionStyle = SIAlertViewTransitionStyleBounce; + +[alertView show]; +``` + +## Credits + +SIAlertView was created by [Sumi Interactive](https://github.com/Sumi-Interactive) in the development of [Grid Diary](http://griddiaryapp.com/). + +## License + +SIAlertView is available under the MIT license. See the LICENSE file for more info. diff --git a/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-cancel-d.png b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-cancel-d.png new file mode 100644 index 0000000..fa432a5 Binary files /dev/null and b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-cancel-d.png differ diff --git a/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-cancel-d@2x.png b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-cancel-d@2x.png new file mode 100644 index 0000000..8f359b8 Binary files /dev/null and b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-cancel-d@2x.png differ diff --git a/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-cancel.png b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-cancel.png new file mode 100644 index 0000000..88d1564 Binary files /dev/null and b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-cancel.png differ diff --git a/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-cancel@2x.png b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-cancel@2x.png new file mode 100644 index 0000000..0ac483b Binary files /dev/null and b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-cancel@2x.png differ diff --git a/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-default-d.png b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-default-d.png new file mode 100644 index 0000000..47f5163 Binary files /dev/null and b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-default-d.png differ diff --git a/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-default-d@2x.png b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-default-d@2x.png new file mode 100644 index 0000000..6d21603 Binary files /dev/null and b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-default-d@2x.png differ diff --git a/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-default.png b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-default.png new file mode 100644 index 0000000..17eab59 Binary files /dev/null and b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-default.png differ diff --git a/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-default@2x.png b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-default@2x.png new file mode 100644 index 0000000..d5f08e6 Binary files /dev/null and b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-default@2x.png differ diff --git a/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-destructive-d.png b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-destructive-d.png new file mode 100644 index 0000000..0a53150 Binary files /dev/null and b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-destructive-d.png differ diff --git a/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-destructive-d@2x.png b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-destructive-d@2x.png new file mode 100644 index 0000000..e614faf Binary files /dev/null and b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-destructive-d@2x.png differ diff --git a/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-destructive.png b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-destructive.png new file mode 100644 index 0000000..28f3264 Binary files /dev/null and b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-destructive.png differ diff --git a/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-destructive@2x.png b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-destructive@2x.png new file mode 100644 index 0000000..1a82328 Binary files /dev/null and b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.bundle/button-destructive@2x.png differ diff --git a/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.h b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.h new file mode 100644 index 0000000..6d0dfd1 --- /dev/null +++ b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.h @@ -0,0 +1,81 @@ +// +// SIAlertView.h +// SIAlertView +// +// Created by Kevin Cao on 13-4-29. +// Copyright (c) 2013年 Sumi Interactive. All rights reserved. +// + +#import + +extern NSString *const SIAlertViewWillShowNotification; +extern NSString *const SIAlertViewDidShowNotification; +extern NSString *const SIAlertViewWillDismissNotification; +extern NSString *const SIAlertViewDidDismissNotification; + +typedef NS_ENUM(NSInteger, SIAlertViewButtonType) { + SIAlertViewButtonTypeDefault = 0, + SIAlertViewButtonTypeDestructive, + SIAlertViewButtonTypeCancel +}; + +typedef NS_ENUM(NSInteger, SIAlertViewBackgroundStyle) { + SIAlertViewBackgroundStyleGradient = 0, + SIAlertViewBackgroundStyleSolid, +}; + +typedef NS_ENUM(NSInteger, SIAlertViewButtonsListStyle) { + SIAlertViewButtonsListStyleNormal = 0, + SIAlertViewButtonsListStyleRows +}; + +typedef NS_ENUM(NSInteger, SIAlertViewTransitionStyle) { + SIAlertViewTransitionStyleSlideFromBottom = 0, + SIAlertViewTransitionStyleSlideFromTop, + SIAlertViewTransitionStyleFade, + SIAlertViewTransitionStyleBounce, + SIAlertViewTransitionStyleDropDown +}; + +@class SIAlertView; +typedef void(^SIAlertViewHandler)(SIAlertView *alertView); + +@interface SIAlertView : UIView + +@property (nonatomic, copy) NSString *title; +@property (nonatomic, copy) NSString *message; + +@property (nonatomic, assign) SIAlertViewTransitionStyle transitionStyle; // default is SIAlertViewTransitionStyleSlideFromBottom +@property (nonatomic, assign) SIAlertViewBackgroundStyle backgroundStyle; // default is SIAlertViewButtonTypeGradient +@property (nonatomic, assign) SIAlertViewButtonsListStyle buttonsListStyle; // default is SIAlertViewButtonsListStyleNormal + +@property (nonatomic, copy) SIAlertViewHandler willShowHandler; +@property (nonatomic, copy) SIAlertViewHandler didShowHandler; +@property (nonatomic, copy) SIAlertViewHandler willDismissHandler; +@property (nonatomic, copy) SIAlertViewHandler didDismissHandler; + +@property (nonatomic, readonly, getter = isVisible) BOOL visible; + +@property (nonatomic, strong) UIColor *viewBackgroundColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; +@property (nonatomic, strong) UIColor *titleColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; +@property (nonatomic, strong) UIColor *messageColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; +@property (nonatomic, strong) UIFont *titleFont NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; +@property (nonatomic, strong) UIFont *messageFont NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; +@property (nonatomic, strong) UIFont *buttonFont NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; +@property (nonatomic, strong) UIColor *buttonColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; +@property (nonatomic, strong) UIColor *cancelButtonColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; +@property (nonatomic, strong) UIColor *destructiveButtonColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; +@property (nonatomic, assign) CGFloat cornerRadius NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; // default is 2.0 +@property (nonatomic, assign) CGFloat shadowRadius NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; // default is 8.0 + +- (void)setDefaultButtonImage:(UIImage *)defaultButtonImage forState:(UIControlState)state NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; +- (void)setCancelButtonImage:(UIImage *)cancelButtonImage forState:(UIControlState)state NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; +- (void)setDestructiveButtonImage:(UIImage *)destructiveButtonImage forState:(UIControlState)state NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; + +- (id)initWithTitle:(NSString *)title andMessage:(NSString *)message; +- (void)addButtonWithTitle:(NSString *)title type:(SIAlertViewButtonType)type handler:(SIAlertViewHandler)handler; + +- (void)show; +- (void)dismissAnimated:(BOOL)animated; + +@end diff --git a/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.m b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.m new file mode 100644 index 0000000..bde3337 --- /dev/null +++ b/grocery-objc/Pods/SIAlertView/SIAlertView/SIAlertView.m @@ -0,0 +1,1185 @@ +// +// SIAlertView.m +// SIAlertView +// +// Created by Kevin Cao on 13-4-29. +// Copyright (c) 2013年 Sumi Interactive. All rights reserved. +// + +#import "SIAlertView.h" +#import + +NSString *const SIAlertViewWillShowNotification = @"SIAlertViewWillShowNotification"; +NSString *const SIAlertViewDidShowNotification = @"SIAlertViewDidShowNotification"; +NSString *const SIAlertViewWillDismissNotification = @"SIAlertViewWillDismissNotification"; +NSString *const SIAlertViewDidDismissNotification = @"SIAlertViewDidDismissNotification"; + +#define DEBUG_LAYOUT 0 + +#define MESSAGE_MIN_LINE_COUNT 3 +#define MESSAGE_MAX_LINE_COUNT 5 +#define GAP 10 +#define CANCEL_BUTTON_PADDING_TOP 5 +#define CONTENT_PADDING_LEFT 10 +#define CONTENT_PADDING_TOP 12 +#define CONTENT_PADDING_BOTTOM 10 +#define BUTTON_HEIGHT 44 +#define CONTAINER_WIDTH 300 + +const UIWindowLevel UIWindowLevelSIAlert = 1999.0; // don't overlap system's alert +const UIWindowLevel UIWindowLevelSIAlertBackground = 1998.0; // below the alert window + +@class SIAlertBackgroundWindow; + +static NSMutableArray *__si_alert_queue; +static BOOL __si_alert_animating; +static SIAlertBackgroundWindow *__si_alert_background_window; +static SIAlertView *__si_alert_current_view; + +@interface UIWindow (SIAlert_Utils) + +- (UIViewController *)currentViewController; + +@end + +@implementation UIWindow (SIAlert_Utils) + +- (UIViewController *)currentViewController +{ + UIViewController *viewController = self.rootViewController; + while (viewController.presentedViewController) { + viewController = viewController.presentedViewController; + } + return viewController; +} + +@end + +#ifdef __IPHONE_7_0 +@interface UIWindow (SIAlert_StatusBarUtils) + +- (UIViewController *)viewControllerForStatusBarStyle; +- (UIViewController *)viewControllerForStatusBarHidden; + +@end + +@implementation UIWindow (SIAlert_StatusBarUtils) + +- (UIViewController *)viewControllerForStatusBarStyle +{ + UIViewController *currentViewController = [self currentViewController]; + + if ([currentViewController childViewControllerForStatusBarStyle]) { + return [currentViewController childViewControllerForStatusBarStyle]; + } else { + return currentViewController; + } +} + +- (UIViewController *)viewControllerForStatusBarHidden +{ + UIViewController *currentViewController = [self currentViewController]; + + if ([currentViewController childViewControllerForStatusBarHidden]) { + return [currentViewController childViewControllerForStatusBarHidden]; + } else { + return currentViewController; + } +} + +@end +#endif + + +@interface SIAlertView () + +@property (nonatomic, strong) NSMutableArray *items; +@property (nonatomic, weak) UIWindow *oldKeyWindow; +@property (nonatomic, strong) UIWindow *alertWindow; +#ifdef __IPHONE_7_0 +@property (nonatomic, assign) UIViewTintAdjustmentMode oldTintAdjustmentMode; +#endif +@property (nonatomic, assign, getter = isVisible) BOOL visible; + +@property (nonatomic, strong) UILabel *titleLabel; +@property (nonatomic, strong) UILabel *messageLabel; +@property (nonatomic, strong) UIView *containerView; +@property (nonatomic, strong) NSMutableArray *buttons; + +@property (nonatomic, assign, getter = isLayoutDirty) BOOL layoutDirty; + ++ (NSMutableArray *)sharedQueue; ++ (SIAlertView *)currentAlertView; + ++ (BOOL)isAnimating; ++ (void)setAnimating:(BOOL)animating; + ++ (void)showBackground; ++ (void)hideBackgroundAnimated:(BOOL)animated; + +- (void)setup; +- (void)invalidateLayout; +- (void)resetTransition; + +@end + +#pragma mark - SIBackgroundWindow + +@interface SIAlertBackgroundWindow : UIWindow + +@end + +@interface SIAlertBackgroundWindow () + +@property (nonatomic, assign) SIAlertViewBackgroundStyle style; + +@end + +@implementation SIAlertBackgroundWindow + +- (id)initWithFrame:(CGRect)frame andStyle:(SIAlertViewBackgroundStyle)style +{ + self = [super initWithFrame:frame]; + if (self) { + self.style = style; + self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + self.opaque = NO; + self.windowLevel = UIWindowLevelSIAlertBackground; + } + return self; +} + +- (void)drawRect:(CGRect)rect +{ + CGContextRef context = UIGraphicsGetCurrentContext(); + switch (self.style) { + case SIAlertViewBackgroundStyleGradient: + { + size_t locationsCount = 2; + CGFloat locations[2] = {0.0f, 1.0f}; + CGFloat colors[8] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.75f}; + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, colors, locations, locationsCount); + CGColorSpaceRelease(colorSpace); + + CGPoint center = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 2); + CGFloat radius = MIN(self.bounds.size.width, self.bounds.size.height) ; + CGContextDrawRadialGradient (context, gradient, center, 0, center, radius, kCGGradientDrawsAfterEndLocation); + CGGradientRelease(gradient); + break; + } + case SIAlertViewBackgroundStyleSolid: + { + [[UIColor colorWithWhite:0 alpha:0.5] set]; + CGContextFillRect(context, self.bounds); + break; + } + } +} + +@end + +#pragma mark - SIAlertItem + +@interface SIAlertItem : NSObject + +@property (nonatomic, copy) NSString *title; +@property (nonatomic, assign) SIAlertViewButtonType type; +@property (nonatomic, copy) SIAlertViewHandler action; + +@end + +@implementation SIAlertItem + +@end + +#pragma mark - SIAlertViewController + +@interface SIAlertViewController : UIViewController + +@property (nonatomic, strong) SIAlertView *alertView; + +@end + +@implementation SIAlertViewController + +#pragma mark - View life cycle + +- (void)loadView +{ + self.view = self.alertView; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + [self.alertView setup]; +} + +- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration +{ + [self.alertView resetTransition]; + [self.alertView invalidateLayout]; +} + +#ifdef __IPHONE_7_0 +- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration +{ + if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) { + [self setNeedsStatusBarAppearanceUpdate]; + } +} +#endif + +- (NSUInteger)supportedInterfaceOrientations +{ + UIViewController *viewController = [self.alertView.oldKeyWindow currentViewController]; + if (viewController) { + return [viewController supportedInterfaceOrientations]; + } + return UIInterfaceOrientationMaskAll; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation +{ + UIViewController *viewController = [self.alertView.oldKeyWindow currentViewController]; + if (viewController) { + return [viewController shouldAutorotateToInterfaceOrientation:toInterfaceOrientation]; + } + return YES; +} + +- (BOOL)shouldAutorotate +{ + UIViewController *viewController = [self.alertView.oldKeyWindow currentViewController]; + if (viewController) { + return [viewController shouldAutorotate]; + } + return YES; +} + +#ifdef __IPHONE_7_0 +- (UIStatusBarStyle)preferredStatusBarStyle +{ + UIWindow *window = self.alertView.oldKeyWindow; + if (!window) { + window = [UIApplication sharedApplication].windows[0]; + } + return [[window viewControllerForStatusBarStyle] preferredStatusBarStyle]; +} + +- (BOOL)prefersStatusBarHidden +{ + UIWindow *window = self.alertView.oldKeyWindow; + if (!window) { + window = [UIApplication sharedApplication].windows[0]; + } + return [[window viewControllerForStatusBarHidden] prefersStatusBarHidden]; +} +#endif + +@end + +#pragma mark - SIAlert + +@implementation SIAlertView + ++ (void)initialize +{ + if (self != [SIAlertView class]) + return; + + SIAlertView *appearance = [self appearance]; + appearance.viewBackgroundColor = [UIColor whiteColor]; + appearance.titleColor = [UIColor blackColor]; + appearance.messageColor = [UIColor darkGrayColor]; + appearance.titleFont = [UIFont boldSystemFontOfSize:20]; + appearance.messageFont = [UIFont systemFontOfSize:16]; + appearance.buttonFont = [UIFont systemFontOfSize:[UIFont buttonFontSize]]; + appearance.buttonColor = [UIColor colorWithWhite:0.4 alpha:1]; + appearance.cancelButtonColor = [UIColor colorWithWhite:0.3 alpha:1]; + appearance.destructiveButtonColor = [UIColor whiteColor]; + appearance.cornerRadius = 2; + appearance.shadowRadius = 8; +} + +- (id)init +{ + return [self initWithTitle:nil andMessage:nil]; +} + +- (id)initWithTitle:(NSString *)title andMessage:(NSString *)message +{ + self = [super init]; + if (self) { + _title = title; + _message = message; + self.items = [[NSMutableArray alloc] init]; + } + return self; +} + +#pragma mark - Class methods + ++ (NSMutableArray *)sharedQueue +{ + if (!__si_alert_queue) { + __si_alert_queue = [NSMutableArray array]; + } + return __si_alert_queue; +} + ++ (SIAlertView *)currentAlertView +{ + return __si_alert_current_view; +} + ++ (void)setCurrentAlertView:(SIAlertView *)alertView +{ + __si_alert_current_view = alertView; +} + ++ (BOOL)isAnimating +{ + return __si_alert_animating; +} + ++ (void)setAnimating:(BOOL)animating +{ + __si_alert_animating = animating; +} + ++ (void)showBackground +{ + if (!__si_alert_background_window) { + __si_alert_background_window = [[SIAlertBackgroundWindow alloc] initWithFrame:[UIScreen mainScreen].bounds + andStyle:[SIAlertView currentAlertView].backgroundStyle]; + [__si_alert_background_window makeKeyAndVisible]; + __si_alert_background_window.alpha = 0; + [UIView animateWithDuration:0.3 + animations:^{ + __si_alert_background_window.alpha = 1; + }]; + } +} + ++ (void)hideBackgroundAnimated:(BOOL)animated +{ + if (!animated) { + [__si_alert_background_window removeFromSuperview]; + __si_alert_background_window = nil; + return; + } + [UIView animateWithDuration:0.3 + animations:^{ + __si_alert_background_window.alpha = 0; + } + completion:^(BOOL finished) { + [__si_alert_background_window removeFromSuperview]; + __si_alert_background_window = nil; + }]; +} + +#pragma mark - Setters + +- (void)setTitle:(NSString *)title +{ + _title = title; + [self invalidateLayout]; +} + +- (void)setMessage:(NSString *)message +{ + _message = message; + [self invalidateLayout]; +} + +#pragma mark - Public + +- (void)addButtonWithTitle:(NSString *)title type:(SIAlertViewButtonType)type handler:(SIAlertViewHandler)handler +{ + SIAlertItem *item = [[SIAlertItem alloc] init]; + item.title = title; + item.type = type; + item.action = handler; + [self.items addObject:item]; +} + +- (void)show +{ + if (self.isVisible) { + return; + } + + self.oldKeyWindow = [[UIApplication sharedApplication] keyWindow]; +#ifdef __IPHONE_7_0 + if ([self.oldKeyWindow respondsToSelector:@selector(setTintAdjustmentMode:)]) { // for iOS 7 + self.oldTintAdjustmentMode = self.oldKeyWindow.tintAdjustmentMode; + self.oldKeyWindow.tintAdjustmentMode = UIViewTintAdjustmentModeDimmed; + } +#endif + + if (![[SIAlertView sharedQueue] containsObject:self]) { + [[SIAlertView sharedQueue] addObject:self]; + } + + if ([SIAlertView isAnimating]) { + return; // wait for next turn + } + + if ([SIAlertView currentAlertView].isVisible) { + SIAlertView *alert = [SIAlertView currentAlertView]; + [alert dismissAnimated:YES cleanup:NO]; + return; + } + + if (self.willShowHandler) { + self.willShowHandler(self); + } + [[NSNotificationCenter defaultCenter] postNotificationName:SIAlertViewWillShowNotification object:self userInfo:nil]; + + self.visible = YES; + + [SIAlertView setAnimating:YES]; + [SIAlertView setCurrentAlertView:self]; + + // transition background + [SIAlertView showBackground]; + + SIAlertViewController *viewController = [[SIAlertViewController alloc] initWithNibName:nil bundle:nil]; + viewController.alertView = self; + + if (!self.alertWindow) { + UIWindow *window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + window.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + window.opaque = NO; + window.windowLevel = UIWindowLevelSIAlert; + window.rootViewController = viewController; + self.alertWindow = window; + } + [self.alertWindow makeKeyAndVisible]; + + [self validateLayout]; + + [self transitionInCompletion:^{ + if (self.didShowHandler) { + self.didShowHandler(self); + } + [[NSNotificationCenter defaultCenter] postNotificationName:SIAlertViewDidShowNotification object:self userInfo:nil]; + + [SIAlertView setAnimating:NO]; + + NSInteger index = [[SIAlertView sharedQueue] indexOfObject:self]; + if (index < [SIAlertView sharedQueue].count - 1) { + [self dismissAnimated:YES cleanup:NO]; // dismiss to show next alert view + } + }]; +} + +- (void)dismissAnimated:(BOOL)animated +{ + [self dismissAnimated:animated cleanup:YES]; +} + +- (void)dismissAnimated:(BOOL)animated cleanup:(BOOL)cleanup +{ + BOOL isVisible = self.isVisible; + + if (isVisible) { + if (self.willDismissHandler) { + self.willDismissHandler(self); + } + [[NSNotificationCenter defaultCenter] postNotificationName:SIAlertViewWillDismissNotification object:self userInfo:nil]; + } + + void (^dismissComplete)(void) = ^{ + self.visible = NO; + + [self teardown]; + + [SIAlertView setCurrentAlertView:nil]; + + SIAlertView *nextAlertView; + NSInteger index = [[SIAlertView sharedQueue] indexOfObject:self]; + if (index != NSNotFound && index < [SIAlertView sharedQueue].count - 1) { + nextAlertView = [SIAlertView sharedQueue][index + 1]; + } + + if (cleanup) { + [[SIAlertView sharedQueue] removeObject:self]; + } + + [SIAlertView setAnimating:NO]; + + if (isVisible) { + if (self.didDismissHandler) { + self.didDismissHandler(self); + } + [[NSNotificationCenter defaultCenter] postNotificationName:SIAlertViewDidDismissNotification object:self userInfo:nil]; + } + + // check if we should show next alert + if (!isVisible) { + return; + } + + if (nextAlertView) { + [nextAlertView show]; + } else { + // show last alert view + if ([SIAlertView sharedQueue].count > 0) { + SIAlertView *alert = [[SIAlertView sharedQueue] lastObject]; + [alert show]; + } + } + }; + + if (animated && isVisible) { + [SIAlertView setAnimating:YES]; + [self transitionOutCompletion:dismissComplete]; + + if ([SIAlertView sharedQueue].count == 1) { + [SIAlertView hideBackgroundAnimated:YES]; + } + + } else { + dismissComplete(); + + if ([SIAlertView sharedQueue].count == 0) { + [SIAlertView hideBackgroundAnimated:YES]; + } + } + + UIWindow *window = self.oldKeyWindow; +#ifdef __IPHONE_7_0 + if ([window respondsToSelector:@selector(setTintAdjustmentMode:)]) { + window.tintAdjustmentMode = self.oldTintAdjustmentMode; + } +#endif + if (!window) { + window = [UIApplication sharedApplication].windows[0]; + } + [window makeKeyWindow]; + window.hidden = NO; +} + +#pragma mark - Transitions + +- (void)transitionInCompletion:(void(^)(void))completion +{ + switch (self.transitionStyle) { + case SIAlertViewTransitionStyleSlideFromBottom: + { + CGRect rect = self.containerView.frame; + CGRect originalRect = rect; + rect.origin.y = self.bounds.size.height; + self.containerView.frame = rect; + [UIView animateWithDuration:0.3 + animations:^{ + self.containerView.frame = originalRect; + } + completion:^(BOOL finished) { + if (completion) { + completion(); + } + }]; + } + break; + case SIAlertViewTransitionStyleSlideFromTop: + { + CGRect rect = self.containerView.frame; + CGRect originalRect = rect; + rect.origin.y = -rect.size.height; + self.containerView.frame = rect; + [UIView animateWithDuration:0.3 + animations:^{ + self.containerView.frame = originalRect; + } + completion:^(BOOL finished) { + if (completion) { + completion(); + } + }]; + } + break; + case SIAlertViewTransitionStyleFade: + { + self.containerView.alpha = 0; + [UIView animateWithDuration:0.3 + animations:^{ + self.containerView.alpha = 1; + } + completion:^(BOOL finished) { + if (completion) { + completion(); + } + }]; + } + break; + case SIAlertViewTransitionStyleBounce: + { + CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; + animation.values = @[@(0.01), @(1.2), @(0.9), @(1)]; + animation.keyTimes = @[@(0), @(0.4), @(0.6), @(1)]; + animation.timingFunctions = @[[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear], [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear], [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]]; + animation.duration = 0.5; + animation.delegate = self; + [animation setValue:completion forKey:@"handler"]; + [self.containerView.layer addAnimation:animation forKey:@"bouce"]; + } + break; + case SIAlertViewTransitionStyleDropDown: + { + CGFloat y = self.containerView.center.y; + CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"position.y"]; + animation.values = @[@(y - self.bounds.size.height), @(y + 20), @(y - 10), @(y)]; + animation.keyTimes = @[@(0), @(0.5), @(0.75), @(1)]; + animation.timingFunctions = @[[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut], [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear], [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]]; + animation.duration = 0.4; + animation.delegate = self; + [animation setValue:completion forKey:@"handler"]; + [self.containerView.layer addAnimation:animation forKey:@"dropdown"]; + } + break; + default: + break; + } +} + +- (void)transitionOutCompletion:(void(^)(void))completion +{ + switch (self.transitionStyle) { + case SIAlertViewTransitionStyleSlideFromBottom: + { + CGRect rect = self.containerView.frame; + rect.origin.y = self.bounds.size.height; + [UIView animateWithDuration:0.3 + delay:0 + options:UIViewAnimationOptionCurveEaseIn + animations:^{ + self.containerView.frame = rect; + } + completion:^(BOOL finished) { + if (completion) { + completion(); + } + }]; + } + break; + case SIAlertViewTransitionStyleSlideFromTop: + { + CGRect rect = self.containerView.frame; + rect.origin.y = -rect.size.height; + [UIView animateWithDuration:0.3 + delay:0 + options:UIViewAnimationOptionCurveEaseIn + animations:^{ + self.containerView.frame = rect; + } + completion:^(BOOL finished) { + if (completion) { + completion(); + } + }]; + } + break; + case SIAlertViewTransitionStyleFade: + { + [UIView animateWithDuration:0.25 + animations:^{ + self.containerView.alpha = 0; + } + completion:^(BOOL finished) { + if (completion) { + completion(); + } + }]; + } + break; + case SIAlertViewTransitionStyleBounce: + { + CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; + animation.values = @[@(1), @(1.2), @(0.01)]; + animation.keyTimes = @[@(0), @(0.4), @(1)]; + animation.timingFunctions = @[[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]]; + animation.duration = 0.35; + animation.delegate = self; + [animation setValue:completion forKey:@"handler"]; + [self.containerView.layer addAnimation:animation forKey:@"bounce"]; + + self.containerView.transform = CGAffineTransformMakeScale(0.01, 0.01); + } + break; + case SIAlertViewTransitionStyleDropDown: + { + CGPoint point = self.containerView.center; + point.y += self.bounds.size.height; + [UIView animateWithDuration:0.3 + delay:0 + options:UIViewAnimationOptionCurveEaseIn + animations:^{ + self.containerView.center = point; + CGFloat angle = ((CGFloat)arc4random_uniform(100) - 50.f) / 100.f; + self.containerView.transform = CGAffineTransformMakeRotation(angle); + } + completion:^(BOOL finished) { + if (completion) { + completion(); + } + }]; + } + break; + default: + break; + } +} + +- (void)resetTransition +{ + [self.containerView.layer removeAllAnimations]; +} + +#pragma mark - Layout + +- (void)layoutSubviews +{ + [super layoutSubviews]; + [self validateLayout]; +} + +- (void)invalidateLayout +{ + self.layoutDirty = YES; + [self setNeedsLayout]; +} + +- (void)validateLayout +{ + if (!self.isLayoutDirty) { + return; + } + self.layoutDirty = NO; +#if DEBUG_LAYOUT + NSLog(@"%@, %@", self, NSStringFromSelector(_cmd)); +#endif + + CGFloat height = [self preferredHeight]; + CGFloat left = (self.bounds.size.width - CONTAINER_WIDTH) * 0.5; + CGFloat top = (self.bounds.size.height - height) * 0.5; + self.containerView.transform = CGAffineTransformIdentity; + self.containerView.frame = CGRectMake(left, top, CONTAINER_WIDTH, height); + self.containerView.layer.shadowPath = [UIBezierPath bezierPathWithRoundedRect:self.containerView.bounds cornerRadius:self.containerView.layer.cornerRadius].CGPath; + + CGFloat y = CONTENT_PADDING_TOP; + if (self.titleLabel) { + self.titleLabel.text = self.title; + CGFloat height = [self heightForTitleLabel]; + self.titleLabel.frame = CGRectMake(CONTENT_PADDING_LEFT, y, self.containerView.bounds.size.width - CONTENT_PADDING_LEFT * 2, height); + y += height; + } + if (self.messageLabel) { + if (y > CONTENT_PADDING_TOP) { + y += GAP; + } + self.messageLabel.text = self.message; + CGFloat height = [self heightForMessageLabel]; + self.messageLabel.frame = CGRectMake(CONTENT_PADDING_LEFT, y, self.containerView.bounds.size.width - CONTENT_PADDING_LEFT * 2, height); + y += height; + } + if (self.items.count > 0) { + if (y > CONTENT_PADDING_TOP) { + y += GAP; + } + if (self.items.count == 2 && self.buttonsListStyle == SIAlertViewButtonsListStyleNormal) { + CGFloat width = (self.containerView.bounds.size.width - CONTENT_PADDING_LEFT * 2 - GAP) * 0.5; + UIButton *button = self.buttons[0]; + button.frame = CGRectMake(CONTENT_PADDING_LEFT, y, width, BUTTON_HEIGHT); + button = self.buttons[1]; + button.frame = CGRectMake(CONTENT_PADDING_LEFT + width + GAP, y, width, BUTTON_HEIGHT); + } else { + for (NSUInteger i = 0; i < self.buttons.count; i++) { + UIButton *button = self.buttons[i]; + button.frame = CGRectMake(CONTENT_PADDING_LEFT, y, self.containerView.bounds.size.width - CONTENT_PADDING_LEFT * 2, BUTTON_HEIGHT); + if (self.buttons.count > 1) { + if (i == self.buttons.count - 1 && ((SIAlertItem *)self.items[i]).type == SIAlertViewButtonTypeCancel) { + CGRect rect = button.frame; + rect.origin.y += CANCEL_BUTTON_PADDING_TOP; + button.frame = rect; + } + y += BUTTON_HEIGHT + GAP; + } + } + } + } +} + +- (CGFloat)preferredHeight +{ + CGFloat height = CONTENT_PADDING_TOP; + if (self.title) { + height += [self heightForTitleLabel]; + } + if (self.message) { + if (height > CONTENT_PADDING_TOP) { + height += GAP; + } + height += [self heightForMessageLabel]; + } + if (self.items.count > 0) { + if (height > CONTENT_PADDING_TOP) { + height += GAP; + } + if (self.items.count <= 2 && self.buttonsListStyle == SIAlertViewButtonsListStyleNormal) { + height += BUTTON_HEIGHT; + } else { + height += (BUTTON_HEIGHT + GAP) * self.items.count - GAP; + if (self.buttons.count > 2 && ((SIAlertItem *)[self.items lastObject]).type == SIAlertViewButtonTypeCancel) { + height += CANCEL_BUTTON_PADDING_TOP; + } + } + } + height += CONTENT_PADDING_BOTTOM; + return height; +} + +- (CGFloat)heightForTitleLabel +{ + if (self.titleLabel) { + CGSize size = [self.title sizeWithFont:self.titleLabel.font + minFontSize: +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 + self.titleLabel.font.pointSize * self.titleLabel.minimumScaleFactor +#else + self.titleLabel.minimumFontSize +#endif + actualFontSize:nil + forWidth:CONTAINER_WIDTH - CONTENT_PADDING_LEFT * 2 + lineBreakMode:self.titleLabel.lineBreakMode]; + return size.height; + } + return 0; +} + +- (CGFloat)heightForMessageLabel +{ + CGFloat minHeight = MESSAGE_MIN_LINE_COUNT * self.messageLabel.font.lineHeight; + if (self.messageLabel) { + CGFloat maxHeight = MESSAGE_MAX_LINE_COUNT * self.messageLabel.font.lineHeight; + CGSize size = [self.message sizeWithFont:self.messageLabel.font + constrainedToSize:CGSizeMake(CONTAINER_WIDTH - CONTENT_PADDING_LEFT * 2, maxHeight) + lineBreakMode:self.messageLabel.lineBreakMode]; + return MAX(minHeight, size.height); + } + return minHeight; +} + +#pragma mark - Setup + +- (void)setup +{ + [self setupContainerView]; + [self updateTitleLabel]; + [self updateMessageLabel]; + [self setupButtons]; + [self invalidateLayout]; +} + +- (void)teardown +{ + [self.containerView removeFromSuperview]; + self.containerView = nil; + self.titleLabel = nil; + self.messageLabel = nil; + [self.buttons removeAllObjects]; + [self.alertWindow removeFromSuperview]; + self.alertWindow = nil; + self.layoutDirty = NO; +} + +- (void)setupContainerView +{ + self.containerView = [[UIView alloc] initWithFrame:self.bounds]; + self.containerView.backgroundColor = _viewBackgroundColor ? _viewBackgroundColor : [UIColor whiteColor]; + self.containerView.layer.cornerRadius = self.cornerRadius; + self.containerView.layer.shadowOffset = CGSizeZero; + self.containerView.layer.shadowRadius = self.shadowRadius; + self.containerView.layer.shadowOpacity = 0.5; + [self addSubview:self.containerView]; +} + +- (void)updateTitleLabel +{ + if (self.title) { + if (!self.titleLabel) { + self.titleLabel = [[UILabel alloc] initWithFrame:self.bounds]; + self.titleLabel.textAlignment = NSTextAlignmentCenter; + self.titleLabel.backgroundColor = [UIColor clearColor]; + self.titleLabel.font = self.titleFont; + self.titleLabel.textColor = self.titleColor; + self.titleLabel.adjustsFontSizeToFitWidth = YES; +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 + self.titleLabel.minimumScaleFactor = 0.75; +#else + self.titleLabel.minimumFontSize = self.titleLabel.font.pointSize * 0.75; +#endif + [self.containerView addSubview:self.titleLabel]; +#if DEBUG_LAYOUT + self.titleLabel.backgroundColor = [UIColor redColor]; +#endif + } + self.titleLabel.text = self.title; + } else { + [self.titleLabel removeFromSuperview]; + self.titleLabel = nil; + } + [self invalidateLayout]; +} + +- (void)updateMessageLabel +{ + if (self.message) { + if (!self.messageLabel) { + self.messageLabel = [[UILabel alloc] initWithFrame:self.bounds]; + self.messageLabel.textAlignment = NSTextAlignmentCenter; + self.messageLabel.backgroundColor = [UIColor clearColor]; + self.messageLabel.font = self.messageFont; + self.messageLabel.textColor = self.messageColor; + self.messageLabel.numberOfLines = MESSAGE_MAX_LINE_COUNT; + [self.containerView addSubview:self.messageLabel]; +#if DEBUG_LAYOUT + self.messageLabel.backgroundColor = [UIColor redColor]; +#endif + } + self.messageLabel.text = self.message; + } else { + [self.messageLabel removeFromSuperview]; + self.messageLabel = nil; + } + [self invalidateLayout]; +} + +- (void)setupButtons +{ + self.buttons = [[NSMutableArray alloc] initWithCapacity:self.items.count]; + for (NSUInteger i = 0; i < self.items.count; i++) { + UIButton *button = [self buttonForItemIndex:i]; + [self.buttons addObject:button]; + [self.containerView addSubview:button]; + } +} + +- (UIButton *)buttonForItemIndex:(NSUInteger)index +{ + SIAlertItem *item = self.items[index]; + UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; + button.tag = index; + button.autoresizingMask = UIViewAutoresizingFlexibleWidth; + button.titleLabel.font = self.buttonFont; + [button setTitle:item.title forState:UIControlStateNormal]; + UIImage *normalImage = nil; + UIImage *highlightedImage = nil; + switch (item.type) { + case SIAlertViewButtonTypeCancel: + normalImage = [UIImage imageNamed:@"SIAlertView.bundle/button-cancel"]; + highlightedImage = [UIImage imageNamed:@"SIAlertView.bundle/button-cancel-d"]; + [button setTitleColor:self.cancelButtonColor forState:UIControlStateNormal]; + [button setTitleColor:[self.cancelButtonColor colorWithAlphaComponent:0.8] forState:UIControlStateHighlighted]; + break; + case SIAlertViewButtonTypeDestructive: + normalImage = [UIImage imageNamed:@"SIAlertView.bundle/button-destructive"]; + highlightedImage = [UIImage imageNamed:@"SIAlertView.bundle/button-destructive-d"]; + [button setTitleColor:self.destructiveButtonColor forState:UIControlStateNormal]; + [button setTitleColor:[self.destructiveButtonColor colorWithAlphaComponent:0.8] forState:UIControlStateHighlighted]; + break; + case SIAlertViewButtonTypeDefault: + default: + normalImage = [UIImage imageNamed:@"SIAlertView.bundle/button-default"]; + highlightedImage = [UIImage imageNamed:@"SIAlertView.bundle/button-default-d"]; + [button setTitleColor:self.buttonColor forState:UIControlStateNormal]; + [button setTitleColor:[self.buttonColor colorWithAlphaComponent:0.8] forState:UIControlStateHighlighted]; + break; + } + CGFloat hInset = floorf(normalImage.size.width / 2); + CGFloat vInset = floorf(normalImage.size.height / 2); + UIEdgeInsets insets = UIEdgeInsetsMake(vInset, hInset, vInset, hInset); + normalImage = [normalImage resizableImageWithCapInsets:insets]; + highlightedImage = [highlightedImage resizableImageWithCapInsets:insets]; + [button setBackgroundImage:normalImage forState:UIControlStateNormal]; + [button setBackgroundImage:highlightedImage forState:UIControlStateHighlighted]; + [button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside]; + + return button; +} + +#pragma mark - Actions + +- (void)buttonAction:(UIButton *)button +{ + [SIAlertView setAnimating:YES]; // set this flag to YES in order to prevent showing another alert in action block + SIAlertItem *item = self.items[button.tag]; + if (item.action) { + item.action(self); + } + [self dismissAnimated:YES]; +} + +#pragma mark - CAAnimation delegate + +- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag +{ + void(^completion)(void) = [anim valueForKey:@"handler"]; + if (completion) { + completion(); + } +} + +#pragma mark - UIAppearance setters + +- (void)setViewBackgroundColor:(UIColor *)viewBackgroundColor +{ + if (_viewBackgroundColor == viewBackgroundColor) { + return; + } + _viewBackgroundColor = viewBackgroundColor; + self.containerView.backgroundColor = viewBackgroundColor; +} + +- (void)setTitleFont:(UIFont *)titleFont +{ + if (_titleFont == titleFont) { + return; + } + _titleFont = titleFont; + self.titleLabel.font = titleFont; + [self invalidateLayout]; +} + +- (void)setMessageFont:(UIFont *)messageFont +{ + if (_messageFont == messageFont) { + return; + } + _messageFont = messageFont; + self.messageLabel.font = messageFont; + [self invalidateLayout]; +} + +- (void)setTitleColor:(UIColor *)titleColor +{ + if (_titleColor == titleColor) { + return; + } + _titleColor = titleColor; + self.titleLabel.textColor = titleColor; +} + +- (void)setMessageColor:(UIColor *)messageColor +{ + if (_messageColor == messageColor) { + return; + } + _messageColor = messageColor; + self.messageLabel.textColor = messageColor; +} + +- (void)setButtonFont:(UIFont *)buttonFont +{ + if (_buttonFont == buttonFont) { + return; + } + _buttonFont = buttonFont; + for (UIButton *button in self.buttons) { + button.titleLabel.font = buttonFont; + } +} + +- (void)setCornerRadius:(CGFloat)cornerRadius +{ + if (_cornerRadius == cornerRadius) { + return; + } + _cornerRadius = cornerRadius; + self.containerView.layer.cornerRadius = cornerRadius; +} + +- (void)setShadowRadius:(CGFloat)shadowRadius +{ + if (_shadowRadius == shadowRadius) { + return; + } + _shadowRadius = shadowRadius; + self.containerView.layer.shadowRadius = shadowRadius; +} + +- (void)setButtonColor:(UIColor *)buttonColor +{ + if (_buttonColor == buttonColor) { + return; + } + _buttonColor = buttonColor; + [self setColor:buttonColor toButtonsOfType:SIAlertViewButtonTypeDefault]; +} + +- (void)setCancelButtonColor:(UIColor *)buttonColor +{ + if (_cancelButtonColor == buttonColor) { + return; + } + _cancelButtonColor = buttonColor; + [self setColor:buttonColor toButtonsOfType:SIAlertViewButtonTypeCancel]; +} + +- (void)setDestructiveButtonColor:(UIColor *)buttonColor +{ + if (_destructiveButtonColor == buttonColor) { + return; + } + _destructiveButtonColor = buttonColor; + [self setColor:buttonColor toButtonsOfType:SIAlertViewButtonTypeDestructive]; +} + + +- (void)setDefaultButtonImage:(UIImage *)defaultButtonImage forState:(UIControlState)state +{ + [self setButtonImage:defaultButtonImage forState:state andButtonType:SIAlertViewButtonTypeDefault]; +} + + +- (void)setCancelButtonImage:(UIImage *)cancelButtonImage forState:(UIControlState)state +{ + [self setButtonImage:cancelButtonImage forState:state andButtonType:SIAlertViewButtonTypeCancel]; +} + + +- (void)setDestructiveButtonImage:(UIImage *)destructiveButtonImage forState:(UIControlState)state +{ + [self setButtonImage:destructiveButtonImage forState:state andButtonType:SIAlertViewButtonTypeDestructive]; +} + + +- (void)setButtonImage:(UIImage *)image forState:(UIControlState)state andButtonType:(SIAlertViewButtonType)type +{ + for (NSUInteger i = 0; i < self.items.count; i++) + { + SIAlertItem *item = self.items[i]; + if(item.type == type) + { + UIButton *button = self.buttons[i]; + [button setBackgroundImage:image forState:state]; + } + } +} + + +-(void)setColor:(UIColor *)color toButtonsOfType:(SIAlertViewButtonType)type { + for (NSUInteger i = 0; i < self.items.count; i++) { + SIAlertItem *item = self.items[i]; + if(item.type == type) { + UIButton *button = self.buttons[i]; + [button setTitleColor:color forState:UIControlStateNormal]; + [button setTitleColor:[color colorWithAlphaComponent:0.8] forState:UIControlStateHighlighted]; + } + } +} + +@end diff --git a/grocery-objc/Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m b/grocery-objc/Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m new file mode 100644 index 0000000..6a29cf8 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_AFNetworking : NSObject +@end +@implementation PodsDummy_AFNetworking +@end diff --git a/grocery-objc/Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch b/grocery-objc/Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch new file mode 100644 index 0000000..b52cf0d --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch @@ -0,0 +1,15 @@ +#ifdef __OBJC__ +#import +#endif + +#ifndef TARGET_OS_IOS + #define TARGET_OS_IOS TARGET_OS_IPHONE +#endif + +#ifndef TARGET_OS_WATCH + #define TARGET_OS_WATCH 0 +#endif + +#ifndef TARGET_OS_TV + #define TARGET_OS_TV 0 +#endif diff --git a/grocery-objc/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig b/grocery-objc/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig new file mode 100644 index 0000000..4c8482a --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig @@ -0,0 +1,5 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AFNetworking" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FoldingTabBar" "${PODS_ROOT}/Headers/Public/HSDatePickerViewController" "${PODS_ROOT}/Headers/Public/NSDate+RelativeTime" "${PODS_ROOT}/Headers/Public/RSBarcodes" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/SIAlertView" "${PODS_ROOT}/Headers/Public/Unirest" +OTHER_LDFLAGS = -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" +PODS_ROOT = ${SRCROOT} +SKIP_INSTALL = YES \ No newline at end of file diff --git a/grocery-objc/Pods/Target Support Files/Firebase/Firebase-dummy.m b/grocery-objc/Pods/Target Support Files/Firebase/Firebase-dummy.m new file mode 100644 index 0000000..87930a8 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/Firebase/Firebase-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Firebase : NSObject +@end +@implementation PodsDummy_Firebase +@end diff --git a/grocery-objc/Pods/Target Support Files/Firebase/Firebase-prefix.pch b/grocery-objc/Pods/Target Support Files/Firebase/Firebase-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/Firebase/Firebase-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/grocery-objc/Pods/Target Support Files/Firebase/Firebase.xcconfig b/grocery-objc/Pods/Target Support Files/Firebase/Firebase.xcconfig new file mode 100644 index 0000000..e472189 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/Firebase/Firebase.xcconfig @@ -0,0 +1,6 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Firebase" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FoldingTabBar" "${PODS_ROOT}/Headers/Public/HSDatePickerViewController" "${PODS_ROOT}/Headers/Public/NSDate+RelativeTime" "${PODS_ROOT}/Headers/Public/RSBarcodes" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/SIAlertView" "${PODS_ROOT}/Headers/Public/Unirest" +LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Firebase" +OTHER_LDFLAGS = -ObjC -l"FirebaseStatic" -l"c++" -l"icucore" -framework "CFNetwork" -framework "Security" -framework "SystemConfiguration" +PODS_ROOT = ${SRCROOT} +SKIP_INSTALL = YES \ No newline at end of file diff --git a/grocery-objc/Pods/Target Support Files/FoldingTabBar/FoldingTabBar-dummy.m b/grocery-objc/Pods/Target Support Files/FoldingTabBar/FoldingTabBar-dummy.m new file mode 100644 index 0000000..0b0eeb2 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/FoldingTabBar/FoldingTabBar-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_FoldingTabBar : NSObject +@end +@implementation PodsDummy_FoldingTabBar +@end diff --git a/grocery-objc/Pods/Target Support Files/FoldingTabBar/FoldingTabBar-prefix.pch b/grocery-objc/Pods/Target Support Files/FoldingTabBar/FoldingTabBar-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/FoldingTabBar/FoldingTabBar-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/grocery-objc/Pods/Target Support Files/FoldingTabBar/FoldingTabBar.xcconfig b/grocery-objc/Pods/Target Support Files/FoldingTabBar/FoldingTabBar.xcconfig new file mode 100644 index 0000000..44ac5c6 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/FoldingTabBar/FoldingTabBar.xcconfig @@ -0,0 +1,5 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/FoldingTabBar" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FoldingTabBar" "${PODS_ROOT}/Headers/Public/HSDatePickerViewController" "${PODS_ROOT}/Headers/Public/NSDate+RelativeTime" "${PODS_ROOT}/Headers/Public/RSBarcodes" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/SIAlertView" "${PODS_ROOT}/Headers/Public/Unirest" +OTHER_LDFLAGS = -framework "QuartzCore" -framework "UIKit" +PODS_ROOT = ${SRCROOT} +SKIP_INSTALL = YES \ No newline at end of file diff --git a/grocery-objc/Pods/Target Support Files/HSDatePickerViewController/HSDatePickerViewController-dummy.m b/grocery-objc/Pods/Target Support Files/HSDatePickerViewController/HSDatePickerViewController-dummy.m new file mode 100644 index 0000000..1fdb32d --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/HSDatePickerViewController/HSDatePickerViewController-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_HSDatePickerViewController : NSObject +@end +@implementation PodsDummy_HSDatePickerViewController +@end diff --git a/grocery-objc/Pods/Target Support Files/HSDatePickerViewController/HSDatePickerViewController-prefix.pch b/grocery-objc/Pods/Target Support Files/HSDatePickerViewController/HSDatePickerViewController-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/HSDatePickerViewController/HSDatePickerViewController-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/grocery-objc/Pods/Target Support Files/HSDatePickerViewController/HSDatePickerViewController.xcconfig b/grocery-objc/Pods/Target Support Files/HSDatePickerViewController/HSDatePickerViewController.xcconfig new file mode 100644 index 0000000..1e112bb --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/HSDatePickerViewController/HSDatePickerViewController.xcconfig @@ -0,0 +1,4 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/HSDatePickerViewController" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FoldingTabBar" "${PODS_ROOT}/Headers/Public/HSDatePickerViewController" "${PODS_ROOT}/Headers/Public/NSDate+RelativeTime" "${PODS_ROOT}/Headers/Public/RSBarcodes" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/SIAlertView" "${PODS_ROOT}/Headers/Public/Unirest" +PODS_ROOT = ${SRCROOT} +SKIP_INSTALL = YES \ No newline at end of file diff --git a/grocery-objc/Pods/Target Support Files/NSDate+RelativeTime/NSDate+RelativeTime-dummy.m b/grocery-objc/Pods/Target Support Files/NSDate+RelativeTime/NSDate+RelativeTime-dummy.m new file mode 100644 index 0000000..b09311b --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/NSDate+RelativeTime/NSDate+RelativeTime-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_NSDate_RelativeTime : NSObject +@end +@implementation PodsDummy_NSDate_RelativeTime +@end diff --git a/grocery-objc/Pods/Target Support Files/NSDate+RelativeTime/NSDate+RelativeTime-prefix.pch b/grocery-objc/Pods/Target Support Files/NSDate+RelativeTime/NSDate+RelativeTime-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/NSDate+RelativeTime/NSDate+RelativeTime-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/grocery-objc/Pods/Target Support Files/NSDate+RelativeTime/NSDate+RelativeTime.xcconfig b/grocery-objc/Pods/Target Support Files/NSDate+RelativeTime/NSDate+RelativeTime.xcconfig new file mode 100644 index 0000000..62746f1 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/NSDate+RelativeTime/NSDate+RelativeTime.xcconfig @@ -0,0 +1,4 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/NSDate+RelativeTime" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FoldingTabBar" "${PODS_ROOT}/Headers/Public/HSDatePickerViewController" "${PODS_ROOT}/Headers/Public/NSDate+RelativeTime" "${PODS_ROOT}/Headers/Public/RSBarcodes" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/SIAlertView" "${PODS_ROOT}/Headers/Public/Unirest" +PODS_ROOT = ${SRCROOT} +SKIP_INSTALL = YES \ No newline at end of file diff --git a/grocery-objc/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown b/grocery-objc/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown new file mode 100644 index 0000000..e1215c3 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown @@ -0,0 +1,190 @@ +# Acknowledgements +This application makes use of the following third party libraries: + +## AFNetworking + +Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) + +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. + + +## Firebase + +https://www.firebase.com/terms/terms-of-service.html + +## FoldingTabBar + +The MIT License (MIT) + +Copyright (c) 2015 Yalantis + +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. + + + +## HSDatePickerViewController + +The MIT License (MIT) + +Copyright (c) 2015 Kamil Powałowski + +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. + + + +## NSDate+RelativeTime + +The MIT License (MIT) + +Copyright (c) 2013 Bart van Zon + +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. + + +## RSBarcodes + +The MIT License (MIT) + +Copyright (c) 2012-2014 P.D.Q. + +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. + + +## SDWebImage + +Copyright (c) 2009 Olivier Poitrey + +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. + + + +## SIAlertView + +Copyright (c) 2013 Sumi Interactive + +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. + +## Unirest + +The MIT License + +Copyright (c) 2013-2015 Mashape (https://www.mashape.com) + +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. + +Generated by CocoaPods - http://cocoapods.org diff --git a/grocery-objc/Pods/Target Support Files/Pods/Pods-acknowledgements.plist b/grocery-objc/Pods/Target Support Files/Pods/Pods-acknowledgements.plist new file mode 100644 index 0000000..c8f5a45 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/Pods/Pods-acknowledgements.plist @@ -0,0 +1,252 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) + +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. + + Title + AFNetworking + Type + PSGroupSpecifier + + + FooterText + https://www.firebase.com/terms/terms-of-service.html + Title + Firebase + Type + PSGroupSpecifier + + + FooterText + The MIT License (MIT) + +Copyright (c) 2015 Yalantis + +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. + + + Title + FoldingTabBar + Type + PSGroupSpecifier + + + FooterText + The MIT License (MIT) + +Copyright (c) 2015 Kamil Powałowski + +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. + + + Title + HSDatePickerViewController + Type + PSGroupSpecifier + + + FooterText + The MIT License (MIT) + +Copyright (c) 2013 Bart van Zon + +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. + + Title + NSDate+RelativeTime + Type + PSGroupSpecifier + + + FooterText + The MIT License (MIT) + +Copyright (c) 2012-2014 P.D.Q. + +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. + + Title + RSBarcodes + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2009 Olivier Poitrey <rs@dailymotion.com> + +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. + + + Title + SDWebImage + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2013 Sumi Interactive + +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. + Title + SIAlertView + Type + PSGroupSpecifier + + + FooterText + The MIT License + +Copyright (c) 2013-2015 Mashape (https://www.mashape.com) + +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. + + Title + Unirest + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - http://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/grocery-objc/Pods/Target Support Files/Pods/Pods-dummy.m b/grocery-objc/Pods/Target Support Files/Pods/Pods-dummy.m new file mode 100644 index 0000000..ade64bd --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/Pods/Pods-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods : NSObject +@end +@implementation PodsDummy_Pods +@end diff --git a/grocery-objc/Pods/Target Support Files/Pods/Pods-frameworks.sh b/grocery-objc/Pods/Target Support Files/Pods/Pods-frameworks.sh new file mode 100755 index 0000000..6f76344 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/Pods/Pods-frameworks.sh @@ -0,0 +1,84 @@ +#!/bin/sh +set -e + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # use filter instead of exclude so missing patterns dont' throw errors + echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" + /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current file + archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" + stripped="" + for arch in $archs; do + if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi +} + diff --git a/grocery-objc/Pods/Target Support Files/Pods/Pods-resources.sh b/grocery-objc/Pods/Target Support Files/Pods/Pods-resources.sh new file mode 100755 index 0000000..56c318b --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/Pods/Pods-resources.sh @@ -0,0 +1,105 @@ +#!/bin/sh +set -e + +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +realpath() { + DIRECTORY="$(cd "${1%/*}" && pwd)" + FILENAME="${1##*/}" + echo "$DIRECTORY/$FILENAME" +} + +install_resource() +{ + case $1 in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.framework) + echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" + xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + /*) + echo "$1" + echo "$1" >> "$RESOURCES_TO_COPY" + ;; + *) + echo "${PODS_ROOT}/$1" + echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" + ;; + esac +} +if [[ "$CONFIGURATION" == "Debug" ]]; then + install_resource "HSDatePickerViewController/HSDatePickerViewControllerDemo/HSDatePickerViewController/HSDatePickerViewController.xib" + install_resource "NSDate+RelativeTime/NSDate+RelativeTime.bundle" + install_resource "SIAlertView/SIAlertView/SIAlertView.bundle" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_resource "HSDatePickerViewController/HSDatePickerViewControllerDemo/HSDatePickerViewController/HSDatePickerViewController.xib" + install_resource "NSDate+RelativeTime/NSDate+RelativeTime.bundle" + install_resource "SIAlertView/SIAlertView/SIAlertView.bundle" +fi + +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] +then + case "${TARGETED_DEVICE_FAMILY}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; + esac + + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "`realpath $PODS_ROOT`*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi diff --git a/grocery-objc/Pods/Target Support Files/Pods/Pods.debug.xcconfig b/grocery-objc/Pods/Target Support Files/Pods/Pods.debug.xcconfig new file mode 100644 index 0000000..155b5d1 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/Pods/Pods.debug.xcconfig @@ -0,0 +1,6 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FoldingTabBar" "${PODS_ROOT}/Headers/Public/HSDatePickerViewController" "${PODS_ROOT}/Headers/Public/NSDate+RelativeTime" "${PODS_ROOT}/Headers/Public/RSBarcodes" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/SIAlertView" "${PODS_ROOT}/Headers/Public/Unirest" +LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Firebase" +OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/Firebase" -isystem "${PODS_ROOT}/Headers/Public/FoldingTabBar" -isystem "${PODS_ROOT}/Headers/Public/HSDatePickerViewController" -isystem "${PODS_ROOT}/Headers/Public/NSDate+RelativeTime" -isystem "${PODS_ROOT}/Headers/Public/RSBarcodes" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" -isystem "${PODS_ROOT}/Headers/Public/SIAlertView" -isystem "${PODS_ROOT}/Headers/Public/Unirest" +OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"Firebase" -l"FirebaseStatic" -l"FoldingTabBar" -l"HSDatePickerViewController" -l"NSDate+RelativeTime" -l"RSBarcodes" -l"SDWebImage" -l"SIAlertView" -l"Unirest" -l"c++" -l"icucore" -framework "AVFoundation" -framework "CFNetwork" -framework "CoreGraphics" -framework "CoreImage" -framework "ImageIO" -framework "MobileCoreServices" -framework "QuartzCore" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/grocery-objc/Pods/Target Support Files/Pods/Pods.release.xcconfig b/grocery-objc/Pods/Target Support Files/Pods/Pods.release.xcconfig new file mode 100644 index 0000000..155b5d1 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/Pods/Pods.release.xcconfig @@ -0,0 +1,6 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FoldingTabBar" "${PODS_ROOT}/Headers/Public/HSDatePickerViewController" "${PODS_ROOT}/Headers/Public/NSDate+RelativeTime" "${PODS_ROOT}/Headers/Public/RSBarcodes" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/SIAlertView" "${PODS_ROOT}/Headers/Public/Unirest" +LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Firebase" +OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/Firebase" -isystem "${PODS_ROOT}/Headers/Public/FoldingTabBar" -isystem "${PODS_ROOT}/Headers/Public/HSDatePickerViewController" -isystem "${PODS_ROOT}/Headers/Public/NSDate+RelativeTime" -isystem "${PODS_ROOT}/Headers/Public/RSBarcodes" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" -isystem "${PODS_ROOT}/Headers/Public/SIAlertView" -isystem "${PODS_ROOT}/Headers/Public/Unirest" +OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"Firebase" -l"FirebaseStatic" -l"FoldingTabBar" -l"HSDatePickerViewController" -l"NSDate+RelativeTime" -l"RSBarcodes" -l"SDWebImage" -l"SIAlertView" -l"Unirest" -l"c++" -l"icucore" -framework "AVFoundation" -framework "CFNetwork" -framework "CoreGraphics" -framework "CoreImage" -framework "ImageIO" -framework "MobileCoreServices" -framework "QuartzCore" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/grocery-objc/Pods/Target Support Files/RSBarcodes/RSBarcodes-dummy.m b/grocery-objc/Pods/Target Support Files/RSBarcodes/RSBarcodes-dummy.m new file mode 100644 index 0000000..b82f610 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/RSBarcodes/RSBarcodes-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_RSBarcodes : NSObject +@end +@implementation PodsDummy_RSBarcodes +@end diff --git a/grocery-objc/Pods/Target Support Files/RSBarcodes/RSBarcodes-prefix.pch b/grocery-objc/Pods/Target Support Files/RSBarcodes/RSBarcodes-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/RSBarcodes/RSBarcodes-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/grocery-objc/Pods/Target Support Files/RSBarcodes/RSBarcodes.xcconfig b/grocery-objc/Pods/Target Support Files/RSBarcodes/RSBarcodes.xcconfig new file mode 100644 index 0000000..f17793a --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/RSBarcodes/RSBarcodes.xcconfig @@ -0,0 +1,5 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/RSBarcodes" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FoldingTabBar" "${PODS_ROOT}/Headers/Public/HSDatePickerViewController" "${PODS_ROOT}/Headers/Public/NSDate+RelativeTime" "${PODS_ROOT}/Headers/Public/RSBarcodes" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/SIAlertView" "${PODS_ROOT}/Headers/Public/Unirest" +OTHER_LDFLAGS = -framework "AVFoundation" -framework "CoreImage" +PODS_ROOT = ${SRCROOT} +SKIP_INSTALL = YES \ No newline at end of file diff --git a/grocery-objc/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m b/grocery-objc/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m new file mode 100644 index 0000000..86d2b5f --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_SDWebImage : NSObject +@end +@implementation PodsDummy_SDWebImage +@end diff --git a/grocery-objc/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch b/grocery-objc/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/grocery-objc/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig b/grocery-objc/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig new file mode 100644 index 0000000..884f164 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig @@ -0,0 +1,5 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SDWebImage" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FoldingTabBar" "${PODS_ROOT}/Headers/Public/HSDatePickerViewController" "${PODS_ROOT}/Headers/Public/NSDate+RelativeTime" "${PODS_ROOT}/Headers/Public/RSBarcodes" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/SIAlertView" "${PODS_ROOT}/Headers/Public/Unirest" +OTHER_LDFLAGS = -framework "ImageIO" +PODS_ROOT = ${SRCROOT} +SKIP_INSTALL = YES \ No newline at end of file diff --git a/grocery-objc/Pods/Target Support Files/SIAlertView/SIAlertView-dummy.m b/grocery-objc/Pods/Target Support Files/SIAlertView/SIAlertView-dummy.m new file mode 100644 index 0000000..d010881 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/SIAlertView/SIAlertView-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_SIAlertView : NSObject +@end +@implementation PodsDummy_SIAlertView +@end diff --git a/grocery-objc/Pods/Target Support Files/SIAlertView/SIAlertView-prefix.pch b/grocery-objc/Pods/Target Support Files/SIAlertView/SIAlertView-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/SIAlertView/SIAlertView-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/grocery-objc/Pods/Target Support Files/SIAlertView/SIAlertView.xcconfig b/grocery-objc/Pods/Target Support Files/SIAlertView/SIAlertView.xcconfig new file mode 100644 index 0000000..603c27b --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/SIAlertView/SIAlertView.xcconfig @@ -0,0 +1,5 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SIAlertView" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FoldingTabBar" "${PODS_ROOT}/Headers/Public/HSDatePickerViewController" "${PODS_ROOT}/Headers/Public/NSDate+RelativeTime" "${PODS_ROOT}/Headers/Public/RSBarcodes" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/SIAlertView" "${PODS_ROOT}/Headers/Public/Unirest" +OTHER_LDFLAGS = -framework "QuartzCore" +PODS_ROOT = ${SRCROOT} +SKIP_INSTALL = YES \ No newline at end of file diff --git a/grocery-objc/Pods/Target Support Files/Unirest/Unirest-dummy.m b/grocery-objc/Pods/Target Support Files/Unirest/Unirest-dummy.m new file mode 100644 index 0000000..c6d5126 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/Unirest/Unirest-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Unirest : NSObject +@end +@implementation PodsDummy_Unirest +@end diff --git a/grocery-objc/Pods/Target Support Files/Unirest/Unirest-prefix.pch b/grocery-objc/Pods/Target Support Files/Unirest/Unirest-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/Unirest/Unirest-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/grocery-objc/Pods/Target Support Files/Unirest/Unirest.xcconfig b/grocery-objc/Pods/Target Support Files/Unirest/Unirest.xcconfig new file mode 100644 index 0000000..feb726d --- /dev/null +++ b/grocery-objc/Pods/Target Support Files/Unirest/Unirest.xcconfig @@ -0,0 +1,4 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Unirest" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FoldingTabBar" "${PODS_ROOT}/Headers/Public/HSDatePickerViewController" "${PODS_ROOT}/Headers/Public/NSDate+RelativeTime" "${PODS_ROOT}/Headers/Public/RSBarcodes" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/SIAlertView" "${PODS_ROOT}/Headers/Public/Unirest" +PODS_ROOT = ${SRCROOT} +SKIP_INSTALL = YES \ No newline at end of file diff --git a/grocery-objc/Pods/Unirest/LICENSE b/grocery-objc/Pods/Unirest/LICENSE new file mode 100644 index 0000000..78fe11e --- /dev/null +++ b/grocery-objc/Pods/Unirest/LICENSE @@ -0,0 +1,22 @@ +The MIT License + +Copyright (c) 2013-2015 Mashape (https://www.mashape.com) + +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. diff --git a/grocery-objc/Pods/Unirest/README.md b/grocery-objc/Pods/Unirest/README.md new file mode 100644 index 0000000..a0e9a74 --- /dev/null +++ b/grocery-objc/Pods/Unirest/README.md @@ -0,0 +1,281 @@ +# Unirest for Objective-C [![Build Status][travis-image]][travis-url] [![version][cocoapods-version]][cocoapods-url] + +[![License][cocoapods-license]][license-url] +[![Code Climate][codeclimate-quality]][codeclimate-url] +[![Coverage Status][codeclimate-coverage]][codeclimate-url] +[![Gitter][gitter-image]][gitter-url] + +Unirest is a set of lightweight HTTP libraries available in [multiple languages](http://unirest.io). + +## Features + +* Make `GET`, `POST`, `PUT`, `PATCH`, `DELETE` requests +* Both syncronous and asynchronous (non-blocking) requests +* It supports form parameters, file uploads and custom body entities +* Supports gzip +* Supports Basic Authentication natively +* Customizable timeout +* Customizable default headers for every request (DRY) +* Automatic JSON parsing into native object (`NSDictionary` or `NSArray`) for JSON responses + +## Installing +Download the Objective-C Unirest Library from GitHub (or clone the repo) and import the folder into your project. You can also install Unirest-obj-c with [CocoaPods](http://cocoapods.org/). + +### CocoaPods + +If you decide to use CocoaPods, create a `Podfile` file in your project's folder: + +```bash +$ edit Podfile +platform :ios, '5.0' +pod 'Unirest', '~> 1.1.3' +``` + +and then execute `pod install`. Make sure to always open the Xcode **workspace** instead of the project file when building your project: + +```bash +$ open App.xcworkspace +``` + +Now you can import your dependencies: + +```objective-c +#import +``` + +### Requirements + +The Unirest-Obj-C client library requires ARC (Automatic Reference Counting) to be enabled in your Xcode project. To enable ARC select your project or target and then go to Build Settings and under the section Apple LLVM compiler 3.0 - Language you will see the option Objective-C Automatic Reference Counting: + +Enable ARC in Xcode + +For existing projects, fortunately Xcode offers a tool to convert existing code to ARC, which is available at Edit -> Refactor -> Convert to Objective-C ARC + +## Creating Request +So you're probably wondering how using Unirest makes creating requests in Objective-C easier, let's look at a working example: + +```objective-c +NSDictionary* headers = @{@"accept": @"application/json"}; +NSDictionary* parameters = @{@"parameter": @"value", @"foo": @"bar"}; + +UNIHTTPJsonResponse *response = [[UNIRest post:^(UNISimpleRequest *request) { + [request setUrl:@"http://httpbin.org/post"]; + [request setHeaders:headers]; + [request setParameters:parameters]; +}] asJson]; +``` + +Just like in the Unirest Java library the Objective-C library supports multiple response types given as the last parameter. In the example above we use `asJson` to get a JSON response, likewise there are `asBinary` and `asString` for responses of other nature such as file data and hypermedia responses. + +## Asynchronous Requests +For non-blocking requests you will want to make an asychronous request to keep your application going while data is fetched or updated in the background, doing so with unirest is extremely easy with barely any code change from the previous example: + +```objective-c +NSDictionary *headers = @{@"accept": @"application/json"}; +NSDictionary *parameters = @{@"parameter": @"value", @"foo": @"bar"}; + +[[UNIRest post:^(UNISimpleRequest *request) { + [request setUrl:@"http://httpbin.org/post"]; + [request setHeaders:headers]; + [request setParameters:parameters]; +}] asJsonAsync:^(UNIHTTPJsonResponse* response, NSError *error) { + // This is the asyncronous callback block + NSInteger code = response.code; + NSDictionary *responseHeaders = response.headers; + UNIJsonNode *body = response.body; + NSData *rawBody = response.rawBody; +}]; +``` + +### Cancel Asynchronous Request + +You can cancel an asyncronous request by invoking the `cancel` method on the `UNIUrlConnection` object: + +```objective-c +UNIUrlConnection *asyncConnection = [[UNIRest get:^(UNISimpleRequest *simpleRequest) { + [request setUrl:@"http://httpbin.org/get"]; +}] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) { + // Do something +}]; + +[asyncConnection cancel]; // Cancel request +``` + +## File Uploads +Transferring files through request with unirest in Objective-C can be done by creating a `NSURL` object and passing it along as a parameter value with a `UNISimpleRequest` like so: + +```objective-c +NSDictionary* headers = @{@"accept": @"application/json"}; +NSURL* file = nil; +NSDictionary* parameters = @{@"parameter": @"value", @"file": file}; + +UNIHTTPJsonResponse *response = [[UNIRest post:^(UNISimpleRequest *request) { + [request setUrl:@"http://httpbin.org/post"]; + [request setHeaders:headers]; + [request setParameters:parameters]; +}] asJson]; +``` + +## Custom Entity Body +To send a custom body such as JSON simply serialize your data utilizing the `NSJSONSerialization` with a `BodyRequest` and `[method]Entity` instead of just `[method]` block like so: + +```objective-c +NSDictionary *headers = @{@"accept": @"application/json"}; +NSDictionary *parameters = @{@"parameter": @"value", @"foo": @"bar"}; + +UNIHTTPJsonResponse *response = [[UNIRest postEntity:^(UNIBodyRequest *request) { + [request setUrl:@"http://httpbin.org/post"]; + [request setHeaders:headers]; + // Converting NSDictionary to JSON: + [request setBody:[NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil]]; +}] asJson]; +``` + +## Basic Authentication + +Authenticating the request with basic authentication can be done by setting the `username` and `password` properties in the builder: + +```objective-c +UNIHTTPJsonResponse *response = [[UNIRest get:^(UNISimpleRequest *request) { + [request setUrl:@"http://httpbin.org/get"]; + [request setUsername:@"user"]; + [request setPassword:@"password"]; +}] asJson]; +``` + +# Request +The Objective-C unirest library uses configuration blocks of type UNISimpleRequest and UNIBodyRequest to configure the URL, Headers, and Parameters / Body of the request. + +```objective-c ++(UNIHTTPRequest*) get:(void (^)(UNISimpleRequestBlock*)) config; + ++(UNIHTTPRequestWithBody*) post:(void (^)(UNISimpleRequestBlock*)) config; ++(UNIHTTPRequestWithBody*) postEntity:(void (^)(UNIBodyRequestBlock*)) config; + ++(UNIHTTPRequestWithBody*) put:(void (^)(UNISimpleRequestBlock*)) config; ++(UNIHTTPRequestWithBody*) putEntity:(void (^)(UNIBodyRequestBlock*)) config; + ++(UNIHTTPRequestWithBody*) patch:(void (^)(UNISimpleRequestBlock*)) config; ++(UNIHTTPRequestWithBody*) patchEntity:(void (^)(UNIBodyRequestBlock*)) config; + ++(UNIHTTPRequestWithBody*) delete:(void (^)(UNISimpleRequestBlock*)) config; ++(UNIHTTPRequestWithBody*) deleteEntity:(void (^)(UNIBodyRequestBlock*)) config; +``` + +- `UNIHTTPRequest` `[UNIRest get:` `(void (^)(UNISimpleRequestBlock*))] config;` + + Sends equivalent request with method type to given URL +- `UNIHTTPRequestWithBody` `[UNIRest (post|postEntity):` `(void (^)(UNISimpleRequestBlock|UNIBodyRequestBlock)(*))] config;` + + Sends equivalent request with method type to given URL +- `UNIHTTPRequestWithBody` `[UNIRest (put|putEntity):` `(void (^)(UNISimpleRequestBlock|UNIBodyRequestBlock)(*))] config;` + + Sends equivalent request with method type to given URL +- `UNIHTTPRequestWithBody` `[UNIRest (patch|patchEntity):` `(void (^)(UNISimpleRequestBlock|UNIBodyRequestBlock)(*))] config;` + + Sends equivalent request with method type to given URL +- `UNIHTTPRequestWithBody` `[UNIRest (delete|deleteEntity):` `(void (^)(UNISimpleRequestBlock|UNIBodyRequestBlock)(*))] config;` + + Sends equivalent request with method type to given URL + +# Response +The `UNIHTTPRequest` and `UNIHTTPRequestWithBody` can then be executed by calling one of: + +```objective-c +-(UNIHTTPStringResponse*) asString; +-(UNIHTTPStringResponse*) asString:(NSError**) error; +-(UNIUrlConnection*) asStringAsync:(UNIHTTPStringResponseBlock) response; + +-(UNIHTTPBinaryResponse*) asBinary; +-(UNIHTTPBinaryResponse*) asBinary:(NSError**) error; +-(UNIUrlConnection*) asBinaryAsync:(UNIHTTPBinaryResponseBlock) response; + +-(UNIHTTPJsonResponse*) asJson; +-(UNIHTTPJsonResponse*) asJson:(NSError**) error; +-(UNIUrlConnection*) asJsonAsync:(UNIHTTPJsonResponseBlock) response; +``` + +- `-(UNIHTTPStringResponse*)` `asString;` + + Blocking request call with response returned as string for Hypermedia APIs or other. + +- `-(UNIHTTPStringResponse*) asString:(NSError**) error;` + + Blocking request call with response returned as string and error handling. + +- `-(UNIUrlConnection*) asStringAsync:(UNIHTTPStringResponseBlock) response;` + + Asynchronous request call with response returned as string for Hypermedia APIs or other. + +- `-(UNIHTTPBinaryResponse*)` `asBinary;` + + Blocking request call with response returned as binary output for files and other media. + +- `-(UNIHTTPBinaryResponse*) asBinary:(NSError**) error;` + + Blocking request call with response returned as binary output and error handling. + +- `-(UNIUrlConnection*) asBinaryAsync:(UNIHTTPBinaryResponseBlock) response;` + + Asynchronous request call with response returned as binary output for files and other media. + +- `-(UNIHTTPJsonResponse*)` `asJson;` + + Blocking request call with response returned as JSON. + +- `-(UNIHTTPJsonResponse*) asString:(NSError**) error;` + + Blocking request call with response returned as JSON and error handling. + +- `-(UNIUrlConnection*) asJsonAsync:(UNIHTTPJsonResponseBlock) response;` + + Asynchronous request call with response returned as JSON. + +# Advanced Configuration + +You can set some advanced configuration to tune Unirest-Obj-C: + +### Timeout + +You can set a custom timeout value (in **seconds**): + +```objective-c +[UNIRest timeout:2]; +``` + +By default the timeout is `60`. + +### Default Request Headers + +You can set default headers that will be sent on every request: + +```objective-c +[UNIRest defaultHeader:@"Header1" value:@"Value1"]; +[UNIRest defaultHeader:@"Header2" value:@"Value2"]; +``` + +You can clear the default headers anytime with: + +```objective-c +[UNIRest clearDefaultHeaders]; +``` + +---- + +Made with ♥ from the [Mashape](https://www.mashape.com/) team + +[license-url]: https://github.com/Mashape/unirest-obj-c/blob/master/LICENSE + +[gitter-url]: https://gitter.im/Mashape/unirest-obj-c +[gitter-image]: https://img.shields.io/badge/Gitter-Join%20Chat-blue.svg?style=flat + +[travis-url]: https://travis-ci.org/Mashape/unirest-obj-c +[travis-image]: https://img.shields.io/travis/Mashape/unirest-obj-c.svg?style=flat + +[cocoapods-url]: http://cocoadocs.org/docsets/Unirest +[cocoapods-license]: https://img.shields.io/cocoapods/l/Unirest.svg?style=flat +[cocoapods-version]: https://img.shields.io/cocoapods/v/Unirest.svg?style=flat + +[codeclimate-url]: https://codeclimate.com/github/Mashape/unirest-obj-c +[codeclimate-quality]: https://img.shields.io/codeclimate/github/Mashape/unirest-obj-c.svg?style=flat +[codeclimate-coverage]: https://img.shields.io/codeclimate/coverage/github/Mashape/unirest-obj-c.svg?style=flat diff --git a/grocery-objc/Pods/Unirest/Unirest/Base64.h b/grocery-objc/Pods/Unirest/Unirest/Base64.h new file mode 100644 index 0000000..80ed56d --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/Base64.h @@ -0,0 +1,30 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +@interface Base64 : NSObject + ++ (NSString *)base64String:(NSString *)str; + +@end \ No newline at end of file diff --git a/grocery-objc/Pods/Unirest/Unirest/Base64.m b/grocery-objc/Pods/Unirest/Unirest/Base64.m new file mode 100644 index 0000000..e474a6e --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/Base64.m @@ -0,0 +1,63 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "Base64.h" + +@implementation Base64 + ++ (NSString *)base64String:(NSString *)str +{ + NSData *theData = [str dataUsingEncoding: NSASCIIStringEncoding]; + const uint8_t* input = (const uint8_t*)[theData bytes]; + NSInteger length = [theData length]; + + static char table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + + NSMutableData* data = [NSMutableData dataWithLength:((length + 2) / 3) * 4]; + uint8_t* output = (uint8_t*)data.mutableBytes; + + NSInteger i; + for (i=0; i < length; i += 3) { + NSInteger value = 0; + NSInteger j; + for (j = i; j < (i + 3); j++) { + value <<= 8; + + if (j < length) { + value |= (0xFF & input[j]); + } + } + + NSInteger theIndex = (i / 3) * 4; + output[theIndex + 0] = table[(value >> 18) & 0x3F]; + output[theIndex + 1] = table[(value >> 12) & 0x3F]; + output[theIndex + 2] = (i + 1) < length ? table[(value >> 6) & 0x3F] : '='; + output[theIndex + 3] = (i + 2) < length ? table[(value >> 0) & 0x3F] : '='; + } + + return [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; +} + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/HttpRequest/UNIBaseRequest.h b/grocery-objc/Pods/Unirest/Unirest/HttpRequest/UNIBaseRequest.h new file mode 100644 index 0000000..a4c9775 --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/HttpRequest/UNIBaseRequest.h @@ -0,0 +1,35 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +@interface UNIBaseRequest : NSObject { + NSError* _error; +} + +@property(readwrite, strong) NSString* url; +@property(readwrite, strong) NSDictionary* headers; +@property(readwrite, strong) NSString* username; +@property(readwrite, strong) NSString* password; + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/HttpRequest/UNIBaseRequest.m b/grocery-objc/Pods/Unirest/Unirest/HttpRequest/UNIBaseRequest.m new file mode 100644 index 0000000..69e0037 --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/HttpRequest/UNIBaseRequest.m @@ -0,0 +1,30 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "UNIBaseRequest.h" + +@implementation UNIBaseRequest + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/HttpRequest/UNIBodyRequest.h b/grocery-objc/Pods/Unirest/Unirest/HttpRequest/UNIBodyRequest.h new file mode 100644 index 0000000..ebbd268 --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/HttpRequest/UNIBodyRequest.h @@ -0,0 +1,32 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "UNIBaseRequest.h" + +@interface UNIBodyRequest : UNIBaseRequest + +@property(readwrite, strong) NSData* body; + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/HttpRequest/UNIBodyRequest.m b/grocery-objc/Pods/Unirest/Unirest/HttpRequest/UNIBodyRequest.m new file mode 100644 index 0000000..7a8e3b2 --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/HttpRequest/UNIBodyRequest.m @@ -0,0 +1,30 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "UNIBodyRequest.h" + +@implementation UNIBodyRequest + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/HttpRequest/UNISimpleRequest.h b/grocery-objc/Pods/Unirest/Unirest/HttpRequest/UNISimpleRequest.h new file mode 100644 index 0000000..e9f7e4d --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/HttpRequest/UNISimpleRequest.h @@ -0,0 +1,32 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "UNIBaseRequest.h" + +@interface UNISimpleRequest : UNIBaseRequest + +@property(readwrite, strong) NSDictionary* parameters; + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/HttpRequest/UNISimpleRequest.m b/grocery-objc/Pods/Unirest/Unirest/HttpRequest/UNISimpleRequest.m new file mode 100644 index 0000000..57eac9d --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/HttpRequest/UNISimpleRequest.m @@ -0,0 +1,30 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "UNISimpleRequest.h" + +@implementation UNISimpleRequest + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPBinaryResponse.h b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPBinaryResponse.h new file mode 100644 index 0000000..deec67b --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPBinaryResponse.h @@ -0,0 +1,34 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "UNIHTTPResponse.h" + +@interface UNIHTTPBinaryResponse : UNIHTTPResponse + +@property(readwrite, strong) NSData* body; + +-(instancetype) initWithSimpleResponse:(UNIHTTPResponse*) httpResponse; + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPBinaryResponse.m b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPBinaryResponse.m new file mode 100644 index 0000000..3a6f973 --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPBinaryResponse.m @@ -0,0 +1,41 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "UNIHTTPBinaryResponse.h" + +@implementation UNIHTTPBinaryResponse + +-(instancetype) initWithSimpleResponse:(UNIHTTPResponse*) httpResponse { + self = [super init]; + if (self) { + [self setCode:[httpResponse code]]; + [self setHeaders:[httpResponse headers]]; + [self setRawBody:[httpResponse rawBody]]; + [self setBody:[httpResponse rawBody]]; + } + return self; +} + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPJsonResponse.h b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPJsonResponse.h new file mode 100644 index 0000000..edf35b9 --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPJsonResponse.h @@ -0,0 +1,35 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "UNIHTTPResponse.h" +#import "UNIJsonNode.h" + +@interface UNIHTTPJsonResponse : UNIHTTPResponse + +@property(readwrite, strong) UNIJsonNode* body; + +-(instancetype) initWithSimpleResponse:(UNIHTTPResponse*) httpResponse; + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPJsonResponse.m b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPJsonResponse.m new file mode 100644 index 0000000..74c6c40 --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPJsonResponse.m @@ -0,0 +1,53 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "UNIHTTPJsonResponse.h" + +@implementation UNIHTTPJsonResponse + +-(instancetype) initWithSimpleResponse:(UNIHTTPResponse*) httpResponse { + self = [super init]; + if (self) { + [self setCode:[httpResponse code]]; + [self setHeaders:[httpResponse headers]]; + [self setRawBody:[httpResponse rawBody]]; + + UNIJsonNode* body = [[UNIJsonNode alloc] init]; + NSError * error = nil; + id json = [NSJSONSerialization JSONObjectWithData:[httpResponse rawBody] options:NSJSONReadingMutableLeaves error:&error]; + + if ([json isKindOfClass:[NSArray class]]) { + [body setArray:json]; + } else { + [body setObject:json]; + } + + [self setBody:body]; + + } + return self; +} + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPResponse.h b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPResponse.h new file mode 100644 index 0000000..59f7d61 --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPResponse.h @@ -0,0 +1,32 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +@interface UNIHTTPResponse : NSObject + +@property(readwrite) NSInteger code; +@property(readwrite, strong) NSDictionary* headers; +@property(readwrite, strong) NSData* rawBody; + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPResponse.m b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPResponse.m new file mode 100644 index 0000000..e1b641e --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPResponse.m @@ -0,0 +1,30 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "UNIHTTPResponse.h" + +@implementation UNIHTTPResponse + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPStringResponse.h b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPStringResponse.h new file mode 100644 index 0000000..75aef16 --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPStringResponse.h @@ -0,0 +1,34 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "UNIHTTPResponse.h" + +@interface UNIHTTPStringResponse : UNIHTTPResponse + +@property(readwrite, strong) NSString* body; + +-(instancetype) initWithSimpleResponse:(UNIHTTPResponse*) httpResponse; + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPStringResponse.m b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPStringResponse.m new file mode 100644 index 0000000..55d00ab --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIHTTPStringResponse.m @@ -0,0 +1,44 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "UNIHTTPStringResponse.h" + +@implementation UNIHTTPStringResponse + +-(instancetype) initWithSimpleResponse:(UNIHTTPResponse*) httpResponse { + self = [super init]; + if (self) { + [self setCode:[httpResponse code]]; + [self setHeaders:[httpResponse headers]]; + [self setRawBody:[httpResponse rawBody]]; + + NSString* body = [[NSString alloc] initWithData:[httpResponse rawBody] encoding:NSUTF8StringEncoding]; + [self setBody:body]; + + } + return self; +} + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIJsonNode.h b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIJsonNode.h new file mode 100644 index 0000000..4a9b7ca --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIJsonNode.h @@ -0,0 +1,37 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +@interface UNIJsonNode : NSObject + +-(BOOL) isArray; + +@property(readwrite, strong) NSDictionary* object; +@property(readwrite, strong) NSArray* array; + +-(NSDictionary*) JSONObject; + +-(NSArray*) JSONArray; + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIJsonNode.m b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIJsonNode.m new file mode 100644 index 0000000..d7258ac --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/HttpResponse/UNIJsonNode.m @@ -0,0 +1,42 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "UNIJsonNode.h" + +@implementation UNIJsonNode + +-(BOOL) isArray { + return _array != nil; +} + +-(NSDictionary*) JSONObject { + return [self object]; +} + +-(NSArray*) JSONArray { + return [self array]; +} + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/UNIHTTPClientHelper.h b/grocery-objc/Pods/Unirest/Unirest/UNIHTTPClientHelper.h new file mode 100644 index 0000000..b2ddcfc --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/UNIHTTPClientHelper.h @@ -0,0 +1,42 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "HttpResponse/UNIHTTPResponse.h" +#import "UNIHTTPRequest.h" +#import "UNIHTTPRequestWithBody.h" +#import "HttpRequest/UNISimpleRequest.h" +#import "UNIUrlConnection.h" + +#define BOUNDARY @"---------------------------17237809831461299884346131229" + +typedef void (^UNIAsyncResponse)(UNIHTTPJsonResponse* jsonResponse, NSError* error); + +@interface UNIHTTPClientHelper : NSObject + ++(UNIHTTPResponse*) requestSync:(UNIHTTPRequest*) request error:(NSError**) error; + ++(UNIUrlConnection*) requestAsync:(UNIHTTPRequest*) request handler:(void (^)(UNIHTTPResponse*, NSError*))handler; + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/UNIHTTPClientHelper.m b/grocery-objc/Pods/Unirest/Unirest/UNIHTTPClientHelper.m new file mode 100644 index 0000000..7cb9ca9 --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/UNIHTTPClientHelper.m @@ -0,0 +1,239 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "UNIHTTPClientHelper.h" +#import "Base64.h" +#import "UNIRest.h" + +@interface UNIHTTPClientHelper() ++ (NSString*) encodeURI:(NSString*)value; ++ (NSString*) dictionaryToQuerystring:(NSDictionary*) parameters; ++ (BOOL) hasBinaryParameters:(NSDictionary*) parameters; ++ (NSMutableURLRequest*) prepareRequest:(UNIHTTPRequest*) request; ++ (UNIHTTPResponse*) getResponse:(NSURLResponse*) response data:(NSData*) data; +@end + +@implementation UNIHTTPClientHelper + ++ (BOOL) hasBinaryParameters:(NSDictionary*) parameters { + for(id key in parameters) { + id value = [parameters objectForKey:key]; + if ([value isKindOfClass:[NSURL class]]) { + return true; + } + } + return false; +} + ++ (NSString*) encodeURI:(NSString*)value { + NSString* result = (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes( + NULL, + (CFStringRef)value, + NULL, + (CFStringRef)@"!*'();:@&=+$,/?%#[]", + kCFStringEncodingUTF8)); + return result; +} + ++ (NSString*) dictionaryToQuerystring:(NSDictionary*) parameters { + NSString* result = @""; + + BOOL firstParameter = YES; + for(id key in parameters) { + id value = [parameters objectForKey:key]; + if (!([value isKindOfClass:[NSURL class]] || value == nil)) { // Don't encode files and null values + NSString* parameter = [NSString stringWithFormat:@"%@%@%@", [UNIHTTPClientHelper encodeURI:key], @"=", [UNIHTTPClientHelper encodeURI:value]]; + if (firstParameter) { + result = [NSString stringWithFormat:@"%@%@", result, parameter]; + } else { + result = [NSString stringWithFormat:@"%@&%@", result, parameter]; + } + firstParameter = NO; + } + } + + return result; +} + ++ (NSMutableURLRequest*) prepareRequest:(UNIHTTPRequest*) request { + UNIHTTPMethod httpMethod = [request httpMethod]; + NSMutableDictionary* headers = [[request headers] mutableCopy]; + + NSString* url = [request url]; + + if (httpMethod == GET) { + UNISimpleRequest* simpleRequest = (UNISimpleRequest*) request; + NSDictionary* parameters = [simpleRequest parameters]; + if ([parameters count] > 0) { + // Add additional parameters if any + NSMutableString* finalUrl = [[NSMutableString alloc] initWithString:url]; + if([url rangeOfString:@"?"].location == NSNotFound) { + [finalUrl appendString:@"?"]; + } else { + [finalUrl appendString:@"&"]; + } + + [finalUrl appendString:[self dictionaryToQuerystring:parameters]]; + url = [NSString stringWithString:finalUrl]; + } + } + + NSMutableURLRequest *requestObj = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:[UNIRest timeout]]; + NSMutableData* body = [[NSMutableData alloc] init]; + + if (httpMethod != GET) { + // Add body + UNIHTTPRequestWithBody* requestWithBody = (UNIHTTPRequestWithBody*) request; + + if ([requestWithBody body] == nil) { + // Has parameters + NSDictionary* parameters = [requestWithBody parameters]; + bool isBinary = [UNIHTTPClientHelper hasBinaryParameters:parameters]; + if (isBinary) { + + [headers setObject:[NSString stringWithFormat:@"multipart/form-data; boundary=%@", BOUNDARY] forKey:@"content-type"]; + + for(id key in parameters) { + id value = [parameters objectForKey:key]; + if ([value isKindOfClass:[NSURL class]] && value != nil) { // Don't encode files and null values + [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n", BOUNDARY] dataUsingEncoding:NSUTF8StringEncoding]]; + NSString* filename = [[value absoluteString] lastPathComponent]; + + NSData* data = [NSData dataWithContentsOfURL:value]; + + [body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"; filename=\"%@\"\r\n", key, filename] dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[[NSString stringWithFormat:@"Content-Length: %d\r\n\r\n", data.length] dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:data]; + } else { + [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n", BOUNDARY] dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"\r\n\r\n", key] dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[[NSString stringWithFormat:@"%@", value] dataUsingEncoding:NSUTF8StringEncoding]]; + } + } + + // Close + [body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n", BOUNDARY] dataUsingEncoding:NSUTF8StringEncoding]]; + } else { + NSString* querystring = [UNIHTTPClientHelper dictionaryToQuerystring:parameters]; + body = [NSMutableData dataWithData:[querystring dataUsingEncoding:NSUTF8StringEncoding]]; + + [headers setValue:@"application/x-www-form-urlencoded" forKey:@"content-type"]; + } + } else { + // Has a body + body = [NSMutableData dataWithData:[requestWithBody body]]; + } + + [requestObj setHTTPBody:body]; + } + + // Set method + switch ([request httpMethod]) { + case GET: + [requestObj setHTTPMethod:@"GET"]; + break; + case POST: + [requestObj setHTTPMethod:@"POST"]; + break; + case PUT: + [requestObj setHTTPMethod:@"PUT"]; + break; + case DELETE: + [requestObj setHTTPMethod:@"DELETE"]; + break; + case PATCH: + [requestObj setHTTPMethod:@"PATCH"]; + break; + } + + // Add headers + [headers setValue:@"unirest-objc/1.1" forKey:@"user-agent"]; + [headers setValue:@"gzip" forKey:@"accept-encoding"]; + + // Add cookies to the headers + [headers setValuesForKeysWithDictionary:[NSHTTPCookie requestHeaderFieldsWithCookies:[[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:[NSURL URLWithString:url]]]]; + + // Basic Auth + if ([request username] != nil || [request password] != nil) { + NSString* user = ([request username] == nil) ? @"" : [request username]; + NSString* pass = ([request password] == nil) ? @"" : [request password]; + NSString *credentials = [NSString stringWithFormat: @"%@:%@", user, pass]; + + NSString* header = [NSString stringWithFormat:@"Basic %@", [Base64 base64String:credentials]]; + [headers setValue:header forKey:@"authorization"]; + } + + // Default headers + NSMutableDictionary* defaultHeaders = [UNIRest defaultHeaders]; + for(NSString* key in defaultHeaders) { + NSString *value = [defaultHeaders objectForKey:key]; + [requestObj addValue:value forHTTPHeaderField:key]; + } + + for (NSString *key in headers) { + NSString *value = [headers objectForKey:key]; + [requestObj addValue:value forHTTPHeaderField:key]; + } + return requestObj; +} + ++(UNIHTTPResponse*) requestSync:(UNIHTTPRequest*) request error:(NSError**) error { + NSMutableURLRequest* requestObj = [self prepareRequest:request]; + + NSHTTPURLResponse * response = nil; + NSData * data = [NSURLConnection sendSynchronousRequest:requestObj returningResponse:&response error:error]; + return [self getResponse:response data:data]; +} + ++(UNIUrlConnection*) requestAsync:(UNIHTTPRequest*) request handler:(void (^)(UNIHTTPResponse*, NSError*))handler { + NSMutableURLRequest* requestObj = [self prepareRequest:request]; + NSOperationQueue *mainQueue = [[NSOperationQueue alloc] init]; + + UNIUrlConnection* connection = [UNIUrlConnection sendAsynchronousRequest:requestObj queue:mainQueue completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) { + + UNIHTTPResponse* res = [self getResponse:response data:data]; + handler(res, connectionError); + + }]; + + return connection; +} + ++ (UNIHTTPResponse*) getResponse:(NSURLResponse*) response data:(NSData*) data { + if (data == nil) { + return nil; + } + + NSHTTPURLResponse* httpResponse = (NSHTTPURLResponse*) response; + + UNIHTTPResponse* res = [[UNIHTTPResponse alloc] init]; + [res setCode:[httpResponse statusCode]]; + [res setHeaders:[httpResponse allHeaderFields]]; + [res setRawBody:data]; + + return res; +} + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/UNIHTTPRequest.h b/grocery-objc/Pods/Unirest/Unirest/UNIHTTPRequest.h new file mode 100644 index 0000000..3007742 --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/UNIHTTPRequest.h @@ -0,0 +1,66 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "HttpResponse/UNIHTTPStringResponse.h" +#import "HttpResponse/UNIHTTPBinaryResponse.h" +#import "HttpResponse/UNIHTTPJsonResponse.h" +#import "UNIUrlConnection.h" + +typedef NS_ENUM(NSInteger, UNIHTTPMethod) { + GET, + POST, + PUT, + DELETE, + PATCH +}; + +typedef void (^UNIHTTPStringResponseBlock)(UNIHTTPStringResponse* stringResponse, NSError* error); +typedef void (^UNIHTTPBinaryResponseBlock)(UNIHTTPBinaryResponse* binaryResponse, NSError* error); +typedef void (^UNIHTTPJsonResponseBlock)(UNIHTTPJsonResponse* jsonResponse, NSError* error); + +@interface UNIHTTPRequest : NSObject + +@property(readwrite, strong) NSDictionary* headers; +@property(readwrite, strong) NSString* url; +@property(readwrite, strong) NSError* error; +@property(readwrite, strong) NSString* username; +@property(readwrite, strong) NSString* password; +@property(readwrite) UNIHTTPMethod httpMethod; + +-(instancetype) initWithSimpleRequest:(UNIHTTPMethod) httpMethod url:(NSString*) url headers:(NSDictionary*) headers username:(NSString*) username password:(NSString*) password; + +-(UNIHTTPStringResponse*) asString; +-(UNIHTTPStringResponse*) asString:(NSError**) error; +-(UNIUrlConnection*) asStringAsync:(UNIHTTPStringResponseBlock) response; + +-(UNIHTTPBinaryResponse*) asBinary; +-(UNIHTTPBinaryResponse*) asBinary:(NSError**) error; +-(UNIUrlConnection*) asBinaryAsync:(UNIHTTPBinaryResponseBlock) response; + +-(UNIHTTPJsonResponse*) asJson; +-(UNIHTTPJsonResponse*) asJson:(NSError**) error; +-(UNIUrlConnection*) asJsonAsync:(UNIHTTPJsonResponseBlock) response; + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/UNIHTTPRequest.m b/grocery-objc/Pods/Unirest/Unirest/UNIHTTPRequest.m new file mode 100644 index 0000000..4938a02 --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/UNIHTTPRequest.m @@ -0,0 +1,110 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "UNIHTTPRequest.h" +#import "UNIHTTPClientHelper.h" + +@implementation UNIHTTPRequest + +-(instancetype) initWithSimpleRequest:(UNIHTTPMethod) httpMethod url:(NSString*) url headers:(NSDictionary*) headers username:(NSString*) username password:(NSString*) password { + self = [super init]; + if (self) { + [self setHttpMethod:httpMethod]; + [self setUrl:url]; + [self setUsername:username]; + [self setPassword:password]; + NSMutableDictionary* lowerCaseHeaders = [[NSMutableDictionary alloc] init]; + if (headers != nil) { + for(id key in headers) { + id value = [headers objectForKey:key]; + [lowerCaseHeaders setObject:value forKey:[key lowercaseString]]; + } + } + [self setHeaders:lowerCaseHeaders]; + } + return self; +} + +-(UNIHTTPStringResponse*) asString { + return [self asString:nil]; +} + +-(UNIHTTPStringResponse*) asString:(NSError**) error { + UNIHTTPResponse* response = [UNIHTTPClientHelper requestSync:self error:error]; + if (response == nil) return nil; + return [[UNIHTTPStringResponse alloc] initWithSimpleResponse:response]; +} + +-(UNIUrlConnection*) asStringAsync:(UNIHTTPStringResponseBlock) response { + return [UNIHTTPClientHelper requestAsync:self handler:^(UNIHTTPResponse * res, NSError * error) { + if (error != nil) { + response(nil, error); + } else { + response([[UNIHTTPStringResponse alloc] initWithSimpleResponse:res], error); + } + }]; +} + +-(UNIHTTPBinaryResponse*) asBinary { + return [self asBinary:nil]; +} + +-(UNIHTTPBinaryResponse*) asBinary:(NSError**) error { + UNIHTTPResponse* response = [UNIHTTPClientHelper requestSync:self error:error]; + if (response == nil) return nil; + return [[UNIHTTPBinaryResponse alloc] initWithSimpleResponse:response]; +} + +-(UNIUrlConnection*) asBinaryAsync:(UNIHTTPBinaryResponseBlock) response { + return [UNIHTTPClientHelper requestAsync:self handler:^(UNIHTTPResponse * res, NSError * error) { + if (error != nil) { + response(nil, error); + } else { + response([[UNIHTTPBinaryResponse alloc] initWithSimpleResponse:res], error); + } + }]; +} + +-(UNIHTTPJsonResponse*) asJson { + return [self asJson:nil]; +} + +-(UNIHTTPJsonResponse*) asJson:(NSError**) error { + UNIHTTPResponse* response = [UNIHTTPClientHelper requestSync:self error:error]; + if (response == nil) return nil; + return [[UNIHTTPJsonResponse alloc] initWithSimpleResponse:response]; +} + +-(UNIUrlConnection*) asJsonAsync:(UNIHTTPJsonResponseBlock) response { + return [UNIHTTPClientHelper requestAsync:self handler:^(UNIHTTPResponse * res, NSError * error) { + if (error != nil) { + response(nil, error); + } else { + response([[UNIHTTPJsonResponse alloc] initWithSimpleResponse:res], error); + } + }]; +} + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/UNIHTTPRequestWithBody.h b/grocery-objc/Pods/Unirest/Unirest/UNIHTTPRequestWithBody.h new file mode 100644 index 0000000..94979ac --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/UNIHTTPRequestWithBody.h @@ -0,0 +1,37 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "UNIHTTPRequest.h" + +@interface UNIHTTPRequestWithBody : UNIHTTPRequest + +@property(readwrite, strong) NSData* body; +@property(readwrite, strong) NSDictionary* parameters; + +-(instancetype) initWithMultipartRequest:(UNIHTTPMethod) httpMethod url:(NSString*) url headers:(NSDictionary*) headers parameters:(NSDictionary*) parameters username:(NSString*) username password:(NSString*) password; + +-(instancetype) initWithBodyRequest:(UNIHTTPMethod) httpMethod url:(NSString*) url headers:(NSDictionary*) headers body:(NSData*) body username:(NSString*) username password:(NSString*) password; + +@end \ No newline at end of file diff --git a/grocery-objc/Pods/Unirest/Unirest/UNIHTTPRequestWithBody.m b/grocery-objc/Pods/Unirest/Unirest/UNIHTTPRequestWithBody.m new file mode 100644 index 0000000..6b8beb2 --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/UNIHTTPRequestWithBody.m @@ -0,0 +1,45 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "UNIHTTPRequestWithBody.h" + +@implementation UNIHTTPRequestWithBody + +-(instancetype) initWithMultipartRequest:(UNIHTTPMethod) httpMethod url:(NSString*) url headers:(NSDictionary*) headers parameters:(NSDictionary*) parameters username:(NSString*) username password:(NSString*) password { + self = [super initWithSimpleRequest:httpMethod url:url headers:headers username:username password:password]; + if (parameters == nil) { + parameters = [[NSDictionary alloc] init]; + } + [self setParameters:[parameters mutableCopy]]; + return self; +} + +-(instancetype) initWithBodyRequest:(UNIHTTPMethod) httpMethod url:(NSString*) url headers:(NSDictionary*) headers body:(NSData*) body username:(NSString*) username password:(NSString*) password { + self = [super initWithSimpleRequest:httpMethod url:url headers:headers username:username password:password]; + [self setBody:body]; + return self; +} + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/UNIRest.h b/grocery-objc/Pods/Unirest/Unirest/UNIRest.h new file mode 100644 index 0000000..06780d2 --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/UNIRest.h @@ -0,0 +1,61 @@ +/* +The MIT License + +Copyright (c) 2013 Mashape (http://mashape.com) + +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. +*/ + +#import +#import "UNIHTTPRequest.h" +#import "UNIHTTPRequestWithBody.h" +#import "HttpRequest/UNISimpleRequest.h" +#import "HttpRequest/UNIBodyRequest.h" +#import "HttpResponse/UNIHTTPBinaryResponse.h" +#import "HttpResponse/UNIHTTPJsonResponse.h" +#import "HttpResponse/UNIHTTPStringResponse.h" + +typedef void (^UNISimpleRequestBlock)(UNISimpleRequest* simpleRequest); +typedef void (^UNIBodyRequestBlock)(UNIBodyRequest* unibodyRequest); + +@interface UNIRest : NSObject + ++(void) timeout:(int) seconds; ++(int) timeout; + ++(void) defaultHeader:(NSString*) name value:(NSString*) value; ++(void) clearDefaultHeaders; ++(NSMutableDictionary*) defaultHeaders; + ++(UNIHTTPRequest*) get:(UNISimpleRequestBlock) config; + ++(UNIHTTPRequestWithBody*) post:(UNISimpleRequestBlock) config; ++(UNIHTTPRequestWithBody*) postEntity:(UNIBodyRequestBlock) config; + ++(UNIHTTPRequestWithBody*) put:(UNISimpleRequestBlock) config; ++(UNIHTTPRequestWithBody*) putEntity:(UNIBodyRequestBlock) config; + ++(UNIHTTPRequestWithBody*) patch:(UNISimpleRequestBlock) config; ++(UNIHTTPRequestWithBody*) patchEntity:(UNIBodyRequestBlock) config; + ++(UNIHTTPRequestWithBody*) delete:(UNISimpleRequestBlock) config; ++(UNIHTTPRequestWithBody*) deleteEntity:(UNIBodyRequestBlock) config; + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/UNIRest.m b/grocery-objc/Pods/Unirest/Unirest/UNIRest.m new file mode 100644 index 0000000..cd094e5 --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/UNIRest.m @@ -0,0 +1,126 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "UNIRest.h" + +@interface UNIRest() ++ (id) getConfig:instance config:(void (^)(id)) config; +@end + +static NSMutableDictionary* defaultHeaders = nil; +static int UNIRestTimeout = 60; + +@implementation UNIRest + ++(void) timeout:(int) seconds { + UNIRestTimeout = seconds; +} + ++(int) timeout { + return UNIRestTimeout; +} + ++(void) defaultHeader:(NSString*) name value:(NSString*) value { + if (defaultHeaders == nil) { + defaultHeaders = [NSMutableDictionary dictionary]; + } + [defaultHeaders setObject:value forKey:name]; +} + ++(NSMutableDictionary*) defaultHeaders { + if (defaultHeaders == nil) { + defaultHeaders = [NSMutableDictionary dictionary]; + } + return defaultHeaders; +} + ++(void) clearDefaultHeaders { + if (defaultHeaders == nil) { + defaultHeaders = [NSMutableDictionary dictionary]; + } + [defaultHeaders removeAllObjects]; +} + ++ (id) getConfig:instance config:(void (^)(id)) config { + if (config) { + config(instance); + } + return instance; +} + ++(UNIHTTPRequest*) get:(UNISimpleRequestBlock) config { + UNISimpleRequest* _config = [self getConfig:[[UNISimpleRequest alloc] init] config:config]; + return [[UNIHTTPRequestWithBody alloc] initWithMultipartRequest:GET url:[_config url] headers:[_config headers] parameters:[_config parameters] username:[_config username] password:[_config password]]; +} + ++(UNIHTTPRequestWithBody*) post:(UNISimpleRequestBlock) config { + UNISimpleRequest* _config = [self getConfig:[[UNISimpleRequest alloc] init] config:config]; + + return [[UNIHTTPRequestWithBody alloc] initWithMultipartRequest:POST url:[_config url] headers:[_config headers] parameters:[_config parameters] username:[_config username] password:[_config password]]; +} + ++(UNIHTTPRequestWithBody*) postEntity:(UNIBodyRequestBlock) config { + UNIBodyRequest* _config = [self getConfig:[[UNIBodyRequest alloc] init] config:config]; + + return [[UNIHTTPRequestWithBody alloc] initWithBodyRequest:POST url:[_config url] headers:[_config headers] body:[_config body] username:[_config username] password:[_config password]]; +} + ++(UNIHTTPRequestWithBody*) put:(UNISimpleRequestBlock) config { + UNISimpleRequest* _config = [self getConfig:[[UNISimpleRequest alloc] init] config:config]; + + return [[UNIHTTPRequestWithBody alloc] initWithMultipartRequest:PUT url:[_config url] headers:[_config headers] parameters:[_config parameters] username:[_config username] password:[_config password]]; +} + ++(UNIHTTPRequestWithBody*) putEntity:(UNIBodyRequestBlock) config { + UNIBodyRequest* _config = [self getConfig:[[UNIBodyRequest alloc] init] config:config]; + + return [[UNIHTTPRequestWithBody alloc] initWithBodyRequest:PUT url:[_config url] headers:[_config headers] body:[_config body] username:[_config username] password:[_config password]]; +} + ++(UNIHTTPRequestWithBody*) patch:(UNISimpleRequestBlock) config { + UNISimpleRequest* _config = [self getConfig:[[UNISimpleRequest alloc] init] config:config]; + + return [[UNIHTTPRequestWithBody alloc] initWithMultipartRequest:PATCH url:[_config url] headers:[_config headers] parameters:[_config parameters] username:[_config username] password:[_config password]]; +} + ++(UNIHTTPRequestWithBody*) patchEntity:(UNIBodyRequestBlock) config { + UNIBodyRequest* _config = [self getConfig:[[UNIBodyRequest alloc] init] config:config]; + + return [[UNIHTTPRequestWithBody alloc] initWithBodyRequest:PATCH url:[_config url] headers:[_config headers] body:[_config body] username:[_config username] password:[_config password]]; +} + ++(UNIHTTPRequestWithBody*) delete:(UNISimpleRequestBlock) config { + UNISimpleRequest* _config = [self getConfig:[[UNISimpleRequest alloc] init] config:config]; + + return [[UNIHTTPRequestWithBody alloc] initWithMultipartRequest:DELETE url:[_config url] headers:[_config headers] parameters:[_config parameters] username:[_config username] password:[_config password]]; +} + ++(UNIHTTPRequestWithBody*) deleteEntity:(UNIBodyRequestBlock) config { + UNIBodyRequest* _config = [self getConfig:[[UNIBodyRequest alloc] init] config:config]; + + return [[UNIHTTPRequestWithBody alloc] initWithBodyRequest:DELETE url:[_config url] headers:[_config headers] body:[_config body] username:[_config username] password:[_config password]]; +} + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/UNIUrlConnection.h b/grocery-objc/Pods/Unirest/Unirest/UNIUrlConnection.h new file mode 100644 index 0000000..9541bbe --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/UNIUrlConnection.h @@ -0,0 +1,38 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import + +@interface UNIUrlConnection : NSObject + +@property (nonatomic, strong) NSURLRequest *request; +@property (nonatomic, strong) NSOperationQueue *queue; +@property (nonatomic, copy) void(^completionHandler)(NSURLResponse *response, NSData *data, NSError *error); + ++ (UNIUrlConnection *)sendAsynchronousRequest:(NSURLRequest *)request queue:(NSOperationQueue *)queue completionHandler:(void(^)(NSURLResponse *response, NSData *data, NSError *error))completionHandler; +- (void)start; +- (void)cancel; + +@end diff --git a/grocery-objc/Pods/Unirest/Unirest/UNIUrlConnection.m b/grocery-objc/Pods/Unirest/Unirest/UNIUrlConnection.m new file mode 100644 index 0000000..df4d393 --- /dev/null +++ b/grocery-objc/Pods/Unirest/Unirest/UNIUrlConnection.m @@ -0,0 +1,113 @@ +/* + The MIT License + + Copyright (c) 2013 Mashape (http://mashape.com) + + 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. + */ + +#import "UNIUrlConnection.h" + +@implementation UNIUrlConnection { + NSURLConnection *connection; + NSHTTPURLResponse *response; + NSMutableData *responseData; +} + +@synthesize request, queue, completionHandler; + ++ (UNIUrlConnection *)sendAsynchronousRequest:(NSURLRequest *)request queue:(NSOperationQueue *)queue completionHandler:(void(^)(NSURLResponse *response, NSData *data, NSError *error))completionHandler +{ + UNIUrlConnection *result = [[UNIUrlConnection alloc] init]; + result.request = request; + result.queue = queue; + result.completionHandler = completionHandler; + [result start]; + return result; +} + +- (void)dealloc +{ + [self cancel]; +} + +- (void)start +{ + connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:NO]; + [connection scheduleInRunLoop:NSRunLoop.mainRunLoop forMode:NSDefaultRunLoopMode]; + if (connection) { + [connection start]; + } else { + if (completionHandler) completionHandler(nil, nil, nil); completionHandler = nil; + } +} + +- (void)cancel +{ + [connection cancel]; connection = nil; + completionHandler = nil; +} + +- (void)connection:(NSURLConnection *)_connection didReceiveResponse:(NSHTTPURLResponse *)_response +{ + response = _response; +} + +- (void)connection:(NSURLConnection *)_connection didReceiveData:(NSData *)data +{ + if (!responseData) { + responseData = [NSMutableData dataWithData:data]; + } else { + [responseData appendData:data]; + } +} + +- (void)connectionDidFinishLoading:(NSURLConnection *)_connection +{ + connection = nil; + if (completionHandler) { + void(^b)(NSURLResponse *response, NSData *data, NSError *error) = completionHandler; + completionHandler = nil; + [queue addOperationWithBlock:^{b(self->response, self->responseData, nil);}]; + } +} + +- (void)connection:(NSURLConnection *)_connection didFailWithError:(NSError *)error +{ + connection = nil; + if (completionHandler) { + void(^b)(NSURLResponse *response, NSData *data, NSError *error) = completionHandler; + completionHandler = nil; + [queue addOperationWithBlock:^{b(self->response, self->responseData, error);}]; + } +} + +#if TARGET_IPHONE_SIMULATOR +- (BOOL)connection:(NSURLConnection *)_connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace +{ + return [protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]; +} +- (void)connection:(NSURLConnection *)_connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge +{ + [challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] forAuthenticationChallenge:challenge]; +} +#endif + +@end diff --git a/grocery-objc/grocery-objc.xcodeproj/project.pbxproj b/grocery-objc/grocery-objc.xcodeproj/project.pbxproj new file mode 100644 index 0000000..ede3a49 --- /dev/null +++ b/grocery-objc/grocery-objc.xcodeproj/project.pbxproj @@ -0,0 +1,444 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 4D73B3DF1C77CA1800B5D8AA /* RecipesTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D73B3DD1C77CA1800B5D8AA /* RecipesTableViewCell.m */; }; + 4D73B3E01C77CA1800B5D8AA /* RecipesTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4D73B3DE1C77CA1800B5D8AA /* RecipesTableViewCell.xib */; }; + 4D7C94741C765D21004152B4 /* InventoryTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D7C94721C765D21004152B4 /* InventoryTableViewCell.m */; }; + 4D7C94751C765D21004152B4 /* InventoryTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4D7C94731C765D21004152B4 /* InventoryTableViewCell.xib */; }; + 4D8664BA1C755113005BE801 /* FoodResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D8664B91C755113005BE801 /* FoodResult.m */; }; + 4D8664BD1C755D93005BE801 /* InventoryTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D8664BC1C755D93005BE801 /* InventoryTableViewController.m */; }; + 4DA094B31C73E79B002F2750 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DA094B21C73E79B002F2750 /* main.m */; }; + 4DA094B61C73E79B002F2750 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DA094B51C73E79B002F2750 /* AppDelegate.m */; }; + 4DA094B91C73E79B002F2750 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DA094B81C73E79B002F2750 /* ViewController.m */; }; + 4DA094BC1C73E79B002F2750 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4DA094BA1C73E79B002F2750 /* Main.storyboard */; }; + 4DA094BE1C73E79B002F2750 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4DA094BD1C73E79B002F2750 /* Assets.xcassets */; }; + 4DA094C11C73E79B002F2750 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4DA094BF1C73E79B002F2750 /* LaunchScreen.storyboard */; }; + 80F572206D454507BACF060C /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A2715DF183509F90B0EA2DF /* libPods.a */; }; + F0839B121C77972E0059E033 /* foodModel.m in Sources */ = {isa = PBXBuildFile; fileRef = F0839B111C77972E0059E033 /* foodModel.m */; }; + F0839B151C779A640059E033 /* RecipesTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F0839B141C779A640059E033 /* RecipesTableViewController.m */; }; + F0839B1E1C77B4400059E033 /* RecipeDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F0839B1D1C77B4400059E033 /* RecipeDetailViewController.m */; }; + F0DEB2481C764781004A2311 /* AddFoodViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F0DEB2471C764781004A2311 /* AddFoodViewController.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 03D5FD406498C36B9A12A0AA /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; + 3A2715DF183509F90B0EA2DF /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 4D73B3DC1C77CA1800B5D8AA /* RecipesTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecipesTableViewCell.h; sourceTree = ""; }; + 4D73B3DD1C77CA1800B5D8AA /* RecipesTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RecipesTableViewCell.m; sourceTree = ""; }; + 4D73B3DE1C77CA1800B5D8AA /* RecipesTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RecipesTableViewCell.xib; sourceTree = ""; }; + 4D7C94711C765D21004152B4 /* InventoryTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InventoryTableViewCell.h; sourceTree = ""; }; + 4D7C94721C765D21004152B4 /* InventoryTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InventoryTableViewCell.m; sourceTree = ""; }; + 4D7C94731C765D21004152B4 /* InventoryTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = InventoryTableViewCell.xib; sourceTree = ""; }; + 4D8664B81C755113005BE801 /* FoodResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FoodResult.h; sourceTree = ""; }; + 4D8664B91C755113005BE801 /* FoodResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FoodResult.m; sourceTree = ""; }; + 4D8664BB1C755D93005BE801 /* InventoryTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InventoryTableViewController.h; sourceTree = ""; }; + 4D8664BC1C755D93005BE801 /* InventoryTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InventoryTableViewController.m; sourceTree = ""; }; + 4DA094AE1C73E79B002F2750 /* grocery-objc.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "grocery-objc.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 4DA094B21C73E79B002F2750 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 4DA094B41C73E79B002F2750 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 4DA094B51C73E79B002F2750 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 4DA094B71C73E79B002F2750 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 4DA094B81C73E79B002F2750 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 4DA094BB1C73E79B002F2750 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 4DA094BD1C73E79B002F2750 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 4DA094C01C73E79B002F2750 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 4DA094C21C73E79B002F2750 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C147D13EDC2589C0A8C553D8 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + F0839B101C77972E0059E033 /* foodModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = foodModel.h; sourceTree = ""; }; + F0839B111C77972E0059E033 /* foodModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = foodModel.m; sourceTree = ""; }; + F0839B131C779A640059E033 /* RecipesTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecipesTableViewController.h; sourceTree = ""; }; + F0839B141C779A640059E033 /* RecipesTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RecipesTableViewController.m; sourceTree = ""; }; + F0839B1C1C77B4400059E033 /* RecipeDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecipeDetailViewController.h; sourceTree = ""; }; + F0839B1D1C77B4400059E033 /* RecipeDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RecipeDetailViewController.m; sourceTree = ""; }; + F0DEB2461C764781004A2311 /* AddFoodViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddFoodViewController.h; sourceTree = ""; }; + F0DEB2471C764781004A2311 /* AddFoodViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddFoodViewController.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 4DA094AB1C73E79B002F2750 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 80F572206D454507BACF060C /* libPods.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 26AFB5B02C05E797ECFCF222 /* Pods */ = { + isa = PBXGroup; + children = ( + C147D13EDC2589C0A8C553D8 /* Pods.debug.xcconfig */, + 03D5FD406498C36B9A12A0AA /* Pods.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + 4DA094A51C73E79B002F2750 = { + isa = PBXGroup; + children = ( + 4DA094B01C73E79B002F2750 /* grocery-objc */, + 4DA094AF1C73E79B002F2750 /* Products */, + 26AFB5B02C05E797ECFCF222 /* Pods */, + 7A76E194A2A74AE32CD249E9 /* Frameworks */, + ); + sourceTree = ""; + }; + 4DA094AF1C73E79B002F2750 /* Products */ = { + isa = PBXGroup; + children = ( + 4DA094AE1C73E79B002F2750 /* grocery-objc.app */, + ); + name = Products; + sourceTree = ""; + }; + 4DA094B01C73E79B002F2750 /* grocery-objc */ = { + isa = PBXGroup; + children = ( + 4DA094B41C73E79B002F2750 /* AppDelegate.h */, + 4DA094B51C73E79B002F2750 /* AppDelegate.m */, + 4DA094B71C73E79B002F2750 /* ViewController.h */, + 4DA094B81C73E79B002F2750 /* ViewController.m */, + 4D8664BB1C755D93005BE801 /* InventoryTableViewController.h */, + 4D8664BC1C755D93005BE801 /* InventoryTableViewController.m */, + F0839B101C77972E0059E033 /* foodModel.h */, + F0839B111C77972E0059E033 /* foodModel.m */, + 4D8664B81C755113005BE801 /* FoodResult.h */, + 4D8664B91C755113005BE801 /* FoodResult.m */, + 4D7C94711C765D21004152B4 /* InventoryTableViewCell.h */, + 4D7C94721C765D21004152B4 /* InventoryTableViewCell.m */, + 4D7C94731C765D21004152B4 /* InventoryTableViewCell.xib */, + 4DA094BA1C73E79B002F2750 /* Main.storyboard */, + F0839B1C1C77B4400059E033 /* RecipeDetailViewController.h */, + F0839B1D1C77B4400059E033 /* RecipeDetailViewController.m */, + F0839B131C779A640059E033 /* RecipesTableViewController.h */, + F0839B141C779A640059E033 /* RecipesTableViewController.m */, + F0DEB2461C764781004A2311 /* AddFoodViewController.h */, + F0DEB2471C764781004A2311 /* AddFoodViewController.m */, + 4D73B3DC1C77CA1800B5D8AA /* RecipesTableViewCell.h */, + 4D73B3DD1C77CA1800B5D8AA /* RecipesTableViewCell.m */, + 4D73B3DE1C77CA1800B5D8AA /* RecipesTableViewCell.xib */, + 4DA094BD1C73E79B002F2750 /* Assets.xcassets */, + 4DA094BF1C73E79B002F2750 /* LaunchScreen.storyboard */, + 4DA094C21C73E79B002F2750 /* Info.plist */, + 4DA094B11C73E79B002F2750 /* Supporting Files */, + ); + path = "grocery-objc"; + sourceTree = ""; + }; + 4DA094B11C73E79B002F2750 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 4DA094B21C73E79B002F2750 /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 7A76E194A2A74AE32CD249E9 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 3A2715DF183509F90B0EA2DF /* libPods.a */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 4DA094AD1C73E79B002F2750 /* grocery-objc */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4DA094C51C73E79B002F2750 /* Build configuration list for PBXNativeTarget "grocery-objc" */; + buildPhases = ( + D0830D54BAAC6A1CCAD3C46A /* Check Pods Manifest.lock */, + 4DA094AA1C73E79B002F2750 /* Sources */, + 4DA094AB1C73E79B002F2750 /* Frameworks */, + 4DA094AC1C73E79B002F2750 /* Resources */, + 6DB5D265B2C0EB96E5164906 /* Embed Pods Frameworks */, + 49ECD687E86554E5863509E1 /* Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "grocery-objc"; + productName = "grocery-objc"; + productReference = 4DA094AE1C73E79B002F2750 /* grocery-objc.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 4DA094A61C73E79B002F2750 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0720; + ORGANIZATIONNAME = "Shena Yoshida"; + TargetAttributes = { + 4DA094AD1C73E79B002F2750 = { + CreatedOnToolsVersion = 7.2; + DevelopmentTeam = 788Q6NYZ88; + }; + }; + }; + buildConfigurationList = 4DA094A91C73E79B002F2750 /* Build configuration list for PBXProject "grocery-objc" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 4DA094A51C73E79B002F2750; + productRefGroup = 4DA094AF1C73E79B002F2750 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 4DA094AD1C73E79B002F2750 /* grocery-objc */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 4DA094AC1C73E79B002F2750 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4D7C94751C765D21004152B4 /* InventoryTableViewCell.xib in Resources */, + 4D73B3E01C77CA1800B5D8AA /* RecipesTableViewCell.xib in Resources */, + 4DA094C11C73E79B002F2750 /* LaunchScreen.storyboard in Resources */, + 4DA094BE1C73E79B002F2750 /* Assets.xcassets in Resources */, + 4DA094BC1C73E79B002F2750 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 49ECD687E86554E5863509E1 /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 6DB5D265B2C0EB96E5164906 /* Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + D0830D54BAAC6A1CCAD3C46A /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 4DA094AA1C73E79B002F2750 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4DA094B91C73E79B002F2750 /* ViewController.m in Sources */, + 4DA094B61C73E79B002F2750 /* AppDelegate.m in Sources */, + F0DEB2481C764781004A2311 /* AddFoodViewController.m in Sources */, + F0839B151C779A640059E033 /* RecipesTableViewController.m in Sources */, + 4D73B3DF1C77CA1800B5D8AA /* RecipesTableViewCell.m in Sources */, + 4D7C94741C765D21004152B4 /* InventoryTableViewCell.m in Sources */, + 4D8664BA1C755113005BE801 /* FoodResult.m in Sources */, + 4D8664BD1C755D93005BE801 /* InventoryTableViewController.m in Sources */, + 4DA094B31C73E79B002F2750 /* main.m in Sources */, + F0839B121C77972E0059E033 /* foodModel.m in Sources */, + F0839B1E1C77B4400059E033 /* RecipeDetailViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 4DA094BA1C73E79B002F2750 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 4DA094BB1C73E79B002F2750 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 4DA094BF1C73E79B002F2750 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 4DA094C01C73E79B002F2750 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 4DA094C31C73E79B002F2750 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 4DA094C41C73E79B002F2750 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 4DA094C61C73E79B002F2750 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C147D13EDC2589C0A8C553D8 /* Pods.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + INFOPLIST_FILE = "grocery-objc/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "shenayoshida.grocery-objc"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 4DA094C71C73E79B002F2750 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 03D5FD406498C36B9A12A0AA /* Pods.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + INFOPLIST_FILE = "grocery-objc/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "shenayoshida.grocery-objc"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 4DA094A91C73E79B002F2750 /* Build configuration list for PBXProject "grocery-objc" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4DA094C31C73E79B002F2750 /* Debug */, + 4DA094C41C73E79B002F2750 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4DA094C51C73E79B002F2750 /* Build configuration list for PBXNativeTarget "grocery-objc" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4DA094C61C73E79B002F2750 /* Debug */, + 4DA094C71C73E79B002F2750 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 4DA094A61C73E79B002F2750 /* Project object */; +} diff --git a/grocery-objc/grocery-objc.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/grocery-objc/grocery-objc.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..4716365 --- /dev/null +++ b/grocery-objc/grocery-objc.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/grocery-objc/grocery-objc.xcodeproj/project.xcworkspace/xcuserdata/shenayoshida.xcuserdatad/UserInterfaceState.xcuserstate b/grocery-objc/grocery-objc.xcodeproj/project.xcworkspace/xcuserdata/shenayoshida.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..06a4b73 Binary files /dev/null and b/grocery-objc/grocery-objc.xcodeproj/project.xcworkspace/xcuserdata/shenayoshida.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/grocery-objc/grocery-objc.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/grocery-objc.xcscheme b/grocery-objc/grocery-objc.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/grocery-objc.xcscheme new file mode 100644 index 0000000..c6b749c --- /dev/null +++ b/grocery-objc/grocery-objc.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/grocery-objc.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/grocery-objc.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/xcschememanagement.plist b/grocery-objc/grocery-objc.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..4876486 --- /dev/null +++ b/grocery-objc/grocery-objc.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + grocery-objc.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 4DA094AD1C73E79B002F2750 + + primary + + + + + diff --git a/grocery-objc/grocery-objc.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/grocery-objc.xcscheme b/grocery-objc/grocery-objc.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/grocery-objc.xcscheme new file mode 100644 index 0000000..7a9bc83 --- /dev/null +++ b/grocery-objc/grocery-objc.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/grocery-objc.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/grocery-objc.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/xcschememanagement.plist b/grocery-objc/grocery-objc.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..4876486 --- /dev/null +++ b/grocery-objc/grocery-objc.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + grocery-objc.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 4DA094AD1C73E79B002F2750 + + primary + + + + + diff --git a/grocery-objc/grocery-objc.xcworkspace/contents.xcworkspacedata b/grocery-objc/grocery-objc.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..3273664 --- /dev/null +++ b/grocery-objc/grocery-objc.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/grocery-objc/grocery-objc.xcworkspace/xcuserdata/hennaahmed.xcuserdatad/UserInterfaceState.xcuserstate b/grocery-objc/grocery-objc.xcworkspace/xcuserdata/hennaahmed.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..1fc5430 Binary files /dev/null and b/grocery-objc/grocery-objc.xcworkspace/xcuserdata/hennaahmed.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/grocery-objc/grocery-objc.xcworkspace/xcuserdata/hennaahmed.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/grocery-objc/grocery-objc.xcworkspace/xcuserdata/hennaahmed.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..ed9a9b4 --- /dev/null +++ b/grocery-objc/grocery-objc.xcworkspace/xcuserdata/hennaahmed.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/grocery-objc/grocery-objc.xcworkspace/xcuserdata/shenayoshida.xcuserdatad/UserInterfaceState.xcuserstate b/grocery-objc/grocery-objc.xcworkspace/xcuserdata/shenayoshida.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..125e3f5 Binary files /dev/null and b/grocery-objc/grocery-objc.xcworkspace/xcuserdata/shenayoshida.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/grocery-objc/grocery-objc.xcworkspace/xcuserdata/shenayoshida.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/grocery-objc/grocery-objc.xcworkspace/xcuserdata/shenayoshida.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..ed9a9b4 --- /dev/null +++ b/grocery-objc/grocery-objc.xcworkspace/xcuserdata/shenayoshida.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/grocery-objc/grocery-objc/AddFoodViewController.h b/grocery-objc/grocery-objc/AddFoodViewController.h new file mode 100644 index 0000000..8d8dddd --- /dev/null +++ b/grocery-objc/grocery-objc/AddFoodViewController.h @@ -0,0 +1,13 @@ +// +// AddFoodViewController.h +// grocery-objc +// +// Created by Henna Ahmed on 2/18/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import + +@interface AddFoodViewController : UIViewController + +@end diff --git a/grocery-objc/grocery-objc/AddFoodViewController.m b/grocery-objc/grocery-objc/AddFoodViewController.m new file mode 100644 index 0000000..4b5e903 --- /dev/null +++ b/grocery-objc/grocery-objc/AddFoodViewController.m @@ -0,0 +1,282 @@ +// +// AddFoodViewController.m +// grocery-objc +// +// Created by Henna Ahmed on 2/18/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import "AddFoodViewController.h" +#import +#import +#import "HSDatePickerViewController.h" +#import +#import + +@interface AddFoodViewController () < +HSDatePickerViewControllerDelegate, +UITableViewDelegate, +UITableViewDataSource, +UISearchBarDelegate, +UISearchBarDelegate +> + +@property (nonatomic) NSMutableArray *autoCompleteSearchResults; +@property (weak, nonatomic) IBOutlet UISearchBar *searchBar; +@property (nonatomic) AFHTTPSessionManager *manager; +@property (weak, nonatomic) IBOutlet UITableView *tableView; +@property (nonatomic, strong) NSDate * expirationDate; +@property (weak, nonatomic) IBOutlet UIButton *addDateButton; +@property (strong, nonatomic) IBOutlet UILabel *foodLabel; +@property (strong, nonatomic) IBOutlet UILabel *messageLabel; +@property (strong, nonatomic) IBOutlet UILabel *expirationMessageLabel; +@property (nonatomic) BOOL foodSet; +@property (nonatomic) BOOL dateSet; + + +@end + +@implementation AddFoodViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + self.autoCompleteSearchResults = [[NSMutableArray alloc] init]; + self.manager = [[AFHTTPSessionManager alloc] init]; + self.searchBar.delegate = self; + self.searchBar.searchBarStyle = UISearchBarStyleMinimal; // remove border from search bar + self.tableView.delegate = self; + self.tableView.dataSource = self; + self.tableView.hidden = YES; + self.expirationMessageLabel.hidden = YES; + self.foodSet = NO; + self.dateSet = NO; + + [self.searchBar setShowsBookmarkButton:YES]; + + + [self.searchBar setImage:[UIImage imageNamed:@"barcode"] forSearchBarIcon:UISearchBarIconBookmark state:UIControlStateNormal]; + [self.searchBar setImage:[UIImage imageNamed:@"barcode"] forSearchBarIcon:UISearchBarIconBookmark state:UIControlStateSelected]; + + UISwipeGestureRecognizer *downSwipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipe:)]; + downSwipe.direction = UISwipeGestureRecognizerDirectionDown; + [self.view addGestureRecognizer:downSwipe]; + + + // Do any additional setup after loading the view. + +} + + +- (void) handleSwipe: (UISwipeGestureRecognizer *) gesture { + switch (gesture.direction) { + case UISwipeGestureRecognizerDirectionDown: + [self dismissViewControllerAnimated:YES completion:nil]; + break; + default: + break; + } +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - SearchBar delegate methods + +-(void)searchBarBookmarkButtonClicked:(UISearchBar *)searchBar{ + + RSScannerViewController *scanner = [[RSScannerViewController alloc] initWithCornerView:YES + controlView:YES + barcodesHandler:^(NSArray *barcodeObjects) { + AVMetadataMachineReadableCodeObject *something = [barcodeObjects firstObject]; + [self.presentingViewController.presentedViewController dismissViewControllerAnimated:YES completion:nil]; + + [self findProductWithBarcode:something.stringValue]; + + } + preferredCameraPosition:AVCaptureDevicePositionBack]; + [scanner setStopOnFirst:YES]; + [self presentViewController:scanner animated:YES completion:nil]; + + +} + +- (void) findProductWithBarcode: (NSString *) barcode{ + NSString *url = [NSString stringWithFormat:@"https://api.nutritionix.com/v1_1/item?upc=%@&appId=ebecb9f6&appKey=8779a49b103c3b99986cd0e27c37d6b9", barcode]; + + [self.manager GET:url parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { + self.foodLabel.text = [responseObject objectForKey:@"item_name"]; + self.foodSet = YES; + + } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { + NSLog(@"%@", error); + }]; + +} + +- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar{ + [searchBar setShowsCancelButton:YES animated:YES]; + [self searchBar:searchBar textDidChange:searchBar.text]; + + return YES; +} + +- (BOOL)searchBarShouldEndEditing:(UISearchBar *)searchBar{ + self.tableView.hidden = YES; + return YES; +} + + +-(void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{ + if (searchBar.text.length > 0) { + self.tableView.hidden = NO; + + //API Call + + NSString *url = [NSString stringWithFormat:@"https://apibeta.nutritionix.com/v2/autocomplete?appId=ebecb9f6&appKey=8779a49b103c3b99986cd0e27c37d6b9&q=%@", searchText]; + NSString *encodedString = [url stringByAddingPercentEncodingWithAllowedCharacters: [NSCharacterSet URLQueryAllowedCharacterSet]]; + [self.manager GET:encodedString parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { + self.autoCompleteSearchResults = responseObject; + dispatch_async(dispatch_get_main_queue(), ^{ + [self.tableView reloadData]; + }); + } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { + NSLog(@"%@", error); + }]; + + + + } +} + +- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar{ + searchBar.text = @""; + [searchBar setShowsCancelButton:NO animated:YES]; + [searchBar resignFirstResponder]; + [self.tableView setHidden:YES]; +} + + +#pragma mark - TableView delegate methods + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.autoCompleteSearchResults.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AutocompleteIdentifier" forIndexPath:indexPath]; + cell.textLabel.text = [self.autoCompleteSearchResults[indexPath.row] objectForKey:@"text"]; + + return cell; +} + + +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ + [self.searchBar setShowsCancelButton:NO animated:YES]; + [self.searchBar resignFirstResponder]; + + self.foodLabel.text = [self.autoCompleteSearchResults[indexPath.row]objectForKey:@"text"]; + self.foodSet = YES; +} + + + + +- (IBAction)addButtonTapped:(UIButton *)sender { + + if (self.foodSet && self.dateSet) { + NSString *foodName = [self.foodLabel.text lowercaseString]; + + NSString *emojiURL = [NSString stringWithFormat:@"https://www.emojidex.com/api/v1/search/emoji/?code_sw=%@", foodName]; + NSString *encodedString = [emojiURL stringByAddingPercentEncodingWithAllowedCharacters: [NSCharacterSet URLQueryAllowedCharacterSet]]; + + AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc] init]; + + [manager GET:encodedString parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { + NSArray * emojiData = [responseObject objectForKey:@"emoji"]; + NSString *moji = @""; + for (NSDictionary* emoji in emojiData) { + + NSString *temp = [emoji objectForKey:@"moji"]; + + if ( [temp isEqualToString:@""]) { + + } + else{ + moji = temp; + break; + } + } + + NSNumber *expires = [NSNumber numberWithDouble:[self.expirationDate timeIntervalSince1970]]; + Firebase *myRootRef = [[Firebase alloc] initWithUrl:@"https://scorching-heat-3082.firebaseio.com/Grocery-List"]; + [[myRootRef childByAppendingPath:foodName] setValue:@{ @"Expiration Date": expires, @"emoji":moji }]; + + [self dismissViewControllerAnimated:YES completion:nil]; + + } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { + NSLog(@"%@", error); + }]; + } + else{ + SIAlertView *alertView = [[SIAlertView alloc] initWithTitle:@"Oops" andMessage:@"Please make sure you have a date and name for your food."]; + + [alertView addButtonWithTitle:@"Ok" + type:SIAlertViewButtonTypeDefault + handler:^(SIAlertView *alert) { + + }]; + + + alertView.transitionStyle = SIAlertViewTransitionStyleBounce; + + [alertView show]; + } + + +} + +- (IBAction)pickDateTapped:(UIButton *)sender { + self.messageLabel.hidden = YES; + + HSDatePickerViewController *hsdpvc = [[HSDatePickerViewController alloc] init]; + hsdpvc.delegate = self; + + [self presentViewController:hsdpvc animated:YES completion:nil]; + +} +- (void)hsDatePickerPickedDate:(NSDate *)date { + + NSString *bestBeforeMessage = @"best before:"; + NSString *dateString = [NSDateFormatter localizedStringFromDate:date + dateStyle:NSDateFormatterShortStyle + timeStyle:NSDateFormatterNoStyle]; + NSString *message = [NSString stringWithFormat:@"%@\n%@", bestBeforeMessage, dateString]; + + self.expirationMessageLabel.text = message; + self.expirationMessageLabel.hidden = NO; + self.expirationDate = date; + [self.addDateButton setImage:nil forState:UIControlStateNormal]; + self.dateSet = YES; + // [self.addDateButton setTitle:message forState:UIControlStateNormal]; +} + + +/* + #pragma mark - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. + } + */ + +@end diff --git a/grocery-objc/grocery-objc/AppDelegate.h b/grocery-objc/grocery-objc/AppDelegate.h new file mode 100644 index 0000000..3ab6186 --- /dev/null +++ b/grocery-objc/grocery-objc/AppDelegate.h @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// grocery-objc +// +// Created by Shena Yoshida on 2/16/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/grocery-objc/grocery-objc/AppDelegate.m b/grocery-objc/grocery-objc/AppDelegate.m new file mode 100644 index 0000000..9cebf2d --- /dev/null +++ b/grocery-objc/grocery-objc/AppDelegate.m @@ -0,0 +1,96 @@ +// +// AppDelegate.m +// grocery-objc +// +// Created by Shena Yoshida on 2/16/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import "AppDelegate.h" +//model +#import "YALTabBarItem.h" + +//controller +#import "YALFoldingTabBarController.h" + +//helpers +#import "YALAnimatingTabBarConstants.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +/* +COLOR KEY: + +white color: [UIColor colorWithRed:239.0/255.0 green:239.0/255.0 blue:239.0/255.0 alpha:1] +peach color: [UIColor colorWithRed:248.0/255.0 green:213.0/255.0 blue:199.0/255.0 alpha:1] + +*/ + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + + UINavigationBar.appearance.barTintColor = [UIColor blackColor]; + + + YALFoldingTabBarController *tabBarController = (YALFoldingTabBarController *) self.window.rootViewController; + + //prepare leftBarItems + YALTabBarItem *item1 = [[YALTabBarItem alloc] initWithItemImage:[UIImage imageNamed:@"kitchen"] + leftItemImage:nil + rightItemImage:nil]; + + tabBarController.leftBarItems = @[item1]; + + //prepare rightBarItems + + + YALTabBarItem *item3 = [[YALTabBarItem alloc] initWithItemImage:[UIImage imageNamed:@"cooking-4"] + leftItemImage:nil + rightItemImage:nil]; + + tabBarController.rightBarItems = @[item3]; + + tabBarController.centerButtonImage = [UIImage imageNamed:@"sign"]; + + tabBarController.selectedIndex = 0; + + //customize tabBarView + tabBarController.tabBarView.extraTabBarItemHeight = YALExtraTabBarItemsDefaultHeight; + tabBarController.tabBarView.offsetForExtraTabBarItems = YALForExtraTabBarItemsDefaultOffset; + tabBarController.tabBarView.backgroundColor = [UIColor blackColor]; + tabBarController.tabBarView.tabBarColor = [UIColor colorWithRed:239.0/255.0 green:239.0/255.0 blue:239.0/255.0 alpha:1]; +// tabBarController.tabBarView.dotColor = [UIColor colorWithRed:94.0/255.0 green:91.0/255.0 blue:149.0/255.0 alpha:1]; + tabBarController.tabBarViewHeight = YALTabBarViewDefaultHeight; + tabBarController.tabBarView.tabBarViewEdgeInsets = YALTabBarViewHDefaultEdgeInsets; + tabBarController.tabBarView.tabBarItemsEdgeInsets = YALTabBarViewItemsDefaultEdgeInsets; + + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. +} + +- (void)applicationDidEnterBackground:(UIApplication *)application { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + +- (void)applicationWillEnterForeground:(UIApplication *)application { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. +} + +- (void)applicationDidBecomeActive:(UIApplication *)application { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + +- (void)applicationWillTerminate:(UIApplication *)application { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + +@end diff --git a/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Contents.json b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..ed523b5 --- /dev/null +++ b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,62 @@ +{ + "images" : [ + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "iTunesArtwork.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "iTunesArtwork@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "iTunesArtwork@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-Small-40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-40@3x copy.png", + "scale" : "3x" + }, + { + "size" : "57x57", + "idiom" : "iphone", + "filename" : "Icon-Small-60.png", + "scale" : "1x" + }, + { + "size" : "57x57", + "idiom" : "iphone", + "filename" : "Icon-Small-60@2x-1.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-Small-60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-Small-60@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Icon-40@3x copy.png b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Icon-40@3x copy.png new file mode 100644 index 0000000..fd05f50 Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Icon-40@3x copy.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png new file mode 100644 index 0000000..dc92454 Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Icon-Small-60.png b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Icon-Small-60.png new file mode 100644 index 0000000..7494f3d Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Icon-Small-60.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Icon-Small-60@2x-1.png b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Icon-Small-60@2x-1.png new file mode 100644 index 0000000..81b25ad Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Icon-Small-60@2x-1.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Icon-Small-60@2x.png b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Icon-Small-60@2x.png new file mode 100644 index 0000000..543be37 Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Icon-Small-60@2x.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Icon-Small-60@3x.png b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Icon-Small-60@3x.png new file mode 100644 index 0000000..dcf8fd7 Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/Icon-Small-60@3x.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/iTunesArtwork.png b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/iTunesArtwork.png new file mode 100644 index 0000000..b1a4b7a Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/iTunesArtwork.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/iTunesArtwork@2x.png b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/iTunesArtwork@2x.png new file mode 100644 index 0000000..8e7e0b6 Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/iTunesArtwork@2x.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/iTunesArtwork@3x.png b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/iTunesArtwork@3x.png new file mode 100644 index 0000000..28432d7 Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/AppIcon.appiconset/iTunesArtwork@3x.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/Contents.json b/grocery-objc/grocery-objc/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/grocery-objc/grocery-objc/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/grocery-objc/grocery-objc/Assets.xcassets/barcode.imageset/Contents.json b/grocery-objc/grocery-objc/Assets.xcassets/barcode.imageset/Contents.json new file mode 100644 index 0000000..0ff20fe --- /dev/null +++ b/grocery-objc/grocery-objc/Assets.xcassets/barcode.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "barcode.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "barcode-1.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/grocery-objc/grocery-objc/Assets.xcassets/barcode.imageset/barcode-1.png b/grocery-objc/grocery-objc/Assets.xcassets/barcode.imageset/barcode-1.png new file mode 100644 index 0000000..5476885 Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/barcode.imageset/barcode-1.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/barcode.imageset/barcode.png b/grocery-objc/grocery-objc/Assets.xcassets/barcode.imageset/barcode.png new file mode 100644 index 0000000..621d036 Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/barcode.imageset/barcode.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/cooking-4.imageset/Contents.json b/grocery-objc/grocery-objc/Assets.xcassets/cooking-4.imageset/Contents.json new file mode 100644 index 0000000..01ec060 --- /dev/null +++ b/grocery-objc/grocery-objc/Assets.xcassets/cooking-4.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "cooking-4.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "cooking-5.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/grocery-objc/grocery-objc/Assets.xcassets/cooking-4.imageset/cooking-4.png b/grocery-objc/grocery-objc/Assets.xcassets/cooking-4.imageset/cooking-4.png new file mode 100644 index 0000000..93a3bcf Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/cooking-4.imageset/cooking-4.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/cooking-4.imageset/cooking-5.png b/grocery-objc/grocery-objc/Assets.xcassets/cooking-4.imageset/cooking-5.png new file mode 100644 index 0000000..b09d085 Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/cooking-4.imageset/cooking-5.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/kitchen.imageset/Contents.json b/grocery-objc/grocery-objc/Assets.xcassets/kitchen.imageset/Contents.json new file mode 100644 index 0000000..875ccac --- /dev/null +++ b/grocery-objc/grocery-objc/Assets.xcassets/kitchen.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "kitchen-1.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "kitchen.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/grocery-objc/grocery-objc/Assets.xcassets/kitchen.imageset/kitchen-1.png b/grocery-objc/grocery-objc/Assets.xcassets/kitchen.imageset/kitchen-1.png new file mode 100644 index 0000000..76d48bc Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/kitchen.imageset/kitchen-1.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/kitchen.imageset/kitchen.png b/grocery-objc/grocery-objc/Assets.xcassets/kitchen.imageset/kitchen.png new file mode 100644 index 0000000..b0ca802 Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/kitchen.imageset/kitchen.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/shopping.imageset/Contents.json b/grocery-objc/grocery-objc/Assets.xcassets/shopping.imageset/Contents.json new file mode 100644 index 0000000..9a0f673 --- /dev/null +++ b/grocery-objc/grocery-objc/Assets.xcassets/shopping.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "shopping.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "shopping-1.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/grocery-objc/grocery-objc/Assets.xcassets/shopping.imageset/shopping-1.png b/grocery-objc/grocery-objc/Assets.xcassets/shopping.imageset/shopping-1.png new file mode 100644 index 0000000..a1652ca Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/shopping.imageset/shopping-1.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/shopping.imageset/shopping.png b/grocery-objc/grocery-objc/Assets.xcassets/shopping.imageset/shopping.png new file mode 100644 index 0000000..366c7f5 Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/shopping.imageset/shopping.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/sign.imageset/Contents.json b/grocery-objc/grocery-objc/Assets.xcassets/sign.imageset/Contents.json new file mode 100644 index 0000000..b18cd57 --- /dev/null +++ b/grocery-objc/grocery-objc/Assets.xcassets/sign.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "sign.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "sign-1.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/grocery-objc/grocery-objc/Assets.xcassets/sign.imageset/sign-1.png b/grocery-objc/grocery-objc/Assets.xcassets/sign.imageset/sign-1.png new file mode 100644 index 0000000..89481cc Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/sign.imageset/sign-1.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/sign.imageset/sign.png b/grocery-objc/grocery-objc/Assets.xcassets/sign.imageset/sign.png new file mode 100644 index 0000000..6572c79 Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/sign.imageset/sign.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/time.imageset/Contents.json b/grocery-objc/grocery-objc/Assets.xcassets/time.imageset/Contents.json new file mode 100644 index 0000000..49eecb4 --- /dev/null +++ b/grocery-objc/grocery-objc/Assets.xcassets/time.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "time.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "time-1.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/grocery-objc/grocery-objc/Assets.xcassets/time.imageset/time-1.png b/grocery-objc/grocery-objc/Assets.xcassets/time.imageset/time-1.png new file mode 100644 index 0000000..2526265 Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/time.imageset/time-1.png differ diff --git a/grocery-objc/grocery-objc/Assets.xcassets/time.imageset/time.png b/grocery-objc/grocery-objc/Assets.xcassets/time.imageset/time.png new file mode 100644 index 0000000..5d04d76 Binary files /dev/null and b/grocery-objc/grocery-objc/Assets.xcassets/time.imageset/time.png differ diff --git a/grocery-objc/grocery-objc/Base.lproj/LaunchScreen.storyboard b/grocery-objc/grocery-objc/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..8326657 --- /dev/null +++ b/grocery-objc/grocery-objc/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/grocery-objc/Base.lproj/Main.storyboard b/grocery-objc/grocery-objc/Base.lproj/Main.storyboard new file mode 100644 index 0000000..842a8c8 --- /dev/null +++ b/grocery-objc/grocery-objc/Base.lproj/Main.storyboard @@ -0,0 +1,466 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/grocery-objc/FoodResult.h b/grocery-objc/grocery-objc/FoodResult.h new file mode 100644 index 0000000..a2ef22c --- /dev/null +++ b/grocery-objc/grocery-objc/FoodResult.h @@ -0,0 +1,25 @@ +// +// FoodResult.h +// grocery-objc +// +// Created by Shena Yoshida on 2/17/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import + +@interface FoodResult : NSObject + +// for fridge inventory +@property (nonatomic) NSString *foodTitle; +@property (nonatomic) NSDate *foodExpirationDate; +@property (nonatomic) NSDate *foodDateAdded; + +// for API results +@property (nonatomic) NSString *recipeName; +@property (nonatomic) NSString *recipeImage; +@property (nonatomic) NSString *recipeIngredients; +@property (nonatomic) NSString *recipeDescription; +@property (nonatomic) NSString *recipeDirections; + +@end diff --git a/grocery-objc/grocery-objc/FoodResult.m b/grocery-objc/grocery-objc/FoodResult.m new file mode 100644 index 0000000..4c4c6c0 --- /dev/null +++ b/grocery-objc/grocery-objc/FoodResult.m @@ -0,0 +1,15 @@ +// +// FoodResult.m +// grocery-objc +// +// Created by Shena Yoshida on 2/17/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import "FoodResult.h" + +@implementation FoodResult + + + +@end diff --git a/grocery-objc/grocery-objc/Info.plist b/grocery-objc/grocery-objc/Info.plist new file mode 100644 index 0000000..b0e09d0 --- /dev/null +++ b/grocery-objc/grocery-objc/Info.plist @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Grub Monitor + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarStyle + UIStatusBarStyleDefault + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/grocery-objc/grocery-objc/InventoryTableViewCell.h b/grocery-objc/grocery-objc/InventoryTableViewCell.h new file mode 100644 index 0000000..c54c40c --- /dev/null +++ b/grocery-objc/grocery-objc/InventoryTableViewCell.h @@ -0,0 +1,16 @@ +// +// InventoryTableViewCell.h +// grocery-objc +// +// Created by Shena Yoshida on 2/18/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import + +@interface InventoryTableViewCell : UITableViewCell + +@property (weak, nonatomic) IBOutlet UILabel *labelFood; +@property (weak, nonatomic) IBOutlet UILabel *labelDate; + +@end diff --git a/grocery-objc/grocery-objc/InventoryTableViewCell.m b/grocery-objc/grocery-objc/InventoryTableViewCell.m new file mode 100644 index 0000000..5bb3939 --- /dev/null +++ b/grocery-objc/grocery-objc/InventoryTableViewCell.m @@ -0,0 +1,23 @@ +// +// InventoryTableViewCell.m +// grocery-objc +// +// Created by Shena Yoshida on 2/18/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import "InventoryTableViewCell.h" + +@implementation InventoryTableViewCell + +- (void)awakeFromNib { + // Initialization code +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/grocery-objc/grocery-objc/InventoryTableViewCell.xib b/grocery-objc/grocery-objc/InventoryTableViewCell.xib new file mode 100644 index 0000000..898861e --- /dev/null +++ b/grocery-objc/grocery-objc/InventoryTableViewCell.xib @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/grocery-objc/InventoryTableViewController.h b/grocery-objc/grocery-objc/InventoryTableViewController.h new file mode 100644 index 0000000..0f0aa1e --- /dev/null +++ b/grocery-objc/grocery-objc/InventoryTableViewController.h @@ -0,0 +1,15 @@ +// +// InventoryTableViewController.h +// grocery-objc +// +// Created by Shena Yoshida on 2/17/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import +#import "FoodResult.h" +#import + +@interface InventoryTableViewController : UITableViewController + +@end diff --git a/grocery-objc/grocery-objc/InventoryTableViewController.m b/grocery-objc/grocery-objc/InventoryTableViewController.m new file mode 100644 index 0000000..a2d8bcb --- /dev/null +++ b/grocery-objc/grocery-objc/InventoryTableViewController.m @@ -0,0 +1,228 @@ +// +// InventoryTableViewController.m +// grocery-objc +// +// Created by Shena Yoshida on 2/17/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import "InventoryTableViewController.h" +#import "AddFoodViewController.h" +#import "NSDate+RelativeTime.h" +#import "InventoryTableViewCell.h" +#import +#import "foodModel.h" + + +@interface InventoryTableViewController () +@property (nonatomic) foodModel *sharedManager; +@end + +@implementation InventoryTableViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + //register notifications + UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert; + UIUserNotificationSettings *mySettings = [UIUserNotificationSettings settingsForTypes:types categories:nil]; + [[UIApplication sharedApplication] registerUserNotificationSettings:mySettings]; + + + + [self.navigationController.navigationBar setTranslucent:NO]; + [self.tabBarController.tabBar setTranslucent:NO]; + + + // set up custom cell + UINib *nib = [UINib nibWithNibName:@"InventoryTableViewCell" bundle:nil]; + [self.tableView registerNib:nib forCellReuseIdentifier:@"cellIdentifier"]; + + // set height of cell to adjust to text + self.tableView.rowHeight = UITableViewAutomaticDimension; + self.tableView.estimatedRowHeight = 50; + + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"shopping"] + style:UIBarButtonItemStylePlain + target:self + action:@selector(addFood:)]; + + self.sharedManager = [foodModel sharedManager]; +} + +- (void) setUpNotificationsWithInterval:(NSTimeInterval)interval{ + + if ([[UIApplication sharedApplication] scheduledLocalNotifications].count < 1){ + + NSMutableArray *aboutToExpire = [[NSMutableArray alloc]init]; + + NSDate *today = [NSDate date]; + NSDate *nextWeek = [today dateByAddingTimeInterval: 1209600.0]; + + //determine which ingredients are about to expire + for (NSDictionary* food in self.sharedManager.foodData) { + NSString *key = [[food allKeys] firstObject]; + NSTimeInterval interval = [[[food objectForKey:key] objectForKey: @"Expiration Date"] doubleValue]; + NSDate * foodDate = [NSDate dateWithTimeIntervalSince1970:interval]; + + if([foodDate compare:nextWeek]<1 && [foodDate compare:[NSDate date]]>0){ + [aboutToExpire addObject:key]; + } + } + + NSString * alertBody = [NSString stringWithFormat:@"Your %@ are about to expire!", [aboutToExpire componentsJoinedByString:@", "]]; + + UILocalNotification* localNotification = [[UILocalNotification alloc] init]; + localNotification.fireDate = [NSDate dateWithTimeIntervalSinceNow:interval]; + localNotification.alertBody = alertBody; + localNotification.timeZone = [NSTimeZone defaultTimeZone]; + [[UIApplication sharedApplication] scheduleLocalNotification:localNotification]; + + } + + +} + +-(void)viewDidAppear:(BOOL)animated{ + + [self.sharedManager.foodData removeAllObjects]; + // read data + Firebase *myRootRef = [[Firebase alloc] initWithUrl:@"https://scorching-heat-3082.firebaseio.com/Grocery-List"]; + [myRootRef observeSingleEventOfType:FEventTypeValue withBlock:^(FDataSnapshot *snapshot) { + if (snapshot.value != [NSNull null]) { + + NSDictionary * jsonFoods = snapshot.value; + NSMutableArray *tempFoodArray = [[NSMutableArray alloc]init]; + + for (NSDictionary* food in jsonFoods){ + + NSDictionary *foodWithData = @{ food : [jsonFoods objectForKey:food] }; + + [tempFoodArray addObject:foodWithData]; + } + NSArray *sortedArray; + sortedArray = [tempFoodArray sortedArrayUsingComparator:^NSComparisonResult(id a, id b) { + + + NSString *firstKey = [[(NSDictionary*)a allKeys]firstObject]; + NSTimeInterval first = [[[(NSDictionary*)a objectForKey:firstKey] objectForKey: @"Expiration Date"] doubleValue]; + NSDate * dateA = [NSDate dateWithTimeIntervalSince1970:first]; + NSString *secondKey = [[(NSDictionary*)b allKeys]firstObject]; + NSTimeInterval second = [[[(NSDictionary*)b objectForKey:secondKey] objectForKey: @"Expiration Date"] doubleValue]; + NSDate * dateB = [NSDate dateWithTimeIntervalSince1970:second]; + + return [dateA compare:dateB]; + }]; + + self.sharedManager.foodData = [sortedArray mutableCopy]; + [self setUpNotificationsWithInterval:60]; + [self.tableView reloadData]; + } + + }]; +} + +-(IBAction)addFood:(id)sender{ + AddFoodViewController * vc = [self.storyboard instantiateViewControllerWithIdentifier:@"addFoodVC"]; + [self presentViewController:vc animated:YES completion:nil]; +} + + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.sharedManager.foodData.count; +} + + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + InventoryTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellIdentifier" forIndexPath:indexPath]; + + NSDictionary *foodObject = self.sharedManager.foodData[indexPath.row]; + + NSString *key = [[foodObject allKeys] firstObject]; + + NSDictionary *foodDetails = [foodObject objectForKey:key]; + + NSString *emoji = [foodDetails objectForKey:@"emoji"]; + NSString *displayName = [NSString stringWithFormat:@"%@ %@", key, emoji]; + NSTimeInterval interval = [[foodDetails objectForKey:@"Expiration Date"] doubleValue]; + NSDate * date = [NSDate dateWithTimeIntervalSince1970:interval]; + if ([date compare:[NSDate date]]<0) { + cell.labelDate.text = @"expired"; + cell.labelDate.textColor = [UIColor redColor]; + } + else{ + cell.labelDate.text = [date relativeTime]; + cell.labelDate.textColor = [UIColor blackColor]; + } + + cell.labelFood.text = displayName; + + + + return cell; +} + + + +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { + + + + return YES; +} + + +-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath +{ + NSDictionary *foodObject = self.sharedManager.foodData[indexPath.row]; + + NSString *key = [[foodObject allKeys] firstObject]; + + NSString *url = [NSString stringWithFormat:@"https://scorching-heat-3082.firebaseio.com/Grocery-List/%@",key]; + + if (editingStyle == UITableViewCellEditingStyleDelete) { + + // read data + + Firebase *mydeletionRef = [[Firebase alloc] initWithUrl:url]; + + [mydeletionRef removeValueWithCompletionBlock:^(NSError *error, Firebase *ref) { + [self.sharedManager.foodData removeObjectAtIndex:indexPath.row]; + [self.tableView reloadData]; + }]; + + } +} + + + + +/* + // Override to support editing the table view. + - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) { + // Delete the row from the data source + [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; + } else if (editingStyle == UITableViewCellEditingStyleInsert) { + // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view + } + } + */ + + +/* + #pragma mark - Navigation + + - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. + } + */ + +@end diff --git a/grocery-objc/grocery-objc/RecipeDetailViewController.h b/grocery-objc/grocery-objc/RecipeDetailViewController.h new file mode 100644 index 0000000..ad5a8a9 --- /dev/null +++ b/grocery-objc/grocery-objc/RecipeDetailViewController.h @@ -0,0 +1,15 @@ +// +// RecipeDetailViewController.h +// grocery-objc +// +// Created by Henna Ahmed on 2/19/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import + +@interface RecipeDetailViewController : UIViewController + +@property (nonatomic) NSString * recipeID; + +@end diff --git a/grocery-objc/grocery-objc/RecipeDetailViewController.m b/grocery-objc/grocery-objc/RecipeDetailViewController.m new file mode 100644 index 0000000..0119d7c --- /dev/null +++ b/grocery-objc/grocery-objc/RecipeDetailViewController.m @@ -0,0 +1,99 @@ +// +// RecipeDetailViewController.m +// grocery-objc +// +// Created by Henna Ahmed on 2/19/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import "RecipeDetailViewController.h" +#import + + +@interface RecipeDetailViewController () +@property (weak, nonatomic) IBOutlet UILabel *recipeTitle; +@property (weak, nonatomic) IBOutlet UILabel *recipeIngredients; +@property (weak, nonatomic) IBOutlet UIImageView *recipeImage; + +@property (weak, nonatomic) IBOutlet UILabel *recipeInstructions; + +@end + +@implementation RecipeDetailViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + [self.navigationController.navigationBar setTranslucent:NO]; + [self.tabBarController.tabBar setTranslucent:NO]; + + + NSString *foodURL = [NSString stringWithFormat:@"https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/%@/information", self.recipeID]; + + NSDictionary *headers = @{@"X-Mashape-Key": @"ebmr78QZnxmshZicMD43oVuhK1IYp1x9ZyNjsnmVvW62GxZpx9"}; + + UNIUrlConnection *asyncConnection = [[UNIRest get:^(UNISimpleRequest *request) { + [request setUrl:foodURL]; + [request setHeaders:headers]; + }] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) { + + + NSDictionary *json = [NSJSONSerialization JSONObjectWithData:response.rawBody + options:kNilOptions + error:nil]; + + //NSString *image = [json objectForKey:@"image"]; + // + //[json objectForKey:@"readyInMinutes"]; + //[json objectForKey:@"servings"]; + // sourceUrl + + dispatch_async(dispatch_get_main_queue(), ^{ + self.recipeTitle.text = [json objectForKey:@"title"]; + self.recipeInstructions.text = [self convertHTML:[json objectForKey:@"instructions"]]; + NSData * imageData = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString: [json objectForKey:@"image"]]]; + self.recipeImage.image = [UIImage imageWithData: imageData]; + NSArray *ingredients = [json objectForKey:@"extendedIngredients"]; + NSMutableString* allIngredients = [NSMutableString stringWithCapacity:150]; + + for(NSDictionary * ingredient in ingredients){ + NSString * ingredientName = [ingredient objectForKey:@"originalString"]; + [allIngredients appendFormat:@"%@\n", ingredientName]; + + } + self.recipeIngredients.text = allIngredients; + }); + + + + }]; + +} + +-(NSString *)convertHTML:(NSString *)html { + + NSScanner *myScanner; + NSString *text = nil; + myScanner = [NSScanner scannerWithString:html]; + + while ([myScanner isAtEnd] == NO) { + + [myScanner scanUpToString:@"<" intoString:NULL] ; + + [myScanner scanUpToString:@">" intoString:&text] ; + + html = [html stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"%@>", text] withString:@""]; + } + // + html = [html stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + + return html; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + + +@end diff --git a/grocery-objc/grocery-objc/RecipesTableViewCell.h b/grocery-objc/grocery-objc/RecipesTableViewCell.h new file mode 100644 index 0000000..eba940d --- /dev/null +++ b/grocery-objc/grocery-objc/RecipesTableViewCell.h @@ -0,0 +1,16 @@ +// +// RecipesTableViewCell.h +// grocery-objc +// +// Created by Shena Yoshida on 2/19/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import + +@interface RecipesTableViewCell : UITableViewCell + +@property (strong, nonatomic) IBOutlet UILabel *recipeLabel; +@property (strong, nonatomic) IBOutlet UIImageView *recipeImage; + +@end diff --git a/grocery-objc/grocery-objc/RecipesTableViewCell.m b/grocery-objc/grocery-objc/RecipesTableViewCell.m new file mode 100644 index 0000000..5b7a2d6 --- /dev/null +++ b/grocery-objc/grocery-objc/RecipesTableViewCell.m @@ -0,0 +1,23 @@ +// +// RecipesTableViewCell.m +// grocery-objc +// +// Created by Shena Yoshida on 2/19/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import "RecipesTableViewCell.h" + +@implementation RecipesTableViewCell + +- (void)awakeFromNib { + // Initialization code +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/grocery-objc/grocery-objc/RecipesTableViewCell.xib b/grocery-objc/grocery-objc/RecipesTableViewCell.xib new file mode 100644 index 0000000..8d0dade --- /dev/null +++ b/grocery-objc/grocery-objc/RecipesTableViewCell.xib @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery-objc/grocery-objc/RecipesTableViewController.h b/grocery-objc/grocery-objc/RecipesTableViewController.h new file mode 100644 index 0000000..86d495e --- /dev/null +++ b/grocery-objc/grocery-objc/RecipesTableViewController.h @@ -0,0 +1,13 @@ +// +// RecipesTableViewController.h +// grocery-objc +// +// Created by Henna Ahmed on 2/19/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import + +@interface RecipesTableViewController : UITableViewController + +@end diff --git a/grocery-objc/grocery-objc/RecipesTableViewController.m b/grocery-objc/grocery-objc/RecipesTableViewController.m new file mode 100644 index 0000000..7fc9490 --- /dev/null +++ b/grocery-objc/grocery-objc/RecipesTableViewController.m @@ -0,0 +1,157 @@ +// +// RecipesTableViewController.m +// grocery-objc +// +// Created by Henna Ahmed on 2/19/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import "RecipesTableViewController.h" +#import "FoodResult.h" +#import +#import "foodModel.h" +#import "RecipeDetailViewController.h" +#import "RecipesTableViewCell.h" +#import + +@interface RecipesTableViewController () +@property (nonatomic) NSMutableArray * recipes; +@property (nonatomic) NSMutableArray * aboutToExpire; +@property (nonatomic) foodModel *sharedManager; + +@end + +@implementation RecipesTableViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + // set up custom cell + UINib *nib = [UINib nibWithNibName:@"RecipesTableViewCell" bundle:nil]; + [self.tableView registerNib:nib forCellReuseIdentifier:@"recipeIdentifier"]; + + // set height of cell to adjust to text + self.tableView.rowHeight = UITableViewAutomaticDimension; + self.tableView.estimatedRowHeight = 50; + + self.tableView.backgroundColor = [UIColor colorWithRed:248.0/255.0 green:213.0/255.0 blue:199.0/255.0 alpha:1]; + self.tableView.backgroundView.backgroundColor = [UIColor colorWithRed:248.0/255.0 green:213.0/255.0 blue:199.0/255.0 alpha:1]; + + [self.navigationController.navigationBar setTranslucent:NO]; + [self.tabBarController.tabBar setTranslucent:NO]; + + + self.recipes = [[NSMutableArray alloc]init]; + self.aboutToExpire = [[NSMutableArray alloc]init]; + self.sharedManager = [foodModel sharedManager]; + NSDate *today = [NSDate date]; + NSDate *nextWeek = [today dateByAddingTimeInterval: 1209600.0]; + + //determine which ingredients are about to expire + for (NSDictionary* food in self.sharedManager.foodData) { + NSString *key = [[food allKeys] firstObject]; + NSTimeInterval interval = [[[food objectForKey:key] objectForKey: @"Expiration Date"] doubleValue]; + NSDate * foodDate = [NSDate dateWithTimeIntervalSince1970:interval]; + + if([foodDate compare:nextWeek]<1 && [foodDate compare:[NSDate date]]>0){ + [self.aboutToExpire addObject:key]; + } + } + + //make a call to the recipe API + [self fetchAPIData]; + + +} + +- (void)fetchAPIData { + NSString *foodURL = [NSString stringWithFormat:@"https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/findByIngredients?ingredients=%@&number=20", [self.aboutToExpire componentsJoinedByString:@","]]; + + NSDictionary *headers = @{@"X-Mashape-Key": @"ebmr78QZnxmshZicMD43oVuhK1IYp1x9ZyNjsnmVvW62GxZpx9"}; + + UNIUrlConnection *asyncConnection = [[UNIRest get:^(UNISimpleRequest *request) { + [request setUrl:foodURL]; + [request setHeaders:headers]; + }] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) { + + if (error) { + NSLog(@"%@", error); + } + else{ + NSArray *json = [NSJSONSerialization JSONObjectWithData:response.rawBody + options:kNilOptions + error:nil]; + self.recipes = [json mutableCopy]; + + dispatch_async(dispatch_get_main_queue(), ^{ + [self.tableView reloadData]; + }); + } + + + }]; + +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + + return self.recipes.count; +} + + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + RecipesTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"recipeIdentifier" forIndexPath:indexPath]; + NSDictionary * recipe = self.recipes[indexPath.row]; + cell.recipeLabel.text = [recipe objectForKey:@"title"]; + + cell.clipsToBounds = YES; + + // stretch cell separators across entire view + cell.preservesSuperviewLayoutMargins = false; + cell.separatorInset = UIEdgeInsetsZero; + cell.layoutMargins = UIEdgeInsetsZero; + + [cell.recipeImage sd_setImageWithURL:[NSURL URLWithString:[recipe objectForKey:@"image"]] + placeholderImage:[UIImage imageNamed:@"placeholder.png"]]; + +// NSData * imageData = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString: [recipe objectForKey:@"image"]]]; +// cell.recipeImage.image = [UIImage imageWithData: imageData]; + + return cell; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + + + + [self performSegueWithIdentifier:@"recipedetailsegue" sender:nil]; + + +} + + + +-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + + NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; + + + RecipeDetailViewController *destViewController = segue.destinationViewController; + destViewController.recipeID = [self.recipes[indexPath.row] objectForKey:@"id"]; + +} + +@end diff --git a/grocery-objc/grocery-objc/ViewController.h b/grocery-objc/grocery-objc/ViewController.h new file mode 100644 index 0000000..e6c486f --- /dev/null +++ b/grocery-objc/grocery-objc/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// grocery-objc +// +// Created by Shena Yoshida on 2/16/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/grocery-objc/grocery-objc/ViewController.m b/grocery-objc/grocery-objc/ViewController.m new file mode 100644 index 0000000..d9bc4aa --- /dev/null +++ b/grocery-objc/grocery-objc/ViewController.m @@ -0,0 +1,29 @@ +// +// ViewController.m +// grocery-objc +// +// Created by Shena Yoshida on 2/16/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import "ViewController.h" + + + +@interface ViewController () + + + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + +} + + + + +@end diff --git a/grocery-objc/grocery-objc/foodModel.h b/grocery-objc/grocery-objc/foodModel.h new file mode 100644 index 0000000..6aa8279 --- /dev/null +++ b/grocery-objc/grocery-objc/foodModel.h @@ -0,0 +1,22 @@ +// +// foodModel.h +// grocery-objc +// +// Created by Henna Ahmed on 2/19/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import + +@interface foodModel : NSObject +{ + NSMutableArray *foodData; +} + +@property (nonatomic, retain) NSMutableArray *foodData; + ++ (id)sharedManager; + +@end + + diff --git a/grocery-objc/grocery-objc/foodModel.m b/grocery-objc/grocery-objc/foodModel.m new file mode 100644 index 0000000..1b7b4dc --- /dev/null +++ b/grocery-objc/grocery-objc/foodModel.m @@ -0,0 +1,38 @@ +// +// foodModel.m +// grocery-objc +// +// Created by Henna Ahmed on 2/19/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import "foodModel.h" + +@implementation foodModel + +@synthesize foodData; + +#pragma mark Singleton Methods + ++ (id)sharedManager { + static foodModel *sharedMyManager = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedMyManager = [[self alloc] init]; + }); + return sharedMyManager; +} + +- (id)init { + if (self = [super init]) { + foodData = [[NSMutableArray alloc] init]; + } + return self; +} + +- (void)dealloc { + // Should never be called, but just here for clarity really. +} + + +@end diff --git a/grocery-objc/grocery-objc/main.m b/grocery-objc/grocery-objc/main.m new file mode 100644 index 0000000..83a03c2 --- /dev/null +++ b/grocery-objc/grocery-objc/main.m @@ -0,0 +1,16 @@ +// +// main.m +// grocery-objc +// +// Created by Shena Yoshida on 2/16/16. +// Copyright © 2016 Shena Yoshida. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/grocery/.DS_Store b/grocery/.DS_Store new file mode 100644 index 0000000..77f3397 Binary files /dev/null and b/grocery/.DS_Store differ diff --git a/grocery/Podfile b/grocery/Podfile new file mode 100644 index 0000000..d60789d --- /dev/null +++ b/grocery/Podfile @@ -0,0 +1,2 @@ +use_frameworks! +pod 'WJBarCodeScanner', '~> 0.0' \ No newline at end of file diff --git a/grocery/Podfile.lock b/grocery/Podfile.lock new file mode 100644 index 0000000..d824fa2 --- /dev/null +++ b/grocery/Podfile.lock @@ -0,0 +1,10 @@ +PODS: + - WJBarCodeScanner (0.0.4) + +DEPENDENCIES: + - WJBarCodeScanner (~> 0.0) + +SPEC CHECKSUMS: + WJBarCodeScanner: 793071e8dddc64ec21d427d59a3d68d04a263563 + +COCOAPODS: 0.39.0 diff --git a/grocery/Pods/Manifest.lock b/grocery/Pods/Manifest.lock new file mode 100644 index 0000000..d824fa2 --- /dev/null +++ b/grocery/Pods/Manifest.lock @@ -0,0 +1,10 @@ +PODS: + - WJBarCodeScanner (0.0.4) + +DEPENDENCIES: + - WJBarCodeScanner (~> 0.0) + +SPEC CHECKSUMS: + WJBarCodeScanner: 793071e8dddc64ec21d427d59a3d68d04a263563 + +COCOAPODS: 0.39.0 diff --git a/grocery/Pods/Pods.xcodeproj/project.pbxproj b/grocery/Pods/Pods.xcodeproj/project.pbxproj new file mode 100644 index 0000000..286fff6 --- /dev/null +++ b/grocery/Pods/Pods.xcodeproj/project.pbxproj @@ -0,0 +1,518 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 195E3002541251A6675DE3A04BB7E10C /* Pods-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 894E5DA93A9F359521A89826BE6DA777 /* Pods-dummy.m */; }; + A290732EDB4B1031696251D1D385A48C /* Pods-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BCC458FDD5F692BBB2BFC64BB5701FC /* Pods-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A58CEF8637B4B80C4687A224026ABAAA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F866EA2B7D47D920CF64B0E05B695896 /* Foundation.framework */; }; + AA9D4EF22DBF8F2C830D5C504B0477C8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F866EA2B7D47D920CF64B0E05B695896 /* Foundation.framework */; }; + BCE67C61B7291F1264FDC325369D5A09 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E770E649A751F6E16D0553FA719AEE0 /* AVFoundation.framework */; }; + C17D6B4BA63A971E4D5818E9541FEBB2 /* WJScanViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C069798842B36A5F08733A56F2892D19 /* WJScanViewController.swift */; }; + C4C3CDBFC2B20B01B755821A9B3BE0CF /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6F15F6B7457ECAED15F41149D90E8E4 /* UIKit.framework */; }; + D0DF2D39E3099B4751E629879EF3B667 /* WJBarCodeScanner-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 965B3AD4219085251D75129D3B41F11F /* WJBarCodeScanner-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D4B746D1A8863ED321D521312680BBF3 /* WJScanView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00809A6F17B0CC6717D3F27C1C160E51 /* WJScanView.swift */; }; + E2640FCAEB320F4824073019BFC3024A /* WJBarCodeScanner-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 8628A8498568A8D3CC53D27DC616900B /* WJBarCodeScanner-dummy.m */; }; + FB7D19E867CA5CB7228CEE431EAD5DC7 /* WJScanLine.png in Sources */ = {isa = PBXBuildFile; fileRef = 9E704E0C4A42B02BBCCCB3FB2A4D5661 /* WJScanLine.png */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 3F409486891144981F42FFD797981CE8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 9D14C1C6FCBF86B631FE75F659EBB0AD; + remoteInfo = WJBarCodeScanner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 00809A6F17B0CC6717D3F27C1C160E51 /* WJScanView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = WJScanView.swift; path = WJBarCodeScanner/WJScanView.swift; sourceTree = ""; }; + 0B6528380E320BDE356D5E24FE77E944 /* WJBarCodeScanner-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "WJBarCodeScanner-prefix.pch"; sourceTree = ""; }; + 178A532B87CB0BDB620E04EE69D832E9 /* WJBarCodeScanner.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = WJBarCodeScanner.modulemap; sourceTree = ""; }; + 2BCC458FDD5F692BBB2BFC64BB5701FC /* Pods-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-umbrella.h"; sourceTree = ""; }; + 3FAE46C4A34DC88A1195D5330162B216 /* WJBarCodeScanner.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = WJBarCodeScanner.xcconfig; sourceTree = ""; }; + 4DCC1545D56F2268E065A2C071F13A34 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 79A9DEDC89FE8336BF5FEDAAF75BF7FC /* Pods.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Pods.modulemap; sourceTree = ""; }; + 8628A8498568A8D3CC53D27DC616900B /* WJBarCodeScanner-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "WJBarCodeScanner-dummy.m"; sourceTree = ""; }; + 87B213035BAC5F75386F62D3C75D2342 /* Pods-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-acknowledgements.plist"; sourceTree = ""; }; + 894E5DA93A9F359521A89826BE6DA777 /* Pods-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-dummy.m"; sourceTree = ""; }; + 8E770E649A751F6E16D0553FA719AEE0 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/AVFoundation.framework; sourceTree = DEVELOPER_DIR; }; + 94AB391EC9742EA1A2E5438B20CEE535 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 965B3AD4219085251D75129D3B41F11F /* WJBarCodeScanner-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "WJBarCodeScanner-umbrella.h"; sourceTree = ""; }; + 977577C045EDA9D9D1F46E2598D19FC7 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.debug.xcconfig; sourceTree = ""; }; + 9E704E0C4A42B02BBCCCB3FB2A4D5661 /* WJScanLine.png */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = image.png; name = WJScanLine.png; path = WJBarCodeScanner/WJScanLine.png; sourceTree = ""; }; + BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + C069798842B36A5F08733A56F2892D19 /* WJScanViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = WJScanViewController.swift; path = WJBarCodeScanner/WJScanViewController.swift; sourceTree = ""; }; + CBC0F7C552B739C909B650A0F42F7F38 /* Pods-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-resources.sh"; sourceTree = ""; }; + D0405803033A2A777B8E4DFA0C1800ED /* Pods-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-acknowledgements.markdown"; sourceTree = ""; }; + D6F15F6B7457ECAED15F41149D90E8E4 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + DA312349A49333542E6F4B36B329960E /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.release.xcconfig; sourceTree = ""; }; + E06623482A4FB6E934FC860519DE2AF8 /* WJBarCodeScanner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WJBarCodeScanner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + E7F21354943D9F42A70697D5A5EF72E9 /* Pods-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-frameworks.sh"; sourceTree = ""; }; + E8446514FBAD26C0E18F24A5715AEF67 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F866EA2B7D47D920CF64B0E05B695896 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 75208151CF60AE9835A6E9A0EA2620DB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A58CEF8637B4B80C4687A224026ABAAA /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9DED60E9FAA6FF539AA632F7BB91724A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + BCE67C61B7291F1264FDC325369D5A09 /* AVFoundation.framework in Frameworks */, + AA9D4EF22DBF8F2C830D5C504B0477C8 /* Foundation.framework in Frameworks */, + C4C3CDBFC2B20B01B755821A9B3BE0CF /* UIKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0E4A3CC01344955033AE89EE53D9C62B /* Products */ = { + isa = PBXGroup; + children = ( + 4DCC1545D56F2268E065A2C071F13A34 /* Pods.framework */, + E06623482A4FB6E934FC860519DE2AF8 /* WJBarCodeScanner.framework */, + ); + name = Products; + sourceTree = ""; + }; + 122DA2E5084A4393C29BE363C764795C /* Frameworks */ = { + isa = PBXGroup; + children = ( + 81DAA33EADCA88F32FDF1FE615DF6816 /* iOS */, + ); + name = Frameworks; + sourceTree = ""; + }; + 1DC615063D01F694B71855D79086C98D /* WJBarCodeScanner */ = { + isa = PBXGroup; + children = ( + 9E704E0C4A42B02BBCCCB3FB2A4D5661 /* WJScanLine.png */, + 00809A6F17B0CC6717D3F27C1C160E51 /* WJScanView.swift */, + C069798842B36A5F08733A56F2892D19 /* WJScanViewController.swift */, + 4BF2297263ACD6371DBD929442382871 /* Support Files */, + ); + path = WJBarCodeScanner; + sourceTree = ""; + }; + 346B030D3C1B2C6812C2AF3B6703D326 /* Pods */ = { + isa = PBXGroup; + children = ( + 1DC615063D01F694B71855D79086C98D /* WJBarCodeScanner */, + ); + name = Pods; + sourceTree = ""; + }; + 4BF2297263ACD6371DBD929442382871 /* Support Files */ = { + isa = PBXGroup; + children = ( + 94AB391EC9742EA1A2E5438B20CEE535 /* Info.plist */, + 178A532B87CB0BDB620E04EE69D832E9 /* WJBarCodeScanner.modulemap */, + 3FAE46C4A34DC88A1195D5330162B216 /* WJBarCodeScanner.xcconfig */, + 8628A8498568A8D3CC53D27DC616900B /* WJBarCodeScanner-dummy.m */, + 0B6528380E320BDE356D5E24FE77E944 /* WJBarCodeScanner-prefix.pch */, + 965B3AD4219085251D75129D3B41F11F /* WJBarCodeScanner-umbrella.h */, + ); + name = "Support Files"; + path = "../Target Support Files/WJBarCodeScanner"; + sourceTree = ""; + }; + 75D98FF52E597A11900E131B6C4E1ADA /* Pods */ = { + isa = PBXGroup; + children = ( + E8446514FBAD26C0E18F24A5715AEF67 /* Info.plist */, + 79A9DEDC89FE8336BF5FEDAAF75BF7FC /* Pods.modulemap */, + D0405803033A2A777B8E4DFA0C1800ED /* Pods-acknowledgements.markdown */, + 87B213035BAC5F75386F62D3C75D2342 /* Pods-acknowledgements.plist */, + 894E5DA93A9F359521A89826BE6DA777 /* Pods-dummy.m */, + E7F21354943D9F42A70697D5A5EF72E9 /* Pods-frameworks.sh */, + CBC0F7C552B739C909B650A0F42F7F38 /* Pods-resources.sh */, + 2BCC458FDD5F692BBB2BFC64BB5701FC /* Pods-umbrella.h */, + 977577C045EDA9D9D1F46E2598D19FC7 /* Pods.debug.xcconfig */, + DA312349A49333542E6F4B36B329960E /* Pods.release.xcconfig */, + ); + name = Pods; + path = "Target Support Files/Pods"; + sourceTree = ""; + }; + 7DB346D0F39D3F0E887471402A8071AB = { + isa = PBXGroup; + children = ( + BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */, + 122DA2E5084A4393C29BE363C764795C /* Frameworks */, + 346B030D3C1B2C6812C2AF3B6703D326 /* Pods */, + 0E4A3CC01344955033AE89EE53D9C62B /* Products */, + B7B80995527643776607AFFA75B91E24 /* Targets Support Files */, + ); + sourceTree = ""; + }; + 81DAA33EADCA88F32FDF1FE615DF6816 /* iOS */ = { + isa = PBXGroup; + children = ( + 8E770E649A751F6E16D0553FA719AEE0 /* AVFoundation.framework */, + F866EA2B7D47D920CF64B0E05B695896 /* Foundation.framework */, + D6F15F6B7457ECAED15F41149D90E8E4 /* UIKit.framework */, + ); + name = iOS; + sourceTree = ""; + }; + B7B80995527643776607AFFA75B91E24 /* Targets Support Files */ = { + isa = PBXGroup; + children = ( + 75D98FF52E597A11900E131B6C4E1ADA /* Pods */, + ); + name = "Targets Support Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + AF28AF16FC255A9AD278232AF899A1B1 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + A290732EDB4B1031696251D1D385A48C /* Pods-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DE497E51F424E473B37AAB21A6114936 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + D0DF2D39E3099B4751E629879EF3B667 /* WJBarCodeScanner-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 9D14C1C6FCBF86B631FE75F659EBB0AD /* WJBarCodeScanner */ = { + isa = PBXNativeTarget; + buildConfigurationList = F618C600D358168D3452C051A2D2BC07 /* Build configuration list for PBXNativeTarget "WJBarCodeScanner" */; + buildPhases = ( + 53FD8D45EDBFF1098925D7467FB02182 /* Sources */, + 9DED60E9FAA6FF539AA632F7BB91724A /* Frameworks */, + DE497E51F424E473B37AAB21A6114936 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = WJBarCodeScanner; + productName = WJBarCodeScanner; + productReference = E06623482A4FB6E934FC860519DE2AF8 /* WJBarCodeScanner.framework */; + productType = "com.apple.product-type.framework"; + }; + CA852532229187CA344C0AB10D9B031E /* Pods */ = { + isa = PBXNativeTarget; + buildConfigurationList = 67D739706881F2E0019D85FD242ED16A /* Build configuration list for PBXNativeTarget "Pods" */; + buildPhases = ( + 61BE8970A84A1B47C78799C0934C73EE /* Sources */, + 75208151CF60AE9835A6E9A0EA2620DB /* Frameworks */, + AF28AF16FC255A9AD278232AF899A1B1 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + 720AF41BBBD86F987FEDAA35F5F186B1 /* PBXTargetDependency */, + ); + name = Pods; + productName = Pods; + productReference = 4DCC1545D56F2268E065A2C071F13A34 /* Pods.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0700; + LastUpgradeCheck = 0700; + }; + buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 7DB346D0F39D3F0E887471402A8071AB; + productRefGroup = 0E4A3CC01344955033AE89EE53D9C62B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CA852532229187CA344C0AB10D9B031E /* Pods */, + 9D14C1C6FCBF86B631FE75F659EBB0AD /* WJBarCodeScanner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 53FD8D45EDBFF1098925D7467FB02182 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E2640FCAEB320F4824073019BFC3024A /* WJBarCodeScanner-dummy.m in Sources */, + FB7D19E867CA5CB7228CEE431EAD5DC7 /* WJScanLine.png in Sources */, + D4B746D1A8863ED321D521312680BBF3 /* WJScanView.swift in Sources */, + C17D6B4BA63A971E4D5818E9541FEBB2 /* WJScanViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 61BE8970A84A1B47C78799C0934C73EE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 195E3002541251A6675DE3A04BB7E10C /* Pods-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 720AF41BBBD86F987FEDAA35F5F186B1 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = WJBarCodeScanner; + target = 9D14C1C6FCBF86B631FE75F659EBB0AD /* WJBarCodeScanner */; + targetProxy = 3F409486891144981F42FFD797981CE8 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 18973EA501431F44CDB4AE0C053624D4 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3FAE46C4A34DC88A1195D5330162B216 /* WJBarCodeScanner.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/WJBarCodeScanner/WJBarCodeScanner-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/WJBarCodeScanner/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/WJBarCodeScanner/WJBarCodeScanner.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = WJBarCodeScanner; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 3AEA801923F067E76A1C56F5EF13C881 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = DA312349A49333542E6F4B36B329960E /* Pods.release.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + INFOPLIST_FILE = "Target Support Files/Pods/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods/Pods.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_NAME = Pods; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 6B5F5E2E18E592EDFF558514F50DB908 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 977577C045EDA9D9D1F46E2598D19FC7 /* Pods.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + INFOPLIST_FILE = "Target Support Files/Pods/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods/Pods.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_NAME = Pods; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 97AE02BCCF1B0BDFD36D6E3D7A1E9BDD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3FAE46C4A34DC88A1195D5330162B216 /* WJBarCodeScanner.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/WJBarCodeScanner/WJBarCodeScanner-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/WJBarCodeScanner/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/WJBarCodeScanner/WJBarCodeScanner.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = WJBarCodeScanner; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + C074F63C9EE7CB4D8C618390A32CEC35 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + ONLY_ACTIVE_ARCH = YES; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Debug; + }; + E43846B588E1892F3093F3B7082B6DFB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PREPROCESSOR_DEFINITIONS = "RELEASE=1"; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C074F63C9EE7CB4D8C618390A32CEC35 /* Debug */, + E43846B588E1892F3093F3B7082B6DFB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 67D739706881F2E0019D85FD242ED16A /* Build configuration list for PBXNativeTarget "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6B5F5E2E18E592EDFF558514F50DB908 /* Debug */, + 3AEA801923F067E76A1C56F5EF13C881 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F618C600D358168D3452C051A2D2BC07 /* Build configuration list for PBXNativeTarget "WJBarCodeScanner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97AE02BCCF1B0BDFD36D6E3D7A1E9BDD /* Debug */, + 18973EA501431F44CDB4AE0C053624D4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; +} diff --git a/grocery/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/Pods.xcscheme b/grocery/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/Pods.xcscheme new file mode 100644 index 0000000..a15c0b3 --- /dev/null +++ b/grocery/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/Pods.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/WJBarCodeScanner.xcscheme b/grocery/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/WJBarCodeScanner.xcscheme new file mode 100644 index 0000000..7a3d8e1 --- /dev/null +++ b/grocery/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/WJBarCodeScanner.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/xcschememanagement.plist b/grocery/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..f8491b1 --- /dev/null +++ b/grocery/Pods/Pods.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,32 @@ + + + + + SchemeUserState + + Pods.xcscheme + + isShown + + + WJBarCodeScanner.xcscheme + + isShown + + + + SuppressBuildableAutocreation + + 9D14C1C6FCBF86B631FE75F659EBB0AD + + primary + + + CA852532229187CA344C0AB10D9B031E + + primary + + + + + diff --git a/grocery/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/Pods.xcscheme b/grocery/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/Pods.xcscheme new file mode 100644 index 0000000..7bbfd94 --- /dev/null +++ b/grocery/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/Pods.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/WJBarCodeScanner.xcscheme b/grocery/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/WJBarCodeScanner.xcscheme new file mode 100644 index 0000000..b626f0a --- /dev/null +++ b/grocery/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/WJBarCodeScanner.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/xcschememanagement.plist b/grocery/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..2d01a75 --- /dev/null +++ b/grocery/Pods/Pods.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,32 @@ + + + + + SchemeUserState + + Pods.xcscheme + + orderHint + 1 + + WJBarCodeScanner.xcscheme + + orderHint + 2 + + + SuppressBuildableAutocreation + + 9D14C1C6FCBF86B631FE75F659EBB0AD + + primary + + + CA852532229187CA344C0AB10D9B031E + + primary + + + + + diff --git a/grocery/Pods/Target Support Files/Pods/Info.plist b/grocery/Pods/Target Support Files/Pods/Info.plist new file mode 100644 index 0000000..6974542 --- /dev/null +++ b/grocery/Pods/Target Support Files/Pods/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + org.cocoapods.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/grocery/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown b/grocery/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown new file mode 100644 index 0000000..0119ff5 --- /dev/null +++ b/grocery/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown @@ -0,0 +1,29 @@ +# Acknowledgements +This application makes use of the following third party libraries: + +## WJBarCodeScanner + +The MIT License (MIT) + +Copyright (c) 2015 wj2061 + +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. + + +Generated by CocoaPods - http://cocoapods.org diff --git a/grocery/Pods/Target Support Files/Pods/Pods-acknowledgements.plist b/grocery/Pods/Target Support Files/Pods/Pods-acknowledgements.plist new file mode 100644 index 0000000..becd8e1 --- /dev/null +++ b/grocery/Pods/Target Support Files/Pods/Pods-acknowledgements.plist @@ -0,0 +1,59 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + The MIT License (MIT) + +Copyright (c) 2015 wj2061 + +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. + + + Title + WJBarCodeScanner + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - http://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/grocery/Pods/Target Support Files/Pods/Pods-dummy.m b/grocery/Pods/Target Support Files/Pods/Pods-dummy.m new file mode 100644 index 0000000..ade64bd --- /dev/null +++ b/grocery/Pods/Target Support Files/Pods/Pods-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods : NSObject +@end +@implementation PodsDummy_Pods +@end diff --git a/grocery/Pods/Target Support Files/Pods/Pods-frameworks.sh b/grocery/Pods/Target Support Files/Pods/Pods-frameworks.sh new file mode 100755 index 0000000..7485f89 --- /dev/null +++ b/grocery/Pods/Target Support Files/Pods/Pods-frameworks.sh @@ -0,0 +1,91 @@ +#!/bin/sh +set -e + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # use filter instead of exclude so missing patterns dont' throw errors + echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" + /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current file + archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" + stripped="" + for arch in $archs; do + if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi +} + + +if [[ "$CONFIGURATION" == "Debug" ]]; then + install_framework "Pods/WJBarCodeScanner.framework" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_framework "Pods/WJBarCodeScanner.framework" +fi diff --git a/grocery/Pods/Target Support Files/Pods/Pods-resources.sh b/grocery/Pods/Target Support Files/Pods/Pods-resources.sh new file mode 100755 index 0000000..16774fb --- /dev/null +++ b/grocery/Pods/Target Support Files/Pods/Pods-resources.sh @@ -0,0 +1,95 @@ +#!/bin/sh +set -e + +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +realpath() { + DIRECTORY="$(cd "${1%/*}" && pwd)" + FILENAME="${1##*/}" + echo "$DIRECTORY/$FILENAME" +} + +install_resource() +{ + case $1 in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.framework) + echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" + xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + /*) + echo "$1" + echo "$1" >> "$RESOURCES_TO_COPY" + ;; + *) + echo "${PODS_ROOT}/$1" + echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] +then + case "${TARGETED_DEVICE_FAMILY}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; + esac + + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "`realpath $PODS_ROOT`*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi diff --git a/grocery/Pods/Target Support Files/Pods/Pods-umbrella.h b/grocery/Pods/Target Support Files/Pods/Pods-umbrella.h new file mode 100644 index 0000000..21dcfd2 --- /dev/null +++ b/grocery/Pods/Target Support Files/Pods/Pods-umbrella.h @@ -0,0 +1,6 @@ +#import + + +FOUNDATION_EXPORT double PodsVersionNumber; +FOUNDATION_EXPORT const unsigned char PodsVersionString[]; + diff --git a/grocery/Pods/Target Support Files/Pods/Pods.debug.xcconfig b/grocery/Pods/Target Support Files/Pods/Pods.debug.xcconfig new file mode 100644 index 0000000..e33a4e8 --- /dev/null +++ b/grocery/Pods/Target Support Files/Pods/Pods.debug.xcconfig @@ -0,0 +1,8 @@ +EMBEDDED_CONTENT_CONTAINS_SWIFT = YES +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/WJBarCodeScanner.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "WJBarCodeScanner" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/grocery/Pods/Target Support Files/Pods/Pods.modulemap b/grocery/Pods/Target Support Files/Pods/Pods.modulemap new file mode 100644 index 0000000..8413413 --- /dev/null +++ b/grocery/Pods/Target Support Files/Pods/Pods.modulemap @@ -0,0 +1,6 @@ +framework module Pods { + umbrella header "Pods-umbrella.h" + + export * + module * { export * } +} diff --git a/grocery/Pods/Target Support Files/Pods/Pods.release.xcconfig b/grocery/Pods/Target Support Files/Pods/Pods.release.xcconfig new file mode 100644 index 0000000..e33a4e8 --- /dev/null +++ b/grocery/Pods/Target Support Files/Pods/Pods.release.xcconfig @@ -0,0 +1,8 @@ +EMBEDDED_CONTENT_CONTAINS_SWIFT = YES +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/WJBarCodeScanner.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "WJBarCodeScanner" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/grocery/Pods/Target Support Files/WJBarCodeScanner/Info.plist b/grocery/Pods/Target Support Files/WJBarCodeScanner/Info.plist new file mode 100644 index 0000000..77dc8f5 --- /dev/null +++ b/grocery/Pods/Target Support Files/WJBarCodeScanner/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + org.cocoapods.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.0.4 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/grocery/Pods/Target Support Files/WJBarCodeScanner/WJBarCodeScanner-dummy.m b/grocery/Pods/Target Support Files/WJBarCodeScanner/WJBarCodeScanner-dummy.m new file mode 100644 index 0000000..4c2677b --- /dev/null +++ b/grocery/Pods/Target Support Files/WJBarCodeScanner/WJBarCodeScanner-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_WJBarCodeScanner : NSObject +@end +@implementation PodsDummy_WJBarCodeScanner +@end diff --git a/grocery/Pods/Target Support Files/WJBarCodeScanner/WJBarCodeScanner-prefix.pch b/grocery/Pods/Target Support Files/WJBarCodeScanner/WJBarCodeScanner-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/grocery/Pods/Target Support Files/WJBarCodeScanner/WJBarCodeScanner-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/grocery/Pods/Target Support Files/WJBarCodeScanner/WJBarCodeScanner-umbrella.h b/grocery/Pods/Target Support Files/WJBarCodeScanner/WJBarCodeScanner-umbrella.h new file mode 100644 index 0000000..8993e49 --- /dev/null +++ b/grocery/Pods/Target Support Files/WJBarCodeScanner/WJBarCodeScanner-umbrella.h @@ -0,0 +1,6 @@ +#import + + +FOUNDATION_EXPORT double WJBarCodeScannerVersionNumber; +FOUNDATION_EXPORT const unsigned char WJBarCodeScannerVersionString[]; + diff --git a/grocery/Pods/Target Support Files/WJBarCodeScanner/WJBarCodeScanner.modulemap b/grocery/Pods/Target Support Files/WJBarCodeScanner/WJBarCodeScanner.modulemap new file mode 100644 index 0000000..a028c08 --- /dev/null +++ b/grocery/Pods/Target Support Files/WJBarCodeScanner/WJBarCodeScanner.modulemap @@ -0,0 +1,6 @@ +framework module WJBarCodeScanner { + umbrella header "WJBarCodeScanner-umbrella.h" + + export * + module * { export * } +} diff --git a/grocery/Pods/Target Support Files/WJBarCodeScanner/WJBarCodeScanner.xcconfig b/grocery/Pods/Target Support Files/WJBarCodeScanner/WJBarCodeScanner.xcconfig new file mode 100644 index 0000000..ba0bba0 --- /dev/null +++ b/grocery/Pods/Target Support Files/WJBarCodeScanner/WJBarCodeScanner.xcconfig @@ -0,0 +1,6 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/WJBarCodeScanner" "${PODS_ROOT}/Headers/Public" +OTHER_LDFLAGS = -framework "AVFoundation" -framework "UIKit" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_ROOT = ${SRCROOT} +SKIP_INSTALL = YES \ No newline at end of file diff --git a/grocery/Pods/WJBarCodeScanner/LICENSE b/grocery/Pods/WJBarCodeScanner/LICENSE new file mode 100644 index 0000000..345df6a --- /dev/null +++ b/grocery/Pods/WJBarCodeScanner/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 wj2061 + +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. + diff --git a/grocery/Pods/WJBarCodeScanner/README.md b/grocery/Pods/WJBarCodeScanner/README.md new file mode 100644 index 0000000..518263a --- /dev/null +++ b/grocery/Pods/WJBarCodeScanner/README.md @@ -0,0 +1,67 @@ +# WJBarCodeScanner + +If you only want to scan a barCode without dig into AVFoundtion,this is a good tool for you. +The WJBarCodeScanner keeps the scan process as simple as possible,and give you as much flexible as possible. + +#ScreenShot +![image](https://github.com/wj2061/WJBarCodeScanner/blob/master/Screenshot/001.jpg) + +# QuickExample +1.Create a subclass of WJScanViewController. +2.Configure transparentArea,scanColor,metadataObjectTypes . +3.Override `func captureOutput(captureOutput: AVCaptureOutput!, didOutputMetadataObjects metadataObjects: [AnyObject]!, fromConnection connection: AVCaptureConnection!)` + to get the result of scanning. +4.Override `func handleCameraWithoutAuth()` to handle cases when there is no camera available. +5.Use proterties (`session` `output`) to do more specific staff. + +```swift +import UIKit +import AVFoundation + +class ViewController: WJScanViewController{ + @IBOutlet weak var messageLabel: UILabel! + + override func viewDidLoad() { + super.viewDidLoad() + transparentArea = CGRect(x: view.center.x-150, y: 0, width: 300, height: 400) + scanColor = UIColor.cyanColor() + metadataObjectTypes = [ AVMetadataObjectTypeQRCode] // IF YOU only want to scan QRCode + } + + override func captureOutput(captureOutput: AVCaptureOutput!, didOutputMetadataObjects metadataObjects: [AnyObject]!, fromConnection connection: AVCaptureConnection!) { + if let metadataObject = metadataObjects.first { + let stringValue = (metadataObject as! AVMetadataMachineReadableCodeObject).stringValue + print(stringValue) + messageLabel.text = stringValue + session.stopRunning() + } + } + + override func handleCameraWithoutAuth() { + let alertView = UIAlertController(title: "alert", message: "Cannot use Back Camera", preferredStyle: .Alert) + alertView.addAction(UIAlertAction(title: "OK", style: .Default, handler: nil )) + presentViewController(alertView, animated: true , completion: nil) + } +} +``` + +# how to install + +##manual +step1: Drop WJBarCodeScanner folder into your project. + +step2: Create a subclass of WJScanViewController. +``` swift +import UIKit +import AVFoundation + +class ViewController: WJScanViewController{ +} + +``` + + + + + + diff --git a/grocery/Pods/WJBarCodeScanner/WJBarCodeScanner/WJScanLine.png b/grocery/Pods/WJBarCodeScanner/WJBarCodeScanner/WJScanLine.png new file mode 100644 index 0000000..a6b01a8 Binary files /dev/null and b/grocery/Pods/WJBarCodeScanner/WJBarCodeScanner/WJScanLine.png differ diff --git a/grocery/Pods/WJBarCodeScanner/WJBarCodeScanner/WJScanView.swift b/grocery/Pods/WJBarCodeScanner/WJBarCodeScanner/WJScanView.swift new file mode 100644 index 0000000..b6e3406 --- /dev/null +++ b/grocery/Pods/WJBarCodeScanner/WJBarCodeScanner/WJScanView.swift @@ -0,0 +1,133 @@ +// +// WJScanView.swift +// BarcodeScanDemo +// +// Created by WJ on 15/12/4. +// Copyright © 2015年 wj. All rights reserved. +// + +import UIKit +let kScanLineAnimateDuration:NSTimeInterval = 0.02 +let kCornerStrokelength:CGFloat = 15 + +class WJScanView: UIView { + var transparentArea = CGRect(){ + didSet{ + setNeedsDisplay() + setNeedsLayout() + } + } + var showScanLine = true + var scanColor = UIColor.redColor(){ + didSet{ + setNeedsDisplay() + setNeedsLayout() + } + } + + private var timer : NSTimer? + private var scanLine = UIImageView() + + override init(frame: CGRect) { + super.init(frame: frame) + backgroundColor = UIColor.clearColor() + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + backgroundColor = UIColor.clearColor() + } + + deinit{ + timer?.invalidate() + timer = nil + } + + + override func layoutSubviews() { + super.layoutSubviews() + if showScanLine{ + initScanLine() + timer?.invalidate() + timer = NSTimer.scheduledTimerWithTimeInterval(kScanLineAnimateDuration, + target: self, + selector: "scan", + userInfo: nil, + repeats: true) + } + } + + private func initScanLine(){ + scanLine.frame = CGRectMake(transparentArea.origin.x, + transparentArea.origin.y, + transparentArea.width, + 2) + scanLine.contentMode = .ScaleAspectFill + + let scanImage = UIImage(named:"WJScanLine", + inBundle: NSBundle(forClass: self.classForCoder), + compatibleWithTraitCollection: nil)! + scanLine.image = scanImage.imageWithRenderingMode(.AlwaysTemplate) + scanLine.tintColor = scanColor + self.addSubview(scanLine) + } + + func scan(){ + UIView.animateWithDuration(kScanLineAnimateDuration, animations: { () -> Void in + var point = self.scanLine.center + if CGRectContainsRect(self.transparentArea, self.scanLine.frame){ + point.y++ + }else { + point.y = CGRectGetMinY(self.transparentArea) + 1 + } + self.scanLine.center = point + }) + } + + override func drawRect(rect: CGRect) { + let ctx = UIGraphicsGetCurrentContext() + + CGContextSetRGBFillColor(ctx, 40/255.0, 40/255.0, 40/255.0, 0.5) + CGContextFillRect(ctx, bounds) //dim background + + CGContextClearRect(ctx, transparentArea) // clear transparentArea + + let path = UIBezierPath(rect: transparentArea) + path.lineWidth = 1 + UIColor.whiteColor().setStroke() + path.stroke() + + addCornerLineWithContext(ctx!, rect: transparentArea) + } + + private func addCornerLineWithContext(ctx:CGContextRef,rect:CGRect){ + CGContextSetLineWidth(ctx, 2) + let components = CGColorGetComponents(scanColor.CGColor) + CGContextSetRGBStrokeColor(ctx, components[0], components[1], components[2], components[3]) + + let upLreftPoints = [CGPointMake(rect.origin.x, rect.origin.y+kCornerStrokelength), + rect.origin, + CGPointMake(rect.origin.x+kCornerStrokelength, rect.origin.y)] + CGContextAddLines(ctx, upLreftPoints, 3) + + let upRightPoint = CGPointMake(CGRectGetMaxX(rect), rect.origin.y) + let upRightPoints = [CGPointMake(upRightPoint.x-kCornerStrokelength, upRightPoint.y), + upRightPoint, + CGPointMake(upRightPoint.x, upRightPoint.y+kCornerStrokelength)] + CGContextAddLines(ctx, upRightPoints, 3) + + let downLeftPoint = CGPointMake(rect.origin.x, CGRectGetMaxY(rect)) + let downLeftPoints = [CGPointMake(downLeftPoint.x, downLeftPoint.y-kCornerStrokelength), + downLeftPoint, + CGPointMake(downLeftPoint.x+kCornerStrokelength, downLeftPoint.y)] + CGContextAddLines(ctx, downLeftPoints, 3) + + let downRightPoint = CGPointMake(CGRectGetMaxX(rect), CGRectGetMaxY(rect)) + let downRightPoints = [CGPointMake(downRightPoint.x-kCornerStrokelength, downRightPoint.y), + downRightPoint, + CGPointMake(downRightPoint.x, downRightPoint.y-kCornerStrokelength)] + CGContextAddLines(ctx, downRightPoints, 3) + + CGContextStrokePath(ctx) + } +} diff --git a/grocery/Pods/WJBarCodeScanner/WJBarCodeScanner/WJScanViewController.swift b/grocery/Pods/WJBarCodeScanner/WJBarCodeScanner/WJScanViewController.swift new file mode 100644 index 0000000..25a3930 --- /dev/null +++ b/grocery/Pods/WJBarCodeScanner/WJBarCodeScanner/WJScanViewController.swift @@ -0,0 +1,124 @@ +// +// WJScanViewController.swift +// BarcodeScanDemo +// +// Created by wj on 15/12/4. +// Copyright © 2015年 wj. All rights reserved. +// + +import UIKit +import AVFoundation + + +@IBDesignable +public +class WJScanViewController: UIViewController ,AVCaptureMetadataOutputObjectsDelegate{ + + public let session = AVCaptureSession() + public let output = AVCaptureMetadataOutput() + public var input:AVCaptureDeviceInput? + + private var scanView :WJScanView? + + public var metadataObjectTypes = [ AVMetadataObjectTypeUPCECode, + AVMetadataObjectTypeCode39Code, + AVMetadataObjectTypeCode39Mod43Code , + AVMetadataObjectTypeEAN13Code , + AVMetadataObjectTypeEAN8Code , + AVMetadataObjectTypeCode93Code , + AVMetadataObjectTypeCode128Code , + AVMetadataObjectTypePDF417Code , + AVMetadataObjectTypeQRCode , + AVMetadataObjectTypeAztecCode , + AVMetadataObjectTypeInterleaved2of5Code , + AVMetadataObjectTypeITF14Code , + AVMetadataObjectTypeDataMatrixCode ] + { + didSet{ + output.metadataObjectTypes = metadataObjectTypes + } + } + + @IBInspectable + public + var scanColor:UIColor = UIColor.greenColor(){ didSet{ scanView?.scanColor = scanColor } } + + public + var transparentArea = CGRectZero{ + didSet{ + print("disSet transparentArea to \(transparentArea)") + scanView?.transparentArea = transparentArea + output.rectOfInterest = CGRectMake(transparentArea.origin.y/view.frame.height, + transparentArea.origin.x/view.frame.width, + transparentArea.height/view.frame.height, + transparentArea.width/view.frame.width) + } + } + + + override public func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = UIColor.clearColor() + + let device = AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeVideo) + + do { + input = try AVCaptureDeviceInput(device: device) + }catch let error as NSError{ + print("WJScanViewController : \n \(error.localizedDescription)") + return + } + + output.setMetadataObjectsDelegate(self, queue: dispatch_get_main_queue()) + + session.sessionPreset = AVCaptureSessionPresetHigh + session.addInput(input) + session.addOutput(output) + output.metadataObjectTypes = metadataObjectTypes + + let preview = AVCaptureVideoPreviewLayer(session: session) + preview.videoGravity = AVLayerVideoGravityResize + preview.frame = view.bounds + view.layer.insertSublayer(preview, atIndex: 0) + session.startRunning() + + scanView = WJScanView(frame: view.bounds) + scanView!.scanColor = scanColor + view.insertSubview(scanView!, atIndex: 1) + + //congifure transparentArea + if transparentArea == CGRectZero{ + transparentArea = CGRect(x: view.center.x-100, y: view.center.y-100, width: 200, height: 200) + }else{ + let rect = transparentArea + transparentArea = rect + } + } + + override public func viewDidAppear(animated: Bool) { + if input == nil{ + handleCameraWithoutAuth() + } + } + + //override in your subclass + public func captureOutput(captureOutput: AVCaptureOutput!, didOutputMetadataObjects metadataObjects: [AnyObject]!, fromConnection connection: AVCaptureConnection!) { + print("11") + if let metadataObject = metadataObjects.first { + let stringValue = (metadataObject as! AVMetadataMachineReadableCodeObject).stringValue + print(stringValue) + } + } + + //Lock Orientations to Portrait + public override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask { + return .Portrait + } + + //access to camera denied + public func handleCameraWithoutAuth(){ + print("handleCameraWithoutAuth") + } + + +} diff --git a/grocery/grocery.xcodeproj/project.pbxproj b/grocery/grocery.xcodeproj/project.pbxproj new file mode 100644 index 0000000..3d66589 --- /dev/null +++ b/grocery/grocery.xcodeproj/project.pbxproj @@ -0,0 +1,587 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 61E6A9A0B8A42CF66F1ECE3A /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BFC517E8A0EDB26FCD66046E /* Pods.framework */; }; + F0F628DB1C4D7EE000CCC9C7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0F628DA1C4D7EE000CCC9C7 /* AppDelegate.swift */; }; + F0F628DD1C4D7EE000CCC9C7 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0F628DC1C4D7EE000CCC9C7 /* ViewController.swift */; }; + F0F628E01C4D7EE000CCC9C7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F0F628DE1C4D7EE000CCC9C7 /* Main.storyboard */; }; + F0F628E21C4D7EE000CCC9C7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F0F628E11C4D7EE000CCC9C7 /* Assets.xcassets */; }; + F0F628E51C4D7EE000CCC9C7 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F0F628E31C4D7EE000CCC9C7 /* LaunchScreen.storyboard */; }; + F0F628F01C4D7EE000CCC9C7 /* groceryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0F628EF1C4D7EE000CCC9C7 /* groceryTests.swift */; }; + F0F628FB1C4D7EE000CCC9C7 /* groceryUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0F628FA1C4D7EE000CCC9C7 /* groceryUITests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + F0F628EC1C4D7EE000CCC9C7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F0F628CF1C4D7EE000CCC9C7 /* Project object */; + proxyType = 1; + remoteGlobalIDString = F0F628D61C4D7EE000CCC9C7; + remoteInfo = grocery; + }; + F0F628F71C4D7EE000CCC9C7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F0F628CF1C4D7EE000CCC9C7 /* Project object */; + proxyType = 1; + remoteGlobalIDString = F0F628D61C4D7EE000CCC9C7; + remoteInfo = grocery; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + BA7E5730541981252CA2EE9F /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + BFC517E8A0EDB26FCD66046E /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F0F628D71C4D7EE000CCC9C7 /* grocery.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = grocery.app; sourceTree = BUILT_PRODUCTS_DIR; }; + F0F628DA1C4D7EE000CCC9C7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + F0F628DC1C4D7EE000CCC9C7 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + F0F628DF1C4D7EE000CCC9C7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + F0F628E11C4D7EE000CCC9C7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + F0F628E41C4D7EE000CCC9C7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + F0F628E61C4D7EE000CCC9C7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F0F628EB1C4D7EE000CCC9C7 /* groceryTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = groceryTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + F0F628EF1C4D7EE000CCC9C7 /* groceryTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = groceryTests.swift; sourceTree = ""; }; + F0F628F11C4D7EE000CCC9C7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F0F628F61C4D7EE000CCC9C7 /* groceryUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = groceryUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + F0F628FA1C4D7EE000CCC9C7 /* groceryUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = groceryUITests.swift; sourceTree = ""; }; + F0F628FC1C4D7EE000CCC9C7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FF26647F01B85ADBDB8DAB81 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + F0F628D41C4D7EE000CCC9C7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 61E6A9A0B8A42CF66F1ECE3A /* Pods.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F0F628E81C4D7EE000CCC9C7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F0F628F31C4D7EE000CCC9C7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8A08B11933896B7EFF8A6B3B /* Frameworks */ = { + isa = PBXGroup; + children = ( + BFC517E8A0EDB26FCD66046E /* Pods.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 9A7D9675068E0594FC91739F /* Pods */ = { + isa = PBXGroup; + children = ( + BA7E5730541981252CA2EE9F /* Pods.debug.xcconfig */, + FF26647F01B85ADBDB8DAB81 /* Pods.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + F0F628CE1C4D7EE000CCC9C7 = { + isa = PBXGroup; + children = ( + F0F628D91C4D7EE000CCC9C7 /* grocery */, + F0F628EE1C4D7EE000CCC9C7 /* groceryTests */, + F0F628F91C4D7EE000CCC9C7 /* groceryUITests */, + F0F628D81C4D7EE000CCC9C7 /* Products */, + 9A7D9675068E0594FC91739F /* Pods */, + 8A08B11933896B7EFF8A6B3B /* Frameworks */, + ); + sourceTree = ""; + }; + F0F628D81C4D7EE000CCC9C7 /* Products */ = { + isa = PBXGroup; + children = ( + F0F628D71C4D7EE000CCC9C7 /* grocery.app */, + F0F628EB1C4D7EE000CCC9C7 /* groceryTests.xctest */, + F0F628F61C4D7EE000CCC9C7 /* groceryUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + F0F628D91C4D7EE000CCC9C7 /* grocery */ = { + isa = PBXGroup; + children = ( + F0F628DA1C4D7EE000CCC9C7 /* AppDelegate.swift */, + F0F628DC1C4D7EE000CCC9C7 /* ViewController.swift */, + F0F628DE1C4D7EE000CCC9C7 /* Main.storyboard */, + F0F628E11C4D7EE000CCC9C7 /* Assets.xcassets */, + F0F628E31C4D7EE000CCC9C7 /* LaunchScreen.storyboard */, + F0F628E61C4D7EE000CCC9C7 /* Info.plist */, + ); + path = grocery; + sourceTree = ""; + }; + F0F628EE1C4D7EE000CCC9C7 /* groceryTests */ = { + isa = PBXGroup; + children = ( + F0F628EF1C4D7EE000CCC9C7 /* groceryTests.swift */, + F0F628F11C4D7EE000CCC9C7 /* Info.plist */, + ); + path = groceryTests; + sourceTree = ""; + }; + F0F628F91C4D7EE000CCC9C7 /* groceryUITests */ = { + isa = PBXGroup; + children = ( + F0F628FA1C4D7EE000CCC9C7 /* groceryUITests.swift */, + F0F628FC1C4D7EE000CCC9C7 /* Info.plist */, + ); + path = groceryUITests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + F0F628D61C4D7EE000CCC9C7 /* grocery */ = { + isa = PBXNativeTarget; + buildConfigurationList = F0F628FF1C4D7EE000CCC9C7 /* Build configuration list for PBXNativeTarget "grocery" */; + buildPhases = ( + 5E1C0B70EE3CE0F53E937986 /* Check Pods Manifest.lock */, + F0F628D31C4D7EE000CCC9C7 /* Sources */, + F0F628D41C4D7EE000CCC9C7 /* Frameworks */, + F0F628D51C4D7EE000CCC9C7 /* Resources */, + 4CBABCF65B84AEBD6143999D /* Embed Pods Frameworks */, + 6B403568856A7887E97D13C9 /* Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = grocery; + productName = grocery; + productReference = F0F628D71C4D7EE000CCC9C7 /* grocery.app */; + productType = "com.apple.product-type.application"; + }; + F0F628EA1C4D7EE000CCC9C7 /* groceryTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = F0F629021C4D7EE000CCC9C7 /* Build configuration list for PBXNativeTarget "groceryTests" */; + buildPhases = ( + F0F628E71C4D7EE000CCC9C7 /* Sources */, + F0F628E81C4D7EE000CCC9C7 /* Frameworks */, + F0F628E91C4D7EE000CCC9C7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + F0F628ED1C4D7EE000CCC9C7 /* PBXTargetDependency */, + ); + name = groceryTests; + productName = groceryTests; + productReference = F0F628EB1C4D7EE000CCC9C7 /* groceryTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + F0F628F51C4D7EE000CCC9C7 /* groceryUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = F0F629051C4D7EE000CCC9C7 /* Build configuration list for PBXNativeTarget "groceryUITests" */; + buildPhases = ( + F0F628F21C4D7EE000CCC9C7 /* Sources */, + F0F628F31C4D7EE000CCC9C7 /* Frameworks */, + F0F628F41C4D7EE000CCC9C7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + F0F628F81C4D7EE000CCC9C7 /* PBXTargetDependency */, + ); + name = groceryUITests; + productName = groceryUITests; + productReference = F0F628F61C4D7EE000CCC9C7 /* groceryUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + F0F628CF1C4D7EE000CCC9C7 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0710; + LastUpgradeCheck = 0710; + ORGANIZATIONNAME = "Henna Ahmed"; + TargetAttributes = { + F0F628D61C4D7EE000CCC9C7 = { + CreatedOnToolsVersion = 7.1; + }; + F0F628EA1C4D7EE000CCC9C7 = { + CreatedOnToolsVersion = 7.1; + TestTargetID = F0F628D61C4D7EE000CCC9C7; + }; + F0F628F51C4D7EE000CCC9C7 = { + CreatedOnToolsVersion = 7.1; + TestTargetID = F0F628D61C4D7EE000CCC9C7; + }; + }; + }; + buildConfigurationList = F0F628D21C4D7EE000CCC9C7 /* Build configuration list for PBXProject "grocery" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = F0F628CE1C4D7EE000CCC9C7; + productRefGroup = F0F628D81C4D7EE000CCC9C7 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + F0F628D61C4D7EE000CCC9C7 /* grocery */, + F0F628EA1C4D7EE000CCC9C7 /* groceryTests */, + F0F628F51C4D7EE000CCC9C7 /* groceryUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + F0F628D51C4D7EE000CCC9C7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F0F628E51C4D7EE000CCC9C7 /* LaunchScreen.storyboard in Resources */, + F0F628E21C4D7EE000CCC9C7 /* Assets.xcassets in Resources */, + F0F628E01C4D7EE000CCC9C7 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F0F628E91C4D7EE000CCC9C7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F0F628F41C4D7EE000CCC9C7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 4CBABCF65B84AEBD6143999D /* Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 5E1C0B70EE3CE0F53E937986 /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + 6B403568856A7887E97D13C9 /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + F0F628D31C4D7EE000CCC9C7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F0F628DD1C4D7EE000CCC9C7 /* ViewController.swift in Sources */, + F0F628DB1C4D7EE000CCC9C7 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F0F628E71C4D7EE000CCC9C7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F0F628F01C4D7EE000CCC9C7 /* groceryTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F0F628F21C4D7EE000CCC9C7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F0F628FB1C4D7EE000CCC9C7 /* groceryUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + F0F628ED1C4D7EE000CCC9C7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F0F628D61C4D7EE000CCC9C7 /* grocery */; + targetProxy = F0F628EC1C4D7EE000CCC9C7 /* PBXContainerItemProxy */; + }; + F0F628F81C4D7EE000CCC9C7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F0F628D61C4D7EE000CCC9C7 /* grocery */; + targetProxy = F0F628F71C4D7EE000CCC9C7 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + F0F628DE1C4D7EE000CCC9C7 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + F0F628DF1C4D7EE000CCC9C7 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + F0F628E31C4D7EE000CCC9C7 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + F0F628E41C4D7EE000CCC9C7 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + F0F628FD1C4D7EE000CCC9C7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + F0F628FE1C4D7EE000CCC9C7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + F0F629001C4D7EE000CCC9C7 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BA7E5730541981252CA2EE9F /* Pods.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = grocery/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.xhenna92.grocery; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + F0F629011C4D7EE000CCC9C7 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FF26647F01B85ADBDB8DAB81 /* Pods.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = grocery/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.xhenna92.grocery; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + F0F629031C4D7EE000CCC9C7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = groceryTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.xhenna92.groceryTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/grocery.app/grocery"; + }; + name = Debug; + }; + F0F629041C4D7EE000CCC9C7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = groceryTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.xhenna92.groceryTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/grocery.app/grocery"; + }; + name = Release; + }; + F0F629061C4D7EE000CCC9C7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = groceryUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.xhenna92.groceryUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_TARGET_NAME = grocery; + USES_XCTRUNNER = YES; + }; + name = Debug; + }; + F0F629071C4D7EE000CCC9C7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = groceryUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.xhenna92.groceryUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_TARGET_NAME = grocery; + USES_XCTRUNNER = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + F0F628D21C4D7EE000CCC9C7 /* Build configuration list for PBXProject "grocery" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F0F628FD1C4D7EE000CCC9C7 /* Debug */, + F0F628FE1C4D7EE000CCC9C7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F0F628FF1C4D7EE000CCC9C7 /* Build configuration list for PBXNativeTarget "grocery" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F0F629001C4D7EE000CCC9C7 /* Debug */, + F0F629011C4D7EE000CCC9C7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F0F629021C4D7EE000CCC9C7 /* Build configuration list for PBXNativeTarget "groceryTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F0F629031C4D7EE000CCC9C7 /* Debug */, + F0F629041C4D7EE000CCC9C7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F0F629051C4D7EE000CCC9C7 /* Build configuration list for PBXNativeTarget "groceryUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F0F629061C4D7EE000CCC9C7 /* Debug */, + F0F629071C4D7EE000CCC9C7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = F0F628CF1C4D7EE000CCC9C7 /* Project object */; +} diff --git a/grocery/grocery.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/grocery/grocery.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..3200e34 --- /dev/null +++ b/grocery/grocery.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/grocery/grocery.xcodeproj/project.xcworkspace/xcuserdata/hennaahmed.xcuserdatad/UserInterfaceState.xcuserstate b/grocery/grocery.xcodeproj/project.xcworkspace/xcuserdata/hennaahmed.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..d9ac1b0 Binary files /dev/null and b/grocery/grocery.xcodeproj/project.xcworkspace/xcuserdata/hennaahmed.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/grocery/grocery.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/grocery.xcscheme b/grocery/grocery.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/grocery.xcscheme new file mode 100644 index 0000000..25bb51c --- /dev/null +++ b/grocery/grocery.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/grocery.xcscheme @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery/grocery.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/xcschememanagement.plist b/grocery/grocery.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..f25f991 --- /dev/null +++ b/grocery/grocery.xcodeproj/xcuserdata/hennaahmed.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,32 @@ + + + + + SchemeUserState + + grocery.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + F0F628D61C4D7EE000CCC9C7 + + primary + + + F0F628EA1C4D7EE000CCC9C7 + + primary + + + F0F628F51C4D7EE000CCC9C7 + + primary + + + + + diff --git a/grocery/grocery.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/grocery.xcscheme b/grocery/grocery.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/grocery.xcscheme new file mode 100644 index 0000000..dc21186 --- /dev/null +++ b/grocery/grocery.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/grocery.xcscheme @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery/grocery.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/xcschememanagement.plist b/grocery/grocery.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..f25f991 --- /dev/null +++ b/grocery/grocery.xcodeproj/xcuserdata/shenayoshida.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,32 @@ + + + + + SchemeUserState + + grocery.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + F0F628D61C4D7EE000CCC9C7 + + primary + + + F0F628EA1C4D7EE000CCC9C7 + + primary + + + F0F628F51C4D7EE000CCC9C7 + + primary + + + + + diff --git a/grocery/grocery.xcworkspace/contents.xcworkspacedata b/grocery/grocery.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..a5c410b --- /dev/null +++ b/grocery/grocery.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/grocery/grocery.xcworkspace/xcuserdata/shenayoshida.xcuserdatad/UserInterfaceState.xcuserstate b/grocery/grocery.xcworkspace/xcuserdata/shenayoshida.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..a649751 Binary files /dev/null and b/grocery/grocery.xcworkspace/xcuserdata/shenayoshida.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/grocery/grocery/AppDelegate.swift b/grocery/grocery/AppDelegate.swift new file mode 100644 index 0000000..51e4b4c --- /dev/null +++ b/grocery/grocery/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// grocery +// +// Created by Henna Ahmed on 1/18/16. +// Copyright © 2016 Henna Ahmed. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(application: UIApplication) { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/grocery/grocery/Assets.xcassets/AppIcon.appiconset/Contents.json b/grocery/grocery/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..36d2c80 --- /dev/null +++ b/grocery/grocery/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/grocery/grocery/Base.lproj/LaunchScreen.storyboard b/grocery/grocery/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..2e721e1 --- /dev/null +++ b/grocery/grocery/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery/grocery/Base.lproj/Main.storyboard b/grocery/grocery/Base.lproj/Main.storyboard new file mode 100644 index 0000000..e584bfa --- /dev/null +++ b/grocery/grocery/Base.lproj/Main.storyboard @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grocery/grocery/Info.plist b/grocery/grocery/Info.plist new file mode 100644 index 0000000..40c6215 --- /dev/null +++ b/grocery/grocery/Info.plist @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/grocery/grocery/ViewController.swift b/grocery/grocery/ViewController.swift new file mode 100644 index 0000000..d25124b --- /dev/null +++ b/grocery/grocery/ViewController.swift @@ -0,0 +1,25 @@ +// +// ViewController.swift +// grocery +// +// Created by Henna Ahmed on 1/18/16. +// Copyright © 2016 Henna Ahmed. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + +} + diff --git a/grocery/groceryTests/Info.plist b/grocery/groceryTests/Info.plist new file mode 100644 index 0000000..ba72822 --- /dev/null +++ b/grocery/groceryTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/grocery/groceryTests/groceryTests.swift b/grocery/groceryTests/groceryTests.swift new file mode 100644 index 0000000..7558001 --- /dev/null +++ b/grocery/groceryTests/groceryTests.swift @@ -0,0 +1,36 @@ +// +// groceryTests.swift +// groceryTests +// +// Created by Henna Ahmed on 1/18/16. +// Copyright © 2016 Henna Ahmed. All rights reserved. +// + +import XCTest +@testable import grocery + +class groceryTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measureBlock { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/grocery/groceryUITests/Info.plist b/grocery/groceryUITests/Info.plist new file mode 100644 index 0000000..ba72822 --- /dev/null +++ b/grocery/groceryUITests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/grocery/groceryUITests/groceryUITests.swift b/grocery/groceryUITests/groceryUITests.swift new file mode 100644 index 0000000..dc8d6eb --- /dev/null +++ b/grocery/groceryUITests/groceryUITests.swift @@ -0,0 +1,36 @@ +// +// groceryUITests.swift +// groceryUITests +// +// Created by Henna Ahmed on 1/18/16. +// Copyright © 2016 Henna Ahmed. All rights reserved. +// + +import XCTest + +class groceryUITests: XCTestCase { + + override func setUp() { + super.setUp() + + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. + XCUIApplication().launch() + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + +}