Giter Club home page Giter Club logo

mxsegmentedpager's People

Contributors

bigluck avatar bitdeli-chef avatar cerupcat avatar drjid avatar jiangmingz avatar maxep avatar mdagostino avatar nixon506e avatar riosc 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

mxsegmentedpager's Issues

Forgotten removeObserver in dealloc

In MXPagerView class you registered self as KVO observer in - (instancetype)init:

    [self addObserver:self forKeyPath:NSStringFromSelector(@selector(contentOffset))
              options:NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld
              context:kMXPagerViewKVOContext];

    [self addObserver:self forKeyPath:NSStringFromSelector(@selector(contentSize))
              options:0
              context:kMXPagerViewKVOContext];

But in - (void)dealloc you forgot to removeObserver. This will lead to crash.

Header Imageview gets 'stuck' at larger size when pulled down in parallax mode

When I use MXSegmentedPager for my detail controller in a uisplitviewcontroller, I encounter the following issue.

Pulling down the view past a certain point results in the enlarged image view 'sticking' at its enlarged size. When the view is released and the header returns to normal size, the imageview is still enlarged.

This is happening in the split view sample app we looked at in a previous issue.

Data disappearing from tableview

Hello, first let me say just thank for creating this awesome project.

I have been figthing with these issue a couple of days now, a ViewController that loads a simple segmented Pager, the first "panel" is loaded from a TableView in the storyboard, when I run the application the data stay on the view only if I do not scroll down, if for some reason I do it, then the cell erase all the labels.

Could you please, take a look and give me some advice.

ViewController.h


#import <UIKit/UIKit.h>

@interface ViewController : UIViewController

@end

ViewController.m


#import "ViewController.h"
#import "MXSegmentedPager.h"
#import "Parse.h"
#import "ParseUI.h"
#import "myCustomCell.h"

@interface ViewController () <MXSegmentedPagerDelegate, MXSegmentedPagerDataSource, UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) MXSegmentedPager  * segmentedPager;
@property (nonatomic, strong) UITableView       * tableView;
@property (nonatomic, strong) UITableView       * tomorrow;
@property (nonatomic, strong) UITableView       * week;
@property (nonatomic, strong) UITableView *ppp;
@property (nonatomic, strong) UITableView *ptabla;




@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    self.navigationController.navigationBar.translucent = NO;
    //self.title = @"Fixtures";

    // Setup the segmented pager properties
    self.segmentedPager.delegate = self;
    self.segmentedPager.dataSource = self;
    self.segmentedPager.segmentedControl.selectionIndicatorLocation = HMSegmentedControlSelectionIndicatorLocationDown;
    self.segmentedPager.segmentedControl.backgroundColor = [UIColor colorWithRed:0.7 green:0.7 blue:0.7 alpha:1];
    self.segmentedPager.segmentedControl.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor blackColor]};
    self.segmentedPager.segmentedControl.selectedTitleTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]};
    self.segmentedPager.segmentedControl.selectionIndicatorColor = [UIColor colorWithRed:0.3 green:0.3 blue:0.3 alpha:1];

    [self.view addSubview:self.segmentedPager];






}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


#pragma -mark Properties

- (MXSegmentedPager *)segmentedPager {
    if (!_segmentedPager) {

        // Set a segmented pager
        _segmentedPager = [[MXSegmentedPager alloc] initWithFrame:(CGRect){
            .origin         = CGPointZero,
            .size.width     = self.view.frame.size.width,
            .size.height    = self.view.frame.size.height - 64.f
        }];
    }
    return _segmentedPager;
}



- (UITableView *)ppp {
    if (!_ppp) {
        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"re" bundle:nil];
        UITableViewController* theController = [storyboard instantiateViewControllerWithIdentifier:@"fff"];

        _ppp = theController.tableView;
    }
    return _ppp;
}


