I make rotation by 180 degrees by code

- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath {
    UICollectionViewLayoutAttributes *retAttr = [[super layoutAttributesForItemAtIndexPath:indexPath] copy];

    if (CGAffineTransformIsIdentity(retAttr.transform)) {
        retAttr.transform = CGAffineTransformMakeRotation(M_PI);
    }

    retAttr.frame = CGRectMake(0, retAttr.frame.origin.y, self.collectionView.bounds.size.width, retAttr.frame.size.height);
    return retAttr;
}

Frame by CGRectMake

(origin = (x = 0, y = 3658), size = (width = 320, height = 1077.5))

But i got

(lldb) po retAttr.frame
(origin = (x = -0.000000000000056843418860808015, y = 3658), size = (width = 320.00000000000011, height = 1077.5))

And cell disappear from screen.

How to correctly rotate or assign frame to x not breaks and width too?

I am developing an app which has video on login screen, and that video sound is muted. But when I am listening music of Music app of iphone and then run my app so my background music sound is automatically decreased. Please give me solution I am using AVPlayer to run video on login screen and use AVPlayer.muted = true

I'm loading a pdf in WebView from my server with this code :

    webView = UIWebView(frame: CGRectMake(0, y, screenSize.width, screenSize.height-y))    
    let url : NSURL! = NSURL(string: urlFile)        
    webView?.loadRequest(NSURLRequest(URL: url))        
    webView?.opaque = false;
    webView?.backgroundColor = UIColor.clearColor()                
    webView?.scalesPageToFit = true;    
    self.view.addSubview(webView!)

This code works but how can i receive an event "onPageLoad"? sorry for bad english, i'm italian(:

I have used inputAccessoryViewin the past to add UIToolbar on top of the keyboard but I don't see where and why you would use inputAccessoryViewController.

What would be an example where inputAccessoryViewController has a better fit than inputAccessoryView?

Thanks

The following class provides a mutating function to change its property:

class Person {

    struct Location {
        var coordinate: CLLocationCoordinate2D!
        var city: String?

        mutating func setLocationNameFromCoordinate(completion:(()->())?) {

            let location = CLLocation(latitude: coordinate.latitude, longitude: coordinate.longitude)
            CLGeocoder().reverseGeocodeLocation(location) { (placemarks: [CLPlacemark]?, error: NSError?) in

                guard let city = placemarks?.first?.locality where error == nil else {
                    return
                }

                self.city = city //1
                completion?()
            }
        }
    }

    var location: Location?
}

The function is called like so:

person.location?.setLocationNameFromCoordinate() {
    print(person.location?.city) //2
}

However, at 1 the city name is set, looking at it from inside the location Struct, but at 2 the city name is not set for the object. What am I doing wrong here?

I need to map the following Json with AlamofireObjectMapper:

{
  "user": {
    "id": 2,
    "first_name": "Dealer",
    "last_name": "Seller",
    "email": "seller@winfooz.com",
    "authentication_token": "L6HzhZWdWhtxNwVkrsjY",
    "documents_uploaded": false,
    "type": "Dealer"
  }
}

I wrote the following part of code, but the mapped object return nil!

class SystemUser:Mappable{       
    func mapping(map: Map) {
        type <- map[SystemUserIdentifiers.UserType] //"type"
        firstName <- map[SystemUserIdentifiers.FirstName]
        lastName <- map[SystemUserIdentifiers.LastName]
        internalIdentifier <- map[SystemUserIdentifiers.InternalIdentifier]
        email <- map[SystemUserIdentifiers.Email]
        documentsUploaded <- map[SystemUserIdentifiers.DocumentsUploaded]
        authenticationToken <- map[SystemUserIdentifiers.AuthenticationToken]
    }
}

Here is sending the post request:

Alamofire.request(.POST, URL, parameters: parameters, encoding: .JSON).responseObject {
            (response: Response<SystemUser, NSError>) in

guard let user = response.result.value else{
                return
            }
print(user.authenticationToken)
}

What is the correct way to map rooted Json?

As you can see below, the notificationsVC is a part of the TabBarController which is embedded in a navigationContoller(lets call it first nC). Then theres a segue from notificationsVC to the second navigationController which will show the messagesVC.

There's a back button in messagesVC which when pressed should go back to notificationsVC

func backbutton() {        
    navigationController?.popViewControllerAnimated(true)         
}

Now this is obviously not working because the navigationController will get the nearest NC and pop the VC in its stack but it won't let me go back to the notificationsVC.

Any other alternative?, although I've tried this with no success as well.

self.dismissViewControllerAnimated(true, completion: nil);

enter image description here

More detailed view enter image description here

Also I'm using the JSQMessagesViewController library to show the messages in messagesVC which shouldn't matter but still worth mentioning. Thanks for your time!

I have built a Phonegap Build app and run into a bit of a bug. I've created all the appropriate images and referenced them in my config.xml file.

However for some reason they are not showing in iPhone 6, 6s or 6+. All other sizes seem to show the splashscreen without any issues. here's my code...

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns   = "http://www.w3.org/ns/widgets"
        xmlns:gap   = "http://phonegap.com/ns/1.0"
        id          = "com.myapp.app.com.app.myapp"
        versionCode = "10" 
        version     = "1.0.8"
        ios-CFBundleVersion="1.0.17" >

<!-- versionCode is optional and Android only -->

<name>My App</name>

<description>
   My App
</description>

<author href="http://www.myemail.co.uk"" email="chris@myemail.co.uk">
    Chris Burns
</author>

<preference name="SplashScreen" value="screen"/>
<preference name="SplashScreenDelay" value="3000" />
<preference name="orientation" value="portrait" />
<preference name="DisallowOverscroll" value="true" />

<!-- iOS -->

    <!-- iPhone / iPod Touch  -->
    <icon src="app/img/icons/apple-touch-icon-57x57.png" gap:platform="ios" width="57" height="57" />

    <!-- iPhone 6 / 6+ -->
    <icon src="app/img/icons/apple-touch-icon-180x180.png" platform="ios" width="180" height="180" />

    <!-- iPhone / iPod Touch  -->
    <icon src="app/img/icons/apple-touch-icon-60x60.png" platform="ios" width="60" height="60" />
    <icon src="app/img/icons/apple-touch-icon-120x120.png" platform="ios" width="120" height="120" />

    <!-- iPad -->
    <icon src="app/img/icons/apple-touch-icon-72x72.png" platform="ios" width="72" height="72" />
    <icon src="app/img/icons/apple-touch-icon-76x76.png" platform="ios" width="76" height="76" />
    <icon src="app/img/icons/apple-touch-icon-152x152.png" platform="ios" width="152" height="152" />

    <icon src="app/img/icons/apple-touch-icon.png" />

<!-- -->

<platform name="ios">

    <!-- iPhone and iPod touch -->
    <splash src="app/img/splash/320x480.png" platform="ios" width="320" height="480" />
    <splash src="app/img/splash/640x960.png" platform="ios" width="640" height="960" />

    <!-- iPhone 5 / iPod Touch (5th Generation) -->
    <splash src="app/img/splash/640x1136.png" platform="ios" width="640" height="1136" />

    <!-- iPhone 6 -->
    <splash src="app/img/splash/750x1334.png" platform="ios" width="750" height="1334" />
    <splash src="app/img/splash/1242x2208.png" platform="ios" width="1242" height="2208" />
    <splash src="app/img/splash/2208x1242.png" platform="ios" width="2208" height="1242" />

    <!-- iPhone 6S -->
    <splash src="app/img/splash/1080x1920.png" platform="ios" width="1080" height="1920" />

    <!-- iPad -->
    <splash src="app/img/splash/768x1024.png" platform="ios" width="768" height="1024" />
    <splash src="app/img/splash/1024x768.png" platform="ios" width="1024" height="768" />

    <!-- Retina iPad -->
    <splash src="app/img/splash/1536x2048.png" platform="ios" width="1536" height="2048" />
    <splash src="app/img/splash/2048x1536.png" platform="ios" width="2048" height="1536" />

</platform>

<platform name="android" />

<splash src="splash.png" />

<plugin name="cordova-plugin-whitelist" source="npm" />
<plugin name="cordova-plugin-splashscreen" source="npm" />
<plugin name="cordova-plugin-splashscreen" spec="3.2.2" />
<plugin name="cordova-plugin-whitelist" spec="1.2.2" />

I'm building an app, where I got several sections in an UITableView. My current solution is collecting my data in a dictionary, and then pick one key for every section. Is there a better solution?

I am trying to install 'Google-Maps-iOS-Utils' but it gives me above error. Here is Podfile :

platform :ios, '9.0'
 use_frameworks! 
 target 'MapClusters' do
  pod 'Alamofire'
  pod 'SwiftyJSON'
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'
end

I tried to remove pod 'Google-Maps-iOS-Utils' and it did work. So I guess Google-Maps-iOS-Utils is the one causing problem. Here is the full error :

[!] The 'Pods-MapClusters' target has transitive dependencies that include static binaries: (/Users/BAPS/Documents/Test/MapClusters/Pods/GoogleMaps/Subspecs/Base/Frameworks/GoogleMapsBase.framework, /Users/BAPS/Documents/Test/MapClusters/Pods/GoogleMaps/Subspecs/Maps/Frameworks/GoogleMapsCore.framework, and /Users/BAPS/Documents/Test/MapClusters/Pods/GoogleMaps/Subspecs/Maps/Frameworks/GoogleMaps.framework)

I have already gone through lot of answers here or elsewhere on web. Till now I have tried these solution :

  1. Disabling the check for transitive dependencies.

    2.pre_install do |installer| def installer.verify_no_static_framework_transitive_dependencies; end end

    post_install do |installer| find Pods -regex 'Pods/GoogleMaps.*\\.h' -print0 | xargs -0 sed -i '' 's/\\(<\\)GoogleMaps\\/\\(.*\\)\\(>\\)/\\"\\2\\"/' find Pods -regex 'Pods/Google-Maps-iOS-Utils.*\\.h' -print0 | xargs -0 sed -i '' 's/\\(<\\)Google-Maps-iOS-Utils\\/\\(.*\\)\\(>\\)/\\"\\2\\"/' end

After adding above two points in Podfile, installation works but then when I try to run the app I get this error:

Error

After removing pod 'SwiftyJSON' it works but I need it there.

I tried few other things too but nothing seems helping. I am new to ios development so I am not able to help myself.

I am using swift, xcode 7.3 and latest cocoapods.

Here goes my code.

func connectionDidFinishLoading(connection: NSURLConnection){

    var err: NSError
    var jsonResult: NSDictionary = NSJSONSerialization.JSONObjectWithData(responseData, options: NSJSONReadingOptions.MutableContainers, error: nil) as! NSDictionary

    if jsonResult.count>0 && jsonResult["results"]!.count>0 {
        var result: NSArray = jsonResult["results"] as! NSArray
        println("\(result)")
        var dict = NSDictionary()
        var myDict = NSDictionary()

        for dict in result {
            let googleGeo = dict["geometry"] as! NSDictionary
            let googleLoc = googleGeo["location"] as! NSDictionary
            let latitude = googleLoc["lat"] as! Float
            let longitude = googleLoc["lng"] as! Float
            let googleicon = dict.valueForKey("icon") as? NSString
            let googlename = dict["name"] as? NSString
            let googlevicinity = dict["vicinity"] as? NSString

            myDict.setValue(latitude, forKey: "lat"    
        }
    }

}

After parsing from Google Places API, i received longitude, latitude, name, vicinity, icon. Now i want to append these value to myDctionary so that i can pass the value to an array and to the next view controller.

Please someone let me know to to do it ?

I have a UIBarButtonItem in a Navigation Bar with the text title "Save". When I transition to a fullscreen UIPopoverController and then dismiss it, the text in my UIBarButtonItem gets truncated to "S..e". For all other segues and views I have no problem when returning.

I've tried manually changing the width and setting "possibleTitles" to include long words but I can't stop the truncation.

I'm using a custom font if that makes a difference.

I have 3 switches. I want it so when one turns on the other 2 turn off.

My code currently looks like this.

if MPHSwitch.on {
        KPHSwitch.enabled = false
        MperSSwitch.enabled = false
    }

I simply want to turn off the switches but setting enabled to false greys them out.

I have tried KPHSwitch.off but that doesn't seem to work.

Thanks.

I have created a extension for a UIViewController for UIImagePicker Controller. I Want a call back to update that picture in viewController when picker delegate is fired. Is there any way for handling this?

Is it possbile to get In-app (or subscription) information (at least price, currency) for iOS application by bundle id or product id from server side.

I know that iOS clients possible to do it using their SDK.

Maybe exists service like iTunes Lookup API?

I am trying to create a library, that uses recyclerview, and then importing that library ie., arr file to an application project.

Changes i did in the library's gradle file are

  • apply plugin: 'com.android.library'
  • removed the applicationId
  • And then generated aar file

The library's gradle file has a list of dependencies

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:recyclerview-v7:24.2.0'

}

Now i imported the aar file to my app. When i try to access the activity containing the recyclerview, the app crashes the following err...

