Skip to content

Commit b53e86e

Browse files
Bug fix
1 parent ea7cac5 commit b53e86e

File tree

80 files changed

+263
-3250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+263
-3250
lines changed

Common/NutellaConfigDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import Foundation
1010

11-
@objc protocol NutellaConfigDelegate {
11+
protocol NutellaConfigDelegate: class {
1212
var runId: String { get }
1313
var appId: String { get }
1414
var componentId: String { get }

Common/NutellaDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ import Foundation
1111
/**
1212
This protocol is there for future uses
1313
*/
14-
@objc public protocol NutellaDelegate {
14+
public protocol NutellaDelegate: class {
1515
}

Common/NutellaLocation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ public class NutellaLocation: NSObject, NutellaNetDelegate, CLLocationManagerDel
464464
var region = CLBeaconRegion(proximityUUID: uuid, major: UInt16(major), minor: UInt16(minor), identifier: "virtual_beacon")
465465

466466
if let peripheralData = region.peripheralDataWithMeasuredPower(-59) {
467-
peripheralManager.startAdvertising(peripheralData)
467+
peripheralManager.startAdvertising(peripheralData as [NSObject : AnyObject])
468468
}
469469
}
470470

@@ -487,14 +487,14 @@ public class NutellaLocation: NSObject, NutellaNetDelegate, CLLocationManagerDel
487487

488488
// Search for the right beacon
489489
for (rid, b) in self.beacons {
490-
if b == clBeacon as CLBeacon {
490+
if b == clBeacon as! CLBeacon {
491491
beacon = b
492492
break
493493
}
494494
}
495495

496496
if beacon != nil {
497-
let distance = (clBeacon as CLBeacon).accuracy
497+
let distance = (clBeacon as! CLBeacon).accuracy
498498

499499
if distance < 0 {
500500
continue

Common/SwiftyJSON.swift

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ extension JSON: SequenceType{
139139
get {
140140
switch self.type {
141141
case .Array:
142-
return (self.object as [AnyObject]).isEmpty
142+
return (self.object as! [AnyObject]).isEmpty
143143
case .Dictionary:
144-
return (self.object as [String : AnyObject]).isEmpty
144+
return (self.object as! [String : AnyObject]).isEmpty
145145
default:
146146
return false
147147
}
@@ -170,7 +170,7 @@ extension JSON: SequenceType{
170170
public func generate() -> GeneratorOf <(String, JSON)> {
171171
switch self.type {
172172
case .Array:
173-
let array_ = object as [AnyObject]
173+
let array_ = object as! [AnyObject]
174174
var generate_ = array_.generate()
175175
var index_: Int = 0
176176
return GeneratorOf<(String, JSON)> {
@@ -181,7 +181,7 @@ extension JSON: SequenceType{
181181
}
182182
}
183183
case .Dictionary:
184-
let dictionary_ = object as [String : AnyObject]
184+
let dictionary_ = object as! [String : AnyObject]
185185
var generate_ = dictionary_.generate()
186186
return GeneratorOf<(String, JSON)> {
187187
if let (key_: String, value_: AnyObject) = generate_.next() {
@@ -221,7 +221,7 @@ extension JSON {
221221
return errorResult_
222222
}
223223

224-
let array_ = self.object as [AnyObject]
224+
let array_ = self.object as! [AnyObject]
225225

226226
if index >= 0 && index < array_.count {
227227
return JSON(array_[index])
@@ -233,7 +233,7 @@ extension JSON {
233233
}
234234
set {
235235
if self.type == .Array {
236-
var array_ = self.object as [AnyObject]
236+
var array_ = self.object as! [AnyObject]
237237
if array_.count > index {
238238
array_[index] = newValue.object
239239
self.object = array_
@@ -259,7 +259,7 @@ extension JSON {
259259
}
260260
set {
261261
if self.type == .Dictionary {
262-
var dictionary_ = self.object as [String : AnyObject]
262+
var dictionary_ = self.object as! [String : AnyObject]
263263
dictionary_[key] = newValue.object
264264
self.object = dictionary_
265265
}
@@ -270,16 +270,16 @@ extension JSON {
270270
private subscript(#sub: SubscriptType) -> JSON {
271271
get {
272272
if sub is String {
273-
return self[key:sub as String]
273+
return self[key:sub as! String]
274274
} else {
275-
return self[index:sub as Int]
275+
return self[index:sub as! Int]
276276
}
277277
}
278278
set {
279279
if sub is String {
280-
self[key:sub as String] = newValue
280+
self[key:sub as! String] = newValue
281281
} else {
282-
self[index:sub as Int] = newValue
282+
self[index:sub as! Int] = newValue
283283
}
284284
}
285285
}
@@ -440,16 +440,17 @@ extension JSON: RawRepresentable {
440440
switch self.type {
441441
case .Array, .Dictionary:
442442
if let data = self.rawData(options: opt) {
443-
return NSString(data: data, encoding: encoding)
443+
var string: String = NSString(data: data, encoding: encoding) as! String
444+
return string
444445
} else {
445446
return nil
446447
}
447448
case .String:
448-
return (self.object as String)
449+
return (self.object as! String)
449450
case .Number:
450-
return (self.object as NSNumber).stringValue
451+
return (self.object as! NSNumber).stringValue
451452
case .Bool:
452-
return (self.object as Bool).description
453+
return (self.object as! Bool).description
453454
case .Null:
454455
return "null"
455456
default:
@@ -483,7 +484,7 @@ extension JSON {
483484
public var array: [JSON]? {
484485
get {
485486
if self.type == .Array {
486-
return map(self.object as [AnyObject]){ JSON($0) }
487+
return map(self.object as! [AnyObject]){ JSON($0) }
487488
} else {
488489
return nil
489490
}
@@ -533,7 +534,7 @@ extension JSON {
533534
public var dictionary: [String : JSON]? {
534535
get {
535536
if self.type == .Dictionary {
536-
return _map(self.object as [String : AnyObject]){ JSON($0) }
537+
return _map(self.object as! [String : AnyObject]){ JSON($0) }
537538
} else {
538539
return nil
539540
}
@@ -634,11 +635,11 @@ extension JSON {
634635
get {
635636
switch self.type {
636637
case .String:
637-
return self.object as String
638+
return self.object as! String
638639
case .Number:
639640
return self.object.stringValue
640641
case .Bool:
641-
return (self.object as Bool).description
642+
return (self.object as! Bool).description
642643
default:
643644
return ""
644645
}
@@ -672,15 +673,15 @@ extension JSON {
672673
get {
673674
switch self.type {
674675
case .String:
675-
let scanner = NSScanner(string: self.object as String)
676+
let scanner = NSScanner(string: self.object as! String)
676677
if scanner.scanDouble(nil){
677678
if (scanner.atEnd) {
678-
return NSNumber(double:(self.object as NSString).doubleValue)
679+
return NSNumber(double:(self.object as! NSString).doubleValue)
679680
}
680681
}
681682
return NSNumber(double: 0.0)
682683
case .Number, .Bool:
683-
return self.object as NSNumber
684+
return self.object as! NSNumber
684685
default:
685686
return NSNumber(double: 0.0)
686687
}
@@ -1008,15 +1009,15 @@ public func ==(lhs: JSON, rhs: JSON) -> Bool {
10081009

10091010
switch (lhs.type, rhs.type) {
10101011
case (.Number, .Number):
1011-
return (lhs.object as NSNumber) == (rhs.object as NSNumber)
1012+
return (lhs.object as! NSNumber) == (rhs.object as! NSNumber)
10121013
case (.String, .String):
1013-
return (lhs.object as String) == (rhs.object as String)
1014+
return (lhs.object as! String) == (rhs.object as! String)
10141015
case (.Bool, .Bool):
1015-
return (lhs.object as Bool) == (rhs.object as Bool)
1016+
return (lhs.object as! Bool) == (rhs.object as! Bool)
10161017
case (.Array, .Array):
1017-
return (lhs.object as NSArray) == (rhs.object as NSArray)
1018+
return (lhs.object as! NSArray) == (rhs.object as! NSArray)
10181019
case (.Dictionary, .Dictionary):
1019-
return (lhs.object as NSDictionary) == (rhs.object as NSDictionary)
1020+
return (lhs.object as! NSDictionary) == (rhs.object as! NSDictionary)
10201021
case (.Null, .Null):
10211022
return true
10221023
default:
@@ -1028,15 +1029,15 @@ public func <=(lhs: JSON, rhs: JSON) -> Bool {
10281029

10291030
switch (lhs.type, rhs.type) {
10301031
case (.Number, .Number):
1031-
return (lhs.object as NSNumber) <= (rhs.object as NSNumber)
1032+
return (lhs.object as! NSNumber) <= (rhs.object as! NSNumber)
10321033
case (.String, .String):
1033-
return (lhs.object as String) <= (rhs.object as String)
1034+
return (lhs.object as! String) <= (rhs.object as! String)
10341035
case (.Bool, .Bool):
1035-
return (lhs.object as Bool) == (rhs.object as Bool)
1036+
return (lhs.object as! Bool) == (rhs.object as! Bool)
10361037
case (.Array, .Array):
1037-
return (lhs.object as NSArray) == (rhs.object as NSArray)
1038+
return (lhs.object as! NSArray) == (rhs.object as! NSArray)
10381039
case (.Dictionary, .Dictionary):
1039-
return (lhs.object as NSDictionary) == (rhs.object as NSDictionary)
1040+
return (lhs.object as! NSDictionary) == (rhs.object as! NSDictionary)
10401041
case (.Null, .Null):
10411042
return true
10421043
default:
@@ -1048,15 +1049,15 @@ public func >=(lhs: JSON, rhs: JSON) -> Bool {
10481049

10491050
switch (lhs.type, rhs.type) {
10501051
case (.Number, .Number):
1051-
return (lhs.object as NSNumber) >= (rhs.object as NSNumber)
1052+
return (lhs.object as! NSNumber) >= (rhs.object as! NSNumber)
10521053
case (.String, .String):
1053-
return (lhs.object as String) >= (rhs.object as String)
1054+
return (lhs.object as! String) >= (rhs.object as! String)
10541055
case (.Bool, .Bool):
1055-
return (lhs.object as Bool) == (rhs.object as Bool)
1056+
return (lhs.object as! Bool) == (rhs.object as! Bool)
10561057
case (.Array, .Array):
1057-
return (lhs.object as NSArray) == (rhs.object as NSArray)
1058+
return (lhs.object as! NSArray) == (rhs.object as! NSArray)
10581059
case (.Dictionary, .Dictionary):
1059-
return (lhs.object as NSDictionary) == (rhs.object as NSDictionary)
1060+
return (lhs.object as! NSDictionary) == (rhs.object as! NSDictionary)
10601061
case (.Null, .Null):
10611062
return true
10621063
default:
@@ -1068,9 +1069,9 @@ public func >(lhs: JSON, rhs: JSON) -> Bool {
10681069

10691070
switch (lhs.type, rhs.type) {
10701071
case (.Number, .Number):
1071-
return (lhs.object as NSNumber) > (rhs.object as NSNumber)
1072+
return (lhs.object as! NSNumber) > (rhs.object as! NSNumber)
10721073
case (.String, .String):
1073-
return (lhs.object as String) > (rhs.object as String)
1074+
return (lhs.object as! String) > (rhs.object as! String)
10741075
default:
10751076
return false
10761077
}
@@ -1080,9 +1081,9 @@ public func <(lhs: JSON, rhs: JSON) -> Bool {
10801081

10811082
switch (lhs.type, rhs.type) {
10821083
case (.Number, .Number):
1083-
return (lhs.object as NSNumber) < (rhs.object as NSNumber)
1084+
return (lhs.object as! NSNumber) < (rhs.object as! NSNumber)
10841085
case (.String, .String):
1085-
return (lhs.object as String) < (rhs.object as String)
1086+
return (lhs.object as! String) < (rhs.object as! String)
10861087
default:
10871088
return false
10881089
}

Mac/Nutella/Frameworks/.DS_Store

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)