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
d1f9360b
Unverified
Commit
d1f9360b
authored
Mar 08, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: cleaning up Editor
parent
fa08e443
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
257 deletions
+89
-257
Material.xcodeproj/project.pbxproj
+0
-6
Sources/iOS/Editor.swift
+3
-2
Sources/iOS/EditorController.swift
+0
-83
Sources/iOS/TextView.swift
+86
-166
No files found.
Material.xcodeproj/project.pbxproj
View file @
d1f9360b
...
...
@@ -19,7 +19,6 @@
9617B0821DFCA8CF00410F8F
/* CapturePreview.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96717B0F1DBE6AF600DA84DB
/* CapturePreview.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9617B0831DFCA8CF00410F8F
/* CaptureController.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96717B0E1DBE6AF600DA84DB
/* CaptureController.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9617B0841DFCA8CF00410F8F
/* Editor.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
961DED451DCC40C500F425B6
/* Editor.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9617B0851DFCA8CF00410F8F
/* EditorController.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
961DED4A1DCC546100F425B6
/* EditorController.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9617B0861DFCA8CF00410F8F
/* HeightPreset.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9626CB9A1DAD3D1D003E2611
/* HeightPreset.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9617B0871DFCA8CF00410F8F
/* PageTabBarController.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
963FBF071D669D14008F8512
/* PageTabBarController.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9617B0881DFCA8CF00410F8F
/* PhotoLibrary.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96717B161DBE6B1800DA84DB
/* PhotoLibrary.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
...
...
@@ -118,7 +117,6 @@
965E81221DD4D5C800D61E4B
/* TextView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB79E1CB40DC500C806FE
/* TextView.swift */
;
};
965E81231DD4D7C800D61E4B
/* BottomTabBar.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB7591CB40DC500C806FE
/* BottomTabBar.swift */
;
};
965E81241DD4D7C800D61E4B
/* Editor.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
961DED451DCC40C500F425B6
/* Editor.swift */
;
};
965E81251DD4D7C800D61E4B
/* EditorController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
961DED4A1DCC546100F425B6
/* EditorController.swift */
;
};
965E81261DD4D7C800D61E4B
/* CharacterAttribute.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
961276621DCD8B1800A7D920
/* CharacterAttribute.swift */
;
};
9697F7BF1D8F2572004741EC
/* Divider.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96230AB71D6A520C00AF47DC
/* Divider.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9697F7C01D8F2572004741EC
/* Material+CALayer.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96F1DC871D654FDF0025F925
/* Material+CALayer.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
...
...
@@ -196,7 +194,6 @@
961276621DCD8B1800A7D920
/* CharacterAttribute.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
CharacterAttribute.swift
;
sourceTree
=
"<group>"
;
};
961730591E145DE900A9A297
/* CollectionViewCard.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
CollectionViewCard.swift
;
sourceTree
=
"<group>"
;
};
961DED451DCC40C500F425B6
/* Editor.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Editor.swift
;
sourceTree
=
"<group>"
;
};
961DED4A1DCC546100F425B6
/* EditorController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
EditorController.swift
;
sourceTree
=
"<group>"
;
};
961E6BDE1DDA2A95004E6C93
/* Application.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Application.swift
;
sourceTree
=
"<group>"
;
};
961E6BE11DDA2AF3004E6C93
/* Screen.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Screen.swift
;
sourceTree
=
"<group>"
;
};
961EFC571D738FF600E84652
/* SnackbarController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
SnackbarController.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -315,7 +312,6 @@
isa
=
PBXGroup
;
children
=
(
961DED451DCC40C500F425B6
/* Editor.swift */
,
961DED4A1DCC546100F425B6
/* EditorController.swift */
,
);
name
=
Editor
;
sourceTree
=
"<group>"
;
...
...
@@ -822,7 +818,6 @@
9617B0821DFCA8CF00410F8F
/* CapturePreview.swift in Headers */
,
9617B0831DFCA8CF00410F8F
/* CaptureController.swift in Headers */
,
9617B0841DFCA8CF00410F8F
/* Editor.swift in Headers */
,
9617B0851DFCA8CF00410F8F
/* EditorController.swift in Headers */
,
9617B0861DFCA8CF00410F8F
/* HeightPreset.swift in Headers */
,
9617B0871DFCA8CF00410F8F
/* PageTabBarController.swift in Headers */
,
9617B0881DFCA8CF00410F8F
/* PhotoLibrary.swift in Headers */
,
...
...
@@ -929,7 +924,6 @@
files
=
(
965E81231DD4D7C800D61E4B
/* BottomTabBar.swift in Sources */
,
965E81241DD4D7C800D61E4B
/* Editor.swift in Sources */
,
965E81251DD4D7C800D61E4B
/* EditorController.swift in Sources */
,
961E6BE21DDA2AF3004E6C93
/* Screen.swift in Sources */
,
965E81261DD4D7C800D61E4B
/* CharacterAttribute.swift in Sources */
,
965E80FF1DD4D5C800D61E4B
/* BottomNavigationController.swift in Sources */
,
...
...
Sources/iOS/Editor.swift
View file @
d1f9360b
...
...
@@ -324,8 +324,9 @@ extension Editor {
/// Prepares the keyboard notification center observers.
fileprivate
func
prepareKeyboardNotificationObservers
()
{
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
handleKeyboardWillShow(notification:)
)
,
name
:
NSNotification
.
Name
.
UIKeyboardWillShow
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
handleKeyboardWillHide(notification:)
)
,
name
:
NSNotification
.
Name
.
UIKeyboardWillHide
,
object
:
nil
)
let
defaultCenter
=
NotificationCenter
.
default
defaultCenter
.
addObserver
(
self
,
selector
:
#selector(
handleKeyboardWillShow(notification:)
)
,
name
:
NSNotification
.
Name
.
UIKeyboardWillShow
,
object
:
nil
)
defaultCenter
.
addObserver
(
self
,
selector
:
#selector(
handleKeyboardWillHide(notification:)
)
,
name
:
NSNotification
.
Name
.
UIKeyboardWillHide
,
object
:
nil
)
}
}
...
...
Sources/iOS/EditorController.swift
deleted
100644 → 0
View file @
fa08e443
/*
* Copyright (C) 2015 - 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of CosmicMind nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import
UIKit
import
AVFoundation
extension
UIViewController
{
/**
A convenience property that provides access to the EditorController.
This is the recommended method of accessing the EditorController
through child UIViewControllers.
*/
public
var
editorController
:
EditorController
?
{
var
viewController
:
UIViewController
?
=
self
while
nil
!=
viewController
{
if
viewController
is
EditorController
{
return
viewController
as?
EditorController
}
viewController
=
viewController
?
.
parent
}
return
nil
}
}
open
class
EditorController
:
ToolbarController
{
/// A reference to the Editor instance.
@IBInspectable
open
let
editor
=
Editor
()
/**
Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepare method
to initialize property values and other setup operations.
The super.prepare method should always be called immediately
when subclassing.
*/
open
override
func
prepare
()
{
super
.
prepare
()
view
.
backgroundColor
=
.
white
prepareToolbar
()
prepareEditor
()
}
/// Prepares the toolbar.
private
func
prepareToolbar
()
{
toolbar
.
depthPreset
=
.
none
}
/// Prepares editor.
private
func
prepareEditor
()
{
editor
.
delegate
=
self
}
}
extension
EditorController
:
EditorDelegate
{}
Sources/iOS/TextView.swift
View file @
d1f9360b
This diff is collapsed.
Click to expand it.
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