├── README.md
├── iOS-Google-Now-Cards-Interface
├── iOS-Google-Now-Cards-Interface.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ ├── xcshareddata
│ │ │ └── iOS-Google-Now-Cards-Interface.xccheckout
│ │ └── xcuserdata
│ │ │ └── domenicovacchiano.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcuserdata
│ │ └── domenicovacchiano.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── iOS-Google-Now-Cards-Interface.xcscheme
│ │ └── xcschememanagement.plist
├── iOS-Google-Now-Cards-Interface
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Base.lproj
│ │ ├── LaunchScreen.xib
│ │ └── Main.storyboard
│ ├── Images.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Info.plist
│ ├── L3SDK
│ │ ├── L3SDKCard.h
│ │ ├── L3SDKCard.m
│ │ ├── L3SDKCardsView.h
│ │ └── L3SDKCardsView.m
│ ├── ViewController.h
│ ├── ViewController.m
│ └── main.m
└── iOS-Google-Now-Cards-InterfaceTests
│ ├── Info.plist
│ └── iOS_Google_Now_Cards_InterfaceTests.m
└── screenshots
└── Google_Now_Cards_Interface_.gif
/README.md:
--------------------------------------------------------------------------------
1 | # iOS-Google-Now-Cards-Interface
2 |
3 | A look like Google Now Cards Interface.
4 |
5 | I did not use UITableView or UICollectionView, but I used a view with sub views.
6 |
7 | Enjoy!
8 |
9 | ;-)
10 |
11 |
12 | 
13 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | DA3465CB1ACD792C00022BD7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DA3465CA1ACD792C00022BD7 /* main.m */; };
11 | DA3465CE1ACD792C00022BD7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DA3465CD1ACD792C00022BD7 /* AppDelegate.m */; };
12 | DA3465D11ACD792C00022BD7 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA3465D01ACD792C00022BD7 /* ViewController.m */; };
13 | DA3465D41ACD792C00022BD7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DA3465D21ACD792C00022BD7 /* Main.storyboard */; };
14 | DA3465D61ACD792C00022BD7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DA3465D51ACD792C00022BD7 /* Images.xcassets */; };
15 | DA3465D91ACD792C00022BD7 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = DA3465D71ACD792C00022BD7 /* LaunchScreen.xib */; };
16 | DA3465E51ACD792C00022BD7 /* iOS_Google_Now_Cards_InterfaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA3465E41ACD792C00022BD7 /* iOS_Google_Now_Cards_InterfaceTests.m */; };
17 | DA3465F31ACD79B600022BD7 /* L3SDKCard.m in Sources */ = {isa = PBXBuildFile; fileRef = DA3465F01ACD79B600022BD7 /* L3SDKCard.m */; };
18 | DA3465F41ACD79B600022BD7 /* L3SDKCardsView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA3465F21ACD79B600022BD7 /* L3SDKCardsView.m */; };
19 | /* End PBXBuildFile section */
20 |
21 | /* Begin PBXContainerItemProxy section */
22 | DA3465DF1ACD792C00022BD7 /* PBXContainerItemProxy */ = {
23 | isa = PBXContainerItemProxy;
24 | containerPortal = DA3465BD1ACD792C00022BD7 /* Project object */;
25 | proxyType = 1;
26 | remoteGlobalIDString = DA3465C41ACD792C00022BD7;
27 | remoteInfo = "iOS-Google-Now-Cards-Interface";
28 | };
29 | /* End PBXContainerItemProxy section */
30 |
31 | /* Begin PBXFileReference section */
32 | DA3465C51ACD792C00022BD7 /* iOS-Google-Now-Cards-Interface.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS-Google-Now-Cards-Interface.app"; sourceTree = BUILT_PRODUCTS_DIR; };
33 | DA3465C91ACD792C00022BD7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
34 | DA3465CA1ACD792C00022BD7 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
35 | DA3465CC1ACD792C00022BD7 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
36 | DA3465CD1ACD792C00022BD7 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
37 | DA3465CF1ACD792C00022BD7 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
38 | DA3465D01ACD792C00022BD7 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
39 | DA3465D31ACD792C00022BD7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
40 | DA3465D51ACD792C00022BD7 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
41 | DA3465D81ACD792C00022BD7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
42 | DA3465DE1ACD792C00022BD7 /* iOS-Google-Now-Cards-InterfaceTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "iOS-Google-Now-Cards-InterfaceTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
43 | DA3465E31ACD792C00022BD7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
44 | DA3465E41ACD792C00022BD7 /* iOS_Google_Now_Cards_InterfaceTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = iOS_Google_Now_Cards_InterfaceTests.m; sourceTree = ""; };
45 | DA3465EF1ACD79B600022BD7 /* L3SDKCard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = L3SDKCard.h; sourceTree = ""; };
46 | DA3465F01ACD79B600022BD7 /* L3SDKCard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = L3SDKCard.m; sourceTree = ""; };
47 | DA3465F11ACD79B600022BD7 /* L3SDKCardsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = L3SDKCardsView.h; sourceTree = ""; };
48 | DA3465F21ACD79B600022BD7 /* L3SDKCardsView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = L3SDKCardsView.m; sourceTree = ""; };
49 | /* End PBXFileReference section */
50 |
51 | /* Begin PBXFrameworksBuildPhase section */
52 | DA3465C21ACD792C00022BD7 /* Frameworks */ = {
53 | isa = PBXFrameworksBuildPhase;
54 | buildActionMask = 2147483647;
55 | files = (
56 | );
57 | runOnlyForDeploymentPostprocessing = 0;
58 | };
59 | DA3465DB1ACD792C00022BD7 /* Frameworks */ = {
60 | isa = PBXFrameworksBuildPhase;
61 | buildActionMask = 2147483647;
62 | files = (
63 | );
64 | runOnlyForDeploymentPostprocessing = 0;
65 | };
66 | /* End PBXFrameworksBuildPhase section */
67 |
68 | /* Begin PBXGroup section */
69 | DA3465BC1ACD792C00022BD7 = {
70 | isa = PBXGroup;
71 | children = (
72 | DA3465C71ACD792C00022BD7 /* iOS-Google-Now-Cards-Interface */,
73 | DA3465E11ACD792C00022BD7 /* iOS-Google-Now-Cards-InterfaceTests */,
74 | DA3465C61ACD792C00022BD7 /* Products */,
75 | );
76 | sourceTree = "";
77 | };
78 | DA3465C61ACD792C00022BD7 /* Products */ = {
79 | isa = PBXGroup;
80 | children = (
81 | DA3465C51ACD792C00022BD7 /* iOS-Google-Now-Cards-Interface.app */,
82 | DA3465DE1ACD792C00022BD7 /* iOS-Google-Now-Cards-InterfaceTests.xctest */,
83 | );
84 | name = Products;
85 | sourceTree = "";
86 | };
87 | DA3465C71ACD792C00022BD7 /* iOS-Google-Now-Cards-Interface */ = {
88 | isa = PBXGroup;
89 | children = (
90 | DA3465EE1ACD79B600022BD7 /* L3SDK */,
91 | DA3465CC1ACD792C00022BD7 /* AppDelegate.h */,
92 | DA3465CD1ACD792C00022BD7 /* AppDelegate.m */,
93 | DA3465CF1ACD792C00022BD7 /* ViewController.h */,
94 | DA3465D01ACD792C00022BD7 /* ViewController.m */,
95 | DA3465D21ACD792C00022BD7 /* Main.storyboard */,
96 | DA3465D51ACD792C00022BD7 /* Images.xcassets */,
97 | DA3465D71ACD792C00022BD7 /* LaunchScreen.xib */,
98 | DA3465C81ACD792C00022BD7 /* Supporting Files */,
99 | );
100 | path = "iOS-Google-Now-Cards-Interface";
101 | sourceTree = "";
102 | };
103 | DA3465C81ACD792C00022BD7 /* Supporting Files */ = {
104 | isa = PBXGroup;
105 | children = (
106 | DA3465C91ACD792C00022BD7 /* Info.plist */,
107 | DA3465CA1ACD792C00022BD7 /* main.m */,
108 | );
109 | name = "Supporting Files";
110 | sourceTree = "";
111 | };
112 | DA3465E11ACD792C00022BD7 /* iOS-Google-Now-Cards-InterfaceTests */ = {
113 | isa = PBXGroup;
114 | children = (
115 | DA3465E41ACD792C00022BD7 /* iOS_Google_Now_Cards_InterfaceTests.m */,
116 | DA3465E21ACD792C00022BD7 /* Supporting Files */,
117 | );
118 | path = "iOS-Google-Now-Cards-InterfaceTests";
119 | sourceTree = "";
120 | };
121 | DA3465E21ACD792C00022BD7 /* Supporting Files */ = {
122 | isa = PBXGroup;
123 | children = (
124 | DA3465E31ACD792C00022BD7 /* Info.plist */,
125 | );
126 | name = "Supporting Files";
127 | sourceTree = "";
128 | };
129 | DA3465EE1ACD79B600022BD7 /* L3SDK */ = {
130 | isa = PBXGroup;
131 | children = (
132 | DA3465EF1ACD79B600022BD7 /* L3SDKCard.h */,
133 | DA3465F01ACD79B600022BD7 /* L3SDKCard.m */,
134 | DA3465F11ACD79B600022BD7 /* L3SDKCardsView.h */,
135 | DA3465F21ACD79B600022BD7 /* L3SDKCardsView.m */,
136 | );
137 | path = L3SDK;
138 | sourceTree = "";
139 | };
140 | /* End PBXGroup section */
141 |
142 | /* Begin PBXNativeTarget section */
143 | DA3465C41ACD792C00022BD7 /* iOS-Google-Now-Cards-Interface */ = {
144 | isa = PBXNativeTarget;
145 | buildConfigurationList = DA3465E81ACD792C00022BD7 /* Build configuration list for PBXNativeTarget "iOS-Google-Now-Cards-Interface" */;
146 | buildPhases = (
147 | DA3465C11ACD792C00022BD7 /* Sources */,
148 | DA3465C21ACD792C00022BD7 /* Frameworks */,
149 | DA3465C31ACD792C00022BD7 /* Resources */,
150 | );
151 | buildRules = (
152 | );
153 | dependencies = (
154 | );
155 | name = "iOS-Google-Now-Cards-Interface";
156 | productName = "iOS-Google-Now-Cards-Interface";
157 | productReference = DA3465C51ACD792C00022BD7 /* iOS-Google-Now-Cards-Interface.app */;
158 | productType = "com.apple.product-type.application";
159 | };
160 | DA3465DD1ACD792C00022BD7 /* iOS-Google-Now-Cards-InterfaceTests */ = {
161 | isa = PBXNativeTarget;
162 | buildConfigurationList = DA3465EB1ACD792C00022BD7 /* Build configuration list for PBXNativeTarget "iOS-Google-Now-Cards-InterfaceTests" */;
163 | buildPhases = (
164 | DA3465DA1ACD792C00022BD7 /* Sources */,
165 | DA3465DB1ACD792C00022BD7 /* Frameworks */,
166 | DA3465DC1ACD792C00022BD7 /* Resources */,
167 | );
168 | buildRules = (
169 | );
170 | dependencies = (
171 | DA3465E01ACD792C00022BD7 /* PBXTargetDependency */,
172 | );
173 | name = "iOS-Google-Now-Cards-InterfaceTests";
174 | productName = "iOS-Google-Now-Cards-InterfaceTests";
175 | productReference = DA3465DE1ACD792C00022BD7 /* iOS-Google-Now-Cards-InterfaceTests.xctest */;
176 | productType = "com.apple.product-type.bundle.unit-test";
177 | };
178 | /* End PBXNativeTarget section */
179 |
180 | /* Begin PBXProject section */
181 | DA3465BD1ACD792C00022BD7 /* Project object */ = {
182 | isa = PBXProject;
183 | attributes = {
184 | LastUpgradeCheck = 0620;
185 | ORGANIZATIONNAME = LamCube;
186 | TargetAttributes = {
187 | DA3465C41ACD792C00022BD7 = {
188 | CreatedOnToolsVersion = 6.2;
189 | };
190 | DA3465DD1ACD792C00022BD7 = {
191 | CreatedOnToolsVersion = 6.2;
192 | TestTargetID = DA3465C41ACD792C00022BD7;
193 | };
194 | };
195 | };
196 | buildConfigurationList = DA3465C01ACD792C00022BD7 /* Build configuration list for PBXProject "iOS-Google-Now-Cards-Interface" */;
197 | compatibilityVersion = "Xcode 3.2";
198 | developmentRegion = English;
199 | hasScannedForEncodings = 0;
200 | knownRegions = (
201 | en,
202 | Base,
203 | );
204 | mainGroup = DA3465BC1ACD792C00022BD7;
205 | productRefGroup = DA3465C61ACD792C00022BD7 /* Products */;
206 | projectDirPath = "";
207 | projectRoot = "";
208 | targets = (
209 | DA3465C41ACD792C00022BD7 /* iOS-Google-Now-Cards-Interface */,
210 | DA3465DD1ACD792C00022BD7 /* iOS-Google-Now-Cards-InterfaceTests */,
211 | );
212 | };
213 | /* End PBXProject section */
214 |
215 | /* Begin PBXResourcesBuildPhase section */
216 | DA3465C31ACD792C00022BD7 /* Resources */ = {
217 | isa = PBXResourcesBuildPhase;
218 | buildActionMask = 2147483647;
219 | files = (
220 | DA3465D41ACD792C00022BD7 /* Main.storyboard in Resources */,
221 | DA3465D91ACD792C00022BD7 /* LaunchScreen.xib in Resources */,
222 | DA3465D61ACD792C00022BD7 /* Images.xcassets in Resources */,
223 | );
224 | runOnlyForDeploymentPostprocessing = 0;
225 | };
226 | DA3465DC1ACD792C00022BD7 /* Resources */ = {
227 | isa = PBXResourcesBuildPhase;
228 | buildActionMask = 2147483647;
229 | files = (
230 | );
231 | runOnlyForDeploymentPostprocessing = 0;
232 | };
233 | /* End PBXResourcesBuildPhase section */
234 |
235 | /* Begin PBXSourcesBuildPhase section */
236 | DA3465C11ACD792C00022BD7 /* Sources */ = {
237 | isa = PBXSourcesBuildPhase;
238 | buildActionMask = 2147483647;
239 | files = (
240 | DA3465D11ACD792C00022BD7 /* ViewController.m in Sources */,
241 | DA3465F31ACD79B600022BD7 /* L3SDKCard.m in Sources */,
242 | DA3465CE1ACD792C00022BD7 /* AppDelegate.m in Sources */,
243 | DA3465F41ACD79B600022BD7 /* L3SDKCardsView.m in Sources */,
244 | DA3465CB1ACD792C00022BD7 /* main.m in Sources */,
245 | );
246 | runOnlyForDeploymentPostprocessing = 0;
247 | };
248 | DA3465DA1ACD792C00022BD7 /* Sources */ = {
249 | isa = PBXSourcesBuildPhase;
250 | buildActionMask = 2147483647;
251 | files = (
252 | DA3465E51ACD792C00022BD7 /* iOS_Google_Now_Cards_InterfaceTests.m in Sources */,
253 | );
254 | runOnlyForDeploymentPostprocessing = 0;
255 | };
256 | /* End PBXSourcesBuildPhase section */
257 |
258 | /* Begin PBXTargetDependency section */
259 | DA3465E01ACD792C00022BD7 /* PBXTargetDependency */ = {
260 | isa = PBXTargetDependency;
261 | target = DA3465C41ACD792C00022BD7 /* iOS-Google-Now-Cards-Interface */;
262 | targetProxy = DA3465DF1ACD792C00022BD7 /* PBXContainerItemProxy */;
263 | };
264 | /* End PBXTargetDependency section */
265 |
266 | /* Begin PBXVariantGroup section */
267 | DA3465D21ACD792C00022BD7 /* Main.storyboard */ = {
268 | isa = PBXVariantGroup;
269 | children = (
270 | DA3465D31ACD792C00022BD7 /* Base */,
271 | );
272 | name = Main.storyboard;
273 | sourceTree = "";
274 | };
275 | DA3465D71ACD792C00022BD7 /* LaunchScreen.xib */ = {
276 | isa = PBXVariantGroup;
277 | children = (
278 | DA3465D81ACD792C00022BD7 /* Base */,
279 | );
280 | name = LaunchScreen.xib;
281 | sourceTree = "";
282 | };
283 | /* End PBXVariantGroup section */
284 |
285 | /* Begin XCBuildConfiguration section */
286 | DA3465E61ACD792C00022BD7 /* Debug */ = {
287 | isa = XCBuildConfiguration;
288 | buildSettings = {
289 | ALWAYS_SEARCH_USER_PATHS = NO;
290 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
291 | CLANG_CXX_LIBRARY = "libc++";
292 | CLANG_ENABLE_MODULES = YES;
293 | CLANG_ENABLE_OBJC_ARC = YES;
294 | CLANG_WARN_BOOL_CONVERSION = YES;
295 | CLANG_WARN_CONSTANT_CONVERSION = YES;
296 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
297 | CLANG_WARN_EMPTY_BODY = YES;
298 | CLANG_WARN_ENUM_CONVERSION = YES;
299 | CLANG_WARN_INT_CONVERSION = YES;
300 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
301 | CLANG_WARN_UNREACHABLE_CODE = YES;
302 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
303 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
304 | COPY_PHASE_STRIP = NO;
305 | ENABLE_STRICT_OBJC_MSGSEND = YES;
306 | GCC_C_LANGUAGE_STANDARD = gnu99;
307 | GCC_DYNAMIC_NO_PIC = NO;
308 | GCC_OPTIMIZATION_LEVEL = 0;
309 | GCC_PREPROCESSOR_DEFINITIONS = (
310 | "DEBUG=1",
311 | "$(inherited)",
312 | );
313 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
314 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
315 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
316 | GCC_WARN_UNDECLARED_SELECTOR = YES;
317 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
318 | GCC_WARN_UNUSED_FUNCTION = YES;
319 | GCC_WARN_UNUSED_VARIABLE = YES;
320 | IPHONEOS_DEPLOYMENT_TARGET = 8.2;
321 | MTL_ENABLE_DEBUG_INFO = YES;
322 | ONLY_ACTIVE_ARCH = YES;
323 | SDKROOT = iphoneos;
324 | TARGETED_DEVICE_FAMILY = "1,2";
325 | };
326 | name = Debug;
327 | };
328 | DA3465E71ACD792C00022BD7 /* Release */ = {
329 | isa = XCBuildConfiguration;
330 | buildSettings = {
331 | ALWAYS_SEARCH_USER_PATHS = NO;
332 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
333 | CLANG_CXX_LIBRARY = "libc++";
334 | CLANG_ENABLE_MODULES = YES;
335 | CLANG_ENABLE_OBJC_ARC = YES;
336 | CLANG_WARN_BOOL_CONVERSION = YES;
337 | CLANG_WARN_CONSTANT_CONVERSION = YES;
338 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
339 | CLANG_WARN_EMPTY_BODY = YES;
340 | CLANG_WARN_ENUM_CONVERSION = YES;
341 | CLANG_WARN_INT_CONVERSION = YES;
342 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
343 | CLANG_WARN_UNREACHABLE_CODE = YES;
344 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
345 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
346 | COPY_PHASE_STRIP = NO;
347 | ENABLE_NS_ASSERTIONS = NO;
348 | ENABLE_STRICT_OBJC_MSGSEND = YES;
349 | GCC_C_LANGUAGE_STANDARD = gnu99;
350 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
351 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
352 | GCC_WARN_UNDECLARED_SELECTOR = YES;
353 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
354 | GCC_WARN_UNUSED_FUNCTION = YES;
355 | GCC_WARN_UNUSED_VARIABLE = YES;
356 | IPHONEOS_DEPLOYMENT_TARGET = 8.2;
357 | MTL_ENABLE_DEBUG_INFO = NO;
358 | SDKROOT = iphoneos;
359 | TARGETED_DEVICE_FAMILY = "1,2";
360 | VALIDATE_PRODUCT = YES;
361 | };
362 | name = Release;
363 | };
364 | DA3465E91ACD792C00022BD7 /* Debug */ = {
365 | isa = XCBuildConfiguration;
366 | buildSettings = {
367 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
368 | INFOPLIST_FILE = "iOS-Google-Now-Cards-Interface/Info.plist";
369 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
370 | PRODUCT_NAME = "$(TARGET_NAME)";
371 | };
372 | name = Debug;
373 | };
374 | DA3465EA1ACD792C00022BD7 /* Release */ = {
375 | isa = XCBuildConfiguration;
376 | buildSettings = {
377 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
378 | INFOPLIST_FILE = "iOS-Google-Now-Cards-Interface/Info.plist";
379 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
380 | PRODUCT_NAME = "$(TARGET_NAME)";
381 | };
382 | name = Release;
383 | };
384 | DA3465EC1ACD792C00022BD7 /* Debug */ = {
385 | isa = XCBuildConfiguration;
386 | buildSettings = {
387 | BUNDLE_LOADER = "$(TEST_HOST)";
388 | FRAMEWORK_SEARCH_PATHS = (
389 | "$(SDKROOT)/Developer/Library/Frameworks",
390 | "$(inherited)",
391 | );
392 | GCC_PREPROCESSOR_DEFINITIONS = (
393 | "DEBUG=1",
394 | "$(inherited)",
395 | );
396 | INFOPLIST_FILE = "iOS-Google-Now-Cards-InterfaceTests/Info.plist";
397 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
398 | PRODUCT_NAME = "$(TARGET_NAME)";
399 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iOS-Google-Now-Cards-Interface.app/iOS-Google-Now-Cards-Interface";
400 | };
401 | name = Debug;
402 | };
403 | DA3465ED1ACD792C00022BD7 /* Release */ = {
404 | isa = XCBuildConfiguration;
405 | buildSettings = {
406 | BUNDLE_LOADER = "$(TEST_HOST)";
407 | FRAMEWORK_SEARCH_PATHS = (
408 | "$(SDKROOT)/Developer/Library/Frameworks",
409 | "$(inherited)",
410 | );
411 | INFOPLIST_FILE = "iOS-Google-Now-Cards-InterfaceTests/Info.plist";
412 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
413 | PRODUCT_NAME = "$(TARGET_NAME)";
414 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iOS-Google-Now-Cards-Interface.app/iOS-Google-Now-Cards-Interface";
415 | };
416 | name = Release;
417 | };
418 | /* End XCBuildConfiguration section */
419 |
420 | /* Begin XCConfigurationList section */
421 | DA3465C01ACD792C00022BD7 /* Build configuration list for PBXProject "iOS-Google-Now-Cards-Interface" */ = {
422 | isa = XCConfigurationList;
423 | buildConfigurations = (
424 | DA3465E61ACD792C00022BD7 /* Debug */,
425 | DA3465E71ACD792C00022BD7 /* Release */,
426 | );
427 | defaultConfigurationIsVisible = 0;
428 | defaultConfigurationName = Release;
429 | };
430 | DA3465E81ACD792C00022BD7 /* Build configuration list for PBXNativeTarget "iOS-Google-Now-Cards-Interface" */ = {
431 | isa = XCConfigurationList;
432 | buildConfigurations = (
433 | DA3465E91ACD792C00022BD7 /* Debug */,
434 | DA3465EA1ACD792C00022BD7 /* Release */,
435 | );
436 | defaultConfigurationIsVisible = 0;
437 | defaultConfigurationName = Release;
438 | };
439 | DA3465EB1ACD792C00022BD7 /* Build configuration list for PBXNativeTarget "iOS-Google-Now-Cards-InterfaceTests" */ = {
440 | isa = XCConfigurationList;
441 | buildConfigurations = (
442 | DA3465EC1ACD792C00022BD7 /* Debug */,
443 | DA3465ED1ACD792C00022BD7 /* Release */,
444 | );
445 | defaultConfigurationIsVisible = 0;
446 | defaultConfigurationName = Release;
447 | };
448 | /* End XCConfigurationList section */
449 | };
450 | rootObject = DA3465BD1ACD792C00022BD7 /* Project object */;
451 | }
452 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface.xcodeproj/project.xcworkspace/xcshareddata/iOS-Google-Now-Cards-Interface.xccheckout:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDESourceControlProjectFavoriteDictionaryKey
6 |
7 | IDESourceControlProjectIdentifier
8 | 2B682C3C-2E0D-49BA-BC50-B12FBCCB63A9
9 | IDESourceControlProjectName
10 | iOS-Google-Now-Cards-Interface
11 | IDESourceControlProjectOriginsDictionary
12 |
13 | 3907080C771A915002D27229ABE060133C4D7BD6
14 | https://github.com/alchimya/iOS-Google-Now-Cards-Interface.git
15 |
16 | IDESourceControlProjectPath
17 | iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface.xcodeproj
18 | IDESourceControlProjectRelativeInstallPathDictionary
19 |
20 | 3907080C771A915002D27229ABE060133C4D7BD6
21 | ../../..
22 |
23 | IDESourceControlProjectURL
24 | https://github.com/alchimya/iOS-Google-Now-Cards-Interface.git
25 | IDESourceControlProjectVersion
26 | 111
27 | IDESourceControlProjectWCCIdentifier
28 | 3907080C771A915002D27229ABE060133C4D7BD6
29 | IDESourceControlProjectWCConfigurations
30 |
31 |
32 | IDESourceControlRepositoryExtensionIdentifierKey
33 | public.vcs.git
34 | IDESourceControlWCCIdentifierKey
35 | 3907080C771A915002D27229ABE060133C4D7BD6
36 | IDESourceControlWCCName
37 | iOS-Google-Now-Cards-Interface
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface.xcodeproj/project.xcworkspace/xcuserdata/domenicovacchiano.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alchimya/iOS-Google-Now-Cards-Interface/82c4f593f3158cb5b111ff9e8e047c93c6f12804/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface.xcodeproj/project.xcworkspace/xcuserdata/domenicovacchiano.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface.xcodeproj/xcuserdata/domenicovacchiano.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface.xcodeproj/xcuserdata/domenicovacchiano.xcuserdatad/xcschemes/iOS-Google-Now-Cards-Interface.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
75 |
77 |
83 |
84 |
85 |
86 |
87 |
88 |
94 |
96 |
102 |
103 |
104 |
105 |
107 |
108 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface.xcodeproj/xcuserdata/domenicovacchiano.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | iOS-Google-Now-Cards-Interface.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | DA3465C41ACD792C00022BD7
16 |
17 | primary
18 |
19 |
20 | DA3465DD1ACD792C00022BD7
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // iOS-Google-Now-Cards-Interface
4 | //
5 | // Created by Domenico Vacchiano on 02/04/15.
6 | // Copyright (c) 2015 LamCube. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // iOS-Google-Now-Cards-Interface
4 | //
5 | // Created by Domenico Vacchiano on 02/04/15.
6 | // Copyright (c) 2015 LamCube. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 |
14 | @end
15 |
16 | @implementation AppDelegate
17 |
18 |
19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
20 | // Override point for customization after application launch.
21 |
22 | //remove status bar
23 | [[UIApplication sharedApplication] setStatusBarHidden:YES];
24 | return YES;
25 | }
26 |
27 | - (void)applicationWillResignActive:(UIApplication *)application {
28 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
29 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
30 | }
31 |
32 | - (void)applicationDidEnterBackground:(UIApplication *)application {
33 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
34 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
35 | }
36 |
37 | - (void)applicationWillEnterForeground:(UIApplication *)application {
38 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
39 | }
40 |
41 | - (void)applicationDidBecomeActive:(UIApplication *)application {
42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
43 | }
44 |
45 | - (void)applicationWillTerminate:(UIApplication *)application {
46 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
47 | }
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "29x29",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "29x29",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "40x40",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "40x40",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "76x76",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "76x76",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIViewControllerBasedStatusBarAppearance
6 |
7 | CFBundleDevelopmentRegion
8 | en
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | com.lam3.$(PRODUCT_NAME:rfc1034identifier)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | UISupportedInterfaceOrientations~ipad
42 |
43 | UIInterfaceOrientationPortrait
44 | UIInterfaceOrientationPortraitUpsideDown
45 | UIInterfaceOrientationLandscapeLeft
46 | UIInterfaceOrientationLandscapeRight
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface/L3SDK/L3SDKCard.h:
--------------------------------------------------------------------------------
1 | //
2 | // Lam3SwipePanel.h
3 | // Lam3SwipePanel
4 | //
5 | // Created by Domenico Vacchiano on 28/03/15.
6 | // Copyright (c) 2015 LamCube. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | @interface L3SDKCard : UIView
13 | @property (nonatomic,assign)CGRect zeroFrame;
14 | @end
15 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface/L3SDK/L3SDKCard.m:
--------------------------------------------------------------------------------
1 | //
2 | // Lam3SwipePanel.m
3 | // Lam3SwipePanel
4 | //
5 | // Created by Domenico Vacchiano on 28/03/15.
6 | // Copyright (c) 2015 LamCube. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "L3SDKCard.h"
11 | #import
12 |
13 |
14 | @implementation L3SDKCard
15 | @synthesize zeroFrame;
16 |
17 | - (void)drawRect:(CGRect)rect {
18 |
19 | UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRect:self.bounds];
20 |
21 | //initial frame
22 | self.zeroFrame=self.frame;
23 |
24 | //shadow
25 | self.layer.masksToBounds = NO;
26 | self.layer.shadowColor = [UIColor blackColor].CGColor;
27 | self.layer.shadowOffset = CGSizeMake(0.0f, 1.0f);
28 | self.layer.shadowOpacity = 0.5f;
29 | self.layer.shadowPath = shadowPath.CGPath;
30 | [self setBackgroundColor:[UIColor whiteColor]];
31 |
32 | }
33 |
34 | -(id)initWithFrame:(CGRect)frame{
35 | self=[super initWithFrame:frame];
36 | if (self) {
37 | [self drawRect:frame];
38 | }
39 | return self;
40 |
41 | }
42 |
43 |
44 |
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface/L3SDK/L3SDKCardsView.h:
--------------------------------------------------------------------------------
1 | //
2 | // L3SDKCardsView.h
3 | // Parallax
4 | //
5 | // Created by Domenico Vacchiano on 01/04/15.
6 | // Copyright (c) 2015 LamCube. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | typedef NS_OPTIONS(NSUInteger, L3SDKCardOptions) {
13 | L3SDKCardOptionsIsSwipeableCard = 1 << 0
14 | };
15 |
16 |
17 | @protocol L3SDKCardsViewDelegate
18 | @optional
19 | - (void)L3SDKCardsView_Scrolling:(UISwipeGestureRecognizerDirection)scrollDirection;
20 | - (void)L3SDKCardsView_CardWillRemove:(UIView*)view;
21 | - (void)L3SDKCardsView_CardDidlRemove:(UIView*)view;
22 | - (void)L3SDKCardsView_AllCardRemoved;
23 | - (void)L3SDKCardsView_UpperLimitReached;
24 | - (void)L3SDKCardsView_BottomLimitReached;
25 | @end
26 |
27 |
28 | @interface L3SDKCardsView : UIView
29 | @property (nonatomic,assign)IBOutlet id delegate;
30 | @property (readonly,nonatomic,strong)NSMutableArray*cards;
31 | @property (nonatomic,assign)CGRect zeroFrame;
32 | @property (nonatomic,assign,getter=getCardWidth) CGFloat cardWidth;
33 | -(void)addCard:(UIView*)card;
34 | -(void)addCard:(UIView*)card withOptions:(L3SDKCardOptions)options;
35 | -(void)drawView;
36 | @end
37 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface/L3SDK/L3SDKCardsView.m:
--------------------------------------------------------------------------------
1 | //
2 | // L3SDKCardsView.m
3 | // Parallax
4 | //
5 | // Created by Domenico Vacchiano on 01/04/15.
6 | // Copyright (c) 2015 LamCube. All rights reserved.
7 | //
8 |
9 | #import "L3SDKCardsView.h"
10 | #define CARD_X_MARGIN 20
11 | #define CARD_Y_MARGIN 10
12 |
13 |
14 |
15 | @interface L3SDKCardsView ()
16 | @property (nonatomic,assign) UISwipeGestureRecognizerDirection gestureDirection;
17 | @property (nonatomic,assign)CGPoint gestureStartPoint;
18 | @property (nonatomic,assign)UIView*gestureView;
19 | @property (nonatomic,strong)NSMutableArray*cardsOptions;
20 | @property (nonatomic,assign)CGRect superviewFrame;
21 | @end
22 |
23 |
24 | @implementation L3SDKCardsView
25 | @synthesize cards;
26 | @synthesize delegate;
27 | @synthesize zeroFrame;
28 | @synthesize cardWidth;
29 |
30 | #pragma mark - Init
31 |
32 |
33 | - (void)drawRect:(CGRect)rect {
34 |
35 | [super drawRect:rect];
36 | [self drawView];
37 |
38 | }
39 |
40 |
41 | -(id)initWithFrame:(CGRect)frame{
42 |
43 |
44 | self=[super initWithFrame:frame];
45 | if (self) {
46 | [self drawRect:frame];
47 | }
48 | return self;
49 |
50 | }
51 | - (id)initWithCoder:(NSCoder *)coder
52 | {
53 | self = [super initWithCoder:coder];
54 |
55 | if(self){
56 | self.backgroundColor = [UIColor clearColor];
57 | cards=[[NSMutableArray alloc]initWithCapacity:10];
58 | self.cardsOptions=[[NSMutableArray alloc]initWithCapacity:10];
59 | }
60 |
61 | return self;
62 | }
63 |
64 |
65 | #pragma mark - Public Methods
66 |
67 |
68 | -(void)addCard:(UIView*)card{
69 | [self addCard:card withOptions:-1];
70 | }
71 | -(void)addCard:(UIView*)card withOptions:(L3SDKCardOptions)options{
72 | [cards addObject:card];
73 |
74 | [self.cardsOptions addObject:[[NSValue alloc] initWithBytes:&options objCType:@encode(L3SDKCardOptions)]];
75 | [self addSubview:card];
76 | }
77 | -(void)drawView{
78 | self.superviewFrame=self.superview.frame;
79 | self.zeroFrame=self.frame;
80 | [self setupHeight];
81 | [self setNeedsDisplay];
82 | }
83 | -(CGFloat)getCardWidth{
84 | return self.frame.size.width-CARD_X_MARGIN;;
85 | }
86 |
87 | #pragma mark - Card Layout
88 | -(void)setupHeight{
89 |
90 | //height of container cards view
91 | int height=0;
92 | //y of container cards view
93 | CGFloat y=self.frame.origin.y;
94 |
95 | //views loop
96 | for (int i=0; i0.4) {
187 | self.gestureView.alpha=self.gestureView.alpha-0.03;
188 | }
189 | }
190 |
191 |
192 | }
193 |
194 | - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
195 | //NSLog(@"touchesEnded");
196 |
197 | if (![self.gestureView isEqual:self]) {
198 |
199 | //we are swiping a card
200 | float x=self.gestureView.frame.origin.x;
201 | if (fabs(x)>self.frame.size.width/2){
202 |
203 | //card will be deleted when x is greater than half width view
204 | if (self.delegate != NULL && [self.delegate respondsToSelector:@selector(L3SDKCardsView_CardWillRemove:)]) {
205 | [self.delegate L3SDKCardsView_CardWillRemove:self.gestureView];
206 | }
207 |
208 | [self removeView:self.gestureView];
209 |
210 | if (self.delegate != NULL && [self.delegate respondsToSelector:@selector(L3SDKCardsView_CardDidlRemove:)]) {
211 | [self.delegate L3SDKCardsView_CardDidlRemove:self.gestureView];
212 | }
213 |
214 | if (self.cards.count==0) {
215 | if (self.delegate != NULL && [self.delegate respondsToSelector:@selector(L3SDKCardsView_AllCardRemoved)]) {
216 | [self.delegate L3SDKCardsView_AllCardRemoved];
217 | }
218 | }
219 | }else{
220 | //card will be positioned at the orginila position
221 | self.gestureView.center = [self getCardCenter:self.gestureView];
222 | self.gestureView.alpha=1.0;
223 | }
224 | }
225 |
226 |
227 | }
228 | - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event{
229 | //NSLog(@"touchesCancelled");
230 | }
231 |
232 | #pragma mark - Touch Utility
233 | -(UISwipeGestureRecognizerDirection)getGestureDirectionWithTouch:(UITouch*)touch {
234 |
235 | CGPoint gestureEndPoint = [touch locationInView:self];
236 | int dx = abs(self.gestureStartPoint.x - gestureEndPoint.x);
237 | int dy = -1 * (gestureEndPoint.y - self.gestureStartPoint.y);
238 |
239 | if(dx > 20) {
240 | // left/right
241 | return UISwipeGestureRecognizerDirectionRight;
242 | }
243 |
244 | if(dy < 0) {
245 | // down
246 | return UISwipeGestureRecognizerDirectionDown;
247 | }else if(dy > 0) {
248 | // up
249 | return UISwipeGestureRecognizerDirectionUp;
250 | }
251 |
252 | return -1;
253 | }
254 | -(BOOL)canScroll:(UISwipeGestureRecognizerDirection)scrollDirection{
255 |
256 |
257 | if(scrollDirection==UISwipeGestureRecognizerDirectionUp && self.frame.origin.y<0) {
258 | //UP scrolling
259 | if (fabs(self.frame.origin.y)>=fabs(self.frame.size.height-self.superviewFrame.size.height)) {
260 | //scroll will stop when last bottom view is at bottom margin
261 | if (self.delegate != NULL && [self.delegate respondsToSelector:@selector(L3SDKCardsView_UpperLimitReached)]) {
262 | [self.delegate L3SDKCardsView_UpperLimitReached];
263 | }
264 | return NO;
265 | }
266 |
267 | }else if(scrollDirection==UISwipeGestureRecognizerDirectionDown && self.frame.origin.y>0) {
268 | //DOWN
269 | if (fabs(self.frame.origin.y)>=self.zeroFrame.origin.y ) {
270 | //scroll will stop when first view is on the initial frame y
271 | if (self.delegate != NULL && [self.delegate respondsToSelector:@selector(L3SDKCardsView_BottomLimitReached)]) {
272 | [self.delegate L3SDKCardsView_BottomLimitReached];
273 | }
274 | return NO;
275 | }
276 | }
277 |
278 |
279 | //avoid vertical scoll if is not required (content of view < of height view)
280 | if ((self.frame.size.height + self.frame.origin.y)=self.zeroFrame.origin.y)) {
281 | return NO;
282 | }
283 |
284 |
285 | return YES;
286 |
287 | }
288 |
289 |
290 | #pragma mark - Card Utility
291 | -(int)getIndexOfView:(UIView*)view{
292 | return [self.cards indexOfObject:view];
293 | }
294 | -(void)removeView:(UIView*)view{
295 |
296 | int index=[self getIndexOfView:view];
297 | [self.gestureView removeFromSuperview];
298 | [self.cards removeObject:self.gestureView];
299 | [self.cardsOptions removeObjectAtIndex:index];
300 | [self setupHeight];
301 |
302 | }
303 | -(L3SDKCardOptions) getOptionsForView:(UIView*)view{
304 | int index=[self getIndexOfView:view];
305 |
306 | //Bug fix
307 | //06/06/2015
308 | if (index>[self.cardsOptions count] || index<0) {
309 | return 0;
310 | }
311 |
312 | NSValue*value=[self.cardsOptions objectAtIndex:index];
313 | L3SDKCardOptions ret;
314 | [value getValue:&ret];
315 |
316 |
317 | return ret;
318 | }
319 | -(BOOL)viewCanSwipe:(UIView*)view{
320 |
321 |
322 | if ([view isEqual:self]) {
323 | return NO;
324 | }
325 |
326 | L3SDKCardOptions options=[self getOptionsForView:view];
327 | if (options==L3SDKCardOptionsIsSwipeableCard) {
328 | return YES;
329 | }
330 | return NO;
331 |
332 | }
333 | -(CGPoint)getCardCenter:(UIView*)card {
334 | return [self getCardCenter:card andXOffset:0 andYOffset:0];
335 | }
336 | -(CGPoint)getCardCenter:(UIView*)card andXOffset:(int)xOffset andYOffset:(int)yOffset{
337 | return CGPointMake(
338 | (self.frame.size.width / 2)+xOffset,
339 | card.center.y+yOffset
340 | );
341 | }
342 |
343 | @end
344 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // iOS-Google-Now-Cards-Interface
4 | //
5 | // Created by Domenico Vacchiano on 02/04/15.
6 | // Copyright (c) 2015 LamCube. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "L3SDKCardsView.h"
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // iOS-Google-Now-Cards-Interface
4 | //
5 | // Created by Domenico Vacchiano on 02/04/15.
6 | // Copyright (c) 2015 LamCube. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "L3SDKCardsView.h"
11 | #import "L3SDKCard.h"
12 |
13 | @interface ViewController ()
14 | //see links on Main.storyboard
15 | @property (nonatomic,strong)IBOutlet UIView*headerView;
16 | @property (nonatomic,strong)IBOutlet L3SDKCardsView*containerView;
17 | @property (nonatomic,strong)UIButton*moreButton;
18 | -(void)addCards;
19 | @end
20 |
21 | @implementation ViewController
22 |
23 | - (void)viewDidLoad {
24 | [super viewDidLoad];
25 | [self addCards];
26 | }
27 | -(void)viewDidAppear:(BOOL)animated{
28 | [super viewDidAppear:animated];
29 |
30 | /*
31 | if (self.containerView.cards.count!=0) {
32 | [self.containerView drawView];
33 | return;
34 | }
35 | [self addCards];
36 | */
37 |
38 | }
39 |
40 | -(void)addCards{
41 |
42 | //sets delegate
43 | self.containerView.delegate=self;
44 |
45 | //card setup
46 | //NOTE It's needed to specify only the height of the card
47 | L3SDKCard*card;
48 | //card1
49 | card=[[L3SDKCard alloc]initWithFrame:CGRectMake(0, 0, 0, 100)];
50 | [self.containerView addCard:card withOptions:L3SDKCardOptionsIsSwipeableCard];
51 |
52 | //card2
53 | card=[[L3SDKCard alloc]initWithFrame:CGRectMake(0, 0, 0, 150)];
54 | //try for example to comment the first line of code and to add the view with no swipeable option
55 | [self.containerView addCard:card withOptions:L3SDKCardOptionsIsSwipeableCard];
56 | //[self.containerView addCard:card];
57 |
58 | //card3
59 | card=[[L3SDKCard alloc]initWithFrame:CGRectMake(0, 0, 0, 80)];
60 | [self.containerView addCard:card withOptions:L3SDKCardOptionsIsSwipeableCard];
61 | //card4
62 | card=[[L3SDKCard alloc]initWithFrame:CGRectMake(0, 0, 0, 120)];
63 | [self.containerView addCard:card withOptions:L3SDKCardOptionsIsSwipeableCard];
64 | //card5
65 | card=[[L3SDKCard alloc]initWithFrame:CGRectMake(0, 0, 0, 220)];
66 | [self.containerView addCard:card withOptions:L3SDKCardOptionsIsSwipeableCard];
67 |
68 |
69 | //add a view (UIButton) at bottom
70 | self.moreButton = [UIButton buttonWithType:UIButtonTypeCustom];
71 | self.moreButton=[[UIButton alloc]initWithFrame:CGRectMake(0, 0, self.containerView.frame.size.width, 40)];
72 | [self.moreButton setTitle:@"More" forState:UIControlStateNormal];
73 | self.moreButton.backgroundColor=[UIColor whiteColor];
74 | [self.moreButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
75 | self.moreButton.titleLabel.font= [UIFont italicSystemFontOfSize:16.0f];
76 | [self.containerView addCard:self.moreButton];
77 |
78 | [self.containerView drawView];
79 |
80 |
81 | }
82 | -(CGFloat)getAlphaHeader{
83 | //calculate alpha by a containteview current y and "original" y
84 | return self.containerView.frame.origin.y/self.containerView.zeroFrame.origin.y;
85 | }
86 | //////////////////////////////////////////////////////////////////////////////////
87 | //EVENTS
88 | #pragma mark - L3SDKCardsView_ events delegate
89 | - (void)L3SDKCardsView_Scrolling:(UISwipeGestureRecognizerDirection)scrollDirection{
90 | self.headerView.alpha=[self getAlphaHeader];
91 | }
92 | - (void)L3SDKCardsView_CardWillRemove:(UIView*)view{
93 | NSLog(@"card will remove");
94 | }
95 | - (void)L3SDKCardsView_CardDidlRemove:(UIView*)view{
96 | NSLog(@"card did remove");
97 | self.headerView.alpha=[self getAlphaHeader];
98 | }
99 | - (void)L3SDKCardsView_AllCardRemoved{
100 | self.headerView.alpha=1;
101 | }
102 | - (void)L3SDKCardsView_UpperLimitReached{
103 | self.headerView.alpha=0;
104 | }
105 | - (void)L3SDKCardsView_BottomLimitReached{
106 | self.headerView.alpha=1;
107 | }
108 |
109 | //////////////////////////////////////////////////////////////////////////////////
110 |
111 | - (void)didReceiveMemoryWarning {
112 | [super didReceiveMemoryWarning];
113 | // Dispose of any resources that can be recreated.
114 | }
115 |
116 | @end
117 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-Interface/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // iOS-Google-Now-Cards-Interface
4 | //
5 | // Created by Domenico Vacchiano on 02/04/15.
6 | // Copyright (c) 2015 LamCube. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-InterfaceTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | com.lam3.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/iOS-Google-Now-Cards-Interface/iOS-Google-Now-Cards-InterfaceTests/iOS_Google_Now_Cards_InterfaceTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // iOS_Google_Now_Cards_InterfaceTests.m
3 | // iOS-Google-Now-Cards-InterfaceTests
4 | //
5 | // Created by Domenico Vacchiano on 02/04/15.
6 | // Copyright (c) 2015 LamCube. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface iOS_Google_Now_Cards_InterfaceTests : XCTestCase
13 |
14 | @end
15 |
16 | @implementation iOS_Google_Now_Cards_InterfaceTests
17 |
18 | - (void)setUp {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown {
24 | // Put teardown code here. This method is called after the invocation of each test method in the class.
25 | [super tearDown];
26 | }
27 |
28 | - (void)testExample {
29 | // This is an example of a functional test case.
30 | XCTAssert(YES, @"Pass");
31 | }
32 |
33 | - (void)testPerformanceExample {
34 | // This is an example of a performance test case.
35 | [self measureBlock:^{
36 | // Put the code you want to measure the time of here.
37 | }];
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/screenshots/Google_Now_Cards_Interface_.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alchimya/iOS-Google-Now-Cards-Interface/82c4f593f3158cb5b111ff9e8e047c93c6f12804/screenshots/Google_Now_Cards_Interface_.gif
--------------------------------------------------------------------------------