小编Keg*_* K.的帖子

使用观察firebase DB的模糊不清

我真的不能得到什么问题?
我正在尝试从firebase Settings节点加载一些设置数据.其他函数中其他节点的相同代码可以工作,但这个代码不明确.为什么?

var ref:FIRDatabaseReference!  //Global variable

     override func viewDidLoad() {
        super.viewDidLoad()


        self.mapView.delegate = self

            if CLLocationManager.locationServicesEnabled() {

                locationManager.delegate = self
                locationManager.desiredAccuracy = kCLLocationAccuracyBest
                locationManager.requestWhenInUseAuthorization()
                locationManager.startUpdatingLocation()

              //  monitorRegion()

            } else {

                // Alert to enable location services on iphone first
            }

            ref = FIRDatabase.database().reference(fromURL: "https://*******.firebaseio.com/")
            //The error is here
            ref.child("Settings").child("service_types").observe(.value) { (snapshot) in

            }


        // Do any additional setup after loading the view.
    }
Run Code Online (Sandbox Code Playgroud)

firebase swift firebase-realtime-database swift3

4
推荐指数
1
解决办法
1646
查看次数

图像视图的圆形底线

我只想让我的底部边框imageView变圆。我如何以编程方式做到这一点?

谢谢你的帮助!

image layer ios swift

2
推荐指数
1
解决办法
540
查看次数

使用swift 3错误进行AWS Dynamodb测试

我真的不会在stackoverflow上提出问题,除非我真的无法在互联网上找到解决方案.我这里有一个压倒一切的方法问题.这是AWS生成的DynamoDB代码.我使用swift 3.0我试图删除覆盖但没有用我得到这个错误:

/ Users/*****_*****/Desktop/APPS/Beer On The Go/AmazonAws/Models/NoSQL/Bars.swift:57:16:方法'JSONKeyPathsByPropertyKey()'与Objective-C选择器' JSONKeyPathsByPropertyKey'与来自超类'AWSDynamoDBObjectModel'的方法'jsonKeyPathsByPropertyKey()'冲突,具有相同的Objective-C选择器

有什么提示可以解决这个问题吗?

    override class func JSONKeyPathsByPropertyKey() -> [NSObject : AnyObject] {
    return [
           "_userId" as NSObject : "userId" as AnyObject,
           "_barId" as NSObject : "barId" as AnyObject,
           "_category" as NSObject : "Category" as AnyObject,
           "_description" as NSObject : "Description" as AnyObject,
           "_name" as NSObject : "Name" as AnyObject,
    ]
}
Run Code Online (Sandbox Code Playgroud)

错误消息

xcode overriding amazon-web-services ios swift

1
推荐指数
1
解决办法
503
查看次数

检查 NSAttributed 字符串的前景色

我有一套NSAttributedStringUITextView我需要检查它的NSAttributedStringKey.foregroundColor价值。

char = attributedText.attributedSubstring(from: attributedRange)
Run Code Online (Sandbox Code Playgroud)

我尝试使用这个过滤器,但我真的不知道如何使用它。

let attr = char.attributes(at: 0, effectiveRange: nil)
attr.filter({ (<#(key: NSAttributedStringKey, value: Any)#>) -> Bool in
            //if true...
        })
Run Code Online (Sandbox Code Playgroud)

uitextview nsattributedstring ios swift

1
推荐指数
1
解决办法
455
查看次数