Giter Site home page Giter Site logo

kazuhiro4949 / pagingkit Goto Github PK

View Code? Open in Web Editor NEW
1.4K 21.0 120.0 1.26 MB

PagingKit provides customizable menu UI. It has more flexible layout and design than the other libraries.

License: MIT License

Swift 98.95% Objective-C 0.54% Ruby 0.51%
ios swift uikit segmentcontrol paging pageviewcontroller uitableview uicollectionview uicollectionviewlayout

pagingkit's Introduction

img

Platform Swift 5.1 License Version Carthage compatible Swift Package Manager compatible

PagingKit provides customizable menu & content UI. It has more flexible layout and design than the other libraries.

What's this?

There are many libraries providing "Paging UI" which have menu and content area. They are convenient but not customizable because your app has to be made compatible with the libraries' layout and view components. When a UI desgin in your app doesn't fit the libraries, you need to fork them or find another one.

PagingKit has more flexible layout and design than the other libraries. You can construct "Menu" and "Content" UI, and they work together. That's all features this library provides. You can fit any design to your apps as you like.

paging_sample

Customized layout

You can align views as you like.

changing position placing a view between content and menu added floating button on right-side on navigation bar
sample_5 sample_4 sample6 2018-12-04 10 00 51

Customized menu design

You can customize menu as you like.

tag like menu text highlighted menu underscore menu App Store app like indicator
sample_3 sample_1 indicator

I'm looking for a pull request of your custom menu design :)

Feature

  • easy to construct Paging UI
  • customizable layout and design
  • UIKit like API
  • Supporting iPhone, iPad and iPhone X

Requirements

  • iOS 9.0+
  • Xcode 11.0+
  • Swift 5.1

Installation

Swift Package Manager

open Swift Packages (which is next to Build Settings). You can add and remove packages from this tab.

See Adding Package Dependencies to Your App

CocoaPods

  • Install CocoaPods
> gem install cocoapods
> pod setup
  • Create Podfile
> pod init
  • Edit Podfile
target 'YourProject' do
  use_frameworks!

  pod "PagingKit" # add

  target 'YourProject' do
    inherit! :search_paths
  end

  target 'YourProject' do
    inherit! :search_paths
  end

end
  • Install
> pod install

open .xcworkspace

Carthage

  • Install Carthage from Homebrew
> ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
> brew update
> brew install carthage
  • Move your project dir and create Cartfile
> touch Cartfile
  • add the following line to Cartfile
github "kazuhiro4949/PagingKit"
  • Create framework
> carthage update --platform iOS
  • In Xcode, move to "Genera > Build Phase > Linked Frameworks and Library"
  • Add the framework to your project
  • Add a new run script and put the following code
/usr/local/bin/carthage copy-frameworks
  • Click "+" at Input file and Add the framework path
$(SRCROOT)/Carthage/Build/iOS/PagingKit.framework
  • Write Import statement on your source file
import PagingKit

Getting Started

There are some samples in this library.

https://github.com/kazuhiro4949/PagingKit/tree/master/iOS%20Sample/iOS%20Sample

You can fit PagingKit into your project as the samples do. Check out this repository and open the workspace.

PagingKit has two essential classes.

  • PagingMenuViewController
  • PagingContentViewController

PagingMenuViewController provides interactive menu for each content. PagingContentViewController provides the contents on a scrollview.

If you make a new project which contains PagingKit, follow the steps.

  1. Add PagingMenuViewController & PagingContentViewController
  2. Assign them to properties
  3. Create menu UI
  4. display data
  5. Synchronize Menu and Content view controllers

1. Add PagingMenuViewController & PagingContentViewController

First, add PagingMenuViewController & PagingContentViewController on container view with Stroyboard.

1. Put container views on Storyboard

Put container views on stroyboard for each the view controllers.

2017-08-25 16 33 51

2. Change class names

input PagingMenuViewController on custom class setting. 2017-08-25 16 36 36

input PagingContentViewController on custom class setting.

2017-08-25 16 36 54

2. Assign them to properties

Assign them on code of the container view controller.

1. Declare properties for the view controllers

Declare properties in container view controller.

class ViewController: UIViewController {
    
    var menuViewController: PagingMenuViewController!
    var contentViewController: PagingContentViewController!

2. override prepare(segue:sender:) and assign the view controllers

Assigin view controllers to each the property on prepare(segue:sender:).

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if let vc = segue.destination as? PagingMenuViewController {
            menuViewController = vc
        } else if let vc = segue.destination as? PagingContentViewController {
            contentViewController = vc
        }
    }

3. Build App

Change menu color. 2017-08-25 17 47 58

Build and check the current state.

2017-08-25 17 47 29

It shows a container view controller that has PagingMenuViewController and PagingContentViewController.

3. Create menu UI

Next, you needs to prepare the menu elements.

1. Inherite PagingMenuViewCell and create custom cell

PagingKit has PagingMenuViewCell. PagingMenuViewController uses it to construct each menu element.

import UIKit
import PagingKit

class MenuCell: PagingMenuViewCell {
    @IBOutlet weak var titleLabel: UILabel!
}

2017-08-25 16 56 56

2. Inherite PagingFocusView and create custom view

PagingKit has PagingFocusView. PagingMenuViewController uses it to point the current focusted menu.

2017-08-25 16 59 07

3. register the above views to PagingMenuViewController

class ViewController: UIViewController {
    
    var menuViewController: PagingMenuViewController!
    var contentViewController: PagingContentViewController!

    override func viewDidLoad() {
        super.viewDidLoad()
        
        menuViewController.register(nib: UINib(nibName: "MenuCell", bundle: nil), forCellWithReuseIdentifier: "MenuCell")
        menuViewController.registerFocusView(nib: UINib(nibName: "FocusView", bundle: nil))
    }

4. display data

Then, implement the data sources to display contents. They are a similar to UITableViewDataSource.

1. prepare data

class ViewController: UIViewController {
    static var viewController: (UIColor) -> UIViewController = { (color) in
       let vc = UIViewController()
        vc.view.backgroundColor = color
        return vc
    }
    
    var dataSource = [(menuTitle: "test1", vc: viewController(.red)), (menuTitle: "test2", vc: viewController(.blue)), (menuTitle: "test3", vc: viewController(.yellow))]

2. set menu data source

Return number of menus, menu widthes and PagingMenuViewCell objects.

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if let vc = segue.destination as? PagingMenuViewController {
            menuViewController = vc
            menuViewController.dataSource = self // <- set menu data source
        } else if let vc = segue.destination as? PagingContentViewController {
            contentViewController = vc
        }
    }
}

extension ViewController: PagingMenuViewControllerDataSource {
    func numberOfItemsForMenuViewController(viewController: PagingMenuViewController) -> Int {
        return dataSource.count
    }
    
    func menuViewController(viewController: PagingMenuViewController, widthForItemAt index: Int) -> CGFloat {
        return 100
    }
    
    func menuViewController(viewController: PagingMenuViewController, cellForItemAt index: Int) -> PagingMenuViewCell {
        let cell = viewController.dequeueReusableCell(withReuseIdentifier: "MenuCell", for: index) as! MenuCell
        cell.titleLabel.text = dataSource[index].menuTitle
        return cell
    }
}

3. configure content data source

Return the number of contents and view controllers.

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if let vc = segue.destination as? PagingMenuViewController {
            menuViewController = vc
            menuViewController.dataSource = self
        } else if let vc = segue.destination as? PagingContentViewController {
            contentViewController = vc
            contentViewController.dataSource = self // <- set content data source
        }
    }
}

extension ViewController: PagingContentViewControllerDataSource {
    func numberOfItemsForContentViewController(viewController: PagingContentViewController) -> Int {
        return dataSource.count
    }
    
    func contentViewController(viewController: PagingContentViewController, viewControllerAt index: Int) -> UIViewController {
        return dataSource[index].vc
    }
}

4. load UI

Call reloadData() methods with starting point.

    override func viewDidLoad() {
        super.viewDidLoad()
        //...
        //...
        menuViewController.reloadData()
        contentViewController.reloadData()
    }

