Hi Audrey - I’m very exciting to try this app and I hope to soon; currently it builds clean but crashes at startup using xCode 7.2.1 and Swift 2.1.1.
The problem isn’t obvious to me, otherwise I’d post a solution!
hi Michael! thanks for your question. When I open the finished sample in Xcode 7.2.1, update the settings, then run, I get lots of error flags and a couple of warnings about vars that should be lets. The error flags are mostly due to the change from method to property of tableView.visibleCells—lots of errors about removing the parentheses. When I fixed all the errors, it ran in the simulator.
Thankyou for sharing . it helped me and there is no document in internet for right swipe for Swift 2 and IOS 9. As there is an in built left swipe function.
Hi Audrey, thank you for the nice tutorial. I learned a LOT about gradients and touch gestures from your work (I stopped at the left swipe deletions, and tried to apply the swiping to my own app.) Everything worked fine (your tutorial, and my code).
But I have a question… Your tutorial doesn’t use a prototype cell from the storyboard. AND you init() the cell with all the cell-level gradient code. All is well. But in my code, I do use a prototype cell from the storyboard (with two labels on it, with outlets into the table cell class).
My code runs fine with an empty cell class (no code or init(…) expressions in it all, just the two outlets. But when I tried to do your cell-level gradient tricks on my cell, the app crashes when it tried to configure the cell and write text into my two labels (that worked fine before the init(…) code that is required to add gradients to the cells.
Could you please comment (and hopefully state a solution) for adding gradients to prototype cells that have been configured on the storyboard? It’s a puzzle to me. I just put in empty initializers (two of them, the NScoder one is required), and it screws up initialization of the cells, so my outlets show up as nil in the table view controller. Thanks
hi Kevin: it seems to work if you put the gradient layer code directly into cellForRowAtIndexPath, although I couldn’t find a place to override layoutSubviews, and you should probably split out the static gradient code (let color1 … gradientLayer.locations…) into something that runs only once.
I think I found the problem. In order to have cell init()'s to work with storyboard cells, I had to call super.init inside of the NSCoder required init. That seemed to work fine.
hi when i am executing the the program part by part for the check point (6) i am getting a error can any one say some solution at
let textSize = text!.sizeWithAttributes([NSFontAttributeName:font]) error:fatal error: unexpectedly found nil while unwrapping an Optional value IN the class StrikeThroughText
thanks for posting! in addition to the “convert to latest Swift” fixes, this works:
func resizeStrikeThrough() {
if let text = text {
let textSize = text.sizeWithAttributes([NSFontAttributeName:font])
strikeThroughLayer.frame = CGRect(x: 0, y: bounds.size.height/2,
width: textSize.width, height: kStrikeOutThickness)
}
}
actually, it’s displaying as 4s, even in larger simulators
Reveal shows a system-generated constraint on the UIView: height=480
I think it’s a bug in the latest Xcode.
I’m back: I wrote a simpler version—table view with default table view cell, String content: the system-generated height constraint is 736 for iPhone 6s Plus simulator. So there’s something about the fancy table view cell that’s causing the problem…
I am new to all this coding excitement, and have started to build my first app. I am currently trying to build a to do style list as per this tutorial as it is just what I wanted and your tutorial appeared the most comprehensive I could find.
However, I am having a really frustrating issue.
I have a number of views already in use so I have created a new tableView and new ViewController to connect to it. However, right at the outset I need to connect the two to create the outlet. I simply cannot get the ctrl + drag to connect to the ViewController and generate the @IBOutlet. In fact only a selection of my storyboard views will connect to any of my controllers.
Maybe I am missing something and I am sure that there is a degree of rookie-ism here, but I have searched everywhere for a reason and just cannot find one.
This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]