Skip to content

Commit

Permalink
Merge pull request #5 from kevinrenskers/master
Browse files Browse the repository at this point in the history
Solve retain cycles
  • Loading branch information
robertofrontado authored Jul 24, 2017
2 parents b4c412a + 85593d3 commit 61478bc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Library/OkPagerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

import UIKit

public protocol OkPagerViewDataSource {
public protocol OkPagerViewDataSource: class {

func viewControllerAtIndex(_ index: Int) -> UIViewController?
func numberOfPages() -> Int?
}

public protocol OkPagerViewDelegate {
public protocol OkPagerViewDelegate: class {

func onPageSelected(_ viewController: UIViewController, index: Int)
}
Expand All @@ -27,12 +27,12 @@ open class OkPagerView: UIView, UIPageViewControllerDataSource, UIPageViewContro
open fileprivate(set) var currentIndex = 0

open var callFirstItemOnCreated = true
open var dataSource: OkPagerViewDataSource! {
open weak var dataSource: OkPagerViewDataSource! {
didSet {
reloadData()
}
}
open var delegate: OkPagerViewDelegate!
open weak var delegate: OkPagerViewDelegate!

required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
Expand Down Expand Up @@ -197,7 +197,7 @@ open class OkPagerView: UIView, UIPageViewControllerDataSource, UIPageViewContro
private class PageViewWrapper: UIViewController {

var pageIndex: Int = 0
var wrappedViewController: UIViewController!
weak var wrappedViewController: UIViewController!

fileprivate override func viewDidLoad() {
super.viewDidLoad()
Expand Down

0 comments on commit 61478bc

Please sign in to comment.