我成功地用'SayHello2'名称制作了可可粉仓.
像这样:
并更新我的GitHub:SayHello2 Github地址
我认为一切都是正确的.但是在cocoapods.org中搜索我的项目时却找不到它.当尝试将此pod添加到Xcode项目时出现此错误:
这是我的spec文件:
#
# Be sure to run `pod lib lint SayHello2.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'SayHello2'
s.version = '0.1.0'
s.summary = 'And just SayHello2.'
# This description is used to generate tags and improve search results.
# * …
Run Code Online (Sandbox Code Playgroud) 我想检查并检测何时点击地图标记或其他任何东西。在这种情况下,iOS Swift 4中的Google地图是否存在任何委托?
谢谢。
我用数据源数组制作了UIPageViewController,它运行正常.但是当向右滑动转发时,请调用After和Before方法.
我的代码在这里:
import UIKit
class MainPageViewController: UIPageViewController,UIPageViewControllerDataSource {
override func viewDidLoad() {
super.viewDidLoad()
self.dataSource = self
initUPageVC(idx:0,isAnimate:false,direction: UIPageViewControllerNavigationDirection.forward)
}
func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController?
{
//PRIVIOUS
let pageContent: MainPageContentViewController = viewController as! MainPageContentViewController
var index = pageContent.index
if ((index == 0) || (index == NSNotFound))
{
return nil
}
index -= 1;
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "updateMenuBarItemSelectedNotif"), object: index)
return getViewControllerAtIndex(index)
}
func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController?
{
//NEXT
let pageContent: MainPageContentViewController = viewController …
Run Code Online (Sandbox Code Playgroud) 我有一个视图,我想在其超级视图中水平和垂直居中。
我试过这个,但它不起作用:
let horConstraint = NSLayoutConstraint(item: webView, attribute: .leading, relatedBy: .equal, toItem: view, attribute: .leading, multiplier: 1.0, constant: 0.0)
view.addConstraints([horConstraint])
Run Code Online (Sandbox Code Playgroud) ios ×3
swift ×2
autolayout ×1
cocoapods ×1
constraints ×1
containers ×1
gesture ×1
git ×1
github ×1
google-maps ×1
layout ×1
swift3 ×1
swipe ×1
tap ×1
xcode ×1