- (UITableView *)tableView {
    if (!_tableView) {
        //Add a table page
        _tableView = [[UITableView alloc] initWithFrame:(CGRect){
            .origin = CGPointZero,
            .size   = self.segmentedPager.containerSize
        }];

        _tableView.delegate = self;
        _tableView.dataSource = self;
    }
    return _tableView;
}

- (UITableView *)tomorrow {
    if (!_tomorrow) {
        //Add a table page
        _tomorrow = [[UITableView alloc] initWithFrame:(CGRect){
            .origin = CGPointZero,
            .size   = self.segmentedPager.containerSize
        }];

        _tomorrow.delegate = self;
        _tomorrow.dataSource = self;
    }
    return _tomorrow;
}

- (UITableView *)week {
    if (!_week) {
        //Add a table page
        _week = [[UITableView alloc] initWithFrame:(CGRect){
            .origin = CGPointZero,
            .size   = self.segmentedPager.containerSize
        }];
        _week.delegate = self;
        _week.dataSource = self;
    }
    return _week;
}

/*
- (void) segmentedPager:(MXSegmentedPager*)segmentedPager didSelectViewWithIndex:(NSInteger)index {
    if(index == 0){
        NSLog(@"Selecciono el cero");
    }
    if(index == 1){
        NSLog(@"Selecciono el 1");
    }
    if(index == 2){
        NSLog(@"Selecciono el 2");
    }
}

*/
#pragma -mark <MXSegmentedPagerDataSource>

- (NSInteger)numberOfPagesInSegmentedPager:(MXSegmentedPager *)segmentedPager {
    return 3;
}

- (NSString *)segmentedPager:(MXSegmentedPager *)segmentedPager titleForSectionAtIndex:(NSInteger)index {
    return [@[@"Today", @"Tomorrow", @"Week"] objectAtIndex:index];
}

- (UIView *)segmentedPager:(MXSegmentedPager *)segmentedPager viewForPageAtIndex:(NSInteger)index {


    return [@[self.ppp, self.tomorrow, self.week] objectAtIndex:index];


}

#pragma -mark <UITableViewDelegate>

- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 50;
}

- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath {
    //MXSimpleViewController *simpleViewController = [[MXSimpleViewController alloc] init];
    //[self.navigationController pushViewController:simpleViewController animated:YES];
}

#pragma -mark <UITableViewDataSource>

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    myCustomCell *cell = [tableView dequeueReusableCellWithIdentifier:@"myCell"];
    if(!cell)
    {
        [tableView registerNib:[UINib nibWithNibName:@"customCell" bundle:nil] forCellReuseIdentifier:@"myCell"];
        cell = [tableView dequeueReusableCellWithIdentifier:@"myCell"];

        tableView.rowHeight = cell.frame.size.height;

    }
    cell.local.text = [NSString stringWithFormat:@"Row %ld", (long)indexPath.row];
    cell.visitante.text = [NSString stringWithFormat:@"Row %ld", (long)indexPath.row];


    return cell;

}


The "fff" TableViewController only set the value of two labels in a prototype cell. But the ideal behavior will be getting the data out of Parse

Thanks and sorry for my english

Issue using storyboard

Hi,

i'm trying to add your very nice library into my project but i've got an issue when i insert the mxsegmentedPager directly in the storyboard.
It seems the datasource and delegate need to be set at first place but the app failed before i can set them in my viewController.
Here is the error :
capture d ecran 2015-05-13 a 17 08 26

Could you help me with that ?

Thanks in advance

How to add a pulltorefresh function

If I want to add a pull to refresh function, how can I do that?
Or when the header had scrolled down to the bottom(without stretched), how can I just scroll down the tableview to pull to refresh. Thanks

viewWill/DidAppear and viewWill/DidDisappear aren't called

Hi @maxep

I have two ViewControllers loaded by MXSegmentedPage; in all this two ViewControllers can be played a video flow by the user.

When user change the current tab I have to pause the played video for the hidden tab.

