Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Companion App iOS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
card10
Companion App iOS
Commits
f3839a7d
Commit
f3839a7d
authored
Aug 22, 2019
by
Roddi Deecke
Committed by
Thomas Mellenthin
Aug 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix implicit getter violation
parent
93bc2994
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
32 deletions
+17
-32
.swiftlint.yml
.swiftlint.yml
+0
-1
card10badge/Bluetooth/DataExtension.swift
card10badge/Bluetooth/DataExtension.swift
+17
-31
No files found.
.swiftlint.yml
View file @
f3839a7d
...
...
@@ -16,7 +16,6 @@ disabled_rules:
-
function_parameter_count
-
line_length
-
force_cast
-
implicit_getter
-
todo
-
file_length
-
function_body_length
...
...
card10badge/Bluetooth/DataExtension.swift
View file @
f3839a7d
...
...
@@ -9,57 +9,43 @@ import UIKit
extension
Data
{
var
uint8
:
UInt8
{
get
{
var
number
:
UInt8
=
0
self
.
copyBytes
(
to
:
&
number
,
count
:
MemoryLayout
<
UInt8
>.
size
)
return
number
}
var
number
:
UInt8
=
0
self
.
copyBytes
(
to
:
&
number
,
count
:
MemoryLayout
<
UInt8
>.
size
)
return
number
}
var
uint16
:
UInt16
{
get
{
let
i16array
=
self
.
withUnsafeBytes
{
UnsafeBufferPointer
<
UInt16
>
(
start
:
$0
,
count
:
self
.
count
/
2
)
.
map
(
UInt16
.
init
(
littleEndian
:))
}
return
i16array
[
0
]
let
i16array
=
self
.
withUnsafeBytes
{
UnsafeBufferPointer
<
UInt16
>
(
start
:
$0
,
count
:
self
.
count
/
2
)
.
map
(
UInt16
.
init
(
littleEndian
:))
}
return
i16array
[
0
]
}
var
uint32
:
UInt32
{
get
{
let
i32array
=
self
.
withUnsafeBytes
{
UnsafeBufferPointer
<
UInt32
>
(
start
:
$0
,
count
:
self
.
count
/
2
)
.
map
(
UInt32
.
init
(
littleEndian
:))
}
return
i32array
[
0
]
let
i32array
=
self
.
withUnsafeBytes
{
UnsafeBufferPointer
<
UInt32
>
(
start
:
$0
,
count
:
self
.
count
/
2
)
.
map
(
UInt32
.
init
(
littleEndian
:))
}
return
i32array
[
0
]
}
var
uint64
:
UInt64
{
get
{
let
i64array
=
self
.
withUnsafeBytes
{
UnsafeBufferPointer
<
UInt64
>
(
start
:
$0
,
count
:
self
.
count
/
2
)
.
map
(
UInt64
.
init
(
littleEndian
:))
}
return
i64array
[
0
]
let
i64array
=
self
.
withUnsafeBytes
{
UnsafeBufferPointer
<
UInt64
>
(
start
:
$0
,
count
:
self
.
count
/
2
)
.
map
(
UInt64
.
init
(
littleEndian
:))
}
return
i64array
[
0
]
}
var
uuid
:
NSUUID
?
{
get
{
var
bytes
=
[
UInt8
](
repeating
:
0
,
count
:
self
.
count
)
self
.
copyBytes
(
to
:
&
bytes
,
count
:
self
.
count
*
MemoryLayout
<
UInt32
>.
size
)
return
NSUUID
(
uuidBytes
:
bytes
)
}
var
bytes
=
[
UInt8
](
repeating
:
0
,
count
:
self
.
count
)
self
.
copyBytes
(
to
:
&
bytes
,
count
:
self
.
count
*
MemoryLayout
<
UInt32
>.
size
)
return
NSUUID
(
uuidBytes
:
bytes
)
}
var
stringASCII
:
String
?
{
get
{
return
NSString
(
data
:
self
,
encoding
:
String
.
Encoding
.
ascii
.
rawValue
)
as
String
?
}
return
NSString
(
data
:
self
,
encoding
:
String
.
Encoding
.
ascii
.
rawValue
)
as
String
?
}
var
stringUTF8
:
String
?
{
get
{
return
NSString
(
data
:
self
,
encoding
:
String
.
Encoding
.
utf8
.
rawValue
)
as
String
?
}
return
NSString
(
data
:
self
,
encoding
:
String
.
Encoding
.
utf8
.
rawValue
)
as
String
?
}
struct
HexEncodingOptions
:
OptionSet
{
...
...
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