FATAL EXCEPTION: main 
            Process: com.example.alertlibtest, PID: 32032
                    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.alertlibtest/com.example.example.tejlib.Jaamoon}: android.view.InflateException: Binary XML file line #11: Binary XML file line #11: Error inflating class android.support.v7.widget.RecyclerView
                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                    at android.app.ActivityThread.-wrap11(ActivityThread.java)
                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                    at android.os.Handler.dispatchMessage(Handler.java:102)
                    at android.os.Looper.loop(Looper.java:148)
                    at android.app.ActivityThread.main(ActivityThread.java:5417)
                    at java.lang.reflect.Method.invoke(Native Method)
                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                    Caused by: android.view.InflateException: Binary XML file line #11: Binary XML file line #11: Error inflating class android.support.v7.widget.RecyclerView
                    at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
                    at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
                    at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
                    at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)
                    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
                    at com.example.example.tejlib.Jaamoon.onCreate(Jaamoon.java:34)
                    at android.app.Activity.performCreate(Activity.java:6237)
                    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                    at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                    at android.os.Handler.dispatchMessage(Handler.java:102) 
                    at android.os.Looper.loop(Looper.java:148) 
                    at android.app.ActivityThread.main(ActivityThread.java:5417) 
                    at java.lang.reflect.Method.invoke(Native Method) 
                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
                    Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class android.support.v7.widget.RecyclerView
                    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776)
                    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
                    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
                    at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
                    at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
                    at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
                    at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284) 
                    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
                    at com.example.example.tejlib.Jaamoon.onCreate(Jaamoon.java:34) 
                    at android.app.Activity.performCreate(Activity.java:6237) 
                    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                    at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                    at android.os.Handler.dispatchMessage(Handler.java:102) 
                    at android.os.Looper.loop(Looper.java:148) 
                    at android.app.ActivityThread.main(ActivityThread.java:5417) 
                    at java.lang.reflect.Method.invoke(Native Method) 
                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
                    Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.widget.RecyclerView" on path: DexPathList[[zip file "/data/app/com.example.alertlibtest-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.alertlibtest-1/lib/x86, /vendor/lib, /system/lib]]
                    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
                    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
                    at android.view.LayoutInflater.createView(LayoutInflater.java:583)
                    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
                    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) 
                    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
                    at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
                    at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
                    at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
                    at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284) 
                    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
                    at com.example.example.tejlib.Jaamoon.onCreate(Jaamoon.java:34) 
                    at android.app.Activity.performCreate(Activity.java:6237) 
                    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                    at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                    at android.os.Handler.dispatchMessage(Handler.java:102) 
                    at android.os.Looper.loop(Looper.java:148) 
                    at android.app.ActivityThread.main(ActivityThread.java:5417) 
                    at java.lang.reflect.Method.invoke(Native Method) 
                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
                    Suppressed: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.widget.RecyclerView" on path: DexPathList[[dex file "/data/data/com.example.alertlibtest/files/instant-run/dex/slice-support-annotations-24.2.0_28ab

Please help to get rid of this error. I want to access the other libraries that i include in the library ie volley and glide.

Thanks in advance.

I am looking to create a customized map with an Image as Background into my app and I am not sure if and howthis is possible.

Requirements:

  • iOS & Android (React-Native)
  • Image as Mapbackground (best case would be: just to have the image - no swipe outside the image)

What i actually know: There is a google.maps api (currently I have no expecrience to it) but I only found something related to: https://developers.google.com/maps/documentation/javascript/examples/maptype-image

Problem here: You can swipe out of the Image (Not static enough). It would be nice to get a solution with the google api or a related/similar option wich would fit.

Thanks in advance for sharing your experience

BR Jonathan

My app should store accounts via account manager but I can`t find some info or examples how I it do with Xamarin.Forms

Can anyone provide step by step process to install PowerExchange CDC for Oracle, so that we can implement in our project?

i want to spin the icons in to it's old state when click on the icons again without losing current features.i donot get any answers fro stack overflow ,that's why i'm asking this here. current features:

  1. icon will rotate 180 degree on first click on corresponding icon.

  2. icon will rotate back on click either on other icon or outside.

with this features i want to add a new feature ,ie, the icon need to be spin back when we click it again.

function rotate(e){
  resetRotation();
  document.getElementById("me").className="spinner in fa fa-caret-down";
  e.stopPropagation();
}

function resetRotation(){
  document.getElementById("me").className="spinner out fa fa-caret-down";
  document.getElementById("you").className="spinner out fa fa-caret-down";
}

function rotatea(e){
  resetRotation();
  document.getElementById("you").className="spinner in fa fa-caret-down";
  e.stopPropagation();
}

document.addEventListener('click', resetRotation);
.spinner {
  transition: all 0.5s linear;
}

.spinner.in{
  transform: rotate(180deg);
}
.spinner.out{
  transform: rotate(0deg);
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
<i onclick="rotate(event)" id="me" class="spinner fa fa-caret-down "></i>
<i onclick="rotatea(event)" id="you" class="spinner fa fa-caret-down"></i>

We are using gitflow and currently have an open release branch.

Illustration

The release at A is currently on the test-system to get tested by key-users. In the meantime we need to release an urgent hotfix. Commonly we pull out a branch of master (so the latest live-system release) and merge it into development and master. If we would do this here, we would not have the hotfix in the currently open release.

So what do I have to do at the point marked as "?" in the illustration? Assume that the hotfix is ready to get merged.