I've thinked to put my logic into the ViewController waiting for a viewWillAppear/viewDidAppear call for the current selected tab and a viewWillDisappear/viewDidDisappear for the previous selected tab, but this methods aren't called right now.

Can you help me?

Thanks

SegmentedControl needs layout constraints

I got this working last time by adding the views programmatically (not hooking up MXSegmentedPager in the storyboard). I have some pretty complex view controllers in my app, and I am trying to hook up MXSegmentedPager to an outlet in storyboard, where the top and bottom constraints change.

I have found that the segmented control needs constraints. I added this to - (HMSegmentedControl *)segmentedControl method:

    _segmentedControl.translatesAutoresizingMaskIntoConstraints = NO;
    NSDictionary *binding  = @{@"v" : _segmentedControl};
    [self addConstraints:[NSLayoutConstraint
                          constraintsWithVisualFormat:@"H:|-0-[v]-0-|"
                          options:NSLayoutFormatDirectionLeadingToTrailing
                          metrics:nil
                          views:binding]];

    [self addConstraints:[NSLayoutConstraint
                          constraintsWithVisualFormat:@"V:|-0-[v(50)]"
                          options:NSLayoutFormatDirectionLeadingToTrailing
                          metrics:nil
                          views:binding]];

which works well. But only in the case that there is no ParallaxHeader.

I am having trouble adding the constraints to the MXSegmentedPager+ParallaxHeader.m file, when a parallax header exists. No matter where I add them, things blow up.

Unwanted view animation on screen frame change

I am using iAd in my app. Sometimes, the screen frame increases and decreases momentarily as the iAd leaves and comes back on the screen. This causes a visible double-reload of the screen, which looks awful - the screen seems to jerk and flicker.

reloadData doesn't update segmentedControl

Hi, I think I've found a bug in the latest version 3.0.1.

In my MXSegmentedPagerController subclass I have just one page when the ViewController is loaded, but after a while (when a remote feed is loaded) I need to add another page.

Even if I call self.segmentedPager.reloadData() the segmentedControl view doesn't update itself, until I manually swipe into the first item.

Somebody can help me?
Thanks.

Content Offset change causes new segment to be selected

The contentOffset changes when the iPad rotates or when the detail view of a UISplitviewController is expanded to fill the width of the screen. The change in contentOffset sets off this sequence

-[MXPagerView observeValueForKeyPath:ofObject:change:context:]
-[MXPagerView didScrollFromPosition:ToPosition:]
-[MXPagerView setIndex:]
-[MXSegmentedPager pagerView:didMoveToPageAtIndex:]

which calls:
[self.segmentedControl setSelectedSegmentIndex:index animated:NO];

So when I rotate the iPad or expand the detailView of a UISplitviewController to fill the screen, a different segment of the segmentedControl is often selected (sometimes it does not switch, but in many/most cases it does).

Removing Parallax

Nice work there. But, is it possible for me to disable the parallax. I don't want it. Thanks

UIScrollView issue

Hi, i implement this cool library in my app. I implement with a UIScrollView but i have this issue. Can you help me?

Thanks!

example

[change ParallaxHeader size]

Hello,

  • can we change the height of the ParallaxHeader
  • we did like this :
  • first :
    segmentedPager.setParallaxHeaderView(headerView, mode: .TopFill,
    height: 300)
  • then :
    segmentedPager.setParallaxHeaderView(headerView, mode: .TopFill,
    height: 600)
  • But it is not work, Error:
Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want. 
    Try this: 
        (1) look at each constraint and try to figure out which you don't expect; 
        (2) find the code that added the unwanted constraint or constraints and fix it. 
(
    "<NSLayoutConstraint:0x21dc73fb0 V:[PrcmQA.NewUserInfoView:0x21dbebe80(300)]>",
    "<NSLayoutConstraint:0x24863bfb0 V:[PrcmQA.NewUserInfoView:0x21dbebe80(>=600)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x24863bfb0 V:[PrcmQA.NewUserInfoView:0x21dbebe80(>=600)]>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.

Thanks for your advice.

didSelectViewWithIndex called multiple times

I have a MXSegmentedPager with two lists and a parallax header.

I am implementing the method

- (void)segmentedPager:(MXSegmentedPager *)segmentedPager didSelectViewWithIndex:(NSInteger)index

to change the parallax header whenever the list changes (I change the imageView's image).

I animate the change of pictures for .5 seconds to make it a bit smoother. Whenever I transition from the first tab to the second, the animation is fine. However, on certain instances, when I change from tab two to tab one, the animation doesn't work.

I logged a message whenever the animation started and when it finished and it seemed that the animation was starting twice. I then put a log at the beginning of the method and confirmed that the method was indeed called twice when switching from the second tab to the first one.

Prohibiting Horizontal Scrolling between Views

I cannot find a way to keep the user from scrolling between the views using horizontal gestures. I want to allow the user to tap the segmentedControl to change views, but I do not want the control to recognize and respond to horizontal gestures. I use several tableviews and I need the swipe to delete functionality; the tableview currently doesn't recognize swipe to delete since this gesture currently will only scroll between the views. I am using MXSegmentedPager only. Tried to remove the gesture recognizer delegate (among other things) and it did not work.

Wrong bottom position of tableViews with translucent NavBar

Hi @maxep, sorry for the massive number of issues I'm opening in those days :(

I'm having a rendering problem when using MXSegmentedPager without the parallax header and with an Translucent Navigation Bar.

You can reprocude the same bug using the MXSegmentedPager-Swift sample.

  • Ad an Navigation Controller in the Main.storyboard
  • Make the Navigation Controller as the Initial View Controller
  • Connect the MXViewController as the root view controller of the Navigation Controller.
    0 In the Navigation Controller select the Navigation Bar component and enable Translucent from the Attributes inspector

Last step: comment out all parallaxHeader settings from the MXViewController.swift file and run.

The last two rows (Row 48 and Row 49) is partially hidden on the bottom of the view

Reuse UIViewController for multiple tabs

Hi @maxep

Once again thanks for the awesome library...Is it possible to reuse the view controller..the way we reuse the uiview...my task is to create dynamic list of products under different categories which are dynamic..So i want to use a viewcontroller which has tableview in it and reuse that viewcontroller for multiple categories...

Thanks

remove observer crash at MXParallaxHeader

When I implement segmentedpager at a detail page and want to push pop the view it crashes some times at first pop and sometimes at second push. Here is the call stack.

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x14480a600 of class MXScrollView was deallocated while key value observers were still registered with it. Current observation info: NSKeyValueObservationInfo 0x144704da0 (
NSKeyValueObservance 0x14468d180: Observer: 0x144588900, Key path: contentOffset, Options: New: YES, Old: NO, Prior: NO Context: 0x1001e00e8, Property: 0x144553890
NSKeyValueObservance 0x1446dc1b0: Observer: 0x144588900, Key path: contentInset, Options: New: YES, Old: YES, Prior: NO Context: 0x1001e00e8, Property: 0x1446bcc30
)'
*** First throw call stack:
(0x18475cf48 0x19930ff80 0x18475ce90 0x18561f640 0x199329ae8 0x184640a4c 0x184712068 0x184640ca0 0x18f87c088 0x189d58ffc 0x1000c3fe8 0x199b5e8b8)
libc++abi.dylib: terminating with uncaught exception of type NSException

MXSegmentedPager blocks use of NSAttributedString titles with HMSegmentedControl

HMSegmentedControl supports the use of NSAttributedString as titles, however the MXSegmentedPager control blocks this as the MXSegmentedPagerDatasource protocol prescribes the use of NSString (which NSAttributedString does not subclass from) as part of its interface contract on the datasource method:

- (NSString*) segmentedPager:(MXSegmentedPager*)segmentedPager titleForSectionAtIndex:(NSInteger)index;

Lazy load each page.

I'm wondering if it'd be easy to add the ability to lazily load a page. For example, rather than allocating all views for each tab on creation, I'd probably want to only load the current one in view or the current one and the next one so that I don't keep them all in memory. Essentially having something more like UIPageViewController where the pages are reused or allocated/deallocated when shown / hidden would be ideal.

Any thoughts on how this might be accomplished?

Bump podspec

It doesn't look like all the latest code is in the latest podspec. Can you bump the version of the podspec so we can get the latest?

View controllers' views added only when segment clicked

Hi, is there an easy way to use

- (UIView *)segmentedPager:(MXSegmentedPager *)segmentedPager viewForPageAtIndex:(NSInteger)index

to use View Controller Subviews that would be loaded only when the corresponding segment control is selected?

The goal would be to use view controllers' subviews where data is loaded.

Failing when using using another Pan Gesture

I copied and pasted the code from MXParallaxViewController into a file (I called it SampleViewPager) in my project.

I then hooked it up to my REFrostedViewController (it is a drawer library I use which uses a panGestureRecognizer to slide the side menu in and out).

This causes it to crash at removeObserverFromView, specifically when it calls [view removeObserver: self forKeyPath:kContentOffsetKeyPath context:kMXScrollViewKVOContext];

It only crashes when the app loads and I try to scroll something within the tableview / webview / text view

MXSegmentedPager with Navigation Controller

Does MXSegmentedPager remove the navigation controller from displaying? I have a MXSegmentedPager embedded in a navigation controller (logging self.navgiationController outputs a NavigationController object) and it doesn't seem to show up (the nav bar).

Resizing tableView

Hello, I'm trying to resize my tableView width by updating the frame of tableview but doesn't worked , I've tried to update tableview with at creation time, at viewWillAppear, tied to change cell Size at cellForRow... but none of them worked any help over here ?

Add new updates to pod

pod update not downloading the latest update...please update the pod to the latest commit...Thanks

Offset when using with UINavigationController

Hi, I'm using MXSegmentedPager inside an UINavigationController. In iOS 8 it works great but in iOS 9 there's a blank offset of 64 at the top, which I think is 20 from the status bar and 44 from the navigation bar. The parallax header wouldn't scroll above that blank space but the segmented controller would.

I was able to fix this bug by adding this lines at the top of your function in MXParallaxHeader.m file:

- (void) setScrollViewContentTopInset:(CGFloat)top {

   if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0")) {
        top = self.height;
    }
   //rest of the code
}

Request: Ability to support space between pages like UIPageView

I can't see any reference to a property supporting space between the page views within MXSegmentedPager and associated classes - apologies if I have missed it.

It would be nice to be able to support a 'gutter' between the page views like the UIPageView's UIPageViewControllerOptionInterPageSpacingKey option.

Freeze with empty list of pages

Hi @maxep, you can reproduce this bug by adding this code in the MXSegmentedPager-Swift sample:

override func numberOfPagesInSegmentedPager(segmentedPager: MXSegmentedPager) -> Int {
    return 0
}

Thanks,
Luca

UIViewcontroller with tableview inside scrolls oddly when using parallax

When using parallax, if I create a UIViewController with a tableview inside as one of the pages, the tableview scrolls it's content when scrolling up (before hitting the top).

In the video below, the first page is a regular tableView which works correctly. The 'top' tab is a UIViewController with a tableView inside and displays how the tableView content is scrolling with the outer scrollView incorrectly.

p9s29mladv

Question: View above the HMSegmentedControl

Is there a way to insert a static (i.e. non parallax) view above the HMSegmentedControl - so the control does not appear at the top of the screen. For instance, if one wanted to put content above the control that shows regardless of selected segment.

Or is VGParallaxHeader the preferred approach to this - but 'turning off' the parallax effect?

Crashing in v3.0

Hi, when I dismissed the modal View Controller containing the MXSegmentPager instance, application crashed with the following error.

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x151e9000 of class MXScrollView was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x16259d70> (...)'

Update in header height

You can set the parallax header and height. However, if you need to change the height of the header, there seems to be no way to do this.

How to add icon with title in tabs?

Hi @maxep

How to add icon with title in tabs in vertical manner like icon at top and title at bottom? I tried setting up icons in this way but icons are not visible only title is displayed.

- (void)viewDidLoad {
[super viewDidLoad];
self.segmentedPager.backgroundColor = [UIColor whiteColor];

self.segmentedPager.pager.transitionStyle = MXPagerViewTransitionStyleScroll;
self.segmentedPager.segmentedControl.backgroundColor = [UIColor colorWithRed: 244.f/255.f green:67.f/255.f blue:54.f/255.f alpha:1.f];
self.segmentedPager.segmentedControl.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]};
self.segmentedPager.segmentedControl.selectedTitleTextAttributes = @{NSForegroundColorAttributeName : [UIColor colorWithRed:0.1 green:0.1 blue:0.1 alpha:1]};
self.segmentedPager.segmentedControl.selectionIndicatorColor = [UIColor whiteColor];
self.segmentedPager.segmentedControlPosition = MXSegmentedControlPositionTop;
self.segmentedPager.segmentedControl.selectionIndicatorLocation = HMSegmentedControlSelectionIndicatorLocationDown;
self.segmentedPager.segmentedControl.selectionStyle = HMSegmentedControlSelectionStyleFullWidthStripe;
self.segmentedPager.segmentedControl.selectedTitleTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]};
self.segmentedPager.segmentedControl.selectionIndicatorHeight = 2.f;
}

