Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x

Swift Programming

Swift is a compiled programming language created for iOS, OS X, watchOS, tvOS and Linux development by Apple Inc. Swift is designed to work with Apple's Cocoa and Cocoa Touch frameworks and the large body of existing Objective-C code written for Apple products. Swift is intended to be more resilient to erroneous code ("safer") than Objective-C and also more concise. It is built with the LLVM compiler framework included in Xcode 6 and later and uses the Objective-C runtime, which allows C, Objective-C, C++ and Swift code to run within a single program. A second free implementation of Swift targets Microsoft's Common Language Infrastructure (a.k.a. .NET) and the Java/Android platform.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi,

I'm currently looking at building a small basic app that a few of my customers are looking for, however they all want it as their own unique app so I will need to whitelabel each release from one core set of code, instead of managing several different sets of code / apps.

All companies will have the exact same app features (which are very basic), however I will need to change the 'logo', 'app name' and 'main UI color' for each release.

Swift / iOS and Android Studio seem to have their own 'Whitelabel Management' feature so that you can have one code base and release variable releases from the code base.

So, you build one core app, and then you can release different builds with the variable settings.

QUESTIONS
01 - Has anyone ever used this approach before, and if so do you have any advice?
02 - Is anyone aware of any software (outside of Swift and Android Studio) that will manage code like this, as I might go the Hybrid approach with React Native.

Thank you in advance for your help.
0
Free Tool: IP Lookup
LVL 10
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

I am very new to writing iOS apps - in fact this is the first app I am writing.  In general it is working, but on first load it is very slow to load the data (which is gets from a web service).  I added some timers to sections of the script and believe I have narrowed down the area that is slow.

Briefly the process is:
  1. Get the article data (in JSON) and save it to an Article object and update table cell
  2. For each article check if it has an image, if so access the image JSON to get the URL
  3. Download the image and save to Article Object and update table cell
  4. Display table and use placeholder image if article does not contain an image

It appears to be point 3 that causes the 'freeze'.  In subsequent uses of the app it checks the saved array of Article Objects and loads data from there, and then only adds new / updated articles and deletes old articles and therefore is much quicker.

While it is useable I would like to load the table with the text as soon as it is available and then load images in the background, save it to the object and refresh the cell once it is available.  While there are articles online with code I cannot seem to get them to work.  Either I am left with the app waiting for all the images to load, or just getting the placeholder image for all articles.

My code (for this) is currently in a couple of places.  Loading the JSON is in the TableViewController viewDidLoad() and the image …
0
Hello,
Are there any good products, sites or services that can be used to basically develop a prototype app for planning purposes and relaying information to others like graphics, dev etc.? Something that can be used as a kind of project manager to build a app.

So lets say you have a idea for a app but want to do a rough, not flashy, draft of the layout and mock actions for buttons etc. So if you tap here then this screen pops up type of thing so not actually coding the app but just some type of WYSIWYG interface to help test out the flow of the design before spending time and money on the actual coding and graphics etc.
0
Hello:

I'm considering taking an online class to learn Swift programming for creating iPhone apps.

But, my laptop has Microsoft Windows 7--not Mac's OCX operating system.

Is it possible to install some sort of "runtime" version of OCX on a Windows laptop?  Also, is it possible to do so without cost?  :)

Thank you!

John
0
Is it possible to send an In-App email from iOS Swift 3 app without it opening a new email message window that the user needs to click 'Send'

I've tried using MessageUI and MFMailComposeViewController but it opens an email message window.

The from and To address will always be the same in my app and I just ned the message to be sent without user intevention
1
Is there a way to do Xcode development and maintain the projects in such a way that if I have to switch between 2 - 3 macs I still have access to my projects.  Right now doing a course on Swift and that would be helpful

Thanks
0
Hi all,

I'm new to both VS and Cordova so be gentle :)
I'm trying to lock my cordova app into landscape orientation only. I went into the config.xml and set orientation to Landscape which ends up doing this:
<preference name="Orientation" value="landscape" />

Open in new window

But when i run/debug the project in browser emulator, the device is still portrait.
I tried using net.yoik.cordova.plugins.screenorientation plugin with following code nad it didn't work either (alert worked)
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
    window.screen.lockOrientation("landscape");
    alert("123");
}

Open in new window

Can anyone please point me in the right direction on how to lock entire app into landscape permanently. Google has not helped me.
Thanks,
Primoz
0
Is Windows Xamarin the next great tool for Cross platform mobile development? What are the alternative tools available and their advantages?

Is jquery mobile another great tool for Cross platform mobile development?
http://jquerymobile.com/
0
What's the requirements to develop current latest Apple App?

Can you provide details in terms of recommended Models, OS versions, Development tools, etc?

I need to draft a spec to purchase one for office use.
0
Hello:

Although I have many skills outlined on my resume, I want to add another practical skill, in case my current skills become obsolete.

