Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
swift practice 2
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jon Bent
swift practice 2
Commits
9ce9cdcc
Commit
9ce9cdcc
authored
May 25, 2022
by
Jon Bent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First commit
parents
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
66 additions
and
0 deletions
+66
-0
Contents.swift
Contents.swift
+32
-0
contents.xcplayground
contents.xcplayground
+5
-0
contents.xcworkspacedata
playground.xcworkspace/contents.xcworkspacedata
+7
-0
UserInterfaceState.xcuserstate
...xcuserdata/Jon.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
timeline.xctimeline
timeline.xctimeline
+6
-0
xcschememanagement.plist
...erdata/Jon.xcuserdatad/xcschemes/xcschememanagement.plist
+16
-0
No files found.
Contents.swift
0 → 100644
View file @
9ce9cdcc
import
UIKit
class
Singleton
{
var
data
:
String
init
(
autoClosure
:
@autoclosure
()
->
String
){
data
=
autoClosure
()
}
static
var
shared
:
Singleton
=
Singleton
(
autoClosure
:
{
"autoclosed singleton"
}())
}
Singleton
.
shared
.
data
extension
Sequence
where
Element
==
Int
{
func
double
()
->
[
Int
]{
return
self
.
map
()
{
$0
*
2
}
}
}
extension
Sequence
where
Element
==
Double
{
func
double
()
->
[
Double
]
{
return
self
.
map
()
{
$0
*
2
}
}
}
extension
Sequence
where
Element
==
String
{
func
double
()
->
[
String
]
{
return
self
.
map
()
{
String
((
Double
(
$0
)
??
0
)
*
2
)}
}
}
print
([
1
,
2
,
3
,
4
]
.
double
())
print
([
1.1
,
2.2
,
3.3
,
4.4
]
.
double
())
print
([
"1.1"
,
"2.2"
,
"3.3"
,
"4.4"
]
.
double
())
contents.xcplayground
0 → 100644
View file @
9ce9cdcc
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground
version=
'5.0'
target-platform=
'ios'
buildActiveScheme=
'true'
importAppTypes=
'true'
>
<timeline
fileName=
'timeline.xctimeline'
/>
</playground>
\ No newline at end of file
playground.xcworkspace/contents.xcworkspacedata
0 → 100644
View file @
9ce9cdcc
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version =
"1.0"
>
<FileRef
location =
"group:"
>
</FileRef>
</Workspace>
playground.xcworkspace/xcuserdata/Jon.xcuserdatad/UserInterfaceState.xcuserstate
0 → 100644
View file @
9ce9cdcc
File added
timeline.xctimeline
0 → 100644
View file @
9ce9cdcc
<?xml version="1.0" encoding="UTF-8"?>
<Timeline
version =
"3.0"
>
<TimelineItems>
</TimelineItems>
</Timeline>
xcuserdata/Jon.xcuserdatad/xcschemes/xcschememanagement.plist
0 → 100644
View file @
9ce9cdcc
<
?xml
v
e
rsion="
1
.
0
"
e
n
c
o
d
ing="UT
F
-
8
"?
>
<
!
D
O
C
TYP
E
plist
PU
B
LI
C
"-//
A
ppl
e
//
D
T
D
PLIST
1
.
0
//
E
N"
"http://www.
a
ppl
e
.
c
om/
D
T
D
s/Prop
e
rtyList-
1
.
0
.
d
t
d
"
>
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
k
e
y
>
SchemeUserState
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
protocol
(
Playground
)
.xcscheme
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
isShown
<
/k
e
y
>
<
fa
ls
e
/
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
0
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/plist
>
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