- (void)viewWillLayoutSubviews {
self.segmentedPager.frame = (CGRect){
    .origin = CGPointZero,
    .size   = self.view.frame.size
};
[super viewWillLayoutSubviews];
}

- (NSString *)segmentedPager:(MXSegmentedPager *)segmentedPager titleForSectionAtIndex:(NSInteger)index {
//return (index < 1)? @"Room Furniture": @"In The Rack";
return [@[@"TAB1",@"TAB2",@"TAB3", @"TAB4", @"TAB5", @"TAB6", @"TAB7", @"TAB8", @"TAB9"] objectAtIndex:index];
}

- (UIImage*) segmentedPager:(MXSegmentedPager*)segmentedPager imageForSectionAtIndex:(NSInteger)index{
//return (index < 1)? ;
NSLog(@"imageForSectionAtIndex -----%ld",(long)index);
self.imageNames = @[@"tab1.png",
                    @"tab2.png",
                    @"tab3.png",
                    @"tab4.png",
                    @"tab5.png",
                    @"tab6.png",
                    @"tab7.png",
                    @"tab8.png",
                    @"tab9.png"];

self.imagesURL = [[NSMutableArray alloc ]init];
for (int i=0; i<self.imageNames.count; i++) {
    NSString*file = [NSString stringWithFormat:@"%@",[self.imageNames objectAtIndex:i]];
    [self.imagesURL addObject:[UIImage imageNamed:file]];
   // NSLog(@"MY image ----------%@",[UIImage imageNamed:file]);
}
return [self.imagesURL objectAtIndex:index];
}

