Tag: cocoa touch

How to properly implement lazy instantiation with an @IBOutlet property in Swift

I am Learning iOS Development with Big Nerd Ranch’s latest iOS book. I have chosen to implement their apps in Swift. In one of their apps, they have the following code in Objective C: – (UIView *)headerView { // If you have not loaded the header view yet… if (!_headerView) { // Load HeaderView.xib [[NSBundle […]

UIDatePicker not displaying correctly

Basically this issue started when I updated my app to run with iOS 9. Without making any change in the code now a white square appears over the picker view, but it works normally. Note that the user can hide and show the picker views and the cells they’re in. If you need more info […]

UIImageview Programmatically in swift

I’m just trying to create a UIImage View programmatically, I have a new view and I tried doing this let imageName = “yourImage.png” view.backgroundColor = UIColor.colorWithPatternImage(UIImage(named:imageName)) This code doesn’t work. please help me as soon as possible

Xcode reference a framework instead of link binary with libraries

When developing cocoa touch framework, how can i use code from third party framework by referencing it other then including it in the “link binary with libraries” option? I dont want to link to binary in order to prevent symbol conflicts between hosting project and the framework (project which will use the framework) Additionally i […]

Import framework for whole project at one place in Swift?

I made an own Cocoa Touch Framework, and I want to import it only at one place in the code. In Xcode / earlier in Objective C there were a central location under Supporting Files. How does it work for Swift based project?

How to push a JSQMessagesViewController correctly

I have a Swift project and am trying to use JSQMessagesViewController within it. I have used cocoapods to install the framework and am importing it using a swift import statement. import JSQMessagesViewController Up to this point there are no errors and everything compiles without warning. However when I try to push a new instance onto […]

auto scroll for UITextView using swift (IOS app)

I cant seem to find a right solution to autoscroll UITextView using Swift. For my app I am receiving constant data from BT, and I am updating it on a UITextView. However, when the UITextView will reach the latest updated line, I would have to manually scroll. What I’m trying to achieve is to keep […]

How to resolve symbol name conflict in a Cocoa touch framework

I developed a Cocoa touch framework and am having problems with third party static framework classes which are embedded inside of it. The problem is symbol collisions when consumer projects use my framework and also import the third party static framework which my framework uses. I eventually want to remove these classes from my framework […]

Automatically scrolling to the bottom of a table with UITableViewAutomaticDimension row height? – Swift, iOS 8+

Usually, in a table, the following code can be used to scroll to the bottom automatically: let indexPath = NSIndexPath(forRow: rowCount – 1, inSection: 0) self.tableView.scrollToRowAtIndexPath(indexPath, atScrollPosition: .Bottom, animated: true) However, when I set it to use automatic row heights in viewDidLoad() as shown below, the above code only scrolls roughly half way down the […]

NSInternalInconsistencyException', reason: 'Could not load NIB in bundle while fetching 500+ records from the address book database

I am sorry if this question is getting repeated, but I could not help it since I have tried every possible solution but nothing worked and hence I am asking this question. I am loading almost 500 records in my table view from the address book database at one go. If the records are few […]