Build and display data source.

2017-08-25 17 54 30

5. Synchronize Menu and Content view controllers

Last, synchronize user interactions between Menu and Content.

1. set menu delegate

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if let vc = segue.destination as? PagingMenuViewController {
            menuViewController = vc
            menuViewController.dataSource = self
            menuViewController.delegate = self // <- set menu delegate
        } else if let vc = segue.destination as? PagingContentViewController {
            contentViewController = vc
            contentViewController.dataSource = self
        }
    }
}

Implement menu delegate to handle the event. It is a similar to UITableViewDelegate. You need to implement scroll method of PagingContentViewController in the delegate method.

extension ViewController: PagingMenuViewControllerDelegate {
    func menuViewController(viewController: PagingMenuViewController, didSelect page: Int, previousPage: Int) {
        contentViewController.scroll(to: page, animated: true)
    }
}

2. set content delegate

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if let vc = segue.destination as? PagingMenuViewController {
            menuViewController = vc
            menuViewController.dataSource = self
            menuViewController.delegate = self
        } else if let vc = segue.destination as? PagingContentViewController {
            contentViewController = vc
            contentViewController.dataSource = self
            contentViewController.delegate = self // <- set content delegate
        }
    }
}

Implement content delegate to handle the event. It is similar to UIScrollViewDelegate. You need to implement the scroll event of PagingMenuViewController. "percent" is distance from "index" argument to the right-side page index.

extension ViewController: PagingContentViewControllerDelegate {
    func contentViewController(viewController: PagingContentViewController, didManualScrollOn index: Int, percent: CGFloat) {
        menuViewController.scroll(index: index, percent: percent, animated: false)
    }
}

That's it.

Tips

Class Design

There are some design policy in this library.

  • The behavior needs to be specified by the library.
  • The layout should be left to developers.
  • Arrangement of the internal components must be left to developers.

Because of that, PagingKit has responsiblity for the behavior. But it doesn't specify a structure of the components. PagingKit favours composition over inheritance. This figure describes overview of the class diagram.

Work with RxSwift

PagingKit goes well with RxSwift.

https://github.com/kazuhiro4949/RxPagingKit

    let items = PublishSubject<[(menu: String, width: CGFloat, content: UIViewController)]>()

    override func viewDidLoad() {
        super.viewDidLoad()
        
        menuViewController?.register(type: TitleLabelMenuViewCell.self, forCellWithReuseIdentifier: "identifier")
        menuViewController?.registerFocusView(view: UnderlineFocusView())
        
        // PagingMenuViewControllerDataSource
        items.asObserver()
            .map { items in items.map({ ($0.menu, $0.width) }) }
            .bind(to: menuViewController.rx.items(
                cellIdentifier: "identifier",
                cellType: TitleLabelMenuViewCell.self)
            ) { _, model, cell in
                cell.titleLabel.text = model
            }
            .disposed(by: disposeBug)
        
        // PagingContentViewControllerDataSource
        items.asObserver()
            .map { items in items.map({ $0.content }) }
            .bind(to: contentViewController.rx.viewControllers())
            .disposed(by: disposeBug)
        
        // PagingMenuViewControllerDelegate
        menuViewController.rx.itemSelected.asObservable().subscribe(onNext: { [weak self] (page, prev) in
            self?.contentViewController.scroll(to: page, animated: true)
        }).disposed(by: disposeBug)
        
        // PagingContentViewControllerDelegate
        contentViewController.rx.didManualScroll.asObservable().subscribe(onNext: { [weak self] (index, percent) in
            self?.menuViewController.scroll(index: index, percent: percent, animated: false)
        }).disposed(by: disposeBug)
    }

License

Copyright (c) 2017 Kazuhiro Hayashi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

pagingkit's People

Contributors

beomcheol avatar devmjun avatar fiftie avatar ikesyo avatar kazuhiro4949 avatar kumabook avatar lm2343635 avatar noppefoxwolf avatar oanhof avatar shark-sea avatar sk-chanch avatar thepsguy 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

pagingkit's Issues

Autolayout engine from a background thread

Hi and thanks for your componant ;)

I have this weird logs when I use PagingKit (exactly when I tap on menu item) and I don't understand why :/ 🤔

FYI : I use Xcode 9.2 & swift4

2017-12-22 11:00:57.983130+0100 Inspector[11699:8624721] This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.
 Stack:(
	0   Foundation                          0x0000000104fd680a _AssertAutolayoutOnAllowedThreadsOnly + 77
	1   Foundation                          0x0000000104ddf66a -[NSISEngine withBehaviors:performModifications:] + 28
	2   UIKit                               0x00000001074a76c5 __100-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:]_block_invoke + 90
	3   UIKit                               0x00000001074a5f23 -[UIView(AdditionalLayoutSupport) _withUnsatisfiableConstraintsLoggingSuspendedIfEngineDelegateExists:] + 104
	4   UIKit                               0x00000001074a7234 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:] + 160
	5   UIKit                               0x00000001074a148f -[UIView(AdditionalLayoutSupport) _systemLayoutSizeFittingSize:withHorizontalFittingPriority:verticalFittingPriority:hasIntentionallyCollapsedHeight:] + 352
	6   UIKit                               0x00000001074a1204 -[UIView(UIConstraintBasedLayout) systemLayoutSizeFittingSize:withHorizontalFittingPriority:verticalFittingPriority:] + 269
	7   UIKit                               0x0000000106b13c24 -[UINavigationController _navigationBarSizeForViewController:proposedHeight:verticalFittingPriority:allowRubberBandStretch:] + 334
	8   UIKit                               0x0000000106b134a4 -[UINavigationController _calculateTopViewFramesForExpandedLayoutWithViewController:contentScrollView:gettingNavBarFrame:topPaletteFrame:] + 241
	9   UIKit                               0x0000000106b12468 -[UINavigationController _calculateTopViewFramesForLayoutWithViewController:contentScrollView:navBarFrame:topPaletteFrame:topLayoutType:] + 341
	10  UIKit                               0x0000000106b120d6 -[UINavigationController _calculateTopLayoutInfoForViewController:] + 194
	11  UIKit                               0x0000000106b0fe24 -[UINavigationController _edgeInsetsForChildViewController:insetsAreAbsolute:] + 156
	12  UIKit                               0x0000000106ac3dea -[UIViewController __updateContentOverlayInsetsWithOurRect:inBoundsOfAncestorViewController:viaImmediateChildOfAncestor:] + 807
	13  UIKit                               0x0000000106ac38f0 -[UIViewController _updateContentOverlayInsetsFromParentIfNecessary] + 713
	14  UIKit                               0x0000000106ac2fd9 -[UIViewController _updateContentOverlayInsetsForSelfAndChildren] + 100
	15  UIKit                               0x0000000106b15893 -[UINavigationController _layoutViewController:] + 111
	16  UIKit                               0x0000000106b0fbc2 -[UINavigationController _layoutTopViewController] + 368
	17  UIKit                               0x0000000106b174d1 -[UINavigationController _startDeferredTransitionIfNeeded:] + 971
	18  UIKit                               0x0000000106b186d3 -[UINavigationController __viewWillLayoutSubviews] + 150
	19  UIKit                               0x0000000106d734e2 -[UILayoutContainerView layoutSubviews] + 231
	20  UIKit                               0x00000001069f7a6d -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1439
	21  QuartzCore                          0x000000010649d61c -[CALayer layoutSublayers] + 159
	22  QuartzCore                          0x00000001064a17ad _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 401
	23  QuartzCore                          0x000000010642886c _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 364
	24  QuartzCore                          0x0000000106455946 _ZN2CA11Transaction6commitEv + 500
	25  QuartzCore                          0x0000000106455fbd _ZN2CA11Transaction14release_threadEPv + 213
	26  libsystem_pthread.dylib             0x000000010a08b39f _pthread_tsd_cleanup + 544
	27  libsystem_pthread.dylib             0x000000010a08b0d9 _pthread_exit + 152
	28  libsystem_pthread.dylib             0x000000010a08965d pthread_attr_getschedpolicy + 0
	29  libsystem_pthread.dylib             0x000000010a08907d start_wqthread + 13
)

Supporting Safe Area

Because PagingMenuView inherits UIScrollView, it has contentInsetAdjustmentBehavior.
There is nothing to do for supporting left-side and right-side insets.
On the other hand, it needs to fit the height within safeAreaInsets by itself.

  • add insets with safeAreaInsets in PageMenuView
  • check lifecycle to ensure correct work
  • add sample code which use safe area

Specification

  • PagingContentViewController
    • always set contentInsetAdjustmentBehavior = .never
  • PagingMenuViewController
    • fix scroll position

Disable swipe for content view

Hi,

I have used this library and content inside is tableview with slider.

when scroll slider, content view also scrolling.

I want to disable scrolling on content view so that i can use slider.

Thanks

0 and 1 Index [Display Data Issue]

Overall Library is awesome ..... But there is an issue between 0 and 1 index

-> When view load and "PagContentViewController" delegate class is called then your 1 index data is overwritten by 0 index and your 1st index data display in the second index and your second index data is displayed in the third Index.

fileprivate func initialLoad(with page: Int)
{
numberOfPages = dataSource?.numberOfItemsForContentViewController(viewController: self) ?? 0
cachedViewControllers = Array(repeating: nil, count: numberOfPages)
loadScrollView(with: page - 1)
loadScrollView(with: page)
loadScrollView(with: page + 1)
}

And

fileprivate func loadPagesIfNeeded(page: Int? = nil)
{
let loadingPage = page ?? leftSidePageIndex
loadScrollView(with: loadingPage - 1)
loadScrollView(with: loadingPage)
loadScrollView(with: loadingPage + 1)
}

There is any suggestion for this issue? I solved this but this is not a permanent solution.

Selected Tab Color

Great control! For the tab style, is there a way to change the color of a tab once it becomes selected? This feature would be amazing.

Jump to the left end tab to right end tab

Want to support to jump to the left end tab to right end tab.
(not infinity scrolling. No need to scroll menu tabs.)

It's hard to explain, I have prepared a short diagram. Please take a look.

Perhaps It can be possible by using UIScrollView's contentOffset (and bounds?), but I couldn't.

Ignore content insets when scrolling

Hi! We can set content insets of PagingMenuViewController, but ignore them when scrolling.

menuViewController.contentInset = UIEdgeInsets(top: 0.0, left: 44.0, bottom: 0.0, right: 44.0)

hoge

I confirmed on iOS 11.2 and 10.3.
Thank you.

Localization

I want to do localization,On PagingContentViewController its working fine but on PagingMenuViewController its not working . Please provide me the solution.

Size of PagingMenuViewController incorrectly

PagingMenuViewController container does not respect AutoLayout size information.

Steps to reproduce in iOS Sample

  • PagingMenuViewController container is aligned to leading and trailing edge.
  • Set Storyboard device to iPhone SE. Container width is now 320.
  • Run on iPhone 6 or 8, the Container width should be 375 but is still 320. Or should be 320 and is 270.
    pagingmenucontroller bug

Also please look at this other alignment issue: #40

Thanks!

scroll useless

menuViewController?.scroll(index: 2)
contentViewController?.scroll(to: 2, animated: true)
The code useless

contentViewController won't scroll to specific page programmatically

Hi, thank you for sharing this great project with everyone! I really like it! But I have a little issue here hoping someone could help me. Thanks a lot!!

About The Issue

I want to add my pages dynamically, reload both menu & content, and then scroll the menu & content to the last page. It turns out menuViewController works successfully, but contentViewController just can't scroll to the last page. Not sure why.

My Tries & Results

  1. reload first, scroll later
func addNewPage() {
        let vc = self.storyboard!.instantiateViewController(withIdentifier: "myViewController")
        pageList.append(vc)

        let lastPageIndex = pageList.endIndex
        
        menuViewController.reloadData()
        contentViewController.reloadData()

        menuViewController.scroll(index: lastPageIndex)
        contentViewController.scroll(to: lastPageIndex, animated: true)
    }

Result: menuViewController will scroll to the last index, but contentViewController always stays at first index.

  1. use reload-with-preferredFocusIndex function
func addNewPage() {
        let vc = self.storyboard!.instantiateViewController(withIdentifier: "myViewController")
        pageList.append(vc)

        let lastPageIndex = pageList.endIndex
        
        menuViewController.reloadData(with: lastPageIndex, completionHandler: nil)
        contentViewController.reloadData(with: lastPageIndex, completion: nil)
        
    }

Result: menuViewController will scroll to the last index, so does contentViewController. BUT, contentViewController is totally blank!! (It didn't load its input views. But when I do a little scroll, like try to scroll to previous page a little but not really scroll to there, then contentViewController will load its input view successfully.)

Option to disable preloading the next viewController?

I have 3 viewControllers for paging. Everything is perfect except one.
viewDidAppear() of second viewController called when first viewController is loaded.
Problem is we are presenting a viewController (basically a coach mark) when second view controller is loaded. Hence when first view controller appears, second viewController's presenting viewController (i.e coach mark) is shown.

I have checked internal code of PagingKit. It has something called "isEnabledPreloadContent" property and 'preloadContentIfNeeded' method which is not used anywhere. I believe if isEnabledPreloadContent is set to false, it should not load viewControllers which are yet to present/load.

As a workaround, I am using "menuViewController(viewController: PagingMenuViewController, didSelect page: Int, previousPage: Int) " method to decide whether to present viewController or not. But this is not satisfying!!

required code signature missing for PagingKit

most of the time i get this issue. unable to understand how to resolve this. i get the message as bellow -

/Users/Mac/Library/Developer/CoreSimulator/Devices/48407F08-C2CC-4DA2-9EDE-BA6B636C8A49/data/Containers/Bundle/Application/E5EB1FAF-1492-4F6D-B4BD-3C3A4D0CE6F8/Fle.app/Frameworks/PagingKit.framework/PagingKit: required code signature missing for '/Users/Mac/Library/Developer/CoreSimulator/Devices/48407F08-C2CC-4DA2-9EDE-BA6B636C8A49/data/Containers/Bundle/Application/E5EB1FAF-1492-4F6D-B4BD-3C3A4D0CE6F8/Fle.app/Frameworks/PagingKit.framework/PagingKit'

plz suggest me what to do to resolve this problem

Populate content with different controller

I was wondering if there was a way to populate the content with collection view??

I am getting issue where when I pass in another controller like this:

var dataSource: [(menu: String, content: UIViewController)] = [ (menu: "menu1", content: viewController(.blue)), (menu: "menu2", content: SecondViewController()) ]

my SecondViewController only holds an imageView:

`class SecondViewController: UIViewController {

@IBOutlet weak var dankImage: UIImageView!

override func viewDidLoad() {
    super.viewDidLoad()

    let imageToSet = UIImage(named: "Dank")
    dankImage.image = imageToSet!
}

}`

When i swipe it always show that it cannot unwrap and returns "nil" - but if i remove setting the image to image view so its blank. This runs fine.

How does this work under the hood when populating view?

Support for iOS 12.0

Hello,

Can you please add support for iOS 12.0+?
I have been getting the following error in the sample project when I run in the devices with iOS 12.4.4 and 12.4.5. However, it's working fine for devices with iOS 13+.

Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value: file /PagingKit-master/iOS Sample/iOS Sample/SimpleViewController.swift, line 67

Hoping to hear from you soon.

Thanks a ton.

alignment property like UILabel.textAlignment

I want a convenience method to align cells when PagingMenuView.contentSize.width is shorter than PagingMenuView.bounds.width.

menuViewController.alignment = .center
// |     |menu1|menu2|menu3|      |
menuViewController.alignment = .right
// |           |menu1|menu2|menu3||
menuViewController.alignment = .left // default
// ||menu1|menu2|menu3|           |

Lifecycle problem

in your demo, just like your SimpleViewController, it's contentViewControllers call their viewDidLoad at the same time.

RTL Support

How to support RTL for the menu? like when arabic, the menu will start at the right.

screen shot 2018-11-21 at 9 55 46 pm

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.