Memory leaks

Hi @maxep
in this last two days I'm fighting with some memory leaks in my application, but I think this leaks depends by MXSegmentedPager.

So I've downloaded the MXSegmentedPager-Swift sample and I've added a new NavigationController with a button in the NavigationBar; this button will push your MXViewController.

schermata 2015-12-16 alle 12 19 10

  • I've started the application with the Profile > Allocations inspector and before start I've checked the "Record reference counts" option; here the Inspector after launching the application (it's cleaned):

schermata 2015-12-16 alle 12 20 59

  • I've clicked on the "Button" button; this button will push your MXViewController in the Navigation Controller:

schermata 2015-12-16 alle 12 21 05

  • I've swipped between the tree tabs:

schermata 2015-12-16 alle 12 21 09

  • A snapshot of the allocations when I come back to the Root View Controller:

schermata 2015-12-16 alle 12 21 13

  • I'm again in the Root View Controller but this time I've opened and closed the MXViewController subview for 10 times.

schermata 2015-12-16 alle 12 27 56

Can you help me?

NSInternalInconsistencyException error

It's hard to say if this is my code implementation or something in MXSegmentedPager that needs to remove obserever. I'm getting the followed error when removing a view that has a MXSegmentedPager.

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x137577700 of class MXPagerView was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x170c55e40> ( <NSKeyValueObservance 0x1702d4cf0: Observer: 0x137577700, Key path: contentOffset, Options: <New: YES, Old: YES, Prior: NO> Context: 0x100ab23f0, Property: 0x17084e4c0> <NSKeyValueObservance 0x1702d4b30: Observer: 0x137577700, Key path: contentSize, Options: <New: NO, Old: NO, Prior: NO> Context: 0x100ab23f0, Property: 0x170851fd0>

Issue with Rotation on iPad

I am a novice programmer and I would fix this on a fork if I could. But it seems like constraints to its superview are not being set within the control.

I did get the control working in Storyboard. But when I use it in the detail view controller for a UISplitViewController, then rotate the view from portrait to landscape, the width of the control does not resize. I set the constraints from the MXSegmentedPager to its superview, but within the MXSegmentedPager itself, it doesn't seem like there are constraints set for the various components.

Again, I would do it if I knew how. Just learning all of this.

Thanks again for this great control.

Crashing app everytime.

I'm trying to setup view pager. i returning 4 pages at number method , same title for every page and same tableview for every page.

P.S : I'm not using storyboards.

* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* setObjectForKey: object cannot be nil (key: 0)'
*** First throw call stack:
(
0 CoreFoundation 0x000000010800cf65 exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000109971deb objc_exception_throw + 48
2 CoreFoundation 0x0000000107f0ad72 -[__NSDictionaryM setObject:forKey:] + 1042
3 MXSegmentedPager 0x0000000108e176d1 __31-[MXPagerView loadPageAtIndex:]_block_invoke + 657
4 MXSegmentedPager 0x0000000108e173c3 -[MXPagerView loadPageAtIndex:] + 131
5 MXSegmentedPager 0x0000000108e1602c -[MXPagerView reloadData] + 876
6 MXSegmentedPager 0x0000000108e19a03 -[MXSegmentedPager reloadData] + 1299
7 MXSegmentedPager 0x0000000108e1876f -[MXSegmentedPager layoutSubviews] + 63
8 UIKit 0x0000000109e8911c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 710
9 QuartzCore 0x000000010912b36a -[CALayer layoutSublayers] + 146
10 QuartzCore 0x000000010911fbd0 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
11 QuartzCore 0x000000010911fa4e _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
12 QuartzCore 0x00000001091141d5 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
13 QuartzCore 0x00000001091419f0 _ZN2CA11Transaction6commitEv + 508
14 QuartzCore 0x0000000109142154 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
15 CoreFoundation 0x0000000107f389d7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION
+ 23
16 CoreFoundation 0x0000000107f38947 __CFRunLoopDoObservers + 391
17 CoreFoundation 0x0000000107f2e59b __CFRunLoopRun + 1147
18 CoreFoundation 0x0000000107f2de98 CFRunLoopRunSpecific + 488
19 GraphicsServices 0x000000010d898ad2 GSEventRunModal + 161
20 UIKit 0x0000000109dd8676 UIApplicationMain + 171
21 FoodKlik 0x00000001068766df main + 111
22 libdyld.dylib 0x000000010b3af92d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

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.