iOS 9 - Distorted UI built with Xcode6 and Swift1.2 - xcode

My app UI is completely distorted on iOS 9. App is built with xcode6 and Swift1.2. I am using xib's for UI. Minimum iOS sdk is iOS7. everything works well on iOS7 and iOS8. Does anyone know what could be possible issue? I can't post app UI as its for some client.

The best way for you is that you download the Xcode 7 and rebuild your app and deal with the building problem.
One problem I have met now days is that "Some deprecated API were removed from iOS 9,which make app crashed!" I think the same is happening at your side also.
You can find all the latest change here:
https://developer.apple.com/library/ios/releasenotes/General/iOS90APIDiffs/index.html
Build you app with xcode 7 and swift 2.0.

To Add new Alamofire library to your current project go with the pod installation. below is the code you have to integrate in your pod file for fresh installatoin of Alamofire.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 2.0'
With the latest release of Alamofire 2.0 request method get change.
I am posting some sample steps which will help you most
Here is my sample code,
// Step : 1
var manager = Manager.sharedInstance
// Specifying the Headers we need
manager.session.configuration.HTTPAdditionalHeaders = [
"Content-Type": "application/graphql",
"Accept": "application/json" //Optional
]
// Step : 3 then call the Alamofire request method.
Alamofire.request(.GET, url2).responseJSON { request, response, result in
print(result.value)
}
Try this or you can check the latest update from alamofire on xcode 7:
https://github.com/Alamofire/Alamofire
In previous version of Alamofire there is one more parameter for handle in request method, now that was removed. Check Git for more information. I think this will help you more.

Related

Alamofire and Reachability.swift not working on xCode8-beta5

I have a custom CocoaPod created in swift2.3 and it has Alamofire and Reachability libraries inside the project. I mean I did integrate Alamofire and Reachability into the project manually.
It still works perfectly on xCode7.3.1 and I am going to update it to swift3 on xCode8-Beta5. I tried to update it but I couldn't get it done successfully.
Here is how I did for the update.
Replaced Alamofire and Reachability in the project folder for swift3 from
https://github.com/Alamofire/Alamofire/tree/swift3
Opened xCode8-Beta5 and converted all files to Swift3 syntax(actually xCode asks it when opening the old version project). So the converting was done automatically by xCode.
And I tried to build the Cocoapod but it gives a the bunch of error.
How can I solve this problem and update the Cocoapod successfully?
I tried to update two Cocoapods on xCode8-beta6 but Alamofire is still not working. Here is a screenshot.
https://www.dropbox.com/s/gm8ud67qc1ixffb/Screen%20Shot%202016-08-20%20at%2011.06.31%20AM.png?dl=0
If you plan to convert your code into swift 3, and to develop in the latest XCode 8 Beta 6 (forget to use Beta 5, I was trying to success round a clock and finally in Beta 6 it is possible to use Alamofire without rewriting all their code):
You need to update the Alamofire to its 4.0 version. I was waiting for this version neverending weeks between beta 2 and beta 6, as it wasn't able to use Alamofire at all. Apple ischanging SDK version by version during summer, but now the latest branch of this framework is on github.
In your Podfile you need to set more parameters to be able to use update stuff in these beta times. They are hardworking on swift3 branch.
If you don't use 4.0 version, there are many issues that XCode is not able to resolve in its convertor for its previous versions of Alamofire.
Huge amount of code they had to change.
They announced they will produce official 4.0 version after Apple releases GM seed. So until we get XCode GM Seed, put this to your Podfile before its install:
I could build Alamofire and Reachability frameworks successfully on xCode8-beta6 without any problem from the following branches.
https://github.com/Alamofire/Alamofire/tree/swift3
https://github.com/ashleymills/Reachability.swift/tree/feature/ios10

Playground in Swift won't use Firebase

As u probably all might know Firebase made a Version jump and I am trying to get my setup working with the Xcode Playground.
There is a reference how to implement Firebase in Playground with older versions of Cocoapods and Ruby but that won't really work for me swift playground for experimenting with firebase. Even though Firebase implementation in the Project itself works fine and i can import my Firebase it won't work on a Playground any more.
Does somebody know how to add a working setup with a Playground and Firebase?
Software in use:
Cocoapods: 2.6.4
Pod: 1.0
Xcode: 7.3.1
Firebase: 3.2.0
Any help or clues here for me?
I created a Framework and then imported into my Playground. Make sure you properly target the framework in the Podfile:
target 'YourApp' do
pod 'Firebase/Core'
target 'YourAppFramework' do
end
end
Once you build the framework then import:
import AppFramework
import FirebaseCore
Most things will work, except for Auth related functions.

Swift 2.0 Xcode 7.1 Google Maps SDK

While Xcode was version 7.0 I had an app that worked perfectly well. I made the cocoapod file, set it up and everything ran perfect.
I just updated to 7.1 and now all I get are 21 errors that say "/Users/Johnathan/Desktop/Parse Default/GoogleMaps/Google Maps/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/Headers/GoogleMaps.h:14:9: Include of non-modular header inside framework module 'GoogleMaps'"
I'm not sure what to do or how to update/edit this. I am not very familiar with cocoapods. Please help. I can't get my app to run. Thanks.
And if it helps all I did was update Xcode and it went from working to not working.
See this thread below for a solution as it seems to be most up to date.
In essence, you will need to add a Bridge Header (see comment 7)
Here it is: https://code.google.com/p/gmaps-api-issues/issues/detail?id=8524&can=1&q=Could%20not%20build%20Objective-C%20module&colspec=ID%20Type%20Status%20Introduced%20Fixed%20Summary%20Stars%20ApiType%20Internal

Xcode will build/run but archive fails with "No such module Google" - Swift iOS

My app has been working fine until Xcode 7.1. In fact, it still runs on both the simulator and iPhone, but when I archive it, I get the error "No such module Google." I have cocoa pods updated to 0.39 and have tried for hours with tweaking the options, from reinstalling cocoa pods to removing the Google Analytics cocoa pod and adding it manually, etc. However, nothing has worked, and whenever I archive the app, I receive an error, yet it still runs fine.
Any thoughts?
Thanks!
Turns out the issue was with Google Analytics for cocoa pods. I completely removed the cocoapod and switched to Flurry.
For me it turned out, that I had forgotten to put
use_frameworks!
into the Podfile. After adding this line and updating the pods it worked. Just make sure to import all modules in all depending classes.
Edit:
Official blog resource from cocoapods

Alamofire Swift 2 - cannot submit for beta testing (Xcode 7 GM)

I have followed the instructions on installing the swift2 branch of Alamofire with cocoa pods. The app works well in the simulator, however, when I archive it for submission with Xcode 7 GM I receive an email with an error:
"The bundle contains an invalid implementation of Swift. The app may have been built or signed with non-compliant or pre-release tools"
This issue definitely relates to the framework as without it I am able to submit for beta testing with the same version of Xcode. I have tried turning bit code OFF in the build settings for Alamofire but it does not help.
Does anyone know how to fix this?
My podfile links only against Alamofire framework:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'swift-2.0'
One of the things that I found rather strange is that when I try to submit an archive I have the following screen:
Maybe this can be helpful in identifying the issue. The extra two targets are notification centre widgets. Disabling them doesn't resolve the issue. And without Alamofire I am able to submit for beta testing with both widgets attached.
Update
For those who are suggesting that "Swift 2.0 is in beta so you cannot submit" I want to clarify once more - I am trying to submit for beta testing. And YES, it is possible!
As I have indicated, I am able to submit for beta testing if I remove Alamofire and my own app is written in Swift 2.0. And if someone still thinks that "it is not possible" here is some info for you. Please read it first before posting comments or down voting question.
Update 2
This issue is still there with Xcode 7 GM...
OK, this issue is now fixed. I have tried the 2.0.1 version of Alamofire and I am able to submit with Xcode 7 GM and Bit Code turned ON for both Alamofire and my app.

Resources