bjhomer / hsimagesidebarview Goto Github PK
View Code? Open in Web Editor NEWA view based on the sidebar in Apple's Keynote app for iPad.
License: MIT License
A view based on the sidebar in Apple's Keynote app for iPad.
License: MIT License
Hi,
How do I use this to do horizontal scrolling? I interchanged the width and height of the "Image Sidebar View" in the sample, but it does not show up.
Can you please help?
Thanks,
DS
I deleted all boxes and was able to select a row where there was no box any longer. Trying to delete this selection caused crash.
Quick and dirty check should prevent this case from crashing: if (selectedIndex != -1 && selectedIndex.row <= [colors count])
2011-06-14 09:58:39.957 Sidebar[2575:207] * Terminating app due to uncaught exception 'NSRangeException', reason: '* -[NSMutableArray removeObjectAtIndex:]: index 3 beyond bounds for empty array'
*** Call stack at first throw:
(
0 CoreFoundation 0x00f325a9 exceptionPreprocess + 185
1 libobjc.A.dylib 0x01086313 objc_exception_throw + 44
2 CoreFoundation 0x00f2b49f -[__NSArrayM removeObjectAtIndex:] + 415
3 Sidebar 0x0000226a -[SidebarViewController deleteSelection:] + 186
4 UIKit 0x001844fd -[UIApplication sendAction:to:from:forEvent:] + 119
5 UIKit 0x00214799 -[UIControl sendAction:to:forEvent:] + 67
6 UIKit 0x00216c2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
7 UIKit 0x002157d8 -[UIControl touchesEnded:withEvent:] + 458
8 UIKit 0x001a8ded -[UIWindow _sendTouchesForEvent:] + 567
9 UIKit 0x00189c37 -[UIApplication sendEvent:] + 447
10 UIKit 0x0018ef2e _UIApplicationHandleEvent + 7576
11 GraphicsServices 0x01a7a992 PurpleEventCallback + 1550
12 CoreFoundation 0x00f13944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 52
13 CoreFoundation 0x00e73cf7 __CFRunLoopDoSource1 + 215
14 CoreFoundation 0x00e70f83 __CFRunLoopRun + 979
15 CoreFoundation 0x00e70840 CFRunLoopRunSpecific + 208
16 CoreFoundation 0x00e70761 CFRunLoopRunInMode + 97
17 GraphicsServices 0x01a791c4 GSEventRunModal + 217
18 GraphicsServices 0x01a79289 GSEventRun + 115
19 UIKit 0x00192c93 UIApplicationMain + 1160
20 Sidebar 0x00001b7e main + 126
21 Sidebar 0x00001af5 start + 53
)
One thing I'd love to see is the ability to return cells in data source methods, in addition to UIImages, which are immutable and cannot update themselves. This would allow us to abstract logic about the content of each item out of the sidebar view and into the cell.
For example, a common idiom is to set a model property on a cell, which then sets up observers on the model's properties and updates the cell's subviews as appropriate when they change. The model object can asynchronously perform network or image processing operations, change it's image property to reflect these changes, then the cell can update the image independent of the sidebar view.
This is in contrast to putting all of this logic inside the sidebar view, then reloading the entire sidebar when the contents of an image changes.
To make this as simple as possible out of the box (and retain compatibility with existing code), you could check to see if the image variant of the data source method is implemented, create an image-only cell subclass behind the scenes and use it to populate the sidebar. Only users that needed cell functionality would implement the cell specific datasource method.
hey, thanks for your HSImageSidebarView,
there is something confusing , in the example project's Portrait mode, there are 6 icon,
but when it comes to Landscape mode,there are only 4 icon.
:)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.