Commit 053fa6f6 by Daniel Dahan

updated TextField examples and internals

parent 18561324
...@@ -3,79 +3,79 @@ ...@@ -3,79 +3,79 @@
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x-1.png", "filename" : "MaterialKit-Icon-29@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@3x.png", "filename" : "MaterialKit-Icon-29@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x.png", "filename" : "MaterialKit-Icon-40@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@3x.png", "filename" : "MaterialKit-Icon-40@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@2x.png", "filename" : "MaterialKit-Icon-60@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@3x.png", "filename" : "MaterialKit-Icon-60@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29.png", "filename" : "MaterialKit-Icon-29.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x.png", "filename" : "MaterialKit-Icon-29@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40.png", "filename" : "MaterialKit-Icon-40.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x-1.png", "filename" : "MaterialKit-Icon-40@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76.png", "filename" : "MaterialKit-Icon-76.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76@2x.png", "filename" : "MaterialKit-Icon-76@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "83.5x83.5", "size" : "83.5x83.5",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-83.5@2x.png", "filename" : "MaterialKit-Icon-83.5@2x.png",
"scale" : "2x" "scale" : "2x"
} }
], ],
......
...@@ -3,79 +3,79 @@ ...@@ -3,79 +3,79 @@
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x-1.png", "filename" : "MaterialKit-Icon-29@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@3x.png", "filename" : "MaterialKit-Icon-29@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x.png", "filename" : "MaterialKit-Icon-40@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@3x.png", "filename" : "MaterialKit-Icon-40@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@2x.png", "filename" : "MaterialKit-Icon-60@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@3x.png", "filename" : "MaterialKit-Icon-60@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29.png", "filename" : "MaterialKit-Icon-29.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x.png", "filename" : "MaterialKit-Icon-29@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40.png", "filename" : "MaterialKit-Icon-40.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x-1.png", "filename" : "MaterialKit-Icon-40@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76.png", "filename" : "MaterialKit-Icon-76.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76@2x.png", "filename" : "MaterialKit-Icon-76@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "83.5x83.5", "size" : "83.5x83.5",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-83.5@2x.png", "filename" : "MaterialKit-Icon-83.5@2x.png",
"scale" : "2x" "scale" : "2x"
} }
], ],
......
...@@ -3,79 +3,79 @@ ...@@ -3,79 +3,79 @@
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x-1.png", "filename" : "MaterialKit-Icon-29@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@3x.png", "filename" : "MaterialKit-Icon-29@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x.png", "filename" : "MaterialKit-Icon-40@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@3x.png", "filename" : "MaterialKit-Icon-40@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@2x.png", "filename" : "MaterialKit-Icon-60@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@3x.png", "filename" : "MaterialKit-Icon-60@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29.png", "filename" : "MaterialKit-Icon-29.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x.png", "filename" : "MaterialKit-Icon-29@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40.png", "filename" : "MaterialKit-Icon-40.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x-1.png", "filename" : "MaterialKit-Icon-40@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76.png", "filename" : "MaterialKit-Icon-76.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76@2x.png", "filename" : "MaterialKit-Icon-76@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "83.5x83.5", "size" : "83.5x83.5",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-83.5@2x.png", "filename" : "MaterialKit-Icon-83.5@2x.png",
"scale" : "2x" "scale" : "2x"
} }
], ],
......
...@@ -3,79 +3,79 @@ ...@@ -3,79 +3,79 @@
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x-1.png", "filename" : "MaterialKit-Icon-29@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@3x.png", "filename" : "MaterialKit-Icon-29@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x.png", "filename" : "MaterialKit-Icon-40@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@3x.png", "filename" : "MaterialKit-Icon-40@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@2x.png", "filename" : "MaterialKit-Icon-60@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@3x.png", "filename" : "MaterialKit-Icon-60@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29.png", "filename" : "MaterialKit-Icon-29.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x.png", "filename" : "MaterialKit-Icon-29@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40.png", "filename" : "MaterialKit-Icon-40.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x-1.png", "filename" : "MaterialKit-Icon-40@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76.png", "filename" : "MaterialKit-Icon-76.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76@2x.png", "filename" : "MaterialKit-Icon-76@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "83.5x83.5", "size" : "83.5x83.5",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-83.5@2x.png", "filename" : "MaterialKit-Icon-83.5@2x.png",
"scale" : "2x" "scale" : "2x"
} }
], ],
......
...@@ -3,79 +3,79 @@ ...@@ -3,79 +3,79 @@
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x-1.png", "filename" : "MaterialKit-Icon-29@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@3x.png", "filename" : "MaterialKit-Icon-29@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x.png", "filename" : "MaterialKit-Icon-40@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@3x.png", "filename" : "MaterialKit-Icon-40@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@2x.png", "filename" : "MaterialKit-Icon-60@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@3x.png", "filename" : "MaterialKit-Icon-60@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29.png", "filename" : "MaterialKit-Icon-29.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x.png", "filename" : "MaterialKit-Icon-29@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40.png", "filename" : "MaterialKit-Icon-40.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x-1.png", "filename" : "MaterialKit-Icon-40@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76.png", "filename" : "MaterialKit-Icon-76.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76@2x.png", "filename" : "MaterialKit-Icon-76@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "83.5x83.5", "size" : "83.5x83.5",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-83.5@2x.png", "filename" : "MaterialKit-Icon-83.5@2x.png",
"scale" : "2x" "scale" : "2x"
} }
], ],
......
...@@ -3,79 +3,79 @@ ...@@ -3,79 +3,79 @@
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x-1.png", "filename" : "MaterialKit-Icon-29@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@3x.png", "filename" : "MaterialKit-Icon-29@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x.png", "filename" : "MaterialKit-Icon-40@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@3x.png", "filename" : "MaterialKit-Icon-40@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@2x.png", "filename" : "MaterialKit-Icon-60@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@3x.png", "filename" : "MaterialKit-Icon-60@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29.png", "filename" : "MaterialKit-Icon-29.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x.png", "filename" : "MaterialKit-Icon-29@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40.png", "filename" : "MaterialKit-Icon-40.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x-1.png", "filename" : "MaterialKit-Icon-40@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76.png", "filename" : "MaterialKit-Icon-76.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76@2x.png", "filename" : "MaterialKit-Icon-76@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "83.5x83.5", "size" : "83.5x83.5",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-83.5@2x.png", "filename" : "MaterialKit-Icon-83.5@2x.png",
"scale" : "2x" "scale" : "2x"
} }
], ],
......
...@@ -3,79 +3,79 @@ ...@@ -3,79 +3,79 @@
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x-1.png", "filename" : "MaterialKit-Icon-29@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@3x.png", "filename" : "MaterialKit-Icon-29@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x.png", "filename" : "MaterialKit-Icon-40@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@3x.png", "filename" : "MaterialKit-Icon-40@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@2x.png", "filename" : "MaterialKit-Icon-60@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@3x.png", "filename" : "MaterialKit-Icon-60@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29.png", "filename" : "MaterialKit-Icon-29.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x.png", "filename" : "MaterialKit-Icon-29@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40.png", "filename" : "MaterialKit-Icon-40.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x-1.png", "filename" : "MaterialKit-Icon-40@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76.png", "filename" : "MaterialKit-Icon-76.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76@2x.png", "filename" : "MaterialKit-Icon-76@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "83.5x83.5", "size" : "83.5x83.5",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-83.5@2x.png", "filename" : "MaterialKit-Icon-83.5@2x.png",
"scale" : "2x" "scale" : "2x"
} }
], ],
......
...@@ -3,79 +3,79 @@ ...@@ -3,79 +3,79 @@
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x-1.png", "filename" : "MaterialKit-Icon-29@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@3x.png", "filename" : "MaterialKit-Icon-29@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x.png", "filename" : "MaterialKit-Icon-40@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@3x.png", "filename" : "MaterialKit-Icon-40@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@2x.png", "filename" : "MaterialKit-Icon-60@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@3x.png", "filename" : "MaterialKit-Icon-60@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29.png", "filename" : "MaterialKit-Icon-29.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x.png", "filename" : "MaterialKit-Icon-29@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40.png", "filename" : "MaterialKit-Icon-40.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x-1.png", "filename" : "MaterialKit-Icon-40@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76.png", "filename" : "MaterialKit-Icon-76.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76@2x.png", "filename" : "MaterialKit-Icon-76@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "83.5x83.5", "size" : "83.5x83.5",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-83.5@2x.png", "filename" : "MaterialKit-Icon-83.5@2x.png",
"scale" : "2x" "scale" : "2x"
} }
], ],
......
...@@ -3,79 +3,79 @@ ...@@ -3,79 +3,79 @@
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x-1.png", "filename" : "MaterialKit-Icon-29@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@3x.png", "filename" : "MaterialKit-Icon-29@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x.png", "filename" : "MaterialKit-Icon-40@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@3x.png", "filename" : "MaterialKit-Icon-40@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@2x.png", "filename" : "MaterialKit-Icon-60@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@3x.png", "filename" : "MaterialKit-Icon-60@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29.png", "filename" : "MaterialKit-Icon-29.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x.png", "filename" : "MaterialKit-Icon-29@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40.png", "filename" : "MaterialKit-Icon-40.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x-1.png", "filename" : "MaterialKit-Icon-40@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76.png", "filename" : "MaterialKit-Icon-76.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76@2x.png", "filename" : "MaterialKit-Icon-76@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "83.5x83.5", "size" : "83.5x83.5",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-83.5@2x.png", "filename" : "MaterialKit-Icon-83.5@2x.png",
"scale" : "2x" "scale" : "2x"
} }
], ],
......
...@@ -28,62 +28,68 @@ ...@@ -28,62 +28,68 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
/*
The following is an example of using a TextField. TextFields offer details
that describe the usage and input results of text. For example, when an
error enters an incorrect email, it is possible to display an error message
under the TextField.
*/
import UIKit import UIKit
import MaterialKit import MaterialKit
class ViewController: UIViewController, TextFieldDelegate { class ViewController: UIViewController, TextFieldDelegate {
private lazy var nameField: TextField = TextField() /// Name TextField.
private lazy var emailField: TextField = TextField() private var nameField: TextField!
/// Email TextField.
private var emailField: TextField!
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
prepareView() prepareView()
prepareNameField() prepareNameField()
prepareEmailField() prepareEmailField()
} }
/** /// General preparation statements.
:name: prepareView
*/
private func prepareView() { private func prepareView() {
view.backgroundColor = MaterialColor.white view.backgroundColor = MaterialColor.white
} }
/** /// Prepares the name TextField.
:name: prepareNameField
:description: A preparation helper for nameField.
*/
private func prepareNameField() { private func prepareNameField() {
nameField.delegate = self nameField = TextField(frame: CGRectMake(57, 100, 300, 24))
nameField.frame = CGRectMake(57, 100, 300, 24) nameField.clearButtonMode = .WhileEditing
nameField.placeholder = "First Name" nameField.placeholder = "First Name"
nameField.font = RobotoFont.regularWithSize(20) nameField.font = RobotoFont.regularWithSize(20)
nameField.textColor = MaterialColor.black nameField.textColor = MaterialColor.black
nameField.titleLabel = UILabel() nameField.titleLabel = UILabel()
nameField.titleLabel!.font = RobotoFont.mediumWithSize(12) nameField.titleLabel!.font = RobotoFont.mediumWithSize(12)
nameField.titleLabelColor = MaterialColor.grey.lighten1 nameField.titleLabelColor = MaterialColor.grey.lighten1
nameField.titleLabelActiveColor = MaterialColor.blue.accent3 nameField.titleLabelActiveColor = MaterialColor.blue.accent3
nameField.clearButtonMode = .WhileEditing
nameField.text = "Hello"
view.addSubview(nameField) view.addSubview(nameField)
} }
/** /// Prepares the email TextField.
:name: prepareEmailField
:description: A preparation helper for emailField.
*/
private func prepareEmailField() { private func prepareEmailField() {
emailField = TextField(frame: CGRectMake(57, 200, 300, 24))
emailField.delegate = self emailField.delegate = self
emailField.frame = CGRectMake(57, 200, 300, 24)
emailField.placeholder = "Email" emailField.placeholder = "Email"
emailField.font = RobotoFont.regularWithSize(20) emailField.font = RobotoFont.regularWithSize(20)
emailField.textColor = MaterialColor.black emailField.textColor = MaterialColor.black
emailField.titleLabel = UILabel() emailField.titleLabel = UILabel()
emailField.titleLabel!.font = RobotoFont.mediumWithSize(12) emailField.titleLabel!.font = RobotoFont.mediumWithSize(12)
emailField.titleLabelColor = MaterialColor.grey.lighten1 emailField.titleLabelColor = MaterialColor.grey.lighten1
emailField.titleLabelActiveColor = MaterialColor.blue.accent3 emailField.titleLabelActiveColor = MaterialColor.blue.accent3
emailField.clearButtonMode = .WhileEditing emailField.clearButtonMode = .WhileEditing
/*
Used to display the error message, which is displayed when
the user presses the 'return' key.
*/
emailField.detailLabel = UILabel() emailField.detailLabel = UILabel()
emailField.detailLabel!.text = "Email is incorrect." emailField.detailLabel!.text = "Email is incorrect."
emailField.detailLabel!.font = RobotoFont.mediumWithSize(12) emailField.detailLabel!.font = RobotoFont.mediumWithSize(12)
...@@ -91,16 +97,10 @@ class ViewController: UIViewController, TextFieldDelegate { ...@@ -91,16 +97,10 @@ class ViewController: UIViewController, TextFieldDelegate {
view.addSubview(emailField) view.addSubview(emailField)
} }
/** /// Executed when the 'return' key is pressed when using the emailField.
:name: textFieldShouldReturn
:description: This is called when the user presses the Return
key on the keyboard.
*/
func textFieldShouldReturn(textField: UITextField) -> Bool { func textFieldShouldReturn(textField: UITextField) -> Bool {
textField.resignFirstResponder() textField.resignFirstResponder()
if textField == emailField { (textField as! TextField).detailLabelHidden = !(0 < emailField.text?.utf16.count)
(textField as! TextField).detailLabelHidden = false
}
return false return false
} }
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
960590221C388FD800691E88 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 960590211C388FD800691E88 /* ViewController.swift */; }; 960590221C388FD800691E88 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 960590211C388FD800691E88 /* ViewController.swift */; };
960590271C388FD800691E88 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 960590261C388FD800691E88 /* Assets.xcassets */; }; 960590271C388FD800691E88 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 960590261C388FD800691E88 /* Assets.xcassets */; };
9605902A1C388FD800691E88 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 960590281C388FD800691E88 /* LaunchScreen.storyboard */; }; 9605902A1C388FD800691E88 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 960590281C388FD800691E88 /* LaunchScreen.storyboard */; };
96607DE61C42CA20008D47D8 /* MaterialKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96607DE51C42CA20008D47D8 /* MaterialKit.framework */; };
96607DE71C42CA20008D47D8 /* MaterialKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 96607DE51C42CA20008D47D8 /* MaterialKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
...@@ -22,7 +20,6 @@ ...@@ -22,7 +20,6 @@
dstPath = ""; dstPath = "";
dstSubfolderSpec = 10; dstSubfolderSpec = 10;
files = ( files = (
96607DE71C42CA20008D47D8 /* MaterialKit.framework in Embed Frameworks */,
); );
name = "Embed Frameworks"; name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
...@@ -36,7 +33,6 @@ ...@@ -36,7 +33,6 @@
960590261C388FD800691E88 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 960590261C388FD800691E88 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
960590291C388FD800691E88 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 960590291C388FD800691E88 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
9605902B1C388FD800691E88 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 9605902B1C388FD800691E88 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
96607DE51C42CA20008D47D8 /* MaterialKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = MaterialKit.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/MaterialKit-gdulktuccbcfwbdfadtpxkworhyc/Build/Products/Debug-iphoneos/MaterialKit.framework"; sourceTree = "<absolute>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -44,7 +40,6 @@ ...@@ -44,7 +40,6 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
96607DE61C42CA20008D47D8 /* MaterialKit.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -54,7 +49,6 @@ ...@@ -54,7 +49,6 @@
960590131C388FD800691E88 = { 960590131C388FD800691E88 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96607DE51C42CA20008D47D8 /* MaterialKit.framework */,
9605901E1C388FD800691E88 /* TextView */, 9605901E1C388FD800691E88 /* TextView */,
9605901D1C388FD800691E88 /* Products */, 9605901D1C388FD800691E88 /* Products */,
); );
......
...@@ -3,79 +3,79 @@ ...@@ -3,79 +3,79 @@
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x-1.png", "filename" : "MaterialKit-Icon-29@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@3x.png", "filename" : "MaterialKit-Icon-29@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x.png", "filename" : "MaterialKit-Icon-40@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@3x.png", "filename" : "MaterialKit-Icon-40@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@2x.png", "filename" : "MaterialKit-Icon-60@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@3x.png", "filename" : "MaterialKit-Icon-60@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29.png", "filename" : "MaterialKit-Icon-29.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x.png", "filename" : "MaterialKit-Icon-29@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40.png", "filename" : "MaterialKit-Icon-40.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x-1.png", "filename" : "MaterialKit-Icon-40@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76.png", "filename" : "MaterialKit-Icon-76.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76@2x.png", "filename" : "MaterialKit-Icon-76@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "83.5x83.5", "size" : "83.5x83.5",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-83.5@2x.png", "filename" : "MaterialKit-Icon-83.5@2x.png",
"scale" : "2x" "scale" : "2x"
} }
], ],
......
...@@ -28,11 +28,19 @@ ...@@ -28,11 +28,19 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
/*
The following is an example of using a TextView. TextViews allow for patterns
in text to be detected.
*/
import UIKit import UIKit
import MaterialKit import MaterialKit
class ViewController: UIViewController, TextDelegate, TextViewDelegate { class ViewController: UIViewController, TextDelegate, TextViewDelegate {
/// A Text storage object that monitors the changes within the textView.
lazy var text: Text = Text() lazy var text: Text = Text()
/// A TextView UI Component.
var textView: TextView! var textView: TextView!
override func viewDidLoad() { override func viewDidLoad() {
...@@ -41,10 +49,12 @@ class ViewController: UIViewController, TextDelegate, TextViewDelegate { ...@@ -41,10 +49,12 @@ class ViewController: UIViewController, TextDelegate, TextViewDelegate {
prepareTextView() prepareTextView()
} }
/// General preparation statements.
private func prepareView() { private func prepareView() {
view.backgroundColor = MaterialColor.white view.backgroundColor = MaterialColor.white
} }
/// Prepares the textView.
func prepareTextView() { func prepareTextView() {
let layoutManager: NSLayoutManager = NSLayoutManager() let layoutManager: NSLayoutManager = NSLayoutManager()
let textContainer: NSTextContainer = NSTextContainer(size: view.bounds.size) let textContainer: NSTextContainer = NSTextContainer(size: view.bounds.size)
...@@ -71,11 +81,19 @@ class ViewController: UIViewController, TextDelegate, TextViewDelegate { ...@@ -71,11 +81,19 @@ class ViewController: UIViewController, TextDelegate, TextViewDelegate {
MaterialLayout.alignToParent(view, child: textView!, top: 124, left: 24, bottom: 24, right: 24) MaterialLayout.alignToParent(view, child: textView!, top: 124, left: 24, bottom: 24, right: 24)
} }
/**
When changes in the textView text are made, this delegation method
is executed with the added text string and range.
*/
func textWillProcessEdit(text: Text, textStorage: TextStorage, string: String, range: NSRange) { func textWillProcessEdit(text: Text, textStorage: TextStorage, string: String, range: NSRange) {
textStorage.removeAttribute(NSFontAttributeName, range: range) textStorage.removeAttribute(NSFontAttributeName, range: range)
textStorage.addAttribute(NSFontAttributeName, value: RobotoFont.regular, range: range) textStorage.addAttribute(NSFontAttributeName, value: RobotoFont.regular, range: range)
} }
/**
When a match is detected within the textView text, this delegation
method is executed with the added text string and range.
*/
func textDidProcessEdit(text: Text, textStorage: TextStorage, string: String, result: NSTextCheckingResult?, flags: NSMatchingFlags, stop: UnsafeMutablePointer<ObjCBool>) { func textDidProcessEdit(text: Text, textStorage: TextStorage, string: String, result: NSTextCheckingResult?, flags: NSMatchingFlags, stop: UnsafeMutablePointer<ObjCBool>) {
textStorage.addAttribute(NSFontAttributeName, value: UIFont.boldSystemFontOfSize(16), range: result!.range) textStorage.addAttribute(NSFontAttributeName, value: UIFont.boldSystemFontOfSize(16), range: result!.range)
} }
......
...@@ -3,79 +3,79 @@ ...@@ -3,79 +3,79 @@
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x-1.png", "filename" : "MaterialKit-Icon-29@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@3x.png", "filename" : "MaterialKit-Icon-29@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x.png", "filename" : "MaterialKit-Icon-40@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@3x.png", "filename" : "MaterialKit-Icon-40@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@2x.png", "filename" : "MaterialKit-Icon-60@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@3x.png", "filename" : "MaterialKit-Icon-60@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29.png", "filename" : "MaterialKit-Icon-29.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x.png", "filename" : "MaterialKit-Icon-29@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40.png", "filename" : "MaterialKit-Icon-40.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x-1.png", "filename" : "MaterialKit-Icon-40@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76.png", "filename" : "MaterialKit-Icon-76.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76@2x.png", "filename" : "MaterialKit-Icon-76@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "83.5x83.5", "size" : "83.5x83.5",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-83.5@2x.png", "filename" : "MaterialKit-Icon-83.5@2x.png",
"scale" : "2x" "scale" : "2x"
} }
], ],
......
...@@ -3,79 +3,79 @@ ...@@ -3,79 +3,79 @@
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x-1.png", "filename" : "MaterialKit-Icon-29@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@3x.png", "filename" : "MaterialKit-Icon-29@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x.png", "filename" : "MaterialKit-Icon-40@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@3x.png", "filename" : "MaterialKit-Icon-40@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@2x.png", "filename" : "MaterialKit-Icon-60@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@3x.png", "filename" : "MaterialKit-Icon-60@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29.png", "filename" : "MaterialKit-Icon-29.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x.png", "filename" : "MaterialKit-Icon-29@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40.png", "filename" : "MaterialKit-Icon-40.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x-1.png", "filename" : "MaterialKit-Icon-40@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76.png", "filename" : "MaterialKit-Icon-76.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76@2x.png", "filename" : "MaterialKit-Icon-76@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "83.5x83.5", "size" : "83.5x83.5",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-83.5@2x.png", "filename" : "MaterialKit-Icon-83.5@2x.png",
"scale" : "2x" "scale" : "2x"
} }
], ],
......
...@@ -3,79 +3,79 @@ ...@@ -3,79 +3,79 @@
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x-1.png", "filename" : "MaterialKit-Icon-29@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@3x.png", "filename" : "MaterialKit-Icon-29@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x.png", "filename" : "MaterialKit-Icon-40@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@3x.png", "filename" : "MaterialKit-Icon-40@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@2x.png", "filename" : "MaterialKit-Icon-60@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@3x.png", "filename" : "MaterialKit-Icon-60@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29.png", "filename" : "MaterialKit-Icon-29.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x.png", "filename" : "MaterialKit-Icon-29@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40.png", "filename" : "MaterialKit-Icon-40.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x-1.png", "filename" : "MaterialKit-Icon-40@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76.png", "filename" : "MaterialKit-Icon-76.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76@2x.png", "filename" : "MaterialKit-Icon-76@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "83.5x83.5", "size" : "83.5x83.5",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-83.5@2x.png", "filename" : "MaterialKit-Icon-83.5@2x.png",
"scale" : "2x" "scale" : "2x"
} }
], ],
......
...@@ -3,79 +3,79 @@ ...@@ -3,79 +3,79 @@
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x-1.png", "filename" : "MaterialKit-Icon-29@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@3x.png", "filename" : "MaterialKit-Icon-29@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x.png", "filename" : "MaterialKit-Icon-40@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@3x.png", "filename" : "MaterialKit-Icon-40@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@2x.png", "filename" : "MaterialKit-Icon-60@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@3x.png", "filename" : "MaterialKit-Icon-60@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29.png", "filename" : "MaterialKit-Icon-29.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x.png", "filename" : "MaterialKit-Icon-29@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40.png", "filename" : "MaterialKit-Icon-40.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x-1.png", "filename" : "MaterialKit-Icon-40@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76.png", "filename" : "MaterialKit-Icon-76.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76@2x.png", "filename" : "MaterialKit-Icon-76@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "83.5x83.5", "size" : "83.5x83.5",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-83.5@2x.png", "filename" : "MaterialKit-Icon-83.5@2x.png",
"scale" : "2x" "scale" : "2x"
} }
], ],
......
...@@ -3,79 +3,79 @@ ...@@ -3,79 +3,79 @@
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x-1.png", "filename" : "MaterialKit-Icon-29@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@3x.png", "filename" : "MaterialKit-Icon-29@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x.png", "filename" : "MaterialKit-Icon-40@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@3x.png", "filename" : "MaterialKit-Icon-40@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@2x.png", "filename" : "MaterialKit-Icon-60@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@3x.png", "filename" : "MaterialKit-Icon-60@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29.png", "filename" : "MaterialKit-Icon-29.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x.png", "filename" : "MaterialKit-Icon-29@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40.png", "filename" : "MaterialKit-Icon-40.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x-1.png", "filename" : "MaterialKit-Icon-40@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76.png", "filename" : "MaterialKit-Icon-76.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76@2x.png", "filename" : "MaterialKit-Icon-76@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "83.5x83.5", "size" : "83.5x83.5",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-83.5@2x.png", "filename" : "MaterialKit-Icon-83.5@2x.png",
"scale" : "2x" "scale" : "2x"
} }
], ],
......
...@@ -3,79 +3,79 @@ ...@@ -3,79 +3,79 @@
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x-1.png", "filename" : "MaterialKit-Icon-29@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-29@3x.png", "filename" : "MaterialKit-Icon-29@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x.png", "filename" : "MaterialKit-Icon-40@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-40@3x.png", "filename" : "MaterialKit-Icon-40@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@2x.png", "filename" : "MaterialKit-Icon-60@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialKit_Icons_Set_Icon-60@3x.png", "filename" : "MaterialKit-Icon-60@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29.png", "filename" : "MaterialKit-Icon-29.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-29@2x.png", "filename" : "MaterialKit-Icon-29@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40.png", "filename" : "MaterialKit-Icon-40.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-40@2x-1.png", "filename" : "MaterialKit-Icon-40@2x-1.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76.png", "filename" : "MaterialKit-Icon-76.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-76@2x.png", "filename" : "MaterialKit-Icon-76@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "83.5x83.5", "size" : "83.5x83.5",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialKit_Icons_Set_Icon-83.5@2x.png", "filename" : "MaterialKit-Icon-83.5@2x.png",
"scale" : "2x" "scale" : "2x"
} }
], ],
......
...@@ -109,15 +109,15 @@ let textField: TextField = TextField(frame: CGRectMake(57, 100, 300, 24)) ...@@ -109,15 +109,15 @@ let textField: TextField = TextField(frame: CGRectMake(57, 100, 300, 24))
textField.placeholder = "First Name" textField.placeholder = "First Name"
textField.font = RobotoFont.regularWithSize(20) textField.font = RobotoFont.regularWithSize(20)
textField.textColor = MaterialColor.black textField.textColor = MaterialColor.black
textField.titleLabel = UILabel() textField.titleLabel = UILabel()
textField.titleLabel!.font = RobotoFont.mediumWithSize(12) textField.titleLabel!.font = RobotoFont.mediumWithSize(12)
textField.titleLabelColor = MaterialColor.grey.lighten1 textField.titleLabelColor = MaterialColor.grey.lighten1
textField.titleLabelActiveColor = MaterialColor.blue.accent3 textField.titleLabelActiveColor = MaterialColor.blue.accent3
textField.clearButtonMode = .WhileEditing textField.clearButtonMode = .WhileEditing
view.addSubview(textField)
// Add nameField to UIViewController. // Add nameField to UIViewController.
view.addSubview(nameField) view.addSubview(textField)
``` ```
<a name="textview"></a> <a name="textview"></a>
......
...@@ -378,7 +378,7 @@ public class MaterialButton : UIButton { ...@@ -378,7 +378,7 @@ public class MaterialButton : UIButton {
public override func animationDidStop(anim: CAAnimation, finished flag: Bool) { public override func animationDidStop(anim: CAAnimation, finished flag: Bool) {
if let a: CAPropertyAnimation = anim as? CAPropertyAnimation { if let a: CAPropertyAnimation = anim as? CAPropertyAnimation {
if let b: CABasicAnimation = a as? CABasicAnimation { if let b: CABasicAnimation = a as? CABasicAnimation {
MaterialAnimation.animationDisabled { MaterialAnimation.animationDisabled { [unowned self] in
self.layer.setValue(nil == b.toValue ? b.byValue : b.toValue, forKey: b.keyPath!) self.layer.setValue(nil == b.toValue ? b.byValue : b.toValue, forKey: b.keyPath!)
} }
} }
......
...@@ -282,7 +282,7 @@ public class MaterialLayer : CAShapeLayer { ...@@ -282,7 +282,7 @@ public class MaterialLayer : CAShapeLayer {
public override func animationDidStop(anim: CAAnimation, finished flag: Bool) { public override func animationDidStop(anim: CAAnimation, finished flag: Bool) {
if let a: CAPropertyAnimation = anim as? CAPropertyAnimation { if let a: CAPropertyAnimation = anim as? CAPropertyAnimation {
if let b: CABasicAnimation = a as? CABasicAnimation { if let b: CABasicAnimation = a as? CABasicAnimation {
MaterialAnimation.animationDisabled { MaterialAnimation.animationDisabled { [unowned self] in
self.setValue(nil == b.toValue ? b.byValue : b.toValue, forKey: b.keyPath!) self.setValue(nil == b.toValue ? b.byValue : b.toValue, forKey: b.keyPath!)
} }
} }
......
...@@ -395,7 +395,7 @@ public class MaterialView : UIView { ...@@ -395,7 +395,7 @@ public class MaterialView : UIView {
public override func animationDidStop(anim: CAAnimation, finished flag: Bool) { public override func animationDidStop(anim: CAAnimation, finished flag: Bool) {
if let a: CAPropertyAnimation = anim as? CAPropertyAnimation { if let a: CAPropertyAnimation = anim as? CAPropertyAnimation {
if let b: CABasicAnimation = a as? CABasicAnimation { if let b: CABasicAnimation = a as? CABasicAnimation {
MaterialAnimation.animationDisabled { MaterialAnimation.animationDisabled { [unowned self] in
self.layer.setValue(nil == b.toValue ? b.byValue : b.toValue, forKey: b.keyPath!) self.layer.setValue(nil == b.toValue ? b.byValue : b.toValue, forKey: b.keyPath!)
} }
} }
......
...@@ -33,9 +33,6 @@ import UIKit ...@@ -33,9 +33,6 @@ import UIKit
public protocol TextFieldDelegate : UITextFieldDelegate {} public protocol TextFieldDelegate : UITextFieldDelegate {}
public class TextField : UITextField { public class TextField : UITextField {
/// The bottom border layer.
public private(set) lazy var bottomBorderLayer: CAShapeLayer = CAShapeLayer()
/** /**
This property is the same as clipsToBounds. It crops any of the view's This property is the same as clipsToBounds. It crops any of the view's
contents from bleeding past the view's frame. If an image is set using contents from bleeding past the view's frame. If an image is set using
...@@ -235,6 +232,15 @@ public class TextField : UITextField { ...@@ -235,6 +232,15 @@ public class TextField : UITextField {
} }
} }
/// The bottom border layer.
public private(set) lazy var bottomBorderLayer: CAShapeLayer = CAShapeLayer()
/**
A property that sets the distance between the textField and
bottomBorderLayer.
*/
public var bottomBorderLayerDistance: CGFloat = 4
/** /**
The title UILabel that is displayed when there is text. The The title UILabel that is displayed when there is text. The
titleLabel text value is updated with the placeholder text titleLabel text value is updated with the placeholder text
...@@ -260,6 +266,19 @@ public class TextField : UITextField { ...@@ -260,6 +266,19 @@ public class TextField : UITextField {
public var titleLabelActiveColor: UIColor? public var titleLabelActiveColor: UIColor?
/** /**
A property that sets the distance between the textField and
titleLabel.
*/
public var titleLabelAnimationDistance: CGFloat = 16
/// An override to the text property.
public override var text: String? {
didSet {
textFieldDidChange(self)
}
}
/**
The detail UILabel that is displayed when the detailLabelHidden property The detail UILabel that is displayed when the detailLabelHidden property
is set to false. is set to false.
*/ */
...@@ -273,14 +292,30 @@ public class TextField : UITextField { ...@@ -273,14 +292,30 @@ public class TextField : UITextField {
The color of the detailLabel text when the detailLabelHidden property The color of the detailLabel text when the detailLabelHidden property
is set to false. is set to false.
*/ */
public var detailLabelActiveColor: UIColor? public var detailLabelActiveColor: UIColor? {
didSet {
if !detailLabelHidden {
detailLabel?.textColor = detailLabelActiveColor
MaterialAnimation.animationDisabled { [unowned self] in
self.bottomBorderLayer.backgroundColor = self.detailLabelActiveColor?.CGColor
}
}
}
}
/**
A property that sets the distance between the textField and
detailLabel.
*/
public var detailLabelAnimationDistance: CGFloat = 8
/** /**
:name: detailLabelHidden :name: detailLabelHidden
*/ */
public var detailLabelHidden: Bool = false { public var detailLabelHidden: Bool = true {
didSet { didSet {
if detailLabelHidden { if detailLabelHidden {
detailLabel?.textColor = titleLabelColor
MaterialAnimation.animationDisabled { [unowned self] in MaterialAnimation.animationDisabled { [unowned self] in
self.bottomBorderLayer.backgroundColor = self.editing ? self.titleLabelActiveColor?.CGColor : self.titleLabelColor?.CGColor self.bottomBorderLayer.backgroundColor = self.editing ? self.titleLabelActiveColor?.CGColor : self.titleLabelColor?.CGColor
} }
...@@ -332,7 +367,7 @@ public class TextField : UITextField { ...@@ -332,7 +367,7 @@ public class TextField : UITextField {
public override func layoutSublayersOfLayer(layer: CALayer) { public override func layoutSublayersOfLayer(layer: CALayer) {
super.layoutSublayersOfLayer(layer) super.layoutSublayersOfLayer(layer)
if self.layer == layer { if self.layer == layer {
bottomBorderLayer.frame = CGRectMake(0, bounds.height + 8, bounds.width, 1) bottomBorderLayer.frame = CGRectMake(0, bounds.height + bottomBorderLayerDistance, bounds.width, 1)
layoutShape() layoutShape()
} }
} }
...@@ -376,7 +411,7 @@ public class TextField : UITextField { ...@@ -376,7 +411,7 @@ public class TextField : UITextField {
public override func animationDidStop(anim: CAAnimation, finished flag: Bool) { public override func animationDidStop(anim: CAAnimation, finished flag: Bool) {
if let a: CAPropertyAnimation = anim as? CAPropertyAnimation { if let a: CAPropertyAnimation = anim as? CAPropertyAnimation {
if let b: CABasicAnimation = a as? CABasicAnimation { if let b: CABasicAnimation = a as? CABasicAnimation {
MaterialAnimation.animationDisabled { MaterialAnimation.animationDisabled { [unowned self] in
self.layer.setValue(nil == b.toValue ? b.byValue : b.toValue, forKey: b.keyPath!) self.layer.setValue(nil == b.toValue ? b.byValue : b.toValue, forKey: b.keyPath!)
} }
} }
...@@ -406,25 +441,9 @@ public class TextField : UITextField { ...@@ -406,25 +441,9 @@ public class TextField : UITextField {
/// Handler for text editing began. /// Handler for text editing began.
internal func textFieldDidBegin(textField: TextField) { internal func textFieldDidBegin(textField: TextField) {
if let v: UILabel = titleLabel { titleLabel?.textColor = titleLabelActiveColor
if v.hidden { MaterialAnimation.animationDisabled { [unowned self] in
let h: CGFloat = v.font.pointSize self.bottomBorderLayer.backgroundColor = self.detailLabelHidden ? self.titleLabelActiveColor?.CGColor : self.detailLabelActiveColor?.CGColor
v.frame = CGRectMake(0, -h, bounds.width, h)
titleLabel?.text = placeholder
}
}
if 0 == text?.utf16.count {
titleLabel?.textColor = titleLabelColor
MaterialAnimation.animationDisabled { [unowned self] in
self.bottomBorderLayer.backgroundColor = self.titleLabelColor?.CGColor
}
detailLabelHidden = true
} else {
titleLabel?.textColor = titleLabelActiveColor
MaterialAnimation.animationDisabled { [unowned self] in
self.bottomBorderLayer.backgroundColor = self.detailLabelHidden ? self.titleLabelActiveColor?.CGColor : self.detailLabelActiveColor?.CGColor
}
} }
} }
...@@ -432,13 +451,13 @@ public class TextField : UITextField { ...@@ -432,13 +451,13 @@ public class TextField : UITextField {
internal func textFieldDidChange(textField: TextField) { internal func textFieldDidChange(textField: TextField) {
if 0 < text?.utf16.count { if 0 < text?.utf16.count {
showTitleLabel() showTitleLabel()
titleLabel?.textColor = titleLabelActiveColor if !detailLabelHidden {
MaterialAnimation.animationDisabled { [unowned self] in MaterialAnimation.animationDisabled { [unowned self] in
self.bottomBorderLayer.backgroundColor = self.detailLabelHidden ? self.titleLabelActiveColor?.CGColor : self.detailLabelActiveColor?.CGColor self.bottomBorderLayer.backgroundColor = self.detailLabelActiveColor?.CGColor
}
} }
} else if 0 == text?.utf16.count { } else if 0 == text?.utf16.count {
hideTitleLabel() hideTitleLabel()
detailLabelHidden = true
} }
} }
...@@ -465,14 +484,13 @@ public class TextField : UITextField { ...@@ -465,14 +484,13 @@ public class TextField : UITextField {
/// Prepares the titleLabel property. /// Prepares the titleLabel property.
private func prepareTitleLabel() { private func prepareTitleLabel() {
if let v: UILabel = titleLabel { if let v: UILabel = titleLabel {
MaterialAnimation.animationDisabled { v.hidden = true
v.hidden = true addSubview(v)
if 0 < text?.utf16.count {
showTitleLabel()
} else {
v.alpha = 0 v.alpha = 0
} }
titleLabel?.text = placeholder
let h: CGFloat = v.font.pointSize
v.frame = CGRectMake(0, -h, bounds.width, h)
addSubview(v)
addTarget(self, action: "textFieldDidBegin:", forControlEvents: .EditingDidBegin) addTarget(self, action: "textFieldDidBegin:", forControlEvents: .EditingDidBegin)
addTarget(self, action: "textFieldDidChange:", forControlEvents: .EditingChanged) addTarget(self, action: "textFieldDidChange:", forControlEvents: .EditingChanged)
addTarget(self, action: "textFieldDidEnd:", forControlEvents: .EditingDidEnd) addTarget(self, action: "textFieldDidEnd:", forControlEvents: .EditingDidEnd)
...@@ -482,13 +500,13 @@ public class TextField : UITextField { ...@@ -482,13 +500,13 @@ public class TextField : UITextField {
/// Prepares the detailLabel property. /// Prepares the detailLabel property.
private func prepareDetailLabel() { private func prepareDetailLabel() {
if let v: UILabel = detailLabel { if let v: UILabel = detailLabel {
MaterialAnimation.animationDisabled { v.hidden = true
v.hidden = true addSubview(v)
if detailLabelHidden {
v.alpha = 0 v.alpha = 0
} else {
showDetailLabel()
} }
let h: CGFloat = v.font.pointSize
v.frame = CGRectMake(0, h + 12, bounds.width, h)
addSubview(v)
addTarget(self, action: "textFieldDidBegin:", forControlEvents: .EditingDidBegin) addTarget(self, action: "textFieldDidBegin:", forControlEvents: .EditingDidBegin)
addTarget(self, action: "textFieldDidChange:", forControlEvents: .EditingChanged) addTarget(self, action: "textFieldDidChange:", forControlEvents: .EditingChanged)
addTarget(self, action: "textFieldDidEnd:", forControlEvents: .EditingDidEnd) addTarget(self, action: "textFieldDidEnd:", forControlEvents: .EditingDidEnd)
...@@ -503,12 +521,20 @@ public class TextField : UITextField { ...@@ -503,12 +521,20 @@ public class TextField : UITextField {
/// Shows and animates the titleLabel property. /// Shows and animates the titleLabel property.
private func showTitleLabel() { private func showTitleLabel() {
if let v: UILabel = titleLabel { if let v: UILabel = titleLabel {
v.frame.size.height = v.font.pointSize if v.hidden {
v.hidden = false if let s: String = placeholder {
UIView.animateWithDuration(0.25, animations: { if 0 == v.text?.utf16.count || nil == v.text {
v.alpha = 1 v.text = s
v.frame.origin.y = -v.frame.height - 4 }
}) }
let h: CGFloat = v.font.pointSize
v.frame = CGRectMake(0, -h, bounds.width, h)
v.hidden = false
UIView.animateWithDuration(0.25, animations: { [unowned self] in
v.alpha = 1
v.frame.origin.y = -v.frame.height - self.titleLabelAnimationDistance
})
}
} }
} }
...@@ -527,11 +553,15 @@ public class TextField : UITextField { ...@@ -527,11 +553,15 @@ public class TextField : UITextField {
/// Shows and animates the detailLabel property. /// Shows and animates the detailLabel property.
private func showDetailLabel() { private func showDetailLabel() {
if let v: UILabel = detailLabel { if let v: UILabel = detailLabel {
v.hidden = false if v.hidden {
UIView.animateWithDuration(0.25, animations: { let h: CGFloat = v.font.pointSize
v.alpha = 1 v.frame = CGRectMake(0, bounds.height + bottomBorderLayerDistance, bounds.width, h)
v.frame.origin.y = v.frame.height + 28 v.hidden = false
}) UIView.animateWithDuration(0.25, animations: { [unowned self] in
v.frame.origin.y = self.frame.height + self.bottomBorderLayerDistance + self.detailLabelAnimationDistance
v.alpha = 1
})
}
} }
} }
......
...@@ -255,6 +255,12 @@ public class TextView: UITextView { ...@@ -255,6 +255,12 @@ public class TextView: UITextView {
/// The color of the titleLabel text when the textView is active. /// The color of the titleLabel text when the textView is active.
public var titleLabelActiveColor: UIColor? public var titleLabelActiveColor: UIColor?
/**
A property that sets the distance between the textView and
titleLabel.
*/
public var titleLabelAnimationDistance: CGFloat = 16
/// Placeholder UILabel view. /// Placeholder UILabel view.
public var placeholderLabel: UILabel? { public var placeholderLabel: UILabel? {
didSet { didSet {
...@@ -262,12 +268,6 @@ public class TextView: UITextView { ...@@ -262,12 +268,6 @@ public class TextView: UITextView {
} }
} }
/**
A property that sets the distance between the textView and
titleLabel.
*/
public var titleLabelAnimationDistance: CGFloat = 16
/// An override to the text property. /// An override to the text property.
public override var text: String! { public override var text: String! {
didSet { didSet {
...@@ -397,7 +397,7 @@ public class TextView: UITextView { ...@@ -397,7 +397,7 @@ public class TextView: UITextView {
public override func animationDidStop(anim: CAAnimation, finished flag: Bool) { public override func animationDidStop(anim: CAAnimation, finished flag: Bool) {
if let a: CAPropertyAnimation = anim as? CAPropertyAnimation { if let a: CAPropertyAnimation = anim as? CAPropertyAnimation {
if let b: CABasicAnimation = a as? CABasicAnimation { if let b: CABasicAnimation = a as? CABasicAnimation {
MaterialAnimation.animationDisabled { MaterialAnimation.animationDisabled { [unowned self] in
self.layer.setValue(nil == b.toValue ? b.byValue : b.toValue, forKey: b.keyPath!) self.layer.setValue(nil == b.toValue ? b.byValue : b.toValue, forKey: b.keyPath!)
} }
} }
...@@ -513,9 +513,8 @@ public class TextView: UITextView { ...@@ -513,9 +513,8 @@ public class TextView: UITextView {
let h: CGFloat = v.font.pointSize let h: CGFloat = v.font.pointSize
v.frame = CGRectMake(0, -h, bounds.width, h) v.frame = CGRectMake(0, -h, bounds.width, h)
v.hidden = false v.hidden = false
UIView.animateWithDuration(0.25, animations: { UIView.animateWithDuration(0.25, animations: { [unowned self] in
v.alpha = 1 v.alpha = 1
print(v.frame)
v.frame.origin.y = -v.frame.height - self.titleLabelAnimationDistance v.frame.origin.y = -v.frame.height - self.titleLabelAnimationDistance
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment