Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
jobthai
jobthai-ios-swift
Commits
05861425
Commit
05861425
authored
8 years ago
by
tayathorn
Browse files
Options
Download
Plain Diff
Merge branch 'feature/sprint32_FixBug' into develop
parents
c85b58ad
e27d6ccc
develop
before_remove_auto_login
TestFlight_3.0.0_20161102
Sprint#33_Build_3.0.0_21
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
JobThai/JobThai/AppExtension.swift
+26
-5
JobThai/JobThai/AppExtension.swift
JobThai/JobThai/JTMTextView.swift
+5
-0
JobThai/JobThai/JTMTextView.swift
JobThai/JobThai/NoticeModel.swift
+2
-2
JobThai/JobThai/NoticeModel.swift
with
33 additions
and
7 deletions
+33
-7
JobThai/JobThai/AppExtension.swift
+
26
−
5
View file @
05861425
...
...
@@ -46,14 +46,35 @@ extension UIViewController {
extension
String
{
//MARK: Calculate content size
func
getContentTextFitSize
(
width
widthSize
:
CGFloat
)
->
CGSize
{
let
contentTextView
=
UITextView
(
frame
:
CGRect
(
origin
:
CGPointZero
,
size
:
CGSize
(
width
:
widthSize
,
height
:
CGFloat
(
MAXFLOAT
))))
func
getContentTextFitSize
(
width
widthSize
:
CGFloat
,
edgeInset
:
UIEdgeInsets
)
->
CGSize
{
let
contentTextView
=
JTMTextView
(
frame
:
CGRect
(
origin
:
CGPointZero
,
size
:
CGSize
(
width
:
widthSize
,
height
:
CGFloat
(
MAXFLOAT
))))
contentTextView
.
font
=
getFontFromDeviceSize
()
contentTextView
.
text
=
self
contentTextView
.
textContainerInset
=
UIEdgeInsets
(
top
:
10
,
left
:
16
,
bottom
:
10
,
right
:
5
)
dump
(
self
)
// contentTextView.setLineSpacingText(self)
contentTextView
.
textContainerInset
=
edgeInset
let
contentSize
=
contentTextView
.
sizeThatFits
(
CGSize
(
width
:
UIScreen
.
mainScreen
()
.
bounds
.
width
,
height
:
CGFloat
(
MAXFLOAT
)))
let
contentSize
=
contentTextView
.
sizeThatFits
(
CGSize
(
width
:
width
Size
,
height
:
CGFloat
(
MAXFLOAT
)))
return
contentSize
return
contentSize
//CGSizeMake(UIScreen.mainScreen().bounds.width, 400)
}
func
getFontFromDeviceSize
()
->
UIFont
{
var
fontSize
:
CGFloat
=
0
if
screenType
==
DisplaySizeType
.
SCREEN_3_5_INCH
{
fontSize
=
12
}
else
if
screenType
==
DisplaySizeType
.
SCREEN_4_0_INCH
{
fontSize
=
12
}
else
if
screenType
==
DisplaySizeType
.
SCREEN_4_7_INCH
{
fontSize
=
13
}
else
if
screenType
==
DisplaySizeType
.
SCREEN_5_5_INCH
{
fontSize
=
14
}
else
{
fontSize
=
12
}
return
UIFont
(
name
:
"HelveticaNeue"
,
size
:
fontSize
)
!
}
func
addHttpToUrl
()
->
String
{
...
...
This diff is collapsed.
Click to expand it.
JobThai/JobThai/JTMTextView.swift
+
5
−
0
View file @
05861425
...
...
@@ -10,8 +10,13 @@ import UIKit
class
JTMTextView
:
UITextView
{
override
init
(
frame
:
CGRect
,
textContainer
:
NSTextContainer
?)
{
super
.
init
(
frame
:
frame
,
textContainer
:
textContainer
)
}
required
init
?(
coder
aDecoder
:
NSCoder
)
{
super
.
init
(
coder
:
aDecoder
)
}
func
setLineSpacingText
(
text
:
String
)
{
...
...
This diff is collapsed.
Click to expand it.
JobThai/JobThai/NoticeModel.swift
+
2
−
2
View file @
05861425
...
...
@@ -39,8 +39,8 @@ class NoticeModel {
//MARK: Calculate Content Size
func
getContentHeight
(
text
:
String
)
->
CGFloat
{
let
contentWidth
=
UIScreen
.
mainScreen
()
.
bounds
.
width
-
contentEdgeInset
.
left
-
contentEdgeInset
.
right
return
text
.
getContentTextFitSize
(
width
:
contentWidth
)
.
height
let
contentWidth
=
UIScreen
.
mainScreen
()
.
bounds
.
width
//
- contentEdgeInset.left - contentEdgeInset.right
return
text
.
getContentTextFitSize
(
width
:
contentWidth
,
edgeInset
:
contentEdgeInset
)
.
height
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets