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
8525e33a
Commit
8525e33a
authored
Apr 06, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated App project to handle transitions from the SideNavigationController more effectively
parent
d00ea0cb
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
63 additions
and
55 deletions
+63
-55
Examples/Material.xcworkspace/contents.xcworkspacedata
+3
-3
Examples/Programmatic/App/App.xcodeproj/project.pbxproj
+6
-0
Examples/Programmatic/App/App/AppLeftViewController.swift
+1
-1
Examples/Programmatic/App/App/ItemViewController.swift
+2
-0
Examples/Programmatic/App/App/RecipesViewController.swift
+0
-1
Examples/Programmatic/MaterialIcon/MaterialIcon.xcodeproj/project.pbxproj
+6
-8
Examples/Programmatic/MaterialIcon/MaterialIcon/AppDelegate.swift
+0
-1
Examples/Programmatic/MaterialIcon/MaterialIcon/ViewController.swift
+33
-35
Sources/iOS/MaterialIcon.swift
+12
-6
No files found.
Examples/Material.xcworkspace/contents.xcworkspacedata
View file @
8525e33a
...
...
@@ -11,6 +11,9 @@
location =
"group:Programmatic/App/App.xcodeproj"
>
</FileRef>
<FileRef
location =
"group:Programmatic/MaterialIcon/MaterialIcon.xcodeproj"
>
</FileRef>
<FileRef
location =
"group:Programmatic/MaterialLayout/MaterialLayout.xcodeproj"
>
</FileRef>
<FileRef
...
...
@@ -38,9 +41,6 @@
location =
"group:Programmatic/MaterialSwitch/MaterialSwitch.xcodeproj"
>
</FileRef>
<FileRef
location =
"group:Programmatic/MaterialIcon/MaterialIcon.xcodeproj"
>
</FileRef>
<FileRef
location =
"group:Programmatic/MaterialCollectionView/MaterialCollectionView.xcodeproj"
>
</FileRef>
<FileRef
...
...
Examples/Programmatic/App/App.xcodeproj/project.pbxproj
View file @
8525e33a
...
...
@@ -18,6 +18,8 @@
9663F94C1C7A74C700AF0965
/* AppMenuViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9663F94B1C7A74C700AF0965
/* AppMenuViewController.swift */
;
};
9663F94E1C7A74EA00AF0965
/* AppLeftViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9663F94D1C7A74EA00AF0965
/* AppLeftViewController.swift */
;
};
9663F9521C7A751D00AF0965
/* ItemViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9663F9511C7A751D00AF0965
/* ItemViewController.swift */
;
};
96BCB8B91CB584FE00C806FE
/* Material.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB8B81CB584FE00C806FE
/* Material.framework */
;
};
96BCB8BA1CB584FE00C806FE
/* Material.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB8B81CB584FE00C806FE
/* Material.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
96CC08881C7FEBD60034FF84
/* RecipesViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96CC08871C7FEBD60034FF84
/* RecipesViewController.swift */
;
};
/* End PBXBuildFile section */
...
...
@@ -28,6 +30,7 @@
dstPath
=
""
;
dstSubfolderSpec
=
10
;
files
=
(
96BCB8BA1CB584FE00C806FE
/* Material.framework in Embed Frameworks */
,
);
name
=
"Embed Frameworks"
;
runOnlyForDeploymentPostprocessing
=
0
;
...
...
@@ -48,6 +51,7 @@
9663F94B1C7A74C700AF0965
/* AppMenuViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
AppMenuViewController.swift
;
sourceTree
=
"<group>"
;
};
9663F94D1C7A74EA00AF0965
/* AppLeftViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
AppLeftViewController.swift
;
sourceTree
=
"<group>"
;
};
9663F9511C7A751D00AF0965
/* ItemViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ItemViewController.swift
;
sourceTree
=
"<group>"
;
};
96BCB8B81CB584FE00C806FE
/* Material.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
name
=
Material.framework
;
path
=
"/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-bshwisidfobstlbomegqyybbrygh/Build/Products/Debug-iphonesimulator/Material.framework"
;
sourceTree
=
"<absolute>"
;
};
96CC08871C7FEBD60034FF84
/* RecipesViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
RecipesViewController.swift
;
sourceTree
=
"<group>"
;
};
/* End PBXFileReference section */
...
...
@@ -56,6 +60,7 @@
isa
=
PBXFrameworksBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
96BCB8B91CB584FE00C806FE
/* Material.framework in Frameworks */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
};
...
...
@@ -65,6 +70,7 @@
9663F9251C7A744500AF0965
=
{
isa
=
PBXGroup
;
children
=
(
96BCB8B81CB584FE00C806FE
/* Material.framework */
,
9663F9301C7A744600AF0965
/* App */
,
9663F92F1C7A744600AF0965
/* Products */
,
);
...
...
Examples/Programmatic/App/App/AppLeftViewController.swift
View file @
8525e33a
...
...
@@ -156,6 +156,6 @@ extension AppLeftViewController: UITableViewDelegate {
/// Select item at row in tableView.
func
tableView
(
tableView
:
UITableView
,
didSelectRowAtIndexPath
indexPath
:
NSIndexPath
)
{
// print("
Cell s
elected")
// print("
S
elected")
}
}
Examples/Programmatic/App/App/ItemViewController.swift
View file @
8525e33a
...
...
@@ -75,6 +75,8 @@ class ItemViewController: UIViewController {
override
func
viewWillAppear
(
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
sideNavigationController
?
.
enabled
=
false
// Stops the scrollView contentInsets from being automatically adjusted.
automaticallyAdjustsScrollViewInsets
=
false
}
...
...
Examples/Programmatic/App/App/RecipesViewController.swift
View file @
8525e33a
...
...
@@ -86,7 +86,6 @@ class RecipesViewController: UIViewController {
override
func
viewWillDisappear
(
animated
:
Bool
)
{
super
.
viewWillDisappear
(
animated
)
// Disable the SideNavigation.
sideNavigationController
?
.
enabled
=
false
// Hide the menuView.
menuViewController
?
.
menuView
.
animate
(
MaterialAnimation
.
animationGroup
([
...
...
Examples/Programmatic/MaterialIcon/MaterialIcon.xcodeproj/project.pbxproj
View file @
8525e33a
...
...
@@ -11,8 +11,8 @@
96A71E6E1C6FA6D500C0C4AE
/* ViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96A71E6D1C6FA6D500C0C4AE
/* ViewController.swift */
;
};
96A71E731C6FA6D500C0C4AE
/* Assets.xcassets in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96A71E721C6FA6D500C0C4AE
/* Assets.xcassets */
;
};
96A71E761C6FA6D500C0C4AE
/* LaunchScreen.storyboard in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96A71E741C6FA6D500C0C4AE
/* LaunchScreen.storyboard */
;
};
F6949FC01CB53676000E4C23
/* Material.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F6949FBD1CB53666000E4C23
/* Material.framework */
;
};
F6949FC11CB53676000E4C23
/* Material.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F6949FBD1CB53666000E4C23
/* Material.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
96BCB8B61CB56F7800C806FE
/* Material.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB8B51CB56F7800C806FE
/* Material.framework */
;
};
96BCB8B71CB56F7800C806FE
/* Material.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB8B51CB56F7800C806FE
/* Material.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
...
...
@@ -22,7 +22,7 @@
dstPath
=
""
;
dstSubfolderSpec
=
10
;
files
=
(
F6949FC11CB53676000E4C23
/* Material.framework in Embed Frameworks */
,
96BCB8B71CB56F7800C806FE
/* Material.framework in Embed Frameworks */
,
);
name
=
"Embed Frameworks"
;
runOnlyForDeploymentPostprocessing
=
0
;
...
...
@@ -36,8 +36,7 @@
96A71E721C6FA6D500C0C4AE
/* Assets.xcassets */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
folder.assetcatalog
;
path
=
Assets.xcassets
;
sourceTree
=
"<group>"
;
};
96A71E751C6FA6D500C0C4AE
/* Base */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file.storyboard
;
name
=
Base
;
path
=
Base.lproj/LaunchScreen.storyboard
;
sourceTree
=
"<group>"
;
};
96A71E771C6FA6D500C0C4AE
/* Info.plist */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.plist.xml
;
path
=
Info.plist
;
sourceTree
=
"<group>"
;
};
F6949FBB1CB53635000E4C23
/* Material.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
Material.framework
;
path
=
"../../../build/Debug-iphoneos/Material.framework"
;
sourceTree
=
"<group>"
;
};
F6949FBD1CB53666000E4C23
/* Material.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
name
=
Material.framework
;
path
=
"/Users/ramon/Library/Developer/Xcode/DerivedData/Material-himrdtrjxqulxbgtyvxqqgkjdthx/Build/Products/Debug-iphonesimulator/Material.framework"
;
sourceTree
=
"<absolute>"
;
};
96BCB8B51CB56F7800C806FE
/* Material.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
name
=
Material.framework
;
path
=
"/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-bshwisidfobstlbomegqyybbrygh/Build/Products/Debug-iphoneos/Material.framework"
;
sourceTree
=
"<absolute>"
;
};
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
...
...
@@ -45,7 +44,7 @@
isa
=
PBXFrameworksBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
F6949FC01CB53676000E4C23
/* Material.framework in Frameworks */
,
96BCB8B61CB56F7800C806FE
/* Material.framework in Frameworks */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
};
...
...
@@ -55,8 +54,7 @@
96A71E5F1C6FA6D500C0C4AE
=
{
isa
=
PBXGroup
;
children
=
(
F6949FBD1CB53666000E4C23
/* Material.framework */
,
F6949FBB1CB53635000E4C23
/* Material.framework */
,
96BCB8B51CB56F7800C806FE
/* Material.framework */
,
96A71E6A1C6FA6D500C0C4AE
/* MaterialIcon */
,
96A71E691C6FA6D500C0C4AE
/* Products */
,
);
...
...
Examples/Programmatic/MaterialIcon/MaterialIcon/AppDelegate.swift
View file @
8525e33a
...
...
@@ -35,7 +35,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var
window
:
UIWindow
?
func
application
(
application
:
UIApplication
,
didFinishLaunchingWithOptions
launchOptions
:
[
NSObject
:
AnyObject
]?)
->
Bool
{
window
=
UIWindow
(
frame
:
UIScreen
.
mainScreen
()
.
bounds
)
window
!.
rootViewController
=
ViewController
()
...
...
Examples/Programmatic/MaterialIcon/MaterialIcon/ViewController.swift
View file @
8525e33a
...
...
@@ -38,12 +38,8 @@ import Material
private
struct
Item
{
var
name
:
String
var
mdIcon
:
UIImage
?
var
cmIcon
:
UIImage
?
}
extension
MaterialIcon
{
init
(){}
var
mdIcon
:
UIImage
?
var
cmIcon
:
UIImage
?
}
class
ViewController
:
UIViewController
{
...
...
@@ -68,32 +64,32 @@ class ViewController: UIViewController {
/// Prepares the items Array.
private
func
prepareItems
()
{
icons
.
append
(
Item
(
name
:
"add"
,
mdIcon
:
MaterialIcon
.
add
,
cmIcon
:
MaterialIcon
.
cm
.
add
))
icons
.
append
(
Item
(
name
:
"addCircle"
,
mdIcon
:
MaterialIcon
.
addCircle
,
cmIcon
:
MaterialIcon
.
cm
.
addCircle
))
icons
.
append
(
Item
(
name
:
"addCircleOutline"
,
mdIcon
:
MaterialIcon
.
addCircleOutline
,
cmIcon
:
MaterialIcon
.
cm
.
addCircleOutline
))
icons
.
append
(
Item
(
name
:
"arrowBack"
,
mdIcon
:
MaterialIcon
.
arrowBack
,
cmIcon
:
MaterialIcon
.
cm
.
arrowBack
))
icons
.
append
(
Item
(
name
:
"arrowDownward"
,
mdIcon
:
MaterialIcon
.
arrowDownward
,
cmIcon
:
MaterialIcon
.
cm
.
arrowDownward
))
icons
.
append
(
Item
(
name
:
"audio"
,
mdIcon
:
MaterialIcon
.
audio
,
cmIcon
:
MaterialIcon
.
cm
.
audio
))
icons
.
append
(
Item
(
name
:
"clear"
,
mdIcon
:
MaterialIcon
.
clear
,
cmIcon
:
MaterialIcon
.
cm
.
clear
))
icons
.
append
(
Item
(
name
:
"close"
,
mdIcon
:
MaterialIcon
.
close
,
cmIcon
:
MaterialIcon
.
cm
.
close
))
icons
.
append
(
Item
(
name
:
"edit"
,
mdIcon
:
MaterialIcon
.
edit
,
cmIcon
:
MaterialIcon
.
cm
.
edit
))
icons
.
append
(
Item
(
name
:
"history"
,
mdIcon
:
MaterialIcon
.
history
,
cmIcon
:
MaterialIcon
.
cm
.
history
))
icons
.
append
(
Item
(
name
:
"image"
,
mdIcon
:
MaterialIcon
.
image
,
cmIcon
:
MaterialIcon
.
cm
.
image
))
icons
.
append
(
Item
(
name
:
"menu"
,
mdIcon
:
MaterialIcon
.
menu
,
cmIcon
:
MaterialIcon
.
cm
.
menu
))
icons
.
append
(
Item
(
name
:
"moreVertical"
,
mdIcon
:
MaterialIcon
.
moreHorizontal
,
cmIcon
:
MaterialIcon
.
cm
.
moreHorizontal
))
icons
.
append
(
Item
(
name
:
"moreHorizontal"
,
mdIcon
:
MaterialIcon
.
moreVertical
,
cmIcon
:
MaterialIcon
.
cm
.
moreVertical
))
icons
.
append
(
Item
(
name
:
"movie"
,
mdIcon
:
MaterialIcon
.
movie
,
cmIcon
:
MaterialIcon
.
cm
.
movie
))
icons
.
append
(
Item
(
name
:
"pen"
,
mdIcon
:
MaterialIcon
.
pen
,
cmIcon
:
MaterialIcon
.
cm
.
pen
))
icons
.
append
(
Item
(
name
:
"place"
,
mdIcon
:
MaterialIcon
.
place
,
cmIcon
:
MaterialIcon
.
cm
.
place
))
icons
.
append
(
Item
(
name
:
"photoCamera"
,
mdIcon
:
MaterialIcon
.
photoCamera
,
cmIcon
:
MaterialIcon
.
cm
.
photoCamera
))
icons
.
append
(
Item
(
name
:
"photoLibrary"
,
mdIcon
:
MaterialIcon
.
photoLibrary
,
cmIcon
:
MaterialIcon
.
cm
.
photoLibrary
))
icons
.
append
(
Item
(
name
:
"search"
,
mdIcon
:
MaterialIcon
.
search
,
cmIcon
:
MaterialIcon
.
cm
.
search
))
icons
.
append
(
Item
(
name
:
"settings"
,
mdIcon
:
MaterialIcon
.
settings
,
cmIcon
:
MaterialIcon
.
cm
.
settings
))
icons
.
append
(
Item
(
name
:
"share"
,
mdIcon
:
MaterialIcon
.
share
,
cmIcon
:
MaterialIcon
.
cm
.
share
))
icons
.
append
(
Item
(
name
:
"star"
,
mdIcon
:
MaterialIcon
.
star
,
cmIcon
:
MaterialIcon
.
cm
.
star
))
icons
.
append
(
Item
(
name
:
"starBorder"
,
mdIcon
:
MaterialIcon
.
starBorder
,
cmIcon
:
MaterialIcon
.
cm
.
starBorder
))
icons
.
append
(
Item
(
name
:
"starHalf"
,
mdIcon
:
MaterialIcon
.
starHalf
,
cmIcon
:
MaterialIcon
.
cm
.
starHalf
))
icons
.
append
(
Item
(
name
:
"videocam"
,
mdIcon
:
MaterialIcon
.
videocam
,
cmIcon
:
MaterialIcon
.
cm
.
videocam
))
icons
.
append
(
Item
(
name
:
"add"
,
mdIcon
:
MaterialIcon
.
add
,
cmIcon
:
MaterialIcon
.
cm
.
add
))
icons
.
append
(
Item
(
name
:
"addCircle"
,
mdIcon
:
MaterialIcon
.
addCircle
,
cmIcon
:
MaterialIcon
.
cm
.
addCircle
))
icons
.
append
(
Item
(
name
:
"addCircleOutline"
,
mdIcon
:
MaterialIcon
.
addCircleOutline
,
cmIcon
:
MaterialIcon
.
cm
.
addCircleOutline
))
icons
.
append
(
Item
(
name
:
"arrowBack"
,
mdIcon
:
MaterialIcon
.
arrowBack
,
cmIcon
:
MaterialIcon
.
cm
.
arrowBack
))
icons
.
append
(
Item
(
name
:
"arrowDownward"
,
mdIcon
:
MaterialIcon
.
arrowDownward
,
cmIcon
:
MaterialIcon
.
cm
.
arrowDownward
))
icons
.
append
(
Item
(
name
:
"audio"
,
mdIcon
:
MaterialIcon
.
audio
,
cmIcon
:
MaterialIcon
.
cm
.
audio
))
icons
.
append
(
Item
(
name
:
"clear"
,
mdIcon
:
MaterialIcon
.
clear
,
cmIcon
:
MaterialIcon
.
cm
.
clear
))
icons
.
append
(
Item
(
name
:
"close"
,
mdIcon
:
MaterialIcon
.
close
,
cmIcon
:
MaterialIcon
.
cm
.
close
))
icons
.
append
(
Item
(
name
:
"edit"
,
mdIcon
:
MaterialIcon
.
edit
,
cmIcon
:
MaterialIcon
.
cm
.
edit
))
icons
.
append
(
Item
(
name
:
"history"
,
mdIcon
:
MaterialIcon
.
history
,
cmIcon
:
MaterialIcon
.
cm
.
history
))
icons
.
append
(
Item
(
name
:
"image"
,
mdIcon
:
MaterialIcon
.
image
,
cmIcon
:
MaterialIcon
.
cm
.
image
))
icons
.
append
(
Item
(
name
:
"menu"
,
mdIcon
:
MaterialIcon
.
menu
,
cmIcon
:
MaterialIcon
.
cm
.
menu
))
icons
.
append
(
Item
(
name
:
"moreVertical"
,
mdIcon
:
MaterialIcon
.
moreHorizontal
,
cmIcon
:
MaterialIcon
.
cm
.
moreHorizontal
))
icons
.
append
(
Item
(
name
:
"moreHorizontal"
,
mdIcon
:
MaterialIcon
.
moreVertical
,
cmIcon
:
MaterialIcon
.
cm
.
moreVertical
))
icons
.
append
(
Item
(
name
:
"movie"
,
mdIcon
:
MaterialIcon
.
movie
,
cmIcon
:
MaterialIcon
.
cm
.
movie
))
icons
.
append
(
Item
(
name
:
"pen"
,
mdIcon
:
MaterialIcon
.
pen
,
cmIcon
:
MaterialIcon
.
cm
.
pen
))
icons
.
append
(
Item
(
name
:
"place"
,
mdIcon
:
MaterialIcon
.
place
,
cmIcon
:
MaterialIcon
.
cm
.
place
))
icons
.
append
(
Item
(
name
:
"photoCamera"
,
mdIcon
:
MaterialIcon
.
photoCamera
,
cmIcon
:
MaterialIcon
.
cm
.
photoCamera
))
icons
.
append
(
Item
(
name
:
"photoLibrary"
,
mdIcon
:
MaterialIcon
.
photoLibrary
,
cmIcon
:
MaterialIcon
.
cm
.
photoLibrary
))
icons
.
append
(
Item
(
name
:
"search"
,
mdIcon
:
MaterialIcon
.
search
,
cmIcon
:
MaterialIcon
.
cm
.
search
))
icons
.
append
(
Item
(
name
:
"settings"
,
mdIcon
:
MaterialIcon
.
settings
,
cmIcon
:
MaterialIcon
.
cm
.
settings
))
icons
.
append
(
Item
(
name
:
"share"
,
mdIcon
:
MaterialIcon
.
share
,
cmIcon
:
MaterialIcon
.
cm
.
share
))
icons
.
append
(
Item
(
name
:
"star"
,
mdIcon
:
MaterialIcon
.
star
,
cmIcon
:
MaterialIcon
.
cm
.
star
))
icons
.
append
(
Item
(
name
:
"starBorder"
,
mdIcon
:
MaterialIcon
.
starBorder
,
cmIcon
:
MaterialIcon
.
cm
.
starBorder
))
icons
.
append
(
Item
(
name
:
"starHalf"
,
mdIcon
:
MaterialIcon
.
starHalf
,
cmIcon
:
MaterialIcon
.
cm
.
starHalf
))
icons
.
append
(
Item
(
name
:
"videocam"
,
mdIcon
:
MaterialIcon
.
videocam
,
cmIcon
:
MaterialIcon
.
cm
.
videocam
))
}
/// Prepares the tableView.
...
...
@@ -158,12 +154,14 @@ extension ViewController: UITableViewDelegate {
}
func
tableView
(
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
let
v
=
UIView
()
let
v
:
UIView
=
UIView
()
v
.
backgroundColor
=
MaterialColor
.
grey
.
lighten4
let
leftLabel
=
UILabel
()
let
leftLabel
:
UILabel
=
UILabel
()
leftLabel
.
grid
.
columns
=
6
leftLabel
.
text
=
"Google Icons"
let
rightLabel
=
UILabel
()
let
rightLabel
:
UILabel
=
UILabel
()
rightLabel
.
grid
.
columns
=
6
rightLabel
.
text
=
"CosmicMind Icons"
rightLabel
.
textAlignment
=
.
Right
...
...
Sources/iOS/MaterialIcon.swift
View file @
8525e33a
...
...
@@ -31,7 +31,13 @@
import
UIKit
public
struct
MaterialIcon
{
/// An internal reference to the icons bundle.
private
static
var
internalBundle
:
NSBundle
?
/**
A public reference to the icons bundle, that aims to detect
the correct bundle to use.
*/
public
static
var
bundle
:
NSBundle
{
if
nil
==
MaterialIcon
.
internalBundle
{
MaterialIcon
.
internalBundle
=
NSBundle
(
forClass
:
MaterialView
.
self
)
...
...
@@ -42,13 +48,13 @@ public struct MaterialIcon {
}
return
MaterialIcon
.
internalBundle
!
}
private
static
func
icon
(
name
:
String
!
)
->
UIImage
{
return
(
UIImage
(
named
:
name
,
inBundle
:
bundle
,
compatibleWithTraitCollection
:
nil
)?
.
imageWithRenderingMode
(
.
AlwaysTemplate
))
!
/// Get the icon by the file name.
public
static
func
icon
(
name
:
String
)
->
UIImage
?
{
return
UIImage
(
named
:
name
,
inBundle
:
bundle
,
compatibleWithTraitCollection
:
nil
)?
.
imageWithRenderingMode
(
.
AlwaysTemplate
)
}
/// Default Google icons.
/// Google icons.
public
static
let
add
:
UIImage
?
=
MaterialIcon
.
icon
(
"ic_add_white"
)
public
static
let
arrowBack
:
UIImage
?
=
MaterialIcon
.
icon
(
"ic_arrow_back_white"
)
public
static
let
arrowDownward
:
UIImage
?
=
MaterialIcon
.
icon
(
"ic_arrow_downward_white"
)
...
...
@@ -78,7 +84,7 @@ public struct MaterialIcon {
public
static
let
videocam
:
UIImage
?
=
MaterialIcon
.
icon
(
"ic_videocam_white"
)
public
static
let
video
:
UIImage
?
=
MaterialIcon
.
icon
(
"cm_video_white"
)
/// C
ustom C
osmicMind icons.
/// CosmicMind icons.
public
struct
cm
{
public
static
let
add
:
UIImage
?
=
MaterialIcon
.
icon
(
"cm_add_white"
)
public
static
let
addCircle
:
UIImage
?
=
MaterialIcon
.
icon
(
"ic_add_circle_white"
)
...
...
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