iOS/OS X全新两步验证: 废除恢复密钥功能

 

威锋网讯 7 月 9 日消息,苹果在今天凌晨对 iOS 9 和 OS X El Capitan 的测试版都进行了更新,同时苹果还对一个没有在最新测试版里出现的功能进行了确认:经过改进的两步验证。威锋网消息,一名苹果发言人向 MacWorld 表明,不久之后他们将在 iOS 9 和 OS X El Capitan 当中启用全新的两步验证,其中一个最大特点就是废除恢复密钥功能。

在目前的安全系统下,如果用户同时遗失了可信任的设备和恢复密钥,不仅意味着账号登陆不了,而且还会被迫放弃原有的 Apple ID。

iOS 9 和 El Capitan 的两步验证(two-step verification)经过更新之后,将更名为“双重认证”(暂译two-factor authentication),取消输入 14 位数恢复密钥的验证步骤。如果用户遗失了可信任的设备,苹果客服会提供实时解决方案,帮助用户恢复 Apple ID。这一次改进有望在 iOS 9 和 OS X El Capitan 正式版发布时实现。

“开启双重认证功能之后,在 Mac 和 Windows 设备上通过 iTunes 购物将需要你输入 6 位数的密码,而这一个 6 位数的密码将自动发往你的 iOS 9 又或者是 OS X El Capitan 设备”。

 

http://www.feng.com/apple/news/2015-07-09/IOSOS-X-new-two-step-verification-abolishing-the-restore-key-function_618295.shtml

apple官方应该是在提倡双重验证,逐步停止两步验证,具体看这里:
从两步验证切换至双重认证
和“两步验证”比“双重认证”才是我真正想要的 – ZEALER 社区

 

iOS tab bar icon size。

You should prepare 3 images icons for each tab bar item (1x, 2x and 3x).

First create the 3x at 75w 75h pixels (maximum: 144 x 96) and save it as [email protected]

Then resize it to 50w 50h pixels (maximum: 96 x 64) and save it as [email protected]

Finally resize it to 25w 25h pixels (maximum: 48 x 32) and save it as iconTab0.png.

Now all you need is to select those 3 images at your finder and drag them to your image assets.

 

 

enter image description here

enter image description here

Swift Custom Table View Cell Example 自定义 UITableViewCell

 

Custom Table View Cell Example

The asker of the original question has solved their problem. I am adding this answer as a mini self contained example project for others who are trying to do the same thing.

The finished project should look like this:

enter image description here

 

Create a new project

It can be just a Single View Application.

Add the code

Add a new Swift file to your project. Name it MyCustomCell.swift. This class will hold the outlets for the views that you add to your cell in the storyboard.

import UIKit class MyCustomCell: UITableViewCell {     @IBOutlet weak var myView: UIView!     @IBOutlet weak var myCellLabel: UILabel! }

We will connect these outlets later.

Open ViewController.swift and make sure you have the following content:

import UIKit class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {      // These strings will be the data for the table view cells     let animals: [String] = ["Horse", "Cow", "Camel", "Sheep", "Goat"]      // These are the colors of the square views in our table view cells.     // In a real project you might use UIImages.     let colors = [UIColor.blueColor(), UIColor.yellowColor(), UIColor.magentaColor(), UIColor.redColor(), UIColor.brownColor()]      // Don't forget to enter this in IB also     let cellReuseIdentifier = "cell"      @IBOutlet var tableView: UITableView!      override func viewDidLoad() {         super.viewDidLoad()          tableView.delegate = self         tableView.dataSource = self     }      // number of rows in table view     func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {         return self.animals.count     }      // create a cell for each table view row     func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {          let cell:MyCustomCell = self.tableView.dequeueReusableCellWithIdentifier(cellReuseIdentifier) as! MyCustomCell          cell.myView.backgroundColor = self.colors[indexPath.row]         cell.myCellLabel.text = self.animals[indexPath.row]          return cell     }      // method to run when table view cell is tapped     func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {         print("You tapped cell number \(indexPath.row).")     } }

Setup the storyboard

Add a Table View to your view controller and use auto layout to pin it to the four sides of the View Controller. Then drag a Table View Cell onto the Table View. And then drag a View and a Label onto the Prototype cell. (You may need to pull the bottom of the prototype cell down so that it is a little bigger.) Use auto layout to fix the View and the Label how you want them arranged within the content view of the Table View Cell. For example, I made my View be 100×100.

enter image description here

Other IB settings

Custom class name and Identifier

Select the Table View Cell and set the custom class to be MyCustomCell (the name of the class in the Swift file we added). Also set the Identifier to be cell (the same string that we used for the cellReuseIdentifier in the code above.

enter image description here

Hook Up the Outlets

  • Control drag from the Table View in the storyboard to the tableView variable in the ViewController code.
  • Do the same for the View and the Label in your Prototype cell to the myView and myCellLabel variables in the MyCustomCell class.

Finished

That’s it. You should be able to run your project now.

Notes

  • The colored views that I used here could be replaced with anything. An obvious example would be a UIImageView.
  • If you are just trying to get a TableView to work, see this even more basic example.
  • If you need a Table View with variable cell heights, see this example.