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
448b0318
Commit
448b0318
authored
Sep 02, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: added updated before release
parent
12fd3d0c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
11 deletions
+12
-11
Source/Capture.swift
+2
-2
Source/CapturePreview.swift
+5
-5
Source/Text.swift
+1
-0
Source/TextView.swift
+4
-4
No files found.
Source/Capture.swift
View file @
448b0318
...
...
@@ -89,12 +89,12 @@ public class Capture: NSObject, AVCaptureFileOutputRecordingDelegate {
public
weak
var
delegate
:
CaptureDelegate
?
/**
*
setup
Session
*
prepare
Session
* A helper method that prepares the session with the various available inputs and outputs.
* @param preset: String, default: AVCaptureSessionPresetHigh
* @return A boolean value, true if successful, false otherwise.
*/
public
func
setup
Session
(
preset
:
String
=
AVCaptureSessionPresetHigh
)
->
Bool
{
public
func
prepare
Session
(
preset
:
String
=
AVCaptureSessionPresetHigh
)
->
Bool
{
session
.
sessionPreset
=
preset
var
error
:
NSError
?
...
...
Source/CapturePreview.swift
View file @
448b0318
...
...
@@ -120,18 +120,18 @@ public class Preview: UIView {
required
public
init
(
coder
aDecoder
:
NSCoder
)
{
super
.
init
(
coder
:
aDecoder
)
setup
View
()
prepare
View
()
}
public
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
setup
View
()
prepare
View
()
}
public
init
()
{
super
.
init
(
frame
:
CGRectZero
)
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
setup
View
()
prepare
View
()
}
//
...
...
@@ -160,10 +160,10 @@ public class Preview: UIView {
}
//
// :name:
setup
View
// :name:
prepare
View
// :description: Common setup for view.
//
private
func
setup
View
()
{
private
func
prepare
View
()
{
let
captureLayer
:
AVCaptureVideoPreviewLayer
=
layer
as!
AVCaptureVideoPreviewLayer
captureLayer
.
videoGravity
=
AVLayerVideoGravityResizeAspectFill
...
...
Source/Text.swift
View file @
448b0318
...
...
@@ -24,6 +24,7 @@ public protocol TextDelegate {
optional
func
textStorageDidProcessEdit
(
text
:
Text
,
textStorage
:
TextStorage
,
string
:
String
,
result
:
NSTextCheckingResult
,
flags
:
NSMatchingFlags
,
stop
:
UnsafeMutablePointer
<
ObjCBool
>
)
}
@objc(Text)
public
class
Text
:
NSObject
{
/**
:name: searchPattern
...
...
Source/TextView.swift
View file @
448b0318
...
...
@@ -33,7 +33,7 @@ public class TextView: UITextView {
required
public
init
(
coder
aDecoder
:
NSCoder
)
{
super
.
init
(
coder
:
aDecoder
)
setup
View
()
prepare
View
()
}
override
public
init
(
frame
:
CGRect
,
textContainer
:
NSTextContainer
?)
{
...
...
@@ -41,7 +41,7 @@ public class TextView: UITextView {
if
CGRectZero
==
frame
{
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
}
setup
View
()
prepare
View
()
}
//
...
...
@@ -136,10 +136,10 @@ public class TextView: UITextView {
}
//
// :name:
setup
View
// :name:
prepare
View
// :description: Sets up the common initilized values.
//
private
func
setup
View
()
{
private
func
prepare
View
()
{
backgroundColor
=
MaterialTheme
.
clear
.
color
textColor
=
MaterialTheme
.
black
.
color
label
.
font
=
font
...
...
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