So, I have been toying with the idea of teaching myself Swift or some other iOS programming language in order to be able to create apps for the iPhone.

Out of the many new business skills a professional could learn, would this be the best?  

If so, how long does it take to learn and is it extraordinarily difficult?  Are there are good and free tutorials online that will successfully teach the lay person such a programming language?

Thanks!

John
0
Hire Technology Freelancers with Gigs
LVL 10
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

I am a rookie with programming but wanted to delve into programming for Androids.  What language should i use?  or what development program.?  also, does this language translate to coding pretty well if i wanted to create the same app for ios.
any commentary would be greatly appreciated
0
As all "great" projects start, my wife asked me to build an app for their small teacher organisation. I'm new to development of IOS, but have worked in java, so I've made progress in getting up to speed with Swift and building up the framework of the app and getting it operational.

However, it dawned on me that I don't have an understanding of do's and don'ts when building a secure app. The books I've read focused on the UI more than the data itself. With the current project, I don't have risk that I need to worry about. But would like to use this app as a ginnie pig.  I'd like to know what are things I should be doing or adding into a iOS app to ensure it's secure and protected. I am not asking from a UI Pov (Apples KB documents provided me with that), but more on the lines of protecting the data if I was sending secure data from the app to a cloud DB (I.e. Firebase) or storing user profile or credentials in the apple "Core Data".
0
Hi

I received a $0.99 bill for iCloud today. I was infuriated! I got it for me and my mom's massive web-space needs

Nah, I just need to know how to turn billing off. It wasn't in App Store. ?

Thanks
0
I have a swift 3 app that uses Alamofire to connect to a web service and get data.  All working but once I am done with the data (inserted into Core Data) and exit the Alamofire closure, the memory held by the variable holding the data is not released.  See code below:  The json variable below will hold to 25MB of memory.  The JSON type is Freddy JSON.  How do i identify why this memory is not being released

            Alamofire.request("\(URLServer().ipUrl)\(urlMethodWithParameters!)") .responseJSON  {
                (response) -> Void in
                
                if response.result.isSuccess {
                    do{
                        let json =  try JSON(data: response.data!)
                        
                        print("JSON retrieval success!")
                        self.processCustomerSyncData(json)
                        CustomersAssociationsSync().performCustomerAssociationsDataSync()
                    }catch{
                        print("error")
                        let netWorkError = AppDelegate.sharedInstance().progressViewController
                        SyncherBase.synchError(sender: netWorkError!)
                    }
                }else if response.result.isFailure {
                    print("User authentication failed!")
                    let netWorkError = AppDelegate.sharedInstance().progressViewController
                    SyncherBase.synchError(sender: netWorkError!)
                }
                
 

Open in new window

0
So I am going to write an app in swift for iPhone.  It is going to have a lot of multimedia, many gigs that will be written to it.
Right now I am thinking of storing the data as files, and syncing them to the cloud.  But what about using  DB?  can a DB handle large multimedia files?  Should I?
I have never written an app before, so any general direction before I start to avoid long term issues would be appreciated.
0
When working with reverse geocoding some address could be ambiguous for given location and the returned array of placemarks can contain multiple values (address gets multiple hits). This happens very rarely. Usually practice is to take first or last object from given array. So, I want to know why is this common practice. I've looked in Apple documentation and they also took object at index 0. Does the first object contains the most accurate address if the array of placemarks contains more than one object for given location (lat, long)? Thanks for your answers.
0
I m looking for somethg to post in our corporate IT security 'current banking breaches events': last one I  wrote was the Bangladesh banks Swift funds theft in Feb.  Think last May  another bank fell victim to a Swift funds fraud too.

Any other banking breaches to share n watch out for?
0
I am creating an iOS app in Swift. I have a table view with two cells, and want to navigate to another view controller when the user clicks on one of the cells. In storyboard, to create a new segue, I control + dragged from Prototype Cell to the destination view controller. This automatically created the segue, and everything is working fine.

The problem is that I have two cells in the table (Repeat and Snooze). When the user clicks Repeat, it should take them to the Repeat View Controller, when the user clicks the Snooze cell, it should take them to the Snooze View Controller. So to handle this, in addition to the above mentioned "automatic" segue, I am also manually handling firing of Segue in didSelectRowAtIndexPath().
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        if (indexPath.item == 0)
        {
            performSegueWithIdentifier("repeatDaysSegue", sender: indexPath.item)
        }
        else if (indexPath.item == 1)
        {
            performSegueWithIdentifier("snoozeSegue", sender: indexPath.item)
        }
    }

Open in new window

It seems to be working OK, but now when the user clicks on the Repeat cell, you can see two Segues happen in the UI. Also, prepareForSegue() gets fired twice. First time the sender is a UITableViewCell, second time sender is Int.

The class code is below, what am I doing wrong?

class AddEditAlarmViewController: UIViewController, UITableViewDelegate, 

Open in new window

