在iOS 12.2上。使用UIAlertController的actionSheet Xcode时,遇到此问题的人都会遇到约束错误
相同的代码在iOS 12.1上运行,没有错误
我已经在Xcode 10.2和10.1上测试了此代码
class ViewController: UIViewController {
let Click : UIButton = {
let button = UIButton(type: UIButton.ButtonType.system)
button.translatesAutoresizingMaskIntoConstraints = false
button.setTitle("OK", for: .normal)
button.tintColor = UIColor.blue
button.addTarget(self, action: #selector(click(_:)), for: UIControl.Event.touchUpInside)
return button
}()
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(Click)
Click.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
Click.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
}
@objc func click(_ sender: UIButton) {
let optionMenu = UIAlertController(title: nil, message: "Choose Option", preferredStyle: .actionSheet)
let deleteAction = UIAlertAction(title: "Delete", style: .default)
let saveAction = …Run Code Online (Sandbox Code Playgroud) 初始化的优点或区别是什么:
lazy var hintView: HintView = {
let hintView = HintView()
return hintView
}()
Run Code Online (Sandbox Code Playgroud)
而不是简单地使用:
var hintView = HintView()
Run Code Online (Sandbox Code Playgroud)
(HintView是:class HintView: UIView {})
非常感谢帮助.
我的iOS是8.1.2,我正在使用UIActivityViewController进行社交分享.我点击一个按钮,让UIActivityViewController出现
- (IBAction)UIActivityTypeButtonClick:(id)sender {
NSString* text=@"I am sharing this text";
NSArray* sharedArray=@[text];
UIActivityViewController * activityVC=[[UIActivityViewController alloc]initWithActivityItems:sharedArray applicationActivities:nil];
activityVC.excludedActivityTypes=@[];
[self presentViewController:activityVC animated:YES completion:nil];
}
Run Code Online (Sandbox Code Playgroud)
我得到了这个

我收到消息,Twitter,邮件,WhatsApp和更多按钮.
单击更多我得到这个.
FACEBOOK
在哪里.我在我的iPhone上有facebook应用程序,并且在设置中也设置了我的ID.但Facebook永远不会出现在这里.Twitter确实如此.这是一个错误还是什么?请建议
谢谢
如何UICollectionView使用自定义单元格生成椭圆形单元格.下面是我想要实现的图像.
不知道如何实现这一点,通过几个链接,但没有得到.请指导.谢谢
更新:我尝试的是
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
return CGSize(width: collectionView.frame.size.width/3.0 - 8, height: collectionView.frame.size.width/2.5[![enter image description here][2]][2] )
}
Run Code Online (Sandbox Code Playgroud)
挖了很多我在这里发布我的问题.我在我的应用程序中使用谷歌登录最新的sdk,该应用程序支持iOS 8+.我目前正在使用Xcode 7.2.最近我的应用程序因许多用户过去经历过的非常常见的原因而被拒绝:
从APPSTORE
我们注意到用户被带到Safari登录或注册帐户,这提供了糟糕的用户体验.具体来说,Google登录会将用户带到Safari进行登录.
下一步
10.6请修改您的应用以使用户能够在应用中登录或注册帐户.
我们建议您实施Safari View Controller API以在您的应用中显示网络内容.Safari View Controller允许显示URL并从应用程序中的嵌入式浏览器检查证书,以便客户可以验证网页URL和SSL证书,以确认他们正在将登录凭据输入合法页面.
结束
我已经知道这种拒绝,因为苹果拒绝了很多在Safari浏览器中使用Sign In流程的应用程序.以下是一些参考链接
https://code.google.com/p/google-plus-platform/issues/detail?id=900
https://github.com/Torsten2217/google-plus-platform/issues/900
以及一些你可以在互联网上轻松找到的链接
2015年5月,Google发布了一个带有本机Web视图的新sdk.完整的集成过程在此处列出http://www.appcoda.com/google-sign-in-how-to/.
它在iOS 8上运行良好,并且还提供了一个控制器.
现在我用我通过的CocoaPods安装了最新的谷歌SDK
https://developers.google.com/identity/sign-in/ios/start
从谷歌上面的链接有一个尝试登录功能适用于iOS,我试过样品.它现在SFSafariViewController只在iOS 9中打开原生,但在iOS 8中,登录流程再次从应用程序外部移植到Safari浏览器.
在评论苹果审核要求使用SafariViewController,但控制的有效性是从的iOS 9及以上.这里是链接https://developer.apple.com/library/ios/documentation/SafariServices/Reference/SFSafariViewController_Ref/
我怎么能在iOS 8中使用最新的谷歌sdk实现这一点.
评论者既没有提到他/她正在测试的iOS版本.
现在任何人都可以帮我解决这个问题.如何在iOS 8中管理Google登录页面的本机控制器.
我正在尝试添加自定义本地通知,但我只是通过我的操作获取股票通知:
我的故事板看起来像这样(标准模板):
我有一个UNNotificationExtensionCategory设置为awesomeNotification(在Info.plist中)的扩展名.此扩展的基础也是Notification Content来自的模板iOS - Application Extension.
在我的app委托中,我有这个:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
let center = UNUserNotificationCenter.current()
let actions = [UNNotificationAction.init(identifier: "Hey", title: "Yo", options: UNNotificationActionOptions.foreground)]
let category = UNNotificationCategory(identifier: "awesomeNotification", actions: actions, minimalActions: actions, intentIdentifiers: [], options: [])
center.setNotificationCategories([category])
center.requestAuthorization([.alert, .sound]) { (granted, error) in
}
return true
}
Run Code Online (Sandbox Code Playgroud)
在我的主应用程序的viewcontroller中,我有以下操作来触发它:
@IBAction func sendPressed(_ sender: AnyObject) {
let content = UNMutableNotificationContent()
content.categoryIdentifier = "awesomeNotification"
content.title = …Run Code Online (Sandbox Code Playgroud) uilocalnotification swift swift3 ios10 unusernotificationcenter
现在我有一个基于Xcode 7.3.1的应用程序运行良好.但是当我想将应用程序安装到iOS 10设备时,就出现了一个问题.据说"无法找到开发者磁盘映像".所以我找到了一个解决方案:https://danielemargutti.com/solve-xcodes-could-not-find-developer-disk-image-error-how-to-run-projects-in-ios-10-device -使用- xcode的-7 /
但是,"/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport"中没有10.0文件夹.所以我找到了一个简单的方法(看起来像)来安装7.3.1和8的版本,这是:https://www.quora.com/What-is-the-best-advice-to-install-Xcode- 8-β-一起,Xcode的-版本-7-3-1
问题是如何才能下载10.0文件夹而不是安装Xcode 8并建立链接或复制/粘贴到Xcode 7.3.1中?在此之前,感谢任何其他解决方案.
我正在使用Xcode 7.3.1(Swift)并使用最新的FB iOS SDK v4.15.1
编辑
同样的情况也发生在
FB iOS SDK v4.14.0
编辑
我在iOS 10设备上遇到一个奇怪的问题每当我在做facebook登录时在我的应用程序和Facebook关闭的回叫返回时,它只是崩溃的应用程序.
登录方案如下: -
BIT CODE - ON
BIT CODE - OFF
所有3个案件都工作正常.
只有问题在于TestFlight.休息所有其他分发方式在FB登录中正常工作.我将很快发布到Facebook开发者支持页面.
以下是TestFlight的完整崩溃日志报告.
https://www.dropbox.com/sh/1q19939akqmgoa9/AADpW4OGoumGrMO4iYO5cw27a?dl=0
您可以从Dropbox下载这两个文件并右键单击 - 显示包内容并导航到日志文件夹,您将在其中找到.crash文件
此外,crashly .txt文件还存在于Dropbox链接中
这是我的崩溃报告的快速预览
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception …Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,如果iPhone设备时间是12小时格式化,则日期格式化程序正常工作,但如果设备时间是24小时格式,则应用程序崩溃.
let dateFormatter = NSDateFormatter();
dateFormatter.dateStyle = NSDateFormatterStyle.ShortStyle
dateFormatter.timeStyle = NSDateFormatterStyle.NoStyle;
dateFormatter.dateFormat = "hh:mm a";
var dt1 = dateFormatter.dateFromString(arrSecond.objectAtIndex(n) as! String)
Run Code Online (Sandbox Code Playgroud) 当我将我的项目转换为swift 3.0时,我发现了错误
无法推断参数'ResultType'
我的代码是这样的:
let fetchRequest = NSFetchRequest(entityName: "Book")
Run Code Online (Sandbox Code Playgroud)
我之前在我的项目中使用此代码,现在它出现错误.如何我正确地修改它.
ios ×5
swift ×5
facebook ×2
ios10 ×2
core-data ×1
google-login ×1
ios8 ×1
iphone ×1
nsdate ×1
objective-c ×1
swift2 ×1
swift3 ×1
swift5 ×1
testflight ×1
xcode ×1