diff --git a/Example/Media.xcassets/price_on.imageset/Contents.json b/Example/Media.xcassets/allergen.imageset/Contents.json similarity index 70% rename from Example/Media.xcassets/price_on.imageset/Contents.json rename to Example/Media.xcassets/allergen.imageset/Contents.json index bf3f4e9..16e9e2b 100644 --- a/Example/Media.xcassets/price_on.imageset/Contents.json +++ b/Example/Media.xcassets/allergen.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "price_on.png", + "filename" : "allergen.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "price_on@2x.png", + "filename" : "allergen@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "price_on@3x.png", + "filename" : "allergen@3x.png", "scale" : "3x" } ], diff --git a/Example/Media.xcassets/allergen.imageset/allergen.png b/Example/Media.xcassets/allergen.imageset/allergen.png new file mode 100644 index 0000000..718ebc2 Binary files /dev/null and b/Example/Media.xcassets/allergen.imageset/allergen.png differ diff --git a/Example/Media.xcassets/allergen.imageset/allergen@2x.png b/Example/Media.xcassets/allergen.imageset/allergen@2x.png new file mode 100644 index 0000000..7bef115 Binary files /dev/null and b/Example/Media.xcassets/allergen.imageset/allergen@2x.png differ diff --git a/Example/Media.xcassets/allergen.imageset/allergen@3x.png b/Example/Media.xcassets/allergen.imageset/allergen@3x.png new file mode 100644 index 0000000..8589f5e Binary files /dev/null and b/Example/Media.xcassets/allergen.imageset/allergen@3x.png differ diff --git a/Example/Media.xcassets/allergen_highlighted.imageset/Contents.json b/Example/Media.xcassets/allergen_highlighted.imageset/Contents.json new file mode 100644 index 0000000..3f4ccd5 --- /dev/null +++ b/Example/Media.xcassets/allergen_highlighted.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "allergen_highlighted.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "allergen_highlighted@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "allergen_highlighted@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Media.xcassets/allergen_highlighted.imageset/allergen_highlighted.png b/Example/Media.xcassets/allergen_highlighted.imageset/allergen_highlighted.png new file mode 100644 index 0000000..a0f3a2f Binary files /dev/null and b/Example/Media.xcassets/allergen_highlighted.imageset/allergen_highlighted.png differ diff --git a/Example/Media.xcassets/allergen_highlighted.imageset/allergen_highlighted@2x.png b/Example/Media.xcassets/allergen_highlighted.imageset/allergen_highlighted@2x.png new file mode 100644 index 0000000..6135817 Binary files /dev/null and b/Example/Media.xcassets/allergen_highlighted.imageset/allergen_highlighted@2x.png differ diff --git a/Example/Media.xcassets/allergen_highlighted.imageset/allergen_highlighted@3x.png b/Example/Media.xcassets/allergen_highlighted.imageset/allergen_highlighted@3x.png new file mode 100644 index 0000000..ba717c7 Binary files /dev/null and b/Example/Media.xcassets/allergen_highlighted.imageset/allergen_highlighted@3x.png differ diff --git a/Example/Media.xcassets/allergen_off.imageset/allergen_off.png b/Example/Media.xcassets/allergen_off.imageset/allergen_off.png deleted file mode 100644 index 72b5a86..0000000 Binary files a/Example/Media.xcassets/allergen_off.imageset/allergen_off.png and /dev/null differ diff --git a/Example/Media.xcassets/allergen_off.imageset/allergen_off@2x.png b/Example/Media.xcassets/allergen_off.imageset/allergen_off@2x.png deleted file mode 100644 index 536cc2c..0000000 Binary files a/Example/Media.xcassets/allergen_off.imageset/allergen_off@2x.png and /dev/null differ diff --git a/Example/Media.xcassets/allergen_off.imageset/allergen_off@3x.png b/Example/Media.xcassets/allergen_off.imageset/allergen_off@3x.png deleted file mode 100644 index 6c2c8b7..0000000 Binary files a/Example/Media.xcassets/allergen_off.imageset/allergen_off@3x.png and /dev/null differ diff --git a/Example/Media.xcassets/allergen_on.imageset/allergen_on.png b/Example/Media.xcassets/allergen_on.imageset/allergen_on.png deleted file mode 100644 index 1bfce71..0000000 Binary files a/Example/Media.xcassets/allergen_on.imageset/allergen_on.png and /dev/null differ diff --git a/Example/Media.xcassets/allergen_on.imageset/allergen_on@2x.png b/Example/Media.xcassets/allergen_on.imageset/allergen_on@2x.png deleted file mode 100644 index 9993c56..0000000 Binary files a/Example/Media.xcassets/allergen_on.imageset/allergen_on@2x.png and /dev/null differ diff --git a/Example/Media.xcassets/allergen_on.imageset/allergen_on@3x.png b/Example/Media.xcassets/allergen_on.imageset/allergen_on@3x.png deleted file mode 100644 index 9f90b4a..0000000 Binary files a/Example/Media.xcassets/allergen_on.imageset/allergen_on@3x.png and /dev/null differ diff --git a/Example/Media.xcassets/calendar_on.imageset/Contents.json b/Example/Media.xcassets/allergen_selected.imageset/Contents.json similarity index 66% rename from Example/Media.xcassets/calendar_on.imageset/Contents.json rename to Example/Media.xcassets/allergen_selected.imageset/Contents.json index 92987e2..5546371 100644 --- a/Example/Media.xcassets/calendar_on.imageset/Contents.json +++ b/Example/Media.xcassets/allergen_selected.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "calendar_on.png", + "filename" : "allergen_selected.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "calendar_on@2x.png", + "filename" : "allergen_selected@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "calendar_on@3x.png", + "filename" : "allergen_selected@3x.png", "scale" : "3x" } ], diff --git a/Example/Media.xcassets/allergen_selected.imageset/allergen_selected.png b/Example/Media.xcassets/allergen_selected.imageset/allergen_selected.png new file mode 100644 index 0000000..96d2499 Binary files /dev/null and b/Example/Media.xcassets/allergen_selected.imageset/allergen_selected.png differ diff --git a/Example/Media.xcassets/allergen_selected.imageset/allergen_selected@2x.png b/Example/Media.xcassets/allergen_selected.imageset/allergen_selected@2x.png new file mode 100644 index 0000000..265ffa5 Binary files /dev/null and b/Example/Media.xcassets/allergen_selected.imageset/allergen_selected@2x.png differ diff --git a/Example/Media.xcassets/allergen_selected.imageset/allergen_selected@3x.png b/Example/Media.xcassets/allergen_selected.imageset/allergen_selected@3x.png new file mode 100644 index 0000000..cd77802 Binary files /dev/null and b/Example/Media.xcassets/allergen_selected.imageset/allergen_selected@3x.png differ diff --git a/Example/Media.xcassets/type_off.imageset/Contents.json b/Example/Media.xcassets/calendar.imageset/Contents.json similarity index 70% rename from Example/Media.xcassets/type_off.imageset/Contents.json rename to Example/Media.xcassets/calendar.imageset/Contents.json index eca5f95..7c6a116 100644 --- a/Example/Media.xcassets/type_off.imageset/Contents.json +++ b/Example/Media.xcassets/calendar.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "type_off.png", + "filename" : "calendar.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "type_off@2x.png", + "filename" : "calendar@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "type_off@3x.png", + "filename" : "calendar@3x.png", "scale" : "3x" } ], diff --git a/Example/Media.xcassets/calendar.imageset/calendar.png b/Example/Media.xcassets/calendar.imageset/calendar.png new file mode 100644 index 0000000..80f97f7 Binary files /dev/null and b/Example/Media.xcassets/calendar.imageset/calendar.png differ diff --git a/Example/Media.xcassets/calendar.imageset/calendar@2x.png b/Example/Media.xcassets/calendar.imageset/calendar@2x.png new file mode 100644 index 0000000..67b5ac7 Binary files /dev/null and b/Example/Media.xcassets/calendar.imageset/calendar@2x.png differ diff --git a/Example/Media.xcassets/calendar.imageset/calendar@3x.png b/Example/Media.xcassets/calendar.imageset/calendar@3x.png new file mode 100644 index 0000000..68c484a Binary files /dev/null and b/Example/Media.xcassets/calendar.imageset/calendar@3x.png differ diff --git a/Example/Media.xcassets/calendar_highlighted.imageset/Contents.json b/Example/Media.xcassets/calendar_highlighted.imageset/Contents.json new file mode 100644 index 0000000..2522dad --- /dev/null +++ b/Example/Media.xcassets/calendar_highlighted.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "calendar_highlighted.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "calendar_highlighted@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "calendar_highlighted@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Media.xcassets/calendar_highlighted.imageset/calendar_highlighted.png b/Example/Media.xcassets/calendar_highlighted.imageset/calendar_highlighted.png new file mode 100644 index 0000000..9b1b0f3 Binary files /dev/null and b/Example/Media.xcassets/calendar_highlighted.imageset/calendar_highlighted.png differ diff --git a/Example/Media.xcassets/calendar_highlighted.imageset/calendar_highlighted@2x.png b/Example/Media.xcassets/calendar_highlighted.imageset/calendar_highlighted@2x.png new file mode 100644 index 0000000..4df3a0b Binary files /dev/null and b/Example/Media.xcassets/calendar_highlighted.imageset/calendar_highlighted@2x.png differ diff --git a/Example/Media.xcassets/calendar_highlighted.imageset/calendar_highlighted@3x.png b/Example/Media.xcassets/calendar_highlighted.imageset/calendar_highlighted@3x.png new file mode 100644 index 0000000..283cba4 Binary files /dev/null and b/Example/Media.xcassets/calendar_highlighted.imageset/calendar_highlighted@3x.png differ diff --git a/Example/Media.xcassets/calendar_off.imageset/calendar_off.png b/Example/Media.xcassets/calendar_off.imageset/calendar_off.png deleted file mode 100644 index a9e2038..0000000 Binary files a/Example/Media.xcassets/calendar_off.imageset/calendar_off.png and /dev/null differ diff --git a/Example/Media.xcassets/calendar_off.imageset/calendar_off@2x.png b/Example/Media.xcassets/calendar_off.imageset/calendar_off@2x.png deleted file mode 100644 index b218fe7..0000000 Binary files a/Example/Media.xcassets/calendar_off.imageset/calendar_off@2x.png and /dev/null differ diff --git a/Example/Media.xcassets/calendar_off.imageset/calendar_off@3x.png b/Example/Media.xcassets/calendar_off.imageset/calendar_off@3x.png deleted file mode 100644 index 2bdb80a..0000000 Binary files a/Example/Media.xcassets/calendar_off.imageset/calendar_off@3x.png and /dev/null differ diff --git a/Example/Media.xcassets/calendar_on.imageset/calendar_on.png b/Example/Media.xcassets/calendar_on.imageset/calendar_on.png deleted file mode 100644 index 01f6cc9..0000000 Binary files a/Example/Media.xcassets/calendar_on.imageset/calendar_on.png and /dev/null differ diff --git a/Example/Media.xcassets/calendar_on.imageset/calendar_on@2x.png b/Example/Media.xcassets/calendar_on.imageset/calendar_on@2x.png deleted file mode 100644 index 3b75b31..0000000 Binary files a/Example/Media.xcassets/calendar_on.imageset/calendar_on@2x.png and /dev/null differ diff --git a/Example/Media.xcassets/calendar_on.imageset/calendar_on@3x.png b/Example/Media.xcassets/calendar_on.imageset/calendar_on@3x.png deleted file mode 100644 index 29131ae..0000000 Binary files a/Example/Media.xcassets/calendar_on.imageset/calendar_on@3x.png and /dev/null differ diff --git a/Example/Media.xcassets/calendar_selected.imageset/Contents.json b/Example/Media.xcassets/calendar_selected.imageset/Contents.json new file mode 100644 index 0000000..8af332a --- /dev/null +++ b/Example/Media.xcassets/calendar_selected.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "calendar_selected.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "calendar_selected@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "calendar_selected@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Media.xcassets/calendar_selected.imageset/calendar_selected.png b/Example/Media.xcassets/calendar_selected.imageset/calendar_selected.png new file mode 100644 index 0000000..16a31f0 Binary files /dev/null and b/Example/Media.xcassets/calendar_selected.imageset/calendar_selected.png differ diff --git a/Example/Media.xcassets/calendar_selected.imageset/calendar_selected@2x.png b/Example/Media.xcassets/calendar_selected.imageset/calendar_selected@2x.png new file mode 100644 index 0000000..be5b6e6 Binary files /dev/null and b/Example/Media.xcassets/calendar_selected.imageset/calendar_selected@2x.png differ diff --git a/Example/Media.xcassets/calendar_selected.imageset/calendar_selected@3x.png b/Example/Media.xcassets/calendar_selected.imageset/calendar_selected@3x.png new file mode 100644 index 0000000..d58e939 Binary files /dev/null and b/Example/Media.xcassets/calendar_selected.imageset/calendar_selected@3x.png differ diff --git a/Example/Media.xcassets/price_off.imageset/Contents.json b/Example/Media.xcassets/location.imageset/Contents.json similarity index 70% rename from Example/Media.xcassets/price_off.imageset/Contents.json rename to Example/Media.xcassets/location.imageset/Contents.json index e3607a0..66d3894 100644 --- a/Example/Media.xcassets/price_off.imageset/Contents.json +++ b/Example/Media.xcassets/location.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "price_off.png", + "filename" : "location.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "price_off@2x.png", + "filename" : "location@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "price_off@3x.png", + "filename" : "location@3x.png", "scale" : "3x" } ], diff --git a/Example/Media.xcassets/location.imageset/location.png b/Example/Media.xcassets/location.imageset/location.png new file mode 100644 index 0000000..fa52c04 Binary files /dev/null and b/Example/Media.xcassets/location.imageset/location.png differ diff --git a/Example/Media.xcassets/location.imageset/location@2x.png b/Example/Media.xcassets/location.imageset/location@2x.png new file mode 100644 index 0000000..bffaaea Binary files /dev/null and b/Example/Media.xcassets/location.imageset/location@2x.png differ diff --git a/Example/Media.xcassets/location.imageset/location@3x.png b/Example/Media.xcassets/location.imageset/location@3x.png new file mode 100644 index 0000000..0635eff Binary files /dev/null and b/Example/Media.xcassets/location.imageset/location@3x.png differ diff --git a/Example/Media.xcassets/location_highlighted.imageset/Contents.json b/Example/Media.xcassets/location_highlighted.imageset/Contents.json new file mode 100644 index 0000000..9195878 --- /dev/null +++ b/Example/Media.xcassets/location_highlighted.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "location_highlighted.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "location_highlighted@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "location_highlighted@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Media.xcassets/location_highlighted.imageset/location_highlighted.png b/Example/Media.xcassets/location_highlighted.imageset/location_highlighted.png new file mode 100644 index 0000000..9fffaa6 Binary files /dev/null and b/Example/Media.xcassets/location_highlighted.imageset/location_highlighted.png differ diff --git a/Example/Media.xcassets/location_highlighted.imageset/location_highlighted@2x.png b/Example/Media.xcassets/location_highlighted.imageset/location_highlighted@2x.png new file mode 100644 index 0000000..e97fd37 Binary files /dev/null and b/Example/Media.xcassets/location_highlighted.imageset/location_highlighted@2x.png differ diff --git a/Example/Media.xcassets/location_highlighted.imageset/location_highlighted@3x.png b/Example/Media.xcassets/location_highlighted.imageset/location_highlighted@3x.png new file mode 100644 index 0000000..686b87d Binary files /dev/null and b/Example/Media.xcassets/location_highlighted.imageset/location_highlighted@3x.png differ diff --git a/Example/Media.xcassets/location_off.imageset/Contents.json b/Example/Media.xcassets/location_off.imageset/Contents.json deleted file mode 100644 index c13a817..0000000 --- a/Example/Media.xcassets/location_off.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "location_off.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "location_off@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "location_off@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example/Media.xcassets/location_off.imageset/location_off.png b/Example/Media.xcassets/location_off.imageset/location_off.png deleted file mode 100644 index f3073a4..0000000 Binary files a/Example/Media.xcassets/location_off.imageset/location_off.png and /dev/null differ diff --git a/Example/Media.xcassets/location_off.imageset/location_off@2x.png b/Example/Media.xcassets/location_off.imageset/location_off@2x.png deleted file mode 100644 index f703dd5..0000000 Binary files a/Example/Media.xcassets/location_off.imageset/location_off@2x.png and /dev/null differ diff --git a/Example/Media.xcassets/location_off.imageset/location_off@3x.png b/Example/Media.xcassets/location_off.imageset/location_off@3x.png deleted file mode 100644 index ef9dc8f..0000000 Binary files a/Example/Media.xcassets/location_off.imageset/location_off@3x.png and /dev/null differ diff --git a/Example/Media.xcassets/location_on.imageset/Contents.json b/Example/Media.xcassets/location_on.imageset/Contents.json deleted file mode 100644 index c334d29..0000000 --- a/Example/Media.xcassets/location_on.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "location_on.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "location_on@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "location_on@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example/Media.xcassets/location_on.imageset/location_on.png b/Example/Media.xcassets/location_on.imageset/location_on.png deleted file mode 100644 index 4422523..0000000 Binary files a/Example/Media.xcassets/location_on.imageset/location_on.png and /dev/null differ diff --git a/Example/Media.xcassets/location_on.imageset/location_on@2x.png b/Example/Media.xcassets/location_on.imageset/location_on@2x.png deleted file mode 100644 index b873c27..0000000 Binary files a/Example/Media.xcassets/location_on.imageset/location_on@2x.png and /dev/null differ diff --git a/Example/Media.xcassets/location_on.imageset/location_on@3x.png b/Example/Media.xcassets/location_on.imageset/location_on@3x.png deleted file mode 100644 index e83788f..0000000 Binary files a/Example/Media.xcassets/location_on.imageset/location_on@3x.png and /dev/null differ diff --git a/Example/Media.xcassets/location_selected.imageset/Contents.json b/Example/Media.xcassets/location_selected.imageset/Contents.json new file mode 100644 index 0000000..266b9b2 --- /dev/null +++ b/Example/Media.xcassets/location_selected.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "location_selected.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "location_selected@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "location_selected@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Media.xcassets/location_selected.imageset/location_selected.png b/Example/Media.xcassets/location_selected.imageset/location_selected.png new file mode 100644 index 0000000..ba51ee5 Binary files /dev/null and b/Example/Media.xcassets/location_selected.imageset/location_selected.png differ diff --git a/Example/Media.xcassets/location_selected.imageset/location_selected@2x.png b/Example/Media.xcassets/location_selected.imageset/location_selected@2x.png new file mode 100644 index 0000000..b3ecb76 Binary files /dev/null and b/Example/Media.xcassets/location_selected.imageset/location_selected@2x.png differ diff --git a/Example/Media.xcassets/location_selected.imageset/location_selected@3x.png b/Example/Media.xcassets/location_selected.imageset/location_selected@3x.png new file mode 100644 index 0000000..40136d9 Binary files /dev/null and b/Example/Media.xcassets/location_selected.imageset/location_selected@3x.png differ diff --git a/Example/Media.xcassets/type_on.imageset/Contents.json b/Example/Media.xcassets/price.imageset/Contents.json similarity index 71% rename from Example/Media.xcassets/type_on.imageset/Contents.json rename to Example/Media.xcassets/price.imageset/Contents.json index 0ad095c..089f961 100644 --- a/Example/Media.xcassets/type_on.imageset/Contents.json +++ b/Example/Media.xcassets/price.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "type_on.png", + "filename" : "price.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "type_on@2x.png", + "filename" : "price@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "type_on@3x.png", + "filename" : "price@3x.png", "scale" : "3x" } ], diff --git a/Example/Media.xcassets/price.imageset/price.png b/Example/Media.xcassets/price.imageset/price.png new file mode 100644 index 0000000..cea95d7 Binary files /dev/null and b/Example/Media.xcassets/price.imageset/price.png differ diff --git a/Example/Media.xcassets/price.imageset/price@2x.png b/Example/Media.xcassets/price.imageset/price@2x.png new file mode 100644 index 0000000..cdb132b Binary files /dev/null and b/Example/Media.xcassets/price.imageset/price@2x.png differ diff --git a/Example/Media.xcassets/price.imageset/price@3x.png b/Example/Media.xcassets/price.imageset/price@3x.png new file mode 100644 index 0000000..210734e Binary files /dev/null and b/Example/Media.xcassets/price.imageset/price@3x.png differ diff --git a/Example/Media.xcassets/price_highlighted.imageset/Contents.json b/Example/Media.xcassets/price_highlighted.imageset/Contents.json new file mode 100644 index 0000000..f635a5c --- /dev/null +++ b/Example/Media.xcassets/price_highlighted.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "price_highlighted.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "price_highlighted@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "price_highlighted@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Media.xcassets/price_highlighted.imageset/price_highlighted.png b/Example/Media.xcassets/price_highlighted.imageset/price_highlighted.png new file mode 100644 index 0000000..a63b16c Binary files /dev/null and b/Example/Media.xcassets/price_highlighted.imageset/price_highlighted.png differ diff --git a/Example/Media.xcassets/price_highlighted.imageset/price_highlighted@2x.png b/Example/Media.xcassets/price_highlighted.imageset/price_highlighted@2x.png new file mode 100644 index 0000000..c05f3b6 Binary files /dev/null and b/Example/Media.xcassets/price_highlighted.imageset/price_highlighted@2x.png differ diff --git a/Example/Media.xcassets/price_highlighted.imageset/price_highlighted@3x.png b/Example/Media.xcassets/price_highlighted.imageset/price_highlighted@3x.png new file mode 100644 index 0000000..2c3a2e4 Binary files /dev/null and b/Example/Media.xcassets/price_highlighted.imageset/price_highlighted@3x.png differ diff --git a/Example/Media.xcassets/price_off.imageset/price_off.png b/Example/Media.xcassets/price_off.imageset/price_off.png deleted file mode 100644 index 7c1e222..0000000 Binary files a/Example/Media.xcassets/price_off.imageset/price_off.png and /dev/null differ diff --git a/Example/Media.xcassets/price_off.imageset/price_off@2x.png b/Example/Media.xcassets/price_off.imageset/price_off@2x.png deleted file mode 100644 index 85853ee..0000000 Binary files a/Example/Media.xcassets/price_off.imageset/price_off@2x.png and /dev/null differ diff --git a/Example/Media.xcassets/price_off.imageset/price_off@3x.png b/Example/Media.xcassets/price_off.imageset/price_off@3x.png deleted file mode 100644 index b9b70e1..0000000 Binary files a/Example/Media.xcassets/price_off.imageset/price_off@3x.png and /dev/null differ diff --git a/Example/Media.xcassets/price_on.imageset/price_on.png b/Example/Media.xcassets/price_on.imageset/price_on.png deleted file mode 100644 index d0b0ea3..0000000 Binary files a/Example/Media.xcassets/price_on.imageset/price_on.png and /dev/null differ diff --git a/Example/Media.xcassets/price_on.imageset/price_on@2x.png b/Example/Media.xcassets/price_on.imageset/price_on@2x.png deleted file mode 100644 index 35b88d5..0000000 Binary files a/Example/Media.xcassets/price_on.imageset/price_on@2x.png and /dev/null differ diff --git a/Example/Media.xcassets/price_on.imageset/price_on@3x.png b/Example/Media.xcassets/price_on.imageset/price_on@3x.png deleted file mode 100644 index dfc8e5b..0000000 Binary files a/Example/Media.xcassets/price_on.imageset/price_on@3x.png and /dev/null differ diff --git a/Example/Media.xcassets/allergen_on.imageset/Contents.json b/Example/Media.xcassets/price_selected.imageset/Contents.json similarity index 67% rename from Example/Media.xcassets/allergen_on.imageset/Contents.json rename to Example/Media.xcassets/price_selected.imageset/Contents.json index fefa164..3f6398b 100644 --- a/Example/Media.xcassets/allergen_on.imageset/Contents.json +++ b/Example/Media.xcassets/price_selected.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "allergen_on.png", + "filename" : "price_selected.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "allergen_on@2x.png", + "filename" : "price_selected@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "allergen_on@3x.png", + "filename" : "price_selected@3x.png", "scale" : "3x" } ], diff --git a/Example/Media.xcassets/price_selected.imageset/price_selected.png b/Example/Media.xcassets/price_selected.imageset/price_selected.png new file mode 100644 index 0000000..37b6aba Binary files /dev/null and b/Example/Media.xcassets/price_selected.imageset/price_selected.png differ diff --git a/Example/Media.xcassets/price_selected.imageset/price_selected@2x.png b/Example/Media.xcassets/price_selected.imageset/price_selected@2x.png new file mode 100644 index 0000000..01ae7cc Binary files /dev/null and b/Example/Media.xcassets/price_selected.imageset/price_selected@2x.png differ diff --git a/Example/Media.xcassets/price_selected.imageset/price_selected@3x.png b/Example/Media.xcassets/price_selected.imageset/price_selected@3x.png new file mode 100644 index 0000000..b3c9133 Binary files /dev/null and b/Example/Media.xcassets/price_selected.imageset/price_selected@3x.png differ diff --git a/Example/Media.xcassets/type.imageset/Contents.json b/Example/Media.xcassets/type.imageset/Contents.json new file mode 100644 index 0000000..7599749 --- /dev/null +++ b/Example/Media.xcassets/type.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "type.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "type@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "type@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Media.xcassets/type.imageset/type.png b/Example/Media.xcassets/type.imageset/type.png new file mode 100644 index 0000000..346ec27 Binary files /dev/null and b/Example/Media.xcassets/type.imageset/type.png differ diff --git a/Example/Media.xcassets/type.imageset/type@2x.png b/Example/Media.xcassets/type.imageset/type@2x.png new file mode 100644 index 0000000..cbc933e Binary files /dev/null and b/Example/Media.xcassets/type.imageset/type@2x.png differ diff --git a/Example/Media.xcassets/type.imageset/type@3x.png b/Example/Media.xcassets/type.imageset/type@3x.png new file mode 100644 index 0000000..9781115 Binary files /dev/null and b/Example/Media.xcassets/type.imageset/type@3x.png differ diff --git a/Example/Media.xcassets/calendar_off.imageset/Contents.json b/Example/Media.xcassets/type_highlighted.imageset/Contents.json similarity index 66% rename from Example/Media.xcassets/calendar_off.imageset/Contents.json rename to Example/Media.xcassets/type_highlighted.imageset/Contents.json index c06110c..b8cd512 100644 --- a/Example/Media.xcassets/calendar_off.imageset/Contents.json +++ b/Example/Media.xcassets/type_highlighted.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "calendar_off.png", + "filename" : "type_highlighted.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "calendar_off@2x.png", + "filename" : "type_highlighted@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "calendar_off@3x.png", + "filename" : "type_highlighted@3x.png", "scale" : "3x" } ], diff --git a/Example/Media.xcassets/type_highlighted.imageset/type_highlighted.png b/Example/Media.xcassets/type_highlighted.imageset/type_highlighted.png new file mode 100644 index 0000000..e863137 Binary files /dev/null and b/Example/Media.xcassets/type_highlighted.imageset/type_highlighted.png differ diff --git a/Example/Media.xcassets/type_highlighted.imageset/type_highlighted@2x.png b/Example/Media.xcassets/type_highlighted.imageset/type_highlighted@2x.png new file mode 100644 index 0000000..c8cb97e Binary files /dev/null and b/Example/Media.xcassets/type_highlighted.imageset/type_highlighted@2x.png differ diff --git a/Example/Media.xcassets/type_highlighted.imageset/type_highlighted@3x.png b/Example/Media.xcassets/type_highlighted.imageset/type_highlighted@3x.png new file mode 100644 index 0000000..f963a8a Binary files /dev/null and b/Example/Media.xcassets/type_highlighted.imageset/type_highlighted@3x.png differ diff --git a/Example/Media.xcassets/type_off.imageset/type_off.png b/Example/Media.xcassets/type_off.imageset/type_off.png deleted file mode 100644 index 3647349..0000000 Binary files a/Example/Media.xcassets/type_off.imageset/type_off.png and /dev/null differ diff --git a/Example/Media.xcassets/type_off.imageset/type_off@2x.png b/Example/Media.xcassets/type_off.imageset/type_off@2x.png deleted file mode 100644 index c2b90bc..0000000 Binary files a/Example/Media.xcassets/type_off.imageset/type_off@2x.png and /dev/null differ diff --git a/Example/Media.xcassets/type_off.imageset/type_off@3x.png b/Example/Media.xcassets/type_off.imageset/type_off@3x.png deleted file mode 100644 index 070d4ef..0000000 Binary files a/Example/Media.xcassets/type_off.imageset/type_off@3x.png and /dev/null differ diff --git a/Example/Media.xcassets/type_on.imageset/type_on.png b/Example/Media.xcassets/type_on.imageset/type_on.png deleted file mode 100644 index 4d0d030..0000000 Binary files a/Example/Media.xcassets/type_on.imageset/type_on.png and /dev/null differ diff --git a/Example/Media.xcassets/type_on.imageset/type_on@2x.png b/Example/Media.xcassets/type_on.imageset/type_on@2x.png deleted file mode 100644 index 45ee1f0..0000000 Binary files a/Example/Media.xcassets/type_on.imageset/type_on@2x.png and /dev/null differ diff --git a/Example/Media.xcassets/type_on.imageset/type_on@3x.png b/Example/Media.xcassets/type_on.imageset/type_on@3x.png deleted file mode 100644 index 6563613..0000000 Binary files a/Example/Media.xcassets/type_on.imageset/type_on@3x.png and /dev/null differ diff --git a/Example/Media.xcassets/allergen_off.imageset/Contents.json b/Example/Media.xcassets/type_selected.imageset/Contents.json similarity index 68% rename from Example/Media.xcassets/allergen_off.imageset/Contents.json rename to Example/Media.xcassets/type_selected.imageset/Contents.json index 1d615c4..e5b7ebf 100644 --- a/Example/Media.xcassets/allergen_off.imageset/Contents.json +++ b/Example/Media.xcassets/type_selected.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "allergen_off.png", + "filename" : "type_selected.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "allergen_off@2x.png", + "filename" : "type_selected@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "allergen_off@3x.png", + "filename" : "type_selected@3x.png", "scale" : "3x" } ], diff --git a/Example/Media.xcassets/type_selected.imageset/type_selected.png b/Example/Media.xcassets/type_selected.imageset/type_selected.png new file mode 100644 index 0000000..81e66e3 Binary files /dev/null and b/Example/Media.xcassets/type_selected.imageset/type_selected.png differ diff --git a/Example/Media.xcassets/type_selected.imageset/type_selected@2x.png b/Example/Media.xcassets/type_selected.imageset/type_selected@2x.png new file mode 100644 index 0000000..5b5bbdf Binary files /dev/null and b/Example/Media.xcassets/type_selected.imageset/type_selected@2x.png differ diff --git a/Example/Media.xcassets/type_selected.imageset/type_selected@3x.png b/Example/Media.xcassets/type_selected.imageset/type_selected@3x.png new file mode 100644 index 0000000..e6342e8 Binary files /dev/null and b/Example/Media.xcassets/type_selected.imageset/type_selected@3x.png differ diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index 63469f4..2c57e0c 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -44,6 +44,10 @@ 610E3F00DD9A11CF2B3AB4ACDF9F2C88 /* ALView+PureLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F1993462D9F57783E626EE12A22DA6E /* ALView+PureLayout.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; 62AF98DE098B6AE453132CE1AA19765E /* POPDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = EB6215B243DFD151285F9B12CE2368A2 /* POPDefines.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6354BF1C514445C33F9B65DD18205535 /* NSArray+PureLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 913E7306AD4E255661D418473382CF54 /* NSArray+PureLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 688F8F6C1B7515A7008E28C8 /* UIButton+BackgroundColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 688F8F681B7515A7008E28C8 /* UIButton+BackgroundColor.h */; }; + 688F8F6D1B7515A7008E28C8 /* UIButton+BackgroundColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 688F8F691B7515A7008E28C8 /* UIButton+BackgroundColor.m */; }; + 688F8F6E1B7515A7008E28C8 /* UIImage+Color.h in Headers */ = {isa = PBXBuildFile; fileRef = 688F8F6A1B7515A7008E28C8 /* UIImage+Color.h */; }; + 688F8F6F1B7515A7008E28C8 /* UIImage+Color.m in Sources */ = {isa = PBXBuildFile; fileRef = 688F8F6B1B7515A7008E28C8 /* UIImage+Color.m */; }; 6BFFC7205011A11472F6457F6D6B489C /* POPAnimation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 24FD90CF8C651053BFFF6A3EAF117125 /* POPAnimation.mm */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; 6C4B81E2699A8266AAB7C85824999897 /* POPSpringAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = A103939D06A87FED0BE43F0CF5F5056A /* POPSpringAnimation.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6DBFBBAB5805C21D1665893E655EA4FD /* POPDecayAnimationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 0092F18589478DBE2AE13D966D9CCD17 /* POPDecayAnimationInternal.h */; settings = {ATTRIBUTES = (Project, ); }; }; @@ -216,6 +220,10 @@ 63FCE3E65371359592CB606E1790BC86 /* POPLayerExtras.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = POPLayerExtras.h; path = pop/POPLayerExtras.h; sourceTree = ""; }; 6474C99DA6F95FB4A031EA234BA3CF12 /* POPPropertyAnimation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = POPPropertyAnimation.h; path = pop/POPPropertyAnimation.h; sourceTree = ""; }; 6805F6C4A24C2AAAB6A33C0A97652E03 /* POPAnimation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = POPAnimation.h; path = pop/POPAnimation.h; sourceTree = ""; }; + 688F8F681B7515A7008E28C8 /* UIButton+BackgroundColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+BackgroundColor.h"; sourceTree = ""; }; + 688F8F691B7515A7008E28C8 /* UIButton+BackgroundColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+BackgroundColor.m"; sourceTree = ""; }; + 688F8F6A1B7515A7008E28C8 /* UIImage+Color.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+Color.h"; sourceTree = ""; }; + 688F8F6B1B7515A7008E28C8 /* UIImage+Color.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Color.m"; sourceTree = ""; }; 6A74066159202FC8BA84394854A1116D /* MMCPSScrollView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = MMCPSScrollView.h; sourceTree = ""; }; 6E05779740DB7A4882324BB0CC77FE83 /* PureLayout.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = PureLayout.h; path = PureLayout/PureLayout/PureLayout.h; sourceTree = ""; }; 73CE6B07292175B9D39CBFFC0DB41A60 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -396,6 +404,7 @@ children = ( 977370A91AC8B677022217B6F7096E4E /* MMCPSScrollView */, FFBEFBD8E8214E18E4714B2658CAC8CB /* NSString+HexColor */, + 688F8F671B7515A7008E28C8 /* UIButton+BackgroundColor */, ); path = Vendor; sourceTree = ""; @@ -486,6 +495,17 @@ path = "Target Support Files/Pods-TabBarPicker_Example"; sourceTree = ""; }; + 688F8F671B7515A7008E28C8 /* UIButton+BackgroundColor */ = { + isa = PBXGroup; + children = ( + 688F8F681B7515A7008E28C8 /* UIButton+BackgroundColor.h */, + 688F8F691B7515A7008E28C8 /* UIButton+BackgroundColor.m */, + 688F8F6A1B7515A7008E28C8 /* UIImage+Color.h */, + 688F8F6B1B7515A7008E28C8 /* UIImage+Color.m */, + ); + path = "UIButton+BackgroundColor"; + sourceTree = ""; + }; 7DB346D0F39D3F0E887471402A8071AB = { isa = PBXGroup; children = ( @@ -719,7 +739,9 @@ A1F2D95F436714051CFE1601C09ACAE9 /* NSString+HexColor.h in Headers */, 3FC1CA95A408FA5E1A57AC93B0C8A988 /* TabBarItem.h in Headers */, DF28F428A637429E12D16D55801D4916 /* TabBarPicker-umbrella.h in Headers */, + 688F8F6C1B7515A7008E28C8 /* UIButton+BackgroundColor.h in Headers */, C83D6A4F894219C63C6ED47E108D3EB3 /* TabBarPicker.h in Headers */, + 688F8F6E1B7515A7008E28C8 /* UIImage+Color.h in Headers */, 7391D8870EF96C08872561E1821F1085 /* TabBarPickerSubItemsView.h in Headers */, 860781420B1293C292A4A3D52E9F50F0 /* TabBarSubItem.h in Headers */, ); @@ -1076,10 +1098,12 @@ buildActionMask = 2147483647; files = ( 7DDBA8DBAAFFC333C9196889504A8897 /* MMCPSScrollView.m in Sources */, + 688F8F6D1B7515A7008E28C8 /* UIButton+BackgroundColor.m in Sources */, D6B77498010DFE75E70431CBF7896FCC /* NSString+HexColor.m in Sources */, 4878C076CDFE4C3EA1F69EA060123C59 /* TabBarItem.m in Sources */, 6F1FE5900883A92AFA28F808B14E8726 /* TabBarPicker-dummy.m in Sources */, B020FF612A093F9D08267D37E81E8A10 /* TabBarPicker.m in Sources */, + 688F8F6F1B7515A7008E28C8 /* UIImage+Color.m in Sources */, 787808E143D0036BA6D65469240A1653 /* TabBarPickerSubItemsView.m in Sources */, 2E7293FA79CA8E73693C7D7C838206AD /* TabBarSubItem.m in Sources */, ); diff --git a/Pod/Classes/TabBarItem.m b/Pod/Classes/TabBarItem.m index 82f8e14..008c862 100644 --- a/Pod/Classes/TabBarItem.m +++ b/Pod/Classes/TabBarItem.m @@ -9,7 +9,7 @@ #import "TabBarItem.h" #import #import "NSString+HexColor.h" -#import +#import "UIButton+BackgroundColor.h" @interface TabBarItem() @@ -83,19 +83,12 @@ - (void) setHighlightedColor:(UIColor *)highlightedColor { _highlightedColor = highlightedColor; - + [_itemButton setBackgroundColor:_highlightedColor forState:UIControlStateHighlighted]; } - (void) setHighlighted:(BOOL) highlighted { [_itemButton setHighlighted:highlighted]; - if ([_itemButton isHighlighted]) { - - [_itemButton setBackgroundColor:_highlightedColor]; - - } - else { - [_itemButton setBackgroundColor:[UIColor clearColor]]; - } + NSLog(@"%@",[NSNumber numberWithBool:[_itemButton isSelected]]); NSLog(@"%@",[NSNumber numberWithBool:[_itemButton isHighlighted]]); NSLog(@"%@",[NSNumber numberWithBool:[_itemButton isEnabled]]); @@ -103,14 +96,6 @@ } - (void) itemButtonTapped { - if ([_itemButton isHighlighted]) { - - [_itemButton setBackgroundColor:_highlightedColor]; - } - else { - [_itemButton setBackgroundColor:[UIColor clearColor]]; - } - if (_delegate && [_delegate respondsToSelector:@selector(tabBarItemSelected:)]) { [_delegate tabBarItemSelected:self]; } @@ -118,7 +103,7 @@ NSLog(@"%@",[NSNumber numberWithBool:[_itemButton isHighlighted]]); NSLog(@"%@",[NSNumber numberWithBool:[_itemButton isEnabled]]); NSLog(@"%ld",_itemButton.state); - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.002 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [_itemButton setHighlighted:YES]; }); } diff --git a/Pod/Classes/Vendor/UIButton+BackgroundColor/UIButton+BackgroundColor.h b/Pod/Classes/Vendor/UIButton+BackgroundColor/UIButton+BackgroundColor.h new file mode 100755 index 0000000..78f88de --- /dev/null +++ b/Pod/Classes/Vendor/UIButton+BackgroundColor/UIButton+BackgroundColor.h @@ -0,0 +1,15 @@ +// +// UIButton+BackgroundColor.h +// UIButton+BackgroundColor +// +// Created by Luu Gia Thuy on 7/28/15. +// Copyright (c) 2015 Luu Gia Thuy. All rights reserved. +// + +#import + +@interface UIButton (BackgroundColor) + +- (void)setBackgroundColor:(UIColor *)backgroundColor forState:(UIControlState)state UI_APPEARANCE_SELECTOR; + +@end diff --git a/Pod/Classes/Vendor/UIButton+BackgroundColor/UIButton+BackgroundColor.m b/Pod/Classes/Vendor/UIButton+BackgroundColor/UIButton+BackgroundColor.m new file mode 100755 index 0000000..0a7d3da --- /dev/null +++ b/Pod/Classes/Vendor/UIButton+BackgroundColor/UIButton+BackgroundColor.m @@ -0,0 +1,20 @@ +// +// UIButton+BackgroundColor.m +// UIButton+BackgroundColor +// +// Created by Luu Gia Thuy on 7/28/15. +// Copyright (c) 2015 Luu Gia Thuy. All rights reserved. +// + +#import "UIImage+Color.h" +#import "UIButton+BackgroundColor.h" + +@implementation UIButton (BackgroundColor) + +- (void)setBackgroundColor:(UIColor *)backgroundColor forState:(UIControlState)state { + [self setBackgroundImage:[UIImage imageWithColor:backgroundColor] forState:state]; +} + +@end + + diff --git a/Pod/Classes/Vendor/UIButton+BackgroundColor/UIImage+Color.h b/Pod/Classes/Vendor/UIButton+BackgroundColor/UIImage+Color.h new file mode 100755 index 0000000..38762d4 --- /dev/null +++ b/Pod/Classes/Vendor/UIButton+BackgroundColor/UIImage+Color.h @@ -0,0 +1,15 @@ +// +// UIImage+Color.h +// UIButton+BackgroundColor +// +// Created by Luu Gia Thuy on 7/28/15. +// +// + +#import + +@interface UIImage (Color) + ++ (UIImage *)imageWithColor:(UIColor *)color; + +@end diff --git a/Pod/Classes/Vendor/UIButton+BackgroundColor/UIImage+Color.m b/Pod/Classes/Vendor/UIButton+BackgroundColor/UIImage+Color.m new file mode 100755 index 0000000..040e5be --- /dev/null +++ b/Pod/Classes/Vendor/UIButton+BackgroundColor/UIImage+Color.m @@ -0,0 +1,27 @@ +// +// UIImage+Color.m +// UIButton+BackgroundColor +// +// Created by Luu Gia Thuy on 7/28/15. +// +// + +#import "UIImage+Color.h" + +@implementation UIImage (Color) + ++ (UIImage *)imageWithColor:(UIColor *)color { + CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f); + UIGraphicsBeginImageContext(rect.size); + CGContextRef context = UIGraphicsGetCurrentContext(); + + CGContextSetFillColorWithColor(context, [color CGColor]); + CGContextFillRect(context, rect); + + UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + + return image; +} + +@end