Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sridatta Gorugantula
Stickers
Commits
de2bb069
Commit
de2bb069
authored
Dec 25, 2019
by
emrcftci
Committed by
Amritpal Sandhu
Jan 28, 2020
Browse files
refactor(*): Upgrade to Swift 5
parent
db1452aa
Changes
7
Hide whitespace changes
Inline
Side-by-side
iOS/WAStickersThirdParty.xcodeproj/project.pbxproj
View file @
de2bb069
...
...
@@ -327,7 +327,7 @@
TargetAttributes
=
{
8A22EDFF1F9A9F40003A7F21
=
{
CreatedOnToolsVersion
=
9.0
;
LastSwiftMigration
=
091
0
;
LastSwiftMigration
=
112
0
;
ProvisioningStyle
=
Automatic
;
SystemCapabilities
=
{
com.apple.ApplicationGroups.iOS
=
{
...
...
@@ -580,7 +580,7 @@
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
SWIFT_OBJC_BRIDGING_HEADER
=
"WAStickersThirdParty/WAStickersThirdParty-Bridging-Header.h"
;
SWIFT_OPTIMIZATION_LEVEL
=
"-Onone"
;
SWIFT_VERSION
=
4
.0
;
SWIFT_VERSION
=
5
.0
;
TARGETED_DEVICE_FAMILY
=
1
;
};
name
=
Debug
;
...
...
@@ -603,7 +603,7 @@
PRODUCT_BUNDLE_IDENTIFIER
=
WA.WAStickersThirdParty
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
SWIFT_OBJC_BRIDGING_HEADER
=
"WAStickersThirdParty/WAStickersThirdParty-Bridging-Header.h"
;
SWIFT_VERSION
=
4
.0
;
SWIFT_VERSION
=
5
.0
;
TARGETED_DEVICE_FAMILY
=
1
;
};
name
=
Release
;
...
...
iOS/WAStickersThirdParty/AppDelegate.swift
View file @
de2bb069
...
...
@@ -13,7 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var
window
:
UIWindow
?
func
application
(
_
application
:
UIApplication
,
didFinishLaunchingWithOptions
launchOptions
:
[
UIApplicationLaunchOptionsKey
:
Any
]?)
->
Bool
{
func
application
(
_
application
:
UIApplication
,
didFinishLaunchingWithOptions
launchOptions
:
[
UIApplication
.
LaunchOptionsKey
:
Any
]?)
->
Bool
{
// Override point for customization after application launch.
return
true
}
...
...
iOS/WAStickersThirdParty/Interoperability.swift
View file @
de2bb069
...
...
@@ -37,7 +37,7 @@ struct Interoperability {
}
if
#available(iOS 10.0, *)
{
pasteboard
.
setItems
([[
PasteboardStickerPackDataType
:
dataToSend
]],
options
:
[
UIPasteboardOption
.
localOnly
:
true
,
UIPasteboardOption
.
expirationDate
:
NSDate
(
timeIntervalSinceNow
:
PasteboardExpirationSeconds
)])
pasteboard
.
setItems
([[
PasteboardStickerPackDataType
:
dataToSend
]],
options
:
[
UIPasteboard
.
Option
sKey
.
localOnly
:
true
,
UIPasteboard
.
Option
sKey
.
expirationDate
:
NSDate
(
timeIntervalSinceNow
:
PasteboardExpirationSeconds
)])
}
else
{
pasteboard
.
setData
(
dataToSend
,
forPasteboardType
:
PasteboardStickerPackDataType
)
}
...
...
iOS/WAStickersThirdParty/StickerPack.swift
View file @
de2bb069
...
...
@@ -184,7 +184,7 @@ class StickerPack {
json
[
"identifier"
]
=
self
.
identifier
json
[
"name"
]
=
self
.
name
json
[
"publisher"
]
=
self
.
publisher
json
[
"tray_image"
]
=
UIImagePNGRepresentation
(
self
.
trayImage
.
image
!
)?
.
base64EncodedString
()
json
[
"tray_image"
]
=
self
.
trayImage
.
image
!
.
pngData
(
)?
.
base64EncodedString
()
var
stickersArray
:
[[
String
:
Any
]]
=
[]
for
sticker
in
self
.
stickers
{
...
...
iOS/WAStickersThirdParty/StickerPackInfoViewController.swift
View file @
de2bb069
...
...
@@ -27,7 +27,7 @@ class StickerPackInfoViewController: UITableViewController {
insets
=
tableView
.
safeAreaInsets
}
footerView
.
label
.
preferredMaxLayoutWidth
=
footerView
.
preferredLabelLayoutWidth
(
viewWidth
:
tableView
.
bounds
.
size
.
width
-
FooterView
.
MARGIN
*
2
-
insets
.
left
-
insets
.
right
)
return
ceil
(
footerView
.
systemLayoutSizeFitting
(
UI
L
ayoutFittingCompressedSize
)
.
height
)
return
ceil
(
footerView
.
systemLayoutSizeFitting
(
UI
View
.
l
ayoutFittingCompressedSize
)
.
height
)
}
var
stickerPack
:
StickerPack
!
...
...
iOS/WAStickersThirdParty/StickerPackViewController.swift
View file @
de2bb069
...
...
@@ -94,6 +94,8 @@ class StickerPackViewController: UIViewController, UICollectionViewDataSource, U
let
buttonLandscapeSize
:
CGSize
=
CGSize
(
width
:
250.0
,
height
:
50.0
)
let
buttonBottomMargin
:
CGFloat
=
20.0
guard
let
view
=
view
else
{
return
}
// Share button constraints
view
.
addConstraint
(
NSLayoutConstraint
(
item
:
view
,
attribute
:
.
bottomMargin
,
relatedBy
:
.
equal
,
toItem
:
shareButton
,
attribute
:
.
bottom
,
multiplier
:
1.0
,
constant
:
buttonBottomMargin
))
let
centerPortraitShareConstraint
=
NSLayoutConstraint
(
item
:
view
,
attribute
:
.
centerXWithinMargins
,
relatedBy
:
.
equal
,
toItem
:
shareButton
,
attribute
:
.
centerXWithinMargins
,
multiplier
:
1.0
,
constant
:
0.0
)
...
...
iOS/WAStickersThirdParty/UIAlertController+Additions.swift
View file @
de2bb069
...
...
@@ -10,7 +10,7 @@ import UIKit
extension
UIAlertController
{
func
addSpinner
()
{
let
activity
:
UIActivityIndicatorView
=
UIActivityIndicatorView
(
activityIndicatorS
tyle
:
.
gray
)
let
activity
:
UIActivityIndicatorView
=
UIActivityIndicatorView
(
s
tyle
:
.
gray
)
view
.
addSubview
(
activity
)
activity
.
translatesAutoresizingMaskIntoConstraints
=
false
...
...
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!
Cancel
Please
register
or
sign in
to comment