Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
deba7ed3
Commit
deba7ed3
authored
Aug 23, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: updated delegation methods access and added PageController from PageTabBarController
parent
37086526
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
70 additions
and
24 deletions
+70
-24
Material.xcodeproj/project.pbxproj
+4
-4
Sources/iOS/Capture.swift
+1
-1
Sources/iOS/CaptureSession.swift
+1
-1
Sources/iOS/DynamicFontType.swift
+1
-1
Sources/iOS/MenuView.swift
+1
-1
Sources/iOS/NavigationDrawerController.swift
+1
-1
Sources/iOS/PageController.swift
+56
-10
Sources/iOS/PhotoLibrary.swift
+1
-1
Sources/iOS/Switch.swift
+1
-1
Sources/iOS/TabBar.swift
+1
-1
Sources/iOS/Text.swift
+1
-1
Sources/iOS/ToolbarController.swift
+1
-1
No files found.
Material.xcodeproj/project.pbxproj
View file @
deba7ed3
...
...
@@ -16,7 +16,7 @@
96334EF61C8B84660083986B
/* Assets.xcassets in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96334EF51C8B84660083986B
/* Assets.xcassets */
;
};
963832421B88DFD80015F710
/* Material.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
963832361B88DFD80015F710
/* Material.framework */
;
};
963FBEFD1D669510008F8512
/* Snackbar.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
963FBEFC1D669510008F8512
/* Snackbar.swift */
;
};
963FBF081D669D14008F8512
/* Page
TabBarController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
963FBF071D669D14008F8512
/* PageTabBar
Controller.swift */
;
};
963FBF081D669D14008F8512
/* Page
Controller.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
963FBF071D669D14008F8512
/* Page
Controller.swift */
;
};
9658F2171CD6FA4700B902C1
/* IconButton.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9658F2161CD6FA4700B902C1
/* IconButton.swift */
;
};
9660161D1CB2ED6C00AAB661
/* Material.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
966016131CB2ED6C00AAB661
/* Material.framework */
;
};
9660162A1CB2F04E00AAB661
/* Material.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96D88C091C1328D800B91418
/* Material.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
...
...
@@ -209,7 +209,7 @@
963832411B88DFD80015F710
/* Material.xctest */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.cfbundle
;
includeInIndex
=
0
;
path
=
Material.xctest
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
963832591B88E31A0015F710
/* Info.plist */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
text.plist.xml
;
path
=
Info.plist
;
sourceTree
=
"<group>"
;
};
963FBEFC1D669510008F8512
/* Snackbar.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Snackbar.swift
;
sourceTree
=
"<group>"
;
};
963FBF071D669D14008F8512
/* Page
TabBarController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PageTabBar
Controller.swift
;
sourceTree
=
"<group>"
;
};
963FBF071D669D14008F8512
/* Page
Controller.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Page
Controller.swift
;
sourceTree
=
"<group>"
;
};
9658F2161CD6FA4700B902C1
/* IconButton.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
IconButton.swift
;
sourceTree
=
"<group>"
;
};
966016131CB2ED6C00AAB661
/* Material.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
includeInIndex
=
0
;
path
=
Material.framework
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
9660161C1CB2ED6C00AAB661
/* Material macOS Tests.xctest */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.cfbundle
;
includeInIndex
=
0
;
path
=
"Material macOS Tests.xctest"
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
...
...
@@ -407,7 +407,7 @@
isa
=
PBXGroup
;
children
=
(
96BCB79A1CB40DC500C806FE
/* TabBar.swift */
,
963FBF071D669D14008F8512
/* Page
TabBar
Controller.swift */
,
963FBF071D669D14008F8512
/* PageController.swift */
,
96BCB7581CB40DC500C806FE
/* BottomNavigationController.swift */
,
96BCB7591CB40DC500C806FE
/* BottomTabBar.swift */
,
);
...
...
@@ -1057,7 +1057,7 @@
962864621D54111D00690B69
/* JSON.swift in Sources */
,
96BCB7C21CB40DC500C806FE
/* Device.swift in Sources */
,
96BCB7A41CB40DC500C806FE
/* CaptureSession.swift in Sources */
,
963FBF081D669D14008F8512
/* Page
TabBar
Controller.swift in Sources */
,
963FBF081D669D14008F8512
/* PageController.swift in Sources */
,
963FBEFD1D669510008F8512
/* Snackbar.swift in Sources */
,
96BCB7C51CB40DC500C806FE
/* MaterialGravity.swift in Sources */
,
968C99471D377849000074FF
/* Offset.swift in Sources */
,
...
...
Sources/iOS/Capture.swift
View file @
deba7ed3
...
...
@@ -133,7 +133,7 @@ public protocol CaptureDelegate {
open
class
Capture
:
View
,
UIGestureRecognizerDelegate
{
/// A delegation reference.
public
weak
var
delegate
:
CaptureDelegate
?
open
weak
var
delegate
:
CaptureDelegate
?
/// A Timer reference for when recording is enabled.
private
var
timer
:
Timer
?
...
...
Sources/iOS/CaptureSession.swift
View file @
deba7ed3
...
...
@@ -366,7 +366,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
}
/// A delegation property for CaptureSessionDelegate.
public
weak
var
delegate
:
CaptureSessionDelegate
?
open
weak
var
delegate
:
CaptureSessionDelegate
?
/// Initializer.
public
override
init
()
{
...
...
Sources/iOS/DynamicFontType.swift
View file @
deba7ed3
...
...
@@ -43,7 +43,7 @@ public protocol DynamicFontTypeDelegate {
@objc(DynamicFontType)
open
class
DynamicFontType
:
NSObject
{
/// A weak reference to a DynamicFontTypeDelegate.
public
weak
var
delegate
:
DynamicFontTypeDelegate
?
open
weak
var
delegate
:
DynamicFontTypeDelegate
?
/// Initializer.
public
override
init
()
{
...
...
Sources/iOS/MenuView.swift
View file @
deba7ed3
...
...
@@ -42,7 +42,7 @@ public class MenuView : PulseView {
public
private(set)
lazy
var
menu
:
Menu
=
Menu
()
/// A delegation reference.
public
weak
var
delegate
:
MenuViewDelegate
?
open
weak
var
delegate
:
MenuViewDelegate
?
public
override
func
hitTest
(
_
point
:
CGPoint
,
with
event
:
UIEvent
?)
->
UIView
?
{
/**
...
...
Sources/iOS/NavigationDrawerController.swift
View file @
deba7ed3
...
...
@@ -179,7 +179,7 @@ public class NavigationDrawerController: RootController, UIGestureRecognizerDele
A NavigationDrawerControllerDelegate property used to bind
the delegation object.
*/
public
weak
var
delegate
:
NavigationDrawerControllerDelegate
?
open
weak
var
delegate
:
NavigationDrawerControllerDelegate
?
/**
A CGFloat property that sets the animation duration of the
...
...
Sources/iOS/Page
TabBar
Controller.swift
→
Sources/iOS/PageController.swift
View file @
deba7ed3
...
...
@@ -32,15 +32,15 @@ import UIKit
extension
UIViewController
{
/**
A convenience property that provides access to the Page
TabBar
Controller.
This is the recommended method of accessing the Page
TabBar
Controller
A convenience property that provides access to the PageController.
This is the recommended method of accessing the PageController
through child UIViewControllers.
*/
public
var
page
TabBarController
:
PageTabBar
Controller
?
{
public
var
page
Controller
:
Page
Controller
?
{
var
viewController
:
UIViewController
?
=
self
while
nil
!=
viewController
{
if
viewController
is
Page
TabBar
Controller
{
return
viewController
as?
Page
TabBar
Controller
if
viewController
is
PageController
{
return
viewController
as?
PageController
}
viewController
=
viewController
?
.
parent
}
...
...
@@ -48,18 +48,32 @@ extension UIViewController {
}
}
@objc(Page
TabBar
ControllerDelegate)
public
protocol
Page
TabBar
ControllerDelegate
{
@objc(PageControllerDelegate)
public
protocol
PageControllerDelegate
{
}
@objc(Page
TabBar
Controller)
open
class
Page
TabBar
Controller
:
RootController
{
@objc(PageController)
open
class
PageController
:
RootController
{
/// Reference to the TabBar.
open
internal(set)
var
tabBar
:
TabBar
!
/// Delegation handler.
public
weak
var
delegate
:
PageTabBarControllerDelegate
?
public
weak
var
delegate
:
PageControllerDelegate
?
/// A reference to the instance when it is a UIPageViewController.
open
var
pageViewController
:
UIPageViewController
?
{
return
rootViewController
as?
UIPageViewController
}
public
required
init
?(
coder
aDecoder
:
NSCoder
)
{
super
.
init
(
coder
:
aDecoder
)
}
public
override
init
(
rootViewController
:
UIViewController
)
{
super
.
init
(
rootViewController
:
UIPageViewController
())
pageViewController
?
.
setViewControllers
([
rootViewController
],
direction
:
.
forward
,
animated
:
true
,
completion
:
nil
)
}
/**
To execute in the order of the layout chain, override this
...
...
@@ -99,6 +113,18 @@ open class PageTabBarController: RootController {
prepareTabBar
()
}
override
func
prepareRootViewController
()
{
super
.
prepareRootViewController
()
guard
let
v
=
pageViewController
else
{
return
}
v
.
isDoubleSided
=
false
v
.
delegate
=
self
v
.
dataSource
=
self
}
/// Prepares the tabBar.
private
func
prepareTabBar
()
{
if
nil
==
tabBar
{
...
...
@@ -108,3 +134,23 @@ open class PageTabBarController: RootController {
}
}
}
extension
PageController
{
open
func
setViewControllers
(
_
viewControllers
:
[
UIViewController
]?,
direction
:
UIPageViewControllerNavigationDirection
,
animated
:
Bool
,
completion
:
(
@escaping
(
Bool
)
->
Swift
.
Void
)?
=
nil
)
{
pageViewController
?
.
setViewControllers
(
viewControllers
,
direction
:
direction
,
animated
:
animated
,
completion
:
completion
)
}
}
extension
PageController
:
UIPageViewControllerDelegate
{
}
extension
PageController
:
UIPageViewControllerDataSource
{
public
func
pageViewController
(
_
pageViewController
:
UIPageViewController
,
viewControllerBefore
viewController
:
UIViewController
)
->
UIViewController
?
{
return
nil
}
public
func
pageViewController
(
_
pageViewController
:
UIPageViewController
,
viewControllerAfter
viewController
:
UIViewController
)
->
UIViewController
?
{
return
nil
}
}
Sources/iOS/PhotoLibrary.swift
View file @
deba7ed3
...
...
@@ -176,7 +176,7 @@ public class PhotoLibrary: NSObject {
public
internal(set)
lazy
var
fetchResultsDataSource
=
[
String
:
PhotoLibraryFetchResultDataSource
]()
/// A reference to a PhotoLibraryDelegate.
public
weak
var
delegate
:
PhotoLibraryDelegate
?
open
weak
var
delegate
:
PhotoLibraryDelegate
?
/// The current PHAuthorizationStatus.
public
var
authorizationStatus
:
PHAuthorizationStatus
{
...
...
Sources/iOS/Switch.swift
View file @
deba7ed3
...
...
@@ -80,7 +80,7 @@ public class Switch: UIControl {
private
var
bounceOffset
:
CGFloat
=
3
/// An Optional delegation method.
public
weak
var
delegate
:
SwitchDelegate
?
open
weak
var
delegate
:
SwitchDelegate
?
/// Indicates if the animation should bounce.
@IBInspectable
public
var
bounceable
:
Bool
=
true
{
...
...
Sources/iOS/TabBar.swift
View file @
deba7ed3
...
...
@@ -103,7 +103,7 @@ open class TabBar: View {
}
/// A delegation reference.
public
weak
var
delegate
:
TabBarDelegate
?
open
weak
var
delegate
:
TabBarDelegate
?
open
override
var
intrinsicContentSize
:
CGSize
{
return
CGSize
(
width
:
width
,
height
:
49
)
...
...
Sources/iOS/Text.swift
View file @
deba7ed3
...
...
@@ -78,7 +78,7 @@ public class Text: NSObject {
public
private(set)
var
textStorage
:
TextStorage
=
TextStorage
()
/// Delegation object for pre and post text processing.
public
weak
var
delegate
:
TextDelegate
?
open
weak
var
delegate
:
TextDelegate
?
/// Initializer.
public
override
init
()
{
...
...
Sources/iOS/ToolbarController.swift
View file @
deba7ed3
...
...
@@ -76,7 +76,7 @@ open class ToolbarController: RootController {
open
internal(set)
var
toolbar
:
Toolbar
!
/// Delegation handler.
public
weak
var
delegate
:
ToolbarControllerDelegate
?
open
weak
var
delegate
:
ToolbarControllerDelegate
?
/// A floating UIViewController.
open
var
floatingViewController
:
UIViewController
?
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment