小编eva*_*aus的帖子

在XCode中创建一个新的故事板并使其成为主要故事板(模拟器中的黑屏)

我第一次开始时不小心删除了项目附带的原始Main.storyboard文件.现在,我需要创建新故事板所需的所有步骤,并使其成为项目的新主要故事板.我只需要一个故事板.当我在模拟器中运行我的应用程序时,我的整个应用程序只是一个黑屏.任何帮助将不胜感激.我在Swift编程.

xcode ios

17
推荐指数
2
解决办法
2万
查看次数

(Swift)'使用未解析的标识符'FIRStorage'

我正在使用firebase,我有以下代码行:

let storageRef = FIRStorage.storage().reference()
Run Code Online (Sandbox Code Playgroud)

这给了我错误'使用未解析的标识符'FIRStorage'.

这些是我文件中的导入:

import UIKit
import Firebase
Run Code Online (Sandbox Code Playgroud)

在视频教程中,我跟踪视频中的人只有这两个导入并且没有错误.'FIRStorage'似乎也是Firebase文档中的实际类.我缺少一个导入吗?我的框架或podfile有什么问题吗?

这是我的豆荚:

在此输入图像描述

任何帮助是极大的赞赏!

xcode ios firebase swift firebase-storage

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

(Swift)UIPanGestureRecognizer在视图上工作正常,直到添加子视图

我有以下视图(这是整个视图控制器的子视图):

lazy var superView: UIView = {
    let cv = UIView()

    cv.backgroundColor = .gray
    cv.translatesAutoresizingMaskIntoConstraints = false
    cv.layer.cornerRadius = 5     
    cv.layer.masksToBounds = true     
    cv.isUserInteractionEnabled = true
    cv.addGestureRecognizer(UIPanGestureRecognizer(target: self, action: #selector(handlePan)))

    return cv
}()
Run Code Online (Sandbox Code Playgroud)

这是我为它设置约束的地方:

// constraints for super view
func setupSuperView() {
    superView.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
    superView.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true

    superView.widthAnchor.constraint(equalTo: view.widthAnchor, constant: -24).isActive = true
    superView.heightAnchor.constraint(equalTo: view.heightAnchor, constant: -200).isActive = true

    // ISSUE: For some reason, adding this subview with or without constraints screws up the pan functionality of …
Run Code Online (Sandbox Code Playgroud)

iphone xcode ios uipangesturerecognizer swift

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

Xcode (Swift) 中没有这样的模块“Firebase”

我一直在查找与此 Xcode 错误有类似/相同问题的每个网站,并且我已经尝试了所有方法,但没有任何效果。大多数人说清理和构建该项目将使 Firebase 得到认可,但这并没有奏效。我尝试了一堆不同的框架搜索路径,但每个框架都位于不同的文件夹中,而不是一个框架文件夹中。这是我的 Podfile:

# Uncomment this line to define a global platform for your project
platform :ios, '9.0'

target 'Target' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

 # Pods for Target

  target 'TargetTests' do
    inherit! :search_paths
    pod 'Firebase', '>= 2.5.0'
    # Pods for testing
 end

end
Run Code Online (Sandbox Code Playgroud)

这些是我的项目文件夹

我尝试过创建我的框架搜索路径 $(SRCROOT) 和所有变体,但没有任何效果。我的问题似乎与我通过谷歌搜索找到的任何其他问题都不一样。我怀疑它是框架搜索路径,但我不知道该怎么做,而且我可能是错的。

任何帮助将不胜感激。

xcode ios firebase swift firebase-realtime-database

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

flutter_google_places 未显示自动完成搜索结果

我正在关注以下链接中有关使用 Google Maps API 创建搜索功能以在地图上查找地点的教程:

Medium.com 颤振教程

以下是我认为构成问题核心的代码:

 /**
* Retrieves the user's location
* NOTE: This pretty much does the same thing as _animateToUser,
* but I separated the two
*/
Future<LatLng> getUserLocation() async {
 var currentLocation = <String, double>{};
 final uLocation = LocationManager.Location();
try {
  currentLocation = await uLocation.getLocation();
  final lat = currentLocation["latitude"];
  final lng = currentLocation["longitude"];
  final center = LatLng(lat, lng);
  return center;
} on Exception {
  currentLocation = null;
  return null;
}
}

/**
 * Searches …
Run Code Online (Sandbox Code Playgroud)

google-maps dart google-places-api flutter google-places-autocomplete

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

ScrollView从左侧开始,需要从中间开始(Swift)

我的应用程序中有滚动视图.它有三个视图控制器可以在它们之间滑动.我希望我的应用程序在中间视图控制器上启动,因此左侧有一个视图控制器,右侧有一个视图控制器.相反,我的应用程序从左侧的视图控制器开始.我怎样才能让它从中间开始?我可能需要一步一步,因为我是新手.

任何帮助是极大的赞赏.

我的设计: 在此输入图像描述

我希望它从橙色viewcontroller开始

iphone xcode ios swift

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