0
I am fairly new to iOS programming in Swift and have been unable to figure out how to set simple scene transitions. I have created a segue from a button on one scene to another but the transition is (by default) the scene loading in coming up from the bottom of the screen. I would like to set it to have the scene loading in coming from the right side of the screen to the left. How do I do this? I have found a few other answers to this question but they all seem to be from Swift 1 or Objective C and no longer work in Xcode 7 or Swift 2.
0
On Demand Webinar: Networking for the Cloud Era
LVL 10
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

I have an app that is loading a JSON file from a remote server, it parses the JSON and add the records to various arrays, this piece is working just fine.  However, I cannot get the tableview to reload the data.

I'm pretty sure I need to use a dispatch at some point but I'm not sure where the following code should go, or even if it's correct?

   
dispatch_async(dispatch_get_main_queue(), { () -> Void in
      self.tableView.reloadData()
    })

Open in new window


Here is the code where I am loading the JSON:

func getData(){
    // Retrieve the JSON file and parse into the tableview
    let filePath = <my URL here>
    let requestURL: NSURL = NSURL(string: filePath)!
    let urlRequest: NSMutableURLRequest = NSMutableURLRequest(URL: requestURL)
    let session = NSURLSession.sharedSession()
    let task = session.dataTaskWithRequest(urlRequest) {
      (data, response, error) -> Void in
      
      let httpResponse = response as! NSHTTPURLResponse
      let statusCode = httpResponse.statusCode
      
      if (statusCode == 200) {
        print("File downloaded successfully.")
        
        do{
          let json = try NSJSONSerialization.JSONObjectWithData(data!, options:.AllowFragments)
          
          if let requests = json["requests"] as? [[String: AnyObject]] {
            for request in requests{
              let customer = request["CustomerName"] as! String
              let theRequest = request["Request"] as! String
              let formName = 

Open in new window

0
Hi, I'm looking for a video tutorial series for Cocoa and Swift 2. I've searched high and low, but none that are current with Xcode 7.x and Swift 2. I've found a couple that are great, but most are Xcode 6 and Objective-C or iOS with Swift 1, but my question is specific - Xcode 7.x and Swift 2.

Does anyone have a link to a good tutorial series that meets those requirements?

Yes...I know that iOS is very similar to Cocoa, but I'd really like to find a tutorial set for Cocoa and not iOS.

Thanks,
Fulano
0
I'm researching the feasibility of creating a basic spreadsheet app, to run on iPad, that will connect with an online SQL Server database.

Or ... if anyone knows of an online spreadsheet that can be programmed to connect as above?
Can Google spreadsheets?

Thanks
0
I want to dive into mobile app development as I have had a handful of clients demand this from me. As a systems administrator, I want to journey into development work seen that it is interesting and lucrative. However, I find myself stuck figuring out how to hit the ground running.

For example, I am really interest in Swift, but this limits me to iOS development only. However, I did find the Xamarin cross-platform UI to be intuitive. Yet, after reading the negatives in the article below, I am not all that convinced to rely on it for 100% of the time.

http://willowtreeapps.com/blog/xamarin-vs-native-app-development/

I figured if I learned C# I can take on a plethora of different projects and even Android if I use Xamarin. However, right now the clients are demanding mobile apps in iOS - nothing that seems too complicated basically a library manual with lots of data in it. They said i should learn in iOS and recommend I use Swift. Then again, they are clients and don't know much about development in general.


Anyhow, as a sysadmin about to dive into mobile development, what is your take on me learning C# and building iOS apps with Xamarin vs learning Swift to satisfy my good paying clients. I am on the fence and know C# is high level and will benefit me in the long run..

..But am wondering if i should simply learn both.  I have 2-3 months to become knowledgeable enough to build this app. Which again doesn't seem too difficult - simply lots of data from a big …
0
For case study & to enhance our own organization's fraud prevention,

a) what are the flaws & gaps/lapses that have resulted in the huge losses of
    Bangladesh bank in the SWIFT transfer

b) what measures / improvments could have been taken to prevent it?
0
Hello,
I do have a source code received from a programmer for an IOS app i am searching to see what service and pem is been used for APSN to see if it is correct in our server as the programmer seems not responding anymore where i could look and what could be useful to share as folders files to get more helps.
Thanks.
0

Swift Programming

Swift is a compiled programming language created for iOS, OS X, watchOS, tvOS and Linux development by Apple Inc. Swift is designed to work with Apple's Cocoa and Cocoa Touch frameworks and the large body of existing Objective-C code written for Apple products. Swift is intended to be more resilient to erroneous code ("safer") than Objective-C and also more concise. It is built with the LLVM compiler framework included in Xcode 6 and later and uses the Objective-C runtime, which allows C, Objective-C, C++ and Swift code to run within a single program. A second free implementation of Swift targets Microsoft's Common Language Infrastructure (a.k.a. .NET) and the Java/Android platform.

Top Experts In
Swift Programming
<
Monthly
>