Giter Club home page Giter Club logo

dznemptydataset's People

Contributors

bartvandendriessche avatar brandons avatar colinhumber avatar dysonapps avatar dzenbot avatar ekurutepe avatar emauro avatar gitter-badger avatar gonghao avatar gorkamm avatar hanneskaeufler avatar imkevinxu avatar jsclayton avatar kaich avatar kareem-hewady avatar kunalverma25 avatar manuelescrig avatar marvinnazari avatar mazyod avatar mmorey avatar mythodeia avatar parsifalc avatar readmecritic avatar rokgregoric avatar sashahilton00 avatar stoprocent avatar streeter avatar wenchaod avatar wkoszek avatar wlisac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dznemptydataset's Issues

embedded scroll views scroll simultaneously

V 1.5 causes an inner scroll view to pass the touch events out to the outer scroll view so they both scroll simultaneously.

Common situation would be a datepicker imbedded in a cell in the tableview. The tableview scrolls as you try to pick a date.

Hide DZNEmptyDataSet at first appearance

Steps:

  1. I'm pushing into a view controller.
  2. It'll show an DZNEmptyDataSet view "No events found.."
  3. An api call will made (waiting)
  4. I got few events
  5. I reload the table, and DZNEmptyDataSet view is away and events will be there.

Here, I don't want to show DZNEmptyDataSet view on start? How to achieve this?

Custom View for Empty Data Set (viewController xib)

Hi, I'm having an issue with the position of a view that is loaded from a view controller's Xib.

If I load initialize a normal view and return it the view is positioned properly. If I initialize a view controller, then use it's view (xib) the views top left edge is positioned in the center of the screen.

- (UIView *)customViewForEmptyDataSet:(UIScrollView *)scrollView {

    NoPhotosViewController *test = [[NoPhotosViewController alloc] init];
    test.view.frame = CGRectMake(0, 0, 320, 900);

    UIView * test2 = [[UIView alloc] init];
    test2.backgroundColor = [UIColor redColor];
    test2.frame = CGRectMake(0, 0, 320, 900);


     return test.view;
}

Any ideas?

Screen shots.

screen shot 2014-07-30 at 9 53 05 pm
screen shot 2014-07-30 at 9 53 43 pm

customViewForEmptyDataSet: no longer centred

Changes committed in c95b7f7 cause my customViewForEmptyDataSet to be rendered at point 0,0 instead of being centred.

I've had a brief look to see if I could find a quick fix, but wasn't able to figure it out.

I'm using the following code in my project:

- (UIView *)customViewForEmptyDataSet:(UIScrollView *)scrollView {
  if (!self.loading) return nil;

  UIActivityIndicatorView *activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
  [activityIndicatorView startAnimating];

  return activityIndicatorView;
}

Can't get it to work!

Hi!
First of all i would like to thank you for this great piece of work!
I tried to get it working on a UITableView and then on UITableViewController and i failed both times.
I have set the delegates and i first tried the sample code provided on the github page and then a stripped down version from the demo app (see below) however nothing shows up.
I am using cocoapods and storyboards.
Any ideas?

