xcode6

UIView changing its position in swift

淺唱寂寞╮ 提交于 2020-02-26 05:53:18
问题 How do I make a UIView slide up with a touch of a button from its original position and them bring it back down with a touch of a button? Using Swift and Xcode 6. I have currently tried this: @IBOutlet weak var DynView: UIView! @IBAction func btnUp(sender: AnyObject) { } 回答1: You have to implement an animation changing the DynView position on click. Here's an example: @IBAction func btnUp(sender: AnyObject) { let xPosition = DynView.frame.origin.x let yPosition = DynView.frame.origin.y - 20 /

UIView changing its position in swift

旧街凉风 提交于 2020-02-26 05:51:10
问题 How do I make a UIView slide up with a touch of a button from its original position and them bring it back down with a touch of a button? Using Swift and Xcode 6. I have currently tried this: @IBOutlet weak var DynView: UIView! @IBAction func btnUp(sender: AnyObject) { } 回答1: You have to implement an animation changing the DynView position on click. Here's an example: @IBAction func btnUp(sender: AnyObject) { let xPosition = DynView.frame.origin.x let yPosition = DynView.frame.origin.y - 20 /

Is .playground a swift file? Who can 'see' it?

送分小仙女□ 提交于 2020-02-21 11:18:53
问题 I'm trying to figure out what .playground file really is. If it's a source file, it cannot (as far as I've tried) be seen by other swift files in the project, nor other .playground files or vice versa. Is a project supposed to have one such file? Are they a kind of swift file? I know what it (.playground file) does, I just can't figure out how it fits in the project. 回答1: A .playground file is actually a bundle directory, which can be verified by right clicking it and selecting "Show Package

Is .playground a swift file? Who can 'see' it?

妖精的绣舞 提交于 2020-02-21 11:18:28
问题 I'm trying to figure out what .playground file really is. If it's a source file, it cannot (as far as I've tried) be seen by other swift files in the project, nor other .playground files or vice versa. Is a project supposed to have one such file? Are they a kind of swift file? I know what it (.playground file) does, I just can't figure out how it fits in the project. 回答1: A .playground file is actually a bundle directory, which can be verified by right clicking it and selecting "Show Package

Displaying NSMutableAttributedString on iOS 8

*爱你&永不变心* 提交于 2020-02-13 04:36:43
问题 Seems on iOS 8.0 (12A365) NSMutableAttributedString sometimes will not be displayed correctly. The problem obviously occurs when the range of the attribute does not start at the beginning of the text (and if there is no other attribute starting at the beginning of the text). So with 1.) the second word "green" in will not show the green background (bug!) ("cell" is a UITableViewCell with UILabel "label" as a subview): 1.) text = [[NSMutableAttributedString alloc] initWithString:@"Green is

Displaying NSMutableAttributedString on iOS 8

给你一囗甜甜゛ 提交于 2020-02-13 04:36:10
问题 Seems on iOS 8.0 (12A365) NSMutableAttributedString sometimes will not be displayed correctly. The problem obviously occurs when the range of the attribute does not start at the beginning of the text (and if there is no other attribute starting at the beginning of the text). So with 1.) the second word "green" in will not show the green background (bug!) ("cell" is a UITableViewCell with UILabel "label" as a subview): 1.) text = [[NSMutableAttributedString alloc] initWithString:@"Green is

dyld: Library not loaded with cocoapods 0.37 and Xcode 6.3

ε祈祈猫儿з 提交于 2020-02-12 07:52:29
问题 I've been reading all the issues about the error: dyld: Library not loaded: @rpath/Bolts.framework/Bolts Referenced from: /private/var/mobile/Containers/Bundle/Application/1542F906-CCE1-4181-AC7C-B5E3EE50E7D7/eBikeMotion.app/eBikeMotion Reason: no suitable image found. Did find: Which makes my application unable to run in a real device (but it runs without any problem in the simulator. Until certain point I thought that it was an issue with the frameworks I was installing, but after

Change default global tint color in swift

℡╲_俬逩灬. 提交于 2020-01-31 04:49:08
问题 I'm developing a little app and I would like to change the default global tint color from blue to orange. I've seen many ways to do it in Objective-C but I can't seem to get it to work using swift. How could I achieve this? Thanks in advance! 回答1: Couldn't that be easier? @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool { self.window

MKMapView showing blank screen in iOS 8

本小妞迷上赌 提交于 2020-01-29 07:24:04
问题 I am having an issue with displaying a MKMapView in iOS 8. It worked fine in iOS 7 and it is working fine now but only on simulator. On device it shows only annotations but no map behind. It looks like this: http://imgur.com/rBVWTeD The error that I am getting: 2014-09-24 22:07:15.349 xxx[1509:265380] Stylesheet does not include style matching tree, or includes an old version. Perhaps it was compiled by an old version of the style compiler. 2014-09-24 22:07:15.351 xxx[1509:265380] Please

Example handling JSON with SwiftyJSON

心已入冬 提交于 2020-01-28 05:35:28
问题 I would like to handle json with SwiftJSON, but I stacked. Does anyone show me example code? I tried to use this library. https://github.com/SwiftyJSON/SwiftyJSON Although I placed SwiftyJSON.swift in the same project, I have error "No such module "SwiftyJSON"" So correct my code or show me example code handling json from web with swiftyJSON lib. Here is my code: import UIKit import SwiftyJSON // No such module "SwiftyJSON" class ViewController: UIViewController { override func viewDidLoad()