pragma mark - DZNTableViewDataSetDataSource Methods

  • (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView
    {
    NSString *text = nil;
    UIFont *font = nil;
    UIColor *textColor = nil;

    NSMutableDictionary *attributes = [NSMutableDictionary new];

    text = @"Welcome to VMs";
    font = [UIFont boldSystemFontOfSize:22.0];
    textColor = [UIColor greenColor];
    [attributes setObject:@(0.45) forKey:NSKernAttributeName];

    if (font) [attributes setObject:font forKey:NSFontAttributeName];
    if (textColor) [attributes setObject:textColor forKey:NSForegroundColorAttributeName];

    return [[NSAttributedString alloc] initWithString:text attributes:attributes];
    }

  • (NSAttributedString *)descriptionForEmptyDataSet:(UIScrollView *)scrollView
    {
    NSString *text = nil;
    UIFont *font = nil;
    UIColor *textColor = nil;

    NSMutableDictionary *attributes = [NSMutableDictionary new];

    NSMutableParagraphStyle *paragraph = [NSMutableParagraphStyle new];
    paragraph.lineBreakMode = NSLineBreakByWordWrapping;
    paragraph.alignment = NSTextAlignmentCenter;

    text = @"Send a message or create a group.";
    font = [UIFont systemFontOfSize:14.0];
    textColor = [UIColor whiteColor];
    paragraph.lineSpacing = 2.0;

    if (font) [attributes setObject:font forKey:NSFontAttributeName];
    if (textColor) [attributes setObject:textColor forKey:NSForegroundColorAttributeName];
    if (paragraph) [attributes setObject:paragraph forKey:NSParagraphStyleAttributeName];

    return [[NSAttributedString alloc] initWithString:text attributes:attributes];
    }

  • (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView
    {
    return [UIImage imageNamed:@"olabord_logo"];
    }

  • (NSAttributedString *)buttonTitleForEmptyDataSet:(UIScrollView *)scrollView forState:(UIControlState)state
    {
    NSString *text = nil;
    UIFont *font = nil;
    UIColor *textColor = nil;

    text = @"Start Browsing";
    font = [UIFont boldSystemFontOfSize:16.0];
    textColor = [UIColor blueColor];

    NSMutableDictionary *attributes = [NSMutableDictionary new];
    if (font) [attributes setObject:font forKey:NSFontAttributeName];
    if (textColor) [attributes setObject:textColor forKey:NSForegroundColorAttributeName];

    return [[NSAttributedString alloc] initWithString:text attributes:attributes];
    }

  • (UIImage *)buttonBackgroundImageForEmptyDataSet:(UIScrollView *)scrollView forState:(UIControlState)state
    {
    NSString *imageName = [[NSString stringWithFormat:@"button_background_%@", self.title] lowercaseString];

    if (state == UIControlStateNormal) imageName = [imageName stringByAppendingString:@"_normal"];
    if (state == UIControlStateHighlighted) imageName = [imageName stringByAppendingString:@"_highlight"];

    UIEdgeInsets capInsets = UIEdgeInsetsMake(10.0, 10.0, 10.0, 10.0);
    UIEdgeInsets rectInsets = UIEdgeInsetsZero;

    capInsets = UIEdgeInsetsMake(25.0, 25.0, 25.0, 25.0);
    rectInsets = UIEdgeInsetsMake(0.0, 10, 0.0, 10);

    return [[[UIImage imageNamed:imageName] resizableImageWithCapInsets:capInsets resizingMode:UIImageResizingModeStretch] imageWithAlignmentRectInsets:rectInsets];
    }

  • (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView
    {
    return [UIColor lightGrayColor];
    }

  • (CGFloat)spaceHeightForEmptyDataSet:(UIScrollView *)scrollView
    {
    return 20;
    }

pragma mark - DZNTableViewDataSetDelegate Methods

  • (BOOL)emptyDataSetShouldAllowTouch:(UIScrollView *)scrollView
    {
    return YES;
    }
  • (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView
    {
    return YES;
    }
  • (void)emptyDataSetDidTapView:(UIScrollView *)scrollView
    {
    NSLog(@"%s",FUNCTION);
    }
  • (void)emptyDataSetDidTapButton:(UIScrollView *)scrollView
    {
    NSLog(@"%s",FUNCTION);
    }
  • (void)dealloc
    {
    myTableView.emptyDataSetSource = nil;
    myTableView.emptyDataSetDelegate = nil;
    }

EmptyDataSet usage in a extended ViewController

Hi,

I'm having a problem when trying to use DZNEmptyDataSet in a ViewController that extends another one.
For instance I have ViewController A that implements DZNEmptyDataSet, and I have ViewController B and C that extends ViewController A.
When I try to use ViewController A or B it doesn't show the empty state state. After some debugging it seems that the problem is on dzn_canDisplay. When it trys to check if the viewcontroller is conformed with the protocol, it fails.
Any Idea how can I make this to work.

Thanks in Advance

Delegate and Source set, but never being called

I'm trying to setup EmptyDataSet on my UICollectionView. I've created my collectionView correctly, implemented the DZNEmptyDataSetDelegate and DZNEmptyDataSetSource protocols, and set the appropriate emptyDataSetSource and emptyDataSetDelegate properties on my UICollectionView. However, I do not see any of my protocol methods being called, and do not see the empty data set indicator being displayed. I just see my blank UICollectionView, as if I had not done anything with DZNEmptyDataSet.

As background, my UI is created using Storyboards. My view controller is a standard UIViewController, implementing the various UICollectionView* protocols, as well as the DZNEmptyDataSet* protocols. My UICollectionView is the view for this view controller. I'm populating my UICollectionView using Core Data. This is a clean install of the app, so there is NO data in my Core Data datastore at the time.

Any ideas why this does not seem to be displaying? Is there an important step I should look out for? I didn't see any huge differences between the sample app and my app. I'd appreciate any help you can give. Thanks!

weird issue with uicollectionview

Hello and thanks for this excellent library.
i am facing a weird issue.
In a UITableView environment when a user taps a uitextfield, inside a UITableViewCell, i am showing a uicollectionview as a customInputAccessoryView that shows words based on user input.
when the user taps the texfield the app now freezes and memory goes well over 1GB. There must be a code loop thats happening in reloadData
i am using this as a inputAccesoryView which is basically a custom uicollectionview that shows words inside horizontal cells.
https://github.com/siuying/IGAutoCompletionToolbar

Can you provide any assistance on why this freezes? Is there a way to disable the swizzling for specific views?

thanks
Konstantinos

Problem with a table view and a collection view together

Hi,
I have a container view that shows one of two views (a table view and a collection view) according to the value of a segmented control.

The container view starts with a table view where emptyDataSetSources of the table view work fine. But when I select the collection view, the data sources of the collection view are not working. I realized that it may be because of dispatch_once here. This doesn't get called in the collection view since it was called for the table view.

How can I solve this problem? Should I have only one datasource which is used by every view controller?

Btw, thank you for your great piece of work.

Data source offsetForEmptyDataSet method not being called

I am trying to set the offset for a custom view, but the offsetForEmptyDataset method is not being called on my data source. Breakpoints have led me to believe the issue is on line 646 of UIScrollView+EmptyDataSet.m:


if (customView) {
            view.customView = customView;
        }
        else {
            // Configure labels
            view.detailLabel.attributedText = [self dzn_detailLabelText];
            view.titleLabel.attributedText = [self dzn_titleLabelText];
            
            // Configure imageview
            view.imageView.image = [self dzn_image];
            
            // Configure button
            [view.button setAttributedTitle:[self dzn_buttonTitleForState:0] forState:0];
            [view.button setAttributedTitle:[self dzn_buttonTitleForState:1] forState:1];
            [view.button setBackgroundImage:[self dzn_buttonBackgroundImageForState:0] forState:0];
            [view.button setBackgroundImage:[self dzn_buttonBackgroundImageForState:1] forState:1];
            [view.button setUserInteractionEnabled:[self dzn_isTouchAllowed]];

            // Configure offset and spacing
            view.offset = [self dzn_offset];
            view.verticalSpace = [self dzn_verticalSpace];
        }

Since I'm returning a custom view, view.offset is never set to [self dzn_offset];

I didn't want to submit a pull request, since I'm unsure as to whether this is a bug or a misunderstanding on my part.

Thanks!

Empty set view never shown on load with NSFetchedResultsController

I've been having an issue where the empty set view is never shown when the app opens and there is no data in my FetchedResultsController. The view shows correctly if I open the app, inject some data into the data store and then manually delete all the rows.

The issue appears to be in the - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context where both new and old never differ because the tableView never adds any rows.

I'm not sure if this is a function of the fact that I'm using a fetchedResultsController to load my data from the store or if this is an issue that happens all the time (I imagine it's the former).

I've managed to hack around this for the time being by changing:

        if (new && old && ![new isEqualToValue:old]) {
            if ([keyPath isEqualToString:kContentSize]) {
                [self didReloadData];
            }
        }

to

        if (new && old && ![new isEqualToValue:old]) {
            if ([keyPath isEqualToString:kContentSize]) {
                [self didReloadData];
            }
        } else {
            [self reloadDataSet];
        }

but I'm sure this isn't the correct or best way to do things here. Is this the way it is intended to work? I can provide a more in depth example if needed.

Empty data set view breaks "pull to refresh"

I'm trying to use this handy library in a UITableViewController which applies the "pull to refresh" pattern and which thus owns a UIRefreshControl. Unfortunately, this combination causes a number of problems:

  1. As long as the empty data set view is visible, the "pull to refresh" gesture is no longer possible even when emptyDataSetShouldAllowTouch: returns NO.

  2. The empty data set view seems to hide the UIRefreshControl (which can be invoked manually by calling beginRefreshing, but it won't become visible as long as the empty data set view is visible). This is also the case when I manually set the background color to transparent (but as far as I can judge from looking at the source code this is the default anyway).

  3. The offset of the empty data set view is wrong (although this could probably also be fixed by returning a custom offset from the according delegate method).

Is there any way to use this library in conjunction with a UIRefreshControl? If there is anything I can do to help resolve this issue, just let me know.

Empty data set in sectioned tableView

First of all thanks for the great work that you've done.
I noticed a bug. I have a tableView with segmented control.
Segmented controll triggers toggleSection:segmentedControl method listed below

- (void)toggleSection:(HMSegmentedControl *)segmentedControl
{  
  self.pickerSection = segmentedControl.selectedSegmentIndex;

  switch (segmentedControl.selectedSegmentIndex) {
    case SectionContacts: {
      self.items = [ContactsStore sharedStore].allIndexedItems;
      self.searchResults = [NSMutableArray arrayWithCapacity:[self.items count]];
    } break;

    case SectionFavorites: {
      self.items = [ContactsStore sharedStore].favorites;
      self.searchResults = [NSMutableArray arrayWithCapacity:[self.items count]];
    } break;

    default: {
      self.items = nil;
      self.searchResults = [NSMutableArray arrayWithCapacity:[self.items count]];
    } break;
  }

  [self.tableView reloadData];
  [self.tableView reloadEmptyDataSet];
}

If i scroll tableView in full tableView (self.items > 0) and switch to empty tableView (default case) empty data set is moved by contentOffset.y.

- (CGPoint)offsetForEmptyDataSet:(UIScrollView *)scrollView

Is not implemented! But if i add

 offset = CGPointMake(0, -self.tableView.contentOffset.y);

text is centred right, but backgroundColorForEmptyDataSet is moved by contentOffset.y.
And self.edgesForExtendedLayout is set to UIRectEdgeNone

DZEmptyDataSet cause app crash!

I think the
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceDidChangeOrientation:) name:UIDeviceOrientationDidChangeNotification object:nil]
what cause the crash when receiving the event notification and try to perform (deviceDidChangeOrientation:) !!
EXC_BAD_ACCESS KERN_INVALID_ADDRESS

for more details:

Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x000000019775fbd0 objc_msgSend + 16
1 CoreFoundation 0x0000000185f262c4 CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 20
2 CoreFoundation 0x0000000185e63450 _CFXNotificationPost + 2060
3 Foundation 0x0000000186d92a80 -[NSNotificationCenter postNotificationName:object:userInfo:] + 72
4 UIKit 0x000000018a9c1ba0 -[UIDevice setOrientation:animated:] + 360
5 UIKit 0x000000018a9c185c -[UIApplication handleEvent:withNewEvent:] + 1632
6 UIKit 0x000000018a9c10ec -[UIApplication sendEvent:] + 104
7 UIKit 0x000000018aa2d330 _UIApplicationHandleEvent + 700
8 GraphicsServices 0x000000018f681194 _PurpleEventCallback + 712
9 GraphicsServices 0x000000018f680c84 PurpleEventCallback + 44
10 CoreFoundation 0x0000000185f37a54 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 56
11 CoreFoundation 0x0000000185f379b4 __CFRunLoopDoSource1 + 436
12 CoreFoundation 0x0000000185f35934 __CFRunLoopRun + 1640
13 CoreFoundation 0x0000000185e612d4 CFRunLoopRunSpecific + 396
14 GraphicsServices 0x000000018f67f6fc GSEventRunModal + 168
15 UIKit 0x000000018aa26fac UIApplicationMain + 1488
16 app 0x0000000100099664 main (main.m:18)
17 libdyld.dylib 0x0000000197dcaa08 start + 4

Empty Data Display but also display the headerView

Is it possible to use DZNEmptyDataSet to combine with UICollectionVC ?
I mean my UICollectionVC always has a headerView like the profile page in Twitter. But sometimes the data set is zero and I would like to show a suggestion to user via DZNEmptyDataSet. I already tried but the Empty Display just cover the whole view if data is zero even if I have headerView. Are there any easy way to tweak the module to work that way?

Thanks in advance

Setting the empty frame height without customview

Is there a way to set the emptydataset's frame without redoing a customview?

The reason being, is that this covers the entire scrollview, and sometimes you (I) would like to display an emptydata notice on part of scrollview. Since the frame covers the entire scrollview, headers (for example) are not clickable (unless there is a way to make emptydataset's frame clickthrough)

Tint Image

Is there an easy way to set the TintColor of the ImageView showing the Image?

Drawables source method

Hey,

It would be great to provide a source method for drawable views. I understand that this can be achieved using custom view, but I think drawable views (using a tool like paintCode) are just like the image convenience method. So..

- (UIView *)drawableViewForEmptyDataSet:(UIScrollView *)scrollView;

Is that viable?

Rotation Layout

When rotating a UITableView that implements DZNEmptyDataSet the empty data set view does not adjust it's layout, see GIF:

tableview_rotation_issue

From the GIF you should be able to see 2 issues:

  1. The text does not auto expand to fill the whole width of the screen when rotated to landscape.
  2. The last line ("To clean the list, tap on the trash icon.") gets cut off when rotated to landscape.

If you add the following code to the Colors table example the issue is exacerbated:

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
    [self.tableView reloadData];
}

If instead you use didRotateFromInterfaceOrientation the view will layout properly but the animation is not very good.

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {

    [self.tableView reloadData];
}

Here is how the collection view behaves:

collectionview_rotation_issue

The animation behavior for the collection view is better although the last line is still cut off. The last line being cut off is not really an issues that can be solved without dynamically changing the placeholder image.

Any suggestions on how to make the rotation animation better with table views?

CollectionView crash with EXC_BAD_ACCESS in RubyMotion

Using the pod in a rubymotion project just crashes on controller launch, tested using collection view.

Here's a test dummy app, just incase:

https://github.com/chrise86/DZNEmptyDataSet-test

Crashlog doesn't give much:

Process:               empty-test [59051]
Path:                  /Users/USER/Library/Developer/CoreSimulator/Devices/9AEF6684-00DC-4378-8434-8DAB36AC1571/data/Containers/Bundle/Application/8D3F8687-5523-437E-BEA3-FC58A74403E7/empty-test.app/empty-test
Identifier:            empty-test
Version:               1.0 (1.0)
Code Type:             X86-64 (Native)
Parent Process:        launchd_sim [86291]
Responsible:           launchd_sim [86291]
User ID:               501

Date/Time:             2014-12-23 07:19:32.223 +0000
OS Version:            Mac OS X 10.10.1 (14B25)
Report Version:        11
Anonymous UUID:        31D16FD2-D8DA-BFA3-450F-A5A584F8C004

Sleep/Wake UUID:       D555C7BA-5C28-4F90-8BE9-5DF0291CA26E

Time Awake Since Boot: 150000 seconds
Time Since Wake:       4000 seconds

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_PROTECTION_FAILURE at 0x00007fff5f3ff638

VM Regions Near 0x7fff5f3ff638:
    MALLOC_TINY            0000000111d00000-0000000111f00000 [ 2048K] rw-/rwx SM=PRV  
--> STACK GUARD            00007fff5bc00000-00007fff5f400000 [ 56.0M] ---/rwx SM=NUL  stack guard for thread 0
    Stack                  00007fff5f400000-00007fff5fc00000 [ 8192K] rw-/rwx SM=COW  thread 0

Application Specific Information:
CoreSimulator 110.4 - Device: iPhone 6 - Runtime: iOS 8.1 (12B401) - DeviceType: iPhone 6

buttonBackground Image

If I use a actual image this works great.

But if I use something like

    UIGraphicsBeginImageContext(size);
    CGContextRef currentContext = UIGraphicsGetCurrentContext();
    CGRect fillRect = CGRectMake(0,0,size.width,size.height);
    CGContextSetFillColorWithColor(currentContext, color.CGColor);
    CGContextFillRect(currentContext, fillRect);

    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

to draw an image of size and color.. it stretches out the image to full screen width...

UITableView Swipe to delete in SwipeView

Hi dzen,
I found a weird issue today. I use SwipeView(https://github.com/nicklockwood/SwipeView) as a container, and two tableViews with this empty dataSet as the swipeView itemView. When I need the 2nd tableView to enable swipe-to-delete, the delete button is really hard to be shown. I haven't figured out whether it's the swipeView's the problem or that of DZNEmptyDataSet. But I tryed to trace the code, and insert some code here:
image
The issue's gone. You think we should fix this specific problem?

Issue with UIPickerView/UIDatePicker

After the last update it seems that the UIPickerViews and UIDatePickers became "empty".
It seems that DZNEmptyDataSet is being applied to this controls

UIScrollView+EmptyDataSet breaks default scrolling behavior

Hi, I just encountered this odd bug, which caused me couple days to figure out. My app has a nested scrollView layout. Something looks like the nested layout in this article:
http://ashfurrow.com/blog/putting-a-uicollectionview-in-a-uitableviewcell/
For iOS 5 and later, a gesture will lock to a scroll view once it is triggered, which means I can either scroll vertically OR horizontally, but not both. However, if you import UIScrollView+EmptyDataSet to the project above, it will allow simultaneous scrolling.
Any idea how to fix it?

ld: 14 duplicate symbols for architecture i386

Everything was working fine but when I tried to build the project onto my phone I got this error and now it wont build at all.

I googled around and people say its normally caused by importing .m file instead of a .h file. But I've scanned and grepped the project and didn't find any mistakes like that.

Any idea what could be wrong?

Ld /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/TenMoves.app/TenMoves normal i386
    cd /Users/davidpdrsn/Desktop/TenMoves_old
    export IPHONEOS_DEPLOYMENT_TARGET=7.1
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk -L/Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator -F/Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator -filelist /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Intermediates/TenMoves.build/Debug-iphonesimulator/TenMoves.build/Objects-normal/i386/TenMoves.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -framework UIKit -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.1 -framework CoreGraphics -framework UIKit -framework Foundation -lPods-TenMoves -lPods -Xlinker -dependency_info -Xlinker /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Intermediates/TenMoves.build/Debug-iphonesimulator/TenMoves.build/Objects-normal/i386/TenMoves_dependency_info.dat -o /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/TenMoves.app/TenMoves

duplicate symbol _OBJC_IVAR_$_DZNEmptyDataSetView._contentView in:
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods-TenMoves.a(UIScrollView+EmptyDataSet.o)
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods.a(UIScrollView+EmptyDataSet.o)
duplicate symbol _OBJC_IVAR_$_DZNEmptyDataSetView._titleLabel in:
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods-TenMoves.a(UIScrollView+EmptyDataSet.o)
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods.a(UIScrollView+EmptyDataSet.o)
duplicate symbol _OBJC_IVAR_$_DZNEmptyDataSetView._detailLabel in:
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods-TenMoves.a(UIScrollView+EmptyDataSet.o)
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods.a(UIScrollView+EmptyDataSet.o)
duplicate symbol _OBJC_IVAR_$_DZNEmptyDataSetView._imageView in:
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods-TenMoves.a(UIScrollView+EmptyDataSet.o)
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods.a(UIScrollView+EmptyDataSet.o)
duplicate symbol _OBJC_IVAR_$_DZNEmptyDataSetView._button in:
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods-TenMoves.a(UIScrollView+EmptyDataSet.o)
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods.a(UIScrollView+EmptyDataSet.o)
duplicate symbol _OBJC_IVAR_$_DZNEmptyDataSetView._customView in:
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods-TenMoves.a(UIScrollView+EmptyDataSet.o)
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods.a(UIScrollView+EmptyDataSet.o)
duplicate symbol _OBJC_IVAR_$_DZNEmptyDataSetView._verticalSpace in:
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods-TenMoves.a(UIScrollView+EmptyDataSet.o)
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods.a(UIScrollView+EmptyDataSet.o)
duplicate symbol _OBJC_IVAR_$_DZNEmptyDataSetView._hostView in:
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods-TenMoves.a(UIScrollView+EmptyDataSet.o)
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods.a(UIScrollView+EmptyDataSet.o)
duplicate symbol _OBJC_IVAR_$_DZNEmptyDataSetView._offset in:
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods-TenMoves.a(UIScrollView+EmptyDataSet.o)
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods.a(UIScrollView+EmptyDataSet.o)
duplicate symbol _OBJC_IVAR_$_DZNEmptyDataSetView._centerToSuperview in:
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods-TenMoves.a(UIScrollView+EmptyDataSet.o)
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods.a(UIScrollView+EmptyDataSet.o)
duplicate symbol _dzn_original_implementation in:
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods-TenMoves.a(UIScrollView+EmptyDataSet.o)
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods.a(UIScrollView+EmptyDataSet.o)
duplicate symbol __implementationKey in:
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods-TenMoves.a(UIScrollView+EmptyDataSet.o)
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods.a(UIScrollView+EmptyDataSet.o)
duplicate symbol _OBJC_CLASS_$_DZNEmptyDataSetView in:
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods-TenMoves.a(UIScrollView+EmptyDataSet.o)
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods.a(UIScrollView+EmptyDataSet.o)
duplicate symbol _OBJC_METACLASS_$_DZNEmptyDataSetView in:
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods-TenMoves.a(UIScrollView+EmptyDataSet.o)
    /Users/davidpdrsn/Library/Developer/Xcode/DerivedData/TenMoves-fdbqylzwygncldfrplaseiuqqmek/Build/Products/Debug-iphonesimulator/libPods.a(UIScrollView+EmptyDataSet.o)
ld: 14 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Can't get it to work with UIScrollView

Hello!

Love this library, use it for many table and collection views.
However, I am now trying to use it in a UIScrollView, but the delegate method 'titleForEmptyDataSet' never gets fired.
I set the datasource and delegate in BOTH storyboard and programmatically in my controller class.
One thing to note, the scrollview is a subview of a UITableViewCell (subclassed). I also tried setting the delegate to the subclassed UITableViewCell and still no luck getting the delegate method for setting the title to fire (even set breakpoints in case the text was just out of view, they never get hit).

Any suggestions?
Thanks!

Place for a button reserved even if not used

Hi Ignacio,

I've accidentaly found a potential issue with DZNEmptyDataSet. The centering looked a little bit off to me, so I ran my app through Spark Inspector and it appears that place for a button is reserved despite not implementing buttonTitleForEmptyDataSet:forState: .

Here's a screenshot, which will show what I mean:

issue

Same situation happens when I return nil in buttonTitleForEmptyDataSet:forState: .

Just wanted to let you know :-)

Thanks again for a great lib!

Submit your renders here (320px wide please)

If you are using DZNEmptyDataSet in your application, please take a screenshot of your empty dataset render and submit it here. This will help others to imagine all possibilities with the library.
Thank you!

PS: 320px wide please

DZNEmptyDataSetDelegate required methods

Is there a particular reason why emptyDataSetShouldDisplay, emptyDataSetShouldAllowTouch and emptyDataSetShouldAllowScroll are @required to implement ?

Since they all provide sensible defaults, it would save me quite a few code warnings if these methods could be made @optional.

Replace KVO by method swizzling for better detection

A more stable detection of -reloadData can be done using method swizzling, like proposed by @juzzin. With KVO it's hard to manage real changes and also adds difficulties to unregister forcing to set the datasource to nil at dealloc. Method swizzling -reloadData should make it easier and straightforward.

Allowing touches to views underneath the empty view.

Since userInteractionEnabled is set to YES on emptyDataSetView, all touches to views underneath are blocked.

This is probably fine for the majority of cases, however I have a header in my UICollectionView using a supplementaryView. Even though the main content is empty, there are still actions that need to be performed from the header. Touches to the supplementary view are currently blocked making it unusable.

It would be great to have an option to enable the behaviour I described above. This is actually what I expected -emptyDataSetShouldAllowTouch: to do, but that is not the case.

EXC_BAD_ACCES when used with NSFetchedResultsController

I get an EXC_BAD_ACCES crash on the " ((void(*)(id,SEL))reloadData_orig)(self,_cmd);" method in:

void dzn_original_implementation(id self, SEL _cmd)
{
// Fetch original implementation from lookup table
NSString *key = _implementationKey(self, _cmd);
NSValue *impValue = [_impLookupTable valueForKey:key];

IMP reloadData_orig = [impValue pointerValue];

// If found, call original implementation
if (reloadData_orig) {
    ((void(*)(id,SEL))reloadData_orig)(self,_cmd);
}

[self dzn_reloadData];

}

This occurs when the NSFetchedResultsController Delegate Method gets called on a tableView with the empty data set.

  • (void)controllerDidChangeContent:(NSFetchedResultsController*)controller
    {
    if (self.beganUpdates) {
    [self.tableView endUpdates];
    }
    }

Gestures not reaching custom view in iOS7 when tableview has a background view

Hi, here's curly one.

It appears that if you insert the empty view beneath the UITableViewWrapperView in the tableview's hierarchy, gestures don't work in iOS7.

Normally it's fine, since inserting the empty view at index 1 puts it above this view (UITableViewWrapperView view is usually at index 0)

But if you've set a background view for your tableview, the background view is at index 0 and the UITableViewWrapperView is at index 1. Thus the empty view is inserted beneath the UITableViewWrapperView view.

This is only a problem in iOS7. In iOS8 inserting the empty view beneath the UITableViewWrapperView view doesn't seem to matter, gestures still work.

Here's my solution:

if ([self isKindOfClass:[UITableView class]] && self.subviews.count > 1) {
    UITableView *tableview = (UITableView *)self;
    if (tableview.backgroundView && self.subviews.count > 2) {
       [tableview insertSubview:view atIndex:2];
   } else {
       [tableview insertSubview:view atIndex:1];
   }
}

I can submit a pull request if you think the above is not crazy.

Buttons not registering tap events

The buttons returned (shown) from

- (NSAttributedString *)buttonTitleForEmptyDataSet:(UIScrollView *)scrollView forState:(UIControlState)state;

aren't registering touch events. The button appears to be displayed properly but tapping them does nothing on devices running iOS 7.x using Xcode 5.1.1. However, the buttons are working properly in the iOS 8 betas.

Thanks,
Wes

Import functionality into Swift project

Great package, I'd love to be able to use this in my Swift project. There doesn't appear to be anything that would make this package incompatible with Swift but I've not been successful in getting it to work. I've added the Pod to my Podfile and successfully imported it with my Objective-C bridging header:

#import <DZNEmptyDataSet/UIScrollView+EmptyDataSet.h>

However when trying to use it in a view controller Xcode is unable to find the source and delegate protocols.

class FavoritesTableViewController: UITableViewController, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate

I took a guess and tried to use import DZNEmptyDataSet at the top of my file, but that didn't solve the issue. Is there a supported way at this stage to use the protocols for this package in a Swift project?

Empty data set in different positions

Hi,

I'm having a very strange problem: the empty data set moves to a different position after some data have been available for a controller and then were removed.

The screenshot below shows what I have in mind:

dzn-error

The empty data set first appears as on the left screenshot. Then, after adding and deleting some data it appears as on the right screenshot.

I do reload the view in viewWillAppear.

This is only a minor issue but do you have any ideas on why this might be happening?

Cheers,

Pawel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.